diff --git a/SeasonsOfLoneliness.cpp b/SeasonsOfLoneliness.cpp index 959ec8d..5b59797 100644 --- a/SeasonsOfLoneliness.cpp +++ b/SeasonsOfLoneliness.cpp @@ -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 "<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 "<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. diff --git a/Seasons_of_Loneliness b/Seasons_of_Loneliness index 757ec37..a558c65 100755 Binary files a/Seasons_of_Loneliness and b/Seasons_of_Loneliness differ