generated from sigonasr2/CPlusPlusProjectTemplate
Fix damage number positioning
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
988925a430
commit
0dc3d66620
@ -1571,11 +1571,11 @@ public:
|
||||
effectRadius({CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->x+CURRENT_ENCOUNTER.x,CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->y+CURRENT_ENCOUNTER.y},ref,true); }
|
||||
} else {
|
||||
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,false);
|
||||
if (ref==LIGHT_STORM&&CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->name.compare("X_X")==0) {
|
||||
CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr=X_X_UNCHARGED_DECAL;
|
||||
if (ref==LIGHT_STORM&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
|
||||
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr=X_X_UNCHARGED_DECAL;
|
||||
} else
|
||||
if (ref==SEED_PELLET&&CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->name.compare("X_X")==0) {
|
||||
CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr=X_X_DECAL;
|
||||
if (ref==SEED_PELLET&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
|
||||
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr=X_X_DECAL;
|
||||
}
|
||||
}
|
||||
} else
|
||||
@ -1628,7 +1628,7 @@ public:
|
||||
int dmgAmt=10*TREES.size();
|
||||
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
|
||||
if (CURRENT_ENCOUNTER.entities[i]->hp>0) {
|
||||
CreateDisplayNumber(dmgAmt,CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[i]->x,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[i]->y,frameCount);
|
||||
CreateDisplayNumber(dmgAmt,CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[i]->x+CURRENT_ENCOUNTER.entities[i]->spr->sprite->width*CURRENT_ENCOUNTER.entities[i]->sprScale.x/2/32,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[i]->y+CURRENT_ENCOUNTER.entities[i]->spr->sprite->height*CURRENT_ENCOUNTER.entities[i]->sprScale.y/2/32,frameCount);
|
||||
CURRENT_ENCOUNTER.entities[i]->hp=std::clamp(CURRENT_ENCOUNTER.entities[i]->hp-dmgAmt,0,CURRENT_ENCOUNTER.entities[i]->maxhp);
|
||||
}
|
||||
}
|
||||
@ -2123,13 +2123,6 @@ public:
|
||||
}
|
||||
SetDrawTarget(2);
|
||||
if (IN_BATTLE_ENCOUNTER) {
|
||||
const vi2d CENTER = {(float)((BATTLE_PLAYER_COORDS.x-PLAYER_COORDS[0])*32+WIDTH/2+(current_playerAnim->flipped?32:0)),(float)((BATTLE_PLAYER_COORDS.y-PLAYER_COORDS[1])*32+HEIGHT/2)};
|
||||
for (int i=0;i<SEEDS.size();i++) {
|
||||
DrawDecal(SEEDS[i]->pos+CENTER,SEED_DECAL,{0.5,0.5});
|
||||
}
|
||||
for (int i=0;i<TREES.size();i++) {
|
||||
DrawDecal(TREES[i]->pos+CENTER,TREE_DECAL,{1,1});
|
||||
}
|
||||
DrawPartialDecal({(float)((BATTLE_PLAYER_COORDS.x-PLAYER_COORDS[0])*32+WIDTH/2-16+(current_playerAnim->flipped?32:0)),(float)((BATTLE_PLAYER_COORDS.y-PLAYER_COORDS[1])*32+HEIGHT/2-16)},current_playerAnim->spr,current_playerAnim->getCurrentFrame(),{32,32},{(float)(current_playerAnim->flipped?-1:1),1});
|
||||
} else {
|
||||
DrawPartialDecal({(float)(WIDTH/2-16+(current_playerAnim->flipped?32:0)),(float)(HEIGHT/2-16)},current_playerAnim->spr,current_playerAnim->getCurrentFrame(),{32,32},{(float)(current_playerAnim->flipped?-1:1),1});
|
||||
@ -2298,6 +2291,15 @@ public:
|
||||
GradientFillRectDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},{32,32},Pixel(0,0,0,0),WHITE,WHITE,Pixel(0,0,0,0));
|
||||
}
|
||||
}
|
||||
if (IN_BATTLE_ENCOUNTER) {
|
||||
const vi2d CENTER = {(float)((BATTLE_PLAYER_COORDS.x-PLAYER_COORDS[0])*32+WIDTH/2+(current_playerAnim->flipped?32:0)),(float)((BATTLE_PLAYER_COORDS.y-PLAYER_COORDS[1])*32+HEIGHT/2)};
|
||||
for (int i=0;i<SEEDS.size();i++) {
|
||||
DrawDecal(SEEDS[i]->pos+CENTER,SEED_DECAL,{0.5,0.5});
|
||||
}
|
||||
for (int i=0;i<TREES.size();i++) {
|
||||
DrawDecal(TREES[i]->pos+CENTER,TREE_DECAL,{1,1});
|
||||
}
|
||||
}
|
||||
for (auto&enc:ENCOUNTERS) {
|
||||
int targetX=-1,targetY=-1;
|
||||
for (auto&ent:enc.entities) {
|
||||
|
Binary file not shown.
6
data.h
6
data.h
@ -99,13 +99,13 @@ $PLAYER
|
||||
I'd better be careful, this ain't no ordinary monster... And what's with that weird sigil on its body..?)",//22
|
||||
R"(
|
||||
$PLAYER
|
||||
Urgh...Not good, the sigil stopped glowing too. I think I'm safe for now.)",//23
|
||||
Urgh...Not good, but looks like I'm safe for now. Now then...)",//23
|
||||
R"(
|
||||
$PLAYER
|
||||
Time to use Petal Storm. It allows me to regenerate health while setting up seeds!)",//24
|
||||
Time to use Petal Storm! It allows me to regenerate health while setting up seeds!)",//24
|
||||
R"(
|
||||
$PLAYER
|
||||
Then I'll be able to use Hurricane powers in order to grow them, nourishing me while dealing additional damage!)",//25
|
||||
Then I'll be able to use Hurricane powers in order to grow them, nourishing me and dealing additional damage!)",//25
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user