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.11 by elmex, Sun Feb 4 11:57:22 2007 UTC vs.
Revision 1.14 by elmex, Tue Apr 10 17:46:22 2007 UTC

576 my $costs = dclone ($costs); 576 my $costs = dclone ($costs);
577 577
578 for my $key (keys %$costs) { 578 for my $key (keys %$costs) {
579 my @grepar; 579 my @grepar;
580 if ($key =~ m/^(resist_|spec_|stat_)/) { # check the special items 580 if ($key =~ m/^(resist_|spec_|stat_)/) { # check the special items
581 @grepar = @{Jeweler::getcfg (plans => $key) || []}; 581 eval { @grepar = @{Jeweler::getcfg (plans => $key) || []} };
582 next if $@;
582 } else { # check the gems 583 } else { # check the gems
583 @grepar = ('gems', undef, undef, $key); 584 @grepar = ('gems', undef, undef, $key);
584 } 585 }
585 586
586 if ($do_remove) { 587 if ($do_remove) {
795sub to_object { 796sub to_object {
796 my ($self) = @_; 797 my ($self) = @_;
797 798
798 my $obj = cf::object::new $self->{hash}->{arch}; 799 my $obj = cf::object::new $self->{hash}->{arch};
799 800
800 $obj->item_power ($self->power_to_level); # there have to be strings attached! 801 $obj->item_power (floor ($self->power_to_level / 3)); # there have to be strings attached!
801 802
802 $obj->face ($self->{hash}{face}); 803 $obj->face ($self->{hash}{face});
803 804
804 my $stats = $obj->stats; 805 my $stats = $obj->stats;
805 806
1084 my $i = 0; 1085 my $i = 0;
1085 my $check_cnts = 0; 1086 my $check_cnts = 0;
1086 my $check_true = 0; 1087 my $check_true = 0;
1087 for my $match (@matchar) { 1088 for my $match (@matchar) {
1088 if ($i % 3 == 0) { 1089 if ($i % 3 == 0) {
1090 return 1 if $check_true && $check_cnts == $check_true;
1089 $check_cnts = 0; 1091 $check_cnts = 0;
1090 $check_true = 0; 1092 $check_true = 0;
1091 } 1093 }
1092 1094
1093 if ($match =~ m/^\s*$/) { 1095 if ($match =~ m/^\s*$/) {
1107 and $check_true++; 1109 and $check_true++;
1108 } 1110 }
1109 $i++; 1111 $i++;
1110 } 1112 }
1111 #d# warn "CHECK $check_true | $check_cnts | [".(join ',', @matchar).":".join (",", ($thing->name, $thing->title, $thing->arch->name))."\n"; 1113 #d# warn "CHECK $check_true | $check_cnts | [".(join ',', @matchar).":".join (",", ($thing->name, $thing->title, $thing->arch->name))."\n";
1112 if ($check_true && $check_cnts == $check_true) { 1114 return 1 if $check_true && $check_cnts == $check_true;
1113 return 1;
1114 }
1115 return 0; 1115 return 0;
1116} 1116}
1117 1117
1118sub grep_for_match { 1118sub grep_for_match {
1119 my ($ingred, $group, @matchar) = @_; 1119 my ($ingred, $group, @matchar) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines