diff options
Diffstat (limited to 'source/Mobs')
-rw-r--r-- | source/Mobs/Monster.cpp | 17 | ||||
-rw-r--r-- | source/Mobs/Monster.h | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp index ffc42cb07..c5b116db4 100644 --- a/source/Mobs/Monster.cpp +++ b/source/Mobs/Monster.cpp @@ -616,6 +616,23 @@ cMonster::eFamily cMonster::FamilyFromType(eType a_Type) +int cMonster::GetSpawnRate(cMonster::eFamily a_MobFamily) +{ + switch (a_MobFamily) + { + case mfHostile: return 1; + case mfPassive: return 400; + case mfAmbient: return 400; + case mfWater: return 400; + } + ASSERT(!"Unhandled mob family"); + return -1; +} + + + + + cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType, int a_Size) { cFastRandom Random; diff --git a/source/Mobs/Monster.h b/source/Mobs/Monster.h index 3b7f40c00..14c72ed73 100644 --- a/source/Mobs/Monster.h +++ b/source/Mobs/Monster.h @@ -146,6 +146,9 @@ public: /// Returns the mob family based on the type static eFamily FamilyFromType(eType a_MobType); + /// Returns the spawn rate (number of game ticks between spawn attempts) for the given mob family + static int GetSpawnRate(cMonster::eFamily a_MobFamily); + // tolua_end /** Creates a new object of the specified mob. |