示例#1
0
        public override void Fight()
        {
            base.Fight();
            if (ActorHelper.IsCaptainActor(ref this.actorPtr))
            {
                base.m_isControledByMan = true;
                base.m_isAutoAI         = false;
            }
            else
            {
                base.m_isControledByMan = false;
                base.m_isAutoAI         = true;
            }
            IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.ServerDataProvider);

            ActorServerData actorData = new ActorServerData();

            if ((actorDataProvider != null) && actorDataProvider.GetActorServerData(ref base.actor.TheActorMeta, ref actorData))
            {
                this.m_skinId    = actorData.SkinId;
                this.m_skinCfgId = CSkinInfo.GetSkinCfgId((uint)base.actor.TheActorMeta.ConfigId, this.m_skinId);
                if (this.m_skinId != 0)
                {
                    ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin((uint)base.actor.TheActorMeta.ConfigId, this.m_skinId);
                    if ((heroSkin != null) && !string.IsNullOrEmpty(heroSkin.szSoundSwitchEvent))
                    {
                        Singleton <CSoundManager> .instance.PostEvent(heroSkin.szSoundSwitchEvent, base.actor.gameObject);
                    }
                }
            }
            base.EnableRVO(false);
        }
        public void PlaySuckSoulEft(PoolObjHandle <ActorRoot> src)
        {
            if ((src != 0) && ((ActorHelper.IsCaptainActor(ref this.actorPtr) && base.actor.Visible) && base.actor.InCamera))
            {
                float      z    = src.handle.CharInfo.iBulletHeight * 0.001f;
                Vector3    pos  = src.handle.gameObject.transform.localToWorldMatrix.MultiplyPoint(new Vector3(0f, 0f, z));
                Quaternion rot  = Quaternion.Euler(-90f, 0f, 0f);
                GameObject obj2 = MonoSingleton <SceneMgr> .GetInstance().GetPooledGameObjLOD(s_heroSuckEftPath, true, SceneObjType.ActionRes, pos, rot);

                if (obj2 != null)
                {
                    DuraEftPlayParam item = new DuraEftPlayParam {
                        EftObj     = obj2,
                        RemainMSec = s_suckSoulMSec
                    };
                    this.soulSuckObjList.Add(item);
                }
            }
        }
示例#3
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);
            }
        }
示例#4
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();
            }
        }
示例#5
0
 public void onActorDead(ref DefaultGameEventParam prm)
 {
     if ((prm.src.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().PlayerCamp == prm.src.handle.TheActorMeta.ActorCamp))
     {
         int index = -1;
         while (++index < this.heroHeads.Length)
         {
             PlayerHead head = this.heroHeads[index];
             if ((head.MyHero != 0) && (head.MyHero == prm.src))
             {
                 head.OnMyHeroDead();
                 break;
             }
         }
         if (((index < this.heroHeads.Length) && !Singleton <BattleLogic> .instance.GetCurLvelContext().isPVPMode) && ActorHelper.IsCaptainActor(ref prm.src))
         {
             int num2 = -1;
             while (++num2 < this.heroHeads.Length)
             {
                 if ((num2 != index) && ((this.heroHeads[num2].MyHero != 0) && !this.heroHeads[num2].MyHero.handle.ActorControl.IsDeadState))
                 {
                     this.pickHeroHead(this.heroHeads[num2]);
                     break;
                 }
             }
         }
     }
 }
 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;
                 }
             }
         }
     }
 }