示例#1
0
        public override void OverridableLeaveFight(Fighter Fighter)
        {
            // Un persos quitte le combat
            switch (this.FightState)
            {
            case Fights.FightState.STATE_PLACE:     // TODO : Uniquement si kické
                this.Map.SendToMap(new GameFightTeamFlagFightersMessage(new List <Fighter> {
                    Fighter
                }, Fighter.Team.LeaderId, false));

                this.SendToFight(new GameActorDestroyMessage(Fighter.ActorId));

                Fighter.LeaveFight();

                Fighter.Send(new GameLeaveMessage());

                if (Team1.GetAliveFighters().Count == 0 || Team2.GetAliveFighters().Count == 0)
                {
                    FightTeam ft = null;
                    if (Team1.GetAliveFighters().Count == 0)
                    {
                        ft = Team1;
                    }
                    else
                    {
                        ft = Team2;
                    }

                    foreach (var TeamFighter in ft.GetFighters())
                    {
                        TeamFighter.Life = 0;
                    }

                    Fighter.Left = true;

                    this.OverridableEndFight(this.GetEnnemyTeam(ft), ft);
                }
                break;

            case FightState.STATE_ACTIVE:
                if (Fighter.TryDie(Fighter.ActorId, true) != -3)
                {
                    Fighter.LeaveFight();

                    Fighter.Send(new GameLeaveMessage());
                }
                ;
                break;
            }
        }