Removing one of many from a container

I have a pack of cigarettes with six cigarettes in it.

The player carries some Marlboros. The Marlboros are a container. The indefinite article of the Players is "a pack of". A cigarette is a kind of thing. In the Marlboros are six cigarettes.

I can’t figure out how I would remove one of them if the player decides to smoke.

Understand "smoke" as smoking. Smoking is an action applying to nothing. Carry out smoking: if the player is carrying the Marlboros: if a cigarette is in the Marlboros: say "Ahhh… just what I needed."; decrement cigarette in the Marlboros; otherwise: say "Looks like my Marlboros are empty." otherwise: say "I have no smokes on me."

Can anyone please tell me what I would have to do to reduce the number of cigarettes in the pack by one?

You’re simulating each cigarette as its own object at the moment, so you could do something like this.

Smoking is an action applying to one thing. Understand "smoke [something]" or "smoke" as smoking.
Rule for supplying a missing noun while smoking:
    if the player encloses a cigarette (called the tobacco):
        now the noun is the tobacco.

Check smoking something:
        if the player does not carry the noun:
            say "(first taking [the noun])[command clarification break]";
            silently try taking the noun;
        if the player does not carry the tobacco, stop the action.

Then you can add carry out and report rules to make the action actually do something. Right now the player just removes a cigarette and holds it in their hand without actually smoking it.

I like what you to do with the missing noun identification, because I handled “smoke” and “smoke [something]” separately so far. So I may use what you’re doing with the noun substitution instead.

But the main problem remains. How do I remove one cigarette from play?

I just tried

remove a cigarette from play;

but it causes an error

Even is I say “one cigarette” the error remains.

Now a random cigarette carried by the player is off-stage.

(I would disallow them from holding more than one out of the pack. )

Remove the noun from play. (That ensures the one they tried to smoke will be removed, if there’s ever a difference between cigarettes.)

Thanks guys, that did the trick. :slight_smile: