Skip to content

Commit

Permalink
edits to swim boost
Browse files Browse the repository at this point in the history
  • Loading branch information
sayterdarkwynd committed Dec 15, 2019
1 parent a202069 commit 15ec07f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 57 deletions.
2 changes: 1 addition & 1 deletion items/active/weapons/ranged/gunfire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function GunFire:init()
self.playerMagBonus = status.stat("magazineSize",0) -- player ammo bonuses
self.playerReloadBonus = status.stat("reloadTime",0) -- player reload bonuses

self.magazineSize = config.getParameter("magazineSize",1) + (self.playerMagBonus or 0) -- total count of the magazine
self.magazineSize = (config.getParameter("magazineSize",1) + (self.playerMagBonus or 0) or 6) -- total count of the magazine
self.magazineAmount = (self.magazineSize or 0) -- current number of bullets in the magazine
self.reloadTime = config.getParameter("reloadTime",1) + (self.playerReloadBonus or 0) -- how long does reloading mag take?

Expand Down
6 changes: 6 additions & 0 deletions player.config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"path": "/statusControllerSettings/stats/maxFood",
"value": { "baseValue": 70 }
},
{
"op": "add",
"path": "/statusControllerSettings/stats/boostAmount",
"value": { "baseValue": 1 }
},

{ "op" : "add", "path" : "/defaultBlueprints/tier1/-", "value" : {"item": "robosnax"} },
//{ "op" : "add", "path" : "/defaultBlueprints/tier1/-", "value" : {"item": "raceEffectEnabler"} },
{ "op" : "add", "path" : "/defaultBlueprints/tier1/-", "value" : {"item": "meatkibble"} },
Expand Down
31 changes: 5 additions & 26 deletions stats/effects/swimboost/swimboost1.lua
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
function init()
local bounds = mcontroller.boundBox()
animator.setParticleEmitterOffsetRegion("bubbles", mcontroller.boundBox())
animator.setParticleEmitterActive("bubbles", true)
effect.addStatModifierGroup({{stat = "boostAmount", amount = 1}}) -- make sure to reset the value to 1 each time it inits so values never stack
self.mouthPosition = status.statusProperty("mouthPosition") or {0,0}
self.mouthBounds = {self.mouthPosition[1], self.mouthPosition[2], self.mouthPosition[1], self.mouthPosition[2]}
self.boostAmount = config.getParameter("boostAmount", 0)
self.riseAmount = config.getParameter("riseAmount", 0)
self.boostAmount = config.getParameter("boostAmount", 1)
effect.addStatModifierGroup({{stat = "boostAmount", effectiveMultiplier = self.boostAmount}}) -- add the swim boost stat
sb.logInfo("ive applied swimboost of x"..status.stat("boostAmount"))
end

function update(dt)

mcontroller.controlParameters(self.liquidMovementParameter)
local position = mcontroller.position()
local worldMouthPosition = {
self.mouthPosition[1] + position[1],
self.mouthPosition[2] + position[2]
}

local liquidAtMouth = world.liquidAt(worldMouthPosition)
if liquidAtMouth and (liquidAtMouth[1] == 1 or liquidAtMouth[1] == 2) then
mcontroller.controlModifiers({
speedModifier = self.boostAmount,
liquidJumpModifier = self.riseAmount,
liquidForce = 150,
liquidImpedance = 0.1
})
animator.setParticleEmitterActive("bubbles", mcontroller.running())
else

animator.setParticleEmitterActive("bubbles", false)
end
end

function uninit()
-- status.removeEphemeralEffect("liquidimmunity")
end
14 changes: 4 additions & 10 deletions stats/effects/swimboost/swimboost1.statuseffect
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"name" : "swimboost1",
"effectConfig" : {
"movementParameters" : {
"liquidImpedance" : 0.4,
"liquidForce" : 90,
"liquidJumpProfile" : {
"jumpSpeed" : 60.0
},
"speedModifier" : 1.37
}
"boostAmount" : 1.2,
"riseAmount" : 1.2
},
"defaultDuration" : 220,

"scripts" : [
"swimboost.lua"
"swimboost1.lua"
],
"animationConfig" : "swimboost1.animation",
"label" : "Swim +",
"label" : "Swim 1",
"icon" : "/interface/statuses/swimboost.png"
}
14 changes: 4 additions & 10 deletions stats/effects/swimboost/swimboost2.statuseffect
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"name" : "swimboost2",
"effectConfig" : {
"movementParameters" : {
"liquidImpedance" : 0.3,
"liquidForce" : 130,
"liquidJumpProfile" : {
"jumpSpeed" : 70.0
},
"speedModifier" : 1.8
}
"boostAmount" : 1.4,
"riseAmount" : 1.4
},
"defaultDuration" : 220,

"scripts" : [
"swimboost.lua"
"swimboost1.lua"
],
"animationConfig" : "swimboost1.animation",
"label" : "Swim +",
"label" : "Swim 2",
"icon" : "/interface/statuses/swimboost.png"
}
14 changes: 4 additions & 10 deletions stats/effects/swimboost/swimboost3.statuseffect
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
"name" : "swimboost3",
"effectConfig" : {
"movementParameters" : {
"liquidImpedance" : 0.15,
"liquidForce" : 160,
"liquidJumpProfile" : {
"jumpSpeed" : 75.0
},
"speedModifier" : 2.2
}
"boostAmount" : 1.8,
"riseAmount" : 1.8
},
"defaultDuration" : 220,

"scripts" : [
"swimboost.lua"
"swimboost1.lua"
],
"animationConfig" : "swimboost1.animation",
"label" : "Swim +",
"label" : "Swim 3",
"icon" : "/interface/statuses/swimboost.png"
}
15 changes: 15 additions & 0 deletions stats/effects/swimboost/swimboost4.statuseffect
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name" : "swimboost4",
"effectConfig" : {
"boostAmount" : 2.2,
"riseAmount" : 2.2
},
"defaultDuration" : 220,

"scripts" : [
"swimboost1.lua"
],
"animationConfig" : "swimboost1.animation",
"label" : "Swim 4",
"icon" : "/interface/statuses/swimboost.png"
}

0 comments on commit 15ec07f

Please sign in to comment.