#OPERATION

* Added GetTargets()

#TARGET
* Also call Dead() when no targets left over

#PLAYERTASKCONTROLLER
* Added FSM events for Flaring, Smoking, and Illumination
* Added Illumination of targets in menu if it is night
* Rename menu parent setting to SetParentMenu(Menu)
This commit is contained in:
Applevangelist
2022-10-21 09:51:44 +02:00
parent 1fc541a9df
commit 37a00f25bc
3 changed files with 99 additions and 11 deletions

View File

@@ -617,7 +617,9 @@ function TARGET:onafterStatus(From, Event, To)
-- Log output verbose=1.
if self.verbose>=1 then
local text=string.format("%s: Targets=%d/%d Life=%.1f/%.1f Damage=%.1f", fsmstate, self:CountTargets(), self.N0, self:GetLife(), self:GetLife0(), self:GetDamage())
if damaged then
if self:CountTargets() == 0 then
text=text.." Dead!"
elseif damaged then
text=text.." Damaged!"
end
self:I(self.lid..text)
@@ -633,7 +635,11 @@ function TARGET:onafterStatus(From, Event, To)
end
self:I(self.lid..text)
end
if self:CountTargets() == 0 then
self:Dead()
end
-- Update status again in 30 sec.
if self:IsAlive() then
self:__Status(-self.TStatus)