|
|
|
@ -1,3 +1,4 @@ |
|
|
|
|
#include "entity.h" |
|
|
|
|
#include "item.h" |
|
|
|
|
#include "layers.h" |
|
|
|
|
#include <string> |
|
|
|
@ -1387,19 +1388,23 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::ATKINCREASE:{ |
|
|
|
|
target->baseAtk+=item->stats.atkIncrease; |
|
|
|
|
target->boosts[boost::ATK]+=item->stats.atkIncrease; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::HPINCREASE:{ |
|
|
|
|
target->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; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::PPINCREASE:{ |
|
|
|
|
target->maxPP+=item->stats.ppIncrease; |
|
|
|
|
target->AddPP(item->stats.ppIncrease); |
|
|
|
|
target->boosts[boost::PP]+=item->stats.ppIncrease; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::SPDINCREASE:{ |
|
|
|
|
target->speed+=item->stats.spdIncrease; |
|
|
|
|
target->boosts[boost::SPD]+=item->stats.spdIncrease; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::LEARNMOVE:{ |
|
|
|
|
bool moveLearned=false; |
|
|
|
@ -1869,17 +1874,69 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
DrawStringPropDecal({72+GetTextSizeProp(defStr).x*0.85F,HEIGHT*(5.F/8)+12},std::to_string(newDefense),(newDefense>equipDefense)?GREEN:(newDefense<equipDefense)?RED:WHITE,{0.85,2}); |
|
|
|
|
} |
|
|
|
|
if (GAME_STATE==GameState::OVERWORLD_STATUS_MENU) { |
|
|
|
|
Entity*member=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[OVERWORLD_POWER_SELECTION_MEMBER]]; |
|
|
|
|
DrawDialogBox({4,4},{(int)(WIDTH-8),(int)(HEIGHT/2)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220)); |
|
|
|
|
int nameWidth=GetTextSizeProp(PARTY_MEMBER_OBJ[OVERWORLD_POWER_SELECTION_MEMBER]->name).x/2; |
|
|
|
|
DrawStringPropDecal({(float)(WIDTH-12-nameWidth),4},PARTY_MEMBER_OBJ[OVERWORLD_POWER_SELECTION_MEMBER]->name,WHITE,{0.5,1}); |
|
|
|
|
int nameWidth=GetTextSizeProp(member->obj->name).x/2; |
|
|
|
|
DrawStringPropDecal({(float)(WIDTH-12-nameWidth),4},member->obj->name,WHITE,{0.5,1}); |
|
|
|
|
DrawRotatedDecal({(float)(WIDTH-nameWidth-16),7},SPRITES["cursor.png"],M_PI,{(float)SPRITES["cursor.png"]->sprite->width/2,(float)SPRITES["cursor.png"]->sprite->height/2},{(sinf(frameCount/10.F*M_PI)>0)?0.5F:0.25F,(sinf(frameCount/10.F*M_PI)>0)?0.5F:0.25F}); |
|
|
|
|
DrawRotatedDecal({(float)(WIDTH-8),7},SPRITES["cursor.png"],0,{(float)SPRITES["cursor.png"]->sprite->width/2,(float)SPRITES["cursor.png"]->sprite->height/2},{(sinf(frameCount/10.F*M_PI)>0)?0.5F:0.25F,(sinf(frameCount/10.F*M_PI)>0)?0.5F:0.25F}); |
|
|
|
|
vi2d drawPos={8,8}; |
|
|
|
|
DrawStringPropDecal(drawPos,PARTY_MEMBER_OBJ[OVERWORLD_POWER_SELECTION_MEMBER]->name); |
|
|
|
|
DrawStringPropDecal(drawPos,member->obj->name); |
|
|
|
|
drawPos.y+=12; |
|
|
|
|
if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[OVERWORLD_POWER_SELECTION_MEMBER]]->GetPrimaryStatusEffect()!=Property::NONE) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
Property statusEffect = member->GetPrimaryStatusEffect(); |
|
|
|
|
if (statusEffect!=Property::NONE) { |
|
|
|
|
DrawStringPropDecal(drawPos,BATTLE_PROPERTIES[statusEffect]->displayName); |
|
|
|
|
} |
|
|
|
|
drawPos.y+=24; |
|
|
|
|
drawPos.x+=96; |
|
|
|
|
std::string displayStr1 = "ATK Boosts: "; |
|
|
|
|
std::string displayStr2 = "+"+std::to_string(member->boosts[boost::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]); |
|
|
|
|
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]); |
|
|
|
|
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]); |
|
|
|
|
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; |
|
|
|
|
drawPos={WIDTH-40,20}; |
|
|
|
|
int calculatedAtk=0; |
|
|
|
|
int calculatedDef=0; |
|
|
|
|
CalculateEquipmentStats(OVERWORLD_POWER_SELECTION_MEMBER,calculatedAtk,calculatedDef); |
|
|
|
|
displayStr1 = "ATK: "; |
|
|
|
|
displayStr2 = std::to_string(calculatedAtk); |
|
|
|
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); |
|
|
|
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); |
|
|
|
|
drawPos.y+=12; |
|
|
|
|
displayStr1 = "DEF: "; |
|
|
|
|
displayStr2 = std::to_string(calculatedDef); |
|
|
|
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); |
|
|
|
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); |
|
|
|
|
drawPos.y+=12; |
|
|
|
|
displayStr1 = "HP: "; |
|
|
|
|
displayStr2 = std::to_string(member->maxHP); |
|
|
|
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); |
|
|
|
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); |
|
|
|
|
drawPos.y+=12; |
|
|
|
|
displayStr1 = "PP: "; |
|
|
|
|
displayStr2 = std::to_string(member->maxPP); |
|
|
|
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); |
|
|
|
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); |
|
|
|
|
drawPos.y+=12; |
|
|
|
|
displayStr1 = "SPD: "; |
|
|
|
|
displayStr2 = std::to_string(member->speed); |
|
|
|
|
DrawStringPropDecal({(float)(drawPos.x-GetTextSizeProp(displayStr1).x),(float)drawPos.y},displayStr1); |
|
|
|
|
DrawStringPropDecal({(float)(WIDTH-8-GetTextSizeProp(displayStr2).x),(float)drawPos.y},displayStr2); |
|
|
|
|
} |
|
|
|
|
if (GAME_STATE==GameState::OVERWORLD_POWER_MENU||GAME_STATE==GameState::OVERWORLD_POWER_PLAYER_MENU||GAME_STATE==GameState::OVERWORLD_GRADE_MENU) { |
|
|
|
|
DrawBattleMoveList(OVERWORLD_POWER_SELECTION_MEMBER); |
|
|
|
@ -2483,6 +2540,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
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[PLAYER]->statusEffects[Property::MUSHROOMIZED]=4; |
|
|
|
|
PARTY_MEMBER_STATS[PLAYER]->moveSet={ |
|
|
|
|
MOVELIST[BattleMoveName::HAILSTORM_A], |
|
|
|
|
MOVELIST[BattleMoveName::HAILSTORM_B], |
|
|
|
@ -2589,6 +2647,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
CreateSprite("crosshair.png"); |
|
|
|
|
CreateSprite("arrow_connector.png"); |
|
|
|
|
CreateSprite("pixel.png"); |
|
|
|
|
CreateSprite("bufficons.png"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SetupObjectInfo() { |
|
|
|
@ -3411,17 +3470,21 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::ATKINCREASE:{ |
|
|
|
|
target->baseAtk+=BATTLE_CUSTOM_ITEM->stats.atkIncrease; |
|
|
|
|
target->boosts[boost::ATK]+=BATTLE_CUSTOM_ITEM->stats.atkIncrease; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::HPINCREASE:{ |
|
|
|
|
target->maxHP+=BATTLE_CUSTOM_ITEM->stats.hpIncrease; |
|
|
|
|
target->AddHP(BATTLE_CUSTOM_ITEM->stats.hpIncrease); |
|
|
|
|
target->boosts[boost::HP]+=BATTLE_CUSTOM_ITEM->stats.hpIncrease; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::PPINCREASE:{ |
|
|
|
|
target->maxPP+=BATTLE_CUSTOM_ITEM->stats.ppIncrease; |
|
|
|
|
target->AddPP(BATTLE_CUSTOM_ITEM->stats.ppIncrease); |
|
|
|
|
target->boosts[boost::PP]+=BATTLE_CUSTOM_ITEM->stats.ppIncrease; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::SPDINCREASE:{ |
|
|
|
|
target->speed+=BATTLE_CUSTOM_ITEM->stats.spdIncrease; |
|
|
|
|
target->boosts[boost::SPD]+=BATTLE_CUSTOM_ITEM->stats.spdIncrease; |
|
|
|
|
}break; |
|
|
|
|
case ItemAction::LEARNMOVE:{ |
|
|
|
|
bool moveLearned=false; |
|
|
|
@ -4523,6 +4586,17 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CalculateEquipmentStats(int partyMemberSlot,int&atk,int&def) { |
|
|
|
|
atk=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->baseAtk; |
|
|
|
|
def=0; |
|
|
|
|
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) { |
|
|
|
|
atk+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->equipment[i]->stats.attack; |
|
|
|
|
def+=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->equipment[i]->stats.defense; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CalculateChangeInEquipmentStats(int partyMemberSlot,int itemSlot,int&equipAttack,int&equipDefense,int&newAttack,int&newDefense) { |
|
|
|
|
EquipSlot::Equip slot; |
|
|
|
|
if (itemSlot==-1) { |
|
|
|
|