Example #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;
            }
        }
Example #2
0
        public override void OverridableLeaveFight(Fighter Fighter)
        {
            switch (this.FightState)
            {
            // TODO deco du joueur
            case Fights.FightState.STATE_PLACE:
                if (Fighter == Fighter.Team.Leader)
                {
                    foreach (var TeamFighter in Fighter.Team.GetFighters())
                    {
                        TeamFighter.Life = 0;
                    }

                    Fighter.Left = true;

                    this.OverridableEndFight(this.GetEnnemyTeam(Fighter.Team), Fighter.Team);
                }
                break;

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

                    Fighter.Send(new GameLeaveMessage());
                }
                break;
            }
        }
Example #3
0
        public override void OverridableLeaveFight(Fighter Fighter)
        {
            // Un persos quitte le combat
            switch (this.FightState)
            {
            case Fights.FightState.STATE_PLACE:
                if (Fighter == Fighter.Team.Leader)
                {
                    foreach (var TeamFighter in Fighter.Team.GetFighters())
                    {
                        TeamFighter.Life = 0;
                    }

                    Fighter.Left = true;

                    this.OverridableEndFight(this.GetEnnemyTeam(Fighter.Team), Fighter.Team);
                }
                else
                {
                    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());
                }
                break;

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

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