Smell restrictions (ADRIFT 5 example): Difference between revisions
From IFWiki
No edit summary |
No edit summary |
||
Line 267: | Line 267: | ||
</code> | </code> | ||
[[Category:Smell restrictions (Example)]] [[Category:Examples of ADRIFT | [[Category:Smell restrictions (Example)]] [[Category:Examples of ADRIFT code]] |
Revision as of 08:28, 3 April 2013
Please note, the code below is the module output for this example. It is not designed to be readable or concise. It might be a good idea to create an XSLT to convert it to a more readable format.
[xml]
<?xml version="1.0" encoding="utf-8"?>
<Adventure>
<Version>5.000031</Version>
<LastUpdated>2013-04-03 08:45:26</LastUpdated>
<Title>Smell Restrictions</Title>
<Author>Campbell Wild</Author>
<ShowFirstLocation>1</ShowFirstLocation>
<ShowExits>1</ShowExits>
<EnableMenu>1</EnableMenu>
<Property>
<Key>Odour</Key>
<Description>odour</Description>
<PropertyOf>AnyItem</PropertyOf>
<Type>Text</Type>
</Property>
<Location>
<Key>Street</Key>
<ShortDescription>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>Street</Text>
</Description>
</ShortDescription>
<LongDescription>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>You are in a street. The sewer is below you.</Text>
</Description>
</LongDescription>
<Movement>
<Direction>Down</Direction>
<Destination>Sewer</Destination>
</Movement>
<Property>
<Key>Odour</Key>
<Value>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>You pick up a faint odour from below.</Text>
</Description>
</Value>
</Property>
</Location>
<Location>
<Key>Sewer</Key>
<ShortDescription>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>Sewer</Text>
</Description>
</ShortDescription>
<LongDescription>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>You are in a sewer. The street is above you.</Text>
</Description>
</LongDescription>
<Movement>
<Direction>Up</Direction>
<Destination>Street</Destination>
</Movement>
</Location>
<Object>
<Key>Flower</Key>
<Article>a</Article>
<Prefix />
<Name>flower</Name>
<Description>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>It's just a nice flower. You don't know what type.</Text>
</Description>
</Description>
<Property>
<Key>Odour</Key>
<Value>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>It smells wonderful.</Text>
</Description>
</Value>
</Property>
<Property>
<Key>StaticOrDynamic</Key>
<Value>Dynamic</Value>
</Property>
<Property>
<Key>DynamicLocation</Key>
<Value>In Location</Value>
</Property>
<Property>
<Key>InLocation</Key>
<Value>Street</Value>
</Property>
</Object>
<Object>
<Key>Spacesuit</Key>
<Article>a</Article>
<Prefix />
<Name>spacesuit</Name>
<Name>space suit</Name>
<Name>suit</Name>
<Description>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>Spacesuits are wonderful things, but they make EVERYONE look fat.</Text>
</Description>
</Description>
<Property>
<Key>Wearable</Key>
</Property>
<Property>
<Key>StaticOrDynamic</Key>
<Value>Dynamic</Value>
</Property>
<Property>
<Key>DynamicLocation</Key>
<Value>In Location</Value>
</Property>
<Property>
<Key>InLocation</Key>
<Value>Street</Value>
</Property>
</Object>
<Object>
<Key>Sewage</Key>
<Article>some</Article>
<Prefix />
<Name>sewage</Name>
<Description>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>Horrible smelly sewage is everywhere in the sewer.</Text>
</Description>
</Description>
<Property>
<Key>Odour</Key>
<Value>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>It reeks.</Text>
</Description>
</Value>
</Property>
<Property>
<Key>ExplicitlyList</Key>
</Property>
<Property>
<Key>StaticOrDynamic</Key>
<Value>Static</Value>
</Property>
<Property>
<Key>StaticLocation</Key>
<Value>Single Location</Value>
</Property>
<Property>
<Key>AtLocation</Key>
<Value>Sewer</Value>
</Property>
</Object>
<Task>
<Key>SmellObject</Key>
<Priority>50033</Priority>
<Type>General</Type>
<Command>smell %item%</Command>
<Description>smell item</Description>
<CompletionMessage>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>%item%.Odour</Text>
</Description>
<Description>
<Restrictions>
<Restriction>
<Item>ReferencedItem MustNot HaveProperty Odour</Item>
</Restriction>
<BracketSequence>#</BracketSequence>
</Restrictions>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>You smell nothing unexpected.</Text>
<TabLabel>No Odour</TabLabel>
</Description>
</CompletionMessage>
<Repeatable>1</Repeatable>
</Task>
<Task>
<Key>SmellObj</Key>
<Priority>1</Priority>
<Type>General</Type>
<Command>smell</Command>
<Description>smell location</Description>
<Repeatable>1</Repeatable>
<Actions>
<SetTasks>Execute SmellObject (%Player%.Location)</SetTasks>
</Actions>
</Task>
<Task>
<Key>CantSmell</Key>
<Priority>50034</Priority>
<Type>Specific</Type>
<GeneralTask>SmellObject</GeneralTask>
<Specific>
<Type>Item</Type>
<Multiple>0</Multiple>
<Key />
</Specific>
<Description>Can't smell wearing suit</Description>
<CompletionMessage>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>You can't smell anything while wearing the spacesuit.</Text>
</Description>
</CompletionMessage>
<Repeatable>1</Repeatable>
<SpecificOverrideType>Override</SpecificOverrideType>
<MessageBeforeOrAfter>After</MessageBeforeOrAfter>
<Restrictions>
<Restriction>
<Character>%Player% Must BeWearingObject Spacesuit</Character>
</Restriction>
<Restriction>
<Item>ReferencedItem MustNot BeCharacter Player</Item>
</Restriction>
<Restriction>
<Item>ReferencedItem MustNot BeObject Spacesuit</Item>
</Restriction>
<BracketSequence>#A#A#</BracketSequence>
</Restrictions>
</Task>
<Task>
<Key>SewageOverwhelm</Key>
<Priority>50035</Priority>
<Type>Specific</Type>
<GeneralTask>SmellObject</GeneralTask>
<Specific>
<Type>Item</Type>
<Multiple>0</Multiple>
<Key />
</Specific>
<Description>Sewage overwhelms</Description>
<CompletionMessage>
<Description>
<DisplayWhen>StartDescriptionWithThis</DisplayWhen>
<Text>The disgusting reek of the sewage overwhelms your nose. You can't smell anything else.</Text>
</Description>
</CompletionMessage>
<Repeatable>1</Repeatable>
<SpecificOverrideType>Override</SpecificOverrideType>
<MessageBeforeOrAfter>After</MessageBeforeOrAfter>
<Restrictions>
<Restriction>
<Character>%Player% Must BeInSameLocationAsObject Sewage</Character>
</Restriction>
<Restriction>
<Character>%Player% MustNot BeWearingObject Spacesuit</Character>
</Restriction>
<Restriction>
<Item>ReferencedItem MustNot BeObject Sewage</Item>
</Restriction>
<BracketSequence>#A#A#</BracketSequence>
</Restrictions>
</Task>
</Adventure>