diff --git a/lib/Lacuna/DB/Result/Excavators.pm b/lib/Lacuna/DB/Result/Excavators.pm index d3ef0ecb..8a207762 100644 --- a/lib/Lacuna/DB/Result/Excavators.pm +++ b/lib/Lacuna/DB/Result/Excavators.pm @@ -10,7 +10,7 @@ __PACKAGE__->add_columns( planet_id => { data_type => 'int', size => 11, is_nullable => 0 }, body_id => { data_type => 'int', size => 11, is_nullable => 0 }, empire_id => { data_type => 'int', size => 11, is_nullable => 0 }, - date_started => { data_type => 'datetime', is_nullable => 0, set_on_create => 1 }, + date_landed => { data_type => 'datetime', is_nullable => 0, set_on_create => 1 }, ); __PACKAGE__->belongs_to('body', 'Lacuna::DB::Result::Map::Body', 'body_id'); diff --git a/lib/Lacuna/RPC/Building/Archaeology.pm b/lib/Lacuna/RPC/Building/Archaeology.pm index d402cef3..d644463f 100644 --- a/lib/Lacuna/RPC/Building/Archaeology.pm +++ b/lib/Lacuna/RPC/Building/Archaeology.pm @@ -1,5 +1,6 @@ package Lacuna::RPC::Building::Archaeology; +use Lacuna::Util qw(format_date); use Moose; use utf8; no warnings qw(uninitialized); @@ -143,7 +144,7 @@ sub view_excavators { glyph => $chances->{glyph}, plan => $chances->{plan}, resource => $chances->{resource}, - date_landed => $building->date_created, + date_landed => format_date($building->date_created), }; my $excavators = $building->excavators; my $travel = Lacuna->db->resultset('Lacuna::DB::Result::Ships') @@ -158,7 +159,7 @@ sub view_excavators { glyph => $chances->{glyph}, plan => $chances->{plan}, resource => $chances->{resource}, - date_landed => $excav->date_landed, + date_landed => format_date($excav->date_landed), }; } return { diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index c2cb8571..df6387ee 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -718,13 +718,13 @@ sub generate_singularity { { rows => 1, order_by => 'rand()' } )->single; if (defined $lock_down) { - my $power = $lock_down->mayhem_xp + $lock_down->offensive + my $power = $lock_down->mayhem_xp + $lock_down->offense; my $defense = 0; my $hq = $body->get_building_of_class('Lacuna::DB::Result::Building::Security'); if (defined $hq) { - $defense = int($hq->level * $hq->efficiency /2 + 0.5); + $defense = $hq->level * $hq->efficiency; } - my $breakthru = int(($power - $defense + $lock_down->luck)/100 + 0.5); + my $breakthru = int(($power - $defense + $lock_down->luck)/100 + 0.5)+50; $breakthru = 5 if $breakthru < 5; $breakthru = 95 if $breakthru > 95; my $failure = 0; @@ -736,7 +736,7 @@ sub generate_singularity { $failure = 1; } else { - $breakthru = $breaktru/2; + $breakthru = $breakthru/2; } my $caught = randint(0,99); if ($caught > $breakthru) { @@ -802,7 +802,7 @@ sub generate_singularity { elsif ($spy_cond eq "Escaped") { $o_message = sprintf("Our BHG on %s misfired today. We suspect enemy action.", $body->name); - $e_message = sprintf("%s was successful on %s in preventing the BHG to be used, %s suspect nothing.", + $e_message = sprintf("%s was successful on %s in preventing the BHG to be used, %s suspects nothing.", $lock_down->name, $body->name, $body->empire->name); } elsif ($spy_cond eq "Unconscious") { @@ -852,7 +852,7 @@ sub generate_singularity { $lock_down->empire->send_predefined_message( tags => ['Spies','Alert'], filename => 'bhg_sabotage_them.txt', - params => [$o_message], + params => [$e_message], ); if ($spy_cond eq "Killed") { $lock_down->available_on(DateTime->now->add(years => 5)); @@ -862,7 +862,7 @@ sub generate_singularity { $lock_down->available_on(DateTime->now->add(days=>7)); $lock_down->task('Captured'); $lock_down->started_assignment(DateTime->now); - $lock_down->times_captured( $self->times_captured + 1 ); + $lock_down->times_captured( $lock_down->times_captured + 1 ); } elsif ($spy_cond eq "Squeek" or $spy_cond eq "Escaped") { }