At last, a predictive solution to plinking:
PHP:while (m_hit_chance() > 0.07) enqueue(get_action($skill[suckerpunch]));
if (have_equipped($item[fouet de tortue-dressage]) && my_location() == $location[outer compound] && // un-brainwash turtles
(contains_text(action,"frenchturtle.gif") [b]|| get_property("lastNemesisReset").to_int() == my_ascensions()[/b]) && my_stat("mp") >= 5*mp_cost($skill[apprivoisez la tortue])) {
float m_dpr(float att_mod, float stun_mod) {
adj.att += att_mod;
adj.stun += stun_mod;
float res = m_hit_chance()*m_regular();
adj.att -= att_mod;
adj.stun -= stun_mod;
return res;
}
I don't understand. Neither does the current m_dpr() then ? Wasn't the purpose of "temp" to return "adj" to its previous state after computing m_hit_chance()*m_regular() ?@slyz: That won't work -- it fails to account for unknown stat adjustment and existing multi-round stuns.
Updates coming soon -- but I'm playing a music festival this weekend so all my time right now is going into that. My first time playing on this huge a stage to this huge a crowd -- it's very exciting even if I am just one of the afternoon "filler" bands!
//Check if we should just attack the monster instead of spellslinging
boolean will_attack(monster foe)
{
float rounds;
boolean no_attack = foe == $monster[procrastination giant] || contains_text(to_lower_case(to_string(foe)), "quantum");
if(get_action("attack").id != "")
{
vprint("You have " + hitchance(1) * 100 + "% chance to hit the monster", "purple", 7);
if(dmg_dealt(get_action("attack").dmg) > 0 && hitchance(1) > 0.8)
{ //How many rounds will it take me to kill the monster by attacking
rounds = ceil(monster_stat("hp") / (dmg_dealt(get_action("attack").dmg) + m_hit_chance()*dmg_dealt(retal.dmg) + dmg_dealt(baseround().dmg)));
vprint("Expected received damage per round: " + m_dpr(0,0) + ", Rounds to kill: " + rounds + ", Expected damage: " + dmg_dealt(get_action("attack").dmg) + ", Hit chance: " + hitchance(1),"purple",8);
if(!no_attack && (ceil(my_hp() / m_dpr(0,0)) > rounds) && (rounds < 10)) //Do not attack if it isn't over quickly and do not attack giants
{
vprint("Monster is weak. We are just going to bash its head in. It'll take " + rounds + " rounds.", "purple", 2);
return true;
}
}
}
return false;
}