… | |
… | |
238 | if ($xp_sum) { |
238 | if ($xp_sum) { |
239 | $pl->ob->message ("You got $xp_sum xp by making $nrof ${outarch}s"); |
239 | $pl->ob->message ("You got $xp_sum xp by making $nrof ${outarch}s"); |
240 | $pl->ob->change_exp ($xp_sum, "jeweler", cf::SK_EXP_SKILL_ONLY); |
240 | $pl->ob->change_exp ($xp_sum, "jeweler", cf::SK_EXP_SKILL_ONLY); |
241 | } |
241 | } |
242 | } else { |
242 | } else { |
243 | $pl->ob->message ("You fail to make something, propably you used not enough source material?"); |
243 | $pl->ob->message ("You fail to make something, probably you used not enough source material?"); |
244 | } |
244 | } |
245 | } |
245 | } |
246 | |
246 | |
247 | |
247 | |
248 | package Jeweler::CauldronHandler; |
248 | package Jeweler::CauldronHandler; |
… | |
… | |
796 | sub to_object { |
796 | sub to_object { |
797 | my ($self) = @_; |
797 | my ($self) = @_; |
798 | |
798 | |
799 | my $obj = cf::object::new $self->{hash}->{arch}; |
799 | my $obj = cf::object::new $self->{hash}->{arch}; |
800 | |
800 | |
801 | $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! |
802 | |
802 | |
803 | $obj->face ($self->{hash}{face}); |
803 | $obj->face ($self->{hash}{face}); |
804 | |
804 | |
805 | my $stats = $obj->stats; |
805 | my $stats = $obj->stats; |
806 | |
806 | |
… | |
… | |
1085 | my $i = 0; |
1085 | my $i = 0; |
1086 | my $check_cnts = 0; |
1086 | my $check_cnts = 0; |
1087 | my $check_true = 0; |
1087 | my $check_true = 0; |
1088 | for my $match (@matchar) { |
1088 | for my $match (@matchar) { |
1089 | if ($i % 3 == 0) { |
1089 | if ($i % 3 == 0) { |
|
|
1090 | return 1 if $check_true && $check_cnts == $check_true; |
1090 | $check_cnts = 0; |
1091 | $check_cnts = 0; |
1091 | $check_true = 0; |
1092 | $check_true = 0; |
1092 | } |
1093 | } |
1093 | |
1094 | |
1094 | if ($match =~ m/^\s*$/) { |
1095 | if ($match =~ m/^\s*$/) { |
… | |
… | |
1108 | and $check_true++; |
1109 | and $check_true++; |
1109 | } |
1110 | } |
1110 | $i++; |
1111 | $i++; |
1111 | } |
1112 | } |
1112 | #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"; |
1113 | if ($check_true && $check_cnts == $check_true) { |
1114 | return 1 if $check_true && $check_cnts == $check_true; |
1114 | return 1; |
|
|
1115 | } |
|
|
1116 | return 0; |
1115 | return 0; |
1117 | } |
1116 | } |
1118 | |
1117 | |
1119 | sub grep_for_match { |
1118 | sub grep_for_match { |
1120 | my ($ingred, $group, @matchar) = @_; |
1119 | my ($ingred, $group, @matchar) = @_; |