Finally wrote the monster manager API
This commit is contained in:
@@ -27,6 +27,8 @@ print("Lua script check")
|
||||
--requirements
|
||||
roomManagerAPI = require("room_manager")
|
||||
roomAPI = require("room")
|
||||
monsterManagerAPI = require("monster_manager")
|
||||
monsterAPI = require("monster")
|
||||
|
||||
mapMaker = require("map_maker")
|
||||
mapSaver = require("map_saver")
|
||||
@@ -43,7 +45,7 @@ roomManagerAPI.SetOnCreate(function(room, index)
|
||||
end)
|
||||
|
||||
roomAPI.ForEachMonster(room, function(monster)
|
||||
--
|
||||
--TODO: move ForEachMonster to the monster manager API
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
@@ -62,4 +64,15 @@ roomAPI.Initialize(underworld, mapSaver.Load, mapSaver.Save, mapMaker.DebugGrass
|
||||
--call the monstrosity
|
||||
doorUtility.createDoorPair("pair 1", overworld, -64, -64, underworld, 64, 64)
|
||||
|
||||
--testing the monster creation
|
||||
print("testing monsters")
|
||||
local monsterMgr = roomAPI.GetMonsterMgr(overworld)
|
||||
|
||||
local monster, mIndex = monsterManagerAPI.Create(monsterMgr, "skume.bmp", 0)
|
||||
|
||||
print("Monster count: ", monsterManagerAPI.GetLoadedCount(monsterMgr))
|
||||
print("Monster avatar: ", monsterAPI.GetAvatar(monster), mIndex)
|
||||
|
||||
monsterManagerAPI.UnloadAll(monsterMgr)
|
||||
|
||||
print("Finished the lua script")
|
||||
|
||||
Reference in New Issue
Block a user