예제 #1
0
        private void OnKillMonster(object sender, GameEventArgs e)
        {
            KillMonsterEventArgs ne = e as KillMonsterEventArgs;

            if (ne == null)
            {
                return;
            }

            if (!this.m_Monsters.Contains(ne.MonsterEntityId))
            {
                return;
            }
            m_Monsters.Remove(ne.MonsterEntityId);
            //if(m_Monsters.Count<MaxCount)
            //{
            //    if (RebornCD > 0)
            //        Invoke("CreateMonster", RebornCD);
            //}

            if (m_Monsters.Count == 0)
            {
                HolderBarrier pHolder = GameEntry.Level.GetHolder(MapHolderType.Barrier) as HolderBarrier;
                this.Barrier = pHolder.FindElement(data.UnlockBarrierId);
                Barrier?.Hide();

                if (TriggerResult)
                {
                    GameEntry.Timer.Register(5, () =>
                    {
                        GameEntry.Event.Fire(this, new PassLevelEventArgs());
                    });
                }
            }
        }
예제 #2
0
        private void OnKillMonster(object sender, GameEventArgs e)
        {
            KillMonsterEventArgs ne = e as KillMonsterEventArgs;

            if (ne == null)
            {
                return;
            }

            if (!this.mMonsterGUIDSet.Contains(ne.MonsterEntityId))
            {
                return;
            }
            this.mMonsterGUIDSet.Remove(ne.MonsterEntityId);
            this.CurrKillNum++;
            this.CurrMonsterNum = mMonsterGUIDSet.Count;
            if (CurrMonsterNum > 0)
            {
                return;
            }
            if (CurrIndex >= mWaveSet.Waves.Count)
            {
                Exit();
            }
            else
            {
                CreateWaveMonsters(mWaveSet.Waves[CurrIndex]);
            }
        }
예제 #3
0
        public override void OnDead(DeadCommand ev)
        {
            base.OnDead(ev);

            KillMonsterEventArgs args = ReferencePool.Acquire <KillMonsterEventArgs>().Fill(Id, EntityId);

            GameEntry.Event.Fire(this, args);
        }
예제 #4
0
        private void OnKillMonster(object sender, GameEventArgs e)
        {
            KillMonsterEventArgs ne            = e as KillMonsterEventArgs;
            DRActorEntity        drActorEntity = GameEntry.DataTable.GetDataTable <DRActorEntity>().GetDataRow(ne.MonsterId);

            if (drActorEntity.KillExp <= 0)
            {
                return;
            }

            int maxLevle = GameEntry.DataTable.GetDataTable <DRHeroLevel>().Count;

            if (drActorEntity.KillExp > 0)
            {
                TryAddExp(drActorEntity.KillExp);
            }
        }