get rid of mode value altogether, no longer needed

This commit is contained in:
Lilian Jónsdóttir 2021-08-14 12:52:15 -07:00
parent 3c7457af8e
commit 39898fed1a
4 changed files with 3 additions and 9 deletions

View file

@ -10,30 +10,24 @@ this.configString = string.gsub(this.modName, "%s+", "")
this.modes = {
{
mode = "equippedArmour",
value = 0,
description = "Actors are pulled down by their combined armour class (Light = 1, Medium = 2, Heavy = 3) multiplied by a tenth of " ..
"the down-pull multiplier. Default of 100 makes it impossible to surface in all heavy armour for all but the most Athletic.",
},
{
mode = "allEquipment",
value = 1,
description = "Actors are pulled down by double the weight of all equipped gear multiplied by a hundredth of the down-pull multiplier.",
},
-- keeping these in this order but with the values unchanged is terrible and I don't care
{
mode = "allEquipmentNecroEdit",
value = 3,
description = "Actors are pulled down by double the weight of all equipped gear multiplied by a hundredth of the down-pull multiplier, " ..
"except any weight above 135 only counts 10%. Lessens the gap between the lightest and heaviest heavy armours.",
},
{
mode = "encumbrancePercentage",
value = 2,
description = "Actors are pulled down by their encumbrance percentage multiplied by triple the down-pull multiplier.",
},
{
mode = "worstCaseScenario",
value = 4,
description = "Calculates results from all formulas, and uses the highest value.",
}
}

View file

@ -11,7 +11,7 @@ this.defaultConfig = {
allEquipment = 100,
encumbrancePercentage = 100
},
mode = common.modes[1].value,
mode = common.modes[1].mode,
allEquipmentWorstCaseNecroMode = true
}

View file

@ -120,7 +120,7 @@ local function sinkInWater(e)
-- calculate the down-pull with the configured formula
else
for _, t in ipairs(common.modes) do
if t.value == config.mode then
if t.mode == config.mode then
downPull, debugStr = formulas[t.mode](actor, mobile, ref)
break
end

View file

@ -31,7 +31,7 @@ local function createOptions()
local options = {}
for _, t in ipairs(common.modes) do
options[#options+1] = {label = common.camelCaseToWords(t.mode), value = t.value}
options[#options+1] = {label = common.camelCaseToWords(t.mode), value = t.mode}
end
return options