The clothes off her back

Hiya!

Okay I’m stumped. I want to rob people who are asleep and loot people who are dead… but I’m not supposed to be able to strip down the asleep!

However, this code still permits me to take the clothes off the back of the lady that’s sleeping. And I don’t want the player to be able to be that perverted.[code]A person can be asleep or awake.
A person is usually awake.

A person can be dead or alive.
A person is usually alive.

instead of waking an asleep person (called the sleeper):
If the sleeper is dead:
say “Sorry, but [one of][the noun] isn’t going to wake up anymore. Ever.[or][regarding the noun][they’re] fucking dead.[or][regarding the noun][they’re] fucking dead. Which is fairly permanent.[at random]”;
If the sleeper is alive:
Say “You shake [the noun] awake.”;
Now the sleeper is awake.

Instead of searching a person:
if the noun is awake:
if the noun is alive:
say “[one of]It would be weird to start rifling through [regarding the noun][their] pockets right now.[or]Maybe it’s not weird to just check other people’s pockets where you come from, but here it’s considered inappropriate.[in random order]”;
otherwise:
say “[The noun] [are] carrying [a list of things carried by the noun][if the noun is wearing anything] and wearing [a list of things worn by the noun][end if].”;
otherwise if the noun is asleep:
say “[The noun] [are] carrying [a list of things carried by the noun][if the noun is wearing anything] and wearing [a list of things worn by the noun][end if].”

The can’t take people’s possessions rule does nothing when the noun is dead or the noun is asleep.

The new can’t take people’s possessions rule is listed instead of the can’t take people’s possessions rule in the check taking rulebook.

This is the new can’t take people’s possessions rule:
if someone (called the owner) carries the noun:
if the owner is awake:
if the owner is alive:
if the player carries the noun:
say “You already have that.”;
otherwise:
say “[the owner] won’t like that.”;
reject the player’s command;
otherwise:
say “You take [the noun] off [the owner][’]s corpse.”;
otherwise if the owner is asleep:
if the player carries the noun:
say “You already have that.”;
otherwise:
if the noun is worn by the owner:
say “[the owner] is bound to notice.”;
reject the player’s command;
otherwise:
say “You take [the noun] while [the owner] is asleep.”;

The block giving rule is not listed in the check giving it to rules. [/code]
I should be able to take their wallet but not their pants. Right? Unless they’re dead, of course. Dead men wear no pants and tell no tales and love ice cream.

Help me, please? It’s really frustrating. :frowning:

“Carries” and “wears” are mutually exclusive–if the owner is wearing the pants, then the owner isn’t carrying the pants. So for worn objects the very first “if” clause evaluates as false and the rule doesn’t do anything.

See section 13.4 of Writing with Inform, “To carry, to wear, to have.” What you want to test here is:

if someone (called the owner) has the noun:

where “has” is shorthand for “carries or wears.” Then the first “if” will go through for worn objects, and you should hit the relevant code option. (I haven’t tested this, but I think it should work.

By the way, you have “reject the player’s command” here, and that’s really only meant for after reading a command rules. For action-processing rules you can say something like “rule fails” or “stop the action” or “instead” on the same line, like this:

say "[the owner] is bound to notice." instead;

I think they have the same effect but it’s a bit confusing to see “reject the player’s command” in a rule that’s not about processing the player’s command. You should also have these on the “You already have that” messages–if this is working, it might be that the can’t take what’s already taken rule is coming in first and preempting this rule.

One more thing is that you should say “[The owner] is bound to notice.” so you get proper capitalization at the beginning of the sentence.

You could split this into two rules:

This is the new can't take people's possessions rule: 
	if someone (called the owner) carries the noun: ...

Check taking something (this is the can't take people's clothing rule): 
	if someone (called the owner) wears the noun: ...

Might be easier to read.

Another thing is you might want to consider the case where the thing you want to take is in a container that an asleep person is wearing, or something like that.

What if he checked whether someone “encloses” an item?

What if we assume I don’t know what you’re talking about? O.O Enclose? Like something that’s also in an envelope?

Yeah, sorry, I was unclear in that my question was meant to be addressed to the I7 gurus. IIRC, the “enclosing” relationship encompasses wearing, carrying, and it being in a container. If the player has a dollar bill in a wallet in their coat pocket, the player would “enclose” the dollar bill AND the wallet AND the coat, whereas they would only be wearing the coat and… actually, I don’t think they’d even be shown as carrying anything, since the wallet is IN the coat.

I was just wondering whether making use of that power, somehow, would be of help to you in this case.

as far as I understand, if there’s a thing inside something held by someone, i could take the thing inside unhindered while the thing that holds it would be protected?

Possibly. I’m not really following this, I just noticed that the “enclosing” relationship hadn’t been mentioned and it seemed to me like a natural fit, so I wanted to pitch it in and see what the experts said. :wink: Hoping to learn something along the way.

To the best of my understanding:

  • I am carrying the scarf if it is in my hand.
  • I am wearing the scarf if it is actually on my body.
  • I am holding the scarf if I am carrying it or I am wearing it.
  • I am enclosing the scarf it I am holding it or I am holding something which encloses it.

So “carries” and “wears” are the most specific, “holds” is a bit more general (it covers me carrying it or wearing it, but not if it’s in the suitcase which I’m holding), and “encloses” is the most general of all. In this case you may want “encloses”, in case the player tries to steal a coin from the purse someone is carrying: the victim is holding the purse, but not the coin, so the rule as written now won’t notice anything wrong.

Yeah, “encloses” encompasses things that are worn by the person or that are carried by the person or that are parts of the person (or any other thing), and also the recursive closure of those–something that’s in a pocket that’s part of the jacket that the person is wearing is enclosed by the person. “Has” just encompasses worn and carried things and not parts (which in this case would be taken care of by the rule that prevents you from taking parts of things), and isn’t recursive.

EDIT: Hmm, that doesn’t actually help explain this, because it doesn’t say that “enclosure” includes worn and carried things. It does, though.

Probably for the rule you have you want “encloses,” unless there are some special cases you want to allow–you shouldn’t be able to pick an awake person’s pocket. Though as zarf says it might be easier to break this down into a couple of different rules.

seems clear to me. :slight_smile: thanks!