From 34d2336030bb2b974ab572bb5790677f12b4b5c4 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 24 Jan 2026 16:17:44 +0100 Subject: [PATCH] xx --- Moose Development/Moose/Ops/EasyA2G.lua | 7 +++--- Moose Development/Moose/Ops/EasyGCICAP.lua | 7 +++--- Moose Development/Moose/Utilities/Utils.lua | 28 ++++++++++++++++++--- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Moose Development/Moose/Ops/EasyA2G.lua b/Moose Development/Moose/Ops/EasyA2G.lua index 1e97ea5c4..96f3e6a0d 100644 --- a/Moose Development/Moose/Ops/EasyA2G.lua +++ b/Moose Development/Moose/Ops/EasyA2G.lua @@ -319,6 +319,10 @@ function EASYA2G:New(Alias, AirbaseName, Coalition, ScoutName) -- defaults self.alias = Alias or AirbaseName.." A2G Wing" + + -- Set some string id for output to DCS.log file. + self.lid=string.format("EASYA2G %s | ", self.alias) + self.coalitionname = string.lower(Coalition) or "blue" self.coalition = self.coalitionname == "blue" and coalition.side.BLUE or coalition.side.RED self.wings = {} @@ -354,9 +358,6 @@ function EASYA2G:New(Alias, AirbaseName, Coalition, ScoutName) self.EngageTargetTypes = {"Ground"} self:SetDefaultTurnoverTime() - -- Set some string id for output to DCS.log file. - self.lid=string.format("EASYA2G %s | ", self.alias) - -- Add FSM transitions. -- From State --> Event --> To State self:SetStartState("Stopped") diff --git a/Moose Development/Moose/Ops/EasyGCICAP.lua b/Moose Development/Moose/Ops/EasyGCICAP.lua index 2c557773a..a1433f052 100644 --- a/Moose Development/Moose/Ops/EasyGCICAP.lua +++ b/Moose Development/Moose/Ops/EasyGCICAP.lua @@ -312,6 +312,10 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName) -- defaults self.alias = Alias or AirbaseName.." CAP Wing" + + -- Set some string id for output to DCS.log file. + self.lid=string.format("EASYGCICAP %s | ", self.alias) + self.coalitionname = string.lower(Coalition) or "blue" self.coalition = self.coalitionname == "blue" and coalition.side.BLUE or coalition.side.RED self.wings = {} @@ -347,9 +351,6 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName) self.EngageTargetTypes = {"Air"} self:SetDefaultTurnoverTime() - -- Set some string id for output to DCS.log file. - self.lid=string.format("EASYGCICAP %s | ", self.alias) - -- Add FSM transitions. -- From State --> Event --> To State self:SetStartState("Stopped") diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index f5694b295..53f5e8e04 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -2923,16 +2923,27 @@ end -- @param #boolean Cinematic (Optional, needs Structured = true) If true, place a fire/smoke effect on the dead static position. -- @param #number Effect (Optional for Cinematic) What effect to use. Defaults to a random effect. Smoke presets are: 1=small smoke and fire, 2=medium smoke and fire, 3=large smoke and fire, 4=huge smoke and fire, 5=small smoke, 6=medium smoke, 7=large smoke, 8=huge smoke. -- @param #number Density (Optional for Cinematic) What smoke density to use, can be 0 to 1. Defaults to 0.5. +-- @param #boolean Resurrection If true, dead units can be restored on load. Defaults to false. +-- @param #number ResurrectPercentage Use this percentage of probability to resurrect a unit. [0..100], defaults to 25. +-- @param #number Healmin If set, life points of a resurrected unit will be randomly restored to min this percentage. [0..100], defaults to 25. +-- @param #number Healmax If set, life points of a resurrected unit will be randomly restored to max this percentage. [0..100], defaults to 75. -- @return #table Table of data objects (tables) containing groupname, coordinate and group object. Returns nil when file cannot be read. -- @return #table When using Cinematic: table of names of smoke and fire objects, so they can be extinguished with `COORDINATE.StopBigSmokeAndFire( name )` -function UTILS.LoadStationaryListOfGroups(Path,Filename,Reduce,Structured,Cinematic,Effect,Density) - +function UTILS.LoadStationaryListOfGroups(Path,Filename,Reduce,Structured,Cinematic,Effect,Density,Resurrection,ResurrectPercentage,Healmin,Healmax) + + local healmin = Healmin or 25 + local healmax = Healmax or 75 + local resurrection = (Resurrection == true) and true or false + local resurrectpercentage = ResurrectPercentage or 25 + local fires = {} + --- + -- @param Core.Point#COORDINATE coord local function Smokers(name,coord,effect,density) local eff = math.random(8) if type(effect) == "number" then eff = effect end - coord:BigSmokeAndFire(eff,density,name) + coord:BigSmokeAndFire( eff, Density, 300, 1, name ) table.insert(fires,name) end @@ -2947,7 +2958,16 @@ function UTILS.LoadStationaryListOfGroups(Path,Filename,Reduce,Structured,Cinema local name = _unit:GetName() Smokers(name,coordinate,Effect,Density) end - _unit:Destroy(false) + -- TODO Resurrection logic + local resurectok = math.random(1,100) + BASE:E(string.format("Load Group | Resurrection | Resurrect %s | Thresh %d | Random %d",tostring(resurrection),resurrectpercentage,resurectok)) + if resurrection == true and (resurectok < resurrectpercentage) then + local heallife = math.random(healmin,healmax) + BASE:E("Load Group | Resurrection | Life "..heallife) + _unit:SetLife(heallife) + else + _unit:Destroy(false) + end reduced = reduced + 1 if reduced == anzahl then break end end