portals 1

This commit is contained in:
2026-06-13 17:58:04 -05:00
parent 49d32eedf5
commit 6818f0545a
9 changed files with 151 additions and 7 deletions
+9
View File
@@ -52,6 +52,10 @@ pub(crate) enum Action {
/// Open a scrollable text overlay. Pauses game ticks while shown; a choice
/// selection dispatches [`Send`](Action::Send) to the source object.
Scroll(Vec<ScrollLine>),
/// Teleport the source object to `(x, y)`. Blocked (with a logged error) if
/// the source is solid and the destination already has a solid occupant.
/// Zero time cost — multiple teleports may fire in one frame.
Teleport { x: i32, y: i32 },
}
// ── Direction helper ──────────────────────────────────────────────────────────
@@ -125,6 +129,11 @@ pub(crate) fn action_to_map(action: &Action) -> rhai::Map {
Action::Scroll(_) => {
m.insert("type".into(), ds("Scroll"));
}
Action::Teleport { x, y } => {
m.insert("type".into(), ds("Teleport"));
m.insert("x".into(), Dynamic::from(*x as i64));
m.insert("y".into(), Dynamic::from(*y as i64));
}
}
m
}