v1.4.4
This commit is contained in:
commit
9c94d113d3
10260 changed files with 1237388 additions and 0 deletions
268
attic/npcs/allergen/allergen.animation
Normal file
268
attic/npcs/allergen/allergen.animation
Normal file
|
@ -0,0 +1,268 @@
|
|||
{
|
||||
"animatedParts" : {
|
||||
"stateTypes" : {
|
||||
"default" : {
|
||||
"priority" : 0,
|
||||
"default" : "idle",
|
||||
|
||||
"states" : {
|
||||
"idle" : {
|
||||
"frames" : 1,
|
||||
"mode" : "loop"
|
||||
},
|
||||
"shoot" : {
|
||||
"frames" : 4,
|
||||
"cycle" : 1.5,
|
||||
"mode" : "transition",
|
||||
"transition" : "recoil"
|
||||
},
|
||||
"recoil" : {
|
||||
"frames" : 4,
|
||||
"cycle" : 1.5,
|
||||
"mode" : "transition",
|
||||
"transition" : "idle"
|
||||
},
|
||||
"die" : {
|
||||
"frames" : 1,
|
||||
"cycle" : 0.5,
|
||||
"mode" : "transition",
|
||||
"transition" : "invisible"
|
||||
},
|
||||
"invisible" : {
|
||||
"frames" : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"parts" : {
|
||||
"body" : {
|
||||
"partStates" : {
|
||||
"default" : {
|
||||
"idle" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:idle.<frame>"
|
||||
}
|
||||
},
|
||||
"shoot" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:shoot.<frame>"
|
||||
}
|
||||
},
|
||||
"recoil" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:recoil.<frame>"
|
||||
}
|
||||
},
|
||||
"die" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:die.<frame>"
|
||||
}
|
||||
},
|
||||
"invisible" : {
|
||||
"properties" : {
|
||||
"image" : "<partImage>:invisible"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"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" ]
|
||||
}
|
||||
}
|
104
attic/npcs/allergen/allergen.monstertype
Normal file
104
attic/npcs/allergen/allergen.monstertype
Normal file
|
@ -0,0 +1,104 @@
|
|||
{
|
||||
"type" : "allergen",
|
||||
|
||||
"categories" : [ "allergen" ],
|
||||
"parts" : [ "body" ],
|
||||
|
||||
"animation" : "allergen.animation",
|
||||
|
||||
"dropPools" : [ "basicMonsterTreasure" ],
|
||||
|
||||
"baseParameters" : {
|
||||
"scripts" : [
|
||||
"/monsters/dungeon/allergen/behavior.lua",
|
||||
"/scripts/sensors.lua",
|
||||
"/scripts/stateMachine.lua",
|
||||
"/scripts/util.lua",
|
||||
"/scripts/vec2.lua"
|
||||
],
|
||||
|
||||
"metaBoundBox" : [-2.5, -2.5, 2.5, 2.5],
|
||||
"scale" : 1.0,
|
||||
|
||||
"movementSettings" : {
|
||||
"collisionPoly" : [ [-2.0, -2.5], [2.0, -2.5], [0.5, 1.0], [-0.5, 1.0] ],
|
||||
|
||||
"mass" : 100.0,
|
||||
"walkSpeed" : 0,
|
||||
"runSpeed" : 0,
|
||||
"jumpSpeed" : 0,
|
||||
"flySpeed" : 0,
|
||||
"airFriction" : 100.0,
|
||||
"airForce" : 0.0
|
||||
},
|
||||
|
||||
"bodyMaterialKind" : "organic",
|
||||
|
||||
"knockoutTime" : 0.1,
|
||||
"knockoutEffect" : "blink",
|
||||
"deathParticles" : "deathPoof",
|
||||
|
||||
"touchDamage" : {
|
||||
"poly" : [ [-2.0, -2.5], [2.0, -2.5], [0.5, 1.0], [-0.5, 1.0] ],
|
||||
"damage" : 15,
|
||||
|
||||
"teamType" : "enemy",
|
||||
"damageSourceKind" : "testpoison",
|
||||
"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" : 9
|
||||
},
|
||||
"protection" : {
|
||||
"baseValue" : 1.0
|
||||
},
|
||||
"healthRegen" : {
|
||||
"baseValue" : 0.0
|
||||
}
|
||||
},
|
||||
|
||||
"resources" : {
|
||||
"stunned" : {
|
||||
"deltaValue" : -1.0,
|
||||
"initialValue" : 0.0
|
||||
},
|
||||
"health" : {
|
||||
"maxStat" : "maxHealth",
|
||||
"deltaStat" : "healthRegen",
|
||||
"defaultPercentage" : 100
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"shoot" : {
|
||||
"seedShotDistance" : 30,
|
||||
"pollenShotDistance" : 5,
|
||||
"fireTime" : 1.5,
|
||||
"recoilTime" : 1.5
|
||||
},
|
||||
|
||||
"mouthOffset" : [0, 0],
|
||||
"feetOffset" : [0, -20]
|
||||
}
|
||||
}
|
BIN
attic/npcs/allergen/allergen.png
Normal file
BIN
attic/npcs/allergen/allergen.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
99
attic/npcs/allergen/behavior.lua
Normal file
99
attic/npcs/allergen/behavior.lua
Normal file
|
@ -0,0 +1,99 @@
|
|||
function init()
|
||||
self.dead = false
|
||||
self.sensors = sensors.create()
|
||||
|
||||
self.state = stateMachine.create({
|
||||
"idleState",
|
||||
"shootState",
|
||||
})
|
||||
self.state.leavingState = function(stateName)
|
||||
entity.setAnimationState("default", "idle")
|
||||
end
|
||||
|
||||
entity.setDamageOnTouch(true)
|
||||
entity.setAggressive(true)
|
||||
entity.setAnimationState("default", "idle")
|
||||
end
|
||||
|
||||
function update(dt)
|
||||
if util.trackTarget(entity.configParameter("shoot.seedShotDistance")) then
|
||||
self.state.pickState({ targetId = self.targetId })
|
||||
end
|
||||
self.state.update(dt)
|
||||
self.sensors.clear()
|
||||
end
|
||||
|
||||
function damage(args)
|
||||
if entity.health() <= 0 then
|
||||
self.state.pickState({ die = true })
|
||||
else
|
||||
self.state.pickState({ targetId = args.sourceId })
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
idleState = {}
|
||||
|
||||
function idleState.enter()
|
||||
return { }
|
||||
end
|
||||
|
||||
function idleState.update(dt, stateData)
|
||||
entity.setAnimationState("default", "idle")
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
shootState = {}
|
||||
|
||||
function shootState.enterWith(args)
|
||||
if args.targetId == nil then return nil end
|
||||
|
||||
local targetPosition = world.entityPosition(args.targetId)
|
||||
if targetPosition == nil then return nil end
|
||||
|
||||
return {
|
||||
targetId = args.targetId,
|
||||
targetPosition = targetPosition,
|
||||
shotFired = false,
|
||||
timer = entity.configParameter("shoot.fireTime"),
|
||||
recoilTimer = entity.configParameter("shoot.recoilTime"),
|
||||
}
|
||||
end
|
||||
|
||||
function shootState.update(dt, stateData)
|
||||
entity.setAnimationState("default", "shoot")
|
||||
|
||||
stateData.timer = stateData.timer - dt
|
||||
if stateData.timer <= 0 then
|
||||
if not stateData.shotFired then
|
||||
local randDir = math.random() * math.pi -- 0 to pi
|
||||
local direction = {
|
||||
math.cos(randDir),
|
||||
math.sin(randDir)
|
||||
}
|
||||
local oldTid = self.targetId
|
||||
self.targetId = nil
|
||||
if util.trackTarget(entity.configParameter("shoot.pollenShotDistance")) then
|
||||
-- entity.setFireDirection({0, 0}, direction)
|
||||
-- entity.startFiring("pollen")
|
||||
else
|
||||
self.targetId = oldTid
|
||||
-- entity.setFireDirection({0, 0}, direction)
|
||||
-- entity.startFiring("seed")
|
||||
end
|
||||
stateData.shotFired = true
|
||||
else
|
||||
-- entity.stopFiring()
|
||||
end
|
||||
stateData.recoilTimer = stateData.recoilTimer - dt
|
||||
end
|
||||
|
||||
if stateData.recoilTimer <= 0 then
|
||||
self.targetId = nil
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
9
attic/npcs/allergen/body.monsterpart
Normal file
9
attic/npcs/allergen/body.monsterpart
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name" : "body",
|
||||
"category" : "allergen",
|
||||
"type" : "body",
|
||||
|
||||
"frames" : {
|
||||
"body" : "allergen.png"
|
||||
}
|
||||
}
|
16
attic/npcs/allergen/default.frames
Normal file
16
attic/npcs/allergen/default.frames
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"frameGrid" : {
|
||||
"size" : [40, 40],
|
||||
"dimensions" : [5, 3],
|
||||
|
||||
"names" : [
|
||||
[ null, "idle.1", null, null, "invisible" ],
|
||||
[ null, "shoot.1", "shoot.2", "shoot.3", "shoot.4" ],
|
||||
[ null, "recoil.1", "recoil.2", "recoil.3", "recoil.4" ]
|
||||
]
|
||||
},
|
||||
"aliases" : {
|
||||
"die.1" : "recoil.2",
|
||||
"portrait" : "idle.1"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue