roippi
Developer
haha. I should've linked to cat fancy magazine.
ETA: oh great, THIS post gets a new page.
[2091] Battlefield (Hippy Uniform)
Encounter: Naughty Sorority Nurse
Strategy: C:\KolMafia\ccs\CafeBoob.ccs [default]
Round 0: cafeboob loses initiative!
Division by zero (BatBrain.ash, line 576)
Round 1: cafeboob attacks!
ETA: would an .isstunnable proxy record make sense? Do $monsters even have proxy data?
If you are using a Black Cat, drop rate is never 100%.
Edit: Any way to have kill_rounds combine damage and hit chance? I split out a version that does dmg_dealt(regular(1)) * hitchance(1) inside, but if there were an official way to do this, it would be more accurate for monsters that you can easily kill if you'd ever hit them...
The first is what was printed in BatBrain 1.3, the second is my modified version of kill_rounds to try to add in hit_chance properly, and the third is what you suggested using...> ash import <batbrain> kill_rounds(regular(1))
Returned: 4
> ash import <batbrain> (dmg_dealt(regular(1)) * hitchance("attack") == 0 ? 999999 : ceil(to_float(monster_stat("hp")) / (dmg_dealt(regular(1)) * hitchance(1) + m_hit_chance()*dmg_dealt(retal.dmg) + dmg_dealt(baseround().dmg))));
Returned: 42
> ash import <batbrain> kill_rounds(get_action("attack"))
Returned: 1120000
return minmax((6.0 + attack - max(monster_stat("def"),0.0))/11.0 - fumble_chance(),critchance(),1.0);
return minmax((6.0 + attack - max(monster_stat("def"),0.0))/11.0 - fumble_chance() + critchance(),critchance(),1.0);
If it thinks that it will do 0 damage every hit, even on the criticals, there isn't much hope of finishing off the battle...> ash import <batbrain> get_action("attack").dmg[$element[none]]
Returned: 0.0
That was against directly following this fight:> ashq import <batbrain> foreach el in $elements[] print(get_action("attack").dmg[el])
0.0
0.0
0.0
0.0
0.0
0.0
Not sure how it got to 0 from this:[2395] Haunted Ballroom
Encounter: floating platter of hors d'oeuvres
Strategy: attack with weapon
Round 0: Theraze wins initiative!
Round 1: Theraze executes a macro!
Round 1: Theraze attacks!
Round 2: floating platter of hors d'oeuvres takes 156 damage.
Round 2: floating platter of hors d'oeuvres takes 11 damage.
You gain 11 hit points
Round 2: Theraze wins the fight!
You gain 18 Muscleboundness
You gain 7 Mysteriousness
You gain 6 Chutzpah
> ash import <batbrain> regular(1)
Returned: aggregate float [element]
hot => 8.0
none => 117.647995
stench => 8.0
> ash import <BatBrain.ash> act(""); get_action("attack");
Factoring in Scarysauce: (6) damage, retal
Returned: record advevent
id => attack
dmg => aggregate float [element]
**none => 35.05091
att => 0.0
def => 0.0
stun => 0.0
hp => -0.10847107
mp => 0.0
meat => 0.0
rounds => 1
stats => aggregate int [stat]
**Moxie => 0
**Muscle => 0
**Mysticality => 0
return minmax((6.0 + attack - max(monster_stat("def"),0.0))/11.0,(1.0 - fumble_chance())*critchance(),1.0 - fumble_chance())*through;
(1.0 - fumble_chance())*critchance()
return minmax((6.0 + attack - max(monster_stat("def"),0.0))/11.0,critchance(),1.0 - fumble_chance())*through;
> ash import <batbrain> act(""); get_action("skill fearful fettucini");
Returned: record advevent
id =>
dmg => aggregate float [element]
att => 0.0
def => 0.0
stun => 0.0
hp => 0.0
mp => 0.0
meat => 0.0
rounds => 0
stats => aggregate int [stat]
> ash import <batbrain> act(""); hitchance("skill fearful fettucini")
Returned: 0.09
> ash import <batbrain> act(""); hitchance("skill 3019")
Returned: 0.09
matcher aid = create_matcher("(use|skill) ([URL="file://\\d+)?",id);"]\\d+)?",id);[/URL]
matcher aid = create_matcher("(use|skill) (d+?)",id)
ash matcher aid = create_matcher("(use|skill) (d+?)","skill 3019"); aid.find(); aid.group(2);
> ash matcher aid = create_matcher("(use|skill) (d+?)","skill ddd"); aid.find(); aid.group(2);
Returned: d
> ash matcher aid = create_matcher("(use|skill) (d+?)","skill 3019"); aid.find(); aid.group(2);
No match attempted or previous match failed ()
Returned: void
> ash matcher aid = create_matcher("(use|skill) (\\d+)?","skill 3019"); aid.find(); aid.group(2);
Returned: 3019
Which reminds me: can you have multiple poisoned effects? If so, which one is removed by the antidote?
So that line should be:
PHP:return minmax((6.0 + attack - max(monster_stat("def"),0.0))/11.0,(1.0 - fumble_chance())*critchance(),1.0 - fumble_chance())*through;
float base = minmax((6.0 + attack - max(monster_stat("def"),0.0))/11.0, 0, 1);
return (1-fumble)*(critchance() + (1-critchance())*base);
switch (to_int(aid.group(2))) {
case 7008: attack = my_buffedstat($stat[moxie]); break; // moxman
case 0001: case 2003: case 7097: break; // Attack with beak, headbutt, turtle of 7 tails; same hitchance as attack
case 1003: if (have_skill($skill[eye of the stoat])) attack += 20; // ts
case 1004: case 1005: if (my_class() == $class[seal clubber] && item_type(equipped_item($slot[weapon])) == "club" &&
weapon_hands(equipped_item($slot[weapon])) == 2) return through; // lts
if (aid.group(2) == 1003 || aid.group(2) == 1004) break;
if (have_skill($skill[eye of the stoat])) attack *= 1.25 + 0.05*to_int(my_class() == $class[seal clubber]); break;
case 7010: case 7011: case 7012: case 7013: case 7014: attack = my_buffedstat($stat[moxie]) + 10; break; // Attack with bottle-rocket
case 2015: case 2103: attack = my_buffedstat($stat[muscle]) + 20; break; // kneebutt & head+knee
default: attack = 0;
}
monster_hp(m) == monster_level_adjustment()
floor(min(800,buffedmus)/4)+{0.1,0.15,0.2}*weaponpower+floor(1.5*bonusmelee)+floor(1.5*bonushot)+floor(1.5*bonuscold)+floor(1.5*bonusstench)+floor(1.5*bonussleaze)+floor(1.5*bonusspooky)
fvars["bonusmelee"] = numeric_modifier("Weapon Damage");
fvars["bonushot"] = numeric_modifier("Hot Damage");
fvars["bonuscold"] = numeric_modifier("Cold Damage");
fvars["bonusstench"] = numeric_modifier("Stench Damage");
fvars["bonussleaze"] = numeric_modifier("Sleaze Damage");
fvars["bonusspooky"] = numeric_modifier("Spooky Damage");
fvars["spelldmgs"] = numeric_modifier("Spell Damage");
if(have_skill($skill[intrinsic spiciness]))
fvars["spelldmg"] = fvars["spelldmgs"] - 10;
else
fvars["spelldmg"] = fvars["spelldmgs"];