Browse Source

started new evolution methods

SBird1337 7 years ago
parent
commit
93f527bb33

+ 1
- 0
.gitignore View File

7
 *.mid
7
 *.mid
8
 *.a
8
 *.a
9
 base/*.*
9
 base/*.*
10
+nbproject/private/tools/

+ 1
- 0
main.asm View File

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

+ 16
- 0
nbproject/configurations.xml View File

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

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

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

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

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

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

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

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
+