Well, I didn't meant that items should be generated with the same rates as now, it would need balancing for sure.
Secondly I didn't meant that monsters would waste all their turns using items. Some monster are just unintelligent but I'm not asking to remove monster drops from them. Some items wouldn't find a use just due to conditions - no reason to drink potion of healing if at full HP, no reason to use wand of bolt if PC isn't in direct line, no reason to read scroll of light unless there is darkness... But even if there is a condition it should be only only a chance to use item. Better tweakable per item / monster.
And the thing I didn't told explicitly, I didn't meant all these things to be implemented at all and surely didn't meant all this to be implemented at one step. For example let's start with the healing gear and implement it in the simplest possible way. Let's start with the potions of healing. Here is the sample in pseudocode how I see it:
Code:
potion = monster.inventory.getItemByType("potion of healing id")
if (potion != null and monster.hp < 50% and random < 50%) {
potion.dispose();
monster.hp += 30;
}
Obviously this would be a lot longer in ADOM and some routines like getting item by type from monster inventory might not exists yet... But doesn't look too complex, right? Of course for making this reusable it would be better to add use probabilities to monster and item tables rather than hardcoding values to tweak it easier, would be better to store trigger conditions and use effects in a separate function and store pointers for them in item table as well... Final implementation could look like this:
Code:
if (!monster.inventory.isEmpty()) {
items = shuffle(monster.inventory.items);
for (item in items) {
if (random < monster.useItemProbability * item.useByMonsterProbability && item.canBeTriggered(monster)) {
item.useByMonster(monster);
break;
}
}
}
+ implementation of all canBeTriggered / useByMonster functions for all items and respective probabilities for items and monsters.
Originally Posted by
grobblewobble
I'm not voting for or against, because of this. It's waaaay too much to ask for. Seriously. Try programming this yourself if you don't believe it..
I'm still starting with my own roguelike but implementing
vision for monsters was a lot harder than any monster AI changes I did so far... including limited item use healing potions and several weapons are there...