updating test maps
This commit is contained in:
@@ -116,6 +116,10 @@ impl Glyph {
|
|||||||
pub const fn is_visible(&self) -> bool {
|
pub const fn is_visible(&self) -> bool {
|
||||||
self.tile != '\0'
|
self.tile != '\0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_transparent(&self) -> bool {
|
||||||
|
self == &Self::transparent()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The `tile` value for a glyph that draws nothing — the `serde` default, used
|
/// The `tile` value for a glyph that draws nothing — the `serde` default, used
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ pub struct SensorSpec {
|
|||||||
pub y: usize,
|
pub y: usize,
|
||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||||
pub script: Option<String>,
|
pub script: Option<String>,
|
||||||
|
#[serde(default, skip_serializing_if = "Glyph::is_transparent")]
|
||||||
pub glyph: Glyph,
|
pub glyph: Glyph,
|
||||||
#[serde(flatten, default)]
|
#[serde(flatten, default)]
|
||||||
pub optics: Optics,
|
pub optics: Optics,
|
||||||
|
|||||||
+40
-11
@@ -12,7 +12,7 @@ hidden = """
|
|||||||
fn tick(me, dt) {
|
fn tick(me, dt) {
|
||||||
if !me.waiting {
|
if !me.waiting {
|
||||||
say("Who's there?");
|
say("Who's there?");
|
||||||
delay(2);
|
delay(2.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
@@ -27,19 +27,18 @@ fn bump(me, _dir) {
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
[boards.cave.map]
|
[boards.cave]
|
||||||
name = "The Cave"
|
name = "The Cave"
|
||||||
width = 40
|
width = 40
|
||||||
height = 15
|
height = 15
|
||||||
dark = true
|
dark = true
|
||||||
floor = { generator = "stone" }
|
floor = { biome = "stone" }
|
||||||
|
|
||||||
# The 'H' object glows magenta inside a walled chamber: its light fills that room
|
# The 'H' object glows magenta inside a walled chamber: its light fills that room
|
||||||
# but the player can't see in until they line up with the gap in the wall. 'L' is
|
# but the player can't see in until they line up with the gap in the wall. 'L' is
|
||||||
# an amber lantern out in the open, and 'T' is a wall torch (glowing terrain) off
|
# an amber lantern out in the open, and 'T' is a wall torch (glowing terrain) off
|
||||||
# in a far corner — a warm point of light you'll only reach by walking to it.
|
# in a far corner — a warm point of light you'll only reach by walking to it.
|
||||||
[boards.cave.grid]
|
grid = """
|
||||||
content = """
|
|
||||||
########################################
|
########################################
|
||||||
# #
|
# #
|
||||||
# #
|
# #
|
||||||
@@ -56,9 +55,39 @@ content = """
|
|||||||
# #
|
# #
|
||||||
########################################
|
########################################
|
||||||
"""
|
"""
|
||||||
[boards.cave.grid.palette]
|
[boards.cave.palette]
|
||||||
"#" = { kind = "wall", tile = "#", fg = "#808080", bg = "#404040" }
|
"#" = { type = "builtin", kind = "wall" }
|
||||||
"@" = { kind = "player" }
|
"@" = { type = "player" }
|
||||||
"T" = { kind = "torch" } # glowing terrain: emits its own warm light
|
|
||||||
"H" = { kind = "object", tile = 2, fg = "#cc66cc", bg = "#000000", solid = true, light = 5, name = "hidden", script_name = "hidden" }
|
# A wall torch. There is no `torch` builtin — a light source is just an object
|
||||||
"L" = { kind = "object", tile = 15, fg = "#ffcc55", bg = "#000000", solid = true, light = 6, name = "lantern", script_name = "lantern" }
|
# with a `glow` radius and no script.
|
||||||
|
[boards.cave.palette.T]
|
||||||
|
type = "object"
|
||||||
|
enter = "block"
|
||||||
|
glow = 4
|
||||||
|
tile = "*"
|
||||||
|
fg = "#ffaa33"
|
||||||
|
bg = "#000000"
|
||||||
|
|
||||||
|
# Glows magenta inside the walled chamber: its light fills that room, but the
|
||||||
|
# player cannot see in until they line up with the gap in the south wall.
|
||||||
|
[boards.cave.palette.H]
|
||||||
|
type = "object"
|
||||||
|
script = "hidden"
|
||||||
|
name = "hidden"
|
||||||
|
enter = "block"
|
||||||
|
glow = 5
|
||||||
|
tile = "☻" # CP437 2 — `tile = 2` is equivalent
|
||||||
|
fg = "#cc66cc"
|
||||||
|
bg = "#000000"
|
||||||
|
|
||||||
|
# An amber lantern out in the open, near the player.
|
||||||
|
[boards.cave.palette.L]
|
||||||
|
type = "object"
|
||||||
|
script = "lantern"
|
||||||
|
name = "lantern"
|
||||||
|
enter = "block"
|
||||||
|
glow = 6
|
||||||
|
tile = "☼" # CP437 15
|
||||||
|
fg = "#ffcc55"
|
||||||
|
bg = "#000000"
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ grid = """
|
|||||||
"""
|
"""
|
||||||
[boards.start.palette]
|
[boards.start.palette]
|
||||||
"#" = { type = "builtin", kind = "wall" }
|
"#" = { type = "builtin", kind = "wall" }
|
||||||
"o" = { type = "builtin", kind = "crate", glyph = { tile = 254, fg = "#aaaaaa", bg = "#000000" } }
|
"o" = { type = "builtin", kind = "crate", tile = 254, fg = "#4444bb", bg = "#000000" }
|
||||||
"@" = { type = "player" }
|
"@" = { type = "player" }
|
||||||
# "G" = { type = "object", tile = 35, fg = "#aa3333", bg = "#000000", enter = "block", script_name = "greeter" }
|
# "G" = { type = "object", tile = 35, fg = "#aa3333", bg = "#000000", enter = "block", script_name = "greeter" }
|
||||||
"h" = { type = "builtin", kind = "heart" }
|
"h" = { type = "builtin", kind = "heart" }
|
||||||
|
|||||||
Reference in New Issue
Block a user