소스 검색

feint, tailwind, metal burst (new moves)

SBird1337 8 년 전
부모
커밋
6d87c6bf98

+ 1
- 0
bpre.sym 파일 보기

@@ -101,6 +101,7 @@ battle_stuff_ptr = 0x02023FE8;
101 101
 battle_enigma_berry = 0x02023F54;
102 102
 battle_turn_random = 0x02023e80;
103 103
 battle_damage_multiplier = 0x02023FD2;
104
+battle_protect = 0x02023E8C;
104 105
 side_affecting_halfword = 0x2023DDE;
105 106
 
106 107
 item_get_quality = 0x0809A948|1;

+ 4
- 2
data/moves/effect_table.S 파일 보기

@@ -95,7 +95,7 @@ m_effect_table:
95 95
 	.word 0x081D73E7 @86
96 96
 	.word 0x081D7403 @87
97 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 99
 	.word 0x081D7449 @90
100 100
 	.word 0x081D7465 @91
101 101
 	.word 0x081D749C @92
@@ -221,4 +221,6 @@ m_effect_table:
221 221
 	.word 0x081D85FB @212
222 222
 	.word 0x081D865F @213
223 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 파일 보기

@@ -40,7 +40,7 @@ move_data_kopfnuss:		.byte	31,			70,		0,		100,		15,		30,		0,		0,		51,		0,		0,		0
40 40
 move_data_hornattacke:		.byte	0,			65,		0,		100,		25,		0,		0,		0,		51,		0,		0,		0
41 41
 move_data_furienschlag:		.byte	29,			15,		0,		85,		20,		0,		0,		0,		51,		0,		0,		0
42 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 44
 move_data_bodyslam:		.byte	6,			85,		0,		100,		15,		30,		0,		0,		19,		0,		0,		0
45 45
 move_data_wickel:		.byte	42,			15,		0,		90,		20,		100,		0,		0,		51,		0,		0,		0
46 46
 move_data_bodycheck:		.byte	48,			90,		0,		85,		20,		0,		0,		0,		51,		0,		0,		0
@@ -376,12 +376,16 @@ move_data_gyroball:		.byte	MOVE_EFFECT_NONE,	25,		8,		100,		5,		0,		0,		0,		51,
376 376
 @TODO HEILOPFER
377 377
 move_data_heilopfer:		.byte	MOVE_EFFECT_NONE,	0,		14,		0,		10,		0,		16,		0,		0,		0,		2,		0
378 378
 move_data_lake:                 .byte	214,			65,		11,		100,		10,		0,		0,		0,		50,		0,		1,		0
379
+@TODO BEERENKRAEFTE
379 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 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 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 389
 move_data_kehrtwende:		.byte	MOVE_EFFECT_NONE,	70,		6,		100,		20,		0,		0,		0,		51,		0,		0,		0
386 390
 move_data_nahkampf:		.byte	MOVE_EFFECT_NONE,	120,		1,		100,		5,		100,		0,		0,		51,		0,		0,		0
387 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 파일 보기

@@ -1218,7 +1218,7 @@ moveset_bisasam:
1218 1218
 .byte 0x1 
1219 1219
 .hword 0x2D 
1220 1220
 .byte 0x3 
1221
-.hword MOVE_ROOST 
1221
+.hword MOVE_FEINT 
1222 1222
 .byte 0x7 
1223 1223
 .hword 0x16 
1224 1224
 .byte 0x9 
@@ -1764,12 +1764,15 @@ moveset_tauboss:
1764 1764
 
1765 1765
 .align 2
1766 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 1776
 .hword 0x74 
1774 1777
 .byte 0x7 
1775 1778
 .hword 0x2C 

+ 33
- 0
nbproject/configurations.xml 파일 보기

@@ -4662,9 +4662,17 @@
4662 4662
             <in>fang_animations.S</in>
4663 4663
             <in>fang_effect.S</in>
4664 4664
           </df>
4665
+          <df name="feint">
4666
+            <in>feint.c</in>
4667
+            <in>feint_scripts.S</in>
4668
+          </df>
4665 4669
           <df name="hazards">
4666 4670
             <in>hazards_scripts.S</in>
4667 4671
           </df>
4672
+          <df name="metal_burst">
4673
+            <in>metal_burst.c</in>
4674
+            <in>metal_burst_script.S</in>
4675
+          </df>
4668 4676
           <df name="power_trick">
4669 4677
             <in>power_trick.c</in>
4670 4678
             <in>power_trick_script.S</in>
@@ -4673,6 +4681,10 @@
4673 4681
             <in>roost.c</in>
4674 4682
             <in>roost_scripts.S</in>
4675 4683
           </df>
4684
+          <df name="tailwind">
4685
+            <in>tailwind.c</in>
4686
+            <in>tailwind_scripts.S</in>
4687
+          </df>
4676 4688
         </df>
4677 4689
         <df name="music">
4678 4690
           <in>main_mixer.S</in>
@@ -27349,11 +27361,25 @@
27349 27361
       </item>
27350 27362
       <item path="src/moves/fang_moves/fang_effect.S" ex="false" tool="4" flavor2="0">
27351 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 27368
       <item path="src/moves/hazards/hazards_scripts.S"
27353 27369
             ex="false"
27354 27370
             tool="4"
27355 27371
             flavor2="0">
27356 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 27383
       <item path="src/moves/power_trick/power_trick.c"
27358 27384
             ex="false"
27359 27385
             tool="0"
@@ -27368,6 +27394,13 @@
27368 27394
       </item>
27369 27395
       <item path="src/moves/roost/roost_scripts.S" ex="false" tool="4" flavor2="0">
27370 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 27404
       <item path="src/music/main_mixer.S" ex="false" tool="4" flavor2="0">
27372 27405
       </item>
27373 27406
       <item path="src/music/music_override.c" ex="false" tool="0" flavor2="0">

+ 19
- 0
nbproject/private/configurations.xml 파일 보기

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

+ 32
- 0
src/include/battle_structs.h 파일 보기

@@ -31,6 +31,38 @@ union main_status{
31 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 66
 #define STATUS_SLEEP 0x7
35 67
 #define STATUS_POISON 0x8
36 68
 #define STATUS_BURN 0x10

+ 41
- 0
src/moves/feint/feint.c 파일 보기

@@ -0,0 +1,41 @@
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 파일 보기

@@ -0,0 +1,55 @@
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 파일 보기

@@ -0,0 +1,7 @@
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 파일 보기

@@ -0,0 +1,29 @@
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 파일 보기

@@ -0,0 +1,16 @@
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 파일 보기

@@ -0,0 +1,20 @@
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 파일 보기

@@ -0,0 +1,2 @@
1
+str_shield_break_normal=Schilde gebrochen und so.
2
+str_shield_break_feint=Offenlegung und so.

+ 1
- 0
string/de/tailwind.txt 파일 보기

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