コード例 #1
0
        public override uint CommonAttackSearchEnemy(int srchR)
        {
            SkillCache      skillUseCache = null;
            SelectEnemyType selectLowHp   = SelectEnemyType.SelectLowHp;
            uint            lockTargetID  = this.lockTargetID;
            Player          ownerPlayer   = ActorHelper.GetOwnerPlayer(ref this.actorPtr);

            if (ownerPlayer != null)
            {
                if (base.IsValidTargetID(lockTargetID))
                {
                    return(lockTargetID);
                }
                selectLowHp = ownerPlayer.AttackTargetMode;
            }
            if (selectLowHp == SelectEnemyType.SelectLowHp)
            {
                lockTargetID = Singleton <AttackModeTargetSearcher> .GetInstance().SearchLowestHpTarget(ref this.actorPtr, srchR, 0);
            }
            else
            {
                lockTargetID = Singleton <AttackModeTargetSearcher> .GetInstance().SearchNearestTarget(ref this.actorPtr, srchR, 0);
            }
            if (!base.IsValidTargetID(lockTargetID))
            {
                skillUseCache = base.actor.ActorControl.actor.SkillControl.SkillUseCache;
                if ((skillUseCache != null) && !skillUseCache.GetSpecialCommonAttack())
                {
                    this.CancelCommonAttackMode();
                    lockTargetID = 0;
                }
            }
            if (lockTargetID == 0)
            {
                this.ClearTargetID();
                return(lockTargetID);
            }
            this.SetLockTargetID(lockTargetID);
            return(lockTargetID);
        }
コード例 #2
0
        public uint AdvanceCommonAttackSearchEnemy(PoolObjHandle <ActorRoot> InActor, int srchR)
        {
            uint      objID          = 0;
            SkillSlot slot           = null;
            bool      useAdvanceMode = false;
            Player    ownerPlayer    = ActorHelper.GetOwnerPlayer(ref InActor);

            if (InActor.handle.SkillControl.TryGetSkillSlot(SkillSlotType.SLOT_SKILL_0, out slot) && (slot.skillIndicator != null))
            {
                useAdvanceMode = slot.skillIndicator.GetUseAdvanceMode();
            }
            if (!useAdvanceMode)
            {
                SelectEnemyType selectLowHp;
                if (ownerPlayer == null)
                {
                    selectLowHp = SelectEnemyType.SelectLowHp;
                }
                else
                {
                    selectLowHp = ownerPlayer.AttackTargetMode;
                }
                if (selectLowHp == SelectEnemyType.SelectLowHp)
                {
                    return(this.CommonAttackSearchLowestHpTarget(InActor.handle.ActorControl, srchR));
                }
                return(this.CommonAttackSearchNearestTarget(InActor.handle.ActorControl, srchR));
            }
            ActorRoot useSkillTargetDefaultAttackMode = null;

            if ((slot != null) || (slot.skillIndicator != null))
            {
                useSkillTargetDefaultAttackMode = slot.skillIndicator.GetUseSkillTargetDefaultAttackMode();
                if (useSkillTargetDefaultAttackMode != null)
                {
                    objID = useSkillTargetDefaultAttackMode.ObjID;
                }
            }
            return(objID);
        }
コード例 #3
0
        public uint AdvanceCommonAttackSearchEnemy(PoolObjHandle <ActorRoot> InActor, int srchR)
        {
            uint      result      = 0u;
            SkillSlot skillSlot   = null;
            bool      flag        = false;
            Player    ownerPlayer = ActorHelper.GetOwnerPlayer(ref InActor);

            if (InActor.handle.SkillControl.TryGetSkillSlot(SkillSlotType.SLOT_SKILL_0, out skillSlot) && skillSlot.skillIndicator != null)
            {
                flag = skillSlot.skillIndicator.GetUseAdvanceMode();
            }
            if (flag)
            {
                if (skillSlot != null || skillSlot.skillIndicator != null)
                {
                    ActorRoot useSkillTargetDefaultAttackMode = skillSlot.skillIndicator.GetUseSkillTargetDefaultAttackMode();
                    if (useSkillTargetDefaultAttackMode != null)
                    {
                        result = useSkillTargetDefaultAttackMode.ObjID;
                    }
                }
                return(result);
            }
            SelectEnemyType selectEnemyType;

            if (ownerPlayer == null)
            {
                selectEnemyType = SelectEnemyType.SelectLowHp;
            }
            else
            {
                selectEnemyType = ownerPlayer.AttackTargetMode;
            }
            if (selectEnemyType == SelectEnemyType.SelectLowHp)
            {
                return(this.CommonAttackSearchLowestHpTarget(InActor.handle.ActorControl, srchR));
            }
            return(this.CommonAttackSearchNearestTarget(InActor.handle.ActorControl, srchR));
        }
コード例 #4
0
        public void PlaySuckSoulEft(PoolObjHandle <ActorRoot> src)
        {
            if (!src)
            {
                return;
            }
            if (!ActorHelper.IsCaptainActor(ref this.actorPtr) || !this.actor.Visible || !this.actor.InCamera)
            {
                return;
            }
            float      z   = (float)src.handle.CharInfo.iBulletHeight * 0.001f;
            Vector3    pos = src.handle.myTransform.localToWorldMatrix.MultiplyPoint(new Vector3(0f, 0f, z));
            Quaternion rot = Quaternion.Euler(-90f, 0f, 0f);
            GameObject pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(EffectPlayComponent.s_heroSuckEftPath, true, SceneObjType.ActionRes, pos, rot);

            if (pooledGameObjLOD != null)
            {
                DuraEftPlayParam duraEftPlayParam = default(DuraEftPlayParam);
                duraEftPlayParam.EftObj     = pooledGameObjLOD;
                duraEftPlayParam.RemainMSec = EffectPlayComponent.s_suckSoulMSec;
                this.soulSuckObjList.Add(duraEftPlayParam);
            }
        }
コード例 #5
0
        public override void Fight()
        {
            base.Fight();
            if (ActorHelper.IsCaptainActor(ref this.actorPtr))
            {
                this.m_isControledByMan = true;
                this.m_isAutoAI         = false;
            }
            else
            {
                this.m_isControledByMan = false;
                this.m_isAutoAI         = true;
            }
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorServerData = default(ActorServerData);

            if (actorDataProvider != null && actorDataProvider.GetActorServerData(ref this.actor.TheActorMeta, ref actorServerData))
            {
                this.m_skinId    = actorServerData.SkinId;
                this.m_skinCfgId = CSkinInfo.GetSkinCfgId((uint)this.actor.TheActorMeta.ConfigId, this.m_skinId);
                if (this.m_skinId != 0u)
                {
                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)this.actor.TheActorMeta.ConfigId, this.m_skinId);
                    if (heroSkin != null && !string.IsNullOrEmpty(heroSkin.szSoundSwitchEvent))
                    {
                        Singleton <CSoundManager> .instance.PostEvent(heroSkin.szSoundSwitchEvent, this.actor.gameObject);
                    }
                }
            }
            this.SetSkillEffectPath();
            base.EnableRVO(false);
            if (this.actor.HorizonMarker != null && FogOfWar.enable)
            {
                this.actor.HorizonMarker.SightRadius = Horizon.QueryGlobalSight();
            }
        }
コード例 #6
0
        public void ExecCommand(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && player.Captain)
            {
                PoolObjHandle <ActorRoot> orignalActor = player.Captain.handle.ActorControl.GetOrignalActor();
                if (orignalActor)
                {
                    if (ActorHelper.IsHostCampActor(ref orignalActor))
                    {
                        KillDetailInfo killDetailInfo = new KillDetailInfo();
                        killDetailInfo.Killer    = orignalActor;
                        killDetailInfo.bSelfCamp = true;
                        killDetailInfo.Type      = KillDetailInfoType.Info_Type_RunningMan;
                        Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo);
                    }
                    Singleton <EventRouter> .instance.BroadCastEvent <PoolObjHandle <ActorRoot> >(EventID.PlayerRunAway, orignalActor);

                    orignalActor.handle.ActorControl.SetOffline(true);
                }
                Singleton <CBattleSystem> .GetInstance().m_battleEquipSystem.ExecuteInOutEquipShopFrameCommand(0, ref player.Captain);
            }
        }
コード例 #7
0
        public void UpdateLogic(int DeltaTime)
        {
            if (this.m_locStat != null)
            {
                this.m_locStat.UpdateLogic(DeltaTime);
            }
            uint num;

            if (Singleton <BattleLogic> .instance.isFighting && Singleton <FrameSynchr> .instance.CurFrameNum % 450u == 0u && (num = Singleton <FrameSynchr> .instance.CurFrameNum / 450u) < 64u)
            {
                List <PoolObjHandle <ActorRoot> > list = ActorHelper.FilterActors(Singleton <GameObjMgr> .instance.HeroActors, new ActorFilterDelegate(Singleton <BattleLogic> .instance.FilterEnemyActor));
                int  count = list.get_Count();
                bool flag  = true;
                for (int i = 0; i < count; i++)
                {
                    flag &= list.get_Item(i).handle.Visible;
                }
                this.u64EmenyIsVisibleToHostHero |= (flag ? 1uL : 0uL) << (int)num;
            }
            if (this.m_playerKDAStat != null)
            {
                this.m_playerKDAStat.UpdateLogic();
            }
        }
コード例 #8
0
 public void SendEvent <ParamType>(GameSkillEventDef _event, PoolObjHandle <ActorRoot> _src, ref ParamType _param, GameSkillEventChannel _channel = 0)
 {
     if (_src != 0)
     {
         if (_channel == GameSkillEventChannel.Channel_HostCtrlActor)
         {
             if (ActorHelper.IsHostCtrlActor(ref _src))
             {
                 this.SendEvent <ParamType>(_event, ref _param);
             }
         }
         else if (_channel == GameSkillEventChannel.Channel_HostActor)
         {
             if (ActorHelper.IsHostActor(ref _src))
             {
                 this.SendEvent <ParamType>(_event, ref _param);
             }
         }
         else if (_channel == GameSkillEventChannel.Channel_AllActor)
         {
             this.SendEvent <ParamType>(_event, ref _param);
         }
     }
 }
コード例 #9
0
        private void onUseSkill(ref ActorSkillEventParam prm)
        {
            if (!ActorHelper.IsHostCtrlActor(ref prm.src))
            {
                return;
            }
            int num = this.TriggerMatches.Length;
            SFilterMatchParam sFilterMatchParam = default(SFilterMatchParam);

            sFilterMatchParam.slot = prm.slot;
            for (int i = 0; i < num; i++)
            {
                CTriggerMatch cTriggerMatch = this.TriggerMatches[i];
                if (cTriggerMatch != null)
                {
                    PoolObjHandle <ActorRoot> src   = new PoolObjHandle <ActorRoot>(null);
                    PoolObjHandle <ActorRoot> atker = new PoolObjHandle <ActorRoot>(null);
                    if (this.FilterMatch(EGlobalGameEvent.UseSkill, cTriggerMatch, src, atker, ref sFilterMatchParam, i))
                    {
                        this.DoTriggering(cTriggerMatch, src, atker);
                    }
                }
            }
        }
コード例 #10
0
ファイル: HeroHeadHud.cs プロジェクト: wujiangu/wanshiwu0.1
 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;
                 }
             }
         }
     }
 }
コード例 #11
0
 private void OnAchievementEvent(KillDetailInfo KillDetail)
 {
     if ((((KillDetail.Killer != 0) && (KillDetail.Killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) && ActorHelper.IsHostCtrlActor(ref KillDetail.Killer)) && ((KillDetail.HeroContiKillType == this.targetAchievementType) || (KillDetail.HeroMultiKillType == this.targetAchievementType)))
     {
         this.CompleteCount++;
         if (!this.bHasComplete && (this.status == StarEvaluationStatus.Success))
         {
             this.bHasComplete = true;
             this.TriggerChangedEvent();
         }
     }
 }
コード例 #12
0
ファイル: ActorConfig.cs プロジェクト: wujiangu/wanshiwu0.1
 private void Update()
 {
     if ((Singleton <BattleLogic> .instance.isFighting && (this.ActorObj != null)) && this.ActorObj.Visible)
     {
         bool flag   = (!Singleton <FrameSynchr> .instance.bEscape && this.bNeedLerp) && (this.ActorObj.InCamera || (this.ActorObj.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet));
         uint nDelta = (uint)(Time.deltaTime * 1000f);
         bool bReset = false;
         if ((this.CustomMoveLerp != null) && flag)
         {
             this.CustomMoveLerp(this.ActorObj, nDelta, false);
         }
         else
         {
             VInt    num2;
             Vector3 vector;
             if (((flag && (this.ActorControl != null)) && this.ActorControl.CanMove) && (this.ActorMovement.isMoving || (this.ActorMovement.nLerpStep > 0)))
             {
                 vector = this.NormalMoveLerp(nDelta);
                 if (!this.ActorMovement.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector, out num2))
                 {
                     vector.y = (float)num2;
                 }
                 base.gameObject.transform.position = vector;
                 this.ActorMovement.nLerpStep--;
             }
             else if (this.oldLocation != this.ActorObj.location)
             {
                 this.oldLocation = this.ActorObj.location;
                 Vector3 oldLocation = (Vector3)this.oldLocation;
                 Vector3 position    = base.gameObject.transform.position;
                 oldLocation.y = position.y;
                 Vector3 vector4 = oldLocation - position;
                 float   num3    = 0f;
                 if (((this.groundSpeed <= 0) || !flag) || ((num3 = vector4.magnitude) > (this.maxFrameMove * Singleton <FrameSynchr> .instance.PreActFrames)))
                 {
                     base.gameObject.transform.position = (Vector3)this.ActorObj.location;
                     if (this.CustomMoveLerp != null)
                     {
                         this.CustomMoveLerp(this.ActorObj, 0, true);
                     }
                     bReset = true;
                 }
                 else if ((num3 > 0.1f) && !ActorHelper.IsHostCtrlActor(ref this.ActorPtr))
                 {
                     float distance = this.ActorObj.MovementComponent.GetDistance(nDelta);
                     vector = Vector3.Lerp(position, oldLocation, distance / num3);
                     if (!this.ActorObj.MovementComponent.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector, out num2))
                     {
                         vector.y = (float)num2;
                     }
                     base.gameObject.transform.position = vector;
                     this.oldLocation = (VInt3)vector;
                 }
             }
         }
         if (flag && (this.ActorObj.MovementComponent != null))
         {
             this.ActorObj.MovementComponent.GravityModeLerp(nDelta, bReset);
         }
         if ((flag && (this.ActorControl != null)) && this.ActorControl.CanRotate)
         {
             if (base.gameObject.transform.rotation != this.tarRotation)
             {
                 base.gameObject.transform.rotation = this.ObjRotationLerp();
             }
         }
         else if (base.gameObject.transform.rotation != this.ActorObj.rotation)
         {
             base.gameObject.transform.rotation = this.ActorObj.rotation;
         }
     }
 }
コード例 #13
0
ファイル: ValueProperty.cs プロジェクト: isoundy000/wzry-1
        public void ChangeGoldCoinInBattle(int changeValue, bool isIncome, bool floatDigit = false, [Optional] Vector3 position, bool isLastHit = false)
        {
            int goldCoinInBattle = (int)this.m_goldCoinInBattle;

            this.m_goldCoinInBattle += changeValue;
            if ((changeValue > 0) && isIncome)
            {
                this.m_goldCoinIncomeInBattle   += changeValue;
                this.m_MaxGoldCoinIncomeInBattle = (this.m_MaxGoldCoinIncomeInBattle <= changeValue) ? changeValue : this.m_MaxGoldCoinIncomeInBattle;
            }
            DebugHelper.Assert(this.m_goldCoinInBattle >= 0, "Wo ri, zhe zenme keneng");
            if (((floatDigit && (changeValue > 0)) && (isIncome && base.actor.Visible)) && ActorHelper.IsHostCtrlActor(ref this.actorPtr))
            {
                if (((position.x == 0f) && (position.y == 0f)) && (position.z == 0f))
                {
                    position = base.actor.gameObject.transform.position;
                }
                Singleton <CBattleSystem> .GetInstance().CreateBattleFloatDigit(changeValue, !isLastHit ? DIGIT_TYPE.ReceiveGoldCoinInBattle : DIGIT_TYPE.ReceiveLastHitGoldCoinInBattle, position);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int, int, bool>("HeroGoldCoinInBattleChange", base.actorPtr, changeValue, (int)this.m_goldCoinInBattle, isIncome);
        }
コード例 #14
0
        public void UnInitIndicatePrefab(bool bDestroy)
        {
            if (!this.skillSlot.Actor || !ActorHelper.IsHostActor(ref this.skillSlot.Actor))
            {
                return;
            }
            if (this.guidePrefab != null)
            {
                this.HidePrefab(this.guidePrefab);
                this.guideSelectActive = false;
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.guidePrefab);

                    this.guidePrefab = null;
                }
            }
            if (this.effectPrefabNormal != null)
            {
                this.HidePrefab(this.effectPrefabNormal);
                this.effectSelectActive = false;
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.effectPrefabNormal);

                    this.effectPrefabNormal = null;
                }
            }
            if (this.effectPrefabBlock != null)
            {
                this.HidePrefab(this.effectPrefabBlock);
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.effectPrefabBlock);

                    this.effectPrefabBlock = null;
                }
            }
            if (this.effectPrefabGrass != null)
            {
                this.HidePrefab(this.effectPrefabGrass);
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.effectPrefabGrass);

                    this.effectPrefabGrass = null;
                }
            }
            if (this.guideWarnPrefab != null)
            {
                this.HidePrefab(this.guideWarnPrefab);
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.guideWarnPrefab);

                    this.guideWarnPrefab = null;
                }
            }
            if (this.effectWarnPrefab != null)
            {
                this.HidePrefab(this.effectWarnPrefab);
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.effectWarnPrefab);

                    this.effectWarnPrefab = null;
                }
            }
            if (this.fixedPrefab != null)
            {
                this.HidePrefab(this.fixedPrefab);
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.fixedPrefab);

                    this.fixedPrefab = null;
                }
            }
            if (this.fixedWarnPrefab != null)
            {
                this.HidePrefab(this.fixedWarnPrefab);
                if (bDestroy)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(this.fixedWarnPrefab);

                    this.fixedWarnPrefab = null;
                }
            }
        }
コード例 #15
0
        private void OnSelectTarget(ref SelectTargetEventParam _param)
        {
            Vector3 position = Vector3.zero;
            PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(_param.commonAttackTargetID);

            if (actor && this.indicatePrefab != null && this.indicateTransform != null && !ActorHelper.IsHostActor(ref actor))
            {
                this.targetObj = actor;
                this.ShowPrefab(this.indicatePrefab);
                if (this.targetObj.handle.CharInfo != null)
                {
                    this.SetPrefabScaler(this.indicatePrefab, this.targetObj.handle.CharInfo.iCollisionSize.x);
                }
                else
                {
                    this.SetPrefabScaler(this.indicatePrefab, 400);
                }
                position    = actor.handle.myTransform.position;
                position.y += 0.2f;
                this.indicateTransform.position = position;
                this.indicateTransform.SetParent(actor.handle.myTransform);
                this.indicateTransform.localRotation = Quaternion.Euler(90f, 0f, 0f);
                if (this.lockHeroPrefab != null && this.lockHeroTransform != null)
                {
                    if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                    {
                        float num = 0f;
                        if (actor.handle.CharInfo != null)
                        {
                            num = (float)actor.handle.CharInfo.iBulletHeight / 1000f;
                        }
                        position.y += num;
                        this.lockHeroTransform.position = position;
                        this.lockHeroTransform.SetParent(actor.handle.myTransform);
                        this.ShowPrefab(this.lockHeroPrefab);
                    }
                    else
                    {
                        this.HidePrefab(this.lockHeroPrefab);
                        MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.lockHeroPrefab, SceneObjType.ActionRes);
                    }
                }
            }
        }
コード例 #16
0
        private KillDetailInfo OnActorDeathd(ref DefaultGameEventParam prm)
        {
            KillDetailInfoType        type = KillDetailInfoType.Info_Type_None;
            KillDetailInfoType        heroMultiKillType = KillDetailInfoType.Info_Type_None;
            KillDetailInfoType        heroContiKillType = KillDetailInfoType.Info_Type_None;
            PoolObjHandle <ActorRoot> victim            = new PoolObjHandle <ActorRoot>();
            PoolObjHandle <ActorRoot> killer            = new PoolObjHandle <ActorRoot>();
            HeroWrapper actorControl = null;
            HeroWrapper wrapper2     = null;
            bool        flag         = false;
            bool        flag2        = false;
            bool        flag3        = false;
            bool        flag4        = false;
            bool        flag5        = false;
            bool        flag6        = false;
            Player      hostPlayer   = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

            DebugHelper.Assert(hostPlayer != null, "Fatal error in OnActorDeadthd, HostPlayer is null!");
            if (hostPlayer != null)
            {
                DebugHelper.Assert((bool)hostPlayer.Captain, "Fatal error in OnActorDeadthd, Captain is null!");
            }
            bool bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
            bool flag8     = false;
            uint objID     = hostPlayer.Captain.handle.ObjID;

            flag8 = (objID == prm.src.handle.ObjID) || (objID == prm.orignalAtker.handle.ObjID);
            flag  = prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero;
            flag2 = prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ;
            flag3 = (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster) && (prm.src.handle.TheActorMeta.ConfigId == Singleton <BattleLogic> .instance.DragonId);
            byte actorSubSoliderType = prm.src.handle.ActorControl.GetActorSubSoliderType();
            bool flag9  = false;
            bool flag10 = false;

            switch (actorSubSoliderType)
            {
            case 8:
                flag9 = true;
                flag3 = false;
                break;

            case 9:
                flag10 = true;
                flag3  = false;
                break;
            }
            victim = prm.src;
            killer = prm.orignalAtker;
            if (flag)
            {
                actorControl = prm.src.handle.ActorControl as HeroWrapper;
                wrapper2     = prm.orignalAtker.handle.ActorControl as HeroWrapper;
                if (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    if (prm.orignalAtker.handle.ObjID == objID)
                    {
                        flag8 = true;
                    }
                    flag4     = true;
                    bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
                }
                else if (actorControl.IsKilledByHero())
                {
                    flag4    = true;
                    killer   = actorControl.LastHeroAtker;
                    wrapper2 = actorControl.LastHeroAtker.handle.ActorControl as HeroWrapper;
                    if (killer.handle.ObjID == objID)
                    {
                        flag8 = true;
                    }
                    bSelfCamp = hostPlayer.PlayerCamp == killer.handle.TheActorMeta.ActorCamp;
                }
                else if (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
                {
                    flag5     = true;
                    flag4     = false;
                    bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
                }
                else if (prm.orignalAtker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
                {
                    flag6     = true;
                    flag4     = false;
                    bSelfCamp = hostPlayer.PlayerCamp == prm.orignalAtker.handle.TheActorMeta.ActorCamp;
                }
                if (flag && flag4)
                {
                    wrapper2.ContiDeadNum = 0;
                    wrapper2.ContiKillNum++;
                    if (wrapper2.IsInMultiKill())
                    {
                        wrapper2.MultiKillNum++;
                    }
                    else
                    {
                        wrapper2.MultiKillNum = 1;
                    }
                    wrapper2.UpdateLastKillTime();
                }
            }
            if (flag && flag4)
            {
                bool flag11 = false;
                if (wrapper2.MultiKillNum == 2)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_DoubleKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_DoubleKill, ref prm);
                }
                else if (wrapper2.MultiKillNum == 3)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_TripleKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_TripleKill, ref prm);
                }
                else if (wrapper2.MultiKillNum == 4)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_QuataryKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_QuataryKill, ref prm);
                }
                else if (wrapper2.MultiKillNum >= 5)
                {
                    flag11            = true;
                    heroMultiKillType = KillDetailInfoType.Info_Type_PentaKill;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_PentaKill, ref prm);
                }
                if (flag11)
                {
                    return(this._create(killer, victim, type, heroMultiKillType, type, bSelfCamp, false, flag8));
                }
            }
            if ((flag && flag4) && (actorControl.ContiKillNum >= 3))
            {
                if (actorControl.ContiKillNum >= 7)
                {
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_OdysseyBeStopped, ref prm);
                }
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_StopMultiKill, heroMultiKillType, type, bSelfCamp, false, flag8));
            }
            if ((flag && flag4) && !this.bFristBlood)
            {
                this.bFristBlood = true;
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_First_Kill, heroMultiKillType, type, bSelfCamp, false, flag8));
            }
            if (flag2 && ((prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 1) || (prm.src.handle.TheStaticData.TheOrganOnlyInfo.OrganType == 4)))
            {
                KillDetailInfo info = this._create(killer, victim, KillDetailInfoType.Info_Type_DestroyTower, type, type, bSelfCamp, false, flag8);
                if (prm.src.handle.TheStaticData.TheOrganOnlyInfo.DeadEnemySoldier > 0)
                {
                    Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, info);

                    return(this._create(killer, victim, KillDetailInfoType.Info_Type_Soldier_Boosted, type, type, bSelfCamp, false, flag8));
                }
                return(info);
            }
            if (flag)
            {
                Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref prm.src);
                if (((ownerPlayer != null) && (ownerPlayer.heroCount > 1)) && ownerPlayer.IsAllHeroesDead())
                {
                    return(this._create(killer, victim, type, type, type, bSelfCamp, true, flag8));
                }
            }
            if (flag && flag4)
            {
                bool flag12 = false;
                if (wrapper2.ContiKillNum == 3)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_MonsterKill;
                }
                else if (wrapper2.ContiKillNum == 4)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_DominateBattle;
                }
                else if (wrapper2.ContiKillNum == 5)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_Legendary;
                }
                else if (wrapper2.ContiKillNum == 6)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_TotalAnnihilat;
                }
                else if (wrapper2.ContiKillNum >= 7)
                {
                    flag12            = true;
                    heroContiKillType = KillDetailInfoType.Info_Type_Odyssey;
                    Singleton <GameEventSys> .GetInstance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_Odyssey, ref prm);
                }
                if (flag12)
                {
                    return(this._create(killer, victim, type, type, heroContiKillType, bSelfCamp, false, flag8));
                }
            }
            if (flag && ((flag4 || flag5) || flag6))
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_Kill, type, type, bSelfCamp, false, flag8));
            }
            if (flag3)
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_KillDragon, type, type, bSelfCamp, false, flag8));
            }
            if (flag10)
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_KillBIGDRAGON, type, type, bSelfCamp, false, flag8));
            }
            if (flag9)
            {
                return(this._create(killer, victim, KillDetailInfoType.Info_Type_KillBARON, type, type, bSelfCamp, false, flag8));
            }
            return(null);
        }
コード例 #17
0
        public void CreateIndicatePrefab(Skill _skillObj)
        {
            if (((this.skillSlot.Actor != 0) && ActorHelper.IsHostActor(ref this.skillSlot.Actor)) && ((_skillObj != null) && (_skillObj.cfgData != null)))
            {
                this.effectHideFrameNum = 0;
                GameObject content = Singleton <CResourceManager> .GetInstance().GetResource(_skillObj.GuidePrefabName, typeof(GameObject), enResourceType.BattleScene, false, false).m_content as GameObject;

                ActorRoot  handle   = this.skillSlot.Actor.handle;
                Quaternion rotation = handle.gameObject.transform.rotation;
                Vector3    position = handle.gameObject.transform.position;
                position.y += 0.3f;
                if (content != null)
                {
                    this.guidePrefab = (GameObject)UnityEngine.Object.Instantiate(content, position, rotation);
                    this.guidePrefab.transform.SetParent(handle.gameObject.transform);
                    this.guidePrefab.SetActive(false);
                }
                content = Singleton <CResourceManager> .GetInstance().GetResource(_skillObj.GuideWarnPrefabName, typeof(GameObject), enResourceType.BattleScene, false, false).m_content as GameObject;

                if (content != null)
                {
                    this.guideWarnPrefab = (GameObject)UnityEngine.Object.Instantiate(content, position, rotation);
                    this.guideWarnPrefab.transform.SetParent(handle.gameObject.transform);
                    this.guideWarnPrefab.SetActive(false);
                }
                content = Singleton <CResourceManager> .GetInstance().GetResource(_skillObj.EffectPrefabName, typeof(GameObject), enResourceType.BattleScene, false, false).m_content as GameObject;

                if (content != null)
                {
                    this.effectPrefab = (GameObject)UnityEngine.Object.Instantiate(content, position, rotation);
                    this.effectPrefab.SetActive(false);
                    MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.effectPrefab, SceneObjType.ActionRes);
                }
                content = Singleton <CResourceManager> .GetInstance().GetResource(_skillObj.EffectWarnPrefabName, typeof(GameObject), enResourceType.BattleScene, false, false).m_content as GameObject;

                if (content != null)
                {
                    this.effectWarnPrefab = (GameObject)UnityEngine.Object.Instantiate(content, position, rotation);
                    this.effectWarnPrefab.SetActive(false);
                    MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.effectWarnPrefab, SceneObjType.ActionRes);
                }
                content = Singleton <CResourceManager> .GetInstance().GetResource(_skillObj.FixedPrefabName, typeof(GameObject), enResourceType.BattleScene, false, false).m_content as GameObject;

                if (content != null)
                {
                    this.fixedPrefab = (GameObject)UnityEngine.Object.Instantiate(content, position, rotation);
                    this.fixedPrefab.SetActive(false);
                    this.fixedPrefab.transform.SetParent(handle.gameObject.transform);
                }
                content = Singleton <CResourceManager> .GetInstance().GetResource(_skillObj.FixedWarnPrefabName, typeof(GameObject), enResourceType.BattleScene, false, false).m_content as GameObject;

                if (content != null)
                {
                    this.fixedWarnPrefab = (GameObject)UnityEngine.Object.Instantiate(content, position, rotation);
                    this.fixedWarnPrefab.SetActive(false);
                    this.fixedWarnPrefab.transform.SetParent(handle.gameObject.transform);
                }
                int iGuideDistance = (int)_skillObj.cfgData.iGuideDistance;
                this.SetPrefabScaler(this.guidePrefab, iGuideDistance);
                this.SetPrefabScaler(this.guideWarnPrefab, iGuideDistance);
                if ((_skillObj.cfgData.dwRangeAppointType == 3) || (_skillObj.cfgData.dwRangeAppointType == 1))
                {
                    this.SetPrefabScaler(this.effectPrefab, iGuideDistance);
                    this.SetPrefabScaler(this.effectWarnPrefab, iGuideDistance);
                }
                int iFixedDistance = (int)_skillObj.cfgData.iFixedDistance;
                this.SetPrefabScaler(this.fixedPrefab, iFixedDistance);
                this.SetPrefabScaler(this.fixedWarnPrefab, iFixedDistance);
            }
        }
コード例 #18
0
        public bool FilterMatch(EGlobalGameEvent inEventType, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, object param, CTriggerMatch match, int inMatchIndex)
        {
            if (!this.CheckDifficulty())
            {
                return(false);
            }
            if (((this.GlobalVariable != 0) && (Singleton <BattleLogic> .instance.m_globalTrigger != null)) && (this.GlobalVariable != Singleton <BattleLogic> .instance.m_globalTrigger.CurGlobalVariable))
            {
                return(false);
            }
            if (this.bCaptainSrc && ((src == 0) || (src != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.bCaptainAtker && ((atker == 0) || (atker != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.SrcActorCond != null)
            {
                foreach (STriggerCondActor actor in this.SrcActorCond)
                {
                    if (!actor.FilterMatch(ref src))
                    {
                        return(false);
                    }
                }
            }
            if (this.AtkerActorCond != null)
            {
                foreach (STriggerCondActor actor2 in this.AtkerActorCond)
                {
                    if (!actor2.FilterMatch(ref atker))
                    {
                        return(false);
                    }
                }
            }
            switch (inEventType)
            {
            case EGlobalGameEvent.SpawnGroupDead:
            {
                if (match.Originator == null)
                {
                    break;
                }
                CommonSpawnGroup component = match.Originator.GetComponent <CommonSpawnGroup>();
                SpawnGroup       group2    = match.Originator.GetComponent <SpawnGroup>();
                if ((component == null) || (component == (param as CommonSpawnGroup)))
                {
                    if ((group2 == null) || (group2 == (param as SpawnGroup)))
                    {
                        break;
                    }
                    return(false);
                }
                return(false);
            }

            case EGlobalGameEvent.ActorDead:
            {
                PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(match.Originator);
                if ((actorRoot == 0) || !(actorRoot != src))
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.ActorDamage:
            {
                HurtEventResultInfo inHurtInfo = (HurtEventResultInfo)param;
                if (this.FilterMatchDamage(ref inHurtInfo))
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.UseSkill:
            {
                ActorSkillEventParam param2 = (ActorSkillEventParam)param;
                if (param2.slot == this.skillSlot)
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.TalentLevelChange:
            {
                TalentLevelChangeParam param4 = (TalentLevelChangeParam)param;
                if (match.Condition.TalentLevel == param4.TalentLevel)
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.BattleGoldChange:
                if ((src != 0) && ActorHelper.IsHostCtrlActor(ref src))
                {
                    int currentGold = (int)param;
                    if (!this.FilterBattleGoldNum(currentGold))
                    {
                        return(false);
                    }
                    break;
                }
                return(false);

            case EGlobalGameEvent.SkillUseCanceled:
            {
                DefaultSkillEventParam param3 = (DefaultSkillEventParam)param;
                if (param3.slot == this.skillSlot)
                {
                    break;
                }
                return(false);
            }
            }
            return(true);
        }
コード例 #19
0
        public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger)
        {
            List <PoolObjHandle <ActorRoot> > list = new List <PoolObjHandle <ActorRoot> >();

            if (this.bSrc && src)
            {
                list.Add(src);
            }
            if (this.bAtker && atker)
            {
                list.Add(atker);
            }
            if (this.RefObjList != null && this.RefObjList.Length > 0)
            {
                GameObject[] refObjList = this.RefObjList;
                for (int i = 0; i < refObjList.Length; i++)
                {
                    GameObject gameObject = refObjList[i];
                    if (!(gameObject == null))
                    {
                        SpawnPoint componentInChildren = gameObject.GetComponentInChildren <SpawnPoint>();
                        if (componentInChildren != null)
                        {
                            List <PoolObjHandle <ActorRoot> >             spawnedList = componentInChildren.GetSpawnedList();
                            List <PoolObjHandle <ActorRoot> > .Enumerator enumerator  = spawnedList.GetEnumerator();
                            while (enumerator.MoveNext())
                            {
                                PoolObjHandle <ActorRoot> current = enumerator.get_Current();
                                if (current)
                                {
                                    list.Add(current);
                                }
                            }
                        }
                        else
                        {
                            PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(gameObject);
                            if (actorRoot)
                            {
                                list.Add(actorRoot);
                            }
                        }
                    }
                }
            }
            List <PoolObjHandle <ActorRoot> > .Enumerator enumerator2 = list.GetEnumerator();
            while (enumerator2.MoveNext())
            {
                if (enumerator2.get_Current())
                {
                    if (!this.HasActor(enumerator2.get_Current()))
                    {
                        this.SetHudText(Utility.GetBubbleText((uint)this.EnterUniqueId), enumerator2.get_Current());
                        if (this.TotalTime > 0)
                        {
                            int id = Singleton <CTimerManager> .GetInstance().AddTimer(this.TotalTime, 1, new CTimer.OnTimeUpHandler(this.OnTimeUp), true);

                            this.m_actorTimerMap.Add(new TriggerActionTextBubble.ActorRootInfo
                            {
                                Actor = enumerator2.get_Current(),
                                Id    = id
                            });
                        }
                    }
                }
            }
            return(null);
        }
コード例 #20
0
        public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger, object prm)
        {
            List <PoolObjHandle <ActorRoot> > list = new List <PoolObjHandle <ActorRoot> >();

            if (base.bSrc && (src != 0))
            {
                list.Add(src);
            }
            if (base.bAtker && (atker != 0))
            {
                list.Add(atker);
            }
            if ((base.RefObjList != null) && (base.RefObjList.Length > 0))
            {
                foreach (GameObject obj2 in base.RefObjList)
                {
                    if (obj2 != null)
                    {
                        SpawnPoint componentInChildren = obj2.GetComponentInChildren <SpawnPoint>();
                        if (componentInChildren != null)
                        {
                            List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = componentInChildren.GetSpawnedList().GetEnumerator();
                            while (enumerator.MoveNext())
                            {
                                PoolObjHandle <ActorRoot> current = enumerator.Current;
                                if (current != 0)
                                {
                                    list.Add(current);
                                }
                            }
                        }
                        else
                        {
                            PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(obj2);
                            if (actorRoot != 0)
                            {
                                list.Add(actorRoot);
                            }
                        }
                    }
                }
            }
            List <PoolObjHandle <ActorRoot> > .Enumerator enumerator2 = list.GetEnumerator();
            while (enumerator2.MoveNext())
            {
                if ((enumerator2.Current != 0) && !this.HasActor(enumerator2.Current))
                {
                    this.SetHudText(Utility.GetBubbleText((uint)base.EnterUniqueId), enumerator2.Current);
                    if (base.TotalTime > 0)
                    {
                        int num2 = Singleton <CTimerManager> .GetInstance().AddTimer(base.TotalTime, 1, new CTimer.OnTimeUpHandler(this.OnTimeUp), true);

                        ActorRootInfo item = new ActorRootInfo {
                            Actor = enumerator2.Current,
                            Id    = num2
                        };
                        this.m_actorTimerMap.Add(item);
                    }
                }
            }
            return(null);
        }
コード例 #21
0
 public void onActorDead(ref GameDeadEventParam prm)
 {
     if (prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp)
     {
         int num = -1;
         while (++num < this.heroHeads.Length)
         {
             PlayerHead playerHead = this.heroHeads[num];
             if (playerHead.MyHero && playerHead.MyHero == prm.src)
             {
                 playerHead.OnMyHeroDead();
                 break;
             }
         }
         if (num < this.heroHeads.Length && !Singleton <BattleLogic> .instance.GetCurLvelContext().IsMobaMode() && ActorHelper.IsCaptainActor(ref prm.src))
         {
             int num2 = -1;
             while (++num2 < this.heroHeads.Length)
             {
                 if (num2 != num && this.heroHeads[num2].MyHero && !this.heroHeads[num2].MyHero.handle.ActorControl.IsDeadState)
                 {
                     this.pickHeroHead(this.heroHeads[num2]);
                     break;
                 }
             }
         }
     }
 }
コード例 #22
0
ファイル: GameObjMgr.cs プロジェクト: TonyDongGuaPi/joework
 public void onActorDamage(ref HurtEventResultInfo info)
 {
     if (info.hurtInfo.hurtType != HurtTypeDef.Therapic && info.hurtInfo.hurtCount == 0 && ActorHelper.IsHostCtrlActor(ref info.atker) && info.src.get_handle().MatHurtEffect != null)
     {
         info.src.get_handle().MatHurtEffect.PlayHurtEffect();
     }
 }
コード例 #23
0
        public override uint SelectSkillTarget(SkillSlot _slot)
        {
            int                iMaxSearchDistance           = 0;
            uint               dwSkillTargetFilter          = 0;
            ActorRoot          useSkillTargetLockAttackMode = null;
            uint               lockTargetID = this.lockTargetID;
            SelectEnemyType    selectLowHp  = SelectEnemyType.SelectLowHp;
            Player             ownerPlayer  = ActorHelper.GetOwnerPlayer(ref this.actorPtr);
            SkillSelectControl instance     = Singleton <SkillSelectControl> .GetInstance();

            Skill skill = (_slot.NextSkillObj == null) ? _slot.SkillObj : _slot.NextSkillObj;

            dwSkillTargetFilter = skill.cfgData.dwSkillTargetFilter;
            if (skill.cfgData.dwSkillTargetRule == 2)
            {
                return(base.actor.ObjID);
            }
            useSkillTargetLockAttackMode = _slot.skillIndicator.GetUseSkillTargetLockAttackMode();
            if (useSkillTargetLockAttackMode != null)
            {
                if (this.IsValidLockTargetID(useSkillTargetLockAttackMode.ObjID))
                {
                    lockTargetID = useSkillTargetLockAttackMode.ObjID;
                    Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(lockTargetID);
                }
                return(lockTargetID);
            }
            if (!this.IsValidLockTargetID(this.lockTargetID))
            {
                if (ownerPlayer != null)
                {
                    selectLowHp = ownerPlayer.AttackTargetMode;
                }
                if (skill.AppointType == SkillRangeAppointType.Target)
                {
                    iMaxSearchDistance = skill.cfgData.iMaxSearchDistance;
                }
                else
                {
                    iMaxSearchDistance = (int)skill.cfgData.iMaxAttackDistance;
                }
                if (selectLowHp == SelectEnemyType.SelectLowHp)
                {
                    lockTargetID = Singleton <AttackModeTargetSearcher> .GetInstance().SearchLowestHpTarget(ref this.actorPtr, iMaxSearchDistance, dwSkillTargetFilter);
                }
                else
                {
                    lockTargetID = Singleton <AttackModeTargetSearcher> .GetInstance().SearchNearestTarget(ref this.actorPtr, iMaxSearchDistance, dwSkillTargetFilter);
                }
                if (this.IsValidLockTargetID(lockTargetID))
                {
                    Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(lockTargetID);
                }
                return(lockTargetID);
            }
            if (!this.IsValidSkillTargetID(lockTargetID, dwSkillTargetFilter))
            {
                lockTargetID = 0;
            }
            return(lockTargetID);
        }
コード例 #24
0
        private void ReadyUseSkillLockAttackMode(Skill readySkillObj, bool bForceSkillUseInDefaultPosition = false)
        {
            if (bForceSkillUseInDefaultPosition)
            {
                this.skillIndicator.SetSkillUseDefaultPosition();
            }
            else
            {
                this.skillTargetId = 0u;
                SelectEnemyType selectEnemyType = SelectEnemyType.SelectLowHp;
                uint            num             = this.Actor.handle.LockTargetAttackModeControl.GetLockTargetID();
                if (!this.Actor.handle.LockTargetAttackModeControl.IsValidLockTargetID(num))
                {
                    Player ownerPlayer = ActorHelper.GetOwnerPlayer(ref this.Actor);
                    if (ownerPlayer != null)
                    {
                        selectEnemyType = ownerPlayer.AttackTargetMode;
                    }
                    if (readySkillObj.AppointType == SkillRangeAppointType.Target)
                    {
                        num = 0u;
                    }
                    else
                    {
                        int  srchR = readySkillObj.cfgData.iMaxAttackDistance;
                        uint dwSkillTargetFilter = readySkillObj.cfgData.dwSkillTargetFilter;
                        if (selectEnemyType == SelectEnemyType.SelectLowHp)
                        {
                            num = Singleton <AttackModeTargetSearcher> .GetInstance().SearchLowestHpTarget(ref this.Actor, srchR, dwSkillTargetFilter, true, SearchTargetPriority.CommonAttack);
                        }
                        else
                        {
                            num = Singleton <AttackModeTargetSearcher> .GetInstance().SearchNearestTarget(ref this.Actor, srchR, dwSkillTargetFilter, true, SearchTargetPriority.CommonAttack);
                        }
                    }
                }
                PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(num);

                if (actor)
                {
                    this.skillTargetId = actor.handle.ObjID;
                    this.skillIndicator.SetSkillUsePosition(actor.handle);
                }
                else
                {
                    this.skillIndicator.SetSkillUseDefaultPosition();
                }
            }
            if (readySkillObj.AppointType == SkillRangeAppointType.Target && readySkillObj.cfgData.bSkillTargetRule != 2)
            {
                this.skillIndicator.SetGuildPrefabShow(false);
                this.skillIndicator.SetGuildWarnPrefabShow(false);
                this.skillIndicator.SetUseAdvanceMode(false);
                this.skillIndicator.SetSkillUseDefaultPosition();
                this.skillIndicator.SetEffectPrefabShow(false);
                this.skillIndicator.SetFixedPrefabShow(true);
            }
            else
            {
                this.skillIndicator.SetGuildPrefabShow(true);
                this.skillIndicator.SetGuildWarnPrefabShow(false);
                this.skillIndicator.SetUseAdvanceMode(true);
            }
        }
コード例 #25
0
 public override void LateUpdate(int nDelta)
 {
     if ((this.actorPtr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || this.actorPtr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call) && ActorHelper.IsHostCtrlActor(ref this.actorPtr))
     {
         for (int i = 0; i < 10; i++)
         {
             SkillSlot skillSlot = this.SkillSlotArray[i];
             if (skillSlot != null)
             {
                 skillSlot.LateUpdate(nDelta);
             }
         }
     }
 }
コード例 #26
0
        public bool FilterMatch(EGlobalGameEvent inEventType, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ref SFilterMatchParam param, CTriggerMatch match, int inMatchIndex)
        {
            if (!this.CheckDifficulty())
            {
                return(false);
            }
            if (this.GlobalVariable != 0 && Singleton <BattleLogic> .instance.m_globalTrigger != null && this.GlobalVariable != Singleton <BattleLogic> .instance.m_globalTrigger.CurGlobalVariable)
            {
                return(false);
            }
            if (this.bCaptainSrc && (!src || src != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain))
            {
                return(false);
            }
            if (this.bCaptainAtker && (!atker || atker != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain))
            {
                return(false);
            }
            if (this.SrcActorCond != null)
            {
                STriggerCondActor[] srcActorCond = this.SrcActorCond;
                for (int i = 0; i < srcActorCond.Length; i++)
                {
                    STriggerCondActor sTriggerCondActor = srcActorCond[i];
                    if (!sTriggerCondActor.FilterMatch(ref src))
                    {
                        return(false);
                    }
                }
            }
            if (this.AtkerActorCond != null)
            {
                STriggerCondActor[] atkerActorCond = this.AtkerActorCond;
                for (int j = 0; j < atkerActorCond.Length; j++)
                {
                    STriggerCondActor sTriggerCondActor2 = atkerActorCond[j];
                    if (!sTriggerCondActor2.FilterMatch(ref atker))
                    {
                        return(false);
                    }
                }
            }
            switch (inEventType)
            {
            case EGlobalGameEvent.SpawnGroupDead:
                if (match.Originator != null)
                {
                    CommonSpawnGroup component  = match.Originator.GetComponent <CommonSpawnGroup>();
                    SpawnGroup       component2 = match.Originator.GetComponent <SpawnGroup>();
                    if (component != null && component != param.csg)
                    {
                        return(false);
                    }
                    if (component2 != null && component2 != param.sg)
                    {
                        return(false);
                    }
                }
                break;

            case EGlobalGameEvent.ActorDead:
            {
                PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(match.Originator);
                if (actorRoot && actorRoot != src)
                {
                    return(false);
                }
                break;
            }

            case EGlobalGameEvent.ActorDamage:
                if (!this.FilterMatchDamage(ref param.hurtInfo))
                {
                    return(false);
                }
                break;

            case EGlobalGameEvent.UseSkill:
                if (param.slot != (SkillSlotType)this.skillSlot)
                {
                    return(false);
                }
                break;

            case EGlobalGameEvent.TalentLevelChange:
                if (match.Condition.TalentLevel != param.intParam)
                {
                    return(false);
                }
                break;

            case EGlobalGameEvent.BattleGoldChange:
            {
                if (!src || !ActorHelper.IsHostCtrlActor(ref src))
                {
                    return(false);
                }
                int intParam = param.intParam;
                if (!this.FilterBattleGoldNum(intParam))
                {
                    return(false);
                }
                break;
            }

            case EGlobalGameEvent.SkillUseCanceled:
                if (param.slot != (SkillSlotType)this.skillSlot)
                {
                    return(false);
                }
                break;
            }
            return(true);
        }
コード例 #27
0
 private void Update()
 {
     if (this.ActorObj != null && this.ActorObj.Visible && Singleton <BattleLogic> .instance.isFighting && Singleton <FrameSynchr> .GetInstance().isRunning)
     {
         try
         {
             bool flag   = Singleton <FrameSynchr> .instance.FrameSpeed == 1 && this.bNeedLerp && (this.ActorObj.InCamera || this.ActorObj.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet);
             uint num    = (uint)(Time.deltaTime * 1000f);
             bool bReset = false;
             if (this.CustomMoveLerp != null && flag)
             {
                 this.CustomMoveLerp(this.ActorObj, num, false);
             }
             else if (flag && this.ActorControl != null && this.ActorControl.CanMove && this.ActorMovement != null && (this.ActorMovement.isMoving || this.ActorMovement.nLerpStep > 0))
             {
                 Vector3 vector = this.NormalMoveLerp(num);
                 VInt    ob;
                 if (!this.ActorMovement.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector, out ob))
                 {
                     vector.y = (float)ob;
                 }
                 this.myTransform.position    = vector;
                 this.ActorMovement.nLerpStep = this.ActorMovement.nLerpStep - 1;
             }
             else if (this.oldLocation != this.ActorObj.location)
             {
                 this.oldLocation = this.ActorObj.location;
                 Vector3 vector2  = (Vector3)this.oldLocation;
                 Vector3 position = this.myTransform.position;
                 vector2.y = position.y;
                 Vector3 vector3 = vector2 - position;
                 float   magnitude;
                 if (this.groundSpeed <= 0 || !flag || (magnitude = vector3.magnitude) > this.maxFrameMove * Singleton <FrameSynchr> .instance.PreActFrames)
                 {
                     this.myTransform.position = (Vector3)this.ActorObj.location;
                     if (this.CustomMoveLerp != null)
                     {
                         this.CustomMoveLerp(this.ActorObj, 0u, true);
                     }
                     bReset = true;
                 }
                 else if (magnitude > 0.1f && !ActorHelper.IsHostCtrlActor(ref this.ActorPtr) && this.ActorMovement != null)
                 {
                     float   distance = this.ActorMovement.GetDistance(num);
                     Vector3 vector4  = Vector3.Lerp(position, vector2, distance / magnitude);
                     VInt    ob2;
                     if (!this.ActorMovement.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector4, out ob2))
                     {
                         vector4.y = (float)ob2;
                     }
                     this.myTransform.position = vector4;
                     this.oldLocation          = (VInt3)vector4;
                 }
             }
             if (flag && this.ActorMovement != null)
             {
                 this.ActorMovement.GravityModeLerp(num, bReset);
             }
             if (this.CustomRotateLerp != null && flag)
             {
                 this.CustomRotateLerp(this.ActorObj, num);
             }
             else if (flag && this.ActorControl != null && this.ActorControl.CanRotate)
             {
                 if (this.myTransform.rotation != this.tarRotation)
                 {
                     this.myTransform.rotation = this.ObjRotationLerp();
                 }
             }
             else if (this.myTransform.rotation != this.ActorObj.rotation)
             {
                 this.myTransform.rotation = this.ActorObj.rotation;
             }
             if (flag && this.ActorObj.ChildUpdate)
             {
                 this.ActorObj.UpdateLerpActorRootSlot();
             }
         }
         catch (Exception var_12_3BB)
         {
         }
     }
 }
コード例 #28
0
        public void CreateIndicatePrefab(Skill _skillObj)
        {
            if (!this.skillSlot.Actor || !ActorHelper.IsHostActor(ref this.skillSlot.Actor))
            {
                return;
            }
            if (_skillObj == null || _skillObj.cfgData == null)
            {
                return;
            }
            this.effectHideFrameNum = 0;
            ActorRoot  handle   = this.skillSlot.Actor.handle;
            Quaternion rotation = handle.myTransform.rotation;
            Vector3    position = handle.myTransform.position;

            position.y += 0.3f;
            GameObject pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.GuidePrefabName, true, SceneObjType.ActionRes, position, rotation);

            if (pooledGameObjLOD != null)
            {
                this.guidePrefab = pooledGameObjLOD;
                this.guidePrefab.transform.SetParent(handle.myTransform);
                this.HidePrefab(this.guidePrefab);
                this.SetPrefabTag(this.guidePrefab);
                this.guideSelectActive = false;
            }
            pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.GuideWarnPrefabName, true, SceneObjType.ActionRes, position, rotation);

            if (pooledGameObjLOD != null)
            {
                this.guideWarnPrefab = pooledGameObjLOD;
                this.guideWarnPrefab.transform.SetParent(handle.myTransform);
                this.HidePrefab(this.guideWarnPrefab);
                this.SetPrefabTag(this.guideWarnPrefab);
            }
            pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.EffectPrefabName, true, SceneObjType.ActionRes, position, rotation);

            if (pooledGameObjLOD != null)
            {
                this.effectPrefabNormal = pooledGameObjLOD;
                this.HidePrefab(this.effectPrefabNormal);
                this.SetPrefabTag(this.effectPrefabNormal);
                this.effectSelectActive = false;
                MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.effectPrefabNormal, SceneObjType.ActionRes);
            }
            this.bSelectEffectPrefab = (_skillObj.cfgData.bSelectEffectPrefab > 0);
            if (this.bSelectEffectPrefab)
            {
                pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.EffectPrefabName + "_y", true, SceneObjType.ActionRes, position, rotation);

                if (pooledGameObjLOD != null)
                {
                    this.effectPrefabBlock = pooledGameObjLOD;
                    this.HidePrefab(this.effectPrefabBlock);
                    this.SetPrefabTag(this.effectPrefabBlock);
                    MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.effectPrefabBlock, SceneObjType.ActionRes);
                }
                pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.EffectPrefabName + "_G", true, SceneObjType.ActionRes, position, rotation);

                if (pooledGameObjLOD != null)
                {
                    this.effectPrefabGrass = pooledGameObjLOD;
                    this.HidePrefab(this.effectPrefabGrass);
                    this.SetPrefabTag(this.effectPrefabGrass);
                    MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.effectPrefabGrass, SceneObjType.ActionRes);
                }
            }
            pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.EffectWarnPrefabName, true, SceneObjType.ActionRes, position, rotation);

            if (pooledGameObjLOD != null)
            {
                this.effectWarnPrefab = pooledGameObjLOD;
                this.HidePrefab(this.effectWarnPrefab);
                this.SetPrefabTag(this.effectWarnPrefab);
                MonoSingleton <SceneMgr> .GetInstance().AddToRoot(this.effectWarnPrefab, SceneObjType.ActionRes);
            }
            pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.FixedPrefabName, true, SceneObjType.ActionRes, position, rotation);

            if (pooledGameObjLOD != null)
            {
                this.fixedPrefab = pooledGameObjLOD;
                this.HidePrefab(this.fixedPrefab);
                this.SetPrefabTag(this.fixedPrefab);
                this.fixedPrefab.transform.SetParent(handle.myTransform);
            }
            pooledGameObjLOD = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(_skillObj.FixedWarnPrefabName, true, SceneObjType.ActionRes, position, rotation);

            if (pooledGameObjLOD != null)
            {
                this.fixedWarnPrefab = pooledGameObjLOD;
                this.HidePrefab(this.fixedWarnPrefab);
                this.SetPrefabTag(this.fixedWarnPrefab);
                this.fixedWarnPrefab.transform.SetParent(handle.myTransform);
            }
            int distance = _skillObj.cfgData.iGuideDistance;

            this.SetPrefabScaler(this.guidePrefab, distance);
            this.SetPrefabScaler(this.guideWarnPrefab, distance);
            if (_skillObj.cfgData.bRangeAppointType == 3 || _skillObj.cfgData.bRangeAppointType == 1)
            {
                this.SetPrefabScaler(this.effectPrefabNormal, distance);
                this.SetPrefabScaler(this.effectPrefabBlock, distance);
                this.SetPrefabScaler(this.effectPrefabGrass, distance);
                this.SetPrefabScaler(this.effectWarnPrefab, distance);
            }
            int distance2 = _skillObj.cfgData.iFixedDistance;

            this.SetPrefabScaler(this.fixedPrefab, distance2);
            this.SetPrefabScaler(this.fixedWarnPrefab, distance2);
        }
コード例 #29
0
        private void OnActorDeadIncomeGoldCoinInBattle(ref PoolObjHandle <ActorRoot> target, ref PoolObjHandle <ActorRoot> attacker)
        {
            if (!target || !attacker)
            {
                return;
            }
            if (ActorHelper.IsHostCtrlActor(ref attacker) && (target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster || target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
            {
                if (attacker.handle.EffectControl != null)
                {
                    attacker.handle.EffectControl.PlayDyingGoldEffect(target);
                }
                Singleton <CSoundManager> .GetInstance().PlayBattleSound("Glod_Get", target, target.handle.gameObject);
            }
            ResIncomeAllocRule resIncomeAllocRule = null;

            switch (target.handle.TheActorMeta.ActorType)
            {
            case ActorTypeDef.Actor_Type_Hero:
                resIncomeAllocRule = this.m_incomeAllocRules[2][3];
                break;

            case ActorTypeDef.Actor_Type_Monster:
            {
                MonsterWrapper monsterWrapper = target.handle.AsMonster();
                if (monsterWrapper != null)
                {
                    RES_MONSTER_TYPE bMonsterType = (RES_MONSTER_TYPE)monsterWrapper.cfgInfo.bMonsterType;
                    if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_JUNGLE)
                    {
                        byte actorSubSoliderType = monsterWrapper.GetActorSubSoliderType();
                        if (actorSubSoliderType == 7 || actorSubSoliderType == 8 || actorSubSoliderType == 9)
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][5];
                        }
                        else if (actorSubSoliderType == 15)
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][7];
                        }
                        else
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][4];
                        }
                    }
                    else if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_SOLDIERLINE)
                    {
                        resIncomeAllocRule = this.m_incomeAllocRules[2][2];
                    }
                }
                break;
            }

            case ActorTypeDef.Actor_Type_Organ:
                resIncomeAllocRule = this.m_incomeAllocRules[2][1];
                break;

            case ActorTypeDef.Actor_Type_EYE:
                resIncomeAllocRule = this.m_incomeAllocRules[2][6];
                break;
            }
            if (resIncomeAllocRule != null)
            {
                ResDT_IncomeAttackRule incomeAllocRuleByAtker = this.GetIncomeAllocRuleByAtker(ref attacker, resIncomeAllocRule);
                if (incomeAllocRuleByAtker != null)
                {
                    this.AllocIncome(ref target, ref attacker, incomeAllocRuleByAtker, enIncomeType.GoldCoinInBattle, resIncomeAllocRule.IncomeChangeRate, resIncomeAllocRule.iComputerChangeRate);
                }
            }
        }
コード例 #30
0
        public override uint SelectSkillTarget(SkillSlot _slot)
        {
            uint               num             = this.lockTargetID;
            SelectEnemyType    selectEnemyType = SelectEnemyType.SelectLowHp;
            Player             ownerPlayer     = ActorHelper.GetOwnerPlayer(ref this.actorPtr);
            SkillSelectControl instance        = Singleton <SkillSelectControl> .GetInstance();

            Skill skill = (_slot.NextSkillObj != null) ? _slot.NextSkillObj : _slot.SkillObj;
            uint  dwSkillTargetFilter = skill.cfgData.dwSkillTargetFilter;

            if (skill.cfgData.bSkillTargetRule == 2)
            {
                num = this.actor.ObjID;
            }
            else if (skill.cfgData.bSkillTargetRule == 5)
            {
                ActorRoot actorRoot = instance.SelectTarget(SkillTargetRule.NextSkillTarget, _slot);
                if (actorRoot != null)
                {
                    num = actorRoot.ObjID;
                    if (this.IsValidLockTargetID(num))
                    {
                        Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(num);
                    }
                }
            }
            else
            {
                ActorRoot useSkillTargetLockAttackMode = _slot.skillIndicator.GetUseSkillTargetLockAttackMode();
                if (useSkillTargetLockAttackMode != null)
                {
                    if (this.IsValidLockTargetID(useSkillTargetLockAttackMode.ObjID))
                    {
                        num = useSkillTargetLockAttackMode.ObjID;
                        Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(num);
                    }
                }
                else if (!this.IsValidLockTargetID(this.lockTargetID))
                {
                    if (ownerPlayer != null)
                    {
                        selectEnemyType = ownerPlayer.AttackTargetMode;
                    }
                    int srchR;
                    if (skill.AppointType == SkillRangeAppointType.Target)
                    {
                        srchR = skill.GetMaxSearchDistance(_slot.GetSkillLevel());
                    }
                    else
                    {
                        srchR = skill.cfgData.iMaxAttackDistance;
                    }
                    if (selectEnemyType == SelectEnemyType.SelectLowHp)
                    {
                        num = Singleton <AttackModeTargetSearcher> .GetInstance().SearchLowestHpTarget(ref this.actorPtr, srchR, dwSkillTargetFilter, true, SearchTargetPriority.CommonAttack);
                    }
                    else
                    {
                        num = Singleton <AttackModeTargetSearcher> .GetInstance().SearchNearestTarget(ref this.actorPtr, srchR, dwSkillTargetFilter, true, SearchTargetPriority.CommonAttack);
                    }
                    if (this.IsValidLockTargetID(num))
                    {
                        Singleton <NetLockAttackTarget> .GetInstance().SendLockAttackTarget(num);
                    }
                }
                else if (!this.IsValidSkillTargetID(num, dwSkillTargetFilter))
                {
                    num = 0u;
                }
            }
            return(num);
        }