On 1 Feb, 10:24, Ido Yehieli <Ido.Yehi....TakeThisOut@gmail.com> wrote:
> On Feb 1, 9:31 am, "Ulf Åström" <ulf.ast....TakeThisOut@gmail.com> wrote:
>
> > I see several advantages, the most attractive that I could call an
> > item by name (wands of wishing here we come!) as well as item number.
>
> To get that advantage I would assume the easiest way is to use an enum
> for your item names.
I already have that; what I want is to enter an arbitrary string and
the game would figure out what I wanted.
So, I had a look at this and found that it was much simpler to solve
than I hade expected. I've moved the item definitions to an array, so
now I can search it for an item name. My search function looks at both
the unidentified and identified names of both items and artifacts. If
there are several matches a random one is selected, so I can wish for
"sword" and get a generic sword, or I might get an artifact weapon.
This also lets me specify just "sword" during monster generation, and
some monsters will naturally end up with unique weapons.
It might need some special cases though; since my potions have colors,
just wishing for "potion" won't work. I should also come up with some
way of limiting the probability of it generating unique items, since
these are taken from a finite pool and the game will sooner or later
run out of them (probably sooner).
-the ru
>> Stay informed about: -MPRHB- Development proceeds...