add_gems -> alter_gems
This commit is contained in:
@@ -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));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user