X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=ND%2FWeb%2FPages%2FRaids.pm;h=7bcb1f4e633d0ce13a4498c056cdbb10f4c6508c;hb=f6cfe40e6a8da61229131a2d38a2535ae66da359;hp=c46571288cd3c836d8135ebdcb9e7506fe91b5dd;hpb=1b004bbdd43ed9eede52625393c7db5face926bf;p=ndwebbie.git diff --git a/ND/Web/Pages/Raids.pm b/ND/Web/Pages/Raids.pm index c465712..7bcb1f4 100644 --- a/ND/Web/Pages/Raids.pm +++ b/ND/Web/Pages/Raids.pm @@ -63,7 +63,6 @@ sub generateClaimXml : method { while (my $target = $targets->fetchrow_hashref){ my %target; $target{Id} = $target->{id}; - $target{Coords} = $target->{id}; my @waves; for (my $i = 1; $i <= $raid->{waves}; $i++){ my %wave; @@ -83,9 +82,6 @@ sub generateClaimXml : method { $claimers = join '/', @claimers; if ($owner){ $wave{Command} = 'Unclaim'; - if ($raid->{released_coords}){ - $target{Coords} = $DBH->selectrow_array('SELECT coords(x,y,z) FROM current_planet_stats WHERE id = ?',undef,$target->{planet}); - } }elsif ($joinable){ $wave{Command} = 'Join'; }else{ @@ -224,7 +220,7 @@ sub render_body { $target{comment} = parseMarkup($target->{comment}) if ($target->{comment}); my $scans = $DBH->prepare(q{SELECT DISTINCT ON (type) type, tick, scan FROM scans - WHERE planet = ? AND type ~ 'Unit|Planet|Military|.* Analysis' AND tick + 24 > tick() AND scan is not null + WHERE planet = ? AND type ~ 'Unit|Planet|Advanced Unit|.* Analysis' AND tick + 24 > tick() AND scan is not null GROUP BY type, tick, scan ORDER BY type ,tick DESC}); $scans->execute($target->{planet}); my %scans; @@ -233,7 +229,7 @@ sub render_body { } my @scans; - for my $type ('Planet','Unit','Military','Surface Analysis','Technology Analysis'){ + for my $type ('Planet','Unit','Advanced Unit','Surface Analysis','Technology Analysis'){ next unless exists $scans{$type}; my $scan = $scans{$type}; if ($self->{TICK} - $scan->{tick} > 5){ @@ -251,6 +247,8 @@ sub render_body { if ($planet->{x} == $target->{x}){ $target{style} = 'incluster'; } + $target{ScoreBash} = 'bash' if ($target->{score}/$planet->{score} < 0.4); + $target{ValueBash} = 'bash' if ($target->{value}/$planet->{value} < 0.4); } my @roids; @@ -259,7 +257,7 @@ sub render_body { for (my $i = 1; $i <= $raid->{waves}; $i++){ my $roids = floor(0.25*$size); $size -= $roids; - my $xp; + my $xp = 0; if ($planet){ $xp = max(0,floor($roids * 10 * (min(2,$target{Score}/$planet->{score}) + min(2,$target{Value}/$planet->{value})-1))); }