Browse Source

added power trick

SBird1337 8 years ago
parent
commit
bd7c13d5f7

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

4
 
4
 
5
 .global m_effect_table
5
 .global m_effect_table
6
 m_effect_table:
6
 m_effect_table:
7
-	.word 0x081D6900 @0
7
+	.word bs_power_trick    @for testing
8
+        @.word 0x081D6900 @0
8
 	.word 0x081D696D @1
9
 	.word 0x081D696D @1
9
 	.word 0x081D69DC @2
10
 	.word 0x081D69DC @2
10
 	.word 0x081D69E7 @3
11
 	.word 0x081D69E7 @3

+ 24
- 0
nbproject/configurations.xml View File

4634
           <df name="hazards">
4634
           <df name="hazards">
4635
             <in>hazards_scripts.S</in>
4635
             <in>hazards_scripts.S</in>
4636
           </df>
4636
           </df>
4637
+          <df name="power_trick">
4638
+            <in>power_trick.c</in>
4639
+            <in>power_trick_script.S</in>
4640
+          </df>
4637
         </df>
4641
         </df>
4638
         <df name="music">
4642
         <df name="music">
4639
           <in>main_mixer.S</in>
4643
           <in>main_mixer.S</in>
4654
           <in>cutscene_meteor.c</in>
4658
           <in>cutscene_meteor.c</in>
4655
         </df>
4659
         </df>
4656
       </df>
4660
       </df>
4661
+      <df name="string">
4662
+        <df name="en">
4663
+          <in>move_strings.txt</in>
4664
+        </df>
4665
+      </df>
4657
       <df name="todo">
4666
       <df name="todo">
4658
         <in>pokemon_evolution.s</in>
4667
         <in>pokemon_evolution.s</in>
4659
         <in>pokemon_habitats.s</in>
4668
         <in>pokemon_habitats.s</in>
4667
       <itemPath>nbproject/private/launcher.properties</itemPath>
4676
       <itemPath>nbproject/private/launcher.properties</itemPath>
4668
       <itemPath>makefile</itemPath>
4677
       <itemPath>makefile</itemPath>
4669
     </logicalFolder>
4678
     </logicalFolder>
4679
+    <itemPath>string/de/move_strings.txt</itemPath>
4670
   </logicalFolder>
4680
   </logicalFolder>
4671
   <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>
4681
   <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>
4672
   <sourceRootList>
4682
   <sourceRootList>
27225
             tool="4"
27235
             tool="4"
27226
             flavor2="0">
27236
             flavor2="0">
27227
       </item>
27237
       </item>
27238
+      <item path="src/moves/power_trick/power_trick.c"
27239
+            ex="false"
27240
+            tool="0"
27241
+            flavor2="0">
27242
+      </item>
27243
+      <item path="src/moves/power_trick/power_trick_script.S"
27244
+            ex="false"
27245
+            tool="4"
27246
+            flavor2="0">
27247
+      </item>
27228
       <item path="src/music/main_mixer.S" ex="false" tool="4" flavor2="0">
27248
       <item path="src/music/main_mixer.S" ex="false" tool="4" flavor2="0">
27229
       </item>
27249
       </item>
27230
       <item path="src/music/music_override.c" ex="false" tool="0" flavor2="0">
27250
       <item path="src/music/music_override.c" ex="false" tool="0" flavor2="0">
27248
       </item>
27268
       </item>
27249
       <item path="src/specials/cutscene_meteor.c" ex="false" tool="0" flavor2="0">
27269
       <item path="src/specials/cutscene_meteor.c" ex="false" tool="0" flavor2="0">
27250
       </item>
27270
       </item>
27271
+      <item path="string/de/move_strings.txt" ex="false" tool="3" flavor2="0">
27272
+      </item>
27273
+      <item path="string/en/move_strings.txt" ex="false" tool="3" flavor2="0">
27274
+      </item>
27251
       <item path="todo/pokemon_evolution.s" ex="false" tool="4" flavor2="0">
27275
       <item path="todo/pokemon_evolution.s" ex="false" tool="4" flavor2="0">
27252
       </item>
27276
       </item>
27253
       <item path="todo/pokemon_habitats.s" ex="false" tool="4" flavor2="0">
27277
       <item path="todo/pokemon_habitats.s" ex="false" tool="4" flavor2="0">

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

3807
             </df>
3807
             </df>
3808
             <df name="hazards">
3808
             <df name="hazards">
3809
             </df>
3809
             </df>
3810
+            <df name="power_trick">
3811
+            </df>
3810
           </df>
3812
           </df>
3811
           <df name="music">
3813
           <df name="music">
3812
           </df>
3814
           </df>
4793
           <df name="hazards">
4795
           <df name="hazards">
4794
             <in>hazards_scripts.S</in>
4796
             <in>hazards_scripts.S</in>
4795
           </df>
4797
           </df>
4798
+          <df name="power_trick">
4799
+            <in>power_trick.c</in>
4800
+            <in>power_trick_script.S</in>
4801
+          </df>
4796
         </df>
4802
         </df>
4797
         <df name="music">
4803
         <df name="music">
4798
           <in>main_mixer.S</in>
4804
           <in>main_mixer.S</in>
4819
         <df name="de">
4825
         <df name="de">
4820
         </df>
4826
         </df>
4821
         <df name="en">
4827
         <df name="en">
4828
+          <in>move_strings.txt</in>
4822
         </df>
4829
         </df>
4823
       </df>
4830
       </df>
4824
       <df name="todo">
4831
       <df name="todo">
4827
       </df>
4834
       </df>
4828
       <in>main.asm</in>
4835
       <in>main.asm</in>
4829
     </df>
4836
     </df>
4837
+    <itemPath>string/de/move_strings.txt</itemPath>
4830
   </logicalFolder>
4838
   </logicalFolder>
4831
   <projectmakefile>makefile</projectmakefile>
4839
   <projectmakefile>makefile</projectmakefile>
4832
   <confs>
4840
   <confs>

+ 13
- 0
src/moves/power_trick/power_trick.c View File

1
+#include <battle.h>
2
+#include <bpre.h>
3
+
4
+u8 power_trick_swap() 
5
+{
6
+    custom_battle_elements.ptr->bank_affecting[battle_active_bank].powertrick = 1;
7
+    u16 *atk = &battle_participants[battle_active_bank].atk;
8
+    u16 *def = &battle_participants[battle_active_bank].def;
9
+    u16 switch_var = *atk;
10
+    *atk = *def;
11
+    *def = switch_var;
12
+    return 0;
13
+}

+ 18
- 0
src/moves/power_trick/power_trick_script.S View File

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

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

1
+str_power_swap=\hFD\h0F tauscht Angriff und\nVerteidigung!

+ 1
- 0
string/en/move_strings.txt View File

1
+str_power_swap=\hFD\h0F switched its Attack\nand Defense!