コード例 #1
0
ファイル: Fight.cs プロジェクト: nightwolf93/Crystal
        /// <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();
            }
        }