mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Updated logic...
This commit is contained in:
parent
7e55dd8a7c
commit
dbf95924eb
@ -119,7 +119,7 @@ do -- AI_DESIGNATE
|
|||||||
-- @param #AI_DESIGNATE self
|
-- @param #AI_DESIGNATE self
|
||||||
-- @param #number Delay
|
-- @param #number Delay
|
||||||
|
|
||||||
self:AddTransition( "*", "LaseOn", "*" )
|
self:AddTransition( "*", "LaseOn", "Lasing" )
|
||||||
|
|
||||||
--- LaseOn Handler OnBefore for AI_DESIGNATE
|
--- LaseOn Handler OnBefore for AI_DESIGNATE
|
||||||
-- @function [parent=#AI_DESIGNATE ] OnBeforeLaseOn
|
-- @function [parent=#AI_DESIGNATE ] OnBeforeLaseOn
|
||||||
@ -145,9 +145,10 @@ do -- AI_DESIGNATE
|
|||||||
-- @param #AI_DESIGNATE self
|
-- @param #AI_DESIGNATE self
|
||||||
-- @param #number Delay
|
-- @param #number Delay
|
||||||
|
|
||||||
|
self:AddTransition( "Lasing", "Lasing", "Lasing" )
|
||||||
|
|
||||||
|
|
||||||
self:AddTransition( "*", "LaseOff", "*" )
|
self:AddTransition( "*", "LaseOff", "Designate" )
|
||||||
|
|
||||||
--- LaseOff Handler OnBefore for AI_DESIGNATE
|
--- LaseOff Handler OnBefore for AI_DESIGNATE
|
||||||
-- @function [parent=#AI_DESIGNATE ] OnBeforeLaseOff
|
-- @function [parent=#AI_DESIGNATE ] OnBeforeLaseOff
|
||||||
@ -413,8 +414,20 @@ do -- AI_DESIGNATE
|
|||||||
-- @return #AI_DESIGNATE
|
-- @return #AI_DESIGNATE
|
||||||
function AI_DESIGNATE:onafterLaseOn( From, Event, To, AttackGroup, Index, Duration )
|
function AI_DESIGNATE:onafterLaseOn( From, Event, To, AttackGroup, Index, Duration )
|
||||||
|
|
||||||
|
self:__Lasing( -5, AttackGroup, Index, Duration )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
-- @param #AI_DESIGNATE self
|
||||||
|
-- @return #AI_DESIGNATE
|
||||||
|
function AI_DESIGNATE:onafterLasing( From, Event, To, AttackGroup, Index, Duration )
|
||||||
|
|
||||||
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
|
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
|
||||||
|
|
||||||
|
local Targets = false
|
||||||
|
|
||||||
TargetSetUnit:ForEachUnit(
|
TargetSetUnit:ForEachUnit(
|
||||||
--- @param Wrapper.Unit#UNIT SmokeUnit
|
--- @param Wrapper.Unit#UNIT SmokeUnit
|
||||||
function( SmokeUnit )
|
function( SmokeUnit )
|
||||||
@ -425,14 +438,16 @@ do -- AI_DESIGNATE
|
|||||||
if NearestRecceGroup then
|
if NearestRecceGroup then
|
||||||
for UnitID, UnitData in pairs( NearestRecceGroup:GetUnits() or {} ) do
|
for UnitID, UnitData in pairs( NearestRecceGroup:GetUnits() or {} ) do
|
||||||
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
|
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
|
Targets = true
|
||||||
if RecceUnit:IsLasing() == false then
|
if RecceUnit:IsLasing() == false then
|
||||||
self.Spots[Index] = self.Spots[Index] or {}
|
self.Spots[Index] = self.Spots[Index] or {}
|
||||||
local Spots = self.Spots[Index]
|
local Spots = self.Spots[Index]
|
||||||
local LaserCode = self.LaserCodes[math.random(1, #self.LaserCodes)]
|
local LaserCode = self.LaserCodes[math.random(1, #self.LaserCodes)]
|
||||||
local Spot = RecceUnit:LaseUnit( SmokeUnit, LaserCode, Duration )
|
local Spot = RecceUnit:LaseUnit( SmokeUnit, LaserCode, Duration )
|
||||||
Spots[#Spots+1] = Spot
|
Spots[RecceUnit] = Spot
|
||||||
RecceUnit:MessageToGroup( "Lasing " .. SmokeUnit:GetTypeName() .. " for " .. Duration .. " seconds. Laser Code: " .. Spot.LaserCode, 15, AttackGroup )
|
RecceUnit:MessageToGroup( "Lasing " .. SmokeUnit:GetTypeName() .. " for " .. Duration .. " seconds. Laser Code: " .. Spot.LaserCode, 15, AttackGroup )
|
||||||
break
|
break
|
||||||
|
else
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -441,9 +456,15 @@ do -- AI_DESIGNATE
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
self:SetDesignateMenu()
|
if Targets == true then
|
||||||
|
self:__Lasing( -30, AttackGroup, Index, Duration )
|
||||||
|
else
|
||||||
|
self:__LaseOff( -0.2, AttackGroup, Index )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:SetDesignateMenu()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @param #AI_DESIGNATE self
|
-- @param #AI_DESIGNATE self
|
||||||
|
|||||||
@ -96,8 +96,12 @@ do
|
|||||||
-- @param To
|
-- @param To
|
||||||
function SPOT:onafterLasing( From, Event, To )
|
function SPOT:onafterLasing( From, Event, To )
|
||||||
|
|
||||||
self:__Lasing( -0.2 )
|
if self.Target:IsAlive() then
|
||||||
self.Spot:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
|
self.Spot:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
|
||||||
|
self:__Lasing( -0.2 )
|
||||||
|
else
|
||||||
|
self:__LaseOff( 0.2 )
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user