This commit is contained in:
2026-07-11 14:47:08 -05:00
parent 6dccf5fc23
commit 03185c9c68
17 changed files with 408 additions and 105 deletions
+12
View File
@@ -161,6 +161,7 @@ impl GameState {
let world = World {
name: String::new(),
start: "board".to_string(),
torch: crate::fov::SIGHT_RADIUS as u32,
scripts,
boards: std::collections::HashMap::from([("board".to_string(), board_ref)]),
};
@@ -182,6 +183,12 @@ impl GameState {
&self.current_board_name
}
/// The player's torch radius (world-wide config; see [`World::torch`]),
/// passed to [`Board::lighting`] when rendering a dark board.
pub fn torch(&self) -> u32 {
self.world.torch
}
/// Returns a clone of the `Rc` for the active board.
///
/// Lets a front-end hold a reference to the current board across a board
@@ -304,6 +311,11 @@ impl GameState {
obj.glyph.tile = tile;
}
}
Action::SetLight(radius) => {
if let Some(obj) = board.objects.get_mut(&ba.source) {
obj.light = radius;
}
}
Action::SetTag {
target,
tag,