I am slightly suspicious that your lantern code didn't work because the variable d was still empty. That said, the code I added was basically functionally identical, and I haven't tested it, so I would appreciate feedback that it works. I also suspect that it will be overestimating its bonus damage, since there is wording on the Wiki about bonus elemental damage not being included.
As for the pliers, there are a few edge cases I'd like to check to determine whether I've placed the code in the correct spot:
One option though would be to have 3 user-configurable values for how much rain/lightning/thunder to keep safe... just set Rain to 100, and it will never mess up your Rain Man chances. Or if you want BatBrain to suggest making it rain during the nun quest, set it lower.
Set Lightning to 100 if you want to control it manually, 0 if you want it fully automated, 20 if you want it to always keep enough for one strike, etc.
You're probably better off using the new modifier added in 14552.
One option though would be to have 3 user-configurable values
it is now giving the correct damage for ravioli shuriken and canelloni canon so I think it passes.
Warning about lightning strike. It doesn't work on non-copyable monsters.
Gurgle could probably use a "nospells" flag in batbrain.txt. While that's not entirely accurate, since spell reflect damage back onto the attacker, it may as well be "nospells".
Quite! I have simply replaced the previous check for Song of Battle with a check for that modifier, solving all of our problems (including its functioning with skills, thanks for pointing that out Bale). A bit afraid that pushing this update will cause false bug reports though, since boolean_modifier("nonexistentmodifier") quietly returns false.
Speaking from experience (thanks for the OHKO Jick!), it's the damage you would inflict as normal which is reduced by elemental resistance. Gurgle's damage caps are not factored in to damage.Any idea what we should use though? Is it roughly your exact spell damage reflected back? Half of it?
I was worried you would say this, which is why I didn't add it to batfactors myself. While I can't imagine a scenario where you'd want to use spells on Gurgle, I agree it's better to let BatBrain decide that. You never know what will be added to the game later.I'd rather we code in the player damage. There may be scenarios in which damaging yourself is the only way you can win, and adding "nospells" would make that path to victory unknowable. Any idea what we should use though? Is it roughly your exact spell damage reflected back? Half of it?
Oh, and it was lost who pointed out that new modifier.
import <BatBrain.ash>;
void battry() {
print("Attack: "+dmg_dealt(get_action("attack").dmg),"orange");
}
void main() {
battry();
}
import <BatBrain.ash>
void main(int initround, monster foe, string pg) {
act(pg);
// now you can smack down the monster with BatBrain-powered gusto!
}