diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-10-06 03:49:43 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-10-06 03:55:10 -0500 |
commit | aa950d8f97cf1170b59db7175433ef5b9c2bdc98 (patch) | |
tree | 73b01c832c3342b0999389bcf61feb0edfb44171 /lib | |
parent | 82ab25a55d12290b310eb3ec7e20aa1b3f91a7cd (diff) | |
download | games-smtnocturne-fusion-aa950d8f97cf1170b59db7175433ef5b9c2bdc98.tar.gz games-smtnocturne-fusion-aa950d8f97cf1170b59db7175433ef5b9c2bdc98.zip |
mark boss demons with a role
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Games/SMTNocturne/Fusion/Demon.pm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Games/SMTNocturne/Fusion/Demon.pm b/lib/Games/SMTNocturne/Fusion/Demon.pm index 3efe004..dbf323c 100644 --- a/lib/Games/SMTNocturne/Fusion/Demon.pm +++ b/lib/Games/SMTNocturne/Fusion/Demon.pm @@ -3,7 +3,7 @@ use Moose; use Moose::Util::TypeConstraints; use MooseX::ClassAttribute; use MooseX::Types::Moose qw(ArrayRef HashRef Int Maybe Str); -use List::MoreUtils qw(firstval lastval); +use List::MoreUtils qw(any firstval lastval); use YAML::Any qw(Load); use Games::SMTNocturne::Fusion::Types qw(DemonType FusionType SMTDemon); # XXX ick ick ick (n::ac breaks overload) @@ -17,6 +17,14 @@ use overload '""' => sub { with 'MooseX::Traits', 'MooseX::Role::Matcher' => { default_match => 'name' }; +my @bosses = (qw(Forneus Specter Troll Matador Orthrus Yaksini Thor Daisoujou + Eligor Berith Kaiwan Ose Mizuchi Sui-Ki Kin-Ki Fuu-Ki Ongyo-Ki + Clotho Lachesis Atropos Girimehkala Sakahagi Aciel Skadi + Gabriel Uriel Raphael Futomimi Trumpeter Surt Mot Mithra + Samael Flauros Beelzebub Metatron), + 'Hell Biker', 'White Rider', 'Red Rider', 'Black Rider', + 'Pale Rider', 'The Harlot', 'Black Frost', 'Beelzebub (Fly)'); + class_has _list => ( is => 'ro', isa => ArrayRef[HashRef], @@ -43,8 +51,12 @@ class_has list => ( return [ map { my $demon_class = "Games::SMTNocturne::Fusion::Demon::$_->{type}"; Class::MOP::load_class($demon_class); + my $traits = [@{ $traits{$_->{fusion_type}} }]; + my $name = $_->{name}; + push @$traits, 'Games::SMTNocturne::Fusion::Role::Boss' + if any { $_ eq $name } @bosses; $demon_class->new_with_traits( - traits => $traits{$_->{fusion_type}}, + traits => $traits, %$_, ); } @{ $class->_list } ]; |