mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'develop' into FF/Ops
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
-- ===
|
||||
--
|
||||
-- ### Author: **applevangelist**
|
||||
-- @date Last Update Oct 2024
|
||||
-- @date Last Update Dec 2024
|
||||
-- @module Ops.AWACS
|
||||
-- @image OPS_AWACS.jpg
|
||||
|
||||
@@ -509,7 +509,7 @@ do
|
||||
-- @field #AWACS
|
||||
AWACS = {
|
||||
ClassName = "AWACS", -- #string
|
||||
version = "0.2.67", -- #string
|
||||
version = "0.2.68", -- #string
|
||||
lid = "", -- #string
|
||||
coalition = coalition.side.BLUE, -- #number
|
||||
coalitiontxt = "blue", -- #string
|
||||
@@ -5922,6 +5922,7 @@ function AWACS:onafterStart(From, Event, To)
|
||||
local AwacsAW = self.AirWing -- Ops.Airwing#AIRWING
|
||||
local mission = AUFTRAG:NewORBIT_RACETRACK(self.OrbitZone:GetCoordinate(),self.AwacsAngels*1000,self.Speed,self.Heading,self.Leg)
|
||||
mission:SetMissionRange(self.MaxMissionRange)
|
||||
mission:SetRequiredAttribute({ GROUP.Attribute.AIR_AWACS }) -- prefered plane type, thanks to Heart8reaker
|
||||
local timeonstation = (self.AwacsTimeOnStation + self.ShiftChangeTime) * 3600
|
||||
mission:SetTime(nil,timeonstation)
|
||||
self.CatchAllMissions[#self.CatchAllMissions+1] = mission
|
||||
|
||||
@@ -1351,7 +1351,7 @@ CTLD.UnitTypeCapabilities = {
|
||||
|
||||
--- CTLD class version.
|
||||
-- @field #string version
|
||||
CTLD.version="1.1.20"
|
||||
CTLD.version="1.1.22"
|
||||
|
||||
--- Instantiate a new CTLD.
|
||||
-- @param #CTLD self
|
||||
@@ -2686,27 +2686,6 @@ function CTLD:_GetCrates(Group, Unit, Cargo, number, drop, pack)
|
||||
row = 1
|
||||
startpos:Translate(6,heading,nil,true)
|
||||
end
|
||||
--[[
|
||||
local initialSpacing = IsHerc and 16 or (capabilities.length+2) -- initial spacing of the first crates
|
||||
local crateSpacing = 4 -- further spacing of remaining crates
|
||||
local lateralSpacing = 4 -- lateral spacing of crates
|
||||
local nrSideBySideCrates = 4 -- number of crates that are placed side-by-side
|
||||
|
||||
if cratesneeded == 1 then
|
||||
-- single crate needed spawns straight ahead
|
||||
cratedistance = initialSpacing
|
||||
rheading = math.fmod((heading + addon), 360)
|
||||
else
|
||||
--if (i - 1) % nrSideBySideCrates == 0 then
|
||||
cratedistance = i == 1 and initialSpacing or (cratedistance + crateSpacing)
|
||||
angleOffNose = math.ceil(math.deg(math.atan(lateralSpacing / cratedistance)))
|
||||
self:I("angleOffNose = "..angleOffNose)
|
||||
rheading = heading + addon - angleOffNose
|
||||
--else
|
||||
-- rheading = heading + addon + angleOffNose
|
||||
--end
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
--local cratevec2 = cratecoord:GetVec2()
|
||||
@@ -3514,7 +3493,7 @@ function CTLD:_UnloadTroops(Group, Unit)
|
||||
if IsHerc then offset = self.TroopUnloadDistGroundHerc or 25 end
|
||||
if IsHook then
|
||||
offset = self.TroopUnloadDistGroundHook or 15
|
||||
if self.TroopUnloadDistHoverHook then
|
||||
if hoverunload and self.TroopUnloadDistHoverHook then
|
||||
offset = self.TroopUnloadDistHoverHook or 5
|
||||
end
|
||||
end
|
||||
@@ -4277,7 +4256,7 @@ end
|
||||
-- @param #number PerTroopMass Mass in kg of each soldier
|
||||
-- @param #number Stock Number of groups in stock. Nil for unlimited.
|
||||
-- @param #string SubCategory Name of sub-category (optional).
|
||||
function CTLD:AddTroopsCargo(Name,Templates,Type,NoTroops,PerTroopMass,Stock,SubCategory)
|
||||
function CTLD:AddTroopsCargo(Name,Templates,Type,NoTroops,PerTroopMass,Stock,SubCategory)
|
||||
self:T(self.lid .. " AddTroopsCargo")
|
||||
self:T({Name,Templates,Type,NoTroops,PerTroopMass,Stock})
|
||||
if not self:_CheckTemplates(Templates) then
|
||||
@@ -4288,6 +4267,7 @@ function CTLD:AddTroopsCargo(Name,Templates,Type,NoTroops,PerTroopMass,Stock,Sub
|
||||
-- Troops are directly loadable
|
||||
local cargo = CTLD_CARGO:New(self.CargoCounter,Name,Templates,Type,false,true,NoTroops,nil,nil,PerTroopMass,Stock, SubCategory)
|
||||
table.insert(self.Cargo_Troops,cargo)
|
||||
if SubCategory and self.usesubcats ~= true then self.usesubcats=true end
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -4324,6 +4304,7 @@ function CTLD:AddCratesCargo(Name,Templates,Type,NoCrates,PerCrateMass,Stock,Sub
|
||||
cargo:SetStaticTypeAndShape(Category,TypeName,ShapeName)
|
||||
end
|
||||
table.insert(self.Cargo_Crates,cargo)
|
||||
if SubCategory and self.usesubcats ~= true then self.usesubcats=true end
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -4350,6 +4331,7 @@ function CTLD:AddStaticsCargo(Name,Mass,Stock,SubCategory,DontShowInMenu,Locatio
|
||||
local cargo = CTLD_CARGO:New(self.CargoCounter,Name,template,type,false,false,1,nil,nil,Mass,Stock,SubCategory,DontShowInMenu,Location)
|
||||
cargo:SetStaticResourceMap(ResourceMap)
|
||||
table.insert(self.Cargo_Statics,cargo)
|
||||
if SubCategory and self.usesubcats ~= true then self.usesubcats=true end
|
||||
return cargo
|
||||
end
|
||||
|
||||
@@ -6127,7 +6109,7 @@ end
|
||||
|
||||
local statics = nil
|
||||
local statics = {}
|
||||
self:T(self.lid.."Bulding Statics Table for Saving")
|
||||
self:T(self.lid.."Building Statics Table for Saving")
|
||||
for _,_cargo in pairs (stcstable) do
|
||||
local cargo = _cargo -- #CTLD_CARGO
|
||||
local object = cargo:GetPositionable() -- Wrapper.Static#STATIC
|
||||
@@ -6162,7 +6144,7 @@ end
|
||||
|
||||
|
||||
--local data = "LoadedData = {\n"
|
||||
local data = "Group,x,y,z,CargoName,CargoTemplates,CargoType,CratesNeeded,CrateMass,Structure\n"
|
||||
local data = "Group,x,y,z,CargoName,CargoTemplates,CargoType,CratesNeeded,CrateMass,Structure,StaticCategory,StaticType,StaticShape\n"
|
||||
local n = 0
|
||||
for _,_grp in pairs(grouptable) do
|
||||
local group = _grp -- Wrapper.Group#GROUP
|
||||
@@ -6189,6 +6171,7 @@ end
|
||||
local cgotype = cargo.CargoType
|
||||
local cgoneed = cargo.CratesNeeded
|
||||
local cgomass = cargo.PerCrateMass
|
||||
local scat,stype,sshape = cargo:GetStaticTypeAndShape()
|
||||
local structure = UTILS.GetCountPerTypeName(group)
|
||||
local strucdata = ""
|
||||
for typen,anzahl in pairs (structure) do
|
||||
@@ -6205,8 +6188,8 @@ end
|
||||
end
|
||||
|
||||
local location = group:GetVec3()
|
||||
local txt = string.format("%s,%d,%d,%d,%s,%s,%s,%d,%d,%s\n"
|
||||
,template,location.x,location.y,location.z,cgoname,cgotemp,cgotype,cgoneed,cgomass,strucdata)
|
||||
local txt = string.format("%s,%d,%d,%d,%s,%s,%s,%d,%d,%s,%s,%s,%s\n"
|
||||
,template,location.x,location.y,location.z,cgoname,cgotemp,cgotype,cgoneed,cgomass,strucdata,scat,stype,sshape or "none")
|
||||
data = data .. txt
|
||||
end
|
||||
end
|
||||
@@ -6231,8 +6214,9 @@ end
|
||||
local cgomass = object.PerCrateMass
|
||||
local crateobj = object.Positionable
|
||||
local location = crateobj:GetVec3()
|
||||
local txt = string.format("%s,%d,%d,%d,%s,%s,%s,%d,%d\n"
|
||||
,"STATIC",location.x,location.y,location.z,cgoname,cgotemp,cgotype,cgoneed,cgomass)
|
||||
local scat,stype,sshape = object:GetStaticTypeAndShape()
|
||||
local txt = string.format("%s,%d,%d,%d,%s,%s,%s,%d,%d,'none',%s,%s,%s\n"
|
||||
,"STATIC",location.x,location.y,location.z,cgoname,cgotemp,cgotype,cgoneed,cgomass,scat,stype,sshape or "none")
|
||||
data = data .. txt
|
||||
end
|
||||
|
||||
@@ -6361,47 +6345,50 @@ end
|
||||
|
||||
for _id,_entry in pairs (loadeddata) do
|
||||
local dataset = UTILS.Split(_entry,",")
|
||||
-- 1=Group,2=x,3=y,4=z,5=CargoName,6=CargoTemplates,7=CargoType,8=CratesNeeded,9=CrateMass,10=Structure
|
||||
-- 1=Group,2=x,3=y,4=z,5=CargoName,6=CargoTemplates,7=CargoType,8=CratesNeeded,9=CrateMass,10=Structure,11=StaticCategory,12=StaticType,13=StaticShape
|
||||
local groupname = dataset[1]
|
||||
local vec2 = {}
|
||||
vec2.x = tonumber(dataset[2])
|
||||
vec2.y = tonumber(dataset[4])
|
||||
local cargoname = dataset[5]
|
||||
local cargotemplates = dataset[6]
|
||||
local cargotype = dataset[7]
|
||||
local size = tonumber(dataset[8])
|
||||
local mass = tonumber(dataset[9])
|
||||
local StaticCategory = dataset[11]
|
||||
local StaticType = dataset[12]
|
||||
local StaticShape = dataset[13]
|
||||
if type(groupname) == "string" and groupname ~= "STATIC" then
|
||||
local cargotemplates = dataset[6]
|
||||
cargotemplates = string.gsub(cargotemplates,"{","")
|
||||
cargotemplates = string.gsub(cargotemplates,"}","")
|
||||
cargotemplates = UTILS.Split(cargotemplates,";")
|
||||
local size = tonumber(dataset[8])
|
||||
local mass = tonumber(dataset[9])
|
||||
local structure = nil
|
||||
if dataset[10] then
|
||||
if dataset[10] and dataset[10] ~= "none" then
|
||||
structure = dataset[10]
|
||||
structure = string.gsub(structure,",","")
|
||||
end
|
||||
-- inject at Vec2
|
||||
local dropzone = ZONE_RADIUS:New("DropZone",vec2,20)
|
||||
if cargotype == CTLD_CARGO.Enum.VEHICLE or cargotype == CTLD_CARGO.Enum.FOB then
|
||||
local injectvehicle = CTLD_CARGO:New(nil,cargoname,cargotemplates,cargotype,true,true,size,nil,true,mass)
|
||||
local injectvehicle = CTLD_CARGO:New(nil,cargoname,cargotemplates,cargotype,true,true,size,nil,true,mass)
|
||||
injectvehicle:SetStaticTypeAndShape(StaticCategory,StaticType,StaticShape)
|
||||
self:InjectVehicles(dropzone,injectvehicle,self.surfacetypes,self.useprecisecoordloads,structure)
|
||||
elseif cargotype == CTLD_CARGO.Enum.TROOPS or cargotype == CTLD_CARGO.Enum.ENGINEERS then
|
||||
local injecttroops = CTLD_CARGO:New(nil,cargoname,cargotemplates,cargotype,true,true,size,nil,true,mass)
|
||||
self:InjectTroops(dropzone,injecttroops,self.surfacetypes,self.useprecisecoordloads,structure)
|
||||
end
|
||||
elseif (type(groupname) == "string" and groupname == "STATIC") or cargotype == CTLD_CARGO.Enum.REPAIR then
|
||||
local cargotemplates = dataset[6]
|
||||
local size = tonumber(dataset[8])
|
||||
local mass = tonumber(dataset[9])
|
||||
local dropzone = ZONE_RADIUS:New("DropZone",vec2,20)
|
||||
local injectstatic = nil
|
||||
if cargotype == CTLD_CARGO.Enum.VEHICLE or cargotype == CTLD_CARGO.Enum.FOB then
|
||||
cargotemplates = string.gsub(cargotemplates,"{","")
|
||||
cargotemplates = string.gsub(cargotemplates,"}","")
|
||||
cargotemplates = UTILS.Split(cargotemplates,";")
|
||||
injectstatic = CTLD_CARGO:New(nil,cargoname,cargotemplates,cargotype,true,true,size,nil,true,mass)
|
||||
injectstatic = CTLD_CARGO:New(nil,cargoname,cargotemplates,cargotype,true,true,size,nil,true,mass)
|
||||
injectstatic:SetStaticTypeAndShape(StaticCategory,StaticType,StaticShape)
|
||||
elseif cargotype == CTLD_CARGO.Enum.STATIC or cargotype == CTLD_CARGO.Enum.REPAIR then
|
||||
injectstatic = CTLD_CARGO:New(nil,cargoname,cargotemplates,cargotype,true,true,size,nil,true,mass)
|
||||
injectstatic:SetStaticTypeAndShape(StaticCategory,StaticType,StaticShape)
|
||||
local map=cargotype:GetStaticResourceMap()
|
||||
injectstatic:SetStaticResourceMap(map)
|
||||
end
|
||||
|
||||
@@ -1314,7 +1314,7 @@ function OPSZONE:EvaluateZone()
|
||||
|
||||
if Nblu>0 then
|
||||
|
||||
if not self:IsAttacked() and self.Tnut>=self.threatlevelCapture then
|
||||
if not self:IsAttacked() and self.Tblu>=self.threatlevelCapture then
|
||||
self:Attacked(coalition.side.BLUE)
|
||||
end
|
||||
|
||||
@@ -1366,7 +1366,7 @@ function OPSZONE:EvaluateZone()
|
||||
|
||||
if Nred>0 then
|
||||
|
||||
if not self:IsAttacked() and self.Tnut>=self.threatlevelCapture then
|
||||
if not self:IsAttacked() and self.Tred>=self.threatlevelCapture then
|
||||
-- Red is attacking blue zone.
|
||||
self:Attacked(coalition.side.RED)
|
||||
end
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
-- @field #boolean smokeownposition
|
||||
-- @field #table SmokeOwn
|
||||
-- @field #boolean smokeaveragetargetpos
|
||||
-- @field #boolean reporttostringbullsonly
|
||||
-- @extends Core.Fsm#FSM
|
||||
|
||||
---
|
||||
@@ -105,7 +106,7 @@ PLAYERRECCE = {
|
||||
ClassName = "PLAYERRECCE",
|
||||
verbose = true,
|
||||
lid = nil,
|
||||
version = "0.1.23",
|
||||
version = "0.1.24",
|
||||
ViewZone = {},
|
||||
ViewZoneVisual = {},
|
||||
ViewZoneLaser = {},
|
||||
@@ -133,7 +134,8 @@ PLAYERRECCE = {
|
||||
TargetCache = nil,
|
||||
smokeownposition = false,
|
||||
SmokeOwn = {},
|
||||
smokeaveragetargetpos = false,
|
||||
smokeaveragetargetpos = true,
|
||||
reporttostringbullsonly = true,
|
||||
}
|
||||
|
||||
---
|
||||
@@ -236,6 +238,8 @@ function PLAYERRECCE:New(Name, Coalition, PlayerSet)
|
||||
|
||||
self.minthreatlevel = 0
|
||||
|
||||
self.reporttostringbullsonly = true
|
||||
|
||||
self.TForget = 600
|
||||
self.TargetCache = FIFO:New()
|
||||
|
||||
@@ -929,7 +933,8 @@ function PLAYERRECCE:_LaseTarget(client,targetset)
|
||||
if (not oldtarget) or targetset:IsNotInSet(oldtarget) or target:IsDead() or target:IsDestroyed() then
|
||||
-- lost LOS or dead
|
||||
laser:LaseOff()
|
||||
if target:IsDead() or target:IsDestroyed() or target:GetLife() < 2 then
|
||||
self:T(self.lid.."Target Life Points: "..target:GetLife() or "none")
|
||||
if target:IsDead() or target:IsDestroyed() or target:GetDamage() > 79 or target:GetLife() <= 1 then
|
||||
self:__Shack(-1,client,oldtarget)
|
||||
--self.LaserTarget[playername] = nil
|
||||
else
|
||||
@@ -1274,6 +1279,9 @@ self:T(self.lid.."_ReportLaserTargets")
|
||||
report:Add("Threat Level: "..ThreatGraph.." ("..ThreatLevelText..")")
|
||||
if not self.ReferencePoint then
|
||||
report:Add("Location: "..client:GetCoordinate():ToStringBULLS(self.Coalition,Settings))
|
||||
if self.reporttostringbullsonly ~= true then
|
||||
report:Add("Location: "..client:GetCoordinate():ToStringA2G(nil,Settings))
|
||||
end
|
||||
else
|
||||
report:Add("Location: "..client:GetCoordinate():ToStringFromRPShort(self.ReferencePoint,self.RPName,client,Settings))
|
||||
end
|
||||
@@ -1317,8 +1325,14 @@ function PLAYERRECCE:_ReportVisualTargets(client,group,playername)
|
||||
report:Add("Threat Level: "..ThreatGraph.." ("..ThreatLevelText..")")
|
||||
if not self.ReferencePoint then
|
||||
report:Add("Location: "..client:GetCoordinate():ToStringBULLS(self.Coalition,Settings))
|
||||
if self.reporttostringbullsonly ~= true then
|
||||
report:Add("Location: "..client:GetCoordinate():ToStringA2G(nil,Settings))
|
||||
end
|
||||
else
|
||||
report:Add("Location: "..client:GetCoordinate():ToStringFromRPShort(self.ReferencePoint,self.RPName,client,Settings))
|
||||
if self.reporttostringbullsonly ~= true then
|
||||
report:Add("Location: "..client:GetCoordinate():ToStringA2G(nil,Settings))
|
||||
end
|
||||
end
|
||||
report:Add(string.rep("-",15))
|
||||
local text = report:Text()
|
||||
@@ -1552,6 +1566,16 @@ function PLAYERRECCE:SetMenuName(Name)
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Set reporting to be BULLS only or BULLS plus playersettings based coordinate.
|
||||
-- @param #PLAYERRECCE self
|
||||
-- @param #boolean OnOff
|
||||
-- @return #PLAYERRECCE self
|
||||
function PLAYERRECCE:SetReportBullsOnly(OnOff)
|
||||
self:T(self.lid.."SetReportBullsOnly: "..tostring(OnOff))
|
||||
self.reporttostringbullsonly = OnOff
|
||||
return self
|
||||
end
|
||||
|
||||
--- [User] Enable smoking of own position
|
||||
-- @param #PLAYERRECCE self
|
||||
-- @return #PLAYERRECCE self
|
||||
|
||||
@@ -997,6 +997,8 @@ function RECOVERYTANKER:onafterStart(From, Event, To)
|
||||
|
||||
-- Init status updates in 10 seconds.
|
||||
self:__Status(10)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -963,6 +963,8 @@ function RESCUEHELO:onafterStart(From, Event, To)
|
||||
|
||||
-- Init status check
|
||||
self:__Status(1)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- On after Status event. Checks player status.
|
||||
|
||||
Reference in New Issue
Block a user