From c4b49f49450e9de62f65ed3756ecb0bb509e4b5c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 25 May 2014 10:21:21 -0400 Subject: normal fusions should only result in normal fusion types --- lib/Games/SMTNocturne/Demons/Demon.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Games/SMTNocturne/Demons') 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; } -- cgit v1.2.3-54-g00ecf