Esempio n. 1
0
 public override void OnActorDeath(ref DefaultGameEventParam prm)
 {
     this.CachedSource   = prm.src;
     this.CachedAttacker = prm.orignalAtker;
     if (((prm.src != 0) && this.bCanStat) && this.ShouldCare(prm.src.handle))
     {
         bool   flag        = true;
         Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref prm.src);
         DebugHelper.Assert(ownerPlayer != null, "咦,怎么会取不到ActorRoot对应的Player呢?");
         ReadonlyContext <PoolObjHandle <ActorRoot> > .Enumerator enumerator = ownerPlayer.GetAllHeroes().GetEnumerator();
         while (enumerator.MoveNext())
         {
             PoolObjHandle <ActorRoot> current = enumerator.Current;
             if (!current.handle.ActorControl.IsDeadState)
             {
                 flag = false;
                 break;
             }
         }
         if (flag)
         {
             this.EncounterCount++;
             this.bCanStat = false;
             bool flag2 = this.CheckResult();
             if (flag2 != this.bCheckResult)
             {
                 this.bCheckResult = flag2;
                 this.TriggerAllDeathEvent();
             }
         }
     }
 }
 private void onActorExitBattle(ref DefaultGameEventParam _prm)
 {
     if (_prm.src == base.sourceActor)
     {
         this.bTrigger = true;
     }
 }
Esempio n. 3
0
 private void OnActorRevive(ref DefaultGameEventParam prm)
 {
     if ((prm.src != 0) && this.ShouldCare(prm.src.handle))
     {
         this.bCanStat = true;
     }
 }
Esempio n. 4
0
        protected void onActorDead(ref DefaultGameEventParam prm)
        {
            int count = this.m_spawnedList.Count;
            int index = 0;

            while (index < this.m_spawnedList.Count)
            {
                if (this.m_spawnedList[index] == 0)
                {
                    this.m_spawnedList.RemoveAt(index);
                }
                else
                {
                    PoolObjHandle <ActorRoot> handle = this.m_spawnedList[index];
                    if (handle.Equals(prm.src))
                    {
                        this.m_spawnedList.RemoveAt(index);
                        break;
                    }
                    index++;
                }
            }
            int num3 = this.m_spawnedList.Count;

            if ((num3 == 0) && (num3 < count))
            {
                this.onMyselfAllDead();
                Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_MonsterGroupDead, ref prm);
            }
        }
Esempio n. 5
0
 private void onActorDead(ref DefaultGameEventParam prm)
 {
     if (((this.SubjectType == RES_BATTLE_TASK_SUBJECT.ORGAN) || (this.SubjectType == RES_BATTLE_TASK_SUBJECT.MONSTER)) && (this.SubjectID == prm.src.handle.TheActorMeta.ConfigId))
     {
         base.Current++;
     }
 }
Esempio n. 6
0
        protected virtual void onActorDead(ref DefaultGameEventParam prm)
        {
            int count = this.m_spawnedList.Count;
            int index = 0;

            while (index < this.m_spawnedList.Count)
            {
                if (this.m_spawnedList[index] == null)
                {
                    this.m_spawnedList.RemoveAt(index);
                }
                else
                {
                    if (this.m_spawnedList[index].Equals(prm.src.handle))
                    {
                        this.m_spawnedList.RemoveAt(index);
                        break;
                    }
                    index++;
                }
            }
            int num3 = this.m_spawnedList.Count;

            if ((num3 == 0) && (num3 < count))
            {
                this.onMyselfAllDead();
            }
        }
Esempio n. 7
0
        private void OnGameEnd(ref DefaultGameEventParam prm)
        {
            Singleton <GameEventSys> .get_instance().RmvEventHandler <GameDeadEventParam>(GameEventDef.Event_ActorDead, new RefAction <GameDeadEventParam>(this.OnActorDead));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_GameEnd, new RefAction <DefaultGameEventParam>(this.OnGameEnd));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <HurtEventResultInfo>(GameEventDef.Event_ActorDamage, new RefAction <HurtEventResultInfo>(this.OnActorDamage));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_DoubleKill, new RefAction <DefaultGameEventParam>(this.OnActorDoubleKill));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_TripleKill, new RefAction <DefaultGameEventParam>(this.OnActorTripleKill));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_QuataryKill, new RefAction <DefaultGameEventParam>(this.OnActorQuataryKill));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_PentaKill, new RefAction <DefaultGameEventParam>(this.OnActorPentaKill));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <DefaultGameEventParam>(GameEventDef.Event_Odyssey, new RefAction <DefaultGameEventParam>(this.OnActorOdyssey));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <SkillChooseTargetEventParam>(GameEventDef.Event_ActorBeChosenAsTarget, new RefAction <SkillChooseTargetEventParam>(this.OnActorBeChosen));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, new RefAction <SkillChooseTargetEventParam>(this.OnHitTrigger));

            Singleton <EventRouter> .GetInstance().RemoveEventHandler <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >("HeroGoldCoinInBattleChange", new Action <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >(this.OnActorBattleCoinChanged));

            Singleton <GameEventSys> .get_instance().RmvEventHandler <HemophagiaEventResultInfo>(GameEventDef.Event_Hemophagia, new RefAction <HemophagiaEventResultInfo>(this.OnActorHemophagia));
        }
Esempio n. 8
0
 private void OnHostActorClearMove(ref DefaultGameEventParam prm)
 {
     if (ActorHelper.IsHostCtrlActor(ref prm.src))
     {
         this.PreMoveDirection = -2147483648;
     }
 }
Esempio n. 9
0
        public override void BeAttackHit(PoolObjHandle <ActorRoot> atker)
        {
            if (base.actor.IsSelfCamp(atker.handle))
            {
                return;
            }
            if (base.actorSubType == 2)
            {
                long iPursuitR = this.cfgInfo.iPursuitR;
                if (((base.actor.ValueComponent.actorHp * 0x2710) / base.actor.ValueComponent.actorHpTotal) <= 0x251c)
                {
                    VInt3 num2 = atker.handle.location - this.originalPos;
                    if (num2.sqrMagnitudeLong2D >= (iPursuitR * iPursuitR))
                    {
                        goto Label_00A7;
                    }
                }
                base.SetInBattle();
                base.m_isAttacked = true;
            }
            else
            {
                base.SetInBattle();
                base.m_isAttacked = true;
            }
Label_00A7:
            atker.handle.ActorControl.SetInBattle();
            atker.handle.ActorControl.SetInAttack();
            DefaultGameEventParam prm = new DefaultGameEventParam(base.GetActor(), atker);

            Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorBeAttack, ref prm);
        }
Esempio n. 10
0
 public void OnActorTripleKill(ref DefaultGameEventParam prm)
 {
     if ((prm.atker != 0) && object.ReferenceEquals(prm.atker.handle, this.actorHero.handle))
     {
         base.m_TripleKillNum++;
     }
 }
Esempio n. 11
0
 public void OnActorPentaKill(ref DefaultGameEventParam prm)
 {
     if (prm.logicAtker && prm.logicAtker == this.actorHero)
     {
         this.m_PentaKillNum++;
     }
 }
Esempio n. 12
0
 private void onImmuneDeadHurt(ref DefaultGameEventParam _prm)
 {
     if (_prm.src == base.sourceActor)
     {
         this.bTrigger = true;
     }
 }
Esempio n. 13
0
 public override void OnActorDeath(ref DefaultGameEventParam prm)
 {
     if (this.ContextProxy != null)
     {
         this.ContextProxy.OnActorDeath(ref prm);
     }
 }
Esempio n. 14
0
 public void OnActorTripleKill(ref DefaultGameEventParam prm)
 {
     if ((prm.atker != 0) && (prm.atker == this.actorHero))
     {
         base.m_TripleKillNum++;
     }
 }
Esempio n. 15
0
 public void onActorDead(ref DefaultGameEventParam prm)
 {
     if ((prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp))
     {
         int index = -1;
         while (++index < this.heroHeads.Length)
         {
             PlayerHead head = this.heroHeads[index];
             if ((head.MyHero != 0) && (head.MyHero == prm.src))
             {
                 head.OnMyHeroDead();
                 break;
             }
         }
         if (((index < this.heroHeads.Length) && !Singleton <BattleLogic> .instance.GetCurLvelContext().isPVPMode) && ActorHelper.IsCaptainActor(ref prm.src))
         {
             int num2 = -1;
             while (++num2 < this.heroHeads.Length)
             {
                 if ((num2 != index) && ((this.heroHeads[num2].MyHero != 0) && !this.heroHeads[num2].MyHero.handle.ActorControl.IsDeadState))
                 {
                     this.pickHeroHead(this.heroHeads[num2]);
                     break;
                 }
             }
         }
     }
 }
Esempio n. 16
0
        private int CriticalDamagePart(ref HurtDataInfo hurt)
        {
            bool flag = false;
            int  num  = 0;

            if ((hurt.atkSlot == SkillSlotType.SLOT_SKILL_0) && (hurt.iCanSkillCrit != 0))
            {
                int num2 = (int)((hurt.attackInfo.iCritStrikeValue + (hurt.attackInfo.iActorLvl * this.battleParam.dwM_Critical)) + this.battleParam.dwN_Critical);
                int num3 = 0;
                int num4 = 0;
                if (num2 > 0)
                {
                    num3 = ((hurt.attackInfo.iCritStrikeValue * 0x2710) / num2) + hurt.attackInfo.iCritStrikeRate;
                }
                int num5 = (int)((hurt.attackInfo.iReduceCritStrikeValue + (base.actor.ValueComponent.mActorValue.actorLvl * this.battleParam.dwM_ReduceCritical)) + this.battleParam.dwN_ReduceCritical);
                if (num5 > 0)
                {
                    num4  = (hurt.attackInfo.iReduceCritStrikeValue * 0x2710) / num5;
                    num4 += hurt.attackInfo.iReduceCritStrikeRate;
                }
                if (!base.actor.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_ImmuneCrit))
                {
                    flag = FrameRandom.Random(0x2710) < (num3 - num4);
                }
                num = !flag ? 0 : hurt.attackInfo.iCritStrikeEff;
                if (flag)
                {
                    DefaultGameEventParam prm = new DefaultGameEventParam(hurt.atker, hurt.target);
                    Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorCrit, ref prm);
                }
            }
            return(num);
        }
Esempio n. 17
0
        private void OnEnterCombat(ref DefaultGameEventParam prm)
        {
            if (prm.src && prm.src.get_handle().ActorControl != null && prm.src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster && prm.src.get_handle().ActorControl.GetActorSubType() == 2)
            {
                if (prm.src.get_handle().ActorControl.GetActorSubSoliderType() == 7)
                {
                    this.m_baojunEnterCombatTime = (int)Singleton <FrameSynchr> .get_instance().LogicFrameTick;
                }
                else if (prm.src.get_handle().ActorControl.GetActorSubSoliderType() == 8)
                {
                    this.m_baronEnterCombatTime = (int)Singleton <FrameSynchr> .get_instance().LogicFrameTick;
                }
                else if (prm.src.get_handle().ActorControl.GetActorSubSoliderType() == 9)
                {
                    this.m_bigDragonEnterCombatTime = (int)Singleton <FrameSynchr> .get_instance().LogicFrameTick;
                }
            }
            else if (prm.src && prm.src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
            {
                List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .get_instance().HeroActors;

                int count = heroActors.get_Count();
                for (int i = 0; i < count; i++)
                {
                    if (heroActors.get_Item(i).get_handle().ObjID == prm.src.get_handle().ObjID&& i < 10)
                    {
                        this.m_arrHeroEnterCombatTime[i] = (int)Singleton <FrameSynchr> .get_instance().LogicFrameTick;

                        break;
                    }
                }
            }
        }
Esempio n. 18
0
 public void Expose(ref DefaultGameEventParam param)
 {
     if (param.atker == this.sourceActor)
     {
         this.bTrigger = true;
     }
 }
 private void OnActorMoveCity(ref DefaultGameEventParam prm)
 {
     if (prm.src && prm.src.handle.SkillControl != null && prm.src.handle.SkillControl.stSkillStat != null)
     {
         prm.src.handle.SkillControl.stSkillStat.m_uiMoveCitySucessTimes += 1u;
     }
 }
Esempio n. 20
0
        public void CaptainCallActorSwitch()
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(this.actorPtr.handle.TheActorMeta.PlayerId);

            if (player != null)
            {
                bool flag     = ActorHelper.IsHostCtrlActor(ref this.hostActor);
                bool isAutoAI = this.hostActor.handle.ActorControl.m_isAutoAI;
                player.Captain.handle.ActorControl.ClearMoveCommand();
                player.Captain.handle.ActorControl.SetSelected(false);
                player.Captain.handle.ActorControl.m_isControledByMan = true;
                player.Captain.handle.ActorControl.SetAutoAI(false);
                if (flag)
                {
                    player.Captain.handle.HudControl.SetSelected(false);
                    this.SpawnHostActorFixedHud();
                }
                player.SetCallCaptain((uint)this.actorPtr.handle.TheActorMeta.ConfigId, this.actorPtr.handle.ObjID);
                player.Captain.handle.ActorControl.SetSelected(true);
                player.Captain.handle.ActorControl.SetAutoAI(isAutoAI);
                if (flag)
                {
                    player.Captain.handle.HudControl.SetSelected(true);
                    DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.actorPtr, this.actorPtr);
                    Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_CaptainSwitch, ref defaultGameEventParam);
                }
            }
        }
Esempio n. 21
0
 private void onActorCrit(ref DefaultGameEventParam _prm)
 {
     if (_prm.src != this.sourceActor)
     {
         return;
     }
     this.bTrigger = true;
 }
Esempio n. 22
0
 private void OnActorDead(ref DefaultGameEventParam prm)
 {
     if (prm.src == this.hostActor)
     {
         base.actor.Suicide();
         this.RemoveCheckDistanceTimer();
     }
 }
Esempio n. 23
0
 private void SendHurtAbsorbEvent(PoolObjHandle <ActorRoot> atker, int changeValue)
 {
     if (changeValue > 0 && this.protectValue != 0)
     {
         DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.buffHolder.actorPtr, atker);
         Singleton <GameEventSys> .get_instance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorHurtAbsorb, ref defaultGameEventParam);
     }
 }
Esempio n. 24
0
 private void onActorDead(ref DefaultGameEventParam prm)
 {
     if ((prm.orignalAtker == base.sourceActor) && base.CheckTargetSubType(prm.src, base.localParams[0], base.localParams[1]))
     {
         this.bTrigger = true;
         base.rootEvent.SetTriggerActor(prm.src);
     }
 }
Esempio n. 25
0
 private void onFightOver(ref DefaultGameEventParam prm)
 {
     this.EndTime = Singleton <FrameSynchr> .instance.LogicFrameTick;
     if (this.status == StarEvaluationStatus.Success)
     {
         this.TriggerChangedEvent();
     }
 }
Esempio n. 26
0
 private void onActorExitBattle(ref DefaultGameEventParam _prm)
 {
     if (_prm.src != this.sourceActor)
     {
         return;
     }
     this.bTrigger = false;
 }
Esempio n. 27
0
 private void OnGameEnd(ref DefaultGameEventParam prm)
 {
     if (this.DropStrategy != null)
     {
         this.DropStrategy.NotifyMatchEnd();
     }
     this.maxDropCount = 0;
 }
 private void onActorDead(ref DefaultGameEventParam prm)
 {
     if (prm.src == base.sourceActor)
     {
         this.bKilled = true;
         base.rootEvent.SetTriggerActor(prm.orignalAtker);
     }
 }
 private void onActorRevive(ref DefaultGameEventParam _prm)
 {
     if (_prm.src != this.sourceActor || (this.localParams[0] == 1 && this.sourceActor.handle.ActorControl.IsEnableReviveContext()))
     {
         return;
     }
     this.bTrigger = true;
 }
Esempio n. 30
0
 public void OnShouldShowProficiencyEffect(ref DefaultGameEventParam prm)
 {
     if (prm.orignalAtker == this.m_wrapper.actorPtr)
     {
         this.m_showTimes++;
         this.ShowProficiencyEffect();
     }
 }