New Moose Structure + Created New Update Mission Method

This commit is contained in:
FlightControl
2016-05-25 11:00:30 +02:00
parent 2a97df7ef9
commit 6a43e9da80
152 changed files with 16809 additions and 517 deletions

View File

@@ -0,0 +1,79 @@
--- ZONE Classes
-- @module Zone
Include.File( "Routines" )
Include.File( "Base" )
Include.File( "Message" )
--- The ZONE class
-- @type ZONE
-- @Extends Base#BASE
ZONE = {
ClassName="ZONE",
}
function ZONE:New( ZoneName )
local self = BASE:Inherit( self, BASE:New() )
self:F( ZoneName )
local Zone = trigger.misc.getZone( ZoneName )
if not Zone then
error( "Zone " .. ZoneName .. " does not exist." )
return nil
end
self.Zone = Zone
self.ZoneName = ZoneName
return self
end
function ZONE:GetPointVec2()
self:F( self.ZoneName )
local Zone = trigger.misc.getZone( self.ZoneName )
local Point = { x = Zone.point.x, y = Zone.point.z }
self:T( { Zone, Point } )
return Point
end
function ZONE:GetPointVec3( Height )
self:F( self.ZoneName )
local Zone = trigger.misc.getZone( self.ZoneName )
local Point = { x = Zone.point.x, y = land.getHeight( self:GetPointVec2() ) + Height, z = Zone.point.z }
self:T( { Zone, Point } )
return Point
end
function ZONE:GetRandomPointVec2()
self:F( self.ZoneName )
local Point = {}
local Zone = trigger.misc.getZone( self.ZoneName )
local angle = math.random() * math.pi*2;
Point.x = Zone.point.x + math.cos( angle ) * math.random() * Zone.radius;
Point.y = Zone.point.z + math.sin( angle ) * math.random() * Zone.radius;
self:T( { Zone, Point } )
return Point
end
function ZONE:GetRadius()
self:F( self.ZoneName )
local Zone = trigger.misc.getZone( self.ZoneName )
self:T( { Zone } )
return Zone.radius
end