diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 39b5cf2..e4e5198 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/SeasonI.h b/SeasonI.h index ac9c9f2..0ed12d9 100644 --- a/SeasonI.h +++ b/SeasonI.h @@ -130,6 +130,8 @@ class SeasonI:public PixelGameEngine{ void ChoiceMade(int choice); void StartCutscene(Cutscene*cutscene); void DrawTriggers(); + void SaveGameSaveData(int saveSlot); + void LoadGameSaveData(int saveSlot); }; extern SeasonI*GAME; #endif \ No newline at end of file diff --git a/battle.h b/battle.h index 7555540..dce4ad1 100644 --- a/battle.h +++ b/battle.h @@ -58,6 +58,7 @@ enum class Resistance{ namespace Battle{ struct Move{ + BattleMoveName id; std::string name=""; std::string desc=""; char grade=0; //If the name of a move name match, then the grade helps sort it into the same category on menus. diff --git a/entity.cpp b/entity.cpp new file mode 100644 index 0000000..22e7415 --- /dev/null +++ b/entity.cpp @@ -0,0 +1,44 @@ +#include "entity.h" +#include "object.h" + +extern std::array PARTY_MEMBER_NAMES; + +std::ostream&operator<<(std::ostream &os,Entity&ent){ + os<< + ent.GetHP()<<" "<< + ent.stats.maxHP<<" "<< + PARTY_MEMBER_NAMES[ent.partyMemberID]<<" "<< + ent.GetPP()<<" "<< + ent.stats.maxPP<<" "<< + ent.stats.baseAtk<<" "<< + ent.stats.speed<<" "<< + ent.stats.resistances.size()<<" "; + for (int i=0;iid<<" "; + } + os<::iterator it=ent.statusEffects.begin();it!=ent.statusEffects.end();++it) { + os<<(int)it->first<<" "<second<<" "; + } + os<id<<" "; + } else { + os<<-1<<" "; + } + } + if (ent.obj!=nullptr) { + os<GetPos().x<<" "<GetPos().y<<" "; + } else { + os<<-999<<" "<<-999<<" "; + } + return os; +} \ No newline at end of file diff --git a/entity.h b/entity.h index 8f64c0d..675df7e 100644 --- a/entity.h +++ b/entity.h @@ -14,14 +14,9 @@ using namespace olc; class Object; -namespace boost{ - enum{ - ATK, - HP, - PP, - SPD - }; -} +struct BoostData{ + int atk=0,hp=0,pp=0,spd=0; +}; class Entity{ @@ -87,11 +82,11 @@ class Entity{ dumb==t.dumb; } //Get the HP that the rolling counter is moving towards. - int GetTargetHP() { + int GetTargetHP(){ return targetHP; } //Gets the current actual health of the target. - int GetHP() { + int GetHP(){ return HP; } //Get the PP that the rolling counter is moving towards. @@ -137,6 +132,7 @@ class Entity{ }; private: pstats_t pstats; + int partyMemberID; public: stats_t stats; int atb=0; //When this value reaches 1000, it's this entity's turn. @@ -152,10 +148,11 @@ class Entity{ int money=0; //Amount of money this entity will drop when defeated. std::array equipment = {nullptr,nullptr,nullptr}; //Equipment this character is using. bool isPlayer=false; //Whether or not this is a player entity. - std::array boosts = {0,0,0,0}; //Values to indicate how much the boosts of each stat ended up being. Order is ATK,HP,PP,SPD. + BoostData boosts = {0,0,0,0}; //Used for initializing players. - Entity(pstats_t stats,std::vectormoveSet,std::vectoritems={},int money=0,std::arrayequipment={}) + Entity(int partyMemberID,pstats_t stats,std::vectormoveSet,std::vectoritems={},int money=0,std::arrayequipment={}) :Entity(nullptr,stats,moveSet,items,money,equipment){ + this->partyMemberID=partyMemberID; isPlayer=true; } //Use this for initializing enemies as it lets you specify an object. @@ -215,6 +212,8 @@ class Entity{ void _SetDirectPP(int pp) { stats._SetDirectPP(pp); } + + friend std::ostream&operator<<(std::ostream &os,Entity&ent); Property GetPrimaryStatusEffect() { for (std::map::iterator it = statusEffects.begin();it!=statusEffects.end();++it) { diff --git a/item.h b/item.h index 112616b..ad6a9d2 100644 --- a/item.h +++ b/item.h @@ -75,14 +75,15 @@ struct CustomItemMessage{ class Item{ public: + ItemName id; std::string name; std::string description; Battle::Move*battlemove=nullptr; ItemStatsStruct stats; int dropChance=8; //1 out of dropChance change of item dropping. std::vector messages; - Item(std::string name,std::string desc,int dropChance=8,ItemStatsStruct stats={hpRecovery:0,ppRecovery:0,atkIncrease:0,spdIncrease:0,hpIncrease:0,ppIncrease:0,learnAbility:nullptr,damage:0,rollDmg:0,attack:0,defense:0,equip:EquipSlot::NONE,important:false,consumable:Consumable::NOT_A_CONSUMABLE},Battle::Move*battlemove=nullptr) - :name(name),description(desc),stats(stats),dropChance(dropChance),battlemove(battlemove){ + Item(ItemName id,std::string name,std::string desc,int dropChance=8,ItemStatsStruct stats={hpRecovery:0,ppRecovery:0,atkIncrease:0,spdIncrease:0,hpIncrease:0,ppIncrease:0,learnAbility:nullptr,damage:0,rollDmg:0,attack:0,defense:0,equip:EquipSlot::NONE,important:false,consumable:Consumable::NOT_A_CONSUMABLE},Battle::Move*battlemove=nullptr) + :id(id),name(name),description(desc),stats(stats),dropChance(dropChance),battlemove(battlemove){ if (stats.hpRecovery) {messages.push_back({"$TARGET recovers "+std::to_string(stats.hpRecovery)+" HP.",ItemAction::HPRECOVERY});} if (stats.ppRecovery) {messages.push_back({"$TARGET recovers "+std::to_string(stats.ppRecovery)+" PP.",ItemAction::PPRECOVERY});} if (stats.atkIncrease) {messages.push_back({"$TARGET gains "+std::to_string(stats.atkIncrease)+" ATK point"+(stats.atkIncrease==1?"":"s")+".",ItemAction::ATKINCREASE});} diff --git a/main.cpp b/main.cpp index 3d48e32..e18f565 100644 --- a/main.cpp +++ b/main.cpp @@ -28,6 +28,9 @@ #include "defines.h" #endif +#define SetupMove(movename) MOVELIST[BattleMoveName::movename]=new Battle::Move{BattleMoveName::movename, +#define SetupItem(itemname) ITEMLIST[ItemName::itemname]=new Item(ItemName::itemname, + using namespace olc; std::vector OBJECTS; @@ -62,7 +65,7 @@ vi2d HIGHLIGHTED_TILE={0,0}; int EDITING_LAYER=layer::DYNAMIC; int SELECTED_OBJ_ID = PLAYER; int OBJ_DISPLAY_OFFSET = 0; -bool GAME_FLAGS[128]={}; +bool GAME_FLAGS[512]={}; std::array PARTY_MEMBER_OBJ={}; std::array PARTY_MEMBER_ID={}; std::array PARTY_MEMBER_STATS={}; @@ -164,6 +167,7 @@ int WORLD_DISPLAY_OFFSET=0; bool SELECTING_A_MAP_FOR_TRIGGER=false; Trigger*LAST_PLACED_TRIGGER=nullptr; Map* ORIGINATING_MAP=nullptr; +std::array PARTY_MEMBER_NAMES={"PLAYER","NESS","PAULA","JEFF","ANNA","KING","POO"}; /* [Choice1,Choice2,Choice3] @@ -310,71 +314,71 @@ bool SeasonI::OnUserCreate(){ #endif void SeasonI::SetupMoveList() { - MOVELIST[BattleMoveName::TESTMOVE1]=new Battle::Move{"Test Move 1","An attack",baseDmg:30,randomDmg:5,range:1,channelTime:0,friendly:false}; - MOVELIST[BattleMoveName::TESTMOVE2]=new Battle::Move{"Test Move 2","An attack",baseDmg:40,randomDmg:10,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0}}; - MOVELIST[BattleMoveName::TESTMOVE3]=new Battle::Move{"Test Move 3","An attack",baseDmg:25,randomDmg:5,PPCost:0,range:3,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::BASH]=new Battle::Move{"Bash","Regular attack.",baseDmg:5,randomDmg:5,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0}}; - MOVELIST[BattleMoveName::BASH_CHANGE]=new Battle::Move{MOVELIST[BattleMoveName::BASH]->name,"Regular attack.",baseDmg:MOVELIST[BattleMoveName::BASH]->baseDmg,randomDmg:MOVELIST[BattleMoveName::BASH]->randomDmg,PPCost:MOVELIST[BattleMoveName::BASH]->PPCost,range:MOVELIST[BattleMoveName::BASH]->range,composition:MOVELIST[BattleMoveName::BASH]->composition,attackMsg:"$USER equipped the $ITEM instead and attacks.",eff:MOVELIST[BattleMoveName::BASH]->eff,pctDamage:MOVELIST[BattleMoveName::BASH]->pctDamage,properties:MOVELIST[BattleMoveName::BASH]->properties}; - MOVELIST[BattleMoveName::DEFEND]=new Battle::Move{"Defend","Defend.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:5*60,friendly:true,{0,0,0,0}}; - MOVELIST[BattleMoveName::EQUIP_ARMOR]=new Battle::Move{"Equip Armor","Equip Armor.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:0,friendly:true,composition:{0,0,0,0},"$USER equips the $ITEM"}; - MOVELIST[BattleMoveName::CONSUMABLE]=new Battle::Move{"Consumable","Consumes an item.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:0,friendly:true,composition:{0,0,0,0},"$USER uses $ITEM on $TARGET"}; - MOVELIST[BattleMoveName::CONSUMABLE_ENEMY]=new Battle::Move{"Consumable","Consumes an item.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0},"$USER uses $ITEM on $TARGET"}; - MOVELIST[BattleMoveName::HAILSTORM_A]=new Battle::Move{"Hailstorm","Causes heavy ice rocks to crash",ALPHA,baseDmg:40,randomDmg:20,PPCost:4,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::HAILSTORM_B]=new Battle::Move{"Hailstorm","Causes heavy ice rocks to crash",BETA,baseDmg:80,randomDmg:20,PPCost:12,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::HAILSTORM_G]=new Battle::Move{"Hailstorm","Causes heavy ice rocks to crash",GAMMA,baseDmg:120,randomDmg:20,PPCost:28,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::HAILSTORM_O]=new Battle::Move{"Hailstorm","Causes heavy ice rocks to crash",OMEGA,baseDmg:210,randomDmg:50,PPCost:69,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::HURRICANE_A]=new Battle::Move{"Hurricane","Scatters seeds, causes heavy rains and winds",ALPHA,baseDmg:25,randomDmg:5,PPCost:7,range:6,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::HURRICANE_B]=new Battle::Move{"Hurricane","Scatters seeds, causes heavy rains and winds",BETA,baseDmg:45,randomDmg:5,PPCost:13,range:6,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::HURRICANE_G]=new Battle::Move{"Hurricane","Scatters seeds, causes heavy rains and winds",GAMMA,baseDmg:75,randomDmg:10,PPCost:25,range:8,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::HURRICANE_O]=new Battle::Move{"Hurricane","Scatters seeds, causes heavy rains and winds",OMEGA,baseDmg:125,randomDmg:20,PPCost:55,range:8,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::METEORRAIN_A]=new Battle::Move{"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",ALPHA,baseDmg:60,randomDmg:10,PPCost:10,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::METEORRAIN_B]=new Battle::Move{"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",BETA,baseDmg:110,randomDmg:30,PPCost:22,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::METEORRAIN_G]=new Battle::Move{"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",GAMMA,baseDmg:200,randomDmg:50,PPCost:47,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::METEORRAIN_O]=new Battle::Move{"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",OMEGA,baseDmg:390,randomDmg:60,PPCost:98,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKFREEZE_A]=new Battle::Move{"PK Freeze","A powerful chilling attack causing frostbite and slow.",ALPHA,baseDmg:10,randomDmg:10,PPCost:4,range:1,channelTime:0,friendly:false,composition:{0,0,20,10},properties:{{Property::SLOW,4}}}; - MOVELIST[BattleMoveName::PKFREEZE_B]=new Battle::Move{"PK Freeze","A powerful chilling attack causing frostbite and slow.",BETA,baseDmg:120,randomDmg:20,PPCost:8,range:1,channelTime:0,friendly:false,composition:{0,0,20,0},properties:{{Property::SLOW,4}}}; - MOVELIST[BattleMoveName::PKFREEZE_G]=new Battle::Move{"PK Freeze","A powerful chilling attack causing frostbite and slow.",GAMMA,baseDmg:240,randomDmg:40,PPCost:12,range:1,channelTime:0,friendly:false,composition:{0,0,20,0},properties:{{Property::SLOW,4}}}; - MOVELIST[BattleMoveName::PKFREEZE_O]=new Battle::Move{"PK Freeze","A powerful chilling attack causing frostbite and slow.",OMEGA,baseDmg:480,randomDmg:50,PPCost:22,range:1,channelTime:0,friendly:false,composition:{0,0,20,0},properties:{{Property::SLOW,4}}}; - MOVELIST[BattleMoveName::PKSHIELD_A]=new Battle::Move{"PK Shield","Protects against physical attacks.",ALPHA,baseDmg:0,randomDmg:0,PPCost:12,range:1,channelTime:0,friendly:true,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKSHIELD_B]=new Battle::Move{"PK Shield","Protects against physical attacks.",BETA,baseDmg:0,randomDmg:0,PPCost:20,range:1,channelTime:0,friendly:true,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKSHIELD_O]=new Battle::Move{"PK Shield","Protects against physical attacks.",OMEGA,baseDmg:0,randomDmg:0,PPCost:59,range:4,channelTime:0,friendly:true,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKSHIELD_S]=new Battle::Move{"PK Shield","Protects against physical attacks.",SIGMA,baseDmg:0,randomDmg:0,PPCost:80,range:10,channelTime:0,friendly:true,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKLIFEUP_A]=new Battle::Move{"PK Lifeup","Restores a small amount of health.",ALPHA,baseDmg:80,randomDmg:10,PPCost:4,range:1,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; - MOVELIST[BattleMoveName::PKLIFEUP_B]=new Battle::Move{"PK Lifeup","Restores a moderate amount of health.",BETA,baseDmg:240,randomDmg:60,PPCost:9,range:1,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; - MOVELIST[BattleMoveName::PKLIFEUP_G]=new Battle::Move{"PK Lifeup","Restores a large amount of health.",GAMMA,baseDmg:400,randomDmg:50,PPCost:21,range:3,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; - MOVELIST[BattleMoveName::PKLIFEUP_O]=new Battle::Move{"PK Lifeup","Restores a great amount of health to all allies.",OMEGA,baseDmg:800,randomDmg:100,PPCost:64,range:6,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; - MOVELIST[BattleMoveName::PKFUN_A]=new Battle::Move{"PK Fun","A very fun barrage. Hits for large damage.",ALPHA,baseDmg:100,randomDmg:10,PPCost:15,range:6,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; - MOVELIST[BattleMoveName::PKFUN_B]=new Battle::Move{"PK Fun","A very fun barrage. Hits for large damage.",BETA,baseDmg:240,randomDmg:40,PPCost:30,range:6,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; - MOVELIST[BattleMoveName::PKFUN_G]=new Battle::Move{"PK Fun","A very fun barrage. Hits for large damage.",GAMMA,baseDmg:360,randomDmg:80,PPCost:45,range:7,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; - MOVELIST[BattleMoveName::PKFUN_O]=new Battle::Move{"PK Fun","A very fun barrage. Hits for large damage.",OMEGA,baseDmg:590,randomDmg:100,PPCost:90,range:8,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; - MOVELIST[BattleMoveName::PKFIRE_A]=new Battle::Move{"PK Fire","Causes extreme heat to burn foes and scorch trees",ALPHA,baseDmg:60,randomDmg:20,PPCost:6,range:3,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKFIRE_B]=new Battle::Move{"PK Fire","Causes extreme heat to burn foes and scorch trees",BETA,baseDmg:120,randomDmg:40,PPCost:12,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKFIRE_G]=new Battle::Move{"PK Fire","Causes extreme heat to burn foes and scorch trees",GAMMA,baseDmg:190,randomDmg:50,PPCost:20,range:5,channelTime:0,friendly:false,composition:{0,0,20,0}}; - MOVELIST[BattleMoveName::PKFIRE_O]=new Battle::Move{"PK Fire","Causes extreme heat to burn foes and scorch trees",OMEGA,baseDmg:360,randomDmg:100,PPCost:32,range:7,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FIREFOUNTAIN_EFFECT}; - MOVELIST[BattleMoveName::FREEZE_PACKET]=new Battle::Move{"Freeze Packet","",baseDmg:120,randomDmg:20,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0},"$USER uses the $POWER"}; + SetupMove(TESTMOVE1)"Test Move 1","An attack",baseDmg:30,randomDmg:5,range:1,channelTime:0,friendly:false}; + SetupMove(TESTMOVE2)"Test Move 2","An attack",baseDmg:40,randomDmg:10,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0}}; + SetupMove(TESTMOVE3)"Test Move 3","An attack",baseDmg:25,randomDmg:5,PPCost:0,range:3,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(BASH)"Bash","Regular attack.",baseDmg:5,randomDmg:5,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0}}; + SetupMove(BASH_CHANGE)MOVELIST[BattleMoveName::BASH]->name,"Regular attack.",baseDmg:MOVELIST[BattleMoveName::BASH]->baseDmg,randomDmg:MOVELIST[BattleMoveName::BASH]->randomDmg,PPCost:MOVELIST[BattleMoveName::BASH]->PPCost,range:MOVELIST[BattleMoveName::BASH]->range,composition:MOVELIST[BattleMoveName::BASH]->composition,attackMsg:"$USER equipped the $ITEM instead and attacks.",eff:MOVELIST[BattleMoveName::BASH]->eff,pctDamage:MOVELIST[BattleMoveName::BASH]->pctDamage,properties:MOVELIST[BattleMoveName::BASH]->properties}; + SetupMove(DEFEND)"Defend","Defend.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:5*60,friendly:true,{0,0,0,0}}; + SetupMove(EQUIP_ARMOR)"Equip Armor","Equip Armor.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:0,friendly:true,composition:{0,0,0,0},"$USER equips the $ITEM"}; + SetupMove(CONSUMABLE)"Consumable","Consumes an item.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:0,friendly:true,composition:{0,0,0,0},"$USER uses $ITEM on $TARGET"}; + SetupMove(CONSUMABLE_ENEMY)"Consumable","Consumes an item.",baseDmg:0,randomDmg:0,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0},"$USER uses $ITEM on $TARGET"}; + SetupMove(HAILSTORM_A)"Hailstorm","Causes heavy ice rocks to crash",ALPHA,baseDmg:40,randomDmg:20,PPCost:4,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(HAILSTORM_B)"Hailstorm","Causes heavy ice rocks to crash",BETA,baseDmg:80,randomDmg:20,PPCost:12,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(HAILSTORM_G)"Hailstorm","Causes heavy ice rocks to crash",GAMMA,baseDmg:120,randomDmg:20,PPCost:28,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(HAILSTORM_O)"Hailstorm","Causes heavy ice rocks to crash",OMEGA,baseDmg:210,randomDmg:50,PPCost:69,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(HURRICANE_A)"Hurricane","Scatters seeds, causes heavy rains and winds",ALPHA,baseDmg:25,randomDmg:5,PPCost:7,range:6,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(HURRICANE_B)"Hurricane","Scatters seeds, causes heavy rains and winds",BETA,baseDmg:45,randomDmg:5,PPCost:13,range:6,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(HURRICANE_G)"Hurricane","Scatters seeds, causes heavy rains and winds",GAMMA,baseDmg:75,randomDmg:10,PPCost:25,range:8,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(HURRICANE_O)"Hurricane","Scatters seeds, causes heavy rains and winds",OMEGA,baseDmg:125,randomDmg:20,PPCost:55,range:8,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(METEORRAIN_A)"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",ALPHA,baseDmg:60,randomDmg:10,PPCost:10,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(METEORRAIN_B)"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",BETA,baseDmg:110,randomDmg:30,PPCost:22,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(METEORRAIN_G)"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",GAMMA,baseDmg:200,randomDmg:50,PPCost:47,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(METEORRAIN_O)"Meteor Rain","Causes fiery rocks to fall from the skies. Chance to burn trees.",OMEGA,baseDmg:390,randomDmg:60,PPCost:98,range:2,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(PKFREEZE_A)"PK Freeze","A powerful chilling attack causing frostbite and slow.",ALPHA,baseDmg:10,randomDmg:10,PPCost:4,range:1,channelTime:0,friendly:false,composition:{0,0,20,10},properties:{{Property::SLOW,4}}}; + SetupMove(PKFREEZE_B)"PK Freeze","A powerful chilling attack causing frostbite and slow.",BETA,baseDmg:120,randomDmg:20,PPCost:8,range:1,channelTime:0,friendly:false,composition:{0,0,20,0},properties:{{Property::SLOW,4}}}; + SetupMove(PKFREEZE_G)"PK Freeze","A powerful chilling attack causing frostbite and slow.",GAMMA,baseDmg:240,randomDmg:40,PPCost:12,range:1,channelTime:0,friendly:false,composition:{0,0,20,0},properties:{{Property::SLOW,4}}}; + SetupMove(PKFREEZE_O)"PK Freeze","A powerful chilling attack causing frostbite and slow.",OMEGA,baseDmg:480,randomDmg:50,PPCost:22,range:1,channelTime:0,friendly:false,composition:{0,0,20,0},properties:{{Property::SLOW,4}}}; + SetupMove(PKSHIELD_A)"PK Shield","Protects against physical attacks.",ALPHA,baseDmg:0,randomDmg:0,PPCost:12,range:1,channelTime:0,friendly:true,composition:{0,0,20,0}}; + SetupMove(PKSHIELD_B)"PK Shield","Protects against physical attacks.",BETA,baseDmg:0,randomDmg:0,PPCost:20,range:1,channelTime:0,friendly:true,composition:{0,0,20,0}}; + SetupMove(PKSHIELD_O)"PK Shield","Protects against physical attacks.",OMEGA,baseDmg:0,randomDmg:0,PPCost:59,range:4,channelTime:0,friendly:true,composition:{0,0,20,0}}; + SetupMove(PKSHIELD_S)"PK Shield","Protects against physical attacks.",SIGMA,baseDmg:0,randomDmg:0,PPCost:80,range:10,channelTime:0,friendly:true,composition:{0,0,20,0}}; + SetupMove(PKLIFEUP_A)"PK Lifeup","Restores a small amount of health.",ALPHA,baseDmg:80,randomDmg:10,PPCost:4,range:1,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; + SetupMove(PKLIFEUP_B)"PK Lifeup","Restores a moderate amount of health.",BETA,baseDmg:240,randomDmg:60,PPCost:9,range:1,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; + SetupMove(PKLIFEUP_G)"PK Lifeup","Restores a large amount of health.",GAMMA,baseDmg:400,randomDmg:50,PPCost:21,range:3,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; + SetupMove(PKLIFEUP_O)"PK Lifeup","Restores a great amount of health to all allies.",OMEGA,baseDmg:800,randomDmg:100,PPCost:64,range:6,channelTime:0,friendly:true,composition:{0,0,20,0},overworld:true}; + SetupMove(PKFUN_A)"PK Fun","A very fun barrage. Hits for large damage.",ALPHA,baseDmg:100,randomDmg:10,PPCost:15,range:6,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; + SetupMove(PKFUN_B)"PK Fun","A very fun barrage. Hits for large damage.",BETA,baseDmg:240,randomDmg:40,PPCost:30,range:6,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; + SetupMove(PKFUN_G)"PK Fun","A very fun barrage. Hits for large damage.",GAMMA,baseDmg:360,randomDmg:80,PPCost:45,range:7,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; + SetupMove(PKFUN_O)"PK Fun","A very fun barrage. Hits for large damage.",OMEGA,baseDmg:590,randomDmg:100,PPCost:90,range:8,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FOUNTAIN_EFFECT}; + SetupMove(PKFIRE_A)"PK Fire","Causes extreme heat to burn foes and scorch trees",ALPHA,baseDmg:60,randomDmg:20,PPCost:6,range:3,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(PKFIRE_B)"PK Fire","Causes extreme heat to burn foes and scorch trees",BETA,baseDmg:120,randomDmg:40,PPCost:12,range:4,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(PKFIRE_G)"PK Fire","Causes extreme heat to burn foes and scorch trees",GAMMA,baseDmg:190,randomDmg:50,PPCost:20,range:5,channelTime:0,friendly:false,composition:{0,0,20,0}}; + SetupMove(PKFIRE_O)"PK Fire","Causes extreme heat to burn foes and scorch trees",OMEGA,baseDmg:360,randomDmg:100,PPCost:32,range:7,channelTime:0,friendly:false,composition:{0,0,20,0},"$USER uses $POWER",FIREFOUNTAIN_EFFECT}; + SetupMove(FREEZE_PACKET)"Freeze Packet","",baseDmg:120,randomDmg:20,PPCost:0,range:1,channelTime:0,friendly:false,composition:{0,0,0,0},"$USER uses the $POWER"}; } void SeasonI::SetupItemList() { //hpRecovery,ppRecovery,attack,dmgReduction,equip,important,consumable - ITEMLIST[ItemName::COOKIE]=new Item("Cookie","A delightful little treat. Restores 40 HP.",2,{hpRecovery:40,consumable:Consumable::FRIENDLY,sellPrice:2}); - ITEMLIST[ItemName::EGG]=new Item("Egg","Did it come before or after the chicken? Restores 60 HP.",3,{hpRecovery:60,consumable:Consumable::FRIENDLY,sellPrice:6}); - ITEMLIST[ItemName::PIZZA]=new Item("Pizza","A scrumptious meal filled with lots of cheese. Restores 200 HP.",4,{hpRecovery:200,consumable:Consumable::FRIENDLY,sellPrice:12}); - ITEMLIST[ItemName::MIRACLE_FOOD_LUNCH]=new Item("Miracle Food Lunch","It doesn't taste very good, but it's said to have miraculous powers when consumed.",16,{hpRecovery:30,ppRecovery:10,atkIncrease:30,spdIncrease:6,hpIncrease:150,ppIncrease:100,learnAbility:MOVELIST[BattleMoveName::PKFIRE_O],consumable:Consumable::FRIENDLY_PERMANENT,sellPrice:180}); - ITEMLIST[ItemName::BOMB]=new Item("Bomb","A small explosive device. Deals around 120 damage.",256,{damage:110,rollDmg:30,consumable:Consumable::ENEMY,sellPrice:30}); - ITEMLIST[ItemName::CRACKED_BAT]=new Item("Cracked Bat","Has some dents in it, but you can probably still dent things with it yourself.",256,{attack:10,equip:EquipSlot::WEAPON,sellPrice:4}); - ITEMLIST[ItemName::TEE_BALL_BAT]=new Item("Tee Ball Bat","Great for playing some ball! Also great for beating your foes!",256,{attack:40,equip:EquipSlot::WEAPON,sellPrice:36}); - ITEMLIST[ItemName::LIGHT_JACKET]=new Item("Light Jacket","Fits just fine.",256,{defense:10,equip:EquipSlot::ARMOR,sellPrice:25}); - ITEMLIST[ItemName::HEAVY_JACKET]=new Item("Heavy Jacket","Are you sure this is good for your shoulders?",256,{defense:25,equip:EquipSlot::ARMOR,sellPrice:79}); - ITEMLIST[ItemName::COPPER_BRACELET]=new Item("Copper Bracelet","It's not quite as shiny as a diamond, but it still makes you look good.",256,{defense:5,equip:EquipSlot::ACCESSORY,sellPrice:64}); - ITEMLIST[ItemName::KEY_TO_THE_PALACE]=new Item("Key to the Palace","Lets you access a Palace.",256,{important:true}); - ITEMLIST[ItemName::FREEZE_PACKET]=new Item("Freeze Packet","Lets out some blistering cold weather.",256,{consumable:Consumable::ENEMY,sellPrice:36},MOVELIST[BattleMoveName::FREEZE_PACKET]); - ITEMLIST[ItemName::SOME_STUPIDLY_LONG_FEATHER]=new Item("Some Stupidly Long Feather","Yeah, we don't know why this feather is so long either.",256,{attack:2,defense:3,equip:EquipSlot::ACCESSORY,sellPrice:36}); + SetupItem(COOKIE)"Cookie","A delightful little treat. Restores 40 HP.",2,{hpRecovery:40,consumable:Consumable::FRIENDLY,sellPrice:2}); + SetupItem(EGG)"Egg","Did it come before or after the chicken? Restores 60 HP.",3,{hpRecovery:60,consumable:Consumable::FRIENDLY,sellPrice:6}); + SetupItem(PIZZA)"Pizza","A scrumptious meal filled with lots of cheese. Restores 200 HP.",4,{hpRecovery:200,consumable:Consumable::FRIENDLY,sellPrice:12}); + SetupItem(MIRACLE_FOOD_LUNCH)"Miracle Food Lunch","It doesn't taste very good, but it's said to have miraculous powers when consumed.",16,{hpRecovery:30,ppRecovery:10,atkIncrease:30,spdIncrease:6,hpIncrease:150,ppIncrease:100,learnAbility:MOVELIST[BattleMoveName::PKFIRE_O],consumable:Consumable::FRIENDLY_PERMANENT,sellPrice:180}); + SetupItem(BOMB)"Bomb","A small explosive device. Deals around 120 damage.",256,{damage:110,rollDmg:30,consumable:Consumable::ENEMY,sellPrice:30}); + SetupItem(CRACKED_BAT)"Cracked Bat","Has some dents in it, but you can probably still dent things with it yourself.",256,{attack:10,equip:EquipSlot::WEAPON,sellPrice:4}); + SetupItem(TEE_BALL_BAT)"Tee Ball Bat","Great for playing some ball! Also great for beating your foes!",256,{attack:40,equip:EquipSlot::WEAPON,sellPrice:36}); + SetupItem(LIGHT_JACKET)"Light Jacket","Fits just fine.",256,{defense:10,equip:EquipSlot::ARMOR,sellPrice:25}); + SetupItem(HEAVY_JACKET)"Heavy Jacket","Are you sure this is good for your shoulders?",256,{defense:25,equip:EquipSlot::ARMOR,sellPrice:79}); + SetupItem(COPPER_BRACELET)"Copper Bracelet","It's not quite as shiny as a diamond, but it still makes you look good.",256,{defense:5,equip:EquipSlot::ACCESSORY,sellPrice:64}); + SetupItem(KEY_TO_THE_PALACE)"Key to the Palace","Lets you access a Palace.",256,{important:true}); + SetupItem(FREEZE_PACKET)"Freeze Packet","Lets out some blistering cold weather.",256,{consumable:Consumable::ENEMY,sellPrice:36},MOVELIST[BattleMoveName::FREEZE_PACKET]); + SetupItem(SOME_STUPIDLY_LONG_FEATHER)"Some Stupidly Long Feather","Yeah, we don't know why this feather is so long either.",256,{attack:2,defense:3,equip:EquipSlot::ACCESSORY,sellPrice:36}); } Entity::pstats_t partyMemberDefaultStats{HP:120,maxHP:120,PP:30,maxPP:30,baseAtk:8,speed:8,resistances:{0,0,0,0}}; void SeasonI::SetupPartyMemberStats() { for (int i=0;i<7;i++) { - PARTY_MEMBER_STATS[i]=new Entity(partyMemberDefaultStats,{MOVELIST[BattleMoveName::TESTMOVE1]}); + PARTY_MEMBER_STATS[i]=new Entity(i,partyMemberDefaultStats,{MOVELIST[BattleMoveName::TESTMOVE1]}); } PARTY_MEMBER_STATS[PLAYER]->statusEffects[Property::MUSHROOMIZED]=4; PARTY_MEMBER_STATS[PLAYER]->moveSet={ @@ -1467,6 +1471,10 @@ void SeasonI::keyUpdates() { ConsoleShow(F1,false); } + if (GetKey(F6).bPressed) { + SaveGameSaveData(0); + } + if (GetKey(O).bPressed) { StartEffect(FOUNTAIN_EFFECT); } @@ -2205,23 +2213,23 @@ void SeasonI::keyUpdates() { }break; case ItemAction::ATKINCREASE:{ target->stats.baseAtk+=item->stats.atkIncrease; - target->boosts[boost::ATK]+=item->stats.atkIncrease; + target->boosts.atk+=item->stats.atkIncrease; }break; case ItemAction::HPINCREASE:{ target->stats.maxHP+=item->stats.hpIncrease; target->AddHP(item->stats.hpIncrease); vi2d box = {(128-32*PARTY_MEMBER_COUNT)+OVERWORLD_TARGET_SELECTION*64+29,170}; DAMAGE_NUMBERS.push_back(new DamageNumber(-item->stats.hpIncrease,box+cameraPos)); - target->boosts[boost::HP]+=item->stats.hpIncrease; + target->boosts.hp+=item->stats.hpIncrease; }break; case ItemAction::PPINCREASE:{ target->stats.maxPP+=item->stats.ppIncrease; target->AddPP(item->stats.ppIncrease); - target->boosts[boost::PP]+=item->stats.ppIncrease; + target->boosts.pp+=item->stats.ppIncrease; }break; case ItemAction::SPDINCREASE:{ target->stats.speed+=item->stats.spdIncrease; - target->boosts[boost::SPD]+=item->stats.spdIncrease; + target->boosts.spd+=item->stats.spdIncrease; }break; case ItemAction::LEARNMOVE:{ bool moveLearned=false; @@ -2793,22 +2801,22 @@ void SeasonI::drawGame(){ drawPos.y+=24; drawPos.x+=96; std::string displayStr1 = "ATK Boosts: "; - std::string displayStr2 = "+"+std::to_string(member->boosts[boost::ATK]); + std::string displayStr2 = "+"+std::to_string(member->boosts.atk); DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); DrawStringPropDecal({(float)(drawPos.x+24-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); drawPos.y+=12; displayStr1 = "HP Boosts: "; - displayStr2 = "+"+std::to_string(member->boosts[boost::HP]); + displayStr2 = "+"+std::to_string(member->boosts.hp); DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); DrawStringPropDecal({(float)(drawPos.x+24-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); drawPos.y+=12; displayStr1 = "PP Boosts: "; - displayStr2 = "+"+std::to_string(member->boosts[boost::PP]); + displayStr2 = "+"+std::to_string(member->boosts.pp); DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); DrawStringPropDecal({(float)(drawPos.x+24-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); drawPos.y+=12; displayStr1 = "SPD Boosts: "; - displayStr2 = "+"+std::to_string(member->boosts[boost::SPD]); + displayStr2 = "+"+std::to_string(member->boosts.spd); DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); DrawStringPropDecal({(float)(drawPos.x+24-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); drawPos.y+=12; @@ -3510,21 +3518,21 @@ void SeasonI::HandleBattle() { }break; case ItemAction::ATKINCREASE:{ target->stats.baseAtk+=BATTLE_CUSTOM_ITEM->stats.atkIncrease; - target->boosts[boost::ATK]+=BATTLE_CUSTOM_ITEM->stats.atkIncrease; + target->boosts.atk+=BATTLE_CUSTOM_ITEM->stats.atkIncrease; }break; case ItemAction::HPINCREASE:{ target->stats.maxHP+=BATTLE_CUSTOM_ITEM->stats.hpIncrease; target->AddHP(BATTLE_CUSTOM_ITEM->stats.hpIncrease); - target->boosts[boost::HP]+=BATTLE_CUSTOM_ITEM->stats.hpIncrease; + target->boosts.hp+=BATTLE_CUSTOM_ITEM->stats.hpIncrease; }break; case ItemAction::PPINCREASE:{ target->stats.maxPP+=BATTLE_CUSTOM_ITEM->stats.ppIncrease; target->AddPP(BATTLE_CUSTOM_ITEM->stats.ppIncrease); - target->boosts[boost::PP]+=BATTLE_CUSTOM_ITEM->stats.ppIncrease; + target->boosts.pp+=BATTLE_CUSTOM_ITEM->stats.ppIncrease; }break; case ItemAction::SPDINCREASE:{ target->stats.speed+=BATTLE_CUSTOM_ITEM->stats.spdIncrease; - target->boosts[boost::SPD]+=BATTLE_CUSTOM_ITEM->stats.spdIncrease; + target->boosts.spd+=BATTLE_CUSTOM_ITEM->stats.spdIncrease; }break; case ItemAction::LEARNMOVE:{ bool moveLearned=false; @@ -5201,6 +5209,18 @@ void SeasonI::SetupMapList(){ }; } +void SeasonI::SaveGameSaveData(int saveSlot) { + std::ofstream file("save"+std::to_string(saveSlot)); + for (int i=PLAYER;i<7;i++) { + file<<*(PARTY_MEMBER_STATS[i]); + } + file.close(); +} + +void SeasonI::LoadGameSaveData(int saveSlot) { + +} + #ifndef TEST_SUITE int main() { diff --git a/object.h b/object.h index acbb04e..9fad149 100644 --- a/object.h +++ b/object.h @@ -246,7 +246,7 @@ class TrashCan_Obj : public Object{ }; extern int MESSAGE_BOX_DIALOG_ANSWER; -extern bool GAME_FLAGS[128]; +extern bool GAME_FLAGS[512]; extern int GAME_STATE; extern void SetupShop(Object*shopkeeper,std::vector> shopItems); extern std::mapITEMLIST; diff --git a/save0 b/save0 new file mode 100644 index 0000000..81f1620 --- /dev/null +++ b/save0 @@ -0,0 +1 @@ +120 120 PLAYER 30 30 8 8 4 0 0 0 0 0 0 0 11 9 10 13 14 15 16 17 33 29 21 25 1 6 4 3 5 7 12 333 240 120 120 NESS 30 30 8 8 4 0 0 0 0 0 0 0 6 33 34 29 30 31 32 0 3 -1 -1 -1 362 260 120 120 PAULA 30 30 8 8 4 0 0 0 0 0 0 0 6 21 22 23 24 37 38 0 3 -1 -1 -1 359 248 120 120 JEFF 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 120 120 ANNA 30 30 8 8 4 0 0 0 0 0 0 0 4 21 25 26 29 0 3 -1 -1 -1 359 236 120 120 KING 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 120 120 POO 30 30 8 8 4 0 0 0 0 0 0 0 1 0 0 3 -1 -1 -1 -999 -999 \ No newline at end of file