public void OnActorRevive(ref DefaultGameEventParam prm)
        {
            uint hostPlayerId = Singleton <GamePlayerCenter> .get_instance().HostPlayerId;

            if (prm.src && prm.src.get_handle().TheActorMeta.PlayerId == hostPlayerId)
            {
                PlayerKDA playerKDA = Singleton <BattleStatistic> .GetInstance().m_playerKDAStat.GetPlayerKDA(hostPlayerId);

                if (playerKDA == null)
                {
                    return;
                }
                ListView <CHostHeroDamage> .Enumerator enumerator = playerKDA.m_hostHeroDamage.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    if (enumerator.get_Current() != null)
                    {
                        enumerator.get_Current().OnActorRevive(ref prm);
                    }
                }
                if (prm.src == this.m_hostActor)
                {
                    this.OnDeadInfoFormClose(null);
                }
            }
        }
 private void onGamePrepareFight(ref DefaultGameEventParam prm)
 {
     if (MonoSingleton <Reconnection> .instance.isProcessingRelayRecover)
     {
         return;
     }
 }
Example #3
0
 private void OnGameEnd(ref DefaultGameEventParam prm)
 {
     if (this.IsCareCondition() && (this.m_form != null))
     {
         this.m_form.Close();
     }
 }
Example #4
0
 private void OnFightStart(ref DefaultGameEventParam param)
 {
     if (!MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.onBattleStart, new uint[0]) && (Singleton <CBattleSystem> .GetInstance().FightForm != null))
     {
         Singleton <CBattleSystem> .GetInstance().FightForm.ShowVoiceTips();
     }
 }
 public void OnActorRevive(ref DefaultGameEventParam prm)
 {
     if (!GameSettings.ShowEnemyHeroHeadBtnMode)
     {
         return;
     }
     if (prm.src && prm.src.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         if (prm.src.get_handle().TheActorMeta.ActorCamp != this.m_hostActor.get_handle().TheActorMeta.ActorCamp)
         {
             int btnIndexByActor = this.GetBtnIndexByActor(prm.src);
             if (btnIndexByActor >= 0 && btnIndexByActor < this.m_iCurEnemyPlayerCount)
             {
                 CEnemyHeroAtkBtn.BTN_INFO[] expr_90_cp_0 = this.m_arrBtnInfo;
                 int expr_90_cp_1 = btnIndexByActor;
                 expr_90_cp_0[expr_90_cp_1].heroState = (expr_90_cp_0[expr_90_cp_1].heroState & -5);
                 this.UpdateHeroAtkBtnWithDistance(btnIndexByActor);
             }
         }
         else if (prm.src == this.m_hostActor)
         {
             for (int i = 0; i < this.m_iCurEnemyPlayerCount; i++)
             {
                 this.UpdateHeroAtkBtnWithHostState(i, false);
                 this.UpdateHeroAtkBtnWithDistance(i);
             }
         }
     }
 }
        public override void Enter(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);

            if (!actorHandle)
            {
                return;
            }
            this.skillControl = actorHandle.handle.SkillControl;
            if (this.skillControl == null)
            {
                return;
            }
            if (this.skillControl.SkillUseCache != null)
            {
                if (this.cacheSkill)
                {
                    this.skillControl.SkillUseCache.SetCacheSkill(true);
                }
                if (this.cacheMove)
                {
                    this.skillControl.SkillUseCache.SetCacheMove(true);
                    DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(actorHandle, actorHandle);
                    Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorClearMove, ref defaultGameEventParam);
                }
            }
        }
    private void OnFightStart(ref DefaultGameEventParam param)
    {
        if (!MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.onBattleStart, new uint[0]) && Singleton <CBattleSystem> .GetInstance().FightForm != null)
        {
            Singleton <CBattleSystem> .GetInstance().FightForm.ShowVoiceTips();
        }
        SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

        if (curLvelContext != null && !this.IsLowHPGuideComplete() && curLvelContext.IsMobaMode())
        {
            ReadonlyContext <PoolObjHandle <ActorRoot> > allHeroes = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().GetAllHeroes();

            DebugHelper.Assert(allHeroes.get_isValidReference(), "newbie guide manager invalid all heros list.");
            if (allHeroes.get_isValidReference())
            {
                for (int i = 0; i < allHeroes.get_Count(); i++)
                {
                    if (allHeroes.get_Item(i) && allHeroes.get_Item(i).get_handle().ValueComponent != null)
                    {
                        allHeroes.get_Item(i).get_handle().ValueComponent.HpChgEvent -= new ValueChangeDelegate(this.OnHostPlayerHPChange);
                    }
                }
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

            if (hostPlayer != null && hostPlayer.Captain && hostPlayer.Captain.get_handle().ValueComponent != null)
            {
                hostPlayer.Captain.get_handle().ValueComponent.HpChgEvent += new ValueChangeDelegate(this.OnHostPlayerHPChange);
            }
        }
    }
Example #8
0
 public void OnActorRevive(ref DefaultGameEventParam prm)
 {
     if (!this.CheckShouldUpdate())
     {
         return;
     }
     if (prm.src && prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
     {
         if (prm.src.handle.TheActorMeta.ActorCamp != this.m_hostActor.handle.TheActorMeta.ActorCamp)
         {
             int btnIndexByActor = this.GetBtnIndexByActor(prm.src);
             if (btnIndexByActor >= 0 && btnIndexByActor < this.m_iCurEnemyPlayerCount)
             {
                 CEnemyHeroAtkBtn.BTN_INFO[] arrBtnInfo = this.m_arrBtnInfo;
                 int num = btnIndexByActor;
                 arrBtnInfo[num].heroState = (arrBtnInfo[num].heroState & -5);
                 this.UpdateHeroAtkBtnWithDistance(btnIndexByActor);
             }
         }
         else if (prm.src == this.m_hostActor)
         {
             for (int i = 0; i < this.m_iCurEnemyPlayerCount; i++)
             {
                 this.UpdateHeroAtkBtnWithHostState(i, false);
                 this.UpdateHeroAtkBtnWithDistance(i);
             }
         }
     }
 }
 private void OnActorDeath(ref DefaultGameEventParam prm)
 {
     if ((prm.src != 0) && (prm.src == this.actorRoot))
     {
         this.Clear();
     }
 }
Example #10
0
 private void OnActorRevive(ref DefaultGameEventParam eventParam)
 {
     if ((eventParam.src != 0) && (eventParam.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
     {
         bool flag = eventParam.src.handle.IsHostCamp();
         int  num  = 0;
         if (flag)
         {
             if (this.m_HeroToIndexDic.TryGetValue(eventParam.src.handle.ObjID, out num))
             {
                 CUIListElementScript heroListElement = this.GetHeroListElement(num);
                 if (heroListElement != null)
                 {
                     this.RefreshHeroIconImageColor(heroListElement, eventParam.src);
                     heroListElement.GetWidget(5).CustomSetActive(false);
                 }
                 this.SetHeroChangeFlag(eventParam.src, enHeroInfoChangeType.ReviveCntDown, false);
             }
         }
         else
         {
             this.m_enemyHeroList.Remove(eventParam.src);
             this.RefreshEnemyHeroListUI();
         }
     }
 }
Example #11
0
        private void OnBuildingAttacked(ref DefaultGameEventParam evtParam)
        {
            if (evtParam.src != 0)
            {
                ActorRoot handle = evtParam.src.handle;
                if ((handle != null) && HudUT.IsTower(handle))
                {
                    HudComponent3D hudControl = handle.HudControl;
                    if (hudControl != null)
                    {
                        GameObject  target      = hudControl.GetCurrent_MapObj();
                        TowerHitMgr towerHitMgr = Singleton <CBattleSystem> .GetInstance().TowerHitMgr;

                        if ((target != null) && (towerHitMgr != null))
                        {
                            towerHitMgr.TryActive(handle.ObjID, target);
                        }
                        Image image  = hudControl.GetBigTower_Img();
                        Image image2 = hudControl.GetSmallTower_Img();
                        if (((image != null) && (image2 != null)) && (handle.ValueComponent != null))
                        {
                            float single = handle.ValueComponent.GetHpRate().single;
                            image.fillAmount  = single;
                            image2.fillAmount = single;
                        }
                    }
                }
            }
        }
 private void onGameStartFight(ref DefaultGameEventParam prm)
 {
     if (!MonoSingleton <Reconnection> .instance.isProcessingRelayRecover)
     {
         this.HideLoading();
     }
 }
Example #13
0
        private void OnFightPrepare(ref DefaultGameEventParam prm)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            if (curLvelContext == null)
            {
                this.m_bIsRecordMomentsEnable = false;
                return;
            }
            this.m_bIsRecordMomentsEnable = (GameSettings.EnableKingTimeMode && this.GetRecorderGlobalCfgEnableFlag() && !Singleton <WatchController> .GetInstance().IsWatching&& curLvelContext.IsMobaModeWithOutGuide());
            if (this.m_bIsRecordMomentsEnable)
            {
                if (Singleton <LobbyLogic> .get_instance().reconnGameInfo != null)
                {
                    this.m_bIsRecordMomentsEnable = false;
                    Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("RecordMomentSuspendRecord"), false, 1.5f, null, new object[0]);

                    return;
                }
                this.Reset();
                this.m_hostActor = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().Captain;

                Singleton <GameJoy> .get_instance().StartMomentsRecording();
            }
        }
Example #14
0
 public void OnFightOver(ref DefaultGameEventParam prm)
 {
     if (this.m_camera != null)
     {
         Object.Destroy(this.m_camera.gameObject);
         this.m_camera = null;
     }
 }
Example #15
0
 private void OnPlayerRevive(ref DefaultGameEventParam prm)
 {
     if (((prm.src != 0) && ActorHelper.IsHostCtrlActor(ref prm.src)) && !this.bFreeCamera)
     {
         this.enableLockedCamera = true;
         this.enableAbsoluteLocationLockCamera = false;
         Singleton <CBattleSystem> .GetInstance().EndCameraDrag();
     }
 }
Example #16
0
        private void onFightStart(ref DefaultGameEventParam prm)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            this.bIsLuandouPlayMode = curLvelContext.IsLuanDouPlayMode();
            this.bIsClassic5V5Mode  = curLvelContext.IsNorma5v5PlayMode();
            if (this.bIsLuandouPlayMode)
            {
            }
        }
Example #17
0
 private void OnExitCombat(ref DefaultGameEventParam prm)
 {
     if (prm.src == this.BaronActor && this.bIsBaronActived)
     {
         this.BaronActor      = default(PoolObjHandle <ActorRoot>);
         this.bIsBaronActived = false;
         this.PlayBattleEvent("Set_Music_DaLong_S2_Cease");
         this.UnRegistBaronEvents();
     }
 }
Example #18
0
 private void onActorDead(ref DefaultGameEventParam param)
 {
     if ((param.src != 0) && ActorHelper.IsHostCtrlActor(ref param.src))
     {
         this.hostDeadNum++;
         if ((this.hostDeadNum == 1) && (Singleton <BattleLogic> .GetInstance().GetCurLvelContext().iLevelID == 0x4e2b))
         {
             this.CheckTriggerTime(NewbieGuideTriggerTimeType.onHostFirstDead, new uint[0]);
         }
     }
 }
Example #19
0
        private void onLearnTalent(ref DefaultGameEventParam param)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "Master Roleinfo is NULL!");
            if ((masterRoleInfo != null) && (((param.src != 0) && ActorHelper.IsHostActor(ref param.src)) && !masterRoleInfo.IsNewbieAchieveSet(5)))
            {
                this.ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_LEARN_TALENT);
                masterRoleInfo.SetNewbieAchieve(5, true, false);
            }
        }
Example #20
0
 private void OnFocusSwitched(ref DefaultGameEventParam prm)
 {
     if (prm.src && ActorHelper.IsHostCtrlActor(ref prm.src) && !Singleton <WatchController> .GetInstance().IsWatching)
     {
         this.SetFocusActor(prm.src);
         if (!prm.src.handle.ActorControl.IsDeadState && !this.bFreeCamera)
         {
             this.enableLockedCamera = true;
             this.enableAbsoluteLocationLockCamera = false;
         }
     }
 }
Example #21
0
 private void OnPlayerRevive(ref DefaultGameEventParam prm)
 {
     if (((prm.src != 0) && ActorHelper.IsHostCtrlActor(ref prm.src)) && (!this.bFreeCamera && !Singleton <WatchController> .GetInstance().IsWatching))
     {
         this.enableLockedCamera = true;
         this.enableAbsoluteLocationLockCamera = false;
         if (Singleton <CBattleSystem> .GetInstance().FightForm != null)
         {
             Singleton <CBattleSystem> .GetInstance().FightForm.DisableCameraDragPanelForRevive();
         }
     }
 }
Example #22
0
 private void OnFocusSwitched(ref DefaultGameEventParam prm)
 {
     if ((prm.src != 0) && ActorHelper.IsHostCtrlActor(ref prm.src))
     {
         this.SetFocusActor(prm.src);
         if (!prm.src.handle.ActorControl.IsDeadState && !this.bFreeCamera)
         {
             this.enableLockedCamera = true;
             this.enableAbsoluteLocationLockCamera = false;
         }
     }
 }
        private void onFightStart(ref DefaultGameEventParam prm)
        {
            this.Clear();
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            this.bActiveSys = curLvelContext.IsMobaModeWithOutGuide();
            if (!this.bActiveSys)
            {
                return;
            }
            this.StartupSys();
        }
Example #24
0
    private void OnPlayerDead(ref DefaultGameEventParam prm)
    {
        if (((prm.src != 0) && ActorHelper.IsHostCtrlActor(ref prm.src)) && !this.bFreeCamera)
        {
            if ((this.MobaCamera != null) && (prm.src.handle.ActorControl != null))
            {
                this.MobaCamera.SetAbsoluteLockLocation((Vector3)prm.src.handle.ActorControl.actorLocation);
            }
            Singleton <CBattleSystem> .GetInstance().StartCameraDrag();

            this.enableLockedCamera = false;
            this.enableAbsoluteLocationLockCamera = true;
            if (this.MobaCamera != null)
            {
                this.MobaCamera._lockTransitionRate = 1f;
            }
        }
    }
Example #25
0
 public override void Leave(Action _action, Track _track)
 {
     if (this.actor_)
     {
         if (this.forbidMove)
         {
             this.actor_.handle.ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbility_Move);
             if (!this.actor_.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Move))
             {
                 DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.actor_, this.actor_);
                 Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorClearMove, ref defaultGameEventParam);
             }
         }
         if (this.forbidSkillAbort && this.actor_.handle.SkillControl.CurUseSkill != null)
         {
             this.actor_.handle.SkillControl.CurUseSkill.skillAbort.InitAbort(true);
         }
         if (this.forbidMoveRotate)
         {
             this.actor_.handle.ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbility_MoveRotate);
         }
         if (this.delaySkillAbort && this.actor_.handle.SkillControl.CurUseSkill != null)
         {
             this.actor_.handle.SkillControl.CurUseSkill.bProtectAbortSkill = false;
             if (this.actor_.handle.SkillControl.CurUseSkill.bDelayAbortSkill)
             {
                 this.actor_.handle.SkillControl.CurUseSkill.bDelayAbortSkill = false;
                 this.actor_.handle.SkillControl.ForceAbortCurUseSkill();
             }
         }
         if (this.forbidEnergyRecover)
         {
             this.actor_.handle.ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbility_RecoverEnergy);
         }
         if (this.forbidCollisionDetection)
         {
             this.actor_.handle.ActorControl.RmvNoAbilityFlag(ObjAbilityType.ObjAbiliity_CollisionDetection);
         }
         this.ImmuneAbility(true);
         this.ClearForbidSkill();
     }
 }
Example #26
0
        public override void Process(AGE.Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.eventSrcId);
            PoolObjHandle <ActorRoot> myLastAtker = _action.GetActorHandle(this.eventAtkerId);

            if ((myLastAtker == 0) && (actorHandle != 0))
            {
                myLastAtker = actorHandle.handle.ActorControl.myLastAtker;
            }
            DefaultGameEventParam prm = new DefaultGameEventParam(actorHandle, myLastAtker);

            if (this.eventType == GameEventDef.Event_GameEnd)
            {
                Singleton <GameEventSys> .instance.PostEvent <DefaultGameEventParam>(this.eventType, ref prm);
            }
            else
            {
                Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(this.eventType, ref prm);
            }
        }
Example #27
0
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle   = _action.GetActorHandle(this.eventSrcId);
            PoolObjHandle <ActorRoot> poolObjHandle = _action.GetActorHandle(this.eventAtkerId);

            if (!poolObjHandle && actorHandle)
            {
                poolObjHandle = actorHandle.get_handle().ActorControl.myLastAtker;
            }
            DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(actorHandle, poolObjHandle);

            if (this.eventType == GameEventDef.Event_GameEnd)
            {
                Singleton <GameEventSys> .get_instance().PostEvent <DefaultGameEventParam>(this.eventType, ref defaultGameEventParam);
            }
            else
            {
                Singleton <GameEventSys> .get_instance().SendEvent <DefaultGameEventParam>(this.eventType, ref defaultGameEventParam);
            }
        }
Example #28
0
 private void MoveCity()
 {
     if (this.actorObj != 0)
     {
         VInt3 zero        = VInt3.zero;
         VInt3 outPosWorld = VInt3.zero;
         if (Singleton <BattleLogic> .GetInstance().mapLogic.GetRevivePosDir(ref this.actorObj.handle.TheActorMeta, true, out outPosWorld, out zero))
         {
             VInt num3;
             if (PathfindingUtility.GetGroundY(outPosWorld, out num3))
             {
                 this.actorObj.handle.groundY = num3;
                 outPosWorld.y = num3.i;
             }
             this.actorObj.handle.forward  = zero;
             this.actorObj.handle.location = outPosWorld;
             this.actorObj.handle.ActorControl.AddNoAbilityFlag(ObjAbilityType.ObjAbility_MoveCity);
             DefaultGameEventParam prm = new DefaultGameEventParam(this.actorObj, this.actorObj);
             Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorMoveCity, ref prm);
         }
     }
 }
Example #29
0
        private void MoveCity()
        {
            if (!this.actorObj)
            {
                return;
            }
            VInt3 zero  = VInt3.zero;
            VInt3 zero2 = VInt3.zero;

            if (Singleton <BattleLogic> .GetInstance().mapLogic.GetRevivePosDir(ref this.actorObj.get_handle().TheActorMeta, true, out zero2, out zero))
            {
                VInt groundY;
                if (PathfindingUtility.GetGroundY(zero2, out groundY))
                {
                    this.actorObj.get_handle().groundY = groundY;
                    zero2.y = groundY.i;
                }
                this.actorObj.get_handle().forward  = zero;
                this.actorObj.get_handle().location = zero2;
                this.actorObj.get_handle().ActorControl.AddNoAbilityFlag(ObjAbilityType.ObjAbility_MoveProtect);
                DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.actorObj, this.actorObj);
                Singleton <GameEventSys> .get_instance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorMoveCity, ref defaultGameEventParam);
            }
        }
Example #30
0
        private void onMonsterGroupDead(ref DefaultGameEventParam param)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            DebugHelper.Assert(masterRoleInfo != null, "Master Roleinfo is NULL!");
            if ((masterRoleInfo != null) && (param.src != 0))
            {
                if (param.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
                {
                    MonsterWrapper wrapper      = param.src.handle.AsMonster();
                    object[]       inParameters = new object[] { param.src.handle.TheActorMeta.ConfigId };
                    DebugHelper.Assert((wrapper != null) && (wrapper.cfgInfo != null), "Can't find Monster config -- ID: {0}", inParameters);
                    if ((wrapper.cfgInfo == null) || (wrapper.cfgInfo.bMonsterType == 1))
                    {
                        return;
                    }
                }
                if ((param.atker != 0) && ActorHelper.IsHostActor(ref param.atker))
                {
                    if ((Singleton <BattleLogic> .GetInstance().DragonId != 0) && (param.src.handle.TheActorMeta.ConfigId == Singleton <BattleLogic> .GetInstance().DragonId))
                    {
                        if (!masterRoleInfo.IsNewbieAchieveSet(4))
                        {
                            Singleton <CNewbieAchieveSys> .GetInstance().ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_KILL_LITTLEDRAGON);

                            masterRoleInfo.SetNewbieAchieve(4, true, false);
                        }
                    }
                    else if (!masterRoleInfo.IsNewbieAchieveSet(3))
                    {
                        this.ShowAchieve(enNewbieAchieve.COM_ACNT_CLIENT_BITS_TYPE_DESTORY_MONSTERHOME);
                        masterRoleInfo.SetNewbieAchieve(3, true, false);
                    }
                }
            }
        }