I’m working on a respawning system for my Eamon-like, and have hit a roadblock (yet again!).
My first problem is having an “original inventory” for a monster. I define items as kinds of things, because I want there to be more than one Shiny Red Shield in the game. But evidently you can’t have a list of kinds-- still confused on this point, because I can have a monster carry a kind of thing, and isn’t an inventory/list of objects carried just a list?
This is what should happen:
When play begins, an iterator loops through the original inventory of every monster, and “now monster carries item.” (item is still in the original inventory list, but related to the monster via the containment relation-- or so I hope)
A monster drops its carried/worn items on its death, and then after a set number of turns comes back alive, now carrying/wearing its “original inventory”
What happens instead:
When play begins, code is instead in place so that (line by line) a monster carries a (kind of sword) and wears a (kind of armor).
A monster drops its carried/worn items on its death (using a modified “Puff of Orange Smoke”-esque system), and then after a set number of turns comes back alive, but without its items (this is to be expected-- the items are moved from the monster’s inventory to the location.)
The code below describes the issue in brief, in case my example isn’t sufficient.
[code]
a person has a list of things called the Original Inventory.
a person can be dead rather than alive. a person is usually alive.
an antelope is a kind of person.
A set of antlers is a kind of thing.
A shiny pelt is a kind of thing.
the original inventory of an antelope is {set of antlers, shiny pelt}.
when play begins:
repeat with a running through antelopes:
repeat with i running through the original inventory of a:
now a carries i;
devkill is an action applying to nothing. understand “devkill” as devkill.
Carry out devkill:
repeat with x running through antelopes in the location:
unless x is the player:
now x is dead;
repeat with i running through things carried by x:
move i to the location;
say “Poor Stephen :(.”
devspawn is an action applying to nothing. understand “devspawn” as devspawn.
Carry out devspawn:
repeat with x running through dead antelopes in the location:
now x is not dead;
repeat with i running through original inventory of x:
now x carries i;
say “Antelopes love it when you do this, especially behind their ears.”
the anteloparium is a room. “Ariums! Antelopes! What more could you ask for?”
the player is in the anteloparium. there are five antelopes in the anteloparium.[/code]
The code gives the errors:
Problem. The constant list 'set of antlers, shiny pelt' contains an entry 'set of antlers' which does make sense, but isn't a constant (it's a set of antlers). Only constants can appear as entries in constant lists, i.e., in lists written in braces '{' and '}'.
Problem. The constant list 'set of antlers, shiny pelt' contains an entry 'shiny pelt' which does make sense, but isn't a constant (it's a shiny pelt). Only constants can appear as entries in constant lists, i.e., in lists written in braces '{' and '}'.
Does anyone have any clue what’s going on, or how I can fix this issue/have a list of kinds that would make everything run smoothly?
I appreciate you guys help!