add_gems -> alter_gems

This commit is contained in:
2026-07-07 23:58:51 -05:00
parent 23b5bf2afb
commit e43dae54a8
7 changed files with 18 additions and 18 deletions
+3 -3
View File
@@ -28,7 +28,7 @@
//! `move(dir)`, `delay(secs)`, `now()`, `set_tile(n)`, `log(msg)`, `say(msg)`,
//! `set_fg(fg)`, `set_bg(bg)`, `set_color(fg, bg)`, `set_tag(target, tag, present)`,
//! `send(target_id, fn_name [, arg])`, `teleport(x, y)`, `push(x, y, dir)`,
//! `shift([[x, y], …])`, `add_gems(n)`, `alter_health(dh)`, `set_key(color, present)`, `die()`
//! `shift([[x, y], …])`, `alter_gems(n)`, `alter_health(dh)`, `set_key(color, present)`, `die()`
use crate::action::{Action, BoardAction, ScrollLine, SendArg, MOVE_COST};
use crate::game::SAY_DURATION;
@@ -377,9 +377,9 @@ fn register_write_api(engine: &mut Engine, board: BoardRef) {
emit(&b, source_of(&ctx), Action::SetTile(tile as u32));
});
// add_gems(n): change the player's gem count (negative subtracts; clamped at 0).
// alter_gems(n): change the player's gem count (negative subtracts; clamped at 0).
let b = board.clone();
engine.register_fn("add_gems", move |ctx: NativeCallContext, n: i64| {
engine.register_fn("alter_gems", move |ctx: NativeCallContext, n: i64| {
emit(&b, source_of(&ctx), Action::AddGems(n));
});