… | |
… | |
87 | my $make_status; |
87 | my $make_status; |
88 | my $exp; |
88 | my $exp; |
89 | |
89 | |
90 | if ($r <= $ch or $pl->flag (cf::FLAG_WIZ)) { |
90 | if ($r <= $ch or $pl->flag (cf::FLAG_WIZ)) { |
91 | my $lvl = max ($ring->power_to_level, 1); |
91 | my $lvl = max ($ring->power_to_level, 1); |
|
|
92 | $exp = |
92 | $exp = (cf::level_to_min_exp ($lvl) - cf::level_to_min_exp ($lvl - 1)) / 100; |
93 | (cf::level_to_min_exp ($lvl) - cf::level_to_min_exp ($lvl - 1)) |
|
|
94 | / (10 + max ($lvl - 1, 0)); # 10 + level times making such a ring |
|
|
95 | # should get you to the rings level at least. |
93 | |
96 | |
94 | if (defined $input_level) { |
97 | if (defined $input_level) { |
95 | my $subexp = |
98 | my $subexp = |
96 | (cf::level_to_min_exp ($input_level) |
99 | (cf::level_to_min_exp ($input_level) |
97 | - cf::level_to_min_exp ($input_level - 1)) |
100 | - cf::level_to_min_exp ($input_level - 1)) |
98 | / 100; |
101 | / (10 + max ($input_level - 1, 0)); # see above for comment |
|
|
102 | |
99 | $exp -= $subexp; |
103 | $exp -= $subexp; |
100 | $exp = max ($exp, 0); |
104 | $exp = max ($exp, 0); |
|
|
105 | |
|
|
106 | } else { |
|
|
107 | # the experience bonus here is to make level 1 rings give you at least |
|
|
108 | # 100 exp points when making them. This also makes leveling in the |
|
|
109 | # first few levels a bit easier. (probably until around level 5-6). |
|
|
110 | my $expbonus = cf::level_to_min_exp (2) / 10; |
|
|
111 | # this bonus should also only be given for _new_ rings and not for merged |
|
|
112 | # ones - to prevent infinite exp making. |
|
|
113 | $exp += $expbonus; |
101 | } |
114 | } |
102 | |
115 | |
103 | $pl->change_exp ($exp, "jeweler", cf::SK_EXP_SKILL_ONLY); |
116 | $pl->change_exp ($exp, "jeweler", cf::SK_EXP_SKILL_ONLY); |
104 | $pl->message ("You succeed and get $exp experience points."); |
117 | $pl->message ("You succeed and get $exp experience points."); |
105 | $make_status = "succeeded"; |
118 | $make_status = "succeeded"; |
… | |
… | |
277 | }; |
290 | }; |
278 | $@ and warn "ERROR: $@\n"; |
291 | $@ and warn "ERROR: $@\n"; |
279 | } |
292 | } |
280 | ); |
293 | ); |
281 | |
294 | |
282 | Jeweler::read_config (cf::datadir . '/jeweler.yaml'); |
295 | Jeweler::read_config "$DATADIR/jeweler.yaml"; |
|
|
296 | |