From 918ef9b8e7ed3caa2786dcd8b13bf1964d1cba2a Mon Sep 17 00:00:00 2001 From: lemming552 Date: Wed, 9 May 2012 14:25:40 -0600 Subject: [PATCH] SRCS limited by range, but speed boosted. --- .../DB/Result/Building/SubspaceSupplyDepot.pm | 2 +- .../DB/Result/Ships/ShortRangeColonyShip.pm | 3 ++- lib/Lacuna/Role/Ship/Send/Range.pm | 16 ++++++++++++++++ var/www/public/changes.txt | 8 +++++--- 4 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 lib/Lacuna/Role/Ship/Send/Range.pm diff --git a/lib/Lacuna/DB/Result/Building/SubspaceSupplyDepot.pm b/lib/Lacuna/DB/Result/Building/SubspaceSupplyDepot.pm index 09ad6a63..831bc10b 100644 --- a/lib/Lacuna/DB/Result/Building/SubspaceSupplyDepot.pm +++ b/lib/Lacuna/DB/Result/Building/SubspaceSupplyDepot.pm @@ -111,7 +111,7 @@ after finish_work => sub { body_id => $body->id, type => 'short_range_colony_ship', name => 'The Gift', - speed => 25, + speed => 1500, task => 'Docked', })->insert; $body->empire->send_predefined_message( diff --git a/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm b/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm index 1d3384b9..ab655f65 100644 --- a/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm +++ b/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm @@ -13,12 +13,13 @@ use constant base_ore_cost => 15000; use constant base_time_cost => 60 * 60 * 8; use constant base_waste_cost => 7000; use constant base_combat => 1000; -use constant base_speed => 10; +use constant base_speed => 700; use constant base_stealth => 0; use constant base_hold_size => 0; use constant pilotable => 1; use constant build_tags => ['Colonization']; +with "Lacuna::Role::Ship::Send::Range"; with "Lacuna::Role::Ship::Send::Planet"; with "Lacuna::Role::Ship::Send::Uninhabited"; with "Lacuna::Role::Ship::Send::SpendNextColonyCost"; diff --git a/lib/Lacuna/Role/Ship/Send/Range.pm b/lib/Lacuna/Role/Ship/Send/Range.pm new file mode 100644 index 00000000..12c0d228 --- /dev/null +++ b/lib/Lacuna/Role/Ship/Send/Range.pm @@ -0,0 +1,16 @@ +package Lacuna::Role::Ship::Send::Range; + +use strict; +use Moose::Role; + +after can_send_to_target => sub { + my ($self, $target) = @_; + + my $distance = $self->body->calculate_distance_to_target($target); + my $range = int($self->speed/100+0.5); + if ($distance > $range) { + confess [1009, 'You only have a range of '.$range.' with this ship.']; + } +}; + +1; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 9cf0be6e..f096617b 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,12 +1,14 @@ 3.0851: - Mod: Change in consumption rates for secondary food. - Fix: Colony ships and trade ships in flight away from insurrected planet now switch flag to their own Capitol. - - Fix: Deployed Bleeders no longer count toward population totals. - - Fix: Waste Chains have star_id change to current star in moved via BHG. - - Mod: Stockpile change in testing. - Mod: Ships in a fleet will return at their own speed if on return trip. + - Fix: Waste Chains have star_id change to current star in moved via BHG. - Mod: Damaged Platforms give plots based on efficiency. + - Fix: Deployed Bleeders no longer count toward population totals. + - Mod: Supply Pods no longer use a plot. - Mod: Having negative plots available makes your people unhappy. + - Mod: Stockpile rules change in testing. + - Mod: Short Range Colony Ships faster, but limited in range. 3.0850: - Fix: All non-trade inflight ships self destruct from an insurrected planet. -- 2.51.2