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.5 by elmex, Wed Jan 31 15:53:17 2007 UTC vs.
Revision 1.7 by elmex, Fri Feb 2 12:05:28 2007 UTC

328 cf::POTION => 'potions', 328 cf::POTION => 'potions',
329 cf::SCROLL => 'scrolls', 329 cf::SCROLL => 'scrolls',
330 ); 330 );
331 331
332 for ($self->{cauldron}->inv) { 332 for ($self->{cauldron}->inv) {
333 if (!$_->flag (cf::FLAG_IDENTIFIED) && $_->need_identify) {
334 die "unidentified";
333 if ($_->flag (cf::FLAG_CURSED) || $_->flag (cf::FLAG_DAMNED)) { 335 } elsif ($_->flag (cf::FLAG_CURSED) || $_->flag (cf::FLAG_DAMNED)) {
334 die "cursed"; 336 die "cursed";
335 } 337 }
336 338
337 if (my $k = $type_to_key{$_->type}) { 339 if (my $k = $type_to_key{$_->type}) {
338 push @{$ingreds->{$k}}, $_; 340 push @{$ingreds->{$k}}, $_;
624 my $self = bless { }, $class; 626 my $self = bless { }, $class;
625 627
626 $self->ring_or_ammy_to_hash ($arg{object}); 628 $self->ring_or_ammy_to_hash ($arg{object});
627 629
628 $self; 630 $self;
631}
632
633sub has_resist {
634 my ($self, $resistnam, $resistval) = @_;
635 my $resnum = $REV_RESMAP{uc $resistnam};
636 if (defined ($resistval)) {
637 return 1 if $self->{hash}->{resist}->{$resnum} == $resistval;
638 } else {
639 return 1 if $self->{hash}->{resist}->{$resnum};
640 }
641 return undef;
629} 642}
630 643
631sub analyze { 644sub analyze {
632 my ($self, $sk, $pl) = @_; 645 my ($self, $sk, $pl) = @_;
633 646
764sub to_object { 777sub to_object {
765 my ($self) = @_; 778 my ($self) = @_;
766 779
767 my $obj = cf::object::new $self->{hash}->{arch}; 780 my $obj = cf::object::new $self->{hash}->{arch};
768 781
782 $obj->item_power ($self->power_to_level); # there have to be strings attached!
783
769 $obj->face ($self->{hash}{face}); 784 $obj->face ($self->{hash}{face});
770 785
771 my $stats = $obj->stats; 786 my $stats = $obj->stats;
772 787
773 $stats->hp ($self->{hash}{spec}{regen}); 788 $stats->hp ($self->{hash}{spec}{regen});

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines