Skip to content

Commit

Permalink
Revert "sera com regen field buff/tweaks" (FAForever#3565)
Browse files Browse the repository at this point in the history
This reverts commit 0c5f779.

The generic buff function has been changed and impacts all buffs, including an adjacency bonus being capped to 3 (and not -0.2 or something similar).
  • Loading branch information
Garanas authored Nov 26, 2021
1 parent ad89d34 commit 0f3d3ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 43 deletions.
27 changes: 8 additions & 19 deletions lua/sim/Buff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -366,23 +366,16 @@ function BuffCalculate(unit, buffName, affectType, initialVal, initialBool)
local mults = 1.0
local multsTotal = 0 -- Used only for regen buffs
local bool = initialBool or false
local ceil = 0
local floor = 0
-- Dynamic ceilings and floors with fallback values for sera regen field
local ceil = 0
-- Dynamic ceilings with fallback values for sera regen field
local ceilings = {
TECH1 = 10,
TECH2 = 15,
TECH3 = 25,
EXPERIMENTAL = 40,
SUBCOMMANDER = 30
}
local floors = {
TECH1 = 3,
TECH2 = 8,
TECH3 = 15,
EXPERIMENTAL = 25,
SUBCOMMANDER = 15
}

if not unit.Buffs.Affects[affectType] then return initialVal, bool end

Expand All @@ -391,6 +384,10 @@ function BuffCalculate(unit, buffName, affectType, initialVal, initialBool)
adds = adds + (v.Add * v.Count)
end

if v.Floor then
floor = v.Floor
end

-- Take regen values from bp, keys have to match techCategory options
if v.BPCeilings then
for k_, v_ in ceilings do
Expand All @@ -399,16 +396,8 @@ function BuffCalculate(unit, buffName, affectType, initialVal, initialBool)
end
end
end
if v.BPFloors then
for k_, v_ in floors do
if v.BPFloors[k_] then
floors[k_] = v.BPFloors[k_]
end
end
end

ceil = ceilings[unit.techCategory] or 99999
floor = floors[unit.techCategory] or 3
ceil = ceilings[unit.techCategory]

if v.Mult then
if affectType == 'Regen' then
Expand All @@ -422,7 +411,7 @@ function BuffCalculate(unit, buffName, affectType, initialVal, initialBool)
if v.Mult ~= 1 then
local maxHealth = unit:GetBlueprint().Defense.MaxHealth
for i=1,v.Count do
multsTotal = multsTotal + math.min((v.Mult * maxHealth), ceil)
multsTotal = multsTotal + math.min((v.Mult * maxHealth), ceil or 99999)
end
end
else
Expand Down
12 changes: 1 addition & 11 deletions units/XSL0001/XSL0001_script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,14 @@ XSL0001 = Class(ACUUnit) {
Regen = {
Add = 0,
Mult = bp.RegenPerSecond,
Floor = bp.RegenFloor,
BPCeilings = {
TECH1 = bp.RegenCeilingT1,
TECH2 = bp.RegenCeilingT2,
TECH3 = bp.RegenCeilingT3,
EXPERIMENTAL = bp.RegenCeilingT4,
SUBCOMMANDER = bp.RegenCeilingSCU,
},
BPFloors = {
TECH1 = bp.RegenFloorT1,
TECH2 = bp.RegenFloorT2,
TECH3 = bp.RegenFloorT3,
EXPERIMENTAL = bp.RegenFloorT4,
SUBCOMMANDER = bp.RegenFloorSCU,
},
},
},
}
Expand Down Expand Up @@ -151,10 +145,6 @@ XSL0001 = Class(ACUUnit) {
Add = bp.ACUAddHealth,
Mult = 1,
},
Regen = {
Add = bp.NewRegenRate,
Mult = 1,
},
},
}
end
Expand Down
16 changes: 3 additions & 13 deletions units/XSL0001/XSL0001_unit.bp
Original file line number Diff line number Diff line change
Expand Up @@ -392,17 +392,12 @@ UnitBlueprint {
Prerequisite = 'RegenAura',
Radius = 35,
MaxHealthFactor = 1.2,
NewRegenRate = 20, --this one is for the ACU itself
RegenFloor = 15,
RegenCeilingT1 = 20,
RegenCeilingT2 = 50,
RegenCeilingT3 = 120,
RegenCeilingT4 = 240,
RegenCeilingSCU = 140,
RegenFloorT1 = 15,
RegenFloorT2 = 30,
RegenFloorT3 = 60,
RegenFloorT4 = 120,
RegenFloorSCU = 80,
RegenPerSecond = 0.01111111111,
Slot = 'LCH',
UnitCategory = 'BUILTBYTIER3FACTORY, BUILTBYQUANTUMGATE, NEEDMOBILEBUILD',
Expand Down Expand Up @@ -613,17 +608,12 @@ UnitBlueprint {
Name = '<LOC enhancements_0125>Restoration Field',
Radius = 30,
MaxHealthFactor = 1.1,
NewRegenRate = 10, --this one is for the ACU itself
RegenFloor = 3,
RegenCeilingT1 = 10,
RegenCeilingT2 = 15,
RegenCeilingT3 = 25,
RegenCeilingT4 = 40,
RegenCeilingSCU = 30,
RegenFloorT1 = 3,
RegenFloorT2 = 8,
RegenFloorT3 = 15,
RegenFloorT4 = 25,
RegenFloorSCU = 15,
RegenCeilingSCU = 30,
RegenPerSecond = 0.02,
ShowBones = {
'Left_Upgrade',
Expand Down

0 comments on commit 0f3d3ce

Please sign in to comment.