setup move list function

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 3d383dfedd
commit 96a2254bfa
  1. BIN
      C++ProjectTemplate
  2. 20
      main.cpp

Binary file not shown.

@ -222,6 +222,11 @@ enum class Property{
DEFENSE_UP, DEFENSE_UP,
}; };
enum class BattleMoveName{
TESTMOVE1,
TESTMOVE2,
TESTMOVE3,
};
namespace Battle{ namespace Battle{
class Move{ class Move{
@ -232,6 +237,7 @@ namespace Battle{
int randomDmg; //Additional random roll damage to add onto the base damage. int randomDmg; //Additional random roll damage to add onto the base damage.
bool pctDamage; //Uses % damage for the base damage instead of flat damage. bool pctDamage; //Uses % damage for the base damage instead of flat damage.
std::vector<std::pair<Property,int>> properties; //The int is used to determine the chance of something occurring. std::vector<std::pair<Property,int>> properties; //The int is used to determine the chance of something occurring.
//Properties order is WET, DRY, COLD, HEAT
Move(std::string name,int baseDmg,int randomDmg,std::array<int,4>composition,bool pctDamage=false,std::vector<std::pair<Property,int>> properties={}) Move(std::string name,int baseDmg,int randomDmg,std::array<int,4>composition,bool pctDamage=false,std::vector<std::pair<Property,int>> properties={})
:name(name),randomDmg(randomDmg),baseDmg(baseDmg),composition(composition),pctDamage(pctDamage),properties(properties){} :name(name),randomDmg(randomDmg),baseDmg(baseDmg),composition(composition),pctDamage(pctDamage),properties(properties){}
}; };
@ -335,6 +341,7 @@ public:
ActionType CurrentAction=ActionType::NONE; ActionType CurrentAction=ActionType::NONE;
double CUTSCENE_FADE_VALUE=0; double CUTSCENE_FADE_VALUE=0;
std::vector<CutsceneAction*>CUTSCENE_QUEUE; std::vector<CutsceneAction*>CUTSCENE_QUEUE;
std::map<BattleMoveName,Battle::Move*>MOVELIST;
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things. bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
@ -361,6 +368,7 @@ public:
EnableLayer(layer::COLLISION,false); EnableLayer(layer::COLLISION,false);
SetupMoveList();
SetupAnimations(); SetupAnimations();
SetupObjectInfo(); SetupObjectInfo();
@ -1158,6 +1166,11 @@ goes on a very long time, I hope you can understand this is only for testing pur
return newObj; return newObj;
} }
void SetupMoveList() {
MOVELIST[BattleMoveName::TESTMOVE1]=new Battle::Move("Test Move 1",30,5,{0,0,0,0});
MOVELIST[BattleMoveName::TESTMOVE2]=new Battle::Move("Test Move 2",40,10,{0,0,0,0});
MOVELIST[BattleMoveName::TESTMOVE3]=new Battle::Move("Test Move 3",25,5,{0,0,20,0});
}
void SetupAnimations() { void SetupAnimations() {
CreateSprite("terrainmap.png"); CreateSprite("terrainmap.png");
@ -1539,10 +1552,9 @@ goes on a very long time, I hope you can understand this is only for testing pur
new Object( new Object(
NPC1_4,"Test Obj",{pos.x+20,pos.y+48},ANIMATIONS["player.png"] NPC1_4,"Test Obj",{pos.x+20,pos.y+48},ANIMATIONS["player.png"]
),70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{ ),70,70,14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
new Battle::Move("Test Move 1",30,5,std::array<int,4>{0,0,0,0}), MOVELIST[BattleMoveName::TESTMOVE1],
new Battle::Move("Test Move 2",30,5,std::array<int,4>{0,0,0,0}), MOVELIST[BattleMoveName::TESTMOVE2],
new Battle::Move("Test Move 3",30,5,std::array<int,4>{0,0,0,0}), MOVELIST[BattleMoveName::TESTMOVE3],
new Battle::Move("Test Move 4",30,5,std::array<int,4>{0,0,0,0}),
} }
)} )}
,chance) ,chance)

Loading…
Cancel
Save