Skip to content

Commit

Permalink
Did some work on monsters
Browse files Browse the repository at this point in the history
  • Loading branch information
Fontbane committed Mar 8, 2022
1 parent 045b644 commit 975309e
Show file tree
Hide file tree
Showing 19 changed files with 410 additions and 26 deletions.
54 changes: 54 additions & 0 deletions config/base_stats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"sappurr" : {
"species" : 1,
"hp" : 48,
"attack" : 60,
"defense" : 50,
"m_attack" : 40,
"m_defense" : 42,
"agility" : 72,
"type1" : "grass",
"gender_param" : 31
},
"pyruff" : {
"species" : 4,
"hp" : 50,
"attack" : 62,
"defense" : 50,
"m_attack" : 45,
"m_defense" : 45,
"agility" : 60,
"type1" : "fire",
"gender_param" : 31
},
"squoink" : {
"species" : 7,
"hp" : 60,
"attack" : 50,
"defense" : 48,
"m_attack" : 58,
"m_defense" : 46,
"agility" : 50,
"type1" : "water",
"height" : 4,
"weight" : 600,
"gender_param" : 31,
"sprite" : "images/battlers/squoink/front.png",
"shiny_palette":"images/battlers/squoink/shiny.pal"
},
"egglet" : {
"species" : 10,
"hp" : 52,
"attack" : 60,
"defense" : 45,
"m_attack" : 48,
"m_defense" : 45,
"agility" : 62,
"type1" : "air",
"height" : 4,
"weight" : 600,
"gender_param" : 31,
"sprite" : "images/battlers/egglet/front.png",
"shiny_palette":"images/battlers/egglet/shiny.pal"
}
}
101 changes: 101 additions & 0 deletions config/items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"nugget":
{
"id": 1,
"pocket": "treasure",
"price": 500
},
"protein powder":
{
"id":2,
"pocket":"medicine",
"price":400,
"useOnField":true,
"usefunc":"use_raise_tv",
"useArgs":1
},
"calcium tablet":
{
"id":3,
"pocket":"medicine",
"price":400,
"useOnField":true,
"usefunc":"use_raise_tv",
"useArgs":2
},
"mystic powder":
{
"id":4,
"pocket":"medicine",
"price":400,
"useOnField":true,
"usefunc":"use_raise_tv",
"useArgs":3
},
"zinc":
{
"id":5,
"pocket":"medicine",
"price":400,
"useOnField":true,
"usefunc":"use_raise_tv",
"useArgs":4
},
"sugar_packet":
{
"id":6,
"pocket":"medicine",
"price":400,
"useOnField":true,
"usefunc":"use_raise_tv",
"useArgs":5
},
"milk":
{
"id":7,
"pocket":"medicine",
"price":400,
"useOnField":true,
"usefunc":"use_raise_tv",
"useArgs":0
},
"restorade":
{
"id":8,
"pocket":"medicine",
"price":20,
"useOnField":true,
"useInBattle":true,
"usefunc":"use_heal",
"useArgs":20
},
"restorade plus":
{
"id":9,
"pocket":"medicine",
"price":40,
"useOnField":true,
"useInBattle":true,
"usefunc":"use_heal",
"useArgs":50
},
"restorade gold":
{
"id":10,
"pocket":"medicine",
"price":80,
"useOnField":true,
"useInBattle":true,
"usefunc":"use_heal",
"useArgs":100
},
"capsule":
{
"id":11,
"pocket":"capsules",
"price":10,
"useInBattle":true,
"usefunc":"use_capsule",
"useArgs":0
}
}
36 changes: 36 additions & 0 deletions config/species.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"names" :
[
"Sappurr",
"Dracamo",
"Vampiroot",
"Pyruff",
"Flarewolf",
"Lycarson",
"Squoink",
"Woghash",
"Soluboar",
"Egglet",
"Reagle",
"Reagalia",
"Mukchuk",
"Dirtskrt"
],
"sprites" :
[
"images/battlers/sappurr/front.png",
"images/battlers/dracamo/front.png",
"images/battlers/vampiroot/front.png",
"images/battlers/pyruff/front.png",
"images/battlers/flarewolf/front.png",
"images/battlers/lycarson/front.png",
"images/battlers/squoink/front.png",
"images/battlers/woghash/front.png",
"images/battlers/soluboar/front.png",
"images/battlers/egglet/front.png",
"images/battlers/reagle/front.png",
"images/battlers/reagalia/front.png",
"images/battlers/mukchuk/front.png",
"images/battlers/dirtskrt/front.png"
]
}
Binary file added images/backgrounds/bf_plains.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/battlers/Sappurr/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions images/battlers/Sappurr/normal.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0 0
112 112 255 255
20 42 4 255
72 104 49 255
46 40 28 255
113 84 72 255
29 22 12 255
85 64 55 255
118 165 84 255
38 61 19 255
48 41 31 255
160 129 93 255
193 174 136 255
165 43 43 255
99 23 23 255
59 51 40 255
19 changes: 19 additions & 0 deletions images/battlers/Sappurr/shiny.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0 0
112 112 255 255
78 37 7 255
177 92 31 255
45 23 28 255
148 110 44 255
29 22 12 255
111 92 37 255
189 128 83 255
128 69 43 255
48 31 36 255
75 115 65 255
169 197 149 255
107 43 165 255
71 23 99 255
74 66 26 255
Binary file added images/battlers/Squoink/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 21 additions & 5 deletions include/k_battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
#include "k_entity.h"
#include "k_monster.h"



typedef struct {
u16 id;
u8 tamerClass;
MonDict* party;
MonDict party[6];
} Tamer;

struct AITamer {
Expand All @@ -18,13 +16,21 @@ struct AITamer {
u8 aiFlags;
}AITamer;

typedef struct BattleRender {
Sprite* bg;
Sprite* participants[4];
Sprite* tamers[4];
}BattleRender;

typedef struct {
u8 fieldsize;
u8 fieldtype;
u8 battleType;
MonDict* participants;
Tamer* tamers;
u8 numMons;
MonDict* participants[4];
Tamer tamers[4];
u8 turnCount;
BattleRender render;
} Battle;

Battle gBattle;
Expand All @@ -36,6 +42,14 @@ Battle gBattle;
#define BATTLE_TYPE_RIVAL 4
#define BATTLE_TYPE_RARE 5

enum {
FIELD_PLAINS,
FIELD_BUILDING,
FIELD_MAX
};

char* battlefieldbgs[FIELD_MAX];

typedef struct BattlefieldState {
u16 flags;
MonDict* participants;
Expand Down Expand Up @@ -68,4 +82,6 @@ u16 CalculateDamage(MonDict attacker, MonDict target, u16 techID, u8 dist);
*/
void CalculateAttack(MonDict attacker, MonDict target, u16 techID, u16* atk, u16* def);

void RenderBattlefield();

#endif // !__K_BATTLE_H__
6 changes: 6 additions & 0 deletions include/k_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ typedef enum Direction{
DIR_E
}Direction;

typedef enum GameState {
GAMESTATE_MENU,
GAMESTATE_FIELD,
GAMESTATE_BATTLE
}GameState;

#define ACTION_NONE 0X00
#define ACTION_MOVE 0X01
#define ACTION_TECH 0X02
Expand Down
5 changes: 5 additions & 0 deletions include/k_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ typedef struct ITEM_S {
Pocket pocket;
Fruit crop;
CropType cropType;
u16 price;//times 10
u8 useOnField : 1;
u8 useInBattle : 1;
void(*Use)(u16 args);
}Item;

void GiveItem(u16 id);
Item GetItemFromJson(u16 id);

#endif // !__K_ITEM_H__
Empty file added include/k_menu.h
Empty file.
Loading

0 comments on commit 975309e

Please sign in to comment.