Browse Source

added close combat

SBird1337 8 years ago
parent
commit
5b45cb9e50

+ 1
- 1
data/moves/animation_table.S View File

@@ -374,7 +374,7 @@ m_animation_table:
374 374
 .word 0x081C6F34 @367
375 375
 .word as_metal_burst @368
376 376
 .word as_uturn @369
377
-.word 0x081C6F34 @370
377
+.word as_close_combat @370
378 378
 .word 0x081C6F34 @371
379 379
 .word 0x081C6F34 @372
380 380
 .word 0x081C6F34 @373

+ 1
- 1
data/moves/effect_table.S View File

@@ -223,4 +223,4 @@ m_effect_table:
223 223
         .word bs_bride   @214
224 224
         .word bs_tailwind@215
225 225
         .word bs_feint   @216
226
-        //.word bs_lower_user_stat @217 lowers the stat of a user, for example hammer arm
226
+        .word bs_close_combat @217

+ 2
- 2
data/moves/move_data.S View File

@@ -385,9 +385,9 @@ move_data_rueckenwind:		.byte	215,                    0,		2,		0,		15,		0,		16,
385 385
 @TODO AKUPRESSUR
386 386
 move_data_akupressur:		.byte	214,			0,		0,		0,		30,		0,		16,		0,		4,		0,		2,		0
387 387
 move_data_metallstoss:		.byte	89,                     1,		8,		100,		10,		0,		1,		0,		0,		0,		0,		0
388
-@TODO KEHRTWENDE
389 388
 move_data_kehrtwende:		.byte	127,            	70,		6,		100,		20,		0,		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
389
+
390
+move_data_nahkampf:		.byte	217,            	120,		1,		100,		5,		100,		0,		0,		51,		0,		0,		0
391 391
 move_data_gegenstoss:		.byte	MOVE_EFFECT_NONE,	50,		17,		100,		10,		0,		0,		0,		51,		0,		0,		0
392 392
 move_data_gewissheit:		.byte	215,			60,		17,		100,		10,		0,		0,		0,		51,		0,		0,		0
393 393
 move_data_itemsperre:		.byte	MOVE_EFFECT_NONE,	0,		17,		100,		15,		0,		0,		0,		26,		0,		2,		0

+ 1
- 1
data/pkmn_tables/pokemon_moveset_table.S View File

@@ -1218,7 +1218,7 @@ moveset_bisasam:
1218 1218
 .byte 0x1 
1219 1219
 .hword 0x2D 
1220 1220
 .byte 0x3 
1221
-.hword MOVE_UTURN 
1221
+.hword MOVE_CLOSE_COMBAT 
1222 1222
 .byte 0x7 
1223 1223
 .hword 0x16 
1224 1224
 .byte 0x9 

+ 14
- 0
nbproject/configurations.xml View File

@@ -4658,6 +4658,10 @@
4658 4658
             <in>bride.c</in>
4659 4659
             <in>bride_scripts.S</in>
4660 4660
           </df>
4661
+          <df name="close_combat">
4662
+            <in>close_combat.c</in>
4663
+            <in>close_combat_scripts.S</in>
4664
+          </df>
4661 4665
           <df name="fang_moves">
4662 4666
             <in>fang_animations.S</in>
4663 4667
             <in>fang_effect.S</in>
@@ -27357,6 +27361,16 @@
27357 27361
       </item>
27358 27362
       <item path="src/moves/bride/bride_scripts.S" ex="false" tool="4" flavor2="0">
27359 27363
       </item>
27364
+      <item path="src/moves/close_combat/close_combat.c"
27365
+            ex="false"
27366
+            tool="0"
27367
+            flavor2="0">
27368
+      </item>
27369
+      <item path="src/moves/close_combat/close_combat_scripts.S"
27370
+            ex="false"
27371
+            tool="4"
27372
+            flavor2="0">
27373
+      </item>
27360 27374
       <item path="src/moves/fang_moves/fang_animations.S"
27361 27375
             ex="false"
27362 27376
             tool="4"

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

@@ -4051,6 +4051,8 @@
4051 4051
             </df>
4052 4052
             <df name="bride">
4053 4053
             </df>
4054
+            <df name="close_combat">
4055
+            </df>
4054 4056
             <df name="fang_moves">
4055 4057
             </df>
4056 4058
             <df name="feint">
@@ -5809,6 +5811,10 @@
5809 5811
             <in>bride.c</in>
5810 5812
             <in>bride_scripts.S</in>
5811 5813
           </df>
5814
+          <df name="close_combat">
5815
+            <in>close_combat.c</in>
5816
+            <in>close_combat_scripts.S</in>
5817
+          </df>
5812 5818
           <df name="fang_moves">
5813 5819
             <in>fang_animations.S</in>
5814 5820
             <in>fang_effect.S</in>

+ 73
- 9
nbproject/private/private.xml View File

@@ -7,28 +7,92 @@
7 7
         <activeConfTypeElem>0</activeConfTypeElem>
8 8
         <activeConfIndexElem>0</activeConfIndexElem>
9 9
     </data>
10
-    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
10
+    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1">
11
+        <file>
12
+            <url>data/moves/move_data.S</url>
13
+            <bookmark id="1">
14
+                <name/>
15
+                <line>8</line>
16
+                <key/>
17
+            </bookmark>
18
+        </file>
19
+    </editor-bookmarks>
11 20
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
12 21
         <group>
13
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/split_physical_special.asm</file>
22
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/bpre.h</file>
14 23
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/table.tbl</file>
24
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/battle_end_of_turn_hook.S</file>
15 25
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/main.asm</file>
16
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/item_data.txt</file>
17
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/data/item/item_scripts.S</file>
18
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/dynamic_overworld_hooks.asm</file>
26
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/metal_burst/metal_burst_script.S</file>
27
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/config.h</file>
28
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/roost/roost_scripts.S</file>
29
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/moves.h</file>
30
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/overworld/trainer_run.S</file>
31
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/move_table.asm</file>
32
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/custom_structs_malloc.c</file>
19 33
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/disable_cry_table_blocks.s</file>
34
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/custom_structs_malloc.h</file>
35
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/battle_locations.h</file>
36
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/bride/bride.c</file>
20 37
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/item_effects.h</file>
38
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/entry_hazards.c</file>
39
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/music.asm</file>
40
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/battle_end_of_turn.c</file>
41
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/specials/custom_specials.c</file>
42
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/sprites.makefile</file>
43
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/overworlds/overworld.asm</file>
44
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/data/moves/effect_table.S</file>
45
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/makefile</file>
46
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/overworld/overworld.c</file>
47
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/item_data.txt</file>
48
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/dynamic_overworld_hooks.asm</file>
49
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/battle.h</file>
50
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/moves.asm</file>
51
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/data/pkmn_tables/pokemon_moveset_table.S</file>
52
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/overworld/overworld_hooks.S</file>
53
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/battle_engine/battle_engine.asm</file>
54
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/feint/feint.c</file>
55
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/icons.makefile</file>
21 56
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/items/item_limits.asm</file>
22 57
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/items/tm_fixes.asm</file>
23 58
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/item_descriptions.txt</file>
24
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/hazards.txt</file>
25 59
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/hooks.asm</file>
26
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/music.asm</file>
60
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/battle_switch_in_hook.S</file>
27 61
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/data/item/tm_hm_move_table.S</file>
28
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/move_strings.txt</file>
29 62
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/items/item_routines.asm</file>
63
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/data/moves/animation_table.S</file>
64
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/uturn/u_turn_script.S</file>
65
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/data/item/item_scripts.S</file>
66
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/gfx_build/overworlds/.gitignore</file>
67
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/linker.ld</file>
68
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/tailwind/tailwind_scripts.S</file>
69
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/tailwind/tailwind.c</file>
70
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/overworlds/trainer.asm</file>
71
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/battle_engine/bs_table.S</file>
72
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/battle_structs.h</file>
73
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/battle_initiative.c</file>
74
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/special.asm</file>
75
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/custom_structs.h</file>
76
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/metal_burst/metal_burst.c</file>
77
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/hazards.txt</file>
78
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/custom_structs_malloc_hook.S</file>
79
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/battle_test.c</file>
80
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/assets.makefile</file>
81
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/bride/bride_scripts.S</file>
82
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/feint/feint_scripts.S</file>
30 83
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/items/item_tables.asm</file>
31
-            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/makefile</file>
84
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/gfx_build/sprites/back_sprites/.gitignore</file>
85
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/split_physical_special.asm</file>
86
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/battle_engine/malloc.asm</file>
87
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/tailwind.txt</file>
88
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/bpre.sym</file>
89
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/roost/roost.c</file>
90
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/moves/hazards/hazards_scripts.S</file>
91
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/battle_script.h</file>
92
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/battle_engine/entry_hazards_hook.S</file>
93
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/data/moves/move_data.S</file>
94
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/string/de/move_strings.txt</file>
95
+            <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/src/include/battle_abilities.h</file>
32 96
             <file>file:/C:/cygwin64/home/auerp/sots/source_of_the_sovereign/patches/items/items.asm</file>
33 97
         </group>
34 98
     </open-files>

+ 27
- 0
src/moves/close_combat/close_combat.c View File

@@ -0,0 +1,27 @@
1
+#include <battle.h>
2
+
3
+extern void* bs_cc_lower_def;
4
+extern void* bs_cc_lower_sdef;
5
+extern void* bs_cc_lower_both;
6
+
7
+u8 close_combat_choose_script() {
8
+    if (battle_participants[battle_attacker_bank].def_buff == 0) {
9
+        if (battle_participants[battle_attacker_bank].sp_def_buff == 0)
10
+        {
11
+            battlescript_cursor = (void*) (0x081D694E);
12
+            return true;
13
+        }
14
+        else
15
+        {
16
+            battlescript_cursor = bs_cc_lower_sdef;
17
+            return true;
18
+        }
19
+    } else if (battle_participants[battle_attacker_bank].sp_def_buff == 0) {
20
+        battlescript_cursor = bs_cc_lower_def;
21
+        return true;
22
+    } else {
23
+        battlescript_cursor = bs_cc_lower_both;
24
+        return true;
25
+    }
26
+    return false;
27
+}

+ 90
- 0
src/moves/close_combat/close_combat_scripts.S View File

@@ -0,0 +1,90 @@
1
+#include <battle_script.h>
2
+
3
+.align 2
4
+.thumb
5
+.text
6
+
7
+.global bs_close_combat
8
+bs_close_combat:
9
+    attackcanceler
10
+    accuracycheck 0x081D695E 0
11
+    attackstring
12
+    ppreduce
13
+    calculatedamage
14
+    attackanimation
15
+    waitanimation
16
+    missmessage
17
+    cmd5c 0
18
+    waitstate
19
+    graphicalhpupdate 0
20
+    datahpupdate 0
21
+    critmessage
22
+    waitmessage 0x40
23
+    resultmessage
24
+    waitmessage 0x40
25
+    faintpokemon 0 0 0
26
+    callasm close_combat_choose_script+1
27
+
28
+bs_lower_def:
29
+    setbyte 0x02023FDF 0
30
+    playstatchangeanimation 1 0x20 1
31
+    setbyte 0x02023FDE 0x95
32
+    statbuffchange 0x41 0x081D694E
33
+    jumpifbyte 0 0x02023FDE 0x2 0x081D694E
34
+    printfromtable 0x083FE588
35
+    waitmessage 0x40
36
+    goto 0x081D694E
37
+
38
+bs_lower_sdef:
39
+    setbyte 0x2023FDF 0x0
40
+    playstatchangeanimation 0x1 0x4 0x1
41
+    setbyte 0x2023FDE 0x92
42
+    statbuffchange 0x41 0x081D694E
43
+    jumpifbyte 0x0 0x02023FDE 0x2 0x081D694E
44
+    printfromtable 0x83FE588
45
+    waitmessage 0x40
46
+    goto 0x081D694E
47
+
48
+bs_lower_both:
49
+    setbyte 0x2023FDF 0x0
50
+    playstatchangeanimation 0x1 0x24 0x1
51
+    setbyte 0x2023FDE 0x92
52
+    statbuffchange 0x41 0x081D694E
53
+    jumpifbyte 0x0 0x02023FDE 0x2 0x081D694E
54
+    printfromtable 0x83FE588
55
+    waitmessage 0x40
56
+    setbyte 0x2023FDE 0x95
57
+    statbuffchange 0x41 0x081D694E
58
+    jumpifbyte 0x0 0x02023FDE 0x2 0x081D694E
59
+    printfromtable 0x83FE588
60
+    waitmessage 0x40
61
+    goto 0x081D694E
62
+
63
+.global bs_cc_lower_def
64
+bs_cc_lower_def:
65
+    .word bs_lower_def
66
+
67
+.global bs_cc_lower_sdef
68
+bs_cc_lower_sdef:
69
+    .word bs_lower_sdef
70
+
71
+.global bs_cc_lower_both
72
+bs_cc_lower_both:
73
+    .word bs_lower_both
74
+
75
+.global as_close_combat
76
+as_close_combat:
77
+    .byte 0x14, 0x09, 0x17, 0x03, 0x2D, 0xB8, 0x0B, 0x08, 0x05, 0x04, 0x00, 0xF7, 0x00, 0x00, 0x01, 0x00
78
+    .byte 0xFF, 0xFF, 0x00, 0x97, 0x27, 0x00, 0x9F, 0x27, 0x0A, 0x03, 0x0C, 0x0C, 0x08, 0x03, 0x7D, 0x90
79
+    .byte 0x09, 0x08, 0x02, 0x05, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x04
80
+    .byte 0x02, 0x08, 0x7C, 0x3E, 0x08, 0x02, 0x04, 0xF1, 0xFF, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19
81
+    .byte 0x74, 0x00, 0x3F, 0x04, 0x01, 0x03, 0xF9, 0x89, 0x09, 0x08, 0x02, 0x05, 0x01, 0x00, 0x05, 0x00
82
+    .byte 0x00, 0x00, 0x19, 0x00, 0x01, 0x00, 0x02, 0x10, 0x67, 0x3E, 0x08, 0x03, 0x05, 0xF1, 0xFF, 0x12
83
+    .byte 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x03, 0x02, 0x08, 0x7C, 0x3E, 0x08, 0x02, 0x04
84
+    .byte 0x00, 0x00, 0xFC, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x19, 0x74, 0x00, 0x3F, 0x04, 0x01, 0x02, 0x10
85
+    .byte 0x67, 0x3E, 0x08, 0x03, 0x05, 0x00, 0x00, 0xFC, 0xFF, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04
86
+    .byte 0x03, 0x02, 0x08, 0x7C, 0x3E, 0x08, 0x02, 0x04, 0x0F, 0x00, 0x09, 0x00, 0x01, 0x00, 0x00, 0x00
87
+    .byte 0x19, 0x74, 0x00, 0x3F, 0x04, 0x01, 0x02, 0x10, 0x67, 0x3E, 0x08, 0x03, 0x05, 0x0F, 0x00, 0x09
88
+    .byte 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x05, 0x02, 0x84, 0x4E, 0x3D, 0x08, 0x02, 0x03
89
+    .byte 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x0B, 0x03, 0x0D, 0x0E, 0xC7, 0x59, 0x1D, 0x08, 0x08
90
+