From d61510dd087990b207fd70604bdc0906dfcfb8eb Mon Sep 17 00:00:00 2001 From: Mark Lemming Date: Tue, 24 Dec 2013 14:21:38 -0700 Subject: [PATCH] Forgot the task list. --- lib/Lacuna/RPC/Building/TheDillonForge.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Lacuna/RPC/Building/TheDillonForge.pm b/lib/Lacuna/RPC/Building/TheDillonForge.pm index 5a7cc719..f78b8653 100644 --- a/lib/Lacuna/RPC/Building/TheDillonForge.pm +++ b/lib/Lacuna/RPC/Building/TheDillonForge.pm @@ -69,6 +69,9 @@ sub _forge_tasks { my $building_level = $building->level ? $building->level : 1; my $body = $building->body; + my $effective_level = ($building_level > $building->body->empire->university_level + 1) ? + $building->body->empire->university_level + 1 : $building_level; + my @split_plans; PLAN: for my $plan (@{$body->plan_cache}) { @@ -88,8 +91,8 @@ PLAN: level => $plan->level, extra_build_level => $plan->extra_build_level, quantity => $plan->quantity, - fail_chance => 100 - ($building->level * 3), - reset_seconds => int(($num_glyphs * $halls * 30 * 3600) / ($building->level * 4)), + fail_chance => 100 - ($effective_level * 3), + reset_seconds => int(($num_glyphs * $halls * 30 * 3600) / ($effective_level * 4)), }; } @@ -98,7 +101,7 @@ PLAN: my @make_plans; foreach my $plan (@plans) { # It takes 2 level 1 plans for each level we are constructing. - my $max_level = min(int($plan->quantity / 2), $building_level); + my $max_level = min(int($plan->quantity / 2), $effective_level); if ($max_level >= 2) { my ($class) = $plan->class =~ m/Lacuna::DB::Result::Building::(.*)$/; push @make_plans, { -- 2.51.2