I'm trying to build something that can perform different actions based on the current HP of whatever you're fighting.
I've found a potentially workable, though incredibly hardcoded and inelegant, solution via a consult script using monster_HP() and a gigantic series of nested if statements. I'm pretty confident there's a better way to go about this though.
...Of course, while typing this, inspiration struck-- at a glance, is this vein of thought about as good as it gets?
string run(int round, string opp, string text) {
for i from 1 to 30 {
if (monster_HP() < Target){
return get_ccs_action(31);
}
else {
return get_ccs_action(round);
}
where each turn's commands are in the CSS and a 31st turn gives the conditional behavior.
I've found a potentially workable, though incredibly hardcoded and inelegant, solution via a consult script using monster_HP() and a gigantic series of nested if statements. I'm pretty confident there's a better way to go about this though.
...Of course, while typing this, inspiration struck-- at a glance, is this vein of thought about as good as it gets?
string run(int round, string opp, string text) {
for i from 1 to 30 {
if (monster_HP() < Target){
return get_ccs_action(31);
}
else {
return get_ccs_action(round);
}
where each turn's commands are in the CSS and a 31st turn gives the conditional behavior.