… | |
… | |
7 | The Jeweler skill helper module. |
7 | The Jeweler skill helper module. |
8 | |
8 | |
9 | =cut |
9 | =cut |
10 | |
10 | |
11 | package Jeweler; |
11 | package Jeweler; |
|
|
12 | |
12 | use strict; |
13 | use strict; |
13 | use YAML; |
14 | use YAML; |
14 | |
15 | |
15 | =over 4 |
16 | =over 4 |
16 | |
17 | |
… | |
… | |
205 | warn "WARNING: xp gain isn't > 0 in convesion '$outarch'\n"; |
206 | warn "WARNING: xp gain isn't > 0 in convesion '$outarch'\n"; |
206 | return; |
207 | return; |
207 | } |
208 | } |
208 | |
209 | |
209 | unless ($outarchvalfact) { |
210 | unless ($outarchvalfact) { |
210 | warn "ERROR: source-arch-value-multiplier == 0 in convesion '$outarch'\n"; |
211 | warn "ERROR: source-arch-value-multiplier == 0 in conversion '$outarch'\n"; |
211 | return; |
212 | return; |
212 | } |
213 | } |
213 | |
214 | |
214 | unless ($outarchvalfact >= 1) { |
215 | unless ($outarchvalfact >= 1) { |
215 | warn "WARNING: source-arch-value-multiplier < 1 in convesion '$outarch', results in more valuable output!\n"; |
216 | warn "WARNING: source-arch-value-multiplier < 1 in conversion '$outarch', results in more valuable output!\n"; |
216 | } |
217 | } |
217 | |
218 | |
218 | my $archvalsum = $ingred->value ($ingr_grp, $srcarchname); |
219 | my $archvalsum = $ingred->value ($ingr_grp, $srcarchname); |
219 | $ingred->remove ($ingr_grp, $srcarchname); |
220 | $ingred->remove ($ingr_grp, $srcarchname); |
220 | |
221 | |
… | |
… | |
234 | } |
235 | } |
235 | } |
236 | } |
236 | |
237 | |
237 | |
238 | |
238 | package Jeweler::CauldronHandler; |
239 | package Jeweler::CauldronHandler; |
|
|
240 | |
239 | use strict; |
241 | use strict; |
240 | |
242 | |
241 | =head2 CauldronHandler |
243 | =head2 CauldronHandler |
242 | |
244 | |
243 | The Jeweler::CauldronHandler package, that helps you with handling the |
245 | The Jeweler::CauldronHandler package, that helps you with handling the |
… | |
… | |
718 | |
720 | |
719 | $stats->$_ ($self->{hash}{stat}{lc $_}) |
721 | $stats->$_ ($self->{hash}{stat}{lc $_}) |
720 | for qw/Str Dex Con Wis Cha Int Pow/; |
722 | for qw/Str Dex Con Wis Cha Int Pow/; |
721 | |
723 | |
722 | for (@Jeweler::RESISTS) { |
724 | for (@Jeweler::RESISTS) { |
723 | $obj->set_resistance ($_, $self->{hash}->{resist}->{$_}); |
725 | $obj->resistance ($_, $self->{hash}->{resist}->{$_}); |
724 | } |
726 | } |
725 | |
727 | |
726 | $obj->flag (cf::FLAG_IDENTIFIED, 1); |
728 | $obj->flag (cf::FLAG_IDENTIFIED, 1); |
727 | |
729 | |
728 | return $obj; |
730 | return $obj; |
… | |
… | |
925 | $cost->{pearl} += ceil $sumvalue * $stat_split->[2] / max 1, $pearch->clone->value; |
927 | $cost->{pearl} += ceil $sumvalue * $stat_split->[2] / max 1, $pearch->clone->value; |
926 | $cost->{ruby} += ceil $sumvalue * $stat_split->[3] / max 1, $ruarch->clone->value; |
928 | $cost->{ruby} += ceil $sumvalue * $stat_split->[3] / max 1, $ruarch->clone->value; |
927 | $cost->{gem} += ceil $sumvalue * $stat_split->[4] / max 1, $diarch->clone->value; |
929 | $cost->{gem} += ceil $sumvalue * $stat_split->[4] / max 1, $diarch->clone->value; |
928 | } |
930 | } |
929 | |
931 | |
930 | |
|
|
931 | |
|
|
932 | package Jeweler::Util; |
932 | package Jeweler::Util; |
|
|
933 | |
933 | use strict; |
934 | use strict; |
934 | |
935 | |
935 | =head2 Util |
936 | =head2 Util |
936 | |
937 | |
937 | Some utility functions for the Jeweler skill. |
938 | Some utility functions for the Jeweler skill. |
… | |
… | |
959 | return 0; |
960 | return 0; |
960 | } |
961 | } |
961 | } |
962 | } |
962 | |
963 | |
963 | remove ($_) for $obj->inv; |
964 | remove ($_) for $obj->inv; |
964 | $obj->remove; |
965 | $obj->destroy; |
965 | $obj->free; |
|
|
966 | return $cnt; |
966 | return $cnt; |
967 | } |
967 | } |
968 | |
968 | |
969 | sub grep_for_match { |
969 | sub grep_for_match { |
970 | my ($thing, @matchar) = @_; |
970 | my ($thing, @matchar) = @_; |