mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
SPOT
- Fixed bug in LaseOnCoordinate. - Minor stuff.
This commit is contained in:
parent
2a7b9cf898
commit
376a3553fa
@ -1617,7 +1617,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
--- Check if the Squadron is visible before startup of the dispatcher.
|
--- Check if the Squadron is visible before startup of the dispatcher.
|
||||||
-- @param #AI_A2A_DISPATCHER self
|
-- @param #AI_A2A_DISPATCHER self
|
||||||
-- @param #string SquadronName The squadron name.
|
-- @param #string SquadronName The squadron name.
|
||||||
-- @return #bool true if visible.
|
-- @return #boolean true if visible.
|
||||||
-- @usage
|
-- @usage
|
||||||
--
|
--
|
||||||
-- -- Set the Squadron visible before startup of dispatcher.
|
-- -- Set the Squadron visible before startup of dispatcher.
|
||||||
@ -2733,7 +2733,7 @@ do -- AI_A2A_DISPATCHER
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
--- Activate resource.
|
||||||
-- @param #AI_A2A_DISPATCHER self
|
-- @param #AI_A2A_DISPATCHER self
|
||||||
function AI_A2A_DISPATCHER:ResourceActivate( DefenderSquadron, DefendersNeeded )
|
function AI_A2A_DISPATCHER:ResourceActivate( DefenderSquadron, DefendersNeeded )
|
||||||
|
|
||||||
|
|||||||
@ -558,6 +558,10 @@ do -- SET_BASE
|
|||||||
--- Iterate the SET_BASE and derived classes and call an iterator function for the given SET_BASE, providing the Object for each element within the set and optional parameters.
|
--- Iterate the SET_BASE and derived classes and call an iterator function for the given SET_BASE, providing the Object for each element within the set and optional parameters.
|
||||||
-- @param #SET_BASE self
|
-- @param #SET_BASE self
|
||||||
-- @param #function IteratorFunction The function that will be called.
|
-- @param #function IteratorFunction The function that will be called.
|
||||||
|
-- @param #table arg Arguments of the IteratorFunction.
|
||||||
|
-- @param #SET_BASE Set (Optional) The set to use. Default self:GetSet().
|
||||||
|
-- @param #function Function (Optional) A function returning a #boolean true/false. Only if true, the IteratorFunction is called.
|
||||||
|
-- @param #table FunctionArguments (Optional) Function arguments.
|
||||||
-- @return #SET_BASE self
|
-- @return #SET_BASE self
|
||||||
function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArguments )
|
function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArguments )
|
||||||
self:F3( arg )
|
self:F3( arg )
|
||||||
@ -571,7 +575,7 @@ do -- SET_BASE
|
|||||||
local Object = ObjectData
|
local Object = ObjectData
|
||||||
self:T3( Object )
|
self:T3( Object )
|
||||||
if Function then
|
if Function then
|
||||||
if Function( unpack( FunctionArguments ), Object ) == true then
|
if Function( unpack( FunctionArguments or {} ), Object ) == true then
|
||||||
IteratorFunction( Object, unpack( arg ) )
|
IteratorFunction( Object, unpack( arg ) )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
@ -285,11 +285,8 @@ do
|
|||||||
|
|
||||||
local RecceDcsUnit = self.Recce:GetDCSObject()
|
local RecceDcsUnit = self.Recce:GetDCSObject()
|
||||||
|
|
||||||
local aimat=Coordinate
|
self.SpotIR = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 1, z = 0 }, Coordinate:GetVec3() )
|
||||||
aimat.y=aimat.y+1
|
self.SpotLaser = Spot.createLaser( RecceDcsUnit, { x = 0, y = 1, z = 0 }, Coordinate:GetVec3(), LaserCode )
|
||||||
|
|
||||||
self.SpotIR = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, aimat:GetVec3() )
|
|
||||||
self.SpotLaser = Spot.createLaser( RecceDcsUnit, { x = 0, y = 2, z = 0 }, aimat:GetVec3(), LaserCode )
|
|
||||||
|
|
||||||
if Duration then
|
if Duration then
|
||||||
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
|
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
|
||||||
@ -323,14 +320,14 @@ do
|
|||||||
self:__Lasing( -0.2 )
|
self:__Lasing( -0.2 )
|
||||||
elseif self.TargetCoord then
|
elseif self.TargetCoord then
|
||||||
|
|
||||||
local aimat=self.TargetCoord --Core.Point#COORDINATE
|
-- Wiggle the IR spot a bit.
|
||||||
aimat.y=aimat.y+1+math.random(-100,100)/100
|
local irvec3={x=self.TargetCoord.x+math.random(-100,100)/100, y=self.TargetCoord.y+math.random(-100,100)/100, z=self.TargetCoord.z} --#DCS.Vec3
|
||||||
aimat.x=aimat.x+math.random(-100,100)/100
|
local lsvec3={x=self.TargetCoord.x, y=self.TargetCoord.y, z=self.TargetCoord.z} --#DCS.Vec3
|
||||||
|
|
||||||
self.SpotIR:setPoint(aimat:GetVec3())
|
self.SpotIR:setPoint(irvec3)
|
||||||
self.SpotLaser:setPoint(self.TargetCoord:GetVec3())
|
self.SpotLaser:setPoint(lsvec3)
|
||||||
|
|
||||||
self:__Lasing( -0.2 )
|
self:__Lasing(-0.25)
|
||||||
else
|
else
|
||||||
self:F( { "Target is not alive", self.Target:IsAlive() } )
|
self:F( { "Target is not alive", self.Target:IsAlive() } )
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1898,7 +1898,7 @@ do -- DETECTION_BASE
|
|||||||
|
|
||||||
--- Get the Detection Set.
|
--- Get the Detection Set.
|
||||||
-- @param #DETECTION_BASE self
|
-- @param #DETECTION_BASE self
|
||||||
-- @return Core.Set#SET_BASE
|
-- @return #DETECTION_BASE self
|
||||||
function DETECTION_BASE:GetDetectionSet()
|
function DETECTION_BASE:GetDetectionSet()
|
||||||
|
|
||||||
local DetectionSet = self.DetectionSet
|
local DetectionSet = self.DetectionSet
|
||||||
|
|||||||
@ -4986,7 +4986,7 @@ function WAREHOUSE:onafterAirbaseRecaptured(From, Event, To, Coalition)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- On after "AssetDead" event triggerd when an asset group died.
|
--- On after "AssetDead" event triggered when an asset group died.
|
||||||
-- @param #WAREHOUSE self
|
-- @param #WAREHOUSE self
|
||||||
-- @param #string From From state.
|
-- @param #string From From state.
|
||||||
-- @param #string Event Event.
|
-- @param #string Event Event.
|
||||||
|
|||||||
@ -12519,7 +12519,7 @@ end
|
|||||||
-- @param #number optdist Optimal distance in meters.
|
-- @param #number optdist Optimal distance in meters.
|
||||||
-- @return #string Feedback message text.
|
-- @return #string Feedback message text.
|
||||||
-- @return #string Debriefing text.
|
-- @return #string Debriefing text.
|
||||||
-- @#AIRBOSS.RadioCall Distance radio call. Not implemented yet.
|
-- @return #AIRBOSS.RadioCall Distance radio call. Not implemented yet.
|
||||||
function AIRBOSS:_DistanceCheck(playerData, optdist)
|
function AIRBOSS:_DistanceCheck(playerData, optdist)
|
||||||
|
|
||||||
if optdist==nil then
|
if optdist==nil then
|
||||||
@ -12554,8 +12554,10 @@ function AIRBOSS:_DistanceCheck(playerData, optdist)
|
|||||||
hint=hint..string.format(" Optimal distance is %.1f NM.", UTILS.MetersToNM(optdist))
|
hint=hint..string.format(" Optimal distance is %.1f NM.", UTILS.MetersToNM(optdist))
|
||||||
elseif playerData.difficulty==AIRBOSS.Difficulty.NORMAL then
|
elseif playerData.difficulty==AIRBOSS.Difficulty.NORMAL then
|
||||||
-- We keep it short normally.
|
-- We keep it short normally.
|
||||||
|
hint=""
|
||||||
elseif playerData.difficulty==AIRBOSS.Difficulty.HARD then
|
elseif playerData.difficulty==AIRBOSS.Difficulty.HARD then
|
||||||
-- No hint at all for the pros.
|
-- No hint at all for the pros.
|
||||||
|
hint=""
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Debriefing text.
|
-- Debriefing text.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user