From 31b0934918dc1e4cb4ac5e86c1f95ec391529af7 Mon Sep 17 00:00:00 2001 From: Mark Lemming Date: Tue, 6 Oct 2015 12:45:02 -0600 Subject: [PATCH] AI Spies didn't have a high chance of being added. --- lib/Lacuna/AI.pm | 4 +++- var/www/public/changes.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna/AI.pm b/lib/Lacuna/AI.pm index 03f9f256..6e19636b 100644 --- a/lib/Lacuna/AI.pm +++ b/lib/Lacuna/AI.pm @@ -359,11 +359,13 @@ sub train_spies { my $max_spies = $intelligence->level * 3; my $room_for = $max_spies - $spies; my $train_count = 0; + say " Training $room_for spies for total of $max_spies with chance of $chance"; if ($subsidise) { + say " Subsidizing"; my $deception = $colony->empire->effective_deception_affinity * 50; while ($train_count < $room_for) { $train_count++; - next if (rand(100) < $chance); + next if ($chance < rand(100)); # bypass everything and just create the spy my $spy = Lacuna->db->resultset('Lacuna::DB::Result::Spies')->new({ from_body_id => $colony->id, diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 303488c3..4e5cfbea 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,6 +1,7 @@ 3.0914: - UI : Evein draining re-added. - Fix: Effective level could be too high. + - Fix: AI have a better chance to train a spy. 3.0913: - Add: Insurrect Value & SRCS happiness cost added to PCC output. -- 2.51.2