Using Cut to Unlock something

Help :open_mouth:

I am trying to get the following action to work.

Cut chain OR >Cut chain with bolt cutters
resulting in the Door the chain is attached to unlocking and saying that the chain is cut and changing the description of the chain.

Where the player needs to hold/enclose the bolt cutters (or some cutting tool) and the target needs to be the chain (or some cuttable thing). The major problems I am running into is trying to get around the existing cutting definition and the program not liking me saying: If the player does not enclose the bolt cutters, say “you need something to cut with”.

any help would be very appreciated. :slight_smile:

What have you tried so far? It sounds like you’re creating a new action for this?

Try this:

[code]The Corridor is a room. “A long stone corridor with a stout-looking door in the south wall.”

The Cell is a room. “You have entered the cell. The door is to the north.”

The stout oaken door is south of the corridor and north of the cell. The stout oaken door is a scenery door. The description is “A massive door made of oak.” Understand “massive” and “oak” as the stout door. The stout door is closed and locked. The stout door is not lockable.

The iron chain is part of the stout door. The description is “A heavy iron chain[if severed] that has been cut in half[end if].” Understand “heavy” as the chain. The chain can be severed or unsevered. The chain is unsevered.

The player carries some bolt cutters and a banana. [The banana is for testing purposes.]

The block cutting rule is not listed in any rulebook.

Check cutting something:
if the noun is not the chain:
say “[The noun] [are] not something you can cut.” instead;
else if the chain is severed:
say “You’ve already cut the chain.” instead;
else if the player does not carry the bolt cutters:
say “With your bare fingernails? You’d need a tool to do that.” instead.

Cutting it with is an action applying to two things. Understand “cut [something] with [something]” as cutting it with.

Check cutting it with:
try cutting the noun instead.

Check cutting the chain with something:
if the chain is severed:
say “You’ve already cut the chain.” instead;
else if the second noun is not the bolt cutters:
say “You can’t cut the chain with [the second noun].” instead;
else if the player does not carry the bolt cutters:
say “You’ll need to pick up the bolt cutters first.” instead.

Carry out cutting the chain:
now the chain is severed;
now the stout door is unlocked.

Carry out cutting the chain with the bolt cutters:
try cutting the chain instead.

Report cutting the chain:
say “You hack the chain in half with the bolt cutters.”[/code]

Thanks a bunch, I finally figured out something but yours is much cleaner :slight_smile:
Here’s what I ended up with.

[code]A thing can be cuttable.
A tool are a kind of thing.
Tools can be snipping.
Tools can be useless.

Check taking something:
If the noun is a useless tool, say “You dont need [the NOUN] anymore.” instead.

Check cutting something:
If the player does not enclose a snipping tool, say “You have nothing to cut with.” instead;
If the noun is not cuttable, say “You cannot cut that.” instead.
[/code]

and later:

Instead of cutting the Rusty Chain: Say "You cut the chains from the cellar door. The bolt cutters have seen better days and are pretty much useless after cutting through the thick chains so you leave them here.".; Now the Cellar Doors are unlocked; Now the Bolt Cutters are useless; Try silently dropping the Bolt Cutters.
where the Rusty Chain is cuttable, and the Bolt Butters are a snipping tool.

Here is my blade code, which allows for things to be cut open:

[code]A blade is a kind of thing.
Understand “cut [something] with [something]” as cutting it with.
Instead of cutting something:
if a blade (called the edge) is held by the player,
try cutting the noun with the edge;
otherwise say “You can’t cut without some sort of blade.”

Cutting it with is an action applying to two things.
Check cutting it with:
	if the second noun is not a blade, say "[The second noun] has not got enough of an edge." instead.
Carry out cutting a container with something:
	now the noun is open;
	now the noun is unopenable.
Report cutting it with:
	say "You slash [the noun] with [the second noun]."[/code]