Random rolls happen per target now. Flashing is a bit more controlled. Shadow is properly black now

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent fba1aba9e9
commit c99aed13db
  1. BIN
      C++ProjectTemplate
  2. 16
      main.cpp

Binary file not shown.

@ -1612,11 +1612,11 @@ goes on a very long time, I hope you can understand this is only for testing pur
}
}
for (auto numb:DAMAGE_NUMBERS) {
vd2d shadowOffset={1,1};
vd2d textSize = GetTextSizeProp((numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage));
DrawStringPropDecal(numb->pos+shadowOffset-cameraPos-textSize/2,(numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage),BLACK,{1,2});
DrawStringPropDecal(numb->pos-cameraPos-textSize/2,(numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage),(numb->damage>=0)?RED:GREEN,{1,2});
vd2d shadowOffset={1,1};
DrawStringPropDecal(numb->pos+shadowOffset-cameraPos-textSize/2,(numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage),(numb->damage>=0)?RED:GREEN,{1,2});
DrawStringPropDecal(numb->pos-cameraPos-textSize/2,(numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage),Pixel(255,255,255,sin((M_PI*frameCount)/30)*128),{1,2});
DrawStringPropDecal(numb->pos-cameraPos-textSize/2,(numb->damage>=0)?"-"+std::to_string(numb->damage):"+"+std::to_string(-numb->damage),Pixel(255,255,255,abs(sin((M_PI*frameCount)/30)*128)),{1,2});
}
if (messageBoxVisible) {
SetDrawTarget(layer::INTERFACE);
@ -2930,10 +2930,10 @@ goes on a very long time, I hope you can understand this is only for testing pur
if (CURRENT_TURN<0) {
if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->friendly) {
if (PARTY_MEMBER_STATS[-PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedTarget-1]->GetHP()>0) {
for (auto&ent:GetEntitiesInRange(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedTarget,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove)) {
int healAmt = PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->baseDmg+
((PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->randomDmg>0)?rand()%PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->randomDmg:0)
+PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->baseAtk;
for (auto&ent:GetEntitiesInRange(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedTarget,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove)) {
if (ent->GetHP()>0) {
std::cout << PARTY_MEMBER_OBJ[-CURRENT_TURN-1]->name << " uses " << PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->name << " " << PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->grade << " on " << ent->obj->name << " recovering " << healAmt << " health.\n";
ent->AddHP(healAmt);
@ -2947,11 +2947,11 @@ goes on a very long time, I hope you can understand this is only for testing pur
}
} else {
if (BATTLE_ENCOUNTER->objs[PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedTarget]->GetHP()>0) {
//Enemies have their health directly set.
for (auto&ent:GetEntitiesInRange(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedTarget,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove)) {
int dmgAmt = PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->baseDmg+
((PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->randomDmg>0)?rand()%PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->randomDmg:0)
+PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->baseAtk;
//Enemies have their health directly set.
for (auto&ent:GetEntitiesInRange(PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedTarget,PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove)) {
if (ent->GetHP()>0) {
std::cout << PARTY_MEMBER_OBJ[-CURRENT_TURN-1]->name << " uses " << PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->name << " " << PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->grade << " on " << ent->obj->name << " dealing " << dmgAmt << " health.\n";
ent->_SetDirectHP(ent->GetHP()-dmgAmt);
@ -2969,10 +2969,10 @@ goes on a very long time, I hope you can understand this is only for testing pur
} else {
if (BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->friendly) {
if (BATTLE_ENCOUNTER->objs[BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget]->GetHP()>0) {
for (auto&ent:GetEntitiesInRange(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove)) {
int healAmt = BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->baseDmg+
((rand()%BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->randomDmg>0)?rand()%BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->randomDmg:0)
+BATTLE_ENCOUNTER->objs[CURRENT_TURN]->baseAtk;
for (auto&ent:GetEntitiesInRange(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove)) {
if (ent->GetHP()>0) {
std::cout << BATTLE_ENCOUNTER->objs[CURRENT_TURN]->obj->name << " uses " << BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->name << " " << BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->grade << " on " << ent->obj->name << " recovering " << healAmt << " health.\n";
ent->AddHP(healAmt);
@ -2984,10 +2984,10 @@ goes on a very long time, I hope you can understand this is only for testing pur
}
} else {
if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget-1]]->GetHP()>0) {
for (auto&ent:GetEntitiesInRange(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove)) {
int dmgAmt = BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->baseDmg+
((rand()%BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->randomDmg>0)?rand()%BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->randomDmg:0)
+BATTLE_ENCOUNTER->objs[CURRENT_TURN]->baseAtk;
for (auto&ent:GetEntitiesInRange(BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedTarget,BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove)) {
if (ent->GetHP()>0) {
std::cout << BATTLE_ENCOUNTER->objs[CURRENT_TURN]->obj->name << " uses " << BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->name << " " << BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->grade << " on " << ent->obj->name << " dealing " << dmgAmt << " health.\n";
ent->SubtractHP(dmgAmt);

Loading…
Cancel
Save