private void Awake() { foreach (Transform child in transform) { SpawnPoints.Add(child); } }
/// <summary> /// Adds an event to the appropriate list for its type; returns the event. /// </summary> public Event Add(Event evnt) { switch (evnt) { case Event.Light e: Lights.Add(e); break; case Event.Sound e: Sounds.Add(e); break; case Event.SFX e: SFX.Add(e); break; case Event.Wind e: Wind.Add(e); break; case Event.Treasure e: Treasures.Add(e); break; case Event.Generator e: Generators.Add(e); break; case Event.Message e: Messages.Add(e); break; case Event.ObjAct e: ObjActs.Add(e); break; case Event.SpawnPoint e: SpawnPoints.Add(e); break; case Event.MapOffset e: MapOffsets.Add(e); break; case Event.Navmesh e: Navmeshes.Add(e); break; case Event.Environment e: Environments.Add(e); break; case Event.PseudoMultiplayer e: PseudoMultiplayers.Add(e); break; default: throw new ArgumentException($"Unrecognized type {evnt.GetType()}.", nameof(evnt)); } return(evnt); }
public override void FillSpawnPoints() { SpawnPoints.Add(GameObject.Find("SpawnPoints/FFA/" + AeCore.m_pCoreGame.MyStats.m_iPlayerID + "SpawnPointID0")); SpawnPoints.Add(GameObject.Find("SpawnPoints/FFA/" + AeCore.m_pCoreGame.MyStats.m_iPlayerID + "SpawnPointID1")); SpawnPoints.Add(GameObject.Find("SpawnPoints/FFA/" + AeCore.m_pCoreGame.MyStats.m_iPlayerID + "SpawnPointID2")); SpawnPoints.Add(GameObject.Find("SpawnPoints/FFA/" + AeCore.m_pCoreGame.MyStats.m_iPlayerID + "SpawnPointID3")); }
private void CreateSpawnPoints() { // Spawn Points at Tier 3 SpawnPoint sp = new SpawnPoint(new Vector2(1024, 1936)); SpawnPoints.Add(sp); // Spawn Points at Tier 4 sp = new SpawnPoint(new Vector2(256, 1840)); SpawnPoints.Add(sp); sp = new SpawnPoint(new Vector2(1792, 1840)); SpawnPoints.Add(sp); // Spawn Points at Tier 8 sp = new SpawnPoint(new Vector2(768, 1296)); SpawnPoints.Add(sp); sp = new SpawnPoint(new Vector2(1280, 1296)); SpawnPoints.Add(sp); // Spawn Points at Tier 9 sp = new SpawnPoint(new Vector2(128, 1008)); SpawnPoints.Add(sp); sp = new SpawnPoint(new Vector2(1920, 1008)); SpawnPoints.Add(sp); // Spawn Points at Tier 10 sp = new SpawnPoint(new Vector2(848, 752)); SpawnPoints.Add(sp); sp = new SpawnPoint(new Vector2(1200, 752)); SpawnPoints.Add(sp); }
private void FillUpPositions() { foreach (var launchsite in PSystemSetup.Instance.SpaceCenterFacilityLaunchSites) { if (!SpawnPoints.ContainsKey(launchsite.hostBody.name)) { SpawnPoints.Add(launchsite.hostBody.name, new List <SpawnPointLocation>()); } foreach (var spawnPoint in launchsite.spawnPoints) { SpawnPoints[launchsite.hostBody.name].Add(new SpawnPointLocation(spawnPoint, launchsite.hostBody)); } } foreach (var launchsite in PSystemSetup.Instance.StockLaunchSites) { if (!SpawnPoints.ContainsKey(launchsite.Body.name)) { SpawnPoints.Add(launchsite.Body.name, new List <SpawnPointLocation>()); } foreach (var spawnPoint in launchsite.spawnPoints) { SpawnPoints[launchsite.Body.name].Add(new SpawnPointLocation(spawnPoint, launchsite.Body)); } } }
public override void FillSpawnPoints() { SpawnPoints.Clear(); SpawnPoints.Add(GameObject.Find("SpawnPoints/Team" + AeCore.m_pCoreGame.MyStats.m_iTeamID.ToString() + "/RightDown")); SpawnPoints.Add(GameObject.Find("SpawnPoints/Team" + AeCore.m_pCoreGame.MyStats.m_iTeamID.ToString() + "/LeftUp")); SpawnPoints.Add(GameObject.Find("SpawnPoints/Team" + AeCore.m_pCoreGame.MyStats.m_iTeamID.ToString() + "/LeftDown")); }
private Entity Spawn(ActorDefinition definition, Vec3F position, BitAngle angle) { Sector sector = world.Geometry.BspTree.Sector(position); Entity entity = new Entity(nextEntityID++, definition, position, angle, sector, this); entity.node = Entities.AddLast(entity); if (entity.Definition.ActorType.SpawnPoint) { spawnPoints.Add(entity); } return(entity); }
private void StoreSpawnAndGoalPoints() { var spawnPoints = data.GetChildren("SpawnPoint"); foreach (var spawnPoint in spawnPoints) { SpawnPoints.Add(new Vector2D(spawnPoint.GetAttributeValue("Position"))); } var goalPoints = data.GetChildren("ExitPoint"); foreach (var goalPoint in goalPoints) { GoalPoints.Add(new Vector2D(goalPoint.GetAttributeValue("Position"))); } }
/// <summary> /// Adds a region to the appropriate list for its type; returns the region. /// </summary> public Region Add(Region region) { switch (region) { case Region.InvasionPoint r: InvasionPoints.Add(r); break; case Region.EnvironmentMapPoint r: EnvironmentMapPoints.Add(r); break; case Region.Sound r: Sounds.Add(r); break; case Region.SFX r: SFX.Add(r); break; case Region.WindSFX r: WindSFX.Add(r); break; case Region.SpawnPoint r: SpawnPoints.Add(r); break; case Region.Message r: Messages.Add(r); break; case Region.PatrolRoute r: PatrolRoutes.Add(r); break; case Region.MovementPoint r: MovementPoints.Add(r); break; case Region.WarpPoint r: WarpPoints.Add(r); break; case Region.ActivationArea r: ActivationAreas.Add(r); break; case Region.Event r: Events.Add(r); break; case Region.Logic r: Logic.Add(r); break; case Region.EnvironmentMapEffectBox r: EnvironmentMapEffectBoxes.Add(r); break; case Region.WindArea r: WindAreas.Add(r); break; case Region.MufflingBox r: MufflingBoxes.Add(r); break; case Region.MufflingPortal r: MufflingPortals.Add(r); break; case Region.Other r: Others.Add(r); break; default: throw new ArgumentException($"Unrecognized type {region.GetType()}.", nameof(region)); } return(region); }
public int SetSpawnPoints() { int checker = 0; for (int i = 0; i < MyWindow.mapa.Grid.Count; i++) { for (int j = 0; j < MyWindow.mapa.Grid[i].Count; j++) { if (MyWindow.mapa.Grid[i][j].WybranySpawn == true) { SpawnPoints.Add(MyWindow.mapa.Grid[i][j]);//agregacja MyWindow.mapa.Grid[i][j].WybranySpawn = false; checker += 1; } } } return(checker); }
public void AddPortal(Portal PT) { if (PT.Name == "sp") { SpawnPoints.Add(PT.ID, PT); } else if (PT.Name == "tp") { // TownPortal: Mystic Door } else { if (Portals.ContainsKey(PT.Name)) { Console.WriteLine("Duplicate portal, Name: {0} MapID: {1}", PT.Name, ID); } else { Portals.Add(PT.Name, PT); } } }
public override void InitSpawnPoints() { NoOfPlayers = 2; for (int x = 0; x < NoOfPlayers; x++) { for (int y = 0; y < 6; y++) { UnitSpawnPoint sp = gameObject.AddComponent <UnitSpawnPoint>(); sp.iPlayerTeamId = x; if (x == 0) { sp.ParentHex = Map.GoHex[y, 0].GetComponent <Hex>(); } if (x == 1) { sp.ParentHex = Map.GoHex[y, 6].GetComponent <Hex>(); } SpawnPoints.Add(sp); } } }
public override void InitSpawnPoints() { NoOfPlayers = 2; for (int x = 0; x < NoOfPlayers; x++) { for (int y = 0; y < 6; y++) { UnitSpawnPoint sp = new UnitSpawnPoint(); SpawnPoints.Add(sp); sp.iPlayerTeamId = x; if (x == 0) { sp.ParentHex = Hexs[y, 0]; } if (x == 1) { sp.ParentHex = Hexs[y, 6]; } SpawnPoints.Add(sp); } } }
public MapReference(WzImage img) { var name = img.Name.Remove(9); if (!int.TryParse(name, out var id)) { return; } MapleId = id; var info = img["info"]; foreach (var node in info.WzProperties) { switch (node.Name) { case "mapMark": case "cloud": case "snow": case "rain": case "fs": case "bgm": case "version": case "mapDesc": case "mapName": case "help": case "streetName": case "moveLimit": case "hideMinimap": break; case "town": IsTown = node.GetInt() > 0; break; case "mobRate": SpawnRate = node.GetDouble(); break; case "returnMap": ReturnMapId = node.GetInt(); break; case "forcedReturn": ForcedReturnMapId = node.GetInt(); break; case "fieldLimit": FieldLimit = (FieldLimitFlags)node.GetInt(); break; case "bUnableToChangeChannel": IsUnableToChangeChannel = node.GetInt() > 0; break; case "bUnableToShop": IsUnableToShop = node.GetInt() > 0; break; case "everlast": IsEverlastDrops = node.GetInt() > 0; break; case "personalShop": IsPersonalShop = node.GetInt() > 0; break; case "recovery": RecoveryHp = (byte)node.GetInt(); break; case "decHP": DecreaseHp = (byte)node.GetInt(); break; case "scrollDisable": IsScrollDisable = node.GetInt() > 0; break; case "timeLimit": TimeLimit = node.GetInt(); break; case "VRTop": VrTop = node.GetInt(); break; case "VRLeft": VrLeft = node.GetInt(); break; case "VRBottom": VrBottom = node.GetInt(); break; case "VRRight": VrRight = node.GetInt(); break; case "fieldType": FieldType = (MapFieldType)node.GetInt(); break; default: _log.Warning( $"Unknown map node Skill={MapleId} Name={node.Name} Value={node.WzValue}"); break; } } HasClock = img["clock"] != null; HasShip = img["shipObj"] != null; img["portal"]?.WzProperties?.ForEach(x => Portals.Add(new PortalReference(x))); img["seat"]?.WzProperties?.ForEach(x => Seats.Add(new SeatReference(x))); img["foothold"]?.WzProperties.SelectMany(x => x.WzProperties).SelectMany(x => x.WzProperties).ToList() .ForEach(x => Footholds.Add(new FootholdReference(x))); img["seat"]?.WzProperties?.ForEach(x => Seats.Add(new SeatReference(x))); img["life"]?.WzProperties?.ForEach(life => { var type = life["type"].GetString(); switch (type) { case "n": Npcs.Add(new MapNpcReference(life)); break; case "m": SpawnPoints.Add(new SpawnPointReference(life, LifeObjectType.Mob)); break; } }); }
internal override Region ReadEntry(BinaryReaderEx br) { RegionType type = br.GetEnum32 <RegionType>(br.Position + 8); switch (type) { case RegionType.Region0: var region0 = new Region.Region0(br); Region0s.Add(region0); return(region0); case RegionType.InvasionPoint: var invasionPoint = new Region.InvasionPoint(br); InvasionPoints.Add(invasionPoint); return(invasionPoint); case RegionType.EnvironmentMapPoint: var environmentMapPoint = new Region.EnvironmentMapPoint(br); EnvironmentMapPoints.Add(environmentMapPoint); return(environmentMapPoint); case RegionType.Sound: var sound = new Region.Sound(br); Sounds.Add(sound); return(sound); case RegionType.SFX: var sfx = new Region.SFX(br); SFXs.Add(sfx); return(sfx); case RegionType.WindSFX: var windSFX = new Region.WindSFX(br); WindSFXs.Add(windSFX); return(windSFX); case RegionType.SpawnPoint: var spawnPoint = new Region.SpawnPoint(br); SpawnPoints.Add(spawnPoint); return(spawnPoint); case RegionType.WalkRoute: var walkRoute = new Region.WalkRoute(br); WalkRoutes.Add(walkRoute); return(walkRoute); case RegionType.WarpPoint: var warpPoint = new Region.WarpPoint(br); WarpPoints.Add(warpPoint); return(warpPoint); case RegionType.ActivationArea: var activationArea = new Region.ActivationArea(br); ActivationAreas.Add(activationArea); return(activationArea); case RegionType.Event: var evt = new Region.Event(br); Events.Add(evt); return(evt); case RegionType.EnvironmentMapEffectBox: var environmentMapEffectBox = new Region.EnvironmentMapEffectBox(br); EnvironmentMapEffectBoxes.Add(environmentMapEffectBox); return(environmentMapEffectBox); case RegionType.WindArea: var windArea = new Region.WindArea(br); WindAreas.Add(windArea); return(windArea); case RegionType.MufflingBox: var mufflingBox = new Region.MufflingBox(br); MufflingBoxes.Add(mufflingBox); return(mufflingBox); case RegionType.MufflingPortal: var mufflingPortal = new Region.MufflingPortal(br); MufflingPortals.Add(mufflingPortal); return(mufflingPortal); case RegionType.Region23: var region23 = new Region.Region23(br); Region23s.Add(region23); return(region23); case RegionType.Region24: var region24 = new Region.Region24(br); Region24s.Add(region24); return(region24); case RegionType.PartsGroup: var partsGroup = new Region.PartsGroup(br); PartsGroups.Add(partsGroup); return(partsGroup); case RegionType.AutoDrawGroup: var autoDrawGroup = new Region.AutoDrawGroup(br); AutoDrawGroups.Add(autoDrawGroup); return(autoDrawGroup); case RegionType.Other: var other = new Region.Other(br); Others.Add(other); return(other); default: throw new NotImplementedException($"Unimplemented region type: {type}"); } }
/// <summary> /// Loads the file from the specified stream. /// </summary> /// <param name="stream">The stream to read from.</param> public override void Load(Stream stream) { BinaryReader reader = new BinaryReader(stream, Encoding.GetEncoding("us-ascii")); int blockCount = reader.ReadInt32(); for (int i = 0; i < blockCount; i++) { ZoneBlock type = (ZoneBlock)reader.ReadInt32(); int offset = reader.ReadInt32(); long nextBlock = stream.Position; stream.Seek(offset, SeekOrigin.Begin); switch (type) { case ZoneBlock.Info: Type = (ZoneType)reader.ReadInt32(); Width = reader.ReadInt32(); Height = reader.ReadInt32(); GridCount = reader.ReadInt32(); GridSize = reader.ReadSingle(); StartPosition = new IntVector2(reader.ReadInt32(), reader.ReadInt32()); for (int w = 0; w < Width; w++) { for (int h = 0; h < Height; h++) { Positions[w, h].IsUsed = reader.ReadBoolean(); Positions[w, h].Position = reader.ReadVector2(); } } break; case ZoneBlock.SpawnPoints: int spawnCount = reader.ReadInt32(); for (int j = 0; j < spawnCount; j++) { SpawnPoint spawnPoint = new SpawnPoint(); spawnPoint.Position = reader.ReadVector3(); spawnPoint.Name = reader.ReadByteString(); SpawnPoints.Add(spawnPoint); } break; case ZoneBlock.Textures: int textureCount = reader.ReadInt32(); for (int j = 0; j < textureCount; j++) { Textures.Add(reader.ReadByteString()); } break; case ZoneBlock.Tiles: int tileCount = reader.ReadInt32(); for (int j = 0; j < tileCount; j++) { ZoneTile tile = new ZoneTile(); tile.Layer1 = reader.ReadInt32(); tile.Layer2 = reader.ReadInt32(); tile.Offset1 = reader.ReadInt32(); tile.Offset2 = reader.ReadInt32(); tile.BlendingEnabled = reader.ReadInt32() != 0; tile.Rotation = (TileRotation)reader.ReadInt32(); tile.TileType = reader.ReadInt32(); Tiles.Add(tile); } break; case ZoneBlock.Economy: Name = reader.ReadByteString(); IsUnderground = reader.ReadInt32() != 0; BackgroundMusicFilePath = reader.ReadByteString(); SkyFilePath = reader.ReadByteString(); EconomyCheckRate = reader.ReadInt32(); PopulationBase = reader.ReadInt32(); PopulationGrowthRate = reader.ReadInt32(); MetalConsumption = reader.ReadInt32(); StoneConsumption = reader.ReadInt32(); WoodConsumption = reader.ReadInt32(); LeatherConsumption = reader.ReadInt32(); ClothConsumption = reader.ReadInt32(); AlchemyConsumption = reader.ReadInt32(); ChemicalConsumption = reader.ReadInt32(); IndustrialConsumption = reader.ReadInt32(); MedicineConsumption = reader.ReadInt32(); FoodConsumption = reader.ReadInt32(); break; } if (i < blockCount - 1) { stream.Seek(nextBlock, SeekOrigin.Begin); } } }
internal override Event ReadEntry(BinaryReaderEx br) { EventType type = br.GetEnum32 <EventType>(br.Position + 8); switch (type) { case EventType.Light: var light = new Event.Light(br); Lights.Add(light); return(light); case EventType.Sound: var sound = new Event.Sound(br); Sounds.Add(sound); return(sound); case EventType.SFX: var sfx = new Event.SFX(br); SFXs.Add(sfx); return(sfx); case EventType.WindSFX: var windSFX = new Event.WindSFX(br); WindSFXs.Add(windSFX); return(windSFX); case EventType.Treasure: var treasure = new Event.Treasure(br); Treasures.Add(treasure); return(treasure); case EventType.Generator: var generator = new Event.Generator(br); Generators.Add(generator); return(generator); case EventType.Message: var message = new Event.Message(br); Messages.Add(message); return(message); case EventType.ObjAct: var objAct = new Event.ObjAct(br); ObjActs.Add(objAct); return(objAct); case EventType.SpawnPoint: var spawnPoint = new Event.SpawnPoint(br); SpawnPoints.Add(spawnPoint); return(spawnPoint); case EventType.MapOffset: var mapOffset = new Event.MapOffset(br); MapOffsets.Add(mapOffset); return(mapOffset); case EventType.Navmesh: var navmesh = new Event.Navmesh(br); Navmeshes.Add(navmesh); return(navmesh); case EventType.Environment: var environment = new Event.Environment(br); Environments.Add(environment); return(environment); case EventType.PseudoMultiplayer: var pseudoMultiplayer = new Event.PseudoMultiplayer(br); PseudoMultiplayers.Add(pseudoMultiplayer); return(pseudoMultiplayer); default: throw new NotImplementedException($"Unsupported event type: {type}"); } }
public void Add(IMsbEvent item) { switch (item) { case Event.Light e: Lights.Add(e); break; case Event.Sound e: Sounds.Add(e); break; case Event.SFX e: SFXs.Add(e); break; case Event.WindSFX e: WindSFXs.Add(e); break; case Event.Treasure e: Treasures.Add(e); break; case Event.Generator e: Generators.Add(e); break; case Event.Message e: Messages.Add(e); break; case Event.ObjAct e: ObjActs.Add(e); break; case Event.SpawnPoint e: SpawnPoints.Add(e); break; case Event.MapOffset e: MapOffsets.Add(e); break; case Event.Navmesh e: Navmeshes.Add(e); break; case Event.Environment e: Environments.Add(e); break; case Event.PseudoMultiplayer e: PseudoMultiplayers.Add(e); break; default: throw new ArgumentException( message: "Item is not recognized", paramName: nameof(item)); } }