Log inGet started
Package

Bestiary.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

Bestiary

The monsters and bosses of "Kicked Out of the Hero's Party": sixteen kinds across the Crypt, the Forest Ruin and the Corrupted Code Vault, each an aiKit enemy with SecondWind health, actionCombatKit telegraphs and a rigged, cel-shaded anime body that animates from the enemy's live state on every peer. Dungeon builders and encounter code call Bestiary.spawn (a full synced enemy) or Bestiary.dress (a body for an enemy other code made); the HUD and story code listen to Bestiary.on("phase" | "died" | "bossAppeared" | "telegraph" | "staggered") and read Bestiary.bossInfo for boss bars.

local Bestiary = require("game.bestiary.Bestiary")
local warden = Bestiary.spawn("crypt_warden", { 0, 0, -12 }, { yaw = 180 })
Bestiary.on("phase", function(ev) if ev.kind == "crypt_warden" and ev.index == 2 then --[[ Software Whispering moment ]] end end)
Bestiary.dress(arpgEnemy, "skeleton_soldier")

Kinds (Bestiary.KINDS)

dungeonidnameaiKit presethprole
cryptskeleton_soldierSkeleton Soldierchaser60sword grunt (rusty shortsword)
cryptghoul_bruteGhoul Brutechaser240big slow brute, every 3rd swing unparryable
cryptcrypt_cultistCrypt Cultisthealer55caster, heals allies (oak staff)
cryptbone_archerBone Archerranged45kiting shooter
cryptcrypt_wardenThe Crypt Wardenboss1400BOSS, greatsword, 3 phases
foreststone_sentinelMoss Sentinelchaser180stone tank
forestthorn_dryadThorn Dryadhealer60caster
forestwolfkin_runnerWolf-kin Runnerchaser70fast runner
forestmushroom_bruteToadstool Brutechaser220brute
forestbridge_golemThe Bridge Golemboss1800BOSS, 4.2 m, 3 phases
vaultglitch_phantomGlitch Phantomambusher50flickering wireframe ambusher
vaultcorrupted_knightCorrupted Knightchaser200elite (code katana)
vaultnull_swarmlingNull Swarmlingswarm18pack swarmer
vaultfirewall_mageFirewall Mageranged70turret-like caster
vaultdorian_corruptedDorianboss1500BOSS, chapter 3 duel, cast model in the glitch material
vaultseraphine_corruptedSeraphineboss2400FINAL BOSS, cast model in the glitch material

Each row also holds model, material, height, telegraph windup, damage, range, cooldown, move speeds, attack clips, gear, xp and, for bosses, title and phases ({ name, above, line }).

API

calldoes
Bestiary.spawn(id, pos, opts?)synced enemy: Brain (bestiary_<id> preset), SecondWind health (death style stay), Telegraphed, MonsterBody. opts: yaw, name, team, route, health, damageScale, warning, leash, bossBar, active
Bestiary.dress(enemy, id, opts?)body for an existing enemy; switches its Brain to a look-less copy of its preset
Bestiary.presetName(id)defines and returns the aiKit preset
Bestiary.bossInfo(id){ name, title, label, phases = "0.6 0.3", phaseNames }
Bestiary.phaseAt(id, fraction)phase index and name at a health fraction
Bestiary.kindOf(enemy)kind id of a dressed enemy
Bestiary.on(evt, fn)events on every peer: phase {entity, kind, index, name, line}, died, bossAppeared {entity, kind, name, title}, telegraph, staggered

How the body animates

MonsterBody.component (synced fields kind, despawnAfterDeath, bossBar) builds the body on each peer as a local, unsynced entity that follows the enemy, so late joiners and every screen get it from the fields alone. Each frame it reads: speed (position change) for idle / walk / run; the Telegraphed windup (telegraph.windup) for a slowed attack anticipation with a hot rim glow, then the strike at full speed; health drops for a hit react and white flash; telegraph.staggered for a stagger; death (SecondWind) for the death clip then a dissolve. Clips are the cast's humanoid clips (game/cast3d/anims).

Bosses get a barsKit boss bar (name, title, phase marks) on every screen within 40 m, and phase events when aiKit's boss brain changes phase.

Files

  • models/<id> rigged bundles (mesh_gen from_image + rig), refs/<id>_apose the reference images, materials/<id> glitchToon materials, shaders/glitchToon the shader.
  • tools/gen_refs.luau, tools/gen_models.luau, tools/bake_materials.luau rebuild them.
  • Bestiary.scene shows every kind in a row.