mirror of
https://github.com/spencershepard/RotorOps.git
synced 2025-11-10 15:45:30 +00:00
Player fatcow (#46)
* Update RotorOpsPerks.lua - added player fatcow - added menu conditions - added action conditions - added a table for tracking farp resources and supporting functions - added flare perk - change menu display to be more compact - changes to points - ignore events if e.initiator is not a unit - fixed monitorFarps - isExist wasn't working when calling on farp objects in farp table (appeared dead) - don't deduct points unless perk action is successful * Update RotorOps.lua - changes to infantry spawns
This commit is contained in:
@@ -1184,12 +1184,19 @@ function RotorOps.assessUnitsInZone(var)
|
||||
for zone, zoneobj in pairs(mist.DBs.zonesByName) do
|
||||
if string.find(zone, RotorOps.active_zone) and string.find(zone:lower(), "spawn") then --if we find a zone that has the active zone name and the word spawn
|
||||
inf_spawn_zones[#inf_spawn_zones + 1] = zone
|
||||
env.info("ROTOR OPS: spawn zone found:"..zone)
|
||||
env.info("ROTOR OPS: active spawn zone found:"..zone)
|
||||
end
|
||||
if string.find(zone:lower(), "spawn") then
|
||||
total_spawn_zones = total_spawn_zones + 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
for index, rops_zone in pairs(RotorOps.zones) do
|
||||
for zone, zoneobj in pairs(mist.DBs.zonesByName) do
|
||||
if string.find(zone:lower(), rops_zone.name:lower()) and string.find(zone:lower(), "spawn") then
|
||||
total_spawn_zones = total_spawn_zones + 1
|
||||
env.info("ROTOR OPS: spawn zone found:"..zone..", total spawn zones:"..total_spawn_zones)
|
||||
end
|
||||
end
|
||||
end
|
||||
--RotorOps.inf_spawns_avail = RotorOps.inf_spawns_per_zone * RotorOps.inf_spawn_multiplier[RotorOps.active_zone_index]
|
||||
if total_spawn_zones > 0 then
|
||||
RotorOps.inf_spawns_avail = (RotorOps.inf_spawns_total / total_spawn_zones) * #inf_spawn_zones
|
||||
@@ -1324,12 +1331,8 @@ function RotorOps.assessUnitsInZone(var)
|
||||
local rand_index = math.random(1, #inf_spawn_zones)
|
||||
local zone = inf_spawn_zones[rand_index]
|
||||
|
||||
if RotorOps.defending then
|
||||
ctld.spawnGroupAtTrigger("blue", RotorOps.inf_spawn_blue, zone, 1000)
|
||||
else
|
||||
ctld.spawnGroupAtTrigger("red", RotorOps.inf_spawn_red, zone, 1000)
|
||||
RotorOps.gameMsg(RotorOps.gameMsgs.infantry_spawned, math.random(1, #RotorOps.gameMsgs.infantry_spawned))
|
||||
end
|
||||
ctld.spawnGroupAtTrigger("red", RotorOps.inf_spawn_red, zone, 1000)
|
||||
RotorOps.gameMsg(RotorOps.gameMsgs.infantry_spawned, math.random(1, #RotorOps.gameMsgs.infantry_spawned))
|
||||
|
||||
RotorOps.inf_spawns_avail = RotorOps.inf_spawns_avail - 1
|
||||
env.info("ROTOR OPS: Attempting to spawn infantry. "..RotorOps.inf_spawns_avail.." spawns remaining in "..zone)
|
||||
|
||||
Reference in New Issue
Block a user