! IAGE Template Library 020326
! Written by R.Rawson-Tetley
! ======================================
! Modifications:
! 26 Mar 02 Few new synonym verbs added.
! New "pronouns" verb and action.
! Fix to it pronoun where it would wipe out the last noun if
! no noun was entered.
! Better sub-location support for exiting state items.
! Default help message and support for credits
! 22 Mar 02 Fixed bug in nearby item scoping check
! 20 Mar 02 Added calls so parser can understand answers to its questions
! 19 Mar 02 Added SynonymMapper routine to simplify some player statements
! Fixed bug in NearbyItems scoping check
! Changed a few messages prior to parser question-answering
! support being implemented
! Added error message for get all with no available items.
! 21 Feb 02 Added CustomDeath and addverb for "over"
! 19 Feb 02 Fixed death and won routines to use correct score routine.
! Fixed "it" pronoun bug.
! 11 Nov 01 Additional adverbs
! 09 Nov 01 Added Score updater (AddScore)
! 31 Oct 01 Fix to bodypart code
! 29 Oct 01 Added routine to consolidate movements - easier for location trapping.
! 28 Oct 01 Added consult, ask and tell to override secondary noun checks.
! 19 Oct 01 Moved dictionary into code
GameCode {
Name "Library"
MaxItemsCanCarry 15
MaxWeightCanCarry 50
MaxSizeCanCarry 50
StartingLocation limbo
ShowAvailableExits no
AllowPersist yes
SinglePlayerGame no
MaxUsers 128
RealTimeNPCs no
UsingIAGECombat yes
UsingIAGEMoney no
WideInventoryDisplay yes
PlayersStayDead no
NPCsStayDead no
AfterInputImmediate: Override [
' This line handles the use of the "it" pronoun.
call ITPronoun.updateit
' This line performs replacement checks for the use of
' male/female pronouns when dealing with NPCs.
call NPCPronouns.replacenouns
' This line maps various ways the player can say
' the same thing to an easier form for the author
' and library to pick up and use
call SynonymMapper.map
' This line calls the routine which handles tighter object
' scoping by checking that objects referenced actually reside
' near the player before allowing them to do anything
' with them.
call NearbyItems.scopecheck
]
Start: Override [
' Show the game version, the library version
' and output the start location to the player
game.displayversion
call StandardLib.DisplayLibraryVersion
game.displaycurrentlocation
' default male/female pronouns
call NPCPronouns.init
]
DisplayBanner: Override [
' Display score / turns
returnvalue = currentplayer.score_&_message(25).text_&_currentplayer.turns
]
Score: Override [
call StandardLib.ShowScore
]
Initialise: Override [
' Build our dictionary on startup
call StandardLib.createverbs
call StandardLib.createadverbs
call StandardLib.createnouns
]
AfterInput: Override [
' This line calls the standard AfterInput library, which generates
' stock responses. You can edit these responses by changing the
' messages 1 - 200
call StandardLib.AfterInput
]
}
!! IAGE Standard Library Responses !!
LibraryMessage 2 "You are carrying too much to take that."
LibraryMessage 3 "Your load is too heavy to take that."
LibraryMessage 4 "You can't see any %s here!"
LibraryMessage 5 "[ What do you want to %s? ]"
LibraryMessage 6 "%s: Taken."
LibraryMessage 7 "You have:"
LibraryMessage 8 " Nothing"
LibraryMessage 9 "[ Where do you want to go? ]"
LibraryMessage 10 "You can't go that way."
LibraryMessage 11 "%s: Dropped."
LibraryMessage 12 "You aren't carrying any %s!"
LibraryMessage 13 "It is pitch black and you cannot see."
LibraryMessage 14 "You can't %s that!"
LibraryMessage 15 "%s: Worn."
LibraryMessage 16 "[ You must supply a verb! ]"
LibraryMessage 17 "[ I don't understand. ]"
LibraryMessage 18 "[ What do you want to put the %s into? ]"
LibraryMessage 19 "%s: Done."
LibraryMessage 20 "%s: It doesn't fit."
LibraryMessage 21 "You can't put an object inside itself!"
LibraryMessage 22 "[ What do you want to remove items from? ]"
LibraryMessage 23 "Flailing wildly in fresh air will not help you."
LibraryMessage 24 "Bizarrely, you can't."
LibraryMessage 25 "/"
LibraryMessage 26 "You have scored"
LibraryMessage 27 "(out of a possible 350) in"
LibraryMessage 28 "turns."
LibraryMessage 29 "Score Build Buffer"
LibraryMessage 30 "That was a rhetorical question."
LibraryMessage 31 "You sound very negative."
LibraryMessage 32 "I'm afraid you will have to help yourself."
LibraryMessage 33 "As good-looking as ever."
LibraryMessage 34 "%s entered the game."
LibraryMessage 35 "The player named ~%s~ is now known as ~%s~."
LibraryMessage 36 "[ That was not a valid player alias. ]"
LibraryMessage 37 "[ This game is now in Verbose mode. Location descriptions will be shown with as much detail as possible - even for locations you have already visited. ]"
LibraryMessage 38 "[ This game is now in brief mode. Detailed location descriptions will not be shown for locations you have already visited. ]"
LibraryMessage 39 "[ I do not understand the word ~%s~ ]"
LibraryMessage 40 "Dark"
LibraryMessage 41 "Exits Lead:"
LibraryMessage 42 "North"
LibraryMessage 43 "South"
LibraryMessage 44 "East"
LibraryMessage 45 "West"
LibraryMessage 46 "Up"
LibraryMessage 47 "Down"
LibraryMessage 48 "Northeast"
LibraryMessage 49 "Northwest"
LibraryMessage 50 "Southeast"
LibraryMessage 51 "Southwest"
LibraryMessage 52 "Nowhere."
LibraryMessage 53 "and"
LibraryMessage 54 "There is"
LibraryMessage 55 "here."
LibraryMessage 56 "(which is providing light)"
LibraryMessage 57 "is here."
LibraryMessage 58 "follows"
LibraryMessage 59 "enters."
LibraryMessage 60 "The %s contains:"
LibraryMessage 61 "goes"
LibraryMessage 62 "You can't attack someone with %s!"
LibraryMessage 63 "%s attacks %s and misses."
LibraryMessage 64 "%s attacks %s for %s points of damage."
LibraryMessage 65 "%s is dead."
LibraryMessage 66 "%s drops all their objects."
LibraryMessage 67 "%s pops into existence."
LibraryMessage 68 "%s has quit."
LibraryMessage 69 "You have been killed."
LibraryMessage 70 "You now have %s's money. Your potential damage and hit points have been increased accordingly."
LibraryMessage 71 "Opened."
LibraryMessage 72 "It's already open."
LibraryMessage 73 "Closed."
LibraryMessage 74 "It's already closed."
LibraryMessage 75 "The %s is open."
LibraryMessage 76 "The %s is closed."
LibraryMessage 77 "takes"
LibraryMessage 78 "(being worn)"
LibraryMessage 79 "(which is open)"
LibraryMessage 80 "(which is closed)"
LibraryMessage 81 "You can't put things in the %s."
LibraryMessage 82 "You can't put things on the %s."
LibraryMessage 83 "[ You can only put items into or onto other items - other prepositions are not supported. ]"
LibraryMessage 84 "On the %s is:"
LibraryMessage 85 "You are now laid on the %s."
LibraryMessage 86 "%s lays down on the %s."
LibraryMessage 87 "You are now sat on the %s."
LibraryMessage 88 "%s sits down on the %s."
LibraryMessage 89 "You are now stood on the %s."
LibraryMessage 90 "%s stands on the %s."
LibraryMessage 91 "%s stands up."
LibraryMessage 92 "You stand up."
LibraryMessage 93 "You can't %s on that!"
LibraryMessage 94 "(sat on the %s)"
LibraryMessage 95 "(stood on the %s)"
LibraryMessage 96 "(laid on the %s)"
LibraryMessage 97 "You have been hit for %s points of damage by %s!"
LibraryMessage 98 "You have %s hit points remaining.
You can cause a maximum of %s damage points without weaponry.
In combat, you have a %s% chance of hitting your target."
LibraryMessage 99 "You have %s gold pieces."
LibraryMessage 100 "(Weapon, max %s damage points)"
LibraryMessage 101 "Hmm.. Tasty!"
LibraryMessage 102 "Suicide isn't the answer."
LibraryMessage 103 "You don't notice anything special about the %s."
LibraryMessage 104 "Opening the %s reveals:"
LibraryMessage 105 "%s hit points remaining.
%s maximum damage.
%s chance of hitting."
LibraryMessage 106 "%s is carrying:"
LibraryMessage 107 "You can't get inside that!"
LibraryMessage 108 "%s gets inside the %s."
LibraryMessage 109 "You get inside the %s."
LibraryMessage 110 "%s gets out of %s."
LibraryMessage 111 "You get out of %s."
LibraryMessage 112 "You aren't inside anything!"
LibraryMessage 113 "(inside the %s)"
LibraryMessage 114 "There's nothing under there."
LibraryMessage 115 "[ What do you want to look under? ]"
LibraryMessage 116 "There's nothing behind there."
LibraryMessage 117 "[ What do you want to look behind? ]"
LibraryMessage 118 "There's nothing through there."
LibraryMessage 119 "[ What do you want to look through? ]"
LibraryMessage 120 "You don't smell anything interesting."
LibraryMessage 121 "You don't hear anything interesting."
LibraryMessage 122 "Now is not the time for napping!"
LibraryMessage 123 "Time passes..."
LibraryMessage 124 "[ Who do you want to ask? ]"
LibraryMessage 125 "[ What you want to ask about? ]"
LibraryMessage 126 "[ Who do you want to tell? ]"
LibraryMessage 127 "[ What do you want to tell them about? ]"
LibraryMessage 128 "Feeling slightly foolish, you give a wave."
LibraryMessage 129 "No need for apologies."
LibraryMessage 130 "You jump in the air."
LibraryMessage 131 "Swearing shows a lack of vocabulary."
LibraryMessage 132 "[ Please enter the password for your save: ]"
LibraryMessage 133 "
*** You have died ***
"
LibraryMessage 134 "Press ENTER to end your session:"
LibraryMessage 135 "
*** You have won! ***
"
LibraryMessage 136 "Don't strain yourself."
LibraryMessage 137 "What a beautiful singing voice you have."
LibraryMessage 138 "But nothing is on sale here."
LibraryMessage 139 "The prayer has little effect, but at least YOU feel better."
LibraryMessage 140 "[ Who do you want to wake? ]"
LibraryMessage 141 "Now is not the time for such things."
LibraryMessage 142 "Taken."
LibraryMessage 143 "Done."
LibraryMessage 144 "Dropped."
LibraryMessage 145 "There is nothing here you can take."
LibraryMessage 146 "
INSTRUCTIONS
This game uses the IAGE Interactive Fiction engine. IAGE games can be played simultaneously with friends or
by yourself.
MULTIPLAYER COMMANDS:
listplayers - Displays a list of everyone currently in the game.
savestate - Saves your position for later. Note that you will need to use
the same nickname for future sessions to restore this position. Also note that saved
games require a password.
restorestate - Restores a saved position.
setalias ~newname~ - Changes your in-game nickname to ~newname~.
say ~text~ - (or $) Says ~text~ to everyone in the location.
shout ~text~ - (or %) Shouts ~text~ to everyone in surrounding locations.
do ~text~ - Outputs text of an action to everyone in the location.
NORMAL COMMANDS:
This game understands ~normal~ interactive fiction commands - imperative statements
to your player character to perform actions.
Compass directions (n,s,e,w,u,d,ne,nw,se,sw) move around the map. In addition, you may
ENTER or GET IN things.
You may (for example) TAKE, DROP, PUT, REMOVE and EXAMINE items, among many other
accepted verbs.
In addition, IAGE will happily understand TAKE ALL, TAKE ALL BUT THE SWORD,
or even TAKE THE APPLE, THE COIN AND THE SWORD.
INVENTORY (or ~i~) tells you what you are carrying,
AGAIN (or ~g~) will repeat your last command.
LOOK, REDESCRIBE (or ~l~, or ~r~) will redisplay your surroundings.
To speak to nearby players and NPCs, use the ~SAY ~ command - free, English
text is expected.
VERBOSE and BRIEF allow you to change whether room descriptions are displayed in
their entirity on subsequent visits.
SCORE or FULLSCORE displays your score to you.
STATUS or DIAGNOSE will report your current state of health if this game supports combat.
PRONOUNS will output what IAGE thinks the current pronouns are for it/them/those/him/her.
EXAMINE and SEARCH allow you to look at items closely.
It is also possible to LOOK IN, LOOK AT, LOOK UNDER and LOOK BEHIND objects.
Senses are supported through the SMELL, LISTEN, TOUCH, FEEL and TASTE commands.
You may also send a number of commands at once, breaking them with a full-stop (.) or
the word ~then~ - eg. ~open mailbox. get leaflet then read it~.
Good luck!
"
Module StandardLib {
proc DisplayLibraryVersion
currentplayer.print IAGE^Library^Version^020326
end
proc ShowScore
' Display the score to the player
currentplayer.print message(26).text_&_^_&_currentplayer.score_&_^_&_message(27).text_&_^_&_currentplayer.turns_&_^_&_message(28).text
end
proc AddScore scamount
' Adds to player's score and tells them
currentplayer.score = currentplayer.score_+_scamount
currentplayer.print [^Your^score^just^went^up^by^_&_scamount_&_^points.^]
end
proc AfterInput
;version,credits
message(1).show
end
endif
;swim
message(23).show
end
endif
;score
currentplayer.showscore
end
endif
;fly
message(24).show
end
endif
;yes
message(30).show
end
endif
;no
message(31).show
end
endif
;help,info
message(146).show
game.displaycurrentlocation
end
endif
' Examine myself --
;examine
if ( input.noun = 4 ) then
message(33).show
end
endif
endif
' Look at me --
;look
if ( input.noun = 4 ) then
message(33).show
end
endif
endif
' Attack myself --
;attack
if ( input.noun = 4 ) then
message(102).show
end
endif
endif
' Attack --
;attack
if ( input.noun = currentplayer.index_+_1000000 ) then
message(102).show
end
endif
endif
' Look under --
;look
#under
if ( input.noun <> 0 ) then
message(114).show
end
else
message(115).show
currentplayer.askparserquestion 1
end
endif
endif
endif
' Look behind --
;look
#behind
if ( input.noun <> 0 ) then
message(116).show
end
else
message(117).show
currentplayer.askparserquestion 1
end
endif
endif
endif
' Look through --
;look
#through
if ( input.noun <> 0 ) then
message(118).show
end
else
message(119).show
currentplayer.askparserquestion 1
end
endif
endif
endif
' Smell --
;smell
message(120).show
end
endif
' Listen --
;listen
message(121).show
end
endif
' Sleep --
;sleep
message(122).show
end
endif
' Wait --
;wait
message(123).show
end
endif
' Show --
;show
if ( input.noun2 = 0 ) then
var iid = getitemfromnoun(input.noun)
currentplayer.print [^Who^do^you^want^to^show^the^_&_item(iid).thename_&_^to?^]
currentplayer.askparserquestion 2
end
endif
endif
' Ask --
;ask
if ( input.noun = 0 ) then
message(124).show
currentplayer.askparserquestion 1
end
endif
if ( input.noun2 = 0 ) then
message(125).show
currentplayer.askparserquestion 2
end
endif
endif
' Tell --
;tell
if ( input.noun = 0 ) then
currentplayer.print message(126).show
currentplayer.askparserquestion 1
end
endif
if ( input.noun2 = 0 ) then
currentplayer.print message(127).show
currentplayer.askparserquestion 2
end
endif
endif
' Think --
;think
message(136).show
end
endif
' Wave --
;wave
message(128).show
end
endif
' Sorry --
;sorry
message(129).show
end
endif
;jump
message(130).show
end
endif
;fuck
message(131).show
end
endif
;sing
message(137).show
end
endif
;buy
message(138).show
end
endif
;pray
message(139).show
end
endif
;wake
if ( input.noun = 0 ) then
message(140).show
currentplayer.askparserquestion 1
end
endif
endif
;kiss
message(141).show
end
endif
' Get all - make sure there is something to get
;get
if ( input.noun = 2 ) then
var curobj = 1
var fndone = 0
while ( curobj < |item(1).count + 1| ) then
if ( item(curobj).currentlocation = currentplayer.currentlocation ) then
if ( item(curobj).invisible = false ) then
fndone = 1
endif
endif
curobj = |curobj + 1|
endwhile
if ( fndone = 0 ) then
message(145).show
end
endif
endif
endif
' Requesting pronouns
;pronouns
call ITPronoun.showpronouns
end
endif
' Getting up/down off things that are stood, sat or laid on
' -- exiting state items.
;get,climb,stand
#down,off,up
var nono = getitemfromnoun input.noun
if ( input.noun = 0 ) and ( currentplayer.stateitem <> 0 ) and ( currentplayer.state > 1 ) then
currentplayer.print "Ok."
currentplayer.state = 1
currentplayer.stateitem = 0
game.displaycurrentlocation
endif
if ( currentplayer.stateitem = nono ) and ( currentplayer.state > 1 ) then
currentplayer.print "Ok."
currentplayer.state = 1
currentplayer.stateitem = 0
game.displaycurrentlocation
endif
endif
endif
' Player State Saving
' ================================
' Quick note on state saving - the save/restore state commands
' require an identifier and a password. This default trap
' always gives the same identifier, meaning the same person can
' only have one save on the server.
' Saves are stored in the same location as the game file with the
' extension .STATE and the game name, player's name and identifier.
;savestate
var pass = ask message(132).text
currentplayer.savestate 00 pass
end
endif
;restorestate
var pass = ask message(132).text
currentplayer.restorestate 00 pass
end
endif
end
proc Dead
message(133).show
currentplayer.showscore
var death = ask message(134).text
currentplayer.quit
end
proc Won
message(135).show
currentplayer.showscore
var death = ask message(134).text
currentplayer.quit
end
proc CustomDeath dmess
currentplayer.print |"
***" & dmess & "***
"|
currentplayer.showscore
var death = ask message(134).text
currentplayer.quit
end
proc createverbs
addverb 1 go
addverb 1 walk
addverb 1 run
addverb 2 look
addverb 2 l
addverb 2 redescribe
addverb 2 r
addverb 3 version
addverb 3 ver
addverb 4 help
addverb 5 get
addverb 5 grab
addverb 5 take
addverb 6 drop
addverb 7 put
addverb 8 remove
addverb 9 light
addverb 10 extinguish
addverb 11 switch
addverb 11 turn
addverb 11 rotate
addverb 12 inventory
addverb 12 i
addverb 13 examine
addverb 13 x
addverb 13 watch
addverb 13 describe
addverb 13 check
addverb 14 say
addverb 15 shout
addverb 16 wear
addverb 16 don
addverb 18 open
addverb 18 unwrap
addverb 19 close
addverb 19 wrap
addverb 19 shut
addverb 19 cover
addverb 20 read
addverb 21 smash
addverb 21 break
addverb 21 destroy
addverb 22 eat
addverb 23 drink
addverb 23 swallow
addverb 23 sip
addverb 24 lock
addverb 25 unlock
addverb 26 kill
addverb 26 attack
addverb 27 throw
addverb 28 push
addverb 28 shove
addverb 29 pull
addverb 30 kick
addverb 30 smack
addverb 30 hit
addverb 30 punch
addverb 30 fight
addverb 31 what
addverb 32 where
addverb 33 who
addverb 34 how
addverb 35 why
addverb 36 swim
addverb 37 fly
addverb 38 yes
addverb 39 no
addverb 40 climb
addverb 40 scale
addverb 41 score
addverb 41 fullscore
addverb 42 jump
addverb 42 skip
addverb 42 hop
addverb 43 smell
addverb 44 listen
addverb 45 "."
addverb 45 then
addverb 46 setalias
addverb 47 listplayers
addverb 48 getscore
addverb 49 say
addverb 49 $
addverb 50 shout
addverb 50 %
addverb 51 quit
addverb 52 run_on_start
addverb 53 verbose
addverb 54 brief
addverb 55 again
addverb 55 g
addverb 56 lie
addverb 57 sit
addverb 58 stand
addverb 59 status
addverb 59 diagnose
addverb 60 move
addverb 61 do
addverb 63 sleep
addverb 63 doze
addverb 63 nap
addverb 64 fuck
addverb 64 piss
addverb 64 shit
addverb 64 cunt
addverb 64 bastard
addverb 65 wait
addverb 66 consult
addverb 67 show
addverb 67 present
addverb 67 display
addverb 68 ask
addverb 69 tell
addverb 70 wave
addverb 71 burn
addverb 72 set
addverb 73 search
addverb 74 blow
addverb 75 stroke
addverb 75 fuss
addverb 75 pet
addverb 76 fix
addverb 77 sorry
addverb 79 dig
addverb 80 cut
addverb 80 chop
addverb 80 slice
addverb 80 prune
addverb 83 oops
addverb 84 inflate
addverb 85 screw
addverb 85 tighten
addverb 86 unscrew
addverb 87 savestate
addverb 88 restorestate
addverb 89 doff
addverb 89 unwear
addverb 89 disrobe
addverb 90 give
addverb 90 feed
addverb 90 offer
addverb 91 touch
addverb 91 feel
addverb 91 fondle
addverb 91 grope
addverb 92 taste
addverb 93 think
addverb 93 contemplate
addverb 93 cogitate
addverb 93 pontificate
addverb 94 sing
addverb 95 buy
addverb 95 purchase
addverb 95 pay
addverb 96 answer
addverb 97 squeeze
addverb 97 squash
addverb 98 set
addverb 99 rub
addverb 100 blow
addverb 101 swing
addverb 102 fill
addverb 103 tie
addverb 103 fasten
addverb 103 attach
addverb 103 fix
addverb 104 untie
addverb 105 pray
addverb 106 wake
addverb 107 burn
addverb 108 kiss
addverb 108 embrace
addverb 108 hug
addverb 109 pronouns
addverb 110 pick
addverb 111 info
addverb 112 credits
addverb 113 knock
addverb 114 talk
addverb 114 speak
end
proc createnouns
addnoun 1 it
addnoun 1 them
addnoun 1 those
addnoun 2 all
addnoun 2 everything
addnoun 3 except
addnoun 3 but
addnoun 4 me
addnoun 4 myself
addnoun 5 him
addnoun 5 his
addnoun 5 he
addnoun 6 her
addnoun 6 hers
addnoun 6 she
end
proc createadverbs
addadverb 1 north
addadverb 1 n
addadverb 2 south
addadverb 2 s
addadverb 3 east
addadverb 3 e
addadverb 4 west
addadverb 4 w
addadverb 5 up
addadverb 5 u
addadverb 6 down
addadverb 6 d
addadverb 7 northeast
addadverb 7 ne
addadverb 8 northwest
addadverb 8 nw
addadverb 9 southeast
addadverb 9 se
addadverb 10 southwest
addadverb 10 sw
addadverb 11 on
addadverb 12 off
addadverb 13 in
addadverb 13 enter
addadverb 14 out
addadverb 14 leave
addadverb 15 from
addadverb 16 and
addadverb 17 the
addadverb 18 to
addadverb 19 with
addadverb 20 at
addadverb 21 under
addadverb 22 behind
addadverb 23 through
addadverb 24 about
addadverb 25 of
addadverb 26 is
addadverb 27 a
addadverb 28 for
addadverb 29 over
end
}
Module NearbyItems {
' IAGE Nearby Items 011116
' R.Rawson-Tetley.
' For use when you want to show an item as a near to a player, but that player is
' unable to do anything but look at it.
' Also contains routines for item scoping checks.
' To use:
' 1. Add a call to NearbyItems.nearbyhandler in your OnAction code for the item.
' 2. You must provide the inline events before_get, before_put and before_remove in your OnAction
' code and add a call to NearbyItems.nearby_beforemove in EACH one, otherwise some
' humourous results will ensue :-)
' This may seem a little strange, but all you have to do is just have a flag on your object
' that stops these routines being called once whatever condition is satisfied (be it the player
' climbing on something, etc.).
proc nearbyhandler itemno
' Only let through examine instructions - you can look at it and that's about it.
;examine
else
currentplayer.print You^can't^reach^the^_&_item(itemno).thename_&_.
end
endif
end
proc nearby_beforemove itemno
returnvalue = You^can't^reach^the^_&_item(itemno).thename_&_.
cancelevent
end
' This routine is called to allow tighter scoping checks when dealing with items.
' It will check all referenced nouns and produce failures for the following:
' 1. Reference to any object which is not carried by the player or contained
' by the stateitem the player is occupying. If the player is not occupying
' a stateitem, they can pretty much do anything not protected by other
' NearbyItem code.
proc scopecheck
' doesn't apply to examines
;examine
else
if ( currentplayer.stateitem <> 0 ) then
var nit = getitemfromnoun input.noun
if ( nit <> 0 ) then
' Item not contained by player state item
if ( item(nit).currentlocation <> item(currentplayer.stateitem).containedlocation ) then
' Item not on surface of player state item
if ( item(nit).currentlocation <> item(currentplayer.stateitem).surfacelocation ) then
' Item not carried by player
if ( item(nit).currentlocation <> currentplayer.containerlocation ) then
' Item not the state item itself
if ( nit <> currentplayer.stateitem ) then
currentplayer.print |"You can't reach the " & item(nit).thename & "."|
end
endif
endif
endif
endif
endif
var nit = getitemfromnoun input.noun2
if ( nit <> 0 ) then
if ( item(nit).currentlocation <> item(currentplayer.stateitem).containerlocation ) then
if ( item(nit).currentlocation <> item(currentplayer.stateitem).surfacelocation ) then
if ( item(nit).currentlocation <> currentplayer.containerlocation ) then
if ( nit <> currentplayer.stateitem ) then
currentplayer.print |"You can't reach the " & item(nit).thename & "."|
end
endif
endif
endif
endif
endif
var nit = getitemfromnoun input.noun3
if ( nit <> 0 ) then
if ( item(nit).currentlocation <> item(currentplayer.stateitem).containerlocation ) then
if ( item(nit).currentlocation <> item(currentplayer.stateitem).surfacelocation ) then
if ( item(nit).currentlocation <> currentplayer.containerlocation ) then
if ( nit <> currentplayer.stateitem ) then
currentplayer.print |"You can't reach the " & item(nit).thename & "."|
end
endif
endif
endif
endif
endif
endif
endif
}
Module NPCPronouns {
' IAGE NPC Pronouns 011029
' R.Rawson-Tetley
' Allows use of him/her pronouns with NPCs. The reason it is done this way
' is so that "it" can refer to another pronoun - funky eh?
' To use:
' 1. At the very top of the OnAction event of your NPCs, add the line
' call NPCPronouns.male or call NPCPronouns.female depending on
' your NPC's sex.
' 2. In the AfterInputImmediate game event, make a call to:
' call NPCPronouns.replacenouns.
' 3. In the OnStart event, make a call to NPCPronouns.init - make sure it is ONSTART -
' not initialise.
proc male cid
currentplayer.setvalue(malepronoun) = cid
end
proc female cid
currentplayer.setvalue(femalepronoun) = cid
end
proc init
currentplayer.setvalue(malepronoun) = 0
currentplayer.setvalue(femalepronoun) = 0
end
proc replacenouns
if ( input.noun = 5 ) then
if ( currentplayer.getvalue(malepronoun) = 0 ) then
currentplayer.print [^There^is^no^male^pronoun^defined.^]
end
endif
var cid = currentplayer.getvalue(malepronoun)
input.noun = character(cid).nounid
currentplayer.print (_&_character(cid).name_&_)
currentplayer.outputtoplayer = false
end
endif
if ( input.noun2 = 5 ) then
if ( currentplayer.getvalue(malepronoun) = 0 ) then
currentplayer.print [^There^is^no^male^pronoun^defined.^]
end
endif
var cid = currentplayer.getvalue(malepronoun)
input.noun2 = character(cid).nounid
currentplayer.print (_&_character(cid).name_&_)
currentplayer.outputtoplayer = false
end
endif
if ( input.noun3 = 5 ) then
if ( currentplayer.getvalue(malepronoun) = 0 ) then
currentplayer.print [^There^is^no^male^pronoun^defined.^]
end
endif
var cid = currentplayer.getvalue(malepronoun)
input.noun3 = character(cid).nounid
currentplayer.print (_&_character(cid).name_&_)
currentplayer.outputtoplayer = false
end
endif
if ( input.noun = 6 ) then
if ( currentplayer.getvalue(femalepronoun) = 0 ) then
currentplayer.print [^There^is^no^female^pronoun^defined.^]
end
endif
var cid = currentplayer.getvalue(femalepronoun)
input.noun = character(cid).nounid
currentplayer.print (_&_character(cid).name_&_)
currentplayer.outputtoplayer = false
end
endif
if ( input.noun2 = 6 ) then
if ( currentplayer.getvalue(femalepronoun) = 0 ) then
currentplayer.print [^There^is^no^female^pronoun^defined.^]
end
endif
var cid = currentplayer.getvalue(femalepronoun)
input.noun2 = character(cid).nounid
currentplayer.print (_&_character(cid).name_&_)
currentplayer.outputtoplayer = false
end
endif
if ( input.noun3 = 6 ) then
if ( currentplayer.getvalue(femalepronoun) = 0 ) then
currentplayer.print [^There^is^no^female^pronoun^defined.^]
end
endif
var cid = currentplayer.getvalue(femalepronoun)
input.noun3 = character(cid).nounid
currentplayer.print (_&_character(cid).name_&_)
currentplayer.outputtoplayer = false
end
endif
end
}
Module ITPronoun {
proc updateit
' If the "it" noun is not the same as the
' actual noun the player used, then
' update what parser thinks the last noun was.
if ( currentplayer.lastnoun <> 1 ) and ( currentplayer.lastnoun <> input.noun ) and ( input.noun <> 0 ) then
currentplayer.lastnoun = input.noun
endif
end
proc showpronouns
' Outputs the current pronoun settings to the player
var outs = "Current Pronouns
"
outs = |outs & "It/Them/Those: "|
if ( currentplayer.lastnoun <> 0 ) then
' See if it's an item
var nono = getitemfromnoun currentplayer.lastnoun
if ( nono <> 0 ) then
' It is! Show it
outs = |outs & item(nono).thename & "
"|
else
outs = |outs & "[ Defined non-object, PC or NPC ]
"|
endif
else
outs = |outs & "[ Not defined ]
"|
endif
outs = |outs & "Him/He/His: "|
var cid = currentplayer.getvalue(malepronoun)
if ( cid <> 0 ) then
outs = |outs & character(cid).name & "
"|
else
outs = |outs & "[ Not defined ]
"|
endif
outs = |outs & "She/Her/Hers: "|
var cid = currentplayer.getvalue(femalepronoun)
if ( cid <> 0 ) then
outs = |outs & character(cid).name & "
"|
else
outs = |outs & "[ Not defined ]
"|
endif
currentplayer.print outs
end
}
Module SynonymMapper {
' Maps meanings to simpler terms for the parser (and author!)
proc map
' NO VERB AND DIRECTION = GO DIRECTION
' ====================================
#n,s,e,w,u,d,ne,se,nw,sw,in,out
if ( input.verb = 0 ) then
input.verb = 1
end
endif
endif
' PICK UP = GET
' =================
;pick
#up
input.verb = 5
input.adverb = 0
end
endif
endif
' PUT DOWN = DROP
' ==================
;put
#down
input.verb = 6
input.adverb = 0
end
endif
endif
' GET X FROM = REMOVE X FROM
' ==========================
;get
#from
input.verb = 8
end
endif
endif
' GET X OFF = REMOVE X FROM
' =========================
;get
#off
if ( input.noun <> 0 ) then
input.verb = 8
input.adverb = 15
end
endif
endif
endif
end
}