rabdill / bishop

An engine for writing browser-based text adventures using only client-side JavaScript.
Other
1 stars 0 forks source link

Taking one object in a room makes the others disappear #157

Closed rabdill closed 9 years ago

rabdill commented 9 years ago

in this room, for example, take shovel makes the photo disappear:

"living room": {
        "type" : "room",
        "name" : "what must be the living room",
        "look" : "The town square, full of people and activities.",
        "exits": {
            "west"  : "foyer"
        },
        "changes" : [
            ["rooms","foyer","entrance text","You stand in the sad, rubble-strewn foyer of what must have at one time been a very nice house."],
            ["rooms","living room","name","the living room"],
            ["rooms","living room","changes",[]]
        ],
        "entrance text" : "You're in the living room. There's debris in here from the shelling, but it appears someone tried cleaning it up. They failed.",
        "items" : {
            "photo" : {
                "name" : "photograph of neighbor's family",
                "status" : "default",
                "messages" : {
                        "take" : "You won't need that for anything.",
                        "examine" : "You wipe some dirt off the broken glass and peer into the familiar faces of the family that lived next to you for years. They're gone now, to who knows where..."
                },
                "states" : {
                    "default" : {
                        "descriptor" : "A photo sits in a dingy frame on a nearby table."
                    },
                    "smash" : {
                        "descriptor" : "The shattered remains of a picture frame are on the floor here.",
                        "from" : {
                            "default" : "You bash the frame against the table; its glass breaks into even more pieces and falls to the floor. You snap the frame in half and drop that nearby."
                        }
                    }
                }
            },
            "shovel" : {
                "name" : "shovel",
                "status" : "default",
                "messages" : {
                        "examine" : "A medium-sized shovel, light enough to carry around but heavy enough to complete most shovel-tasks."
                },
                "take" : {
                    "default" : "You take the shovel. It's lighter than you expected it to be, and easy to carry."
                },
                "states" : {
                    "default" : {
                        "descriptor" : "A shovel leans against the couch."
                    }
                }
            }
        },
        "synonyms" : {
            "items" : {
                "photo" : ["picture","frame"]
            },
            "actions" : {
                "smash" : ["break","bash"]
            }
        },
        "title" : "@home base@"
    }
rabdill commented 9 years ago

Using other verbs on the objects ("examine shovel", "take photo" which fails on purpose) works as intended

rabdill commented 9 years ago

This is ONLY if the item being taken doesn't have an ID, plus the other items don't either.