I am having some difficulty getting this code to work with multiple items. If I only have a single item it will remove just fine, however once I introduced multiple items (duplicates), I can’t seem to get the code to work in my favour.
This is the working code with the troublesome addition in bold:
Section 1 - Firearms
The Shotgun is a thing.
The description of the shotgun is “a single barrel shotgun which requires shotgun shells to use”.
A Bullet is a kind of thing.
A shell is a kind of bullet.
Firing is an action applying to one carried thing.
Understand “fire [shotgun]” as firing.
Before firing the shotgun:
if the player has a shell:
say “Bang!”;
continue the action.
Before firing the shotgun:
if the player does not have a shell:
say “I need ammo”;
stop the action.
After firing the shotgun:
remove a shell from play.
Section 2 - Test Room
The Test Room is a room.
The Shotgun is in the Test Room.
There are ten shells in the Test Room.
How would one best remove a single shell from play after each time the player shoots the gun? I have tried dozens of variations of this one line in an attempt to get it to work but every time i get a compile error. i have tried "remove from the player, remove 1 shell, remove one shell, now the shell is removed from play etc. etc. but i think i have fundamentally missed something.
Could anyone help or point me in the right direction here as I’m a bit lost.
the error i’m getting is:
Problem. You wrote ‘remove a shell from play’ , but ‘a shell’ is used in a context where I’d expect to see a (single) specific example of an object, not a description.
I was trying to match one of these phrases:
I recognised:
a shell = a description of shells
But I didn’t recognise ‘play’.
I’m a bit lost on why it says " but ‘a shell’ is used in a context where I’d expect to see a (single) specific example of an object, not a description." as I have defined shells as objects. In gameplay I can pickup any number of the shells or drop any number and it recognises each individually which is why I’m confused as to why it won’t simply remove one of these from play after the action is completed.
Thanks in advance for any help.
Cheers!