Пример #1
0
 public AsignVariableTrigger(FightingZone Map)
     : base(Map, 140, 70, "Asign Variable Event", new string[] { "Asign Variable" }, new string[] { "Variable asigned" })
 {
     _VariableName = "";
     _Value        = 0;
     _SignOperator = Operators.SignOperators.Equal;
 }
        public LoadingScreen(FightingZone ScreenToLoad, TripleThunderOnlineClient Client)
        {
            this.ScreenToLoad = ScreenToLoad;
            this.Client       = Client;

            HasAskedForInfo = false;
        }
        private void StartGame()
        {
            sndButtonClick.Play();

            if (OnlineClient != null && OnlineClient.IsConnected)
            {
                OnlineClient.StartGame();
            }
            else
            {
                FightingZone NewMap;

                if (Room.MapPath == "Random")
                {
                    DirectoryInfo MapDirectory = new DirectoryInfo(Content.RootDirectory + "/Maps/Triple Thunder/Battle/");

                    FileInfo[] ArrayMapFile = MapDirectory.GetFiles("*.ttm");
                    Random     Random       = new Random();
                    string     FileName     = ArrayMapFile[Random.Next(ArrayMapFile.Length)].Name;
                    FileName = FileName.Remove(FileName.Length - 4);
                    NewMap   = new FightingZone("Battle/" + FileName, Room.UseTeams, Room.ListRoomPlayer);
                }
                else
                {
                    NewMap = new FightingZone(Room.MapPath, Room.UseTeams, Room.ListRoomPlayer);
                }

                NewMap.Rules = new BattleGameRules(Room, NewMap);
                PushScreen(NewMap);
            }
        }
Пример #4
0
        protected override void Execute(IOnlineConnection Sender)
        {
            FightingZone NewGame = new FightingZone(Owner.MapPath, Owner.UseTeams, OnlineServer, CreatedGroup);

            GameRules Rules = new MissionGameRules(Owner, NewGame);
            NewGame.Rules = Rules;

            CreatedGroup.SetGame(NewGame);

            for (int P = 0; P < CreatedGroup.Room.ListOnlinePlayer.Count; P++)
            {
                IOnlineConnection ActiveOnlinePlayer = CreatedGroup.Room.ListOnlinePlayer[P];
                Player ActivePlayer = Owner.ListRoomPlayer[P];
                ActivePlayer.OnlineClient = ActiveOnlinePlayer;

                NewGame.AddLocalCharacter(ActivePlayer);

                //Add Game Specific scripts
                Dictionary<string, OnlineScript> DicNewScript = new Dictionary<string, OnlineScript>();
                DicNewScript.Add(FinishedLoadingScriptServer.ScriptName, new FinishedLoadingScriptServer(CreatedGroup));
                DicNewScript.Add(SendPlayerUpdateScriptServer.ScriptName, new SendPlayerUpdateScriptServer(CreatedGroup, ActivePlayer));
                DicNewScript.Add(ShootBulletScriptServer.ScriptName, new ShootBulletScriptServer(CreatedGroup, ActivePlayer));
                DicNewScript.Add(AskTripleThunderGameDataScriptServer.ScriptName, new AskTripleThunderGameDataScriptServer(CreatedGroup));
                ActiveOnlinePlayer.AddOrReplaceScripts(DicNewScript);
            }

            for (int P = 0; P < CreatedGroup.Room.ListOnlinePlayer.Count; P++)
            {
                IOnlineConnection ActiveOnlinePlayer = CreatedGroup.Room.ListOnlinePlayer[P];
                ActiveOnlinePlayer.Send(new CreateGameScriptServer());
            }
        }
        protected override void Execute(IOnlineConnection Sender)
        {
            FightingZone NewGame = new FightingZone(Owner.MapPath, Owner.UseTeams, OnlineServer, CreatedGroup);

            GameRules Rules = new BattleGameRules(Owner, NewGame);

            NewGame.Rules = Rules;

            CreatedGroup.SetGame(NewGame);

            for (int P = 0; P < CreatedGroup.Room.ListOnlinePlayer.Count; P++)
            {
                IOnlineConnection ActiveOnlinePlayer = CreatedGroup.Room.ListOnlinePlayer[P];
                Player            ActivePlayer       = Owner.ListRoomPlayer[P];
                ActivePlayer.OnlineClient = ActiveOnlinePlayer;

                NewGame.AddLocalCharacter(ActivePlayer);

                //Add Game Specific scripts
                Dictionary <string, OnlineScript> DicNewScript = OnlineHelper.GetTripleThunderScriptsServer(CreatedGroup, ActivePlayer);
                ActiveOnlinePlayer.AddOrReplaceScripts(DicNewScript);
            }

            for (int P = 0; P < CreatedGroup.Room.ListOnlinePlayer.Count; P++)
            {
                IOnlineConnection ActiveOnlinePlayer = CreatedGroup.Room.ListOnlinePlayer[P];
                ActiveOnlinePlayer.Send(new CreateGameScriptServer());
            }
        }
Пример #6
0
        public void Load(BinaryReader BR, ContentManager Content, Layer Owner, FightingZone Map)
        {
            this.Owner = Owner;
            this.Map   = Map;
            _Position  = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            Depth      = BR.ReadInt32();

            DoLoad(BR, Content);
        }
Пример #7
0
 public SpawnRobotTrigger(FightingZone Map)
     : base(Map, 140, 70, "Spawn Robot", new string[] { "Spawn Robot" }, new string[] { })
 {
     _LayerIndex  = 0;
     _Team        = 0;
     _AIPath      = string.Empty;
     _RobotPath   = string.Empty;
     _ListWeapons = new List <string>();
 }
        public BattleGameRules(BattleRoomInformations Room, FightingZone Map)
            : base(Map)
        {
            this.Room = Room;

            GameLengthInSeconds = 0;
            DicPointsPerTeam    = new Dictionary <int, int>();
            ListCurrentLivesRemainingPerTeam = new List <int>();
        }
 public StageCompleteTextOverlay(Texture2D sprWaveComplete, SpriteFont fntWaveNumber, int WaveNumber, FightingZone Map, MapScript Owner)
 {
     this.sprWaveComplete = sprWaveComplete;
     this.fntWaveNumber   = fntWaveNumber;
     this.WaveNumber      = WaveNumber;
     this.Map             = Map;
     this.Owner           = Owner;
     AnimationState       = AnimationStates.Visible;
 }
        public static void ClassInit(TestContext context)
        {
            AttackContext = new TripleThunderAttackContext();
            RobotContext  = new TripleThunderRobotContext();
            DummyMap      = new FightingZone(RobotContext, AttackContext);
            AttackParams  = DummyMap.AttackParams;
            DummyMap.ListLayer.Add(new Layer(DummyMap));
            DummyMap.LoadTripleThunderEffects();
            DummyMap.LoadTripleThunderRequirements();
            DummyMap.LoadTripleThunderTargetTypes();

            RobotContext.Map           = DummyMap;
            AttackContext.OwnerSandbox = DummyMap.ListLayer[0];
        }
Пример #11
0
        protected override void Execute(IOnlineConnection Host)
        {
            FightingZone NewGame = new FightingZone(Owner);
            GameRules    Rules   = new MissionGameRules(Room, NewGame);

            NewGame.Rules = Rules;

            NewGame.ListGameScreen = ListGameScreen;
            NewGame.PushScreen(new LoadingScreen(NewGame, Owner));

            Dictionary <string, OnlineScript> DicNewScript = OnlineHelper.GetTripleThunderScriptsClient(Owner);

            Host.AddOrReplaceScripts(DicNewScript);
        }
        private void StartGame()
        {
            sndButtonClick.Play();

            if (OnlineClient != null && OnlineClient.IsConnected)
            {
                OnlineClient.StartGame();
            }
            else
            {
                RemoveAllScreens();

                FightingZone NewMap = new FightingZone(Room.MapPath, true, Room.ListRoomPlayer);
                NewMap.Rules = new MissionGameRules(Room, NewMap);
                PushScreen(NewMap);
            }
        }
Пример #13
0
 public Layer(FightingZone Owner)
 {
     ListDelayedOnlineCommand  = new List <DelayedExecutableOnlineScript>();
     ListWorldCollisionPolygon = new List <WorldPolygon>();
     ListImages             = new List <SimpleAnimation>();
     ListProp               = new List <Prop>();
     ListSpawnPointTeam     = new List <SpawnPoint>();
     ListSpawnPointNoTeam   = new List <SpawnPoint>();
     ListVisualEffects      = new List <SimpleAnimation>();
     DicRobot               = new Dictionary <uint, RobotAnimation>();
     ListVehicle            = new List <Vehicle>();
     ListRobotToAdd         = new List <RobotAnimation>();
     ListRobotToRemove      = new List <uint>();
     GroundLevelCollision   = new Polygon();
     ListAttackCollisionBox = new List <Projectile>();
     this.Owner             = Owner;
 }
Пример #14
0
        private void LoadMap(string MapPath)
        {
            string Name = MapPath.Substring(0, MapPath.Length - 4).Substring(28);

            this.Text = Name + " - Project Eternity Triple Thunder Map Editor";
            LayerViewer.Preload();

            FightingZone LoadedFightingZone = new FightingZone(Name, false);

            LoadedFightingZone.UsePreview          = true;
            LayerViewer.ActiveFightingZone         = LoadedFightingZone;
            LayerViewer.ActiveFightingZone.Content = LayerViewer.content;
            LayerViewer.ActiveFightingZone.Load();


            LayerViewer.SetListMapScript(LoadedFightingZone.ListMapScript);
            LayerViewer.Helper.OnSelect = (SelectedObject, RightClick) => {
                if (RightClick && SelectedObject != null)
                {
                    LayerViewer.cmsScriptMenu.Show(LayerViewer, PointToClient(Cursor.Position));
                }
                else
                {
                    pgScriptProperties.SelectedObject = SelectedObject;
                }
            };


            for (int S = LoadedFightingZone.ListMapScript.Count - 1; S >= 0; --S)
            {
                LayerViewer.Helper.InitScript(LoadedFightingZone.ListMapScript[S]);
            }

            for (int L = 0; L < LayerViewer.ActiveFightingZone.ListLayer.Count; L++)
            {
                lstLayers.Items.Add("Layer " + lstLayers.Items.Count);
            }

            if (LayerViewer.ActiveFightingZone.ListLayer.Count > 0)
            {
                lstLayers.SelectedIndex = 0;
            }
        }
        protected override void Execute(IOnlineConnection Host)
        {
            FightingZone NewGame = new FightingZone(Owner);
            GameRules    Rules   = new BattleGameRules(Room, NewGame);

            NewGame.Rules = Rules;

            NewGame.ListGameScreen = ListGameScreen;
            NewGame.PushScreen(new LoadingScreen(NewGame, Owner));

            Dictionary <string, OnlineScript> DicNewScript = new Dictionary <string, OnlineScript>();

            DicNewScript.Add(SendPlayerUpdateScriptClient.ScriptName, new SendPlayerUpdateScriptClient(Owner));
            DicNewScript.Add(SendPlayerRespawnScriptClient.ScriptName, new SendPlayerRespawnScriptClient(Owner));
            DicNewScript.Add(SendPlayerDamageScriptClient.ScriptName, new SendPlayerDamageScriptClient(Owner));
            DicNewScript.Add(ShootBulletScriptClient.ScriptName, new ShootBulletScriptClient(Owner));
            DicNewScript.Add(ReceiveGameDataScriptClient.ScriptName, new ReceiveGameDataScriptClient(Owner));
            DicNewScript.Add(GoToNextMapScriptClient.ScriptName, new GoToNextMapScriptClient(Owner));
            DicNewScript.Add(GameEndedScriptClient.ScriptName, new GameEndedScriptClient(Owner));

            Host.AddOrReplaceScripts(DicNewScript);
        }
Пример #16
0
        public virtual void DrawRegular(CustomSpriteBatch g)
        {
            if (FightingZone.ShowCollisionBoxes)
            {
                foreach (Polygon ActivePolygon in ListCollisionPolygon)
                {
                    g.Draw(FightingZone.sprPixel, new Rectangle((int)(ActivePolygon.Center.X) - 2,
                                                                (int)(ActivePolygon.Center.Y) - 2, (int)(5), (int)5), Color.Red);

                    for (int V = 0; V < ActivePolygon.ArrayVertex.Length; V++)
                    {
                        if (V < ActivePolygon.ArrayVertex.Length - 1)
                        {
                            FightingZone.DrawLine(g, ActivePolygon.ArrayVertex[V], ActivePolygon.ArrayVertex[V + 1], Color.Red);
                        }
                        else
                        {
                            FightingZone.DrawLine(g, ActivePolygon.ArrayVertex[V], ActivePolygon.ArrayVertex[0], Color.Red);
                        }
                    }
                }
            }
        }
 public MissionGameRules(MissionRoomInformations Room, FightingZone Map)
     : base(Map)
 {
     this.Room = Room;
 }
Пример #18
0
 public TripleThunderAIInfo(RobotAnimation Owner, Layer OwnerLayer, FightingZone OwnerMap)
 {
     this.Owner      = Owner;
     this.OwnerLayer = OwnerLayer;
     this.OwnerMap   = OwnerMap;
 }
        protected override void Execute(IOnlineConnection Host)
        {
            OnlineGameClient.RoomID = RoomID;

            Dictionary <string, OnlineScript> DicNewGameServerScript = new Dictionary <string, OnlineScript>();
            IMissionSelect   NewMissionSelectScreen;
            RoomInformations NewRoom;
            FightingZone     NewFightingZone = null;

            if (HasGame)
            {
                NewFightingZone = new FightingZone(OnlineGameClient);
                NewFightingZone.ListGameScreen = ScreenOwner.ListGameScreen;

                DicNewGameServerScript = OnlineHelper.GetTripleThunderScriptsClient(OnlineGameClient);
                Host.IsGameReady       = true;
            }
            if (RoomType == RoomInformations.RoomTypeMission)
            {
                MissionRoomInformations MissionRoom = new MissionRoomInformations(RoomID, RoomName, RoomType, RoomSubtype, CurrentDifficulty, MapPath, ListJoiningPlayerID, RoomData);
                if (HasGame)
                {
                    NewFightingZone.Rules = new MissionGameRules(MissionRoom, NewFightingZone);
                }

                NewRoom = MissionRoom;

                MissionSelect NewMissionSelect = new MissionSelect(OnlineGameClient, OnlineCommunicationClient, MissionRoom);
                NewScreen = NewMissionSelect;
                NewMissionSelectScreen = NewMissionSelect;

                DicNewGameServerScript.Add(CreateGameMissionScriptClient.ScriptName, new CreateGameMissionScriptClient(OnlineGameClient, ScreenOwner.ListGameScreen, MissionRoom));
                DicNewGameServerScript.Add(ChangeRoomExtrasBattleScriptClient.ScriptName, new ChangeRoomExtrasMissionScriptClient(MissionRoom, NewMissionSelect));
            }
            else
            {
                BattleRoomInformations BattleRoom = new BattleRoomInformations(RoomID, RoomName, RoomType, RoomSubtype, CurrentDifficulty, MapPath, ListJoiningPlayerID, RoomData);
                if (HasGame)
                {
                    NewFightingZone.Rules = new BattleGameRules(BattleRoom, NewFightingZone);
                }

                NewRoom = BattleRoom;

                BattleSelect NewBattleSelect = new BattleSelect(OnlineGameClient, OnlineCommunicationClient, BattleRoom);
                NewScreen = NewBattleSelect;
                NewMissionSelectScreen = NewBattleSelect;

                DicNewGameServerScript.Add(CreateGameMissionScriptClient.ScriptName, new CreateGameBattleScriptClient(OnlineGameClient, ScreenOwner.ListGameScreen, BattleRoom));
                DicNewGameServerScript.Add(ChangeRoomExtrasBattleScriptClient.ScriptName, new ChangeRoomExtrasBattleScriptClient(BattleRoom, NewBattleSelect));
            }

            if (HasGame)
            {
                ScreenOwner.PushScreen(new LoadingScreen(NewFightingZone, OnlineGameClient));
            }

            DicNewGameServerScript.Add(PlayerJoinedScriptClient.ScriptName, new PlayerJoinedScriptClient(NewMissionSelectScreen));
            DicNewGameServerScript.Add(PlayerLeftScriptClient.ScriptName, new PlayerLeftScriptClient(NewRoom, OnlineGameClient, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangeCharacterScriptClient.ScriptName, new ChangeCharacterScriptClient(NewRoom, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangePlayerTypeScriptClient.ScriptName, new ChangePlayerTypeScriptClient(NewRoom, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangeTeamScriptClient.ScriptName, new ChangeTeamScriptClient(NewRoom));
            DicNewGameServerScript.Add(ChangeMapScriptClient.ScriptName, new ChangeMapScriptClient(NewRoom, NewMissionSelectScreen));
            DicNewGameServerScript.Add(ChangeRoomSubtypeScriptClient.ScriptName, new ChangeRoomSubtypeScriptClient(NewMissionSelectScreen));

            Host.AddOrReplaceScripts(DicNewGameServerScript);

            if (OnlineCommunicationClient.Host != null)
            {
                OnlineCommunicationClient.Chat.InsertTab(RoomID, "Chat");
                OnlineCommunicationClient.Chat.CloseTab("Global");
                OnlineCommunicationClient.Host.Send(new CreateOrJoinCommunicationGroupScriptClient(RoomID, false));
                OnlineCommunicationClient.Host.Send(new LeaveCommunicationGroupScriptClient("Global"));
            }

            OnlineGameClient.DelayOnlineScript(this);
        }
 public StartVisualNovelTrigger(FightingZone Map)
     : base(Map, 140, 70, "Start Visual Novel Event", new string[] { "Check Condition" }, new string[] { })
 {
     _VNPath = "";
     _PreLoad = true;
 }
Пример #21
0
        protected override void OnJoinRoomLocal(IOnlineConnection Sender, string RoomID, GameClientGroup ActiveGroup)
        {
            RoomInformations JoinedRoom            = (RoomInformations)ActiveGroup.Room;
            List <Player>    ListJoiningPlayerInfo = JoinedRoom.GetOnlinePlayer(Sender);

            foreach (IOnlineConnection ActivePlayer in ActiveGroup.Room.ListOnlinePlayer)
            {
                if (ActivePlayer == Sender)
                {
                    continue;
                }

                ActivePlayer.Send(new PlayerJoinedScriptServer(ListJoiningPlayerInfo));
            }

            Dictionary <string, OnlineScript> DicNewScript = OnlineHelper.GetRoomScriptsServer(JoinedRoom, Owner);

            if (JoinedRoom.RoomType == RoomInformations.RoomTypeMission)
            {
                MissionRoomInformations MissionRoom = (MissionRoomInformations)JoinedRoom;

                DicNewScript.Add(AskStartGameMissionScriptServer.ScriptName, new AskStartGameMissionScriptServer(MissionRoom, (TripleThunderClientGroup)ActiveGroup, Owner));
                DicNewScript.Add(AskChangeRoomExtrasMissionScriptServer.ScriptName, new AskChangeRoomExtrasMissionScriptServer(MissionRoom));
            }
            else if (JoinedRoom.RoomType == RoomInformations.RoomTypeBattle)
            {
                BattleRoomInformations BattleRoom = (BattleRoomInformations)JoinedRoom;

                DicNewScript.Add(AskStartGameMissionScriptServer.ScriptName, new AskStartGameBattleScriptServer(BattleRoom, (TripleThunderClientGroup)ActiveGroup, Owner));
                DicNewScript.Add(AskChangeRoomExtrasBattleScriptServer.ScriptName, new AskChangeRoomExtrasBattleScriptServer(BattleRoom));
            }
            Sender.AddOrReplaceScripts(DicNewScript);

            if (ActiveGroup.CurrentGame != null)
            {
                FightingZone CurrentGame = (FightingZone)ActiveGroup.CurrentGame;

                foreach (Player ActivePlayer in ListJoiningPlayerInfo)
                {
                    CurrentGame.AddLocalCharacter(ActivePlayer);
                    ActivePlayer.OnlineClient = Sender;

                    int LayerIndex;
                    CurrentGame.AddPlayerFromSpawn(ActivePlayer, CurrentGame.NextRobotID + (uint.MaxValue - 100), true, out LayerIndex);

                    //Add Game Specific scripts
                    DicNewScript = OnlineHelper.GetTripleThunderScriptsServer((TripleThunderClientGroup)ActiveGroup, ActivePlayer);
                    Sender.AddOrReplaceScripts(DicNewScript);

                    foreach (IOnlineConnection OtherPlayer in ActiveGroup.Room.ListOnlinePlayer)
                    {
                        if (OtherPlayer == Sender)
                        {
                            continue;
                        }

                        OtherPlayer.Send(new CreatePlayerScriptServer(ActivePlayer, LayerIndex, false));
                    }
                }
            }

            Sender.Send(new JoinRoomLocalScriptServer(RoomID, JoinedRoom.CurrentDifficulty, ListJoiningPlayerInfo, ActiveGroup));
        }
Пример #22
0
 public FightingZoneTrigger(FightingZone Map, int ScriptWidth, int ScriptHeight, string Name, string[] ArrayNameTrigger, string[] ArrayNameCondition)
     : base(ScriptWidth, ScriptHeight, Name, ArrayNameTrigger, ArrayNameCondition)
 {
     this.Map = Map;
 }
Пример #23
0
 public GameRules(FightingZone Map)
 {
     this.Map = Map;
 }
 public void SetGame(FightingZone CurrentGame)
 {
     _CurrentGame = CurrentGame;
 }
Пример #25
0
 public void SetGame(FightingZone NewGame)
 {
     CurrentGame       = NewGame;
     TripleThunderGame = NewGame;
 }
Пример #26
0
        public Layer(FightingZone Owner, BinaryReader BR)
            : this(Owner)
        {
            Dictionary <string, Prop> DicPropsByName = Prop.GetAllPropsByName();

            int ListPolygonCount = BR.ReadInt32();
            ListWorldCollisionPolygon = new List <WorldPolygon>(ListPolygonCount);
            for (int P = 0; P < ListPolygonCount; P++)
            {
                int ArrayVertexCount = BR.ReadInt32();

                Vector2[] ArrayVertex = new Vector2[ArrayVertexCount];
                for (int V = 0; V < ArrayVertexCount; V++)
                {
                    ArrayVertex[V] = new Vector2(BR.ReadSingle(), BR.ReadSingle());
                }

                bool BlockBullets = BR.ReadBoolean();
                bool IsPlatform   = BR.ReadBoolean();

                WorldPolygon NewPolygon;
                if (GameScreen.GraphicsDevice != null)
                {
                    NewPolygon = new WorldPolygon(ArrayVertex, GameScreen.GraphicsDevice.PresentationParameters.BackBufferWidth, GameScreen.GraphicsDevice.PresentationParameters.BackBufferHeight);
                }
                else
                {
                    NewPolygon = new WorldPolygon(ArrayVertex, 1, 1);
                }

                NewPolygon.BlockBullets = BlockBullets;
                NewPolygon.IsPlatform   = IsPlatform;

                NewPolygon.ComputerCenter();
                ListWorldCollisionPolygon.Add(NewPolygon);
            }

            int       ArrayGroundLevelCollisionCount = BR.ReadInt32();
            Vector2[] ArrayGroundLevelCollision      = new Vector2[ArrayGroundLevelCollisionCount];
            for (int V = 0; V < ArrayGroundLevelCollisionCount; V++)
            {
                ArrayGroundLevelCollision[V] = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            }
            short[] ArrayGroundLevelCollisionIndex = new short[2];
            ArrayGroundLevelCollisionIndex[0] = 0;
            ArrayGroundLevelCollisionIndex[1] = 1;

            if (GameScreen.GraphicsDevice != null)
            {
                GroundLevelCollision = new Polygon(ArrayGroundLevelCollision, ArrayGroundLevelCollisionIndex, GameScreen.GraphicsDevice.PresentationParameters.BackBufferWidth, GameScreen.GraphicsDevice.PresentationParameters.BackBufferHeight);
            }
            else
            {
                GroundLevelCollision = new Polygon(ArrayGroundLevelCollision, ArrayGroundLevelCollisionIndex, 1, 1);
            }

            int ListImagesCount = BR.ReadInt32();
            ListImages = new List <SimpleAnimation>(ListImagesCount);
            for (int P = 0; P < ListImagesCount; P++)
            {
                SimpleAnimation NewBackground = new SimpleAnimation(BR, true);
                NewBackground.Position = new Vector2(BR.ReadSingle(), BR.ReadSingle());
                NewBackground.Depth    = BR.ReadSingle();

                if (!Owner.IsServer)
                {
                    NewBackground.Load(Owner.Content, "");
                    ListImages.Add(NewBackground);
                }
            }

            int ListPropCount = BR.ReadInt32();
            for (int P = 0; P < ListPropCount; ++P)
            {
                string PropName = BR.ReadString();
                Prop   NewProp  = DicPropsByName[PropName].Copy();
                NewProp.Load(BR, Owner.Content, this, Owner);

                //Props are Client side only.
                if (NewProp.CanRunOnServer || !Owner.IsServer)
                {
                    ListProp.Add(NewProp);
                }
            }

            int ListSpawnPointSPCount = BR.ReadInt32();
            for (int S = 0; S < ListSpawnPointSPCount; ++S)
            {
                ListSpawnPointTeam.Add(SpawnPoint.Load(BR));
            }

            int ListSpawnPointMPCount = BR.ReadInt32();
            for (int S = 0; S < ListSpawnPointMPCount; ++S)
            {
                ListSpawnPointTeam.Add(SpawnPoint.Load(BR));
            }
        }
Пример #27
0
        public GameEndBattleScreen(FightingZone Owner)
        {
            this.Owner = Owner;

            TimeToLiveInSeconds = 5;
        }
Пример #28
0
 public SwitchTrigger(FightingZone Map)
     : base(Map, 140, 70, "Switch", new string[] { "Turn On", "Turn Off", "Toggle" }, new string[] { "Switch to On", "Switch to Off", "Switch toggled" })
 {
     State = _State;
 }
Пример #29
0
 public FightingZoneFormulaParser(FightingZone Map)
 {
     this.Map = Map;
 }
        protected override void Execute(IOnlineConnection Host)
        {
            Owner.RoomID = RoomID;

            Dictionary <string, OnlineScript> DicNewScript = new Dictionary <string, OnlineScript>();
            IMissionSelect   NewMissionSelectScreen;
            RoomInformations NewRoom;
            FightingZone     NewFightingZone = null;

            if (HasGame)
            {
                NewFightingZone = new FightingZone(Owner);
                NewFightingZone.ListGameScreen = ScreenOwner.ListGameScreen;

                DicNewScript.Add(SendPlayerUpdateScriptClient.ScriptName, new SendPlayerUpdateScriptClient(Owner));
                DicNewScript.Add(SendPlayerRespawnScriptClient.ScriptName, new SendPlayerRespawnScriptClient(Owner));
                DicNewScript.Add(SendPlayerDamageScriptClient.ScriptName, new SendPlayerDamageScriptClient(Owner));
                DicNewScript.Add(ShootBulletScriptClient.ScriptName, new ShootBulletScriptClient(Owner));
                DicNewScript.Add(ReceiveGameDataScriptClient.ScriptName, new ReceiveGameDataScriptClient(Owner));
                DicNewScript.Add(GoToNextMapScriptClient.ScriptName, new GoToNextMapScriptClient(Owner));
                DicNewScript.Add(GameEndedScriptClient.ScriptName, new GameEndedScriptClient(Owner));
                Host.IsGameReady = true;
            }
            if (RoomType == RoomInformations.RoomTypeMission)
            {
                MissionRoomInformations MissionRoom = new MissionRoomInformations(RoomID, RoomName, RoomType, RoomSubtype, CurrentDifficulty, MapPath, ListJoiningPlayerID, RoomData);
                if (HasGame)
                {
                    NewFightingZone.Rules = new MissionGameRules(MissionRoom, NewFightingZone);
                }
                NewRoom = MissionRoom;
                MissionSelect NewScreen = new MissionSelect(Owner, MissionRoom);
                DicNewScript.Add(CreateGameMissionScriptClient.ScriptName, new CreateGameMissionScriptClient(Owner, ScreenOwner.ListGameScreen, MissionRoom));
                DicNewScript.Add(ChangeRoomExtrasBattleScriptClient.ScriptName, new ChangeRoomExtrasMissionScriptClient(MissionRoom, NewScreen));
                NewMissionSelectScreen = NewScreen;
                ScreenOwner.PushScreen(NewScreen);
            }
            else
            {
                BattleRoomInformations BattleRoom = new BattleRoomInformations(RoomID, RoomName, RoomType, RoomSubtype, CurrentDifficulty, MapPath, ListJoiningPlayerID, RoomData);
                if (HasGame)
                {
                    NewFightingZone.Rules = new BattleGameRules(BattleRoom, NewFightingZone);
                }
                NewRoom = BattleRoom;
                BattleSelect NewScreen = new BattleSelect(Owner, BattleRoom);
                DicNewScript.Add(CreateGameMissionScriptClient.ScriptName, new CreateGameBattleScriptClient(Owner, ScreenOwner.ListGameScreen, BattleRoom));
                DicNewScript.Add(ChangeRoomExtrasBattleScriptClient.ScriptName, new ChangeRoomExtrasBattleScriptClient(BattleRoom, NewScreen));
                NewMissionSelectScreen = NewScreen;
                ScreenOwner.PushScreen(NewScreen);
            }

            if (HasGame)
            {
                ScreenOwner.PushScreen(new LoadingScreen(NewFightingZone, Owner));
            }

            DicNewScript.Add(PlayerJoinedScriptClient.ScriptName, new PlayerJoinedScriptClient(NewMissionSelectScreen));
            DicNewScript.Add(PlayerLeftScriptClient.ScriptName, new PlayerLeftScriptClient(NewRoom, Owner, NewMissionSelectScreen));
            DicNewScript.Add(ChangeCharacterScriptClient.ScriptName, new ChangeCharacterScriptClient(NewRoom, NewMissionSelectScreen));
            DicNewScript.Add(ChangePlayerTypeScriptClient.ScriptName, new ChangePlayerTypeScriptClient(NewRoom, NewMissionSelectScreen));
            DicNewScript.Add(ChangeTeamScriptClient.ScriptName, new ChangeTeamScriptClient(NewRoom));
            DicNewScript.Add(ChangeMapScriptClient.ScriptName, new ChangeMapScriptClient(NewRoom, NewMissionSelectScreen));
            DicNewScript.Add(ChangeRoomSubtypeScriptClient.ScriptName, new ChangeRoomSubtypeScriptClient(NewMissionSelectScreen));

            Host.AddOrReplaceScripts(DicNewScript);
        }