Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Keys on the Tomb"
- [ To make output slightly nicer, uncomment one of the two blocks. (Using consolidate keys without using multiple keys has no effect.) ]
- [Use multiple keys;]
- [Use multiple keys; Use consolidate keys;]
- Use multiple keys translates as (- Constant MULTIPLE_KEYS; -).
- Use consolidate keys translates as (- Constant CONSOLIDATE_KEYS; -).
- kings_tomb is a room. The printed name is "The King's Tomb". "Old and dusty."
- The tomb is a supporter in kings_tomb.
- A key is a kind of thing. Understand "keys" as the plural of key.
- The player holds a rock.
- The player holds a key called the iron key.
- The player holds a key called the silver key.
- The player holds a book.
- The player holds a key called the brass key.
- The player holds a key called the gold key.
- The player holds a key called the bronze key.
- The player holds a container called the knapsack.
- Key vault is a container.
- After putting a key on the tomb:
- if not using the multiple keys option:
- say "You hear a jingle and [the noun] disappears.";
- move the noun to the key vault;
- otherwise:
- let m_o_l be the multiple object list;
- let placed_keys be a list of objects;
- repeat with obj running through m_o_l:
- if obj is a key:
- add obj to placed_keys;
- if the number of entries in placed_keys <= 1:
- say "You hear a jingle and [the noun] disappears.";
- move the noun to the key vault;
- otherwise:
- say "You hear a jingle and [placed_keys with definite articles] disappear.";
- repeat with removed key running through placed_keys:
- move the removed key to the key vault;
- remove noun from placed_keys;
- remove placed_keys from m_o_l;
- alter the multiple object list to m_o_l;
- [ Below code is used whether multiple keys is active or not]
- if the number of keys in the key vault >= 5:
- say "You hear a creak as the tomb opens up...";
- end the game in victory.
- [===================================================]
- [ If not using "consolidate keys", these lines have no effect. ]
- This is the my announce rule:
- if the current item from the multiple object list is not nothing:
- follow the announcement rules.
- My announce rule is listed instead of the announce items from multiple object lists rule in the action-processing rules.
- The announcement rules are a rulebook.
- An announcement rule while putting a key on the tomb:
- if the multiple keys option is active and the consolidate keys option is active:
- let all-keys be a list of objects;
- repeat with potential key running through the multiple object list:
- if potential key is a key:
- add potential key to all-keys;
- say "[all-keys with definite articles]: [run paragraph on]" instead;
- An announcement rule:
- say "[current item from the multiple object list]: [run paragraph on]".
- [===================================================]
- test first with "put all on tomb".
- test second with "put keys on tomb".
- test third with "put all but silver key on tomb / put silver key on tomb".
Advertisement
Add Comment
Please, Sign In to add comment