From 426d6662831ade7a186fd6c1df860246932d7147 Mon Sep 17 00:00:00 2001 From: Mark Lemming Date: Fri, 16 Jan 2015 07:12:10 -0700 Subject: [PATCH] More message work and adjustment of defense. --- lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm | 20 ++++++++----------- lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm | 3 ++- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm b/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm index 4a2eab1e..b0547b50 100644 --- a/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm +++ b/lib/Lacuna/Role/Ship/Arrive/DamageBuilding.pm @@ -145,19 +145,16 @@ after handle_arrival_procedures => sub { } push @{$report}, (['Buildings', scalar @all_builds]); + my %treport; if ( $snarks{snarks}->{count}/4 > scalar @all_builds) { for my $building (@all_builds) { $building->spend_efficiency(100); $building->update; - push @{$report}, [ - $building->name, - 100, - ]; + $treport{"$building->name"} = 100; } } else { my $building; - my %treport; for my $sn_type ("observatory_seeker", "security_ministry_seeker", "spaceport_seeker", "snarks") { my @tbuilds; @@ -199,13 +196,12 @@ after handle_arrival_procedures => sub { } } } - for my $key (sort keys %treport) { - push @{$report}, [ - $key, - $treport{"$key"}, - ]; - - } + } + for my $key (sort keys %treport) { + push @{$report}, [ + $key, + $treport{"$key"}, + ]; } diff --git a/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm b/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm index b02cf795..07242ada 100644 --- a/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm +++ b/lib/Lacuna/Role/Ship/Arrive/TriggerDefense.pm @@ -462,6 +462,7 @@ sub notify_battle_results { ], attachments => { table => $report }, ); +# Send an email to defender as well if ($self->foreign_body->empire) { $self->foreign_body->add_news(20, @@ -491,7 +492,7 @@ sub saw_stats { for my $saw (@planet_saws) { $cnt++; $planet_combat += int($saw->effective_level * $saw->effective_efficiency * - (1.75 ** $saw->effective_level)); + (1.75 ** ($saw->effective_level/2)) + 0.5); push @defending_saws, $saw; last if $cnt >= 10; } -- 2.51.2