rabdill / bishop

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

Synonyms don't work right when using "do x with y" #171

Closed rabdill closed 9 years ago

rabdill commented 9 years ago

In this room, for example, move rubble with shovel SHOULD work, but it only works when you type move pile with shovel:

"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",
                "id" : "neighbor photo",
                "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",
                "id" : "living room 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."
                    }
                }
            },
            "pile" : {
                "name" : "pile of junk",
                "id" : "living room pile",
                "status" : "default",
                "messages" : {
                        "examine" : "It's a big mound of material from broken wall, caved-in ceiling and simple household trash. Some of it fell here, but much looks to have been piled on purpose."
                },
                "states" : {
                    "default" : {
                        "descriptor" : "To the north, a huge pile of rubble blocks what looks like it might be a doorway."
                    },
                    "move" : {
                        "descriptor" : "Trash and drywall is strewn around in front of the doorway.",
                        "requires" : "shovel",
                        "from" : {
                            "default" : "You slowly push your way through the junk, tossing the little stuff aside and shoving the big pieces with your foot. Soon, the doorway is opened up."
                        },
                        "changes" : [
                            ["rooms","living room","exits","north","dining room"]
                        ]
                    }
                }
            }
        },
        "synonyms" : {
            "items" : {
                "photo" : ["picture","frame"],
                "pile" : ["trash","rubble"]
            },
            "actions" : {
                "smash" : ["break","bash"],
                "move" : [""]
            }
        },
        "title" : "@home base@"
    },
rabdill commented 9 years ago

https://github.com/rabdill/bishops_map/commit/cf6fb9d8aff39b29fd32168f23ce2158b1b9dd4e