123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- """
- Prototypes
- A prototype is a simple way to create individualized instances of a
- given typeclass. It is dictionary with specific key names.
- For example, you might have a Sword typeclass that implements everything a
- Sword would need to do. The only difference between different individual Swords
- would be their key, description and some Attributes. The Prototype system
- allows to create a range of such Swords with only minor variations. Prototypes
- can also inherit and combine together to form entire hierarchies (such as
- giving all Sabres and all Broadswords some common properties). Note that bigger
- variations, such as custom commands or functionality belong in a hierarchy of
- typeclasses instead.
- A prototype can either be a dictionary placed into a global variable in a
- python module (a 'module-prototype') or stored in the database as a dict on a
- special Script (a db-prototype). The former can be created just by adding dicts
- to modules Evennia looks at for prototypes, the latter is easiest created
- in-game via the `olc` command/menu.
- Prototypes are read and used to create new objects with the `spawn` command
- or directly via `evennia.spawn` or the full path `evennia.prototypes.spawner.spawn`.
- A prototype dictionary have the following keywords:
- Possible keywords are:
- - `prototype_key` - the name of the prototype. This is required for db-prototypes,
- for module-prototypes, the global variable name of the dict is used instead
- - `prototype_parent` - string pointing to parent prototype if any. Prototype inherits
- in a similar way as classes, with children overriding values in their partents.
- - `key` - string, the main object identifier.
- - `typeclass` - string, if not set, will use `settings.BASE_OBJECT_TYPECLASS`.
- - `location` - this should be a valid object or #dbref.
- - `home` - valid object or #dbref.
- - `destination` - only valid for exits (object or #dbref).
- - `permissions` - string or list of permission strings.
- - `locks` - a lock-string to use for the spawned object.
- - `aliases` - string or list of strings.
- - `attrs` - Attributes, expressed as a list of tuples on the form `(attrname, value)`,
- `(attrname, value, category)`, or `(attrname, value, category, locks)`. If using one
- of the shorter forms, defaults are used for the rest.
- - `tags` - Tags, as a list of tuples `(tag,)`, `(tag, category)` or `(tag, category, data)`.
- - Any other keywords are interpreted as Attributes with no category or lock.
- These will internally be added to `attrs` (eqivalent to `(attrname, value)`.
- See the `spawn` command and `evennia.prototypes.spawner.spawn` for more info.
- """
- # ROOMS
- START_00 = {
- "prototype_parent": "ROOM",
- "prototype_tags": ["room"],
- "key": "ruined room",
- "aliases": "start_00",
- "desc": "This room, once royally adorned, now lies in ruins. |/"
- "A violent battle must have been fought in this place,"
- "mixed with the broken wood of the furniture stand out broken weapons"
- "and bodies devoured by the passage of time. "
- "The long oak table that once occupied the center of the room"
- " it's now overturned against the wall to create a makeshift barricade."
- }
- START_01 = {
- "prototype_parent": "ROOM",
- "prototype_tags": ["room"],
- "key": "long hall",
- "aliases": ["hall", "start_01"],
- "desc": "A long hall paved with large hewn stones, thick oak beams"
- "still hold up the ceiling frescoed with gilded symbols. Dust corpuscles swirl"
- "in the light, disturbed by your passage."
- }
- START_02 = {
- "prototype_parent": "ROOM",
- "prototype_tags": ["room"],
- "key": "old guardhouse",
- "aliases": ["guardhouse", "start_02"],
- "desc": "An old guardhouse devastated by the fighting that took place in these halls."
- "The only part that has been spared is the ceiling, completely covered with"
- "peeling frescoes depicting scenes of martial life."
- }
- START_03 = {
- "prototype_parent": "ROOM",
- "prototype_tags": ["room"],
- "key": "empty corridor",
- "aliases": ["corridor", "start_03"],
- "desc": "The sides of the corridor are lined with stone archways, each adorned by a"
- "stone statue. All the statues have been broken behind recognition."
- }
- START_04 = {
- "prototype_parent": "ROOM",
- "prototype_tags": ["room"],
- "key": "empty corridor",
- "aliases": ["corridor", "start_04"],
- "desc": "This building seems to have survived the ravages of time better than"
- "most of the others. Its arched roof and wide spaces suggests that"
- "this is a temple or church of some kind."
- }
- # EXITS
- START_DOOR_00 = {
- "prototype_parent": "EXIT",
- "prototype_tags": ["exit"],
- "key": "sculpted archway",
- "aliases": ["archway", "start_door_00"],
- "desc": "A beautifully sculpted arched entrance. Two figures are carved into the"
- "stone on either side of the door, on the right Its, the muse of Deception, on"
- "right Izzac, the muse of Authority."
- }
- START_DOOR_01 = {
- "prototype_parent": "EXIT",
- "prototype_tags": ["exit"],
- "key": "open doorway",
- "aliases": ["doorway", "start_door_01"],
- "desc": "A large doorway, with no door. The rune '|y◧|n' is engraved on the granite jamb."
- }
- START_DOOR_02 = {
- "prototype_parent": "EXIT",
- "prototype_tags": ["exit"],
- "key": "small doorway",
- "aliases": ["doorway", "start_door_02"],
- "desc": "A small doorway, with no door. The rune '|y◓|n' is engraved on the granite jamb."
- }
- START_DOOR_03 = {
- "prototype_parent": "EXIT",
- "prototype_tags": ["exit"],
- "key": "reinforced door",
- "aliases": ["door", "start_door_03"],
- "desc": "A big oak door, reinforced with iron bars across its frame."
- "It bears marks and burns all over its surface but hasn't been breached during the"
- "siege."
- }
|