From 15cd63518ae75c3d3df3a6f18e3bc341440f387f Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 10 Mar 2011 14:25:53 -0600 Subject: [PATCH] must be a member of an alliance --- lib/Lacuna/DB/Result/Ships/SpaceStation.pm | 1 + lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm diff --git a/lib/Lacuna/DB/Result/Ships/SpaceStation.pm b/lib/Lacuna/DB/Result/Ships/SpaceStation.pm index 563e7794..a46acbdf 100644 --- a/lib/Lacuna/DB/Result/Ships/SpaceStation.pm +++ b/lib/Lacuna/DB/Result/Ships/SpaceStation.pm @@ -22,6 +22,7 @@ use constant type_formatted => 'Space Station Hull'; with "Lacuna::Role::Ship::Send::Planet"; with 'Lacuna::Role::Ship::Send::Uninhabited'; +with 'Lacuna::Role::Ship::Send::MemberOfAlliance'; with "Lacuna::Role::Ship::Send::SpendNextColonyCost"; with "Lacuna::Role::Ship::Arrive::ConvertToStation"; diff --git a/lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm b/lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm new file mode 100644 index 00000000..bc09a064 --- /dev/null +++ b/lib/Lacuna/Role/Ship/Send/MemberOfAlliance.pm @@ -0,0 +1,11 @@ +package Lacuna::Role::Ship::Send::MemberOfAlliance; + +use strict; +use Moose::Role; + +after can_send_to_target => sub { + my ($self, $target) = @_; + confess [1013, 'You must be part of an alliance.'] unless ($self->body->empire->alliance_id); +}; + +1; -- 2.51.2