… | |
… | |
44 | if $cf::CFG{ext_bonus_debug}; |
44 | if $cf::CFG{ext_bonus_debug}; |
45 | |
45 | |
46 | $weapon->value ($value); |
46 | $weapon->value ($value); |
47 | } |
47 | } |
48 | |
48 | |
49 | cf::attach_to_type cf::WEAPON, 0, |
49 | cf::object->attach ( |
|
|
50 | type => cf::WEAPON, |
50 | on_add_bonus => sub { |
51 | on_add_bonus => sub { |
51 | my ($item, $creator, $diff, $max_magic, $flags) = @_; |
52 | my ($item, $creator, $diff, $max_magic, $flags) = @_; |
52 | return if $flags || !$creator; |
53 | return if $flags || !$creator; |
53 | |
54 | |
54 | $diff /= $MAX_LEVEL; |
55 | $diff /= $MAX_LEVEL; |
… | |
… | |
60 | |
61 | |
61 | determine_weapon_value $item; |
62 | determine_weapon_value $item; |
62 | |
63 | |
63 | cf::override; |
64 | cf::override; |
64 | }, |
65 | }, |
65 | ; |
66 | ); |