v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
12
assets/devel/items/active/partypopper/muzzleflash.frames
Normal file
12
assets/devel/items/active/partypopper/muzzleflash.frames
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"frameGrid" : {
|
||||
"size" : [15, 15],
|
||||
"dimensions" : [2, 3],
|
||||
|
||||
"names" : [
|
||||
[ "1.1", "1.2" ],
|
||||
[ "2.1", "2.2" ],
|
||||
[ "3.1", "3.2" ]
|
||||
]
|
||||
}
|
||||
}
|
BIN
assets/devel/items/active/partypopper/muzzleflash.png
Normal file
BIN
assets/devel/items/active/partypopper/muzzleflash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 379 B |
17
assets/devel/items/active/partypopper/partypopper.activeitem
Normal file
17
assets/devel/items/active/partypopper/partypopper.activeitem
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"itemName" : "partypopper",
|
||||
"level" : 1,
|
||||
"rarity" : "Legendary",
|
||||
"category" : "toy",
|
||||
"description" : "It's party time!",
|
||||
"shortdescription" : "Party Popper",
|
||||
"twoHanded" : true,
|
||||
|
||||
"inventoryIcon" : "partypoppericon.png",
|
||||
"animation" : "partypopper.animation",
|
||||
"animationCustom" : {},
|
||||
"scripts" : ["partypopper.lua"],
|
||||
|
||||
"fireTime" : 2.0,
|
||||
"fireOffset" : [1.0, 0.0]
|
||||
}
|
237
assets/devel/items/active/partypopper/partypopper.animation
Normal file
237
assets/devel/items/active/partypopper/partypopper.animation
Normal file
|
@ -0,0 +1,237 @@
|
|||
{
|
||||
"animatedParts" : {
|
||||
"stateTypes" : {
|
||||
"firing" : {
|
||||
"default" : "off",
|
||||
"states" : {
|
||||
"off" : {
|
||||
"properties" : {
|
||||
"particleEmittersOff" : [ "confetti" ]
|
||||
}
|
||||
},
|
||||
"fire" : {
|
||||
"frames" : 2,
|
||||
"cycle" : 0.1,
|
||||
"mode" : "transition",
|
||||
"transition" : "confetti",
|
||||
"properties" : {
|
||||
"immediateSound" : "/sfx/gun/grenadeblast1.ogg",
|
||||
"particleEmittersOff" : [ "confetti" ]
|
||||
},
|
||||
"frameProperties" : {
|
||||
"stateNudge" : [ [-0.125, 0], [0, 0] ]
|
||||
}
|
||||
},
|
||||
"confetti" : {
|
||||
"cycle" : 0.2,
|
||||
"mode" : "transition",
|
||||
"transition" : "off",
|
||||
"properties" : {
|
||||
"particleEmittersOn" : [ "confetti" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"parts" : {
|
||||
"gun" : {
|
||||
"properties" : {
|
||||
"centered" : true,
|
||||
"image" : "partypopper.png",
|
||||
"offset" : [0.0, 0.0]
|
||||
}
|
||||
},
|
||||
"muzzleFlash" : {
|
||||
"properties" : {
|
||||
"zLevel" : 1,
|
||||
"centered" : true,
|
||||
"offset" : [2.0, 0.0]
|
||||
},
|
||||
|
||||
"partStates" : {
|
||||
"firing" : {
|
||||
"off" : {
|
||||
"properties" : {
|
||||
"image" : ""
|
||||
}
|
||||
},
|
||||
"fire" : {
|
||||
"properties" : {
|
||||
"image" : "muzzleflash.png:<variant>.<frame>"
|
||||
}
|
||||
},
|
||||
"confetti" : {
|
||||
"properties" : {
|
||||
"image" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"particleEmitters" : {
|
||||
"confetti" : {
|
||||
"emissionRate" : 500.0,
|
||||
"emissionRateVariance" : 0.0,
|
||||
"active" : true,
|
||||
|
||||
"particles" : [
|
||||
{
|
||||
// Red, drifting
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [255, 0, 0, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 9.0],
|
||||
"finalVelocity" : [0.0, -5.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [2, 2.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// Red, falling fast
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [255, 0, 0, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 7.0],
|
||||
"finalVelocity" : [0.0, -50.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [5, 2.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// Green, drifting
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [0, 255, 0, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 9.0],
|
||||
"finalVelocity" : [0.0, -5.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [2, 2.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// Green, falling fast
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [0, 255, 0, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 7.0],
|
||||
"finalVelocity" : [0.0, -50.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [5, 2.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// Blue, drifting
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [0, 0, 255, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 9.0],
|
||||
"finalVelocity" : [0.0, -5.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [2, 2.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// Blue, falling fast
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [0, 0, 255, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 7.0],
|
||||
"finalVelocity" : [0.0, -50.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [5, 2.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// White, drifting
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [255, 255, 255, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 9.0],
|
||||
"finalVelocity" : [0.0, -5.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [2, 2.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// White, falling fast
|
||||
"particle" : {
|
||||
"type" : "ember",
|
||||
"position" : [1.0, 0],
|
||||
"size" : 2.0,
|
||||
"color" : [255, 255, 255, 255],
|
||||
"light" : [50, 50, 50],
|
||||
"fade" : 0.9,
|
||||
"initialVelocity" : [0.0, 7.0],
|
||||
"finalVelocity" : [0.0, -50.0],
|
||||
"approach" : [0, 20],
|
||||
"timeToLive" : 5,
|
||||
"layer" : "middle",
|
||||
"variance" : {
|
||||
"initialVelocity" : [5, 2.0]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
83
assets/devel/items/active/partypopper/partypopper.lua
Normal file
83
assets/devel/items/active/partypopper/partypopper.lua
Normal file
|
@ -0,0 +1,83 @@
|
|||
require "/scripts/vec2.lua"
|
||||
|
||||
function init()
|
||||
-- sb.logInfo("Initializing metagun")
|
||||
|
||||
self.recoil = 0
|
||||
self.recoilRate = 0
|
||||
|
||||
self.fireOffset = config.getParameter("fireOffset")
|
||||
updateAim()
|
||||
|
||||
self.active = false
|
||||
storage.fireTimer = storage.fireTimer or 0
|
||||
|
||||
animator.setPartTag("muzzleFlash", "variant", "1")
|
||||
end
|
||||
|
||||
function uninit()
|
||||
-- sb.logInfo("Uninitializing metagun")
|
||||
end
|
||||
|
||||
function update(dt, fireMode, shiftHeld)
|
||||
-- sb.logInfo("Updating metagun with fireMode %s and shiftHeld %s", fireMode, shiftHeld)
|
||||
|
||||
updateAim()
|
||||
|
||||
storage.fireTimer = math.max(storage.fireTimer - dt, 0)
|
||||
|
||||
if self.active then
|
||||
self.recoilRate = 0
|
||||
else
|
||||
self.recoilRate = math.max(1, self.recoilRate + (10 * dt))
|
||||
end
|
||||
self.recoil = math.max(self.recoil - dt * self.recoilRate, 0)
|
||||
|
||||
if self.active and storage.fireTimer <= 0 then
|
||||
self.recoil = math.pi/2 - self.aimAngle
|
||||
activeItem.setArmAngle(math.pi/2)
|
||||
if animator.animationState("firing") == "off" then
|
||||
animator.setAnimationState("firing", "fire")
|
||||
end
|
||||
animator.setPartTag("muzzleFlash", "variant", math.random(1, 3))
|
||||
storage.fireTimer = config.getParameter("fireTime", 1.0)
|
||||
|
||||
end
|
||||
|
||||
self.active = false
|
||||
end
|
||||
|
||||
function activate(fireMode, shiftHeld)
|
||||
-- sb.logInfo("Activating metagun with fireMode %s and shiftHeld %s", fireMode, shiftHeld)
|
||||
|
||||
self.active = true
|
||||
end
|
||||
|
||||
function updateAim()
|
||||
self.aimAngle, self.aimDirection = activeItem.aimAngleAndDirection(self.fireOffset[2], activeItem.ownerAimPosition())
|
||||
self.aimAngle = self.aimAngle + self.recoil
|
||||
activeItem.setArmAngle(self.aimAngle)
|
||||
activeItem.setFacingDirection(self.aimDirection)
|
||||
end
|
||||
|
||||
function firePosition()
|
||||
return vec2.add(mcontroller.position(), activeItem.handPosition(self.fireOffset))
|
||||
end
|
||||
|
||||
function aimVector()
|
||||
local aimVector = vec2.rotate({1, 0}, self.aimAngle + sb.nrand(config.getParameter("inaccuracy", 0), 0))
|
||||
aimVector[1] = aimVector[1] * self.aimDirection
|
||||
return aimVector
|
||||
end
|
||||
|
||||
function holdingItem()
|
||||
return true
|
||||
end
|
||||
|
||||
function recoil()
|
||||
return false
|
||||
end
|
||||
|
||||
function outsideOfHand()
|
||||
return false
|
||||
end
|
BIN
assets/devel/items/active/partypopper/partypopper.png
Normal file
BIN
assets/devel/items/active/partypopper/partypopper.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 253 B |
BIN
assets/devel/items/active/partypopper/partypoppericon.png
Normal file
BIN
assets/devel/items/active/partypopper/partypoppericon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 402 B |
Loading…
Add table
Add a link
Reference in a new issue