diff --git a/lib/Lacuna.pm b/lib/Lacuna.pm index 0143b0e5..a5d8ab3a 100644 --- a/lib/Lacuna.pm +++ b/lib/Lacuna.pm @@ -7,7 +7,7 @@ use Config::JSON; useall __PACKAGE__; -our $VERSION = 3.0846; +our $VERSION = 3.0847; my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); my $db = Lacuna::DB->connect($config->get('db/dsn'),$config->get('db/username'),$config->get('db/password'), { mysql_enable_utf8 => 1}); diff --git a/lib/Lacuna/Constants.pm b/lib/Lacuna/Constants.pm index da98ce83..19ae6810 100644 --- a/lib/Lacuna/Constants.pm +++ b/lib/Lacuna/Constants.pm @@ -109,10 +109,10 @@ use constant SPACE_STATION_MODULES => (qw( )); use constant SHIP_TYPES => (qw( probe short_range_colony_ship colony_ship spy_pod cargo_ship space_station smuggler_ship mining_platform_ship terraforming_platform_ship surveyor - gas_giant_settlement_ship scow dory freighter snark snark2 snark3 thud + gas_giant_settlement_ship scow scow_fast scow_20 scow_30 dory freighter snark snark2 snark3 thud supply_pod supply_pod2 supply_pod3 supply_pod4 drone fighter spy_shuttle observatory_seeker security_ministry_seeker - spaceport_seeker excavator detonator scanner barge hulk galleon stake + spaceport_seeker excavator detonator scanner barge hulk hulk_fast hulk_huge galleon stake placebo placebo2 placebo3 placebo4 placebo5 placebo6 bleeder sweeper )); diff --git a/lib/Lacuna/DB/Result/Building/Shipyard.pm b/lib/Lacuna/DB/Result/Building/Shipyard.pm index eb1fd4a3..f0a9d7c2 100644 --- a/lib/Lacuna/DB/Result/Building/Shipyard.pm +++ b/lib/Lacuna/DB/Result/Building/Shipyard.pm @@ -141,6 +141,7 @@ sub build_ship { $self->set_ship_speed($ship); $self->set_ship_combat($ship); $self->set_ship_hold_size($ship); + $ship->dock_size($ship->base_dock_size); $self->set_ship_stealth($ship); $time ||= $self->get_ship_costs($ship)->{seconds}; my $latest = $self->building_ships->search(undef, { order_by => { -desc => 'date_available' }, rows => 1})->single; diff --git a/lib/Lacuna/DB/Result/Building/Trade.pm b/lib/Lacuna/DB/Result/Building/Trade.pm index 1137330b..e4be6ca9 100644 --- a/lib/Lacuna/DB/Result/Building/Trade.pm +++ b/lib/Lacuna/DB/Result/Building/Trade.pm @@ -119,10 +119,16 @@ sub available_market { sub trade_ships { my $self = shift; + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $self->body_id, + efficiency => 100, + } )->get_column('level')->max; return Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search({ task => 'Docked', - type => { 'in' => [qw(dory barge galleon hulk cargo_ship freighter smuggler_ship)] }, + type => { 'in' => [qw(dory barge galleon hulk hulk_huge hulk_fast cargo_ship freighter smuggler_ship)] }, body_id => $self->body_id, + dock_size => {'<=' => $max_level } }, { order_by=> {-desc => ['hold_size']} diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index 8d1fa622..2a5cf50f 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -39,6 +39,9 @@ use constant MEDALS => { terraforming_platform_ship => 'Built Terraforming Platform Ship', gas_giant_settlement_ship => 'Built Gas Giant Settlement Platform Ship', scow => 'Built Scow', + scow_20 => 'Built Scow 20', + scow_30 => 'Built Scow 30', + scow_fast => 'Built Fast Scow', dory => 'Built Dory', barge => 'Built Barge', placebo => 'Built Placebo', @@ -50,6 +53,8 @@ use constant MEDALS => { bleeder => 'Built Bleeder', galleon => 'Built Galleon', hulk => 'Built Hulk', + hulk_huge => 'Built Huge Hulk', + hulk_fast => 'Built Fast Hulk', freighter => 'Built Freighter', thud => 'Built Thud', stake => 'Built Stake', diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index fb8dc7b6..edc46fea 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -37,6 +37,7 @@ __PACKAGE__->add_columns( foreign_body_id => { data_type => 'int', is_nullable => 1 }, foreign_star_id => { data_type => 'int', is_nullable => 1 }, fleet_speed => { data_type => 'int', is_nullable => 0 }, + dock_size => { data_type => 'int', is_nullable => 0 }, ); __PACKAGE__->typecast_map(type => { 'probe' => 'Lacuna::DB::Result::Ships::Probe', @@ -65,11 +66,16 @@ __PACKAGE__->typecast_map(type => { 'detonator' => 'Lacuna::DB::Result::Ships::Detonator', 'excavator' => 'Lacuna::DB::Result::Ships::Excavator', 'scow' => 'Lacuna::DB::Result::Ships::Scow', + 'scow_20' => 'Lacuna::DB::Result::Ships::Scow20', + 'scow_30' => 'Lacuna::DB::Result::Ships::Scow30', + 'scow_fast' => 'Lacuna::DB::Result::Ships::ScowFast', 'freighter' => 'Lacuna::DB::Result::Ships::Freighter', 'dory' => 'Lacuna::DB::Result::Ships::Dory', 'barge' => 'Lacuna::DB::Result::Ships::Barge', 'galleon' => 'Lacuna::DB::Result::Ships::Galleon', 'hulk' => 'Lacuna::DB::Result::Ships::Hulk', + 'hulk_huge' => 'Lacuna::DB::Result::Ships::HulkHuge', + 'hulk_fast' => 'Lacuna::DB::Result::Ships::HulkFast', 'snark' => 'Lacuna::DB::Result::Ships::Snark', 'snark2' => 'Lacuna::DB::Result::Ships::Snark2', 'snark3' => 'Lacuna::DB::Result::Ships::Snark3', @@ -101,6 +107,7 @@ use constant base_speed => 1; use constant base_combat => 0; use constant base_stealth => 0; use constant base_hold_size => 0; +use constant base_dock_size => 1; use constant pilotable => 0; use constant target_building => []; use constant build_tags => []; @@ -196,6 +203,7 @@ sub get_status { stealth => $self->stealth, combat => $self->combat, hold_size => $self->hold_size, + dock_size => $self->dock_size, date_started => $self->date_started_formatted, date_available => $self->date_available_formatted, max_occupants => $self->max_occupants, diff --git a/lib/Lacuna/DB/Result/Ships/Barge.pm b/lib/Lacuna/DB/Result/Ships/Barge.pm index 9d027653..c34dd346 100644 --- a/lib/Lacuna/DB/Result/Ships/Barge.pm +++ b/lib/Lacuna/DB/Result/Ships/Barge.pm @@ -12,9 +12,10 @@ use constant base_energy_cost => 6100; use constant base_ore_cost => 10300; use constant base_time_cost => 5000; use constant base_waste_cost => 900; -use constant base_speed => 1050; +use constant base_speed => 1100; use constant base_stealth => 2450; -use constant base_hold_size => 790; +use constant base_hold_size => 800; +use constant base_dock_size => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/CargoShip.pm b/lib/Lacuna/DB/Result/Ships/CargoShip.pm index 1a319deb..a834f298 100644 --- a/lib/Lacuna/DB/Result/Ships/CargoShip.pm +++ b/lib/Lacuna/DB/Result/Ships/CargoShip.pm @@ -12,9 +12,10 @@ use constant base_energy_cost => 12000; use constant base_ore_cost => 20400; use constant base_time_cost => 7200; use constant base_waste_cost => 1500; -use constant base_speed => 1000; +use constant base_speed => 1050; use constant base_stealth => 1500; -use constant base_hold_size => 1555; +use constant base_hold_size => 1700; +use constant base_dock_size => 5; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Dory.pm b/lib/Lacuna/DB/Result/Ships/Dory.pm index b3d1e1cc..c554c213 100644 --- a/lib/Lacuna/DB/Result/Ships/Dory.pm +++ b/lib/Lacuna/DB/Result/Ships/Dory.pm @@ -12,9 +12,10 @@ use constant base_energy_cost => 3250; use constant base_ore_cost => 5500; use constant base_time_cost => 3800; use constant base_waste_cost => 400; -use constant base_speed => 1200; +use constant base_speed => 1250; use constant base_stealth => 4100; -use constant base_hold_size => 350; +use constant base_hold_size => 400; +use constant base_dock_size => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Freighter.pm b/lib/Lacuna/DB/Result/Ships/Freighter.pm index 17793bfd..dc03ce0b 100644 --- a/lib/Lacuna/DB/Result/Ships/Freighter.pm +++ b/lib/Lacuna/DB/Result/Ships/Freighter.pm @@ -13,9 +13,10 @@ use constant base_energy_cost => 36000; use constant base_ore_cost => 61000; use constant base_time_cost => 15000; use constant base_waste_cost => 4800; -use constant base_speed => 800; +use constant base_speed => 900; use constant base_stealth => 0; -use constant base_hold_size => 3500; +use constant base_hold_size => 4000; +use constant base_dock_size => 15; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Galleon.pm b/lib/Lacuna/DB/Result/Ships/Galleon.pm index 58f2e4f0..b1cfa225 100644 --- a/lib/Lacuna/DB/Result/Ships/Galleon.pm +++ b/lib/Lacuna/DB/Result/Ships/Galleon.pm @@ -12,9 +12,10 @@ use constant base_energy_cost => 25000; use constant base_ore_cost => 40200; use constant base_time_cost => 11200; use constant base_waste_cost => 3200; -use constant base_speed => 1200; +use constant base_speed => 1250; use constant base_stealth => 0; -use constant base_hold_size => 1650; +use constant base_hold_size => 1750; +use constant base_dock_size => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Hulk.pm b/lib/Lacuna/DB/Result/Ships/Hulk.pm index 44fff628..59fefe70 100644 --- a/lib/Lacuna/DB/Result/Ships/Hulk.pm +++ b/lib/Lacuna/DB/Result/Ships/Hulk.pm @@ -13,9 +13,10 @@ use constant base_energy_cost => 75000; use constant base_ore_cost => 124000; use constant base_time_cost => 20000; use constant base_waste_cost => 11000; -use constant base_speed => 500; +use constant base_speed => 600; use constant base_stealth => 0; use constant base_hold_size => 7900; +use constant base_dock_size => 20; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/HulkFast.pm b/lib/Lacuna/DB/Result/Ships/HulkFast.pm new file mode 100644 index 00000000..9a90f816 --- /dev/null +++ b/lib/Lacuna/DB/Result/Ships/HulkFast.pm @@ -0,0 +1,29 @@ +package Lacuna::DB::Result::Ships::HulkFast; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Ships'; + + +use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 28 }; +# Figure out how to also add Prop Level 30 to prereq +use constant base_food_cost => 15000; +use constant base_water_cost => 30000; +use constant base_energy_cost => 500000; +use constant base_ore_cost => 1000000; +use constant base_time_cost => 43200; +use constant base_waste_cost => 100000; +use constant base_speed => 750; +use constant base_stealth => 0; +use constant base_hold_size => 10000; +use constant base_dock_size => 25; +use constant pilotable => 1; +use constant build_tags => [qw(Trade Mining)]; + +with "Lacuna::Role::Ship::Send::UsePush"; +with "Lacuna::Role::Ship::Arrive::CargoExchange"; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm new file mode 100644 index 00000000..5e00cf4a --- /dev/null +++ b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm @@ -0,0 +1,28 @@ +package Lacuna::DB::Result::Ships::HulkHuge; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Ships'; + + +use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 30 }; +use constant base_food_cost => 60000; +use constant base_water_cost => 100000; +use constant base_energy_cost => 10000000; +use constant base_ore_cost => 5000000; +use constant base_time_cost => 86400; +use constant base_waste_cost => 200000; +use constant base_speed => 425; +use constant base_stealth => 0; +use constant base_hold_size => 100000; +use constant base_dock_size => 30; +use constant pilotable => 1; +use constant build_tags => [qw(Trade Mining)]; + +with "Lacuna::Role::Ship::Send::UsePush"; +with "Lacuna::Role::Ship::Arrive::CargoExchange"; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Ships/Scow.pm b/lib/Lacuna/DB/Result/Ships/Scow.pm index c49c8c4a..4a21594b 100644 --- a/lib/Lacuna/DB/Result/Ships/Scow.pm +++ b/lib/Lacuna/DB/Result/Ships/Scow.pm @@ -12,10 +12,11 @@ use constant base_energy_cost => 32400; use constant base_ore_cost => 28400; use constant base_time_cost => 14600; use constant base_waste_cost => 8400; -use constant base_speed => 400; +use constant base_speed => 450; use constant base_combat => 500; use constant base_stealth => 0; -use constant base_hold_size => 2100; +use constant base_hold_size => 2000; +use constant base_dock_size => 1; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/Scow20.pm b/lib/Lacuna/DB/Result/Ships/Scow20.pm new file mode 100644 index 00000000..9363213f --- /dev/null +++ b/lib/Lacuna/DB/Result/Ships/Scow20.pm @@ -0,0 +1,28 @@ +package Lacuna::DB::Result::Ships::Scow20; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Ships'; + +use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 20 }; +use constant base_food_cost => 10000; +use constant base_water_cost => 30000; +use constant base_energy_cost => 150000; +use constant base_ore_cost => 100000; +use constant base_time_cost => 28800; +use constant base_waste_cost => 50000; +use constant base_speed => 350; +use constant base_combat => 600; +use constant base_stealth => 0; +use constant base_hold_size => 10000; +use constant base_dock_size => 15; +use constant build_tags => [qw(War Trade)]; + +with "Lacuna::Role::Ship::Send::PlanetAndStar"; +with "Lacuna::Role::Ship::Send::MaybeHostile"; +with "Lacuna::Role::Ship::Arrive::TriggerDefense"; +with "Lacuna::Role::Ship::Arrive::DumpWaste"; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Ships/Scow30.pm b/lib/Lacuna/DB/Result/Ships/Scow30.pm new file mode 100644 index 00000000..b8bb3059 --- /dev/null +++ b/lib/Lacuna/DB/Result/Ships/Scow30.pm @@ -0,0 +1,28 @@ +package Lacuna::DB::Result::Ships::Scow30; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Ships'; + +use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 30 }; +use constant base_food_cost => 50000; +use constant base_water_cost => 150000; +use constant base_energy_cost => 5000000; +use constant base_ore_cost => 1000000; +use constant base_time_cost => 86400; +use constant base_waste_cost => 20000000; +use constant base_speed => 100; +use constant base_combat => 0; +use constant base_stealth => 0; +use constant base_hold_size => 200000; +use constant base_dock_size => 25; +use constant build_tags => [qw(War Trade)]; + +with "Lacuna::Role::Ship::Send::PlanetAndStar"; +with "Lacuna::Role::Ship::Send::MaybeHostile"; +with "Lacuna::Role::Ship::Arrive::TriggerDefense"; +with "Lacuna::Role::Ship::Arrive::DumpWaste"; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Ships/ScowFast.pm b/lib/Lacuna/DB/Result/Ships/ScowFast.pm new file mode 100644 index 00000000..5c2391d1 --- /dev/null +++ b/lib/Lacuna/DB/Result/Ships/ScowFast.pm @@ -0,0 +1,29 @@ +package Lacuna::DB::Result::Ships::ScowFast; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Ships'; + +use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 25 }; +# Prop 25 also when we figure it out. +use constant base_food_cost => 3000; +use constant base_water_cost => 10000; +use constant base_energy_cost => 100000; +use constant base_ore_cost => 60000; +use constant base_time_cost => 21600; +use constant base_waste_cost => 25000; +use constant base_speed => 700; +use constant base_combat => 500; +use constant base_stealth => 0; +use constant base_hold_size => 2000; +use constant base_dock_size => 20; +use constant build_tags => [qw(War Trade)]; + +with "Lacuna::Role::Ship::Send::PlanetAndStar"; +with "Lacuna::Role::Ship::Send::MaybeHostile"; +with "Lacuna::Role::Ship::Arrive::TriggerDefense"; +with "Lacuna::Role::Ship::Arrive::DumpWaste"; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm index a8019b52..83bed27d 100644 --- a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm +++ b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm @@ -12,9 +12,10 @@ use constant base_energy_cost => 27000; use constant base_ore_cost => 16800; use constant base_time_cost => 28800; use constant base_waste_cost => 1800; -use constant base_speed => 1500; -use constant base_stealth => 5500; -use constant base_hold_size => 480; +use constant base_speed => 1700; +use constant base_stealth => 5000; +use constant base_hold_size => 500; +use constant base_dock_size => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index b3f40a22..0fcdacce 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -1956,6 +1956,8 @@ sub steal_resources { 'galleon', 'freighter', 'hulk', + 'hulk_fast', + 'hulk_huge', 'dory', 'barge']}}, { rows => 1, order_by => 'rand()' } diff --git a/lib/Lacuna/RPC/Building/.SpacePort.pm.swp b/lib/Lacuna/RPC/Building/.SpacePort.pm.swp new file mode 100644 index 0000000000000000000000000000000000000000..37f112387eca9476ffdf179cf86e4dbf4227f264 GIT binary patch literal 53248 zcmYc?2=nw+FxN9?U|?VnU|{%aSn2Eb+CnYm4 zT|c-WF*!9Lzo+!Ur$#X*G!=UsnGZl4ZFu?l%*Z3J2uJSW5 zoZ@F-IKa=qu#lgDp@E-)A&Q@Y!GfQGL5ZJ%L6M(33n}LCqn}Oj!7X!mJE(QimE(QiME(V5DP6mc- zP6mclP6h@yP6h@xQ0JYKf#D4Y1H&s028Nd$3=CH}7#L=9Ffhb&FfeFwFfe>&XJFXK z&cLvSoq=H%I|D;8I|D-iI|G9OI|BnVI|IWnHU@_KYzz#y*cccVvN13Ou`w|CurV+= zvN14xVr5`>!^*&LfR%xvnU#Sdf|Y?Gh?RlCmz9CRf|Y?mm6d_vDhmU{3Kj;29u@|M z2o?qgXBGwq9TorcBo?Komgw4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;qMuFQ35Whf1P#~>lNCgj4M!4AmY0E*Q4&SwsC`}u*HBuDbURn*c9z4cu z2k(49+LX|Q0BW7tArC*p?h^$iYj8M_mZ&lA;6w{get_empire_by_session($session_id); my $building = $self->get_building($empire, $building_id); - my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search({ body_id => $building->body_id, task => { in => ['Mining', 'Docked']}, type => { 'in' => [qw(cargo_ship dory hulk barge galleon freighter smuggler_ship)] } }); + my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships') + ->search({ body_id => $building->body_id, task => { in => ['Mining', 'Docked']}, + type => { 'in' => [qw(cargo_ship dory hulk hulk_fast hulk_huge barge galleon freighter smuggler_ship)] } }); my @fleet; while (my $ship = $ships->next) { push @fleet, { diff --git a/lib/Lacuna/RPC/Building/Shipyard.pm b/lib/Lacuna/RPC/Building/Shipyard.pm index bd213c8b..c598a179 100644 --- a/lib/Lacuna/RPC/Building/Shipyard.pm +++ b/lib/Lacuna/RPC/Building/Shipyard.pm @@ -122,6 +122,7 @@ sub get_buildable { speed => $building->set_ship_speed($ship), stealth => $building->set_ship_stealth($ship), hold_size => $building->set_ship_hold_size($ship), + dock_size => $ship->base_dock_size, combat => $building->set_ship_combat($ship), max_occupants => $ship->max_occupants }, diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index ba0a1ab4..6ef9bcfd 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -296,9 +296,16 @@ sub prepare_send_spies { } $empire->current_session->check_captcha; + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $on_body_id, + efficiency => 100, + } )->get_column('level')->max; my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( - {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, task=>'Docked', body_id => $on_body_id}, + {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, + task=>'Docked', body_id => $on_body_id, + dock_size => {'<=' => $max_level } }, {order_by => 'name', rows=>100} ); my @ships; @@ -340,6 +347,11 @@ sub send_spies { } $empire->current_session->check_captcha; + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $to_body_id, + efficiency => 100, + } )->get_column('level')->max; # get the ship my $ship = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->find($ship_id); @@ -349,6 +361,9 @@ sub send_spies { unless ($ship->is_available) { confess [1010, "That ship is not available."]; } + unless ($ship->dock_size <= $max_level) { + confess [1010, "Your spaceport level is not high enough to support that ship."]; + } # check size unless (scalar(@{$spy_ids})) { @@ -409,8 +424,16 @@ sub prepare_fetch_spies { confess [1013, "Cannot fetch spies from an uninhabited planet."]; } + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $to_body_id, + efficiency => 100, + } )->get_column('level')->max; + my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( - {type => { in => [qw(cargo_ship smuggler_ship dory barge)]}, task=>'Docked', body_id => $to_body_id}, + {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, + task=>'Docked', body_id => $to_body_id, + dock_size => {'<=' => $max_level } }, {order_by => 'name', rows=>100} ); my @ships; @@ -453,6 +476,12 @@ sub fetch_spies { my $to_body = $self->get_body($empire, $to_body_id); my $on_body = Lacuna->db->resultset('Lacuna::DB::Result::Map::Body')->find($on_body_id); + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $to_body_id, + efficiency => 100, + } )->get_column('level')->max; + # get the ship my $ship = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->find($ship_id); unless (defined $ship) { @@ -462,6 +491,10 @@ sub fetch_spies { confess [1010, "That ship is not available."]; } + unless ($ship->dock_size <= $max_level) { + confess [1010, "Your spaceport level is not high enough to support that ship."]; + } + unless ($on_body->empire_id) { confess [1013, "Cannot fetch spies from an uninhabited planet."]; } diff --git a/lib/Lacuna/RPC/Building/Trade.pm b/lib/Lacuna/RPC/Building/Trade.pm index d0c7f9a0..e15f7131 100644 --- a/lib/Lacuna/RPC/Building/Trade.pm +++ b/lib/Lacuna/RPC/Building/Trade.pm @@ -25,6 +25,7 @@ sub get_trade_ships { my @ships; my $ships = $building->trade_ships; while (my $ship = $ships->next) { + push @ships, $ship->get_status($target); } return { diff --git a/lib/Lacuna/Role/TraderRpc.pm b/lib/Lacuna/Role/TraderRpc.pm index 1af5b75a..a66c8bbe 100644 --- a/lib/Lacuna/Role/TraderRpc.pm +++ b/lib/Lacuna/Role/TraderRpc.pm @@ -97,6 +97,7 @@ sub get_ships { name => $ship->name, type => $ship->type, hold_size => $ship->hold_size, + dock_size => $ship->dock_size, speed => $ship->speed, }; } @@ -116,10 +117,9 @@ sub get_ship_summary { {body_id => $building->body_id, task => 'docked'}, {order_by => [ 'type', 'hold_size', 'speed']} ); - my $ship_summary = {}; while (my $ship = $ships->next) { - my $key = sprintf("%s~%s~%02u~%02u", $ship->name, $ship->type, $ship->hold_size, $ship->speed); + my $key = sprintf("%s~%s~%02u~%02u~%02u", $ship->name, $ship->type, $ship->hold_size, $ship->speed, $ship->dock_size); $ship_summary->{$key}++; } @@ -129,7 +129,7 @@ sub get_ship_summary { my @out; for my $ship (@ships) { my ($key,$quantity) = %$ship; - my ($name,$type,$hold_size,$speed) = split /~/, $key; + my ($name,$type,$hold_size,$speed,$dock_size) = split /~/, $key; push @out, { name => $name, diff --git a/var/upgrades/3.0847.sql b/var/upgrades/3.0847.sql new file mode 100644 index 00000000..f49ea57d --- /dev/null +++ b/var/upgrades/3.0847.sql @@ -0,0 +1 @@ +alter table ships add column dock_size int default 1; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 5691544a..04734f19 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,3 +1,8 @@ +3.0847: + - Add: New Scow and Hulk types added. + - Add: New Spaceport requirement added for ships. Will not affect current existing ships. + - Add: BHG Medal image added. + 3.0846: - Fix: Fixed inapproriate use of it is in several files. - Fix: Closed API loophole. diff --git a/var/www/public/starmap/index.html b/var/www/public/starmap/index.html index 606b08a7..fd542238 100644 --- a/var/www/public/starmap/index.html +++ b/var/www/public/starmap/index.html @@ -25,11 +25,11 @@

-

Click and drag on either map to zoom in or out. Click on two points to calculate distance. Reset Zoom Highlight Zones

+

Click and drag on either map to zoom in or out. Click on two points to calculate distance. Reset Map

Show:

-

Brought to you by the Sea of Goats

+

This map would not be possible if not for the work by Empire Name of the Sea of Goats

@@ -55,15 +55,17 @@ $(function () { return keys; } - - - var choiceContainer = $("#choices"); - var keylist = keys(starmap.alliances).sort(function(a,b) {return starmap.alliances[a].id - starmap.alliances[b].id}); + var keylist = keys(starmap.alliances).sort( + function(a,b) { + return (starmap.alliances[a].id <= 0) ? -1 : + (starmap.alliances[a].label > starmap.alliances[b].label) ? 1 : -1; + } + ); for (var idx in keylist) { var key = keylist[idx]; var val = starmap.alliances[key]; - if (key == '-1') { + if (key < '0') { // by default only check the Saben choiceContainer.append('
' + @@ -103,6 +105,35 @@ $(function () { return data; } + var markings = [ + {xaxis: { from: -245, to: 245 }, yaxis: { from: -248, to: 249 }, color: "#00FFFF"}, + {xaxis: { from: -499, to: -250 }, yaxis: { from: -498, to: -250}, color: "#888888"}, + {xaxis: { from: -499, to: -250 }, yaxis: { from: -248, to: 249 }, color: "#dddddd"}, + {xaxis: { from: -245, to: 245 }, yaxis: { from: -498, to: -250}, color: "#dddddd"}, + {xaxis: { from: -245, to: 245 }, yaxis: { from: 250 , to: 499 }, color: "#dddddd"}, + {xaxis: { from: 250 , to: 499 }, yaxis: { from: -248, to: 249 }, color: "#dddddd"}, + {xaxis: { from: 250 , to: 499 }, yaxis: { from: 250 , to: 499 }, color: "#888888"}, + {xaxis: { from: -499, to: -250}, yaxis: { from: 250 , to: 499 }, color: "#888888"}, + {xaxis: { from: 250, to: 499 }, yaxis: { from: -498, to: -250 }, color: "#888888"}, + {xaxis: { from: 500, to: 747 }, yaxis: { from: -498, to: -250 }, color: "#dddddd"}, + {xaxis: { from: 1250, to: 1497}, yaxis: { from: 1250, to: 1495 }, color: "#888888"}, + {xaxis: { from: -748, to: -500}, yaxis: { from: -748, to: -500 }, color: "#888888"}, + {xaxis: { from: -748, to: -500}, yaxis: { from: -248, to: 249 }, color: "#888888"}, + {xaxis: { from: -748, to: -500}, yaxis: { from: 250 , to: 499 }, color: "#dddddd"}, + {xaxis: { from: -245, to: 245 }, yaxis: { from: -748, to: -500 }, color: "#888888"}, + {xaxis: { from: -245, to: 245 }, yaxis: { from: 500 , to: 749 }, color: "#888888"}, + {xaxis: { from: 250 , to: 499 }, yaxis: { from: -748, to: -500 }, color: "#dddddd"}, + {xaxis: { from: 500 , to: 747 }, yaxis: { from: -248, to: 249 }, color: "#888888"}, + {xaxis: { from: 500 , to: 747 }, yaxis: { from: 500 , to: 749 }, color: "#888888"}, + {xaxis: { from: -499, to: -250}, yaxis: { from: -748, to: -500 }, color: "#dddddd"}, + {xaxis: { from: -748, to: -500}, yaxis: { from: -498, to: -250 }, color: "#dddddd"}, + {xaxis: { from: -499, to: -250}, yaxis: { from: 500 , to: 749 }, color: "#dddddd"}, + {xaxis: { from: -748, to: -500}, yaxis: { from: 500 , to: 749 }, color: "#888888"}, + {xaxis: { from: 250 , to: 499 }, yaxis: { from: 500 , to: 748 }, color: "#dddddd"}, + {xaxis: { from: 500 , to: 747 }, yaxis: { from: -748, to: -500 }, color: "#888888"}, + {xaxis: { from: 500 , to: 747 }, yaxis: { from: 250 , to: 499 }, color: "#dddddd"}, + ]; + var options = { legend: { show: false }, @@ -112,8 +143,8 @@ $(function () { }, xaxis: { ticks: 10, min: starmap.map.bounds.x[0], max: starmap.map.bounds.x[1] }, selection: { mode: "xy" }, - grid: { hoverable: true, clickable: true }, - yaxis: { min: starmap.map.bounds.y[0], max: starmap.map.bounds.y[1] } + grid: { hoverable: true, clickable: true, markings: markings}, + yaxis: { ticks: 10, min: starmap.map.bounds.y[0], max: starmap.map.bounds.y[1] }, }; // now connect the two diff --git a/var/www/public/starmap/sectors.html b/var/www/public/starmap/sectors.html deleted file mode 100644 index ae3e6766..00000000 --- a/var/www/public/starmap/sectors.html +++ /dev/null @@ -1,284 +0,0 @@ - - - - - Lacuna Alliance Starmap - - - - - - - -

Lacuna Alliance Starmap

- - -
-
-
- -
-
- -

-
- -

Click and drag on either map to zoom in or out. Click on two points to calculate distance. Reset Map

- -

Show:

-
-

This map would not be possible if not for the work by Empire Name of the Sea of Goats

- -
- - - - - -- 2.51.2 From 559f215075f155857e297e648381c620bf4d8d93 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 08:31:43 -0600 Subject: [PATCH 02/45] Dock Size changed to Berth Size. --- lib/Lacuna.pm | 2 +- lib/Lacuna/DB/Result/Building/Shipyard.pm | 2 +- lib/Lacuna/DB/Result/Building/Trade.pm | 2 +- lib/Lacuna/DB/Result/Ships.pm | 6 +++--- lib/Lacuna/DB/Result/Ships/Barge.pm | 2 +- lib/Lacuna/DB/Result/Ships/CargoShip.pm | 2 +- lib/Lacuna/DB/Result/Ships/Dory.pm | 2 +- lib/Lacuna/DB/Result/Ships/Freighter.pm | 2 +- lib/Lacuna/DB/Result/Ships/Galleon.pm | 2 +- lib/Lacuna/DB/Result/Ships/Hulk.pm | 2 +- lib/Lacuna/DB/Result/Ships/HulkFast.pm | 2 +- lib/Lacuna/DB/Result/Ships/HulkHuge.pm | 2 +- lib/Lacuna/DB/Result/Ships/Scow.pm | 2 +- lib/Lacuna/DB/Result/Ships/Scow20.pm | 2 +- lib/Lacuna/DB/Result/Ships/Scow30.pm | 2 +- lib/Lacuna/DB/Result/Ships/ScowFast.pm | 2 +- lib/Lacuna/DB/Result/Ships/SmugglerShip.pm | 2 +- lib/Lacuna/RPC/Building/.SpacePort.pm.swp | Bin 53248 -> 0 bytes lib/Lacuna/RPC/Building/Shipyard.pm | 2 +- lib/Lacuna/RPC/Building/SpacePort.pm | 10 +++++----- lib/Lacuna/Role/TraderRpc.pm | 6 +++--- var/upgrades/3.0847.sql | 2 +- var/www/public/changes.txt | 4 ++++ 23 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 lib/Lacuna/RPC/Building/.SpacePort.pm.swp diff --git a/lib/Lacuna.pm b/lib/Lacuna.pm index a5d8ab3a..beaa09ae 100644 --- a/lib/Lacuna.pm +++ b/lib/Lacuna.pm @@ -7,7 +7,7 @@ use Config::JSON; useall __PACKAGE__; -our $VERSION = 3.0847; +our $VERSION = 3.0848; my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); my $db = Lacuna::DB->connect($config->get('db/dsn'),$config->get('db/username'),$config->get('db/password'), { mysql_enable_utf8 => 1}); diff --git a/lib/Lacuna/DB/Result/Building/Shipyard.pm b/lib/Lacuna/DB/Result/Building/Shipyard.pm index f0a9d7c2..f72248ea 100644 --- a/lib/Lacuna/DB/Result/Building/Shipyard.pm +++ b/lib/Lacuna/DB/Result/Building/Shipyard.pm @@ -141,7 +141,7 @@ sub build_ship { $self->set_ship_speed($ship); $self->set_ship_combat($ship); $self->set_ship_hold_size($ship); - $ship->dock_size($ship->base_dock_size); + $ship->berth_size($ship->base_berth_size); $self->set_ship_stealth($ship); $time ||= $self->get_ship_costs($ship)->{seconds}; my $latest = $self->building_ships->search(undef, { order_by => { -desc => 'date_available' }, rows => 1})->single; diff --git a/lib/Lacuna/DB/Result/Building/Trade.pm b/lib/Lacuna/DB/Result/Building/Trade.pm index e4be6ca9..78cd179b 100644 --- a/lib/Lacuna/DB/Result/Building/Trade.pm +++ b/lib/Lacuna/DB/Result/Building/Trade.pm @@ -128,7 +128,7 @@ sub trade_ships { task => 'Docked', type => { 'in' => [qw(dory barge galleon hulk hulk_huge hulk_fast cargo_ship freighter smuggler_ship)] }, body_id => $self->body_id, - dock_size => {'<=' => $max_level } + berth_size => {'<=' => $max_level } }, { order_by=> {-desc => ['hold_size']} diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index edc46fea..91f27797 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -37,7 +37,7 @@ __PACKAGE__->add_columns( foreign_body_id => { data_type => 'int', is_nullable => 1 }, foreign_star_id => { data_type => 'int', is_nullable => 1 }, fleet_speed => { data_type => 'int', is_nullable => 0 }, - dock_size => { data_type => 'int', is_nullable => 0 }, + berth_size => { data_type => 'int', is_nullable => 0 }, ); __PACKAGE__->typecast_map(type => { 'probe' => 'Lacuna::DB::Result::Ships::Probe', @@ -107,7 +107,7 @@ use constant base_speed => 1; use constant base_combat => 0; use constant base_stealth => 0; use constant base_hold_size => 0; -use constant base_dock_size => 1; +use constant base_berth_size => 1; use constant pilotable => 0; use constant target_building => []; use constant build_tags => []; @@ -203,7 +203,7 @@ sub get_status { stealth => $self->stealth, combat => $self->combat, hold_size => $self->hold_size, - dock_size => $self->dock_size, + berth_size => $self->berth_size, date_started => $self->date_started_formatted, date_available => $self->date_available_formatted, max_occupants => $self->max_occupants, diff --git a/lib/Lacuna/DB/Result/Ships/Barge.pm b/lib/Lacuna/DB/Result/Ships/Barge.pm index c34dd346..2cadba36 100644 --- a/lib/Lacuna/DB/Result/Ships/Barge.pm +++ b/lib/Lacuna/DB/Result/Ships/Barge.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 900; use constant base_speed => 1100; use constant base_stealth => 2450; use constant base_hold_size => 800; -use constant base_dock_size => 1; +use constant base_berth_size => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/CargoShip.pm b/lib/Lacuna/DB/Result/Ships/CargoShip.pm index a834f298..9efee7ff 100644 --- a/lib/Lacuna/DB/Result/Ships/CargoShip.pm +++ b/lib/Lacuna/DB/Result/Ships/CargoShip.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 1500; use constant base_speed => 1050; use constant base_stealth => 1500; use constant base_hold_size => 1700; -use constant base_dock_size => 5; +use constant base_berth_size => 5; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Dory.pm b/lib/Lacuna/DB/Result/Ships/Dory.pm index c554c213..39963900 100644 --- a/lib/Lacuna/DB/Result/Ships/Dory.pm +++ b/lib/Lacuna/DB/Result/Ships/Dory.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 400; use constant base_speed => 1250; use constant base_stealth => 4100; use constant base_hold_size => 400; -use constant base_dock_size => 1; +use constant base_berth_size => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Freighter.pm b/lib/Lacuna/DB/Result/Ships/Freighter.pm index dc03ce0b..1971382d 100644 --- a/lib/Lacuna/DB/Result/Ships/Freighter.pm +++ b/lib/Lacuna/DB/Result/Ships/Freighter.pm @@ -16,7 +16,7 @@ use constant base_waste_cost => 4800; use constant base_speed => 900; use constant base_stealth => 0; use constant base_hold_size => 4000; -use constant base_dock_size => 15; +use constant base_berth_size => 15; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Galleon.pm b/lib/Lacuna/DB/Result/Ships/Galleon.pm index b1cfa225..81362085 100644 --- a/lib/Lacuna/DB/Result/Ships/Galleon.pm +++ b/lib/Lacuna/DB/Result/Ships/Galleon.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 3200; use constant base_speed => 1250; use constant base_stealth => 0; use constant base_hold_size => 1750; -use constant base_dock_size => 10; +use constant base_berth_size => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Hulk.pm b/lib/Lacuna/DB/Result/Ships/Hulk.pm index 59fefe70..7f2cb881 100644 --- a/lib/Lacuna/DB/Result/Ships/Hulk.pm +++ b/lib/Lacuna/DB/Result/Ships/Hulk.pm @@ -16,7 +16,7 @@ use constant base_waste_cost => 11000; use constant base_speed => 600; use constant base_stealth => 0; use constant base_hold_size => 7900; -use constant base_dock_size => 20; +use constant base_berth_size => 20; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/HulkFast.pm b/lib/Lacuna/DB/Result/Ships/HulkFast.pm index 9a90f816..d3e908dd 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkFast.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkFast.pm @@ -17,7 +17,7 @@ use constant base_waste_cost => 100000; use constant base_speed => 750; use constant base_stealth => 0; use constant base_hold_size => 10000; -use constant base_dock_size => 25; +use constant base_berth_size => 25; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm index 5e00cf4a..f9e84229 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm @@ -16,7 +16,7 @@ use constant base_waste_cost => 200000; use constant base_speed => 425; use constant base_stealth => 0; use constant base_hold_size => 100000; -use constant base_dock_size => 30; +use constant base_berth_size => 30; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Scow.pm b/lib/Lacuna/DB/Result/Ships/Scow.pm index 4a21594b..5c2cc767 100644 --- a/lib/Lacuna/DB/Result/Ships/Scow.pm +++ b/lib/Lacuna/DB/Result/Ships/Scow.pm @@ -16,7 +16,7 @@ use constant base_speed => 450; use constant base_combat => 500; use constant base_stealth => 0; use constant base_hold_size => 2000; -use constant base_dock_size => 1; +use constant base_berth_size => 1; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/Scow20.pm b/lib/Lacuna/DB/Result/Ships/Scow20.pm index 9363213f..bde62437 100644 --- a/lib/Lacuna/DB/Result/Ships/Scow20.pm +++ b/lib/Lacuna/DB/Result/Ships/Scow20.pm @@ -16,7 +16,7 @@ use constant base_speed => 350; use constant base_combat => 600; use constant base_stealth => 0; use constant base_hold_size => 10000; -use constant base_dock_size => 15; +use constant base_berth_size => 15; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/Scow30.pm b/lib/Lacuna/DB/Result/Ships/Scow30.pm index b8bb3059..bf838f20 100644 --- a/lib/Lacuna/DB/Result/Ships/Scow30.pm +++ b/lib/Lacuna/DB/Result/Ships/Scow30.pm @@ -16,7 +16,7 @@ use constant base_speed => 100; use constant base_combat => 0; use constant base_stealth => 0; use constant base_hold_size => 200000; -use constant base_dock_size => 25; +use constant base_berth_size => 25; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/ScowFast.pm b/lib/Lacuna/DB/Result/Ships/ScowFast.pm index 5c2391d1..69c0c9b8 100644 --- a/lib/Lacuna/DB/Result/Ships/ScowFast.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowFast.pm @@ -17,7 +17,7 @@ use constant base_speed => 700; use constant base_combat => 500; use constant base_stealth => 0; use constant base_hold_size => 2000; -use constant base_dock_size => 20; +use constant base_berth_size => 20; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm index 83bed27d..4f2cd596 100644 --- a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm +++ b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 1800; use constant base_speed => 1700; use constant base_stealth => 5000; use constant base_hold_size => 500; -use constant base_dock_size => 10; +use constant base_berth_size => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/RPC/Building/.SpacePort.pm.swp b/lib/Lacuna/RPC/Building/.SpacePort.pm.swp deleted file mode 100644 index 37f112387eca9476ffdf179cf86e4dbf4227f264..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 53248 zcmYc?2=nw+FxN9?U|?VnU|{%aSn2Eb+CnYm4 zT|c-WF*!9Lzo+!Ur$#X*G!=UsnGZl4ZFu?l%*Z3J2uJSW5 zoZ@F-IKa=qu#lgDp@E-)A&Q@Y!GfQGL5ZJ%L6M(33n}LCqn}Oj!7X!mJE(QimE(QiME(V5DP6mc- zP6mclP6h@yP6h@xQ0JYKf#D4Y1H&s028Nd$3=CH}7#L=9Ffhb&FfeFwFfe>&XJFXK z&cLvSoq=H%I|D;8I|D-iI|G9OI|BnVI|IWnHU@_KYzz#y*cccVvN13Ou`w|CurV+= zvN14xVr5`>!^*&LfR%xvnU#Sdf|Y?Gh?RlCmz9CRf|Y?mm6d_vDhmU{3Kj;29u@|M z2o?qgXBGwq9TorcBo?Komgw4L7AI<`Ll#?DS-Ch_Sp}sQm*$jMS@|XwSXl*^ zBo?V_YARGSfD8i@njm99JOzccoYd5k_~O*Ol=z&?+{_Y?sI8rXN^W9Bd~rr*L9q^4 z2S~UyFR?5!Gbb@ACl$m6V_Q3g7zZQ?glbH+3JPG=a0!Ik%)I1$&~g;8kx&Ax7AApE zT3nJ?Qd$gE1EoOjEl$lz)3r;>FUn0UiH9iCP)W@#$Sg|LQBXJqC0jX=3oS&DLnXYS>o?4=z4i1X=g4CjTaDb_6D%8{{7#Tpq z5o}B?m;||~ptLwc!2#h-1r?BPut9K_L81;R9-wMK4%L7-7h*QZK!njCUS4WN2|`Xm z0b(6;94J&PfNTT>H`L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WhKU>u4BgPaekBJ3Ll_4GgBS+`g8&Bu12+c)!)bN~ zh8^q-44c>)7_!+J7$Vpi7=obp0$gBYU^vCbz;Kj}fdOPw@8ESzB5u<&>o#5R|&^wes*%ySt^*Fd&g0%^+1HZr%vJC*F z1$@m-d|p22%$EIST2iB_IP*Qxp=@6EpL`jsV#XEn-1Tke#p|F~rT# zLJU-ZLAncw`+>m*z{*+lleQqe9FXf_VGXL1!1qrfZR*Cmlow$%*l7x|<7EjM3Q~<` zFh~f~ILM7xV6VYE4PJ+=ppppLxvPoX>;svBzzF|=Qv>M61<>7ENPdH<1!XFzc?z}) zE{P?nA(^?Upj|ZOx^{^vDH_G8$@zIH#kO|Puue|QNiNMvEJ=l)<`Q3$nVYHsbD<_u zx&c`M9-=4)1uQg|f~J6Rc5o1?k?+QZbwEJoft*{6a>W;ljMNkP*vNmWxpW@@oI)EZD{2sx%9EmD{$D9|Aykn3&}A>%6GBnc)Ev5nSr z9V~ZNLyxY5#yNPs18DvV>G~&i(9xP$E{g^ojsm~78sSeO@5C<1Pr+%hE&TEk1;`a) z2-A^65p~)Slz(9Jb>*2Q86;nP4N7$=w{H`OKsw(_4RRj#Z~$GAP1&W?u#AV*d{D<{ zuuM@xav69heMV*h(uqX`E|mra9t@dhn1Uk> zQNSTspnL;qMuFQ35Whf1P#~>lNCgj4M!4AmY0E*Q4&SwsC`}u*HBuDbURn*c9z4cu z2k(49+LX|Q0BW7tArC*p?h^$iYj8M_mZ&lA;6w{ $building->set_ship_speed($ship), stealth => $building->set_ship_stealth($ship), hold_size => $building->set_ship_hold_size($ship), - dock_size => $ship->base_dock_size, + berth_size => $ship->base_berth_size, combat => $building->set_ship_combat($ship), max_occupants => $ship->max_occupants }, diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index 6ef9bcfd..4d18d1de 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -190,7 +190,7 @@ sub send_fleet { push @fleet, $ship_id; } unless ($excavator <= 1) { - confess [1010, 'Only one Excavator may be sent to a body in a 30 day period']; + confess [1010, 'Only one Excavator may be sent to a body by this empire.']; } unless ($set_speed <= $speed) { confess [1009, 'Set speed cannot exceed the speed of the slowest ship.']; @@ -305,7 +305,7 @@ sub prepare_send_spies { my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, task=>'Docked', body_id => $on_body_id, - dock_size => {'<=' => $max_level } }, + berth_size => {'<=' => $max_level } }, {order_by => 'name', rows=>100} ); my @ships; @@ -361,7 +361,7 @@ sub send_spies { unless ($ship->is_available) { confess [1010, "That ship is not available."]; } - unless ($ship->dock_size <= $max_level) { + unless ($ship->berth_size <= $max_level) { confess [1010, "Your spaceport level is not high enough to support that ship."]; } @@ -433,7 +433,7 @@ sub prepare_fetch_spies { my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, task=>'Docked', body_id => $to_body_id, - dock_size => {'<=' => $max_level } }, + berth_size => {'<=' => $max_level } }, {order_by => 'name', rows=>100} ); my @ships; @@ -491,7 +491,7 @@ sub fetch_spies { confess [1010, "That ship is not available."]; } - unless ($ship->dock_size <= $max_level) { + unless ($ship->berth_size <= $max_level) { confess [1010, "Your spaceport level is not high enough to support that ship."]; } diff --git a/lib/Lacuna/Role/TraderRpc.pm b/lib/Lacuna/Role/TraderRpc.pm index a66c8bbe..3b645082 100644 --- a/lib/Lacuna/Role/TraderRpc.pm +++ b/lib/Lacuna/Role/TraderRpc.pm @@ -97,7 +97,7 @@ sub get_ships { name => $ship->name, type => $ship->type, hold_size => $ship->hold_size, - dock_size => $ship->dock_size, + berth_size => $ship->berth_size, speed => $ship->speed, }; } @@ -119,7 +119,7 @@ sub get_ship_summary { ); my $ship_summary = {}; while (my $ship = $ships->next) { - my $key = sprintf("%s~%s~%02u~%02u~%02u", $ship->name, $ship->type, $ship->hold_size, $ship->speed, $ship->dock_size); + my $key = sprintf("%s~%s~%02u~%02u~%02u", $ship->name, $ship->type, $ship->hold_size, $ship->speed, $ship->berth_size); $ship_summary->{$key}++; } @@ -129,7 +129,7 @@ sub get_ship_summary { my @out; for my $ship (@ships) { my ($key,$quantity) = %$ship; - my ($name,$type,$hold_size,$speed,$dock_size) = split /~/, $key; + my ($name,$type,$hold_size,$speed,$berth_size) = split /~/, $key; push @out, { name => $name, diff --git a/var/upgrades/3.0847.sql b/var/upgrades/3.0847.sql index f49ea57d..11e42cd4 100644 --- a/var/upgrades/3.0847.sql +++ b/var/upgrades/3.0847.sql @@ -1 +1 @@ -alter table ships add column dock_size int default 1; +alter table ships add column berth_size tinyint default 1; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 04734f19..e78bf04a 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,3 +1,7 @@ +3.0848: + - Mod: Berth Size less confusing than Dock Size. + - Fix: Scows limited to Spaceport Level determined by Berth. + 3.0847: - Add: New Scow and Hulk types added. - Add: New Spaceport requirement added for ships. Will not affect current existing ships. -- 2.51.2 From 648ffc7ba7c351c01aaef70a7a0b626ed44e20f3 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 09:46:24 -0600 Subject: [PATCH 03/45] Scow 20 and 30 renamed to Large and Mega. --- lib/Lacuna/DB/Result/Medals.pm | 4 +-- lib/Lacuna/DB/Result/Ships.pm | 4 +-- lib/Lacuna/DB/Result/Ships/HulkHuge.pm | 16 +++++----- .../Result/Ships/{Scow20.pm => ScowLarge.pm} | 14 ++++---- .../Result/Ships/{Scow30.pm => ScowMega.pm} | 16 +++++----- lib/Lacuna/RPC/Building/SpacePort.pm | 32 +++++++++++++------ lib/Lacuna/RPC/Stats.pm | 4 +-- 7 files changed, 51 insertions(+), 39 deletions(-) rename lib/Lacuna/DB/Result/Ships/{Scow20.pm => ScowLarge.pm} (69%) rename lib/Lacuna/DB/Result/Ships/{Scow30.pm => ScowMega.pm} (64%) diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index 2a5cf50f..247b5db3 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -39,8 +39,8 @@ use constant MEDALS => { terraforming_platform_ship => 'Built Terraforming Platform Ship', gas_giant_settlement_ship => 'Built Gas Giant Settlement Platform Ship', scow => 'Built Scow', - scow_20 => 'Built Scow 20', - scow_30 => 'Built Scow 30', + scow_large => 'Built Large Scow', + scow_mega => 'Built Mega Scow', scow_fast => 'Built Fast Scow', dory => 'Built Dory', barge => 'Built Barge', diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index 91f27797..d461f382 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -66,8 +66,8 @@ __PACKAGE__->typecast_map(type => { 'detonator' => 'Lacuna::DB::Result::Ships::Detonator', 'excavator' => 'Lacuna::DB::Result::Ships::Excavator', 'scow' => 'Lacuna::DB::Result::Ships::Scow', - 'scow_20' => 'Lacuna::DB::Result::Ships::Scow20', - 'scow_30' => 'Lacuna::DB::Result::Ships::Scow30', + 'scow_large' => 'Lacuna::DB::Result::Ships::ScowLarge', + 'scow_mega' => 'Lacuna::DB::Result::Ships::ScowMega', 'scow_fast' => 'Lacuna::DB::Result::Ships::ScowFast', 'freighter' => 'Lacuna::DB::Result::Ships::Freighter', 'dory' => 'Lacuna::DB::Result::Ships::Dory', diff --git a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm index f9e84229..8f30bac0 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm @@ -7,15 +7,15 @@ extends 'Lacuna::DB::Result::Ships'; use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 30 }; -use constant base_food_cost => 60000; -use constant base_water_cost => 100000; -use constant base_energy_cost => 10000000; -use constant base_ore_cost => 5000000; -use constant base_time_cost => 86400; -use constant base_waste_cost => 200000; -use constant base_speed => 425; +use constant base_food_cost => 90000; +use constant base_water_cost => 150000; +use constant base_energy_cost => 15000000; +use constant base_ore_cost => 7500000; +use constant base_time_cost => 128000; +use constant base_waste_cost => 250000; +use constant base_speed => 420; use constant base_stealth => 0; -use constant base_hold_size => 100000; +use constant base_hold_size => 150000; use constant base_berth_size => 30; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Scow20.pm b/lib/Lacuna/DB/Result/Ships/ScowLarge.pm similarity index 69% rename from lib/Lacuna/DB/Result/Ships/Scow20.pm rename to lib/Lacuna/DB/Result/Ships/ScowLarge.pm index bde62437..d3cec297 100644 --- a/lib/Lacuna/DB/Result/Ships/Scow20.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowLarge.pm @@ -1,4 +1,4 @@ -package Lacuna::DB::Result::Ships::Scow20; +package Lacuna::DB::Result::Ships::ScowLarge; use Moose; use utf8; @@ -7,15 +7,15 @@ extends 'Lacuna::DB::Result::Ships'; use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 20 }; use constant base_food_cost => 10000; -use constant base_water_cost => 30000; -use constant base_energy_cost => 150000; -use constant base_ore_cost => 100000; -use constant base_time_cost => 28800; +use constant base_water_cost => 32000; +use constant base_energy_cost => 170000; +use constant base_ore_cost => 120000; +use constant base_time_cost => 32000; use constant base_waste_cost => 50000; -use constant base_speed => 350; +use constant base_speed => 325; use constant base_combat => 600; use constant base_stealth => 0; -use constant base_hold_size => 10000; +use constant base_hold_size => 12000; use constant base_berth_size => 15; use constant build_tags => [qw(War Trade)]; diff --git a/lib/Lacuna/DB/Result/Ships/Scow30.pm b/lib/Lacuna/DB/Result/Ships/ScowMega.pm similarity index 64% rename from lib/Lacuna/DB/Result/Ships/Scow30.pm rename to lib/Lacuna/DB/Result/Ships/ScowMega.pm index bf838f20..808267d8 100644 --- a/lib/Lacuna/DB/Result/Ships/Scow30.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowMega.pm @@ -1,4 +1,4 @@ -package Lacuna::DB::Result::Ships::Scow30; +package Lacuna::DB::Result::Ships::ScowMega; use Moose; use utf8; @@ -6,16 +6,16 @@ no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 30 }; -use constant base_food_cost => 50000; -use constant base_water_cost => 150000; -use constant base_energy_cost => 5000000; -use constant base_ore_cost => 1000000; -use constant base_time_cost => 86400; -use constant base_waste_cost => 20000000; +use constant base_food_cost => 60000; +use constant base_water_cost => 180000; +use constant base_energy_cost => 6000000; +use constant base_ore_cost => 1500000; +use constant base_time_cost => 98000; +use constant base_waste_cost => 25000000; use constant base_speed => 100; use constant base_combat => 0; use constant base_stealth => 0; -use constant base_hold_size => 200000; +use constant base_hold_size => 300000; use constant base_berth_size => 25; use constant build_tags => [qw(War Trade)]; diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index 4d18d1de..c28db256 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -72,19 +72,31 @@ sub get_ships_for { push @incoming, $ship->get_status; } + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $body_id, + efficiency => 100, + } )->get_column('level')->max; + my @unavailable; my @available; - my $available_rs = $ships->search({task => 'Docked', body_id=>$body->id }); + my $available_rs = $ships->search( {task => 'Docked', + body_id=>$body->id }); while (my $ship = $available_rs->next) { - $ship->body($body); - eval{ $ship->can_send_to_target($target) }; - my $reason = $@; - if ($reason) { - push @unavailable, { ship => $ship->get_status, reason => $reason }; - next; - } - $ship->body($body); - push @available, $ship->get_status($target); + $ship->body($body); + eval{ $ship->can_send_to_target($target) }; + my $reason = $@; + if ($reason) { + push @unavailable, { ship => $ship->get_status, reason => $reason }; + next; + } + if ($ship->berth_size > $max_level) { + $reason = [ 552, 'Max Berth Size from this planet is '.$max_level ]; + push @unavailable, { ship => $ship->get_status, reason => $reason }; + next; + } + $ship->body($body); + push @available, $ship->get_status($target); } my $max_ships = Lacuna->config->get('ships_per_fleet') || 20; diff --git a/lib/Lacuna/RPC/Stats.pm b/lib/Lacuna/RPC/Stats.pm index 0ac2b377..132c6146 100644 --- a/lib/Lacuna/RPC/Stats.pm +++ b/lib/Lacuna/RPC/Stats.pm @@ -11,12 +11,12 @@ sub credits { { 'Game Design' => ['JT Smith','Jamie Vrbsky']}, { 'Web Client' => ['John Rozeske','Graham Knop','Matthew Musgrove']}, { 'iPhone Client' => ['Kevin Runde']}, - { 'Game Server' => ['JT Smith','Graham Knop','Matthew Musgrove','Ian C. Docherty (icydee)']}, + { 'Game Server' => ['JT Smith','Graham Knop','Matthew Musgrove','Ian C. Docherty (icydee)', 'Mark Lemming (Norway)']}, { 'Art and Icons' => ['Ryan Knope','JT Smith','Joseph Wain / glyphish.com','Keegan Runde']}, { 'Geology Consultant' => ['Geofuels, LLC / geofuelsllc.com']}, { 'Play Testers' => ['John Oettinger','Jamie Vrbsky','Mike Kastern','Chris Burr','Eric Patterson','Frank Dillon','Kristi McCombs','Ryan McCombs','Mike Helfman','Tavis Parker','Sarah Bownds','Rob Dicke','Gemma Blair','Bev Smith','Mike Vrbsky']}, { 'Game Support' => ['Plain Black Corporation / plainblack.com','Mary Hoerr']}, - { 'Lost City of Tyleon' => ['Steven Binns','Owen Ferguson','Garloo','Mark Lemming, Norway','Saint','Shadow','JT Smith','Noel Sorensen','James T']}, + { 'Lost City of Tyleon' => ['Steven Binns','Owen Ferguson','Garloo','Mark Lemming, (Norway)','Saint','Shadow','JT Smith','Noel Sorensen','James T']}, { 'AI Design' => ['JT Smith','Ian C. Docherty (icydee)']}, ]; } -- 2.51.2 From d91d250f2426435115a387892b17438f9e982349 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 09:47:33 -0600 Subject: [PATCH 04/45] updated changes.txt --- var/www/public/changes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index e78bf04a..d42b2ceb 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,6 +1,7 @@ 3.0848: - Mod: Berth Size less confusing than Dock Size. - Fix: Scows limited to Spaceport Level determined by Berth. + - Mod: Scow 20 and 30 changed names. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From 6f7191a14306ae276fbd6bd0acb47614ee718dc2 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 10:05:28 -0600 Subject: [PATCH 05/45] Forgot one place to modify names. --- lib/Lacuna/Constants.pm | 2 +- var/www/public/changes.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/Constants.pm b/lib/Lacuna/Constants.pm index 19ae6810..36150e81 100644 --- a/lib/Lacuna/Constants.pm +++ b/lib/Lacuna/Constants.pm @@ -109,7 +109,7 @@ use constant SPACE_STATION_MODULES => (qw( )); use constant SHIP_TYPES => (qw( probe short_range_colony_ship colony_ship spy_pod cargo_ship space_station smuggler_ship mining_platform_ship terraforming_platform_ship surveyor - gas_giant_settlement_ship scow scow_fast scow_20 scow_30 dory freighter snark snark2 snark3 thud + gas_giant_settlement_ship scow scow_fast scow_large scow_mega dory freighter snark snark2 snark3 thud supply_pod supply_pod2 supply_pod3 supply_pod4 drone fighter spy_shuttle observatory_seeker security_ministry_seeker spaceport_seeker excavator detonator scanner barge hulk hulk_fast hulk_huge galleon stake diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index d42b2ceb..7dadd8da 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,7 +1,7 @@ 3.0848: - Mod: Berth Size less confusing than Dock Size. - Fix: Scows limited to Spaceport Level determined by Berth. - - Mod: Scow 20 and 30 changed names. + - Mod: Scow 20 and 30 changed names to Large & Mega. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From c96b7ba494a9417030c339e82eb92c00f70768d2 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 11:49:03 -0600 Subject: [PATCH 06/45] Multiple Building Prereqs for ships possible. --- lib/Lacuna/DB/Result/Building/Shipyard.pm | 74 +++++++++++-------- lib/Lacuna/DB/Result/Ships.pm | 2 +- lib/Lacuna/DB/Result/Ships/Barge.pm | 4 +- lib/Lacuna/DB/Result/Ships/Bleeder.pm | 2 +- lib/Lacuna/DB/Result/Ships/CargoShip.pm | 4 +- lib/Lacuna/DB/Result/Ships/ColonyShip.pm | 2 +- lib/Lacuna/DB/Result/Ships/Detonator.pm | 2 +- lib/Lacuna/DB/Result/Ships/Dory.pm | 4 +- lib/Lacuna/DB/Result/Ships/Drone.pm | 2 +- lib/Lacuna/DB/Result/Ships/Excavator.pm | 10 +-- lib/Lacuna/DB/Result/Ships/Fighter.pm | 3 +- lib/Lacuna/DB/Result/Ships/Freighter.pm | 4 +- lib/Lacuna/DB/Result/Ships/Galleon.pm | 4 +- .../Ships/GasGiantSettlementPlatformShip.pm | 2 +- lib/Lacuna/DB/Result/Ships/Hulk.pm | 4 +- lib/Lacuna/DB/Result/Ships/HulkFast.pm | 4 +- lib/Lacuna/DB/Result/Ships/HulkHuge.pm | 2 +- .../DB/Result/Ships/MiningPlatformShip.pm | 2 +- .../DB/Result/Ships/ObservatorySeeker.pm | 2 +- lib/Lacuna/DB/Result/Ships/Placebo.pm | 2 +- lib/Lacuna/DB/Result/Ships/Placebo2.pm | 2 +- lib/Lacuna/DB/Result/Ships/Placebo3.pm | 2 +- lib/Lacuna/DB/Result/Ships/Placebo4.pm | 2 +- lib/Lacuna/DB/Result/Ships/Placebo5.pm | 2 +- lib/Lacuna/DB/Result/Ships/Placebo6.pm | 2 +- lib/Lacuna/DB/Result/Ships/Probe.pm | 2 +- lib/Lacuna/DB/Result/Ships/Scanner.pm | 2 +- lib/Lacuna/DB/Result/Ships/Scow.pm | 5 +- lib/Lacuna/DB/Result/Ships/ScowFast.pm | 6 +- lib/Lacuna/DB/Result/Ships/ScowLarge.pm | 4 +- lib/Lacuna/DB/Result/Ships/ScowMega.pm | 4 +- .../DB/Result/Ships/SecurityMinistrySeeker.pm | 2 +- .../DB/Result/Ships/ShortRangeColonyShip.pm | 2 +- lib/Lacuna/DB/Result/Ships/SmugglerShip.pm | 2 +- lib/Lacuna/DB/Result/Ships/Snark.pm | 2 +- lib/Lacuna/DB/Result/Ships/Snark2.pm | 2 +- lib/Lacuna/DB/Result/Ships/Snark3.pm | 2 +- lib/Lacuna/DB/Result/Ships/SpacePortSeeker.pm | 2 +- lib/Lacuna/DB/Result/Ships/SpaceStation.pm | 2 +- lib/Lacuna/DB/Result/Ships/SpyPod.pm | 2 +- lib/Lacuna/DB/Result/Ships/SpyShuttle.pm | 2 +- lib/Lacuna/DB/Result/Ships/Stake.pm | 2 +- lib/Lacuna/DB/Result/Ships/SupplyPod.pm | 2 +- lib/Lacuna/DB/Result/Ships/SupplyPod2.pm | 2 +- lib/Lacuna/DB/Result/Ships/SupplyPod3.pm | 2 +- lib/Lacuna/DB/Result/Ships/SupplyPod4.pm | 2 +- lib/Lacuna/DB/Result/Ships/Surveyor.pm | 2 +- lib/Lacuna/DB/Result/Ships/Sweeper.pm | 2 +- .../Result/Ships/TerraformingPlatformShip.pm | 2 +- lib/Lacuna/DB/Result/Ships/Thud.pm | 2 +- 50 files changed, 105 insertions(+), 101 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building/Shipyard.pm b/lib/Lacuna/DB/Result/Building/Shipyard.pm index f72248ea..8f5956ff 100644 --- a/lib/Lacuna/DB/Result/Building/Shipyard.pm +++ b/lib/Lacuna/DB/Result/Building/Shipyard.pm @@ -75,39 +75,53 @@ has max_ships => ( ); sub can_build_ship { - my ($self, $ship, $costs, $quantity) = @_; - $quantity = defined $quantity ? $quantity : 1; - - if (ref $ship eq 'Lacuna::DB::Result::Ships') { - confess [1002, 'That is an unknown ship type.']; - } - $ship->body_id($self->body_id); - $ship->shipyard_id($self->id); - my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships'); - $costs ||= $self->get_ship_costs($ship); - if ($self->level < 1) { - confess [1013, "You can't build a ship if the shipyard isn't complete."]; - } - my $count = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { body_id => $self->body_id, class => $ship->prereq->{class}, level => {'>=' => $ship->prereq->{level}} } )->count; + my ($self, $ship, $costs, $quantity) = @_; + $quantity = defined $quantity ? $quantity : 1; + + if (ref $ship eq 'Lacuna::DB::Result::Ships') { + confess [1002, 'That is an unknown ship type.']; + } + $ship->body_id($self->body_id); + $ship->shipyard_id($self->id); + my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships'); + $costs ||= $self->get_ship_costs($ship); + if ($self->level < 1) { + confess [1013, "You can't build a ship if the shipyard isn't complete."]; + } + my $reason = ''; + for my $prereq (@{$ship->prereq}) { + my $count = Lacuna->db->resultset('Lacuna::DB::Result::Building') + ->search( { body_id => $self->body_id, + class => $prereq->{class}, + level => {'>=' => $prereq->{level}} } )->count; unless ($count) { - confess [1013, 'You need a level '.$ship->prereq->{level}.' '.$ship->prereq->{class}->name.' to build this ship.']; - } - my $body = $self->body; - foreach my $key (keys %{$costs}) { - next if ($key eq 'seconds' || $key eq 'waste'); - my $cost = $costs->{$key} * $quantity; - unless ($cost <= $body->type_stored($key)) { - confess [1011, 'Not enough resources.', $key]; - } - } - my $ships_building = $ships->search({body_id => $self->body_id, task=>'Building'})->count; - if ($ships_building + $quantity > $self->max_ships) { - confess [1013, 'You can only have '.$self->max_ships.' ships in the queue at this shipyard. Upgrade the shipyard to support more ships.']; + if ($reason eq '') { + $reason = 'You need a level '.$prereq->{level}.' '.$prereq->{class}->name; + } + else { + $reason .= ' and a level '.$prereq->{level}.' '.$prereq->{class}->name; + } } - unless ($self->body->spaceport->docks_available >= $quantity) { - confess [1009, "You do not have $quantity docks available at the Spaceport."]; + } + if ($reason ne '') { + confess [1013, "$reason" ]; + } + my $body = $self->body; + foreach my $key (keys %{$costs}) { + next if ($key eq 'seconds' || $key eq 'waste'); + my $cost = $costs->{$key} * $quantity; + unless ($cost <= $body->type_stored($key)) { + confess [1011, 'Not enough resources.', $key]; } - return 1; + } + my $ships_building = $ships->search({body_id => $self->body_id, task=>'Building'})->count; + if ($ships_building + $quantity > $self->max_ships) { + confess [1013, 'You can only have '.$self->max_ships.' ships in the queue at this shipyard. Upgrade the shipyard to support more ships.']; + } + unless ($self->body->spaceport->docks_available >= $quantity) { + confess [1009, "You do not have $quantity docks available at the Spaceport."]; + } + return 1; } sub building_ships { diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index d461f382..3ae4f118 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -96,7 +96,7 @@ __PACKAGE__->belongs_to('body', 'Lacuna::DB::Result::Map::Body', 'body_id'); __PACKAGE__->belongs_to('foreign_star', 'Lacuna::DB::Result::Map::Star', 'foreign_star_id'); __PACKAGE__->belongs_to('foreign_body', 'Lacuna::DB::Result::Map::Body', 'foreign_body_id'); -use constant prereq => { class=> 'Lacuna::DB::Result::Building::University', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::University', level => 1 } ]; use constant base_food_cost => 1; use constant base_water_cost => 1; use constant base_energy_cost => 1; diff --git a/lib/Lacuna/DB/Result/Ships/Barge.pm b/lib/Lacuna/DB/Result/Ships/Barge.pm index 2cadba36..e2684f92 100644 --- a/lib/Lacuna/DB/Result/Ships/Barge.pm +++ b/lib/Lacuna/DB/Result/Ships/Barge.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 5 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 5 } ]; use constant base_food_cost => 650; use constant base_water_cost => 1900; use constant base_energy_cost => 6100; @@ -15,7 +15,7 @@ use constant base_waste_cost => 900; use constant base_speed => 1100; use constant base_stealth => 2450; use constant base_hold_size => 800; -use constant base_berth_size => 1; +use constant base_berth_size => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Bleeder.pm b/lib/Lacuna/DB/Result/Ships/Bleeder.pm index bdc650a7..713c857f 100644 --- a/lib/Lacuna/DB/Result/Ships/Bleeder.pm +++ b/lib/Lacuna/DB/Result/Ships/Bleeder.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 12 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 12 } ]; use constant base_food_cost => 8000; use constant base_water_cost => 21000; use constant base_energy_cost => 69010; diff --git a/lib/Lacuna/DB/Result/Ships/CargoShip.pm b/lib/Lacuna/DB/Result/Ships/CargoShip.pm index 9efee7ff..ad66b639 100644 --- a/lib/Lacuna/DB/Result/Ships/CargoShip.pm +++ b/lib/Lacuna/DB/Result/Ships/CargoShip.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 10 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 10 } ]; use constant base_food_cost => 1200; use constant base_water_cost => 3600; use constant base_energy_cost => 12000; @@ -15,7 +15,7 @@ use constant base_waste_cost => 1500; use constant base_speed => 1050; use constant base_stealth => 1500; use constant base_hold_size => 1700; -use constant base_berth_size => 5; +use constant base_berth_size => 5; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/ColonyShip.pm b/lib/Lacuna/DB/Result/Ships/ColonyShip.pm index f57f5315..675e9222 100644 --- a/lib/Lacuna/DB/Result/Ships/ColonyShip.pm +++ b/lib/Lacuna/DB/Result/Ships/ColonyShip.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Observatory', level => 5 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Observatory', level => 5 } ]; use constant base_food_cost => 45000; use constant base_water_cost => 45000; use constant base_energy_cost => 45000; diff --git a/lib/Lacuna/DB/Result/Ships/Detonator.pm b/lib/Lacuna/DB/Result/Ships/Detonator.pm index 27c2031c..334a634b 100644 --- a/lib/Lacuna/DB/Result/Ships/Detonator.pm +++ b/lib/Lacuna/DB/Result/Ships/Detonator.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 1 } ]; use constant base_food_cost => 6000; use constant base_water_cost => 15600; use constant base_energy_cost => 113600; diff --git a/lib/Lacuna/DB/Result/Ships/Dory.pm b/lib/Lacuna/DB/Result/Ships/Dory.pm index 39963900..15c1377d 100644 --- a/lib/Lacuna/DB/Result/Ships/Dory.pm +++ b/lib/Lacuna/DB/Result/Ships/Dory.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 1 } ]; use constant base_food_cost => 350; use constant base_water_cost => 700; use constant base_energy_cost => 3250; @@ -15,7 +15,7 @@ use constant base_waste_cost => 400; use constant base_speed => 1250; use constant base_stealth => 4100; use constant base_hold_size => 400; -use constant base_berth_size => 1; +use constant base_berth_size => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Drone.pm b/lib/Lacuna/DB/Result/Ships/Drone.pm index d1c3bcc3..4cdc1213 100644 --- a/lib/Lacuna/DB/Result/Ships/Drone.pm +++ b/lib/Lacuna/DB/Result/Ships/Drone.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Security', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Security', level => 1 } ]; use constant base_food_cost => 250; use constant base_water_cost => 650; use constant base_energy_cost => 4050; diff --git a/lib/Lacuna/DB/Result/Ships/Excavator.pm b/lib/Lacuna/DB/Result/Ships/Excavator.pm index bd93f7b8..98b7ce25 100644 --- a/lib/Lacuna/DB/Result/Ships/Excavator.pm +++ b/lib/Lacuna/DB/Result/Ships/Excavator.pm @@ -5,15 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Archaeology', level => 11 }; -# Keeping Old prices around just while testing stuff -# use constant base_food_cost => 400; -# use constant base_water_cost => 1000; -# use constant base_energy_cost => 8500; -# use constant base_ore_cost => 11000; -# use constant base_time_cost => 20000; -# use constant base_waste_cost => 1200; -# use constant base_speed => 1800; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Archaeology', level => 11 } ]; use constant base_food_cost => 3000; use constant base_water_cost => 5000; use constant base_energy_cost => 20000; diff --git a/lib/Lacuna/DB/Result/Ships/Fighter.pm b/lib/Lacuna/DB/Result/Ships/Fighter.pm index adcc19ae..5f6de90e 100644 --- a/lib/Lacuna/DB/Result/Ships/Fighter.pm +++ b/lib/Lacuna/DB/Result/Ships/Fighter.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::PilotTraining', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::PilotTraining', level => 1 } ]; use constant base_food_cost => 1000; use constant base_water_cost => 2600; use constant base_energy_cost => 16200; @@ -18,7 +18,6 @@ use constant pilotable => 1; use constant build_tags => ['War']; with "Lacuna::Role::Ship::Send::Body"; -# with "Lacuna::Role::Ship::Send::NotIsolationist"; #commented out to let fighters to protect iso with "Lacuna::Role::Ship::Arrive::Defend"; no Moose; diff --git a/lib/Lacuna/DB/Result/Ships/Freighter.pm b/lib/Lacuna/DB/Result/Ships/Freighter.pm index 1971382d..25da6b82 100644 --- a/lib/Lacuna/DB/Result/Ships/Freighter.pm +++ b/lib/Lacuna/DB/Result/Ships/Freighter.pm @@ -6,7 +6,7 @@ no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 20 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 20 } ]; use constant base_food_cost => 3600; use constant base_water_cost => 10800; use constant base_energy_cost => 36000; @@ -16,7 +16,7 @@ use constant base_waste_cost => 4800; use constant base_speed => 900; use constant base_stealth => 0; use constant base_hold_size => 4000; -use constant base_berth_size => 15; +use constant base_berth_size => 15; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Galleon.pm b/lib/Lacuna/DB/Result/Ships/Galleon.pm index 81362085..9cbe1cee 100644 --- a/lib/Lacuna/DB/Result/Ships/Galleon.pm +++ b/lib/Lacuna/DB/Result/Ships/Galleon.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 15 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 15 } ]; use constant base_food_cost => 2500; use constant base_water_cost => 7500; use constant base_energy_cost => 25000; @@ -15,7 +15,7 @@ use constant base_waste_cost => 3200; use constant base_speed => 1250; use constant base_stealth => 0; use constant base_hold_size => 1750; -use constant base_berth_size => 10; +use constant base_berth_size => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/GasGiantSettlementPlatformShip.pm b/lib/Lacuna/DB/Result/Ships/GasGiantSettlementPlatformShip.pm index 63be3306..a6d10666 100644 --- a/lib/Lacuna/DB/Result/Ships/GasGiantSettlementPlatformShip.pm +++ b/lib/Lacuna/DB/Result/Ships/GasGiantSettlementPlatformShip.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::GasGiantLab', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::GasGiantLab', level => 1 } ]; use constant base_food_cost => 36000; use constant base_water_cost => 90000; use constant base_energy_cost => 340000; diff --git a/lib/Lacuna/DB/Result/Ships/Hulk.pm b/lib/Lacuna/DB/Result/Ships/Hulk.pm index 7f2cb881..722c45ad 100644 --- a/lib/Lacuna/DB/Result/Ships/Hulk.pm +++ b/lib/Lacuna/DB/Result/Ships/Hulk.pm @@ -6,7 +6,7 @@ no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 25 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 25 }]; use constant base_food_cost => 7300; use constant base_water_cost => 23000; use constant base_energy_cost => 75000; @@ -16,7 +16,7 @@ use constant base_waste_cost => 11000; use constant base_speed => 600; use constant base_stealth => 0; use constant base_hold_size => 7900; -use constant base_berth_size => 20; +use constant base_berth_size => 20; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/HulkFast.pm b/lib/Lacuna/DB/Result/Ships/HulkFast.pm index d3e908dd..95d6f49c 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkFast.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkFast.pm @@ -6,8 +6,8 @@ no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 28 }; -# Figure out how to also add Prop Level 30 to prereq +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 25 }, + { class=> 'Lacuna::DB::Result::Building::Propulsion', level => 30 } ]; use constant base_food_cost => 15000; use constant base_water_cost => 30000; use constant base_energy_cost => 500000; diff --git a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm index 8f30bac0..d7014815 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm @@ -6,7 +6,7 @@ no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Trade', level => 30 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Trade', level => 30 } ]; use constant base_food_cost => 90000; use constant base_water_cost => 150000; use constant base_energy_cost => 15000000; diff --git a/lib/Lacuna/DB/Result/Ships/MiningPlatformShip.pm b/lib/Lacuna/DB/Result/Ships/MiningPlatformShip.pm index c728d745..272cfbf9 100644 --- a/lib/Lacuna/DB/Result/Ships/MiningPlatformShip.pm +++ b/lib/Lacuna/DB/Result/Ships/MiningPlatformShip.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Ore::Ministry', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Ore::Ministry', level => 1 }]; use constant base_food_cost => 4800; use constant base_water_cost => 14400; use constant base_energy_cost => 96000; diff --git a/lib/Lacuna/DB/Result/Ships/ObservatorySeeker.pm b/lib/Lacuna/DB/Result/Ships/ObservatorySeeker.pm index ed65688e..aedf0fba 100644 --- a/lib/Lacuna/DB/Result/Ships/ObservatorySeeker.pm +++ b/lib/Lacuna/DB/Result/Ships/ObservatorySeeker.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 10 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 10 }]; use constant base_food_cost => 20000; use constant base_water_cost => 50000; use constant base_energy_cost => 170000; diff --git a/lib/Lacuna/DB/Result/Ships/Placebo.pm b/lib/Lacuna/DB/Result/Ships/Placebo.pm index 0c4c9e8a..cc547025 100644 --- a/lib/Lacuna/DB/Result/Ships/Placebo.pm +++ b/lib/Lacuna/DB/Result/Ships/Placebo.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 5 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 5 }]; use constant base_food_cost => 2000; use constant base_water_cost => 2000; use constant base_energy_cost => 4000; diff --git a/lib/Lacuna/DB/Result/Ships/Placebo2.pm b/lib/Lacuna/DB/Result/Ships/Placebo2.pm index bab1e7ca..7ee9e2a8 100644 --- a/lib/Lacuna/DB/Result/Ships/Placebo2.pm +++ b/lib/Lacuna/DB/Result/Ships/Placebo2.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 10 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 10 }]; use constant base_food_cost => 2000; use constant base_water_cost => 2000; use constant base_energy_cost => 5000; diff --git a/lib/Lacuna/DB/Result/Ships/Placebo3.pm b/lib/Lacuna/DB/Result/Ships/Placebo3.pm index a8043963..ad19d85e 100644 --- a/lib/Lacuna/DB/Result/Ships/Placebo3.pm +++ b/lib/Lacuna/DB/Result/Ships/Placebo3.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 15 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 15 }]; use constant base_food_cost => 2000; use constant base_water_cost => 2000; use constant base_energy_cost => 6000; diff --git a/lib/Lacuna/DB/Result/Ships/Placebo4.pm b/lib/Lacuna/DB/Result/Ships/Placebo4.pm index 2fcfc9b0..3a947186 100644 --- a/lib/Lacuna/DB/Result/Ships/Placebo4.pm +++ b/lib/Lacuna/DB/Result/Ships/Placebo4.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 20 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 20 }]; use constant base_food_cost => 2000; use constant base_water_cost => 2000; use constant base_energy_cost => 7000; diff --git a/lib/Lacuna/DB/Result/Ships/Placebo5.pm b/lib/Lacuna/DB/Result/Ships/Placebo5.pm index 16dbfeca..bcbd1960 100644 --- a/lib/Lacuna/DB/Result/Ships/Placebo5.pm +++ b/lib/Lacuna/DB/Result/Ships/Placebo5.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 25 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 25 }]; use constant base_food_cost => 2000; use constant base_water_cost => 2000; use constant base_energy_cost => 8000; diff --git a/lib/Lacuna/DB/Result/Ships/Placebo6.pm b/lib/Lacuna/DB/Result/Ships/Placebo6.pm index fc24522b..904bad1a 100644 --- a/lib/Lacuna/DB/Result/Ships/Placebo6.pm +++ b/lib/Lacuna/DB/Result/Ships/Placebo6.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 30 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 30 }]; use constant base_food_cost => 2000; use constant base_water_cost => 2000; use constant base_energy_cost => 9000; diff --git a/lib/Lacuna/DB/Result/Ships/Probe.pm b/lib/Lacuna/DB/Result/Ships/Probe.pm index 07b0f1fc..408654ea 100644 --- a/lib/Lacuna/DB/Result/Ships/Probe.pm +++ b/lib/Lacuna/DB/Result/Ships/Probe.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Observatory', level => 1 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::Observatory', level => 1 }]; use constant base_food_cost => 100; use constant base_water_cost => 300; use constant base_energy_cost => 2000; diff --git a/lib/Lacuna/DB/Result/Ships/Scanner.pm b/lib/Lacuna/DB/Result/Ships/Scanner.pm index 7fa3b625..c4577e06 100644 --- a/lib/Lacuna/DB/Result/Ships/Scanner.pm +++ b/lib/Lacuna/DB/Result/Ships/Scanner.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Intelligence', level => 5 }; +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::Intelligence', level => 5 }]; use constant base_food_cost => 150; use constant base_water_cost => 250; use constant base_energy_cost => 2500; diff --git a/lib/Lacuna/DB/Result/Ships/Scow.pm b/lib/Lacuna/DB/Result/Ships/Scow.pm index 5c2cc767..043720b6 100644 --- a/lib/Lacuna/DB/Result/Ships/Scow.pm +++ b/lib/Lacuna/DB/Result/Ships/Scow.pm @@ -5,18 +5,17 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 10 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 10 } ]; use constant base_food_cost => 2000; use constant base_water_cost => 5200; use constant base_energy_cost => 32400; use constant base_ore_cost => 28400; use constant base_time_cost => 14600; use constant base_waste_cost => 8400; -use constant base_speed => 450; +use constant base_speed => 420; use constant base_combat => 500; use constant base_stealth => 0; use constant base_hold_size => 2000; -use constant base_berth_size => 1; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/ScowFast.pm b/lib/Lacuna/DB/Result/Ships/ScowFast.pm index 69c0c9b8..0dd843e2 100644 --- a/lib/Lacuna/DB/Result/Ships/ScowFast.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowFast.pm @@ -5,8 +5,8 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 25 }; -# Prop 25 also when we figure it out. +use constant prereq => [{ class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 25 }, + { class=> 'Lacuna::DB::Result::Building::Propulsion', level => 25 } ]; use constant base_food_cost => 3000; use constant base_water_cost => 10000; use constant base_energy_cost => 100000; @@ -17,7 +17,7 @@ use constant base_speed => 700; use constant base_combat => 500; use constant base_stealth => 0; use constant base_hold_size => 2000; -use constant base_berth_size => 20; +use constant base_berth_size => 20; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/ScowLarge.pm b/lib/Lacuna/DB/Result/Ships/ScowLarge.pm index d3cec297..360bc197 100644 --- a/lib/Lacuna/DB/Result/Ships/ScowLarge.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowLarge.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 20 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 20 } ]; use constant base_food_cost => 10000; use constant base_water_cost => 32000; use constant base_energy_cost => 170000; @@ -16,7 +16,7 @@ use constant base_speed => 325; use constant base_combat => 600; use constant base_stealth => 0; use constant base_hold_size => 12000; -use constant base_berth_size => 15; +use constant base_berth_size => 15; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/ScowMega.pm b/lib/Lacuna/DB/Result/Ships/ScowMega.pm index 808267d8..2b8f44ad 100644 --- a/lib/Lacuna/DB/Result/Ships/ScowMega.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowMega.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 30 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Waste::Sequestration', level => 30 } ]; use constant base_food_cost => 60000; use constant base_water_cost => 180000; use constant base_energy_cost => 6000000; @@ -16,7 +16,7 @@ use constant base_speed => 100; use constant base_combat => 0; use constant base_stealth => 0; use constant base_hold_size => 300000; -use constant base_berth_size => 25; +use constant base_berth_size => 25; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/SecurityMinistrySeeker.pm b/lib/Lacuna/DB/Result/Ships/SecurityMinistrySeeker.pm index 1ee7ac14..a21120f5 100644 --- a/lib/Lacuna/DB/Result/Ships/SecurityMinistrySeeker.pm +++ b/lib/Lacuna/DB/Result/Ships/SecurityMinistrySeeker.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 20 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 20 } ]; use constant base_food_cost => 20000; use constant base_water_cost => 50000; use constant base_energy_cost => 180000; diff --git a/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm b/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm index e171f112..1d3384b9 100644 --- a/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm +++ b/lib/Lacuna/DB/Result/Ships/ShortRangeColonyShip.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Observatory', level => 3 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Observatory', level => 3 } ]; use constant base_food_cost => 15000; use constant base_water_cost => 15000; use constant base_energy_cost => 15000; diff --git a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm index 4f2cd596..0421a371 100644 --- a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm +++ b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::CloakingLab', level => 1 } ]; use constant base_food_cost => 1500; use constant base_water_cost => 3900; use constant base_energy_cost => 27000; diff --git a/lib/Lacuna/DB/Result/Ships/Snark.pm b/lib/Lacuna/DB/Result/Ships/Snark.pm index b4a0dc8e..3986868d 100644 --- a/lib/Lacuna/DB/Result/Ships/Snark.pm +++ b/lib/Lacuna/DB/Result/Ships/Snark.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 5 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 5 } ]; use constant base_food_cost => 18000; use constant base_water_cost => 46800; use constant base_energy_cost => 145000; diff --git a/lib/Lacuna/DB/Result/Ships/Snark2.pm b/lib/Lacuna/DB/Result/Ships/Snark2.pm index 935a2a8d..c1f5e86e 100644 --- a/lib/Lacuna/DB/Result/Ships/Snark2.pm +++ b/lib/Lacuna/DB/Result/Ships/Snark2.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 18 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 18 } ]; use constant base_food_cost => 37000; use constant base_water_cost => 64600; use constant base_energy_cost => 194000; diff --git a/lib/Lacuna/DB/Result/Ships/Snark3.pm b/lib/Lacuna/DB/Result/Ships/Snark3.pm index 45086c37..d4248a6f 100644 --- a/lib/Lacuna/DB/Result/Ships/Snark3.pm +++ b/lib/Lacuna/DB/Result/Ships/Snark3.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 25 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 25 } ]; use constant base_food_cost => 47000; use constant base_water_cost => 84600; use constant base_energy_cost => 224000; diff --git a/lib/Lacuna/DB/Result/Ships/SpacePortSeeker.pm b/lib/Lacuna/DB/Result/Ships/SpacePortSeeker.pm index 70303cdd..9007ffb3 100644 --- a/lib/Lacuna/DB/Result/Ships/SpacePortSeeker.pm +++ b/lib/Lacuna/DB/Result/Ships/SpacePortSeeker.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 15 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 15 } ]; use constant base_food_cost => 20000; use constant base_water_cost => 50000; use constant base_energy_cost => 160000; diff --git a/lib/Lacuna/DB/Result/Ships/SpaceStation.pm b/lib/Lacuna/DB/Result/Ships/SpaceStation.pm index 73b01fa7..1ae48514 100644 --- a/lib/Lacuna/DB/Result/Ships/SpaceStation.pm +++ b/lib/Lacuna/DB/Result/Ships/SpaceStation.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Embassy', level => 20 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Embassy', level => 20 } ]; use constant base_food_cost => 8000000; use constant base_water_cost => 8000000; use constant base_energy_cost => 8000000; diff --git a/lib/Lacuna/DB/Result/Ships/SpyPod.pm b/lib/Lacuna/DB/Result/Ships/SpyPod.pm index 74d538cb..1de8b103 100644 --- a/lib/Lacuna/DB/Result/Ships/SpyPod.pm +++ b/lib/Lacuna/DB/Result/Ships/SpyPod.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Espionage', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Espionage', level => 1 } ]; use constant base_food_cost => 200; use constant base_water_cost => 600; use constant base_energy_cost => 4000; diff --git a/lib/Lacuna/DB/Result/Ships/SpyShuttle.pm b/lib/Lacuna/DB/Result/Ships/SpyShuttle.pm index c4f298b9..6a9d878b 100644 --- a/lib/Lacuna/DB/Result/Ships/SpyShuttle.pm +++ b/lib/Lacuna/DB/Result/Ships/SpyShuttle.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Espionage', level => 15 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Espionage', level => 15 } ]; use constant base_food_cost => 750; use constant base_water_cost => 2300; use constant base_energy_cost => 15000; diff --git a/lib/Lacuna/DB/Result/Ships/Stake.pm b/lib/Lacuna/DB/Result/Ships/Stake.pm index a1f7cabc..646f156a 100644 --- a/lib/Lacuna/DB/Result/Ships/Stake.pm +++ b/lib/Lacuna/DB/Result/Ships/Stake.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Observatory', level => 10 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Observatory', level => 10 } ]; use constant base_food_cost => 3000; use constant base_water_cost => 4000; use constant base_energy_cost => 10000; diff --git a/lib/Lacuna/DB/Result/Ships/SupplyPod.pm b/lib/Lacuna/DB/Result/Ships/SupplyPod.pm index 37c9d515..7f6a836e 100644 --- a/lib/Lacuna/DB/Result/Ships/SupplyPod.pm +++ b/lib/Lacuna/DB/Result/Ships/SupplyPod.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 10 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 10 } ]; use constant base_food_cost => 1800; use constant base_water_cost => 1900; use constant base_energy_cost => 4500; diff --git a/lib/Lacuna/DB/Result/Ships/SupplyPod2.pm b/lib/Lacuna/DB/Result/Ships/SupplyPod2.pm index b34865ad..31741ffa 100644 --- a/lib/Lacuna/DB/Result/Ships/SupplyPod2.pm +++ b/lib/Lacuna/DB/Result/Ships/SupplyPod2.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 15 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 15 } ]; use constant base_food_cost => 29000; use constant base_water_cost => 30000; use constant base_energy_cost => 74000; diff --git a/lib/Lacuna/DB/Result/Ships/SupplyPod3.pm b/lib/Lacuna/DB/Result/Ships/SupplyPod3.pm index 5ee4f8c2..57d3e2ee 100644 --- a/lib/Lacuna/DB/Result/Ships/SupplyPod3.pm +++ b/lib/Lacuna/DB/Result/Ships/SupplyPod3.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 20 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 20 } ]; use constant base_food_cost => 480000; use constant base_water_cost => 500000; use constant base_energy_cost => 1200000; diff --git a/lib/Lacuna/DB/Result/Ships/SupplyPod4.pm b/lib/Lacuna/DB/Result/Ships/SupplyPod4.pm index 2fdcee5a..9c72761f 100644 --- a/lib/Lacuna/DB/Result/Ships/SupplyPod4.pm +++ b/lib/Lacuna/DB/Result/Ships/SupplyPod4.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 25 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::PlanetaryCommand', level => 25 } ]; use constant base_food_cost => 8000000; use constant base_water_cost => 8500000; use constant base_energy_cost => 20000000; diff --git a/lib/Lacuna/DB/Result/Ships/Surveyor.pm b/lib/Lacuna/DB/Result/Ships/Surveyor.pm index a6fe50ad..5d1b6bd5 100644 --- a/lib/Lacuna/DB/Result/Ships/Surveyor.pm +++ b/lib/Lacuna/DB/Result/Ships/Surveyor.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::Intelligence', level => 10 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::Intelligence', level => 10 } ]; use constant base_food_cost => 1500; use constant base_water_cost => 2500; use constant base_energy_cost => 25000; diff --git a/lib/Lacuna/DB/Result/Ships/Sweeper.pm b/lib/Lacuna/DB/Result/Ships/Sweeper.pm index 790630c9..ac5b0353 100644 --- a/lib/Lacuna/DB/Result/Ships/Sweeper.pm +++ b/lib/Lacuna/DB/Result/Ships/Sweeper.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 16 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 16 } ]; use constant base_food_cost => 5000; use constant base_water_cost => 12000; use constant base_energy_cost => 70000; diff --git a/lib/Lacuna/DB/Result/Ships/TerraformingPlatformShip.pm b/lib/Lacuna/DB/Result/Ships/TerraformingPlatformShip.pm index ca167664..23e4dbe5 100644 --- a/lib/Lacuna/DB/Result/Ships/TerraformingPlatformShip.pm +++ b/lib/Lacuna/DB/Result/Ships/TerraformingPlatformShip.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::TerraformingLab', level => 1 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::TerraformingLab', level => 1 } ]; use constant base_food_cost => 96000; use constant base_water_cost => 180000; use constant base_energy_cost => 310000; diff --git a/lib/Lacuna/DB/Result/Ships/Thud.pm b/lib/Lacuna/DB/Result/Ships/Thud.pm index 48bb163c..7e41d103 100644 --- a/lib/Lacuna/DB/Result/Ships/Thud.pm +++ b/lib/Lacuna/DB/Result/Ships/Thud.pm @@ -5,7 +5,7 @@ use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Ships'; -use constant prereq => { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 3 }; +use constant prereq => [ { class=> 'Lacuna::DB::Result::Building::MunitionsLab', level => 3 } ]; use constant base_food_cost => 7000; use constant base_water_cost => 8000; use constant base_energy_cost => 23000; -- 2.51.2 From d40527c8b4d21a250f8a711dcb079ada16cb5308 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 11:50:37 -0600 Subject: [PATCH 07/45] Changes documented. --- var/www/public/changes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 7dadd8da..444ecef6 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -2,6 +2,7 @@ - Mod: Berth Size less confusing than Dock Size. - Fix: Scows limited to Spaceport Level determined by Berth. - Mod: Scow 20 and 30 changed names to Large & Mega. + - Mod: Possible to have more than one building prereq for ships. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From 71bc03305f443eb7a96bb4613247ffa9d8cbe091 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 12:40:15 -0600 Subject: [PATCH 08/45] All starting empires start on a size 45 planet. --- lib/Lacuna/DB/Result/Empire.pm | 1 + lib/Lacuna/DB/Result/Ships/SmugglerShip.pm | 2 +- var/messages/welcome.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/DB/Result/Empire.pm b/lib/Lacuna/DB/Result/Empire.pm index 19210e84..5cad6627 100644 --- a/lib/Lacuna/DB/Result/Empire.pm +++ b/lib/Lacuna/DB/Result/Empire.pm @@ -459,6 +459,7 @@ sub found { $home_planet ||= $self->find_home_planet; $self->tutorial_scratch($home_planet->name); $self->home_planet_id($home_planet->id); + $home_planet->size(45); $self->stage('founded'); $self->update; $self->home_planet($home_planet); diff --git a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm index 0421a371..e10814e6 100644 --- a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm +++ b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm @@ -14,7 +14,7 @@ use constant base_time_cost => 28800; use constant base_waste_cost => 1800; use constant base_speed => 1700; use constant base_stealth => 5000; -use constant base_hold_size => 500; +use constant base_hold_size => 520; use constant base_berth_size => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/var/messages/welcome.txt b/var/messages/welcome.txt index a9ed01ff..31d6bc31 100644 --- a/var/messages/welcome.txt +++ b/var/messages/welcome.txt @@ -4,7 +4,7 @@ Allow me to introduce myself. I am Tou Re Ell, diplomat for {Empire 1 Lacuna Exp Since you are new I'd like to offer you an arrangment to help get your empire started. In return for completing some simple tasks, I will assist you in building the necessary components to ensure your survival. -I'll assume you want my help. If that's true, your first task is to gather some information for me about your star system. Locate your planet in the star map and rename it. +I'll assume you want my help. If that's true, your first task is to gather some information for me about your star system. Locate your planet in the star map and rename it. You'll note that your planet is size 45. Regards, -- 2.51.2 From 2cae23637570ddd8828c0ee51ff8c279066b8040 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 12:41:26 -0600 Subject: [PATCH 09/45] Changes... --- var/www/public/changes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 444ecef6..e767b54c 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -3,6 +3,7 @@ - Fix: Scows limited to Spaceport Level determined by Berth. - Mod: Scow 20 and 30 changed names to Large & Mega. - Mod: Possible to have more than one building prereq for ships. + - Mod: All starting empires begin on a size 45 planet. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From 1e9995ff52b9424a932e11fe2f7503f995c8a9fd Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 15:02:41 -0600 Subject: [PATCH 10/45] Couple tweaks done. --- lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index c0eee55a..b000cae5 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -344,7 +344,7 @@ sub bhg_make_planet { my $random = randint(0,99); if ($random < 5) { $class = 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G'.randint(1,5); - $size = randint(70, 121); + $size = randint(90, 121); } else { $class = 'Lacuna::DB::Result::Map::Body::Planet::P'.randint(1,20); @@ -374,9 +374,11 @@ sub bhg_make_asteroid { my $old_class = $body->class; my $old_size = $body->size; $body->buildings->delete_all; + my $new_size = int($building->level/5); + $new_size = 10 if $new_size > 10; $body->update({ class => 'Lacuna::DB::Result::Map::Body::Asteroid::A'.randint(1,21), - size => int($building->level/5), + size => $new_size; needs_recalc => 1, usable_as_starter_enabled => 0, alliance_id => undef, @@ -386,7 +388,7 @@ sub bhg_make_asteroid { old_class => $old_class, class => $body->class, old_size => $old_size, - size => $body->size, + size => $new_size, id => $body->id, name => $body->name, }; @@ -592,6 +594,7 @@ sub bhg_decor { $plant = randint(1, int($building->level/3)+1); $max_level = $building->level; } + $max_level = 30 if $max_level > 30; my $planted = 0; my $now = DateTime->now; foreach my $cnt (1..$plant) { -- 2.51.2 From 3bc1b520b624dc631db4edc76e3a6981130bb133 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 3 Apr 2012 23:15:27 -0600 Subject: [PATCH 11/45] Added get_actions_for method. --- docs/BlackHoleGenerator.pod | 35 +++++- lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 112 ++++++++++++------ var/www/public/changes.txt | 1 + 3 files changed, 111 insertions(+), 37 deletions(-) diff --git a/docs/BlackHoleGenerator.pod b/docs/BlackHoleGenerator.pod index 4cdf74e0..7dc478ca 100644 --- a/docs/BlackHoleGenerator.pod +++ b/docs/BlackHoleGenerator.pod @@ -13,7 +13,7 @@ This method is extended to include the list of tasks. "building" : { ... }, "tasks" : [ { - "fail_chance" : 15, #Note, range is not factored in. + "base_fail" : 15, #Note, range is not factored in. "min_level" : 10, "name" : "Make Asteroid", "occupied" : 0, @@ -30,6 +30,7 @@ This method is extended to include the list of tasks. } + =head2 generate_singularity ( session_id, building_id, target, task_name, [ params ] ) Returns success, failure, and side effect results. @@ -123,4 +124,36 @@ Optional hash reference only used for Change Type that looks like this: { "newtype" : 20 } +=head2 get_actions_for ( session_id, building_id, target ) + +Returns status and task list with success percentage for defined target. + + { + "status" : { ... }, + "building" : { ... }, + "tasks" : [ + { + "base_fail" : 15, + "body_id" : 973213, + "dist" : 134.40, + "min_level" : 10, + "name" : "Make Asteroid", + "occupied" : 0, + "range" : 150, + "reason" : "You can only make an asteroid from a planet." + "recovery" : 129600, + "side_chance" : 25, + "success" : 0, + "throw" : 1009, + "types" : [ + "habitable planet", + "gas giant" + ], + "waste_cost" : 50000000 + },... + ] + } + +Options are as described for generate_singularity + =cut diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index b000cae5..e918b4aa 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -63,6 +63,68 @@ sub find_target { return $target; } +sub get_actions_for { + my ($self, $session_id, $building_id, $target_params) = @_; + my $empire = $self->get_empire_by_session($session_id); + my $building = $self->get_building($empire, $building_id); + my $body = $building->body; + my $target = $self->find_target($target_params); + unless (defined $target) { + confess [1002, 'Could not locate target.']; + } + my @tasks = bhg_tasks($building); + my @list; + for my $task (@tasks) { + my $chance = task_chance($building, $target, $task); + $task->{body_id} = $chance->{body_id}; + $task->{dist} = $chance->{dist}; + $task->{range} = $chance->{range}; + $task->{reason} = $chance->{reason}; + $task->{success} = $chance->{success}; + $task->{throw} = $chance->{throw}; + } + return { + status => $self->format_status($empire, $body), + tasks => \@tasks + }; +} + +sub task_chance { + my ($building, $target, $task) = @_; + + my $dist = sprintf "%0.2f", $building->body->calculate_distance_to_target($target)/100; + my $range = $building->level * 10; + my $return = { + success => 0, + body_id => $target->id, + dist => $dist, + range => $range, + throw => 0, + reason => '', + }; + unless ($building->level >= $task->{min_level}) { + $return->{throw} = 1013; + $return->{reason} = sprintf("You need a Level %d Black Hole Generator to do that", + $task->{min_level}); + return $return; + } + my $target_type = $target->get_type; + unless ( grep { $target_type eq $_ } @{$task->{types}} ) { + $return->{throw} = 1009; + $return->{reason} = $task->{reason}; + return $return; + } + unless ($dist < $range) { + $return->{throw} = 1009; + $return->{reason} = 'That body is too far away at '.$dist. + ' with a range of '.$range.'.'; + return $return; + } + $return->{success} = int((100 - $task->{base_fail}) * sqrt( ($range - $dist)/$range)); + $return->{success} = 5 if $return->{success} < 5; + return $return; +} + sub generate_singularity { my ($self, $session_id, $building_id, $target_params, $task_name, $params) = @_; my $empire = $self->get_empire_by_session($session_id); @@ -82,24 +144,16 @@ sub generate_singularity { unless ($task) { confess [1002, 'Could not find task: '.$task_name]; } - unless ($building->level >= $task->{min_level}) { - confess [1013, sprintf("You need a Level %d Black Hole Generator to do that", - $task->{min_level})]; - } - my $btype = $target->get_type; - unless ( grep { $btype eq $_ } @{$task->{types}} ) { - confess [1009, $task->{reason}]; + my $chance = task_chance($building, $target, $task); + if ($chance->{throw} > 0) { + confess [ $chance->{throw}, $chance->{reason} ]; } # TEST SETTINGS # $task->{waste_cost} = 1; # $task->{recovery} = 5; # $task->{side_chance} = 95; # TEST SETTINGS - my $dist = sprintf "%7.2f", $building->body->calculate_distance_to_target($target)/100; - my $range = $building->level * 10; - unless ($dist < $range) { - confess [1009, 'That body is too far away at '.$dist.' with a range of '.$range.'. '.$target->id."\n"]; - } + my $btype = $target->get_type; unless ($body->waste_stored >= $task->{waste_cost}) { confess [1011, 'You need at least '.$task->{waste_cost}.' waste to run that function of the Black Hole Generator.']; } @@ -155,19 +209,6 @@ sub generate_singularity { $allowed = 1; } } -# elsif ($target->star->station->laws->search({type => 'MembersOnlyColonization'})->count) { -# if ($target->star->station->alliance_id == $body->empire->alliance_id) { -# $allowed = 1; -# } -# else { -# $confess = 'Only '.$target->star->station->alliance->name. -# ' members can colonize planets in the jurisdiction of the space station.\n'; -# } -# } -# } -# else { -# $allowed = 1; -# } } else { if ($target->star->station_id) { @@ -197,10 +238,9 @@ sub generate_singularity { $building->start_work({}, $task->{recovery})->update; # Pass the basic checks # Check for startup failure - my $fail = randint(0,99) - (30 - sqrt( ($range - $dist) * (300/$range)) * 2.71); - if (($task->{fail_chance} > $fail )) { + unless (randint(0,99) < $chance->{success}) { # Something went wrong with the start - $fail = randint(0,19); + my $fail = randint(0,19); if ($fail == 0) { $return_stats = bhg_self_destruct($building); $body->add_news(75, @@ -378,7 +418,7 @@ sub bhg_make_asteroid { $new_size = 10 if $new_size > 10; $body->update({ class => 'Lacuna::DB::Result::Map::Body::Asteroid::A'.randint(1,21), - size => $new_size; + size => $new_size, needs_recalc => 1, usable_as_starter_enabled => 0, alliance_id => undef, @@ -894,7 +934,7 @@ sub bhg_tasks { min_level => 10, recovery => int($day_sec * 90/$blevel), waste_cost => 50_000_000, - fail_chance => int(100 - $building->level * 3), + base_fail => int(100 - $building->level * 3), side_chance => 25, }, { @@ -905,7 +945,7 @@ sub bhg_tasks { min_level => 15, recovery => int($day_sec * 90/$blevel), waste_cost => 100_000_000, - fail_chance => int(100 - $building->level * 2.75), + base_fail => int(100 - $building->level * 2.75), side_chance => 40, }, { @@ -916,7 +956,7 @@ sub bhg_tasks { min_level => 20, recovery => int($day_sec * 180/$blevel), waste_cost => 1_000_000_000, - fail_chance => int(100 - $building->level * 2.5), + base_fail => int(100 - $building->level * 2.5), side_chance => 60, }, { @@ -927,25 +967,25 @@ sub bhg_tasks { min_level => 25, recovery => int($day_sec * 300/$blevel), waste_cost => 10_000_000_000, - fail_chance => int(100 - $building->level * 2.25), + base_fail => int(100 - $building->level * 2.25), side_chance => 75, }, { name => 'Swap Places', types => ['asteroid', 'habitable planet', 'gas giant', 'space station'], - reason => "Invalid reason.", + reason => "All targets.", occupied => 1, min_level => 30, recovery => int($day_sec * 360/$blevel), waste_cost => 15_000_000_000, - fail_chance => int(100 - $building->level * 2), + base_fail => int(100 - $building->level * 2), side_chance => 90, }, ); return @tasks; } -__PACKAGE__->register_rpc_method_names(qw(generate_singularity)); +__PACKAGE__->register_rpc_method_names(qw(generate_singularity get_actions_for)); no Moose; __PACKAGE__->meta->make_immutable; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index e767b54c..94e9f830 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -4,6 +4,7 @@ - Mod: Scow 20 and 30 changed names to Large & Mega. - Mod: Possible to have more than one building prereq for ships. - Mod: All starting empires begin on a size 45 planet. + - Add: Added get_actions_for method for BHG. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From e50a8d50c337f46d6b1f743f1101421bf5fd1c51 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Wed, 4 Apr 2012 15:41:11 -0600 Subject: [PATCH 12/45] BHG can swap planet into empty orbits. --- lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 210 ++++++++++++++---- var/www/public/changes.txt | 1 + 2 files changed, 164 insertions(+), 47 deletions(-) diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index e918b4aa..47f16e11 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -56,9 +56,59 @@ sub find_target { $target = Lacuna->db ->resultset('Lacuna::DB::Result::Map::Body') ->search({ x => $target_params->{x}, y => $target_params->{y} }, {rows=>1})->single; +#Check for empty orbits. + unless (defined $target) { + my $star = Lacuna->db + ->resultset('Lacuna::DB::Result::Map::Star') + ->search( { x => { '>=' => ($target_params->{x} -2), '<=' => ($target_params->{x} +2) }, + y => { '>=' => ($target_params->{y} -2), '<=' => ($target_params->{y} +2) } }, + {rows=>1})->single; + if (defined $star) { + my $sx = $star->x; my $sy = $star->y; + my $tx = $target_params->{x}; my $ty = $target_params->{y}; + my $orbit = 0; + if (($sx+1 == $tx) && ($sy+2 == $ty)) { + $orbit = 1; + } + elsif (($sx+2 == $tx) && ($sy+1 == $ty)) { + $orbit = 2; + } + elsif (($sx+2 == $tx) && ($sy-1 == $ty)) { + $orbit = 3; + } + elsif (($sx+1 == $tx) && ($sy-2 == $ty)) { + $orbit = 4; + } + elsif (($sx-1 == $tx) && ($sy-2 == $ty)) { + $orbit = 5; + } + elsif (($sx-2 == $tx) && ($sy-1 == $ty)) { + $orbit = 6; + } + elsif (($sx-2 == $tx) && ($sy+1 == $ty)) { + $orbit = 7; + } + elsif (($sx-1 == $tx) && ($sy+2 == $ty)) { + $orbit = 8; + } + if ($orbit) { + $target = { + id => 0, + name => "Empty Space", + orbit => $orbit, + type => 'empty', + x => $tx, + y => $ty, + zone => $star->zone, + star => $star, + star_id => $star->id, + }; + } + } + } } unless (defined $target) { - confess [ 1002, 'Could not find the target.', $target]; + confess [ 1002, 'Could not find the target.']; } return $target; } @@ -69,9 +119,6 @@ sub get_actions_for { my $building = $self->get_building($empire, $building_id); my $body = $building->body; my $target = $self->find_target($target_params); - unless (defined $target) { - confess [1002, 'Could not locate target.']; - } my @tasks = bhg_tasks($building); my @list; for my $task (@tasks) { @@ -92,11 +139,23 @@ sub get_actions_for { sub task_chance { my ($building, $target, $task) = @_; - my $dist = sprintf "%0.2f", $building->body->calculate_distance_to_target($target)/100; + my $dist; my $target_type; my $target_id; + if (ref $target eq 'HASH') { + my $bx = $building->body->x; + my $by = $building->body->y; + $dist = sprintf "%0.2f", sqrt( ($target->{x} - $bx)**2 + ($target->{y} - $by)**2); + $target_id = $target->{id}; + $target_type = $target->{type}; + } + else { + $dist = sprintf "%0.2f", $building->body->calculate_distance_to_target($target)/100; + $target_id = $target->id; + $target_type = $target->get_type; + } my $range = $building->level * 10; my $return = { success => 0, - body_id => $target->id, + body_id => $target_id, dist => $dist, range => $range, throw => 0, @@ -108,7 +167,6 @@ sub task_chance { $task->{min_level}); return $return; } - my $target_type = $target->get_type; unless ( grep { $target_type eq $_ } @{$task->{types}} ) { $return->{throw} = 1009; $return->{reason} = $task->{reason}; @@ -152,8 +210,25 @@ sub generate_singularity { # $task->{waste_cost} = 1; # $task->{recovery} = 5; # $task->{side_chance} = 95; +# $task->{success} = 100; # TEST SETTINGS - my $btype = $target->get_type; + my $btype; + my $tempire; + my $tstar; + my $tid; + if (ref $target eq 'HASH') { + $btype = $target->{type}; + $tstar = $target->{star}; + $tid = $target->{id}; + } + else { + $btype = $target->get_type; + $tstar = $target->star; + $tid = $target->id; + if (defined($target->empire)) { + $tempire = $target->empire; + } + } unless ($body->waste_stored >= $task->{waste_cost}) { confess [1011, 'You need at least '.$task->{waste_cost}.' waste to run that function of the Black Hole Generator.']; } @@ -174,7 +249,7 @@ sub generate_singularity { }; } } - elsif (defined($target->empire)) { + elsif (defined($tempire)) { $body->add_news(75, sprintf('Scientists revolt against %s for trying to turn %s into an asteroid.', $empire->name, $target->name)); @@ -185,40 +260,43 @@ sub generate_singularity { }; } } - if ( $task->{name} eq "Change Type" && defined ($target->empire) ) { - unless ( ($body->empire->id == $target->empire->id) or + if ( $task->{name} eq "Change Type" && defined ($tempire) ) { + unless ( ($body->empire->id == $tempire->id) or ( $body->empire->alliance_id && - ($body->empire->alliance_id == $target->empire->alliance_id))) { + ($body->empire->alliance_id == $tempire->alliance_id))) { confess [1009, "You can not change type of a body if it is occupied by another alliance!\n"]; } } elsif ( $task->{name} eq "Swap Places" ) { my $confess = ""; my $allowed = 0; - if (defined($target->empire)) { - $confess = "You can not attempt that action on a body if it is occupied by another alliance!\n"; - if ($body->empire->id == $target->empire->id) { + if ($tid == $body->id) { + $confess = "Pointless swapping with oneself."; + } + elsif (defined($tempire)) { + $confess = "You can not attempt that action on a body if it is occupied by another alliance!"; + if ($body->empire->id == $tempire->id) { $allowed = 1; } elsif ($body->empire->alliance_id && - ($body->empire->alliance_id == $target->empire->alliance_id)) { + ($body->empire->alliance_id == $tempire->alliance_id)) { $allowed = 1; } - elsif ($target->star->station_id) { - if ($body->empire->alliance_id && $target->star->station->alliance_id == $body->empire->alliance_id) { + elsif ($tstar->station_id) { + if ($body->empire->alliance_id && $tstar->station->alliance_id == $body->empire->alliance_id) { $allowed = 1; } } } else { - if ($target->star->station_id) { - if ($target->star->station->laws->search({type => 'MembersOnlyColonization'})->count) { - if ($target->star->station->alliance_id == $body->empire->alliance_id) { + if ($tstar->station_id) { + if ($tstar->station->laws->search({type => 'MembersOnlyColonization'})->count) { + if ($tstar->station->alliance_id == $body->empire->alliance_id) { $allowed = 1; } else { - $confess = 'Only '.$target->star->station->alliance->name. - ' members can colonize planets in the jurisdiction of the space station.\n'; + $confess = 'Only '.$tstar->station->alliance->name. + ' members can colonize planets in the jurisdiction of the space station.'; } } else { @@ -238,7 +316,7 @@ sub generate_singularity { $building->start_work({}, $task->{recovery})->update; # Pass the basic checks # Check for startup failure - unless (randint(0,99) < $chance->{success}) { + unless (randint(0,99) < $task->{success}) { # Something went wrong with the start my $fail = randint(0,19); if ($fail == 0) { @@ -301,16 +379,22 @@ sub generate_singularity { } elsif ($task->{name} eq "Swap Places") { $return_stats = bhg_swap($building, $target); + my $tname; + if (ref $target eq 'HASH') { + $tname = $target->{name}; + } + else { + $tname = $target->name; + } $body->add_news(50, sprintf('%s has switched places with %s!', - $body->name, $target->name)); + $body->name, $tname)); } else { confess [552, "Internal Error"]; } $effect->{target} = $return_stats; #And now side effect time -# If we add swap, swap two random unihabited bodies or possibly current planet with another random? my $side = randint(0,99); if ($task->{side_chance} > $side) { my $side_type = randint(0,99); @@ -345,33 +429,65 @@ sub bhg_swap { my ($building, $target) = @_; my $body = $building->body; my $return; - my $old_x = $body->x; - my $old_y = $body->y; - my $old_zone = $body->zone; - my $old_star = $body->star_id; - my $old_orbit = $body->orbit; + my $old_data = { + x => $body->x, + y => $body->y, + zone => $body->zone, + star => $body->star_id, + orbit => $body->orbit, + }; + my $new_data; + if (ref $target eq 'HASH') { + $new_data = { + id => $target->{id}, + name => $target->{name}, + orbit => $target->{orbit}, + star_id => $target->{star_id}, + type => $target->{type}, + x => $target->{x}, + y => $target->{y}, + zone => $target->{zone}, + }; + } + else { + $new_data = { + id => $target->id, + name => $target->name, + orbit => $target->orbit, + star_id => $target->star_id, + type => $target->get_type, + x => $target->x, + y => $target->y, + zone => $target->zone, + }; + } $body->update({ needs_recalc => 1, - x => $target->x, - y => $target->y, - zone => $target->zone, - star_id => $target->star_id, - orbit => $target->orbit, - }); - $target->update({ - needs_recalc => 1, - x => $old_x, - y => $old_y, - zone => $old_zone, - star_id => $old_star, - orbit => $old_orbit, + x => $new_data->{x}, + y => $new_data->{y}, + zone => $new_data->{zone}, + star_id => $new_data->{star_id}, + orbit => $new_data->{orbit}, }); +#confess [ 9999, 'in swap!' ]; + unless ($new_data->{type} eq "empty") { + $target->update({ + needs_recalc => 1, + x => $old_data->{x}, + y => $old_data->{y}, + zone => $old_data->{zone}, + star_id => $old_data->{star}, + orbit => $old_data->{orbit}, + }); + } return { message => "Swapped Places", name => $body->name, id => $body->id, - swapname => $target->name, - swapid => $target->id, + swapname => $new_data->{name}, + swapid => $new_data->{id}, + lorbit => $old_data->{orbit}, + orbit => $new_data->{orbit}, }; } @@ -972,7 +1088,7 @@ sub bhg_tasks { }, { name => 'Swap Places', - types => ['asteroid', 'habitable planet', 'gas giant', 'space station'], + types => ['asteroid', 'habitable planet', 'gas giant', 'space station', 'empty'], reason => "All targets.", occupied => 1, min_level => 30, diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 94e9f830..071955e8 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -5,6 +5,7 @@ - Mod: Possible to have more than one building prereq for ships. - Mod: All starting empires begin on a size 45 planet. - Add: Added get_actions_for method for BHG. + - Add: BHG planets can now move into empty orbits. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From abb3749923420d87870cf88d48546037e6bb8877 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Wed, 4 Apr 2012 16:14:37 -0600 Subject: [PATCH 13/45] Fixing wrong variable used in test. --- lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index 47f16e11..cc4d794c 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -210,7 +210,7 @@ sub generate_singularity { # $task->{waste_cost} = 1; # $task->{recovery} = 5; # $task->{side_chance} = 95; -# $task->{success} = 100; +# $chance->{success} = 100; # TEST SETTINGS my $btype; my $tempire; @@ -316,7 +316,8 @@ sub generate_singularity { $building->start_work({}, $task->{recovery})->update; # Pass the basic checks # Check for startup failure - unless (randint(0,99) < $task->{success}) { + my $roll = randint(0,99); + unless ($roll < $chance->{success}) { # Something went wrong with the start my $fail = randint(0,19); if ($fail == 0) { @@ -355,6 +356,8 @@ sub generate_singularity { sprintf('Scientists on %s are concerned when their singularity has a malfunction.', $body->name)); } + $return_stats->{perc} = $chance->{success}; + $return_stats->{roll} = $roll; $effect->{fail} = $return_stats; } else { @@ -486,7 +489,6 @@ sub bhg_swap { id => $body->id, swapname => $new_data->{name}, swapid => $new_data->{id}, - lorbit => $old_data->{orbit}, orbit => $new_data->{orbit}, }; } -- 2.51.2 From 776fb9f8093ac708984039c47f15302b6eacf599 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Wed, 4 Apr 2012 16:18:50 -0600 Subject: [PATCH 14/45] Test Parameters --- lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index cc4d794c..a608daaf 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -207,9 +207,9 @@ sub generate_singularity { confess [ $chance->{throw}, $chance->{reason} ]; } # TEST SETTINGS -# $task->{waste_cost} = 1; -# $task->{recovery} = 5; -# $task->{side_chance} = 95; + $task->{waste_cost} = 1; + $task->{recovery} = 5; + $task->{side_chance} = 95; # $chance->{success} = 100; # TEST SETTINGS my $btype; -- 2.51.2 From 59cea39cd872839ba784bfbcc976b8275ccdb5a8 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Wed, 4 Apr 2012 21:46:39 -0600 Subject: [PATCH 15/45] Couple more messages, adjusted n19 reports less often. --- lib/Lacuna/DB/Result/Building/Archaeology.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building/Archaeology.pm b/lib/Lacuna/DB/Result/Building/Archaeology.pm index e1bace8a..e0b9db4c 100644 --- a/lib/Lacuna/DB/Result/Building/Archaeology.pm +++ b/lib/Lacuna/DB/Result/Building/Archaeology.pm @@ -169,7 +169,7 @@ sub dig_it { message => "Found level $lvl + $plus $name Plan.", outcome => "Plan", }; - $self->body->add_news(5,sprintf("%s uncovered a %s plan on %s.", + $self->body->add_news(2,sprintf("%s uncovered a %s plan on %s.", $empire_name, $name, $body->name)); } when ("glyph") { @@ -178,7 +178,7 @@ sub dig_it { message => "Found a $glyph glyph.", outcome => "Glyph", }; - $self->body->add_news(5,sprintf("%s uncovered a %s glyph on %s.", + $self->body->add_news(1,sprintf("%s uncovered a %s glyph on %s.", $empire_name, $glyph, $body->name)); } when ("artifact") { @@ -200,32 +200,36 @@ sub dig_it { } when ("destroy") { if (randint(0,99) < 5) { -# This should give an excavator a 1.2% survival each day. Unless on artifact planets. my $message = random_element([ 'Dave, this conversation can serve no purpose anymore. Goodbye.', 'Did you notice anything weird a minute ago?', + 'Good. For a moment there, I thought we were in trouble.', 'Hasta la vista, baby', 'Houston.. we have a problem', 'I say we take off and nuke the site from orbit. It\'s the only way to be sure.', 'It\'s just a harmless little bunny...', 'It\'s full of stars', + 'Auntie Em, where\'s Toto? Its a twister! Its a twister!', 'Looks like I picked the wrong week to stop sniffing glue.', 'Klaatu Barada Ni*cough*', 'Oh no, not again.', 'Oops? What oops? No oops!', 'Ph\'nglui Mglw\'nafh Cthulhu R\'lyeh wgah\'nagi fhtagn.', + 'Push the buttom Max!', 'That\'s it man, game over man, game over!', 'The brazen temple doors open...', - 'There are things in the mist', + 'There are things in the mist.', + 'They\'re coming for me now, and then they\'ll come for you!', 'They\'re here already! You\'re next! You\'re next, You\'re next...!', 'This is obviously some strange usage of the word safe that I wasn\'t previously aware of.', 'Trust me, I\'m trained to do this.', + 'We have top men working on it now.', ]); $result = { message => $message, outcome => "Destroyed", }; - $self->body->add_news(10, $message); + $self->body->add_news(10, "$message"); } else { $result = { @@ -563,7 +567,7 @@ before finish_work => sub { } ); $empire->add_medal($ore.'_glyph'); - $body->add_news(70, sprintf('%s has uncovered a rare and ancient %s glyph on %s.',$empire->name, $ore, $body->name)); + $body->add_news(30, sprintf('%s has uncovered a rare and ancient %s glyph on %s.',$empire->name, $ore, $body->name)); } }; -- 2.51.2 From 0811f08ca4f1bb5fd75030a6097ddb6fc509beb1 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Fri, 6 Apr 2012 16:26:23 -0600 Subject: [PATCH 16/45] Slight chance of no ore being chosen for a glyph. --- lib/Lacuna/DB/Result/Building/Archaeology.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building/Archaeology.pm b/lib/Lacuna/DB/Result/Building/Archaeology.pm index e0b9db4c..260b7acb 100644 --- a/lib/Lacuna/DB/Result/Building/Archaeology.pm +++ b/lib/Lacuna/DB/Result/Building/Archaeology.pm @@ -201,6 +201,7 @@ sub dig_it { when ("destroy") { if (randint(0,99) < 5) { my $message = random_element([ + 'Aw, there\'s something behind me, isn\'t there?', 'Dave, this conversation can serve no purpose anymore. Goodbye.', 'Did you notice anything weird a minute ago?', 'Good. For a moment there, I thought we were in trouble.', @@ -339,10 +340,10 @@ sub found_glyph { $ore_total += $ores{$ore}; } my $base = 0; - my $rnum = randint(0,$ore_total); + my $rnum = randint(1,$ore_total); my $glyph = "error"; for my $ore (ORE_TYPES) { - if ($rnum < $ores{$ore} + $base) { + if ($rnum <= $ores{$ore} + $base) { $glyph = $ore; last; } -- 2.51.2 From 1dc0ac38cde8b67961197539ebed53a71016b99c Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 8 Apr 2012 14:35:08 -0500 Subject: [PATCH 17/45] added 20 new planets --- lib/Lacuna/DB/Result/Map/Body/Planet/P21.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P22.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P23.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P24.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P25.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P26.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P27.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P28.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P29.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P30.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P31.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P32.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P33.pm | 36 +++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P34.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P35.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P36.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P37.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P38.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P39.pm | 35 ++++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Planet/P40.pm | 35 ++++++++++++++++++++ 20 files changed, 701 insertions(+) create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P21.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P22.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P23.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P24.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P25.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P26.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P27.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P28.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P29.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P30.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P31.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P32.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P33.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P34.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P35.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P36.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P37.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P38.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P39.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Planet/P40.pm diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P21.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P21.pm new file mode 100644 index 00000000..6475dd95 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P21.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P21; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p21'; + +use constant water => 6300; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 8000; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 2000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P22.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P22.pm new file mode 100644 index 00000000..df605bef --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P22.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P22; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p22'; + +use constant water => 6700; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 5000; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 5000; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P23.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P23.pm new file mode 100644 index 00000000..5cb8398d --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P23.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P23; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p23'; + +use constant water => 7100; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 3500; +use constant kerogen => 3500; +use constant anthracite => 3000; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P24.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P24.pm new file mode 100644 index 00000000..cb0ce1e0 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P24.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P24; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p24'; + +use constant water => 7400; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 3300; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 3300; +use constant zircon => 3400; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P25.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P25.pm new file mode 100644 index 00000000..6493fdab --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P25.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P25; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p25'; + +use constant water => 9475; +use constant rutile => 2000; +use constant chromite => 1000; +use constant chalcopyrite => 3000; +use constant galena => 4000; +use constant gold => 1000; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P26.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P26.pm new file mode 100644 index 00000000..f3157e01 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P26.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P26; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p26'; + +use constant water => 7800; +use constant rutile => 100; +use constant chromite => 100; +use constant chalcopyrite => 100; +use constant galena => 100; +use constant gold => 9000; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 100; +use constant halite => 100; +use constant gypsum => 100; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 100; +use constant kerogen => 100; +use constant anthracite => 1; +use constant magnetite => 100; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P27.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P27.pm new file mode 100644 index 00000000..1fec849d --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P27.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P27; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p27'; + +use constant water => 2500; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 100; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 100; +use constant halite => 9500; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 100; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 100; +use constant monazite => 100; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P28.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P28.pm new file mode 100644 index 00000000..b3439422 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P28.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P28; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p28'; + +use constant water => 9230; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1500; +use constant bauxite => 1500; +use constant goethite => 2500; +use constant halite => 3500; +use constant gypsum => 2000; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P29.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P29.pm new file mode 100644 index 00000000..2844982a --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P29.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P29; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p29'; + +use constant water => 10000; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 3000; +use constant trona => 1; +use constant sulfur => 5000; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 2000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P30.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P30.pm new file mode 100644 index 00000000..7b61b6f7 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P30.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P30; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p30'; + +use constant water => 6450; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 4000; +use constant galena => 1; +use constant gold => 3000; +use constant uraninite => 1; +use constant bauxite => 3000; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P31.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P31.pm new file mode 100644 index 00000000..739e024e --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P31.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P31; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p31'; + +use constant water => 5885; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 2500; +use constant sulfur => 1500; +use constant methane => 1000; +use constant kerogen => 3000; +use constant anthracite => 2000; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P32.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P32.pm new file mode 100644 index 00000000..b566f045 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P32.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P32; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p32'; + +use constant water => 8600; +use constant rutile => 2000; +use constant chromite => 2000; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 2000; +use constant goethite => 2000; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 2000; +use constant fluorite => 1; +use constant beryl => 2000; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P33.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P33.pm new file mode 100644 index 00000000..ce1d3630 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P33.pm @@ -0,0 +1,36 @@ +package Lacuna::DB::Result::Map::Body::Planet::P33; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; +use Lacuna::Util; + +use constant image => 'p33'; + +sub water { randint(1000,10000) } +sub rutile { randint(1,1000) } +sub chromite { randint(1,1000) } +sub chalcopyrite { randint(1,1000) } +sub galena { randint(1,1000) } +sub gold { randint(1,1000) } +sub uraninite { randint(1,1000) } +sub bauxite { randint(1,1000) } +sub goethite { randint(1,1000) } +sub halite { randint(1,1000) } +sub gypsum { randint(1,1000) } +sub trona { randint(1,1000) } +sub sulfur { randint(1,1000) } +sub methane { randint(1,1000) } +sub kerogen { randint(1,1000) } +sub anthracite { randint(1,1000) } +sub magnetite { randint(1,1000) } +sub fluorite { randint(1,1000) } +sub beryl { randint(1,1000) } +sub zircon { randint(1,1000) } +sub monazite { randint(1,1000) } + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P34.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P34.pm new file mode 100644 index 00000000..d4f0820f --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P34.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P34; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p34'; + +use constant water => 7575; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 2000; +use constant fluorite => 2000; +use constant beryl => 2000; +use constant zircon => 2000; +use constant monazite => 2000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P35.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P35.pm new file mode 100644 index 00000000..265b6baf --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P35.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P35; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p35'; + +use constant water => 5885; +use constant rutile => 500; +use constant chromite => 500; +use constant chalcopyrite => 500; +use constant galena => 500; +use constant gold => 500; +use constant uraninite => 500; +use constant bauxite => 500; +use constant goethite => 500; +use constant halite => 500; +use constant gypsum => 500; +use constant trona => 500; +use constant sulfur => 500; +use constant methane => 500; +use constant kerogen => 500; +use constant anthracite => 500; +use constant magnetite => 500; +use constant fluorite => 500; +use constant beryl => 500; +use constant zircon => 500; +use constant monazite => 500; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P36.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P36.pm new file mode 100644 index 00000000..133c3605 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P36.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P36; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p36'; + +use constant water => 15000; +use constant rutile => 100; +use constant chromite => 100; +use constant chalcopyrite => 100; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 100; +use constant goethite => 100; +use constant halite => 1; +use constant gypsum => 100; +use constant trona => 1; +use constant sulfur => 100; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 100; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P37.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P37.pm new file mode 100644 index 00000000..6fb0f08a --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P37.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P37; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p37'; + +use constant water => 6225; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 2000; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 2000; +use constant anthracite => 2000; +use constant magnetite => 2000; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 2000; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P38.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P38.pm new file mode 100644 index 00000000..3a9f3733 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P38.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P38; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p38'; + +use constant water => 8000; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 7000; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 3000; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P39.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P39.pm new file mode 100644 index 00000000..964d66b2 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P39.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P39; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p39'; + +use constant water => 7135; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 500; +use constant trona => 1; +use constant sulfur => 2000; +use constant methane => 4000; +use constant kerogen => 1500; +use constant anthracite => 500; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1500; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet/P40.pm b/lib/Lacuna/DB/Result/Map/Body/Planet/P40.pm new file mode 100644 index 00000000..9ebae557 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Planet/P40.pm @@ -0,0 +1,35 @@ +package Lacuna::DB::Result::Map::Body::Planet::P40; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Planet'; + +use constant image => 'p40'; + +use constant water => 8350; +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 4000; +use constant gypsum => 1; +use constant trona => 2000; +use constant sulfur => 4000; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + -- 2.51.2 From 2d29d5830a20ee55e508a99a7e068fd16199667a Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 8 Apr 2012 14:35:37 -0500 Subject: [PATCH 18/45] added 5 new asteroids --- lib/Lacuna/DB/Result/Map/Body/Asteroid/A22.pm | 33 +++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Asteroid/A23.pm | 33 +++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Asteroid/A24.pm | 33 +++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Asteroid/A25.pm | 33 +++++++++++++++++++ lib/Lacuna/DB/Result/Map/Body/Asteroid/A26.pm | 33 +++++++++++++++++++ 5 files changed, 165 insertions(+) create mode 100644 lib/Lacuna/DB/Result/Map/Body/Asteroid/A22.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Asteroid/A23.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Asteroid/A24.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Asteroid/A25.pm create mode 100644 lib/Lacuna/DB/Result/Map/Body/Asteroid/A26.pm diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A22.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A22.pm new file mode 100644 index 00000000..f12b318c --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A22.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Map::Body::Asteroid::A22; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Asteroid'; + +use constant image => 'a22'; + +use constant rutile => 800; +use constant chromite => 900; +use constant chalcopyrite => 700; +use constant galena => 800; +use constant gold => 100; +use constant uraninite => 1; +use constant bauxite => 900; +use constant goethite => 400; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 400; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 500; +use constant fluorite => 100; +use constant beryl => 1; +use constant zircon => 200; +use constant monazite => 300; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A23.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A23.pm new file mode 100644 index 00000000..87f262ba --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A23.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Map::Body::Asteroid::A23; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Asteroid'; + +use constant image => 'a23'; + +use constant rutile => 1000; +use constant chromite => 1000; +use constant chalcopyrite => 1000; +use constant galena => 1000; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1000; +use constant beryl => 1000; +use constant zircon => 1000; +use constant monazite => 1; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A24.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A24.pm new file mode 100644 index 00000000..4abb1a6e --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A24.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Map::Body::Asteroid::A24; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Asteroid'; + +use constant image => 'a24'; + +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 4000; +use constant trona => 1; +use constant sulfur => 3000; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1500; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A25.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A25.pm new file mode 100644 index 00000000..97266457 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A25.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Map::Body::Asteroid::A25; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Asteroid'; + +use constant image => 'a25'; + +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 7900; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1; +use constant anthracite => 1; +use constant magnetite => 1; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 1; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A26.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A26.pm new file mode 100644 index 00000000..7e6a8158 --- /dev/null +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A26.pm @@ -0,0 +1,33 @@ +package Lacuna::DB::Result::Map::Body::Asteroid::A26; + +use Moose; +use utf8; +no warnings qw(uninitialized); +extends 'Lacuna::DB::Result::Map::Body::Asteroid'; + +use constant image => 'a26'; + +use constant rutile => 1; +use constant chromite => 1; +use constant chalcopyrite => 1; +use constant galena => 1; +use constant gold => 1; +use constant uraninite => 1750; +use constant bauxite => 1; +use constant goethite => 1; +use constant halite => 1; +use constant gypsum => 1; +use constant trona => 1; +use constant sulfur => 1; +use constant methane => 1; +use constant kerogen => 1500; +use constant anthracite => 1500; +use constant magnetite => 1500; +use constant fluorite => 1; +use constant beryl => 1; +use constant zircon => 1; +use constant monazite => 750; + +no Moose; +__PACKAGE__->meta->make_immutable(inline_constructor => 0); + -- 2.51.2 From 343834ca9b6c3062f876bcd0637b50578845e6d9 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Sun, 8 Apr 2012 18:43:17 -0600 Subject: [PATCH 19/45] Waste to fill scow check modified. --- lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm | 14 +++++++++++--- var/www/public/changes.txt | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm b/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm index b61614cd..e39ebe9f 100644 --- a/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm +++ b/lib/Lacuna/Role/Ship/Arrive/DumpWaste.pm @@ -68,15 +68,23 @@ after handle_arrival_procedures => sub { after send => sub { my $self = shift; - $self->body->spend_waste($self->hold_size)->update; - $self->payload({ resources => { waste => $self->hold_size } }); + my $waste_sent; + if ($self->body->waste_stored < $self->hold_size) { + $waste_sent = $self->body->waste_stored > 0 ? $self->body->waste_stored : 0; + } + else { + $waste_sent = $self->hold_size; + } + $self->body->spend_waste($waste_sent)->update; + $self->payload({ resources => { waste => $waste_sent } }); $self->update; }; after can_send_to_target => sub { my ($self, $target) = @_; confess [1013, 'Can only be sent to inhabited planets.'] if ($target->isa('Lacuna::DB::Result::Map::Body::Planet') && !$target->empire_id); - confess [1011, 'You do not have enough waste to fill this scow. You need '.$self->hold_size.' waste to launch.'] unless ($self->body->waste_stored > $self->hold_size); + confess [1011, 'You have no waste to ship' ] unless ($self->body->waste_stored > 0); +# confess [1011, 'You do not have enough waste to fill this scow. You need '.$self->hold_size.' waste to launch.'] unless ($self->body->waste_stored > $self->hold_size); }; 1; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 071955e8..9ad2355d 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -6,6 +6,7 @@ - Mod: All starting empires begin on a size 45 planet. - Add: Added get_actions_for method for BHG. - Add: BHG planets can now move into empty orbits. + - Mod: Scows don't have to be full to send. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From f4c363df8bece6a372d65cdc5b67446c4906e071 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 10 Apr 2012 11:39:14 -0600 Subject: [PATCH 20/45] Trade Summary compacted and Berth Level included. --- lib/Lacuna/DB/Result/Building/Shipyard.pm | 2 +- lib/Lacuna/DB/Result/Building/Trade.pm | 2 +- lib/Lacuna/DB/Result/Ships.pm | 6 +-- lib/Lacuna/DB/Result/Ships/Barge.pm | 2 +- lib/Lacuna/DB/Result/Ships/CargoShip.pm | 2 +- lib/Lacuna/DB/Result/Ships/Dory.pm | 2 +- lib/Lacuna/DB/Result/Ships/Freighter.pm | 2 +- lib/Lacuna/DB/Result/Ships/Galleon.pm | 2 +- lib/Lacuna/DB/Result/Ships/Hulk.pm | 2 +- lib/Lacuna/DB/Result/Ships/HulkFast.pm | 2 +- lib/Lacuna/DB/Result/Ships/HulkHuge.pm | 2 +- lib/Lacuna/DB/Result/Ships/ScowFast.pm | 2 +- lib/Lacuna/DB/Result/Ships/ScowLarge.pm | 2 +- lib/Lacuna/DB/Result/Ships/ScowMega.pm | 2 +- lib/Lacuna/DB/Result/Ships/SmugglerShip.pm | 2 +- lib/Lacuna/RPC/Building/Shipyard.pm | 2 +- lib/Lacuna/RPC/Building/SpacePort.pm | 16 +++---- lib/Lacuna/Role/Container.pm | 52 ++++++++++++++++++---- lib/Lacuna/Role/TraderRpc.pm | 7 +-- var/upgrades/3.0847.sql | 2 +- var/www/public/changes.txt | 3 +- 21 files changed, 76 insertions(+), 40 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building/Shipyard.pm b/lib/Lacuna/DB/Result/Building/Shipyard.pm index 8f5956ff..70e5856a 100644 --- a/lib/Lacuna/DB/Result/Building/Shipyard.pm +++ b/lib/Lacuna/DB/Result/Building/Shipyard.pm @@ -155,7 +155,7 @@ sub build_ship { $self->set_ship_speed($ship); $self->set_ship_combat($ship); $self->set_ship_hold_size($ship); - $ship->berth_size($ship->base_berth_size); + $ship->berth_level($ship->base_berth_level); $self->set_ship_stealth($ship); $time ||= $self->get_ship_costs($ship)->{seconds}; my $latest = $self->building_ships->search(undef, { order_by => { -desc => 'date_available' }, rows => 1})->single; diff --git a/lib/Lacuna/DB/Result/Building/Trade.pm b/lib/Lacuna/DB/Result/Building/Trade.pm index 78cd179b..acb6d0e5 100644 --- a/lib/Lacuna/DB/Result/Building/Trade.pm +++ b/lib/Lacuna/DB/Result/Building/Trade.pm @@ -128,7 +128,7 @@ sub trade_ships { task => 'Docked', type => { 'in' => [qw(dory barge galleon hulk hulk_huge hulk_fast cargo_ship freighter smuggler_ship)] }, body_id => $self->body_id, - berth_size => {'<=' => $max_level } + berth_level => {'<=' => $max_level } }, { order_by=> {-desc => ['hold_size']} diff --git a/lib/Lacuna/DB/Result/Ships.pm b/lib/Lacuna/DB/Result/Ships.pm index 3ae4f118..131cdeb6 100644 --- a/lib/Lacuna/DB/Result/Ships.pm +++ b/lib/Lacuna/DB/Result/Ships.pm @@ -37,7 +37,7 @@ __PACKAGE__->add_columns( foreign_body_id => { data_type => 'int', is_nullable => 1 }, foreign_star_id => { data_type => 'int', is_nullable => 1 }, fleet_speed => { data_type => 'int', is_nullable => 0 }, - berth_size => { data_type => 'int', is_nullable => 0 }, + berth_level => { data_type => 'int', is_nullable => 0 }, ); __PACKAGE__->typecast_map(type => { 'probe' => 'Lacuna::DB::Result::Ships::Probe', @@ -107,7 +107,7 @@ use constant base_speed => 1; use constant base_combat => 0; use constant base_stealth => 0; use constant base_hold_size => 0; -use constant base_berth_size => 1; +use constant base_berth_level => 1; use constant pilotable => 0; use constant target_building => []; use constant build_tags => []; @@ -203,7 +203,7 @@ sub get_status { stealth => $self->stealth, combat => $self->combat, hold_size => $self->hold_size, - berth_size => $self->berth_size, + berth_level => $self->berth_level, date_started => $self->date_started_formatted, date_available => $self->date_available_formatted, max_occupants => $self->max_occupants, diff --git a/lib/Lacuna/DB/Result/Ships/Barge.pm b/lib/Lacuna/DB/Result/Ships/Barge.pm index e2684f92..b7aa7afb 100644 --- a/lib/Lacuna/DB/Result/Ships/Barge.pm +++ b/lib/Lacuna/DB/Result/Ships/Barge.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 900; use constant base_speed => 1100; use constant base_stealth => 2450; use constant base_hold_size => 800; -use constant base_berth_size => 1; +use constant base_berth_level => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/CargoShip.pm b/lib/Lacuna/DB/Result/Ships/CargoShip.pm index ad66b639..69e1b1d6 100644 --- a/lib/Lacuna/DB/Result/Ships/CargoShip.pm +++ b/lib/Lacuna/DB/Result/Ships/CargoShip.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 1500; use constant base_speed => 1050; use constant base_stealth => 1500; use constant base_hold_size => 1700; -use constant base_berth_size => 5; +use constant base_berth_level => 5; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Dory.pm b/lib/Lacuna/DB/Result/Ships/Dory.pm index 15c1377d..4dcb73a7 100644 --- a/lib/Lacuna/DB/Result/Ships/Dory.pm +++ b/lib/Lacuna/DB/Result/Ships/Dory.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 400; use constant base_speed => 1250; use constant base_stealth => 4100; use constant base_hold_size => 400; -use constant base_berth_size => 1; +use constant base_berth_level => 1; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/DB/Result/Ships/Freighter.pm b/lib/Lacuna/DB/Result/Ships/Freighter.pm index 25da6b82..e9a50957 100644 --- a/lib/Lacuna/DB/Result/Ships/Freighter.pm +++ b/lib/Lacuna/DB/Result/Ships/Freighter.pm @@ -16,7 +16,7 @@ use constant base_waste_cost => 4800; use constant base_speed => 900; use constant base_stealth => 0; use constant base_hold_size => 4000; -use constant base_berth_size => 15; +use constant base_berth_level => 15; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Galleon.pm b/lib/Lacuna/DB/Result/Ships/Galleon.pm index 9cbe1cee..8f84eb24 100644 --- a/lib/Lacuna/DB/Result/Ships/Galleon.pm +++ b/lib/Lacuna/DB/Result/Ships/Galleon.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 3200; use constant base_speed => 1250; use constant base_stealth => 0; use constant base_hold_size => 1750; -use constant base_berth_size => 10; +use constant base_berth_level => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/Hulk.pm b/lib/Lacuna/DB/Result/Ships/Hulk.pm index 722c45ad..6af5e52b 100644 --- a/lib/Lacuna/DB/Result/Ships/Hulk.pm +++ b/lib/Lacuna/DB/Result/Ships/Hulk.pm @@ -16,7 +16,7 @@ use constant base_waste_cost => 11000; use constant base_speed => 600; use constant base_stealth => 0; use constant base_hold_size => 7900; -use constant base_berth_size => 20; +use constant base_berth_level => 20; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/HulkFast.pm b/lib/Lacuna/DB/Result/Ships/HulkFast.pm index 95d6f49c..97938a72 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkFast.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkFast.pm @@ -17,7 +17,7 @@ use constant base_waste_cost => 100000; use constant base_speed => 750; use constant base_stealth => 0; use constant base_hold_size => 10000; -use constant base_berth_size => 25; +use constant base_berth_level => 25; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm index d7014815..78ab0ef9 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm @@ -16,7 +16,7 @@ use constant base_waste_cost => 250000; use constant base_speed => 420; use constant base_stealth => 0; use constant base_hold_size => 150000; -use constant base_berth_size => 30; +use constant base_berth_level => 30; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/lib/Lacuna/DB/Result/Ships/ScowFast.pm b/lib/Lacuna/DB/Result/Ships/ScowFast.pm index 0dd843e2..087c37d9 100644 --- a/lib/Lacuna/DB/Result/Ships/ScowFast.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowFast.pm @@ -17,7 +17,7 @@ use constant base_speed => 700; use constant base_combat => 500; use constant base_stealth => 0; use constant base_hold_size => 2000; -use constant base_berth_size => 20; +use constant base_berth_level => 20; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/ScowLarge.pm b/lib/Lacuna/DB/Result/Ships/ScowLarge.pm index 360bc197..d466a4f1 100644 --- a/lib/Lacuna/DB/Result/Ships/ScowLarge.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowLarge.pm @@ -16,7 +16,7 @@ use constant base_speed => 325; use constant base_combat => 600; use constant base_stealth => 0; use constant base_hold_size => 12000; -use constant base_berth_size => 15; +use constant base_berth_level => 15; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/ScowMega.pm b/lib/Lacuna/DB/Result/Ships/ScowMega.pm index 2b8f44ad..ec4e1e94 100644 --- a/lib/Lacuna/DB/Result/Ships/ScowMega.pm +++ b/lib/Lacuna/DB/Result/Ships/ScowMega.pm @@ -16,7 +16,7 @@ use constant base_speed => 100; use constant base_combat => 0; use constant base_stealth => 0; use constant base_hold_size => 300000; -use constant base_berth_size => 25; +use constant base_berth_level => 25; use constant build_tags => [qw(War Trade)]; with "Lacuna::Role::Ship::Send::PlanetAndStar"; diff --git a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm index e10814e6..374a01d8 100644 --- a/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm +++ b/lib/Lacuna/DB/Result/Ships/SmugglerShip.pm @@ -15,7 +15,7 @@ use constant base_waste_cost => 1800; use constant base_speed => 1700; use constant base_stealth => 5000; use constant base_hold_size => 520; -use constant base_berth_size => 10; +use constant base_berth_level => 10; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining Intelligence)]; diff --git a/lib/Lacuna/RPC/Building/Shipyard.pm b/lib/Lacuna/RPC/Building/Shipyard.pm index af4f34a2..187db1a6 100644 --- a/lib/Lacuna/RPC/Building/Shipyard.pm +++ b/lib/Lacuna/RPC/Building/Shipyard.pm @@ -122,7 +122,7 @@ sub get_buildable { speed => $building->set_ship_speed($ship), stealth => $building->set_ship_stealth($ship), hold_size => $building->set_ship_hold_size($ship), - berth_size => $ship->base_berth_size, + berth_level => $ship->base_berth_level, combat => $building->set_ship_combat($ship), max_occupants => $ship->max_occupants }, diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index c28db256..50136eb3 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -90,8 +90,8 @@ sub get_ships_for { push @unavailable, { ship => $ship->get_status, reason => $reason }; next; } - if ($ship->berth_size > $max_level) { - $reason = [ 552, 'Max Berth Size from this planet is '.$max_level ]; + if ($ship->berth_level > $max_level) { + $reason = [ 552, 'Max Berth Level to send from this planet is '.$max_level ]; push @unavailable, { ship => $ship->get_status, reason => $reason }; next; } @@ -317,7 +317,7 @@ sub prepare_send_spies { my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, task=>'Docked', body_id => $on_body_id, - berth_size => {'<=' => $max_level } }, + berth_level => {'<=' => $max_level } }, {order_by => 'name', rows=>100} ); my @ships; @@ -373,8 +373,8 @@ sub send_spies { unless ($ship->is_available) { confess [1010, "That ship is not available."]; } - unless ($ship->berth_size <= $max_level) { - confess [1010, "Your spaceport level is not high enough to support that ship."]; + unless ($ship->berth_level <= $max_level) { + confess [1010, "Your spaceport level is not high enough to support a ship with a Berth Level of ".$ship->berth_level."."]; } # check size @@ -445,7 +445,7 @@ sub prepare_fetch_spies { my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search( {type => { in => [qw(spy_pod cargo_ship smuggler_ship dory spy_shuttle barge)]}, task=>'Docked', body_id => $to_body_id, - berth_size => {'<=' => $max_level } }, + berth_level => {'<=' => $max_level } }, {order_by => 'name', rows=>100} ); my @ships; @@ -503,8 +503,8 @@ sub fetch_spies { confess [1010, "That ship is not available."]; } - unless ($ship->berth_size <= $max_level) { - confess [1010, "Your spaceport level is not high enough to support that ship."]; + unless ($ship->berth_level <= $max_level) { + confess [1010, "Your spaceport level is not high enough to support a ship with a Berth Level of ".$ship->berth_level."."]; } unless ($on_body->empire_id) { diff --git a/lib/Lacuna/Role/Container.pm b/lib/Lacuna/Role/Container.pm index 3b571779..9e683ca1 100644 --- a/lib/Lacuna/Role/Container.pm +++ b/lib/Lacuna/Role/Container.pm @@ -110,9 +110,24 @@ sub unload { return $self; } +sub consolidate { + my ($items) = @_; + + my %items; + my @items; + for my $item (@$items) { + $items{$item}++; + } + for my $item (sort keys %items) { + push @items, sprintf("%5s %s", commify($items{$item}), $item); + } + return \@items; +} + sub format_description_of_payload { my ($self) = @_; my @items; + my @scratch; my $payload = $self->payload; # essentia @@ -124,53 +139,72 @@ sub format_description_of_payload { } # glyphs + @scratch = (); foreach my $glyph (@{$payload->{glyphs}}) { - push @items, $glyph.' glyph'; + push @scratch, $glyph.' glyph'; } + push @items, @{consolidate(\@scratch)}; # ships my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships'); + + @scratch = (); foreach my $id (@{ $payload->{ships}}) { - my $ship = $ships->find($id); - next unless defined $ship; - my $pattern = '%s (speed: %s, stealth: %s, hold size: %s, combat: %s)' ; - push @items, sprintf($pattern, $ship->type_formatted, commify($ship->speed), commify($ship->stealth), commify($ship->hold_size), commify($ship->combat)); + my $ship = $ships->find($id); + next unless defined $ship; + my $pattern = '%s (speed: %s, stealth: %s, hold size: %s, berth: %s, combat: %s)' ; + push @scratch, + sprintf($pattern, + $ship->type_formatted, + commify($ship->speed), + commify($ship->stealth), + commify($ship->hold_size), + commify($ship->berth_level), + commify($ship->combat)); } + push @items, @{consolidate(\@scratch)}; # plans + @scratch = (); foreach my $stats (@{ $payload->{plans}}) { my $level = $stats->{level}; if ($stats->{extra_build_level}) { $level .= '+'.$stats->{extra_build_level}; } my $pattern = '%s (%s) plan'; - push @items, sprintf($pattern, $stats->{class}->name, $level); + push @scratch, sprintf($pattern, $stats->{class}->name, $level); } + push @items, @{consolidate(\@scratch)}; # spies + @scratch = (); my $spies = Lacuna->db->resultset('Lacuna::DB::Result::Spies'); if (exists $payload->{spies}) { foreach my $id (@{$payload->{spies}}) { my $spy = $spies->find($id); next unless defined $spy; - push @items, 'Level '.$spy->level.' spy named '.$spy->name . ' (transport)'; + push @scratch, 'Level '.$spy->level.' spy named '.$spy->name . ' (transport)'; } } + push @items, @{consolidate(\@scratch)}; # prisoners + @scratch = (); if (exists $payload->{prisoners}) { foreach my $id (@{$payload->{prisoners}}) { my $spy = $spies->find($id); next unless defined $spy; - push @items, 'Level '.$spy->level.' spy named '.$spy->name . ' (prisoner) sentence expires '.$spy->format_available_on; + push @scratch, 'Level '.$spy->level.' spy named '.$spy->name . ' (prisoner) sentence expires '.$spy->format_available_on; } } + push @items, @{consolidate(\@scratch)}; # fetch spies + @scratch = (); if (exists $payload->{fetch_spies}) { foreach my $id (@{$payload->{fetch_spies}}) { my $spy = $spies->find($id); - push @items, 'Level '.$spy->level.' spy named '.$spy->name . ' (fetch upon arrival)'; + push @scratch, 'Level '.$spy->level.' spy named '.$spy->name . ' (fetch upon arrival)'; } } diff --git a/lib/Lacuna/Role/TraderRpc.pm b/lib/Lacuna/Role/TraderRpc.pm index 3b645082..7f93729d 100644 --- a/lib/Lacuna/Role/TraderRpc.pm +++ b/lib/Lacuna/Role/TraderRpc.pm @@ -97,7 +97,7 @@ sub get_ships { name => $ship->name, type => $ship->type, hold_size => $ship->hold_size, - berth_size => $ship->berth_size, + berth_level => $ship->berth_level, speed => $ship->speed, }; } @@ -119,7 +119,7 @@ sub get_ship_summary { ); my $ship_summary = {}; while (my $ship = $ships->next) { - my $key = sprintf("%s~%s~%02u~%02u~%02u", $ship->name, $ship->type, $ship->hold_size, $ship->speed, $ship->berth_size); + my $key = sprintf("%s~%s~%02u~%02u~%02u", $ship->name, $ship->type, $ship->hold_size, $ship->berth_level, $ship->speed); $ship_summary->{$key}++; } @@ -129,12 +129,13 @@ sub get_ship_summary { my @out; for my $ship (@ships) { my ($key,$quantity) = %$ship; - my ($name,$type,$hold_size,$speed,$berth_size) = split /~/, $key; + my ($name,$type,$hold_size,$berth_level,$speed) = split /~/, $key; push @out, { name => $name, type => $type, hold_size => int($hold_size), + berth_level => int($berth_level), speed => int($speed), quantity => $quantity, }; diff --git a/var/upgrades/3.0847.sql b/var/upgrades/3.0847.sql index 11e42cd4..ace8144a 100644 --- a/var/upgrades/3.0847.sql +++ b/var/upgrades/3.0847.sql @@ -1 +1 @@ -alter table ships add column berth_size tinyint default 1; +alter table ships add column berth_level tinyint default 1; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 9ad2355d..5cc9cedc 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,5 +1,6 @@ 3.0848: - - Mod: Berth Size less confusing than Dock Size. + - Mod: Trade Summaries more compact. + - Mod: Berth Level less confusing than Dock Size. - Fix: Scows limited to Spaceport Level determined by Berth. - Mod: Scow 20 and 30 changed names to Large & Mega. - Mod: Possible to have more than one building prereq for ships. -- 2.51.2 From 35479ddc600b67d86ae96d534ce102b29310ce54 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 10 Apr 2012 13:37:00 -0600 Subject: [PATCH 21/45] Summarize Missions, berth and cleaning new empires. --- lib/Lacuna/DB/Result/Empire.pm | 64 ++++++++++++++++------- lib/Lacuna/DB/Result/Mission.pm | 34 ++++++++++-- lib/Lacuna/RPC/Building/MiningMinistry.pm | 9 ++++ lib/Lacuna/RPC/Building/SpacePort.pm | 2 +- var/www/public/changes.txt | 7 +-- 5 files changed, 90 insertions(+), 26 deletions(-) diff --git a/lib/Lacuna/DB/Result/Empire.pm b/lib/Lacuna/DB/Result/Empire.pm index 5cad6627..9da52c3b 100644 --- a/lib/Lacuna/DB/Result/Empire.pm +++ b/lib/Lacuna/DB/Result/Empire.pm @@ -450,26 +450,54 @@ sub attach_invite_code { } sub found { - my ($self, $home_planet) = @_; - - # lock empire - $self->update({stage=>'finding home planet'}); - - # found home planet - $home_planet ||= $self->find_home_planet; - $self->tutorial_scratch($home_planet->name); - $self->home_planet_id($home_planet->id); - $home_planet->size(45); - $self->stage('founded'); - $self->update; - $self->home_planet($home_planet); - $self->add_probe($home_planet->star_id, $home_planet->id); + my ($self, $home_planet) = @_; + + # lock empire + $self->update({stage=>'finding home planet'}); + + # found home planet + $home_planet ||= $self->find_home_planet; + $self->tutorial_scratch($home_planet->name); + $self->home_planet_id($home_planet->id); + $home_planet->size(45); + # Clean off everything but decor + my $decor = [qw( + Lacuna::DB::Result::Building::Permanent::Beach1 + Lacuna::DB::Result::Building::Permanent::Beach2 + Lacuna::DB::Result::Building::Permanent::Beach3 + Lacuna::DB::Result::Building::Permanent::Beach4 + Lacuna::DB::Result::Building::Permanent::Beach5 + Lacuna::DB::Result::Building::Permanent::Beach6 + Lacuna::DB::Result::Building::Permanent::Beach7 + Lacuna::DB::Result::Building::Permanent::Beach8 + Lacuna::DB::Result::Building::Permanent::Beach9 + Lacuna::DB::Result::Building::Permanent::Beach10 + Lacuna::DB::Result::Building::Permanent::Beach11 + Lacuna::DB::Result::Building::Permanent::Beach12 + Lacuna::DB::Result::Building::Permanent::Beach13 + Lacuna::DB::Result::Building::Permanent::Crater + Lacuna::DB::Result::Building::Permanent::Grove + Lacuna::DB::Result::Building::Permanent::Lagoon + Lacuna::DB::Result::Building::Permanent::Lake + Lacuna::DB::Result::Building::Permanent::RockyOutcrop + Lacuna::DB::Result::Building::Permanent::Sand + )]; + my $buildings = $home_planet->buildings->search; + while (my $building = $buildings->next) { + unless ( grep { $building->class eq $_ } @{$decor}) { + $building->delete; + } + } + $self->stage('founded'); + $self->update; + $self->home_planet($home_planet); + $self->add_probe($home_planet->star_id, $home_planet->id); - # found colony - $home_planet->found_colony($self); + # found colony + $home_planet->found_colony($self); - # send welcome - return Lacuna::Tutorial->new(empire=>$self)->start('explore_the_ui'); + # send welcome +return Lacuna::Tutorial->new(empire=>$self)->start('explore_the_ui'); } diff --git a/lib/Lacuna/DB/Result/Mission.pm b/lib/Lacuna/DB/Result/Mission.pm index 4341440d..4c5616af 100644 --- a/lib/Lacuna/DB/Result/Mission.pm +++ b/lib/Lacuna/DB/Result/Mission.pm @@ -127,6 +127,7 @@ sub add_rewards { combat => $ship->{combat} || 0, stealth => $ship->{stealth} || 0, hold_size => $ship->{hold_size} || 0, + berth_level => $ship->{berth_level} || 1, body_id => $body->id, task => 'Docked', })->insert; @@ -180,6 +181,7 @@ sub spend_objectives { speed => {'>=' => $ship->{speed}}, stealth => {'>=' => $ship->{stealth}}, hold_size => {'>=' => $ship->{hold_size}}, + berth_level => {'>=' => $ship->{berth_level}}, }, {rows => 1, order_by => 'id'} )->single->delete; @@ -248,6 +250,7 @@ sub check_objectives { speed => {'>=' => $ship->{speed} || 0}, stealth => {'>=' => $ship->{stealth} || 0}, hold_size => {'>=' => $ship->{hold_size} || 0}, + berth_level => {'>=' => $ship->{berth_level} || 0}, task => 'Docked', id => { 'not in' => \@ids }, },{ @@ -319,9 +322,24 @@ sub format_rewards { return $self->format_items($self->params->get('mission_reward')); } +sub consolidate { + my ($items) = @_; + + my %items; + my @items; + for my $item (@$items) { + $items{$item}++; + } + for my $item (sort keys %items) { + push @items, sprintf("%5s %s", commify($items{$item}), $item); + } + return \@items; +} + sub format_items { my ($self, $items, $is_objective) = @_; my @items; + my @scratch; # essentia push @items, sprintf('%s essentia.', commify($items->{essentia})) if ($items->{essentia}); @@ -335,20 +353,25 @@ sub format_items { } # glyphs + @scratch = (); foreach my $glyph (@{$items->{glyphs}}) { - push @items, $glyph.' glyph'; + push @scratch, $glyph.' glyph'; } + push @items, @{consolidate(\@scratch)}; # ships + @scratch = (); my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships'); foreach my $stats (@{ $items->{ships}}) { my $ship = $ships->new({type=>$stats->{type}}); my $pattern = $is_objective ? '%s (speed >= %s, stealth >= %s, hold size >= %s, combat >= %s)' : '%s (speed: %s, stealth: %s, hold size: %s, combat: %s)' ; - push @items, sprintf($pattern, $ship->type_formatted, commify($stats->{speed}), commify($stats->{stealth}), commify($stats->{hold_size}), commify($stats->{combat})); + push @scratch, sprintf($pattern, $ship->type_formatted, commify($stats->{speed}), commify($stats->{stealth}), commify($stats->{hold_size}), commify($stats->{combat})); } + push @items, @{consolidate(\@scratch)}; # fleet movement if ($is_objective && exists $items->{fleet_movement}) { + @scratch = (); my $bodies = Lacuna->db->resultset("Lacuna::DB::Result::Map::Body"); my $stars = Lacuna->db->resultset("Lacuna::DB::Result::Map::Star"); my $scratch = $self->scratch || {fleet_movement=>[]}; @@ -363,19 +386,22 @@ sub format_items { } warn "fleet movement target not found"; next unless defined $target; - push @items, 'Send '.$ship->type_formatted.' to '.$target->name.' ('.$target->x.','.$target->y.').'; + push @scratch, 'Send '.$ship->type_formatted.' to '.$target->name.' ('.$target->x.','.$target->y.').'; } + push @items, @{consolidate(\@scratch)}; } # plans + @scratch = (); foreach my $stats (@{ $items->{plans}}) { my $level = $stats->{level}; if ($stats->{extra_build_level}) { $level .= '+'.$stats->{extra_build_level}; } my $pattern = $is_objective ? '%s (>= %s) plan' : '%s (%s) plan'; - push @items, sprintf($pattern, $stats->{classname}->name, $level); + push @scratch, sprintf($pattern, $stats->{classname}->name, $level); } + push @items, @{consolidate(\@scratch)}; return \@items; } diff --git a/lib/Lacuna/RPC/Building/MiningMinistry.pm b/lib/Lacuna/RPC/Building/MiningMinistry.pm index 21818a85..f41411eb 100644 --- a/lib/Lacuna/RPC/Building/MiningMinistry.pm +++ b/lib/Lacuna/RPC/Building/MiningMinistry.pm @@ -27,6 +27,7 @@ sub view_ships { name => $ship->name, speed => $ship->speed, hold_size => $ship->hold_size, + berth_level => $ship->berth_level, task => $ship->task, }; } @@ -110,6 +111,14 @@ sub add_cargo_ship_to_fleet { unless ($ship->body_id eq $building->body_id) { confess [1013, "You can't manage a ship that is not yours."]; } + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $building->body_id, + efficiency => 100, + } )->get_column('level')->max; + unless ($max_level >= $ship->berth_level) { + confess [1009, 'Max Berth Level is '.$max_level.' for ships on this planet.' ]; + } $building->add_ship($ship); return { status =>$self->format_status($empire, $building->body), diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index 50136eb3..88b25636 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -91,7 +91,7 @@ sub get_ships_for { next; } if ($ship->berth_level > $max_level) { - $reason = [ 552, 'Max Berth Level to send from this planet is '.$max_level ]; + $reason = [ 1009, 'Max Berth Level to send from this planet is '.$max_level ]; push @unavailable, { ship => $ship->get_status, reason => $reason }; next; } diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 5cc9cedc..de14e997 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,13 +1,14 @@ 3.0848: - - Mod: Trade Summaries more compact. - Mod: Berth Level less confusing than Dock Size. - - Fix: Scows limited to Spaceport Level determined by Berth. - - Mod: Scow 20 and 30 changed names to Large & Mega. + - Fix: Scows and Trade Ships limited to Spaceport Level determined by Berth. + - Add: Hulk Large, Hulk Fast, Scow Fast, Scow Large, and Scow Mega Added. - Mod: Possible to have more than one building prereq for ships. - Mod: All starting empires begin on a size 45 planet. - Add: Added get_actions_for method for BHG. - Add: BHG planets can now move into empty orbits. - Mod: Scows don't have to be full to send. + - Mod: Trade Summaries more compact. + - Mod: Summarize Missions. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From 3440371e13b30e451f64e008a01a604b00530ac4 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 10 Apr 2012 14:55:03 -0600 Subject: [PATCH 22/45] Excavators more stringent check. --- lib/Lacuna/DB/Result/Building/Archaeology.pm | 12 +++++++++--- lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 6 ++++-- var/upgrades/3.0847.sql | 1 + var/www/public/changes.txt | 5 +++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building/Archaeology.pm b/lib/Lacuna/DB/Result/Building/Archaeology.pm index 260b7acb..a28b746a 100644 --- a/lib/Lacuna/DB/Result/Building/Archaeology.pm +++ b/lib/Lacuna/DB/Result/Building/Archaeology.pm @@ -490,13 +490,19 @@ sub can_add_excavator { $count = Lacuna->db->resultset('Lacuna::DB::Result::Excavators') ->search({ body_id => $body->id, empire_id => $self->body->empire->id })->count; unless ($on_arrival) { - $count += Lacuna->db->resultset('Lacuna::DB::Result::Ships') + my $ships = Lacuna->db->resultset('Lacuna::DB::Result::Ships') ->search( { type=>'excavator', foreign_body_id => $body->id, task=>'Travelling', - body_id=>$self->body_id - })->count; + }); + while (my $ship = $ships->next) { + my $from = $ship->body; + if ($from->empire->id == $self->body->empire->id) { + $count++; + last; + } + } } if ($count) { confess [1010, $body->name.' already has an excavator from your empire or one is on the way.']; diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index a608daaf..77a6014a 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -943,7 +943,8 @@ sub bhg_change_type { name => $body->name, }; } - my $starter = (!$body->empire && $body->size >= 40 && $body->size <= 50) ? 1 : 0; +# my $starter = (!$body->empire && $body->size >= 40 && $body->size <= 50) ? 1 : 0; + my $starter = 0; $body->update({ needs_recalc => 1, class => $class, @@ -1023,7 +1024,8 @@ sub bhg_size { name => $body->name, }; } - my $starter = (!$body->empire && $body->size >= 40 && $body->size <= 50) ? 1 : 0; +# my $starter = (!$body->empire && $body->size >= 40 && $body->size <= 50) ? 1 : 0; + my $starter = 0; $body->update({ needs_recalc => 1, size => $current_size, diff --git a/var/upgrades/3.0847.sql b/var/upgrades/3.0847.sql index ace8144a..e853cba1 100644 --- a/var/upgrades/3.0847.sql +++ b/var/upgrades/3.0847.sql @@ -1 +1,2 @@ alter table ships add column berth_level tinyint default 1; +delete from probes where empire_id < 0; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index de14e997..83c5d6ee 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,14 +1,15 @@ 3.0848: + - Add: Hulk Large, Hulk Fast, Scow Fast, Scow Large, and Scow Mega Added. - Mod: Berth Level less confusing than Dock Size. - Fix: Scows and Trade Ships limited to Spaceport Level determined by Berth. - - Add: Hulk Large, Hulk Fast, Scow Fast, Scow Large, and Scow Mega Added. - Mod: Possible to have more than one building prereq for ships. + - Mod: Scows don't have to be full to send. - Mod: All starting empires begin on a size 45 planet. - Add: Added get_actions_for method for BHG. - Add: BHG planets can now move into empty orbits. - - Mod: Scows don't have to be full to send. - Mod: Trade Summaries more compact. - Mod: Summarize Missions. + - Fix: Excavators check to see if any excavators from empire are on way to body. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From 2a8d6dbe46156ef14e0daa5666ce53dfdea49d55 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 10 Apr 2012 16:35:09 -0600 Subject: [PATCH 23/45] Better error handling on target. --- lib/Lacuna/RPC/Building/BlackHoleGenerator.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index 77a6014a..af1b370c 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -42,17 +42,25 @@ sub find_target { 'The target parameter should be a hash reference. For example { "body_id" : 9999 }.']; } my $target; + my $target_word = join(":", keys %$target_params); + if ($target_word eq '') { + confess [ -32602, + 'The target parameter should be a hash reference. For example { "body_id" : 9999 }.']; + } if (exists $target_params->{body_id}) { + $target_word = $target_params->{body_id}; $target = Lacuna->db ->resultset('Lacuna::DB::Result::Map::Body') ->find($target_params->{body_id}); } elsif (exists $target_params->{body_name}) { + $target_word = $target_params->{body_name}; $target = Lacuna->db ->resultset('Lacuna::DB::Result::Map::Body') ->search({ name => $target_params->{body_name} }, {rows=>1})->single; } elsif (exists $target_params->{x}) { + $target_word = $target_params->{x}.":".$target_params->{y}; $target = Lacuna->db ->resultset('Lacuna::DB::Result::Map::Body') ->search({ x => $target_params->{x}, y => $target_params->{y} }, {rows=>1})->single; @@ -108,7 +116,7 @@ sub find_target { } } unless (defined $target) { - confess [ 1002, 'Could not find the target.']; + confess [ 1002, 'Could not find '.$target_word.' target.']; } return $target; } -- 2.51.2 From ad4ffb2a00085db83fa5dd23a5244c4d3f5a5b89 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Tue, 10 Apr 2012 20:42:26 -0600 Subject: [PATCH 24/45] Slight tweak in display --- lib/Lacuna/DB/Result/Mission.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lacuna/DB/Result/Mission.pm b/lib/Lacuna/DB/Result/Mission.pm index 4c5616af..1105d8dd 100644 --- a/lib/Lacuna/DB/Result/Mission.pm +++ b/lib/Lacuna/DB/Result/Mission.pm @@ -331,7 +331,7 @@ sub consolidate { $items{$item}++; } for my $item (sort keys %items) { - push @items, sprintf("%5s %s", commify($items{$item}), $item); + push @items, sprintf("%5s : %s", commify($items{$item}), $item); } return \@items; } -- 2.51.2 From 6b994e33268206a4c1bceac872254d160fc26c67 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Thu, 12 Apr 2012 08:13:31 -0600 Subject: [PATCH 25/45] Clean up Excavators from abandoned planet (or deleted building) --- lib/Lacuna/DB/Result/Building/Archaeology.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Lacuna/DB/Result/Building/Archaeology.pm b/lib/Lacuna/DB/Result/Building/Archaeology.pm index a28b746a..49373506 100644 --- a/lib/Lacuna/DB/Result/Building/Archaeology.pm +++ b/lib/Lacuna/DB/Result/Building/Archaeology.pm @@ -603,6 +603,11 @@ sub make_plan { return $self->body->add_plan($plan_class, 1); } +before delete => sub { + my ($self) = @_; + $self->excavators->delete_all; +}; + before 'can_downgrade' => sub { my $self = shift; my $ecount = $self->excavators->count; -- 2.51.2 From 8e4c94b50b0856a335e9a4f1423d6790c7874c5b Mon Sep 17 00:00:00 2001 From: lemming552 Date: Thu, 12 Apr 2012 20:48:24 -0600 Subject: [PATCH 26/45] Don't look for berth level for ship qualifiers yet. --- lib/Lacuna/DB/Result/Mission.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lacuna/DB/Result/Mission.pm b/lib/Lacuna/DB/Result/Mission.pm index 1105d8dd..c7d1187f 100644 --- a/lib/Lacuna/DB/Result/Mission.pm +++ b/lib/Lacuna/DB/Result/Mission.pm @@ -181,7 +181,7 @@ sub spend_objectives { speed => {'>=' => $ship->{speed}}, stealth => {'>=' => $ship->{stealth}}, hold_size => {'>=' => $ship->{hold_size}}, - berth_level => {'>=' => $ship->{berth_level}}, +# berth_level => {'>=' => $ship->{berth_level}}, }, {rows => 1, order_by => 'id'} )->single->delete; -- 2.51.2 From a3ff7aef308cdae4a5f78017ea5168e4f8851899 Mon Sep 17 00:00:00 2001 From: ysth Date: Mon, 16 Apr 2012 23:57:13 -0700 Subject: [PATCH 27/45] IBS downgrade shouldn't repeal more laws than needed --- lib/Lacuna/Role/Influencer.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/Role/Influencer.pm b/lib/Lacuna/Role/Influencer.pm index b8b25d6d..d03a644b 100644 --- a/lib/Lacuna/Role/Influencer.pm +++ b/lib/Lacuna/Role/Influencer.pm @@ -17,9 +17,24 @@ before demolish => sub { before downgrade => sub { my $self = shift; my $station = $self->body; + + my @laws = $station->laws->search({type => 'Jurisdiction'},{order_by => { -desc => 'date_enacted'}})->all; + + # If this is an IBS, we must remove soon-to-be out of range star seizures now instead + # of after downgrade, since that may make removing any others unnecessary and improper + if ($self->isa('Lacuna::DB::Result::Building::Module::IBS')) { + my $range_of_influence = $station->range_of_influence - 1000; + for (my $law_index = $#laws; $law_index >= 0; --$law_index ) { + my $law = $laws[$law_index]; + if ($station->calculate_distance_to_target($law->star) > $range_of_influence) { + $law->delete; + splice @laws, $law_index, 1; + } + } + } + my $influence_remaining = $station->influence_remaining - 1; - my $laws = $station->laws->search({type => 'Jurisdiction'},{order_by => { -desc => 'date_enacted'}}); - while (my $law = $laws->next) { + for my $law (@laws) { last if $influence_remaining >= 0; $law->delete; $influence_remaining++; -- 2.51.2 From 30e9378bfc30dafec104797134fe7a851cd655fe Mon Sep 17 00:00:00 2001 From: ysth Date: Tue, 17 Apr 2012 00:03:59 -0700 Subject: [PATCH 28/45] Asteroids shouldn't have water --- lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm | 2 -- lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm | 2 -- lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm | 2 +- lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm | 2 -- lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm | 2 +- lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm | 2 -- 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm index fdfebbf1..97a3448e 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm @@ -47,8 +47,6 @@ use constant beryl => 313; use constant magnetite => 296; -use constant water => 289; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm index 9c3426a5..0999d9d3 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm @@ -9,8 +9,6 @@ use constant image => 'a17'; use constant beryl => 4233; -use constant water => 3800; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm index 2547816b..04cb6c8c 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm @@ -8,8 +8,8 @@ extends 'Lacuna::DB::Result::Map::Body::Asteroid'; use constant image => 'a18'; use constant trona => 3326; + use constant gypsum => 4120; -use constant water => 115; no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm index 89deab10..b18b7336 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm @@ -11,8 +11,6 @@ use constant fluorite => 1000; use constant gold => 8500; -use constant water => 500; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm index 88afb909..c54b48bc 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm @@ -8,8 +8,8 @@ extends 'Lacuna::DB::Result::Map::Body::Asteroid'; use constant image => 'a6'; use constant galena => 5790; + use constant kerogen => 40; -use constant water => 13; no Moose; diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm index 4e2b1892..c0e68da1 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm @@ -9,8 +9,6 @@ use constant image => 'a9'; use constant methane => 5500; -use constant water => 1700; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); -- 2.51.2 From 0f606f60ba1e9cd09b139134079cf5ec3ba16d13 Mon Sep 17 00:00:00 2001 From: ysth Date: Tue, 17 Apr 2012 00:13:08 -0700 Subject: [PATCH 29/45] When parliament and SCC are losing their final efficiency, take into account that spy damage may have left efficiency at at a non-multiple of 25 --- lib/Lacuna/DB/Result/Map/Body/Planet.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index c69a922e..714183ed 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -2045,7 +2045,7 @@ sub complain_about_lack_of_resources { my $sc = $self->get_building_of_class('Lacuna::DB::Result::Building::Module::StationCommand'); if ($sc && $par) { if ($sc->level == $par->level) { - if ($sc->level == 1 && $sc->efficiency == 25 && $par->efficiency == 25) { + if ($sc->level == 1 && $sc->efficiency <= 25 && $par->efficiency <= 25) { # They go out together with a big bang $sc->spend_efficiency(25)->update; $building_name = $par->name; -- 2.51.2 From 336c62e77e94c229ad31681203345e3ab986dc1a Mon Sep 17 00:00:00 2001 From: ysth Date: Tue, 17 Apr 2012 00:16:24 -0700 Subject: [PATCH 30/45] On building theft, use actual downgrade function, triggering law repeals on influnce reduction --- lib/Lacuna/DB/Result/Building.pm | 8 +++++--- lib/Lacuna/DB/Result/Spies.pm | 7 ++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index a27245e3..d666779d 100755 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -628,7 +628,7 @@ sub can_downgrade { } sub downgrade { - my $self = shift; + my ($self, $theft) = @_; if ($self->level == 1) { $self->can_demolish; return $self->demolish; @@ -636,8 +636,10 @@ sub downgrade { $self->level( $self->level - 1); $self->update; my $body = $self->body; - $body->add_waste(sprintf('%.0f',$self->ore_to_build * $self->upgrade_cost)); - $body->spend_happiness(sprintf('%.0f',$self->food_to_build * $self->upgrade_cost)); + if (!$theft) { + $body->add_waste(sprintf('%.0f',$self->ore_to_build * $self->upgrade_cost)); + $body->spend_happiness(sprintf('%.0f',$self->food_to_build * $self->upgrade_cost)); + } $body->needs_recalc(1); $body->needs_surface_refresh(1); $body->update; diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index 0fcdacce..48906486 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -2134,11 +2134,8 @@ sub steal_building { my $max = ($self->level > 30) ? 30 : $self->level; my $level = randint(1, $max); $level = $building->level if ($level > $building->level); - $building->level( $building->level - 1 ); - $building->update; - $on_body->needs_recalc(1); - $on_body->needs_surface_refresh(1); - $on_body->update; + $building->body($on_body); + $building->downgrade(1); $self->from_body->add_plan($building->class, $level); $on_body->empire->send_predefined_message( tags => ['Spies','Alert'], -- 2.51.2 From 47270908673f655986a6aef9b86257a28c74d5f1 Mon Sep 17 00:00:00 2001 From: ysth Date: Mon, 16 Apr 2012 23:57:13 -0700 Subject: [PATCH 31/45] IBS downgrade shouldn't repeal more laws than needed --- lib/Lacuna/Role/Influencer.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/Role/Influencer.pm b/lib/Lacuna/Role/Influencer.pm index b8b25d6d..d03a644b 100644 --- a/lib/Lacuna/Role/Influencer.pm +++ b/lib/Lacuna/Role/Influencer.pm @@ -17,9 +17,24 @@ before demolish => sub { before downgrade => sub { my $self = shift; my $station = $self->body; + + my @laws = $station->laws->search({type => 'Jurisdiction'},{order_by => { -desc => 'date_enacted'}})->all; + + # If this is an IBS, we must remove soon-to-be out of range star seizures now instead + # of after downgrade, since that may make removing any others unnecessary and improper + if ($self->isa('Lacuna::DB::Result::Building::Module::IBS')) { + my $range_of_influence = $station->range_of_influence - 1000; + for (my $law_index = $#laws; $law_index >= 0; --$law_index ) { + my $law = $laws[$law_index]; + if ($station->calculate_distance_to_target($law->star) > $range_of_influence) { + $law->delete; + splice @laws, $law_index, 1; + } + } + } + my $influence_remaining = $station->influence_remaining - 1; - my $laws = $station->laws->search({type => 'Jurisdiction'},{order_by => { -desc => 'date_enacted'}}); - while (my $law = $laws->next) { + for my $law (@laws) { last if $influence_remaining >= 0; $law->delete; $influence_remaining++; -- 2.51.2 From b44a1f7e2fdbfeac3057b5f906fc3aef9f79e2cc Mon Sep 17 00:00:00 2001 From: ysth Date: Tue, 17 Apr 2012 00:03:59 -0700 Subject: [PATCH 32/45] Asteroids shouldn't have water --- lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm | 2 -- lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm | 2 -- lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm | 2 +- lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm | 2 -- lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm | 2 +- lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm | 2 -- 6 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm index fdfebbf1..97a3448e 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A12.pm @@ -47,8 +47,6 @@ use constant beryl => 313; use constant magnetite => 296; -use constant water => 289; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm index 9c3426a5..0999d9d3 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A17.pm @@ -9,8 +9,6 @@ use constant image => 'a17'; use constant beryl => 4233; -use constant water => 3800; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm index 2547816b..04cb6c8c 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A18.pm @@ -8,8 +8,8 @@ extends 'Lacuna::DB::Result::Map::Body::Asteroid'; use constant image => 'a18'; use constant trona => 3326; + use constant gypsum => 4120; -use constant water => 115; no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm index 89deab10..b18b7336 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A5.pm @@ -11,8 +11,6 @@ use constant fluorite => 1000; use constant gold => 8500; -use constant water => 500; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm index 88afb909..c54b48bc 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A6.pm @@ -8,8 +8,8 @@ extends 'Lacuna::DB::Result::Map::Body::Asteroid'; use constant image => 'a6'; use constant galena => 5790; + use constant kerogen => 40; -use constant water => 13; no Moose; diff --git a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm index 4e2b1892..c0e68da1 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Asteroid/A9.pm @@ -9,8 +9,6 @@ use constant image => 'a9'; use constant methane => 5500; -use constant water => 1700; - no Moose; __PACKAGE__->meta->make_immutable(inline_constructor => 0); -- 2.51.2 From 35f8cfa5e936dc42778784d539885fe4a3b64587 Mon Sep 17 00:00:00 2001 From: ysth Date: Tue, 17 Apr 2012 00:13:08 -0700 Subject: [PATCH 33/45] When parliament and SCC are losing their final efficiency, take into account that spy damage may have left efficiency at at a non-multiple of 25 --- lib/Lacuna/DB/Result/Map/Body/Planet.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index c69a922e..714183ed 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -2045,7 +2045,7 @@ sub complain_about_lack_of_resources { my $sc = $self->get_building_of_class('Lacuna::DB::Result::Building::Module::StationCommand'); if ($sc && $par) { if ($sc->level == $par->level) { - if ($sc->level == 1 && $sc->efficiency == 25 && $par->efficiency == 25) { + if ($sc->level == 1 && $sc->efficiency <= 25 && $par->efficiency <= 25) { # They go out together with a big bang $sc->spend_efficiency(25)->update; $building_name = $par->name; -- 2.51.2 From 43b3b55a4449265c9e9d21ce73ad4e2899b4390e Mon Sep 17 00:00:00 2001 From: ysth Date: Tue, 17 Apr 2012 00:16:24 -0700 Subject: [PATCH 34/45] On building theft, use actual downgrade function, triggering law repeals on influnce reduction --- lib/Lacuna/DB/Result/Building.pm | 8 +++++--- lib/Lacuna/DB/Result/Spies.pm | 7 ++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Lacuna/DB/Result/Building.pm b/lib/Lacuna/DB/Result/Building.pm index a27245e3..d666779d 100755 --- a/lib/Lacuna/DB/Result/Building.pm +++ b/lib/Lacuna/DB/Result/Building.pm @@ -628,7 +628,7 @@ sub can_downgrade { } sub downgrade { - my $self = shift; + my ($self, $theft) = @_; if ($self->level == 1) { $self->can_demolish; return $self->demolish; @@ -636,8 +636,10 @@ sub downgrade { $self->level( $self->level - 1); $self->update; my $body = $self->body; - $body->add_waste(sprintf('%.0f',$self->ore_to_build * $self->upgrade_cost)); - $body->spend_happiness(sprintf('%.0f',$self->food_to_build * $self->upgrade_cost)); + if (!$theft) { + $body->add_waste(sprintf('%.0f',$self->ore_to_build * $self->upgrade_cost)); + $body->spend_happiness(sprintf('%.0f',$self->food_to_build * $self->upgrade_cost)); + } $body->needs_recalc(1); $body->needs_surface_refresh(1); $body->update; diff --git a/lib/Lacuna/DB/Result/Spies.pm b/lib/Lacuna/DB/Result/Spies.pm index 0fcdacce..48906486 100644 --- a/lib/Lacuna/DB/Result/Spies.pm +++ b/lib/Lacuna/DB/Result/Spies.pm @@ -2134,11 +2134,8 @@ sub steal_building { my $max = ($self->level > 30) ? 30 : $self->level; my $level = randint(1, $max); $level = $building->level if ($level > $building->level); - $building->level( $building->level - 1 ); - $building->update; - $on_body->needs_recalc(1); - $on_body->needs_surface_refresh(1); - $on_body->update; + $building->body($on_body); + $building->downgrade(1); $self->from_body->add_plan($building->class, $level); $on_body->empire->send_predefined_message( tags => ['Spies','Alert'], -- 2.51.2 From a3092e1bcef7b22184c9a79857d077f8da29438b Mon Sep 17 00:00:00 2001 From: ysth Date: Wed, 18 Apr 2012 11:14:07 -0700 Subject: [PATCH 35/45] Send spies should check max berth level of ship's body, not the target --- lib/Lacuna/RPC/Building/SpacePort.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Lacuna/RPC/Building/SpacePort.pm b/lib/Lacuna/RPC/Building/SpacePort.pm index 6ef9bcfd..8879949c 100644 --- a/lib/Lacuna/RPC/Building/SpacePort.pm +++ b/lib/Lacuna/RPC/Building/SpacePort.pm @@ -347,11 +347,6 @@ sub send_spies { } $empire->current_session->check_captcha; - my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { - class => 'Lacuna::DB::Result::Building::SpacePort', - body_id => $to_body_id, - efficiency => 100, - } )->get_column('level')->max; # get the ship my $ship = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->find($ship_id); @@ -361,8 +356,13 @@ sub send_spies { unless ($ship->is_available) { confess [1010, "That ship is not available."]; } - unless ($ship->dock_size <= $max_level) { - confess [1010, "Your spaceport level is not high enough to support that ship."]; + my $max_level = Lacuna->db->resultset('Lacuna::DB::Result::Building')->search( { + class => 'Lacuna::DB::Result::Building::SpacePort', + body_id => $ship->body_id, + efficiency => 100, + } )->get_column('level')->max; + unless ($ship->berth_level <= $max_level) { + confess [1010, "Your spaceport level is not high enough to support a ship with a Berth Level of ".$ship->berth_level."."]; } # check size -- 2.51.2 From 34752a0c68225062f08c39173bf115da1b387808 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Thu, 19 Apr 2012 00:08:31 -0600 Subject: [PATCH 36/45] SQL for update. --- lib/Lacuna/DB/Result/Building/Archaeology.pm | 19 ++++++++++++------- lib/Lacuna/DB/Result/Ships/HulkHuge.pm | 12 ++++++------ var/upgrades/3.0848.sql | 1 + var/www/public/changes.txt | 4 ++-- 4 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 var/upgrades/3.0848.sql diff --git a/lib/Lacuna/DB/Result/Building/Archaeology.pm b/lib/Lacuna/DB/Result/Building/Archaeology.pm index 49373506..0f814fba 100644 --- a/lib/Lacuna/DB/Result/Building/Archaeology.pm +++ b/lib/Lacuna/DB/Result/Building/Archaeology.pm @@ -256,10 +256,10 @@ sub found_plan { my $plan_types = plans_of_type(); my $class; - my $rand_cat = randint(0,19); + my $rand_cat = randint(0,99); my $lvl = 1; my $plus = 0; - if ($rand_cat < 1) { + if ($rand_cat < 3) { $class = random_element($plan_types->{special}); if (randint(0,100) < int($level/3)) { $plus = randint(0, int($level/8)); @@ -268,9 +268,14 @@ sub found_plan { } } } - elsif ($rand_cat < 14) { + elsif ($rand_cat < 80) { $class = random_element($plan_types->{natural}); - $plus = randint(1, int($level/6)+1) if (randint(0,100) < int($level/2)); + if (randint(0,100) < int($level/2)) { + $plus = randint(0, int($level/6)); + if ($level == 30 && $plus > 0) { + $plus++; + } + } } else { $class = random_element($plan_types->{decor}); @@ -359,14 +364,14 @@ sub can_you_dig_it { my ($self, $body, $level, $arch) = @_; my $mult = $arch + 1; - my $plan = int($level/4 + 1) * $mult; # 1-8% * 2 + my $plan = int($level/4 + 1) * $mult; my $ore_total = 0; for my $ore (ORE_TYPES) { $ore_total += $body->$ore; } $ore_total = 10_000 if $ore_total > 10_000; - my $glyph = int($mult * $level * $ore_total/15_000)+1; # 1-20% (2x if arch run) +1 - my $resource = int(5/2 * $level); # 2-75% + my $glyph = int($mult * $level * $ore_total/20_000)+1; + my $resource = int(5/2 * $level); my $artifact = 0; if (!$arch && $body->buildings->count) { $artifact = 14; diff --git a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm index 78ab0ef9..133b6e9b 100644 --- a/lib/Lacuna/DB/Result/Ships/HulkHuge.pm +++ b/lib/Lacuna/DB/Result/Ships/HulkHuge.pm @@ -10,13 +10,13 @@ use constant prereq => [ { class=> 'Lacuna::DB::Result::Building use constant base_food_cost => 90000; use constant base_water_cost => 150000; use constant base_energy_cost => 15000000; -use constant base_ore_cost => 7500000; -use constant base_time_cost => 128000; -use constant base_waste_cost => 250000; -use constant base_speed => 420; +use constant base_ore_cost => 10000000; +use constant base_time_cost => 256000; +use constant base_waste_cost => 1000000; +use constant base_speed => 350; use constant base_stealth => 0; -use constant base_hold_size => 150000; -use constant base_berth_level => 30; +use constant base_hold_size => 170100; +use constant base_berth_level => 30; use constant pilotable => 1; use constant build_tags => [qw(Trade Mining)]; diff --git a/var/upgrades/3.0848.sql b/var/upgrades/3.0848.sql new file mode 100644 index 00000000..465ca226 --- /dev/null +++ b/var/upgrades/3.0848.sql @@ -0,0 +1 @@ +delete excavators, body from excavators INNER JOIN body on body.id = excavators.planet_id where excavators.empire_id != body.empire_id; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index e6355c5d..1e14cb5e 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,15 +1,15 @@ 3.0848: - Add: Hulk Large, Hulk Fast, Scow Fast, Scow Large, and Scow Mega Added. - - Mod: Berth Level less confusing than Dock Size. - Fix: Scows and Trade Ships limited to Spaceport Level determined by Berth. - Mod: Possible to have more than one building prereq for ships. - Mod: Scows don't have to be full to send. - Mod: All starting empires begin on a size 45 planet. - - Add: Added get_actions_for method for BHG. + - Add: Added get_actions_for method with BHG. - Add: BHG planets can now move into empty orbits. - Mod: Trade Summaries more compact. - Mod: Summarize Missions. - Fix: Excavators check to see if any excavators from empire are on way to body. + - Mod: Berth Level less confusing than Dock Size. 3.0847: - Add: New Scow and Hulk types added. -- 2.51.2 From e7c3e8b9dadcbedf8152d42d1a5646d40f625813 Mon Sep 17 00:00:00 2001 From: lemming552 Date: Thu, 19 Apr 2012 02:54:04 -0600 Subject: [PATCH 37/45] Put p21-40, a22-26 in Body & medals. Copied grahms fix from building.pm --- lib/Lacuna/DB/Result/Map/Body.pm | 32 ++++++++++++++++++++++++++++++-- lib/Lacuna/DB/Result/Medals.pm | 20 ++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/DB/Result/Map/Body.pm b/lib/Lacuna/DB/Result/Map/Body.pm index d2d8c7f8..47a35109 100644 --- a/lib/Lacuna/DB/Result/Map/Body.pm +++ b/lib/Lacuna/DB/Result/Map/Body.pm @@ -132,7 +132,9 @@ after 'sqlt_deploy_hook' => sub { $sqlt_table->add_index(name => 'idx_planet_search', fields => ['usable_as_starter_enabled','usable_as_starter']); }; -__PACKAGE__->typecast_map(class => { +{ + local *ensure_class_loaded = sub {}; # graham's crazy fix for circular dependency, may break if DynamicSubclass gets upgraded + __PACKAGE__->typecast_map(class => { 'Lacuna::DB::Result::Map::Body::Asteroid::A1' => 'Lacuna::DB::Result::Map::Body::Asteroid::A1', 'Lacuna::DB::Result::Map::Body::Asteroid::A2' => 'Lacuna::DB::Result::Map::Body::Asteroid::A2', 'Lacuna::DB::Result::Map::Body::Asteroid::A3' => 'Lacuna::DB::Result::Map::Body::Asteroid::A3', @@ -154,6 +156,11 @@ __PACKAGE__->typecast_map(class => { 'Lacuna::DB::Result::Map::Body::Asteroid::A19' => 'Lacuna::DB::Result::Map::Body::Asteroid::A19', 'Lacuna::DB::Result::Map::Body::Asteroid::A20' => 'Lacuna::DB::Result::Map::Body::Asteroid::A20', 'Lacuna::DB::Result::Map::Body::Asteroid::A21' => 'Lacuna::DB::Result::Map::Body::Asteroid::A21', + 'Lacuna::DB::Result::Map::Body::Asteroid::A22' => 'Lacuna::DB::Result::Map::Body::Asteroid::A22', + 'Lacuna::DB::Result::Map::Body::Asteroid::A23' => 'Lacuna::DB::Result::Map::Body::Asteroid::A23', + 'Lacuna::DB::Result::Map::Body::Asteroid::A24' => 'Lacuna::DB::Result::Map::Body::Asteroid::A24', + 'Lacuna::DB::Result::Map::Body::Asteroid::A25' => 'Lacuna::DB::Result::Map::Body::Asteroid::A25', + 'Lacuna::DB::Result::Map::Body::Asteroid::A26' => 'Lacuna::DB::Result::Map::Body::Asteroid::A26', 'Lacuna::DB::Result::Map::Body::Planet::P1' => 'Lacuna::DB::Result::Map::Body::Planet::P1', 'Lacuna::DB::Result::Map::Body::Planet::P2' => 'Lacuna::DB::Result::Map::Body::Planet::P2', 'Lacuna::DB::Result::Map::Body::Planet::P3' => 'Lacuna::DB::Result::Map::Body::Planet::P3', @@ -174,13 +181,34 @@ __PACKAGE__->typecast_map(class => { 'Lacuna::DB::Result::Map::Body::Planet::P18' => 'Lacuna::DB::Result::Map::Body::Planet::P18', 'Lacuna::DB::Result::Map::Body::Planet::P19' => 'Lacuna::DB::Result::Map::Body::Planet::P19', 'Lacuna::DB::Result::Map::Body::Planet::P20' => 'Lacuna::DB::Result::Map::Body::Planet::P20', + 'Lacuna::DB::Result::Map::Body::Planet::P21' => 'Lacuna::DB::Result::Map::Body::Planet::P21', + 'Lacuna::DB::Result::Map::Body::Planet::P22' => 'Lacuna::DB::Result::Map::Body::Planet::P22', + 'Lacuna::DB::Result::Map::Body::Planet::P23' => 'Lacuna::DB::Result::Map::Body::Planet::P23', + 'Lacuna::DB::Result::Map::Body::Planet::P24' => 'Lacuna::DB::Result::Map::Body::Planet::P24', + 'Lacuna::DB::Result::Map::Body::Planet::P25' => 'Lacuna::DB::Result::Map::Body::Planet::P25', + 'Lacuna::DB::Result::Map::Body::Planet::P26' => 'Lacuna::DB::Result::Map::Body::Planet::P26', + 'Lacuna::DB::Result::Map::Body::Planet::P27' => 'Lacuna::DB::Result::Map::Body::Planet::P27', + 'Lacuna::DB::Result::Map::Body::Planet::P28' => 'Lacuna::DB::Result::Map::Body::Planet::P28', + 'Lacuna::DB::Result::Map::Body::Planet::P29' => 'Lacuna::DB::Result::Map::Body::Planet::P29', + 'Lacuna::DB::Result::Map::Body::Planet::P30' => 'Lacuna::DB::Result::Map::Body::Planet::P30', + 'Lacuna::DB::Result::Map::Body::Planet::P31' => 'Lacuna::DB::Result::Map::Body::Planet::P31', + 'Lacuna::DB::Result::Map::Body::Planet::P32' => 'Lacuna::DB::Result::Map::Body::Planet::P32', + 'Lacuna::DB::Result::Map::Body::Planet::P33' => 'Lacuna::DB::Result::Map::Body::Planet::P33', + 'Lacuna::DB::Result::Map::Body::Planet::P34' => 'Lacuna::DB::Result::Map::Body::Planet::P34', + 'Lacuna::DB::Result::Map::Body::Planet::P35' => 'Lacuna::DB::Result::Map::Body::Planet::P35', + 'Lacuna::DB::Result::Map::Body::Planet::P36' => 'Lacuna::DB::Result::Map::Body::Planet::P36', + 'Lacuna::DB::Result::Map::Body::Planet::P37' => 'Lacuna::DB::Result::Map::Body::Planet::P37', + 'Lacuna::DB::Result::Map::Body::Planet::P38' => 'Lacuna::DB::Result::Map::Body::Planet::P38', + 'Lacuna::DB::Result::Map::Body::Planet::P39' => 'Lacuna::DB::Result::Map::Body::Planet::P39', + 'Lacuna::DB::Result::Map::Body::Planet::P40' => 'Lacuna::DB::Result::Map::Body::Planet::P40', 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G1' => 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G1', 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G2' => 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G2', 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G3' => 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G3', 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G4' => 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G4', 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G5' => 'Lacuna::DB::Result::Map::Body::Planet::GasGiant::G5', 'Lacuna::DB::Result::Map::Body::Planet::Station' => 'Lacuna::DB::Result::Map::Body::Planet::Station', -}); + }); +} # RELATIONSHIPS diff --git a/lib/Lacuna/DB/Result/Medals.pm b/lib/Lacuna/DB/Result/Medals.pm index 247b5db3..5fcd2ccb 100644 --- a/lib/Lacuna/DB/Result/Medals.pm +++ b/lib/Lacuna/DB/Result/Medals.pm @@ -133,6 +133,26 @@ use constant MEDALS => { P18 => 'Settled P18 Type Planet', P19 => 'Settled P19 Type Planet', P20 => 'Settled P20 Type Planet', + P21 => 'Settled P21 Type Planet', + P22 => 'Settled P22 Type Planet', + P23 => 'Settled P23 Type Planet', + P24 => 'Settled P24 Type Planet', + P25 => 'Settled P25 Type Planet', + P26 => 'Settled P26 Type Planet', + P27 => 'Settled P27 Type Planet', + P28 => 'Settled P28 Type Planet', + P29 => 'Settled P29 Type Planet', + P30 => 'Settled P30 Type Planet', + P31 => 'Settled P31 Type Planet', + P32 => 'Settled P32 Type Planet', + P33 => 'Settled P33 Type Planet', + P34 => 'Settled P34 Type Planet', + P35 => 'Settled P35 Type Planet', + P36 => 'Settled P36 Type Planet', + P37 => 'Settled P37 Type Planet', + P38 => 'Settled P38 Type Planet', + P39 => 'Settled P39 Type Planet', + P40 => 'Settled P40 Type Planet', G1 => 'Settled G1 Type Gas Giant', G2 => 'Settled G2 Type Gas Giant', G3 => 'Settled G3 Type Gas Giant', -- 2.51.2 From 708fc49a28aaa95ca3ef4efce4174c055c90214d Mon Sep 17 00:00:00 2001 From: lemming552 Date: Thu, 19 Apr 2012 21:29:42 -0600 Subject: [PATCH 38/45] Slight change to beginning planets. Also a test script adding more. --- bin/util/new_starters.pl | 101 ++++++++++++++++++++++++ lib/Lacuna/DB/Result/Empire.pm | 1 + lib/Lacuna/DB/Result/Map/Body/Planet.pm | 5 +- 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 bin/util/new_starters.pl diff --git a/bin/util/new_starters.pl b/bin/util/new_starters.pl new file mode 100644 index 00000000..16f2da1f --- /dev/null +++ b/bin/util/new_starters.pl @@ -0,0 +1,101 @@ +# Setting more starter planets in the center zones. More likely, the closer to 0,0 the body is. +use 5.010; +use strict; +use lib '/data/Lacuna-Server/lib'; +use Lacuna::DB; +use Lacuna; +use Lacuna::Util qw(randint format_date); +use Getopt::Long; +$|=1; +our $quiet; +GetOptions( + 'quiet' => \$quiet, +); + + +out('Started'); +my $start = time; + +out('Loading DB'); +our $db = Lacuna->db; + +out('Reviewing planets'); +my $planets_rs = $db->resultset('Lacuna::DB::Result::Map::Body'); +my @planets = $planets_rs->search( { + empire_id => undef, + orbit => {'!=' => 8}, + size => {'>=' => 30}, + size => {'<=' => 50}, + } + )->get_column('id')->all; +out('Found '.scalar @planets.' planets.'); +my $old_s = 0; my $new_s = 0; my $unch = 0; +foreach my $id (@planets) { + my $planet = $planets_rs->find($id); + next unless ($planet->get_type eq 'habitable planet'); + next unless ($planet->zone ~~ ['1|1','1|-1','-1|1','-1|-1','0|0','0|1','1|0','-1|0','0|-1']); + + my $orbit = $planet->orbit; + my $start_val = 80 - sqrt($planet->y**2 + $planet->x**2)/10; + if ($orbit == 3) { + $start_val = int(0.9 * $start_val); + } + elsif ($orbit == 4) { + $start_val = int(0.7 * $start_val); + } + elsif ($orbit == 5 or $orbit == 6) { + $start_val = int(0.6 * $start_val); + } + elsif ($orbit == 1 or $orbit == 7) { + $start_val = int(0.4 * $start_val); + } + my $start_enb = (randint(0,99) < $start_val) ? 1 : 0; + my $old_val = $planet->usable_as_starter; + my $old_enb = $planet->usable_as_starter_enabled; + +# If old start, then leave alone + if ($old_enb) { + $old_s++; + out( sprintf("%30s OL:%4d-%d nv:%2d-%d o:%s (%4d,%4d) Z:%5s %s", + $planet->name, + $old_val, $old_enb, + $start_val, $start_enb, + $planet->orbit, + $planet->x, $planet->y, + $planet->zone, + $planet->get_type, + )); + } + elsif ($start_enb) { + $new_s++; + out( sprintf("%30s oo:%4d-%d NN:%2d-%d o:%s (%4d,%4d) Z:%5s %s", + $planet->name, + $old_val, $old_enb, + $start_val, $start_enb, + $planet->orbit, + $planet->x, $planet->y, + $planet->zone, + $planet->get_type, + )); + } + else { + $unch++; + } +} + +my $finish = time; +out('Finished'); +out((($finish - $start)/60)." minutes have elapsed"); +out(sprintf("%6d Planets checked, %6d added, %6d old, %6d unch", scalar @planets, $new_s, $old_s, $unch)); + + +############### +## SUBROUTINES +############### + +sub out { + my $message = shift; + unless ($quiet) { + say format_date(DateTime->now), " ", $message; + } +} diff --git a/lib/Lacuna/DB/Result/Empire.pm b/lib/Lacuna/DB/Result/Empire.pm index 9da52c3b..8c1b9d70 100644 --- a/lib/Lacuna/DB/Result/Empire.pm +++ b/lib/Lacuna/DB/Result/Empire.pm @@ -507,6 +507,7 @@ sub find_home_planet { my %search = ( usable_as_starter_enabled => 1, orbit => { between => [ $self->min_orbit, $self->max_orbit] }, + empire_id => undef, ); # determine search area diff --git a/lib/Lacuna/DB/Result/Map/Body/Planet.pm b/lib/Lacuna/DB/Result/Map/Body/Planet.pm index 714183ed..487095a7 100644 --- a/lib/Lacuna/DB/Result/Map/Body/Planet.pm +++ b/lib/Lacuna/DB/Result/Map/Body/Planet.pm @@ -140,7 +140,10 @@ sub sanitize { Lacuna->db->resultset('Lacuna::DB::Result::MercenaryMarket')->search({body_id => $self->id})->delete_all; Lacuna->db->resultset('Lacuna::DB::Result::Probes')->search({body_id => $self->id})->delete; $self->empire_id(undef); - if ($self->get_type eq 'habitable planet' && $self->size >= 40 && $self->size <= 50 && $self->zone ~~ ['1|1','1|-1','-1|1','-1|-1','0|0','0|1','1|0','-1|0','0|-1']) { + if ($self->get_type eq 'habitable planet' && + $self->size >= 40 && $self->size <= 50 && + $self->orbit != 8 && + $self->zone ~~ ['1|1','1|-1','-1|1','-1|-1','0|0','0|1','1|0','-1|0','0|-1']) { $self->usable_as_starter_enabled(1); } $self->update; -- 2.51.2 From d971fd421ecc457e90ba89875db9ea1d9d0106cf Mon Sep 17 00:00:00 2001 From: lemming552 Date: Thu, 19 Apr 2012 22:00:02 -0600 Subject: [PATCH 39/45] alliance map adjustment. --- var/www/public/starmap/index.html | 54 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/var/www/public/starmap/index.html b/var/www/public/starmap/index.html index fd542238..9f8dce99 100644 --- a/var/www/public/starmap/index.html +++ b/var/www/public/starmap/index.html @@ -66,7 +66,7 @@ $(function () { var key = keylist[idx]; var val = starmap.alliances[key]; if (key < '0') { - // by default only check the Saben + // by default only check the AI choiceContainer.append('
' + '