This commit is contained in:
Aria 2025-03-21 22:23:30 +11:00
commit 9c94d113d3
Signed by untrusted user who does not match committer: aria
GPG key ID: 19AB7AA462B8AB3B
10260 changed files with 1237388 additions and 0 deletions

View file

@ -0,0 +1,339 @@
{
"animatedParts" : {
"stateTypes" : {
"movement" : {
"default" : "idle",
"states" : {
"idle" : { },
"jump" : {
"frames" : 4,
"cycle" : 0.5,
"mode" : "end"
},
"fall" : {
"frames" : 4,
"cycle" : 0.5,
"mode" : "end"
},
"walk" : {
"frames" : 10,
"cycle" : 1.0,
"mode" : "loop"
},
"backWalk" : {
"frames" : 10,
"cycle" : 1.0,
"mode" : "loop"
}
}
}
},
"parts" : {
"body" : {
"properties" : {
"centered" : true,
"zLevel" : 3,
"sitPosition" : [5.25, 2.0]
},
"partStates" : {
"movement" : {
"idle" : {
"properties" : {
"image" : "<partImage>:idle"
}
},
"jump" : {
"properties" : {
"image" : "<partImage>:idle",
"immediateSound" : "/sfx/tech/mech_jump3.ogg"
},
"frameProperties" : {
"offset" : [ [0, 0.5], [0, 0.5], [0, 0.375], [0, 0.375] ]
}
},
"fall" : {
"properties" : {
"image" : "<partImage>:idle"
},
"frameProperties" : {
"offset" : [ [0, 0.25], [0, 0.25], [0, 0.125], [0, 0] ]
}
},
"walk" : {
"properties" : {
"image" : "<partImage>:idle"
},
"frameProperties" : {
"immediateSound" : [ "/sfx/tech/mech_step.ogg", "", "", "", "", "/sfx/tech/mech_step.ogg", "", "", "", "" ],
"offset" : [ [0, 0.375], [0, 0.125], [0, 0], [0, 0.125], [0, 0.25], [0, 0.375], [0, 0.125], [0, 0], [0, 0.125], [0, 0.25] ]
}
},
"backWalk" : {
"properties" : {
"image" : "<partImage>:idle"
},
"frameProperties" : {
"immediateSound" : [ "/sfx/tech/mech_step.ogg", "", "", "", "", "/sfx/tech/mech_step.ogg", "", "", "", "" ],
"offset" : [ [0, 0.375], [0, 0.125], [0, 0], [0, 0.125], [0, 0.25], [0, 0.375], [0, 0.125], [0, 0], [0, 0.125], [0, 0.25] ]
}
}
}
}
},
"backLeg" : {
"properties" : {
"centered" : true,
"zLevel" : -2,
"anchorPart" : "body"
},
"partStates" : {
"movement" : {
"idle" : {
"properties" : {
"image" : "<partImage>:idle",
"offset" : [-3.0, 0]
}
},
"jump" : {
"properties" : {
"image" : "<partImage>:jump.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.5], [-3.0, -0.5], [-3.0, -0.375], [-3.0, -0.375] ]
}
},
"fall" : {
"properties" : {
"image" : "<partImage>:fall.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.25], [-3.0, -0.25], [-3.0, -0.125], [-3.0, 0] ]
}
},
"walk" : {
"properties" : {
"image" : "<partImage>:move.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25], [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25] ]
}
},
"backWalk" : {
"properties" : {
"image" : "<partImage>:bmove.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25], [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25] ]
}
}
}
}
},
"backLeg2" : {
"properties" : {
"centered" : true,
"zLevel" : -2,
"anchorPart" : "body"
},
"partStates" : {
"movement" : {
"idle" : {
"properties" : {
"image" : "<partImage>:idle",
"offset" : [4.0, 0]
}
},
"jump" : {
"properties" : {
"image" : "<partImage>:jump.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.5], [4.0, -0.5], [4.0, -0.375], [4.0, -0.375] ]
}
},
"fall" : {
"properties" : {
"image" : "<partImage>:fall.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.25], [4.0, -0.25], [4.0, -0.125], [4.0, 0] ]
}
},
"walk" : {
"properties" : {
"image" : "<partImage>:move.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25], [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25] ]
}
},
"backWalk" : {
"properties" : {
"image" : "<partImage>:bmove.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25], [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25] ]
}
}
}
}
},
"background" : {
"properties" : {
"centered" : true,
"zLevel" : -1,
"anchorPart" : "body"
},
"partStates" : {
"movement" : {
"idle" : {
"properties" : {
"image" : "<partImage>:idle"
}
},
"jump" : {
"properties" : {
"image" : "<partImage>:idle"
}
},
"fall" : {
"properties" : {
"image" : "<partImage>:idle"
}
},
"walk" : {
"properties" : {
"image" : "<partImage>:idle"
}
},
"backWalk" : {
"properties" : {
"image" : "<partImage>:idle"
}
}
}
}
},
"frontLeg" : {
"properties" : {
"centered" : true,
"zLevel" : 5,
"anchorPart" : "body"
},
"partStates" : {
"movement" : {
"idle" : {
"properties" : {
"image" : "<partImage>:idle",
"offset" : [-3.0, 0]
}
},
"jump" : {
"properties" : {
"image" : "<partImage>:jump.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.5], [-3.0, -0.5], [-3.0, -0.375], [-3.0, -0.375] ]
}
},
"fall" : {
"properties" : {
"image" : "<partImage>:fall.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.25], [-3.0, -0.25], [-3.0, -0.125], [-3.0, 0] ]
}
},
"walk" : {
"properties" : {
"image" : "<partImage>:move.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25], [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25] ]
}
},
"backWalk" : {
"properties" : {
"image" : "<partImage>:bmove.<frame>"
},
"frameProperties" : {
"offset" : [ [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25], [-3.0, -0.375], [-3.0, -0.125], [-3.0, 0], [-3.0, -0.125], [-3.0, -0.25] ]
}
}
}
}
},
"frontLeg2" : {
"properties" : {
"centered" : true,
"zLevel" : 5,
"anchorPart" : "body"
},
"partStates" : {
"movement" : {
"idle" : {
"properties" : {
"image" : "<partImage>:idle",
"offset" : [4.0, 0]
}
},
"jump" : {
"properties" : {
"image" : "<partImage>:jump.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.5], [4.0, -0.5], [4.0, -0.375], [4.0, -0.375] ]
}
},
"fall" : {
"properties" : {
"image" : "<partImage>:fall.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.25], [4.0, -0.25], [4.0, -0.125], [4.0, 0] ]
}
},
"walk" : {
"properties" : {
"image" : "<partImage>:move.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25], [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25] ]
}
},
"backWalk" : {
"properties" : {
"image" : "<partImage>:bmove.<frame>"
},
"frameProperties" : {
"offset" : [ [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25], [4.0, -0.375], [4.0, -0.125], [4.0, 0], [4.0, -0.125], [4.0, -0.25] ]
}
}
}
}
}
}
},
"rotationGroups" : {
"guns" : {
"angularVelocity" : 10.0
}
}
}

View file

@ -0,0 +1,87 @@
require "/scripts/vec2.lua"
require "/scripts/util.lua"
function init()
self.active = false
self.fireTimer = 0
animator.rotateGroup("guns", 0, true)
self.level = config.getParameter("mechLevel", 6)
self.groundFrames = 1
end
function update()
if mcontroller.atWorldLimit() then
vehicle.destroy()
return
end
local mechHorizontalMovement = config.getParameter("mechHorizontalMovement")
local mechJumpVelocity = config.getParameter("mechJumpVelocity")
local offGroundFrames = config.getParameter("offGroundFrames")
local mechCollisionPoly = mcontroller.collisionPoly()
local position = mcontroller.position()
local entityInSeat = vehicle.entityLoungingIn("seat")
if entityInSeat then
vehicle.setDamageTeam(world.entityDamageTeam(entityInSeat))
else
vehicle.setDamageTeam({type = "passive"})
end
local diff = world.distance(vehicle.aimPosition("seat"), mcontroller.position())
local aimAngle = math.atan(diff[2], diff[1])
local facingDirection = (aimAngle > math.pi / 2 or aimAngle < -math.pi / 2) and -1 or 1
if facingDirection < 0 then
animator.setFlipped(true)
else
animator.setFlipped(false)
end
local onGround = mcontroller.onGround()
local movingDirection = 0
if vehicle.controlHeld("seat", "left") and onGround then
mcontroller.setXVelocity(-mechHorizontalMovement)
movingDirection = -1
end
if vehicle.controlHeld("seat", "right") and onGround then
mcontroller.setXVelocity(mechHorizontalMovement)
movingDirection = 1
end
if vehicle.controlHeld("seat", "jump") and onGround then
mcontroller.setXVelocity(mechJumpVelocity[1] * movingDirection)
mcontroller.setYVelocity(mechJumpVelocity[2])
animator.setAnimationState("movement", "jump")
self.groundFrames = 0
end
if onGround then
self.groundFrames = offGroundFrames
else
self.groundFrames = self.groundFrames - 1
end
if self.groundFrames <= 0 then
if mcontroller.velocity()[2] > 0 then
animator.setAnimationState("movement", "jump")
else
animator.setAnimationState("movement", "fall")
end
elseif movingDirection ~= 0 then
if facingDirection ~= movingDirection then
animator.setAnimationState("movement", "backWalk")
else
animator.setAnimationState("movement", "walk")
end
elseif onGround then
animator.setAnimationState("movement", "idle")
end
if vehicle.controlHeld("seat", "primaryFire") then
-- TODO: party harder
end
end

View file

@ -0,0 +1,61 @@
{
"name" : "partymech",
"boundBox" : [-5, -5, 5, 5],
"slaveControlTimeout" : 2.0,
"slaveControlHeartbeat" : 1.0,
"canBeHit" : false,
"script" : "/vehicles/partymech/partymech.lua",
"animation" : "/vehicles/partymech/partymech.animation",
"animationPartTags" : {
"backLeg" : {
"partImage" : "/vehicles/partymech/partymechbleg.png"
},
"backLeg2" : {
"partImage" : "/vehicles/partymech/partymechbleg.png"
},
"background" : {
"partImage" : "/vehicles/partymech/partymechbackground.png"
},
"body" : {
"partImage" : "/vehicles/partymech/partymechbody.png"
},
"frontLeg" : {
"partImage" : "/vehicles/partymech/partymechfleg.png"
},
"frontLeg2" : {
"partImage" : "/vehicles/partymech/partymechfleg.png"
}
},
"movementSettings" : {
"collisionPoly" : [ [-7.5, -2.0], [-6, -4.5], [6, -4.5], [7.5, -2.0], [7.5, 2], [6, 3], [-6, 3], [-7.5, 2] ],
"mass" : 5,
"airFriction" : 0.5,
"groundFriction" : 40.0,
"ignorePlatformCollision" : true
},
"loungePositions" : {
"seat" : {
"part" : "body",
"partAnchor" : "sitPosition",
"orientation" : "sit"
}
},
"physicsCollisions" : {
"platform" : {
"collision" : [ [-6, 2.0], [6, 2.0], [6, 2.5], [-6, 2.5] ],
"collisionKind" : "platform",
"attachToPart" : "body"
}
},
"mechHorizontalMovement" : 8,
"mechJumpVelocity" : [10, 30],
"offGroundFrames" : 8,
"mechLevel" : 6
}

View file

@ -0,0 +1,13 @@
{
"frameGrid" : {
"size" : [184, 72],
"dimensions" : [5, 2],
"names" : [
[ "idle", null, null ],
[ null, null, null ]
]
},
"aliases" : { }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -0,0 +1,25 @@
{
"frameGrid" : {
"size" : [92, 72],
"dimensions" : [11, 2],
"names" : [
[ null, "idle", null, "jump.1", "jump.2", "jump.3", "jump.4", "fall.1", "fall.2", "fall.3", "fall.4" ],
[ null, "move.1", "move.2", "move.3", "move.4", "move.5", "move.6", "move.7", "move.8", "move.9", "move.10" ]
]
},
"aliases" : {
"bmove.10" : "move.1",
"bmove.9" : "move.2",
"bmove.8" : "move.3",
"bmove.7" : "move.4",
"bmove.6" : "move.5",
"bmove.5" : "move.6",
"bmove.4" : "move.7",
"bmove.3" : "move.8",
"bmove.2" : "move.9",
"bmove.1" : "move.10"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View file

@ -0,0 +1,13 @@
{
"frameGrid" : {
"size" : [184, 72],
"dimensions" : [5, 2],
"names" : [
[ "idle", null, null ],
[ null, null, null ]
]
},
"aliases" : { }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,25 @@
{
"frameGrid" : {
"size" : [92, 72],
"dimensions" : [11, 2],
"names" : [
[ null, "idle", null, "jump.1", "jump.2", "jump.3", "jump.4", "fall.1", "fall.2", "fall.3", "fall.4" ],
[ null, "move.1", "move.2", "move.3", "move.4", "move.5", "move.6", "move.7", "move.8", "move.9", "move.10" ]
]
},
"aliases" : {
"bmove.10" : "move.1",
"bmove.9" : "move.2",
"bmove.8" : "move.3",
"bmove.7" : "move.4",
"bmove.6" : "move.5",
"bmove.5" : "move.6",
"bmove.4" : "move.7",
"bmove.3" : "move.8",
"bmove.2" : "move.9",
"bmove.1" : "move.10"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB