Skip to content

Commit

Permalink
Stars as target non-grouping.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemming552 committed Mar 27, 2015
1 parent bbe19aa commit 6a3cee6
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bin/puppet/setup_colony.pl
Expand Up @@ -41,6 +41,8 @@
}
print "Really!\n";
if ($sanitize) {
my @all_buildings = @{$body->building_cache};
$body->delete_buildings(\@all_buildings);
$body->sanitize;
}
print "Checking empire\n";
Expand Down
5 changes: 4 additions & 1 deletion lib/Lacuna/DB/Result/Ships.pm
Expand Up @@ -436,7 +436,10 @@ sub send {
my $end_range = DateTime->now->add(seconds => ($seconds2arrive + $sec_rng));
my $ships_rs;
my $ag_chk = 0;
if ( grep { $self->type eq $_ } @ag_list ) {
if ($target->isa('Lacuna::DB::Result::Map::Star')) {
$ag_chk = 0; #Just an empty statement.
}
elsif ( grep { $self->type eq $_ } @ag_list ) {
$ships_rs = Lacuna->db->resultset('Lacuna::DB::Result::Ships')->search({
id => { '!=' => $self->id },
body_id => $self->body_id,
Expand Down
1 change: 1 addition & 0 deletions lib/Lacuna/DB/Result/Ships/AttackGroup.pm
Expand Up @@ -25,6 +25,7 @@ with "Lacuna::Role::Ship::Arrive::DeployBleeder";
with "Lacuna::Role::Ship::Arrive::DeploySmolderingCrater";
with "Lacuna::Role::Ship::Arrive::ScanSurface";
with "Lacuna::Role::Ship::Arrive::SurveySurface";
with "Lacuna::Role::Ship::Arrive::DestroyMinersExcavators";
with "Lacuna::Role::Ship::Arrive::GroupHome";

no Moose;
Expand Down
1 change: 1 addition & 0 deletions lib/Lacuna/RPC/Building/SpacePort.pm
Expand Up @@ -380,6 +380,7 @@ sub send_ship_types {
number_of_docks => 0,
};
my $payload;
$ag_chk = 0 if ($target->isa('Lacuna::DB::Result::Map::Star'));

foreach my $ship (values %$ship_ref) {
if ($ag_chk > 1 and grep { $ship->type eq $_ } @ag_list) {
Expand Down
26 changes: 26 additions & 0 deletions lib/Lacuna/Role/Ship/Arrive/DestroyMinersExcavators.pm
Expand Up @@ -14,6 +14,32 @@ after handle_arrival_procedures => sub {
my $is_uninhabit = ($body_attacked->isa('Lacuna::DB::Result::Map::Body::Planet') and !(defined($body_attacked->empire_id)) );
# not an asteroid or uninhabited planet
return unless ( $self->foreign_body_id && ($is_asteroid || $is_uninhabit));
my $do_boom = 0;
my $done_after = 1;
if ($self->type eq "attack_group") {
my $payload = $self->payload;
my @trim;
for my $fleet (keys %{$payload->{fleet}}) {
if ($payload->{fleet}->{$fleet}->{type} eq "detonators") {
$do_boom = 1;
push @trim, $fleet;
}
else {
$done_after = 0;
}
}
if ($done_after == 0 and $do_scan) {
for my $key (@trim) {
delete $payload->{fleet}->{$key};
}
$self->payload($payload);
$self->update;
}
}
else {
$do_boom = 1;
}
return unless $do_boom;

my $logs = Lacuna->db->resultset('Lacuna::DB::Result::Log::Battles');
my $mcount = 0;
Expand Down
3 changes: 2 additions & 1 deletion var/www/public/changes.txt
Expand Up @@ -3,7 +3,8 @@
- Add: view_unread Inbox API
- Add: Stations auto-seize
- Add: Voting allowed in embassy
- Fix: Detonators do not group when sent toward different stars.
- Fix: If star is a target, no grouping.
- Fix: Detonators work properly on arrival.

3.0909:
- Add: Admin UI to set alliance logo.
Expand Down

0 comments on commit 6a3cee6

Please sign in to comment.