From af4fb4f720566082c5036f57ee6b7cd83dbf935c Mon Sep 17 00:00:00 2001 From: lemming552 Date: Fri, 20 Mar 2015 23:03:33 -0600 Subject: [PATCH] Balance modifications --- .../Building/Permanent/TheDillonForge.pm | 29 ++++++++++++++++++- lib/Lacuna/DB/Result/Ships/Fighter.pm | 2 +- lib/Lacuna/DB/Result/Ships/Sweeper.pm | 2 +- var/www/public/changes.txt | 2 ++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building/Permanent/TheDillonForge.pm b/lib/Lacuna/DB/Result/Building/Permanent/TheDillonForge.pm index 57428c1c..88c671f6 100644 --- a/lib/Lacuna/DB/Result/Building/Permanent/TheDillonForge.pm +++ b/lib/Lacuna/DB/Result/Building/Permanent/TheDillonForge.pm @@ -60,6 +60,9 @@ sub subsidy_cost { $sub = 2 + $sub * $pow_two; } } + my $working = $self->working_forges - 1; + $working = 0 if ($working < 0); + $sub *= 2**$working; return $sub; } @@ -97,6 +100,11 @@ sub split_plan { my $base = ($num_glyphs * $halls * 30 * 3600) / ($effective_level * 4); my $build_secs = int($base * (2.72 ** (log($quantity)/log(2))) + 0.5); + + my $working = $self->working_forges - 1; + $working = 0 if ($working < 0); + $build_secs *= 2**$working; + $build_secs = 15 if ($build_secs < 15); $build_secs = 31_536_000 if ($build_secs > 31_536_000); $self->start_work({task => 'split_plan', class => $class, level => $level, extra_build_level => $extra_build_level, quantity => $quantity}, $build_secs)->update; @@ -130,8 +138,11 @@ sub make_plan { } $body->delete_many_plans($plan, $quantity_to_delete); + my $working = $self->working_forges - 1; + $working = 0 if ($working < 0); + my $mult = 2**$working; - $self->start_work({task => 'make_plan', level => $level, class => $class}, ($level * 5000))->update; + $self->start_work({task => 'make_plan', level => $level, class => $class}, int(($level/1.75) * $mult * $level * 5000))->update; } sub equivalent_halls { @@ -145,6 +156,22 @@ sub equivalent_halls { return $halls; } +sub working_forges { + my ($self) = @_; + + my $working_forges = Lacuna->db->resultset('Empire') + ->search( + { + '_buildings.class' => "Lacuna::DB::Result::Building::Permanent::TheDillonForge", + 'me.id' => $self->body->empire_id, + '_buildings.is_working' => 1, + }, { + join => { 'bodies' => '_buildings' }, + })->count; + $working_forges = 0 unless defined($working_forges); + return $working_forges; +} + before finish_work => sub { my $self = shift; diff --git a/lib/Lacuna/DB/Result/Ships/Fighter.pm b/lib/Lacuna/DB/Result/Ships/Fighter.pm index 465daddc..1ce5c0da 100644 --- a/lib/Lacuna/DB/Result/Ships/Fighter.pm +++ b/lib/Lacuna/DB/Result/Ships/Fighter.pm @@ -13,7 +13,7 @@ use constant base_ore_cost => 14200; use constant base_time_cost => 60 * 60 * 4; use constant base_waste_cost => 4200; use constant base_combat => 5000; -use constant base_speed => 2000; +use constant base_speed => 2500; use constant pilotable => 1; use constant build_tags => ['War']; diff --git a/lib/Lacuna/DB/Result/Ships/Sweeper.pm b/lib/Lacuna/DB/Result/Ships/Sweeper.pm index a2276850..90902e29 100644 --- a/lib/Lacuna/DB/Result/Ships/Sweeper.pm +++ b/lib/Lacuna/DB/Result/Ships/Sweeper.pm @@ -13,7 +13,7 @@ use constant base_ore_cost => 75000; use constant base_time_cost => 60 * 60 * 7; use constant base_waste_cost => 20000; use constant base_combat => 6200; -use constant base_speed => 2600; +use constant base_speed => 2200; use constant base_stealth => 2800; use constant pilotable => 1; use constant build_tags => ['War']; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 2926fab1..ae61a56a 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -35,6 +35,8 @@ - Mod: Split happiness cost calculation with SS & Colonies. - Mod: SS Plans get cheaper packaging, level of SS Lab matters. - Fix: Known colonies includes allied knowledge. + - Mod: Balancing ships some more. + - Mod: Multiple Forges in empire ramp up costs. 3.0908: - Mod: trash_messages_where now defaults to not returning deleted message IDs. -- 2.51.2