… | |
… | |
21 | =cut |
21 | =cut |
22 | |
22 | |
23 | our $CFG; |
23 | our $CFG; |
24 | |
24 | |
25 | sub load_config { |
25 | sub load_config { |
|
|
26 | cf::trace "loading jeweler config from $cf::DATADIR/jeweler\n"; |
|
|
27 | |
26 | 0 < Coro::AIO::aio_load "$cf::DATADIR/jeweler", my $data |
28 | 0 < Coro::AIO::aio_load "$cf::DATADIR/jeweler", my $data |
27 | or die "$cf::DATADIR/jeweler: $!"; |
29 | or die "$cf::DATADIR/jeweler: $!"; |
28 | |
30 | |
29 | $CFG = cf::decode_json $data; |
31 | $CFG = cf::decode_json $data; |
30 | } |
32 | } |
… | |
… | |
247 | } |
249 | } |
248 | |
250 | |
249 | |
251 | |
250 | package Jeweler::CauldronHandler; |
252 | package Jeweler::CauldronHandler; |
251 | |
253 | |
252 | use strict; |
254 | use common::sense; |
253 | |
255 | |
254 | =head2 CauldronHandler |
256 | =head2 CauldronHandler |
255 | |
257 | |
256 | The Jeweler::CauldronHandler package, that helps you with handling the |
258 | The Jeweler::CauldronHandler package, that helps you with handling the |
257 | cauldron stuff. Can also be used for other skills. |
259 | cauldron stuff. Can also be used for other skills. |
… | |
… | |
365 | =back |
367 | =back |
366 | |
368 | |
367 | =cut |
369 | =cut |
368 | |
370 | |
369 | package Jeweler::Ingredients; |
371 | package Jeweler::Ingredients; |
|
|
372 | |
|
|
373 | use common::sense; |
|
|
374 | |
370 | use Storable qw/dclone/; |
375 | use Storable qw/dclone/; |
371 | use strict; |
|
|
372 | |
376 | |
373 | =head2 Ingredients |
377 | =head2 Ingredients |
374 | |
378 | |
375 | This class handles the ingredients. |
379 | This class handles the ingredients. |
376 | |
380 | |
… | |
… | |
622 | } |
626 | } |
623 | } |
627 | } |
624 | } |
628 | } |
625 | |
629 | |
626 | package Jeweler::Object; |
630 | package Jeweler::Object; |
627 | use strict; |
631 | |
|
|
632 | use common::sense; |
628 | use POSIX; |
633 | use POSIX; |
629 | use List::Util qw/max min sum/; |
634 | use List::Util qw/max min sum/; |
630 | |
635 | |
631 | sub new { |
636 | sub new { |
632 | my ($class, %arg) = @_; |
637 | my ($class, %arg) = @_; |
… | |
… | |
1104 | $cost->{gem} += ceil $sumvalue * $stat_split->[4] / max 1, $diarch->value; |
1109 | $cost->{gem} += ceil $sumvalue * $stat_split->[4] / max 1, $diarch->value; |
1105 | } |
1110 | } |
1106 | |
1111 | |
1107 | package Jeweler::Util; |
1112 | package Jeweler::Util; |
1108 | |
1113 | |
1109 | use strict; |
1114 | use common::sense; |
1110 | |
1115 | |
1111 | =head2 Util |
1116 | =head2 Util |
1112 | |
1117 | |
1113 | Some utility functions for the Jeweler skill. |
1118 | Some utility functions for the Jeweler skill. |
1114 | |
1119 | |