public MonsterSpawnInfo SpawnMonstersToRoom(MapRoom room, string monsterTypeName, MapRoom.RoomType type, int direction, int countRooms, int countMobsPerRoom, bool randomOffset = false, int level = 1, int chance = 100, bool exclude = true) { if (chance < 100 && !ChanceCheck(chance)) { return(null); } Tile[] rooms = room.GetSubRooms(type, direction, countRooms, exclude); MonsterSpawnInfo info = null; foreach (Tile t in rooms) { if (t == null) { break; } for (int i = 0; i < countMobsPerRoom; i++) { info = SpawnMonsterToRoom(room, monsterTypeName, t, randomOffset, level); } } return(info); }
public override void SpawnMonsters() { Utils.Timer.StartTimer("spawnmap"); foreach (MapRoom room in map.GetMapRooms()) { if (room.region.GetParentOrSelf().Equals(start)) { SpawnMonstersToRoom(room, MonsterId.FloatingBasicCell.ToString(), MapRoom.RoomType.MEDIUM, MapRoom.DIRECTION_RIGHT, 1, 1); SpawnMonstersToRoom(room, MonsterId.PassiveHelperCell.ToString(), MapRoom.RoomType.MEDIUM, MapRoom.DIRECTION_RIGHT, 2, 1); } else if (room.region.GetParentOrSelf().Equals(room1)) { SpawnMonstersToRoom(room, MonsterId.BasicCell.ToString(), MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER, 6, 1); } else if (room.region.GetParentOrSelf().Equals(room2)) { //SpawnMonstersToRoom(room, MonsterId.HelperCell, MapRoom.RoomType.TINY, MapRoom.DIRECTION_LEFT, 5, 1, 1, 100, false); SpawnMonstersToRoom(room, MonsterId.TurretCell.ToString(), MapRoom.RoomType.VERYLARGE, MapRoom.DIRECTION_CENTER, 1, 1); SpawnMonstersToRoom(room, MonsterId.FourDiagShooterCell.ToString(), MapRoom.RoomType.MEDIUM, MapRoom.DIRECTION_LEFT, 2, 1); Tile t = room.GetTileWithSpaceAround(5, MapRoom.DIRECTION_RIGHT); MonsterSpawnInfo patrol = SpawnMonsterToRoom(room, MonsterId.Neutrophyle_Patrol.ToString(), t); //MonsterSpawnInfo patrol = SpawnMonstersToRoom(room, MonsterId.Neutrophyle_Patrol, MapRoom.RoomType.MEDIUM, MapRoom.DIRECTION_RIGHT, 1, 1); if (patrol != null) { try { SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), Utils.GenerateRandomPositionAround(patrol.SpawnPos, 5, 3)).master = patrol; SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), Utils.GenerateRandomPositionAround(patrol.SpawnPos, 5, 3)).master = patrol; SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), Utils.GenerateRandomPositionAround(patrol.SpawnPos, 5, 3)).master = patrol; SpawnMonsterToRoom(room, MonsterId.Lymfocyte_melee.ToString(), Utils.GenerateRandomPositionAround(patrol.SpawnPos, 5, 3)); SpawnMonsterToRoom(room, MonsterId.Lymfocyte_melee.ToString(), Utils.GenerateRandomPositionAround(patrol.SpawnPos, 5, 3)); SpawnMonsterToRoom(room, MonsterId.Lymfocyte_melee.ToString(), Utils.GenerateRandomPositionAround(patrol.SpawnPos, 5, 3)); SpawnMonsterToRoom(room, MonsterId.Lymfocyte_melee.ToString(), Utils.GenerateRandomPositionAround(patrol.SpawnPos, 5, 3)); } catch (Exception) { } } } else if (room.region.GetParentOrSelf().Equals(miniboss)) { Tile largestRoom = room.GetLargestSubRoom(); //SpawnMonsterToRoom(room, MonsterId.TankSpreadshooter, largestRoom, 1); } } Utils.Timer.EndTimer("spawnmap"); }
public MonsterSpawnInfo SpawnMonsterToRoom(MapRoom room, string monsterTypeName, Vector3 pos, bool randomOffset = false, int level = 1, int chance = 100) { if (chance < 100 && !ChanceCheck(chance)) { return(null); } if (randomOffset) { pos = Utils.GenerateRandomPositionAround(pos, 5, 2); } MonsterSpawnInfo info = new MonsterSpawnInfo(map, monsterTypeName, pos); info.level = level; info.SetRegion(room.region.GetParentOrSelf()); map.AddMonsterToMap(info); return(info); }
public override void SpawnMonsters() { Utils.Timer.StartTimer("spawnmap"); foreach (MapRoom room in map.GetMapRooms()) { if (room.region.GetParentOrSelf().Equals(start)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_CENTER, 1)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.DementCell.ToString(), t, false, 1); SpawnMonsterToRoom(room, MonsterId.DementCell.ToString(), t, true, 1); SpawnMonsterToRoom(room, MonsterId.DementCell.ToString(), t, true, 1); SpawnMonsterToRoom(room, MonsterId.DementCell.ToString(), t, true, 1).AddHealDrop(100, 2); } } else if (room.region.GetParentOrSelf().Equals(mid2)) { Tile tt = room.GetLargestSubRoom(true); MonsterSpawnInfo info = SpawnMonsterToRoom(room, MonsterId.TurretCell.ToString(), tt, false, 3); SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), tt, true).master = info; SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), tt, true).master = info; SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), tt, true).master = info; tt = room.GetLargestSubRoom(true); info = SpawnMonsterToRoom(room, MonsterId.TurretCell.ToString(), tt, false, 3); SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), tt, true).master = info; SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), tt, true).master = info; SpawnMonsterToRoom(room, MonsterId.PassiveHelperCell.ToString(), tt, true).master = info; } else if (room.region.GetParentOrSelf().Equals(mid3)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_DOWN, 6)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.Lymfocyte_melee.ToString(), t, false, 1).AddHealDrop(40, 3); SpawnMonsterToRoom(room, MonsterId.HealerCell.ToString(), t, false, 1).AddHealDrop(40, 3); } foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_UP, 6)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.SniperCell.ToString(), t, false, 1).AddHealDrop(40, 3); } foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_CENTER, 6)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.PusherCell.ToString(), t, false, 1).AddHealDrop(40, 3); } } else if (room.region.GetParentOrSelf().Equals(mid)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER, 2)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.TankCell.ToString(), t, false, 1).AddHealDrop(100, 3); } // 8x charger in the middle foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER, 2)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.ChargerCell.ToString(), t, false, 1, 100); } } else if (room.region.GetParentOrSelf().Equals(end)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_CENTER, 2)) { if (t == null) { break; } SpawnMonsterToRoom(room, "Hop", t, true, 1, 100); SpawnMonsterToRoom(room, "Hop", t, true, 1, 100); SpawnMonsterToRoom(room, MonsterId.FourDiagShooterCell.ToString(), t, true, 1, 100); SpawnMonsterToRoom(room, MonsterId.FourDiagShooterCell.ToString(), t, true, 1, 100); } } } Utils.Timer.EndTimer("spawnmap"); }
public override void SpawnMonsters() { Utils.Timer.StartTimer("spawnmap"); foreach (MapRoom room in map.GetMapRooms()) { if (room.region.GetParentOrSelf().Equals(boss)) // boss room { Tile t = room.GetLargestSubRoom(true); SpawnMonsterToRoom(room, MonsterId.SwarmerBoss.ToString(), t, false, 1) .AddHealDrop(100, 10) .AddDrop(33, ItemType.CLASSIC_UPGRADE, 2, 1) .AddDrop(100, ItemType.CLASSIC_UPGRADE, 1, 1); } else if (room.region.GetParentOrSelf().Equals(start)) // start room - nothing interesting here { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_RIGHT, 1)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.DementCell.ToString(), t, true, 1).AddHealDrop(33); } } else if (room.region.GetParentOrSelf().Equals(second)) // second room: jump cells, armored cell and floating ranged { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_CENTER, 2)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.JumpCell.ToString(), t, true, mapLevel); } foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_CENTER, 1)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.ArmoredCell.ToString(), t, true, mapLevel).AddHealDrop(33); } foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_CENTER, 2)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.FloatingBasicCell.ToString(), t, true, mapLevel); } } else if (room.region.GetParentOrSelf().Equals(thirdBig)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER_RIGHT, 4)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.SpiderCell.ToString(), t, true, mapLevel); } foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER, 1)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.MorphCellBig.ToString(), t, true, mapLevel); } } else if (room.region.GetParentOrSelf().Equals(fourth)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_CENTER, 6)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.SuiciderCell.ToString(), t, true, mapLevel); } } else if (room.region.GetParentOrSelf().Equals(fifthBig)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER_LEFT, 1)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.TankCell.ToString(), t, true, mapLevel); } foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER, 1)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.MissileTurretCell.ToString(), t, true, mapLevel); } foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.SMALL, MapRoom.DIRECTION_CENTER_RIGHT, 1)) { if (t == null) { break; } MonsterSpawnInfo patrol = SpawnMonsterToRoom(room, MonsterId.Neutrophyle_Patrol.ToString(), t, true, mapLevel); SpawnMonsterToRoom(room, MonsterId.Lymfocyte_melee.ToString(), t, true, mapLevel).master = patrol; SpawnMonsterToRoom(room, MonsterId.Lymfocyte_melee.ToString(), t, true, mapLevel).master = patrol; SpawnMonsterToRoom(room, MonsterId.Lymfocyte_ranged.ToString(), t, true, mapLevel).master = patrol; SpawnMonsterToRoom(room, MonsterId.Lymfocyte_ranged.ToString(), t, true, mapLevel).master = patrol; } } else if (room.region.GetParentOrSelf().Equals(end)) { foreach (Tile t in room.GetSubRooms(MapRoom.RoomType.TINY, MapRoom.DIRECTION_RIGHT, 2)) { if (t == null) { break; } SpawnMonsterToRoom(room, MonsterId.DementCell.ToString(), t, true, 1).AddHealDrop(33); } } } Utils.Timer.EndTimer("spawnmap"); }