GlRpg
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->
GlRpg
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->TODO: describe this component.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2gl.rpg.GlRpg — SLICE 4: progression, the Devil Fruits, the named swords, quests, enemies and bosses. Attach to `Mount_RPG`. This is the game's HUB. It owns the player's whole progression state and the creatures that give it out. Other slices read and write it through its methods rather than keeping their own copy of a level: state() -> the whole progression record addXp(n), addBelly(n) -> grant, and level up when the curve says so damage(n), heal(n) -> the hero's HP (0 HP knocks you out at the dock) spendEnergy(n), restEnergy() -> the ability resource buy(item), equipSword(id), eatFruit(id), useAbility(i) -> the character sheet quests(), startQuest(id), completeQuest(id) -> the quest log enemies(), bossOf(islandId) -> what is out there Swords and fruits come from `gl.gl_core`; nothing here invents a number.
hero( ) → void
heroPos( ) → void
rememberFruit(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
recalc( ) → void
Recompute the derived stats from the level. Called on every level up.
spawnEnemy(def: any, x: number, y: number, z: number, isBoss: boolean) → void
| arg | type | description |
|---|---|---|
| def | any | |
| x | number | |
| y | number | |
| z | number | |
| isBoss | boolean |
placeEnemies( ) → void
refreshQuestUnlocks( ) → void
creditKill(target: string) → void
Credit a kill to every active quest that names this target, and finish any that reaches its count.
| arg | type | description |
|---|---|---|
| target | string |
grantXp(amount: number) → void
| arg | type | description |
|---|---|---|
| amount | number |
awake( ) → void
updateEnemy(rec: any, dt: number) → void
| arg | type | description |
|---|---|---|
| rec | any | |
| dt | number |
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
state( ) → any
The whole progression record. Read it, do not copy it.
addXp(amount: number) → void
Grant XP (and level up when the curve says so).
| arg | type | description |
|---|---|---|
| amount | number |
addBelly(amount: number) → void
Grant Belly.
| arg | type | description |
|---|---|---|
| amount | number |
damage(amount: number) → void
Take damage. At 0 HP the hero is knocked out and wakes at the dock.
| arg | type | description |
|---|---|---|
| amount | number |
heal(amount: number) → void
Heal the hero.
| arg | type | description |
|---|---|---|
| amount | number |
attackPower( ) → number
What the hero's next blow is worth, sword included.
spendEnergy(amount: number) → boolean
Spend Energy on an ability; false when there is not enough.
| arg | type | description |
|---|---|---|
| amount | number |
kill(id: number) → any
Bring an enemy down. Grants its XP and Belly and credits the quest log.
| arg | type | description |
|---|---|---|
| id | number |
enemies( ) → void
Every living enemy, nearest first to a position. The hero slice locks on and strikes through this.
bossOf(islandId: string) → any
The boss standing at an island's landmark, if it is up.
| arg | type | description |
|---|---|---|
| islandId | string |
quests( ) → void
The quest log: every quest with its state and progress.
startQuest(id: string) → boolean
Take a quest, if the island is open to this level.
| arg | type | description |
|---|---|---|
| id | string |
advanceQuest(id: string, by: number) → void
Tick a quest's objective directly (for quests that are not kills).
| arg | type | description |
|---|---|---|
| id | string | |
| by | number |
sheet( ) → any
The character sheet: swords, fruits and what is equipped.
buy(item: string) → any
Buy a sword or a Devil Fruit with Belly. Items are `sword:<id>` or `fruit:<id>`.
| arg | type | description |
|---|---|---|
| item | string |
equipSword(id: string) → boolean
Equip one of the swords you own.
| arg | type | description |
|---|---|---|
| id | string |
eatFruit(id: string) → boolean
Eat a Devil Fruit. Eating one costs the ability to swim.
| arg | type | description |
|---|---|---|
| id | string |
useAbility(index: number) → any
Fire one of the eaten fruit's abilities (1 or 2). Enforces the cooldown and the Energy cost, and grows mastery on every use.
| arg | type | description |
|---|---|---|
| index | number |
hit(id: number, damage: number) → any
Land a blow on an enemy. Returns what happened, and when the blow is the one that brings it down, grants its XP and Belly through `kill`.
| arg | type | description |
|---|---|---|
| id | number | |
| damage | number |
lockOn(range: number) → any
The nearest enemy within a reach, for lock-on.
| arg | type | description |
|---|---|---|
| range | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.