… | |
… | |
8 | |
8 | |
9 | =cut |
9 | =cut |
10 | |
10 | |
11 | package Jeweler; |
11 | package Jeweler; |
12 | |
12 | |
13 | use strict; |
13 | use common::sense; |
14 | use YAML; |
|
|
15 | |
14 | |
16 | =over 4 |
15 | =over 4 |
17 | |
16 | |
18 | =item @RESISTS |
17 | =item @RESISTS |
19 | |
18 | |
… | |
… | |
479 | } |
478 | } |
480 | |
479 | |
481 | sub improve_ring_by_plan { |
480 | sub improve_ring_by_plan { |
482 | my ($self, $plan, $ring) = @_; |
481 | my ($self, $plan, $ring) = @_; |
483 | |
482 | |
484 | $ring = do { my $guard = Coro::Storable::guard; dclone $ring }; |
483 | $ring = dclone $ring; |
485 | |
484 | |
486 | my $ingred = $self->{ingredients}; |
485 | my $ingred = $self->{ingredients}; |
487 | my $impr = {}; |
486 | my $impr = {}; |
488 | |
487 | |
489 | if ($plan =~ m/^stat_(\S+)$/) { |
488 | if ($plan =~ m/^stat_(\S+)$/) { |
… | |
… | |
573 | } |
572 | } |
574 | |
573 | |
575 | sub check_costs { |
574 | sub check_costs { |
576 | my ($self, $costs, $do_remove) = @_; |
575 | my ($self, $costs, $do_remove) = @_; |
577 | |
576 | |
578 | my $costs = do { my $guard = Coro::Storable::guard; dclone $costs }; |
577 | my $costs = dclone $costs; |
579 | |
578 | |
580 | for my $key (keys %$costs) { |
579 | for my $key (keys %$costs) { |
581 | my @grepar; |
580 | my @grepar; |
582 | if ($key =~ m/^(resist_|spec_|stat_)/) { # check the special items |
581 | if ($key =~ m/^(resist_|spec_|stat_)/) { # check the special items |
583 | eval { @grepar = @{Jeweler::getcfg (plans => $key) || []} }; |
582 | eval { @grepar = @{Jeweler::getcfg (plans => $key) || []} }; |