diff --git a/lib/Lacuna/DB/Result/Building/Energy/Waste.pm b/lib/Lacuna/DB/Result/Building/Energy/Waste.pm index b8b1112b..d67dcb1e 100644 --- a/lib/Lacuna/DB/Result/Building/Energy/Waste.pm +++ b/lib/Lacuna/DB/Result/Building/Energy/Waste.pm @@ -4,6 +4,7 @@ use Moose; use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Building::Energy'; +with 'Lacuna::Role::WasteProcessor'; around 'build_tags' => sub { my ($orig, $class) = @_; diff --git a/lib/Lacuna/DB/Result/Building/Waste.pm b/lib/Lacuna/DB/Result/Building/Waste.pm index de2bd15d..c087a667 100644 --- a/lib/Lacuna/DB/Result/Building/Waste.pm +++ b/lib/Lacuna/DB/Result/Building/Waste.pm @@ -4,6 +4,7 @@ use Moose; use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Building'; +with 'Lacuna::Role::WasteProcessor'; around 'build_tags' => sub { my ($orig, $class) = @_; diff --git a/lib/Lacuna/DB/Result/Building/Water/Reclamation.pm b/lib/Lacuna/DB/Result/Building/Water/Reclamation.pm index 45dd4ae5..7f542e75 100644 --- a/lib/Lacuna/DB/Result/Building/Water/Reclamation.pm +++ b/lib/Lacuna/DB/Result/Building/Water/Reclamation.pm @@ -4,6 +4,7 @@ use Moose; use utf8; no warnings qw(uninitialized); extends 'Lacuna::DB::Result::Building::Water'; +with 'Lacuna::Role::WasteProcessor'; around 'build_tags' => sub { my ($orig, $class) = @_; diff --git a/lib/Lacuna/Role/WasteProcessor.pm b/lib/Lacuna/Role/WasteProcessor.pm new file mode 100644 index 00000000..3b9b8fb1 --- /dev/null +++ b/lib/Lacuna/Role/WasteProcessor.pm @@ -0,0 +1,27 @@ +package Lacuna::Role::WasteProcessor; + +use Moose::Role; + + +sub ore_production_hour { + my ($self) = @_; + my $base = $self->ore_production * $self->production_hour * ($self->body->total_ore_concentration / 10000); + return 0 if $base == 0; + return sprintf('%.0f', $base * $self->manufacturing_production_bonus); +} + +sub energy_production_hour { + my ($self) = @_; + my $base = $self->energy_production * $self->production_hour; + return 0 if $base == 0; + return sprintf('%.0f', $base * $self->manufacturing_production_bonus); +} + +sub water_production_hour { + my ($self) = @_; + my $base = $self->water_production * $self->production_hour; + return 0 if $base == 0; + return sprintf('%.0f', $base * $self->manufacturing_production_bonus); +} + +1; diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index 3cdb54e9..e553eb7a 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,12 +1,22 @@ 2.4400 - - Rule: Environmental affinity now adds 5% per level to waste and water storage capacity. - - Rule: Mining affinity now adds 5% per level to ore storage capacity. - - Rule: Farming affinity now adds 5% per level to food storage capacity. - - Rule: Science affinity now adds 5% per level to energy storage capacity. + - Add: Configurable settings for Tournament Server play. + - Rule: Environmental affinity now adds 4% per level to waste and water storage capacity. + - Rule: Mining affinity now adds 4% per level to ore storage capacity. + - Rule: Farming affinity now adds 4% per level to food storage capacity. + - Rule: Science affinity now adds 4% per level to energy storage capacity. + - Rule: Farming affinity now increases food production 4% per level instead of 3%. + - Rule: Mining affinity now increases ore production 4% per level instead of 3%. + - Rule: Science affinity now increases energy production 4% per level instead of 3%. + - Rule: Environmental affinity now increases water production 4% per level instead of 3%. + - Rule: Environmental affinity now increases waste consumption 4% per level instead of 1%. - Rule: Management affinity now reduces building build times by 5% per level instead of 3%. + - Rule: Manufacturing affinity now reduces ship build costs by 5% per level instead of 1%. + - Rule: Research affinity now reduces building build costs by 5% per level instead of 1%. - Rule: Genetics lab now requires 1 level for each point you graft on to your species. - Rule: SAW protects all allied planets in the same star system. - Fix: Abducted operatives didn't stay prisoners long enough. + - Fix: Farming affinity was being applied to manufactured foods instead of manufacturing affinity. + - Fix: Environmental/Science/Mining affinity was being applied to waste conversion buildings instead of manufacturing affinity. 2.4301 - Fixed counter intel reports being signed by wrong agent.