13 lines
334 B
Plaintext
13 lines
334 B
Plaintext
|
|
// Doors toggle between closed (solid) and open (passable).
|
||
|
|
pub fn toggle(ctx) {
|
||
|
|
if ctx.is_solid() {
|
||
|
|
ctx.set_solid(false);
|
||
|
|
ctx.set_variant("open");
|
||
|
|
ctx.message("You open the door.");
|
||
|
|
} else {
|
||
|
|
ctx.set_solid(true);
|
||
|
|
ctx.set_variant("");
|
||
|
|
ctx.message("You close the door.");
|
||
|
|
}
|
||
|
|
}
|