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,258 @@
{
"animatedParts" : {
"stateTypes" : {
"movement" : {
"priority" : 0,
"default" : "idle",
"states" : {
"idle" : {
"frames" : 1,
"cycle" : 0,
"mode" : "loop"
},
"move" : {
"frames" : 8,
"cycle" : 1,
"mode" : "loop"
},
"moveshoot" : {
"frames" : 8,
"cycle" : 1,
"mode" : "loop"
},
"attack" : {
"frames" : 5,
"cycle" : 1,
"mode" : "loop"
}
}
}
},
"parts" : {
"body" : {
"partStates" : {
"movement" : {
"idle" : {
"properties" : {
"image" : "<partImage>:idle.<frame>"
}
},
"move" : {
"properties" : {
"image" : "<partImage>:move.<frame>"
}
},
"aggro" : {
"properties" : {
"image" : "<partImage>:aggro"
}
},
"attack" : {
"properties" : {
"image" : "<partImage>:attack.<frame>"
}
}
}
}
}
}
},
"particleEmitters" : {
"deathPoof" : {
"particles" : [
{
"particle" : {
"type" : "animated",
"animation" : "/animations/puff2c/puff2c.animation",
"size" : 1,
"angularVelocity" : 35,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [0, 0],
"finalVelocity" : [0, 0],
"approach" : [1, 1],
"timeToLive" : 0.4,
"layer" : "middle"
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz1/fizz1.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [-8, 8],
"finalVelocity" : [-3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [-4, 2],
"finalVelocity" : [-3, -4]
}
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz1/fizz1.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [8, 8],
"finalVelocity" : [3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [4, 2],
"finalVelocity" : [3, -4]
}
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz2/fizz2.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [-8, 8],
"finalVelocity" : [-3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [-4, 2],
"finalVelocity" : [-3, -4]
}
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz2/fizz2.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [8, 8],
"finalVelocity" : [3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [4, 2],
"finalVelocity" : [3, -4]
}
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz3/fizz3.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [-8, 8],
"finalVelocity" : [-3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [-4, 2],
"finalVelocity" : [-3, -4]
}
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz3/fizz3.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [8, 8],
"finalVelocity" : [3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [4, 2],
"finalVelocity" : [3, -4]
}
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz4/fizz4.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [-8, 8],
"finalVelocity" : [-3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [-4, 2],
"finalVelocity" : [-3, -4]
}
}
},
{
"particle" : {
"type" : "animated",
"animation" : "/animations/fizz4/fizz4.animation",
"size" : 1,
"angularVelocity" : 20,
"fade" : 1,
"destructionTime" : 7,
"position" : [0, 0],
"initialVelocity" : [8, 8],
"finalVelocity" : [3, -4],
"approach" : [15, 15],
"timeToLive" : 3.45,
"layer" : "middle",
"variance" : {
"initialVelocity" : [4, 2],
"finalVelocity" : [3, -4]
}
}
}
]
}
},
"effects" : {
"blink" : {
"type" : "flash",
"time" : 0.25,
"directives" : "fade=ffffff;0.5"
}
},
"sounds" : {
"turnHostile" : [ ],
"deathPuff" : [ "/sfx/npc/enemydeathpuff.ogg" ]
}
}

View file

@ -0,0 +1,107 @@
{
"type" : "aviansentry",
"categories" : [ "aviansentry" ],
"parts" : [ "body" ],
"animation" : "aviansentry.animation",
"dropPools" : [ "basicMonsterTreasure" ],
"baseParameters" : {
"scripts" : [
"/monsters/dungeon/aviansentry/behavior.lua",
"/scripts/sensors.lua",
"/scripts/stateMachine.lua",
"/scripts/util.lua",
"/scripts/vec2.lua"
],
"damageTeam" : 1,
"metaBoundBox" : [-1.0, -1.0, 1.0, 1.0],
"scale" : 1.0,
"movementSettings" : {
"collisionPoly" : [ [-2.0, -3.0], [2.0, -3.0], [2.0, 3.0], [-2.0, 3.0] ],
"mass" : 0.2,
"walkSpeed" : 3,
"runSpeed" : 3,
"jumpSpeed" : 5,
"flySpeed" : 15,
"airFriction" : 0.25,
"airForce" : 50.0
},
"bodyMaterialKind" : "organic",
"knockoutTime" : 0.1,
"knockoutEffect" : "blink",
"deathParticles" : "deathPoof",
"touchDamage" : {
"poly" : [ [-1.0, -0.65], [1.0, -0.65], [1.0, 0.65], [-1.0, 0.65] ],
"damage" : 15,
"teamType" : "enemy",
"damageSourceKind" : "bite",
"statusEffects" : [ ]
},
"statusSettings" : {
"statusProperties" : {
"targetMaterialKind" : "organic"
},
"appliesEnvironmentStatusEffects" : false,
"minimumLiquidStatusEffectPercentage" : 0.1,
"primaryScriptSources" : [
"/stats/monster_primary.lua"
],
"primaryScriptDelta" : 5,
"stats" : {
"knockbackStunTime" : {
"baseValue" : 0.25
},
"knockbackThreshold" : {
"baseValue" : 10
},
"maxHealth" : {
"baseValue" : 72
},
"protection" : {
"baseValue" : 1.0
},
"healthRegen" : {
"baseValue" : 0.0
}
},
"resources" : {
"stunned" : {
"deltaValue" : -1.0,
"initialValue" : 0.0
},
"health" : {
"maxStat" : "maxHealth",
"deltaStat" : "healthRegen",
"defaultPercentage" : 100
}
}
},
"mouthOffset" : [0, 0],
"feetOffset" : [0, -8],
"collisionSensors" : [ [-1.25, 0.0], [1.25, 0.0] ],
"moveTimeRange" : [2.5, 5.0],
"cleanTimeRange" : [1.0, 3.0],
"attackTargetHoldTime" : 5.0,
"attackDistance" : 2.0
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,137 @@
function init()
self.sensors = sensors.create()
self.state = stateMachine.create({
"moveState",
"cleanState",
"attackState"
})
self.state.leavingState = function(stateName)
entity.setAnimationState("movement", "idle")
end
entity.setAggressive(false)
entity.setDeathParticleBurst("deathPoof")
entity.setAnimationState("movement", "idle")
end
function update(dt)
self.state.update(dt)
self.sensors.clear()
end
function damage(args)
self.state.pickState(args.sourceId)
end
function move(direction)
entity.setAnimationState("movement", "move")
mcontroller.controlMove(direction, true)
end
--------------------------------------------------------------------------------
moveState = {}
function moveState.enter()
local direction
if math.random(100) > 50 then
direction = 1
else
direction = -1
end
return {
timer = entity.randomizeParameterRange("moveTimeRange"),
direction = direction
}
end
function moveState.update(dt, stateData)
if self.sensors.collisionSensors.collision.any(true) then
stateData.direction = -stateData.direction
end
move(stateData.direction)
stateData.timer = stateData.timer - dt
if stateData.timer <= 0 then
return true, 1.0
end
return false
end
--------------------------------------------------------------------------------
cleanState = {}
function cleanState.enter()
return { timer = entity.randomizeParameterRange("cleanTimeRange") }
end
function cleanState.update(dt, stateData)
stateData.timer = stateData.timer - dt
return stateData.timer <= 0
end
--------------------------------------------------------------------------------
attackState = {}
function attackState.enterWith(targetId)
if targetId == 0 then return nil end
attackState.setAggressive(targetId)
return { timer = entity.configParameter("attackTargetHoldTime") }
end
function attackState.update(dt, stateData)
util.trackExistingTarget()
if self.targetPosition ~= nil then
local toTarget = world.distance(self.targetPosition, mcontroller.position())
if world.magnitude(toTarget) < entity.configParameter("attackDistance") then
attackState.setAttackEnabled(true)
else
attackState.setAttackEnabled(false)
move(util.toDirection(toTarget[1]))
end
end
if self.targetId == nil then
stateData.timer = stateData.timer - dt
else
stateData.timer = entity.configParameter("attackTargetHoldTime")
end
if stateData.timer <= 0 then
attackState.setAttackEnabled(false)
attackState.setAggressive(nil)
return true
else
return false
end
end
function attackState.setAttackEnabled(enabled)
if enabled then
entity.setAnimationState("movement", "attack")
else
entity.setAnimationState("movement")
end
entity.setDamageOnTouch(enabled)
end
function attackState.setAggressive(targetId)
self.targetId = targetId
if targetId ~= nil then
entity.setAnimationState("movement")
entity.setAggressive(true)
else
entity.setAnimationState("movement", "idle")
entity.setAggressive(false)
end
end

View file

@ -0,0 +1,9 @@
{
"name" : "body",
"category" : "aviansentry",
"type" : "body",
"frames" : {
"body" : "aviansentry.png"
}
}

View file

@ -0,0 +1,75 @@
{
"cooldownDuration" : 0.1,
"energyResponses" : [
{
"threshold" : 0,
"invulnerabilityDuration" : 0,
"invulnerabilityMode" : "none",
"knockbackMagnitude" : 0,
"knockbackSkidDuration" : 0,
"knockbackMode" : "normal",
"knockbackAngle" : 0,
"stunDuration" : 0,
"stunMode" : "none"
}
],
"healthResponses" : [
{
"threshold" : 0,
"invulnerabilityDuration" : 0,
"invulnerabilityMode" : "none",
"knockbackMagnitude" : 0,
"knockbackSkidDuration" : 0,
"knockbackMode" : "normal",
"knockbackAngle" : 0,
"stunDuration" : 0,
"stunMode" : "none"
},
{
"threshold" : 0.06,
"invulnerabilityDuration" : 0,
"invulnerabilityMode" : "none",
"knockbackMagnitude" : 0,
"knockbackSkidDuration" : 0,
"knockbackMode" : "normal",
"knockbackAngle" : 0,
"stunDuration" : 0,
"stunMode" : "none"
},
{
"threshold" : 0.16,
"invulnerabilityDuration" : 0,
"invulnerabilityMode" : "none",
"knockbackMagnitude" : 0,
"knockbackSkidDuration" : 0,
"knockbackMode" : "normal",
"knockbackAngle" : 0,
"stunDuration" : 0,
"stunMode" : "none"
},
{
"threshold" : 0.26,
"invulnerabilityDuration" : 0,
"invulnerabilityMode" : "none",
"knockbackMagnitude" : 0,
"knockbackSkidDuration" : 0,
"knockbackMode" : "normal",
"knockbackAngle" : 0,
"stunDuration" : 0,
"stunMode" : "none"
},
{
"threshold" : 0.51,
"invulnerabilityDuration" : 0,
"invulnerabilityMode" : "none",
"knockbackMagnitude" : 0,
"knockbackSkidDuration" : 0,
"knockbackMode" : "normal",
"knockbackAngle" : 0,
"stunDuration" : 0.1,
"stunMode" : "flyStun"
}
]
}

View file

@ -0,0 +1,13 @@
{
"frameGrid" : {
"size" : [48, 48],
"dimensions" : [9, 4],
"names" : [
[ null, "idle.1", null, null, null, null, null, null, null ],
[ null, "move.1", "move.2", "move.3", "move.4", "move.5", "move.6", "move.7", "move.8" ],
[ null, "moveshoot.1", "moveshoot.2", "moveshoot.3", "moveshoot.4", "moveshoot.5", "moveshoot.6", "moveshoot.7", "moveshoot.8" ],
[ null, "attack.1", "attack.2", "attack.3", "attack.4", "attack.5", null, null, null ]
]
}
}