diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-10-06 11:47:09 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-10-06 11:48:12 -0500 |
commit | ce5a827b7b6724b12ba1485a2e445379b566e0c4 (patch) | |
tree | abc1f4cfcb1b19a613d15b8469c610bc582a0a63 /lib | |
parent | 8e1791bc9bea497b9ade7ded36af74b401752be0 (diff) | |
download | games-smtnocturne-fusion-ce5a827b7b6724b12ba1485a2e445379b566e0c4.tar.gz games-smtnocturne-fusion-ce5a827b7b6724b12ba1485a2e445379b566e0c4.zip |
add rules for fusing demons to make elements
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Games/SMTNocturne/Fusion/Chart.pm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Games/SMTNocturne/Fusion/Chart.pm b/lib/Games/SMTNocturne/Fusion/Chart.pm index b20b70f..57f89fc 100644 --- a/lib/Games/SMTNocturne/Fusion/Chart.pm +++ b/lib/Games/SMTNocturne/Fusion/Chart.pm @@ -49,10 +49,18 @@ my %element_fusions = ( multi method fuse (ClassName $class: SMTDemon $demon1 is coerce, SMTDemon $demon2 is coerce) { - return Demon->next_demon_above_level( - $class->_type_chart->{$demon1->type}{$demon2->type}, - ($demon1->level + $demon2->level) / 2, - ); + if ($demon1->type eq $demon2->type) { + # aw, this can't be a separate multimethod + my $element = $demon1->self_fusion_element; + return unless $element; + return Demon->lookup($element); + } + else { + return Demon->next_demon_above_level( + $class->_type_chart->{$demon1->type}{$demon2->type}, + ($demon1->level + $demon2->level) / 2, + ); + } } multi method fuse (ClassName $class: Element $demon1 is coerce, |