Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Version 2/130731 of Openable Garments by Shadow Wolf begins here.
- "Layered garments that unbutton, unzip, pull down, push up, etc."
- Include version 9 of Layered Garments by Shadow Wolf.
- Volume - Openable Garments
- A garment-element can be open.
- Definition: A garment is partially-covered if a garment-element composing it is under something.
- [Inform Bug 554 prevents overriding a definition with a later one. Here we create several identical (but more specific) definitions instead).
- http://inform7.com/mantis/view.php?id=554
- ]
- Definition: A garment is uppermost if it is not under a closed opaque thing.
- Definition: A garment-piece is uppermost if it is not under a closed opaque thing.
- Definition: A body-part is uppermost if it is not under a closed opaque thing.
- Use simple opening translates as (- Constant SIMPLE_OPENING; -).
- Volume - Closures/Fastenings
- Closure is a kind of value. The closures are non-closeable, zipped, buttoned, and laced.
- Definition: A garment (called the item) is unfastened if an open closeable garment-element is a portion of the item.
- Definition: A garment is fastened if it is not unfastened.
- Definition: A garment is closure-blocked if a closeable garment-element composing it is under something closed.
- A garment has a closure. A garment-element can be closeable.
- A garment can be removed-when-unfastened.
- Fastening is an action applying to one thing. Unfastening is an action applying to one thing.
- Check an actor unfastening a not worn garment (this is the cant unfasten unworn garments rule): instead report openable garment message "noun not worn".
- Check an actor unfastening an unfastened garment (this is the cant unfasten open garments rule): instead report openable garment message "noun already open".
- Check an actor unfastening a non-closeable garment (this is the cant unfasten garments without a closure rule): instead report openable garment message "noun doesnt open".
- Check an actor unfastening a closure-blocked garment (this is the cant unfasten when somethings in the way rule):
- if a closeable garment-element composing the noun is under a closed garment-element (called the impediment):
- now the second noun is the impediment;
- instead report openable garment message "impeded by second noun".
- Check an actor unfastening a removed-when-unfastened partially-covered garment (this is the auto-removable garments must be free rule):
- if a garment-element composing the noun is under a garment-element (called the impediment):
- now the second noun is the impediment;
- instead report openable garment message "2nd prevents removal".
- The cant unfasten when somethings in the way rule is listed before the auto-removable garments must be free rule in the check unfastening rulebook.
- Carry out an actor unfastening a garment (this is the standard carry out unfastening rule):
- now all closeable garment-elements composing the noun are open;
- if the noun is removed-when-unfastened:
- doff the noun;
- now the noun is carried by the actor.
- Report an actor unfastening a garment when the noun is not removed-when-unfastened (this is the standard report unfastening rule):
- if the closure of the noun is:
- -- buttoned: report openable garment message "report unbuttoning";
- -- zipped: report openable garment message "report unzipping";
- -- laced: report openable garment message "report unlacing".
- Report an actor unfastening a removed-when-unfastened garment (this is the standard report unfastening and removing rule):
- if the closure of the noun is:
- -- buttoned: report openable garment message "unbutton and remove";
- -- zipped: report openable garment message "unzip and remove";
- -- laced: report openable garment message "unlace and remove".
- Check an actor fastening a not worn garment (this is the cant fasten unworn garments rule): instead report openable garment message "noun not worn".
- Check an actor fastening a fastened garment (this is the cant fasten closed garments rule): instead report openable garment message "noun already closed".
- Check an actor fastening a non-closeable garment (this is the cant fasten garments without a closure rule): instead report openable garment message "noun cant be closed".
- Check an actor fastening a closure-blocked garment (this is the cant fasten when somethings in the way rule):
- if a closeable garment-element composing the noun is under a closed garment-element (called the impediment):
- now the second noun is the impediment;
- instead report openable garment message "impeded by second noun".
- Carry out an actor fastening a garment (this is the standard carry out fastening rule):
- now all closeable garment-elements composing the noun are closed.
- After donning a garment (called the item) (this is the close garments when donning them rule):
- now all closeable garment-elements composing the item are closed;
- Report an actor fastening (this is the standard report fastening rule):
- if the closure of the noun is:
- -- buttoned: report openable garment message "report buttoning";
- -- zipped: report openable garment message "report zipping";
- -- laced: report openable garment message "report lacing".
- Understand "open [a garment]" as unfastening when the simple opening option is active.
- Understand "close [a garment]" as fastening when the simple opening option is active.
- Buttoning is an action applying to one thing. Understand "button [a garment]" or "button up [a garment]" or "button [a garment] up" as buttoning.
- Before an actor buttoning a buttoned garment (this is the redirect buttoning garments rule): try the actor fastening the noun instead.
- Instead of an actor buttoning a not buttoned garment (this is the block buttoning garments without buttons rule): report openable garment message "noun not buttoned".
- Unbuttoning is an action applying to one thing. Understand "unbutton [a garment]" as unbuttoning.
- Before an actor unbuttoning a buttoned garment (this is the redirect unbuttoning garments rule): try the actor unfastening the noun instead.
- Instead of an actor unbuttoning a not buttoned garment (this is the block unbuttoning garments without buttons rule): report openable garment message "noun not buttoned".
- Zipping is an action applying to one thing. Understand "zip [a garment]" or "zip up [a garment]" or "zip [a garment] up" as zipping.
- Instead of an actor zipping a not zipped garment (this is the block zipping garments without zippers rule): report openable garment message "noun not zippered".
- Before an actor zipping a zipped garment (this is the redirect zipping garments rule): try the actor fastening the noun instead.
- Unzipping is an action applying to one thing. Understand "unzip [a garment]" as unzipping.
- Instead of an actor unzipping a not zipped garment (this is the block unzipping garments without zippers rule): report openable garment message "noun not zippered".
- Before an actor unzipping a zipped garment (this is the redirect unzipping garments rule): try the actor unfastening the noun instead.
- Lacing is an action applying to one thing. Understand "lace [a garment] up" or "lace up [a garment]" as lacing.
- Instead of an actor lacing a not laced garment (this is the block lacing garments without laces rule): report openable garment message "noun not laceup".
- Before an actor lacing a laced garment (this is the redirect lacing garments rule): try the actor fastening the noun instead.
- Unlacing is an action applying to one thing. Understand "unlace [a garment]" as unlacing.
- Instead of an actor unlacing a not laced garment (this is the block unlacing garments without laces rule): report openable garment message "noun not unlaceable".
- Before an actor unlacing a laced garment (this is the redirect unlacing garments rule): try the actor unfastening the noun instead.
- Volume - Shiftable Garments
- A garment-element can be shiftable.
- Shiftability is a kind of value. The shiftability are non-shiftable, liftable, lowerable, and pushable.
- A garment has a shiftability.
- Definition: A garment (called the item) is shifted if a an open shiftable garment-element is a portion of the item.
- Definition: A garment is unshifted if it is not shifted.
- Definition: A garment is shifting-blocked if a shiftable garment-element composing it is under something closed.
- Shifting is an action applying to one thing. Straightening is an action applying to one thing.
- Check an actor shifting a shifted liftable garment (this is the cant lift open garments rule): instead report openable garment message "noun pushed up".
- Check an actor shifting a shifted lowerable garment (this is the cant lower open garments rule): instead report openable garment message "noun shoved down".
- Check an actor shifting a shifted pushable garment (this is the cant push open garments aside rule): instead report openable garment message "noun pushed aside".
- Check an actor shifting a non-shiftable garment (this is the cant shift unmovable garments rule): instead report openable garment message "cant shift noun".
- Check an actor shifting a shifting-blocked garment (this is the cant shift unreachable garments rule): instead report openable garment message "cant reach noun".
- Check an actor shifting a not worn garment (this is the cant shift unworn garments rule): instead report openable garment message "noun not worn".
- Carry out an actor shifting a garment (this is the standard carry out shifting rule):
- now all shiftable garment-elements composing the noun are open.
- Report an actor shifting a garment (this is the standard report shifting rule):
- if the shiftability of the noun is:
- -- liftable: report openable garment message "report lifting";
- -- lowerable: report openable garment message "report lowering";
- -- pushable: report openable garment message "report pushing aside".
- Check an actor straightening a non-shiftable garment (this is the cant straighten unmovable garments rule): instead report openable garment message "no need to straighten".
- Check an actor straightening an unshifted liftable garment (this is the cant lift closed garments rule) : instead report openable garment message "noun pulled down".
- Check an actor straightening an unshifted lowerable garment (this is the cant lower closed garments rule): instead report openable garment message "noun pulled up".
- Check an actor straightening an unshifted pushable garment (this is the cant pull closed garments back rule): instead report openable garment message "noun in place".
- Check an actor straightening a shifting-blocked garment (this is the cant straighten unreachable garments rule): instead report openable garment message "cant reach noun".
- Check an actor straightening a not worn garment (this is the cant straighten unworn garments rule): instead report openable garment message "noun not worn".
- Carry out an actor straightening a garment (this is the standard carry out straightening rule):
- now all shiftable garment-elements composing the noun are closed.
- After donning a garment (called the item) (this is the straighten garments when donning them rule):
- now all shiftable garment-elements composing the item are closed.
- Report an actor straightening a garment (this is the standard report straightening rule):
- if the shiftability of the noun is:
- -- liftable: report openable garment message "report pulling down";
- -- lowerable: report openable garment message "report pulling up";
- -- pushable: report openable garment message "report straightening."
- Understand the command "shove" as "push".
- Lifting is an action applying to one thing.
- Understand "pull up [a garment]" or "pull [a garment] up" as lifting.
- Understand "push up [a garment]" or "push [a garment] up" as lifting.
- Understand "lift [a garment]" or "lift up [a garment]" or "lift [a garment] up" as lifting.
- Before an actor lifting a liftable garment (this is the redirect lifting to shifting rule): instead try the actor shifting the noun.
- Before an actor lifting a lowerable garment (this is the redirect lifting to straightening rule): instead try the actor straightening the noun.
- Instead of an actor lifting a garment (this is the block unnecessary lifting rule): report openable garment message "no point lifting".
- Lowering is an action applying to one thing.
- Understand "push down [a garment]" or "push [a garment] down" as lowering.
- Understand "pull down [a garment]" or "pull [a garment] down" as lowering.
- Understand "lower [a garment]" as lowering.
- Before an actor lowering a lowerable garment (this is the redirect lowering to shifting rule): instead try the actor shifting the noun.
- Before an actor lowering a liftable garment (this is the redirect lowering to straightening rule): instead try the actor shifting the noun.
- Instead of an actor lowering a garment (this is the block unnecessary lowering rule): report openable garment message "no point lowering".
- Pushing aside is an action applying to one thing.
- Understand "push aside [a garment]" or "push [a garment] aside" as pushing aside.
- Understand "pull aside [a garment]" or "pull [a garment] aside" as pushing aside.
- Before an actor pushing aside a pushable garment (this is the redirect pushing aside rule): instead try the actor shifting the noun.
- Instead of an actor pushing aside a garment (this is the block unnecessary pushing aside rule): report openable garment message "no point pushing".
- Pulling back is an action applying to one thing.
- Understand "straighten [a garment]" or "straighten up/out [a garment]" or "straighten [a garment] up/out" as pulling back.
- Understand "pull back [a garment]" or "pull [a garment] back" or "push [a garment] back" or "push back [a garment]" as pulling back.
- Instead of an actor pulling back a garment (this is the block unnecessary pulling back rule): report openable garment message "no point straightening".
- Before an actor pulling back a pushable garment (this is the redirect pulling back rule): instead try the actor straightening the noun.
- Volume - Rippable Garments
- A garment-element can be rippable.
- Definition: A garment is tearable if a rippable garment-element is a portion of it.
- Definition: A garment is torn if an open rippable garment-element is a portion of it.
- Understand the commands "rip" and "tear" as "cut".
- The block cutting rule is not listed in the check cutting rulebook.
- Check an actor cutting something which is not a garment (this is the block cutting non-garments rule): abide by the block cutting rule.
- Check an actor cutting a not tearable garment (this is the cant cut non-rippable garments rule): abide by the block cutting rule.
- Check an actor cutting a torn garment (this is the cant cut twice rule): instead report openable garment message "already torn".
- Carry out an actor cutting a garment (this is the standard carry out cutting garments rule):
- now all rippable garment-elements composing the noun are open.
- Report an actor cutting a garment (this is the standard report cutting garments rule): report openable garment message "report tearing".
- Volume - Garment Access
- The garment access rules are a rulebook.
- Unfastening a garment is garment manipulation. Fastening a garment is garment manipulation. Straightening is garment manipulation. Shifting a garment is garment manipulation. Cutting a garment is garment manipulation.
- Before garment manipulation when the actor does not wear the noun (this is the execute garment manipulation rule): anonymously abide by the garment access rules.
- The execute garment manipulation rule is listed last in the before rulebook.
- Volume - Default Messages
- To report openable garment message (T - a text):
- choose the row with a name of T in the Table of Openable Garment Messages;
- if there is a complex output entry:
- consider the complex output entry;
- otherwise:
- say "[the message entry][paragraph break]".
- [The purpose of this is to allow the author to replace any default messages by amending the Table of Openable Garment Messages.]
- Table of Openable Garment Messages
- name message complex output
- "cant reach noun" "[The person asked] can't reach [that-those of the noun]." a rule
- "impeded by second noun" "[The second noun] [is-are] in the way."
- "2nd prevents removal" "[The second noun] prevent[s] removing [the noun]."
- "noun already open" "[The noun] [is-are] already open."
- "noun doesnt open" "[The noun] do[es]nt open."
- "noun not worn" "There's no point unless someone is wearing [it-them of the noun]."
- "report unbuttoning" "[The person asked] unbutton[s] [the noun]."
- "report unzipping" "[The person asked] unzip[s] [the noun]."
- "report unlacing" "[The person asked] unlace[s] [the noun]."
- "noun already closed" "[The noun] [is-are] already closed."
- "noun cant be closed" "There's no way to close [the noun]."
- "report buttoning" "[The person asked] button[s] up [the noun]."
- "report zipping" "[The person asked] zip[s] up [the noun]."
- "report lacing" "[The person asked] lace[s] up [the noun]."
- "noun not buttoned" "[The noun] do[es]n't seem to have any buttons."
- "noun not zippered" "[The noun] do[es]n't seem to have a zipper."
- "noun not laceup" "[The noun] do[es]n't appear to lace up."
- "noun not unlaceable" "[The noun] do[es] not appear to be unlaceable."
- "noun pushed up" "[The noun] has already been pushed up."
- "noun shoved down" "[The noun] has already been shoved down."
- "noun pushed aside" "[The noun] has already been pushed aside."
- "cant shift noun" "[The person asked] see[s] no useful way to shift [the noun]."
- "report lifting" "[The person asked] lift[s] [the noun]."
- "report lowering" "[The person asked] push[es] [the noun] down."
- "report pushing aside" "[The person asked] push[es] [the noun] aside."
- "no need to straighten" "There's no need to straighten that up."
- "noun pulled down" "[The noun] is already pulled down."
- "noun pulled up" "[The noun] is already pulled up."
- "noun in place" "[The noun] is already in place."
- "report pulling down" "[The person asked] pull[s] down [the noun]."
- "report pulling up" "[The person asked] pull[s] up [the noun]."
- "report straightening" "[The person asked] straighten[s] out [the noun]."
- "no point lifting" "There doesn't seem to be much point to lifting [the noun]."
- "no point lowering" "There doesn't seem to be much point to lowering [the noun]."
- "no point pushing" "There doesn't seem to be much point to pushing [the noun] aside."
- "no point straightening" "There doesn't seem to be much point to straightening [the noun]."
- "already torn" "[The noun] is already torn."
- "report tearing" "[The person asked] rip[s] open [the noun]."
- "unbutton and remove" "[The person asked] unbutton[s] and remove[s] [the noun]."
- "unzip and remove" "[The person asked] unzip[s] and remove[s] [the noun]."
- "unlace and remove" "[The person asked] unlace[s] and remove[s] [the noun]."
- Openable Garments ends here.
- ---- DOCUMENTATION ----
- Openable Garments Documentation
- This extension, built on Layered Garments, provides rules for opening and closing garments, either by various forms of fastenings, or by pushing and pulling the garments around (which we call "shifting"). Opening a garment (or part of a garment) exposes the body-parts and garments underneath.
- It's possible that some garments may open in multiple ways - for instance, a dress where the top can be unzipped and the skirt can be pushed up. Openable Garments allows this with some restrictions:
- - The garment must be a complex garment (i.e. containing at least one additional garment-piece in addition to the main garment).
- - Each element of the garment (the main garment, and the garment-pieces) must open in a single way, either via unfastening, or via shifting.
- - The garment overall supports one unfastening method, and one shifting method. It is not possible to have two kinds of fastenings or two kinds of shifting.
- For non-complex garments, only one opening method is allowed.
- In addition to unfastening and shifting, garment-elements may be "rippable". Rippable garments may be opened (by the cut/tear/rip verb), but cannot be closed again.
- Chapter: Defining Openable Garments
- Section: Simple Garments
- Declare the garment to be either closeable or shiftable. (Closeable means that an unfastening method is used, shiftable means one of the shifting verbs). Also declare what kind of fastenings or how the garment is shifted. Examples:
- The blouse is a closeable buttoned shirt. The windbreaker is a closeable zipped jacket.
- The thong is a shiftable pushable pair of underpants. [Pushable means it can be "pushed aside" or "pulled aside".]
- Section: Complex Garments
- Declare (at most) one shifting method and one fastening type on the main garment. You don't have to have both if it isn't appropriate.
- The cocktail dress is a liftable zippered dress.
- Each piece of the garment, including the main garment, needs to declare whether it opens via fastenings (closeable) or shifting (shiftable):
- The cocktail dress is closeable. [The main part of a dress is the top, covering the torso.] The cocktail dress's dress-skirt is shiftable.
- Chapter: Fastening/Unfastening types
- Garments can be zipped, buttoned, or laced. These are closed and opened by paired fastening/unfastening verbs: Buttoning and unbuttoning, zipping and unzipping, lacing and unlacing.
- All the verbs redirect (via before rules) to the "fastening" and "unfastening" actions. To write additional rules for a particular garment, add them to fastening/unfastening.
- If the "Use simple opening" option is declared, then "open" and "close" will work for any kind of fastening type. (But not for shiftable garments.)
- Section: Garments that are removed when unfastened
- Some garments should be automatically removed if they are unfastened. For example, a corset comes off if it's unlaced, or jeans that come off when unzipped. Such an item can be declared as "removed-when-unfastened".
- A removed-when-unfastened item cannot be opened if there is any garment on top of any part of it - in other words, unless it can be immediately removed without having to remove any other garments. (Normally a garment can be opened as long as any garments on top of the openable parts are themselves open).
- If you want a garment that's only conditionally removed, declare it as normal (not removed-when-unfastened) and check the appropriate conditions in an "After unfastening" rule. If it should be removed, then use "doff the noun; now the noun is carried by the actor;" (assuming it should end up in the actor's inventory).
- Section: Pseudo-openable garments
- You might want to have garments that can be unbuttoned, unzipped, or unlaced without there being any actual effect, or with an effect that's different than opening/closing pieces. Sneakers, for instance - unlacing them doesn't give you more access to the sock below, but may change how they're described, etc.
- Simply declare the garment as "laced" (or buttoned or zipped), but don't define any closeable elements. Override the "unfastened" definition, and write Carry out fastening/unfastening rules.
- A pair of sneakers is a kind of pair of shoes. A pair of sneakers is usually laced. A pair of sneakers can be laced-up.
- Definition: a pair of sneakers is unfastened if it is not laced-up.
- Carry out unfastening a pair of sneakers: now the noun is not laced-up.
- Carry out fastening a pair of sneakers: now the noun is laced-up.
- Before printing the name of a not laced-up pair of sneaker, say "unlaced ". Understand "unlaced" as a pair of sneakers when the item described is not laced-up.
- Section: New fastening types.
- To add a new kind of fastening, define it as a closure (which is the name of the kind of value used for this). Then add new actions with the appropriate vocabulary, with Before rules redirecting to the fastening/unfastening actions (and instead rules which block the action if tried on the wrong type of garment). You will also probably want to add "Report unfastening" and "Report fastening" rule that displays the appropriate default messages.
- Buckled is a closure.
- Buckling is an action applying to one thing. Understand "buckle [a garment] up" or "buckle up [a garment]" as buckling.
- Unbuckling is an action applying to one thing. Understand "unbuckle [a garment]" as unbuckling.
- Before an actor buckling a buckled garment, try the actor fastening the noun instead. Instead of an actor buckling a not buckled garment, instead say "That doesn't have any buckles."
- Before an actor unbuckling a buckled garment, try the actor unfastening the noun instead. Instead of an actor unbuckling a not buckled garment, instead say "That doesn't have any buckles."
- Report an actor fastening a buckled garment: say "[The actor] buckle[s] up [the noun]."
- Report an actor unfastening a buckled garment: say "[The actor] unbuckle[s] [the noun]."
- [The report rules should also probably check for removed-when-fastened...]
- Chapter: Shiftable Garments
- "Liftable" garments can be pushed or pulled up to open them (and pushed or pulled down to close them). "Lowerable" garments can be pushed or pulled down to open them (and pushed/pulled up to close). "Pushable" garments can be pushed or pulled aside to open, and "pushed/pulled back" or "straightened" to close them.
- All of the various verbs are redirected to the shifting action (which opens garments) or the straightening action (which closes them) as appropriate.
- While I can't think of any additional shifting methods you would want to define, it's entirely possible. It should be easy enough to follow the extension's code to see how it's done.
- Chapter: Rippable Garments
- Simply declare a garment-element to be rippable, and it will be openable by the rip/tear/cut verb. Rippable elements should not be shiftable or closeable.
- To add special rules, add them to the "cutting" action (defined by Inform 7).
- Chapter: Garment Access Rules
- Obviously, NPCs may not want the player to run around opening and closing their clothes without permission. For this purpose, there is a new rulebook called the "garment access rules". These are executed at the end of the before rules, for any action which is listed as "garment manipulation", when the actor is not wearing the noun. The rulebook is initially empty. When writing rules, make sure you end the rule with "instead" or "rule failed".
- A garment access rule when Jane is wearing the noun: say "Jane says 'I don't think so, buster!'" instead.
- A garment access rule for shifting a pair of underpants when the noun is worn by Alice: say "Alice tells you she's not quite ready for that step." instead.
- Note that this doesn't prevent the player from ordering an NPC to open their own clothes - the persuasion rules are for that.
- You can define additional behavior as garment manipulation, as long as the noun is the garment being manipulated.
- Chapter: Openable Garment Messages
- All of the output from this extension can be found in the "Table of Openable Garment Messages". If you want to change one of the messages from a check, instead, or report rule, simply amend this table. There are three columns: name (a unique name for each message), message (a simple text message to be output), and "complex output" (usually blank, but you can specify the name of a rule). If a rule is listed in the complex output entry, it will be called instead of displaying the defined message entry. The rule can of course display any text you want it to, or do anything else.
- Chapter: Change History
- Version 2/130720: First published release.
- Version 2/130731: Doc fix: cocktail dress example.
Advertisement
Add Comment
Please, Sign In to add comment