ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/Jeweler.pm
(Generate patch)

Comparing deliantra/server/ext/Jeweler.pm (file contents):
Revision 1.33 by root, Wed Apr 28 21:05:33 2010 UTC vs.
Revision 1.36 by root, Tue May 4 22:49:21 2010 UTC

21=cut 21=cut
22 22
23our $CFG; 23our $CFG;
24 24
25sub load_config { 25sub 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
250package Jeweler::CauldronHandler; 252package Jeweler::CauldronHandler;
251 253
252use strict; 254use common::sense;
253 255
254=head2 CauldronHandler 256=head2 CauldronHandler
255 257
256The Jeweler::CauldronHandler package, that helps you with handling the 258The Jeweler::CauldronHandler package, that helps you with handling the
257cauldron stuff. Can also be used for other skills. 259cauldron stuff. Can also be used for other skills.
365=back 367=back
366 368
367=cut 369=cut
368 370
369package Jeweler::Ingredients; 371package Jeweler::Ingredients;
372
373use common::sense;
374
370use Storable qw/dclone/; 375use Storable qw/dclone/;
371use strict;
372 376
373=head2 Ingredients 377=head2 Ingredients
374 378
375This class handles the ingredients. 379This class handles the ingredients.
376 380
622 } 626 }
623 } 627 }
624} 628}
625 629
626package Jeweler::Object; 630package Jeweler::Object;
627use strict; 631
632use common::sense;
628use POSIX; 633use POSIX;
629use List::Util qw/max min sum/; 634use List::Util qw/max min sum/;
630 635
631sub new { 636sub 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
1107package Jeweler::Util; 1112package Jeweler::Util;
1108 1113
1109use strict; 1114use common::sense;
1110 1115
1111=head2 Util 1116=head2 Util
1112 1117
1113Some utility functions for the Jeweler skill. 1118Some utility functions for the Jeweler skill.
1114 1119

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines