generated from sigonasr2/CPlusPlusProjectTemplate
Buff icons move over based on health text size
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
827367beca
commit
50025d2653
@ -2154,7 +2154,6 @@ public:
|
|||||||
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
|
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
|
||||||
BATTLE_DROUGHT_ACTIVE=false;
|
BATTLE_DROUGHT_ACTIVE=false;
|
||||||
std::cout<<"Drought turned off.\n";
|
std::cout<<"Drought turned off.\n";
|
||||||
PETRIFY_TURNS=std::clamp(PETRIFY_TURNS-1,0,3);
|
|
||||||
} else {
|
} else {
|
||||||
if (CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->lastSlowVal==CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->speed&&
|
if (CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->lastSlowVal==CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->speed&&
|
||||||
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->speed!=0&&rand()%3==0) {
|
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->speed!=0&&rand()%3==0) {
|
||||||
@ -2216,6 +2215,7 @@ public:
|
|||||||
//std::cout<<"Battle State is "<<BATTLE_STATE<<" (3)\n";
|
//std::cout<<"Battle State is "<<BATTLE_STATE<<" (3)\n";
|
||||||
BATTLE_STATE=battle::PLAYER_SELECTION;
|
BATTLE_STATE=battle::PLAYER_SELECTION;
|
||||||
PLAYER_SELECTED_TARGET=-1;
|
PLAYER_SELECTED_TARGET=-1;
|
||||||
|
PETRIFY_TURNS=std::clamp(PETRIFY_TURNS-1,0,3);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BATTLE_CURRENT_TURN_ENTITY=turnOrder.front();
|
BATTLE_CURRENT_TURN_ENTITY=turnOrder.front();
|
||||||
@ -2926,7 +2926,7 @@ public:
|
|||||||
DrawStringDecal({4+1,(float)(HEIGHT-10-GetTextSize("HP:").y+1)},"HP: "+std::to_string(PLAYER_HP),BLACK);
|
DrawStringDecal({4+1,(float)(HEIGHT-10-GetTextSize("HP:").y+1)},"HP: "+std::to_string(PLAYER_HP),BLACK);
|
||||||
DrawStringDecal({4,(float)(HEIGHT-10-GetTextSize("HP:").y)},"HP: "+std::to_string(PLAYER_HP));
|
DrawStringDecal({4,(float)(HEIGHT-10-GetTextSize("HP:").y)},"HP: "+std::to_string(PLAYER_HP));
|
||||||
DrawHealthbar({2,HEIGHT-10},WIDTH/2,(float)PLAYER_HP/PLAYER_MAXHP,BLACK);
|
DrawHealthbar({2,HEIGHT-10},WIDTH/2,(float)PLAYER_HP/PLAYER_MAXHP,BLACK);
|
||||||
DrawBuffs({64,HEIGHT-26});
|
DrawBuffs({64+GetTextSize(std::to_string(PLAYER_HP)).x,HEIGHT-26});
|
||||||
for (auto&numb:BATTLE_DISPLAY_NUMBERS) {
|
for (auto&numb:BATTLE_DISPLAY_NUMBERS) {
|
||||||
std::string display=((numb->number>0)?"-"+std::to_string(numb->number):"+"+std::to_string(numb->number*-1));
|
std::string display=((numb->number>0)?"-"+std::to_string(numb->number):"+"+std::to_string(numb->number*-1));
|
||||||
for (int x=-1;x<=1;x++) {
|
for (int x=-1;x<=1;x++) {
|
||||||
@ -3804,6 +3804,7 @@ public:
|
|||||||
std::cout<<"Battle State set to "<<BATTLE_STATE<<"\n";
|
std::cout<<"Battle State set to "<<BATTLE_STATE<<"\n";
|
||||||
BATTLE_DROUGHT_ACTIVE=false;
|
BATTLE_DROUGHT_ACTIVE=false;
|
||||||
FOOD_REGEN_TURNS=0;
|
FOOD_REGEN_TURNS=0;
|
||||||
|
PETRIFY_TURNS=0;
|
||||||
clearSeeds();
|
clearSeeds();
|
||||||
clearTrees();
|
clearTrees();
|
||||||
while (!turnOrder.empty()) {
|
while (!turnOrder.empty()) {
|
||||||
@ -3844,16 +3845,16 @@ public:
|
|||||||
vi2d buffPos={0,0};
|
vi2d buffPos={0,0};
|
||||||
//Draw Player's Buffs.
|
//Draw Player's Buffs.
|
||||||
if (FOOD_REGEN_TURNS>0) {
|
if (FOOD_REGEN_TURNS>0) {
|
||||||
DrawDecal(pos,HP_REGEN_DECAL);
|
DrawDecal(pos+buffPos,HP_REGEN_DECAL);
|
||||||
std::string txt=std::to_string(FOOD_REGEN_TURNS);
|
std::string txt=std::to_string(FOOD_REGEN_TURNS);
|
||||||
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x+1,pos.y+16-GetTextSize(txt).y+1},txt,VERY_DARK_GREEN);
|
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x+1,pos.y+16-GetTextSize(txt).y+1},txt,VERY_DARK_GREEN);
|
||||||
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x,pos.y+16-GetTextSize(txt).y},txt);
|
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x,pos.y+16-GetTextSize(txt).y},txt);
|
||||||
buffPos.x+=16;
|
buffPos.x+=16;
|
||||||
}
|
}
|
||||||
if (PETRIFY_TURNS>0) {
|
if (PETRIFY_TURNS>0) {
|
||||||
DrawDecal(pos,PETRIFY_DECAL);
|
DrawDecal(pos+buffPos,PETRIFY_DECAL);
|
||||||
std::string txt=std::to_string(PETRIFY_TURNS);
|
std::string txt=std::to_string(PETRIFY_TURNS);
|
||||||
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x+1,pos.y+16-GetTextSize(txt).y+1},txt,VERY_DARK_GREEN);
|
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x+1,pos.y+16-GetTextSize(txt).y+1},txt,VERY_DARK_RED);
|
||||||
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x,pos.y+16-GetTextSize(txt).y},txt);
|
DrawStringDecal({pos.x+buffPos.x-GetTextSize(txt).x,pos.y+16-GetTextSize(txt).y},txt);
|
||||||
buffPos.x+=16;
|
buffPos.x+=16;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user