mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
7c91b9847b
@ -534,7 +534,7 @@
|
|||||||
ARTY={
|
ARTY={
|
||||||
ClassName="ARTY",
|
ClassName="ARTY",
|
||||||
lid=nil,
|
lid=nil,
|
||||||
Debug=false,
|
Debug=true,
|
||||||
targets={},
|
targets={},
|
||||||
moves={},
|
moves={},
|
||||||
currentTarget=nil,
|
currentTarget=nil,
|
||||||
@ -619,61 +619,99 @@ ARTY.WeaponType={
|
|||||||
}
|
}
|
||||||
|
|
||||||
--- Database of common artillery unit properties.
|
--- Database of common artillery unit properties.
|
||||||
|
-- @type ARTY.dbitem
|
||||||
|
-- @field #string displayname Name displayed in ME.
|
||||||
|
-- @field #number minrange Minimum firing range in meters.
|
||||||
|
-- @field #number maxrange Maximum firing range in meters.
|
||||||
|
-- @field #number reloadtime Reload time in seconds.
|
||||||
|
|
||||||
|
--- Database of common artillery unit properties.
|
||||||
|
-- Table key is the "type name" and table value is and `ARTY.dbitem`.
|
||||||
-- @type ARTY.db
|
-- @type ARTY.db
|
||||||
ARTY.db={
|
ARTY.db={
|
||||||
["2B11 mortar"] = { -- type "2B11 mortar"
|
["2B11 mortar"] = {
|
||||||
minrange = 500, -- correct?
|
displayname = "Mortar 2B11 120mm",
|
||||||
maxrange = 7000, -- 7 km
|
minrange = 500, -- correct?
|
||||||
reloadtime = 30, -- 30 sec
|
maxrange = 7000, -- 7 km
|
||||||
|
reloadtime = 30, -- 30 sec
|
||||||
},
|
},
|
||||||
["SPH 2S1 Gvozdika"] = { -- type "SAU Gvozdika"
|
["SAU Gvozdika"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "SPH 2S1 Gvozdika 122mm",
|
||||||
maxrange = 15000, -- 15 km
|
minrange = 300, -- correct?
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 15000, -- 15 km
|
||||||
|
reloadtime = nil, -- unknown
|
||||||
},
|
},
|
||||||
["SPH 2S19 Msta"] = { --type "SAU Msta", alias "2S19 Msta"
|
["SAU Msta"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "SPH 2S19 Msta 152mm",
|
||||||
maxrange = 23500, -- 23.5 km
|
minrange = 300, -- correct?
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 23500, -- 23.5 km
|
||||||
|
reloadtime = nil, -- unknown
|
||||||
},
|
},
|
||||||
["SPH 2S3 Akatsia"] = { -- type "SAU Akatsia", alias "2S3 Akatsia"
|
["SAU Akatsia"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "SPH 2S3 Akatsia 152mm",
|
||||||
maxrange = 17000, -- 17 km
|
minrange = 300,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 17000,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["SPH 2S9 Nona"] = { --type "SAU 2-C9"
|
["SAU 2-C9"] = {
|
||||||
minrange = 500, -- correct?
|
displayname = "SPM 2S9 Nona 120mm M",
|
||||||
maxrange = 7000, -- 7 km
|
minrange = 500,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 7000,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["SPH M109 Paladin"] = { -- type "M-109", alias "M109"
|
["M-109"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "SPH M109 Paladin 155mm",
|
||||||
maxrange = 22000, -- 22 km
|
minrange = 300,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 22000,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["SpGH Dana"] = { -- type "SpGH_Dana"
|
["SpGH_Dana"] = {
|
||||||
minrange = 300, -- correct?
|
displayname = "SPH Dana vz77 152mm",
|
||||||
maxrange = 18700, -- 18.7 km
|
minrange = 300,
|
||||||
reloadtime = nil, -- unknown
|
maxrange = 18700,
|
||||||
|
reloadtime = nil,
|
||||||
},
|
},
|
||||||
["MLRS BM-21 Grad"] = { --type "Grad-URAL", alias "MLRS BM-21 Grad"
|
["MLRS BM-21 Grad"] = { --type "Grad-URAL", alias "MLRS BM-21 Grad"
|
||||||
minrange = 5000, -- 5 km
|
minrange = 5000,
|
||||||
maxrange = 19000, -- 19 km
|
maxrange = 19000,
|
||||||
reloadtime = 420, -- 7 min
|
reloadtime = 420,
|
||||||
},
|
},
|
||||||
["MLRS 9K57 Uragan BM-27"] = { -- type "Uragan_BM-27"
|
["MLRS 9K57 Uragan BM-27"] = { -- type "Uragan_BM-27"
|
||||||
minrange = 11500, -- 11.5 km
|
minrange = 11500,
|
||||||
maxrange = 35800, -- 35.8 km
|
maxrange = 35800,
|
||||||
reloadtime = 840, -- 14 min
|
reloadtime = 840,
|
||||||
},
|
},
|
||||||
["MLRS 9A52 Smerch"] = { -- type "Smerch"
|
["MLRS 9A52 Smerch"] = { -- type "Smerch"
|
||||||
minrange = 20000, -- 20 km
|
minrange = 20000,
|
||||||
maxrange = 70000, -- 70 km
|
maxrange = 70000,
|
||||||
reloadtime = 2160, -- 36 min
|
reloadtime = 2160,
|
||||||
},
|
},
|
||||||
["MLRS M270"] = { --type "MRLS", alias "M270 MRLS"
|
["MLRS M270"] = { --type "MRLS", alias "M270 MRLS"
|
||||||
minrange = 10000, -- 10 km
|
minrange = 10000,
|
||||||
maxrange = 32000, -- 32 km
|
maxrange = 32000,
|
||||||
|
reloadtime = 540,
|
||||||
|
},
|
||||||
|
["M12_GMC"] = {
|
||||||
|
displayname = "SPH M12 GMC 155mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 18200,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["Wespe124"] = {
|
||||||
|
displayname = "SPH Sd.Kfz.124 Wespe 105mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 7000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["T155_Firtina"] = {
|
||||||
|
displayname = "SPH T155 Firtina 155mm",
|
||||||
|
minrange = 300,
|
||||||
|
maxrange = 41000,
|
||||||
|
reloadtime = nil,
|
||||||
|
},
|
||||||
|
["LeFH_18-40-105"] = {
|
||||||
|
minrange = 500, -- 500 m(?)
|
||||||
|
maxrange = 10500, -- 32 km
|
||||||
reloadtime = 540, -- 9 min
|
reloadtime = 540, -- 9 min
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -1923,7 +1961,7 @@ function ARTY:onafterStart(Controllable, From, Event, To)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Check if we have and arty type that is in the DB.
|
-- Check if we have and arty type that is in the DB.
|
||||||
local _dbproperties=self:_CheckDB(self.DisplayName)
|
local _dbproperties=self:_CheckDB(self.Type)
|
||||||
self:T({dbproperties=_dbproperties})
|
self:T({dbproperties=_dbproperties})
|
||||||
if _dbproperties~=nil then
|
if _dbproperties~=nil then
|
||||||
for property,value in pairs(_dbproperties) do
|
for property,value in pairs(_dbproperties) do
|
||||||
|
|||||||
@ -1352,7 +1352,7 @@ CTLD.UnitTypeCapabilities = {
|
|||||||
|
|
||||||
--- CTLD class version.
|
--- CTLD class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CTLD.version="1.1.23"
|
CTLD.version="1.1.24"
|
||||||
|
|
||||||
--- Instantiate a new CTLD.
|
--- Instantiate a new CTLD.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@ -5512,14 +5512,18 @@ end
|
|||||||
local match = false
|
local match = false
|
||||||
local cgotbl = self.Cargo_Troops
|
local cgotbl = self.Cargo_Troops
|
||||||
local name = cargo:GetName()
|
local name = cargo:GetName()
|
||||||
|
local CargoObject
|
||||||
|
local CargoName
|
||||||
for _,_cgo in pairs (cgotbl) do
|
for _,_cgo in pairs (cgotbl) do
|
||||||
local cname = _cgo:GetName()
|
local cname = _cgo:GetName()
|
||||||
if name == cname then
|
if name == cname then
|
||||||
match = true
|
match = true
|
||||||
|
CargoObject = _cgo
|
||||||
|
CargoName = cname
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return match
|
return match, CargoObject, CargoName
|
||||||
end
|
end
|
||||||
|
|
||||||
local function Cruncher(group,typename,anzahl)
|
local function Cruncher(group,typename,anzahl)
|
||||||
@ -5565,11 +5569,24 @@ end
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not IsTroopsMatch(cargo) then
|
local match,CargoObject,CargoName = IsTroopsMatch(cargo)
|
||||||
|
|
||||||
|
if not match then
|
||||||
self.CargoCounter = self.CargoCounter + 1
|
self.CargoCounter = self.CargoCounter + 1
|
||||||
cargo.ID = self.CargoCounter
|
cargo.ID = self.CargoCounter
|
||||||
cargo.Stock = 1
|
cargo.Stock = 1
|
||||||
table.insert(self.Cargo_Troops,cargo)
|
table.insert(self.Cargo_Crates,cargo)
|
||||||
|
end
|
||||||
|
|
||||||
|
if match and CargoObject then
|
||||||
|
local stock = CargoObject:GetStock()
|
||||||
|
if stock ~= -1 and stock ~= nil and stock == 0 then
|
||||||
|
-- stock empty
|
||||||
|
self:T(self.lid.."Stock of "..CargoName.." is empty. Cannot inject.")
|
||||||
|
return
|
||||||
|
else
|
||||||
|
CargoObject:RemoveStock(1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local type = cargo:GetType() -- #CTLD_CARGO.Enum
|
local type = cargo:GetType() -- #CTLD_CARGO.Enum
|
||||||
@ -5637,14 +5654,18 @@ end
|
|||||||
local match = false
|
local match = false
|
||||||
local cgotbl = self.Cargo_Crates
|
local cgotbl = self.Cargo_Crates
|
||||||
local name = cargo:GetName()
|
local name = cargo:GetName()
|
||||||
|
local CargoObject
|
||||||
|
local CargoName
|
||||||
for _,_cgo in pairs (cgotbl) do
|
for _,_cgo in pairs (cgotbl) do
|
||||||
local cname = _cgo:GetName()
|
local cname = _cgo:GetName()
|
||||||
if name == cname then
|
if name == cname then
|
||||||
match = true
|
match = true
|
||||||
|
CargoObject = _cgo
|
||||||
|
CargoName = cname
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return match
|
return match,CargoObject,CargoName
|
||||||
end
|
end
|
||||||
|
|
||||||
local function Cruncher(group,typename,anzahl)
|
local function Cruncher(group,typename,anzahl)
|
||||||
@ -5690,13 +5711,26 @@ end
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not IsVehicMatch(cargo) then
|
local match,CargoObject,CargoName = IsVehicMatch(cargo)
|
||||||
|
|
||||||
|
if not match then
|
||||||
self.CargoCounter = self.CargoCounter + 1
|
self.CargoCounter = self.CargoCounter + 1
|
||||||
cargo.ID = self.CargoCounter
|
cargo.ID = self.CargoCounter
|
||||||
cargo.Stock = 1
|
cargo.Stock = 1
|
||||||
table.insert(self.Cargo_Crates,cargo)
|
table.insert(self.Cargo_Crates,cargo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if match and CargoObject then
|
||||||
|
local stock = CargoObject:GetStock()
|
||||||
|
if stock ~= -1 and stock ~= nil and stock == 0 then
|
||||||
|
-- stock empty
|
||||||
|
self:T(self.lid.."Stock of "..CargoName.." is empty. Cannot inject.")
|
||||||
|
return
|
||||||
|
else
|
||||||
|
CargoObject:RemoveStock(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local type = cargo:GetType() -- #CTLD_CARGO.Enum
|
local type = cargo:GetType() -- #CTLD_CARGO.Enum
|
||||||
if (type == CTLD_CARGO.Enum.VEHICLE or type == CTLD_CARGO.Enum.FOB) then
|
if (type == CTLD_CARGO.Enum.VEHICLE or type == CTLD_CARGO.Enum.FOB) then
|
||||||
-- unload
|
-- unload
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user