示例#1
0
        /// <summary>
        /// Init fight with mobs
        /// </summary>
        public Fight(Fighter fighter1, Engines.Map.MonsterGroup monsters, Engines.MapEngine map,
                                                        Enums.FightTypeEnum fightType = Enums.FightTypeEnum.PvM)
        {
            //Stop the bonus timer
            monsters.StopBonusTimer();

            this.FightType = fightType;
            this.Map = map;
            this.ID = this.Map.GetActorAvailableID;
            this.RedTeam = new FightTeam(0, fighter1, this, false);
            this.BlueTeam = new FightTeam(1, new Fighter(-9, monsters.Leader, monsters), this, true);
            this.InitPlaces();
            this.InitMontersGroup(monsters);
            this.InitTimeline();
            this.PlacePlayer(fighter1);
            this.StartTime = Environment.TickCount;
            this.InitCheckFight();
            if (FightType == Enums.FightTypeEnum.PvM)
            {
                this.StartTimer = new System.Timers.Timer(30000);
                this.StartTimer.Enabled = true;
                this.StartTimer.Elapsed += new System.Timers.ElapsedEventHandler(StartTimer_Elapsed);
                this.StartTimer.Start();
            }
        }
示例#2
0
        /// <summary>
        /// Init challenge player vs player
        /// </summary>
        public Fight(Fighter fighter1, Fighter fighter2, Engines.MapEngine map, Enums.FightTypeEnum fightType)
        {
            this.FightType = fightType;
            this.Map = map;
            this.ID = this.Map.GetActorAvailableID;
            this.InitTeam(fighter1, fighter2);
            this.InitPlaces();
            this.InitTimeline();
            this.PlacePlayer(fighter1);
            this.PlacePlayer(fighter2);
            this.StartTime = Environment.TickCount;
            this.InitCheckFight();

            if (FightType == Enums.FightTypeEnum.Agression)
            {
                this.StartTimer = new System.Timers.Timer(30000);
                this.StartTimer.Enabled = true;
                this.StartTimer.Elapsed += new System.Timers.ElapsedEventHandler(StartTimer_Elapsed);
                this.StartTimer.Start();
            }
        }