Add in hidden buff effects

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent f2e6a46bb8
commit 645bcfbb2d
  1. 16
      SeasonsOfLoneliness.cpp
  2. BIN
      Seasons_of_Loneliness

@ -2985,6 +2985,7 @@ public:
}
printf("\n");
}
f.close();
}
void changeAnimation(Animation*anim) {
@ -3116,7 +3117,7 @@ public:
finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage);
Entity*ent=CURRENT_ENCOUNTER.entities[i];
std::cout<<"Distance is "<<distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<<"m.\n";
if (distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<=power->range) {
if (distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<=power->range&&!ent->hidden) {
ent->hp=std::clamp(ent->hp-finalDamage,0,ent->maxhp);
CreateDisplayNumber(finalDamage,ent->x+CURRENT_ENCOUNTER.x+ent->spr->sprite->width*ent->sprScale.x/2/32,ent->y+CURRENT_ENCOUNTER.y+ent->spr->sprite->height*ent->sprScale.y/2/32,frameCount);
ent->damageFrame=frameCount;
@ -3130,7 +3131,7 @@ public:
finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage);
Entity*ent=CURRENT_ENCOUNTER.entities[i];
//std::cout<<"Distance was "<<distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32),(float)((ent->y+CURRENT_ENCOUNTER.y)*32)},coords*32)<<"\n";
if (ent->hp>0&&distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<=power->range) {
if (ent->hp>0&&distancetoCoords({(float)((ent->x+CURRENT_ENCOUNTER.x)*32)+ent->spr->sprite->width*ent->sprScale.x/2,(float)((ent->y+CURRENT_ENCOUNTER.y)*32)+ent->spr->sprite->height*ent->sprScale.y/2},coords*32)<=power->range&&!ent->hidden) {
ent->hp=std::clamp(ent->hp-finalDamage,0,ent->maxhp);
CreateDisplayNumber(finalDamage,ent->x+CURRENT_ENCOUNTER.x+ent->spr->sprite->width*ent->sprScale.x/2/32,ent->y+CURRENT_ENCOUNTER.y+ent->spr->sprite->height*ent->sprScale.y/2/32,frameCount);
ent->damageFrame=frameCount;
@ -3543,11 +3544,18 @@ public:
void DrawBuffs(vf2d pos,Entity*ent) {
if (ent!=NULL) {
vi2d buffPos={0,0};
if (ent->speed==-1) {
DrawDecal(pos,SLOWED_DECAL);
DrawDecal(pos+buffPos,SLOWED_DECAL);
buffPos.x+=16;
} else
if (ent->speed==1) {
DrawDecal(pos,SPEED_DECAL);
DrawDecal(pos+buffPos,SPEED_DECAL);
buffPos.x+=16;
}
if (ent->hidden) {
DrawDecal(pos+buffPos,HIDDEN_DECAL);
buffPos.x+=16;
}
} else {
//Draw Player's Buffs.

Binary file not shown.
Loading…
Cancel
Save