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,10 @@
{
"frameGrid" : {
"size" : [19, 19],
"dimensions" : [1, 1],
"names" : [
[ "0" ]
]
}
}

View file

@ -0,0 +1,102 @@
require "/scripts/vec2.lua"
require "/scripts/util.lua"
require "/scripts/projectiles/orbit.lua"
function init()
self.ownerId = projectile.sourceEntity()
self.orbitPosition = world.entityPosition(self.ownerId)
self.orbitDistance = config.getParameter("orbitDistance")
self.orbitSpeed = config.getParameter("orbitSpeed")
self.orbitParameters = config.getParameter("orbitParameters")
mcontroller.applyParameters(self.orbitParameters)
self.landed = false
self.released = false
self.releaseAngleTolerance = 0.2
self.releaseParameters = config.getParameter("releaseParameters")
self.pickupDistance = config.getParameter("pickupDistance")
end
function update(dt)
if self.ownerId and world.entityExists(self.ownerId) then
if not self.released then
-- if not self.orbitParameters.collisionEnabled == false and mcontroller.isColliding() then
-- if self.releaseAngle then
-- sb.logInfo("angle %s was within %s of %s",
-- mcontroller.rotation(),
-- math.abs(util.angleDiff(mcontroller.rotation(), self.releaseAngle)),
-- self.releaseAngle)
-- end
if self.releaseAngle and math.abs(util.angleDiff(mcontroller.rotation(), self.releaseAngle)) < self.releaseAngleTolerance then
mcontroller.setVelocity(vec2.withAngle(self.releaseAngle, vec2.mag(mcontroller.velocity())))
release()
else
orbit(self.orbitPosition, self.orbitDistance, self.orbitSpeed)
end
elseif not self.landed then
self.landed = mcontroller.onGround() and vec2.mag(mcontroller.velocity()) < 0.2
end
else
projectile.die()
end
end
function updateOrbit(orbitPosition, orbitSpeed)
self.orbitPosition = orbitPosition
self.orbitSpeed = orbitSpeed
projectile.setTimeToLive(5.0)
end
-- function holdChain()
-- local holdVector = world.distance(self.orbitPosition, mcontroller.position())
-- local orbitDistance = vec2.mag(holdVector)
-- sb.logInfo("Holding chain! length is %s, target length %s", orbitDistance, self.orbitDistance)
-- mcontroller.setVelocity(vec2.mul(vec2.norm(mcontroller.velocity()), self.baseSpeed))
-- if orbitDistance >= self.orbitDistance then
-- local holdAngle = vec2.angle(holdVector)
-- local holdVelocity = 20 * (orbitDistance - self.orbitDistance)
-- sb.logInfo("Holding at angle %s with target velocity %s", holdAngle, holdVelocity)
-- mcontroller.approachVelocityAlongAngle(holdAngle, holdVelocity, 1000, true)
-- end
-- projectile.setTimeToLive(2.0)
-- end
function pullChain(position, velocity, controlForce)
local pullVector = world.distance(position, mcontroller.position())
if vec2.mag(pullVector) < self.pickupDistance then
kill()
else
local pullAngle = vec2.angle(pullVector)
mcontroller.approachVelocityAlongAngle(pullAngle, velocity, controlForce, true)
projectile.setTimeToLive(2.0)
end
end
function speed()
return vec2.mag(mcontroller.velocity())
end
function requestRelease(releaseAngle)
self.releaseAngle = releaseAngle
end
function release()
self.released = true
mcontroller.applyParameters(self.releaseParameters)
end
function released()
return self.released
end
function landed()
return self.landed
end
function kill()
projectile.die()
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

View file

@ -0,0 +1,21 @@
{
"projectileName" : "chainball",
"image" : "chainball.png",
"animationCycle" : 1.0,
"frameNumber" : 1,
"pointLight" : false,
"flippable" : false,
"actionOnReap" : [ ],
"statusEffects" : [ ],
"power" : 0.0,
"speed" : 30,
"damageKind" : "default",
"physics" : "chainball",
"bounces" : -1,
"piercing" : true,
"timeToLive" : 0.5,
"onlyHitTerrain" : true,
"scripts" : [ "chainball.lua" ]
}

View file

@ -0,0 +1,10 @@
{
"frameGrid" : {
"size" : [12, 12],
"dimensions" : [4, 1],
"names" : [
[ "0", "1", "2", "3" ]
]
}
}

View file

@ -0,0 +1,22 @@
require "/scripts/vec2.lua"
function init()
end
function update()
end
function control(direction)
mcontroller.approachVelocity(vec2.mul(vec2.norm(direction), config.getParameter("maxSpeed")), config.getParameter("controlForce"))
end
function controlTo(position)
local offset = world.distance(position, mcontroller.position())
mcontroller.approachVelocity(vec2.mul(vec2.norm(offset), config.getParameter("maxSpeed")), config.getParameter("controlForce"))
end
function isDrone()
return true
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

View file

@ -0,0 +1,25 @@
{
"projectileName" : "drone",
"clientEntityMode" : "ClientPresenceMaster",
"physics" : "hover",
"image" : "drone.png",
"animationCycle" : 0.04,
"pointLight" : true,
"lightColor" : [170, 210, 255],
"frameNumber" : 4,
"damageKindImage" : "icon.png",
"timeToLive" : 60,
"actionOnReap" : [
{
"action" : "config",
"file" : "/projectiles/explosions/regularexplosion2/regularexplosion2.config"
}
],
"speed" : 10,
"power" : 0,
"onlyHitTerrain" : true,
"damageKind" : "default",
"scripts" : [ "drone.lua" ],
"controlForce" : 20,
"maxSpeed" : 20
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

View file

@ -0,0 +1,10 @@
{
"frameGrid" : {
"size" : [8, 16],
"dimensions" : [6, 1],
"names" : [
[ "0", "1", "2", "3", "4", "5" ]
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

View file

@ -0,0 +1,14 @@
{
"projectileName" : "vacuum",
"image" : "vacuum.png",
"physics" : "illusion",
"animationCycle" : 0.5,
"damageKindImage" : "icon.png",
"frameNumber" : 6,
"power" : 0,
"speed" : -30,
"timeToLive" : 0.5,
"bounces" : 0,
"piercing" : true,
"damageKind" : "slash"
}