From 0a73cf7350661d53e0dacec947a3abc991f43d4e Mon Sep 17 00:00:00 2001 From: Matthew Musgrove Date: Tue, 5 Apr 2011 20:18:19 -0500 Subject: [PATCH] Fix defender's home field advantage --- lib/Lacuna/DB/Result/Spies.pm | 4 +++- var/www/public/changes.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index 29391b57..2a38fa86 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -468,10 +468,12 @@ sub run_mission { my $power = $self->offense + $self->$mission_skill; my $toughness = 0; my $defender = $self->get_defender; + my $hfa = 0; if (defined $defender) { $toughness = $defender->defense + $defender->$mission_skill; + $hfa = $defender->home_field_advantage; } - my $breakthru = ($power - $toughness - $defender->home_field_advantage) + $self->luck; + my $breakthru = ($power - $toughness - $hfa) + $self->luck; # handle outcomes and xp my $out; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 1f5f29a5..1c95a76c 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -10,6 +10,7 @@ - Fix: Police Station docs now show up under Modules instead of Buildings. - Fix: view_ships_orbiting will now return the ships that are orbiting your planet instead of just the count. - Fix: Fighters will return home after defending (instead of doubling the travel time). + - Fix: Fix defender's home field advantage. 3.0402 - API: Changed parliament propositions and laws to use email formatting rules. -- 2.51.2