Implemented single target selection healing

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent c8514d9fe7
commit 50b678211b
  1. BIN
      C++ProjectTemplate
  2. 42
      main.cpp

Binary file not shown.

@ -160,6 +160,7 @@ public:
int OVERWORLD_TARGET_SELECTION=0;
bool HEALING_OVERWORLD_MEMBERS=false; //When set to true, members will be healed as dialog boxes are closed using the HEALING_OVERWORLD_MEMBER variable.
int HEALING_OVERWORLD_MEMBER=0;
bool HEALING_OVERWORLD_SINGLE_MEMBER=false; //When set to true, a single member is being healed.
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
@ -337,6 +338,25 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
}
castingMember->selectedMove=nullptr;
}
if (HEALING_OVERWORLD_SINGLE_MEMBER) {
Entity*castingMember=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[OVERWORLD_POWER_SELECTION_MEMBER]];
castingMember->selectedMove=OVERWORLD_SELECTED_POWER;
Entity*target=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[OVERWORLD_TARGET_SELECTION]];
int healAmt = CalculateHealing(castingMember);
vi2d box = {(128-32*PARTY_MEMBER_COUNT)+OVERWORLD_TARGET_SELECTION*64+29,170};
DAMAGE_NUMBERS.push_back(new DamageNumber(-healAmt,box+cameraPos));
target->AddHP(healAmt);
if (target->GetHP()>0) {
targetText+=target->obj->name+" recovered "+std::to_string(healAmt)+" hitpoints.";
} else {
targetText+="But it failed.";
}
messageBoxLoad=true;
messageBoxVisible=true;
HEALING_OVERWORLD_SINGLE_MEMBER=false;
GAME_STATE=GameState::OVERWORLD_GRADE_MENU;
castingMember->selectedMove=nullptr;
}
}
} else {
while (messageBoxMarker<messageBoxFinalText.length()) {
@ -1194,6 +1214,26 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
}
}
}break;
case GameState::OVERWORLD_TARGET_MENU:{
if (RightPressed()) {
OVERWORLD_TARGET_SELECTION=(OVERWORLD_TARGET_SELECTION+1)%PARTY_MEMBER_COUNT;
}
if (LeftPressed()) {
OVERWORLD_TARGET_SELECTION--;
if (OVERWORLD_TARGET_SELECTION<0) {
OVERWORLD_TARGET_SELECTION=PARTY_MEMBER_COUNT-1;
}
}
if (UpPressed()){
GAME_STATE=GameState::OVERWORLD_GRADE_MENU;
}
if (ACTIONKEYPRESSED) {
HEALING_OVERWORLD_SINGLE_MEMBER=true;
Battle::Move*move=BATTLE_MOVELIST_DISPLAY[OVERWORLD_POWER_SELECTION_CURSOR[OVERWORLD_POWER_SELECTION_MEMBER]][OVERWORLD_POWER_GRADE_CURSOR];
PARTY_MEMBER_STATS[PARTY_MEMBER_ID[OVERWORLD_POWER_SELECTION_MEMBER]]->SubtractPP(move->PPCost);
DisplayMessageBox(PARTY_MEMBER_OBJ[OVERWORLD_POWER_SELECTION_MEMBER]->name+" begins to cast "+move->GetPowerName()+".\n");
}
}break;
case GameState::EDITOR:{
if (IsTextEntryEnabled()) {
return;
@ -3865,10 +3905,10 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
OVERWORLD_SELECTED_POWER=move;
OVERWORLD_TARGET_SELECTION=0;
if (move->name=="PK Lifeup") {
PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->SubtractPP(move->PPCost);
if (move->range==1) {
GAME_STATE=GameState::OVERWORLD_TARGET_MENU;
} else {
PARTY_MEMBER_STATS[PARTY_MEMBER_ID[partyMemberSlot]]->SubtractPP(move->PPCost);
DisplayMessageBox(PARTY_MEMBER_OBJ[partyMemberSlot]->name+" begins to cast "+move->GetPowerName()+".\n");
HEALING_OVERWORLD_MEMBERS=true;
HEALING_OVERWORLD_MEMBER=0;

Loading…
Cancel
Save