advevent famevent() {
float weight = familiar_weight(my_familiar()) + weight_adjustment();
advevent res; res.id = to_string(my_familiar());
float r;
switch (my_familiar()) {
// starfish-types
case $familiar[snow angel]: r = 0.33; res.dmg = to_spread(0.75*(weight + 3),"cold"); res.mp = dmg_dealt(res.dmg); break;
case $familiar[spirit hobo]:
case $familiar[gluttonous green ghost]: if (famspent) break;
case $familiar[rogue program]:
case $familiar[star starfish]: r = 0.33; res.dmg = to_spread(0.75*(weight + 3),"physical"); res.mp = dmg_dealt(res.dmg); break;
case $familiar[animated macaroni duck]: r = 0.33; res.dmg = to_spread(0.75*(weight + 3 + min(20,2*my_level())*to_int(my_class() == $class[pastamancer])),"physical"); res.mp = dmg_dealt(res.dmg); break;
case $familiar[autonomous disco ball]: if (familiar_equipped_equipment(my_familiar()) != familiar_equipment(my_familiar())) break;
r = 0.33; res.dmg = to_spread(9.75,"physical"); res.mp = dmg_dealt(res.dmg); break;
case $familiar[midget clownfish]: r = 0.33; res.dmg = to_spread(0.75*(modifier_eval("1+zone(sea)*0.5")*weight + 3),"sleaze"); res.mp = dmg_dealt(res.dmg); break;
case $familiar[rock lobster]: r = 0.33; res.dmg = to_spread(0.75*(modifier_eval("1+zone(sea)*0.5")*weight + 3),"hot"); res.mp = dmg_dealt(res.dmg); break;
case $familiar[slimeling]: if (famspent) break; r = 0.5; res.dmg = to_spread(0.75*(weight + 3),"physical"); res.mp = dmg_dealt(res.dmg); break;
// others
case $familiar[hobo monkey]: if (famspent) break; r = 1.0; res.meat = 75; break;
case $familiar[ninja pirate zombie robot]: r = 0.5; if (round < 10) res.meat = 0.22 * (6.0*weight + 10); res.mp = 0.22 * 1.5*(weight + 2) + 5; res.hp = res.mp;
res.dmg = to_spread(1.5*(weight + 2),"physical",0.22); res.delevel = 0.22 * floor(weight/2.0);
res.meat = 0.12 * item_val($item[toast]); break;
case $familiar[stocking mimic]:
case $familiar[cocoabo]: r = 0.33; if (round < 10) res.meat = 0.25 * (4.0*weight + 9);
res.mp = 0.25 * (weight + 7); res.hp = res.mp;
res.delevel = 0.25 * (weight + 1)/3;
res.dmg = to_spread(weight + 2,"physical",0.25 + 0.25*to_int(round > 9)); break;
case $familiar[feather boa constrictor]: r = 0.33; if (round < 10) res.meat = 0.5 * 5*(weight + 2); // action rate?? arbitrarily using 33%
res.stun = min(0.9,1.5*weight/100.0)/r; // stun rate is standard potato
res.dmg = to_spread(weight + 2,"sleaze",0.5); break;
case $familiar[hanukkimbo dreidl]: r = 1.7*weight/100.0 + 0.19; res.meat = 0.25 * 2*weight; res.stun = 0.25;
res.dmg = to_spread(max(2,weight),"physical",0.25); res.mp = 0.25 * (weight + 1.0)/3.0; break;
case $familiar[howling balloon monkey]: if (weight < 11) break; r = 1.0; res.mp = 0.275 * weight/3.0; res.dmg = to_spread(weight/3.0,"physical",0.225); break;
case $familiar[baby yeti]: r = 0.5; res.mp = 0.5 * (weight/2.0 + weight + 5)/2.0; res.dmg = to_spread(res.mp,"cold"); break;
case $familiar[personal raincloud]: r = 0.6; res.mp = 0.25 * (weight + 3)/2.0; res.hp = res.mp; res.dmg = to_spread(res.mp,"physical"); res.delevel = 0.25 * max(1.0,weight/8.0); break;
case $familiar[adorable seal larva]: weight += min(20,2*my_level())*to_int(my_class() == $class[seal clubber]);
case $familiar[mosquito]: r = 0.2; res.dmg = to_spread(max(1.0,0.25 * weight),"physical"); res.hp = dmg_dealt(res.dmg); break;
// can damage player
case $familiar[fuzzy dice]: r = 0.3; res.delevel = 0.055 * weight; res.stun = 0.111; res.meat = 0.83; res.mp = 0.055 * weight; res.hp = 0.083 * weight; res.dmg = to_spread(weight,"physical",0.083); break;
case $familiar[robogoose]: r = 0.33; res.dmg = to_spread((weight + 4)/2.0,"physical",0.2); res.hp = 0.2*(2.0*weight + 14) - 0.2*(weight + 4.5); res.stun = 0.2; res.delevel = 0.2 * (weight + 4)/3.0; break;
case $familiar[stab bat]:
case $familiar[scary death orb]: r = ceil(weight/6.0)*0.1; res.hp = -(0.33 - 0.13*to_int(have_equipped(familiar_equipment(my_familiar())))) * (weight/1.5 + 2);
string t = "spooky"; if (my_familiar() == $familiar[stab bat]) t = "physical"; res.dmg = to_spread(weight/1.5 + 2,t,0.66 + 0.14*to_int(have_equipped(familiar_equipment(my_familiar())))); break;
// attacks!
case $familiar[angry goat]: r = ceil(weight/6.0)*0.1; res.dmg = to_spread(weight/3.0 + 1,"physical, stench"); break;
case $familiar[dandy lion]: if (item_type(equipped_item($slot[weapon])) != "whip") break; r = 0.5; res.dmg = to_spread(weight/1.5 + 1.5,"physical"); break;
case $familiar[killer bee]: r = 0.33; res.dmg = to_spread(max(1.0,weight/4),"physical"); break;
case $familiar[disembodied hand]: r = 1.0; res.dmg = to_spread(1.5*weight + get_power(familiar_equipped_equipment($familiar[disembodied hand]))/7.5,"physical"); break;
case $familiar[flaming gravy fairy]: r = 0.33; res.dmg = to_spread(weight/1.5,"hot"); break;
case $familiar[frozen gravy fairy]: r = 0.33; res.dmg = to_spread(weight/1.5,"cold"); break;
case $familiar[sleazy gravy fairy]: r = 0.33; res.dmg = to_spread(weight/1.5,"sleaze"); break;
case $familiar[spooky gravy fairy]: r = 0.33; res.dmg = to_spread(weight/1.5,"spooky"); break;
case $familiar[stinky gravy fairy]: r = 0.33; res.dmg = to_spread(weight/1.5,"stench"); break;
case $familiar[grue]: r = 0.1 + 0.1*ceil(weight/4); res.dmg = to_spread((2+(5-moon_light())*2.25) + weight/1.5,"spooky"); break;
case $familiar[jill-o-lantern]: r = 0.25; res.dmg = to_spread((weight + 2)/3.0 + 1,"physical, hot, spooky"); break;
case $familiar[magimechtech micromechamech]: r = 1.0; res.dmg[$element[hot]] = 0.15 * weight/1.5; res.dmg[$element[none]] = 0.566*weight - 2.0; break;
case $familiar[mariachi chihuahua]: weight += min(20,2*my_level())*to_int(my_class() == $class[accordion thief]);
case $familiar[sabre-toothed lime]: r = ceil(weight/6.0)*0.1; res.dmg = to_spread(weight/1.5+1.5,"physical"); break;
case $familiar[misshapen animal skeleton]: r = 1.0; res.dmg = to_spread(weight/1.5 + 5.5,"spooky",0.66*(0.4 + ceil(weight/5.0)*0.1)); res.delevel = 0.33*weight/6.0; break;
case $familiar[ninja snowflake]: r = 1.0; res.dmg = to_spread(weight/1.5,"cold",ceil(weight/6.0)*0.1); break;
case $familiar[wereturtle]: r = to_int(moon_light() + 2*to_int(have_equipped($item[moontan lotion])) > 5); res.dmg = to_spread(weight + 3*moon_light(),"spooky",0.2+0.1*floor((weight-1)/4)); break;
case $familiar[wizard action figure]: r = 0.83; res.dmg = to_spread(weight + 1,"physical, hot, cold, spooky, sleaze, stench"); break;
}
return factor(res,minmax(r + min(0.1,have_effect($effect[jingle jangle jingle])),0,1));
}