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

Comparing deliantra/maps/perl/Jeweler.pm (file contents):
Revision 1.4 by elmex, Fri Sep 1 13:40:05 2006 UTC vs.
Revision 1.5 by root, Fri Sep 8 15:21:04 2006 UTC

163sub analyze { 163sub analyze {
164 my ($sk, $chdl, $pl) = @_; 164 my ($sk, $chdl, $pl) = @_;
165 165
166 my $hadunid = 0; 166 my $hadunid = 0;
167 for ($chdl->grep_by_type (cf::RING, cf::AMULET)) { 167 for ($chdl->grep_by_type (cf::RING, cf::AMULET)) {
168 if (!$_->get_flag (cf::FLAG_IDENTIFIED) && $_->need_identify) { 168 if (!$_->flag (cf::FLAG_IDENTIFIED) && $_->need_identify) {
169 $hadunid = 1; 169 $hadunid = 1;
170 next; 170 next;
171 } 171 }
172 my $r = Jeweler::Object->new (object => $_); 172 my $r = Jeweler::Object->new (object => $_);
173 my $msg = $r->analyze ($sk, $pl); 173 my $msg = $r->analyze ($sk, $pl);
174 $pl->message ($r->to_string . ": " . $msg); 174 $pl->message ($r->to_string . ": " . $msg);
175 if ($pl->get_flag (cf::FLAG_WIZ)) { 175 if ($pl->flag (cf::FLAG_WIZ)) {
176 $r->wiz_analyze ($pl); 176 $r->wiz_analyze ($pl);
177 } 177 }
178 } 178 }
179 if ($hadunid) { 179 if ($hadunid) {
180 $pl->message ("You couldn't identify the other rings and not analyze them!"); 180 $pl->message ("You couldn't identify the other rings and not analyze them!");
582 582
583 my $sklvl = cf::exp_to_level ($sk->stats->exp); 583 my $sklvl = cf::exp_to_level ($sk->stats->exp);
584 my $ringlvl = $self->power_to_level; 584 my $ringlvl = $self->power_to_level;
585 585
586 my $tmpl; 586 my $tmpl;
587 if ($pl->get_flag (cf::FLAG_WIZ)) { 587 if ($pl->flag (cf::FLAG_WIZ)) {
588 $tmpl = Jeweler::level_diff_to_chance_perc ($sklvl - $ringlvl); 588 $tmpl = Jeweler::level_diff_to_chance_perc ($sklvl - $ringlvl);
589 } else { 589 } else {
590 $tmpl = Jeweler::level_diff_to_str ($sklvl - $ringlvl); 590 $tmpl = Jeweler::level_diff_to_str ($sklvl - $ringlvl);
591 } 591 }
592 my $msg = sprintf "Projected success rate: %s", $tmpl; 592 my $msg = sprintf "Projected success rate: %s", $tmpl;
718 718
719 for (@Jeweler::RESISTS) { 719 for (@Jeweler::RESISTS) {
720 $obj->set_resistance ($_, $self->{hash}->{resist}->{$_} * 1); 720 $obj->set_resistance ($_, $self->{hash}->{resist}->{$_} * 1);
721 } 721 }
722 722
723 $obj->set_flag (cf::FLAG_IDENTIFIED, 1); 723 $obj->flag (cf::FLAG_IDENTIFIED, 1);
724 724
725 return $obj; 725 return $obj;
726} 726}
727 727
728sub stat_level { 728sub stat_level {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines