generated from sigonasr2/CPlusPlusProjectTemplate
Fix bugs with battle move bar displays
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
c3e3ececcc
commit
169478fdfe
Binary file not shown.
6
main.cpp
6
main.cpp
@ -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));
|
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) {
|
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;
|
std::string label=member->selectedMove->name;
|
||||||
label+=" ";
|
label+=" ";
|
||||||
if (member->selectedMove->grade!=0) {
|
if (member->selectedMove->grade!=0) {
|
||||||
@ -3137,7 +3137,7 @@ void SeasonI::drawGame(){
|
|||||||
Entity*obj = BATTLE_ENCOUNTER->objs[i];
|
Entity*obj = BATTLE_ENCOUNTER->objs[i];
|
||||||
if (obj->GetHP()>0&&obj->selectedMove!=nullptr) {
|
if (obj->GetHP()>0&&obj->selectedMove!=nullptr) {
|
||||||
vi2d barOffset={-SPRITES["atbbar_front.png"]->sprite->width/2,8};
|
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"]);
|
DrawDecal(obj->obj->GetPos()+obj->obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_front.png"]);
|
||||||
std::string label=obj->selectedMove->name;
|
std::string label=obj->selectedMove->name;
|
||||||
if (obj->selectedMove->grade!=0) {
|
if (obj->selectedMove->grade!=0) {
|
||||||
@ -4432,7 +4432,7 @@ void SeasonI::DrawGameWorld() {
|
|||||||
accX+=obj->GetScale().x;
|
accX+=obj->GetScale().x;
|
||||||
for (int yy=0;yy<obj->spr->sprSize.y;yy++) {
|
for (int yy=0;yy<obj->spr->sprSize.y;yy++) {
|
||||||
accY+=obj->GetScale().y;
|
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) {
|
while (accY>=1) {
|
||||||
for (int xxx=0;xxx<accX;xxx++) {
|
for (int xxx=0;xxx<accX;xxx++) {
|
||||||
if (col.a>64) {
|
if (col.a>64) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user