diff options
Diffstat (limited to 'lib/Games/SMTNocturne/Demons')
-rw-r--r-- | lib/Games/SMTNocturne/Demons/FusionChart.pm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Games/SMTNocturne/Demons/FusionChart.pm b/lib/Games/SMTNocturne/Demons/FusionChart.pm index 42e5f77..7848e40 100644 --- a/lib/Games/SMTNocturne/Demons/FusionChart.pm +++ b/lib/Games/SMTNocturne/Demons/FusionChart.pm @@ -15,6 +15,22 @@ sub fuse { return $TYPES{$type1}{$type2}; } +sub unfuse { + my ($type) = @_; + + die "unknown demon type $type" unless $TYPES{$type}; + + my @combinations; + for my $type1 (keys %TYPES) { + for my $type2 (grep { $_ le $type1 } keys %TYPES) { + push @combinations, [ $type1, $type2 ] + if $TYPES{$type1}{$type2} eq $type; + } + } + + return @combinations; +} + 1; __DATA__ |