… | |
… | |
185 | unless $found; |
185 | unless $found; |
186 | } |
186 | } |
187 | |
187 | |
188 | # this function converts metals/minerals into a raw ring (of adornment) |
188 | # this function converts metals/minerals into a raw ring (of adornment) |
189 | sub simple_converter { |
189 | sub simple_converter { |
190 | my ($pl, $ingred, $chdl, $conv) = @_; |
190 | my ($pl, $ingred, $chdl, $conv, $sk_lvl, $low_skill_cb) = @_; |
191 | |
191 | |
192 | $conv = lc $conv; |
192 | $conv = lc $conv; |
193 | my $cnvs = $CFG->{conversions}; |
193 | my $cnvs = $CFG->{conversions}; |
194 | |
194 | |
195 | return unless $cnvs->{$conv}; |
195 | return unless $cnvs->{$conv}; |
… | |
… | |
217 | |
217 | |
218 | unless ($outarchvalfact >= 1) { |
218 | unless ($outarchvalfact >= 1) { |
219 | warn "WARNING: source-arch-value-multiplier < 1 in conversion '$outarch', results in more valuable output!\n"; |
219 | warn "WARNING: source-arch-value-multiplier < 1 in conversion '$outarch', results in more valuable output!\n"; |
220 | } |
220 | } |
221 | |
221 | |
222 | my $archvalsum = $ingred->value ($ingr_grp, $srcarchname); |
222 | my $archvalsum = $ingred->value ($ingr_grp, $srcarchname); |
223 | $ingred->remove ($ingr_grp, $srcarchname); |
|
|
224 | |
|
|
225 | my $outarchval = cf::arch::find ($outarch)->value; |
223 | my $outarchval = cf::arch::find ($outarch)->value; |
226 | |
|
|
227 | my $nrof = int $archvalsum / (($outarchval || 1000) * $outarchvalfact); |
224 | my $nrof = int $archvalsum / (($outarchval || 1000) * $outarchvalfact); |
|
|
225 | my $can_make_nr = int (($sk_lvl / 2) + 10); |
|
|
226 | |
|
|
227 | if ($nrof > $can_make_nr) { |
|
|
228 | $pl->ob->message ("Your jeweler level is too low to make $nrof rings, you can only make $can_make_nr at your current level."); |
|
|
229 | return; |
|
|
230 | } |
|
|
231 | |
228 | if ($nrof) { |
232 | if ($nrof) { |
229 | # XXX: yes, I know what I'm doing here, I don't set nrof, but it didn't work somehow (pls. check sometimes) |
233 | # XXX: yes, I know what I'm doing here, I don't set nrof, but it didn't work somehow (pls. check sometimes) |
|
|
234 | $ingred->remove ($ingr_grp, $srcarchname); |
230 | for (1 .. $nrof) { |
235 | for (1 .. $nrof) { |
231 | $chdl->put (my $ob = cf::object::new $outarch); |
236 | $chdl->put (my $ob = cf::object::new $outarch); |
232 | $ob->set_animation (cf::rndm $ob->num_animations) |
237 | $ob->set_animation (cf::rndm $ob->num_animations) |
233 | if ($ob->type == cf::RING); |
238 | if ($ob->type == cf::RING); |
234 | $ob->flag (cf::FLAG_IDENTIFIED, 1); |
239 | $ob->flag (cf::FLAG_IDENTIFIED, 1); |
… | |
… | |
911 | sub resist_level { |
916 | sub resist_level { |
912 | my ($self) = @_; |
917 | my ($self) = @_; |
913 | |
918 | |
914 | my $resists = $self->{hash}->{resist} || {}; |
919 | my $resists = $self->{hash}->{resist} || {}; |
915 | |
920 | |
916 | my $att_res_lvl = Jeweler::getcfg (maxlevels => 'resist_level'); |
921 | my $att_res_lvl = Jeweler::getcfg (maxlevels => 'resist_level'); |
917 | my $efc_res_lvl = Jeweler::getcfg (maxlevels => 'effect_resist_level'); |
922 | my $efc_res_lvl = Jeweler::getcfg (maxlevels => 'effect_resist_level'); |
918 | my $max_att_res = Jeweler::getcfg (maximprovements => 'attack_resistances'); |
923 | my $max_att_res = Jeweler::getcfg (maximprovements => 'attack_resistances'); |
919 | my $max_efc_res = Jeweler::getcfg (maximprovements => 'effect_resistances'); |
924 | my $max_efc_res = Jeweler::getcfg (maximprovements => 'effect_resistances'); |
920 | my $max_ovr_res = Jeweler::getcfg (maximprovements => 'resistances'); |
925 | my $max_ovr_res = Jeweler::getcfg (maximprovements => 'resistances'); |
921 | |
926 | |
922 | my $ressum = 0; |
927 | my $ressum = 0; |