summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-10-06 02:32:17 -0500
committerJesse Luehrs <doy@tozt.net>2009-10-06 02:32:17 -0500
commitb914e1b76e7e9f8cb8dbee0862315a4e223fcce6 (patch)
tree62dcf5a5e0fd7b7f393efa8e524d5f26f9168cfd
parenta8855585f83184833fcecc74a989ae204d78de9b (diff)
downloadgames-smtnocturne-fusion-b914e1b76e7e9f8cb8dbee0862315a4e223fcce6.tar.gz
games-smtnocturne-fusion-b914e1b76e7e9f8cb8dbee0862315a4e223fcce6.zip
add element fusions to make mitama
-rw-r--r--lib/Games/SMTNocturne/Fusion/Chart.pm27
-rw-r--r--lib/Games/SMTNocturne/Fusion/Types.pm4
2 files changed, 27 insertions, 4 deletions
diff --git a/lib/Games/SMTNocturne/Fusion/Chart.pm b/lib/Games/SMTNocturne/Fusion/Chart.pm
index a5b226b..9095a50 100644
--- a/lib/Games/SMTNocturne/Fusion/Chart.pm
+++ b/lib/Games/SMTNocturne/Fusion/Chart.pm
@@ -63,8 +63,31 @@ multi method fuse (ClassName $self: SMTDemon $demon1 is coerce,
multi method fuse (ClassName $self: Element $demon1 is coerce,
Element $demon2 is coerce) {
- # XXX: fix
- return;
+ my %element_fusions = (
+ Erthys => {
+ Aeros => 'Nigi',
+ Aquans => 'Ara',
+ Flameis => 'Kusi',
+ },
+ Aeros => {
+ Erthys => 'Nigi',
+ Aquans => 'Kusi',
+ Flameis => 'Ara',
+ },
+ Aquans => {
+ Erthys => 'Ara',
+ Aeros => 'Kusi',
+ Flameis => 'Saki',
+ },
+ Flameis => {
+ Erthys => 'Kusi',
+ Aeros => 'Ara',
+ Aquans => 'Saki',
+ },
+ );
+ my $mitama = $element_fusions{$demon1->name}{$demon2->name};
+ return unless $mitama;
+ return Demon->lookup("$mitama Mitama");
}
multi method fuse (ClassName $self: Mitama $demon1 is coerce,
diff --git a/lib/Games/SMTNocturne/Fusion/Types.pm b/lib/Games/SMTNocturne/Fusion/Types.pm
index b62f483..cddece8 100644
--- a/lib/Games/SMTNocturne/Fusion/Types.pm
+++ b/lib/Games/SMTNocturne/Fusion/Types.pm
@@ -24,8 +24,8 @@ coerce DemonList, from ArrayRef[Str],
for my $typename (@demon_types) {
my $type = __PACKAGE__->can($typename)->();
- class_type $type,
- { class => "Games::SMTNocturne::Fusion::Demon::$typename" };
+ subtype $type, as SMTDemon,
+ where { $_->isa("Games::SMTNocturne::Fusion::Demon::$typename") };
coerce $type, from Str,
via { Games::SMTNocturne::Fusion::Demon->lookup($_) };
}