summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Games/SMTNocturne/Demons.pm4
-rw-r--r--lib/Games/SMTNocturne/Demons/Demon.pm6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/Games/SMTNocturne/Demons.pm b/lib/Games/SMTNocturne/Demons.pm
index 0cc20c8..e1e482d 100644
--- a/lib/Games/SMTNocturne/Demons.pm
+++ b/lib/Games/SMTNocturne/Demons.pm
@@ -94,8 +94,8 @@ sub _normal_fusion {
my $new_level = ($demon1->level + $demon2->level) / 2 + 1;
- return Games::SMTNocturne::Demons::Demon->from_type_and_level(
- $new_type, $new_level
+ return Games::SMTNocturne::Demons::Demon->from_fusion_stats(
+ $new_type, $new_level, 'normal'
);
}
diff --git a/lib/Games/SMTNocturne/Demons/Demon.pm b/lib/Games/SMTNocturne/Demons/Demon.pm
index 53d3cd8..4a1b8ce 100644
--- a/lib/Games/SMTNocturne/Demons/Demon.pm
+++ b/lib/Games/SMTNocturne/Demons/Demon.pm
@@ -29,13 +29,13 @@ sub from_name {
return $DEMONS_BY_NAME{$name};
}
-sub from_type_and_level {
- my ($class, $type, $level) = @_;
+sub from_fusion_stats {
+ my ($class, $type, $level, $fusion_type) = @_;
die "unknown type $type" unless $DEMONS_BY_TYPE{$type};
my $found;
- for my $demon (@{ $DEMONS_BY_TYPE{$type} }) {
+ for my $demon (grep { $_->fusion_type eq $fusion_type } @{ $DEMONS_BY_TYPE{$type} }) {
$found = $demon;
last if $demon->level >= $level;
}