"You pick " + object.article + " up." "You can't take " + object.article + "." WriteVerb(object, "be") + " too heavy to be taken." "You can't carry any more items." "You can't put more items in " + object.article + "." "You drop " + object.article + "." "You can't drop " + object.article + "." "You can't put " + object.article + " there." "You are already carrying " + object.article + "." "You are not carrying " + object.article + "." "You can't use " + object.article + "." "You can't give " + object.article + "." WriteVerb(object, "say") + " nothing." CapFirst(GetDefiniteName(object)) + " " + Conjugate(object, "be") + " not open." WriteVerb(object, "be") + " already open." WriteVerb(object, "be") + " already closed." "You can't open " + object.article + "." "You can't close " + object.article + "." "You open " + object.article + "." "You close " + object.article + "." WriteVerb(object, "be") + " already there." WriteVerb(object, "contain") WriteVerb(object, "be") + " full." "Please choose which '" + text + "' you mean:" "Undo: " + text WriteVerb(object, "do") + " not reply." WriteVerb(object, "do") + " not reply." WriteVerb(object, "be") + " locked." WriteVerb(object, "be") + " already locked." WriteVerb(object, "be") + " already unlocked." "You cannot lock " + object.article + " when " + object.gender + " " + Conjugate(object, "be") + " open." WriteVerb(object, "be") + " already switched on." WriteVerb(object, "be") + " already switched off." "You switch " + object.article + " on." "You switch " + object.article + " off." "You eat " + object.article + "." CapFirst(GetDisplayAlias(object1)) + " " + Conjugate(object1, "do") + " not contain " + GetDisplayAlias(object2) + "." "You are looking " + text +"." "It is too dark to make anything out." "You put " + object.article + " on." "You can't wear " + object.article + "." "You would need to get " + object.article + " before you can put " + object.article + " on." "You would need to get " + object.article + " before you can take " + object.article + " off." "You are already wearing " + object.article + "." "You are not wearing " + object.article + "." "You cannot remove " + object.article + "!" "You cannot wear that over " + GetDisplayGarment(object) + "." "You cannot wear that while wearing " + GetDisplayGarment(object) + "." "You take " + object.article + " off." "You can't remove that while wearing " + GetDisplayGarment(object) + "." "You can't buy " + object.article + "." "You can't climb " + object.article + "." "You can't drink " + object.article + "." "You can't eat " + object.article + "." WriteVerb(object1, "do") + " not want " + object2.article + "." "You can't hit " + object.article + "." "You can't kill " + object.article + "." "You can't kiss " + object.article + "." "You can't knock " + object.article + "." "You can't lick " + object.article + "." "You can't lie on " + object.article + "." "You listen, but " + object.gender + " makes no sound." "You can't lock " + object.article + "." "You can't move " + object.article + "." "You can't pull " + object.article + "." "You can't push " + object.article + "." "You can't read " + object.article + "." "You can't search " + object.article + "." "You can't show " + object.article + "." "You can't sit on " + object.article + "." "You sniff, but " + object.gender + " doesn't smell of much." "You can't taste " + object.article + "." "You can't throw " + object.article + "." "You can't tie " + object.article + "." "You can't touch " + object.article + "." "You can't turn " + object.article + " on." "You can't turn " + object.article + " off." "You can't turn " + object.article + "." "You can't unlock " + object.article + "." "You can't untie " + object.article + "." "You can't use " + object2.article + " that way." "You can't wear " + object.article + "." WriteVerb(object, "do") + " nothing." "The object with the name '" + text + "' cannot be found." "The attribute with the name '" + text + "' cannot be found." 7a793990-96db-4e7e-b34d-7fe3deed17ff 1.0 2019 16 Wheat false Simon Mellor Mystery Black Blue font-family:Georgia, serif;color:Black;font-size:16pt;;background:Wheat 3 section3 player speak buy climb drink eat hit kill kiss knock lick lie listen lock move pull push read search show sit smell taste throw tie touch turnon turnoff turn unlock untie break smash speak speak buy buy climb climb drink drink eat eat hit hit kill kill kiss kiss knock knock lick lick lie lieon listen listento lock lock move move pull pull push push read read search search show show sit siton smell smell taste taste throw throw tie tie touch touch turnon turnon turnoff turnoff turn turn unlock unlock untie untie break k3 smash k4 false 2 false false 22 section2 look at .*?)$|^look (?.*?)$|^x (?.*?)$|^examine (?.*?)$|^exam (?.*?)$|^ex (?.*?)$]]> take .*?)$|^get (?.*?)$|^pick up (?.*?)$]]> notheld drop .*?)$]]> inventory use .*?)$]]> ^undo$ ^i$|^inv$|^inventory$ ^look$|^l$ north|east|south|west|northeast|northwest|southeast|southwest|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]> ^quit$ .*)$|^go (?.*)$|^(?north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]> You can't go there. open .*?)$]]> close .*?)$]]> .*) (on|in|on to|in to|into) (?.*)$]]> object1=inventory|object2=container .*) (from|out of|off|out) (?.*)$]]> object1=contents|object2=container give .*?)$]]> .*) to (?.*)$]]> .*) (on|with) (?.*)$]]> .*) about (?.*)$]]> .*) about (?.*)$]]> .*) to (?.*)$]]> .*), (?.*)$]]> .*)$]]> speak to speak DefaultSpeakTo .*?)( (with|using) (?.*))?$|^speak (?.*?)( (with|using) (?.*))?$|^talk to (?.*?)( (with|using) (?.*))?$|^talk (?.*?)( (with|using) (?.*))?$]]> buy buy DefaultBuy .*?)( (with|using) (?.*))?$|^purchase (?.*?)( (with|using) (?.*))?$]]> climb climb DefaultClimb .*?)( (with|using) (?.*))?$]]> drink drink DefaultDrink .*?)( (with|using) (?.*))?$]]> eat eat DefaultEat .*?)( (with|using) (?.*))?$]]> hit hit DefaultHit .*?)( (with|using) (?.*))?$]]> kill kill DefaultKill .*?)( (with|using) (?.*))?$]]> kiss kiss DefaultKiss .*?)( (with|using) (?.*))?$]]> knock knock DefaultKnock .*?)( (with|using) (?.*))?$]]> lick lick DefaultLick .*?)( (with|using) (?.*))?$]]> lie on lie DefaultLie .*?)( (with|using) (?.*))?$|^lie upon (?.*?)( (with|using) (?.*))?$|^lie down on (?.*?)( (with|using) (?.*))?$|^lie down upon (?.*?)( (with|using) (?.*))?$]]> listen to listen DefaultListenTo .*?)( (with|using) (?.*))?$]]> lock lock DefaultLock .*?)( (with|using) (?.*))?$]]> move move DefaultMove .*?)( (with|using) (?.*))?$]]> pull pull DefaultPull .*?)( (with|using) (?.*))?$]]> push push DefaultPush .*?)( (with|using) (?.*))?$]]> read read DefaultRead .*?)( (with|using) (?.*))?$]]> search search DefaultSearch .*?)( (with|using) (?.*))?$]]> show show DefaultShow .*?)( (with|using) (?.*))?$]]> sit on sit DefaultSit .*?)( (with|using) (?.*))?$|^sit upon (?.*?)( (with|using) (?.*))?$|^sit down on (?.*?)( (with|using) (?.*))?$|^sit down upon (?.*?)( (with|using) (?.*))?$]]> smell smell DefaultSmell .*?)( (with|using) (?.*))?$|^sniff (?.*?)( (with|using) (?.*))?$]]> taste taste DefaultTaste .*?)( (with|using) (?.*))?$]]> throw throw DefaultThrow .*?)( (with|using) (?.*))?$]]> tie tie DefaultTie .*?)( (with|using) (?.*))?$]]> touch touch DefaultTouch .*?)( (with|using) (?.*))?$]]> turn on turnon DefaultTurnOn .*?)( (with|using) (?.*))?$|^turn (?.*?) on( (with|using) (?.*))?$|^switch on (?.*?)( (with|using) (?.*))?$|^switch (?.*?) on( (with|using) (?.*))?$]]> turn off turnoff DefaultTurnOff .*?)( (with|using) (?.*))?$|^turn (?.*?) off( (with|using) (?.*))?$|^switch off (?.*?)( (with|using) (?.*))?$|^switch (?.*?) off( (with|using) (?.*))?$]]> turn turn DefaultTurn .*?)( (with|using) (?.*))?$]]> unlock unlock DefaultUnlock .*?)( (with|using) (?.*))?$]]> untie untie DefaultUntie .*?)( (with|using) (?.*))?$]]> ^listen$ ^jump$ ^sit$|^sit down$ ^lie$|^lie down$ ^sleep$|^rest$ ^wait$|^z$ ^xyzzy$ ^help$|^\?$ ^save$ ^(version|info|about)$ ^log$|^view log$|^display log$ ^(view|display|show) (the |)(script|transcript)$ ^(transcript|script)( on|)$|^enable (script|transcript)$ ^(transcript|script) off$|^disable (script|transcript)$ ^restart$ put #object# on .*?) on$|^wear (?.*?)$|^put on (?.*?)$|^don (?.*?)$|^wear (?.*?)$]]> inventory take #object# off .*?) off$|^remove (?.*?)$|^take off (?.*?)$|^doff (?.*?)$]]> inventory .*)]]> break "You can't break " + object.article + "." .*?)( (with|using) (?.*))?$]]> break smash "You can't smash " + object.article + "." .*?)( (with|using) (?.*))?$]]> smash false There is a door at one end and a window looking out onto the city skape.
To the West is a small alcove
]]>
false it it me myself self me me myself self Looking good. you
yourself
save save multiple false
You have been caught and you are trapped inside a small seedy hotel.
Can you escape and give Rock a taste of his own medicnie?
]]>
Look at Take Crimson 1
Covered in dead flies and some other gunk which defies identification false ") } ]]> Smash Break Locked tighter than a ducks bum :) if (Got(A Key)) { msg ("You unlock the door and it swings open. Bugger, the key snaps off in the lock") MoveObject (A Key, Store Room) create exit ("North", Dark dirty unused room, Corridoor) } else { msg ("A key would be useful?") } Unlock
false To the east is another room.]]> IncreaseObjectCounter (Brick, "simon") if (GetInt(Brick, "simon") = 4) { MoveObjectHere (Brick) if (ListContains(ScopeVisible(), Brick)) { msg ("Ouch, What was that!! A bloody house brick on the floor. Oh my toe!!") } } msg ("What a shit hole!!!") Crimson Wait!
You can see a piece of string tied to the winow frrame, it's dangling down the wall on the outside..
]]>
MoveObject (A Key, player) msg ("What's this? On the end of the string is a door key....") Could be the key to the whole game!
There's a door at the North end of the room and you can see the city through the broken window Georgia, serif 12 White Black Blue false 0.5 Arial 9 White Black LightGrey Black northwest north northeast west east southwest south southeast up down in out 0 false all everything the a an false false false false false false false false Classic false false ]]> $! false 1 Black false 950 false 30 0 20 20 false false false false 1 2 3 4 false false false false false en false 30 300 false false false false false false false false false *.jpg;*.jpeg;*.png;*.gif;*.js;*.wav;*.mp3;*.htm;*.html;*.svg;*.ogg;*.ogv false false false InitPOV (oldvalue, game.pov) game.textprocessorcommandresult = ProcessTextCommand_If (section, data) game.textprocessorcommandresult = ProcessTextCommand_Either (section, data) game.textprocessorcommandresult = ProcessTextCommand_Here (section, data) game.textprocessorcommandresult = ProcessTextCommand_Here (section, data) game.textprocessorcommandresult = ProcessTextCommand_Popup (section, data) game.textprocessorcommandresult = ProcessTextCommand_Format (section, data) game.textprocessorcommandresult = ProcessTextCommand_Format (section, data) game.textprocessorcommandresult = ProcessTextCommand_Format (section, data) game.textprocessorcommandresult = ProcessTextCommand_Format (section, data) game.textprocessorcommandresult = ProcessTextCommand_Colour (section, data) game.textprocessorcommandresult = ProcessTextCommand_Colour (section, data) game.textprocessorcommandresult = ProcessTextCommand_Colour (section, data) game.textprocessorcommandresult = ProcessTextCommand_Object (section, data) game.textprocessorcommandresult = ProcessTextCommand_Command (section, data) game.textprocessorcommandresult = ProcessTextCommand_Command (section, data) game.textprocessorcommandresult = ProcessTextCommand_Exit (section, data) game.textprocessorcommandresult = ProcessTextCommand_Once (section, data) game.textprocessorcommandresult = ProcessTextCommand_NotFirst (section, data) game.textprocessorcommandresult = ProcessTextCommand_Random (section, data) game.textprocessorcommandresult = ProcessTextCommand_RandomAlias (section, data) game.textprocessorcommandresult = ProcessTextCommand_Img (section, data) game.textprocessorcommandresult = ProcessTextCommand_Counter (section, data) game.textprocessorcommandresult = ProcessTextCommand_Select (section, data) game.textprocessorcommandresult = ProcessTextCommand_Eval (section, data) game.textprocessorcommandresult = ProcessTextCommand_Eval (section, data) false false false 650 60 Black White White 'Lucida Console', Monaco, monospace Press Start 2P 14 'Lucida Console', Monaco, monospace Black White GreenYellow false false false 650 60 'Courier New', Courier, monospace Special Elite Red Yellow Yellow 'Comic Sans MS', cursive, sans-serif 14 Impact, Charcoal, sans-serif Red Yellow Black Yellow Look at Take Look at Use Drop false false false it
it
its worn false false false false You are in You can see You can go containing false false false 0 0 false false 1 1 White Black 1 15 false Black 0 0 me me myself self Looking good. you yourself your false false false false false false false false 0 false if (game.pov = this) { if (IsDefined("oldvalue")) { OnEnterRoom (oldvalue) } else { OnEnterRoom (null) } if (game.gridmap) { MergePOVCoordinates } } this.hasbeenmoved = true if (this.isopen and HasScript(this, "onopen")) { do (this, "onopen") } if (not this.isopen and HasScript(this, "onclose")) { do (this, "onclose") } if (this.locked and HasScript(this, "onlock")) { do (this, "onlock") } if (not this.locked and HasScript(this, "onunlock")) { do (this, "onunlock") } if (this.switchedon and HasScript(this, "onswitchon")) { do (this, "onswitchon") } if (not this.switchedon and HasScript(this, "onswitchoff")) { do (this, "onswitchoff") }
Go to false false That way is locked. false false 1 false 0 0 Go northwest nw north n northeast ne west w east e southwest sw south s southeast se up u down d in out o ^$ with; using With which object? That doesn't work. There are no objects available to do that with. Look at Speak to Look at Speak to he
him
his worn
false Look at Speak to she
her
her worn
false they
them
their worn
Look at Speak to they
them
their worn
Look at Speak to they
them
their worn
Open Close Open Close Open Close Open Close Open Close Open Close on which there is Open Close Open Close 1 100 activecontainer.maxvolume) { correct = false if (HasString(this, "containerfullmessage")) { message = this.containerfullmessage } else { message = DynamicTemplate("ContainerFull", this) } } } activecontainer = activecontainer.parent } children = GetDirectChildren(this) if (listcount(children) >= this.maxobjects) { correct = false if (HasString(this, "containermaxobjects")) { message = this.containermaxobjects } else { message = DynamicTemplate("MaxObjectsInContainer", this) } } if (correct = false) { msg (message) } else { if (HasScript(object, "drop")) { params = NewDictionary() dictionary add (params, "destination", this) do (object, "drop", params) } else { object.parent = this msg (Template("Done")) } } ]]> Open Close Open Close You do not have the key. Unlocked. Locked. false if (this.locked) { if (this.autounlock and AllKeysAvailable(this)) { do (this, "unlock") if (not this.isopen) { OpenObject (this) } } else { msg (DynamicTemplate("LockedObject", this)) } } else { OpenObject (this) } if (this.locked) { msg (DynamicTemplate("LockedObject", this)) } else { CloseObject (this) } if (this.locked) { msg (DynamicTemplate("AlreadyLocked", this)) } else if (this.isopen and not this.canlockopen) { msg (DynamicTemplate("CannotLockOpen", this)) } else { if (AllKeysAvailable(this)) { msg (this.lockmessage) this.locked = true } else { msg (this.nokeymessage) } } if (not this.locked) { msg (DynamicTemplate("AlreadyUnlocked", this)) } else { if (AllKeysAvailable(this)) { msg (this.unlockmessage) this.locked = false if (this.autoopen and not this.isopen) { TryOpenClose (true, this) } } else { msg (this.nokeymessage) } } 0 false if (ListContains(ScopeReachable(), this)) { if (this.switchedon) { msg (DynamicTemplate("AlreadySwitchedOn", this)) } else if (not this.cannotswitchon = "") { msg (this.cannotswitchon) } else { if (HasString(this, "switchonmsg")) { msg (this.switchonmsg) } else { msg (DynamicTemplate("SwitchedOn", this)) } this.switchedon = true } } else { msg (DynamicTemplate("DefaultTurnOn", this)) } if (ListContains(ScopeReachable(), this)) { if (not this.switchedon) { msg (DynamicTemplate("AlreadySwitchedOff", this)) } else { if (HasString(this, "switchoffmsg")) { msg (this.switchoffmsg) } else { msg (DynamicTemplate("SwitchedOff", this)) } this.switchedon = false } } else { msg (DynamicTemplate("DefaultTurnOff", this)) } Switch on Switch off Switch on Switch off 0 if (HasString(this, "eatmsg")) { msg (this.eatmsg) } else { msg (DynamicTemplate("Eaten", this)) } if (HasInt(game.pov, "health")) { game.pov.health = game.pov.health + this.eathealth } destroy (this.name) Eat Eat 10 11 14 5 7 13 false 0 0 2 msg (DynamicTemplate("TakeSuccessful", this)) this.parent = game.pov SetVerbs " + s + "" ]]> Wear Remove false false false Green #drop #take #to #open #close #on #off 0) { return ("an") } else { return ("a") } ]]> return (CapFirst(obj.gender) + " " + Conjugate(obj, verb)) gender = obj.gender if (gender = "he" or gender = "she") { gender = "it" } switch (verb) { case ("be") { switch (gender) { case ("i") { return ("am") } case ("you") { return ("are") } case ("it") { return ("is") } case ("we") { return ("are") } case ("they") { return ("are") } default { return ("is") } } } case ("do") { switch (gender) { case ("i") { return ("do") } case ("you") { return ("do") } case ("it") { return ("does") } case ("we") { return ("do") } case ("they") { return ("do") } default { return ("do") } } } default { if (gender = "it") { if (EndsWith(verb, "y") and not EndsWith(verb, "ey")) { return (Mid(verb, 1, Lengthof(verb) - 1) + "ies") } else { return (verb + "s") } } else { return (verb) } } } return (possessive + " " + GetDisplayAlias(object)) 0) { s = s + StringListItem(number_units, hundreds) + " hundred " if (number > 0) { s = s + "and " } } if (number < 20) { if (not number = 0 or s = "") { s = s + StringListItem(number_units, number) } } else { units = number % 10 tens = (number / 10) % 10 s = s + StringListItem(number_tens, tens - 2) if (not units = 0) { s = s + StringListItem(number_units, units) } } } else { s = ToString(number) } return (Trim(s)) ]]> result = GetDisplayAlias(obj) if (GetBoolean(obj, "usedefaultprefix") or not obj.prefix = null) { result = "the " + result } return (result) "") { msg (list) } } ]]> game.pov.maxvolume) { continue = false if (HasString(game.pov, "containerfullmessage")) { message = prefix + game.pov.containerfullmessage } else { message = prefix + DynamicTemplate("FullInventory", object) } } } children = GetDirectChildren(game.pov) if (HasInt(game.pov, "maxobjects")) { if (game.pov.maxobjects > 0) { if (ListCount(children) >= game.pov.maxobjects) { continue = false if (HasString(game.pov, "containermaxobjects")) { message = prefix + game.pov.containermaxobjects } else { message = prefix + DynamicTemplate("MaxObjectsInInventory", object) } } } } if (continue = false) { msg (message) } else { found = true takemsg = object.takemsg switch (TypeOf(object, "take")) { case ("script") { if (ismultiple) { OutputTextNoBr (prefix) } do (object, "take") takemsg = "" } case ("boolean") { if (object.take = true) { object.parent = game.pov if (takemsg = null) { takemsg = DynamicTemplate("TakeSuccessful", object) } } else { found = false } } case ("string") { object.parent = game.pov takemsg = object.take } default { found = false } } if (not found and takemsg = null) { takemsg = DynamicTemplate("TakeUnsuccessful", object) } if (LengthOf(takemsg) > 0) { msg (prefix + takemsg) } if (HasScript(object, "ontake")) { do (object, "ontake") } if (found and GetBoolean (object, "scenery") and object.parent = game.pov) { object.scenery = false } } } ]]> 0) { msg (prefix + dropmsg) } if (HasScript(object, "ondrop")) { do (object, "ondrop") } } ]]> objectlist = NewObjectList() objectlist = ScopeReachableInventory() objectlist = ListCombine (objectlist, ScopeReachableNotHeld()) excludelist = NewObjectList() list add (excludelist, game.pov) list add (excludelist, object) candidates = NewObjectList() candidates = ListExclude(RemoveSceneryObjects(objectlist), excludelist) return (candidates) if (doopen) { action = "open" scriptaction = "openscript" } else { action = "close" scriptaction = "closescript" } if (not ListContains(ScopeReachable(), object)) { msg (BlockingMessage(object, "")) } else { found = false if (GetBoolean(object, action)) { if (doopen) { if (object.isopen) { msg (DynamicTemplate("AlreadyOpen", object)) } else { if (HasScript(object, scriptaction)) { do (object, scriptaction) } else { OpenObject (object) } } } else { if (not object.isopen) { msg (DynamicTemplate("AlreadyClosed", object)) } else { if (HasScript(object, scriptaction)) { do (object, scriptaction) } else { CloseObject (object) } } } } else { if (doopen) { msg (DynamicTemplate("CantOpen", object)) } else { msg (DynamicTemplate("CantClose", object)) } } } if (HasString(object, "openmsg")) { msg (object.openmsg) } else { msg (DynamicTemplate("OpenSuccessful", object)) } object.isopen = true ListObjectContents (object) if (HasString(object, "closemsg")) { msg (object.closemsg) } else { msg (DynamicTemplate("CloseSuccessful", object)) } object.isopen = false objectlist = NewObjectList() objectlist = ScopeReachableInventory() objectlist = ListCombine (objectlist, ScopeReachableNotHeld()) excludelist = NewObjectList() list add (excludelist, game.pov) list add (excludelist, object) candidates = NewObjectList() candidates = ListExclude(RemoveSceneryObjects(objectlist), excludelist) return (candidates) handled = false if (HasString(object2, "give")) { msg (object2.give) handled = true } else if (TypeOf(object2, "give") = "scriptdictionary") { if (DictionaryContains(object2.give, object1.name)) { parameters = NewObjectDictionary() dictionary add (parameters, "this", object2) dictionary add (parameters, "object", object1) invoke (ScriptDictionaryItem(object2.give, object1.name), parameters) handled = true } if (not handled) { if (HasScript(object2, "giveanything")) { parameters = NewObjectDictionary() dictionary add (parameters, "object", object1) do (object2, "giveanything", parameters) handled = true } } } if (not handled) { if (HasString(object1, "giveto")) { msg (object1.giveto) handled = true } else if (TypeOf(object1, "giveto") = "scriptdictionary") { if (DictionaryContains(object1.giveto, object2.name)) { parameters = NewObjectDictionary() dictionary add (parameters, "this", object1) dictionary add (parameters, "object", object2) invoke (ScriptDictionaryItem(object1.giveto, object2.name), parameters) handled = true } else { if (HasScript(object1, "givetoanything")) { parameters = NewObjectDictionary() dictionary add (parameters, "object", object2) do (object1, "givetoanything", parameters) handled = true } } } } if (not handled) { msg (DynamicTemplate("DefaultGive", object2, object1)) } handled = false if (HasString(object2, "useon")) { msg (object2.useon) handled = true } else if (TypeOf(object2, "useon") = "scriptdictionary") { if (DictionaryContains(object2.useon, object1.name)) { parameters = NewObjectDictionary() dictionary add (parameters, "this", object2) dictionary add (parameters, "object", object1) invoke (ScriptDictionaryItem(object2.useon, object1.name), parameters) handled = true } else { if (HasScript(object2, "useanything")) { parameters = NewObjectDictionary() dictionary add (parameters, "object", object1) do (object2, "useanything", parameters) handled = true } } } if (not handled) { if (HasString(object1, "selfuseon")) { msg (object1.selfuseon) handled = true } else if (TypeOf(object1, "selfuseon") = "scriptdictionary") { if (DictionaryContains(object1.selfuseon, object2.name)) { parameters = NewObjectDictionary() dictionary add (parameters, "this", object1) dictionary add (parameters, "object", object2) invoke (ScriptDictionaryItem(object1.selfuseon, object2.name), parameters) handled = true } else { if (HasScript(object1, "selfuseanything")) { parameters = NewObjectDictionary() dictionary add (parameters, "object", object2) do (object1, "selfuseanything", parameters) handled = true } } } } if (not handled) { msg (DynamicTemplate("DefaultUseOn", object2, object1)) } = maxstrength and strength>0) { match = ScriptDictionaryItem(dictionary, keywords) maxstrength = strength } } if (match <> null) { parameters = NewObjectDictionary() dictionary add (parameters, "this", object) invoke (match, parameters) handled = true } } if (not handled) { if (HasScript(object, defaultscript)) { d = NewDictionary() dictionary add (d, "text", text) do (object, defaultscript, d) } else { msg (DynamicTemplate(defaulttemplate, object)) } } ]]> keywordlist = Split(keywords, " ") inputlist = Split(input, " ") strength = 0 foreach (word, inputlist) { foreach (keyword, keywordlist) { if (StartsWith(word, keyword)) { strength = strength + LengthOf(keyword) } } } return (strength) game.suppressturnscripts = true game.transcriptstring = game.transcriptstring + data obj = GetBlockingObject(blocked) if (HasString(obj, "blockingmessage")) { return (obj.blockingmessage) } else { return (prefix + DynamicTemplate("ObjectNotOpen", obj)) } set (object, flag, true) set (object, flag, false) if (not HasInt(object, counter)) { set (object, counter, 0) } set (object, counter, GetInt(object, counter) + 1) if (not HasInt(object, counter)) { set (object, counter, 0) } set (object, counter, GetInt(object, counter) - 1) return (GetBoolean(object, "switchedon")) object.parent = game.pov object.parent = parent object.parent = game.pov.parent object.parent = null object.visible = true object.visible = false object.visible = true object.visible = false object.isopen = true object.isopen = false newobject = ShallowClone(object) if (not HasString(object, "alias")) { newobject.alias = object.name } if (not HasAttribute(object, "prototype")) { newobject.prototype = object } foreach (o, GetDirectChildren(object)) { o2 = CloneObject (o) MoveObject (o2, newobject) } return (newobject) newobject = CloneObject(object) newobject.parent = newparent return (newobject) newobject = CloneObject(object) if (HasScript(newobject, "_initialise_")) { do (newobject, "_initialise_") } return (newobject) newobject = CloneObject(object) newobject.parent = game.pov.parent return (newobject) exit.locked = true exit.locked = false object.switchedon = true object.switchedon = false object.dark = true object.dark = false if (LengthOf(strength) = 0) { object.lightsource = false } else { object.lightsource = true } object.lightstrength = strength if (LengthOf(strength) = 0) { exit.lightsource = false } else { exit.lightsource = true } exit.lightstrength = strength object) { game.pov = object if (game.gridmap) { JS.Grid_ClearAllLayers () Grid_Redraw } OnEnterRoom (null) } ]]> request (RequestSave, "") request (Speak, s) " + optionText + "") } EndOutputSection (outputsection) game.menuoptions = options game.menuallowcancel = allowCancel game.menucallback = callback game.menuoutputsection = outputsection ]]> if (game.menucallback = null) { error ("Unexpected menu response") } else { parameters = NewStringDictionary() dictionary add (parameters, "result", UnescapeQuotes(option)) script = game.menucallback ClearMenu if (not GetBoolean(game, "disambiguating")) { game.runturnscripts = true } game.disambiguating = false invoke (script, parameters) FinishTurn } s = Replace(s, "\"", "@@@doublequote@@@") s = Replace(s, "\'", "@@@singlequote@@@") return (s) s = Replace(s, "@@@doublequote@@@", "\"") s = Replace(s, "@@@singlequote@@@", "\'") return (s) 0 and number <= ListCount(game.menuoptionskeys)) { handled = true ShowMenuResponse (StringListItem(game.menuoptionskeys, number - 1)) } } return (handled) ]]> HideOutputSection (game.menuoutputsection) game.menuoutputsection = null game.menuoptions = null game.menucallback = null if (not HasInt(game, "lastoutputsection")) { game.lastoutputsection = 0 } game.lastoutputsection = game.lastoutputsection + 1 name = "section" + game.lastoutputsection JS.StartOutputSection (name) return (name) JS.EndOutputSection (name) JS.HideOutputSection (name) if (HasString(game, "currentturnoutputsection")) { game.lastturnoutputsection = game.currentturnoutputsection EndOutputSection (game.currentturnoutputsection) } game.currentturnoutputsection = StartNewOutputSection() if (HasString(game, "lastturnoutputsection")) { HideOutputSection (game.lastturnoutputsection) } options = NewStringList() list add (options, "Yes") list add (options, "No") game.askcallback = callback ShowMenu (question, options, false) { parameters = NewDictionary() if (result = "Yes") { boolresult = true } else { boolresult = false } dictionary add (parameters, "result", boolresult) callback = game.askcallback game.askcallback = null invoke (callback, parameters) } if (HasObject(object, "key")) { if (not HasInt(object,"keycount")) { object.keycount = 1 object.key1 = object.key } if (not HasObject(object, "key1")) { object.key1 = object.key } } for (x, 1, object.keycount) { keyname = "key" + ToString(x) if (HasObject(object, keyname)) { if (not ListContains(ScopeInventory(), GetAttribute(object, keyname))) { return (false) } } } return (true) create exit (dir, from, to) create exit (ReverseDirection(dir), to, from) if (not TypeOf(value1) = TypeOf(value2)) { return (false) } if (not value1 = value2) { return (false) } return (true) list1 = Split("north;northeast;east;southeast;south;southwest;west;northwest;up;down;in;out", ";") list2 = Split("south;southwest;west;northwest;north;northeast;east;southeast;down;up;out;in", ";") n = IndexOf(list1, dir) if (not n = -1) { return (StringListItem(list2, n)) } return (dir) \\D*)(?\\d+)(?\\D)(?\\d*)(?\\D*)$" if (not IsRegexMatch(regex, control, "DisplayNumber")) { error ("Unexpected format in DisplayNumber (" + control + "). Should be a number, followed by a single character separator, followed by a number.") } options = Populate(regex, control, "DisplayNumber") places = ToInt(StringDictionaryItem(options, "places")) padding = ToInt(StringDictionaryItem(options, "padding")) if (places > 0) { padding = padding + 1 + places } decimal = Replace(Decimalise(n, places), ".", StringDictionaryItem(options, "sep")) return (StringDictionaryItem(options, "before") + PadString(decimal, padding, 0) + StringDictionaryItem(options, "after")) ]]> for (i, 0, ListCount(lst) - 1) { x = ListItem(lst, i) if (x = item) { return (i) } } return (-1) l = NewStringList() foreach (o, list) { if (HasString(o, att)) { list add (l, GetString(o, att)) } } return (l) l = NewObjectList() foreach (o, lst) { if (DoesInherit(o, t)) { list add (l, o) } } return (l) if (not IsDefined("value")) { return (FilterByNotAttribute (lst, name, null)) } l = NewObjectList() foreach (o, lst) { val = GetAttribute(o, name) if (Equal(val, value)) { list add (l, o) } } return (l) if (not IsDefined("value")) { return (FilterByAttribute (lst, name, null)) } l = NewObjectList() foreach (o, lst) { val = GetAttribute(o, name) if (not Equal(val, value)) { list add (l, o) } } return (l) l = NewList() foreach (o, lst) { if (not Equal(o, null)) { if (IndexOf(l, o) = -1) { list add (l, o) } } } return (l) l = NewObjectList() foreach (o, lst) { if (not Equal(o, null)) { if (IndexOf(l, o) = -1) { list add (l, o) } } } return (l) return (FilterByAttribute(AllObjects(),"isroom",true)) if (dict = null or TypeOf(dict)="object") { error ("DictionaryAdd: Dictionary does not exist!") } if (DictionaryContains(dict, key)) { dictionary remove (dict, key) } dictionary add (dict, key, val) if (dict = null or TypeOf(dict)="object") { error ("DictionaryAdd: Dictionary does not exist!") } if (DictionaryContains(dict, key)) { dictionary remove (dict, key) } if (GetBoolean(game,"debugging")) { Log ("DEBUGGING: "+txt) }

DEBUGGING: "+txt+"


") } ]]>
game.notranscript = true JS.eval ("savingTranscript = false;") game.nohtmllog = true d = NewDictionary() dictionary add (d, key1, value1) if (IsDefined("key2")) { dictionary add (d, key2, value2) } if (IsDefined("key3")) { dictionary add (d, key3, value3) } return (d) null) { if (HandleMenuTextResponse(command)) { handled = true } else { if (game.menuallowcancel) { ClearMenu } else { handled = true } } } if (not handled) { StartTurnOutputSection if (StartsWith (command, "*")) { game.suppressturnscripts = true msg ("") msg (SafeXML (command)) msg ("Noted.") FinishTurn } else { shownlink = false if (game.echocommand) { if (metadata <> null and game.enablehyperlinks and game.echohyperlinks) { foreach (key, metadata) { if (EndsWith(command, key)) { objectname = StringDictionaryItem(metadata, key) object = GetObject(objectname) if (object <> null) { msg ("") msg ("> " + Left(command, LengthOf(command) - LengthOf(key)) + "{object:" + object.name + "}") shownlink = true } } } } if (not shownlink) { msg ("") OutputTextRaw ("> " + SafeXML(command)) } } if (game.command_newline) { msg ("") } game.pov.commandmetadata = metadata if (game.multiplecommands) { commands = Split(command, ".") if (ListCount(commands) = 1) { game.pov.commandqueue = null HandleSingleCommand (Trim(command)) } else { game.pov.commandqueue = commands HandleNextCommandQueueItem } } else { game.pov.commandqueue = null HandleSingleCommand (Trim(command)) } } } ]]> 0) { thiscommand = Trim(StringListItem(game.pov.commandqueue, 0)) if (queuelength = 1) { game.pov.commandqueue = null } else { newqueue = NewStringList() for (i, 1, queuelength - 1) { list add (newqueue, StringListItem(game.pov.commandqueue, i)) } game.pov.commandqueue = newqueue } if (LengthOf(thiscommand) > 0) { HandleSingleCommand (thiscommand) } else { HandleNextCommandQueueItem } } } ]]> = maxstrength) { skip = false if (thiscommand <> null) { if (thiscommand.parent <> null and candidate.parent = null) { skip = true } } if (not skip) { thiscommand = candidate maxstrength = strength } } } if (thiscommand = null) { if (HasScript(game, "unresolvedcommandhandler")) { params = NewDictionary() dictionary add (params, "command", command) do (game, "unresolvedcommandhandler", params) } else { msg (Template("UnrecognisedCommand")) } HandleNextCommandQueueItem } else { varlist = Populate(thiscommand.pattern, command, thiscommand.name) HandleSingleCommandPattern (command, thiscommand, varlist) } } ]]> game.pov.currentcommand = command game.pov.currentcommandpattern = thiscommand game.pov.currentcommandvarlist = varlist game.pov.currentcommandvarlistqueue = NewStringList() foreach (key, varlist) { list add (game.pov.currentcommandvarlistqueue, key) } game.pov.currentcommandresolvedelements = NewDictionary() game.pov.currentcommandresolvedobjects = NewObjectList() game.pov.currentcommandunresolvedobject = null game.pov.currentcommandpendingvariable = null ResolveNextName 0) { var = StringListItem(game.pov.currentcommandvarlistqueue, 0) if (queuelength = 1) { game.pov.currentcommandvarlistqueue = null } else { newqueue = NewStringList() for (i, 1, queuelength - 1) { list add (newqueue, StringListItem(game.pov.currentcommandvarlistqueue, i)) } game.pov.currentcommandvarlistqueue = newqueue } value = StringDictionaryItem(game.pov.currentcommandvarlist, var) if (value <> "") { result = null resolvinglist = false if (StartsWith(var, "objectexit")) { result = ResolveName(var, value, "exit") } if (result = null) { if (StartsWith(var, "object")) { if (GetBoolean(game.pov.currentcommandpattern, "allow_all")) { scope = FilterByAttribute(GetScope("object", "", "object"), "scenery", false) game.pov.currentcommandpendingobjectscope = ListExclude(scope, FilterByAttribute(scope, "not_all", true)) game.pov.currentcommandpendingvariable = var ResolveNameList (value, "object") resolvinglist = true } else if (HasScript(game.pov.currentcommandpattern, "multipleobjects")) { game.pov.currentcommandpendingobjectlist = NewObjectList() game.pov.currentcommandpendingvariable = var do (game.pov.currentcommandpattern, "multipleobjects") ResolveNameList (value, "object") resolvinglist = true } else { result = ResolveName(var, value, "object") } } else if (StartsWith(var, "exit")) { result = ResolveName(var, value, "exit") } else if (StartsWith(var, "text")) { result = StringDictionaryItem(game.pov.currentcommandvarlist, var) } else { error ("Unhandled command variable '" + var + "' - command variable names must begin with 'object', 'exit' or 'text'") } } if (result = null) { if ((not resolvinglist) and LengthOf(GetString(game.pov, "currentcommandpendingvariable")) = 0) { UnresolvedCommand (value, var) } } else { AddToResolvedNames (var, result) } } else { ResolveNextName } } else { resolvedall = true } } else if (queuetype = "null") { resolvedall = true } else { error ("Invalid queue type") } if (resolvedall) { game.lastobjects = game.pov.currentcommandresolvedobjects if (not DictionaryContains(game.pov.currentcommandresolvedelements, "multiple")) { dictionary add (game.pov.currentcommandresolvedelements, "multiple", false) } if (not GetBoolean(game.pov.currentcommandpattern, "isundo")) { if (LengthOf(game.pov.currentcommand) > 0) { start transaction (game.pov.currentcommand) } } if (not GetBoolean(game.pov.currentcommandpattern, "isoops")) { game.unresolvedcommand = null game.unresolvedcommandvarlist = null game.unresolvedcommandkey = null } if (HasScript(game.pov.currentcommandpattern, "script")) { do (game.pov.currentcommandpattern, "script", game.pov.currentcommandresolvedelements) } game.runturnscripts = true FinishTurn HandleNextCommandQueueItem } ]]> if (TypeOf(result) = "object") { if (result.type = "object") { list add (game.pov.currentcommandresolvedobjects, result) } } else if (TypeOf(result) = "objectlist") { foreach (obj, result) { if (obj.type = "object") { list add (game.pov.currentcommandresolvedobjects, obj) } } } dictionary add (game.pov.currentcommandresolvedelements, var, result) ResolveNextName null) { if (DictionaryContains(game.pov.commandmetadata, value)) { result = GetObject(StringDictionaryItem(game.pov.commandmetadata, value)) if (result <> null) { if (ListContains(ScopeVisible(), result)) { found = true return (result) } } } } if (not found) { value = LCase(value) result = ResolveNameInternal(variable, value, objtype) if (result <> null) { return (result) } else { foreach (prefix, game.parserignoreprefixes) { if (StartsWith(value, prefix + " ")) { result = ResolveNameInternal(variable, Mid(value, LengthOf(prefix) + 1), objtype) } } if (result = null and LengthOf(variable) = 0 and not GetBoolean(game.pov, "currentcommandmultiobjectpending")) { UnresolvedCommand (value, game.pov.currentcommandpendingvariable) } return (result) } } ]]> game.pov.currentcommandmultiobjectpending = false scope = GetScope(variable, value, objtype) if (HasString(game.pov.currentcommandpattern, "scope")) { secondaryscope = ScopeVisible() } else { secondaryscope = null } return (ResolveNameFromList(variable, value, objtype, scope, secondaryscope)) null) { foreach (altname, obj.alt) { CompareNames (LCase(altname), value, obj, fullmatches, partialmatches) } } } if (objtype = "object" and game.lastobjects <> null) { foreach (obj, game.lastobjects) { CompareNames (LCase(obj.article), value, obj, fullmatches, partialmatches) CompareNames (LCase(obj.gender), value, obj, fullmatches, partialmatches) } } if (ListCount(fullmatches) = 0 and ListCount(partialmatches) = 0 and not secondaryscope = null) { foreach (obj, secondaryscope) { name = LCase(GetDisplayAlias(obj)) CompareNames (name, value, obj, fullmatches, partialmatches) if (obj.alt <> null) { foreach (altname, obj.alt) { CompareNames (LCase(altname), value, obj, fullmatches, partialmatches) } } } } if (ListCount(fullmatches) = 1) { return (ListItem(fullmatches, 0)) } else if (ListCount(fullmatches) = 0 and ListCount(partialmatches) = 1) { return (ListItem(partialmatches, 0)) } else if (ListCount(fullmatches) + ListCount(partialmatches) = 0) { return (null) } else { game.disambiguating = true candidates = ListCompact(ListCombine(fullmatches, partialmatches)) if (LengthOf(variable) > 0) { game.pov.currentcommandpendingvariable = variable ShowMenu (DynamicTemplate("DisambiguateMenu", value), candidates, true) { varname = game.pov.currentcommandpendingvariable game.pov.currentcommandpendingvariable = null if (result <> null) { AddToResolvedNames (varname, GetObject(result)) } } } else { game.pov.currentcommandmultiobjectpending = true ShowMenu (DynamicTemplate("DisambiguateMenu", value), candidates, true) { if (result <> null) { list add (game.pov.currentcommandpendingobjectlist, GetObject(result)) ResolveNextNameListItem } } } return (null) } ]]> game.pov.currentcommandpendingobjectlist = NewObjectList() game.pov.currentcommandpendingobjectlistunresolved = NewStringList() game.pov.currentcommandpendingobjecttype = objtype inputlist = Split(value, ",") foreach (inputbase, inputlist) { inputlist2 = Split(inputbase, " " + Template("And") + " ") foreach (input, inputlist2) { list add (game.pov.currentcommandpendingobjectlistunresolved, input) } } ResolveNextNameListItem 0) { thisitem = Trim(StringListItem(game.pov.currentcommandpendingobjectlistunresolved, 0)) if (queuelength = 1) { game.pov.currentcommandpendingobjectlistunresolved = null } else { newqueue = NewStringList() for (i, 1, queuelength - 1) { list add (newqueue, StringListItem(game.pov.currentcommandpendingobjectlistunresolved, i)) } game.pov.currentcommandpendingobjectlistunresolved = newqueue } ResolveNameListItem (Trim(thisitem)) } else { resolvedall = true } } else { resolvedall = true } if (resolvedall) { ResolveNameListItemFinished (game.pov.currentcommandpendingobjectlist) } ]]> null) { if (not ListContains(game.pov.currentcommandpendingobjectlist, object)) { list add (game.pov.currentcommandpendingobjectlist, object) } ResolveNextNameListItem } } ]]> 1) { if (not DictionaryContains(game.pov.currentcommandresolvedelements, "multiple")) { dictionary add (game.pov.currentcommandresolvedelements, "multiple", true) } } AddToResolvedNames (game.pov.currentcommandpendingvariable, result) ]]> 1) { msg (game.pov.currentcommandpattern.unresolved + " (" + unresolvedobject + ")") } else { msg (game.pov.currentcommandpattern.unresolved) } } else { if (ListCount(game.pov.currentcommandvarlist) > 1) { msg (Template("UnresolvedObject") + " (" + unresolvedobject + ")") } else { msg (Template("UnresolvedObject")) } } game.unresolvedcommand = game.pov.currentcommandpattern game.unresolvedcommandvarlist = game.pov.currentcommandvarlist game.unresolvedcommandkey = unresolvedkey ]]> dictionary = GetAttribute(object, property) if (DictionaryContains(dictionary, object2.name)) { parameters = NewDictionary() dictionary add (parameters, "this", object) dictionary add (parameters, "object", object2) invoke (ScriptDictionaryItem(dictionary, object2.name), parameters) } else { parameters = NewDictionary() dictionary add (parameters, "this", object) dictionary add (parameters, "object", object2) if (DictionaryContains(dictionary, "default")) { invoke (ScriptDictionaryItem(dictionary, "default"), parameters) } else { msg (default) } } 0) { params = NewDictionary() dictionary add (params, "items", items) dictionary add (params, "command", game.pov.currentcommandpattern) dictionary add (params, "variable", variable) dictionary add (params, "objtype", objtype) dictionary add (params, "matched", game.pov.currentcommandresolvedelements) foreach (o, objectswithscripts) { do (o, "changecommandscope", params) } items = ObjectListCompact(items) } return (items) ]]> lst = Split(scopestring, "|") if (ListCount(lst) = 1) { return (scopestring) } foreach (s, lst) { if (StartsWith(s, variable + "=")) { return (Mid(s, LengthOf(variable) + 2)) } } return ("all") 0) { if (not ListContains(partialmatches, obj)) { list add (partialmatches, obj) } } } } ]]> msg ("WARNING: GenerateMenuChoices is deprecated as ShowMenu can handle lists with objects") foreach (obj, objects) { if (not DictionaryContains(dictionary, obj.name)) { dictionary add (dictionary, obj.name, GetDisplayAlias(obj)) } } return (ListExclude(ScopeVisibleNotHeldNotScenery(), game.pov)) return (RemoveLookOnlyExits(RemoveSceneryObjects(ScopeExits()))) result = NewObjectList() foreach (obj, GetAllChildObjects(game.pov)) { if (ContainsVisible(game.pov, obj)) { list add (result, obj) } } return (result) result = NewObjectList() foreach (obj, GetAllChildObjects(game.pov)) { if (ContainsReachable(game.pov, obj)) { list add (result, obj) } } return (result) return (ScopeVisibleNotHeldForRoom(game.pov.parent)) if (room = game.pov.parent) { result = ListCombine(ScopeReachableNotHeldForRoom(room), ScopeVisibleNotReachableForRoom(room)) list add (result, game.pov) return (result) } else { return (ListCombine(ScopeReachableNotHeldForRoom(room), ScopeVisibleNotReachableForRoom(room))) } return (ScopeVisibleNotHeldNotSceneryForRoom(game.pov.parent)) return (RemoveSceneryObjects(ScopeVisibleNotHeldForRoom(room))) return (ScopeReachableForRoom(game.pov.parent)) if (room = game.pov.parent) { result = ListCombine(ScopeReachableNotHeldForRoom(room), ScopeReachableInventory()) list add (result, game.pov) } else { result = ScopeReachableNotHeldForRoom(room) } return (result) return (ScopeVisibleNotReachableForRoom(game.pov.parent)) result = NewObjectList() exclude = ScopeReachableForRoom(room) list add (exclude, game.pov) newParent = GetNonTransparentParent(room) foreach (obj, GetAllChildObjects(newParent)) { if (ContainsVisible(newParent, obj) and not ListContains(exclude, obj)) { list add (result, obj) } } return (result) if (GetBoolean(room, "transparent")) { if (room.parent = null) { return (room) } else { return (GetNonTransparentParent(room.parent)) } } else { return (room) } return (ScopeReachableNotHeldForRoom(game.pov.parent)) result = ScopeVisible() lightobjects = NewObjectList() foreach (obj, result) { if (GetBoolean(obj, "lightsource") and GetString(obj, "lightstrength") = lightstrength) { list add (lightobjects, obj) } } exits = ScopeExits() foreach (obj, exits) { if (GetBoolean(obj, "lightsource") and GetString(obj, "lightstrength") = lightstrength) { list add (lightobjects, obj) } } return (lightobjects) game.pov and not Contains(game.pov, obj)) { list add (result, obj) } } if (HasScript(game, "scopebackdrop")) { dict = NewDictionary() dictionary add (dict, "items", result) do (game, "scopebackdrop", dict) } return (result) ]]> return (ScopeVisibleForRoom(game.pov.parent)) if (room = game.pov.parent) { return (ListCombine(ScopeVisibleNotHeldForRoom(room), ScopeInventory())) } else { return (ScopeVisibleNotHeldForRoom(room)) } return (ScopeExitsForRoom(game.pov.parent)) result = NewObjectList() foreach (exit, AllExits()) { if (exit.parent = room) { if (exit.visible) { if (GetBoolean(room, "darklevel")) { if (GetBoolean(exit, "lightsource")) { list add (result, exit) } } else { list add (result, exit) } } } } return (result) result = NewObjectList() foreach (exit, AllExits()) { if (exit.parent = room) { if (exit.visible and not exit.locked) { if (GetBoolean(room, "darklevel")) { if (GetBoolean(exit, "lightsource")) { list add (result, exit) } } else { list add (result, exit) } } } } return (result) result = NewObjectList() foreach (command, AllCommands()) { if (command.parent = null or command.parent = game.pov.parent) { list add (result, command) } if (not game.pov.parent.parent = null) { if (command.parent = game.pov.parent.parent) { list add (result, command) } } } return (result) result = null foreach (obj, ListParents(obj)) { if (result = null and not CanReachThrough(obj)) { result = obj } } return (result) null) { parent_as_list = NewObjectList() list add (parent_as_list, obj.parent) result = ListCombine(parent_as_list, ListParents(obj.parent)) } return (result) ]]> return (ContainsAccessible(parentObj, searchObj, false)) return (ContainsAccessible(parentObj, searchObj, true)) if (not HasObject(searchObj, "parent")) { return (false) } else if (not searchObj.visible) { return (false) } else if (GetBoolean(parentObj, "darklevel") and not GetBoolean(searchObj, "lightsource")) { return (false) } else { if (searchObj.parent = null) { return (false) } else if (searchObj.parent = parentObj) { return (true) } else { if (onlyReachable) { canAdd = CanReachThrough(searchObj.parent) } else { canAdd = CanSeeThrough(searchObj.parent) } if (canAdd) { return (ContainsAccessible(parentObj, searchObj.parent, onlyReachable)) } else { return (false) } } } result = 0 foreach (object, GetAllChildObjects ( obj )) { if (HasInt(object, "volume")) { result = result + object.volume } } if (allinclusive and HasInt(obj, "volume")) { result = result + obj.volume } return (result) return ((GetBoolean(obj, "transparent") or CanReachThrough(obj)) and not GetBoolean(obj, "hidechildren")) return (GetBoolean(obj, "isopen") and not GetBoolean(obj, "hidechildren")) return (ListContains(ScopeInventory(), obj)) if (game.enablehyperlinks) { data = NewStringDictionary() foreach (object, ScopeVisible()) { dictionary add (data, object.name, Join(GetDisplayVerbs(object), "/")) } JS.updateObjectLinks (data) exits = NewStringList() foreach (exit, ScopeExits()) { list add (exits, exit.name) } JS.updateExitLinks (exits) commands = NewStringList() foreach (cmd, ScopeCommands()) { list add (commands, cmd.name) } JS.updateCommandLinks (commands) } return (NewObjectList()) " + CapFirst(GetDisplayName(game.pov.parent)) + "") } if (game.autodescription_youarein_newline) { msg (desc + "
") desc = "" } } if (i = game.autodescription_youcansee) { objects = FormatObjectList(game.pov.parent.objectslistprefix, GetNonTransparentParent(game.pov.parent), Template("And"), ".") desc = AddDescriptionLine(desc, objects) if (game.autodescription_youcansee_newline) { msg (desc + "
") desc = "" } } if (i = game.autodescription_youcango) { exits = FormatExitList(game.pov.parent.exitslistprefix, GetExitsList(), Template("Or"), ".") desc = AddDescriptionLine(desc, exits) if (game.autodescription_youcango_newline) { msg (desc + "
") desc = "" } } if (i = game.autodescription_description) { if (HasScript(game.pov.parent, descriptionfield)) { if (LengthOf(desc) > 0) { msg (desc) desc = "" } do (game.pov.parent, descriptionfield) if (game.autodescription_description_newline) { msg ("") } } else { desc = AddDescriptionLine(desc, GetRoomDescription()) if (game.autodescription_description_newline) { msg (desc + "
") desc = "" } } } } if (LengthOf(desc) > 0) { msg (desc) } } else { if (HasScript(game.pov.parent, descriptionfield)) { do (game.pov.parent, descriptionfield) } else { fulldesc = GetRoomDescription() if (LengthOf(fulldesc) > 0) { msg (fulldesc) } } } ]]>
0) { if (LengthOf(desc) > 0) { msg (desc) desc = "" } desc = desc + line } return (desc) ]]> 0) { fulldesc = game.pov.parent.darkroomdescription } } if (fulldesc = "") { fulldesc = DynamicTemplate("LookAtDarkness", game.pov.parent) } } else { if (HasString(game.pov.parent, "description")) { if (LengthOf(game.pov.parent.description) > 0) { fulldesc = game.pov.parent.description } } } if (game.appendobjectdescription) { foreach (val, ScopeVisibleNotHeld()) { if (HasString(val, "inroomdescription")) { if (LengthOf(val.inroomdescription) > 0 and val <> game.pov) { fulldesc = fulldesc + " " + val.inroomdescription } } } } return (Trim(fulldesc)) ]]> null) { if (game.clearscreenonroomenter) { ClearScreen if (not game.currentexitmessage = null) { msg (game.currentexitmessage) game.currentexitmessage = null } } if (HasScript(oldRoom, "onexit")) { do (oldRoom, "onexit") } } } on ready { if ((not GetBoolean(game.pov.parent, "visited")) and HasScript(game.pov.parent, "beforefirstenter")) { do (game.pov.parent, "beforefirstenter") } on ready { if (HasScript(game.pov.parent, "beforeenter")) { do (game.pov.parent, "beforeenter") } on ready { if (game.gridmap) { Grid_CalculateMapCoordinates (game.pov.parent, game.pov) Grid_DrawPlayerInRoom (game.pov.parent) } if (IsDefined("oldRoom")) { if (oldRoom <> null and game.changeroom_newline and not game.command_newline) { msg ("") } } JS.updateLocation (CapFirst(GetDisplayName(game.pov.parent))) roomFrameExists = false if (HasString(game.pov.parent, "picture")) { if (LengthOf(game.pov.parent.picture) > 0) { roomFrameExists = true SetFramePicture (game.pov.parent.picture) } } if (game.clearframe and not roomFrameExists) { ClearFramePicture } if (game.showdescriptiononenter) { ShowRoomDescription } if (HasScript( game, "roomenter")) { do (game, "roomenter") } on ready { if ((not GetBoolean(game.pov.parent, "visited")) and HasScript(game.pov.parent, "firstenter")) { do (game.pov.parent, "firstenter") } on ready { if (HasScript(game.pov.parent, "enter")) { do (game.pov.parent, "enter") } } set (game.pov.parent, "visited", true) } } } } ]]> game.pov and obj.visible) { list add (result, obj) } } return (result) ]]> result = NewObjectList() foreach (obj, list) { if (not obj.lookonly) { list add (result, obj) } } return (result) result = NewObjectList() foreach (obj, list) { if (GetBoolean(obj, "lightsource") or obj.parent = game.pov) { list add (result, obj) } } return (result) 0) { count = 0 result = preList + " " foreach (item, list) { result = result + GetDisplayNameLink(item, "exit") count = count + 1 if (count = listLength - 1) { result = result + " " + preFinal + " " } else if (count < listLength) { result = result + ", " } } result = result + postList } return (result) ]]> if (HasString(obj, "alias")) { result = obj.alias } else { result = obj.name } return (result) return (GetDisplayNameLink(obj, "")) null) { verbCount = ListCount(verbs) } else { verbCount = 0 } if (type = "exit" and verbCount = 1) { if (not game.enablehyperlinks) { result = GetDisplayAlias(obj) } else { result = "{exit:" + obj.name + "}" } } else if (type = "") { result = GetDisplayAlias(obj) } else { result = "{object:" + obj.name + "}" } if (not GetBoolean(obj, "usedefaultprefix")) { if (obj.prefix = null) { prefix = "" } else { prefix = obj.prefix } } else if (type = "exit") { prefix = "" } else { prefix = GetDefaultPrefix(obj) } if (LengthOf(prefix) > 0) { prefix = prefix + " " } result = prefix + result if (not GetBoolean(obj, "usedefaultprefix") and HasString(obj, "suffix")) { if (LengthOf(obj.suffix) > 0) { result = result + " " + obj.suffix } } return (result) ]]> return ("{object:" + obj.name + "}") if (HasString(obj, "listalias")) { result = ProcessText(obj.listalias) } else { result = GetDisplayAlias(obj) } return (result) 0) { roomCheckDarkness = false } } else { roomCheckDarkness = false } game.pov.parent.darklevel = roomCheckDarkness return (roomCheckDarkness) ]]> timer.enabled = true timer.trigger = game.timeelapsed + timer.interval timer.enabled = false timer.interval = interval timer.script = script SetTimeoutID (interval, "", script) timername = "" if (name = "") { timername = GetUniqueElementName("timeout") } else { if (GetTimer(name) = null and GetObject(name) = null) { timername = name } else { error ("Error creating timer: There is already an existing object named " + name) } } if (not timername = "") { create timer (timername) timer = GetTimer(timername) SetTimerInterval (timer, interval) timer.timeoutscript = script SetTimerScript (timer) { this.enabled = false invoke (this.timeoutscript) JS.scrollToEnd () destroy (this.name) } EnableTimer (timer) } error ("The Pause function is obsolete as of Quest 5.5") if (IsGameRunning()) { if (game.menucallback = null) { foreach (turnscript, ObjectListSort(AllTurnScripts(), "name")) { if (GetBoolean(turnscript, "enabled")) { inscope = false if (turnscript.parent = game or turnscript.parent = null) { inscope = true } else { if (Contains(turnscript.parent, game.pov)) { inscope = true } } if (inscope) { do (turnscript, "script") } } } } } turnscript.enabled = true turnscript.enabled = false turnscript.script = script SetTurnTimeoutID (turncount, "", script) = this.triggerturncount) { this.enabled = false invoke (this.timeoutscript) destroy (this.name) } } EnableTurnScript (turnscript) } ]]> game.suppressturnscripts = true ")) ]]> if (not statusAttributes = null) { foreach (attr, statusAttributes) { list add (status, FormatStatusAttribute(attr, GetAttribute(element, attr), StringDictionaryItem(statusAttributes, attr))) } } if (LengthOf(format) = 0) { return (CapFirst(attr) + ": " + value) } else { if (TypeOf(value) = "int" and attr = "money" and HasString(game, "moneyformat")) { value = DisplayMoney(value) } else if (TypeOf(value) = "int" or TypeOf(value) = "double") { value = ToString(value) } else if (TypeOf(value) = "null") { value = "" } return (Replace(format, "!", value)) } if (game.showscore) { game.score = 0 if (game.statusattributes = null) { game.statusattributes = NewStringDictionary() } dictionary add (game.statusattributes, "score", "Score: !") } if (game.showhealth) { if (game.povstatusattributes = null) { game.povstatusattributes = NewStringDictionary() } dictionary add (game.povstatusattributes, "health", "Health: !%") } if (game.showmoney) { if (game.povstatusattributes = null) { game.povstatusattributes = NewStringDictionary() } dictionary add (game.povstatusattributes, "money", "Money: !") } if (not HasInt(game, "score")) { error ("Score is not configured. To enable score, go to 'game' and tick 'Show score' on the Player tab.") } game.score = game.score + amount if (not HasInt(game, "score")) { error ("Score is not configured. To enable score, go to 'game' and tick 'Show score' on the Player tab.") } game.score = game.score - amount if (not HasInt(game.pov, "health")) { error ("Health is not configured. To enable health, go to 'game' and tick 'Show health' on the Player tab.") } game.pov.health = game.pov.health + amount if (not HasInt(game.pov, "health")) { error ("Health is not configured. To enable health, go to 'game' and tick 'Show health' on the Player tab.") } game.pov.health = game.pov.health - amount if (not HasInt(game.pov, "money")) { error ("Money is not configured. To enable money, go to 'game' and tick 'Show money' on the Player tab.") } game.pov.money = game.pov.money + amount if (not HasInt(game.pov, "money")) { error ("Money is not configured. To enable money, go to 'game' and tick 'Show money' on the Player tab.") } game.pov.money = game.pov.money - amount OutputTextRaw (ProcessText(text)) " + text + "
") if (GetString(game, "commandbarformat") <> format) { ResetCommandBarFormat } RequestSpeak (text) ]]>
format = GetCurrentTextFormat("") + ";background:" + game.defaultbackground game.commandbarformat = format JS.setCommandBarStyle (format) OutputTextRawNoBr (ProcessText(text)) " + text + "") RequestSpeak (text) ]]> 0) { style = style + "font-family:" + font + ";" } if (LengthOf(colour) = 0) { if (UIOptionUseGameColours()) { colour = game.defaultforeground } else { colour = GetUIOption("OverrideForeground") } } if (LengthOf(colour) > 0) { style = style + "color:" + colour + ";" } if (UIOptionUseGameFont()) { size = game.defaultfontsize } else { size = ToDouble(GetUIOption("OverrideFontSize")) } if (size > 0) { style = style + "font-size:" + ToString(size) + "pt;" } return (style) ]]> return (GetCurrentTextFormat(GetLinkTextColour())) value = GetUIOption("UseGameFont") if (value = null or value = "true") { return (true) } else { return (false) } value = GetUIOption("UseGameColours") if (value = null or value = "true") { return (true) } else { return (false) } params = NewDictionary() if (not game.text_processor_this = null) { dictionary add (params, "this", game.text_processor_this) } if (HasAttribute(game, "text_processor_variables")) { foreach (key, game.text_processor_variables) { if (not key = "this" or game.text_processor_this = null) { dictionary add (params, key, DictionaryItem(game.text_processor_variables, key)) } } } return (params) if (not game.text_processor_this = null and objectname = "this") { object = game.text_processor_this if (TypeOf(object) = "object") { return (object) } } if (not game.text_processor_variables = null and DictionaryContains (game.text_processor_variables, objectname)) { object = DictionaryItem(game.text_processor_variables, objectname) if (TypeOf(object) = "object") { return (object) } } return (GetObject(objectname)) if (UIOptionUseGameColours()) { return (game.defaultlinkforeground) } else { return (GetUIOption("OverrideLinkForeground")) } data = NewDictionary() dictionary add (data, "fulltext", text) text = ProcessTextSection(text, data) return (Replace(Replace(text, "@@@open@@@", "{"), "@@@close@@@", "}")) 0) { nestCount = 1 searchStart = open + 1 finished = false while (not finished) { nextOpen = Instr(searchStart, text, "{") nextClose = Instr(searchStart, text, "}") if (nextClose > 0) { if (nextOpen > 0 and nextOpen < nextClose) { nestCount = nestCount + 1 searchStart = nextOpen + 1 } else { nestCount = nestCount - 1 searchStart = nextClose + 1 if (nestCount = 0) { close = nextClose containsUnprocessedSection = true finished = true } } } else { finished = true } } } if (containsUnprocessedSection) { section = Mid(text, open + 1, close - open - 1) value = ProcessTextCommand(section, data) value = ProcessTextSection(value, data) text = Left(text, open - 1) + value + ProcessTextSection(Mid(text, close + 1), data) } return (text) ]]> params = NewDictionary() dictionary add (params, "section", section) dictionary add (params, "data", data) foreach (command, game.textprocessorcommands) { if (StartsWith(section, command)) { invoke (ScriptDictionaryItem(game.textprocessorcommands, command), params) if (HasString(game, "textprocessorcommandresult")) { result = game.textprocessorcommandresult game.textprocessorcommandresult = null return (result) } } } dot = Instr(section, ".") if (dot = 0) { return ("@@@open@@@" + ProcessTextSection(section, data) + "@@@close@@@") } else { objectname = Left(section, dot - 1) attributename = Mid(section, dot + 1) object = ObjectForTextProcessor(objectname) if (object = null) { return ("@@@open@@@" + ProcessTextSection(section, data) + "@@@close@@@") } else { if (HasAttribute(object, attributename)) { type = TypeOf(object, attributename) switch (type) { case ("string") { return (ToString(GetAttribute(object, attributename))) } case ("int") { return (ToString(GetAttribute(object, attributename))) } case ("double") { return (ToString(GetAttribute(object, attributename))) } case ("boolean") { result = GetAttribute(object, attributename) if (result) { return ("true") } else { return ("false") } } default { return ("(" + type + ")") } } } else { return ("") } } } if (StartsWith(section, "=")) { section = Mid(section, 2) } else { section = Mid(section, 6) } if (not IsRegexMatch("[^\\w\\s]", section, "tp_punctuation_check")) { section = section + "()" } return (ToString(eval(section))) command = Mid(section, 8) l = Tsplit(command) if (ListCount(l) = 1) { return ("@@@open@@@either " + command + "@@@close@@@") } condition = StringListItem(l, 0) text = StringListItem(l, 1) if (ListCount(l) = 2) { sep = Instr(text, "|") if (sep = 0) { text2 = "" } else { text2 = Mid(text, sep + 1) text = Replace(text, "|" + text2, "") } } else { text2 = StringListItem(l, 2) } result = eval(condition, ParamsForTextProcessor()) if (result) { return (ProcessTextSection(text, data)) } else { if (text2 = "") { return ("") } else { return (ProcessTextSection(text2, data)) } } if (StartsWith(section, "here")) { flag = true command = Mid(section, 6) } else { flag = false command = Mid(section, 9) } colon = Instr(command, ":") if (colon = 0) { return ("@@@open@@@" + section + "@@@close@@@") } else { text = Mid(command, colon + 1) condition = Left(command, colon - 1) object = Eval(condition, ParamsForTextProcessor()) if (object = null) { return ("@@@open@@@" + section + "@@@close@@@") } if (object.parent = game.pov.parent and flag) { return (ProcessTextSection(text, data)) } else if (not object.parent = game.pov.parent and not flag) { return (ProcessTextSection(text, data)) } else { return ("") } } 0) { operatorlength = 2 } if (operator = 0) { operator = Instr(condition, ">=") if (operator <> 0) { operatorlength = 2 } } if (operator = 0) { operator = Instr(condition, "<>") if (operator <> 0) { operatorlength = 2 } } if (operator = 0) { operator = Instr(condition, "<") if (operator <> 0) { operatorlength = 1 } } if (operator = 0) { operator = Instr(condition, ">") if (operator <> 0) { operatorlength = 1 } } if (operator = 0) { operator = Instr(condition, "=") if (operator <> 0) { operatorlength = 1 } } if (operator = 0) { checkfor = true if (StartsWith(condition, "not ")) { checkfor = false condition = Mid(condition, 5) } dot = Instr(condition, ".") if (dot = 0) { result = GetBoolean(game, condition) } else { objectname = Left(condition, dot - 1) attributename = Mid(condition, dot + 1) object = ObjectForTextProcessor(objectname) if (object = null) { result = false } else { result = GetBoolean(object, attributename) } } if (result = checkfor) { return (ProcessTextSection(text, data)) } else { return ("") } } else { lhs = Left(condition, operator - 1) rhs = Mid(condition, operator + operatorlength) op = Mid(condition, operator, operatorlength) dot = Instr(lhs, ".") if (dot = 0) { objectname = "" attributename = "" if (HasInt(game, lhs)) { objectname = "game" attributename = lhs } else { return ("@@@open@@@if " + command + "@@@close@@@") } } else { objectname = Left(lhs, dot - 1) attributename = Mid(lhs, dot + 1) } object = ObjectForTextProcessor(objectname) if (object = null) { return ("@@@open@@@if " + command + "@@@close@@@") } else if (not HasAttribute(object, attributename)) { return ("@@@open@@@if " + command + "@@@close@@@") } else { value = GetAttribute(object, attributename) if (TypeOf(value) = "object") { value = value.name } if (op = "=") { if (ToString(value) = rhs) { return (ProcessTextSection(text, data)) } else { return ("") } } else if (op = "<>") { if (not ToString(value) = rhs) { return (ProcessTextSection(text, data)) } else { return ("") } } else if (op = ">") { if (ToDouble(ToString(value)) > ToDouble(rhs)) { return (ProcessTextSection(text, data)) } else { return ("") } } else if (op = "<") { if (ToDouble(ToString(value)) < ToDouble(rhs)) { return (ProcessTextSection(text, data)) } else { return ("") } } else if (op = ">=") { if (ToDouble(ToString(value)) >= ToDouble(rhs)) { return (ProcessTextSection(text, data)) } else { return ("") } } else if (op = "<=") { if (ToDouble(ToString(value)) <= ToDouble(rhs)) { return (ProcessTextSection(text, data)) } else { return ("") } } } } } ]]> " + section + "", data)) ]]> " + s + "", data)) } else { return (ProcessTextSection("" + s + "", data)) } ]]> " + s1 + "" return (ProcessTextSection(s, data)) ]]> 0) { text = Mid(objectname, colon + 1) objectname = Left(objectname, colon - 1) } object = ObjectForTextProcessor(objectname) if (object = null) { return ("@@@open@@@" + ProcessTextSection(section, data) + "@@@close@@@") } else { if (LengthOf(text) = 0) { text = SafeXML(GetDisplayAlias(object)) } if (game.enablehyperlinks) { linkid = ProcessTextCommand_GetNextLinkId() colour = "" if (HasString(object, "linkcolour") and GetUIOption("UseGameColours") = "true") { colour = object.linkcolour } else { colour = GetLinkTextColour() } style = GetCurrentTextFormat(colour) return ("" + text + "") } else { return (text) } } ]]> if (not HasInt(game, "lastlinkid")) { game.lastlinkid = 0 } game.lastlinkid = game.lastlinkid + 1 return ("verblink" + game.lastlinkid) 0) { text = Mid(command, colon + 1) command = Left(command, colon - 1) } style = GetCurrentLinkTextFormat() candidates = NewObjectList() foreach (cmd, ScopeCommands()) { if (IsRegexMatch(cmd.pattern, command, cmd.name)) { list add (candidates, cmd) } } elementid = "" if (ListCount(candidates) = 1) { cmd = ObjectListItem(candidates, 0) elementid = cmd.name } linkid = ProcessTextCommand_GetNextLinkId() dataattrs = "" if (game.deactivatecommandlinks) { dataattrs = dataattrs + "data-deactivateonclick=\"true\" " } dataattrs = dataattrs + "data-command=\"" + command + "\"" return ("" + ProcessTextSection(text, data) + "") ]]> " + alias + "") } ]]> if (not HasAttribute(game, "textprocessor_seen")) { game.textprocessor_seen = NewDictionary() } fulltext = StringDictionaryItem(data, "fulltext") if (not DictionaryContains(game.textprocessor_seen, fulltext)) { onceSectionsInThisText = NewList() dictionary add (game.textprocessor_seen, fulltext, onceSectionsInThisText) } else { onceSectionsInThisText = DictionaryItem(game.textprocessor_seen, fulltext) } if (not ListContains(onceSectionsInThisText, section)) { list add (onceSectionsInThisText, section) return (ProcessTextSection(Mid(section, 6), data)) } else { return ("") } if (not HasAttribute(game, "textprocessor_seen")) { game.textprocessor_seen = NewDictionary() } fulltext = StringDictionaryItem(data, "fulltext") if (not DictionaryContains(game.textprocessor_seen, fulltext)) { onceSectionsInThisText = NewList() dictionary add (game.textprocessor_seen, fulltext, onceSectionsInThisText) } else { onceSectionsInThisText = DictionaryItem(game.textprocessor_seen, fulltext) } if (not ListContains(onceSectionsInThisText, section)) { list add (onceSectionsInThisText, section) return ("") } else { return (ProcessTextSection(Mid(section, 10), data)) } elements = Mid(section, 8) elementslist = Tsplit(elements) index = GetRandomInt(0, ListCount(elementslist) - 1) return (ProcessTextSection(ListItem(elementslist, index), data)) = sections) { item = Mid(splittext, startpos, i - startpos) list add (itemlist, item) startpos = i + 1 } } item = Mid(splittext, startpos) list add (itemlist, item) return (itemlist) ]]> 0) { return (ListItem(object.alt, GetRandomInt(0, count - 1))) } else { return ("") } } ]]> ") ]]> section = Mid(section, 9) if (HasAttribute(game, section)) { return (ToString(GetAttribute(game, section))) } else { return ("0") } 0) { elementslist = Split(Join(elementslist, ":"), "|") } index = GetInt(object, StringListItem(objectandattlist, 1)) if ((0 > index) or (index >= Listcount(elementslist))) { return ("@@@open@@@" + ProcessTextSection(section, data) + "@@@close@@@") } else { return (ProcessTextSection(ListItem(elementslist, index), data)) } } } ]]> ") game.panelcontents = filename ]]> JS.setPanelContents ("") game.panelcontents = null JS.clearScreen () game.defaultforeground = colour JS.setBackground (colour) game.defaultbackground = colour game.defaultlinkforeground = colour game.defaultfont = font game.defaultwebfont = "" AddExternalStylesheet ("https://fonts.googleapis.com/css?family=" + Replace(font, " ", "+")) game.defaultwebfont = font if (game.externalstylesheets = null) { game.externalstylesheets = NewStringList() } if (not ListContains(game.externalstylesheets, stylesheet)) { list add (game.externalstylesheets, stylesheet) JS.addExternalStylesheet (stylesheet) } game.defaultfontsize = size SetAlignment ("center") msg (text) SetAlignment ("left") JS.AddYouTube (id) JS.AddVimeo (id) 0) { url = Mid(url, pos + 3) } if (https) { url = "https://" + url } else { url = "http://" + url } msg ("" + text + "") ]]> " + text + "") ]]> return ("{command:" + cmd + ":" + text + "}") JS.SetBackgroundImage (GetFileURL(filename)) game.backgroundimage = filename JS.SetBackgroundOpacity (opacity) game.backgroundopacity = opacity game.setbackgroundopacity = true " } else { result = "
    " } foreach (item, list) { result = result + "
  • " + item + "
  • " } if (numbers) { result = result + "" } else { result = result + "
" } msg (result) ]]>
JS.createNewDiv (align) if (game.defaultwebfont = null) { return (game.defaultfont) } else { if (game.defaultwebfont = "") { return (game.defaultfont) } else { return ("'" + game.defaultwebfont + "', " + game.defaultfont) } } = a) { result = result + r n = n - a } } return (result) ]]> JS.Grid_SetScale (scale) null) { if (room.grid_parent_offset_auto) { room.grid_parent_offset_x = (room.parent.grid_width - room.grid_width) /2.0 room.grid_parent_offset_y = (room.parent.grid_length - room.grid_length) /2.0 } Grid_SetGridCoordinateForPlayer (playerobject, room.parent, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") - room.grid_parent_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, room.parent, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") - room.grid_parent_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, room.parent, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) room.parent.grid_render = true Grid_CalculateMapCoordinates (room.parent, playerobject) } foreach (exit, AllExits()) { if (exit.parent = room and not GetBoolean(exit, "lookonly")) { if (DoesInherit(exit, "northdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width/2.0 + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.to.grid_width/2.0) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", (Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.to.grid_length) - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.grid_length) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "eastdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length/2.0 + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.to.grid_length/2.0) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y")) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "southdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width/2.0 + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.to.grid_width/2.0) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") + exit.grid_length) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "westdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length/2.0 + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", (Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.to.grid_width) - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.to.grid_length/2.0) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y")) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "northwestdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", (Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.to.grid_width) - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", (Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.to.grid_length) - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.grid_length) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "northeastdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", (Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.to.grid_length) - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") - exit.grid_length) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "southwestdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", (Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.to.grid_width) - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") - exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") + exit.grid_length) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "southeastdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_x", Grid_GetGridCoordinateForPlayer(playerobject, exit, "x") + exit.grid_length) Grid_SetGridCoordinateForPlayer (playerobject, exit, "end_y", Grid_GetGridCoordinateForPlayer(playerobject, exit, "y") + exit.grid_length) exit.grid_render = true exit.to.grid_render = true } else if (DoesInherit(exit, "updirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width/2.0 - exit.to.grid_width/2.0 + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length/2.0 - exit.to.grid_length/2.0 + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z") + exit.grid_length) exit.grid_render = false exit.to.grid_render = true } else if (DoesInherit(exit, "downdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width/2.0 - exit.to.grid_width/2.0 + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length/2.0 - exit.to.grid_length/2.0 + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z") - exit.grid_length) exit.grid_render = false exit.to.grid_render = true } else if (DoesInherit(exit, "indirection") or DoesInherit(exit, "outdirection")) { Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "x", Grid_GetGridCoordinateForPlayer(playerobject, room, "x") + room.grid_width/2.0 - exit.to.grid_width/2.0 + exit.grid_offset_x) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "y", Grid_GetGridCoordinateForPlayer(playerobject, room, "y") + room.grid_length/2.0 - exit.to.grid_length/2.0 + exit.grid_offset_y) Grid_SetGridCoordinateForPlayer (playerobject, exit.to, "z", Grid_GetGridCoordinateForPlayer(playerobject, room, "z")) exit.grid_render = false exit.to.grid_render = true } } } ]]> if (room.grid_render) { Grid_DrawRoom (room, false, game.pov) player_x = Grid_GetGridCoordinateForPlayer(game.pov, room, "x") + room.grid_width/2.0 player_y = Grid_GetGridCoordinateForPlayer(game.pov, room, "y") + room.grid_length/2.0 player_z = Grid_GetGridCoordinateForPlayer(game.pov, room, "z") JS.Grid_DrawPlayer (player_x, player_y, player_z, 5, "black", 2, "yellow") } null) { Grid_DrawRoom (room.parent, redraw, playerobject) } JS.Grid_DrawBox (Grid_GetGridCoordinateForPlayer(game.pov, room, "x"), Grid_GetGridCoordinateForPlayer(game.pov, room, "y"), Grid_GetGridCoordinateForPlayer(game.pov, room, "z"), room.grid_width, room.grid_length, room.grid_border, room.grid_borderwidth, room.grid_fill, room.grid_bordersides) if (LengthOf(room.grid_label) > 0) { label_x = Grid_GetGridCoordinateForPlayer(game.pov, room, "x") + room.grid_width/2.0 label_y = (Grid_GetGridCoordinateForPlayer(game.pov, room, "y") + room.grid_length/2.0) - 0.5 JS.Grid_DrawLabel (label_x, label_y, Grid_GetGridCoordinateForPlayer(game.pov, room, "z"), room.grid_label, room.grid_label_colour) } foreach (exit, AllExits()) { if (exit.grid_render and exit.parent = room and exit.grid_length > 0) { Grid_DrawLine (Grid_GetGridCoordinateForPlayer(game.pov, exit, "x"), Grid_GetGridCoordinateForPlayer(game.pov, exit, "y"), Grid_GetGridCoordinateForPlayer(game.pov, exit, "end_x"), Grid_GetGridCoordinateForPlayer(game.pov, exit, "end_y"), game.mapexitcolour, game.mapexitwidth) } } Grid_SetRoomBooleanForPlayer (playerobject, room, "grid_isdrawn", true) } } ]]> if (visible) { JS.Grid_ShowCustomLayer (true) } else { JS.Grid_ShowCustomLayer (false) } JS.Grid_ClearCustomLayer () JS.Grid_DrawLine (x1, y1, x2, y2, border, borderWidth) JS.Grid_DrawArrow (id, x1, y1, x2, y2, border, borderWidth) JS.Grid_DrawGridLines (x1, y1, x2, y2, border) JS.Grid_SetCentre (x, y) JS.Grid_DrawSquare (id, x, y, width, height, text, fill) JS.Grid_LoadSvg (data, id) JS.Grid_DrawSvg (id, symbolid, x, y, width, height) JS.Grid_DrawImage (id, url, x, y, width, height) JS.Grid_AddNewShapePoint (x, y) JS.Grid_DrawShape (id, border, fill, opacity) parameters = Split(parameterstring, ";") x = ToInt(StringListItem(parameters, 0)) y = ToInt(StringListItem(parameters, 1)) GridSquareClick (x, y) foreach (object, AllObjects()) { if (Grid_GetRoomBooleanForPlayer(game.pov, object, "grid_isdrawn")) { Grid_DrawRoom (object, true, game.pov) } } coordinates = Grid_GetPlayerCoordinatesForRoom(playerobject, room) if (DictionaryContains(coordinates, coordinate)) { dictionary remove (coordinates, coordinate) } dictionary add (coordinates, coordinate, value * 1.0) coordinates = Grid_GetPlayerCoordinatesForRoom(playerobject, room) return (DictionaryItem(coordinates, coordinate)) datadictionary = Grid_GetPlayerCoordinatesForRoom(playerobject, room) if (DictionaryContains(datadictionary, coordinate)) { dictionary remove (datadictionary, coordinate) } dictionary add (datadictionary, coordinate, value) coordinatedata = Grid_GetPlayerCoordinateDictionary(playerobject) if (not DictionaryContains(coordinatedata, room.name)) { return (false) } else { datadictionary = Grid_GetPlayerCoordinatesForRoom(playerobject, room) if (DictionaryContains(datadictionary, attribute)) { return (DictionaryItem(datadictionary, attribute)) } else { return (false) } } if (HasAttribute(playerobject, "grid_coordinates_delegate")) { return (Grid_GetPlayerCoordinateDictionary(playerobject.grid_coordinates_delegate)) } else { if (not HasAttribute(playerobject, "grid_coordinates")) { playerobject.grid_coordinates = NewDictionary() Grid_SetGridCoordinateForPlayer (playerobject, playerobject.parent, "x", 0) Grid_SetGridCoordinateForPlayer (playerobject, playerobject.parent, "y", 0) Grid_SetGridCoordinateForPlayer (playerobject, playerobject.parent, "z", 0) playerobject.parent.grid_render = true Grid_CalculateMapCoordinates (playerobject.parent, playerobject) } return (playerobject.grid_coordinates) } coordinatedata = Grid_GetPlayerCoordinateDictionary(playerobject) if (not DictionaryContains(coordinatedata, room.name)) { dictionary add (coordinatedata, room.name, NewDictionary()) } return (DictionaryItem(coordinatedata, room.name)) game.pov and HasAttribute(obj, "grid_coordinates")) { objcoordinateowner = GetCoordinateOwner(obj) if (coordinateowner <> objcoordinateowner) { MapPOVCoordinates (objcoordinateowner, coordinateowner) } } } ]]> if (HasAttribute(playerobject, "grid_coordinates_delegate")) { return (GetCoordinateOwner(playerobject.grid_coordinates_delegate)) } else { return (playerobject) } sourcecoordinates = Grid_GetPlayerCoordinateDictionary(source) targetcoordinates = Grid_GetPlayerCoordinateDictionary(target) xoffset = Grid_GetGridCoordinateForPlayer(target, game.pov.parent, "x") - Grid_GetGridCoordinateForPlayer(source, game.pov.parent, "x") yoffset = Grid_GetGridCoordinateForPlayer(target, game.pov.parent, "y") - Grid_GetGridCoordinateForPlayer(source, game.pov.parent, "y") zoffset = Grid_GetGridCoordinateForPlayer(target, game.pov.parent, "z") - Grid_GetGridCoordinateForPlayer(source, game.pov.parent, "z") foreach (roomname, sourcecoordinates) { coordinatedata = DictionaryItem(sourcecoordinates, roomname) if (not DictionaryContains(targetcoordinates, roomname)) { newroomdata = NewDictionary() dictionary add (targetcoordinates, roomname, newroomdata) MapPOVCoordinate (coordinatedata, newroomdata, "x", xoffset) MapPOVCoordinate (coordinatedata, newroomdata, "y", yoffset) MapPOVCoordinate (coordinatedata, newroomdata, "z", zoffset) MapPOVCoordinate (coordinatedata, newroomdata, "end_x", xoffset) MapPOVCoordinate (coordinatedata, newroomdata, "end_y", yoffset) } else { newroomdata = DictionaryItem(targetcoordinates, roomname) } if (DictionaryContains(coordinatedata, "grid_isdrawn")) { if (DictionaryContains(newroomdata, "grid_isdrawn")) { dictionary remove (newroomdata, "grid_isdrawn") } dictionary add (newroomdata, "grid_isdrawn", DictionaryItem(coordinatedata, "grid_isdrawn")) } } source.grid_coordinates_delegate = target Grid_Redraw Grid_DrawPlayerInRoom (game.pov.parent) if (DictionaryContains(sourcedata, name)) { value = DictionaryItem(sourcedata, name) dictionary add (targetdata, name, value + offset) } 0) { sides = ToInt(Mid(dice, p1 + 1, p2 - p1 - 1)) total = ToInt(Mid(dice, p2 + 1, p3 - p2)) } else if (p4 > 0) { sides = ToInt(Mid(dice, p1 + 1, p4 - p1 - 1)) total = -ToInt(Mid(dice, p4 + 1, p3 - p2)) } else { sides = ToInt(Mid(dice, p1 + 1, p3 - p1)) total = 0 } for (i, 1, number) { total = total + GetRandomInt(1, sides) } return (total) ]]> n = ListCount(lst) if (n = 0) { return (null) } index = GetRandomInt(0, n - 1) return (ObjectListItem(lst, index)) if (TypeOf(lst) = "string") { lst = Split(lst, ";") } n = ListCount(lst) if (n = 0) { return ("") } index = GetRandomInt(0, n - 1) return (StringListItem(lst, index)) return (PickOneObject(GetDirectChildren(obj))) l = NewObjectList() foreach (o, GetDirectChildren(room)) { if (DoesInherit(o, typename)) { list add (l, o) } } return (PickOneObject(l)) return (PickOneObject(ScopeExitsForRoom (room))) return (PickOneObject(ScopeUnlockedExitsForRoom (room))) TextFX_Typewriter_Internal (text, speed, GetCurrentFontFamily(), game.defaultforeground, game.defaultfontsize) JS.TextFX.Typewriter (text, speed, font, color, size) TextFX_Unscramble_Internal (text, speed, reveal, GetCurrentFontFamily(), game.defaultforeground, game.defaultfontsize) JS.TextFX.Unscramble (text, speed, reveal, font, color, size) object.wear_layer or obj.wear_layer = 0 or object.wear_layer = 0) { msg (DynamicTemplate("CannotWearOver", obj)) return (false) } if (obj.wear_layer = object.wear_layer) { msg (DynamicTemplate("CannotWearWith", obj)) return (false) } } if (not TestGarment(object)) { return (false) } WearGarment (object) if (object.wearmsg = null) { P (DynamicTemplate("WearSuccessful",object)) } else { P (object.wearmsg) } if (HasScript(object, "onafterwear")) { do (object, "onafterwear") } else if (HasString(object, "onafterwear")) { P (object.onafterwear) } AfterWear return (true) ]]> if (GetBoolean(object, "multistate")) { object.multistate_status = 1 } else { object.multistate_status = 0 } if (object.alias = null) { object.alias = object.name } if (object.listalias = null) { object.listalias = object.alias } if (object.original_alias = null) { object.original_drop = object.drop object.original_alias = object.alias object.original_listalias = object.listalias object.original_bonusatts = object.bonusatts object.original_wearslots = object.wear_slots object.display = GetDisplayAlias(object) } object.parent = _GetWornClothingLocation() object.worn = True object.drop = false _SetGarmentAlias (object) _SetMultistate (object) SetVerbs SetBonuses (object, true) if (HasInt(game.pov, "maxobjects")) { game.pov.maxobjects = game.pov.maxobjects + 1 } if (GetBoolean(object, "multistate")) { if (not HasAttribute(object, "multistate_descriptors")) { error ("No descriptors for multistate clothing: " + object.name) } if (not HasAttribute(object, "multistate_verbs")) { error ("No verbs for multistate clothing: " + object.name) } if (not HasAttribute(object, "multistate_wearslots")) { error ("No wearslots for multistate clothing: " + object.name) } statecount = ListCount(object.multistate_descriptors) if (not statecount = ListCount(object.multistate_verbs)) { error ("Mismatch in lists for multistate clothing: " + object.name) } if (not statecount = ListCount(object.multistate_wearslots)) { error ("Mismatch in lists for multistate clothing: " + object.name) } object.original_wearslots = object.wear_slots } = game.pov.maxobjects) { msg (DynamicTemplate("MaxObjectsInInventory", object)) return (false) } } obj = _GetOuterForGarment(game.pov, object) if (not obj = null) { if (obj.wear_layer > object.wear_layer) { msg (DynamicTemplate("RemoveFirst", obj)) return (false) } } if (not TestRemove(object)) { return (false) } RemoveGarment (object) if (object.removemsg = null) { P (DynamicTemplate("RemoveSuccessful",object)) } else { P (object.removemsg) } if (HasScript(object, "onafterremove")) { do (object, "onafterremove") } else if (HasString(object, "onafterremove")) { P (object.onafterremove) } AfterRemove return (true) ]]> ")) { object.listalias = null do (object, "colourmylistalias") } else { object.listalias = object.original_listalias } } object.parent = game.pov if (HasInt(game.pov, "maxobjects")) { game.pov.maxobjects = game.pov.maxobjects - 1 } SetVerbs ]]> sl = NewStringList() foreach (o, AllObjects()) { if (HasAttribute(o, "wear_slots")) { foreach (s, o.wear_slots) { if (not ListContains(sl, s)) { list add (sl, s) } } } } return (sl) 0) { prefix = prefix + " " } if (HasString(obj, "original_alias")) { result = prefix + obj.original_alias } else { result = prefix + obj.alias } if (not GetBoolean(obj, "usedefaultprefix") and HasString(obj, "suffix")) { if (LengthOf(obj.suffix) > 0) { result = result + " " + obj.suffix } } return (result) ]]> if (object.multistate_status = 0) { return (" (" + object.wornmodifier + ")") } s = StringListItem(object.multistate_descriptors, object.multistate_status - 1) if (s = "*") { return (" (" + object.wornmodifier + ")") } return (" (" + object.wornmodifier + " " + s + ")") ListCount(object.multistate_descriptors)) { error ("Attempt to set state to " + state + " for " + object.name + " (max " + ListCount(object.multistate_descriptors) + ")") } if (not object.multistate_status = state) { SetBonuses (object, false) object.multistate_status = state _SetGarmentAlias (object) _SetMultistate (object) SetBonuses (object, true) SetVerbs } ]]> garment.wear_layer) { garment = o } } return (garment) ]]> return (_GetList(char, null)) ol = newObjectList() foreach (s, Slots()) { o = GetOuterFor(char, s) if (not o = null and not ListContains(ol, o)) { list add (ol, o) } } return (ol) total = 2 * _GetSlotArmour(char, "head") + 3 * _GetSlotArmour(char, "torso") foreach (s, Split("feet|legs|shoulders|arms|hands", "|")) { total = total + _GetSlotArmour(char, s) } return (total) return (GetOuterFor(game.pov, slot)) return (GetArmourFor(game.pov)) foreach (o, GetAllChildObjects(game.pov)) { if (DoesInherit(o, "wearable")) { if (HasAttribute(o, "wear_adjverbs")) { if (o.wear_adjverbs) { if (HasAttribute(o, "wear_slots") and HasInt(o, "wear_layer")) { _SetVerbsForGarment (o) } if (not HasString(o, "alias")) { o.alias = o.name } if (not HasString(o, "listalias")) { o.listalias = o.alias } } } } } count = 0 foreach (o, GetAllChildObjects(game.pov)) { if (GetBoolean(o, "worn")) { count = count + 1 } } return (count) l = NewStringList() foreach (obj, ListWornFor(game.pov)) { list add (l, GetDisplayGarment(obj)) } return (FormatList(l, ",", "and", "nothing")) if (HasString(garment, "bonusatts")) { foreach (att, Split(garment.bonusatts, ";")) { bonus = 1 plusarray = Split(att, "+") minusarray = Split(att, "-") if (ListCount(plusarray) = 2) { att = StringListitem(plusarray, 0) if (not IsInt(StringListitem(plusarray, 1))) { error ("Bonus attribute for " + garment.name + " not properly formatted: " + garment.bonusatts) } bonus = ToInt(StringListitem(plusarray, 1)) } if (ListCount(minusarray) = 2) { att = StringListitem(minusarray, 0) if (not IsInt(StringListitem(minusarray, 1))) { error ("Negative bonus attribute for " + garment.name + " not properly formatted: " + garment.bonusatts) } bonus = -ToInt(StringListitem(minusarray, 1)) } if (not wearflag) { bonus = -bonus } bonus = ClothingBonusMultiplier() * bonus n = GetInt(game.pov, att) + bonus set (player, att, n) } } SetListAlias (object, alias, alias) object.alias = alias object.listalias = listalias if (Equal(object.worn, true)) { object.original_alias = object.alias object.original_listalias = object.listalias object.display = GetDisplayAlias(object) _SetGarmentAlias (object) } if (GetBoolean(object, "multistate")) { ws = StringListItem(object.multistate_wearslots, object.multistate_status - 1) if (ws = "*") { object.wear_slots = object.original_wearslots } else { object.wear_slots = Split(ws, ";") } wv = StringListItem(object.multistate_verbs, object.multistate_status - 1) if (wv = "*") { object.wornverbs = null } else { object.wornverbs = wv } ba = StringListItem(object.multistate_bonusatts, object.multistate_status - 1) if (ba = "*") { object.bonusatts = object.original_bonusatts } else { object.bonusatts = ba } } ")) { object.listalias = null do (object, "colourmylistalias") } else { object.listalias = object.original_listalias + ext } } ]]> foreach (o, GetDirectChildren(game.pov)) { if (GetBoolean(o, "wornclothinglocation")) { return (o) } } return (game.pov) foreach (slot, garment.wear_slots) { obj = GetOuterFor(char, slot) if (not obj = null and not obj = garment) { return (obj) } } return (null) garment.inventoryverbs = list if (not s = null) { if (not s = "") { foreach (s2, Split(s, ";")) { list add (garment.inventoryverbs, s2) } } } garments = NewObjectList() foreach (o, GetAllChildObjects(char)) { if (HasAttribute(o, "wear_slots") and HasInt(o, "wear_layer") and GetBoolean(o, "worn")) { if (ListContains(o.wear_slots, slot) or slot = null) { list add (garments, o) } } } return (garments) max) { max = o.armour } } return (total + max) ]]> return (1) msg (s) return (true) return (true) \\S+?)\\.(?\\S+?)(?:(?\\[|\\{)(?.*?)(?:\\]|\\}))?(?:\\s?(?\\=)\\s?(?:(?(?:\\[|\\{)?)(?.*?)(?:\\]|\\})?)(?(valkeytoken)|(?:(?.+?)\\.(?.+?))))?$" if (IsRegexMatch (regex, text)) { result = populate (regex, text) Log (ToString(result)) object = getObjectExt(result["object"]) if (TypeOf(object) = "null") { error (DynamicTemplate("DevModeErrorCantFindObject", result["object"])) } attribute = result["attribute"] current_value = GetAttribute(object, attribute) if (TypeOf(current_value) = "null" and result["istoken"] <> "=") { error (DynamicTemplate("DevModeErrorCantFindAttribute", result["attribute"])) } value = result["value"] if (result["istoken"] = "=") { if (result["value"] = "?") { value = true } else if (result["value"] = "!") { value = false } else if (result["value"] = "~") { value = not GetBoolean (object, attribute) } else if (result["valkeytoken"] = "[") { value = NewList () if (result["value"] <> "") { list = Split(result["value"], ",") foreach (item, list) { list add (value, Eval(Trim(item))) } } } else if (result["valkeytoken"] = "{") { value = NewDictionary () if (result["value"] <> "") { list = Split(result["value"], ",") foreach (assign, list) { if (not Instr(assign, ":") = 0) { dic = Split(assign, ":") dickey = dic[0] dicvalue = dic[1] dictionary add (value, dickey, Eval(Trim(dicvalue))) } else { error (Template("DevModeErrorWrongFormat")) } } } } else if (result["valobject"] <> "") { valobject = getObjectExt(result["valobject"]) if (TypeOf(valobject) = "null") { error (DynamicTemplate("DevModeErrorCantFindObject", result["valobject"])) } if (result["valattribute"] <> "") { valattribute = result["valattribute"] value = GetAttribute(valobject, valattribute) if (TypeOf(value) = "null") { error (DynamicTemplate("DevModeErrorCantFindAttribute", result["valattribute"])) } } } else { value = Eval(result["value"]) } if (result["keytoken"] = "[") { if (TypeOf(current_value) <> "list" and TypeOf(current_value) <> "objectlist" and TypeOf(current_value) <> "stringlist") { current_value = NewList () } if (result["key"] <> "") { if (not IsNumeric(result["key"])) { error (Template("DevModeErrorWrongTyp")) } else if (ToInt(result["key"]) < ListCount(current_value)) { list remove (current_value, ListItem(current_value, ToInt(result["key"]))) } } list add (current_value, value) value = NewList () value = current_value } else if (result["keytoken"] = "{") { if (TypeOf(current_value) <> "dictionary" and TypeOf(current_value) <> "objectdictionary" and TypeOf(current_value) <> "stringdictionary") { current_value = NewDictionary () } if (result["key"] <> "") { if (result["key"] in current_value) { dictionary remove (current_value, result["key"]) } dictionary add (current_value, result["key"], value) value = NewDictionary () value = current_value } } set (object, attribute, value) DevModeOutput (Template("DevModeComSetAttribute") + object.name + "." + attribute + "=" + ParseToFlyScript(value)) } else { key = "" if (result["keytoken"] = "[") { if (TypeOf(current_value) <> "list" and TypeOf(current_value) <> "objectlist" and TypeOf(current_value) <> "stringlist") { error (Template("DevModeErrorWrongTyp")) } else if (not IsNumeric(result["key"])) { error (Template("DevModeErrorWrongTyp")) } else if (ToInt(result["key"]) > ListCount(current_value)-1) { error (Template("DevModeErrorWrongKey")) } else { current_value = ListItem(current_value, ToInt(result["key"])) } key = "[" + result["key"] + "]" } if (result["keytoken"] = "{") { if (TypeOf(current_value) <> "dictionary" and TypeOf(current_value) <> "objectdictionary" and TypeOf(current_value) <> "stringdictionary") { error (Template("DevModeErrorWrongTyp")) } else if (not result["key"] in current_value) { error (Template("DevModeErrorWrongKey")) } else { current_value = DictionaryItem(current_value, result["key"]) } key = "{" + result["key"] + "}" } DevModeOutput (Template("DevModeComGetAttribute") + object.name + "." + attribute + key + "=" + ParseToFlyScript(current_value)) } } else { error (Template("DevModeErrorWrongFormat")) } ]]> " } case ("list") { list = NewStringList() foreach (item, text) { switch (TypeOf(item)) { case ("string") { item = "\"" + item + "\"" } case ("object") { item = item.name } default { item = ToString(item) } } list add (list, item) } parsetext = "[" + Join (list, ",") + "]" } case ("stringlist") { list = NewStringList() foreach (item, text) { switch (TypeOf(item)) { case ("string") { item = "\"" + item + "\"" } case ("object") { item = item.name } default { item = ToString(item) } } list add (list, item) } parsetext = "[" + Join (list, ",") + "]" } case ("objectlist") { list = NewStringList() foreach (item, text) { switch (TypeOf(item)) { case ("string") { item = "\"" + item + "\"" } case ("object") { item = item.name } default { item = ToString(item) } } list add (list, item) } parsetext = "[" + Join (list, ",") + "]" } case ("dictionary") { list = NewStringList() foreach (key, text) { item = DictionaryItem(text, key) switch (TypeOf(item)) { case ("string") { item = "\"" + item + "\"" } case ("object") { item = item.name } case ("script") { item = "<" + Replace(ToString(item), "Script: ", "") + ">" } default { item = ToString(item) } } list add (list, key + ":" + item) } parsetext = "{" + Join (list, ",") + "}" } case ("stringdictionary") { list = NewStringList() foreach (key, text) { item = DictionaryItem(text, key) switch (TypeOf(item)) { case ("string") { item = "\"" + item + "\"" } case ("object") { item = item.name } case ("script") { item = "<" + Replace(ToString(item), "Script: ", "") + ">" } default { item = ToString(item) } } list add (list, key + ":" + item) } parsetext = "{" + Join (list, ",") + "}" } case ("objectdictionary") { list = NewStringList() foreach (key, text) { item = DictionaryItem(text, key) switch (TypeOf(item)) { case ("string") { item = "\"" + item + "\"" } case ("object") { item = item.name } case ("script") { item = "<" + Replace(ToString(item), "Script: ", "") + ">" } default { item = ToString(item) } } list add (list, key + ":" + item) } parsetext = "{" + Join (list, ",") + "}" } case ("scriptdictionary") { list = NewStringList() foreach (key, text) { item = DictionaryItem(text, key) switch (TypeOf(item)) { case ("string") { item = "\"" + item + "\"" } case ("object") { item = item.name } case ("script") { item = "<" + Replace(ToString(item), "Script: ", "") + ">" } default { item = ToString(item) } } list add (list, key + ":" + item) } parsetext = "{" + Join (list, ",") + "}" } default { parsetext = ToString(text) } } return (parsetext) ]]> " + str + "") } ]]> " + str + "") } ]]> { } scr => { } if (obj = null) { error (Template("DevModeErrorObjectNotRecognised")) } if (HasAttribute (obj, cha)) { scr = GetAttribute (obj, cha) set (obj, cha, bla) set (obj, att, val) set (obj, cha, scr) } else { set (obj, att, val) } ]]> if (HasAttribute(game, "devmode_active")) { if (game.devmode_active) { DevModeOutput (Template("DevModeActive")) if (HasAttribute(game, "devmode_attributes") and not DictionaryCount(game.devmode_attributes) = 0) { foreach (key, game.devmode_attributes) { command = key + "=" + ToString(DictionaryItem(game.devmode_attributes, key)) commandOutput ("#" + command) ParseToQuestCode (command) } } if (game.devmode_changepov) { commandOutput ("#to " + game.devmode_pov) HandleSingleCommand ("#to " + game.devmode_pov) } if (game.devmode_changepovpos) { commandOutput ("#go " + game.devmode_povpos) HandleSingleCommand ("#go " + game.devmode_povpos) } if (game.devmode_setverbs) { setVerbs } if (game.devmode_setinitscript and HasScript(game, "devmode_initscript")) { msg ("") DevModeOutput (Template("DevModeStartScript")) do (game, "devmode_initscript") } msg ("") } } data = NewStringList () list add (data, "{\"name\":\"game\"}") foreach (obj, AllObjects()) { list add (data, "{\"name\":\"" + obj.name + "\"}") } datastr = "[" + Join (data, ",") + "]" JS.setTableData ("names", datastr) data = NewStringList () obj = GetObject (name) foreach (attr, GetAttributeNames (obj, true)) { val = ParseToFlyScript (GetAttribute (obj, attr)) list add (data, "{\"attribute\":\"" + attr + "\",\"value\":\"" + Replace(val, "\"", "\\\"") + "\"}") } datastr = "[" + Join (data, ",") + "]" JS.setTableData ("attr", datastr) commandOutput ("#" + command) ParseToQuestCode (command) " + command) ]]> verbs = game.devmode_verbs foreach (object, AllObjects()) { if (HasAttribute(object, "displayverbs")) { object.displayverbs = ListCombine (object.displayverbs, verbs) } if (HasAttribute(object, "inventoryverbs")) { object.inventoryverbs = ListCombine (object.inventoryverbs, verbs) } } game.enablehyperlinks = true msg ("") DevModeOutput (Template("DevModeSetVerbs")) obj = GetObject(name) if (obj = null) { foreach (sobj, AllObjects()) { if (HasAttribute(sobj, "alias")) { if (LCase(sobj.alias) = LCase(name)) { return (sobj) } } } } return (obj) Start DevMode-Selftest...") create ("testobject1") create ("testobject2") testobject1.testattribut = "" commands = NewDictionary () dictionary add (commands, "#take testobject1", "Got (testobject1)") dictionary add (commands, "#drop testobject1", "Contains (game.pov.parent, testobject1)") dictionary add (commands, "#put testobject1 in testobject2", "Contains (testobject2, testobject1)") dictionary add (commands, "#open testobject1", "testobject1.isopen") dictionary add (commands, "#close testobject1", "not testobject1.isopen") dictionary add (commands, "#on testobject1", "IsSwitchedOn(testobject1)") dictionary add (commands, "#off testobject1", "not IsSwitchedOn(testobject1)") dictionary add (commands, "#to testobject1", "game.pov = testobject1") dictionary add (commands, "#go testobject2", "game.pov.parent = testobject2") dictionary add (commands, "#testobject1.testattribut=true", "TypeOf(testobject1.testattribut) = \"boolean\" and testobject1.testattribut=true") dictionary add (commands, "#testobject1.testattribut=false", "TypeOf(testobject1.testattribut) = \"boolean\" and testobject1.testattribut=false") dictionary add (commands, "#testobject1.testattribut=?", "TypeOf(testobject1.testattribut) = \"boolean\" and testobject1.testattribut=true") dictionary add (commands, "#testobject1.testattribut=!", "TypeOf(testobject1.testattribut) = \"boolean\" and testobject1.testattribut=false") dictionary add (commands, "#testobject1.testattribut=~", "TypeOf(testobject1.testattribut) = \"boolean\" and testobject1.testattribut=true") dictionary add (commands, "#testobject1.testattribut=\"teststring\"", "TypeOf(testobject1.testattribut) = \"string\" and testobject1.testattribut=\"teststring\"") dictionary add (commands, "#testobject1.testattribut=25", "TypeOf(testobject1.testattribut) = \"int\" and testobject1.testattribut = 25") dictionary add (commands, "#testobject1.testattribut=25.25", "TypeOf(testobject1.testattribut) = \"double\" and testobject1.testattribut = 25.25") dictionary add (commands, "#testobject1.testattribut=testobject1", "TypeOf(testobject1.testattribut) = \"object\" and testobject1.testattribut = testobject1") dictionary add (commands, "#testobject1.testattribut=[]", "TypeOf(testobject1.testattribut) = \"list\" and ListCount(testobject1.testattribut) = 0") dictionary add (commands, "#testobject1.testattribut=[\"testitem1\",\"testitem2\",testobject1,testobject2]", "TypeOf(testobject1.testattribut) = \"list\" and ListCount(testobject1.testattribut) = 4 and TypeOf(ListItem(testobject1.testattribut, 0)) = \"string\" and ListItem(testobject1.testattribut, 0) = \"testitem1\" and TypeOf(ListItem(testobject1.testattribut, 1)) = \"string\" and ListItem(testobject1.testattribut, 1) = \"testitem2\" and TypeOf(ListItem(testobject1.testattribut, 2)) = \"object\" and ListItem(testobject1.testattribut, 2) = testobject1 and TypeOf(ListItem(testobject1.testattribut, 3)) = \"object\" and ListItem(testobject1.testattribut, 3) = testobject2") dictionary add (commands, "#testobject1.testattribut[2]=\"newtestitem2\"", "TypeOf(testobject1.testattribut) = \"list\" and ListCount(testobject1.testattribut) = 4 and TypeOf(ListItem(testobject1.testattribut, 3)) = \"string\" and ListItem(testobject1.testattribut, 3) = \"newtestitem2\"") dictionary add (commands, "#testobject1.testattribut[]=\"newtestitem5\"", "TypeOf(testobject1.testattribut) = \"list\" and ListCount(testobject1.testattribut) = 5 and ListItem(testobject1.testattribut, 4) = \"newtestitem5\"") dictionary add (commands, "#testobject1.testattribut[1]", "") dictionary add (commands, "#testobject1.testattribut={}", "TypeOf(testobject1.testattribut) = \"dictionary\" and DictionaryCount(testobject1.testattribut) = 0") dictionary add (commands, "#testobject1.testattribut={testkey1:\"testitem1\",testkey2:\"testitem2\",testkey3:testobject1,testkey4:testobject2}", "TypeOf(testobject1.testattribut) = \"dictionary\" and DictionaryCount(testobject1.testattribut) = 4 and TypeOf(DictionaryItem(testobject1.testattribut, \"testkey1\")) = \"string\" and DictionaryItem(testobject1.testattribut, \"testkey1\") = \"testitem1\" and TypeOf(DictionaryItem(testobject1.testattribut, \"testkey2\")) = \"string\" and DictionaryItem(testobject1.testattribut, \"testkey2\") = \"testitem2\" and TypeOf(DictionaryItem(testobject1.testattribut, \"testkey3\")) = \"object\" and DictionaryItem(testobject1.testattribut, \"testkey3\") = testobject1 and TypeOf(DictionaryItem(testobject1.testattribut, \"testkey4\")) = \"object\" and DictionaryItem(testobject1.testattribut, \"testkey4\") = testobject2") dictionary add (commands, "#testobject1.testattribut{testkey4}=\"newtestitem4\"", "TypeOf(testobject1.testattribut) = \"dictionary\" and DictionaryCount(testobject1.testattribut) = 4 and TypeOf(DictionaryItem(testobject1.testattribut, \"testkey4\")) = \"string\" and DictionaryItem(testobject1.testattribut, \"testkey4\") = \"newtestitem4\"") dictionary add (commands, "#testobject1.testattribut{testkey1}", "") dictionary add (commands, "#testobject1.testattribut=testobject2.name", "TypeOf(testobject1.testattribut) = \"string\" and testobject1.testattribut=\"testobject2\"") dictionary add (commands, "#testobject1.testattribut", "") iserror = false foreach (command, commands) { if (not iserror) { on ready { DevModeOutput ("
> " + command) HandleSingleCommand (command) on ready { compare = ToString(DictionaryItem(commands, command)) if (compare <> "") { result = Eval(compare) } DevModeOutput ("Quest-Presentation: testobject1.testattribut = " + ToString(testobject1.testattribut)) if (not result) { iserror = true DevModeOutputError (Template("DevModeComSelfTestFailed")) Log (ToString(ListItem(testobject1.testattribut, 2))) } } } } } ]]>
null) { foreach (stylesheet, game.externalstylesheets) { JS.addExternalStylesheet (stylesheet) } } if (game.setbackgroundopacity) { SetBackgroundOpacity (game.backgroundopacity) } SetBackgroundColour (game.defaultbackground) SetForegroundColour (game.defaultforeground) SetLinkForegroundColour (game.defaultlinkforeground) if (LengthOf(game.backgroundimage) > 0) { SetBackgroundImage (game.backgroundimage) } JS.setCompassDirections (Join(game.compassdirections, ";")) JS.setInterfaceString ("InventoryLabel", "Inventory") JS.setInterfaceString ("StatusLabel", "Status") JS.setInterfaceString ("PlacesObjectsLabel", "Places and Objects") JS.setInterfaceString ("CompassLabel", "Compass") JS.setInterfaceString ("InButtonLabel", "in") JS.setInterfaceString ("OutButtonLabel", "out") JS.setInterfaceString ("EmptyListLabel", "(empty)") JS.setInterfaceString ("NothingSelectedLabel", "(nothing selected)") JS.setInterfaceString ("TypeHereLabel", "Type here...") JS.setInterfaceString ("ContinueLabel", "Continue...") JS.SetMenuBackground (game.menubackground) JS.SetMenuForeground (game.menuforeground) JS.SetMenuHoverBackground (game.menuhoverbackground) JS.SetMenuHoverForeground (game.menuhoverforeground) JS.SetMenuFontName (game.menufont) JS.SetMenuFontSize (game.menufontsize + "pt") if (not game.underlinehyperlinks) { JS.TurnOffHyperlinksUnderline () } ResetCommandBarFormat if (game.showcommandbar) { JS.uiShow ("#txtCommandDiv") } else { JS.uiHide ("#txtCommandDiv") } if (HasString(game, "panelcontents")) { SetFramePicture (game.panelcontents) } if (game.gridmap) { JS.ShowGrid (game.mapsize) Grid_SetScale (game.mapscale) if (game.pov <> null) { if (game.pov.parent <> null) { Grid_Redraw Grid_DrawPlayerInRoom (game.pov.parent) } } } JS.setCss ("body", "color:" + game.defaultforeground + ";font-family:" + game.defaultfont + ";font-size:" + game.defaultfontsize + "pt;") if (HasString(game, "bordercolour")) { JS.setCss ("#gameBorder", "border-left:1px solid " + game.bordercolour + ";border-right:1px solid " + game.bordercolour) } if (not game.classiclocation) { JS.setCss ("#status", "background-image:none") if (HasString(game, "customlocationcolour")) { JS.setCss ("#status", "background-color:" + game.customlocationcolour) } else { JS.setCss ("#status", "background:transparent") } if (HasString(game, "customlocationtextcolour")) { JS.setCss ("#status", "color:" + game.customlocationtextcolour) } if (HasString(game, "customlocationbordercolour")) { JS.setCss ("#status", "border:1px solid " + game.customlocationbordercolour) } else { JS.setCss ("#status", "border:none") } } if (game.showlocation) { JS.uiShow ("#location") JS.setCss ("#status", "display:block") } else { JS.setCss ("#status", "display:none") } if (HasString(game, "marginscolour")) { JS.setCss ("body", "background-color:" + game.marginscolour) } if (game.turnoffsavebutton) { JS.setCss ("#controlButtons", "display:none") } if (game.turnoffcompass) { JS.setCss ("#compassLabel", "display:none;") JS.setCss ("#compassAccordion", "display:none;") } if (game.turnoffinventory) { JS.setCss ("#inventoryLabel", "display:none") JS.setCss ("#inventoryAccordion", "display:none") } if (game.turnoffplacesandobjects) { JS.setCss ("#placesObjectsLabel", "display:none") JS.setCss ("#placesObjectsAccordion", "display:none") } if (game.statusandcompassattop) { JS.eval ("$('#commandPane').insertBefore('#inventoryLabel')") JS.eval ("$('#customStatusPane').insertBefore('#inventoryLabel')") JS.eval ("$('#statusVarsLabel').insertBefore('#inventoryLabel')") JS.eval ("$('#statusVarsAccordion').insertBefore('#inventoryLabel')") JS.eval ("$('#compassLabel').insertBefore('#inventoryLabel')") JS.eval ("$('#compassAccordion').insertBefore('#inventoryLabel')") } if (game.showpanes and game.commandpane) { JS.setCss ("#commandPane", "display:block") } if (game.showpanes and game.customstatuspane) { JS.setCss ("#customStatusPane", "display:block") } if (game.colourblend) { JS.colourBlend (game.colourblendtop, game.colourblendbottom) } if (game.borderlesscursor) { JS.addScript ("") JS.setCss ("#txtCommandDiv", "color:" + game.defaultforeground) JS.eval ("$('#txtCommandPrompt').html('" + game.commandcursor + "')") } else if (game.shadowbox) { JS.addScript ("") } if (game.panestheme = "Midnight") { JS.setPanes ("white", "midnightblue", "midnightblue", "skyblue") } if (game.panestheme = "Nature") { JS.setPanes ("#A1C935", "#254117", "#306754", "#A1C935", "green") } if (game.panestheme = "Parchment") { JS.setPanes ("#493D26", "#FAEBD7", "#FAEBD7", "#493D26", "#C88141") } if (game.panestheme = "Vanilla") { JS.setPanes ("black", "white") } if (game.panestheme = "Black") { JS.setPanes ("orange", "black", "black", "orange") } if (game.panestheme = "Blood") { JS.setPanes ("orange", "#800000", "#800000", "orange", "yellow") } if (game.panestheme = "Tranquil") { JS.setPanes ("midnightblue", "skyblue", "white", "midnightblue", "blue") } if (game.respondtogridclicks) { JS.respondToGridClicks (true) } if (not game.showborder) { JS.hideBorder () } if (game.showpanes) { JS.panesVisible (true) } else { JS.panesVisible (false) } JS.getDivCount () if (not game.pov = null) { JS.updateLocation (CapFirst(GetDisplayName(game.pov.parent))) } if (game.feature_devmode) { setDevMode } InitUserInterface if (HasScript(game, "inituserinterface")) { do (game, "inituserinterface") } ]]> " + game.gamename + "") if (game.subtitle <> null) { if (LengthOf(game.subtitle) > 0) { PrintCentered ("" + game.subtitle + "") } } if (game.author <> null) { if (LengthOf(game.author) > 0) { PrintCentered ("
by " + game.author + "") } } msg ("
") JS.EndOutputSection ("title") } if (game.pov = null) { playerObject = GetObject("player") if (playerObject = null) { if (ListCount(AllObjects()) > 0) { firstRoom = ObjectListItem(AllObjects(), 0) } else { create ("room") firstRoom = room } create ("player") player.parent = firstRoom } game.pov = player } else { InitPOV (null, game.pov) } InitStatusAttributes UpdateStatusAttributes InitVerbsList if (HasScript(game, "start")) { do (game, "start") } foreach (obj, AllObjects()) { if (HasScript(obj, "_initialise_")) { do (obj, "_initialise_") } } UpdateStatusAttributes UpdateObjectLinks on ready { if (game.gridmap) { Grid_DrawPlayerInRoom (game.pov.parent) } if (game.displayroomdescriptiononstart) { OnEnterRoom (null) } UpdateStatusAttributes UpdateObjectLinks } if (GetBoolean(game, "notranscript")) { JS.eval ("transcriptEnabled = false;") } game.runturnscripts = false FinishTurn ]]>
game.verbattributes = NewStringList() game.verbattributeslookup = NewObjectDictionary() foreach (cmd, AllCommands()) { if (HasString(cmd, "property")) { list add (game.verbattributes, cmd.property) dictionary add (game.verbattributeslookup, cmd.property, cmd) } } if (Contains(game.pov, object)) { baselist = object.inventoryverbs } else { baselist = object.displayverbs } if (not game.autodisplayverbs or GetBoolean(object, "usestandardverblist") or not HasAttribute(game, "verbattributes")) { return (baselist) } else { if (HasAttribute(object, "generatedverbslist")) { verbs = object.generatedverbslist } else { verbs = NewStringList() foreach (attr, GetAttributeNames(object, false)) { if (ListContains(game.verbattributes, attr)) { cmd = ObjectDictionaryItem(game.verbattributeslookup, attr) if (HasString(cmd, "displayverb")) { displayverb = CapFirst(cmd.displayverb) } else { displayverb = CapFirst(attr) } if (not ListContains(baselist, displayverb)) { list add (verbs, displayverb) } } } object.generatedverbslist = verbs } if (GetBoolean(object, "useindividualverblist")) { return (verbs) } else { return (ListCombine(baselist, verbs)) } } null) { oldPOV.alias = oldPOV.external_alias oldPOV.alt = oldPOV.external_alt oldPOV.look = oldPOV.external_look oldPOV.gender = oldPOV.external_gender oldPOV.article = oldPOV.external_article } newPOV.external_alias = newPOV.alias newPOV.external_alt = newPOV.alt newPOV.external_look = newPOV.look newPOV.external_gender = newPOV.gender newPOV.external_article = newPOV.article if (not GetBoolean(newPOV, "pov_used")) { if (newPOV.alt = null) { newPOV.pov_alt = newPOV.pov_alt } else { newPOV.pov_alt = ListCombine(newPOV.alt, newPOV.pov_alt) } if (newPOV.alias <> null) { list add (newPOV.pov_alt, newPOV.alias) } if (game.showmoney and not HasInt(newPOV, "money")) { newPOV.money = 0 } if (game.showhealth) { newPOV.health = 100 newPOV.changedhealth => { if (this.health > 100) { this.health = 100 } else if (this.health = 0) { if (HasScript(game, "onhealthzero")) { do (game, "onhealthzero") } } else if (this.health < 0) { this.health = 0 } } } newPOV.pov_used = true } newPOV.alias = newPOV.pov_alias newPOV.alt = newPOV.pov_alt newPOV.look = newPOV.pov_look newPOV.gender = newPOV.pov_gender newPOV.article = newPOV.pov_article ]]> if (GetBoolean(game,"runturnscripts")) { if (not GetBoolean(game, "suppressturnscripts")) { RunTurnScripts } } game.runturnscripts = false game.suppressturnscripts = false UpdateStatusAttributes CheckDarkness UpdateObjectLinks game.questplatform = s
Mel Simons PI

by Simon Mellor


You are in a Dark dirty unused room.
You can see a Note.
You can go west.
It's gloomy in here
There is a door at one end and a window looking out onto the city skape.
To the West is a small alcove


> look at Note
You, Mel Simons are a private investigator, you have poked your nose a little to far into the busyness of Rock Hard, a local thug.
You have been caught and you are trapped inside a small seedy hotel.
Can you escape and give Rock a taste of his own medicnie?


> save
]]>