bmos
March 6th, 2021, 17:02
In 3.5E ruleset's function evalAbilityHelper, there is a simple change that can be made to allow easier automation of effects.
Specifically, this also allows 1/3 or 1/4 instead of only 1/2 multipliers used for things like [CL] or [LVL].
local sSign, sModifier, sShortAbility = sEffectAbility:match("^%[([%+%-]?)([H%d]?)([A-Z][A-Z][A-Z]?)%]$");
can be changed to
local sSign, sModifier, sShortAbility = sEffectAbility:match("^%[([%+%-]?)([HTQ%d]?)([A-Z][A-Z][A-Z]?)%]$");
and
if nAbility then
if sSign == "-" then
nAbility = 0 - nAbility;
end
if sModifier == "H" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 2);
else
nAbility = math.ceil(nAbility / 2);
end
elseif sModifier then
nAbility = nAbility * (tonumber(sModifier) or 1);
end
end
must be changed to
if nAbility then
if sSign == "-" then
nAbility = 0 - nAbility;
end
if sModifier == "H" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 2);
else
nAbility = math.ceil(nAbility / 2);
end
elseif sModifier == "T" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 3);
else
nAbility = math.ceil(nAbility / 3);
end
elseif sModifier == "Q" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 4);
else
nAbility = math.ceil(nAbility / 4);
end
elseif sModifier then
nAbility = nAbility * (tonumber(sModifier) or 1);
end
end
also, in evalEffect there is a change:
if rEffectComp.remainder[i]:match("^%[([%+%-]?)([H%d]?)([A-Z][A-Z][A-Z]?)%]$") then
must be changed to
if rEffectComp.remainder[i]:match("^%[([%+%-]?)([HTQ%d]?)([A-Z][A-Z][A-Z]?)%]$") then
I wrote this modification personally and (with my permission) it has been used in Kelrugem's FullOverlayPackage.
I have never applied any specific license to this code, nor has Kel. If I understand recent discussion about some licenses making changes not eligible for use in core rulesets, this means this change should be usable by SmiteWorks with Kel and my express permission for FG to use this code however they like in perpetuity. I hereby grant an unlimited license in perpetuity for use of this change if SmiteWorks would like. I hope Kel will also confirm this (and that it makes this eligible).
Specifically, this also allows 1/3 or 1/4 instead of only 1/2 multipliers used for things like [CL] or [LVL].
local sSign, sModifier, sShortAbility = sEffectAbility:match("^%[([%+%-]?)([H%d]?)([A-Z][A-Z][A-Z]?)%]$");
can be changed to
local sSign, sModifier, sShortAbility = sEffectAbility:match("^%[([%+%-]?)([HTQ%d]?)([A-Z][A-Z][A-Z]?)%]$");
and
if nAbility then
if sSign == "-" then
nAbility = 0 - nAbility;
end
if sModifier == "H" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 2);
else
nAbility = math.ceil(nAbility / 2);
end
elseif sModifier then
nAbility = nAbility * (tonumber(sModifier) or 1);
end
end
must be changed to
if nAbility then
if sSign == "-" then
nAbility = 0 - nAbility;
end
if sModifier == "H" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 2);
else
nAbility = math.ceil(nAbility / 2);
end
elseif sModifier == "T" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 3);
else
nAbility = math.ceil(nAbility / 3);
end
elseif sModifier == "Q" then
if nAbility > 0 then
nAbility = math.floor(nAbility / 4);
else
nAbility = math.ceil(nAbility / 4);
end
elseif sModifier then
nAbility = nAbility * (tonumber(sModifier) or 1);
end
end
also, in evalEffect there is a change:
if rEffectComp.remainder[i]:match("^%[([%+%-]?)([H%d]?)([A-Z][A-Z][A-Z]?)%]$") then
must be changed to
if rEffectComp.remainder[i]:match("^%[([%+%-]?)([HTQ%d]?)([A-Z][A-Z][A-Z]?)%]$") then
I wrote this modification personally and (with my permission) it has been used in Kelrugem's FullOverlayPackage.
I have never applied any specific license to this code, nor has Kel. If I understand recent discussion about some licenses making changes not eligible for use in core rulesets, this means this change should be usable by SmiteWorks with Kel and my express permission for FG to use this code however they like in perpetuity. I hereby grant an unlimited license in perpetuity for use of this change if SmiteWorks would like. I hope Kel will also confirm this (and that it makes this eligible).