diff --git a/bees/apiary.lua b/bees/apiary.lua index 2c0cd280ec6..98604bbabbd 100644 --- a/bees/apiary.lua +++ b/bees/apiary.lua @@ -92,7 +92,7 @@ specialFrameFunctions = { end end, copperFrame = function(data) - self.randAmount = math.random(1,2) + self.randAmount = math.random(1,2) if isHiveQueenActive(true) and areDronesActive() then if not ironFrameTimer then ironFrameTimer = data[1] @@ -105,7 +105,7 @@ specialFrameFunctions = { end end, ironFrame = function(data) - self.randAmount = math.random(1,2) + self.randAmount = math.random(1,2) if isHiveQueenActive(true) and areDronesActive() then if not ironFrameTimer then ironFrameTimer = data[1] @@ -118,7 +118,7 @@ specialFrameFunctions = { end end, tungstenFrame = function(data) - self.randAmount = math.random(1,2) + self.randAmount = math.random(1,2) if isHiveQueenActive(true) and areDronesActive() then if not ironFrameTimer then ironFrameTimer = data[1] @@ -131,7 +131,7 @@ specialFrameFunctions = { end end, titaniumFrame = function(data) - self.randAmount = math.random(1,2) + self.randAmount = math.random(1,2) if isHiveQueenActive(true) and areDronesActive() then if not ironFrameTimer then ironFrameTimer = data[1] @@ -144,7 +144,7 @@ specialFrameFunctions = { end end, durasteelFrame = function(data) - self.randAmount = math.random(1,2) + self.randAmount = math.random(1,2) if isHiveQueenActive(true) and areDronesActive() then if not ironFrameTimer then ironFrameTimer = data[1] @@ -172,7 +172,7 @@ function init() biome = world.type() -- Disabled on ship and player space stations - if biome == "unknown" then --or biome == "playerstation" then + if biome == "unknown" then --or biome == "playerstation" then script.setUpdateDelta(-1) return end @@ -527,7 +527,7 @@ function getFrames(dt) frameBonuses[stat] = true end elseif cfg.config[stat] then - -- the total frame count influences the overall stats. Take the current frame bonus and add the amount in the stack to the provided bonus + -- the total frame count influences the overall stats. Take the current frame bonus and add the amount in the stack to the provided bonus frameBonuses[stat] = (frameBonuses[stat] + cfg.config[stat]) * (1 + ((contents[frameSlot].count/100) * 0.5 )) --add total frames to total end end @@ -655,7 +655,7 @@ function queenProduction() --youngQueenProgress = youngQueenProgress + productionQueen * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.25 youngQueenProgress = youngQueenProgress + productionQueen * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.5 --sb.logInfo(youngQueenProgress) - droneProgress = droneProgress + productionDrone * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.25 + droneProgress = droneProgress + productionDrone * (math.random(beeData.productionRandomModifierRange[1],beeData.productionRandomModifierRange[2]) * 0.01) * 0.25 if youngQueenProgress >= beeData.youngQueenProductionRequirement then local produced = math.floor(youngQueenProgress / beeData.youngQueenProductionRequirement) @@ -736,11 +736,11 @@ end -- Can be called from other places (Like the frame scripts) function ageQueen(amount) --if changing this, make sure it matches in beeBuilder.lua - local fullLifespan = genelib.statFromGenomeToValue(queen.parameters.genome, "queenLifespan") * ((frameBonuses.queenLifespan or 0 / 8) + 1) - --sb.logInfo(fullLifespan) + local fullLifespan = genelib.statFromGenomeToValue(queen.parameters.genome, "queenLifespan") * ((frameBonuses.queenLifespan or 0 / 8) + 1) + --sb.logInfo(fullLifespan) if not queen.parameters.lifespan or queen.parameters.lifespan < 0 then - queen.parameters.lifespan = fullLifespan + queen.parameters.lifespan = fullLifespan end @@ -993,21 +993,21 @@ function miteGrowth() --sb.logInfo("%s",sDBG) --display an infested hive image over the normal hive appearance if its infested enough - if storage.mites > 20 then --if mites pass 20, display a really rotten looking apiary - animator.setAnimationState("base", "infested2", true) - animator.setAnimationState("warning", "on", true) - elseif storage.mites > 6 then --if mites pass 6, display a rotten looking apiary - animator.setAnimationState("base", "infested", true) - animator.setAnimationState("warning", "on", true) + if storage.mites > 20 then --if mites pass 20, display a really rotten looking apiary + animator.setAnimationState("base", "infested2", true) + animator.setAnimationState("warning", "on", true) + elseif storage.mites > 6 then --if mites pass 6, display a rotten looking apiary + animator.setAnimationState("base", "infested", true) + animator.setAnimationState("warning", "on", true) elseif storage.mites > 0.98 then - animator.setAnimationState("warning", "on", true) --show symbol for mite infestation, but dont change apiary look + animator.setAnimationState("warning", "on", true) --show symbol for mite infestation, but dont change apiary look else - animator.setAnimationState("base", "default", true) - animator.setAnimationState("warning", "off", true) + animator.setAnimationState("base", "default", true) + animator.setAnimationState("warning", "off", true) end -- elseif fartstick <= beeData.mites.infestationChance then elseif math.random() <= beeData.mites.infestationChance then - storage.mites = beeData.mites.growthStatic --storage.mites = storage.mites + (storage.mites*mult) - (hiveMiteResistance) + storage.mites = beeData.mites.growthStatic --storage.mites = storage.mites + (storage.mites*mult) - (hiveMiteResistance) end end @@ -1120,27 +1120,27 @@ function getBiomeFavor(name) --frame immunity to biomes if frameBonuses.radResistance then if (biome == "alien") or (biome == "jungle") or (biome == "barren") or (biome == "barren2") or (biome == "barren3") or (biome == "chromatic") or (biome == "irradiated") or (biome == "metallicmoon") then - if (favor < 2) then - favor = 2 - end + if (favor < 2) then + favor = 2 + end end elseif frameBonuses.coldResistance then if (biome == "snow") or (biome == "arctic") or (biome == "snowdark") or (biome == "arcticdark") or (biome == "tundra") or (biome == "tundradark") or (biome == "crystalmoon") or (biome == "frozenvolcanic") or (biome == "icemoon") or (biome == "icewaste") or (biome == "icewastedark") or (biome == "nitrogensea") then - if (favor < 2) then - favor = 2 - end + if (favor < 2) then + favor = 2 + end end elseif frameBonuses.heatResistance then if (biome == "desert") or (biome == "volcanic") or (biome == "volcanicdark") or (biome == "magma") or (biome == "magmadark") or (biome == "desertwastes") or (biome == "desertwastesdark") or (biome == "infernus") or (biome == "infernusdark") or (biome == "frozenvolcanic") then - if (favor < 2) then - favor = 2 - end + if (favor < 2) then + favor = 2 + end end elseif frameBonuses.physicalResistance then - if (biome == "toxic") or (biome == "moon") or (biome == "scorched") or (biome == "scorchedcity") or (biome == "volcanic") or (biome == "volcanicdark") or (biome == "savannah") or (biome == "jungle") or (biome == "thickjungle") or (biome == "sulphuric") or (biome == "sulphuricdark") or (biome == "tidewater") then - if (favor < 2) then - favor = 2 - end + if (biome == "toxic") or (biome == "moon") or (biome == "scorched") or (biome == "scorchedcity") or (biome == "volcanic") or (biome == "volcanicdark") or (biome == "savannah") or (biome == "jungle") or (biome == "thickjungle") or (biome == "sulphuric") or (biome == "sulphuricdark") or (biome == "tidewater") then + if (favor < 2) then + favor = 2 + end end end diff --git a/interface/scripted/fu_upgradetable/fu_upgradetable.lua b/interface/scripted/fu_upgradetable/fu_upgradetable.lua index b2ef0b29c87..3d9320a1817 100644 --- a/interface/scripted/fu_upgradetable/fu_upgradetable.lua +++ b/interface/scripted/fu_upgradetable/fu_upgradetable.lua @@ -169,40 +169,44 @@ function populateItemList(forceRepop) local upgradableItems={} for i = 1, #upgradeableWeaponItems do - local monkeys=deepSizeOf(upgradeableWeaponItems[i]) - if monkeys <=250 then - upgradeableWeaponItems[i].count = 1 - local itemLevel - if upgradeableWeaponItems[i].parameters.level then - itemLevel = upgradeableWeaponItems[i].parameters.level - else - local itemConfig = root.itemConfig(upgradeableWeaponItems[i]) - if itemConfig.config.level then - itemLevel = itemConfig.config.level + if (not upgradeableWeaponItems[i].parameters.itemTags) or contains(upgradeableWeaponItems[i].parameters.itemTags,"upgradeableWeapon") then + local monkeys=deepSizeOf(upgradeableWeaponItems[i]) + if monkeys <=250 then + upgradeableWeaponItems[i].count = 1 + local itemLevel + if upgradeableWeaponItems[i].parameters.level then + itemLevel = upgradeableWeaponItems[i].parameters.level else - itemLevel = 1 + local itemConfig = root.itemConfig(upgradeableWeaponItems[i]) + if itemConfig.config.level then + itemLevel = itemConfig.config.level + else + itemLevel = 1 + end end + table.insert(upgradableItems,{itemData=upgradeableWeaponItems[i],itemType="weapon",itemLevel=itemLevel}) end - table.insert(upgradableItems,{itemData=upgradeableWeaponItems[i],itemType="weapon",itemLevel=itemLevel}) end end for i = 1, #upgradeableToolItems do - local monkeys=deepSizeOf(upgradeableToolItems[i]) - if monkeys <=250 then - upgradeableToolItems[i].count = 1 - local itemLevel - if upgradeableToolItems[i].parameters.level then - itemLevel = upgradeableToolItems[i].parameters.level - else - local itemConfig = root.itemConfig(upgradeableToolItems[i]) - if itemConfig.config.level then - itemLevel = itemConfig.config.level + if (not upgradeableToolItems[i].parameters.itemTags) or contains(upgradeableToolItems[i].parameters.itemTags,"upgradeableWeapon") then + local monkeys=deepSizeOf(upgradeableToolItems[i]) + if monkeys <=250 then + upgradeableToolItems[i].count = 1 + local itemLevel + if upgradeableToolItems[i].parameters.level then + itemLevel = upgradeableToolItems[i].parameters.level else - itemLevel = 1 + local itemConfig = root.itemConfig(upgradeableToolItems[i]) + if itemConfig.config.level then + itemLevel = itemConfig.config.level + else + itemLevel = 1 + end end + table.insert(upgradableItems,{itemData=upgradeableToolItems[i],itemType="tool", itemLevel=itemLevel}) end - table.insert(upgradableItems,{itemData=upgradeableToolItems[i],itemType="tool", itemLevel=itemLevel}) end end diff --git a/monsters/pandorasboxmonsterscripts/pandorasboxsimplefarmablemonster.lua b/monsters/pandorasboxmonsterscripts/pandorasboxsimplefarmablemonster.lua index e356ac15098..e3dcc606fdf 100644 --- a/monsters/pandorasboxmonsterscripts/pandorasboxsimplefarmablemonster.lua +++ b/monsters/pandorasboxmonsterscripts/pandorasboxsimplefarmablemonster.lua @@ -4,6 +4,7 @@ require "/scripts/util.lua" local originalUpdate = update local originalInit = init +local cacheHarvestTime function init() originalInit() @@ -12,51 +13,63 @@ function init() return math.max(storage.harvestTime - (world.time() - storage.lastHarvest), 0) end end) + cacheHarvestTime=config.getParameter("harvestTime") end function resetMonsterHarvest() - storage.lastHarvest = world.time() - harvestTimeLeft = config.getParameter("pandorasboxHarvestTimeLeft") - if not storage.harvestTime and harvestTimeLeft then - storage.harvestTime = harvestTimeLeft - else - storage.harvestTime = util.randomInRange(config.getParameter("harvestTime")) - end + cacheHarvestTime=config.getParameter("harvestTime") + storage.lastHarvest = world.time() + harvestTimeLeft = config.getParameter("pandorasboxHarvestTimeLeft") + if not storage.harvestTime and harvestTimeLeft then + storage.harvestTime = harvestTimeLeft + else + storage.harvestTime = util.randomInRange(cacheHarvestTime) + end +end + +function resolveStageDuration(dur) + if type(dur)=="table" then + return math.max(unpack(dur)) + else + return dur + end end function hasMonsterHarvest(args, board) - if not storage.lastHarvest then - resetMonsterHarvest() - end - - if world.time() - storage.lastHarvest >= storage.harvestTime then - return true - else - return false - end + local harvestMath=(world.time() - storage.lastHarvest) + if (not storage.lastHarvest) or ((not cacheHarvestTime) or (harvestMath<0) or (harvestMath>=(resolveStageDuration(cacheHarvestTime))*100)) then + resetMonsterHarvest() + return false + end + + if harvestMath >= storage.harvestTime then + return true + else + return false + end end function update(dt) - originalUpdate(dt) - if config.getParameter("wildHarvestable") or config.getParameter("ownerUuid") then - monster.setInteractive(hasMonsterHarvest()) - end + originalUpdate(dt) + if config.getParameter("wildHarvestable") or config.getParameter("ownerUuid") then + monster.setInteractive(hasMonsterHarvest()) + end end function dropMonsterHarvest(args, board) - local treasurePool = config.getParameter("harvestPool") - local treasure = root.createTreasure(treasurePool, monster.level()) - local spawnPosition = vec2.add(mcontroller.position(), config.getParameter("harvestSpawnOffset", {0, 0})) - - for _,item in pairs(treasure) do - world.spawnItem(item, spawnPosition) - end - resetMonsterHarvest() - return true + local treasurePool = config.getParameter("harvestPool") + local treasure = root.createTreasure(treasurePool, monster.level()) + local spawnPosition = vec2.add(mcontroller.position(), config.getParameter("harvestSpawnOffset", {0, 0})) + + for _,item in pairs(treasure) do + world.spawnItem(item, spawnPosition) + end + resetMonsterHarvest() + return true end function interact() -if hasMonsterHarvest() then -dropMonsterHarvest() - end + if hasMonsterHarvest() then + dropMonsterHarvest() + end end diff --git a/objects/gels/isn_accelgel/isn_accelgel.lua b/objects/gels/isn_accelgel/isn_accelgel.lua index 5036456d50d..2a75b1c84b2 100644 --- a/objects/gels/isn_accelgel/isn_accelgel.lua +++ b/objects/gels/isn_accelgel/isn_accelgel.lua @@ -1,17 +1,20 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - animator.setParticleEmitterOffsetRegion("yellow", mcontroller.boundBox()) - animator.setParticleEmitterActive("yellow", true) - animator.setParticleEmitterOffsetRegion("cyan", mcontroller.boundBox()) - animator.setParticleEmitterActive("cyan", true) + animator.setParticleEmitterOffsetRegion("yellow", mcontroller.boundBox()) + animator.setParticleEmitterActive("yellow", true) + animator.setParticleEmitterOffsetRegion("cyan", mcontroller.boundBox()) + animator.setParticleEmitterActive("cyan", true) end function update(dt) - mcontroller.controlModifiers({ - groundMovementModifier = 0.75, - runModifier = 0.75, - jumpModifier = 0.5 - }) + applyFilteredModifiers({ + groundMovementModifier = 0.75, + speedModifier = 0.75, + airJumpModifier = 0.5 + }) end function uninit() + filterModifiers({},true) end diff --git a/projectiles/guns/a_sciencemod/isn_irradiator/isn_irradiation.lua b/projectiles/guns/a_sciencemod/isn_irradiator/isn_irradiation.lua index 38eb59b752d..b50971f38a1 100644 --- a/projectiles/guns/a_sciencemod/isn_irradiator/isn_irradiation.lua +++ b/projectiles/guns/a_sciencemod/isn_irradiator/isn_irradiation.lua @@ -1,36 +1,38 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - script.setUpdateDelta(5) - self.tickTimer = 1 - self.pulseTimer = 0 - self.halfPi = math.pi / 2 + script.setUpdateDelta(5) + self.tickTimer = 1 + self.pulseTimer = 0 + self.halfPi = math.pi / 2 end function update(dt) - mcontroller.controlModifiers({ - runModifier = -0.35, - jumpModifier = -0.4 - }) + applyFilteredModifiers({ + speedModifier = 0.65, + airJumpModifier = 0.6 + }) - self.tickTimer = self.tickTimer - dt - if self.tickTimer <= 0 then - self.tickTimer = 1 - status.applySelfDamageRequest({ - damageType = "IgnoresDef", - damageKind = "radioactive", - damage = 0.06 * status.resourceMax("health"), - sourceEntityId = entity.id() - }) - end + self.tickTimer = self.tickTimer - dt + if self.tickTimer <= 0 then + self.tickTimer = 1 + status.applySelfDamageRequest({ + damageType = "IgnoresDef", + damageKind = "radioactive", + damage = 0.06 * status.resourceMax("health"), + sourceEntityId = entity.id() + }) + end - self.pulseTimer = self.pulseTimer + dt * 2 - if self.pulseTimer >= math.pi then - self.pulseTimer = self.pulseTimer - math.pi - end + self.pulseTimer = self.pulseTimer + dt * 2 + if self.pulseTimer >= math.pi then + self.pulseTimer = self.pulseTimer - math.pi + end - local pulseMagnitude = math.floor(math.cos(self.pulseTimer - self.halfPi) * 16) / 16 - effect.setParentDirectives(string.format("fade=00AA00=%.3f?border=2;00FF00%2x;00000000", (pulseMagnitude * 0.3 + 0.1), math.floor(pulseMagnitude * 70) + 10)) + local pulseMagnitude = math.floor(math.cos(self.pulseTimer - self.halfPi) * 16) / 16 + effect.setParentDirectives(string.format("fade=00AA00=%.3f?border=2;00FF00%2x;00000000", (pulseMagnitude * 0.3 + 0.1), math.floor(pulseMagnitude * 70) + 10)) end function uninit() - -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/projectiles/mushroom/shroomcloud/shroomburst.lua b/projectiles/mushroom/shroomcloud/shroomburst.lua index 6f9134b1105..f8a96c175d9 100644 --- a/projectiles/mushroom/shroomcloud/shroomburst.lua +++ b/projectiles/mushroom/shroomcloud/shroomburst.lua @@ -1,35 +1,37 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - script.setUpdateDelta(5) - self.tickTimer = 1 - self.pulseTimer = 0 - self.halfPi = math.pi / 2 + script.setUpdateDelta(5) + self.tickTimer = 1 + self.pulseTimer = 0 + self.halfPi = math.pi / 2 end function update(dt) - mcontroller.controlModifiers({ - runModifier = -0.55, - jumpModifier = -0.35 - }) + applyFilteredModifiers({ + speedModifier = 0.55, + airJumpModifier = 0.65 + }) - self.tickTimer = self.tickTimer - dt - if self.tickTimer <= 0 then - self.tickTimer = 1 - status.applySelfDamageRequest({ - damageType = "IgnoresDef", - damage = 0.054 * status.resourceMax("health"), - sourceEntityId = entity.id() - }) - end + self.tickTimer = self.tickTimer - dt + if self.tickTimer <= 0 then + self.tickTimer = 1 + status.applySelfDamageRequest({ + damageType = "IgnoresDef", + damage = 0.054 * status.resourceMax("health"), + sourceEntityId = entity.id() + }) + end - self.pulseTimer = self.pulseTimer + dt * 2 - if self.pulseTimer >= math.pi then - self.pulseTimer = self.pulseTimer - math.pi - end + self.pulseTimer = self.pulseTimer + dt * 2 + if self.pulseTimer >= math.pi then + self.pulseTimer = self.pulseTimer - math.pi + end - local pulseMagnitude = math.floor(math.cos(self.pulseTimer - self.halfPi) * 16) / 16 - effect.setParentDirectives(string.format("fade=00AA00=%.3f?border=2;00FF00%2x;00000000", (pulseMagnitude * 0.3 + 0.1), math.floor(pulseMagnitude * 70) + 10)) + local pulseMagnitude = math.floor(math.cos(self.pulseTimer - self.halfPi) * 16) / 16 + effect.setParentDirectives(string.format("fade=00AA00=%.3f?border=2;00FF00%2x;00000000", (pulseMagnitude * 0.3 + 0.1), math.floor(pulseMagnitude * 70) + 10)) end function uninit() - -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/projectiles/throwable/ise3/crystalliteshard.projectile b/projectiles/throwable/ise3/crystalliteshard.projectile index f7a759f3b1f..9aa748c078a 100644 --- a/projectiles/throwable/ise3/crystalliteshard.projectile +++ b/projectiles/throwable/ise3/crystalliteshard.projectile @@ -62,6 +62,7 @@ "angleAdjust" : 35 } ], + "statusEffects" : [ "runboostdebuff" ], "power" : 100.0, "damageKind" : "electricplasma", "emitters" : [ "daggerblue" ] diff --git a/scripts/FRHelper.lua b/scripts/FRHelper.lua index d06e06c6c71..7d00ee591a8 100644 --- a/scripts/FRHelper.lua +++ b/scripts/FRHelper.lua @@ -1,3 +1,4 @@ +require "/stats/effects/fu_statusUtil.lua" require("/scripts/util.lua") FRHelper = {} @@ -188,7 +189,7 @@ function FRHelper:applyControlModifiers(cM, cP) if type(cM)=="table" then --sb.logInfo("FRHelper:applyControlModifiers:cM %s",cM) --mcontroller.controlModifiers(cM or self.controlModifiers or {}) - mcontroller.controlModifiers(filterModifiers(copy(cM))) + applyFilteredModifiers(cM) end if type(cP)=="table" then --sb.logInfo("FRHelper:applyControlParameters:cP %s",cP) @@ -197,12 +198,6 @@ function FRHelper:applyControlModifiers(cM, cP) end end -function filterModifiers(stuff) - if (status.statPositive("spikeSphereActive") and 1.0) and stuff["speedModifier"] then stuff["speedModifier"]=1.0 end - return stuff -end - - -- Load the given script (scripts without context are added to "racialscript" instead) function FRHelper:loadScript(script) local contexts = script.contexts diff --git a/scripts/fr_scripts/foodRush.lua b/scripts/fr_scripts/foodRush.lua index 74296e73c65..292963eef81 100644 --- a/scripts/fr_scripts/foodRush.lua +++ b/scripts/fr_scripts/foodRush.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + --[[ Provides a speed bonus that increases when you're well fed. @@ -20,7 +22,7 @@ function FRHelper:call(args) else foodValue = args.foodDefault end - + statusUtilHandle("foodRush") foodValue = foodValue / args.speedFactor - mcontroller.controlModifiers({ speedModifier=(status.statPositive("spikeSphereActive") and 1.0) or util.lerp(foodValue, args.minSpeed, args.maxSpeed) }) + applyFilteredModifiers({ speedModifier=util.lerp(foodValue, args.minSpeed, args.maxSpeed) }) end diff --git a/scripts/fubasictilegroundeffects.lua b/scripts/fubasictilegroundeffects.lua index 94f5e3a2c1c..b0508d87264 100644 --- a/scripts/fubasictilegroundeffects.lua +++ b/scripts/fubasictilegroundeffects.lua @@ -1,3 +1,6 @@ +require "/scripts/furesearchGenerators.lua" +require "/stats/effects/fu_statusUtil.lua" + local tileEffects_Init = init local tileEffects_Update = update local applyTileEffects @@ -8,8 +11,6 @@ tileEffects = {} currentTile = {} collisionParams = {} -require "/scripts/furesearchGenerators.lua" - function init(...) tileMaterials() self.airJumpModifier = 1 @@ -29,7 +30,7 @@ function update(dt,...) local softness = 1 self.position = mcontroller.position() if not onGround and self.airJumpModifier ~= 1 then - mcontroller.controlModifiers({airJumpModifier = self.airJumpModifier}) + applyFilteredModifiers({airJumpModifier = self.airJumpModifier}) end @@ -88,7 +89,7 @@ end applyTileEffects = function(groundMat) status.addEphemeralEffects(currentTile["effects"]) - mcontroller.controlModifiers(currentTile["controlModifiers"]) + applyFilteredModifiers(currentTile["controlModifiers"]) mcontroller.controlParameters(currentTile["controlParameters"]) local airJumpModifier = currentTile.controlModifiers.airJumpModifier diff --git a/scripts/pandorasbox/objects/pandorasboxfarmableobject.lua b/scripts/pandorasbox/objects/pandorasboxfarmableobject.lua index f3348a10f99..0f0db29e60d 100644 --- a/scripts/pandorasbox/objects/pandorasboxfarmableobject.lua +++ b/scripts/pandorasbox/objects/pandorasboxfarmableobject.lua @@ -20,11 +20,22 @@ function init() end end +function resolveStageDuration(dur) + if type(dur)=="table" then + return math.max(unpack(dur)) + else + return dur + end +end + function update(dt) storage.groundPositions = storage.groundPositions or getGroundPositions() if storage.lastHarvest then if storage.stage and not storage.harvestable then - if world.time() - storage.lastHarvest >= storage.harvestTime then + local harvestMath=(world.time() - storage.lastHarvest) + if (harvestMath<0) or (harvestMath>(resolveStageDuration(stages[stage].duration))*100) then + storage.harvestTime=util.randomInRange(stages[stage].duration)+world.time() + elseif harvestMath >= storage.harvestTime then if checkForMoisture(true) then grow() end @@ -158,4 +169,4 @@ function checkForMoisture(consume) if #modData > 0 then return true end -end \ No newline at end of file +end diff --git a/species/avali.raceeffect b/species/avali.raceeffect index f86690583bf..efceb3c7f5c 100644 --- a/species/avali.raceeffect +++ b/species/avali.raceeffect @@ -28,8 +28,8 @@ { "stat" : "maxHealth", "effectiveMultiplier" : 0.75 } ], "controlModifiers" : { - "speedModifier" : 0.9, - "jumpModifier" : 1 + "speedModifier" : 0.9//, + //"airJumpModifier" : 1//if you actually want this to do anything it needs to be airjumpmodifier with a value outside 1.0. } } ], @@ -97,4 +97,4 @@ } }, "tech" : [ "flight_avali" ] -} \ No newline at end of file +} diff --git a/species/calliote.raceeffect b/species/calliote.raceeffect new file mode 100644 index 00000000000..f245f132ef3 --- /dev/null +++ b/species/calliote.raceeffect @@ -0,0 +1,10 @@ +{ + "scripts" : [ + { + "script" : "/scripts/fr_scripts/speciesredirect.lua", + "args" : { + "species" : "callistan" + } + } + ] +} \ No newline at end of file diff --git a/species/calliotes.species.patch b/species/calliotes.species.patch new file mode 100644 index 00000000000..a33eab41289 --- /dev/null +++ b/species/calliotes.species.patch @@ -0,0 +1,24 @@ +[ + { "op": "replace", + "path" : "/charCreationTooltip/description" , + "value" : "Space wolves with a love for energy weapons and tech. They're swift and extremely mobile, navigating almost any terrain, but a tad on the fragile side. + + ^orange;Diet^reset;: Carnivore + +^orange;Perks^reset;: + Speed modified by hunger: from ^red;0.9^reset;x when starving to ^green;1.1^reset;x when full. + Damage x^green;1.05^reset;, Energy x^green;1.12^reset; + ^green;Resist^reset;: ^green;20^reset;% Shadow, Radiation, Fire, ^green;30^reset;% Ice + ^cyan;Immune^reset;: Slush, Snow, Soil, Mud, Web and Sandstorm effects + +^orange;Environment^reset;: + ^green;Lush, Forest and Tundra^reset; biomes: Damage x^green;1.1^reset;, Health x^green;1.15^reset; + +^orange;Weapons^reset;: + Energy Weapons: +^green;3^reset;% Crit Chance, +^green;25^reset;% E. Regen + +^red;Weaknesses^reset;: + ^red;Resist^reset;: -^red;20^reset;% Cosmic, Poison. -^red;30^reset;% Electric + Max Food x^red;0.6^reset;" + } +] diff --git a/species/callistan.raceeffect b/species/callistan.raceeffect index c3d7f42f9c0..8e988217b76 100644 --- a/species/callistan.raceeffect +++ b/species/callistan.raceeffect @@ -42,8 +42,8 @@ "args" : { "foodDefault" : 0.5, "speedFactor" : 4.25, - "minSpeed" : 0.0, - "maxSpeed" : 0.2 + "minSpeed" : 0.9, + "maxSpeed" : 1.1 } } ] diff --git a/species/callistan.species.patch b/species/callistan.species.patch index 4b835fc5ba2..a33eab41289 100644 --- a/species/callistan.species.patch +++ b/species/callistan.species.patch @@ -6,7 +6,7 @@ ^orange;Diet^reset;: Carnivore ^orange;Perks^reset;: - Staying fed increases speed (max +^green;16.6^reset;%) + Speed modified by hunger: from ^red;0.9^reset;x when starving to ^green;1.1^reset;x when full. Damage x^green;1.05^reset;, Energy x^green;1.12^reset; ^green;Resist^reset;: ^green;20^reset;% Shadow, Radiation, Fire, ^green;30^reset;% Ice ^cyan;Immune^reset;: Slush, Snow, Soil, Mud, Web and Sandstorm effects diff --git a/species/calskies.species.patch b/species/calskies.species.patch index 5af4f31fb30..a33eab41289 100644 --- a/species/calskies.species.patch +++ b/species/calskies.species.patch @@ -6,7 +6,7 @@ ^orange;Diet^reset;: Carnivore ^orange;Perks^reset;: - Staying fed increases speed (max +^green;16.6^reset;%) + Speed modified by hunger: from ^red;0.9^reset;x when starving to ^green;1.1^reset;x when full. Damage x^green;1.05^reset;, Energy x^green;1.12^reset; ^green;Resist^reset;: ^green;20^reset;% Shadow, Radiation, Fire, ^green;30^reset;% Ice ^cyan;Immune^reset;: Slush, Snow, Soil, Mud, Web and Sandstorm effects @@ -20,5 +20,5 @@ ^red;Weaknesses^reset;: ^red;Resist^reset;: -^red;20^reset;% Cosmic, Poison. -^red;30^reset;% Electric Max Food x^red;0.6^reset;" - } -] \ No newline at end of file + } +] diff --git a/stats/__STAT_LIST.TXT b/stats/__STAT_LIST.TXT index e42564441ef..622a5238269 100644 --- a/stats/__STAT_LIST.TXT +++ b/stats/__STAT_LIST.TXT @@ -145,7 +145,9 @@ OTHER: powerMultiplier [armorStatB] [1-Relative] knockbackThreshold [any] [Unknown. Default: 9] fallDamageMultiplier [effectiveMultiplier] [1-Relative] DO NOT use baseMultiplier. We want to avoid players getting fall damage immunity from additive sources. - jumpModifier [amount] [1-Relative] vanilla thing. + + jumpModifier [amount] [0-Relative] vanilla. this is used for AI in pathing.lua, it has no effect outside AI pathing. for modifying actual jump stats, use controlModifier:airJumpModifier. if controlModifier:airJumpModifier is 2.3, this stat should be +1.3. + activeMovementAbilities [amount] [0-Relative] Typically Binary (0 or 1), used to block movement related abilities. vanilla. arrowSpeedMultiplier [amount] [0-relative] additive multiplier to projectile speed on bows. diff --git a/stats/bonuses/callistanFoodRush.lua b/stats/bonuses/callistanFoodRush.lua deleted file mode 100644 index c24a6c500c1..00000000000 --- a/stats/bonuses/callistanFoodRush.lua +++ /dev/null @@ -1,10 +0,0 @@ -function update(dt) - if status.isResource("food") then - self.foodValue = status.resource("food") - else - self.foodValue = 35 - end - - self.foodValue = (self.foodValue / 4.25)/100 - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or (1 + math.max(0.1, self.foodValue))}) -end diff --git a/stats/bonuses/callistanFoodRush.statuseffect b/stats/bonuses/callistanFoodRush.statuseffect deleted file mode 100644 index 97ad48bb7b3..00000000000 --- a/stats/bonuses/callistanFoodRush.statuseffect +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name" : "callistanFoodRush", - "effectConfig" : { - //Core attributes - "healthBonus" : 0.0, - "energyBonus" : 0.12, - "attackBonus" : 1.05, - "defenseBonus" : 0, - - //Resistances - "physicalResistance" : 0, - "electricResistance" : -0.3, - "fireResistance" : 0.2, - "iceResistance" : 0.3, - "poisonResistance" : -0.2, - "shadowResistance" : 0.2, - "cosmicResistance" : -0.2, - "radioactiveResistance" : 0.2 - }, - - "defaultDuration" : 3, - - "scripts" : [ - "callistanFoodRush.lua" - ] - -} diff --git a/stats/bonuses/undergroundBonus.lua b/stats/bonuses/undergroundBonus.lua index 4449089dece..708be46a580 100644 --- a/stats/bonuses/undergroundBonus.lua +++ b/stats/bonuses/undergroundBonus.lua @@ -1,38 +1,30 @@ +require "/stats/effects/fu_statusUtil.lua" require("/scripts/util.lua") function init() - self.species = world.entitySpecies(entity.id()) - if not self.species then return end + self.species = world.entitySpecies(entity.id()) + if not self.species then return end - self.raceConfig = root.assetJson("/species/greckan.raceeffect") + self.raceConfig = root.assetJson("/species/greckan.raceeffect") - underground = undergroundCheck() + underground = undergroundCheck() - script.setUpdateDelta(10) -end - -function undergroundCheck() - if not self.raceConfig.undergroundBonus then return false end - return world.underground(mcontroller.position()) + script.setUpdateDelta(10) end function update(dt) - if not self.raceConfig then init() end - - underground = undergroundCheck() - if underground then - status.setPersistentEffects("undergroundBonus", self.raceConfig.undergroundBonus.stats) - mcontroller.controlModifiers(filterModifiers(copy(self.raceConfig.undergroundBonus.stats))) - else - status.clearPersistentEffects("undergroundBonus") - end + if not self.raceConfig then init() end + + underground = undergroundCheck() + if underground then + status.setPersistentEffects("undergroundBonus", self.raceConfig.undergroundBonus.stats) + applyFilteredModifiers(self.raceConfig.undergroundBonus.stats) + else + status.clearPersistentEffects("undergroundBonus") + end end function uninit() - status.clearPersistentEffects("undergroundBonus") -end - -function filterModifiers(stuff) - if (status.statPositive("spikeSphereActive") and 1.0) and stuff["speedModifier"] then stuff["speedModifier"]=1.0 end - return stuff + filterModifiers({},true) + status.clearPersistentEffects("undergroundBonus") end diff --git a/stats/deprecated/callistanFoodRush.statuseffect b/stats/deprecated/callistanFoodRush.statuseffect new file mode 100644 index 00000000000..7bcff742110 --- /dev/null +++ b/stats/deprecated/callistanFoodRush.statuseffect @@ -0,0 +1,10 @@ +{ + "name" : "callistanFoodRush", + + "defaultDuration" : 0, + + "scripts" : [ + "deprecated.lua" + ] + +} diff --git a/stats/effects/food/bonus/foodbonus.lua b/stats/effects/food/bonus/foodbonus.lua index 6ca048f58d6..9d88c9bae09 100644 --- a/stats/effects/food/bonus/foodbonus.lua +++ b/stats/effects/food/bonus/foodbonus.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() local foodStats=config.getParameter("stats") if foodStats then @@ -8,11 +10,11 @@ end function update(dt) if self.foodControlMods then - mcontroller.controlModifiers(filterModifiers(copy(self.foodControlMods))) + applyFilteredModifiers(self.foodControlMods) end end -function filterModifiers(stuff) - if (status.statPositive("spikeSphereActive") and 1.0) and stuff["speedModifier"] then stuff["speedModifier"]=1.0 end - return stuff + +function uninit() + filterModifiers({},true) end diff --git a/stats/effects/food/penalty/foodpenalty.lua b/stats/effects/food/penalty/foodpenalty.lua index 2e5383cfe5d..3f6efe1f413 100644 --- a/stats/effects/food/penalty/foodpenalty.lua +++ b/stats/effects/food/penalty/foodpenalty.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() self.tickDamagePercentage = config.getParameter("poisonPercent", 0.005) self.tickTime = config.getParameter("poisonSpeed", 2) @@ -22,16 +24,21 @@ function update(dt) damageSourceKind = "poison", sourceEntityId = entity.id() }) - mcontroller.controlModifiers({ airJumpModifier = 0.08, speedModifier = 0.08 }) + local modifierSet=self.foodControlMods or {} + modifierSet.airJumpModifier=0.08 + modifierSet.speedModifier=0.08 + applyFilteredModifiers(modifierSet) effect.setParentDirectives("fade=806e4f="..self.tickTimer * 0.25) status.removeEphemeralEffect("wellfed") if status.resourcePercentage("food") > 0.85 then status.setResourcePercentage("food", 0.85) end + else + if self.foodControlMods then + applyFilteredModifiers(self.foodControlMods) + end end - if self.foodControlMods then - mcontroller.controlModifiers(self.foodControlMods) - end end function uninit() + filterModifiers({},true) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/bees/queensetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/bees/queensetbonuseffect.lua index 61ce458653c..e6970ff39dc 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/bees/queensetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/bees/queensetbonuseffect.lua @@ -27,8 +27,8 @@ function update(dt) else checkWeapons() end - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.25, + applyFilteredModifiers({ + speedModifier = 1.25, airJumpModifier = 1.15 }) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier1/leathersetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier1/leathersetbonuseffect.lua index 733069db0ef..22b01342b9b 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier1/leathersetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier1/leathersetbonuseffect.lua @@ -33,7 +33,7 @@ function update(dt) else checkArmor() checkWeapons() - mcontroller.controlModifiers({speed=1.025}) + applyFilteredModifiers({speed=1.025}) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier1/missionarysetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier1/missionarysetbonuseffect.lua index e8c44549b96..19504c18d92 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier1/missionarysetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier1/missionarysetbonuseffect.lua @@ -23,7 +23,7 @@ function update(dt) effect.expire() else checkWeapons() - mcontroller.controlModifiers({speedModifier=(status.statPositive("spikeSphereActive") and 1.0) or 1.05,jumpModifier=1.05}) + applyFilteredModifiers({speedModifier=1.05,airJumpModifier=1.05}) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier1/streakersetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier1/streakersetbonuseffect.lua index 8db6d4b85d7..42c4cf71a7b 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier1/streakersetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier1/streakersetbonuseffect.lua @@ -28,7 +28,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.20,airJumpModifier = 1.20}) + applyFilteredModifiers({speedModifier = 1.2,airJumpModifier = 1.2}) self.timer=(self.timer or 0) + dt if self.timer > 1.0 then diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/blistersetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/blistersetbonuseffect.lua index d21af057c9c..23f957d4e7c 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/blistersetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/blistersetbonuseffect.lua @@ -24,7 +24,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05}) + applyFilteredModifiers({speedModifier = 1.05}) checkWeapons() end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/operativesetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/operativesetbonuseffect.lua index a57539ab4b5..e270060bc13 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/operativesetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/operativesetbonuseffect.lua @@ -15,6 +15,6 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier=(status.statPositive("spikeSphereActive") and 1.0) or 1.08,jumpModifier=1.08}) + applyFilteredModifiers({speedModifier=1.08,airJumpModifier=1.08}) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/radienleathersetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/radienleathersetbonuseffect.lua index 89fe081effe..b4a6476cab9 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/radienleathersetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/radienleathersetbonuseffect.lua @@ -29,8 +29,8 @@ function update(dt) else checkWeapons() checkPlanet() - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05 + applyFilteredModifiers({ + speedModifier = 1.05 }) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/radientungstensetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/radientungstensetbonuseffect.lua index 46e692d204e..531a33282a9 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/radientungstensetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/radientungstensetbonuseffect.lua @@ -29,8 +29,8 @@ function update(dt) else checkWeapons() checkPlanet() - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05 + applyFilteredModifiers({ + speedModifier = 1.05 }) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/reconsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/reconsetbonuseffect.lua index 1ae1603b707..68fca505036 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/reconsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/reconsetbonuseffect.lua @@ -22,7 +22,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05}) + applyFilteredModifiers({speedModifier = 1.05}) checkWeapons() end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/sanguinesetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/sanguinesetbonuseffect.lua index 66af8562d66..0f22d0d0554 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/sanguinesetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/sanguinesetbonuseffect.lua @@ -21,7 +21,7 @@ function update(dt) --setRegen(0) effect.expire() else - mcontroller.controlModifiers({speedModifier = 1.10}) + applyFilteredModifiers({speedModifier = 1.10}) checkWeapons() --setRegen(0.005) end @@ -34,4 +34,4 @@ function checkWeapons() else effect.setStatModifierGroup(effectHandlerList.weaponBonusHandle,{}) end -end \ No newline at end of file +end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/swashbucklersetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/swashbucklersetbonuseffect.lua index 3554f770484..1ff36231fa5 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/swashbucklersetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/swashbucklersetbonuseffect.lua @@ -23,7 +23,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({jump=1.08}) + applyFilteredModifiers({airJumpModifier=1.08}) checkWeapons() end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier2/vagabondsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier2/vagabondsetbonuseffect.lua index 823ef2b84fc..1ebfd2cb48b 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier2/vagabondsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier2/vagabondsetbonuseffect.lua @@ -17,7 +17,7 @@ function update(dt) effect.expire() else checkWeapons() - mcontroller.controlModifiers({speedModifier=(status.statPositive("spikeSphereActive") and 1.0) or 1.1}) + applyFilteredModifiers({speedModifier=1.1}) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/assaultsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/assaultsetbonuseffect.lua index 78818a453f7..46bb5b6be21 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/assaultsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/assaultsetbonuseffect.lua @@ -25,7 +25,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({airJumpModifier = 1.2}) + applyFilteredModifiers({airJumpModifier = 1.2}) checkWeapons() end @@ -38,4 +38,4 @@ function checkWeapons() else effect.setStatModifierGroup(effectHandlerList.weaponBonus1Handle,{}) end -end \ No newline at end of file +end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/chaossetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/chaossetbonuseffect.lua index f17994d16d9..c30eeedc118 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/chaossetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/chaossetbonuseffect.lua @@ -23,7 +23,7 @@ function update(dt) setRegen(0.0) effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.1}) + applyFilteredModifiers({speedModifier = 1.1}) checkWeapons() setRegen(0.005) diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/corsairsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/corsairsetbonuseffect.lua index c3146d8cee1..bd18fd572ed 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/corsairsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/corsairsetbonuseffect.lua @@ -25,7 +25,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({airJumpModifier = 1.05,speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05}) + applyFilteredModifiers({airJumpModifier = 1.05,speedModifier = 1.05}) checkWeapons() end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/nautilussetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/nautilussetbonuseffect.lua index 84b2cf334a7..ae5e472433e 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/nautilussetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/nautilussetbonuseffect.lua @@ -34,7 +34,7 @@ end function checkWorld() if checkBiome({"ocean", "sulphuricocean", "aethersea", "tidewater", "nitrogensea", "strangesea"}) then - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05}) + applyFilteredModifiers({speedModifier = 1.05}) effect.setStatModifierGroup(effectHandlerList.armorBonus2Handle,armorBonus2) else effect.setStatModifierGroup(effectHandlerList.armorBonus2Handle,{}) diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/raidersetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/raidersetbonuseffect.lua index 2cd74e2b26f..6021b6bc27c 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/raidersetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/raidersetbonuseffect.lua @@ -20,7 +20,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.12}) + applyFilteredModifiers({speedModifier = 1.12}) checkWeapons() end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/reconsetbonuseffect2.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/reconsetbonuseffect2.lua index e1fcd00e8be..8c43c74c0cb 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/reconsetbonuseffect2.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/reconsetbonuseffect2.lua @@ -24,7 +24,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.1}) + applyFilteredModifiers({speedModifier = 1.1}) checkWeapons() end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/shieldedsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/shieldedsetbonuseffect.lua index fe0c69d8d74..e21f0434e8c 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/shieldedsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/shieldedsetbonuseffect.lua @@ -15,6 +15,6 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.15}) + applyFilteredModifiers({speedModifier = 1.15}) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/stalkersetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/stalkersetbonuseffect.lua index 42241125f4c..8773758c3b3 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/stalkersetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/stalkersetbonuseffect.lua @@ -23,7 +23,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.08}) + applyFilteredModifiers({speedModifier = 1.08}) checkWeapons() end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/steampunksetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/steampunksetbonuseffect.lua index 5c52fc5d351..6d995f0dc5b 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/steampunksetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/steampunksetbonuseffect.lua @@ -25,7 +25,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05}) + applyFilteredModifiers({speedModifier = 1.05}) checkWeapons() end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier3/warriorrobessetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier3/warriorrobessetbonuseffect.lua index 4db0a7d32ca..a553ed127fc 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier3/warriorrobessetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier3/warriorrobessetbonuseffect.lua @@ -17,8 +17,8 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.08, + applyFilteredModifiers({ + speedModifier = 1.08, airJumpModifier = 1.08 }) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/agentsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/agentsetbonuseffect.lua index c036131d122..bb789c2ea42 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/agentsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/agentsetbonuseffect.lua @@ -24,9 +24,9 @@ function update(dt) effect.expire() else checkWeapons() - mcontroller.controlModifiers({ + applyFilteredModifiers({ airJumpModifier = 1.08, - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.12 + speedModifier = 1.12 }) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/biofleshsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/biofleshsetbonuseffect.lua index 9d2e52a2f1e..46324b19a3a 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/biofleshsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/biofleshsetbonuseffect.lua @@ -23,8 +23,8 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.12, + applyFilteredModifiers({ + speedModifier = 1.12, airJumpModifier = 1.12 }) checkWeapons() diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/graphenesetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/graphenesetbonuseffect.lua index 1265f620c91..fe9f72c8148 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/graphenesetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/graphenesetbonuseffect.lua @@ -26,9 +26,9 @@ function update(dt) checkWeapons() end - mcontroller.controlModifiers({ + applyFilteredModifiers({ airJumpModifier = 1.05, - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05 + speedModifier = 1.05 }) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/krakensetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/krakensetbonuseffect.lua index eb93d7f8eba..d691c3b9b93 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/krakensetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/krakensetbonuseffect.lua @@ -36,7 +36,7 @@ end function checkBiomeBonus() if checkBiome({"ocean","sulphuricocean","aethersea","nitrogensea","strangesea","tidewater"}) then effect.setStatModifierGroup(effectHandlerList.armorBonus2Handle,armorBonus2) - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05}) + applyFilteredModifiers({speedModifier = 1.05}) else effect.setStatModifierGroup(effectHandlerList.armorBonus2Handle,{}) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/mavericksetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/mavericksetbonuseffect.lua index d0ab3a39d5f..26bfdb9a9ea 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/mavericksetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/mavericksetbonuseffect.lua @@ -16,8 +16,8 @@ function update(dt) effect.expire() else checkWeapons() - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.15, + applyFilteredModifiers({ + speedModifier = 1.15, airJumpModifier = 1.15 }) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/shadowbonesetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/shadowbonesetbonuseffect.lua index 1d6ad9012e2..7b66603621e 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/shadowbonesetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/shadowbonesetbonuseffect.lua @@ -22,8 +22,8 @@ function update(dt) else checkWeapons() - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.10 + applyFilteredModifiers({ + speedModifier = 1.1 }) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/warriorsetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/warriorsetbonuseffect.lua index 7734be86455..0ccba84f181 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/warriorsetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/warriorsetbonuseffect.lua @@ -24,8 +24,8 @@ function update(dt) else checkWeapons() - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.10 + applyFilteredModifiers({ + speedModifier = 1.1 }) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/x10setbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/x10setbonuseffect.lua index 409a865956e..6f8ba954527 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/x10setbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/x10setbonuseffect.lua @@ -6,9 +6,9 @@ weaponBonus={ {stat = "critChance", amount = 2} } -armorBonus={ +-- armorBonus={ -} +-- } armorEffect={ {stat = "breathProtection", amount = 1.0}, @@ -33,7 +33,7 @@ function update(dt) else checkWeapons() end - mcontroller.controlModifiers({ + applyFilteredModifiers({ airJumpModifier = 1.2 }) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier4/xenosetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier4/xenosetbonuseffect.lua index bcdfefb23d6..3c8a8eb278c 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier4/xenosetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier4/xenosetbonuseffect.lua @@ -27,7 +27,7 @@ function update(dt) else checkWeapons() end - mcontroller.controlModifiers({ + applyFilteredModifiers({ airJumpModifier = 1.2 }) end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier5/leviathansetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier5/leviathansetbonuseffect.lua index cda36848c20..c00adb71311 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier5/leviathansetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier5/leviathansetbonuseffect.lua @@ -37,8 +37,8 @@ function update(dt) if checkBiome({"ocean","sulphuricocean","aethersea","nitrogensea","strangesea","tidewater"}) then effect.setStatModifierGroup(effectHandlerList.armorBonusHandle2,armorBonus2) - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05 + applyFilteredModifiers({ + speedModifier = 1.05 }) else effect.setStatModifierGroup(effectHandlerList.armorBonusHandle2,{}) diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier6/radienpyreitesetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier6/radienpyreitesetbonuseffect.lua index a6ccdd95c6f..8594dd29591 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier6/radienpyreitesetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier6/radienpyreitesetbonuseffect.lua @@ -40,8 +40,8 @@ function update(dt) else checkWeapons() checkPlanet() - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.05 + applyFilteredModifiers({ + speedModifier = 1.05 }) end end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier6/reconsetbonuseffect3.lua b/stats/effects/fu_armoreffects/set_bonuses/tier6/reconsetbonuseffect3.lua index 68411bce2ef..bdc828ec3e9 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier6/reconsetbonuseffect3.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier6/reconsetbonuseffect3.lua @@ -28,7 +28,7 @@ function update(dt) checkWeapons() end - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.15}) + applyFilteredModifiers({speedModifier = 1.15}) end function checkWeapons() diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier7/densiniumsetbonuseffectkhe.lua b/stats/effects/fu_armoreffects/set_bonuses/tier7/densiniumsetbonuseffectkhe.lua index 7013ded4720..492ebbd9460 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier7/densiniumsetbonuseffectkhe.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier7/densiniumsetbonuseffectkhe.lua @@ -48,7 +48,7 @@ function update(dt) else status.addEphemeralEffect("convert_energy-health_10_1-1_inefficientover") status.addEphemeralEffect("devaarmorpenalty") - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.15}) + applyFilteredModifiers({speedModifier = 1.15}) checkWeapons() end diff --git a/stats/effects/fu_armoreffects/set_bonuses/tier7/phasesetbonuseffect.lua b/stats/effects/fu_armoreffects/set_bonuses/tier7/phasesetbonuseffect.lua index 85beac0d838..4ece4164624 100644 --- a/stats/effects/fu_armoreffects/set_bonuses/tier7/phasesetbonuseffect.lua +++ b/stats/effects/fu_armoreffects/set_bonuses/tier7/phasesetbonuseffect.lua @@ -27,7 +27,7 @@ function update(dt) if not checkSetWorn(self.setBonusCheck) then effect.expire() else - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.20,airJumpModifier = 1.20}) + applyFilteredModifiers({speedModifier = 1.2,airJumpModifier = 1.2}) setRegen(0.008) end end diff --git a/stats/effects/fu_armoreffects/setbonuses_common.lua b/stats/effects/fu_armoreffects/setbonuses_common.lua index 315dad37a97..ec480ece9e9 100644 --- a/stats/effects/fu_armoreffects/setbonuses_common.lua +++ b/stats/effects/fu_armoreffects/setbonuses_common.lua @@ -1,4 +1,5 @@ require "/items/active/tagCaching.lua" --integral to mastery identification +require "/stats/effects/fu_statusUtil.lua"--used for filtering speed bonuses require "/scripts/util.lua" function setSEBonusInit(setBonusName, SetBonusEffects) @@ -125,8 +126,9 @@ function setBonusUninit() end effectHandlerList={} removePetBuffs() + filterModifiers({},true) end function uninit() setBonusUninit() -end \ No newline at end of file +end diff --git a/stats/effects/fu_armoreffects/special_bonuses/brainslug.lua b/stats/effects/fu_armoreffects/special_bonuses/brainslug.lua index 20d3e7a0b84..bbc82945c60 100644 --- a/stats/effects/fu_armoreffects/special_bonuses/brainslug.lua +++ b/stats/effects/fu_armoreffects/special_bonuses/brainslug.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() animator.setParticleEmitterOffsetRegion("slug", mcontroller.boundBox()) animator.setParticleEmitterActive("slug", true) @@ -20,8 +22,8 @@ function update(dt) groundForce = 23.5, runSpeed = 17.0 }) - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.40 + applyFilteredModifiers({ + speedModifier = 1.4 }) self.activateTimer = self.activateTimer -1 @@ -33,5 +35,5 @@ function update(dt) end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/fu_armoreffects/special_bonuses/fuslowfall.lua b/stats/effects/fu_armoreffects/special_bonuses/fuslowfall.lua index db3b8379368..aa3a33a213f 100644 --- a/stats/effects/fu_armoreffects/special_bonuses/fuslowfall.lua +++ b/stats/effects/fu_armoreffects/special_bonuses/fuslowfall.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() script.setUpdateDelta(10) self.controlParameters=config.getParameter("fallingParameters") @@ -14,19 +16,18 @@ function update(dt) end end + local speedValue=1.0 + local airJumpValue=1.0 if (world.windLevel(mcontroller.position()) >= 70 ) then - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.12, - airJumpModifier = 1.12 - }) + speedValue = 1.12 + airJumpValue = 1.12 elseif (world.windLevel(mcontroller.position()) >= 7 ) then - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.15, - airJumpModifier = 1.20 - }) + speedValue = 1.15 + airJumpValue = 1.2 end + applyFilteredModifiers({speedModifier=speedValue,airJumpModifier=airJumpValue}) end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/fu_effects/fleshreaper/fleshreaper.lua b/stats/effects/fu_effects/fleshreaper/fleshreaper.lua index c6ac45c2aee..3d7a85ed92f 100644 --- a/stats/effects/fu_effects/fleshreaper/fleshreaper.lua +++ b/stats/effects/fu_effects/fleshreaper/fleshreaper.lua @@ -12,7 +12,6 @@ function update(dt) end - function uninit() -end \ No newline at end of file +end diff --git a/stats/effects/fu_effects/fleshreaper/fleshreaper2.lua b/stats/effects/fu_effects/fleshreaper/fleshreaper2.lua index 8ae885fd02b..303f80ac2e4 100644 --- a/stats/effects/fu_effects/fleshreaper/fleshreaper2.lua +++ b/stats/effects/fu_effects/fleshreaper/fleshreaper2.lua @@ -12,10 +12,6 @@ function update(dt) end - - - - function uninit() -end \ No newline at end of file +end diff --git a/stats/effects/fu_effects/freeze/freeze.lua b/stats/effects/fu_effects/freeze/freeze.lua index 5de38d49c63..772349dffb2 100644 --- a/stats/effects/fu_effects/freeze/freeze.lua +++ b/stats/effects/fu_effects/freeze/freeze.lua @@ -9,9 +9,7 @@ function init() effect.setParentDirectives("fade=DDDDFF=0.5") end - local stuns = status.statusProperty("stuns", {}) - stuns["freeze"] = true - status.setStatusProperty("stuns", stuns) + legacyStun("freeze") didInit=true end @@ -23,8 +21,6 @@ end function uninit() if didInit then - local stuns = status.statusProperty("stuns", {}) - stuns["freeze"] = nil - status.setStatusProperty("stuns", stuns) + legacyStun("freeze") end -end \ No newline at end of file +end diff --git a/stats/effects/fu_effects/frozenburning/frozenburning.lua b/stats/effects/fu_effects/frozenburning/frozenburning.lua index 2699b2197d6..c89bc8761b0 100644 --- a/stats/effects/fu_effects/frozenburning/frozenburning.lua +++ b/stats/effects/fu_effects/frozenburning/frozenburning.lua @@ -1,56 +1,53 @@ -function init() - animator.setParticleEmitterOffsetRegion("flames", mcontroller.boundBox()) - animator.setParticleEmitterActive("flames", true) - animator.setParticleEmitterOffsetRegion("frozenfiretrail", mcontroller.boundBox()) - animator.setParticleEmitterActive("frozenfiretrail", true) - effect.setParentDirectives("fade=AC00BF=0.25") - - script.setUpdateDelta(5) - self.baseModifier = 0 - self.tickTime = 1.0 - self.tickTimer = self.tickTime - - effect.addStatModifierGroup({ - {stat = "jumpModifier", amount = -0.15} - }) +require "/stats/effects/fu_statusUtil.lua" +function init() + animator.setParticleEmitterOffsetRegion("flames", mcontroller.boundBox()) + animator.setParticleEmitterActive("flames", true) + animator.setParticleEmitterOffsetRegion("frozenfiretrail", mcontroller.boundBox()) + animator.setParticleEmitterActive("frozenfiretrail", true) + effect.setParentDirectives("fade=AC00BF=0.25") + + script.setUpdateDelta(5) + self.baseModifier = 0 + self.tickTime = 1.0 + self.tickTimer = self.tickTime end function update(dt) - if effect.duration() and world.liquidAt({mcontroller.xPosition(), mcontroller.yPosition() - 1}) then - effect.expire() - end - - mcontroller.controlModifiers({ - groundMovementModifier = 0.3, - speedModifier = 0.75, - airJumpModifier = 0.85 - }) - - self.tickTimer = self.tickTimer - dt - - self.baseModifier = status.stat("fireResistance") - if self.baseModifier >= 0.6 then - self.baseModifier = 2.5 - elseif self.baseModifier >= 0.4 then - self.baseModifier = 1.75 - elseif self.baseModifier >= 0.2 then - self.baseModifier = 1 - else - self.baseModifier = 0 - end - - if self.tickTimer <= 0 then - self.tickTimer = self.tickTime - status.applySelfDamageRequest({ - damageType = "IgnoresDef", - damage = 3 - self.baseModifier, - damageSourceKind = "ice", - sourceEntityId = entity.id() - }) - end + if effect.duration() and world.liquidAt({mcontroller.xPosition(), mcontroller.yPosition() - 1}) then + effect.expire() + end + + applyFilteredModifiers({ + groundMovementModifier = 0.3, + speedModifier = 0.75, + airJumpModifier = 0.85 + }) + + self.tickTimer = self.tickTimer - dt + + self.baseModifier = status.stat("fireResistance") + if self.baseModifier >= 0.6 then + self.baseModifier = 2.5 + elseif self.baseModifier >= 0.4 then + self.baseModifier = 1.75 + elseif self.baseModifier >= 0.2 then + self.baseModifier = 1 + else + self.baseModifier = 0 + end + + if self.tickTimer <= 0 then + self.tickTimer = self.tickTime + status.applySelfDamageRequest({ + damageType = "IgnoresDef", + damage = 3 - self.baseModifier, + damageSourceKind = "ice", + sourceEntityId = entity.id() + }) + end end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/fu_effects/fu_medicine/devilsbargain/devilsbargain.lua b/stats/effects/fu_effects/fu_medicine/devilsbargain/devilsbargain.lua index f215d32fc7a..4ae126dfc7f 100644 --- a/stats/effects/fu_effects/fu_medicine/devilsbargain/devilsbargain.lua +++ b/stats/effects/fu_effects/fu_medicine/devilsbargain/devilsbargain.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() effect.addStatModifierGroup({ {stat = "powerMultiplier", amount = 0.2}, @@ -15,7 +17,11 @@ function init() end function update(dt) - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.55 + applyFilteredModifiers({ + speedModifier = 1.55 }) end + +function uninit() + filterModifiers({},true) +end diff --git a/stats/effects/fu_effects/intoxicated/booze.lua b/stats/effects/fu_effects/intoxicated/booze.lua index c3290a191e1..930891b9289 100644 --- a/stats/effects/fu_effects/intoxicated/booze.lua +++ b/stats/effects/fu_effects/intoxicated/booze.lua @@ -1,17 +1,16 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() activateVisualEffects() - local slows = status.statusProperty("slows", {}) - slows["booze"] = 0.55 - status.setStatusProperty("slows", slows) script.setUpdateDelta(1) setParticleConfig(0) end function update(dt) - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = 0.85, - runModifier = 0.85, - jumpModifier = 0.82 + speedModifier = 0.85, + airJumpModifier = 0.82 }) setParticleConfig(dt) world.sendEntityMessage(entity.id(),"fu_specialAnimator.spawnParticle",particleConfig) @@ -38,7 +37,5 @@ function activateVisualEffects() end function uninit() - local slows = status.statusProperty("slows", {}) - slows["booze"] = nil - status.setStatusProperty("slows", slows) -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/fu_effects/intoxicated/booze2.lua b/stats/effects/fu_effects/intoxicated/booze2.lua index 2579dcf4c8d..9c0405dff18 100644 --- a/stats/effects/fu_effects/intoxicated/booze2.lua +++ b/stats/effects/fu_effects/intoxicated/booze2.lua @@ -1,17 +1,16 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() activateVisualEffects() - local slows = status.statusProperty("slows", {}) - slows["booze2"] = 0.65 - status.setStatusProperty("slows", slows) script.setUpdateDelta(1) setParticleConfig(0) end function update(dt) - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = 0.75, - runModifier = 0.75, - jumpModifier = 0.65 + speedModifier = 0.75, + airJumpModifier = 0.65 }) setParticleConfig(dt) world.sendEntityMessage(entity.id(),"fu_specialAnimator.spawnParticle",particleConfig) @@ -38,7 +37,5 @@ function activateVisualEffects() end function uninit() - local slows = status.statusProperty("slows", {}) - slows["booze2"] = nil - status.setStatusProperty("slows", slows) -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/fu_effects/movementpotion/fumovementpotion.lua b/stats/effects/fu_effects/movementpotion/fumovementpotion.lua index ce5f158b842..797db7f5339 100644 --- a/stats/effects/fu_effects/movementpotion/fumovementpotion.lua +++ b/stats/effects/fu_effects/movementpotion/fumovementpotion.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() local bounds = mcontroller.boundBox() animator.setParticleEmitterOffsetRegion("dust", {bounds[1], bounds[2] + 0.2, bounds[3], bounds[2] + 0.3}) @@ -6,18 +8,18 @@ function init() if self.featherfall == 1 then effect.addStatModifierGroup({{stat = "fallDamageMultiplier", amount = -1.0}}) end - self.speedModifier=config.getParameter("runmodifiervalue", 30) + self.speedModifier=config.getParameter("speedmodifiervalue", 1.5) self.airJumpModifier=config.getParameter("jumpmodifiervalue", 30) end function update(dt) animator.setParticleEmitterActive("dust", mcontroller.onGround() and mcontroller.running()) - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or self.speedModifier, + applyFilteredModifiers({ + speedModifier = self.speedModifier, airJumpModifier = self.airJumpModifier }) end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/fu_effects/movementpotion/fusevenleaguescarfmovement.statuseffect b/stats/effects/fu_effects/movementpotion/fusevenleaguescarfmovement.statuseffect index 04f5737eb18..6bf1bf7905e 100644 --- a/stats/effects/fu_effects/movementpotion/fusevenleaguescarfmovement.statuseffect +++ b/stats/effects/fu_effects/movementpotion/fusevenleaguescarfmovement.statuseffect @@ -1,6 +1,6 @@ { "name" : "fusevenleaguescarfmovement", - "effectConfig" : { "runmodifiervalue" : 0.5, "jumpmodifiervalue" : 0, "featherfall" : 0 }, + "effectConfig" : { "speedmodifiervalue" : 0.5, "jumpmodifiervalue" : 0, "featherfall" : 0 }, "defaultDuration" : 3, "scripts" : [ @@ -9,4 +9,4 @@ "animationConfig" : "fumovementpotion.animation" -} \ No newline at end of file +} diff --git a/stats/effects/fu_effects/movementpotion/fusupermovement.statuseffect b/stats/effects/fu_effects/movementpotion/fusupermovement.statuseffect index 81c84e85b36..45d1de8a3a2 100644 --- a/stats/effects/fu_effects/movementpotion/fusupermovement.statuseffect +++ b/stats/effects/fu_effects/movementpotion/fusupermovement.statuseffect @@ -1,6 +1,6 @@ { "name" : "fusupermovement", - "effectConfig" : { "runmodifiervalue" : 1.5, "jumpmodifiervalue" : 1.5, "featherfall" : 1 }, + "effectConfig" : { "speedmodifiervalue" : 1.5, "jumpmodifiervalue" : 1.5, "featherfall" : 1 }, "defaultDuration" : 20, "scripts" : [ @@ -10,4 +10,4 @@ "animationConfig" : "fumovementpotion.animation", "icon" : "/interface/statuses/runboost.png" -} \ No newline at end of file +} diff --git a/stats/effects/fu_effects/movementpotion/fusupermovementstim.statuseffect b/stats/effects/fu_effects/movementpotion/fusupermovementstim.statuseffect index 68c43a32b71..c88d903fdee 100644 --- a/stats/effects/fu_effects/movementpotion/fusupermovementstim.statuseffect +++ b/stats/effects/fu_effects/movementpotion/fusupermovementstim.statuseffect @@ -1,6 +1,6 @@ { "name" : "fusupermovementstim", - "effectConfig" : { "runmodifiervalue" : 3.5, "jumpmodifiervalue" : 1.5, "featherfall" : 1 }, + "effectConfig" : { "speedmodifiervalue" : 3.5, "jumpmodifiervalue" : 1.5, "featherfall" : 1 }, "defaultDuration" : 24, "scripts" : [ @@ -10,4 +10,4 @@ "animationConfig" : "fumovementpotion.animation", "icon" : "/interface/statuses/runboost.png" -} \ No newline at end of file +} diff --git a/stats/effects/fu_effects/powerboost/phaseattackstat.lua b/stats/effects/fu_effects/powerboost/phaseattackstat.lua index be0aebdc64f..844d5e56cd9 100644 --- a/stats/effects/fu_effects/powerboost/phaseattackstat.lua +++ b/stats/effects/fu_effects/powerboost/phaseattackstat.lua @@ -1,32 +1,44 @@ require "/scripts/vec2.lua" function init() - local alpha = math.floor(config.getParameter("alpha") * 255) - effect.setParentDirectives(string.format("?multiply=ffffff%02x", alpha)) script.setUpdateDelta(10) - self.damageBonus=1.0+(getTechBonus()*0.01) - powerHandler=effect.addStatModifierGroup({{stat = "powerMultiplier", effectiveMultiplier = self.damageBonus}}) -end -function getTechBonus() - return 1 + status.stat("phasetechBonus") + effect.setParentDirectives(string.format("?multiply=ffffff%02x", (math.floor(config.getParameter("alpha") * 255)))) + + self.timeElapsed=0 + self.flatCost=5.0 + self.percentCost=0.05 + self.damageGainRate=0.3 + self.multCap=3.0 + self.speedCostMult=0.1 + self.speedPenalty=0.75 + self.timeElapsedThreshold=6.0 + self.timeElapsedMult=1.0 + self.damageBonus=1.0+((1 + status.stat("phasetechBonus"))*0.01) + + powerHandler=effect.addStatModifierGroup({{stat = "powerMultiplier", effectiveMultiplier = self.damageBonus}}) end function update(dt) + self.timeElapsed=(self.timeElapsed or 0)+dt mcontroller.controlModifiers({speedModifier = 0.75}) status.setResourcePercentage("energyRegenBlock", 1.0) - local cost=5 - local vel=vec2.mag(mcontroller.velocity())/10.0 - cost=cost+vel - cost=dt*((status.resourceMax("energy")*0.01*cost)+cost) - if status.overConsumeResource("energy",cost) then + if status.overConsumeResource("energy", + dt + *( + (status.resourceMax("energy")*self.percentCost)+ + (self.flatCost+(vec2.mag(mcontroller.velocity())*self.speedCostMult)) + ) + *self.damageBonus + *(1+(math.max(0,self.timeElapsed-self.timeElapsedThreshold)*self.timeElapsedMult)) + ) then if status.resourcePositive("energyRegenBlock") then - self.damageBonus=math.min(self.damageBonus*(1+(0.08*dt)),3.0) + self.damageBonus=math.min(self.damageBonus*(1+(self.damageGainRate*dt)),self.multCap) end - else end - if self.damageBonus==3.0 then + + if self.damageBonus==self.multCap then status.removeEphemeralEffect("phaseattackindicatorcharging") status.addEphemeralEffect("phaseattackindicatorcharged",1) else diff --git a/stats/effects/fu_genericControlModifiers.lua b/stats/effects/fu_genericControlModifiers.lua index 98a02322c36..286c9a170ab 100644 --- a/stats/effects/fu_genericControlModifiers.lua +++ b/stats/effects/fu_genericControlModifiers.lua @@ -1,4 +1,7 @@ +require "/stats/effects/fu_statusUtil.lua" + local oldInitControlModifier=init +local oldUninitControlModifier=uninit local oldUpdateControlModifier=update require("/scripts/util.lua") @@ -9,11 +12,11 @@ function init() end function update(dt) - mcontroller.controlModifiers(filterModifiers(copy(controlModifierValues))) + applyFilteredModifiers(controlModifierValues) if oldUpdateControlModifier then oldUpdateControlModifier(dt) end end -function filterModifiers(stuff) - if (status.statPositive("spikeSphereActive") and 1.0) and stuff["speedModifier"] then stuff["speedModifier"]=1.0 end - return stuff +function uninit() + filterModifiers({},true) + if oldUninitControlModifier then oldUninitControlModifier() end end diff --git a/stats/effects/fu_statusUtil.lua b/stats/effects/fu_statusUtil.lua index 6935dcd6f2f..2c1697a4ac1 100644 --- a/stats/effects/fu_statusUtil.lua +++ b/stats/effects/fu_statusUtil.lua @@ -1,3 +1,8 @@ +require "/scripts/util.lua" + +fuStatusUtil={} +fuStatusUtil.vars={} + function getLight() local position = mcontroller.position() position[1] = math.floor(position[1]) @@ -29,3 +34,104 @@ function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end + +function filterSpeed(speed,clear,override) + if type(speed)~="number" then + -- sb.logInfo("speed was somehow not number, it was instead %s",speed) + speed=tonumber(speed) + end + if clear then + legacySlow(statusUtilHandle()) + return + end + if status.statPositive("spikeSphereActive") then + if not fuStatusUtil.vars.spikeState then + legacySlow(statusUtilHandle()) + fuStatusUtil.vars.spikeState=true + end + fuStatusUtil.vars.speedModifier=1.0 + return 1.0 + else + if (fuStatusUtil.vars.spikeState) or (fuStatusUtil.vars.speedModifier~=speed) then + if speed<1.0 then + legacySlow(statusUtilHandle(),speed) + else + legacySlow(statusUtilHandle()) + end + fuStatusUtil.vars.speedModifier=speed + fuStatusUtil.vars.spikeState=false + end + return speed + end +end + +function statusUtilHandle(fill) + if not fuStatusUtil.vars.handle then + fuStatusUtil.vars.handle=(config and config.getParameter("statusUtilHandle")) or fill or "generic"..(math.floor(math.random(0,1000000)*1000000)) + end + return fuStatusUtil.vars.handle +end + +--adds the stat modifier for AI pathing code +function filterAirJump(mod,clear) + -- sb.logInfo("filterairjump %s",{m=mod,c=clear,paj=fuStatusUtil.vars.isPlayer_airJump}) + if not effect then return mod end + if (not fuStatusUtil.vars.isPlayer_airJump) and world.entityType(entity.id())=="player" then + fuStatusUtil.vars.isPlayer_airJump=true + clear=true + elseif (fuStatusUtil.vars.isPlayer_airJump) then + return mod + end + + if clear and fuStatusUtil.vars.airHandle then + effect.removeStatModifierGroup(fuStatusUtil.vars.airHandle) + fuStatusUtil.vars.airHandle=nil + return + end + if not fuStatusUtil.vars.airHandle then + fuStatusUtil.vars.airHandle=effect.addStatModifierGroup({}) + end + effect.setStatModifierGroup(fuStatusUtil.vars.airHandle,{{stat="jumpModifier",amount=mod-1.0}}) + return mod +end + +function applyFilteredModifiers(modifiers) + mcontroller.controlModifiers(filterModifiers(modifiers)) +end + +function filterModifiers(stuff,clear) + local moreStuff=copy(stuff) + if clear then + filterSpeed(0,true) + filterAirJump(0,true) + return + end + if moreStuff["speedModifier"] then + moreStuff["speedModifier"]=filterSpeed(moreStuff["speedModifier"]) + end + if moreStuff["airJumpModifier"] then + moreStuff["airJumpModifier"]=filterAirJump(moreStuff["airJumpModifier"]) + end + return moreStuff +end + +--the below 2 functions are for legacy monster code, to handle their animation speeds. they don't actually slow anything. +function legacySlow(handle,modifier) + if (not fuStatusUtil.vars.isPlayer_LegacySlow) and world.entityType(entity.id())=="player" then + fuStatusUtil.vars.isPlayer_LegacySlow=true + modifier=nil + elseif fuStatusUtil.vars.isPlayer_LegacySlow then + return + end + local slows = status.statusProperty("slows", {}) + if slows[handle]~=nil then + slows[handle] = modifier + status.setStatusProperty("slows", slows) + end +end + +function legacyStun(handle) + local stuns = status.statusProperty("stuns", {}) + stuns[handle] = modifier + status.setStatusProperty("stuns", stuns) +end diff --git a/stats/effects/fu_tileeffects/mobility_effects/blacktarslow.lua b/stats/effects/fu_tileeffects/mobility_effects/blacktarslow.lua.unused similarity index 92% rename from stats/effects/fu_tileeffects/mobility_effects/blacktarslow.lua rename to stats/effects/fu_tileeffects/mobility_effects/blacktarslow.lua.unused index 6080f2f47d3..e8083660424 100644 --- a/stats/effects/fu_tileeffects/mobility_effects/blacktarslow.lua +++ b/stats/effects/fu_tileeffects/mobility_effects/blacktarslow.lua.unused @@ -5,7 +5,7 @@ end function update(dt) mcontroller.controlModifiers({ groundMovementModifier = 0.4, - runModifier = 0.4, + runModifier = 0.4,--this does nothing airJumpModifier = 0.45 }) end @@ -23,4 +23,4 @@ end function uninit() -end \ No newline at end of file +end diff --git a/stats/effects/fu_tileeffects/mobility_effects/fuquicksand.lua b/stats/effects/fu_tileeffects/mobility_effects/fuquicksand.lua index fa7f22ea0f6..e453e3e98ab 100644 --- a/stats/effects/fu_tileeffects/mobility_effects/fuquicksand.lua +++ b/stats/effects/fu_tileeffects/mobility_effects/fuquicksand.lua @@ -1,28 +1,28 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() animator.setParticleEmitterOffsetRegion("sanddrips", mcontroller.boundBox()) animator.setParticleEmitterActive("sanddrips", true) if entity.entityType()=="player" then animator.setParticleEmitterActive("statustext", true) end - effect.setParentDirectives("fade=BDAE65=0.1") - local slows = status.statusProperty("slows", {}) - slows["sandslowdown"] = 0.9 - status.setStatusProperty("slows", slows) self.groundMovementModifier = config.getParameter("moveMod",1) - self.runModifier = config.getParameter("speedMod",1) + self.speedModifier = config.getParameter("speedMod",1) self.jumpModifier = config.getParameter("jumpMod",1) end function update(dt) - mcontroller.controlModifiers({groundMovementModifier = self.groundMovementModifier,runModifier = self.runModifier,jumpModifier = self.jumpModifier}) + applyFilteredModifiers({ + groundMovementModifier = self.groundMovementModifier, + speedModifier = self.speedModifier, + airJumpModifier = self.jumpModifier + }) mcontroller.controlParameters({liquidFriction = 75.0}) --local waterFactor = mcontroller.liquidPercentage() end function uninit() - local slows = status.statusProperty("slows", {}) - slows["sandslowdown"] = nil - status.setStatusProperty("slows", slows) -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/fu_tileeffects/mobility_effects/slow.lua b/stats/effects/fu_tileeffects/mobility_effects/slow.lua index 946ae2f6b32..345a978cb4a 100644 --- a/stats/effects/fu_tileeffects/mobility_effects/slow.lua +++ b/stats/effects/fu_tileeffects/mobility_effects/slow.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) animator.setParticleEmitterActive("drips", true) @@ -15,7 +17,7 @@ function init() end function update(dt) - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = self.groundMovementModifier, speedModifier = self.speedModifier, airJumpModifier = self.airJumpModifier @@ -29,3 +31,7 @@ function activateVisualEffects(directives) animator.burstParticleEmitter("statustext") end end + +function uninit() + filterModifiers({},true) +end diff --git a/stats/effects/fu_tileeffects/mobility_effects/slushslow.lua b/stats/effects/fu_tileeffects/mobility_effects/slushslow.lua index 71d7186bf06..331626a1cff 100644 --- a/stats/effects/fu_tileeffects/mobility_effects/slushslow.lua +++ b/stats/effects/fu_tileeffects/mobility_effects/slushslow.lua @@ -1,31 +1,23 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - local slows = status.statusProperty("slows", {}) - slows["slushslow"] = 0.3 - status.setStatusProperty("slows", slows) - animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) - animator.setParticleEmitterActive("drips", true) + animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) + animator.setParticleEmitterActive("drips", true) end function update(dt) - mcontroller.controlParameters({ - normalGroundFriction = 1, - groundForce = 25, - slopeSlidingFactor = 0.162 - }) - mcontroller.controlModifiers({ - groundMovementModifier = 0.8, - runModifier = 0.77, - jumpModifier = 0.8 - }) + mcontroller.controlParameters({ + normalGroundFriction = 1, + groundForce = 25, + slopeSlidingFactor = 0.162 + }) + applyFilteredModifiers({ + groundMovementModifier = 0.8, + speedModifier = 0.77, + airJumpModifier = 0.8 + }) end function uninit() - local slows = status.statusProperty("slows", {}) - slows["slushslow"] = nil - status.setStatusProperty("slows", slows) + filterModifiers({},true) end - - - - - diff --git a/stats/effects/fu_tileeffects/mobility_effects/snowslow.lua b/stats/effects/fu_tileeffects/mobility_effects/snowslow.lua index 6037e9630f7..727f606f975 100644 --- a/stats/effects/fu_tileeffects/mobility_effects/snowslow.lua +++ b/stats/effects/fu_tileeffects/mobility_effects/snowslow.lua @@ -1,28 +1,26 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - local slows = status.statusProperty("slows", {}) - slows["snowslow"] = 0.53 - status.setStatusProperty("slows", slows) - animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) - animator.setParticleEmitterActive("drips", true) + animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) + animator.setParticleEmitterActive("drips", true) end function update(dt) - if status.stat("iceResistance") < 70.0 then - mcontroller.controlModifiers({ - groundMovementModifier = 0.75, - speedModifier = 0.75, - airJumpModifier = 0.8 - }) - end + if status.stat("iceResistance") < 70.0 then + applyFilteredModifiers({ + groundMovementModifier = 0.75, + speedModifier = 0.75, + airJumpModifier = 0.8 + }) + else + applyFilteredModifiers({ + groundMovementModifier = 1, + speedModifier = 1, + airJumpModifier = 1 + }) + end end function uninit() - local slows = status.statusProperty("slows", {}) - slows["snowslow"] = nil - status.setStatusProperty("slows", slows) + filterModifiers({},true) end - - - - - diff --git a/stats/effects/fu_tileeffects/poison_effects/darkwaterpoison/darkwaterpoison.lua b/stats/effects/fu_tileeffects/poison_effects/darkwaterpoison/darkwaterpoison.lua index e0a830b4480..570b8fea0fd 100644 --- a/stats/effects/fu_tileeffects/poison_effects/darkwaterpoison/darkwaterpoison.lua +++ b/stats/effects/fu_tileeffects/poison_effects/darkwaterpoison/darkwaterpoison.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() script.setUpdateDelta(5) self.tickTime = 1.0 @@ -34,7 +36,11 @@ function update(dt) if self.tickTimer <= 0 then self.tickTimer = self.tickTime end - mcontroller.controlModifiers({groundMovementModifier = 0.80,runModifier = 0.80,jumpModifier = 0.80}) + applyFilteredModifiers({ + groundMovementModifier = 0.8, + speedModifier = 0.8, + airJumpModifier = 0.8 + }) effect.setParentDirectives("fade=AA00AA="..self.tickTimer * 0.4) end @@ -44,4 +50,6 @@ function uninit() effect.removeStatModifierGroup(shrubbery) shrubbery=nil end -end \ No newline at end of file + + filterModifiers({},true) +end diff --git a/stats/effects/fu_tileeffects/poison_effects/nitrogenfreeze/nitrogenfreeze.lua b/stats/effects/fu_tileeffects/poison_effects/nitrogenfreeze/nitrogenfreeze.lua index bfce5729399..e9335b4dc7a 100644 --- a/stats/effects/fu_tileeffects/poison_effects/nitrogenfreeze/nitrogenfreeze.lua +++ b/stats/effects/fu_tileeffects/poison_effects/nitrogenfreeze/nitrogenfreeze.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() animator.setParticleEmitterOffsetRegion("snow", mcontroller.boundBox()) animator.setParticleEmitterActive("snow", true) @@ -8,31 +10,35 @@ function init() end function update(dt) - if ( status.stat("iceResistance") >= 0.75 ) then + if ( status.stat("iceResistance") >= 0.75 ) then effect.expire() end - mcontroller.controlModifiers({ - groundForce = 60.5, - slopeSlidingFactor = 0.6, - groundMovementModifier = 0.45, - runModifier = 0.65, - jumpModifier = 0.75 - }) + applyFilteredModifiers({ + groundForce = 60.5, + slopeSlidingFactor = 0.6, + groundMovementModifier = 0.45, + speedModifier = 0.65, + airJumpModifier = 0.75 + }) mcontroller.controlParameters({ - normalGroundFriction = 4.675 - }) + normalGroundFriction = 4.675 + }) self.tickTimer = self.tickTimer - dt if self.tickTimer <= 0 then self.tickTimer = self.tickTime status.applySelfDamageRequest({ - damageType = "IgnoresDef", - damage = self.baseDamage, - damageSourceKind = "hoarfrost", - sourceEntityId = entity.id() - }) + damageType = "IgnoresDef", + damage = self.baseDamage, + damageSourceKind = "hoarfrost", + sourceEntityId = entity.id() + }) end effect.setParentDirectives("fade=66FFFF="..self.tickTimer * 0.4) -end \ No newline at end of file +end + +function uninit() + filterModifiers({},true) +end diff --git a/stats/effects/fu_tileeffects/specialty_effects/webstick/webstick.lua b/stats/effects/fu_tileeffects/specialty_effects/webstick/webstick.lua index e506cfa425d..12f6e83a728 100644 --- a/stats/effects/fu_tileeffects/specialty_effects/webstick/webstick.lua +++ b/stats/effects/fu_tileeffects/specialty_effects/webstick/webstick.lua @@ -1,26 +1,28 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - animator.setParticleEmitterOffsetRegion("webstick", mcontroller.boundBox()) - animator.setParticleEmitterActive("webstick", true) + animator.setParticleEmitterOffsetRegion("webstick", mcontroller.boundBox()) + animator.setParticleEmitterActive("webstick", true) end function update(dt) - mcontroller.controlModifiers({ - airJumpModifier = 0.3, - speedModifier = 0.1 - }) - if mcontroller.yVelocity() < 0 then - mcontroller.setYVelocity(math.max(mcontroller.yVelocity(), -1)) - end - if effect.duration() < 0.3 then - if world.material({mcontroller.position()[1],mcontroller.position()[2] - 1.5}, "foreground") == "spidersilkblockmik" then - effect.modifyDuration(0.1) - elseif world.material({mcontroller.position()[1],mcontroller.position()[2] - 2.5}, "foreground") == "spidersilkblockmik" then - effect.modifyDuration(0.1) + applyFilteredModifiers({ + airJumpModifier = 0.3, + speedModifier = 0.1 + }) + if mcontroller.yVelocity() < 0 then + mcontroller.setYVelocity(math.max(mcontroller.yVelocity(), -1)) + end + if effect.duration() < 0.3 then + if world.material({mcontroller.position()[1],mcontroller.position()[2] - 1.5}, "foreground") == "spidersilkblockmik" then + effect.modifyDuration(0.1) + elseif world.material({mcontroller.position()[1],mcontroller.position()[2] - 2.5}, "foreground") == "spidersilkblockmik" then + effect.modifyDuration(0.1) + end end - end end function uninit() - -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/fu_tileeffects/specialty_effects/windslow/windslow.lua b/stats/effects/fu_tileeffects/specialty_effects/windslow/windslow.lua index 94d4847b55f..a0cfdcc1d78 100644 --- a/stats/effects/fu_tileeffects/specialty_effects/windslow/windslow.lua +++ b/stats/effects/fu_tileeffects/specialty_effects/windslow/windslow.lua @@ -1,20 +1,18 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - effect.setParentDirectives("fade=ffea00=0.4") - effect.addStatModifierGroup({ - {stat = "jumpModifier", amount = -0.22} - }) - self.movementModifiers = config.getParameter("movementModifiers", {}) - self.energyCost = 2 + effect.setParentDirectives("fade=ffea00=0.4") + self.energyCost = 2 end function update(dt) - mcontroller.controlModifiers({ - groundMovementModifier = 0.6, - speedModifier = 0.65, - airJumpModifier = 0.80 - }) + applyFilteredModifiers({ + groundMovementModifier = 0.6, + speedModifier = 0.65, + airJumpModifier = 0.80 + }) end function uninit() - -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/fu_weathereffects/new/fuWeatherBase.lua b/stats/effects/fu_weathereffects/new/fuWeatherBase.lua index c1cf391813d..f7b62facdab 100644 --- a/stats/effects/fu_weathereffects/new/fuWeatherBase.lua +++ b/stats/effects/fu_weathereffects/new/fuWeatherBase.lua @@ -1,3 +1,4 @@ +require "/stats/effects/fu_statusUtil.lua" require "/scripts/vec2.lua" require "/scripts/util.lua" @@ -294,7 +295,7 @@ function fuWeatherBase.applyMovementPenalties(self, modifier) if (self.baseJumpPenalty > 0) then jumpPenalty = self.baseJumpPenalty * math.min(modifier, 1.0) end - mcontroller.controlModifiers({ + applyFilteredModifiers({ speedModifier = 1.0 - speedPenalty, airJumpModifier = 1.0 - jumpPenalty }) diff --git a/stats/effects/lowgrav/lowgrav_fallspeed.lua b/stats/effects/lowgrav/lowgrav_fallspeed.lua index d242edafd04..ef6f7cc551a 100644 --- a/stats/effects/lowgrav/lowgrav_fallspeed.lua +++ b/stats/effects/lowgrav/lowgrav_fallspeed.lua @@ -1,3 +1,4 @@ +require "/stats/effects/fu_statusUtil.lua" function init() effect.addStatModifierGroup({ {stat = "gravrainImmunity", amount = 1} }) @@ -10,12 +11,12 @@ function update() mcontroller.controlParameters(self.fallingParameters or {}) mcontroller.setYVelocity(math.max(mcontroller.yVelocity(), self.maxFallSpeed or 0)) end - mcontroller.controlModifiers({ + applyFilteredModifiers({ airJumpModifier = 1.45, jumpHoldTime = 1.0 }) end -function unit() - +function uninit() + filterModifiers({},true) end diff --git a/stats/effects/medicalStationSpecials/hypopanic/hypopanic.lua b/stats/effects/medicalStationSpecials/hypopanic/hypopanic.lua index 29f0a14cf6e..63d3cba2fc2 100644 --- a/stats/effects/medicalStationSpecials/hypopanic/hypopanic.lua +++ b/stats/effects/medicalStationSpecials/hypopanic/hypopanic.lua @@ -1,4 +1,4 @@ - +require "/stats/effects/fu_statusUtil.lua" require "/stats/effects/medicalStationSpecials/medicalStatusBase.lua" function init() @@ -33,14 +33,14 @@ function update(dt) local revPcnt = 1 - (currPcnt / fullPcnt) local pcntOfSpeedBonus = revPcnt * self.maxSpeedBonus - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or (1 + pcntOfSpeedBonus) }) + applyFilteredModifiers({ speedModifier = (1 + pcntOfSpeedBonus) }) else - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or (1 + self.maxSpeedBonus) }) + applyFilteredModifiers({ speedModifier = (1 + self.maxSpeedBonus) }) end baseUpdate(dt) end function uninit() - --baseUninit(self.modifierGroupID) + filterModifiers({},true) end diff --git a/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.lua b/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.lua index bd5995fd13c..c3167cb8210 100644 --- a/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.lua +++ b/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.lua @@ -1,55 +1,77 @@ require "/stats/effects/medicalStationSpecials/medicalStatusBase.lua" -function init() - self.cloudInterval = 0 - self.baseCloudInterval = config.getParameter("cloudInterval", 0) - self.onShip = false - self.useMedStationCode=config.getParameter("useMedStationCode",true) - self.damage=config.getParameter("selfDamage", 0) - self.damageSourceKind=config.getParameter("selfDamageType", 0) - - local data = root.assetJson("/projectiles/medicalStationSpecials/toxicCloud/toxiccloud.projectile") - self.baseDamage = data.power + -- "toxiccloudconfig":{ + -- "cloudInterval" : 3, + -- "cloudDamage" : 5, + -- "cloudDamageType" : "poison", + -- "selfDamage" : 5, + -- "selfDamageType" : "poison", + -- "cloudDuration" : 5 + -- }, +function init() + if not toxSystemDidInit then + toxInit() + end + if not medStationDidInit then + medStationInit() + end +end +function toxInit() if world.type() == "unknown" then self.onShip = true + else + self.toxiccloudconfig=config.getParameter("toxiccloudconfig") end - if self.useMedStationCode then + if self.toxiccloudconfig then + toxSystemDidInit=true + else + self.onShip=true + end +end + +function medStationInit() + if self.toxiccloudconfig.useMedStationCode then baseInit() + medStationDidInit=true end - didInit=true end function update(dt) - if not didInit then - init() - return + if not toxSystemDidInit then + toxInit() + end + if not medStationDidInit then + medStationInit() end if not self.onShip then - if self.cloudInterval <= 0 then + self.cloudTimer=(self.cloudTimer or 0)+dt + if self.cloudTimer >= self.toxiccloudconfig.cloudInterval then status.applySelfDamageRequest({ damageType = "IgnoresDef", - damage = self.damage, - damageSourceKind = self.damageSourceKind, + damage = self.toxiccloudconfig.selfDamage, + damageSourceKind = self.toxiccloudconfig.selfDamageType, sourceEntityId = entity.id() }) - world.spawnProjectile("medicaltoxiccloud", entity.position(), entity.id(), nil, nil, {power = self.baseDamage * status.stat("powerMultiplier")}) + world.spawnProjectile("medicaltoxiccloud", entity.position(), entity.id(), nil, nil, { + power = self.toxiccloudconfig.cloudDamage * status.stat("powerMultiplier"), + timeToLive = self.toxiccloudconfig.cloudDuration, + damageKind = self.toxiccloudconfig.cloudDamageType + }) - self.cloudInterval = self.baseCloudInterval - else - self.cloudInterval = self.cloudInterval - dt + self.cloudTimer = 0 end end - if self.useMedStationCode then + if self.toxiccloudconfig.useMedStationCode then baseUpdate(dt) end end function uninit() --baseUninit(self.modifierGroupID) -end \ No newline at end of file +end diff --git a/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.statuseffect b/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.statuseffect index c9690661b57..5e08bd0da30 100644 --- a/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.statuseffect +++ b/stats/effects/medicalStationSpecials/toxiccloud/toxiccloud.statuseffect @@ -7,12 +7,14 @@ "scripts" : [ "toxiccloud.lua","/stats/effects/fu_genericStatApplier.lua" ], "effectConfig" : { - "cloudInterval" : 3, - "cloudDamage" : 5, - "cloudDamageType" : "poison", - "selfDamage" : 5, - "selfDamageType" : "poison", - "cloudDuration" : 5, + "toxiccloudconfig":{ + "cloudInterval" : 3, + "cloudDamage" : 5, + "cloudDamageType" : "poison", + "selfDamage" : 5, + "selfDamageType" : "poison", + "cloudDuration" : 5 + }, "stats": [{"stat": "foodDelta","baseMultiplier": 1.2}] } } diff --git a/stats/effects/medicalStationSpecials/toxiccloud/toxiccloudmadness.statuseffect b/stats/effects/medicalStationSpecials/toxiccloud/toxiccloudmadness.statuseffect index 7560a1c4b0f..fd3baa10cf3 100644 --- a/stats/effects/medicalStationSpecials/toxiccloud/toxiccloudmadness.statuseffect +++ b/stats/effects/medicalStationSpecials/toxiccloud/toxiccloudmadness.statuseffect @@ -7,12 +7,14 @@ "scripts" : [ "toxiccloud.lua" ], "effectConfig" : { - "cloudInterval" : 3, - "cloudDamage" : 5, - "cloudDamageType" : "poison", - "selfDamage" : 5, - "selfDamageType" : "poison", - "cloudDuration" : 5, - "useMedStationCode":false + "toxiccloudconfig":{ + "cloudInterval" : 3, + "cloudDamage" : 5, + "cloudDamageType" : "poison", + "selfDamage" : 5, + "selfDamageType" : "poison", + "cloudDuration" : 5, + "useMedStationCode":false + } } } diff --git a/stats/effects/pandorasbox/pandorasboxglitchtopstatuseffects/pandorasboxglitchedjumpboost/pandorasboxglitchedjumpboost.lua b/stats/effects/pandorasbox/pandorasboxglitchtopstatuseffects/pandorasboxglitchedjumpboost/pandorasboxglitchedjumpboost.lua index 3ee7fef7ec5..68a96c6f413 100644 --- a/stats/effects/pandorasbox/pandorasboxglitchtopstatuseffects/pandorasboxglitchedjumpboost/pandorasboxglitchedjumpboost.lua +++ b/stats/effects/pandorasbox/pandorasboxglitchtopstatuseffects/pandorasboxglitchedjumpboost/pandorasboxglitchedjumpboost.lua @@ -1,15 +1,11 @@ -function init() - effect.addStatModifierGroup({ - {stat = "jumpModifier", amount = 0.5} - }) -end +require "/stats/effects/fu_statusUtil.lua" function update(dt) - mcontroller.controlModifiers({ + applyFilteredModifiers({ airJumpModifier = 1.5 }) end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/passive/lighthunter.lua b/stats/effects/passive/lighthunter.lua index cad60e86bcd..c927c28fdbe 100644 --- a/stats/effects/passive/lighthunter.lua +++ b/stats/effects/passive/lighthunter.lua @@ -8,60 +8,44 @@ end function update(dt) local lightLevel = getLight() + local speedValue=1.0 + local specialValue=0 if lightLevel >= 95 then - effect.setStatModifierGroup(lightHunterEffects, { - {stat = "energyRegenPercentageRate", amount = 1.08 + self.powerBonus}, - {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.08}, - {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.08} - }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.20 }) + specialValue=0.08 + speedValue = 1.2 elseif lightLevel >= 80 then - effect.setStatModifierGroup(lightHunterEffects, { - {stat = "energyRegenPercentageRate", amount = 1.08 + self.powerBonus}, - {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.07}, - {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.07} - }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.18 }) + specialValue=0.07 + speedValue = 1.18 elseif lightLevel >= 70 then - effect.setStatModifierGroup(lightHunterEffects, { - {stat = "energyRegenPercentageRate", amount = 1.08 + self.powerBonus}, - {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.06}, - {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.06} - }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.16 }) + specialValue=0.06 + speedValue = 1.16 elseif lightLevel >= 60 then - effect.setStatModifierGroup(lightHunterEffects, { - {stat = "energyRegenPercentageRate", amount = 1.08 + self.powerBonus}, - {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.05}, - {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.05} - }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.14 }) + specialValue=0.05 + speedValue = 1.14 elseif lightLevel >= 50 then - effect.setStatModifierGroup(lightHunterEffects, { - {stat = "energyRegenPercentageRate", amount = 1.08 + self.powerBonus}, - {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.04}, - {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.04} - }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.11 }) + specialValue=0.04 + speedValue = 1.11 elseif lightLevel >= 40 then - effect.setStatModifierGroup(lightHunterEffects, { - {stat = "energyRegenPercentageRate", amount = 1.08 + self.powerBonus}, - {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.02}, - {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.02} - }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.09 }) + specialValue=0.02 + speedValue = 1.09 elseif lightLevel >= 30 then + speedValue = 1.06 + end + if lightLevel>=30 then effect.setStatModifierGroup(lightHunterEffects, { {stat = "energyRegenPercentageRate", amount = 1.08 + self.powerBonus}, - {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.00}, - {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.00} + {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.00+specialValue}, + {stat = "powerMultiplier", baseMultiplier = self.powerBonus + 1.00+specialValue} }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.06 }) else effect.setStatModifierGroup(lightHunterEffects,{}) end + applyFilteredModifiers({ + speedModifier = speedValue + }) end function uninit() effect.removeStatModifierGroup(lightHunterEffects) + filterModifiers({},true) end diff --git a/stats/effects/passive/nightfear.lua b/stats/effects/passive/nightfear.lua index 8965fe4cfcd..4a1575bace0 100644 --- a/stats/effects/passive/nightfear.lua +++ b/stats/effects/passive/nightfear.lua @@ -12,7 +12,7 @@ function update(dt) {stat = "maxHealth", baseMultiplier = 0.95}, {stat = "powerMultiplier", baseMultiplier = 0.95} }) - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.1}) + applyFilteredModifiers({speedModifier = 1.1}) else effect.setStatModifierGroup(nightFearEffects,{}) end @@ -20,4 +20,5 @@ end function uninit() effect.removeStatModifierGroup(nightFearEffects) + filterModifiers({},true) end diff --git a/stats/effects/passive/trolllighteffect.lua b/stats/effects/passive/trolllighteffect.lua index b7a9ea4f402..29fe0ed90d4 100644 --- a/stats/effects/passive/trolllighteffect.lua +++ b/stats/effects/passive/trolllighteffect.lua @@ -7,32 +7,39 @@ end function update(dt) local lightLevel = getLight() + local speedValue if lightLevel <= 55 then status.setPersistentEffects("trollEffects", { {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.2} }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.2 }) + speedValue=1.2 elseif lightLevel <= 65 then status.setPersistentEffects("trollEffects", { {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.1} }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.1 }) + speedValue=1.1 elseif lightLevel <= 75 then status.setPersistentEffects("trollEffects", { {stat = "maxHealth", baseMultiplier = self.powerBonus + 1.0} }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.0 }) + speedValue=1.0 elseif lightLevel <= 85 then status.setPersistentEffects("trollEffects", { {stat = "maxHealth", baseMultiplier = self.powerBonus + 0.9} }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 0.9 }) + speedValue=0.9 elseif lightLevel <= 95 then status.setPersistentEffects("trollEffects", { {stat = "maxHealth", baseMultiplier = self.powerBonus + 0.8} }) - mcontroller.controlModifiers({ speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 0.8 }) + speedValue=0.9 else status.clearPersistentEffects("trollEffects") + speedValue=1.0 end + applyFilteredModifiers({ speedModifier = speedValue }) +end + +function uninit() + filterModifiers({},true) end diff --git a/stats/effects/runboost/runboost.lua b/stats/effects/runboost/runboost.lua index fa5ae5449a6..5f6473146d7 100644 --- a/stats/effects/runboost/runboost.lua +++ b/stats/effects/runboost/runboost.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() if not mcontroller.boundBox() then delayInit=true return end local bounds = mcontroller.boundBox() @@ -7,11 +9,11 @@ end function update(dt) if delayInit then delayInit=false init() end animator.setParticleEmitterActive("flames", config.getParameter("particles", true) and mcontroller.onGround() and mcontroller.running()) - mcontroller.controlModifiers({ - speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.5 + applyFilteredModifiers({ + speedModifier = 1.5 }) end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/runboost/runboostdebuff.lua b/stats/effects/runboost/runboostdebuff.lua deleted file mode 100644 index a51dd06b79a..00000000000 --- a/stats/effects/runboost/runboostdebuff.lua +++ /dev/null @@ -1,13 +0,0 @@ -function init() -end - -function update(dt) - mcontroller.controlModifiers({ - runModifier = 0.70, - speedModifier = 0.70 - }) -end - -function uninit() - -end \ No newline at end of file diff --git a/stats/effects/runboost/runboostdebuff.statuseffect b/stats/effects/runboost/runboostdebuff.statuseffect index 7caa314645b..bb21cdf620a 100644 --- a/stats/effects/runboost/runboostdebuff.statuseffect +++ b/stats/effects/runboost/runboostdebuff.statuseffect @@ -3,16 +3,17 @@ "blockingStat" : "stunImmunity", "effectConfig": { "controlModifiers": { - "runModifier": 0.7 + "speedModifier": 0.7 } }, - "defaultDuration": 30, + "defaultDuration": 5, "scripts": [ + "runboostdebuffvfx.lua", "/stats/effects/fu_genericControlModifiers.lua" ], - "animationConfig" : "runboost.animation", + "animationConfig" : "/stats/effects/sandstorm/sandstorm.animation", "label" : "-30% Run", "icon" : "/interface/statuses/haste.png" diff --git a/stats/effects/runboost/runboostdebuff10.statuseffect b/stats/effects/runboost/runboostdebuff10.statuseffect index de9821c09f5..f1b848a64c7 100644 --- a/stats/effects/runboost/runboostdebuff10.statuseffect +++ b/stats/effects/runboost/runboostdebuff10.statuseffect @@ -3,16 +3,17 @@ "blockingStat" : "stunImmunity", "effectConfig": { "controlModifiers": { - "runModifier": 0.9 + "speedModifier": 0.9 } }, - "defaultDuration": 30, + "defaultDuration": 5, "scripts": [ + "runboostdebuffvfx.lua", "/stats/effects/fu_genericControlModifiers.lua" ], - "animationConfig" : "runboost.animation", + "animationConfig" : "/stats/effects/sandstorm/sandstorm.animation", "label" : "-10% Run", "icon" : "/interface/statuses/haste.png" diff --git a/stats/effects/runboost/runboostdebuff20.statuseffect b/stats/effects/runboost/runboostdebuff20.statuseffect index acd41e00d6b..84647956bfd 100644 --- a/stats/effects/runboost/runboostdebuff20.statuseffect +++ b/stats/effects/runboost/runboostdebuff20.statuseffect @@ -3,16 +3,17 @@ "blockingStat" : "stunImmunity", "effectConfig": { "controlModifiers": { - "runModifier": 0.8 + "speedModifier": 0.8 } }, - "defaultDuration": 30, + "defaultDuration": 5, "scripts": [ + "runboostdebuffvfx.lua", "/stats/effects/fu_genericControlModifiers.lua" ], - "animationConfig" : "runboost.animation", + "animationConfig" : "/stats/effects/sandstorm/sandstorm.animation", "label" : "-20% Run", "icon" : "/interface/statuses/haste.png" diff --git a/stats/effects/runboost/runboostdebuffvfx.lua b/stats/effects/runboost/runboostdebuffvfx.lua new file mode 100644 index 00000000000..6570c258804 --- /dev/null +++ b/stats/effects/runboost/runboostdebuffvfx.lua @@ -0,0 +1,5 @@ +function init() + animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) + animator.setParticleEmitterActive("drips", true) + effect.setParentDirectives("fade=7733AA=0.1") +end diff --git a/stats/effects/slimeslow/slimeslow.lua b/stats/effects/slimeslow/slimeslow.lua index 98a8ee43080..0a6b799fe9f 100644 --- a/stats/effects/slimeslow/slimeslow.lua +++ b/stats/effects/slimeslow/slimeslow.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() if not world.entityType(entity.id()) then return end animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) @@ -15,13 +17,13 @@ function update(dt) if self.frEnabled and (self.species == "slimeperson") then self.healingRate = 0.025 effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = 0.9, speedModifier = 0.9, airJumpModifier = 1.4 }) else - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = 0.5, speedModifier = 0.25 }) @@ -32,4 +34,5 @@ function uninit() if bonusHandler then effect.removeStatModifierGroup(bonusHandler) end + filterModifiers({},true) end diff --git a/stats/effects/slow/icySlow.lua b/stats/effects/slow/icySlow.lua index 4ffbd8a9677..947ce4af950 100644 --- a/stats/effects/slow/icySlow.lua +++ b/stats/effects/slow/icySlow.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() if (status.stat("iceResistance")>=config.getParameter("resistanceThreshold",0.75)) then effect.expire() @@ -5,25 +7,18 @@ function init() end effect.setParentDirectives("fade=404040=0.5") - local slows = status.statusProperty("slows", {}) - slows["iceslow"] = 0.65 - status.setStatusProperty("slows", slows) didInit=true end function update(dt) if not didInit then return end - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = 0.6, - runModifier = 0.65, - jumpModifier = 0.65 + speedModifier = 0.65, + airJumpModifier = 0.65 }) end function uninit() - if didInit then - local slows = status.statusProperty("slows", {}) - slows["iceslow"] = nil - status.setStatusProperty("slows", slows) - end -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/slow/slow.lua b/stats/effects/slow/slow.lua index 90b98ad4c78..6d4b990f14a 100644 --- a/stats/effects/slow/slow.lua +++ b/stats/effects/slow/slow.lua @@ -1,21 +1,17 @@ -function init() - effect.setParentDirectives("fade=404040=0.5") +require "/stats/effects/fu_statusUtil.lua" - local slows = status.statusProperty("slows", {}) - slows["leoslow"] = 0.65 - status.setStatusProperty("slows", slows) +function init() + effect.setParentDirectives("fade=404040=0.5") end function update(dt) - mcontroller.controlModifiers({ - groundMovementModifier = 0.6, - runModifier = 0.65, - jumpModifier = 0.65 - }) + applyFilteredModifiers({ + groundMovementModifier = 0.6, + speedModifier = 0.65, + airJumpModifier = 0.65 + }) end function uninit() - local slows = status.statusProperty("slows", {}) - slows["leoslow"] = nil - status.setStatusProperty("slows", slows) -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/slow/timeslip.lua b/stats/effects/slow/timeslip.lua index 5d4d8f58e96..257a7639064 100644 --- a/stats/effects/slow/timeslip.lua +++ b/stats/effects/slow/timeslip.lua @@ -1,21 +1,17 @@ -function init() - effect.setParentDirectives("fade=cc3aef=0.5") +require "/stats/effects/fu_statusUtil.lua" - local slows = status.statusProperty("slows", {}) - slows["leoslow"] = 0.45 - status.setStatusProperty("slows", slows) +function init() + effect.setParentDirectives("fade=cc3aef=0.5") end function update(dt) - mcontroller.controlModifiers({ - groundMovementModifier = 0.4, - runModifier = 0.45, - jumpModifier = 0.45 - }) + applyFilteredModifiers({ + groundMovementModifier = 0.4, + speedModifier = 0.45, + airJumpModifier = 0.45 + }) end function uninit() - local slows = status.statusProperty("slows", {}) - slows["leoslow"] = nil - status.setStatusProperty("slows", slows) -end \ No newline at end of file + filterModifiers({},true) +end diff --git a/stats/effects/stun/stun.lua b/stats/effects/stun/stun.lua index d045e3eb870..668e008ebfb 100644 --- a/stats/effects/stun/stun.lua +++ b/stats/effects/stun/stun.lua @@ -1,10 +1,11 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() effect.setParentDirectives("fade=7733AA=0.25") - effect.addStatModifierGroup({{stat = "jumpModifier", amount = -0.3}}) end function update(dt) - mcontroller.controlModifiers({ + applyFilteredModifiers({ ToolUsageSuppressed = true, facingSuppressed = true, movementSuppressed = true, @@ -15,5 +16,5 @@ function update(dt) end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/tarslow/tarslow.lua b/stats/effects/tarslow/tarslow.lua index 87f40fa6630..bf0935e26a8 100644 --- a/stats/effects/tarslow/tarslow.lua +++ b/stats/effects/tarslow/tarslow.lua @@ -1,12 +1,11 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() script.setUpdateDelta(5) if not world.entityType(entity.id()) then return end animator.setParticleEmitterOffsetRegion("drips", mcontroller.boundBox()) animator.setParticleEmitterActive("drips", true) effect.setParentDirectives("fade=300030=0.8") - baseHandler=effect.addStatModifierGroup({ - {stat = "jumpModifier", amount = -0.20} - }) bonusHandler=effect.addStatModifierGroup({}) self.healingRate = 1 self.frEnabled=status.statusProperty("fr_enabled") @@ -21,14 +20,14 @@ function update(dt) if self.frEnabled and (self.species == "glitch") then self.healingRate = 0.015 effect.setStatModifierGroup(bonusHandler,{{stat="healthRegen",amount=status.stat("maxHealth")*self.healingRate*math.max(0,1+status.stat("healingBonus"))}}) - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = 1, speedModifier = 1, airJumpModifier = 1, liquidImpedance = 0.01 }) else - mcontroller.controlModifiers({ + applyFilteredModifiers({ groundMovementModifier = 0.5, speedModifier = 0.65, airJumpModifier = 0.80 @@ -41,7 +40,5 @@ function uninit() if bonusHandler then effect.removeStatModifierGroup(bonusHandler) end - if baseHandler then - effect.removeStatModifierGroup(baseHandler) - end + filterModifiers({},true) end diff --git a/stats/effects/waterweight/waterweight.lua b/stats/effects/waterweight/waterweight.lua index fd853bffa3d..7f4e9652403 100644 --- a/stats/effects/waterweight/waterweight.lua +++ b/stats/effects/waterweight/waterweight.lua @@ -1,17 +1,16 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - effect.setParentDirectives("fade=D1CC87=0.1") - effect.addStatModifierGroup({ - {stat = "jumpModifier", amount = -0.25} - }) + effect.setParentDirectives("fade=D1CC87=0.1") end function update(dt) - mcontroller.controlModifiers({ - speedModifier = 0.7, - airJumpModifier = 0.55 - }) + applyFilteredModifiers({ + speedModifier = 0.7, + airJumpModifier = 0.55 + }) end function uninit() - + filterModifiers({},true) end diff --git a/stats/effects/weaknesses/radioactiveplant.lua b/stats/effects/weaknesses/radioactiveplant.lua index d9d8f8dba17..ec8d9761502 100644 --- a/stats/effects/weaknesses/radioactiveplant.lua +++ b/stats/effects/weaknesses/radioactiveplant.lua @@ -1,3 +1,5 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() script.setUpdateDelta(5) if not world.entitySpecies(entity.id()) then return end @@ -38,6 +40,7 @@ function update(dt) else self.tickTimer = (self.tickTimer or 0) - dt end + applyFilteredModifiers({ airJumpModifier = 1.0, speedModifier = 1.0 }) end end @@ -50,7 +53,7 @@ function applyPenalty() sourceEntityId = entity.id() }) effect.setParentDirectives("fade=806e4f="..self.tickTimer * 0.25) - mcontroller.controlModifiers({ airJumpModifier = 0.08, speedModifier = 0.08 }) + applyFilteredModifiers({ airJumpModifier = 0.08, speedModifier = 0.08 }) end function applyEffects() @@ -66,4 +69,5 @@ function uninit() if not self.didInit then return end effect.removeStatModifierGroup(self.statHandler) animator.setParticleEmitterActive("drips", false) + filterModifiers({},true) end diff --git a/stats/effects/wet/wetblood.lua b/stats/effects/wet/wetblood.lua index ce0faf877a2..c80bb68ec4d 100644 --- a/stats/effects/wet/wetblood.lua +++ b/stats/effects/wet/wetblood.lua @@ -1,22 +1,28 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - animator.setParticleEmitterOffsetRegion("dripsblood", mcontroller.boundBox()) - if (mcontroller.liquidPercentage() < 0.30) then - animator.setParticleEmitterActive("dripsblood", true) - else - animator.setParticleEmitterActive("dripsblood", false) - end + animator.setParticleEmitterOffsetRegion("dripsblood", mcontroller.boundBox()) + if (mcontroller.liquidPercentage() < 0.30) then + animator.setParticleEmitterActive("dripsblood", true) + else + animator.setParticleEmitterActive("dripsblood", false) + end - effect.setParentDirectives("fade=ff0072=0.1") + effect.setParentDirectives("fade=ff0072=0.1") end function update(dt) - if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged - animator.setParticleEmitterActive("dripsblood", true) - else - animator.setParticleEmitterActive("dripsblood", false) - end - mcontroller.controlModifiers({ - runModifier = 0.97, - jumpModifier = 0.97 - }) -end \ No newline at end of file + if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged + animator.setParticleEmitterActive("dripsblood", true) + else + animator.setParticleEmitterActive("dripsblood", false) + end + applyFilteredModifiers({ + speedModifier = 0.97, + airJumpModifier = 0.97 + }) +end + +function uninit() + filterModifiers({},true) +end diff --git a/stats/effects/wet/wetelder.lua b/stats/effects/wet/wetelder.lua index 5f8a4f86ec2..2b63d72c7f1 100644 --- a/stats/effects/wet/wetelder.lua +++ b/stats/effects/wet/wetelder.lua @@ -1,22 +1,28 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - animator.setParticleEmitterOffsetRegion("dripselder", mcontroller.boundBox()) - if (mcontroller.liquidPercentage() < 0.30) then - animator.setParticleEmitterActive("dripselder", true) - else - animator.setParticleEmitterActive("dripselder", false) - end + animator.setParticleEmitterOffsetRegion("dripselder", mcontroller.boundBox()) + if (mcontroller.liquidPercentage() < 0.30) then + animator.setParticleEmitterActive("dripselder", true) + else + animator.setParticleEmitterActive("dripselder", false) + end - effect.setParentDirectives("fade=337233=0.1") + effect.setParentDirectives("fade=337233=0.1") end function update(dt) - if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged - animator.setParticleEmitterActive("dripselder", true) - else - animator.setParticleEmitterActive("dripselder", false) - end - mcontroller.controlModifiers({ - runModifier = 0.77, - jumpModifier = 0.77 - }) -end \ No newline at end of file + if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged + animator.setParticleEmitterActive("dripselder", true) + else + animator.setParticleEmitterActive("dripselder", false) + end + applyFilteredModifiers({ + speedModifier = 0.77, + airJumpModifier = 0.77 + }) +end + +function uninit() + filterModifiers({},true) +end diff --git a/stats/effects/wet/wethealingwater.lua b/stats/effects/wet/wethealingwater.lua index 2681caa1dd5..09ed031db08 100644 --- a/stats/effects/wet/wethealingwater.lua +++ b/stats/effects/wet/wethealingwater.lua @@ -1,22 +1,28 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - animator.setParticleEmitterOffsetRegion("dripshealing", mcontroller.boundBox()) - if (mcontroller.liquidPercentage() < 0.30) then - animator.setParticleEmitterActive("dripshealing", true) - else - animator.setParticleEmitterActive("dripshealing", false) - end + animator.setParticleEmitterOffsetRegion("dripshealing", mcontroller.boundBox()) + if (mcontroller.liquidPercentage() < 0.30) then + animator.setParticleEmitterActive("dripshealing", true) + else + animator.setParticleEmitterActive("dripshealing", false) + end - effect.setParentDirectives("fade=2244ff=0.1") + effect.setParentDirectives("fade=2244ff=0.1") end function update(dt) - if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged - animator.setParticleEmitterActive("dripshealing", true) - else - animator.setParticleEmitterActive("dripshealing", false) - end - mcontroller.controlModifiers({ - runModifier = 0.97, - jumpModifier = 0.97 - }) -end \ No newline at end of file + if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged + animator.setParticleEmitterActive("dripshealing", true) + else + animator.setParticleEmitterActive("dripshealing", false) + end + applyFilteredModifiers({ + speedModifier = 0.97, + airJumpModifier = 0.97 + }) +end + +function uninit() + filterModifiers({},true) +end diff --git a/stats/effects/wet/wetpus.lua b/stats/effects/wet/wetpus.lua index 1d2a72a303f..d8c4b085437 100644 --- a/stats/effects/wet/wetpus.lua +++ b/stats/effects/wet/wetpus.lua @@ -1,22 +1,28 @@ +require "/stats/effects/fu_statusUtil.lua" + function init() - animator.setParticleEmitterOffsetRegion("dripspus", mcontroller.boundBox()) - if (mcontroller.liquidPercentage() < 0.30) then - animator.setParticleEmitterActive("dripspus", true) - else - animator.setParticleEmitterActive("dripspus", false) - end + animator.setParticleEmitterOffsetRegion("dripspus", mcontroller.boundBox()) + if (mcontroller.liquidPercentage() < 0.30) then + animator.setParticleEmitterActive("dripspus", true) + else + animator.setParticleEmitterActive("dripspus", false) + end - effect.setParentDirectives("fade=0072ff=0.1") + effect.setParentDirectives("fade=0072ff=0.1") end function update(dt) - if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged - animator.setParticleEmitterActive("dripspus", true) - else - animator.setParticleEmitterActive("dripspus", false) - end - mcontroller.controlModifiers({ - runModifier = 0.87, - jumpModifier = 0.87 - }) -end \ No newline at end of file + if (mcontroller.liquidPercentage() < 0.30) then --only apply when submerged + animator.setParticleEmitterActive("dripspus", true) + else + animator.setParticleEmitterActive("dripspus", false) + end + applyFilteredModifiers({ + speedModifier = 0.87, + airJumpModifier = 0.87 + }) +end + +function uninit() + filterModifiers({},true) +end diff --git a/tech/distortionsphere/armorsphere.tech b/tech/distortionsphere/armorsphere.tech index 5230457f0f0..f15c3b71c67 100644 --- a/tech/distortionsphere/armorsphere.tech +++ b/tech/distortionsphere/armorsphere.tech @@ -19,7 +19,6 @@ "transformedMovementParameters" : { "collisionPoly" : [ [-0.85, -0.45], [-0.45, -0.85], [0.45, -0.85], [0.85, -0.45], [0.85, 0.45], [0.45, 0.85], [-0.45, 0.85], [-0.85, 0.45] ], - "runModifier" : 1, "groundForce" : 450.0, "normalGroundFriction" : 1.5, "ambulatingGroundFriction" : 0.25, diff --git a/tech/distortionsphere/bouncesphere.tech b/tech/distortionsphere/bouncesphere.tech index 33ebfefc33b..43f9db06b5c 100644 --- a/tech/distortionsphere/bouncesphere.tech +++ b/tech/distortionsphere/bouncesphere.tech @@ -19,7 +19,6 @@ "transformedMovementParameters" : { "collisionPoly" : [ [-0.85, -0.45], [-0.45, -0.85], [0.45, -0.85], [0.85, -0.45], [0.85, 0.45], [0.45, 0.85], [-0.45, 0.85], [-0.85, 0.45] ], - "runModifier" : 1, "groundForce" : 400.0, "normalGroundFriction" : 2, "ambulatingGroundFriction" : 0.45, diff --git a/tech/distortionsphere/funball.tech b/tech/distortionsphere/funball.tech index ea5091b0f92..387711b55d9 100644 --- a/tech/distortionsphere/funball.tech +++ b/tech/distortionsphere/funball.tech @@ -19,7 +19,6 @@ "transformedMovementParameters" : { "collisionPoly" : [ [-0.85, -0.45], [-0.45, -0.85], [0.45, -0.85], [0.85, -0.45], [0.85, 0.45], [0.45, 0.85], [-0.45, 0.85], [-0.85, 0.45] ], - "runModifier" : 0.9, "groundForce" : 700.0, "normalGroundFriction" : 4, "ambulatingGroundFriction" : 0.45, diff --git a/tech/distortionsphere/microsphere.tech b/tech/distortionsphere/microsphere.tech index 713ed40f203..bb6aefbcfe3 100644 --- a/tech/distortionsphere/microsphere.tech +++ b/tech/distortionsphere/microsphere.tech @@ -19,7 +19,6 @@ "transformedMovementParameters" : { "collisionPoly" : [ [-0.45, -0.25], [-0.25, -0.45], [0.25, -0.45], [0.45, -0.25], [0.45, 0.25], [0.25, 0.45], [-0.25, 0.45], [-0.45, 0.25] ], - "runModifier" : 1, "groundForce" : 400.0, "normalGroundFriction" : 1.6, "ambulatingGroundFriction" : 0.25, diff --git a/tech/distortionsphere/microspherebomb.tech b/tech/distortionsphere/microspherebomb.tech index ad4fa56dabd..47ddbaf5355 100644 --- a/tech/distortionsphere/microspherebomb.tech +++ b/tech/distortionsphere/microspherebomb.tech @@ -19,7 +19,6 @@ "transformedMovementParameters" : { "collisionPoly" : [ [-0.45, -0.25], [-0.25, -0.45], [0.25, -0.45], [0.45, -0.25], [0.45, 0.25], [0.25, 0.45], [-0.25, 0.45], [-0.45, 0.25] ], - "runModifier" : 1, "groundForce" : 400.0, "normalGroundFriction" : 1.6, "ambulatingGroundFriction" : 0.25, diff --git a/tech/other/bugarmor.lua b/tech/other/bugarmor.lua index 25b020632f6..30e07fdef83 100644 --- a/tech/other/bugarmor.lua +++ b/tech/other/bugarmor.lua @@ -1,3 +1,4 @@ +require "/stats/effects/fu_statusUtil.lua" require "/scripts/vec2.lua" function init() @@ -97,13 +98,13 @@ function update(args) end if self.stance == "defense" then -- in defense stance, we are slow - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 0.75}) + applyFilteredModifiers({speedModifier = 0.75}) elseif self.stance == "shield" then -- in shield stance we are slightly slower - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 0.90}) + applyFilteredModifiers({speedModifier = 0.90}) elseif self.stance == "attack" then -- in attack stance we are faster - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.1}) + applyFilteredModifiers({speedModifier = 1.1}) elseif self.stance == "jump" then -- in jump stance we are faster and jump higher - mcontroller.controlModifiers({speedModifier = (status.statPositive("spikeSphereActive") and 1.0) or 1.1, airJumpModifier = 1.1}) + applyFilteredModifiers({speedModifier = 1.1, airJumpModifier = 1.1}) end end @@ -123,4 +124,5 @@ end function uninit() attemptActivation(false) + filterModifiers({},true) end diff --git a/tileEffects.config b/tileEffects.config index 8fd5f5cfedf..c90a1202fa6 100644 --- a/tileEffects.config +++ b/tileEffects.config @@ -3,9 +3,6 @@ "clay" : { "brittle" : 1, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -21,9 +18,6 @@ "cloudblock" : { "brittle" : 10, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -39,9 +33,6 @@ "frozenwater" : { "brittle" : 10, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -57,9 +48,6 @@ "glass" : { "brittle" : 10, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -75,9 +63,6 @@ "ice" : { "brittle" : 10, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -93,9 +78,6 @@ "iceblock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -110,9 +92,7 @@ "mud" : { "brittle" : 1, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 0.8, - "runModifier" : 1 + "groundMovementModifier" : 0.8 }, "controlParameters" : { "bounceFactor" : 0, @@ -128,9 +108,6 @@ "sand" : { "brittle" : 2, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -148,7 +125,7 @@ "controlModifiers" : { "airJumpModifier" : 0.7, "groundMovementModifier" : 0.5, - "runModifier" : 0.7 + "speedModifier" : 0.7 }, "controlParameters" : { "bounceFactor" : 0, @@ -163,9 +140,6 @@ "slime" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 1, @@ -180,9 +154,6 @@ "slush" : { "brittle" : 8, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -198,9 +169,6 @@ "snow" : { "brittle" : 8, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -216,9 +184,6 @@ "spidersilkblock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -233,9 +198,6 @@ "spidersilkblockmik" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -252,7 +214,7 @@ "controlModifiers" : { "airJumpModifier" : 0.7, "groundMovementModifier" : 0.5, - "runModifier" : 0.7 + "speedModifier" : 0.7 }, "controlParameters" : { "bounceFactor" : 0, @@ -270,9 +232,6 @@ "asphalt" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -287,9 +246,6 @@ "bioblock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -304,9 +260,6 @@ "bioblock2" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -321,9 +274,6 @@ "blackslime" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -338,9 +288,6 @@ "crystalsand" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -355,9 +302,6 @@ "fublueslime" : { "brittle" : 2, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 1, @@ -373,9 +317,6 @@ "fublueslimedirt" : { "brittle" : 2, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 1, @@ -391,9 +332,6 @@ "fublueslimestone" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0.5, @@ -408,9 +346,6 @@ "fujellyblock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 1, @@ -425,9 +360,6 @@ "glasssand" : { "brittle" : 5, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -443,9 +375,6 @@ "glowsand" : { "brittle" : 2, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -461,9 +390,6 @@ "honeycombmaterial" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -478,9 +404,6 @@ "iceblock1" : { "brittle" : 3, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -496,9 +419,6 @@ "iceblock2" : { "brittle" : 3, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -514,9 +434,6 @@ "iceblock3" : { "brittle" : 3, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -532,9 +449,6 @@ "iceblock4" : { "brittle" : 3, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -550,9 +464,6 @@ "irradiatedtile" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -567,9 +478,6 @@ "irradiatedtile2" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -584,9 +492,6 @@ "irradiatedtile3" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -601,9 +506,6 @@ "jellyblock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 1, @@ -618,9 +520,6 @@ "jellystone" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 1, @@ -635,9 +534,6 @@ "jumpblock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -652,9 +548,6 @@ "jungledirt1" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -669,9 +562,6 @@ "jungledirt2" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -686,9 +576,6 @@ "magmatile1" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -704,9 +591,6 @@ "magmatile2" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -722,9 +606,6 @@ "magmatile3" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -740,9 +621,6 @@ "magmatile4" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -758,9 +636,6 @@ "metallic" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -775,9 +650,6 @@ "moltenmetal" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -792,9 +664,6 @@ "moltensand" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -809,9 +678,6 @@ "moltensteel" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -826,9 +692,6 @@ "moltentile" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -843,9 +706,6 @@ "protorock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -860,9 +720,6 @@ "rainbowsand" : { "brittle" : 2, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -878,9 +735,6 @@ "raincloud" : { "brittle" : 10, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -896,9 +750,6 @@ "redhotcobblestone" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -914,9 +765,6 @@ "redsand" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -931,9 +779,6 @@ "slime2" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 1, @@ -948,9 +793,6 @@ "speedblock" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -965,9 +807,6 @@ "springvines" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0, @@ -982,9 +821,6 @@ "swampdirtff" : { "brittle" : false, "controlModifiers" : { - "airJumpModifier" : 1, - "groundMovementModifier" : 1, - "runModifier" : 1 }, "controlParameters" : { "bounceFactor" : 0,