ID:164415
 
I've been looking for a way of implementing a system where the deeper down into a dungeon the player travels, the stronger monsters they will find.

I've tried everything I can think of, including seperate lists of monsters that are called upon depending on the user's level, but I only seem to be getting monsters from one list.

It's really bugging me, and I was wondering if anyone could help.

- Milo
Simplest way: keep an associative list of monster types and strength values. When generating a monster, get a copy of the list, and cut off only the part of containing monsters with a strength value less than or equal to the player's current strength value.

(in fact, generate that list only when the player levels up, so you're not performing needless list operations)

Then, pick from that list.

[edit]Actually, maybe I should be clearer:

You'll need two lists: one will contain EVERY monster, along with their strength values. The other will contain only the monsters that can be spawned, according to the game's conditions. Whenever those conditions change (player levels up, player changes dungeon levels, etc.), then a new list is generated. The list is generated by stepping through the full list until it finds a mob too strong, then copying everything before it.

The list will be a list of types. So, to create a new monster, you should be able to do:
var/T = pick(spawnableMonsters)
var/mob/monster/M = new T()