]> ruin.nu Git - ndwebbie.git/blobdiff - ND/Web/Pages/Raids.pm
possible to hide targets below bash limits, if we chose to
[ndwebbie.git] / ND / Web / Pages / Raids.pm
index eddd7c8935e7de626374bf4b606d12d98321470d..afb91c1adb64501481b5f643837489755edc570d 100644 (file)
@@ -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{
@@ -207,6 +203,14 @@ sub render_body {
                my @targets;
                while (my $target = $targetquery->fetchrow_hashref){
                        my %target;
+                       if ($planet){
+                               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);
+                               #next if ($target->{score}/$planet->{score} < 0.4) && ($target->{value}/$planet->{value} < 0.4);
+                       }
                        $target{Id} = $target->{id};
                        $target{Race} = $target->{race};
                        my $num = pow(10,length($target->{score})-2);
@@ -247,11 +251,6 @@ sub render_body {
                        }
                        $target{Scans} = \@scans;
 
-                       if ($planet){
-                               if ($planet->{x} == $target->{x}){
-                                       $target{style} = 'incluster';
-                               }
-                       }
 
                        my @roids;
                        my @claims;
@@ -259,9 +258,9 @@ 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)));
+                                       $xp = pa_xp($roids,$planet->{score},$planet->{value},$target{Score},$target{Value});
                                }
                                push @roids,{Wave => $i, Roids => $roids, XP => $xp};
                                if ($self->{AJAX}){