by_player flag on bump and delay flag on move
This commit is contained in:
+14
-8
@@ -54,15 +54,17 @@ fn tick(me, dt) {
|
||||
me.delay(0.5);
|
||||
}
|
||||
// Fires when a solid (the player, an object, or a pushed crate) presses into this
|
||||
// object; dir is the direction the bump came from.
|
||||
fn bump(me, dir) {
|
||||
log(`mover bumped from ${dir}`);
|
||||
// object; dir is the direction the bump came from, by_player whether the bumper
|
||||
// was the player.
|
||||
fn bump(me, dir, by_player) {
|
||||
log(`mover bumped from ${dir} by player ${by_player}`);
|
||||
say("Ow!");
|
||||
}
|
||||
"""
|
||||
|
||||
muffin = """
|
||||
fn bump(me, _dir) {
|
||||
fn bump(me, _dir, by_player) {
|
||||
if !by_player { return; }
|
||||
scroll([
|
||||
"You find a small muffin on the ground, your favorite kind.",
|
||||
"It smells of cinnamon and warm mornings.",
|
||||
@@ -81,7 +83,8 @@ fn ignore() {
|
||||
"""
|
||||
|
||||
noticeboard = """
|
||||
fn bump(me, _dir) {
|
||||
fn bump(me, _dir, by_player) {
|
||||
if !by_player { return; }
|
||||
scroll([
|
||||
" TOWN NOTICE BOARD",
|
||||
" ",
|
||||
@@ -114,7 +117,8 @@ fn bump(me, _dir) {
|
||||
"""
|
||||
|
||||
bookshelf = """
|
||||
fn bump(me, _dir) {
|
||||
fn bump(me, _dir, by_player) {
|
||||
if !by_player { return; }
|
||||
scroll([
|
||||
" THE BOOKSHELF",
|
||||
" ",
|
||||
@@ -133,13 +137,15 @@ fn bump(me, _dir) {
|
||||
"""
|
||||
|
||||
fireplace = """
|
||||
fn bump(me, _dir) {
|
||||
fn bump(me, _dir, by_player) {
|
||||
if !by_player { return; }
|
||||
say("The fire crackles warmly.\\nYou feel at ease.");
|
||||
}
|
||||
"""
|
||||
|
||||
chest = """
|
||||
fn bump(me, _dir) {
|
||||
fn bump(me, _dir, by_player) {
|
||||
if !by_player { return; }
|
||||
scroll([
|
||||
" THE CHEST",
|
||||
" ",
|
||||
|
||||
Reference in New Issue
Block a user