You see a daisho - as always, comprised of a katana and wakizashi - here.
>EXAMINE DAISHO
A daisho is the name given to a pair of Japanese samurai swords, the long
(katana) and the short (wakizashi). The swords of this particular daisho have
golden hilts and black braiding.
>EXAMINE KATANA
A Japanese longsword, just over three feet long, with a curved blade. The hilt
is made of gold and is covered with black braiding.
>EXAMINE WAKIZASHI
(Same as katana description, with the exception that the wakizashi is defined as
"A Japanese shortsword" and its length is given as being "just over two feet long")
>GET DAISHO
katana: Taken.
wakizashi: Taken.
>INVENTORY
You are carrying:
a daisho (as always, comprised of a katana and wakizashi)
>DROP DAISHO
katana: Dropped.
wakizashi: Dropped.
>GET SWORD
Which sword do you mean, the katana or the wakizashi?
>KATANA
Taken.
>EXAMINE DAISHO
A daisho is the name given to a pair of Japanese samurai swords, the long
(katana) and the short (wakizashi). The swords of this particular daisho have
golden hilts and black braiding.
Currently, you're holding the katana, but the wakizashi is laying on the
ground here.
>INVENTORY
You are carrying:
a katana
>GET WAKIZASHI
Taken.
>INVENTORY
You are carrying:
a daisho (as always, comprised of a katana and wakizashi)
[The following attack sequence is important only to show how I want the swords
to behave should one of them become lost or destroyed. I don't specifically
need to know how to code the ferocious example...]
An example appears out of nowhere and attacks you!
>ATTACK EXAMPLE WITH DAISHO
Unfortunately, you're not skilled in the techniques of dual swordplay; you
may attack the example with either sword, but not both.
>ATTACK EXAMPLE WITH KATANA
You cleave the example in half, but break the katana in the process. Both the
katana and corpse disappear in a puff of plaid smoke.
[Your score has gone down by five points.]
>INVENTORY
You are carrying:
a wakizashi
>EXAMINE DAISHO
A daisho is the name given to a pair of Japanese samurai swords, the long
(katana) and the short (wakizashi). Unfortunately, you have (due to your
carelessness) allowed the katana to be broken, so you are left only with the
wakizashi. Its hilt is made of gold and is covered with black braiding.
>DROP DAISHO
wakizashi: Dropped.
To recap:
A pair of Japanese swords, which may be referred to as a single object
("daisho") or as two seperate objects ("katana" and "wakizashi"). Should one
of the swords become lost or broken, "daisho" may also refer to the remaining
sword. If both swords are being carried, they will be printed in one
inventory entry as being part of the daisho, but if only one is being carried,
the inventory will never make mention of the daisho.
--
daniel r. lackey standing in government denies knowledge
jmdre...@earthlink.net the shadows XVI. the tower
===============================================================================
"God is dead." -- F.W. Nietzsche
"He's not dead, he's... pining for the fjords!" -- M. Palin
[long example]
> A pair of Japanese swords, which may be referred to as a single object
> ("daisho") or as two seperate objects ("katana" and "wakizashi"). Should one
> of the swords become lost or broken, "daisho" may also refer to the remaining
> sword. If both swords are being carried, they will be printed in one
> inventory entry as being part of the daisho, but if only one is being carried,
> the inventory will never make mention of the daisho.
I think, in Inform, the best way to handle this is to scream loudly and
then take up a simpler hobby.
Er, ok. At one point, there was a Inform example which implemented a pair
of gloves, which magically formed and unformed a "pair of gloves" if they
were in the same place. You could look for that. It worked by running a
daemon which actually checked every turn, and removed the two "glove"
objects and put a "pair of gloves" object in their place, or versa. I
don't remember how it ahndled the "drop left glove" case. Probably some
scoping thing.
--Z
--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."
>Er, ok. At one point, there was a Inform example which implemented a pair
>of gloves, which magically formed and unformed a "pair of gloves" if they
>were in the same place. You could look for that.
It's in "Toyshop", one of the examples in the Inform examples directory
(if you can't find it under Inform 6, look under Inform 5).
It's a godawful amount of work for a lousy pair of gloves, if you ask
me.
Mary Kuhner mkku...@genetics.washington.edu
Here's how it ought to be done (in my opinion):
--SNIP SNIP--
Constant Story "Dasisho A-Go-Go";
Constant Headline "^1997 Erik Hetzner^";
Include "parser";
Include "verblib";
Include "grammar";
[ Descendant childObj parentObj tempObj;
for (tempObj = parent (childObj):tempObj ~= nothing:
tempObj = parent (tempObj)) {
if (tempObj == parentObj)
rtrue;
}
rfalse;
];
[ Initialise;
Location = Room;
];
Class Daisho
with parse_name [the_word i;
the_word = NextWord ();
i++;
if (the_word == 'daisho') {
parser_action = ##PluralFound;
return i;
} else if (WordInProperty (the_word, self, name)) {
return i;
}
],
list_together [;
if (Descendant (self, player)) {
print "a daisho";
if ((c_style & NEWLINE_BIT) ~= 0)
print "^";
rtrue;
}
else
rfalse;
];
Object Room "Room"
with description "A small, barren room.",
has light;
Object -> Katana "katana"
class Daisho
with name 'katana';
Object -> Wakizashi "wakizashi"
class Daisho
with name 'wakizashi';
--CUT HERE--
Most of this code comes from money.h, it's all very similar to what
I'd been doing with that, so it wasn't much trouble. Really, the
hardest part was spelling wakizashi. :) But that's only because I've
been staring at problems like this for months, trying to get 'em to
work.
--
Erik Hetzner <e...@uclink4.berkeley.edu>
: I think, in Inform, the best way to handle this is to scream loudly and
: then take up a simpler hobby.
I disagree. It's much simpler to skip the screaming part. :)
: Er, ok. At one point, there was a Inform example which implemented a pair
: of gloves, which magically formed and unformed a "pair of gloves" if they
: were in the same place. You could look for that. It worked by running a
: daemon which actually checked every turn, and removed the two "glove"
: objects and put a "pair of gloves" object in their place, or versa. I
: don't remember how it ahndled the "drop left glove" case. Probably some
: scoping thing.
If *I* were doing this, I think that I'd use a neat parse_name
routine. If the player referred to daisho, it would use ##PluralFound.
This, plus a list_together routine, might do the trick.
--
Erik Hetzner <e...@uclink4.berkeley.edu>
Wasn't that Magic Toyshop? I seem to remember there being a pair of
gloves that you had to use to pick up the tasty piece o' candy. At any
rate, the source should be readily accessible.
--
Spatch conducts top-secret experiments at http://error.net/~spatula
remove the X from my email address when replying. gads, i'm trendy.
"Do you find my method acting unsound?" "I see no acting at all."
mstie#43790
You may want to look at the 'pair of gloves' example in the "Toyshop" example
(available on ftp.gmd.de)
-- Andreas
Nah. That would be way too easy. I prefer masochism.