v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"frameGrid" : {
|
||||
"size" : [96, 48],
|
||||
"dimensions" : [3, 1],
|
||||
|
||||
"names" : [
|
||||
[ "1", "2", "3" ]
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
require "/scripts/poly.lua"
|
||||
require "/scripts/vec2.lua"
|
||||
|
||||
function setupAbility(altAbilityConfig)
|
||||
local vacuum = WeaponAbility:new()
|
||||
|
||||
function vacuum:init()
|
||||
self.cooldownTimer = 0
|
||||
self:reset()
|
||||
end
|
||||
|
||||
function vacuum:update(dt, fireMode, shiftHeld)
|
||||
WeaponAbility.update(self, dt, fireMode, shiftHeld)
|
||||
|
||||
self.cooldownTimer = math.max(0, self.cooldownTimer - self.dt)
|
||||
|
||||
if self.fireMode == "alt"
|
||||
and not self.active
|
||||
and self.cooldownTimer == 0
|
||||
and not status.resourceLocked("energy") then
|
||||
|
||||
self:setState(self.fire)
|
||||
end
|
||||
end
|
||||
|
||||
function vacuum:fire()
|
||||
self.weapon:setStance(self.stances.fire)
|
||||
-- self.weapon.aimAngle = 0
|
||||
-- self.weapon:updateAim()
|
||||
animator.setAnimationState("vacuum", "active")
|
||||
animator.playSound("vacuumStart")
|
||||
animator.playSound("vacuumLoop", -1)
|
||||
|
||||
local vacuumPoint = {
|
||||
type = "RadialForceRegion",
|
||||
center = animator.partPoint("vacuumCone", "vacuumPoint"),
|
||||
targetRadialVelocity = self.pointSpeed,
|
||||
outerRadius = 1.5,
|
||||
innerRadius = 0.5,
|
||||
controlForce = self.pointForce
|
||||
}
|
||||
|
||||
self.active = true
|
||||
|
||||
while self.fireMode == "alt" and status.overConsumeResource("energy", self.energyUsage * self.dt) do
|
||||
mcontroller.controlModifiers({runningSuppressed = true})
|
||||
|
||||
local forceVector = vec2.rotate(self.coneSpeed, self.weapon.aimAngle)
|
||||
forceVector[1] = forceVector[1] * self.weapon.aimDirection
|
||||
|
||||
local vacuumConeTop = {
|
||||
type = "DirectionalForceRegion",
|
||||
polyRegion = animator.partPoly("vacuumCone", "vacuumPolyTop"),
|
||||
xTargetVelocity = forceVector[1],
|
||||
yTargetVelocity = -forceVector[2],
|
||||
controlForce = self.coneForce
|
||||
}
|
||||
local vacuumConeBottom = {
|
||||
type = "DirectionalForceRegion",
|
||||
polyRegion = animator.partPoly("vacuumCone", "vacuumPolyBottom"),
|
||||
xTargetVelocity = forceVector[1],
|
||||
yTargetVelocity = forceVector[2],
|
||||
controlForce = self.coneForce
|
||||
}
|
||||
activeItem.setItemForceRegions({vacuumConeTop, vacuumConeBottom, vacuumPoint})
|
||||
|
||||
coroutine.yield()
|
||||
end
|
||||
|
||||
activeItem.setItemForceRegions({})
|
||||
|
||||
animator.setAnimationState("vacuum", "idle")
|
||||
animator.stopAllSounds("vacuumLoop")
|
||||
|
||||
self.cooldownTimer = self.cooldownTime
|
||||
|
||||
self.active = false
|
||||
end
|
||||
|
||||
function vacuum:reset()
|
||||
animator.setAnimationState("vacuum", "idle")
|
||||
animator.stopAllSounds("vacuumLoop")
|
||||
activeItem.setItemForceRegions({})
|
||||
self.active = false
|
||||
end
|
||||
|
||||
function vacuum:uninit()
|
||||
self:reset()
|
||||
end
|
||||
|
||||
return vacuum
|
||||
end
|
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"animationCustom" : {
|
||||
"animatedParts" : {
|
||||
"stateTypes" : {
|
||||
"vacuum" : {
|
||||
"default" : "idle",
|
||||
"states" : {
|
||||
"idle" : { },
|
||||
"active" : {
|
||||
"frames" : 3,
|
||||
"cycle" : 0.3,
|
||||
"mode" : "loop"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"parts" : {
|
||||
"vacuumCone" : {
|
||||
"properties" : {
|
||||
"zLevel" : -1,
|
||||
"centered" : true,
|
||||
"offset" : [6.0, 0.0],
|
||||
"transformationGroups" : [ "muzzle" ],
|
||||
"vacuumPolyTop" : [ [-4.5, 0], [-4.5, 1.5], [6.0, 4.0], [6.0, 0] ],
|
||||
"vacuumPolyBottom" : [ [-4.5, -1.5], [-4.5, 0], [6.0, 0], [6.0, -4.0] ],
|
||||
"vacuumPoint" : [-5.0, 0.25]
|
||||
},
|
||||
"partStates" : {
|
||||
"vacuum" : {
|
||||
"idle" : {
|
||||
"properties" : {
|
||||
"image" : ""
|
||||
}
|
||||
},
|
||||
"active" : {
|
||||
"properties" : {
|
||||
"image" : "/items/active/weapons/ranged/abilities/vacuum/vacuum.png:<frame>"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sounds" : {
|
||||
"vacuumStart" : [ ],
|
||||
"vacuumLoop" : [ ]
|
||||
}
|
||||
},
|
||||
|
||||
"ability" : {
|
||||
"type" : "vacuum",
|
||||
"scripts" : ["/items/active/weapons/ranged/abilities/vacuum/vacuum.lua"],
|
||||
|
||||
"cooldownTime" : 0.5,
|
||||
|
||||
"coneSpeed" : [-20, 5],
|
||||
"coneForce" : 400,
|
||||
"pointSpeed" : -10,
|
||||
"pointForce" : 500,
|
||||
|
||||
"energyUsage" : 20,
|
||||
|
||||
"stances" : {
|
||||
"fire" : {
|
||||
"armRotation" : 0,
|
||||
"weaponRotation" : 0,
|
||||
"twoHanded" : true,
|
||||
|
||||
"allowRotate" : true,
|
||||
"allowFlip" : true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue