Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/CustomDamages' into Mack-Merges
Browse files Browse the repository at this point in the history
  • Loading branch information
MackValentine committed Nov 27, 2024
2 parents 9e72ce1 + 81f18c5 commit 7cade88
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/game_custombattle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ std::string Game_CustomBattle::parseExpression(const string& expression, const G

sub_string = chaine;

std::regex reg1("([ab])\\.((atk)*(def)*(int)*(agi)*(hp)*(mhp)*(mp)*(mmp)*(lvl)*(exp)*(id)*(isactor)*(isenemy)*)");
std::regex reg1("([ab])\\.((atk)*(def)*(int)*(agi)*(hp)*(mhp)*(mp)*(mmp)*(lvl)*(exp)*(id)*(isactor)*(isenemy)*(isdefending)*)");
std::sregex_iterator it_reg(chaine.begin(), chaine.end(), reg1);
while (it_reg != end)
{
Expand Down Expand Up @@ -551,6 +551,14 @@ std::string Game_CustomBattle::parseExpression(const string& expression, const G
value = 1;
}
}

else if (param == "isdefending") {
value = 0;
if (btl->IsDefending()) {
value = 1;
}
}

}

sub_string = std::regex_replace(sub_string, std::regex(src + "." + param), to_string(value));
Expand Down

0 comments on commit 7cade88

Please sign in to comment.