diff --git a/bin/tick_fissures.pl b/bin/tick_fissures.pl index b1609612..13d9711e 100644 --- a/bin/tick_fissures.pl +++ b/bin/tick_fissures.pl @@ -411,8 +411,8 @@ sub fissure_explode { } last GASSY if (++$grown >= 5); } - if ($body->in_neutral_area) { - out("Skipping damage to other planets because origin in Neutral Area."); + if ($body->in_neutral_area or $body->in_starter_zone) { + out("Skipping damage to other planets because origin in Neutral or Starting Area."); return; } # Damage planets in range (damage depends upon distance from the event) @@ -434,7 +434,7 @@ sub fissure_explode { my $damaged = 0; DAMAGED: while (my $to_damage = $closest->next) { - next if ($to_damage->in_neutral_area); + next if ($to_damage->in_neutral_area or $to_damage->in_starter_zone); next if ($to_damage->get_type eq 'space station'); # Since supply chains etc, will probably be damaged, they'll still be threatened. next unless ($to_damage->empire->date_created < DateTime->now->subtract(days => 60)); # damage planet @@ -446,6 +446,16 @@ sub fissure_explode { my $distance = $to_damage->get_column('distance'); my $damage = int(100 - $distance); $damage = int($damage/2) if ($to_damage->get_type eq 'gas giant'); # Gas Giants are more resiliant or more spread out. + my $citadel = $to_damage->get_building_of_class("Lacuna::DB::Result::Building::Permanent::CitadelOfKnope"); + if ($citadel) { + my $reduction = 2 * $citadel->level; + $damage -= $reduction; + if ($damage < 1) { + out(" Citadel causes all debris to bypass."); + next; + } + out (" Citadel reduces damage by $reduction."); + } $damage = 1 if $damage < 1; out(" Causing an average of $damage damage to each building"); my @all_buildings = @{$to_damage->building_cache}; diff --git a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm index 269ab049..77928e6b 100644 --- a/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm +++ b/lib/Lacuna/RPC/Building/BlackHoleGenerator.pm @@ -232,6 +232,7 @@ sub no_occ_or_nonally { my @stripped; for my $check (@$checking) { next if $check->empire_id; + next if ($check->get_buildings_of_class('Lacuna::DB::Result::Building::Permanent::Fissure')); if ( defined($check->star->station_id)) { if ($check->star->station->empire->alliance_id == $aid) { push @stripped, $check; @@ -667,6 +668,14 @@ sub generate_singularity { $allowed = 1; } } + if ($body->get_buildings_of_class('Lacuna::DB::Result::Building::Permanent::Fissure')) { + $confess = sprintf("%s can not be moved without tearing apart from the fissure on it.", $body->name); + $allowed = 0; + } + elsif ($target->get_buildings_of_class('Lacuna::DB::Result::Building::Permanent::Fissure')) { + $confess = sprintf("%s can not be moved without tearing apart from the fissure on it.", $target->name); + $allowed = 0; + } unless ($allowed) { confess [ 1010, $confess ]; } @@ -686,6 +695,11 @@ sub generate_singularity { # Let's check all planets in our system and target system qualify_moving_sys($building, $target); } + elsif ( $task->{name} eq 'Jump Zone' ) { + if ($body->get_buildings_of_class('Lacuna::DB::Result::Building::Permanent::Fissure')) { + confess [1009, sprintf("%s can not be moved without tearing apart from the fissure on it.", $body->name) ]; + } + } $body->spend_waste($task->{waste_cost})->update; $building->start_work({}, $task->{recovery})->update; @@ -873,6 +887,9 @@ sub qualify_moving_sys { } } } + if ($body->get_buildings_of_class('Lacuna::DB::Result::Building::Permanent::Fissure')) { + confess [1009, 'You can not move a body with a fissure on it.']; + } } return 1; } diff --git a/var/www/public/changes.txt b/var/www/public/changes.txt index a9750cf6..c4de63db 100644 --- a/var/www/public/changes.txt +++ b/var/www/public/changes.txt @@ -1,5 +1,8 @@ 3.0893: - Fix: Closed starter zone loophole. + - Mod: Citadel now repels planetary debris. + - Mod: Fissures are too unstable to move. + - Mod: Fissures in starter zones don't cause damage. 3.0892: - Fix: Fix schedule to remove past jobs when rescheduling.