wip 7 more test fixing
This commit is contained in:
+1
-18
@@ -42,7 +42,7 @@ actions (and any pacing `Delay`) have fully drained. While actions from an earli
|
||||
pending, the engine just advances the queue by `dt` and does **not** re-run `tick`. This means you no
|
||||
longer need to guard the body with `if me.queue.length == 0` / `if !me.waiting` — the engine does it
|
||||
for you, so a plain `move(North)` naturally paces itself one step per drain. `dt` is the elapsed time
|
||||
since the last tick, in seconds (a `f64`). (All other hooks — `bump`/`enter`/`grab`/`send`/`init` —
|
||||
since the last tick, in seconds (a `f64`). (All other hooks — `bump`/`enter`/`send`/`init` —
|
||||
still fire regardless of queued actions.)
|
||||
|
||||
```rhai
|
||||
@@ -91,23 +91,6 @@ fn enter(me, dir) {
|
||||
}
|
||||
```
|
||||
|
||||
### `fn grab(me, state)`
|
||||
|
||||
Called when the **player walks onto** this object and the object is a *grab* thing (gems, hearts —
|
||||
`solid + grab`). Unlike `bump`, the player ends up on the object's cell; the hook typically adjusts a
|
||||
player stat and removes the object. It fires followed by an immediate resolve, so any `die()` /
|
||||
`alter_gems()` / `alter_health()` applies before the player's move returns.
|
||||
|
||||
```rhai
|
||||
fn grab(me, state) {
|
||||
alter_gems(1);
|
||||
die();
|
||||
}
|
||||
```
|
||||
|
||||
> Grab is **only** triggered by the player walking onto the object. A grab thing *pushed* or
|
||||
> *shifted* into the player is treated as an ordinary solid (no `grab()`).
|
||||
|
||||
### Custom handler functions
|
||||
|
||||
Any other function can be invoked on an object two ways:
|
||||
|
||||
Reference in New Issue
Block a user