summaryrefslogtreecommitdiffstats
path: root/lib/Games/SMTNocturne/Demons
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-06-16 23:47:25 -0400
committerJesse Luehrs <doy@tozt.net>2014-06-16 23:47:25 -0400
commitba33133be8b38efe0475968b419036a421da2bac (patch)
tree3c7287924218f1710af8ba62e3726a798ed64497 /lib/Games/SMTNocturne/Demons
parente1346469d2375f4ec00be0927cc4ea195039471b (diff)
downloadgames-smtnocturne-demons-ba33133be8b38efe0475968b419036a421da2bac.tar.gz
games-smtnocturne-demons-ba33133be8b38efe0475968b419036a421da2bac.zip
add some docs
Diffstat (limited to 'lib/Games/SMTNocturne/Demons')
-rw-r--r--lib/Games/SMTNocturne/Demons/Demon.pm47
-rw-r--r--lib/Games/SMTNocturne/Demons/Fusion.pm44
2 files changed, 91 insertions, 0 deletions
diff --git a/lib/Games/SMTNocturne/Demons/Demon.pm b/lib/Games/SMTNocturne/Demons/Demon.pm
index bc1e958..dee3855 100644
--- a/lib/Games/SMTNocturne/Demons/Demon.pm
+++ b/lib/Games/SMTNocturne/Demons/Demon.pm
@@ -2,9 +2,29 @@ package Games::SMTNocturne::Demons::Demon;
use strict;
use warnings;
use overload '""' => 'to_string', fallback => 1;
+# ABSTRACT: an individual demon
use JSON::PP;
+=head1 SYNOPSIS
+
+ use Games::SMTNocturne::Demons 'demon';
+
+ my $pixie = demon('Pixie');
+ say $pixie->name # 'Pixie'
+ say $pixie->level # 2
+ say $pixie->type # 'Fairy'
+
+=head1 DESCRIPTION
+
+This class represents an individual demon. You typically create instances of
+this class via the functions in the L<Games::SMTNocturne::Demons> package, and
+you can then look up various data using the accessors here. This class also
+includes a stringification overload to display the information about the demon
+in a readable form.
+
+=cut
+
my %DEMONS_BY_NAME = %{ decode_json(do { local $/; <DATA> }) };
for my $name (keys %DEMONS_BY_NAME) {
$DEMONS_BY_NAME{$name}{name} = $name;
@@ -75,6 +95,33 @@ sub from_type {
return @{ $DEMONS_BY_TYPE{$type} };
}
+=method boss
+
+True if the demon is a boss (meaning that fusing it will not be possible until
+it has been defeated).
+
+=method fusion_type
+
+How this demon can be created. Can be C<normal> for demons that can be fused
+normally, C<evolve> for demons that must be evolved, C<special> for demons
+that require special fusions, and C<deathstone> for demons that require a
+deathstone in order to fuse.
+
+=method level
+
+The base level of the demon. This level is what is used in the fusion process,
+regardless of the experience level of the actual demon in your party.
+
+=method name
+
+The name of the demon.
+
+=method type
+
+The type of the demon (C<Fairy>, C<Yoma>, etc).
+
+=cut
+
sub boss { $_[0]->{boss} }
sub fusion_type { $_[0]->{fusion_type} }
sub level { $_[0]->{level} }
diff --git a/lib/Games/SMTNocturne/Demons/Fusion.pm b/lib/Games/SMTNocturne/Demons/Fusion.pm
index cdfdcd8..4c1c901 100644
--- a/lib/Games/SMTNocturne/Demons/Fusion.pm
+++ b/lib/Games/SMTNocturne/Demons/Fusion.pm
@@ -2,9 +2,30 @@ package Games::SMTNocturne::Demons::Fusion;
use strict;
use warnings;
use overload '""' => 'to_string';
+# ABSTRACT: represents the results of a fusion
use Games::SMTNocturne::Demons::Demon;
+=head1 SYNOPSIS
+
+ use Games::SMTNocturne::Demons 'fusions_for';
+
+ my @fusions = fusions_for('Jack Frost');
+
+ say $fusions[0]->demons->[0]; # <Divine Angel (11)>
+ say $fusions[0]->demons->[1]; # <Foul Will o' Wisp (1)>
+ say $fusions[0]->result; # <Fairy Jack Frost (7)>
+ say $fusions[0]; # Fuse <Divine Angel (11)> with <Foul Will o' Wisp (1)> resulting in <Fairy Jack Frost (7)>
+
+=head1 DESCRIPTION
+
+This class represents the result of a demon fusion which was calculated by the
+C<fusions_for> function in L<Games::SMTNocturne::Demons>. It includes various
+accessor methods to get information about the generated fusion, as well as a
+stringification overload to produce a readable summary.
+
+=cut
+
sub new {
my ($class, $options, $demon1, $demon2, $sacrifice, $kagutsuchi) = @_;
@@ -33,6 +54,29 @@ sub new {
return bless $attrs, $class;
}
+=method demons
+
+An arrayref containing the two demons to be fused.
+
+=method sacrifice
+
+An optional third demon to be sacrificed (at full Kagutsuchi).
+
+=method deathstone
+
+True if this fusion requires a deathstone.
+
+=method kagutsuchi
+
+An optional arrayref containing the Kagutsuchi phases during which this fusion
+may take place.
+
+=method result
+
+The demon that will be created by the fusion.
+
+=cut
+
sub options { $_[0]->{options} }
sub demons { $_[0]->{demons} }
sub sacrifice { $_[0]->{sacrifice} }