From 3915741eccf2c74b7be8043dce10b81161bf4854 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 25 May 2014 11:40:12 -0400 Subject: implement element fusion --- lib/Games/SMTNocturne/Demons.pm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'lib/Games/SMTNocturne/Demons.pm') diff --git a/lib/Games/SMTNocturne/Demons.pm b/lib/Games/SMTNocturne/Demons.pm index b5da3d1..386ce0c 100644 --- a/lib/Games/SMTNocturne/Demons.pm +++ b/lib/Games/SMTNocturne/Demons.pm @@ -69,9 +69,20 @@ sub _fuse_mitama { } sub _element_fusion { - my ($element, $demon) = @_; + my ($element, $demon, $options) = @_; - die "element fusion nyi"; + my $direction = Games::SMTNocturne::Demons::FusionChart::element_fusion( + $demon->type, $element->name + ); + return unless $direction; + + return Games::SMTNocturne::Demons::Demon->from_fusion_stats({ + type => $demon->type, + level => $demon->level, + fusion_type => 'normal', + offset => $direction, + %{ $options || {} }, + }); } sub _mitama_fusion { @@ -83,7 +94,11 @@ sub _mitama_fusion { sub _fuse_element { my ($demon1, $demon2) = @_; - die "element fusion nyi"; + my $element = Games::SMTNocturne::Demons::FusionChart::fuse_element( + $demon1->type + ); + return unless $element; + return Games::SMTNocturne::Demons::Demon->from_name($element); } sub _normal_fusion { -- cgit v1.2.3-54-g00ecf