generated from sigonasr2/CPlusPlusProjectTemplate
Highlight multiple allies when they're getting attacked
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
170179dea4
commit
45cdc24410
Binary file not shown.
26
main.cpp
26
main.cpp
@ -745,16 +745,16 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
bool moved=false;
|
||||
vd2d movementComponents = {0,0};
|
||||
if (UpHeld()) {
|
||||
movementComponents.y-=NAN;
|
||||
movementComponents.y-=1;
|
||||
}
|
||||
if (DownHeld()) {
|
||||
movementComponents.y+=NAN;
|
||||
movementComponents.y+=1;
|
||||
}
|
||||
if (LeftHeld()) {
|
||||
movementComponents.x-=NAN;
|
||||
movementComponents.x-=1;
|
||||
}
|
||||
if (RightHeld()) {
|
||||
movementComponents.x+=NAN;
|
||||
movementComponents.x+=1;
|
||||
}
|
||||
if (movementComponents.mag()>0) {
|
||||
if (PARTY_MEMBER_OBJ[0]->SmoothMove(movementComponents)) {
|
||||
@ -1560,6 +1560,13 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
}
|
||||
}
|
||||
cameraPos+=screenShakeOffset;
|
||||
|
||||
std::vector<Entity*> attackedAllies;
|
||||
|
||||
if (CURRENT_TURN>=0&&BATTLE_STATE==BattleState::WAIT_ANIMATION&&BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget<0) {
|
||||
attackedAllies=GetEntitiesInRange(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->channelPos,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove);
|
||||
}
|
||||
|
||||
for (int i=0;i<PARTY_MEMBER_COUNT;i++) {
|
||||
Entity*member=PARTY_MEMBER_STATS[PARTY_MEMBER_ID[i]];
|
||||
Object*obj=PARTY_MEMBER_OBJ[i];
|
||||
@ -1568,7 +1575,14 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
if (CURRENT_TURN==-i-1) {
|
||||
box.y-=20;
|
||||
}
|
||||
if (CURRENT_TURN>=0&&BATTLE_STATE==BattleState::WAIT_ANIMATION&&BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget==-i-1) {
|
||||
bool underAttack=false;
|
||||
for (int j=0;j<attackedAllies.size();j++) {
|
||||
if (attackedAllies[j]->obj==PARTY_MEMBER_OBJ[i]) {
|
||||
underAttack=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (CURRENT_TURN>=0&&BATTLE_STATE==BattleState::WAIT_ANIMATION&&underAttack) {
|
||||
drawCheckerboardBox(box,{59,59},Pixel(180,159,194),Pixel(200,179,214),{6,6},RED,DARK_RED);
|
||||
} else {
|
||||
drawCheckerboardBox(box,{59,59},Pixel(180,159,194),Pixel(200,179,214),{6,6});
|
||||
@ -2035,7 +2049,7 @@ goes on a very long time, I hope you can understand this is only for testing pur
|
||||
void SetupMoveList() {
|
||||
MOVELIST[BattleMoveName::TESTMOVE1]=new Battle::Move("Test Move 1","An attack",30,5,ㅍ 0,1,0,false,{0,0,0,0});
|
||||
MOVELIST[BattleMoveName::TESTMOVE2]=new Battle::Move("Test Move 2","An attack",40,10,ㅍ 0,1,0,false,{0,0,0,0});
|
||||
MOVELIST[BattleMoveName::TESTMOVE3]=new Battle::Move("Test Move 3","An attack",25,5,ㅍ 0,1,0,false,{0,0,20,0});
|
||||
MOVELIST[BattleMoveName::TESTMOVE3]=new Battle::Move("Test Move 3","An attack",25,5,ㅍ 0,3,0,false,{0,0,20,0});
|
||||
MOVELIST[BattleMoveName::BASH]=new Battle::Move("Bash","Regular attack.",5,5,ㅍ 0,1,0,false,{0,0,0,0});
|
||||
MOVELIST[BattleMoveName::HAILSTORM_A]=new Battle::Move("Hailstorm","Causes heavy ice rocks to crash",ALPHA,40,20,ㅍ 4,4,0,false,{0,0,20,0});
|
||||
MOVELIST[BattleMoveName::HAILSTORM_B]=new Battle::Move("Hailstorm","Causes heavy ice rocks to crash",BETA,80,20,ㅍ 12,4,0,false,{0,0,20,0});
|
||||
|
Loading…
x
Reference in New Issue
Block a user