… | |
… | |
193 | |
193 | |
194 | sub _add_resist($$$) { |
194 | sub _add_resist($$$) { |
195 | my ($ob, $mask, $value) = @_; |
195 | my ($ob, $mask, $value) = @_; |
196 | |
196 | |
197 | while (my ($k, $v) = each %attack_mask) { |
197 | while (my ($k, $v) = each %attack_mask) { |
198 | $ob->{"resist_$k"} += $value if $mask & $v; |
198 | $ob->{"resist_$k"} = min 100, max -100, $ob->{"resist_$k"} + $value if $mask & $v; |
199 | } |
199 | } |
200 | } |
200 | } |
201 | |
201 | |
202 | # object as in "Object xxx", i.e. archetypes |
202 | # object as in "Object xxx", i.e. archetypes |
203 | sub normalize_object($) { |
203 | sub normalize_object($) { |
… | |
… | |
288 | slaying => delete $ob->{"event_${event}"}, |
288 | slaying => delete $ob->{"event_${event}"}, |
289 | name => delete $ob->{"event_${event}_options"}, |
289 | name => delete $ob->{"event_${event}_options"}, |
290 | }; |
290 | }; |
291 | } |
291 | } |
292 | } |
292 | } |
|
|
293 | |
|
|
294 | # some archetypes had "+3" instead of the canonical "3", so fix |
|
|
295 | $ob->{dam} *= 1 if exists $ob->{dam}; |
293 | |
296 | |
294 | $ob |
297 | $ob |
295 | } |
298 | } |
296 | |
299 | |
297 | # arch as in "arch xxx", ie.. objects |
300 | # arch as in "arch xxx", ie.. objects |