@jtff/miztemplate-lib 3.10.3 → 3.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lua/src/020-mission_functions.lua +1 -1
- package/lua/src/110-set_clients.lua +57 -57
- package/lua/src/120-tankers.lua +208 -209
- package/lua/src/130-airboss.lua +907 -562
- package/lua/src/150-awacs.lua +202 -203
- package/package.json +1 -1
|
@@ -892,7 +892,7 @@ function SpawnRanges(param)
|
|
|
892
892
|
local y = staticToSpawn.y
|
|
893
893
|
--spawnStatic = SPAWNSTATIC:NewFromType(staticTypeToSpawn, staticCategoryToSpawn)
|
|
894
894
|
if (staticToSpawn.type == "big_smoke" and staticToSpawn.category == "Effects") then
|
|
895
|
-
local landAltitude = POINT_VEC2:New( x, y ):
|
|
895
|
+
local landAltitude = POINT_VEC2:New( x, y ):GetLandHeight()
|
|
896
896
|
trigger.action.effectSmokeBig({ x = x, y = landAltitude, z = y}, staticToSpawn.effectPreset or 1, staticToSpawn.effectTransparency or 1)
|
|
897
897
|
else
|
|
898
898
|
if (staticToSpawn.coalition ~= nil) then
|
|
@@ -32,15 +32,15 @@ function Set_CLIENT:OnEventPlayerEnterAircraft(EventData)
|
|
|
32
32
|
for index, objQRA in ipairs(QRAArray) do
|
|
33
33
|
if (MenuCoalitionQRA[clientUnit:GetCoalition()]) and (objQRA.customconfig.type == JTFF_QRA.Type.TangoAuto) then
|
|
34
34
|
objQRA.menu[clientUnit:GetCoalition()] = MENU_GROUP_COMMAND:New(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
clientGroup,
|
|
36
|
+
"Trigger " .. objQRA.customconfig.name,
|
|
37
|
+
MenuCoalitionQRA[clientUnit:GetCoalition()],
|
|
38
|
+
QRATrigger,
|
|
39
|
+
{
|
|
40
|
+
objQRA,
|
|
41
|
+
clientUnit:GetName(),
|
|
42
|
+
index,
|
|
43
|
+
}
|
|
44
44
|
)
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -72,8 +72,8 @@ function Set_CLIENT:OnEventRefueling(EventData)
|
|
|
72
72
|
local tankerUnit = UNIT:Find(EventData.initiator)
|
|
73
73
|
local refuelingUnitsSearchRadiusMeters = 150
|
|
74
74
|
local tankerUnitName = 'unknown'
|
|
75
|
-
local client
|
|
76
|
-
local clientUnit
|
|
75
|
+
local client
|
|
76
|
+
local clientUnit
|
|
77
77
|
local clientFuel = 0
|
|
78
78
|
local clientName = 'unknown'
|
|
79
79
|
if (type(tankerUnit) ~= 'nil') then
|
|
@@ -83,60 +83,60 @@ function Set_CLIENT:OnEventRefueling(EventData)
|
|
|
83
83
|
tankerUnitName = tankerUnit:GetName()
|
|
84
84
|
local isTanker, tankerRefuelSystem = tankerUnit:IsTanker()
|
|
85
85
|
local refuelingUnitsSet = tankerUnit
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
end
|
|
86
|
+
:GetCoordinate()
|
|
87
|
+
:ScanUnits(refuelingUnitsSearchRadiusMeters)
|
|
88
|
+
:FilterCoalitions(tankerUnit:GetCoalitionName())
|
|
89
|
+
:FilterActive(true)
|
|
90
|
+
:FilterAlive()
|
|
91
|
+
:FilterFunction(
|
|
92
|
+
function(unit)
|
|
93
|
+
local isRefuelable, unitrefuelsystem = unit:IsRefuelable()
|
|
94
|
+
return isRefuelable and unitrefuelsystem == tankerRefuelSystem
|
|
95
|
+
end)
|
|
96
|
+
:ForEachUnit(
|
|
97
|
+
function(unit)
|
|
98
|
+
local clientRefueling = CLIENT:Find(unit:GetDCSObject(), true)
|
|
99
|
+
--trigger.action.outText(string.format("testing unit %s for clientRefuelableSet",unit:GetName()), 90)
|
|
100
|
+
if type(clientRefueling) ~= 'nil' then
|
|
101
|
+
clientRefuelableSet:AddObject(clientRefueling)
|
|
102
|
+
jtff_log.trace(string.format("adding %s to clientRefuelableSet (refuelable aicrafts near tanker)",clientRefueling:GetPlayer()),"TANKER")
|
|
104
103
|
end
|
|
104
|
+
end
|
|
105
105
|
)
|
|
106
106
|
jtff_log.trace(string.format("refuelingUnitSet (refuelable aicrafts near tanker) : count = %d",refuelingUnitsSet:Count()),"TANKER")
|
|
107
107
|
jtff_log.trace(string.format("clientRefuelableSet (client refuelable aircrafts near tanker): count = %d",clientRefuelableSet:Count()),"TANKER")
|
|
108
108
|
if clientRefuelableSet:Count() >= 1 then
|
|
109
109
|
if clientRefuelableSet:Count() >= 2 then
|
|
110
110
|
clientRefuelableSet:ForEachClient(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
end
|
|
111
|
+
function(curClient)
|
|
112
|
+
local clientUnitObject = curClient:GetClientGroupUnit()
|
|
113
|
+
local clientFuelMassMax = clientUnitObject:GetFuel() * clientUnitObject:GetDesc().fuelMassMax
|
|
114
|
+
if not(BASE:GetState(clientUnitObject, "isRefueling")) then
|
|
115
|
+
local mytimer=TIMER:New(
|
|
116
|
+
function(unit, clientObject, initialFuelState, tankerName)
|
|
117
|
+
if (unit:GetFuel() * unit:GetDesc().fuelMassMax-initialFuelState >= 0) then
|
|
118
|
+
local clientNameString = clientObject:GetPlayer() or unit:GetName()
|
|
119
|
+
BASE:SetState( unit, "isRefueling", true )
|
|
120
|
+
BASE:SetState( unit, "FuelState", initialFuelState )
|
|
121
|
+
jtff_log.info(
|
|
122
|
+
string.format(
|
|
123
|
+
"[%s] Start refueling at the tanker [%s], current fuel : %.0f Lbs",
|
|
124
|
+
clientNameString,
|
|
125
|
+
tankerName,
|
|
126
|
+
UTILS.kg2lbs(initialFuelState)
|
|
127
|
+
),
|
|
128
|
+
"TANKER"
|
|
129
|
+
)
|
|
130
|
+
end
|
|
131
|
+
end,
|
|
132
|
+
clientUnitObject,
|
|
133
|
+
curClient,
|
|
134
|
+
clientFuelMassMax,
|
|
135
|
+
tankerUnitName
|
|
136
|
+
)
|
|
137
|
+
mytimer:Start(2)
|
|
139
138
|
end
|
|
139
|
+
end
|
|
140
140
|
)
|
|
141
141
|
else
|
|
142
142
|
client = clientRefuelableSet:GetFirst()
|