public RespawnPoint(MyVector pos, MyVector rotation, GameTeam team)
 {
     position = pos;
     timeSinceUse = RespawnCooldown;
     orientation = MyQuaternion.FromEulerAngles(rotation.X, rotation.Y, rotation.Z);
     this.team = team;
 }
 public override void ChangePlayerTeam(Player player, GameTeam newTeam)
 {
     World.Instance.ChangeTeam(player, newTeam);
     if (player == this.player)
     {
         if (newTeam == GameTeam.Assassins)
             clientNetworkLayer.ChangeTeam(clientNetworkLayer.CurrentGameInfo.TeamScoreList[0].TeamId);
         else
             clientNetworkLayer.ChangeTeam(clientNetworkLayer.CurrentGameInfo.TeamScoreList[1].TeamId);
     }
 }
Beispiel #3
0
 public void ChangeTeam(Player player, GameTeam newTeam)
 {
     if (player.CharacterClass != null)
     {
         if (newTeam != player.CharacterClass.GameTeam)
         {
             RemovePlayer(player);
             if (newTeam == GameTeam.Assassins)
             {
                 player.CharacterClass = ObjectCache.Instance.GetAssassinClass();
             }
             else if (newTeam == GameTeam.Knights)
             {
                 player.CharacterClass = ObjectCache.Instance.GetKnightClass();
             }
             AddPlayer(player);
         }
     }
     else
     {
         if (newTeam == GameTeam.Assassins)
         {
             player.CharacterClass = ObjectCache.Instance.GetAssassinClass();
         }
         else if (newTeam == GameTeam.Knights)
         {
             player.CharacterClass = ObjectCache.Instance.GetKnightClass();
         }
         AddPlayer(player);
     }
 }
 public virtual void EndRound(GameTeam defeatedTeam)
 {
     if (defeatedTeam == GameTeam.Assassins)
         knightsScore++;
     else if (defeatedTeam == GameTeam.Knights)
         assassinsScore++;
 }
 public abstract void ChangePlayerTeam(Player player, GameTeam team);
        public UDPClientServerCommons.Constants.WeaponEnumeration GetWeaponIDByClass(WeaponClass wc, GameTeam team)
        {
            if (team == GameTeam.Assassins)
            {
                if (wc is PipeClass)
                    return  UDPClientServerCommons.Constants.WeaponEnumeration.Sword;
                if (wc is FireballClass)
                    return UDPClientServerCommons.Constants.WeaponEnumeration.CrossBow;

            }
            else if (team == GameTeam.Knights)
            {
                if (wc is CrossbowClass)
                    return UDPClientServerCommons.Constants.WeaponEnumeration.Sword;
                if (wc is GrenadeClass)
                    return UDPClientServerCommons.Constants.WeaponEnumeration.CrossBow;

            }
            return  UDPClientServerCommons.Constants.WeaponEnumeration.None;
        }
        public WeaponClass GetWeaponClassByID(UDPClientServerCommons.Constants.WeaponEnumeration weapon, GameTeam team)
        {
            if (team == GameTeam.Assassins)
            {
                if (weapon == UDPClientServerCommons.Constants.WeaponEnumeration.CrossBow)
                    return ObjectCache.Instance.GetWeapon("Pipe");
                if (weapon == UDPClientServerCommons.Constants.WeaponEnumeration.Sword)
                    return ObjectCache.Instance.GetWeapon("Fireball");

            }
            else if (team == GameTeam.Knights)
            {
                if (weapon == UDPClientServerCommons.Constants.WeaponEnumeration.CrossBow)
                    return ObjectCache.Instance.GetWeapon("Crossbow");
                if (weapon == UDPClientServerCommons.Constants.WeaponEnumeration.Sword)
                    return ObjectCache.Instance.GetWeapon("Grenade");

            }
            return null;
        }
 public override void EndRound(GameTeam defeatedTeam)
 {
     base.EndRound(defeatedTeam);
     World.Instance.Paused = true;
     gameStatus = GameStatus.WaitingForStart;
     if (defeatedTeam == player.CharacterClass.GameTeam)
     {
         SoundSystem.SoundEngine.PlaySound(SoundSystem.Enums.SoundTypes.fanfare1, (Vector3)player.CurrentCharacter.Position);
     }
     else
     {
         SoundSystem.SoundEngine.PlaySound(SoundSystem.Enums.SoundTypes.defeat, (Vector3)player.CurrentCharacter.Position);
     }
 }
        public override void ChangePlayerTeam(Player player, GameTeam newTeam)
        {
            World.Instance.ChangeTeam(player, newTeam);
            if (player == this.player)
            {
                if (newTeam == GameTeam.Assassins)
                    serverNetworkLayer.Client.ChangeTeam(serverNetworkLayer.Client.CurrentGameInfo.TeamScoreList[0].TeamId);
                else
                    serverNetworkLayer.Client.ChangeTeam(serverNetworkLayer.Client.CurrentGameInfo.TeamScoreList[1].TeamId);

                //if (newTeam == GameTeam.Assassins)
                //    serverNetworkLayer.Client.ChangeTeam(13);
                //else
                //    serverNetworkLayer.Client.ChangeTeam(39);
            }
        }
        public override void EndRound(GameTeam defeatedTeam)
        {
            base.EndRound(defeatedTeam);
            World.Instance.Paused = true;
            if (defeatedTeam == GameTeam.Assassins)
            {
                List<TeamData> teams = new List<TeamData>();
                TeamData data;
                data = serverNetworkLayer.Client.CurrentGameInfo.TeamScoreList[1];
                data.TeamScore++;
                teams.Add(data);
                serverNetworkLayer.UpdatePlayerHealthAndTeamScore(new List<PlayerHealthData>(), teams);

            }
            else if(defeatedTeam== GameTeam.Knights)
            {
                List<TeamData> teams = new List<TeamData>();
                TeamData data;
                data = serverNetworkLayer.Client.CurrentGameInfo.TeamScoreList[0];
                data.TeamScore++;
                teams.Add(data);
                serverNetworkLayer.UpdatePlayerHealthAndTeamScore(new List<PlayerHealthData>(), teams);
            }

            gameStatus = GameStatus.WaitingForStart;
            if (defeatedTeam == player.CharacterClass.GameTeam)
            {
                SoundSystem.SoundEngine.PlaySound(SoundSystem.Enums.SoundTypes.fanfare1, (Vector3)player.CurrentCharacter.Position);
            }
            else
            {
                SoundSystem.SoundEngine.PlaySound(SoundSystem.Enums.SoundTypes.defeat, (Vector3)player.CurrentCharacter.Position);
            }

            //siec?
        }