… | |
… | |
355 | |
355 | |
356 | sub put { |
356 | sub put { |
357 | my ($self, $obj) = @_; |
357 | my ($self, $obj) = @_; |
358 | |
358 | |
359 | return undef unless $self->{cauldron}; |
359 | return undef unless $self->{cauldron}; |
360 | $obj->insert_ob_in_ob ($self->{cauldron}); |
360 | $self->{cauldron}->insert ($obj); |
361 | } |
361 | } |
362 | |
362 | |
363 | =back |
363 | =back |
364 | |
364 | |
365 | =cut |
365 | =cut |
… | |
… | |
477 | } |
477 | } |
478 | |
478 | |
479 | sub improve_ring_by_plan { |
479 | sub improve_ring_by_plan { |
480 | my ($self, $plan, $ring) = @_; |
480 | my ($self, $plan, $ring) = @_; |
481 | |
481 | |
482 | $ring = dclone ($ring); |
482 | $ring = do { my $guard = Coro::Storable::guard; dclone $ring }; |
483 | |
483 | |
484 | my $ingred = $self->{ingredients}; |
484 | my $ingred = $self->{ingredients}; |
485 | my $impr = {}; |
485 | my $impr = {}; |
486 | |
486 | |
487 | if ($plan =~ m/^stat_(\S+)$/) { |
487 | if ($plan =~ m/^stat_(\S+)$/) { |
… | |
… | |
571 | } |
571 | } |
572 | |
572 | |
573 | sub check_costs { |
573 | sub check_costs { |
574 | my ($self, $costs, $do_remove) = @_; |
574 | my ($self, $costs, $do_remove) = @_; |
575 | |
575 | |
576 | my $costs = dclone ($costs); |
576 | my $costs = do { my $guard = Coro::Storable::guard; dclone $costs }; |
577 | |
577 | |
578 | for my $key (keys %$costs) { |
578 | for my $key (keys %$costs) { |
579 | my @grepar; |
579 | my @grepar; |
580 | if ($key =~ m/^(resist_|spec_|stat_)/) { # check the special items |
580 | if ($key =~ m/^(resist_|spec_|stat_)/) { # check the special items |
581 | eval { @grepar = @{Jeweler::getcfg (plans => $key) || []} }; |
581 | eval { @grepar = @{Jeweler::getcfg (plans => $key) || []} }; |
… | |
… | |
1065 | my ($cost, $diamonds, $category) = @_; |
1065 | my ($cost, $diamonds, $category) = @_; |
1066 | |
1066 | |
1067 | my $stat_split = Jeweler::getcfg (diamond_split => $category); |
1067 | my $stat_split = Jeweler::getcfg (diamond_split => $category); |
1068 | |
1068 | |
1069 | my $sum = sum (@$stat_split); |
1069 | my $sum = sum (@$stat_split); |
1070 | if ($sum < (1 - 0.0001)) { |
|
|
1071 | warn "JEWELER BUG: sum (@$stat_split) = $sum < 1 for $category!"; |
|
|
1072 | } |
|
|
1073 | |
1070 | |
1074 | my $emarch = cf::arch::find 'emerald'; |
1071 | my $emarch = cf::arch::find 'emerald'; |
1075 | my $saarch = cf::arch::find 'sapphire'; |
1072 | my $saarch = cf::arch::find 'sapphire'; |
1076 | my $pearch = cf::arch::find 'pearl'; |
1073 | my $pearch = cf::arch::find 'pearl'; |
1077 | my $ruarch = cf::arch::find 'ruby'; |
1074 | my $ruarch = cf::arch::find 'ruby'; |