Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld bdf6a40a-f…

Foes

One instance, on the scene's `MountFoes`. One foe is live at a time: the arena picks which. Every Rakshasa is built from its `G.FOES` entry, so silhouette, scale, colour, speed, damage and behaviour are data rather than code.

by◐satish·posted 25d ago
What it does

Foes — the eight Rakshasas

One instance, on the scene's MountFoes. One foe is live at a time: the arena picks which. Every Rakshasa is built from its G.FOES entry, so silhouette, scale, colour, speed, damage and behaviour are data rather than code.

Public fields

None. The live foe is published on G.foes and summarised in G.state.foe.

Methods

  • :summon() — force the current arena's foe to appear.
  • :healthShare() — the live foe's health as a 0-1 share, or nil.

Lifecycle

  • start() — reaches MountFoes and subscribes to act changes: a foe appears when the act becomes FIGHT and is cleared on every other act.
  • update(dt) — runs the foe's state machine: close, telegraph, strike, recover, plus whatever its behaviour adds.
  • onDestroy() — unsubscribes and clears the foe.

Notes

  • Every attack is telegraphed. A ring grows on the ground for the whole wind-up before anything lands, which is what makes a fight readable rather than a coin toss, and it is the rule the whole roster holds to.
  • hurt(amount, from) is the only way in. The hero slice calls it through the published record, and it answers how much actually landed — the Stone Brute's stance soaks part of a blow, and a heavy enough hit interrupts a wind-up.
  • Behaviours: brute closes and swings; hunter dashes from the flank and retreats; slammer slams the ground and braces; caster throws fire from range; storm teleports and calls bolts; swarmer hops in fast; destroyer and portal_lord do all of it and change at their phase marks.
  • Phases come off the record. The Portal Lord's phases list says when the sky changes and how fast it moves; crossing a mark fires BOSS_PHASE.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

game.foes.Foes — the eight Rakshasas of GANESHA: GUARDIAN OF THE PORTAL. Boots onto `MountFoes`. One foe is live at a time: the arena picks which. Each is built from `G.FOES` so the roster is data — silhouette, scale, colour and behaviour all come off the record, and a new Rakshasa is a table entry rather than a new file. Every attack is telegraphed on the ground for at least `windup` seconds before it lands, which is the difference between a fight and a coin toss. The boss changes behaviour at the phases named on its record.

Model

rnd( ) → number

(the Director owns the freeze; this slice holds still in it)

mat(name: string, rgb: { number }, emissive: number?) → void

argtypedescription
namestring
rgb{ number }
emissivenumber?

buildShape(parent: any, c: any, index: number) → any

One silhouette per behaviour, built from faceted primitives, so the eight read apart at a glance even at a distance.

argtypedescription
parentany
cany
indexnumber

add(name: string, model: any, material: any, pos: { number }, scale: { number }, rot: { number }?) → void

argtypedescription
namestring
modelany
materialany
pos{ number }
scale{ number }
rot{ number }?

wadd(name: string, model: any, material: any, pos: { number }, scale: { number }) → void

argtypedescription
namestring
modelany
materialany
pos{ number }
scale{ number }

publish(index: number) → void

argtypedescription
indexnumber

curPos( ) → any

hurt(amount: number, _from: any) → void

argtypedescription
amountnumber
_fromany

clearFoe( ) → void

spawnFoe(index: number) → void

argtypedescription
indexnumber

showTelegraph(radius: number, seconds: number, colour: { number }) → void

argtypedescription
radiusnumber
secondsnumber
colour{ number }

tickTelegraph(dt: number, total: number) → void

argtypedescription
dtnumber
totalnumber

hideTelegraph( ) → void

addSlam(x: number, z: number, r: number, damage: number) → void

argtypedescription
xnumber
znumber
rnumber
damagenumber

addShot(damage: number, r: number, speed: number) → void

argtypedescription
damagenumber
rnumber
speednumber

playerPos( ) → void

faceTo(p: any) → void

argtypedescription
pany

moveToward(p: any, speed: number, dt: number, keep: number) → void

argtypedescription
pany
speednumber
dtnumber
keepnumber

hitPlayer(damage: number, range: number, arcDeg: number) → void

argtypedescription
damagenumber
rangenumber
arcDegnumber

tickSlams(dt: number) → void

argtypedescription
dtnumber

tickShots(dt: number) → void

argtypedescription
dtnumber

tickPhases( ) → void

The Portal Lord's phases: the record names them and this is what they mean.

tick(dt: number) → void

argtypedescription
dtnumber

awake( ) → void

start( ) → void

update(dt: ?) → void

argtypedescription
dt?

onDestroy( ) → void

summon( ) → void

Force the arena's foe to appear. Used by the interface when a fight starts.

healthShare( ) → number

The live foe's health as a 0-1 share, or nil when none is up.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

7items
▣
module · born here
❒asset
# Game The spine of **GANESHA: GUARDIAN OF THE PORTAL**. One shared module every slice requires: the tuning numbers, the eight Rakshasas and their arenas, the eleven quests, the story machine's acts, the mount points, and the event bus. It draws nothing, moves nothing and sounds nothing — it is the contract that lets a slice be written without knowing who else is in the world. `require` returns one shared instance per world, so `G.state` read in the hero slice is the same table the interface slice reads, and `G.on` / `G.emit` is how one slice learns what another did. ## Exports - `G.TITLE`, `G.SUBTITLE` — the title card's own words. - `G.ART_STYLE` — the one art-direction sentence every visual decision answers to. - `G.PALETTE` (hex, for the interface) and `G.RGB` (0-1 triples, for lights/materials). - `G.ACT` / `G.ACT_ORDER` — the story machine's phases. - `G.QUESTS` — the eleven quests, in order: `{ title, objective }`. - `G.PLAYER` — the guardian's 2000 HP, speeds, stamina, jump. - `G.ATTACKS` / `G.ATTACK_ORDER` / `G.ABILITY_BAR` — the four attacks with damage, timing, reach, arc and cooldown. - `G.FOES` — the eight Rakshasas: health, speed, damage, reach, behaviour, tells. - `G.ARENAS` — the eight battlefields: ground colour, sky, sun, fog, props. - `G.BEATS` — timings for the beats between fights. - `G.state` — the shared run state (act, quest, arena, health, foe, banner…). - `G.EV` — event names; `G.on(name, fn)` and `G.emit(name, payload)`. - `G.setAct` / `G.setQuest` / `G.setArena` — the only writers of those fields. - `G.banner` / `G.toast` / `G.kick` / `G.freeze` — the presentation verbs. - `G.MOUNTS` / `G.SLICES` — where each slice is booted. - `G.clamp` / `G.lerp` / `G.damp` / `G.angleDelta` / `G.horizDist` / `G.yawTo`. - `G.arena()` / `G.foeAt(i)` / `G.questForArena(i)` / `G.restart()`. ## Usage ```luau local G = require("game.Game") G.on(G.EV.FOE_DIED, function(foe) G.setQuest(G.questForArena(G.state.arena)) end) if G.state.act == G.ACT.FIGHT then local arena = G.arena() local tuning = G.foeAt(G.state.arena) end ``` ## Notes - **State has one writer per field.** The hero slice owns `health`, `stamina` and `cooldowns`; the foes slice owns `foe` and `bossBar`; the world slice owns `act` transitions from its own beats. Announce changes with `G.emit` so the interface and the sound slice hear them. - **The bus is per world, not per frame.** Subscribe in `start()` and keep the unsubscribe function the subscribe returns; drop it in `onDestroy()` or a reload will leave two listeners running. - **Arenas are 1-indexed and match `G.FOES` by `arena.foe`.**
▲ 0↑ born
backing path · game/foes/Foes.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.