I coded a watch which should always be worn by the actor. The start of the game shows that the actor is holding the watch instead of wearing it? I’ve included all the code that should be causing this problem.
/* A class for clothing worn by the player character, and which we can't take *
* off. We use this for the PC's constant compliment of articles. *************/
class AlwaysWorn: Wearable
WornBy = me
dobjFor(Doff)
{
check()
{
cannotDoffMsg;
exit;
}
}
cannotDoffMsg = "You must keep this with you."
/* Exclude these from DROP ALL and DOFF ALL */
hideFromAll(action)
{
return action.ofKind(DropAction)
|| action.ofKind(DoffAction)
|| action.ofKind(PutInAction)
|| inherited(action);
}
;
/* Show actor. ****************************************************************/
me: BagOfHolding, Actor
location = Beach
VocabWords = 'Tom Thomas Tom/Thomas/Leavens'
desc
{
"You're Thomas Leavens. You are known as Dr. Tom to your friends and
associates. Your ex-wife calls you names that can't be repeated! Other than
your underwear and socks, you're wearing your usual working attire. ";
}
affinityFor(obj)
{
return (obj != self && obj.ofKind(Wearable) ? 50 : 0);
}
inventoryLister: actorInventoryLister
{
showInventoryEmpty(parent)
{
/* empty inventory */
"<<buildSynthParam('The/he', parent)>> {is} holding absolutely
nothing. ";
}
showInventoryWearingOnly(parent, wearing)
{
/* we're carrying nothing but wearing some items */
"<<buildSynthParam('The/he', parent)>> {is}n\'t holding anything,
but {is} sporting <<wearing>>. ";
}
showInventoryCarryingOnly(parent, carrying)
{
/* we have only carried items to report */
"<<buildSynthParam('The/he', parent)>> {is} holding <<carrying>>. ";
}
showInventoryShortLists(parent, carrying, wearing)
{
local nm = gSynthMessageParam(parent);
/* short lists - combine carried and worn in a single sentence */
"<<buildParam('The/he', nm)>> {is} holding <<carrying>>,
and <<buildParam('it\'s', nm)>>{subj} sporting <<wearing>>. ";
}
showInventoryLongLists(parent, carrying, wearing)
{
local nm = gSynthMessageParam(parent);
/* long lists - show carried and worn in separate sentences */
"<<buildParam('The/he', nm)>> {is} holding <<carrying>>.
<<buildParam('It\'s', nm)>> sporting <<wearing>>. ";
}
/*
* For 'tall' listings, we'll use the standard listing style, so we
* need to provide the framing messages for the tall-mode
* listing.
*/
showListPrefixTall(itemCount, pov, parent)
{ "<<buildSynthParam('The/he', parent)>> {is} holding:"; }
showListContentsPrefixTall(itemCount, pov, parent)
{ "<<buildSynthParam('A/he', parent)>>, who {is} holding:"; }
}
/* Use person-sized Bulk. */
bulk = 10
;
+watch: AlwaysWorn 'wrist wristwatch/watch' 'wristwatch'
"It's just a cheap watch."
cannotDoffMsg = "You must wear this."
;
/* Room0001: The Actor Starts Game Here. **************************************/
Beach : OutdoorRoom 'At The Beach' 'At The Beach'
roomFirstDesc()
{ "This is first description.";
}
shortDesc = "You are at the sandy beach.";
;
/* Room0002: The path from/to the beach. **************************************/
I certainly could use some help on this one.
RonG