public PVPRoomInformations(string RoomID, string RoomName, string RoomType, string RoomSubtype, string CurrentDifficulty, string MapName, List <string> ListLocalPlayerID, ContentManager Content, byte[] RoomData)
            : base(RoomID, RoomName, RoomType, RoomSubtype, CurrentDifficulty, MapName, ListLocalPlayerID)
        {
            using (MemoryStream MS = new MemoryStream(RoomData))
            {
                using (BinaryReader BR = new BinaryReader(MS))
                {
                    MaxKill = BR.ReadInt32();
                    MaxGameLengthInMinutes = BR.ReadInt32();

                    int NumberOfPlayers = BR.ReadInt32();
                    for (int P = 0; P < NumberOfPlayers; ++P)
                    {
                        BattleMapPlayer NewPlayer = new BattleMapPlayer(BR.ReadString(), BR.ReadString(), BR.ReadString(), true, BR.ReadInt32(), BR.ReadBoolean(),
                                                                        Color.FromNonPremultiplied(BR.ReadByte(), BR.ReadByte(), BR.ReadByte(), 255));
                        Unit      NewUnit      = Unit.FromFullName("Normal/Original/Voltaire", Content, PlayerManager.DicUnitType, PlayerManager.DicRequirement, PlayerManager.DicEffect, PlayerManager.DicAutomaticSkillTarget);
                        Character NewCharacter = new Character("Original/Greg", Content, PlayerManager.DicRequirement, PlayerManager.DicEffect, PlayerManager.DicAutomaticSkillTarget, PlayerManager.DicManualSkillTarget);
                        NewCharacter.Level           = 1;
                        NewUnit.ArrayCharacterActive = new Character[] { NewCharacter };

                        Squad NewSquad = new Squad("Squad", NewUnit);

                        NewPlayer.Inventory.ActiveLoadout.ListSquad.Add(NewSquad);

                        ListRoomPlayer.Add(NewPlayer);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public BattleMapPlayer(BattleMapPlayer Clone)
        {
            if (Clone == null)
            {
                Team             = -1;
                OnlinePlayerType = PlayerTypeNA;
                return;
            }

            ConnectionID       = Clone.ConnectionID;
            Name               = Clone.Name;
            Guild              = Clone.Guild;
            License            = Clone.License;
            Ranking            = Clone.Ranking;
            IsOnline           = Clone.IsOnline;
            Team               = Clone.Team;
            Level              = Clone.Level;
            Money              = Clone.Money;
            IsPlayerControlled = Clone.IsPlayerControlled;
            Color              = Clone.Color;
            GameplayType       = Clone.GameplayType;
            InputManager       = Clone.InputManager;
            LocalPlayerIndex   = Clone.LocalPlayerIndex;

            OnlinePlayerType = Clone.OnlinePlayerType;
            OnlineClient     = Clone.OnlineClient;

            Inventory = Clone.Inventory;
        }
        public void AddOnlinePlayer(IOnlineConnection NewPlayer, string PlayerType)
        {
            ListOnlinePlayer.Add(NewPlayer);
            BattleMapPlayer NewRoomPlayer = new BattleMapPlayer(NewPlayer.ID, NewPlayer.Name, PlayerType, true, 0, true, Color.Blue);

            NewRoomPlayer.OnlineClient = NewPlayer;
            NewRoomPlayer.GameplayType = GameplayTypes.None;
            ListRoomPlayer.Add(NewRoomPlayer);
            CurrentPlayerCount = (byte)ListRoomPlayer.Count;
        }
Exemplo n.º 4
0
        private void StartGame()
        {
            sndButtonClick.Play();

            if (OnlineGameClient != null && OnlineGameClient.IsConnected)
            {
                OnlineGameClient.StartGame();
            }
            else
            {
                Dictionary <string, List <Squad> > DicSpawnSquadByPlayer = new Dictionary <string, List <Squad> >();
                for (int P = 0; P < Room.ListRoomPlayer.Count; ++P)
                {
                    DicSpawnSquadByPlayer.Add(Room.ListRoomPlayer[P].Name, Room.ListRoomPlayer[P].Inventory.ActiveLoadout.ListSquad);
                }

                BattleMap NewMap;

                if (Room.MapPath == "Random")
                {
                    NewMap = BattleMap.DicBattmeMapType[Room.MapType].GetNewMap(Room.RoomType);
                }
                else
                {
                    NewMap = BattleMap.DicBattmeMapType[Room.MapType].GetNewMap(Room.RoomType);
                }

                NewMap.BattleMapPath         = Room.MapPath;
                NewMap.DicSpawnSquadByPlayer = DicSpawnSquadByPlayer;
                NewMap.ListGameScreen        = ListGameScreen;

                for (int P = 0; P < 10; P++)
                {
                    if (P < PlayerManager.ListLocalPlayer.Count)
                    {
                        BattleMapPlayer ActivePlayer = PlayerManager.ListLocalPlayer[P];
                        NewMap.AddLocalPlayer(ActivePlayer);
                    }
                    else//Fill with empty players to ensure the enemy player is always player 10+
                    {
                        NewMap.AddLocalPlayer(null);
                    }
                }

                NewMap.Load();
                NewMap.Init();
                NewMap.TogglePreview(true);
                ListGameScreen.Insert(0, NewMap);
            }
        }
        public InventoryScreen()
        {
            ActivePlayer       = PlayerManager.ListLocalPlayer[0];
            ActivePlayer.Level = 50;

            LeftSideWidth       = (int)(Constants.Width * 0.5);
            TopSectionHeight    = (int)(Constants.Height * 0.1);
            HeaderSectionY      = TopSectionHeight;
            HeaderSectionHeight = (int)(Constants.Height * 0.05);

            BottomSectionHeight = (int)(Constants.Height * 0.07);
            BottomSectionY      = Constants.Height - BottomSectionHeight;

            MiddleSectionY      = (HeaderSectionY + HeaderSectionHeight);
            MiddleSectionHeight = BottomSectionY - MiddleSectionY;
        }
Exemplo n.º 6
0
        private void DrawPlayerBox(CustomSpriteBatch g, int DrawX, int DrawY, int PlayerToDrawIndex)
        {
            BattleMapPlayer PlayerToDraw = Room.ListRoomPlayer[PlayerToDrawIndex];

            DrawBox(g, new Vector2(DrawX, DrawY), 50, 25, Color.White);
            DrawBox(g, new Vector2(DrawX + 50, DrawY), 50, 25, Color.White);
            DrawBox(g, new Vector2(DrawX + 100, DrawY), 180, 25, Color.White);
            if (Room.UseTeams && ListMapTeam.Count > 0)
            {
                DrawBox(g, new Vector2(DrawX + 280, DrawY), 85, 25, Color.White);
                g.DrawStringMiddleAligned(fntText, ListAllTeamInfo[PlayerToDraw.Team].TeamName, new Vector2(DrawX + 322, DrawY + 5), Color.White);
            }

            g.DrawString(fntText, "Lv. 50", new Vector2(DrawX + 57, DrawY + 5), Color.White);
            g.DrawString(fntText, PlayerToDraw.Name, new Vector2(DrawX + 110, DrawY + 5), Color.White);

            for (int S = 0; S < PlayerToDraw.Inventory.ActiveLoadout.ListSquad.Count; S++)
            {
                if (PlayerToDraw.Inventory.ActiveLoadout.ListSquad[S] != null)
                {
                    g.Draw(PlayerToDraw.Inventory.ActiveLoadout.ListSquad[S][0].SpriteMap, new Rectangle(DrawX + 370 + S * 35, DrawY - 3, 32, 32), Color.White);
                }
            }

            if (PlayerToDraw.OnlinePlayerType == BattleMapPlayer.PlayerTypeHost)
            {
                g.DrawString(fntText, "Host", new Vector2(DrawX + 6, DrawY + 5), Color.White);
            }
            else if (PlayerToDraw.OnlinePlayerType == BattleMapPlayer.PlayerTypeReady)
            {
                g.DrawString(fntText, "Ready", new Vector2(DrawX + 6, DrawY + 5), Color.White);
            }
            if (SelectingTeam == -1)
            {
                Rectangle PlayerInfoCollisionBox = new Rectangle(DrawX, DrawY, 320, 25);
                Rectangle TeamCollisionBox       = new Rectangle(DrawX + 280, DrawY, 85, 25);
                if (Room.UseTeams && ListMapTeam.Count > 0 && PlayerManager.ListLocalPlayer.Contains(PlayerToDraw) && TeamCollisionBox.Contains(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y))
                {
                    g.Draw(sprPixel, new Rectangle(DrawX + 280, DrawY, 85, 25), Color.FromNonPremultiplied(255, 255, 255, 127));
                }
                else if (PlayerInfoCollisionBox.Contains(MouseHelper.MouseStateCurrent.X, MouseHelper.MouseStateCurrent.Y))
                {
                    g.Draw(sprPixel, new Rectangle(DrawX, DrawY, 280, 25), Color.FromNonPremultiplied(255, 255, 255, 127));
                }
            }
        }
Exemplo n.º 7
0
        private void OnAddPlayerPressed()
        {
            sndButtonClick.Play();

            BattleMapPlayer NewPlayer    = new BattleMapPlayer(PlayerManager.OnlinePlayerID, "Player " + (PlayerManager.ListLocalPlayer.Count + 1), BattleMapPlayer.PlayerTypes.Online, false, 0, true, Color.Blue);
            Unit            NewUnit      = Unit.FromFullName("Normal/Original/Voltaire", GameScreen.ContentFallback, PlayerManager.DicUnitType, PlayerManager.DicRequirement, PlayerManager.DicEffect, PlayerManager.DicAutomaticSkillTarget);
            Character       NewCharacter = new Character("Original/Greg", GameScreen.ContentFallback, PlayerManager.DicRequirement, PlayerManager.DicEffect, PlayerManager.DicAutomaticSkillTarget, PlayerManager.DicManualSkillTarget);

            NewCharacter.Level           = 1;
            NewUnit.ArrayCharacterActive = new Character[] { NewCharacter };

            Squad NewSquad = new Squad("Squad", NewUnit);

            NewSquad.IsPlayerControlled = true;

            NewPlayer.Inventory.ActiveLoadout.ListSquad.Add(NewSquad);

            PlayerManager.ListLocalPlayer.Add(NewPlayer);
            UpdateUIElements();
        }
Exemplo n.º 8
0
        public override void Load()
        {
            sndButtonOver  = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav");
            sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav");

            fntArial12 = Content.Load <SpriteFont>("Fonts/Arial12");

            ListPlayerProfile = BattleMapPlayer.GetProfileNames();

            int   MenuWidth  = (int)(Constants.Width * 0.45);
            int   MenuHeight = (int)(Constants.Height * 0.45);
            float MenuX      = Constants.Width / 2 - MenuWidth / 2;
            float MenuY      = Constants.Height / 2 - MenuHeight / 2;

            ProfilesScrollbar = new BoxScrollbar(new Vector2(MenuX + MenuWidth - 20, MenuY), MenuHeight, Math.Max(0, ListPlayerProfile.Count - 9), OnProfileScrollbarChange);
            ConfirmButton     = new BoxButton(new Rectangle((int)MenuX + 10, (int)MenuY + MenuHeight + 5, 70, 30), fntArial12, "Confirm", OnButtonOver, OnConfirmButtonPressed);
            CancelButton      = new BoxButton(new Rectangle((int)MenuX + MenuWidth - 80, (int)MenuY + MenuHeight + 5, 70, 30), fntArial12, "Cancel", OnButtonOver, OnCancelButtonPressed);

            ArrayUIElement = new IUIElement[]
            {
                ConfirmButton, CancelButton, ProfilesScrollbar,
            };
        }
Exemplo n.º 9
0
        public override void Load()
        {
            Trace.Listeners.Add(new TextWriterTraceListener("ClientError.log", "myListener"));

            PlayerManager.DicUnitType = Unit.LoadAllUnits();
            PlayerManager.DicRequirement = BaseSkillRequirement.LoadAllRequirements();
            PlayerManager.DicEffect = BaseEffect.LoadAllEffects();
            PlayerManager.DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            PlayerManager.DicManualSkillTarget = ManualSkillTarget.LoadAllTargetTypes();

            fntArial12 = Content.Load<SpriteFont>("Fonts/Arial12");
            ChatInput = new TextInput(fntArial12, sprPixel, sprPixel, new Vector2(68, 518), new Vector2(470, 20), SendMessage);

            sndBGM = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/Music/Channel.mp3");
            sndBGM.SetLoop(true);
            sndBGM.PlayAsBGM();

            sndButtonOver = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Over.wav");
            sndButtonClick = new FMODSound(FMODSystem, "Content/Triple Thunder/Menus/SFX/Button Click.wav");

            sprBackground = Content.Load<Texture2D>("Triple Thunder/Menus/Channel/Background");
            sprLicenseAll = Content.Load<Texture2D>("Triple Thunder/Menus/Channel/License All");
            sprTitleBattle = Content.Load<Texture2D>("Triple Thunder/Menus/Channel/Title Battle");

            LocalPlayerSelectionButton = new BoxButton(new Rectangle(400, 8, 120, 45), fntArial12, "Local Players\r\nManagement", OnButtonOver, SelectLocalPlayers);

            QuickStartButton = new BoxButton(new Rectangle(47, 70, 100, 45), fntArial12, "Quick Start", OnButtonOver, null);
            CreateARoomButton = new BoxButton(new  Rectangle(150, 70, 100, 45), fntArial12, "Create\n\ra Room", OnButtonOver, CreateARoom);
            WaitingRoomOnlyButton = new InteractiveButton(Content, "Triple Thunder/Menus/Channel/Waiting Room Only", new Vector2(447, 85), OnButtonOver, null);

            InfoButton = new BoxButton(new Rectangle(572, 40, 100, 35), fntArial12, "Info", OnButtonOver, null);
            RankingButton = new BoxButton(new Rectangle(682, 40, 100, 35), fntArial12, "Ranking", OnButtonOver, null);
            OptionsButton = new BoxButton(new Rectangle(572, 74, 100, 35), fntArial12, "Options", OnButtonOver, null);
            HelpButton = new BoxButton(new Rectangle(682, 74, 100, 35), fntArial12, "Help", OnButtonOver, null);

            ShowAllPlayersFilter = new BoxButton(new Rectangle(572, 130, 60, 25), fntArial12, "All", OnButtonOver, ShowAllPlayers);
            ShowFriendsFilter = new BoxButton(new Rectangle(572 + 62, 130, 60, 25), fntArial12, "Friends", OnButtonOver, ShowFriends);
            ShowGuildsFilter = new BoxButton(new Rectangle(572 + 62 + 62, 130, 60, 25), fntArial12, "Guild", OnButtonOver, ShowGuild);
            
            InventoryButton = new BoxButton(new Rectangle(572, 514, 100, 45), fntArial12, "Inventory", OnButtonOver, OpenInventory);
            ShopButton = new BoxButton(new Rectangle(682, 514, 100, 45), fntArial12, "Shop", OnButtonOver, OpenShop);

            ShowAllPlayersFilter.CanBeChecked = true;
            ShowFriendsFilter.CanBeChecked = true;
            ShowGuildsFilter.CanBeChecked = true;
            ShowAllPlayersFilter.Select();

            ArrayMenuButton = new IUIElement[]
            {
                LocalPlayerSelectionButton, CreateARoomButton, QuickStartButton,
                InfoButton, RankingButton, OptionsButton, HelpButton,
                ShowAllPlayersFilter, ShowFriendsFilter, ShowGuildsFilter,
                ShopButton, InventoryButton,
            };

            if (OnlineGameClient != null)
            {
                InitOnlineGameClient();
                InitOnlineCommunicationClient();
            }
            else
            {
                BattleMapPlayer NewPlayer = new BattleMapPlayer(PlayerManager.OnlinePlayerID, "Player " + (PlayerManager.ListLocalPlayer.Count + 1), BattleMapPlayer.PlayerTypes.Online, false, 0, true, Color.Blue);

                PlayerManager.ListLocalPlayer.Add(NewPlayer);
                PlayerManager.ListLocalPlayer[0].LoadLocally(GameScreen.ContentFallback);
            }
        }
Exemplo n.º 10
0
        private void UpdatePlayers()
        {
            if (PlayerListType == PlayerListTypes.All)
            {
                for (int P = 0; P < ArrayLobbyPlayer.Length; P++)
                {
                    BattleMapPlayer ActivePlayer = ArrayLobbyPlayer[P];
                    float X = 635;
                    float Y = 166 + P * (fntArial12.LineSpacing + 4);

                    if (MouseHelper.MouseStateCurrent.X >= X && MouseHelper.MouseStateCurrent.X <= X + 100
                        && MouseHelper.MouseStateCurrent.Y >= Y && MouseHelper.MouseStateCurrent.Y <= Y + fntArial12.LineSpacing)
                    {
                        if (MouseHelper.InputLeftButtonPressed())
                        {

                        }
                        else if (MouseHelper.InputRightButtonPressed())
                        {
                            string GroupID;
                            if (string.Compare(PlayerManager.OnlinePlayerID, ActivePlayer.ConnectionID, StringComparison.InvariantCulture) < 0)
                            {
                                GroupID = PlayerManager.OnlinePlayerID + ActivePlayer.ConnectionID;
                            }
                            else
                            {
                                GroupID = ActivePlayer.ConnectionID + PlayerManager.OnlinePlayerID;
                            }
                            OnlineCommunicationClient.Host.Send(new CreateOrJoinCommunicationGroupScriptClient(GroupID, true));
                            OnlineCommunicationClient.Host.Send(new SendGroupInviteScriptClient(GroupID, PlayerManager.OnlinePlayerName, ActivePlayer.ConnectionID));
                            OnlineCommunicationClient.Chat.OpenTab(GroupID, ActivePlayer.Name);
                        }
                    }
                }
            }
            else if (PlayerListType == PlayerListTypes.Friends)
            {
                for (int P = 0; P < ArrayLobbyFriends.Length; P++)
                {
                    BattleMapPlayer ActivePlayer = ArrayLobbyFriends[P];
                    float X = 635;
                    float Y = 166 + P * (fntArial12.LineSpacing + 4);

                    if (MouseHelper.MouseStateCurrent.X >= X && MouseHelper.MouseStateCurrent.X <= X + 100
                        && MouseHelper.MouseStateCurrent.Y >= Y && MouseHelper.MouseStateCurrent.Y <= Y + fntArial12.LineSpacing)
                    {
                        if (MouseHelper.InputLeftButtonPressed())
                        {
                        }
                        else if (MouseHelper.InputRightButtonPressed())
                        {
                            string GroupID;
                            if (string.Compare(PlayerManager.OnlinePlayerID, ActivePlayer.ConnectionID, StringComparison.InvariantCulture) < 0)
                            {
                                GroupID = PlayerManager.OnlinePlayerID + ActivePlayer.ConnectionID;
                            }
                            else
                            {
                                GroupID = ActivePlayer.ConnectionID + PlayerManager.OnlinePlayerID;
                            }
                            OnlineCommunicationClient.Host.Send(new CreateOrJoinCommunicationGroupScriptClient(GroupID, true));
                            OnlineCommunicationClient.Host.Send(new SendGroupInviteScriptClient(GroupID, PlayerManager.OnlinePlayerName, ActivePlayer.ConnectionID));
                            OnlineCommunicationClient.Chat.OpenTab(GroupID, ActivePlayer.Name);
                        }
                    }
                }
            }
        }
Exemplo n.º 11
0
 public abstract void AddLocalPlayer(BattleMapPlayer NewPlayer);
Exemplo n.º 12
0
 public LocalPlayerProfileSelectionScreen(BattleMapPlayer ActivePlayer)
 {
     this.ActivePlayer = ActivePlayer;
 }
Exemplo n.º 13
0
 public void UpdateCharacter(BattleMapPlayer PlayerToUpdate)
 {
     if (Room.GetLocalPlayer() == PlayerToUpdate)
     {
     }
 }
Exemplo n.º 14
0
        public void AddPlayer(BattleMapPlayer NewPlayer)
        {
            Room.ListRoomPlayer.Add(NewPlayer);

            UpdateReadyOrHost();
        }
Exemplo n.º 15
0
 public void AddLocalPlayer(BattleMapPlayer NewPlayer)
 {
     ListRoomPlayer.Add(NewPlayer);
     ListLocalPlayerID.Add(NewPlayer.ConnectionID);
     CurrentPlayerCount = (byte)ListRoomPlayer.Count;
 }