Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit e79cf30

Browse files
committed
Add some breaching tool spawns to MetaFight and Bunker Breach
1 parent c2bffbe commit e79cf30

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

Base.rte/Activities/BunkerBreach.lua

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,13 @@ function BunkerBreach:CreateInfantry(team, loadout)
459459

460460
actor:AddInventoryItem(RandomHDFirearm("Weapons - Light", tech));
461461
actor:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", tech));
462-
if math.random() < 0.6 then
462+
local rand = math.random();
463+
if rand < 0.5 then
463464
actor:AddInventoryItem(RandomTDExplosive("Bombs - Grenades", tech));
464-
else
465+
elseif rand < 0.8 then
465466
actor:AddInventoryItem(CreateHDFirearm("Medikit", "Base.rte"));
467+
else
468+
actor:AddInventoryItem(RandomHDFirearm("Tools - Breaching", tech));
466469
end
467470

468471
elseif loadout == "Heavy" then
@@ -498,10 +501,13 @@ function BunkerBreach:CreateInfantry(team, loadout)
498501
actor:AddInventoryItem(RandomHDFirearm("Weapons - Light", tech));
499502
else
500503
actor:AddInventoryItem(RandomHDFirearm("Weapons - Secondary", tech));
501-
if math.random() < 0.3 then
504+
local rand = math.random();
505+
if rand < 0.2 then
502506
actor:AddInventoryItem(RandomHeldDevice("Shields", tech));
503-
else
507+
elseif rand < 0.4 then
504508
actor:AddInventoryItem(CreateHDFirearm("Medikit", "Base.rte"));
509+
else
510+
actor:AddInventoryItem(RandomTDExplosive("Tools - Breaching", tech));
505511
end
506512
end
507513
actor:AddInventoryItem(RandomHDFirearm("Tools - Diggers", tech));

Base.rte/Activities/MetaFight.lua

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,8 +1809,17 @@ function MetaFight:PurchaseHeavyInfantry(player, techID)
18091809
end
18101810

18111811
if math.random() < rte.DiggersRate then
1812-
Cargo = RandomHDFirearm("Tools - Diggers", techID)
1813-
if Cargo then
1812+
if math.random() < 0.2 then
1813+
if math.random() < 0.3 then
1814+
Cargo = RandomHDFirearm("Tools - Breaching", techID)
1815+
digger = 0.5
1816+
else
1817+
Cargo = RandomTDExplosive("Tools - Breaching", techID)
1818+
end
1819+
self:AddOverridePurchase(Cargo, player)
1820+
mass = mass + Cargo.Mass
1821+
else
1822+
Cargo = RandomHDFirearm("Tools - Diggers", techID)
18141823
self:AddOverridePurchase(Cargo, player)
18151824
mass = mass + Cargo.Mass
18161825
digger = 1
@@ -1842,8 +1851,17 @@ function MetaFight:PurchaseMediumInfantry(player, techID)
18421851
end
18431852

18441853
if math.random() < rte.DiggersRate then
1845-
Cargo = RandomHDFirearm("Tools - Diggers", techID)
1846-
if Cargo then
1854+
if math.random() < 0.4 then
1855+
if math.random() < 0.5 then
1856+
Cargo = RandomHDFirearm("Tools - Breaching", techID)
1857+
digger = 0.5
1858+
else
1859+
Cargo = RandomTDExplosive("Tools - Breaching", techID)
1860+
end
1861+
self:AddOverridePurchase(Cargo, player)
1862+
mass = mass + Cargo.Mass
1863+
else
1864+
Cargo = RandomHDFirearm("Tools - Diggers", techID)
18471865
self:AddOverridePurchase(Cargo, player)
18481866
mass = mass + Cargo.Mass
18491867
digger = 1
@@ -1875,8 +1893,17 @@ function MetaFight:PurchaseLightInfantry(player, techID)
18751893
end
18761894

18771895
if math.random() < rte.DiggersRate then
1878-
Cargo = RandomHDFirearm("Tools - Diggers", techID)
1879-
if Cargo then
1896+
if math.random() < 0.6 then
1897+
if math.random() < 0.7 then
1898+
Cargo = RandomHDFirearm("Tools - Breaching", techID)
1899+
digger = 0.5
1900+
else
1901+
Cargo = RandomTDExplosive("Tools - Breaching", techID)
1902+
end
1903+
self:AddOverridePurchase(Cargo, player)
1904+
mass = mass + Cargo.Mass
1905+
else
1906+
Cargo = RandomHDFirearm("Tools - Diggers", techID)
18801907
self:AddOverridePurchase(Cargo, player)
18811908
mass = mass + Cargo.Mass
18821909
digger = 1

0 commit comments

Comments
 (0)