Browse Source

feint, tailwind, metal burst (new moves)

SBird1337 8 years ago
parent
commit
6d87c6bf98

+ 1
- 0
bpre.sym View File

101
 battle_enigma_berry = 0x02023F54;
101
 battle_enigma_berry = 0x02023F54;
102
 battle_turn_random = 0x02023e80;
102
 battle_turn_random = 0x02023e80;
103
 battle_damage_multiplier = 0x02023FD2;
103
 battle_damage_multiplier = 0x02023FD2;
104
+battle_protect = 0x02023E8C;
104
 side_affecting_halfword = 0x2023DDE;
105
 side_affecting_halfword = 0x2023DDE;
105
 
106
 
106
 item_get_quality = 0x0809A948|1;
107
 item_get_quality = 0x0809A948|1;

+ 4
- 2
data/moves/effect_table.S View File

95
 	.word 0x081D73E7 @86
95
 	.word 0x081D73E7 @86
96
 	.word 0x081D7403 @87
96
 	.word 0x081D7403 @87
97
 	.word 0x081D741B @88
97
 	.word 0x081D741B @88
98
-	.word 0x081D7433 @89
98
+	.word bs_metal_burst_counter @89 COUNTER and METAL_BURST in one script for AI purposes
99
 	.word 0x081D7449 @90
99
 	.word 0x081D7449 @90
100
 	.word 0x081D7465 @91
100
 	.word 0x081D7465 @91
101
 	.word 0x081D749C @92
101
 	.word 0x081D749C @92
221
 	.word 0x081D85FB @212
221
 	.word 0x081D85FB @212
222
 	.word 0x081D865F @213
222
 	.word 0x081D865F @213
223
         .word bs_bride   @214
223
         .word bs_bride   @214
224
-        //.word bs_lower_user_stat @215 lowers the stat of a user, for example hammer arm
224
+        .word bs_tailwind@215
225
+        .word bs_feint   @216
226
+        //.word bs_lower_user_stat @217 lowers the stat of a user, for example hammer arm

+ 8
- 4
data/moves/move_data.S View File

40
 move_data_hornattacke:		.byte	0,			65,		0,		100,		25,		0,		0,		0,		51,		0,		0,		0
40
 move_data_hornattacke:		.byte	0,			65,		0,		100,		25,		0,		0,		0,		51,		0,		0,		0
41
 move_data_furienschlag:		.byte	29,			15,		0,		85,		20,		0,		0,		0,		51,		0,		0,		0
41
 move_data_furienschlag:		.byte	29,			15,		0,		85,		20,		0,		0,		0,		51,		0,		0,		0
42
 move_data_hornbohrer:		.byte	38,			1,		0,		30,		5,		0,		0,		0,		19,		0,		0,		0
42
 move_data_hornbohrer:		.byte	38,			1,		0,		30,		5,		0,		0,		0,		19,		0,		0,		0
43
-move_data_tackle:		.byte	214,			40,		0,		100,		35,		0,		0,		0,		51,		0,		0,		0
43
+move_data_tackle:		.byte	0,			40,		0,		100,		35,		0,		0,		0,		51,		0,		0,		0
44
 move_data_bodyslam:		.byte	6,			85,		0,		100,		15,		30,		0,		0,		19,		0,		0,		0
44
 move_data_bodyslam:		.byte	6,			85,		0,		100,		15,		30,		0,		0,		19,		0,		0,		0
45
 move_data_wickel:		.byte	42,			15,		0,		90,		20,		100,		0,		0,		51,		0,		0,		0
45
 move_data_wickel:		.byte	42,			15,		0,		90,		20,		100,		0,		0,		51,		0,		0,		0
46
 move_data_bodycheck:		.byte	48,			90,		0,		85,		20,		0,		0,		0,		51,		0,		0,		0
46
 move_data_bodycheck:		.byte	48,			90,		0,		85,		20,		0,		0,		0,		51,		0,		0,		0
376
 @TODO HEILOPFER
376
 @TODO HEILOPFER
377
 move_data_heilopfer:		.byte	MOVE_EFFECT_NONE,	0,		14,		0,		10,		0,		16,		0,		0,		0,		2,		0
377
 move_data_heilopfer:		.byte	MOVE_EFFECT_NONE,	0,		14,		0,		10,		0,		16,		0,		0,		0,		2,		0
378
 move_data_lake:                 .byte	214,			65,		11,		100,		10,		0,		0,		0,		50,		0,		1,		0
378
 move_data_lake:                 .byte	214,			65,		11,		100,		10,		0,		0,		0,		50,		0,		1,		0
379
+@TODO BEERENKRAEFTE
379
 move_data_beerenkraefte:	.byte	MOVE_EFFECT_NONE,	1,		0,		100,		15,		0,		0,		0,		18,		0,		0,		0
380
 move_data_beerenkraefte:	.byte	MOVE_EFFECT_NONE,	1,		0,		100,		15,		0,		0,		0,		18,		0,		0,		0
380
-move_data_offenlegung:		.byte	MOVE_EFFECT_NONE,	30,		0,		100,		10,		0,		0,		2,		0,		0,		0,		0
381
+move_data_offenlegung:		.byte	216,            	30,		0,		100,		10,		0,		0,		2,		0,		0,		0,		0
382
+@TODO PFLUECKER
381
 move_data_pfluecker:		.byte	MOVE_EFFECT_NONE,	60,		2,		100,		20,		0,		0,		0,		51,		0,		0,		0
383
 move_data_pfluecker:		.byte	MOVE_EFFECT_NONE,	60,		2,		100,		20,		0,		0,		0,		51,		0,		0,		0
382
-move_data_rueckenwind:		.byte	MOVE_EFFECT_NONE,	0,		2,		0,		15,		0,		16,		0,		4,		0,		2,		0
384
+move_data_rueckenwind:		.byte	215,	0,		2,		0,		15,		0,		16,		0,		4,		0,		2,		0
385
+@TODO AKUPRESSUR
383
 move_data_akupressur:		.byte	214,			0,		0,		0,		30,		0,		16,		0,		4,		0,		2,		0
386
 move_data_akupressur:		.byte	214,			0,		0,		0,		30,		0,		16,		0,		4,		0,		2,		0
384
-move_data_metallstoss:		.byte	MOVE_EFFECT_NONE,	1,		8,		100,		10,		0,		1,		0,		0,		0,		0,		0
387
+move_data_metallstoss:		.byte	89,	1,		8,		100,		10,		0,		1,		0,		0,		0,		0,		0
388
+@TODO KEHRTWENDE
385
 move_data_kehrtwende:		.byte	MOVE_EFFECT_NONE,	70,		6,		100,		20,		0,		0,		0,		51,		0,		0,		0
389
 move_data_kehrtwende:		.byte	MOVE_EFFECT_NONE,	70,		6,		100,		20,		0,		0,		0,		51,		0,		0,		0
386
 move_data_nahkampf:		.byte	MOVE_EFFECT_NONE,	120,		1,		100,		5,		100,		0,		0,		51,		0,		0,		0
390
 move_data_nahkampf:		.byte	MOVE_EFFECT_NONE,	120,		1,		100,		5,		100,		0,		0,		51,		0,		0,		0
387
 move_data_gegenstoss:		.byte	MOVE_EFFECT_NONE,	50,		17,		100,		10,		0,		0,		0,		51,		0,		0,		0
391
 move_data_gegenstoss:		.byte	MOVE_EFFECT_NONE,	50,		17,		100,		10,		0,		0,		0,		51,		0,		0,		0

+ 10
- 7
data/pkmn_tables/pokemon_moveset_table.S View File

1218
 .byte 0x1 
1218
 .byte 0x1 
1219
 .hword 0x2D 
1219
 .hword 0x2D 
1220
 .byte 0x3 
1220
 .byte 0x3 
1221
-.hword MOVE_ROOST 
1221
+.hword MOVE_FEINT 
1222
 .byte 0x7 
1222
 .byte 0x7 
1223
 .hword 0x16 
1223
 .hword 0x16 
1224
 .byte 0x9 
1224
 .byte 0x9 
1764
 
1764
 
1765
 .align 2
1765
 .align 2
1766
 moveset_rattfratz: 
1766
 moveset_rattfratz: 
1767
-.hword 0x27 
1768
-.byte 0x1 
1769
-.hword 0x21 
1770
-.byte 0x1 
1771
-.hword 0x62 
1772
-.byte 0x4 
1767
+
1768
+.hword MOVE_METAL_BURST
1769
+.byte 1
1770
+//.hword 0x27 
1771
+//.byte 0x1 
1772
+//.hword 0x21 
1773
+//.byte 0x1 
1774
+//.hword 0x62 
1775
+//.byte 0x4 
1773
 .hword 0x74 
1776
 .hword 0x74 
1774
 .byte 0x7 
1777
 .byte 0x7 
1775
 .hword 0x2C 
1778
 .hword 0x2C 

+ 33
- 0
nbproject/configurations.xml View File

4662
             <in>fang_animations.S</in>
4662
             <in>fang_animations.S</in>
4663
             <in>fang_effect.S</in>
4663
             <in>fang_effect.S</in>
4664
           </df>
4664
           </df>
4665
+          <df name="feint">
4666
+            <in>feint.c</in>
4667
+            <in>feint_scripts.S</in>
4668
+          </df>
4665
           <df name="hazards">
4669
           <df name="hazards">
4666
             <in>hazards_scripts.S</in>
4670
             <in>hazards_scripts.S</in>
4667
           </df>
4671
           </df>
4672
+          <df name="metal_burst">
4673
+            <in>metal_burst.c</in>
4674
+            <in>metal_burst_script.S</in>
4675
+          </df>
4668
           <df name="power_trick">
4676
           <df name="power_trick">
4669
             <in>power_trick.c</in>
4677
             <in>power_trick.c</in>
4670
             <in>power_trick_script.S</in>
4678
             <in>power_trick_script.S</in>
4673
             <in>roost.c</in>
4681
             <in>roost.c</in>
4674
             <in>roost_scripts.S</in>
4682
             <in>roost_scripts.S</in>
4675
           </df>
4683
           </df>
4684
+          <df name="tailwind">
4685
+            <in>tailwind.c</in>
4686
+            <in>tailwind_scripts.S</in>
4687
+          </df>
4676
         </df>
4688
         </df>
4677
         <df name="music">
4689
         <df name="music">
4678
           <in>main_mixer.S</in>
4690
           <in>main_mixer.S</in>
27349
       </item>
27361
       </item>
27350
       <item path="src/moves/fang_moves/fang_effect.S" ex="false" tool="4" flavor2="0">
27362
       <item path="src/moves/fang_moves/fang_effect.S" ex="false" tool="4" flavor2="0">
27351
       </item>
27363
       </item>
27364
+      <item path="src/moves/feint/feint.c" ex="false" tool="0" flavor2="0">
27365
+      </item>
27366
+      <item path="src/moves/feint/feint_scripts.S" ex="false" tool="4" flavor2="0">
27367
+      </item>
27352
       <item path="src/moves/hazards/hazards_scripts.S"
27368
       <item path="src/moves/hazards/hazards_scripts.S"
27353
             ex="false"
27369
             ex="false"
27354
             tool="4"
27370
             tool="4"
27355
             flavor2="0">
27371
             flavor2="0">
27356
       </item>
27372
       </item>
27373
+      <item path="src/moves/metal_burst/metal_burst.c"
27374
+            ex="false"
27375
+            tool="0"
27376
+            flavor2="0">
27377
+      </item>
27378
+      <item path="src/moves/metal_burst/metal_burst_script.S"
27379
+            ex="false"
27380
+            tool="4"
27381
+            flavor2="0">
27382
+      </item>
27357
       <item path="src/moves/power_trick/power_trick.c"
27383
       <item path="src/moves/power_trick/power_trick.c"
27358
             ex="false"
27384
             ex="false"
27359
             tool="0"
27385
             tool="0"
27368
       </item>
27394
       </item>
27369
       <item path="src/moves/roost/roost_scripts.S" ex="false" tool="4" flavor2="0">
27395
       <item path="src/moves/roost/roost_scripts.S" ex="false" tool="4" flavor2="0">
27370
       </item>
27396
       </item>
27397
+      <item path="src/moves/tailwind/tailwind.c" ex="false" tool="0" flavor2="0">
27398
+      </item>
27399
+      <item path="src/moves/tailwind/tailwind_scripts.S"
27400
+            ex="false"
27401
+            tool="4"
27402
+            flavor2="0">
27403
+      </item>
27371
       <item path="src/music/main_mixer.S" ex="false" tool="4" flavor2="0">
27404
       <item path="src/music/main_mixer.S" ex="false" tool="4" flavor2="0">
27372
       </item>
27405
       </item>
27373
       <item path="src/music/music_override.c" ex="false" tool="0" flavor2="0">
27406
       <item path="src/music/music_override.c" ex="false" tool="0" flavor2="0">

+ 19
- 0
nbproject/private/configurations.xml View File

4053
             </df>
4053
             </df>
4054
             <df name="fang_moves">
4054
             <df name="fang_moves">
4055
             </df>
4055
             </df>
4056
+            <df name="feint">
4057
+            </df>
4056
             <df name="hazards">
4058
             <df name="hazards">
4057
             </df>
4059
             </df>
4060
+            <df name="metal_burst">
4061
+            </df>
4058
             <df name="power_trick">
4062
             <df name="power_trick">
4059
             </df>
4063
             </df>
4060
             <df name="roost">
4064
             <df name="roost">
4061
             </df>
4065
             </df>
4066
+            <df name="tailwind">
4067
+            </df>
4062
           </df>
4068
           </df>
4063
           <df name="music">
4069
           <df name="music">
4064
           </df>
4070
           </df>
5278
               <in>SEQ_BGM_CITY_03.s</in>
5284
               <in>SEQ_BGM_CITY_03.s</in>
5279
               <in>SEQ_BGM_CITY_04.s</in>
5285
               <in>SEQ_BGM_CITY_04.s</in>
5280
               <in>SEQ_BGM_CITY_05.s</in>
5286
               <in>SEQ_BGM_CITY_05.s</in>
5287
+              <in>SEQ_BGM_CITY_06.s</in>
5281
               <in>SEQ_BGM_DEMO_AMER.s</in>
5288
               <in>SEQ_BGM_DEMO_AMER.s</in>
5282
               <in>SEQ_BGM_DEMO_R.s</in>
5289
               <in>SEQ_BGM_DEMO_R.s</in>
5283
               <in>SEQ_BGM_DEMO_RL.s</in>
5290
               <in>SEQ_BGM_DEMO_RL.s</in>
5804
             <in>fang_animations.S</in>
5811
             <in>fang_animations.S</in>
5805
             <in>fang_effect.S</in>
5812
             <in>fang_effect.S</in>
5806
           </df>
5813
           </df>
5814
+          <df name="feint">
5815
+            <in>feint.c</in>
5816
+            <in>feint_scripts.S</in>
5817
+          </df>
5807
           <df name="hazards">
5818
           <df name="hazards">
5808
             <in>hazards_scripts.S</in>
5819
             <in>hazards_scripts.S</in>
5809
           </df>
5820
           </df>
5821
+          <df name="metal_burst">
5822
+            <in>metal_burst.c</in>
5823
+            <in>metal_burst_script.S</in>
5824
+          </df>
5810
           <df name="power_trick">
5825
           <df name="power_trick">
5811
             <in>power_trick.c</in>
5826
             <in>power_trick.c</in>
5812
             <in>power_trick_script.S</in>
5827
             <in>power_trick_script.S</in>
5815
             <in>roost.c</in>
5830
             <in>roost.c</in>
5816
             <in>roost_scripts.S</in>
5831
             <in>roost_scripts.S</in>
5817
           </df>
5832
           </df>
5833
+          <df name="tailwind">
5834
+            <in>tailwind.c</in>
5835
+            <in>tailwind_scripts.S</in>
5836
+          </df>
5818
         </df>
5837
         </df>
5819
         <df name="music">
5838
         <df name="music">
5820
           <in>main_mixer.S</in>
5839
           <in>main_mixer.S</in>

+ 32
- 0
src/include/battle_structs.h View File

31
     struct status_main flags;
31
     struct status_main flags;
32
 };
32
 };
33
 
33
 
34
+struct protect_struct{
35
+    u8 flag0_protect : 1;
36
+    u8 flag0_endure : 1;
37
+    u8 flag0_onlystruggle : 1;
38
+    u8 flag0_helpinghand : 1;
39
+    u8 flag0_bouncemove : 1;
40
+    u8 flag0_stealmove : 1;
41
+    u8 flag0_unknown: 1;
42
+    u8 flag0_prlz_immobility: 1;
43
+    u8 flag1_confusion_self_damage: 1;
44
+    u8 flag1_noteffective: 1;
45
+    u8 flag1_chargingturn: 1; //dive, dig etc.
46
+    u8 flag1_smokeballflee: 1;
47
+    u8 flag1_runaway_flee: 1;
48
+    u8 flag1_used_imprisoned_move: 1;
49
+    u8 flag1_love_immobility: 1;
50
+    u8 flag1_used_disabled_move: 1;
51
+    u8 flag2_used_taunted_move: 1;
52
+    u8 flag2_unknown: 1;
53
+    u8 flag2_flinch_immobility : 1;
54
+    u8 flag2_notfirststrike : 1;
55
+    u8 flag2_free: 4;
56
+    u8 field3;
57
+    u32 physical_damage;
58
+    u32 special_damage;
59
+    u8 counter_target;
60
+    u8 mirrorcoat_target;
61
+    u16 fieldE;
62
+};
63
+
64
+extern struct protect_struct battle_protect[4];
65
+
34
 #define STATUS_SLEEP 0x7
66
 #define STATUS_SLEEP 0x7
35
 #define STATUS_POISON 0x8
67
 #define STATUS_POISON 0x8
36
 #define STATUS_BURN 0x10
68
 #define STATUS_BURN 0x10

+ 41
- 0
src/moves/feint/feint.c View File

1
+#include <battle.h>
2
+
3
+extern void* bs_feint_no_break_ptr;
4
+
5
+u8 break_shields() {
6
+    u8 side = get_side_from_bank(battle_defender_bank);
7
+    u8 effect = false;
8
+    struct bank_affecting* defender_bank = &custom_battle_elements.ptr->bank_affecting[battle_defender_bank];
9
+    struct side_affecting* defender_side = &custom_battle_elements.ptr->side_affecting[get_side_from_bank(battle_defender_bank)];
10
+    if (battle_protect[battle_defender_bank].flag0_protect) {
11
+        effect = true;
12
+        battle_protect[battle_defender_bank].flag0_protect = false;
13
+    }
14
+    if (defender_bank->kings_shield) {
15
+        effect = true;
16
+        defender_bank->kings_shield = false;
17
+    }
18
+    if (defender_bank->spiky_shield) {
19
+        effect = true;
20
+        defender_bank->spiky_shield = false;
21
+    }
22
+    if (defender_side->mat_block) {
23
+        effect = true;
24
+        defender_side->mat_block = false;
25
+    }
26
+    if (defender_side->quick_guard) {
27
+        effect = true;
28
+        defender_side->quick_guard = false;
29
+    }
30
+    if (defender_side->wide_guard) {
31
+        effect = true;
32
+        defender_side->wide_guard = false;
33
+    }
34
+    if (defender_side->crafty_shield) {
35
+        effect = true;
36
+        defender_side->crafty_shield = false;
37
+    }
38
+    if(effect)
39
+        return false;
40
+    battlescript_cursor = bs_feint_no_break_ptr;
41
+}

+ 55
- 0
src/moves/feint/feint_scripts.S View File

1
+#include <battle_script.h>
2
+#include <moves.h>
3
+.align 2
4
+.text
5
+.thumb
6
+
7
+.global bs_feint
8
+bs_feint:
9
+    attackcanceler
10
+    accuracycheck 0x081D695E 0
11
+    attackstring
12
+    ppreduce
13
+    callasm break_shields+1
14
+normal_execute:
15
+    calculatedamage
16
+    attackanimation
17
+    waitanimation
18
+    missmessage
19
+    cmd5c 0x0
20
+    graphicalhpupdate 0
21
+    datahpupdate 0
22
+    critmessage
23
+    waitmessage 0x40
24
+    jumpifhalfword 0x0 0x02023D4A MOVE_FEINT feint_message
25
+    setword STRING_LOADER str_shield_break_normal
26
+    goto after_feint
27
+feint_message:
28
+    setword STRING_LOADER str_shield_break_feint
29
+after_feint:
30
+    printstring 0x184
31
+    waitmessage 0x40
32
+    faintpokemon 0x0 0x0 0x0
33
+    setbyte 0x2023FD8 0x0
34
+    cmd49 0x0 0x0
35
+    end
36
+    
37
+.global bs_feint_no_break
38
+bs_feint_no_break:
39
+    calculatedamage
40
+    attackanimation
41
+    waitanimation
42
+    missmessage
43
+    cmd5c 0x0
44
+    graphicalhpupdate 0
45
+    datahpupdate 0
46
+    critmessage
47
+    waitmessage 0x40
48
+    faintpokemon 0x0 0x0 0x0
49
+    setbyte 0x2023FD8 0x0
50
+    cmd49 0x0 0x0
51
+    end
52
+
53
+.global bs_feint_no_break_ptr
54
+bs_feint_no_break_ptr:
55
+    .word bs_feint_no_break

+ 7
- 0
src/moves/metal_burst/metal_burst.c View File

1
+#include <battle.h>
2
+
3
+u8 metal_burst_dmg_reduction()
4
+{
5
+    battle_damage_store = battle_damage_store - (battle_damage_store >> 2);
6
+    return false;
7
+}

+ 29
- 0
src/moves/metal_burst/metal_burst_script.S View File

1
+#include <battle_script.h>
2
+#include <moves.h>
3
+
4
+.align 2
5
+.thumb
6
+.text
7
+
8
+.global bs_metal_burst_counter
9
+bs_metal_burst_counter:
10
+    jumpifhalfword 0x0 0x02023D4A MOVE_COUNTER 0x081D7433
11
+    attackcanceler
12
+    counterdamagecalculator try_mirror_coat
13
+    accuracycheck 0x81D695E 0x0
14
+    attackstring
15
+    ppreduce
16
+    damagecalc2
17
+    cmd69
18
+    callasm metal_burst_dmg_reduction+1
19
+    goto 0x81D6934
20
+
21
+try_mirror_coat:
22
+    mirrorcoatdamagecalculator 0x081D7DF0
23
+    accuracycheck 0x81D695E 0x0
24
+    attackstring
25
+    ppreduce
26
+    damagecalc2
27
+    cmd69
28
+    callasm metal_burst_dmg_reduction+1
29
+    goto 0x81D6934

+ 16
- 0
src/moves/tailwind/tailwind.c View File

1
+#include <battle.h>
2
+
3
+extern void* bs_tailwind_failed_ptr;
4
+
5
+u8 set_tailwind()
6
+{
7
+    struct side_affecting* current_side = &custom_battle_elements.ptr->side_affecting[get_side_from_bank(battle_attacker_bank)];
8
+    if(!current_side->tailwind)
9
+    {
10
+        current_side->tailwind = 5;
11
+        current_side->tailwind_bank = battle_attacker_bank;
12
+        return false;
13
+    }
14
+    battlescript_cursor = (void*)(0x081D7DF0);
15
+    return true;
16
+}

+ 20
- 0
src/moves/tailwind/tailwind_scripts.S View File

1
+#include <battle_script.h>
2
+
3
+.align 2
4
+.thumb
5
+.text
6
+
7
+.global bs_tailwind
8
+bs_tailwind:
9
+    attackcanceler
10
+    callasm set_tailwind+1
11
+    attackstring
12
+    ppreduce
13
+    attackanimation
14
+    waitanimation
15
+    setword STRING_LOADER str_tailwind
16
+    printstring 0x184
17
+    waitmessage 0x40
18
+    goto 0x081D694E
19
+
20
+

+ 2
- 0
string/de/shield_break.txt View File

1
+str_shield_break_normal=Schilde gebrochen und so.
2
+str_shield_break_feint=Offenlegung und so.

+ 1
- 0
string/de/tailwind.txt View File

1
+str_tailwind=Die Pokémon, die auf deiner Seite\nkämpfen, erhalten Rückenwind!