Fix bugs with battle move bar displays

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent c3e3ececcc
commit 169478fdfe
  1. BIN
      C++ProjectTemplate
  2. 6
      main.cpp

Binary file not shown.

@ -2665,7 +2665,7 @@ void SeasonI::drawGame(){
DrawDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_front.png"],{1,1},Pixel(255,255,255,boxAlpha));
}
if (member->selectedMove!=nullptr) {
DrawPartialDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_back.png"],{0,0},{(1-((float)member->channelTimeRemaining/member->selectedMove->channelTime))*SPRITES["atbbar_back.png"]->sprite->width,static_cast<float>(SPRITES["atbbar_back.png"]->sprite->height)},{1,1},Pixel(0,178,0,boxAlpha));
DrawPartialDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_back.png"],{0,0},{(1-((member->selectedMove->channelTime==0)?0:((float)member->channelTimeRemaining/member->selectedMove->channelTime)))*SPRITES["atbbar_back.png"]->sprite->width,static_cast<float>(SPRITES["atbbar_back.png"]->sprite->height)},{1,1},Pixel(0,178,0,boxAlpha));
std::string label=member->selectedMove->name;
label+=" ";
if (member->selectedMove->grade!=0) {
@ -3137,7 +3137,7 @@ void SeasonI::drawGame(){
Entity*obj = BATTLE_ENCOUNTER->objs[i];
if (obj->GetHP()>0&&obj->selectedMove!=nullptr) {
vi2d barOffset={-SPRITES["atbbar_front.png"]->sprite->width/2,8};
DrawPartialDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_back.png"],{0,0},{(1-((float)obj->channelTimeRemaining/obj->selectedMove->channelTime))*SPRITES["atbbar_back.png"]->sprite->width,static_cast<float>(SPRITES["atbbar_back.png"]->sprite->height)},{1,1},YELLOW*0.8);
DrawPartialDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_back.png"],{0,0},{(1-((obj->selectedMove->channelTime==0)?0:((float)obj->channelTimeRemaining/obj->selectedMove->channelTime)))*SPRITES["atbbar_back.png"]->sprite->width,static_cast<float>(SPRITES["atbbar_back.png"]->sprite->height)},{1,1},YELLOW*0.8);
DrawDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_front.png"]);
std::string label=obj->selectedMove->name;
if (obj->selectedMove->grade!=0) {
@ -4432,7 +4432,7 @@ void SeasonI::DrawGameWorld() {
accX+=obj->GetScale().x;
for (int yy=0;yy<obj->spr->sprSize.y;yy++) {
accY+=obj->GetScale().y;
Pixel col = data[yy*obj->spr->spr->sprite->width+xx+((obj->frameIndex%obj->spr->frames)*obj->spr->sprSize.x)];
Pixel col = data[(yy+obj->animationSubIndex*obj->spr->sprSize.y)*obj->spr->spr->sprite->width+xx+((obj->frameIndex%obj->spr->frames)*obj->spr->sprSize.x)];
while (accY>=1) {
for (int xxx=0;xxx<accX;xxx++) {
if (col.a>64) {

Loading…
Cancel
Save