Example #1
0
 public FightTeam(sbyte id, List<short> placementcells, TeamColorEnum teamcolor, TeamTypeEnum teamtype)
 {
     this.PlacementCells = placementcells;
     this.TeamColor = teamcolor;
     this.TeamType = teamtype;
     this.Id = id;
 }
Example #2
0
        public override void OnFightEnded(TeamColorEnum winner)
        {
            FightTeam winners = null;
            FightTeam loosers = null;
            if (winner == RedTeam.TeamColor)
            {
                winners = RedTeam;
                loosers = BlueTeam;
            }
            else if (winner == BlueTeam.TeamColor)
            {
                winners = BlueTeam;
                loosers = RedTeam;
            }

            GetAllCharacterFighters(true).ForEach(x => x.Client.Character.Record.ArenaFightCount++);

            winners.GetCharacterFighters(true).ForEach(x => x.Client.Character.Record.ArenaVictoryCount++);

            winners.GetCharacterFighters(true).ForEach(x => x.Client.Character.Record.ActualRank += (ushort)(x.Client.Character.Record.Level)); // Check for an algo

            foreach (var _winner in winners.GetCharacterFighters(true))
            {
               if (_winner.Client.Character.Record.ActualRank > _winner.Client.Character.Record.MaxRank)
               {
                   _winner.Client.Character.Record.MaxRank = _winner.Client.Character.Record.ActualRank;
                   _winner.Client.Character.Record.BestDailyRank = _winner.Client.Character.Record.ActualRank;
               }
            }

            loosers.GetCharacterFighters(true).ForEach(x => x.Client.Character.Record.ActualRank -= (ushort)(x.Client.Character.Record.Level));

            GetAllCharacterFighters(true).ForEach(x => x.Client.Character.RefreshArenasInfos());
            base.OnFightEnded(winner);
        }
 public FightTeam(sbyte id, List <short> placementcells, TeamColorEnum teamcolor, TeamTypeEnum teamtype)
 {
     this.PlacementCells = placementcells;
     this.TeamColor      = teamcolor;
     this.TeamType       = teamtype;
     this.Id             = id;
 }
 public TemporaryArenaClient(WorldClient client, TeamColorEnum teamColor, bool master)
 {
     this.WorldClient = client;
     this.TeamColor   = teamColor;
     this.Ready       = false;
     this.Master      = master;
 }
   public FightResult(Fighter fighter,TeamColorEnum winner)
   {
       this.Fighter = fighter;
       if (fighter.Team.TeamColor == winner)
           OutCome = FightOutcomeEnum.RESULT_VICTORY;
       else
           OutCome = FightOutcomeEnum.RESULT_LOST;
 
   }
Example #6
0
 public void EndFight()
 {
     TeamColorEnum winner = GetWinner();
     var results = GetFightResults(winner);
     OnFightEnded(winner);
     foreach (var fighter in GetAllCharacterFighters(true).FindAll(x => !x.HasLeft))
     {
         if (Started)
             ShowFightResults(results, fighter.Client);
     }
     Dispose(); 
 }
Example #7
0
        public void AddPlacement(TeamColorEnum teamColor, short cellId)
        {
            if (teamColor == TeamColorEnum.Blue)
            {
                this.Record.BlueCells.Add(cellId);
            }
            else if (teamColor == TeamColorEnum.Red)
            {
                this.Record.RedCells.Add(cellId);
            }

            this.Record.UpdateElement();
        }
Example #8
0
        public short GetPlacementCell(TeamColorEnum team)
        {
            List<short> usedplacement;

            switch (team)
            {
                case TeamColorEnum.BLUE_TEAM:
                    usedplacement = BlueTeam.GetFighters().ConvertAll<short>(x => x.CellId);
                    return Map.BlueCells.Find(x => !usedplacement.Contains(x));
                case TeamColorEnum.RED_TEAM:
                    usedplacement = RedTeam.GetFighters().ConvertAll<short>(x => x.CellId);
                    return Map.RedCells.Find(x => !usedplacement.Contains(x));
            }
            return 0;
        }
Example #9
0
        public bool IsPlacementCellFree(TeamColorEnum team)
        {
            List<short> usedplacement;

            switch (team)
            {
                case TeamColorEnum.BLUE_TEAM:
                    {
                        usedplacement = BlueTeam.GetFighters().ConvertAll<short>(x => x.CellId);
                        return Map.BlueCells.FindAll(x => !usedplacement.Contains(x)).Count != 0;
                    }
                case TeamColorEnum.RED_TEAM:
                    usedplacement = RedTeam.GetFighters().ConvertAll<short>(x => x.CellId);
                    return Map.RedCells.FindAll(x => !usedplacement.Contains(x)).Count != 0;
            }
            return false;
        }
Example #10
0
 public List<FightResultListEntry> GetFightResults(TeamColorEnum winner)
 {
     List<FightResultListEntry> results = new List<FightResultListEntry>();
     var fighters = GetAllFighters(true);
     foreach (Fighter fighter in fighters)
     {
         if (fighter is CharacterFighter)
         {
             results.Add(new FightResultPlayer(fighter as CharacterFighter, winner).GetEntry());
         }
         if (fighter is MonsterFighter)
         {
             if (!fighter.FighterStats.Summoned)
                 results.Add(new FightResultMonster(fighter as MonsterFighter, winner).GetEntry());
         }
     }
     return results;
 }
Example #11
0
        public FightResultPlayer(CharacterFighter fighter, TeamColorEnum winner)
            : base(fighter, winner)
        {
            this.PlayerLevel = fighter.Client.Character.Record.Level;

            if (fighter.Fight is FightPvM && winner == fighter.Team.TeamColor)
            {
                GeneratePVMLoot();
            }
            if (fighter.Fight is FightArena && winner == fighter.Team.TeamColor)
            {
                GenerateArenaLoot();
            }

            // if (fighter.Fight is FightAgression && winner == fighter.Team.TeamColor)
            {
                // add honor
            }
        }
        public FightResultPlayer(CharacterFighter fighter, TeamColorEnum winner)
            : base(fighter, winner)
        {
            this.PlayerLevel = fighter.Client.Character.Record.Level;

            if (fighter.Fight is FightPvM && winner == fighter.Team.TeamColor)
            {
                GeneratePVMLoot();
            }
            if (fighter.Fight is FightArena && winner == fighter.Team.TeamColor)
            {
                GenerateArenaLoot();
            }

            // if (fighter.Fight is FightAgression && winner == fighter.Team.TeamColor)
            {
                // add honor
            }
        }
        public override void OnFightEnded(TeamColorEnum winner)
        {
            FightTeam winners = null;
            FightTeam loosers = null;

            if (winner == RedTeam.TeamColor)
            {
                winners = RedTeam;
                loosers = BlueTeam;
            }
            else if (winner == BlueTeam.TeamColor)
            {
                winners = BlueTeam;
                loosers = RedTeam;
            }

            GetAllCharacterFighters(true).ForEach(x => x.Client.Character.Record.ArenaFightCount++);

            winners.GetCharacterFighters(true).ForEach(x => x.Client.Character.Record.ArenaVictoryCount++);

            winners.GetCharacterFighters(true).ForEach(x => x.Client.Character.Record.ActualRank += (ushort)(x.Client.Character.Record.Level)); // Check for an algo

            foreach (var _winner in winners.GetCharacterFighters(true))
            {
                if (_winner.Client.Character.Record.ActualRank > _winner.Client.Character.Record.MaxRank)
                {
                    _winner.Client.Character.Record.MaxRank       = _winner.Client.Character.Record.ActualRank;
                    _winner.Client.Character.Record.BestDailyRank = _winner.Client.Character.Record.ActualRank;
                }
            }

            loosers.GetCharacterFighters(true).ForEach(x => x.Client.Character.Record.ActualRank -= (ushort)(x.Client.Character.Record.Level));


            GetAllCharacterFighters(true).ForEach(x => x.Client.Character.RefreshArenasInfos());
            base.OnFightEnded(winner);
        }
Example #14
0
        public virtual void OnFightEnded(TeamColorEnum winner)
        {

        }
Example #15
0
 public Team(TeamColorEnum teamColor, string name)
 {
     TeamColor = teamColor;
     Name      = name;
 }
Example #16
0
 public FightResultMonster(MonsterFighter fighter, TeamColorEnum winner)
     : base(fighter, winner)
 {
 }