public ActionPanelMapSwitch(DeathmatchMap Map, Squad ActiveSquad, MapSwitchPoint ActiveSwitchPoint) : base(PanelName, Map, false) { this.ActiveSquad = ActiveSquad; this.ActiveSwitchPoint = ActiveSwitchPoint; }
public static void ChangeSquadBetweenMaps(DeathmatchMap Map, Squad ActiveSquad, MapSwitchPoint ActiveSwitchPoint) { Map.ListPlayer[Map.ActivePlayerIndex].ListSquad.Remove(ActiveSquad); Map.ListPlayer[Map.ActivePlayerIndex].UpdateAliveStatus(); DeathmatchMap SwitchMap = (DeathmatchMap)Map.ListSubMap.Find(x => x.BattleMapPath == ActiveSwitchPoint.SwitchMapPath); if (!SwitchMap.IsInit) { SwitchMap.Init(); SwitchMap.TogglePreview(true); } for (int U = 0; U < ActiveSquad.UnitsInSquad; ++U) { ActiveSquad.At(U).ReinitializeMembers(Map.DicUnitType[ActiveSquad.At(U).UnitTypeName]); } ActiveSquad.ReloadSkills(SwitchMap.DicUnitType, SwitchMap.DicRequirement, SwitchMap.DicEffect, SwitchMap.DicAutomaticSkillTarget, SwitchMap.DicManualSkillTarget); SwitchMap.ListPlayer[Map.ActivePlayerIndex].ListSquad.Add(ActiveSquad); SwitchMap.ListPlayer[Map.ActivePlayerIndex].UpdateAliveStatus(); ActiveSquad.SetPosition(new Vector3(ActiveSwitchPoint.OtherMapEntryPoint.X, ActiveSwitchPoint.OtherMapEntryPoint.Y, ActiveSquad.Z)); Map.ListGameScreen.Remove(Map); Map.ListGameScreen.Insert(0, SwitchMap); }
public MapLayer(DeathmatchMap Map, BinaryReader BR) { this.Map = Map; ListSingleplayerSpawns = new List <EventPoint>(); ListMultiplayerSpawns = new List <EventPoint>(); ListMapSwitchPoint = new List <MapSwitchPoint>(); ListTeleportPoint = new List <TeleportPoint>(); ListSubLayer = new List <SubMapLayer>(); ListProp = new List <InteractiveProp>(); StartupDelay = BR.ReadInt32(); ToggleDelayOn = BR.ReadInt32(); ToggleDelayOff = BR.ReadInt32(); _Depth = BR.ReadSingle(); if (StartupDelay == 0) { IsVisible = true; ToggleTimer = ToggleDelayOn; } else { IsVisible = false; ToggleTimer = StartupDelay; } ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y]; for (int Y = 0; Y < Map.MapSize.Y; Y++) { for (int X = 0; X < Map.MapSize.X; X++) { ArrayTerrain[X, Y] = new Terrain(BR, X, Y); } } int ListSingleplayerSpawnsCount = BR.ReadInt32(); ListSingleplayerSpawns = new List <EventPoint>(ListSingleplayerSpawnsCount); for (int S = 0; S < ListSingleplayerSpawnsCount; S++) { EventPoint NewPoint = new EventPoint(BR); NewPoint.ColorRed = Color.Blue.R; NewPoint.ColorGreen = Color.Blue.G; NewPoint.ColorBlue = Color.Blue.B; ListSingleplayerSpawns.Add(NewPoint); } int ListMultiplayerSpawnsCount = BR.ReadInt32(); ListMultiplayerSpawns = new List <EventPoint>(ListMultiplayerSpawnsCount); for (int S = 0; S < ListMultiplayerSpawnsCount; S++) { EventPoint NewPoint = new EventPoint(BR); int ColorIndex = Convert.ToInt32(NewPoint.Tag) - 1; /*NewPoint.ColorRed = Map.ListMultiplayerColor[ColorIndex].R; * NewPoint.ColorGreen = Map.ListMultiplayerColor[ColorIndex].G; * NewPoint.ColorBlue = Map.ListMultiplayerColor[ColorIndex].B;*/ ListMultiplayerSpawns.Add(NewPoint); } int ListMapSwitchPointCount = BR.ReadInt32(); ListMapSwitchPoint = new List <MapSwitchPoint>(ListMapSwitchPointCount); for (int S = 0; S < ListMapSwitchPointCount; S++) { MapSwitchPoint NewMapSwitchPoint = new MapSwitchPoint(BR); ListMapSwitchPoint.Add(NewMapSwitchPoint); if (BattleMap.DicBattmeMapType.Count > 0 && !string.IsNullOrEmpty(NewMapSwitchPoint.SwitchMapPath) && Map.ListSubMap.Find(x => x.BattleMapPath == NewMapSwitchPoint.SwitchMapPath) == null) { BattleMap NewMap = BattleMap.DicBattmeMapType[NewMapSwitchPoint.SwitchMapType].GetNewMap(string.Empty); NewMap.BattleMapPath = NewMapSwitchPoint.SwitchMapPath; NewMap.ListGameScreen = Map.ListGameScreen; NewMap.ListSubMap = Map.ListSubMap; NewMap.Load(); } } int ListTeleportPointCount = BR.ReadInt32(); ListTeleportPoint = new List <TeleportPoint>(ListTeleportPointCount); for (int S = 0; S < ListTeleportPointCount; S++) { TeleportPoint NewTeleportPoint = new TeleportPoint(BR); ListTeleportPoint.Add(NewTeleportPoint); } int ListPropCount = BR.ReadInt32(); ListProp = new List <InteractiveProp>(ListPropCount); for (int L = 0; L < ListPropCount; L++) { ListProp.Add(Map.DicInteractiveProp[BR.ReadString()].LoadCopy(BR)); } LayerGrid = new DeathmatchMap2D(Map, this, BR); int ListSubLayerCount = BR.ReadInt32(); ListSubLayer = new List <SubMapLayer>(ListSubLayerCount); for (int L = 0; L < ListSubLayerCount; L++) { ListSubLayer.Add(new SubMapLayer(Map, BR)); } LayerGrid.Depth = Depth; }