… | |
… | |
112 | warn "error in jeweler ingredient extraction: $@"; |
112 | warn "error in jeweler ingredient extraction: $@"; |
113 | return; |
113 | return; |
114 | } |
114 | } |
115 | $ingred; |
115 | $ingred; |
116 | } |
116 | } |
|
|
117 | |
|
|
118 | cf::object::attachment check_ring_drop_on => |
|
|
119 | on_drop_on => sub { |
|
|
120 | my ($self, $obj, $who) = @_; |
|
|
121 | my $cfg = $self->{check_ring_drop_on}; |
|
|
122 | if ($obj->type == cf::RING |
|
|
123 | && !$obj->flag (cf::FLAG_CURSED) |
|
|
124 | && !$obj->flag (cf::FLAG_DAMNED) |
|
|
125 | ) { |
|
|
126 | my $ringo = Jeweler::Object->new (object => $obj); |
|
|
127 | for (grep { /^resist_/ } keys %$cfg) { |
|
|
128 | if (/^resist_(\S+)$/) { |
|
|
129 | if ($ringo->has_resist ($1)) { |
|
|
130 | $self->map->trigger ( |
|
|
131 | $cfg->{connection}, |
|
|
132 | $cfg->{state} |
|
|
133 | ); |
|
|
134 | cf::override; |
|
|
135 | } |
|
|
136 | } |
|
|
137 | } |
|
|
138 | } |
|
|
139 | }; |
117 | |
140 | |
118 | cf::object->attach ( |
141 | cf::object->attach ( |
119 | type => cf::SKILL, |
142 | type => cf::SKILL, |
120 | subtype => cf::SK_JEWELER, |
143 | subtype => cf::SK_JEWELER, |
121 | on_use_skill => sub { |
144 | on_use_skill => sub { |