From 0a9266d9d0dad05063b573fceec4372dc79fab1a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 26 May 2014 13:05:12 -0400 Subject: need to pass options through here too --- bin/smt_fusion | 1 + lib/Games/SMTNocturne/Demons/Fusion.pm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/smt_fusion b/bin/smt_fusion index b4992f2..71d627c 100644 --- a/bin/smt_fusion +++ b/bin/smt_fusion @@ -158,6 +158,7 @@ sub _check_fusion { my $new_fusion = Games::SMTNocturne::Demons::Fusion->new( $demon1, $demon2, + $options, ($sacrifice ? ($sacrifice) : ()), diff --git a/lib/Games/SMTNocturne/Demons/Fusion.pm b/lib/Games/SMTNocturne/Demons/Fusion.pm index 529c2c8..045b1c6 100644 --- a/lib/Games/SMTNocturne/Demons/Fusion.pm +++ b/lib/Games/SMTNocturne/Demons/Fusion.pm @@ -6,7 +6,7 @@ use overload '""' => 'to_string'; use Games::SMTNocturne::Demons::Demon; sub new { - my ($class, $demon1, $demon2, $sacrifice, $kagatsuchi) = @_; + my ($class, $demon1, $demon2, $options, $sacrifice, $kagatsuchi) = @_; my $attrs = {}; @@ -28,10 +28,12 @@ sub new { } $attrs->{kagatsuchi} = $kagatsuchi; + $attrs->{options} = $options || {}; return bless $attrs, $class; } +sub options { $_[0]->{options} } sub demons { $_[0]->{demons} } sub sacrifice { $_[0]->{sacrifice} } sub deathstone { $_[0]->{deathstone} } @@ -42,6 +44,7 @@ sub result { $self->{result} ||= Games::SMTNocturne::Demons::fuse( @{ $self->demons }, { + %{ $self->options }, sacrifice => $self->sacrifice, deathstone => $self->deathstone, kagatsuchi => @{ $self->kagatsuchi || [] }[0], -- cgit v1.2.3-54-g00ecf