static MonPreset() { for (int act = 0; act < presets.Length; ++act) { presets[act] = new List <MonPreset>(); } for (int i = 0; i < sheet.Count; ++i) { MonPreset preset = sheet[i]; presets[preset.act].Add(preset); } }
public static void LoadAll() { var sw = System.Diagnostics.Stopwatch.StartNew(); Translation.Load(); SoundInfo.Load(); SoundEnvironment.Load(); ObjectInfo.Load(); BodyLoc.Load(); ExpTable.Load(); LevelType.Load(); LevelWarpInfo.Load(); LevelPreset.Load(); LevelMazeInfo.Load(); LevelInfo.Load(); OverlayInfo.Load(); MissileInfo.Load(); ItemStat.Load(); ItemRatio.Load(); ItemType.Load(); ItemPropertyInfo.Load(); ItemSet.Load(); UniqueItem.Load(); SetItem.Load(); TreasureClass.Load(); MagicAffix.Load(); CharStatsInfo.Load(); MonLvl.Load(); MonPreset.Load(); MonSound.Load(); MonStatsExtended.Load(); MonStat.Load(); SuperUnique.Load(); SkillDescription.Load(); SkillInfo.Load(); SpawnPreset.Load(); StateInfo.Load(); Debug.Log("All txt files loaded in " + sw.ElapsedMilliseconds + " ms"); }
static bool CreateObject(SpawnPreset obj, int x, int y, int level, Transform root) { var pos = Iso.MapToWorld(x - 2, y - 2); if (obj.type == 2) { if (obj.objectId >= ObjectInfo.sheet.Count) { return(false); } ObjectInfo objectInfo = ObjectInfo.sheet[obj.objectId]; var staticObject = World.SpawnObject(objectInfo, pos, parent: root); staticObject.modeName = obj.mode; return(true); } else { string monPreset = MonPreset.Find(obj.act, obj.id); MonStat monStat = null; SuperUnique superUnique = null; if (monPreset != null) { monStat = MonStat.Find(monPreset); if (monStat == null) { superUnique = SuperUnique.Find(monPreset); } } else { monStat = MonStat.sheet[obj.id]; } if (monStat != null) { World.SpawnMonster(monStat, pos, root); return(true); } if (superUnique != null) { var monster = World.SpawnMonster(superUnique.monStat, pos, root); monster.gameObject.name = superUnique.nameStr; monster.title = superUnique.name; monster.level = level; int minionCount = Random.Range(superUnique.minGrp, superUnique.maxGrp + 1); for (int i = 0; i < minionCount; ++i) { var minion = World.SpawnMonster(superUnique.monStat, pos, root); minion.level = level; } return(true); } if (obj.id == 10) { // Fallens for (int i = 0; i < 4; ++i) { World.SpawnMonster("fallen1", pos, root); } return(true); } if (obj.id == 11) { // Fallen shaman + fallens Spawn(MonStat.Find("fallenshaman1"), x, y, level, root); for (int i = 0; i < 4; ++i) { var fallen = World.SpawnMonster("fallen1", pos, root); fallen.level = level; } return(true); } if (obj.id == 27) { // Fallen shaman Spawn(MonStat.Find("fallenshaman1"), x, y, level, root); return(true); } return(false); } }