Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pockets pockets pockets

11 views
Skip to first unread message

Erik Hetzner

unread,
Feb 6, 1997, 3:00:00 AM2/6/97
to

Because I said I would, & because I enjoy wasting bandwidth, at the end of
this message is a short Inform program that implements a pocket with only
one object. It's pretty self explanatory, but:

garment_name is the name of the garment (ie "blue jeans")
garment_article is the article of the gament ("a pair of")
pocket_name is the name of the pocket ("pocket")
pocket_article is the article of the pocket ("your")

It can & is used as a sack object, which I find kind of neat.

Well, I hope you all enjoy!
--
Erik

---cut here----
Constant Story "POCKETS OF PLENTY";
Constant Headline "^Copyright 1997 Erik Hetzner^";
Constant MAX_CARRIED 2;
Constant SACK_OBJECT Jeans;
Include "parser";
Include "verblib";
Include "grammar";

Class GarmentWithPocket
with name "blue jeans",
describe [;
"^You can see ", (a) self, " here.";
],
short_name [;
if (action == ##Take) {
if (self in Player)
print (string) self.pocket_name;
else {
if (self hasnt general)
print (string) self.garment_name;
else
print (string) self.pocket_name;
give self general;
}
} else {
give self ~general;
if (action == ##Insert or ##Remove or ##Search)
print (string) self.pocket_name;
else
print (string) self.garment_name;
}
rtrue;
],
article [;
if (action == ##Take) {
if (self in Player)
print (string) self.pocket_article;
else {
if (self hasnt general)
print (string) self.garment_article;
else
print (string) self.pocket_article;
}
} else {
if (action == ##Insert or ##Remove or ##Search)
print (string) self.pocket_article;
else
print (string) self.garment_article;
}
rtrue;
],
invent [ x;
if (inventory_stage == 2) {
if (self has worn)
print " (being worn)";
if (children (self) == 0)
rtrue;
print ", in the pocket of which ";
if (children (self) == 1)
print "is";
else
print "are";
if ((c_style & NEWLINE_BIT) ~= 0)
print ":";
else
print " ";
if ((c_style & NEWLINE_BIT) ~= 0) {
x = true;
print "^ ";
}
WriteListFrom (child (self), ENGLISH_BIT + RECURSE_BIT);
if (x == true) {
print "^";
}
rtrue;
}
],
description [;
print (string) self.garment_description, " ";
print "In the pocket of ", (the) self, " there ";
if (children (self) == 1)
print "is";
else
print "are";
print " ";
WriteListFrom (child (self), ENGLISH_BIT);
print ".^";
],
has container clothing open ~transparent;

Object Hall "The Hall of Pockets"
with description "Well, the hall of one pocket, really. Yours.",
has light;

Object -> Jeans "blue jeans"
class GarmentWithPocket
with name "pant" "pants" "pair of pants" "trousers" "pocket"
"jeans" "faded" "blue" "blue jeans" "faded blue jeans",
pocket_name "pocket",
pocket_article "your",
garment_name "blue jeans",
garment_article "a pair of",
garment_description "A pair of faded blue jeans.";

Object -> Duckie "rubber duckie"
with name "duck" "rubber" "duckie" "rubber duckie",
description "Squeak! Squeak!";

Object -> Pen "ballpoint pen"
with name "pen" "biro" "ballpoint",
description "All dried out.";

Object -> Candy "chocolate bar"
with name "candy" "bar" "choco" "chocolate bar" "candy bar",
description "A good-looking bar of chocolate.",
has edible;

[ Initialise;
print "^^";
Location = Hall;
move player to Hall;
];
--cut here---

--
Erik Hetzner <e...@uclink4.berkeley.edu>

Richard H. Poser II

unread,
Feb 6, 1997, 3:00:00 AM2/6/97
to

On 06-Feb-97 22:38:20, e...@uclink4.berkeley.edu
(Erik Hetzner) wrote the following:

>Because I said I would, & because I enjoy wasting bandwidth, at the end of
>this message is a short Inform program that implements a pocket with only
>one object.

>It can & is used as a sack object, which I find kind of neat.

Very good except that the description of the GarmentWithPocket Class gives
the wrong description when the pocket is empty...

The following changes need to be made...

---cut here----

description [;
print (string) self.garment_description, " ";

--> if ( children(self) == 0)
--> "The pocket of ", (the) self, " is empty.";
--> else
--> print "In the pocket of ", (the) self, " there ";

if (children (self) == 1)
print "is";
else
print "are";
print " ";
WriteListFrom (child (self), ENGLISH_BIT);
print ".^";
],

--cut here---

Richard H. Poser II (The Next Regeneration) <rhp...@Fair.Net>
--
The Whomiga Times: http://www.america.net/~rhposer
Doctor Who Pinball: http://www.america.net/~rhposer/pinball
Selected RADW Links: http://www.america.net/~rhposer/RADW
--
Official RADW Birthday Clearinghouse / Team AMIGA


Erik Hetzner

unread,
Feb 7, 1997, 3:00:00 AM2/7/97
to

In article <1277.6976...@fair.net>, Richard H. Poser II

<rhp...@fair.net> wrote:
> Very good except that the description of the GarmentWithPocket Class gives
> the wrong description when the pocket is empty...
>
> The following changes need to be made...
>
>[And here was the fix...]

Well, I never did claim to be perfect. :) I mean, I was rather proud of
it, but...

No, seriously, thanks for pointing that out.

If anyone else notices any problems, please tell me! I might actually use
this code in my next (and first released) game. Thanks!

--
Erik Hetzner <e...@uclink4.berkeley.edu>

Kathleen Fischer

unread,
Feb 7, 1997, 3:00:00 AM2/7/97
to e...@uclink4.berkeley.edu

Erik Hetzner wrote:
> If anyone else notices any problems, please tell me! I might
> actually use this code in my next (and first released) game. Thanks!

Does that mean that <sniff> the rest of us <sniff> <whimper> <whimper>
can't use it? :(


--
*******************************************************************
* Kathleen M. Fischer
* kfis...@greenhouse.llnl.gov
** "Don't stop to stomp ants while the elephants are stampeding" **

Erik Hetzner

unread,
Feb 9, 1997, 3:00:00 AM2/9/97
to

In article <32FBC3...@greenhouse.llnl.gov>, Kathleen Fischer

<kfis...@greenhouse.llnl.gov> wrote:
> Does that mean that <sniff> the rest of us <sniff> <whimper> <whimper>
> can't use it? :(

Of course not. :) You're all free to use this code any way you'd like to.
I don't even care for credit. (Okay, I'm feeling pretty crazy today :)

--
Erik Hetzner <e...@uclink4.berkeley.edu>

0 new messages