-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a202069
commit 15ec07f
Showing
7 changed files
with
39 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |