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,11 @@
{
"frameGrid" : {
"size" : [32, 32],
"dimensions" : [1, 1],
"names" : [
[ "default" ]
]
}
}

View file

@ -0,0 +1,34 @@
{
"objectName" : "dpstestdummy",
"colonyTags" : [],
"rarity" : "Common",
"description" : "This straw dummy is filled with advanced sensors to measure incoming damage.",
"shortdescription" : "DPS Test Dummy",
"race" : "glitch",
"category" : "decorative",
"price" : 70,
"inventoryIcon" : "dpstestdummyicon.png",
"orientations" : [
{
"dualImage" : "dpstestdummy.png:<color>",
"imagePosition" : [-16, -0],
"frames" : 1,
"animationCycle" : 1.0,
"spaceScan" : 0.1,
"anchors" : [ "bottom" ]
}
],
"smashable" : true,
"smashDropOptions" : [[["dpstestdummy"]]],
"health" : 10000,
"damageTeam" : {
"type" : "indiscriminate"
},
"scripts" : ["recount.lua"],
"scriptDelta" : 1
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

View file

@ -0,0 +1,55 @@
function init()
self.maxHealth = config.getParameter("health")
self.autoResetTime = config.getParameter("autoResetTime", 7)
self.autoResetTimer = 0
reset()
object.setInteractive(true)
end
function update(dt)
local currentHealth = object.health()
self.autoResetTimer = math.max(0, self.autoResetTimer - dt)
if self.autoResetTimer == 0 then
reset()
end
if currentHealth < self.maxHealth then
self.meterActive = true
self.autoResetTimer = self.autoResetTime
end
if self.meterActive then
self.meterTimer = self.meterTimer + dt
self.totalDamage = self.totalDamage + (self.maxHealth - currentHealth)
object.setHealth(self.maxHealth)
end
drawOutput()
end
function onInteraction(args)
if self.meterActive then
reset()
else
object.smash()
end
end
function reset()
self.meterActive = false
self.meterTimer = 0
self.totalDamage = 0
object.setHealth(self.maxHealth)
end
function drawOutput()
local pos = entity.position()
pos = {pos[1] - 1.5, pos[2] + 4}
local dps = self.meterTimer > 0 and (self.totalDamage / self.meterTimer) or 0
local outputString = string.format("%.1f damage over\n%.1f seconds\n%.1f DPS", self.totalDamage, self.meterTimer, dps)
world.debugText(outputString, pos, "white")
end