summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-10-06 11:47:09 -0500
committerJesse Luehrs <doy@tozt.net>2009-10-06 11:48:12 -0500
commitce5a827b7b6724b12ba1485a2e445379b566e0c4 (patch)
treeabc1f4cfcb1b19a613d15b8469c610bc582a0a63
parent8e1791bc9bea497b9ade7ded36af74b401752be0 (diff)
downloadgames-smtnocturne-fusion-ce5a827b7b6724b12ba1485a2e445379b566e0c4.tar.gz
games-smtnocturne-fusion-ce5a827b7b6724b12ba1485a2e445379b566e0c4.zip
add rules for fusing demons to make elements
-rw-r--r--lib/Games/SMTNocturne/Fusion/Chart.pm16
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,