From 22943c6629ad51e8b9fa8fa862c06fa237ee2113 Mon Sep 17 00:00:00 2001 From: Mark Lemming Date: Sat, 6 Jun 2015 16:01:08 -0600 Subject: [PATCH] Have spies bugout that are too high for Jackpot. --- lib/Lacuna/AI/Jackpot.pm | 14 ++++++++++++-- var/messages/jackpot_reject.txt | 5 +++++ var/www/public/changes.txt | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 var/messages/jackpot_reject.txt diff --git a/lib/Lacuna/AI/Jackpot.pm b/lib/Lacuna/AI/Jackpot.pm index dfa22856..237f0ce3 100644 --- a/lib/Lacuna/AI/Jackpot.pm +++ b/lib/Lacuna/AI/Jackpot.pm @@ -169,7 +169,8 @@ sub reset_stuff { sub reject_badspy { my ($self, $colony) = @_; - print "Jailing Spies that are too advanced\n"; + print "Bouncing Spies that are too advanced\n"; + my %empires; my $spies = Lacuna->db->resultset('Spies')->search({ 'me.on_body_id' => $colony->id, 'me.empire_id' => {'!=' => $colony->empire_id }, @@ -182,7 +183,16 @@ sub reject_badspy { join => 'empire', }); while (my $spy = $spies->next) { - $spy->go_to_jail; + printf " Spy ID: %d from %s sent home\n",$spy->id, $spy->empire->name; + my $result = eval { $spy->assign("Bugout") }; + unless ($empires{$spy->empire->id} ) { + $empires{$spy->empire->id} = 1; + $spy->empire->send_predefined_message( + from => $colony->empire, + tags => ['Spies','Alert'], + filename => 'jackpot_reject.txt', + ) + } } } diff --git a/var/messages/jackpot_reject.txt b/var/messages/jackpot_reject.txt new file mode 100644 index 00000000..08826bc4 --- /dev/null +++ b/var/messages/jackpot_reject.txt @@ -0,0 +1,5 @@ +University too high +~~~ +You have advanced past the tech level for raiding Jackpot. So your spies have been sent back to you. + +-Jackpot Administration diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 47fba134..8393e9c7 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -10,6 +10,7 @@ - Add: RPC counter always displayed in UI - Fix: Can now change station owner to oneself (UI) - Add: homeworld highlighted and always at the top of the public profile + - Mod: Spies from tech levels above 15 are bounced automatically instead of jailed. 3.0911: - Add: Reduce opacity for less-well-controlled stars. -- 2.51.2