"That's not something you can get on."
"You're already on " + object.article + "."
"You already are."
"You're not on " + object.article + "."
"You're not on anything."
"You stand up."
"You ### on the ground."
"You ### on " + object.posture_surface + "."
"You cannot sit here."
"You cannot lie down here."
"Tell " + object.article + " all you want, " + object.gender + "'s not going to do anything."
WriteVerb(object, "be") + " not on " + obj.article + "."
WriteVerb(object, "be") + " not on anything."
CapFirst(GetDisplayName(object)) + " stands up."
CapFirst(object.gender) + " already is."
"You (or anyone else!) can't sit here!"
"You (or anyone else!) can't lie down here!"
You (or anyone else) can't ### here!
stand
stand on #object#;stand #object#;stand upon #object#
"You can't stand on " + object.article + "."
lie on #object#; lie upon #object#; lie down on #object#; lie down upon #object#;recline on #object#;recline upon #object#
recline
"You can't recline on " + object.article + "."
sit;sit down
none
lie;lie down;recline
none
kneel;kneel down;kneel up
none
crouch;crouch down;squat;squat down
none
crawl;get on hands and knees;get on my hands and knees;get on all fours
none
get on #object#;on #object#
stand;stand up
get off #object#;off #object#
get off;off
none
none
return (true)
if (game.pov.parent.nositting) {
msg(Replace(Template("PosturesNotAllowedHere"), "###", option))
}
else {
Posture (posture, Replace(DynamicTemplate(template, game.pov.parent), "###", posture), null)
}
0) {
// there is some furniture here.
// If any have this as the prefered posture, just go with the first one
l = FilterByAttribute (furniture_list, "preferred_posture", posture)
if (ListCount(l) > 0) {
return (ObjectListItem(l, 0))
}
return (ObjectListItem(furniture_list, 0))
}
else {
return (null)
}
]]>
if (not game.pov.posture = null) {
if (game.pov.posture_object = null) {
game.pov.posture = null
msg (DynamicTemplate("PosturesStandUp", game))
}
else {
att = game.pov.posture + "offmsg"
if (HasString(game.pov.posture_object, att)) {
msg(Replace(GetString(game.pov.posture_object, att), "###", GetDefiniteName(game.pov.posture_object)))
}
else {
msg (DynamicTemplate("PosturesStandUp", game))
}
game.pov.posture_object = null
game.pov.posture = null
}
JS.updateLocation (CapFirst(GetDisplayName(game.pov.parent)))
PostureRemoveExit()
}
// This just does the action; there is no checking it is allowed or anything except alreadsy done
if (game.pov.posture = posture and game.pov.posture_object = obj) {
msg(DynamicTemplate("PosturesAlreadyAre", game))
}
else {
if (not game.pov.posture_object = obj) {
StandUp()
}
game.pov.posture = posture
game.pov.posture_object = obj
if (obj = null) {
// !!!lang
JS.updateLocation (CapFirst(GetDisplayName(game.pov.parent)) + " (" + posture + ")")
msg (message)
}
else {
// !!!lang
JS.updateLocation (CapFirst(GetDisplayName(game.pov.parent)) + " (" + posture + " on " + ProcessText(GetDisplayName(obj)) + ")")
msg (Replace(message, "###", GetDefiniteName(obj)))
}
if (posture = "stand") {
PostureAddExit("down")
}
else {
PostureAddExit("up")
}
}
PostureRemoveExit()
o = GetObject("posture_exit_" + dir)
if (o = null) {
create exit ("posture_exit_" + dir, dir, game.pov.parent, game.pov.parent, dir + "direction")
o = GetObject("posture_exit_" + dir)
o.scenery = true
o.runscript = true
o.script => {
StandUp
}
}
else {
o.parent = game.pov.parent
o.to = game.pov.parent
}
s = GetExitByName (game.pov.parent, dir)
if (not s = null) {
o.old_exit = GetObject(s)
if (o.old_exit.visible) {
o.old_exit.visible = false
}
else {
o.old_exit = null
}
}
o = GetObject("posture_exit_up")
if (not o = null) {
o.parent = null
if (not o.old_exit = null) {
o.old_exit.visible = true
}
}
o = GetObject("posture_exit_down")
if (not o = null) {
o.parent = null
if (not o.old_exit = null) {
o.old_exit.visible = true
}
}
.*) to|(?.*),) (recline|lie down|lie)$]]>
.*) to|(?.*),) (sit down|sit)$]]>
.*) to|(?.*),) (kneel down|kneel up|kneel)$]]>
.*) to|(?.*),) (crouch down|crouch|squat down|squat)$]]>
.*) to|(?.*),) (grovel|crawl|(get down on|get on|get down on his|get down on its|get down on her|get on his|get on its|get on her) (hands and knees|all fours))$]]>
.*) to|(?.*),) (get on|on) (?.*)$]]>
.*) to|(?.*),) (stand on|stand|step on to|step on) (?.*)$]]>
.*) to|(?.*),) (sit down on|sit on|sit) (?.*)$]]>
.*) to|(?.*),) (recline on|recline|lie down on|lie on|lie) (?.*)$]]>
.*) to|(?.*),) (stand up|stand)$]]>
.*) to|(?.*),) (get off|off) (?.*)$]]>
.*) to|(?.*),) (get off|off|get down)$]]>
if (not DoesInherit(npc, "NpcType")) {
msg(DynamicTemplate("PosturesNotNpc", npc))
}
else if (not obj = null and not npc.posture_object = obj) {
msg (DynamicTemplate("PosturesNpcNotOnObj", obj))
}
else {
do (npc, "requeststandup", QuickParams("object", obj))
}
if (not DoesInherit(npc, "NpcType")) {
msg(DynamicTemplate("PosturesNotNpc", npc))
}
else if (not obj = null and not DoesInherit(obj, "furniture_type")) {
// Not furniture
msg (DynamicTemplate("PosturesNotGetOn", obj))
}
else {
do (npc, "requestposture", QuickParams("object", obj, "option", posture))
}
.*)$|^go (?.*)$|^(?north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]>
[UnresolvedLocation]
.*) to|(?.*),) go to (?.*)$]]>
That's not somewhere you can get to.
objectnpc=all|object=world
.*) to|(?.*),) (go |)(?north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]>
That's not somewhere you can go.
.*) to|(?.*),) (follow me|follow)$]]>
.*) to|(?.*),) (stop following|don't follow|do not follow|wait here|wait)( me|)$]]>
.*) to|(?.*),) (get|take|pick up) (?.*)$]]>
.*) to|(?.*),) (drop) (?.*)$]]>
none
foreach (npc, FilterByType(ScopeVisibleNotHeldForRoom (game.pov.parent), "NpcType")) {
foreach (obj, GetDirectChildren(npc)) {
list add (items, obj)
}
}
.*) to|(?.*),) (give me|give) (?.*)$]]>
none
foreach (npc, FilterByType(ScopeVisibleNotHeldForRoom (game.pov.parent), "NpcType")) {
foreach (obj, GetDirectChildren(npc)) {
list add (items, obj)
}
}
.*) to|(?.*),) (give) (?.*) to (?.*)$]]>
none
foreach (npc, FilterByType(ScopeVisibleNotHeldForRoom (game.pov.parent), "NpcType")) {
foreach (obj, GetDirectChildren(npc)) {
list add (items, obj)
}
}
if (not DoesInherit(npc, "NpcType")) {
msg(DynamicTemplate("PosturesNotNpc", npc))
}
else if (not object.parent = npc) {
msg(WriteVerb(npc, "do") + " not have " + object.article + ".")
}
else {
msg ("Giving " + object.name + " to " + subject.name)
do(npc, "requestgive", QuickParams("object", object, "subject", subject))
}
0){
PrintIfDebug (this, "Outstanding actions: " + Join(this.actions, ","))
}
if (ListCount(this.actions) > 0 and not HasAttribute(this, "group")) {
s = StringListItem(this.actions, 0)
PrintIfDebug (this, "Doing: " + s)
if (NpcAct (this, s)) {
list remove (this.actions, s)
PrintIfDebug (this, "Deleted")
}
}
}
]]>
this.complies = true
Okay!
do (this, "checkagreement", QuickParams("command", "take", "object", object))
if (this.complies) {
if (HasScript(object, "npc_take")) {
do (object, "npc_take", QuickParams("npc", this))
}
else if ((HasBoolean(object, "npc_take") and not GetBoolean(object, "npc_take")) or (not HasAttribute(object, "npc_take") and not GetBoolean(object, "take"))) {
msg ("'I can't get that,' says " + GetDefiniteName(this) + ".")
}
else {
if (object.parent = game.pov) {
msg ("'" + this.yesmsg + "' says " + CapFirst(GetDefiniteName(this)) + ", taking " + GetDefiniteName(object) + " from you.")
}
else {
msg ("'" + this.yesmsg + "' says " + CapFirst(GetDefiniteName(this)) + ", picking " + GetDefiniteName(object) + " up.")
}
object.parent = this
}
}
do (this, "checkagreement", QuickParams("command", "drop", "object", object))
if (this.complies) {
if (HasScript(object, "npc_drop")) {
do (object, "npc_drop", QuickParams("npc", this))
}
else if ((HasBoolean(object, "npc_drop") and not GetBoolean(object, "npc_drop")) or (not HasAttribute(object, "npc_drop") and not GetBoolean(object, "drop"))) {
msg ("'I can't drop that,' says " + GetDefiniteName(this) + ".")
}
else {
msg ("'" + this.yesmsg + "' says " + CapFirst(GetDefiniteName(this)) + ", dropping " + GetDefiniteName(object) + ".")
object.parent = this.parent
}
}
do (this, "checkagreement", QuickParams("command", "give", "object", object))
if (this.complies) {
if (not DoesInherit(subject, "NpcType") and not subject = game.pov) {
msg ("'Why would I give anything to " + GetDefiniteName(subject) + ",' says " + GetDefiniteName(this) + ".")
}
else {
handled = false
if (HasAttribute(this, "npc_give_script_list")) {
if (DictionaryContains(this.npc_give_script_list, object.name)) {
invoke (ScriptDictionaryItem(this.npc_give_script_list, object.name), QuickParams("subject", subject, "object", object))
handled = true
}
}
if (not handled) {
if ((HasBoolean(object, "npc_drop") and not GetBoolean(object, "npc_drop")) or (not HasAttribute(object, "npc_drop") and not GetBoolean(object, "drop"))) {
msg ("'I can't drop that,' says " + GetDefiniteName(this) + ".")
}
else {
if (subject.gender = "you") {
target = "you"
}
else {
target = GetDefiniteName(subject)
}
msg ("'" + this.yesmsg + "' says " + CapFirst(GetDefiniteName(this)) + ", giving " + GetDefiniteName(object) + " to " + target + ".")
object.parent = subject
}
}
}
}
do (this, "checkagreement", QuickParams("command", "go", "object", object))
if (this.complies) {
if (object.locked) {
msg ("'It's locked,' says " + GetDefiniteName(this) + ".")
}
else {
if (this.posture = null) {
msg ("'" + this.yesmsg + "' says " + CapFirst(GetDefiniteName(this)) + ", heading " + object.alias + ".")
}
else if (this.posture_object = null) {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) + ", standing up and going " + object.alias + ".")
}
else {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) + ", getting off " + GetDefiniteName(this.posture_object) + ", and walking " + object.alias + "wards.")
}
this.posture_object = null
this.posture = null
this.listalias = this.alias
this.parent = object.to
}
}
do (this, "checkagreement", QuickParams("command", "follow"))
if (this.complies) {
if (this.following = game.pov) {
msg ("'I am!' says " + GetDefiniteName(this) + ".")
}
else {
if (this.posture = null) {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) +", looking expectantly at you.")
}
else if (this.posture_object = null) {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) + ", standing up, looking expectantly at you.")
}
else {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) + ", getting off " + GetDefiniteName(this.posture_object) + ", looking expectantly at you.")
}
this.following = game.pov
this.posture_object = null
this.posture = null
this.listalias = this.alias
// Checks to see if "actions" has been set up (meaning at least on action has been added) to avoid errors.
if (HasAttribute(this, "actions")) {
while (ListCount (this.actions) > 0) {
s = ListItem (this.actions, 0)
list remove (this.actions, s)
PrintIfDebug (this, "Deleted " + ToString(s))
}
}
}
}
do (this, "checkagreement", QuickParams("command", "wait"))
if (this.complies) {
if (this.following = null) {
msg ("'I am!' says " + GetDefiniteName(this) + ".")
}
else {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) + ", tapping " + this.possessive + " foot.")
this.following = game.pov
this.posture_object = null
this.posture = null
this.listalias = this.alias
// Checks to see if "actions" has been set up (meaning at least on action has been added) to avoid errors.
if (HasAttribute(this, "actions")) {
while (ListCount (this.actions) > 0) {
s = ListItem (this.actions, 0)
list remove (this.actions, s)
PrintIfDebug (this, "Deleted " + ToString(s))
}
}
}
}
do (this, "checkagreement", QuickParams("command", "standup"))
if (this.complies) {
if (this.posture = null) {
msg ("'I am!' says " + GetDefiniteName(this) + ".")
}
else if (this.posture_object = null) {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) + ", standing up.")
}
else {
msg ("'" + this.yesmsg + "' says " + GetDefiniteName(this) + ", getting off " + GetDefiniteName(this.posture_object) + ".")
}
this.posture_object = null
this.posture = null
this.listalias = this.alias
}
do (this, "checkagreement", QuickParams("command", option, "object", object))
if (this.complies) {
if (object = null) {
object = FindFurniture(option, this.parent)
}
if (this.posture = option and this.posture_object = object) {
msg ("'I am!' says " + GetDefiniteName(this) + ".")
}
else if (not object = null) {
if ((option = "sit" and object.cansiton = False) or (option = "stand" and object.canstandon = False) or (option = "recline" and object.canreclineon = False)) {
msg (CapFirst(GetDefiniteName(this)) + " can't " + option + " on " + GetDefiniteName(object) + ".")
}
else {
do (this, "doposture", QuickParams("posture", option, "object", object))
}
}
else if (GetBoolean(game.pov.parent, "nositting")) {
if (HasString(game.pov.parent, "nositmsg")) {
msg(game.pov.parent.nosittingmsg)
}
else {
msg(Replace(Template("PosturesNotAllowedHere"), "###", option))
}
}
else {
do (this, "doposture", QuickParams("posture", option, "object", null))
this.listalias = this.alias
// Checks to see if "actions" has been set up (meaning at least on action has been added) to avoid errors.
if (HasAttribute(this, "actions")) {
while (ListCount (this.actions) > 0) {
s = ListItem (this.actions, 0)
list remove (this.actions, s)
PrintIfDebug (this, "Deleted " + ToString(s))
}
}
}
}
// Does the posture, no checking
s = "'" + this.yesmsg + "' says " + CapFirst(GetDefiniteName(this))
if (not this.posture_object = object and not this.posture_object = null) {
s = s + ", getting off " + GetDefiniteName(this.posture_object)
}
s = s + ". "
if (not object = null) {
do (this, posture + "onobj", QuickParams("object", object, "s", s))
}
else {
do (this, posture + "onground", QuickParams("object", this.parent, "s", s))
}
this.posture = posture
this.posture_object = object
if (this.alias = null) this.alias = this.name
if (not object = null) {
this.listalias = this.alias + " (" + AddIng(posture) + " on " + ProcessText(GetDisplayName(object)) + ")"
}
else {
this.listalias = this.alias + " (" + AddIng(posture) + ")"
}
msg (CapFirst(GetDisplayName(this)) + " " + Replace(GetString(this.posture_object, att), "###", GetDefiniteName(this.posture_object)))
msg (CapFirst(GetDefiniteName(this)) + " sits on " + GetDefiniteName(object) + ".")
msg (CapFirst(GetDefiniteName(this)) + " stands on " + GetDefiniteName(object) + ".")
msg (CapFirst(GetDefiniteName(this)) + " lies down on " + GetDefiniteName(object) + ".")
if (not IsDefined("s")) s = ""
if (HasString(object, "posture_surface")) {
msg (s + CapFirst(this.gender)) + " sits on " + object.posture_surface + ".")
}
else {
msg (s + CapFirst(this.gender) + " sits on the ground.")
}
if (not IsDefined("s")) s = ""
if (HasString(object, "posture_surface")) {
msg (s + CapFirst(this.gender) + " lies down on " + object.posture_surface + ".")
}
else {
msg (s + CapFirst(this.gender) + " lies down on the ground.")
}
if (not IsDefined("s")) s = ""
if (HasString(object, "posture_surface")) {
msg (s + CapFirst(this.gender) + " crouches down on " + object.posture_surface + ".")
}
else {
msg (s + CapFirst(this.gender) + " crouches down on the ground.")
}
if (not IsDefined("s")) s = ""
if (HasString(object, "posture_surface")) {
msg (s + CapFirst(this.gender) + " kneels down on " + object.posture_surface + ".")
}
else {
msg (s + CapFirst(this.gender) + " kneels down on the ground.")
}
if (not IsDefined("s")) s = ""
if (HasString(object, "posture_surface")) {
msg (s + CapFirst(this.gender) + " gets down on " + object.posture_surface + " on " + this.possessive + " hands and knees.")
}
else {
msg (s + CapFirst(this.gender) + " gets down on ground on " + this.possessive + " hands and knees.")
}
false
if (this.canstandon) {
Posture ("stand", this.standonmsg, this)
}
else {
msg (Replace(this.nostandmsg, "###", GetDefiniteName(this)))
}
You step up on to ###.
You step off ###.
You can't stand on ###.
true
if (this.cansiton) {
Posture ("sit", this.sitonmsg, this)
}
else {
msg (Replace(this.nositmsg, "###", GetDefiniteName(this)))
}
You sit on ###.
You get off ###.
You can't sit on ###.
false
if (this.canreclineon) {
Posture ("recline", this.reclineonmsg, this)
}
else {
msg (Replace(this.noreclinemsg, "###", GetDefiniteName(this)))
}
You lie down on ###.
You get off ###.
You can't recline on ###.
Stand on;Sit on;Lie on
sit
false
false
false
She is holding
holding
Not while she's got hold of it.
false
false
false
He is holding
holding
Not while he's got hold of it.
<_initialise_>
do(this, "resetalias")
false
if (game.pov.parent = room) {
msg (s)
if (not GetObject("game_clock") = null) {
game_clock.event = true
}
}
Pause (game.conversationalist)
return (FilterByAttribute(AllObjects(), "group", group))
if (DoesInherit(group, "GroupType")) {
return (PickOneObject(FilterByAttribute(AllObjects(), "group", group)))
}
else {
return (group)
}
if(HasAttribute(npc, "actions")){
if (ListCount(npc.actions) > 0){
s = StringListItem(npc.actions, 0)
if (StartsWith(s, "Follow:")) {
list remove (npc.actions, s)
PrintIfDebug (npc, "Stopped following")
}
}
}
if (HasAttribute(npc, "group")) {
npc.group.paused = true
}
else {
npc.paused = true
}
if (HasAttribute(npc, "group")) {
npc.group.suspended = true
npc.group.suspendedcount = count
}
else {
npc.suspended = true
npc.suspendedcount = count
}
if (HasAttribute(npc, "group")) {
npc.group.suspended = false
}
else {
npc.suspended = false
}
ary = Split(s, ":")
if (ListCount(ary) = 1) {
PrintIfHere (npc.parent, s)
f = true
}
else {
objname = StringListItem(ary, 1)
if (objname = "") {
game.currentobj = null
}
else {
game.currentobj = GetObject (objname)
if (game.currentobj = null) {
error ("Failed to find object in NpcAct: " + objname)
}
}
game.currentnpc = npc
f = Eval("Npc" + StringListItem(ary, 0) + "(game.currentnpc, game.currentobj)")
}
return (f)
exitname = GetExitByLink (npc.parent, dest)
if (exitname = null) {
return (true)
}
exit = GetObject(exitname)
if (HasScript(exit, "npcallowedtouse")) {
npc.allowedtoproceed = false
do (exit, "npcallowedtouse", QuickParams("npc", npc, "comm", comm))
return (npc.allowedtoproceed)
}
return (exit.visible and not exit.locked)
if (not NpcAllowedToMoveTo(npc, obj, "Move")) {
return (true)
}
oldroom = npc.parent
npc.parent = obj
if (DoesInherit(npc, "GroupType")) {
foreach (o, GroupMembers(npc)) {
o.parent = obj
}
}
if (not oldroom = npc.parent) {
// leaving
if (oldroom = player.parent) {
exitname = GetExitByLink (oldroom, npc.parent)
if (not exitname = null) {
exit = GetObject(exitname)
if (HasScript(exit, "npc_using")) {
do (exit, "npc_using", QuickParams("npc", npc))
}
else {
NpcLeaving (npc, exit)
}
}
}
// entering
if (npc.parent = player.parent) {
exitname = GetExitByLink (npc.parent, oldroom)
if (not exitname = null) {
exit = GetObject(exitname)
if (HasScript(exit, "npc_entering_by")) {
do (exit, "npc_entering_by", d)
}
else {
NpcEntering (npc, exit)
}
}
}
}
return (true)
msg(CapFirst(GetDisplayName(npc)) + " " + Conjugate(npc, "leave") + ", heading " + NiceDirection(exit, false) + ".")
msg(CapFirst(GetDisplayName(npc)) + " " + Conjugate(npc, "enter") + " from " + NiceDirection(exit, true) + ".")
switch (exit.alias) {
case ("in") { s = "inside" }
case ("out") { s = "outside" }
case ("up") { s = "above" }
case ("down") { s = "below" }
default {
if (addthe) {
s = "the " + exit.alias
}
else {
s = exit.alias
}
}
}
return (s)
if (obj = game.pov or HasScript(obj, "takeaturn")) {
return (npc.parent = obj.parent)
}
else if (HasBoolean(obj, "locked")) {
return (not obj.locked)
}
else {
return (npc = obj.parent)
}
exit = PickOneUnlockedExit (npc.parent)
oldroom = npc.parent
NpcMove(npc, exit.to)
return (obj.parent = npc.parent)
obj.parent = npc
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " picks up the " + GetDisplayAlias(obj) + ".")
return (true)
obj.parent = npc.parent
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " drops the " + GetDisplayAlias(obj) + ".")
return (true)
obj.parent = game.pov
PrintIfHere (npc.parent, CapFirst(GetDisplayName(Member(npc))) + " gives you the " + GetDisplayAlias(obj) + ".")
return (true)
if (not obj.locked) {
obj.locked = true
PrintIfHere (npc.parent, CapFirst(GetDisplayName(Member(npc))) + " locks the " + GetDisplayAlias(obj) + ".")
}
return (true)
if (obj.locked) {
obj.locked = false
PrintIfHere (npc.parent, CapFirst(GetDisplayName(Member(npc))) + " unlocks the " + GetDisplayAlias(obj) + ".")
}
return (true)
if (not obj.isopen) {
obj.isopen = true
PrintIfHere (npc.parent, CapFirst(GetDisplayName(Member(npc))) + " opens the " + GetDisplayAlias(obj) + ".")
}
return (true)
if (obj.isopen) {
obj.isopen = false
PrintIfHere (npc.parent, CapFirst(GetDisplayName(Member(npc))) + " closes the " + GetDisplayAlias(obj) + ".")
}
return (true)
if (not obj.worn) {
obj.worn = true
obj.parent = npc
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " puts on the " + GetDisplayAlias(obj) + ".")
}
return (true)
if (obj.worn) {
obj.worn = false
obj.parent = npc
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " takes off the " + GetDisplayAlias(obj) + ".")
}
return (true)
return (NpcInclude(obj, npc))
return (true)
if (not npc.parent = obj.parent) {
NpcGoTo(npc, obj.parent)
}
else if (HasAttribute(npc, "followidle")) {
msg(PickOneString(npc.followidle))
}
return (false)
return (NpcGoTo(npc, obj.parent))
exitlist = NewObjectList()
foreach (ex, AllExits()) {
if (not GetBoolean(ex, "stopallnpcs") and not GetBoolean(ex, "stop" + npc.name) and not ex.locked and ex.visible) {
list add (exitlist, ex)
}
}
return (PathLib_GetPathExt(npc.parent, obj, exitlist, -1))
l = GetRoute(npc, obj)
if (ListCount(l) = 0) {
return (true)
}
exit = ObjectListItem(l, 0)
NpcMove (npc, exit.to)
return (ListCount(l) = 1)
npc.posture = "sit"
npc.posture_object = obj
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " sits on the " + GetDisplayAlias(obj) + ".")
return (true)
if (DoesInherit(obj, "furniture_type")) {
npc.posture = "stand"
npc.posture_object = obj
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " stands on the " + GetDisplayAlias(obj) + ".")
}
else {
npc.posture = null
npc.posture_object = null
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " stands up.")
}
return (true)
npc.posture = "recline"
npc.posture_object = obj
PrintIfHere (npc.parent, CapFirst(GetDisplayName(npc)) + " lies down on the " + GetDisplayAlias(obj) + ".")
return (true)
npc.deletefromlist = true
if (HasScript (npc, "npcscript")) {
d = NewDictionary()
dictionary add (d, "item", obj)
do (npc, "npcscript", d)
}
return (npc.deletefromlist)
if (not DoesInherit(npc, "GroupType")) error (npc.name + " is not a group!")
return (obj.group = npc)
if (not DoesInherit(npc, "GroupType")) error (npc.name + " is not a group!")
return (ListCount(GroupMembers(npc)) = obj.count)
if (not DoesInherit(npc, "GroupType")) error (npc.name + " is not a group!")
obj.group = npc
do(npc, "resetalias")
npc.parent = obj.parent
return (true)
if (not DoesInherit(npc, "GroupType")) error (npc.name + " is not a group!")
obj.group = null
do(npc, "resetalias")
return (true)
if (not DoesInherit(npc, "GroupType")) error (npc.name + " is not a group!")
foreach (member, GroupMembers(npc)) {
member.group = null
}
do(npc, "resetalias")
return (true)
0 and path = null and (maxlength = -1 or length <= maxlength)) {
iterations = iterations + 1
//msg("iterations = " + iterations)
entry = current[0]
list remove(current, entry)
room = entry["room"]
//msg("room = " + room.name)
room.pathlib_visited = game.pathID
//msg("entry=" + entry)
if (room = end) {
path = entry["path"]
//msg("path=" + path)
} else {
foreach (exit, exits) {
toRoom = exit.to
//msg("toRoom = " + toRoom)
if (toRoom <> null) {
if (exit.parent = room) {
// This is a room to be investigated.
if (GetInt(toRoom, "pathlib_current") <> game.pathID and GetInt(toRoom, "pathlib_visited") <> game.pathID) {
// We have not touched this room yet. Add its exit to the list.
newEntry = _PathLib_AddEntry(current, toRoom)
// Assign to an object attribute to force a copy.
game.PathLib_pathtemp = entry["path"]
list add(game.PathLib_pathtemp, exit)
dictionary add(newEntry, "path", game.PathLib_pathtemp)
game.PathLib_pathtemp = null
//msg("Added")
}
}
}
}
}
length = ListCount(entry["path"])
}
//msg("iterations = " + iterations + ", path count = " + ListCount(path))
return (path)
]]>
// From PathLib by Jay Nabonne
entry = NewDictionary()
dictionary add(entry, "room", room)
list add(list, entry)
room.pathlib_current = game.pathID
return (entry)
_ObjectEditor
NPC
editor_room;editor_player
dropdowntypes
Type
*=None; MaleNpc=Male NPC; FemaleNpc=Female NPC; NpcType=Generic NPC; GroupType=Group
150
textbox
Agreement message (will appear inside quotes; can use text processor)
yesmsg
NpcType
GroupType
Check agreement script
script
checkagreement
NpcType
GroupType
label
Should set "complies" attribute to true if the NPC is agreeable, false otherwise.
NpcType
GroupType
label
Should give a response if the NPC refuses.
NpcType
GroupType
label
Can use "command", "object" local variables.
NpcType
GroupType
scriptdictionary
Script to run when this NPC is gives an object to another NPC
npc_give_script_list
Name of object given
NpcType
GroupType
label
Can use "subject" (the receiving NPC) and "object" local variables.
NpcType
GroupType
_ObjectEditor
NPC Actions
NpcType
List of actions to perform
list
actions
200
NpcType
Action (eg Move:kitchen, or just text)
title
Available actions:
NpcType
label
Move: NPC will move directly to the indicated room
NpcType
label
GoTo: NPC will go to the specified location, one turn per room. Use GoToParent to have the NPC navigate to the same room as an item or another NPC.
NpcType
label
Get/Drop/Give: NPC will pick up/drop/give to the player the indicated item (whether it is there or not)
NpcType
label
Lock/Unlock/Open/Close/Wear/Remove: NPC will lock/unlock/open/close/wear/remove the indicated item (whether it is there or not)
NpcType
label
Sit/Stand/Recline: NPC will sit/stand/recline on the indicated item (whether it is there or not); use "Stand" with an item that is not furniture to have the NPC stand up.
NpcType
label
Search: NPC will move via a random exit, and will continue to do so until in the same room as the indicated item
NpcType
label
Wait: NPC will wait, and will continue to do so until the player or other NPC is the same room if the indicated item is the player or an NPC, or the indicated item is unlocked if it has a "locked" attribute, or until given the indicated item otherwise.
NpcType
label
Pause: NPC does nothing for one turn.
NpcType
label
Script: Runs the NPC's "npcscript" script. If this sets the NPC's "deletefromlist" attribute to false, then this will run again next turn.
NpcType
label
You can add your own verbs; add a new function called "Npc", followed by the verb, have it return a Boolean, and take two attributes, the NPC and the item.
NpcType
title
Script
NpcType
script
NPC script (run with NpcScript)
npcscript
200
NpcType
label
Set this.deletefromlist to false to have the script run again next turn.
NpcType
_ObjectEditor
Items for NPCs
editor_room; defaultplayer;NpcType
multi
Take (NPC)
npc_take
null=Default behaviour;boolean=Boolean; script=Run script
Item can be taken by NPC
multi
Drop (NPC)
npc_drop
null=Default behaviour;boolean=Boolean; script=Run script
Item can be dropped by NPC
dropdowntypes
Type
*=None; furniture_type=Furniture
150
title
Furniture
furniture_type
dropdown
Preferred posture
preferred_posture
sit;stand;recline
furniture_type
title
Standing...
furniture_type
Can stand on?
checkbox
canstandon
200
furniture_type
textbox
Stand on message
standonmsg
furniture_type
this.canstandon
textbox
Get off message
standoffmsg
furniture_type
this.canstandon
textbox
No standing message
nostandmsg
furniture_type
not this.canstandon
title
Sitting...
furniture_type
Can sit on?
checkbox
cansiton
200
furniture_type
textbox
Sit on message
sitonmsg
furniture_type
this.cansiton
textbox
Get off message
sitoffmsg
furniture_type
this.cansiton
textbox
No sitting message
nositmsg
furniture_type
not this.cansiton
title
Reclining...
furniture_type
Can recline on?
checkbox
canreclineon
200
furniture_type
textbox
Recline on msg
reclineonmsg
furniture_type
this.canreclineon
textbox
Get off message
reclineoffmsg
furniture_type
this.canreclineon
textbox
No reclining message
noreclinemsg
furniture_type
not this.canreclineon
label
Note: ### is used as a stand-in for this object (prepended by "the" if appropriate).
furniture_type
_ObjectEditor
Postures
editor_object; defaultplayer
checkbox
nositting
Sitting/reclining prohibited
textbox
No sitting msg
nositmsg
GetBoolean(this, "nositting")
textbox
No reclining msg
noreclinemsg
GetBoolean(this, "nositting")
textbox
Surface name
posture_surface
not GetBoolean(this, "nositting")