mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Progress
This commit is contained in:
parent
036768d400
commit
456b3f483f
@ -186,7 +186,6 @@ do -- AI_DESIGNATE
|
|||||||
|
|
||||||
self:AddTransition( "Lasing", "Lasing", "Lasing" )
|
self:AddTransition( "Lasing", "Lasing", "Lasing" )
|
||||||
|
|
||||||
|
|
||||||
self:AddTransition( "*", "LaseOff", "Designate" )
|
self:AddTransition( "*", "LaseOff", "Designate" )
|
||||||
|
|
||||||
--- LaseOff Handler OnBefore for AI_DESIGNATE
|
--- LaseOff Handler OnBefore for AI_DESIGNATE
|
||||||
@ -266,8 +265,8 @@ do -- AI_DESIGNATE
|
|||||||
-- @function [parent=#AI_DESIGNATE] __Illuminate
|
-- @function [parent=#AI_DESIGNATE] __Illuminate
|
||||||
-- @param #AI_DESIGNATE self
|
-- @param #AI_DESIGNATE self
|
||||||
-- @param #number Delay
|
-- @param #number Delay
|
||||||
|
|
||||||
|
self:AddTransition( "*", "Done", "*" )
|
||||||
|
|
||||||
self:AddTransition( "*", "Status", "*" )
|
self:AddTransition( "*", "Status", "*" )
|
||||||
|
|
||||||
@ -445,7 +444,8 @@ do -- AI_DESIGNATE
|
|||||||
self:E("Designate through Illumination")
|
self:E("Designate through Illumination")
|
||||||
|
|
||||||
self.Designating[Index] = "Illuminate"
|
self.Designating[Index] = "Illuminate"
|
||||||
self:__Illuminate( 1, AttackGroup, Index )
|
|
||||||
|
self:__Illuminate( 1, AttackGroup, Index )
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -590,20 +590,25 @@ do -- AI_DESIGNATE
|
|||||||
|
|
||||||
|
|
||||||
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
|
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
|
||||||
|
local TargetSetUnitCount = TargetSetUnit:Count()
|
||||||
|
|
||||||
TargetSetUnit:ForEachUnit(
|
TargetSetUnit:ForEachUnit(
|
||||||
--- @param Wrapper.Unit#UNIT SmokeUnit
|
--- @param Wrapper.Unit#UNIT SmokeUnit
|
||||||
function( SmokeUnit )
|
function( SmokeUnit )
|
||||||
self:E("In procedure")
|
self:E("In procedure")
|
||||||
--if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then
|
if math.random( 1, TargetSetUnitCount ) == math.random( 1, TargetSetUnitCount ) then
|
||||||
|
local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2())
|
||||||
|
local RecceUnit = RecceGroup:GetUnit( 1 )
|
||||||
|
RecceUnit:MessageToGroup( "Smoking " .. SmokeUnit:GetTypeName() .. ".", 5, AttackGroup )
|
||||||
SCHEDULER:New( self,
|
SCHEDULER:New( self,
|
||||||
function()
|
function()
|
||||||
if SmokeUnit:IsAlive() then
|
if SmokeUnit:IsAlive() then
|
||||||
SmokeUnit:Smoke( Color, 150 )
|
SmokeUnit:Smoke( Color, 150 )
|
||||||
end
|
end
|
||||||
end, {}, math.random( 10, 60 )
|
self:Done( Index )
|
||||||
|
end, {}, math.random( 5, 20 )
|
||||||
)
|
)
|
||||||
--end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -616,24 +621,31 @@ do -- AI_DESIGNATE
|
|||||||
function AI_DESIGNATE:onafterIlluminate( From, Event, To, AttackGroup, Index )
|
function AI_DESIGNATE:onafterIlluminate( From, Event, To, AttackGroup, Index )
|
||||||
|
|
||||||
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
|
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
|
||||||
|
|
||||||
TargetSetUnit:ForEachUnit(
|
|
||||||
--- @param Wrapper.Unit#UNIT SmokeUnit
|
|
||||||
function( SmokeUnit )
|
|
||||||
self:E("In procedure")
|
|
||||||
--if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then
|
|
||||||
SCHEDULER:New( self,
|
|
||||||
function()
|
|
||||||
if SmokeUnit:IsAlive() then
|
|
||||||
SmokeUnit:GetPointVec3():AddY(800):IlluminationBomb()
|
|
||||||
end
|
|
||||||
end, {}, math.random( 10, 60 )
|
|
||||||
)
|
|
||||||
--end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
|
local TargetUnit = TargetSetUnit:GetFirst()
|
||||||
|
|
||||||
|
if TargetUnit then
|
||||||
|
local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(TargetUnit:GetPointVec2())
|
||||||
|
local RecceUnit = RecceGroup:GetUnit( 1 )
|
||||||
|
RecceUnit:MessageToGroup( "Illuminating " .. TargetUnit:GetTypeName() .. ".", 5, AttackGroup )
|
||||||
|
SCHEDULER:New( self,
|
||||||
|
function()
|
||||||
|
if TargetUnit:IsAlive() then
|
||||||
|
TargetUnit:GetPointVec3():AddY(300):IlluminationBomb()
|
||||||
|
end
|
||||||
|
self:Done( Index )
|
||||||
|
end, {}, math.random( 5, 20 )
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Done
|
||||||
|
-- @param #AI_DESIGNATE self
|
||||||
|
-- @return #AI_DESIGNATE
|
||||||
|
function AI_DESIGNATE:onafterDone( From, Event, To, Index )
|
||||||
|
|
||||||
|
self.Designating[Index] = nil
|
||||||
|
self:SetDesignateMenu()
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user