generated from sigonasr2/CPlusPlusProjectTemplate
Implement money drops on enemies
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
320e9bdf30
commit
7aba68c6c0
Binary file not shown.
@ -17,9 +17,7 @@ using namespace olc;
|
|||||||
#define DEFAULT_CHANNELPOS {-99,-99}
|
#define DEFAULT_CHANNELPOS {-99,-99}
|
||||||
#define CUSTOM_MESSAGE_WAIT_TIME 90
|
#define CUSTOM_MESSAGE_WAIT_TIME 90
|
||||||
|
|
||||||
#define ㅎ
|
#define 돈
|
||||||
#define ㅍ
|
|
||||||
#define 아
|
|
||||||
|
|
||||||
#define α '`'
|
#define α '`'
|
||||||
#define β '{'
|
#define β '{'
|
||||||
|
172
entity.h
172
entity.h
@ -19,54 +19,54 @@ namespace boost{
|
|||||||
|
|
||||||
|
|
||||||
class Entity{
|
class Entity{
|
||||||
private:
|
struct pstats_t{
|
||||||
int HP=0;
|
|
||||||
int targetHP=0;
|
|
||||||
int PP=0;
|
|
||||||
int targetPP=0;
|
|
||||||
public:
|
public:
|
||||||
|
int HP=0;
|
||||||
int maxHP=0;
|
int maxHP=0;
|
||||||
|
int PP=0;
|
||||||
int maxPP=0;
|
int maxPP=0;
|
||||||
std::array<int,4>resistances={0,0,0,0};
|
int targetHP=0;
|
||||||
int speed=0;
|
int targetPP=0;
|
||||||
int baseAtk=0;
|
int baseAtk=0;
|
||||||
|
int speed=0;
|
||||||
|
std::array<int,4>resistances={0,0,0,0};
|
||||||
int damageReduction=0; //A percentage of how much damage to reduce.
|
int damageReduction=0; //A percentage of how much damage to reduce.
|
||||||
bool smart=false;
|
bool smart=false;
|
||||||
bool dumb=false;
|
bool dumb=false;
|
||||||
int atb=0; //When this value reaches 1000, it's this entity's turn.
|
};
|
||||||
Object* obj;
|
struct stats_t{
|
||||||
std::vector<Battle::Move*> moveSet;
|
private:
|
||||||
std::map<Property,int> statusEffects;
|
int HP=0;
|
||||||
int selectedTarget = NO_TARGET;
|
public:
|
||||||
Battle::Move*selectedMove = nullptr; //The index of the selected move.
|
int maxHP=0;
|
||||||
int channelTimeRemaining = 0; //The amount of channel time left until move can be performed.
|
private:
|
||||||
vd2d channelPos = DEFAULT_CHANNELPOS; //Where our channel is happening.
|
int PP=0;
|
||||||
std::vector<Item*> inventory; //Used mostly for enemy spoils.
|
public:
|
||||||
std::array<Item*,3> equipment = {nullptr,nullptr,nullptr}; //Equipment this character is using.
|
int maxPP=0;
|
||||||
bool isPlayer=false; //Whether or not this is a player entity.
|
private:
|
||||||
std::array<int,4> boosts = {0,0,0,0}; //Values to indicate how much the boosts of each stat ended up being. Order is ATK,HP,PP,SPD.
|
int targetHP=0;
|
||||||
//Used for initializing players.
|
int targetPP=0;
|
||||||
Entity(int HP,int maxHP,int PP,int maxPP,int baseAtk,std::array<int,4>resistances,int speed,std::vector<Battle::Move*>moveSet,std::vector<Item*>items={},std::array<Item*,3>equipment={},int damageReduction=0,bool smart=false,bool dumb=false)
|
public:
|
||||||
:Entity(nullptr,HP,maxHP,PP,maxPP,baseAtk,resistances,speed,moveSet,items,equipment,damageReduction,smart,dumb){
|
int baseAtk=0;
|
||||||
isPlayer=true;
|
int speed=0;
|
||||||
}
|
std::array<int,4>resistances={0,0,0,0};
|
||||||
//Use this for initializing enemies as it lets you specify an object.
|
int damageReduction=0; //A percentage of how much damage to reduce.
|
||||||
Entity(Object*obj,int HP,int maxHP,int PP,int maxPP,int baseAtk,std::array<int,4>resistances,int speed,std::vector<Battle::Move*>moveSet,std::vector<Item*>items={},std::array<Item*,3>equipment={},int damageReduction=0,bool smart=false,bool dumb=false)
|
bool smart=false;
|
||||||
:obj(obj),HP(HP),maxHP(maxHP),PP(PP),maxPP(maxPP),baseAtk(baseAtk),speed(speed),equipment(equipment),moveSet(moveSet),damageReduction(damageReduction),inventory(items),smart(smart),dumb(dumb){
|
bool dumb=false;
|
||||||
for (int i=0;i<4;i++) {
|
stats_t(pstats_t stats) {
|
||||||
this->resistances[i]=resistances[i];
|
this->HP=stats.HP;
|
||||||
}
|
this->PP=stats.PP;
|
||||||
this->targetHP=HP;
|
this->targetHP=stats.targetHP;
|
||||||
this->targetPP=PP;
|
this->targetPP=stats.targetPP;
|
||||||
}
|
this->maxHP=stats.maxHP;
|
||||||
Property GetPrimaryStatusEffect() {
|
this->maxPP=stats.maxPP;
|
||||||
for (std::map<Property,int>::iterator it = statusEffects.begin();it!=statusEffects.end();++it) {
|
this->baseAtk=stats.baseAtk;
|
||||||
if (it->second!=0) {
|
this->speed=stats.speed;
|
||||||
return it->first;
|
this->resistances=stats.resistances;
|
||||||
}
|
this->damageReduction=stats.damageReduction;
|
||||||
}
|
this->smart=stats.smart;
|
||||||
return Property::NONE;
|
this->dumb=stats.dumb;
|
||||||
}
|
};
|
||||||
//Get the HP that the rolling counter is moving towards.
|
//Get the HP that the rolling counter is moving towards.
|
||||||
int GetTargetHP() {
|
int GetTargetHP() {
|
||||||
return targetHP;
|
return targetHP;
|
||||||
@ -115,6 +115,96 @@ class Entity{
|
|||||||
void _SetDirectPP(int pp) {
|
void _SetDirectPP(int pp) {
|
||||||
PP=pp;
|
PP=pp;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
private:
|
||||||
|
pstats_t pstats;
|
||||||
|
public:
|
||||||
|
stats_t stats;
|
||||||
|
int atb=0; //When this value reaches 1000, it's this entity's turn.
|
||||||
|
public:
|
||||||
|
Object* obj;
|
||||||
|
std::vector<Battle::Move*> moveSet;
|
||||||
|
std::map<Property,int> statusEffects;
|
||||||
|
int selectedTarget = NO_TARGET;
|
||||||
|
Battle::Move*selectedMove = nullptr; //The index of the selected move.
|
||||||
|
int channelTimeRemaining = 0; //The amount of channel time left until move can be performed.
|
||||||
|
vd2d channelPos = DEFAULT_CHANNELPOS; //Where our channel is happening.
|
||||||
|
std::vector<Item*> inventory; //Used mostly for enemy spoils.
|
||||||
|
int money=0; //Amount of money this entity will drop when defeated.
|
||||||
|
std::array<Item*,3> equipment = {nullptr,nullptr,nullptr}; //Equipment this character is using.
|
||||||
|
bool isPlayer=false; //Whether or not this is a player entity.
|
||||||
|
std::array<int,4> boosts = {0,0,0,0}; //Values to indicate how much the boosts of each stat ended up being. Order is ATK,HP,PP,SPD.
|
||||||
|
//Used for initializing players.
|
||||||
|
Entity(pstats_t stats,std::vector<Battle::Move*>moveSet,std::vector<Item*>items={},int money=0,std::array<Item*,3>equipment={})
|
||||||
|
:Entity(nullptr,stats,moveSet,items,money,equipment){
|
||||||
|
isPlayer=true;
|
||||||
|
}
|
||||||
|
//Use this for initializing enemies as it lets you specify an object.
|
||||||
|
Entity(Object*obj,pstats_t stats,std::vector<Battle::Move*>moveSet,std::vector<Item*>items={},int money=0,std::array<Item*,3>equipment={})
|
||||||
|
:obj(obj),stats({stats.HP,stats.PP,stats.targetHP,stats.targetPP,stats.maxHP,stats.maxPP,stats.baseAtk,stats.speed,stats.resistances,stats.damageReduction,stats.smart,stats.dumb}),equipment(equipment),moveSet(moveSet),inventory(items),money(money){
|
||||||
|
for (int i=0;i<4;i++) {
|
||||||
|
this->stats.resistances[i]=stats.resistances[i];
|
||||||
|
}
|
||||||
|
this->stats.SetTargetHP(stats.HP);
|
||||||
|
this->stats.SetTargetPP(stats.PP);
|
||||||
|
}
|
||||||
|
//Get the HP that the rolling counter is moving towards.
|
||||||
|
int GetTargetHP() {
|
||||||
|
return stats.GetTargetHP();
|
||||||
|
}
|
||||||
|
//Gets the current actual health of the target.
|
||||||
|
int GetHP() {
|
||||||
|
return stats.GetHP();
|
||||||
|
}
|
||||||
|
//Get the PP that the rolling counter is moving towards.
|
||||||
|
int GetTargetPP() {
|
||||||
|
return stats.GetTargetPP();
|
||||||
|
}
|
||||||
|
//Gets the current actual pp of the target.
|
||||||
|
int GetPP() {
|
||||||
|
return stats.GetPP();
|
||||||
|
}
|
||||||
|
//Sets the rolling counter target to this health value.
|
||||||
|
void SetTargetHP(int hp) {
|
||||||
|
stats.SetTargetHP(hp);
|
||||||
|
}
|
||||||
|
//Sets the rolling counter target to this pp value.
|
||||||
|
void SetTargetPP(int pp) {
|
||||||
|
stats.SetTargetPP(pp);
|
||||||
|
}
|
||||||
|
//Subtracts from the rolling counter target from this health value.
|
||||||
|
void SubtractHP(int hp) {
|
||||||
|
stats.SubtractHP(hp);
|
||||||
|
}
|
||||||
|
//Adds to the rolling counter target from this health value.
|
||||||
|
void AddHP(int hp) {
|
||||||
|
stats.AddHP(hp);
|
||||||
|
}
|
||||||
|
//Subtracts from the rolling counter target from this pp value.
|
||||||
|
void SubtractPP(int pp) {
|
||||||
|
stats.SubtractPP(pp);
|
||||||
|
}
|
||||||
|
//Adds to the rolling counter target from this pp value.
|
||||||
|
void AddPP(int pp) {
|
||||||
|
stats.AddPP(pp);
|
||||||
|
}
|
||||||
|
//THIS IS FOR SPECIAL USE CASES ONLY! Normally you want to touch the rolling counter amount instead using SetTargetHP()!
|
||||||
|
void _SetDirectHP(int hp) {
|
||||||
|
stats._SetDirectHP(hp);
|
||||||
|
}
|
||||||
|
//THIS IS FOR SPECIAL USE CASES ONLY! Normally you want to touch the rolling counter amount instead using SetTargetPP()!
|
||||||
|
void _SetDirectPP(int pp) {
|
||||||
|
stats._SetDirectPP(pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
Property GetPrimaryStatusEffect() {
|
||||||
|
for (std::map<Property,int>::iterator it = statusEffects.begin();it!=statusEffects.end();++it) {
|
||||||
|
if (it->second!=0) {
|
||||||
|
return it->first;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Property::NONE;
|
||||||
|
}
|
||||||
|
|
||||||
void RemoveItem(int index) {
|
void RemoveItem(int index) {
|
||||||
if (isPlayer) {
|
if (isPlayer) {
|
||||||
|
123
main.cpp
123
main.cpp
@ -172,6 +172,9 @@ std::vector<std::string> MESSAGE_BOX_CHOICE_LIST={};
|
|||||||
bool waitingForChoice=false;
|
bool waitingForChoice=false;
|
||||||
int MESSAGE_BOX_DIALOG_CHOICE_CURSOR=0;
|
int MESSAGE_BOX_DIALOG_CHOICE_CURSOR=0;
|
||||||
Object*INTERACTING_WITH=nullptr;
|
Object*INTERACTING_WITH=nullptr;
|
||||||
|
std::vector<std::pair<Item*,int>> SHOP_ITEMS={};
|
||||||
|
int MONEY=0;
|
||||||
|
int ENEMY_MONEY_SUM=0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[Choice1,Choice2,Choice3]
|
[Choice1,Choice2,Choice3]
|
||||||
@ -387,6 +390,10 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
GAME_STATE=GameState::GAME_WORLD;
|
GAME_STATE=GameState::GAME_WORLD;
|
||||||
CLOSE_OVERWORLD_WINDOW=false;
|
CLOSE_OVERWORLD_WINDOW=false;
|
||||||
}
|
}
|
||||||
|
if (INTERACTING_WITH!=nullptr) {
|
||||||
|
INTERACTING_WITH->DialogClosed();
|
||||||
|
INTERACTING_WITH=nullptr;
|
||||||
|
}
|
||||||
if (HEALING_OVERWORLD_MEMBERS) {
|
if (HEALING_OVERWORLD_MEMBERS) {
|
||||||
if (HEALING_OVERWORLD_MEMBER==0||HEALING_OVERWORLD_MEMBER==2) {
|
if (HEALING_OVERWORLD_MEMBER==0||HEALING_OVERWORLD_MEMBER==2) {
|
||||||
DisplayMessageBox("");
|
DisplayMessageBox("");
|
||||||
@ -871,7 +878,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
//DisplayMessageBox("Not implemented yet.");
|
//DisplayMessageBox("Not implemented yet.");
|
||||||
BATTLE_STATE=BattleState::MOVE_SELECT;
|
BATTLE_STATE=BattleState::MOVE_SELECT;
|
||||||
SELECTED_MOVE_SQUARE={0,0};
|
SELECTED_MOVE_SQUARE={0,0};
|
||||||
PopulateMovementGrid(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->obj->GetPosWithOrigin(),CalculateSpeedGridMovementAmount(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->speed));
|
PopulateMovementGrid(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->obj->GetPosWithOrigin(),CalculateSpeedGridMovementAmount(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->stats.speed));
|
||||||
}break;
|
}break;
|
||||||
case 5:{ //Run selected.
|
case 5:{ //Run selected.
|
||||||
DisplayMessageBox("Not implemented yet.");
|
DisplayMessageBox("Not implemented yet.");
|
||||||
@ -1496,23 +1503,23 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
target->AddPP(item->stats.ppRecovery);
|
target->AddPP(item->stats.ppRecovery);
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::ATKINCREASE:{
|
case ItemAction::ATKINCREASE:{
|
||||||
target->baseAtk+=item->stats.atkIncrease;
|
target->stats.baseAtk+=item->stats.atkIncrease;
|
||||||
target->boosts[boost::ATK]+=item->stats.atkIncrease;
|
target->boosts[boost::ATK]+=item->stats.atkIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::HPINCREASE:{
|
case ItemAction::HPINCREASE:{
|
||||||
target->maxHP+=item->stats.hpIncrease;
|
target->stats.maxHP+=item->stats.hpIncrease;
|
||||||
target->AddHP(item->stats.hpIncrease);
|
target->AddHP(item->stats.hpIncrease);
|
||||||
vi2d box = {(128-32*PARTY_MEMBER_COUNT)+OVERWORLD_TARGET_SELECTION*64+29,170};
|
vi2d box = {(128-32*PARTY_MEMBER_COUNT)+OVERWORLD_TARGET_SELECTION*64+29,170};
|
||||||
DAMAGE_NUMBERS.push_back(new DamageNumber(-item->stats.hpIncrease,box+cameraPos));
|
DAMAGE_NUMBERS.push_back(new DamageNumber(-item->stats.hpIncrease,box+cameraPos));
|
||||||
target->boosts[boost::HP]+=item->stats.hpIncrease;
|
target->boosts[boost::HP]+=item->stats.hpIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::PPINCREASE:{
|
case ItemAction::PPINCREASE:{
|
||||||
target->maxPP+=item->stats.ppIncrease;
|
target->stats.maxPP+=item->stats.ppIncrease;
|
||||||
target->AddPP(item->stats.ppIncrease);
|
target->AddPP(item->stats.ppIncrease);
|
||||||
target->boosts[boost::PP]+=item->stats.ppIncrease;
|
target->boosts[boost::PP]+=item->stats.ppIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::SPDINCREASE:{
|
case ItemAction::SPDINCREASE:{
|
||||||
target->speed+=item->stats.spdIncrease;
|
target->stats.speed+=item->stats.spdIncrease;
|
||||||
target->boosts[boost::SPD]+=item->stats.spdIncrease;
|
target->boosts[boost::SPD]+=item->stats.spdIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::LEARNMOVE:{
|
case ItemAction::LEARNMOVE:{
|
||||||
@ -1916,7 +1923,8 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
case GameState::OVERWORLD_EQUIP_MENU:
|
case GameState::OVERWORLD_EQUIP_MENU:
|
||||||
case GameState::OVERWORLD_EQUIP_PLAYER_MENU:
|
case GameState::OVERWORLD_EQUIP_PLAYER_MENU:
|
||||||
case GameState::OVERWORLD_STATUS_MENU:
|
case GameState::OVERWORLD_STATUS_MENU:
|
||||||
case GameState::OVERWORLD_TARGET_MENU:{
|
case GameState::OVERWORLD_TARGET_MENU:
|
||||||
|
case GameState::SHOPKEEPER_MENU:{
|
||||||
DrawGameWorld();
|
DrawGameWorld();
|
||||||
if (GAME_STATE!=GameState::GAME_WORLD&&GAME_STATE!=GameState::OVERWORLD_TARGET_MENU) {
|
if (GAME_STATE!=GameState::GAME_WORLD&&GAME_STATE!=GameState::OVERWORLD_TARGET_MENU) {
|
||||||
SetDrawTarget(layer::INTERFACE);
|
SetDrawTarget(layer::INTERFACE);
|
||||||
@ -2034,17 +2042,17 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
||||||
drawPos.y+=12;
|
drawPos.y+=12;
|
||||||
displayStr1 = "HP: ";
|
displayStr1 = "HP: ";
|
||||||
displayStr2 = std::to_string(member->maxHP);
|
displayStr2 = std::to_string(member->stats.maxHP);
|
||||||
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1);
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1);
|
||||||
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
||||||
drawPos.y+=12;
|
drawPos.y+=12;
|
||||||
displayStr1 = "PP: ";
|
displayStr1 = "PP: ";
|
||||||
displayStr2 = std::to_string(member->maxPP);
|
displayStr2 = std::to_string(member->stats.maxPP);
|
||||||
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1);
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1);
|
||||||
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
||||||
drawPos.y+=12;
|
drawPos.y+=12;
|
||||||
displayStr1 = "SPD: ";
|
displayStr1 = "SPD: ";
|
||||||
displayStr2 = std::to_string(member->speed);
|
displayStr2 = std::to_string(member->stats.speed);
|
||||||
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1);
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1);
|
||||||
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2);
|
||||||
}
|
}
|
||||||
@ -2195,7 +2203,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
int newAttack=0;
|
int newAttack=0;
|
||||||
int newDefense=0;
|
int newDefense=0;
|
||||||
CalculateChangeInEquipmentStats(i,ITEM_SELECTION_CURSOR,equipAttack,equipDefense,newAttack,newDefense);
|
CalculateChangeInEquipmentStats(i,ITEM_SELECTION_CURSOR,equipAttack,equipDefense,newAttack,newDefense);
|
||||||
DrawStringPropDecal({(float)4+WIDTH*(1.0F/8),(float)(HEIGHT/2+4+12+i*10)},std::to_string(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->baseAtk+newAttack),(newAttack>equipAttack)?GREEN:(newAttack<equipAttack)?RED:WHITE,{0.5,1});
|
DrawStringPropDecal({(float)4+WIDTH*(1.0F/8),(float)(HEIGHT/2+4+12+i*10)},std::to_string(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->stats.baseAtk+newAttack),(newAttack>equipAttack)?GREEN:(newAttack<equipAttack)?RED:WHITE,{0.5,1});
|
||||||
DrawStringPropDecal({(float)4+WIDTH*(1.0F/4),(float)(HEIGHT/2+4+12+i*10)},std::to_string(newDefense),(newDefense>equipDefense)?GREEN:(newDefense<equipDefense)?RED:WHITE,{0.5,1});
|
DrawStringPropDecal({(float)4+WIDTH*(1.0F/4),(float)(HEIGHT/2+4+12+i*10)},std::to_string(newDefense),(newDefense>equipDefense)?GREEN:(newDefense<equipDefense)?RED:WHITE,{0.5,1});
|
||||||
if (newAttack!=equipAttack) {DrawRotatedDecal({(float)4+WIDTH*(1.0F/4)-14,(float)(HEIGHT/2+4+12+i*10+2+((newAttack<equipAttack)?4:0))},SPRITES["cursor.png"],newAttack>equipAttack?-M_PI_2:M_PI_2,{4,4},{0.5,0.5},newAttack>equipAttack?GREEN:RED);}
|
if (newAttack!=equipAttack) {DrawRotatedDecal({(float)4+WIDTH*(1.0F/4)-14,(float)(HEIGHT/2+4+12+i*10+2+((newAttack<equipAttack)?4:0))},SPRITES["cursor.png"],newAttack>equipAttack?-M_PI_2:M_PI_2,{4,4},{0.5,0.5},newAttack>equipAttack?GREEN:RED);}
|
||||||
if (newDefense!=equipDefense) {DrawRotatedDecal({(float)4+WIDTH*(3.0F/8)-14,(float)(HEIGHT/2+4+12+i*10+2+((newDefense<equipDefense)?4:0))},SPRITES["cursor.png"],newDefense>equipDefense?-M_PI_2:M_PI_2,{4,4},{0.5,0.5},newDefense>equipDefense?GREEN:RED);}
|
if (newDefense!=equipDefense) {DrawRotatedDecal({(float)4+WIDTH*(3.0F/8)-14,(float)(HEIGHT/2+4+12+i*10+2+((newDefense<equipDefense)?4:0))},SPRITES["cursor.png"],newDefense>equipDefense?-M_PI_2:M_PI_2,{4,4},{0.5,0.5},newDefense>equipDefense?GREEN:RED);}
|
||||||
@ -2655,7 +2663,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
|
|
||||||
void SetupPartyMemberStats() {
|
void SetupPartyMemberStats() {
|
||||||
for (int i=0;i<7;i++) {
|
for (int i=0;i<7;i++) {
|
||||||
PARTY_MEMBER_STATS[i]=new Entity(120,120,30,30,8,{0,0,0,0},8,{MOVELIST[BattleMoveName::TESTMOVE1]});
|
PARTY_MEMBER_STATS[i]=new Entity({HP:120,maxHP:120,PP:30,maxPP:30,baseAtk:8,speed:8,resistances:{0,0,0,0}},{MOVELIST[BattleMoveName::TESTMOVE1]});
|
||||||
}
|
}
|
||||||
PARTY_MEMBER_STATS[PLAYER]->statusEffects[Property::MUSHROOMIZED]=4;
|
PARTY_MEMBER_STATS[PLAYER]->statusEffects[Property::MUSHROOMIZED]=4;
|
||||||
PARTY_MEMBER_STATS[PLAYER]->moveSet={
|
PARTY_MEMBER_STATS[PLAYER]->moveSet={
|
||||||
@ -2944,32 +2952,38 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
std::vector<Entity*>{
|
std::vector<Entity*>{
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj",3,2,ANIMATIONS["player.png"]),
|
NPC1_4,"Test Obj",3,2,ANIMATIONS["player.png"]),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
},
|
||||||
|
{},
|
||||||
|
돈 0),
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj 2",1,3,ANIMATIONS["player.png"]),
|
NPC1_4,"Test Obj 2",1,3,ANIMATIONS["player.png"]),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
},
|
||||||
|
{},
|
||||||
|
돈 0),
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj 3",2,2,ANIMATIONS["player.png"]),
|
NPC1_4,"Test Obj 3",2,2,ANIMATIONS["player.png"]),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
},
|
||||||
|
{},
|
||||||
|
돈 0),
|
||||||
}));//ENCOUNTER_1
|
}));//ENCOUNTER_1
|
||||||
ENCOUNTER_LIST.push_back(new Encounter(encounter::ENCOUNTER_2,{0,0},std::array<vd2d,4>{vd2d
|
ENCOUNTER_LIST.push_back(new Encounter(encounter::ENCOUNTER_2,{0,0},std::array<vd2d,4>{vd2d
|
||||||
{grid(1,1)},{grid(2,2)},{grid(3,2)},{grid(4,2)}},
|
{grid(1,1)},{grid(2,2)},{grid(3,2)},{grid(4,2)}},
|
||||||
std::vector<Entity*>{
|
std::vector<Entity*>{
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj",1,4,ANIMATIONS["player.png"],{2,2},GREEN,20),
|
NPC1_4,"Test Obj",1,4,ANIMATIONS["player.png"],{2,2},GREEN,20),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},5,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
@ -2978,10 +2992,11 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
ITEMLIST[ItemName::EGG],
|
ITEMLIST[ItemName::EGG],
|
||||||
ITEMLIST[ItemName::PIZZA],
|
ITEMLIST[ItemName::PIZZA],
|
||||||
ITEMLIST[ItemName::MIRACLE_FOOD_LUNCH],
|
ITEMLIST[ItemName::MIRACLE_FOOD_LUNCH],
|
||||||
}),
|
},
|
||||||
|
돈 35),
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj 2",1,2,ANIMATIONS["player.png"],{2,2},GREEN,20),
|
NPC1_4,"Test Obj 2",1,2,ANIMATIONS["player.png"],{2,2},GREEN,20),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},5,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
@ -2990,10 +3005,11 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
ITEMLIST[ItemName::EGG],
|
ITEMLIST[ItemName::EGG],
|
||||||
ITEMLIST[ItemName::PIZZA],
|
ITEMLIST[ItemName::PIZZA],
|
||||||
ITEMLIST[ItemName::MIRACLE_FOOD_LUNCH],
|
ITEMLIST[ItemName::MIRACLE_FOOD_LUNCH],
|
||||||
}),
|
},
|
||||||
|
돈 35),
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj 3",2,1,ANIMATIONS["player.png"],{2,2},GREEN,20),
|
NPC1_4,"Test Obj 3",2,1,ANIMATIONS["player.png"],{2,2},GREEN,20),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},5,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
@ -3002,43 +3018,52 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
ITEMLIST[ItemName::EGG],
|
ITEMLIST[ItemName::EGG],
|
||||||
ITEMLIST[ItemName::PIZZA],
|
ITEMLIST[ItemName::PIZZA],
|
||||||
ITEMLIST[ItemName::MIRACLE_FOOD_LUNCH],
|
ITEMLIST[ItemName::MIRACLE_FOOD_LUNCH],
|
||||||
}),
|
},
|
||||||
|
돈 35),
|
||||||
}));//ENCOUNTER_2
|
}));//ENCOUNTER_2
|
||||||
ENCOUNTER_LIST.push_back(new Encounter(encounter::ENCOUNTER_3,{0,0},std::array<vd2d,4>{vd2d
|
ENCOUNTER_LIST.push_back(new Encounter(encounter::ENCOUNTER_3,{0,0},std::array<vd2d,4>{vd2d
|
||||||
{grid(1,1)},{grid(2,2)},{grid(3,2)},{grid(4,2)}},
|
{grid(1,1)},{grid(2,2)},{grid(3,2)},{grid(4,2)}},
|
||||||
std::vector<Entity*>{
|
std::vector<Entity*>{
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj",1,2,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
NPC1_4,"Test Obj",1,2,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
},
|
||||||
|
{},
|
||||||
|
돈 0),
|
||||||
}));//ENCOUNTER_3
|
}));//ENCOUNTER_3
|
||||||
ENCOUNTER_LIST.push_back(new Encounter(encounter::ENCOUNTER_4,{0,0},std::array<vd2d,4>{vd2d
|
ENCOUNTER_LIST.push_back(new Encounter(encounter::ENCOUNTER_4,{0,0},std::array<vd2d,4>{vd2d
|
||||||
{grid(1,2)},{grid(2,2)},{grid(3,2)},{grid(4,2)}},
|
{grid(1,2)},{grid(2,2)},{grid(3,2)},{grid(4,2)}},
|
||||||
std::vector<Entity*>{
|
std::vector<Entity*>{
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj",6,2,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
NPC1_4,"Test Obj",6,2,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
},
|
||||||
|
{},
|
||||||
|
돈 0),
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj",7,2,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
NPC1_4,"Test Obj",7,2,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
},
|
||||||
|
{},
|
||||||
|
돈 0),
|
||||||
new Entity(new Standard_Obj(
|
new Entity(new Standard_Obj(
|
||||||
NPC1_4,"Test Obj",3,5,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
NPC1_4,"Test Obj",3,5,ANIMATIONS["player.png"],{1,1},MAGENTA),
|
||||||
ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array<int,4>{0,0,0,0},0,std::vector<Battle::Move*>{
|
{HP:70,maxHP:70,PP:10,maxPP:10,baseAtk:14,speed:5,resistances:{0,0,0,0}},std::vector<Battle::Move*>{
|
||||||
MOVELIST[BattleMoveName::TESTMOVE1],
|
MOVELIST[BattleMoveName::TESTMOVE1],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE2],
|
MOVELIST[BattleMoveName::TESTMOVE2],
|
||||||
MOVELIST[BattleMoveName::TESTMOVE3],
|
MOVELIST[BattleMoveName::TESTMOVE3],
|
||||||
}),
|
},
|
||||||
|
{},
|
||||||
|
돈 0),
|
||||||
}));//ENCOUNTER_4
|
}));//ENCOUNTER_4
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3281,7 +3306,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
for (int i=0;i<ENCOUNTER_LIST[id]->objs.size();i++) {
|
for (int i=0;i<ENCOUNTER_LIST[id]->objs.size();i++) {
|
||||||
Entity*ent=ENCOUNTER_LIST[id]->objs[i];
|
Entity*ent=ENCOUNTER_LIST[id]->objs[i];
|
||||||
Object*newObj=new Standard_Obj(ent->obj->id,ent->obj->name,ent->obj->GetPos(),ent->obj->spr,ent->obj->GetScale(),ent->obj->color,ent->obj->animationSpd,ent->obj->temp);
|
Object*newObj=new Standard_Obj(ent->obj->id,ent->obj->name,ent->obj->GetPos(),ent->obj->spr,ent->obj->GetScale(),ent->obj->color,ent->obj->animationSpd,ent->obj->temp);
|
||||||
ents.push_back(new Entity(newObj,ent->GetHP(),ent->maxHP,ent->GetPP(),ent->maxPP,ent->baseAtk,ent->resistances,ent->speed,ent->moveSet,ent->inventory,ent->equipment,ent->damageReduction,ent->smart,ent->dumb));
|
ents.push_back(new Entity(newObj,{ent->GetHP(),ent->GetPP(),ent->GetTargetHP(),ent->GetTargetPP(),ent->stats.maxHP,ent->stats.maxPP,ent->stats.baseAtk,ent->stats.speed,ent->stats.resistances,ent->stats.damageReduction,ent->stats.smart,ent->stats.dumb},ent->moveSet,ent->inventory,ent->money,ent->equipment));
|
||||||
}
|
}
|
||||||
Encounter*data=new Encounter(id,pos,ENCOUNTER_LIST[id]->playerPos,ents,chance);
|
Encounter*data=new Encounter(id,pos,ENCOUNTER_LIST[id]->playerPos,ents,chance);
|
||||||
data->chance=chance;
|
data->chance=chance;
|
||||||
@ -3478,7 +3503,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->atb+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->speed;
|
PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->atb+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->stats.speed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -3535,7 +3560,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
BATTLE_ENCOUNTER->objs[i]->atb+=BATTLE_ENCOUNTER->objs[i]->speed;
|
BATTLE_ENCOUNTER->objs[i]->atb+=BATTLE_ENCOUNTER->objs[i]->stats.speed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -3575,21 +3600,21 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
target->AddPP(BATTLE_CUSTOM_ITEM->stats.ppRecovery);
|
target->AddPP(BATTLE_CUSTOM_ITEM->stats.ppRecovery);
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::ATKINCREASE:{
|
case ItemAction::ATKINCREASE:{
|
||||||
target->baseAtk+=BATTLE_CUSTOM_ITEM->stats.atkIncrease;
|
target->stats.baseAtk+=BATTLE_CUSTOM_ITEM->stats.atkIncrease;
|
||||||
target->boosts[boost::ATK]+=BATTLE_CUSTOM_ITEM->stats.atkIncrease;
|
target->boosts[boost::ATK]+=BATTLE_CUSTOM_ITEM->stats.atkIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::HPINCREASE:{
|
case ItemAction::HPINCREASE:{
|
||||||
target->maxHP+=BATTLE_CUSTOM_ITEM->stats.hpIncrease;
|
target->stats.maxHP+=BATTLE_CUSTOM_ITEM->stats.hpIncrease;
|
||||||
target->AddHP(BATTLE_CUSTOM_ITEM->stats.hpIncrease);
|
target->AddHP(BATTLE_CUSTOM_ITEM->stats.hpIncrease);
|
||||||
target->boosts[boost::HP]+=BATTLE_CUSTOM_ITEM->stats.hpIncrease;
|
target->boosts[boost::HP]+=BATTLE_CUSTOM_ITEM->stats.hpIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::PPINCREASE:{
|
case ItemAction::PPINCREASE:{
|
||||||
target->maxPP+=BATTLE_CUSTOM_ITEM->stats.ppIncrease;
|
target->stats.maxPP+=BATTLE_CUSTOM_ITEM->stats.ppIncrease;
|
||||||
target->AddPP(BATTLE_CUSTOM_ITEM->stats.ppIncrease);
|
target->AddPP(BATTLE_CUSTOM_ITEM->stats.ppIncrease);
|
||||||
target->boosts[boost::PP]+=BATTLE_CUSTOM_ITEM->stats.ppIncrease;
|
target->boosts[boost::PP]+=BATTLE_CUSTOM_ITEM->stats.ppIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::SPDINCREASE:{
|
case ItemAction::SPDINCREASE:{
|
||||||
target->speed+=BATTLE_CUSTOM_ITEM->stats.spdIncrease;
|
target->stats.speed+=BATTLE_CUSTOM_ITEM->stats.spdIncrease;
|
||||||
target->boosts[boost::SPD]+=BATTLE_CUSTOM_ITEM->stats.spdIncrease;
|
target->boosts[boost::SPD]+=BATTLE_CUSTOM_ITEM->stats.spdIncrease;
|
||||||
}break;
|
}break;
|
||||||
case ItemAction::LEARNMOVE:{
|
case ItemAction::LEARNMOVE:{
|
||||||
@ -3750,6 +3775,10 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
}
|
}
|
||||||
PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->_SetDirectPP(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->GetTargetPP());
|
PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->_SetDirectPP(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]]->GetTargetPP());
|
||||||
}
|
}
|
||||||
|
ENEMY_MONEY_SUM=0;
|
||||||
|
for (int i=0;i<BATTLE_ENCOUNTER->objs.size();i++) {
|
||||||
|
ENEMY_MONEY_SUM+=BATTLE_ENCOUNTER->objs[i]->money;
|
||||||
|
}
|
||||||
BATTLE_STATE=BattleState::ENEMY_SPOILS;
|
BATTLE_STATE=BattleState::ENEMY_SPOILS;
|
||||||
BATTLE_ROLLING_COUNTER_WAITTIME=0;
|
BATTLE_ROLLING_COUNTER_WAITTIME=0;
|
||||||
}
|
}
|
||||||
@ -3791,7 +3820,13 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
BATTLE_SPOILS_MESSAGE+=BATTLE_SPOILS_LIST[0]->name+".";
|
BATTLE_SPOILS_MESSAGE+=BATTLE_SPOILS_LIST[0]->name+".";
|
||||||
PARTY_INVENTORY.push_back(BATTLE_SPOILS_LIST[0]);
|
PARTY_INVENTORY.push_back(BATTLE_SPOILS_LIST[0]);
|
||||||
BATTLE_SPOILS_LIST.erase(BATTLE_SPOILS_LIST.begin());
|
BATTLE_SPOILS_LIST.erase(BATTLE_SPOILS_LIST.begin());
|
||||||
} else {
|
} else
|
||||||
|
if (ENEMY_MONEY_SUM>0) {
|
||||||
|
BATTLE_SPOILS_MESSAGE="You gained $"+std::to_string(ENEMY_MONEY_SUM)+".";
|
||||||
|
MONEY+=ENEMY_MONEY_SUM;
|
||||||
|
ENEMY_MONEY_SUM=0;
|
||||||
|
} else
|
||||||
|
{
|
||||||
BATTLE_STATE=BattleState::MOVE_CAMERA_BACK;
|
BATTLE_STATE=BattleState::MOVE_CAMERA_BACK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4212,7 +4247,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
}
|
}
|
||||||
int attackerDamage = (attacker->selectedMove->baseDmg+
|
int attackerDamage = (attacker->selectedMove->baseDmg+
|
||||||
((attacker->selectedMove->randomDmg>0)?rand()%attacker->selectedMove->randomDmg:0)
|
((attacker->selectedMove->randomDmg>0)?rand()%attacker->selectedMove->randomDmg:0)
|
||||||
+attacker->baseAtk
|
+attacker->stats.baseAtk
|
||||||
+equipDamage);
|
+equipDamage);
|
||||||
finalDamage += attackerDamage;
|
finalDamage += attackerDamage;
|
||||||
|
|
||||||
@ -4491,7 +4526,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
DrawDialogBox({WIDTH-WIDTH/3+WIDTH/6-1,HEIGHT/4+2},{(int)(WIDTH/6),HEIGHT/8},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
|
DrawDialogBox({WIDTH-WIDTH/3+WIDTH/6-1,HEIGHT/4+2},{(int)(WIDTH/6),HEIGHT/8},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
|
||||||
DrawStringPropDecal(damageBoxPos+textStartingOffset,"Damage",WHITE,{0.7,0.8});
|
DrawStringPropDecal(damageBoxPos+textStartingOffset,"Damage",WHITE,{0.7,0.8});
|
||||||
if (BATTLE_MOVELIST_DISPLAY.size()>0) {
|
if (BATTLE_MOVELIST_DISPLAY.size()>0) {
|
||||||
label = (BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->baseDmg!=0)?std::to_string(BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->baseDmg+PARTY_MEMBER_STATS[partyMemberSlot]->baseAtk)+"~"+std::to_string(BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->randomDmg+BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->baseDmg+PARTY_MEMBER_STATS[partyMemberSlot]->baseAtk):"N/A";
|
label = (BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->baseDmg!=0)?std::to_string(BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->baseDmg+PARTY_MEMBER_STATS[partyMemberSlot]->stats.baseAtk)+"~"+std::to_string(BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->randomDmg+BATTLE_MOVELIST_DISPLAY[selectioncursor][gradeselectioncursor]->baseDmg+PARTY_MEMBER_STATS[partyMemberSlot]->stats.baseAtk):"N/A";
|
||||||
DrawStringPropDecal({static_cast<float>(damageBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5))),static_cast<float>(damageBoxPos.y+textStartingOffset.y+8)},label,WHITE,{static_cast<float>(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),1.5});
|
DrawStringPropDecal({static_cast<float>(damageBoxPos.x+textStartingOffset.x+(WIDTH/6)-8-GetTextSizeProp(label).x*(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5))),static_cast<float>(damageBoxPos.y+textStartingOffset.y+8)},label,WHITE,{static_cast<float>(std::min((double)((WIDTH/6)-8)/GetTextSizeProp(label).x,1.5)),1.5});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4607,8 +4642,8 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
}
|
}
|
||||||
Entity*member=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]];
|
Entity*member=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]];
|
||||||
|
|
||||||
HandleRollingCounters(i,player_rollhp_counter,player_rollhp_display,member,member->maxHP,member->GetHP(),member->GetTargetHP());
|
HandleRollingCounters(i,player_rollhp_counter,player_rollhp_display,member,member->stats.maxHP,member->GetHP(),member->GetTargetHP());
|
||||||
HandleRollingCounters(i,player_rollpp_counter,player_rollpp_display,member,member->maxPP,member->GetPP(),member->GetTargetPP(),true);
|
HandleRollingCounters(i,player_rollpp_counter,player_rollpp_display,member,member->stats.maxPP,member->GetPP(),member->GetTargetPP(),true);
|
||||||
|
|
||||||
if (player_rollwait_counter[i]==0) {
|
if (player_rollwait_counter[i]==0) {
|
||||||
player_rollwait_counter[i]=BATTLE_ROLLING_COUNTER_WAITTIME*13;
|
player_rollwait_counter[i]=BATTLE_ROLLING_COUNTER_WAITTIME*13;
|
||||||
@ -4693,7 +4728,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CalculateEquipmentStats(int partyMemberSlot,int&atk,int&def) {
|
void CalculateEquipmentStats(int partyMemberSlot,int&atk,int&def) {
|
||||||
atk=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->baseAtk;
|
atk=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->stats.baseAtk;
|
||||||
def=0;
|
def=0;
|
||||||
for (int i=0;i<PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->equipment.size();i++) {
|
for (int i=0;i<PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->equipment.size();i++) {
|
||||||
if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->equipment[i]!=nullptr) {
|
if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->equipment[i]!=nullptr) {
|
||||||
|
12
object.h
12
object.h
@ -6,6 +6,7 @@
|
|||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
#include "layers.h"
|
#include "layers.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
#include "states.h"
|
||||||
using namespace olc;
|
using namespace olc;
|
||||||
|
|
||||||
struct Interaction{
|
struct Interaction{
|
||||||
@ -59,6 +60,7 @@ class Object{
|
|||||||
//When the player tries to interact with this object.
|
//When the player tries to interact with this object.
|
||||||
virtual Interaction Interact()=0;
|
virtual Interaction Interact()=0;
|
||||||
virtual void ChoiceMade(int choice)=0;
|
virtual void ChoiceMade(int choice)=0;
|
||||||
|
virtual void DialogClosed()=0;
|
||||||
void SetScale(vd2d scale) {
|
void SetScale(vd2d scale) {
|
||||||
this->scale=scale;
|
this->scale=scale;
|
||||||
if (spr!=nullptr) {
|
if (spr!=nullptr) {
|
||||||
@ -172,7 +174,8 @@ class Object{
|
|||||||
class Standard_Obj : public Object{
|
class Standard_Obj : public Object{
|
||||||
DynamicObject(Standard_Obj)
|
DynamicObject(Standard_Obj)
|
||||||
Interaction Interact()override{return {};}
|
Interaction Interact()override{return {};}
|
||||||
void ChoiceMade(int choice)override{}
|
void DialogClosed()override{};
|
||||||
|
void ChoiceMade(int choice)override{};
|
||||||
};
|
};
|
||||||
|
|
||||||
class TrashCan_Obj : public Object{
|
class TrashCan_Obj : public Object{
|
||||||
@ -180,11 +183,13 @@ class TrashCan_Obj : public Object{
|
|||||||
Interaction Interact()override{
|
Interaction Interact()override{
|
||||||
frameIndex=1;
|
frameIndex=1;
|
||||||
return {{"You dig around the trash can.","Nope! Just looks like plain ol' trash."}};}
|
return {{"You dig around the trash can.","Nope! Just looks like plain ol' trash."}};}
|
||||||
void ChoiceMade(int choice)override{}
|
void DialogClosed()override{};
|
||||||
|
void ChoiceMade(int choice)override{};
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int MESSAGE_BOX_DIALOG_ANSWER;
|
extern int MESSAGE_BOX_DIALOG_ANSWER;
|
||||||
extern bool GAME_FLAGS[128];
|
extern bool GAME_FLAGS[128];
|
||||||
|
extern int GAME_STATE;
|
||||||
|
|
||||||
class Shopkeeper_Obj : public Object{
|
class Shopkeeper_Obj : public Object{
|
||||||
DynamicObject(Shopkeeper_Obj)
|
DynamicObject(Shopkeeper_Obj)
|
||||||
@ -214,5 +219,8 @@ class Shopkeeper_Obj : public Object{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void DialogClosed()override{
|
||||||
|
GAME_STATE = GameState::SHOPKEEPER_MENU;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user