|
|
|
@ -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) { |
|
|
|
|