- or download this
if($goblin<0){
$goblin=0;
}if($wizard<0){
$wizard=0;
}
- or download this
# Early in the code, i.e. in some configuration section
my @max_damages = (0) x $number_of_rooms;
...
# ... then
$wizard -= 1 + int(rand($max_damages[$room]));
- or download this
$wizard -= 1 + int(rand($room + 1));