portals 1
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user