I've changed this spell to be both combat and overland like most unit enchantments are.
I used it today and found out the game crashes at the end of turn if it was cast overland.
I suspected the high attack value causing some sort of an overflow (I used it on a 40 atk hero so it got raised to 80), but using the spell on a spearmen instead still caused a crash. I also suspected the zero defense so I edited a unit to have naturally 0 defense but it didn't crash so that wasn't the reason either.
...actually, nevermind, I found the problem.
I'll leave this thread here if anyone else runs into this.
Berserk sets the unit's defense to -20 instead of 0. Which is obviously not the safest thing to do.
8F87D : EC->00
I suspect the crash is actually caused when my new unit value calculation for the AI takes place, which assumed defense is non-negative, but I wouldn't leave it like that even if the rest of the game doesn't crash from it. It just feels really bad to set a unit's stats to negative values like that, who knows what other incompatibilities it might cause.
As a side effect, it might be possible to raise the defense of the unit through effects that get applied after berserk, I would guess they used -20 to make that impossible but...negative defense really isn't the way to do that.
I used it today and found out the game crashes at the end of turn if it was cast overland.
I suspected the high attack value causing some sort of an overflow (I used it on a 40 atk hero so it got raised to 80), but using the spell on a spearmen instead still caused a crash. I also suspected the zero defense so I edited a unit to have naturally 0 defense but it didn't crash so that wasn't the reason either.
...actually, nevermind, I found the problem.
I'll leave this thread here if anyone else runs into this.
Berserk sets the unit's defense to -20 instead of 0. Which is obviously not the safest thing to do.
8F87D : EC->00
I suspect the crash is actually caused when my new unit value calculation for the AI takes place, which assumed defense is non-negative, but I wouldn't leave it like that even if the rest of the game doesn't crash from it. It just feels really bad to set a unit's stats to negative values like that, who knows what other incompatibilities it might cause.
As a side effect, it might be possible to raise the defense of the unit through effects that get applied after berserk, I would guess they used -20 to make that impossible but...negative defense really isn't the way to do that.