All pastes #135087 Raw Edit

Mines! Mines!

public text v1 · immutable
#135087 ·published 2006-08-16 18:03 UTC
rendered paste body
#Global Hooks

$Simulation:

[

--Get all weapons
for i=1,mn.getNumWeapons() do
   weapon = mn.getWeaponByIndex(i)
   weapontype = weapon.Class.Name

   --Select only mines
   if weapontype == "Helios" then
      weaponlife = weapon.LifeLeft

      --Select only those mines that have been activated (time activation)
      if weaponlife < 25 then
         weaponteam = weapon.Team

         --Start building distance array
         for m=1,mn.getNumShips() do
            ship = mn.getShipByIndex(m)
            shipteam = ship.Team
            weaponposition = weapon.Position
            shipposition = ship.Position
            shipdistance = weaponposition:getDistance(shipposition)

            if shipteam ~= weaponteam and shipdistance < 1000 then
               weapon.LifeLeft = 0
            end
         end
      end
   end
end

]

#End