Skip to content

Commit

Permalink
renamed chicken modoptions prefix from 'mo_' to 'chicken_'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruwetuin committed Aug 1, 2018
1 parent e1af6fd commit 5ec4362
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 88 deletions.
2 changes: 1 addition & 1 deletion engineoptions.lua
Expand Up @@ -38,7 +38,7 @@ local options =
name = 'Max units',
desc = 'Maximum number of units (including buildings) for each team allowed at the same time',
type = 'number',
def = 1500,
def = 2000,
min = 1,
max = 10000, --- engine caps at lower limit if more than 3 team are ingame
step = 1, -- quantization is aligned to the def value, (step <= 0) means that there is no quantization
Expand Down
13 changes: 2 additions & 11 deletions luarules/gadgets/chicken_overseer.lua
Expand Up @@ -16,17 +16,8 @@ end
local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if string.find(luaAI, "Chicken:") then
if luaAI == "Chicken: Very Easy" or
luaAI == "Chicken: Easy" or
luaAI == "Chicken: Normal" or
luaAI == "Chicken: Hard" or
luaAI == "Chicken: Very Hard" or
luaAI == "Chicken: Epic!" or
luaAI == "Chicken: Custom" or
luaAI == "Chicken: Survival" then
chickensEnabled = true
end
if luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then
chickensEnabled = true
end
end

Expand Down
15 changes: 3 additions & 12 deletions luarules/gadgets/chicken_progenitor.lua
Expand Up @@ -16,18 +16,9 @@ end
local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if string.find(luaAI, "Chicken:") then
if luaAI == "Chicken: Very Easy" or
luaAI == "Chicken: Easy" or
luaAI == "Chicken: Normal" or
luaAI == "Chicken: Hard" or
luaAI == "Chicken: Very Hard" or
luaAI == "Chicken: Epic!" or
luaAI == "Chicken: Custom" or
luaAI == "Chicken: Survival" then
chickensEnabled = true
end
end
if luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then
chickensEnabled = true
end
end

if chickensEnabled == true then
Expand Down
17 changes: 4 additions & 13 deletions luarules/gadgets/chicken_spawner_defense.lua
Expand Up @@ -16,18 +16,9 @@ end
local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if string.find(luaAI, "Chicken:") then
if luaAI == "Chicken: Very Easy" or
luaAI == "Chicken: Easy" or
luaAI == "Chicken: Normal" or
luaAI == "Chicken: Hard" or
luaAI == "Chicken: Very Hard" or
luaAI == "Chicken: Epic!" or
luaAI == "Chicken: Custom" or
luaAI == "Chicken: Survival" then
chickensEnabled = true
end
end
if luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then
chickensEnabled = true
end
end

if chickensEnabled == true then
Expand Down Expand Up @@ -1510,7 +1501,7 @@ function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID)
updateSpawnQueen()
else
if modes[highestLevel] == SURVIVAL then
queenTime = t + (((Spring.GetModOptions().mo_queentime or 40) * 60) * survivalQueenMod)
queenTime = t + (((Spring.GetModOptions().chicken_queentime or 40) * 60) * survivalQueenMod)
survivalQueenMod = survivalQueenMod * 0.8
queenAnger = 0 -- reenable chicken spawning
burrowAnger = 0
Expand Down
13 changes: 2 additions & 11 deletions luarules/gadgets/chicken_special_damage.lua
Expand Up @@ -16,17 +16,8 @@ end
local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if string.find(luaAI, "Chicken:") then
if luaAI == "Chicken: Very Easy" or
luaAI == "Chicken: Easy" or
luaAI == "Chicken: Normal" or
luaAI == "Chicken: Hard" or
luaAI == "Chicken: Very Hard" or
luaAI == "Chicken: Epic!" or
luaAI == "Chicken: Custom" or
luaAI == "Chicken: Survival" then
chickensEnabled = true
end
if luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then
chickensEnabled = true
end
end

Expand Down
15 changes: 3 additions & 12 deletions luaui/Widgets_BA/gui_chickenStatsPanel.lua
Expand Up @@ -20,18 +20,9 @@ local widgetScale = customScale
local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if luaAI ~= "" then
if luaAI == "Chicken: Very Easy" or
luaAI == "Chicken: Easy" or
luaAI == "Chicken: Normal" or
luaAI == "Chicken: Hard" or
luaAI == "Chicken: Very Hard" or
luaAI == "Chicken: Epic!" or
luaAI == "Chicken: Custom" or
luaAI == "Chicken: Survival" then
chickensEnabled = true
end
end
if luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then
chickensEnabled = true
end
end

if chickensEnabled == true then
Expand Down
15 changes: 3 additions & 12 deletions luaui/Widgets_BA/gui_chicken_teamcolor.lua
Expand Up @@ -16,18 +16,9 @@ end
local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if luaAI ~= "" then
if luaAI == "Chicken: Very Easy" or
luaAI == "Chicken: Easy" or
luaAI == "Chicken: Normal" or
luaAI == "Chicken: Hard" or
luaAI == "Chicken: Very Hard" or
luaAI == "Chicken: Epic!" or
luaAI == "Chicken: Custom" or
luaAI == "Chicken: Survival" then
chickensEnabled = true
end
end
if luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then
chickensEnabled = true
end
end

if chickensEnabled == true then
Expand Down
18 changes: 17 additions & 1 deletion luaui/Widgets_BA/gui_gameinfo.lua
Expand Up @@ -24,6 +24,14 @@ local valuegreycolor = "\255\180\180\180"
local vcolor = valuegreycolor
local separator = "::"

local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if luaAI ~= "" and string.sub(luaAI, 1, 9) == 'Chicken: ' then
chickensEnabled = true
end
end

local changelogFile = ""
changelogFile = changelogFile .. titlecolor..Game.gameName..valuegreycolor.." ("..Game.gameMutator..") "..titlecolor..Game.gameVersion.."\n"
changelogFile = changelogFile .. keycolor.."Engine"..separator..valuegreycolor..((Game and Game.version) or (Engine and Engine.version) or "Engine version error").."\n"
Expand Down Expand Up @@ -81,13 +89,21 @@ modoptionsDefault['pathfinder'] = 'normal'
modoptionsDefault['startmetal'] = '1000'
modoptionsDefault['startenergy'] = '1000'
modoptionsDefault['fixedallies'] = '1'
modoptionsDefault['maxunits'] = '1000'
modoptionsDefault['maxunits'] = '2000'
modoptionsDefault['disablemapdamage'] = '0'

local modoptions = Spring.GetModOptions()
local vcolor = valuegreycolor
local changedModoptions = {}
local unchangedModoptions = {}

if not chickensEnabled then -- filter chicken modoptions
for key, value in pairs(modoptions) do
if string.sub(key, 1, 8) == 'chicken_' then
modoptions[key] = nil
end
end
end
for key, value in pairs(modoptions) do
if value == modoptionsDefault[key] then
unchangedModoptions[key] = value
Expand Down
30 changes: 15 additions & 15 deletions modoptions.lua
Expand Up @@ -316,7 +316,7 @@ local options={
type = 'section',
},
{
key="mo_chickenstart",
key="chicken_chickenstart",
name="Burrow Placement",
desc="Control where burrows spawn",
type="list",
Expand All @@ -330,7 +330,7 @@ local options={
}
},
{
key="mo_queendifficulty",
key="chicken_queendifficulty",
name="Queen Difficulty",
desc="How hard doth the Chicken Queen",
type="list",
Expand All @@ -347,7 +347,7 @@ local options={
}
},
{
key = "mo_queentime",
key = "chicken_queentime",
name = "Max Queen Arrival (Minutes)",
desc = "Queen will spawn after given time.",
type = "number",
Expand All @@ -358,7 +358,7 @@ local options={
section= "chicken_defense_options",
},
{
key = "mo_maxchicken",
key = "chicken_maxchicken",
name = "Chicken Limit",
desc = "Maximum number of chickens on map.",
type = "number",
Expand All @@ -369,7 +369,7 @@ local options={
section= "chicken_defense_options",
},
{
key = "mo_graceperiod",
key = "chicken_graceperiod",
name = "Grace Period (Seconds)",
desc = "Time before chickens become active.",
type = "number",
Expand All @@ -380,14 +380,14 @@ local options={
section= "chicken_defense_options",
},
{
key = "mo_queenanger",
key = "chicken_queenanger",
name = "Add Queen Anger",
desc = "Killing burrows adds to queen anger.",
type = "bool",
def = true,
section= "chicken_defense_options",
},

-- Chicken Defense Custom Difficulty Settings
{
key = 'chicken_defense_custom_difficulty_settings',
Expand All @@ -396,7 +396,7 @@ local options={
type = 'section',
},
{
key = "mo_custom_burrowspawn",
key = "chicken_custom_burrowspawn",
name = "Burrow Spawn Rate (Seconds)",
desc = "Time between burrow spawns.",
type = "number",
Expand All @@ -407,7 +407,7 @@ local options={
section= "chicken_defense_custom_difficulty_settings",
},
{
key = "mo_custom_chickenspawn",
key = "chicken_custom_chickenspawn",
name = "Wave Spawn Rate (Seconds)",
desc = "Time between chicken waves.",
type = "number",
Expand All @@ -418,7 +418,7 @@ local options={
section= "chicken_defense_custom_difficulty_settings",
},
{
key = "mo_custom_minchicken",
key = "chicken_custom_minchicken",
name = "Min Chickens Per Player",
desc = "Minimum Number of chickens before spawn chance kicks in",
type = "number",
Expand All @@ -429,7 +429,7 @@ local options={
section= "chicken_defense_custom_difficulty_settings",
},
{
key = "mo_custom_spawnchance",
key = "chicken_custom_spawnchance",
name = "Spawn Chance (Percent)",
desc = "Percent chance of each chicken spawn once greater thwn the min chickens per player limit",
type = "number",
Expand All @@ -440,7 +440,7 @@ local options={
section= "chicken_defense_custom_difficulty_settings",
},
{
key = "mo_custom_angerbonus",
key = "chicken_custom_angerbonus",
name = "Burrow Kill Anger (Percent)",
desc = "Seconds added per burrow kill.",
type = "number",
Expand All @@ -451,7 +451,7 @@ local options={
section= "chicken_defense_custom_difficulty_settings",
},
{
key = "mo_custom_queenspawnmult",
key = "chicken_custom_queenspawnmult",
name = "Queen Wave Size Mod",
desc = "Number of squads spawned by the queen at once.",
type = "number",
Expand All @@ -473,7 +473,7 @@ local options={
section= "chicken_defense_custom_difficulty_settings",
},
{
key = "mo_custom_lobberemp",
key = "chicken_custom_lobberemp",
name = "Lobber EMP Duration",
desc = "Max duration of Lobber EMP artillery",
type = "number",
Expand All @@ -484,7 +484,7 @@ local options={
section= "chicken_defense_custom_difficulty_settings",
},
{
key = "mo_custom_damagemod",
key = "chicken_custom_damagemod",
name = "Damage Mod",
desc = "Percent modifier for chicken damage",
type = "number",
Expand Down

0 comments on commit 5ec4362

Please sign in to comment.