ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/jeweler.ext
(Generate patch)

Comparing deliantra/maps/perl/jeweler.ext (file contents):
Revision 1.9 by root, Fri Sep 8 15:21:04 2006 UTC vs.
Revision 1.12 by root, Thu Oct 5 19:10:42 2006 UTC

1#! perl 1#! perl
2#CONVERSION: NONE 2
3use Data::Dumper; 3use Data::Dumper;
4use Jeweler; 4use Jeweler;
5use List::Util qw/max min sum/; 5use List::Util qw/max min sum/;
6use strict; 6use strict;
7 7
42 42
43 my $ingred = $chdl->extract_jeweler_ingredients; 43 my $ingred = $chdl->extract_jeweler_ingredients;
44 my @ring = $ingred->get_ring; 44 my @ring = $ingred->get_ring;
45 my @rings = map { Jeweler::Object->new (object => $_) } @ring; 45 my @rings = map { Jeweler::Object->new (object => $_) } @ring;
46 46
47 if (@rings < 2) { 47 @rings >= 2
48 $pl->message ("You slap yourself, you forgot to put at least 2 jeweles in!"); 48 or return $pl->reply (undef, "You slap yourself, you forgot to put at least 2 jewels in!");
49 return;
50 }
51 49
52 my $ring = shift @rings; 50 my $ring = shift @rings;
53 $ring->improve_by_ring (@rings); 51 $ring->improve_by_ring (@rings);
54 52
55 if ($do_analyze) { 53 if ($do_analyze) {
56 $pl->message ("You want to make a " . $ring->to_string . ": " . $ring->analyze ($sk, $pl)); 54 $pl->reply (undef, "You want to make a " . $ring->to_string . ": " . $ring->analyze ($sk, $pl));
57 if ($pl->flag (cf::FLAG_WIZ)) {
58 $ring->wiz_analyze ($pl); 55 $ring->wiz_analyze ($pl)
59 } 56 if $pl->flag (cf::FLAG_WIZ);
60 return; 57 return;
61 } 58 }
62 59
63 make_ring ($chdl, $ingred, $ring, $sk, $pl); 60 make_ring ($chdl, $ingred, $ring, $sk, $pl);
64} 61}
88 85
89cf::attach_to_type cf::SKILL, cf::SK_JEWELER, 86cf::attach_to_type cf::SKILL, cf::SK_JEWELER,
90 on_use_skill => sub { 87 on_use_skill => sub {
91 my ($sk, $ob, $part, $dir, $msg) = @_; 88 my ($sk, $ob, $part, $dir, $msg) = @_;
92 my $pl = $ob; 89 my $pl = $ob;
93 warn ($pl->name . " uses jeweler skill [$msg]!\n");
94 90
95 my $skobj = $sk; 91 my $skobj = $sk;
96 92
97 my $chdl = new Jeweler::CauldronHandler; 93 my $chdl = new Jeweler::CauldronHandler;
98 94
188 } 184 }
189 } 185 }
190 }; 186 };
191 $@ and warn "ERROR: $@\n"; 187 $@ and warn "ERROR: $@\n";
192 } 188 }
189;
190

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines