Player channel time bars

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 4708a6b857
commit be3a8fd996
  1. BIN
      C++ProjectTemplate
  2. 36
      main.cpp

Binary file not shown.

@ -1764,9 +1764,26 @@ goes on a very long time, I hope you can understand this is only for testing pur
box.y-=20;
}
drawCheckerboardBox(box,{59,59},olc::Pixel(180,159,194),olc::Pixel(200,179,214),{6,6});
DrawStringDecal({(float)(box.x+6),(float)(box.y+6)},obj->name,olc::BLACK);
if (member->selectedMove==nullptr) {
DrawStringDecal({(float)(box.x+6),(float)(box.y+6)},obj->name,olc::BLACK);
} else {
DrawStringDecal({(float)(box.x+6),(float)(box.y+4)},obj->name,olc::BLACK,{1,0.8});
}
DrawPartialDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_back.png"],{0,0},{member->atb/1000.0*SPRITES["atbbar_back.png"]->sprite->width,SPRITES["atbbar_back.png"]->sprite->height});
DrawDecal({(float)(box.x+4),(float)(box.y+5+8+2)},SPRITES["atbbar_front.png"]);
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,SPRITES["atbbar_back.png"]->sprite->height},{1,1},GREEN*0.7);
std::wstring label=to_wstring(member->selectedMove->name);
if (member->selectedMove->grade!=0) {
label+=L" ";
label+=member->selectedMove->grade;
}
vd2d textOffset=GetTextSize(to_string(label))*0.6;
textOffset.y+=10;
textOffset.x+=5;
vd2d barPos = {(float)(box.x+4),(float)(box.y+5+8+2)};
DrawFancyStringDecal(barPos-textOffset/2,label,BLACK,{(float)54/GetTextSize(to_string(label)).x,0.6});
}
const olc::vi2d hpTextPos = {box.x+5,box.y+25};
for (int x=-1;x<=1;x++) {
for (int y=-1;y<=1;y++) {
@ -1787,27 +1804,12 @@ goes on a very long time, I hope you can understand this is only for testing pur
}
DrawStringDecal(mpTextPos,"PP",olc::BLACK);
DrawRollingCounter(mpTextPos,member->PP,player_rollpp_display[i],player_rollpp_counter[i]);
if (member->selectedMove!=nullptr) {
vi2d barOffset={-SPRITES["atbbar_front.png"]->sprite->width/2,8};
DrawPartialDecal(obj->GetPos()+obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_back.png"],{0,0},{(1-((float)member->channelTimeRemaining/member->selectedMove->channelTime))*SPRITES["atbbar_back.png"]->sprite->width,SPRITES["atbbar_back.png"]->sprite->height},{1,1},YELLOW);
DrawDecal(obj->GetPos()+obj->originPoint-cameraPos+barOffset,SPRITES["atbbar_front.png"]);
std::wstring label=to_wstring(member->selectedMove->name);
if (member->selectedMove->grade!=0) {
label+=L" ";
label+=member->selectedMove->grade;
}
vd2d textOffset=GetTextSize(to_string(label))*0.6;
textOffset.y-=6;
vi2d shadowOffset = {1,1};
DrawFancyStringDecal(obj->GetPos()+obj->originPoint-cameraPos+barOffset-textOffset/2+shadowOffset,label,BLACK,{0.6,0.6});
DrawFancyStringDecal(obj->GetPos()+obj->originPoint-cameraPos+barOffset-textOffset/2,label,WHITE,{0.6,0.6});
}
}
for (int i=0;i<BATTLE_ENCOUNTER->objs.size();i++) {
Entity*obj = BATTLE_ENCOUNTER->objs[i];
if (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,SPRITES["atbbar_back.png"]->sprite->height},{1,1},YELLOW);
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,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::wstring label=to_wstring(obj->selectedMove->name);
if (obj->selectedMove->grade!=0) {

Loading…
Cancel
Save