Browse Source

started new evolution methods

SBird1337 7 years ago
parent
commit
93f527bb33

+ 1
- 0
.gitignore View File

@@ -7,3 +7,4 @@ temp
7 7
 *.mid
8 8
 *.a
9 9
 base/*.*
10
+nbproject/private/tools/

+ 1
- 0
main.asm View File

@@ -35,6 +35,7 @@
35 35
 .include "patches/pokemon_data/pokemon_shiny_pal.asm"
36 36
 .include "patches/pokemon_data/pokemon_icons.asm"
37 37
 .include "patches/pokemon_data/pokemon_habitats.asm"
38
+.include "patches/pokemon_data/pokemon_evolution.asm"
38 39
 
39 40
 .include "patches/overworlds/pkm_wild.asm"
40 41
 //.include "patches/dns/core.asm"

+ 16
- 0
nbproject/configurations.xml View File

@@ -20,6 +20,9 @@
20 20
         <df name="overworlds">
21 21
           <in>pkm_wild.asm</in>
22 22
         </df>
23
+        <df name="pokemon_data">
24
+          <in>pokemon_evolution.asm</in>
25
+        </df>
23 26
         <df name="trainer_sprites">
24 27
           <in>trainer_data.asm</in>
25 28
         </df>
@@ -71,6 +74,9 @@
71 74
         <df name="encode">
72 75
           <in>crc32.c</in>
73 76
         </df>
77
+        <df name="evolution">
78
+          <in>evolution_methods.c</in>
79
+        </df>
74 80
         <df name="include">
75 81
           <df name="assets">
76 82
             <df name="mug">
@@ -87,6 +93,7 @@
87 93
             </df>
88 94
             <in>ascii.c</in>
89 95
           </df>
96
+          <in>agb_debug.h</in>
90 97
         </df>
91 98
         <df name="interface">
92 99
           <in>textbox_mugshots.c</in>
@@ -267,6 +274,11 @@
267 274
       </item>
268 275
       <item path="patches/overworlds/pkm_wild.asm" ex="false" tool="4" flavor2="0">
269 276
       </item>
277
+      <item path="patches/pokemon_data/pokemon_evolution.asm"
278
+            ex="false"
279
+            tool="4"
280
+            flavor2="0">
281
+      </item>
270 282
       <item path="patches/trainer_sprites/trainer_data.asm"
271 283
             ex="false"
272 284
             tool="4"
@@ -385,6 +397,10 @@
385 397
         <cTool flags="0">
386 398
         </cTool>
387 399
       </item>
400
+      <item path="src/evolution/evolution_methods.c" ex="false" tool="0" flavor2="0">
401
+      </item>
402
+      <item path="src/include/agb_debug.h" ex="false" tool="3" flavor2="0">
403
+      </item>
388 404
       <item path="src/include/assets/ascii.c" ex="false" tool="0" flavor2="3">
389 405
         <cTool flags="0">
390 406
         </cTool>

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

@@ -5692,6 +5692,8 @@
5692 5692
           </df>
5693 5693
           <df name="encode">
5694 5694
           </df>
5695
+          <df name="evolution">
5696
+          </df>
5695 5697
           <df name="include">
5696 5698
             <df name="assets">
5697 5699
               <df name="mug">
@@ -5829,6 +5831,7 @@
5829 5831
           <in>pokedex_order.asm</in>
5830 5832
           <in>pokemon_back_sprites.asm</in>
5831 5833
           <in>pokemon_egg_moves.asm</in>
5834
+          <in>pokemon_evolution.asm</in>
5832 5835
           <in>pokemon_footprints.asm</in>
5833 5836
           <in>pokemon_front_sprites.asm</in>
5834 5837
           <in>pokemon_habitats.asm</in>
@@ -6623,6 +6626,9 @@
6623 6626
         <df name="encode">
6624 6627
           <in>crc32.c</in>
6625 6628
         </df>
6629
+        <df name="evolution">
6630
+          <in>evolution_methods.c</in>
6631
+        </df>
6626 6632
         <df name="include">
6627 6633
           <df name="assets">
6628 6634
             <df name="interface">
@@ -6656,6 +6662,7 @@
6656 6662
             <in>ascii.c</in>
6657 6663
             <in>ascii.h</in>
6658 6664
           </df>
6665
+          <in>agb_debug.h</in>
6659 6666
           <in>applymovements.h</in>
6660 6667
           <in>attack_names.h</in>
6661 6668
           <in>battle_abilities.h</in>

+ 4
- 0
patches/pokemon_data/pokemon_evolution.asm View File

@@ -0,0 +1,4 @@
1
+.org 0x08042EC4
2
+ldr r7, =evolution_try_evolve+1
3
+bx r7
4
+.pool

+ 52
- 0
src/evolution/evolution_methods.c View File

@@ -0,0 +1,52 @@
1
+/****************************************************************************
2
+ * Copyright (C) 2015-2017 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+
23
+/**
24
+ * @file evolution_methods.c
25
+ * @author Sturmvogel
26
+ * @date 18 apr 2017
27
+ * @brief decide if a pokémon is able to evolve and what the consequences are.
28
+ *
29
+ */
30
+#include <game_engine.h>
31
+#include <pkmn_attributes.h>
32
+#include <agb_debug.h>
33
+
34
+enum evo_source
35
+{
36
+    LEVEL_UP,
37
+    TRADE,
38
+    STONE_EVOLUTION,
39
+    STONE_REQUEST
40
+};
41
+
42
+u16 evolution_try_evolve(struct pokemon* pokemon, enum evo_source source, u16 stoneId)
43
+{
44
+    u16 held_item = pokemon_get_attribute(pokemon, ATTR_HELD_ITEM, NULL);
45
+    u16 species = pokemon_get_attribute(pokemon, ATTR_SPECIES, NULL);
46
+    u16 level = pokemon_get_attribute(pokemon, ATTR_LEVEL, NULL);
47
+    //TODO PID
48
+    dprintf("Species %d tried to evolve.\n", species);
49
+    dprintf("Cause: %d\n", source);
50
+    dprintf("Held Item: %d; Level: %d\nBlocking evolution for debug.", held_item, level);
51
+    return 150;
52
+}

+ 35
- 0
src/include/agb_debug.h View File

@@ -0,0 +1,35 @@
1
+/****************************************************************************
2
+ * Copyright (C) 2015-2017 by the SotS Team                                 *
3
+ *                                                                          *
4
+ * This file is part of Sovereign of the Skies.                             *
5
+ *                                                                          *
6
+ *   Sovereign of the Skies is free software: you can redistribute it       *
7
+ *   and/or modify it                                                       *
8
+ *   under the terms of the GNU Lesser General Public License as published  *
9
+ *   by the Free Software Foundation, either version 3 of the License, or   *
10
+ *   (at your option) any later version provided you include a copy of the  *
11
+ *   licence and this header.                                               *
12
+ *                                                                          *
13
+ *   Sovereign of the Skies is distributed in the hope that it will be      *
14
+ *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of *
15
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
16
+ *   GNU Lesser General Public License for more details.                    *
17
+ *                                                                          *
18
+ *   You should have received a copy of the GNU Lesser General Public       *
19
+ *   License along with Sovereign of the Skies.                             *
20
+ *   If not, see <http://www.gnu.org/licenses/>.                            *
21
+ ****************************************************************************/
22
+/* 
23
+ * File:   agb_debug.h
24
+ * Author: Sturmvogel
25
+ *
26
+ * Created on 18. April 2017, 15:25
27
+ */
28
+
29
+#ifndef AGB_DEBUG_H
30
+#define AGB_DEBUG_H
31
+
32
+void dprintf(const char * str, ...);
33
+
34
+#endif /* AGB_DEBUG_H */
35
+