… | |
… | |
52 | my $ring = shift @rings; |
52 | my $ring = shift @rings; |
53 | $ring->improve_by_ring (@rings); |
53 | $ring->improve_by_ring (@rings); |
54 | |
54 | |
55 | if ($do_analyze) { |
55 | if ($do_analyze) { |
56 | $pl->message ("You want to make a " . $ring->to_string . ": " . $ring->analyze ($sk, $pl)); |
56 | $pl->message ("You want to make a " . $ring->to_string . ": " . $ring->analyze ($sk, $pl)); |
57 | if ($pl->get_flag (cf::FLAG_WIZ)) { |
57 | if ($pl->flag (cf::FLAG_WIZ)) { |
58 | $ring->wiz_analyze ($pl); |
58 | $ring->wiz_analyze ($pl); |
59 | } |
59 | } |
60 | return; |
60 | return; |
61 | } |
61 | } |
62 | |
62 | |
… | |
… | |
64 | } |
64 | } |
65 | |
65 | |
66 | sub make_ring { |
66 | sub make_ring { |
67 | my ($chdl, $ingred, $ring, $sk, $pl) = @_; |
67 | my ($chdl, $ingred, $ring, $sk, $pl) = @_; |
68 | |
68 | |
69 | if (!$pl->get_flag (cf::FLAG_WIZ)) { |
69 | if (!$pl->flag (cf::FLAG_WIZ)) { |
70 | $ingred->remove ('rings'); |
70 | $ingred->remove ('rings'); |
71 | $ingred->remove ('ammys'); |
71 | $ingred->remove ('ammys'); |
72 | } |
72 | } |
73 | |
73 | |
74 | my $ch = $ring->get_chance_perc ($sk); |
74 | my $ch = $ring->get_chance_perc ($sk); |
75 | my $succ = 0; |
75 | my $succ = 0; |
76 | my $r = cf::random_roll (0, 100, $pl, cf::PREFER_HIGH); |
76 | my $r = cf::random_roll (0, 100, $pl, cf::PREFER_HIGH); |
77 | if ($r <= $ch or $pl->get_flag (cf::FLAG_WIZ)) { |
77 | if ($r <= $ch or $pl->flag (cf::FLAG_WIZ)) { |
78 | my $lvl = max ($ring->power_to_level, 1); |
78 | my $lvl = max ($ring->power_to_level, 1); |
79 | my $exp = (cf::level_to_min_exp ($lvl) - cf::level_to_min_exp ($lvl - 1)) / 100; |
79 | my $exp = (cf::level_to_min_exp ($lvl) - cf::level_to_min_exp ($lvl - 1)) / 100; |
80 | $pl->change_exp ($exp, "jeweler", cf::SK_EXP_SKILL_ONLY); |
80 | $pl->change_exp ($exp, "jeweler", cf::SK_EXP_SKILL_ONLY); |
81 | $pl->message ("You succeed and get $exp experience."); |
81 | $pl->message ("You succeed and get $exp experience."); |
82 | } else { |
82 | } else { |
… | |
… | |
171 | $pl->message ("You recognize that you are short of: " |
171 | $pl->message ("You recognize that you are short of: " |
172 | . (join ", ", |
172 | . (join ", ", |
173 | map { my $cost = $remcosts->{$_}; $cost . " " . ($cost > 1 ? "times" : "time") . " " . ingred_alias ($_) } |
173 | map { my $cost = $remcosts->{$_}; $cost . " " . ($cost > 1 ? "times" : "time") . " " . ingred_alias ($_) } |
174 | grep { $remcosts->{$_} > 0 } keys %$remcosts)); |
174 | grep { $remcosts->{$_} > 0 } keys %$remcosts)); |
175 | |
175 | |
176 | if ($pl->get_flag (cf::FLAG_WIZ)) { |
176 | if ($pl->flag (cf::FLAG_WIZ)) { |
177 | $iring->wiz_analyze ($pl); |
177 | $iring->wiz_analyze ($pl); |
178 | } |
178 | } |
179 | } else { |
179 | } else { |
180 | if (!$pl->get_flag (cf::FLAG_WIZ)) { |
180 | if (!$pl->flag (cf::FLAG_WIZ)) { |
181 | $ingred->check_costs (\%cdiff, 1); |
181 | $ingred->check_costs (\%cdiff, 1); |
182 | } |
182 | } |
183 | make_ring ($chdl, $ingred, $iring, $sk, $pl); |
183 | make_ring ($chdl, $ingred, $iring, $sk, $pl); |
184 | } |
184 | } |
185 | } |
185 | } |