v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
3
assets/devel/tech/shrink/shrink.animation
Normal file
3
assets/devel/tech/shrink/shrink.animation
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
|
||||
}
|
51
assets/devel/tech/shrink/shrink.lua
Normal file
51
assets/devel/tech/shrink/shrink.lua
Normal file
|
@ -0,0 +1,51 @@
|
|||
require "/scripts/poly.lua"
|
||||
|
||||
function init()
|
||||
self.shrinkFactor = config.getParameter("shrinkFactor", 0.5)
|
||||
self.shrinkTime = config.getParameter("shrinkTime", 1.0)
|
||||
self.standingPoly = mcontroller.baseParameters().standingPoly
|
||||
self.crouchingPoly = mcontroller.baseParameters().crouchingPoly
|
||||
self.active = false
|
||||
self.shrinkTimer = 0
|
||||
end
|
||||
|
||||
function update(args)
|
||||
if not self.specialLast and args.moves["special1"] then
|
||||
storage.active = not storage.active
|
||||
end
|
||||
self.specialLast = args.moves["special1"]
|
||||
|
||||
if storage.active then
|
||||
self.shrinkTimer = math.min(self.shrinkTime, self.shrinkTimer + args.dt)
|
||||
updateShrink()
|
||||
tech.setToolUsageSuppressed(true)
|
||||
elseif self.shrinkTimer > 0 then
|
||||
self.shrinkTimer = math.max(0, self.shrinkTimer - args.dt)
|
||||
updateShrink()
|
||||
else
|
||||
tech.setToolUsageSuppressed(false)
|
||||
end
|
||||
end
|
||||
|
||||
function updateShrink()
|
||||
if self.shrinkTimer > 0 then
|
||||
local scaleAmount = 1 - util.round(self.shrinkFactor * (self.shrinkTimer / self.shrinkTime), 2)
|
||||
tech.setParentDirectives("?scalenearest=" .. scaleAmount .. "=" .. scaleAmount)
|
||||
|
||||
mcontroller.controlParameters({
|
||||
standingPoly = poly.scale(self.standingPoly, scaleAmount),
|
||||
crouchingPoly = poly.scale(self.crouchingPoly, scaleAmount)
|
||||
})
|
||||
mcontroller.controlModifiers({
|
||||
speedModifier = scaleAmount,
|
||||
airJumpModifier = scaleAmount
|
||||
})
|
||||
else
|
||||
tech.setParentDirectives()
|
||||
end
|
||||
end
|
||||
|
||||
function uninit()
|
||||
self.shrinkTimer = 0
|
||||
updateShrink()
|
||||
end
|
17
assets/devel/tech/shrink/shrink.tech
Normal file
17
assets/devel/tech/shrink/shrink.tech
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name" : "shrink",
|
||||
"type" : "head",
|
||||
|
||||
"scripts" : [ "shrink.lua" ],
|
||||
"animator" : "shrink.animation",
|
||||
|
||||
"description" : "Drink Me",
|
||||
"shortDescription" : "Shrink",
|
||||
"rarity" : "Legendary",
|
||||
"icon" : "/tech/shrink.png",
|
||||
|
||||
"chipCost" : 8,
|
||||
|
||||
"shrinkFactor" : 0.5,
|
||||
"shrinkTime" : 0.5
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue