diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-05-25 10:21:21 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-05-25 10:21:21 -0400 |
commit | c4b49f49450e9de62f65ed3756ecb0bb509e4b5c (patch) | |
tree | c9f0ab5365a9902313cd8ca50ba036f386452733 /lib/Games/SMTNocturne/Demons | |
parent | 0aa86530fc0ee050e5520f248b18b9affa493ff3 (diff) | |
download | games-smtnocturne-demons-c4b49f49450e9de62f65ed3756ecb0bb509e4b5c.tar.gz games-smtnocturne-demons-c4b49f49450e9de62f65ed3756ecb0bb509e4b5c.zip |
normal fusions should only result in normal fusion types
Diffstat (limited to 'lib/Games/SMTNocturne/Demons')
-rw-r--r-- | lib/Games/SMTNocturne/Demons/Demon.pm | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |