From 493e0f612f47f9caeb574e4e38d89d603247618d Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 16 Jan 2011 09:20:48 -0600 Subject: [PATCH] - Rule: Manufacturing affinity now reduces ship build costs by 5% per level instead of 1%. - Rule: Research affinity now reduces building build costs by 5% per level instead of 1%. --- lib/Lacuna/DB/Result/Building.pm | 4 ++-- lib/Lacuna/DB/Result/Building/Shipyard.pm | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index b8331bb6..763cdd01 100644 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -693,12 +693,12 @@ sub can_upgrade { sub construction_cost_reduction_bonus { my $self = shift; - return (100 - $self->body->empire->research_affinity) / 100; + return (100 - $self->body->empire->research_affinity * 5) / 100; } sub manufacturing_cost_reduction_bonus { my $self = shift; - return (100 - $self->body->empire->manufacturing_affinity) / 100; + return (100 - $self->body->empire->manufacturing_affinity * 5) / 100; } sub time_cost_reduction_bonus { diff --git a/lib/Lacuna/DB/Result/Building/Shipyard.pm b/lib/Lacuna/DB/Result/Building/Shipyard.pm index b6f11712..af61c0a8 100644 --- a/lib/Lacuna/DB/Result/Building/Shipyard.pm +++ b/lib/Lacuna/DB/Result/Building/Shipyard.pm @@ -49,12 +49,13 @@ sub get_ship_costs { my $throttle = Lacuna->config->get('ship_build_speed') || 0; my $seconds = sprintf('%0.f', $ship->base_time_cost * $self->time_cost_reduction_bonus(($self->level * 3) + $throttle)); $seconds = 15 if $seconds < 15; + my $bonus = $self->manufacturing_cost_reduction_bonus; return { seconds => $seconds, - food => sprintf('%0.f', $ship->base_food_cost * $percentage_of_cost * $self->manufacturing_cost_reduction_bonus), - water => sprintf('%0.f', $ship->base_water_cost * $percentage_of_cost * $self->manufacturing_cost_reduction_bonus), - ore => sprintf('%0.f', $ship->base_ore_cost * $percentage_of_cost * $self->manufacturing_cost_reduction_bonus), - energy => sprintf('%0.f', $ship->base_energy_cost * $percentage_of_cost * $self->manufacturing_cost_reduction_bonus), + food => sprintf('%0.f', $ship->base_food_cost * $percentage_of_cost * $bonus), + water => sprintf('%0.f', $ship->base_water_cost * $percentage_of_cost * $bonus), + ore => sprintf('%0.f', $ship->base_ore_cost * $percentage_of_cost * $bonus), + energy => sprintf('%0.f', $ship->base_energy_cost * $percentage_of_cost * $bonus), waste => sprintf('%0.f', $ship->base_waste_cost * $percentage_of_cost), }; } -- 2.51.2