Exemple #1
0
        private void ShowHero(PoolObjHandle <ActorRoot> actor)
        {
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(actor.handle.TheActorMeta.ConfigId);
            GameObject     obj2      = this.m_FormScript.m_formWidgets[4];

            if (obj2 != null)
            {
                string str       = CUIUtility.s_Sprite_Dynamic_BustHero_Dir;
                string str2      = "30" + actor.handle.TheActorMeta.ConfigId.ToString() + "0";
                Image  component = obj2.transform.GetComponent <Image>();
                if (component != null)
                {
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + str2, Singleton <CUIManager> .GetInstance().GetForm(s_battleHeroInfoForm), true, false, false);
                }
            }
            GameObject obj3 = this.m_FormScript.m_formWidgets[5];

            if (obj3 != null)
            {
                Text text = obj3.transform.GetComponent <Text>();
                if (text != null)
                {
                    text.text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                }
            }
            GameObject obj4 = this.m_FormScript.m_formWidgets[6];

            if (obj4 != null)
            {
                Text text2 = obj4.transform.GetComponent <Text>();
                if (text2 != null)
                {
                    text2.text = StringHelper.UTF8BytesToString(ref dataByKey.szHeroTips);
                }
            }
        }
        public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger)
        {
            if (this.timer != -1)
            {
                return(null);
            }
            this.GuideTipId = this.EnterUniqueId;
            ActorRoot inSrc   = (!src) ? null : src.get_handle();
            ActorRoot inAtker = (!atker) ? null : atker.get_handle();

            if (this.bEnable)
            {
                Singleton <TipProcessor> .GetInstance().PlayDrama(this.GuideTipId, inSrc, inAtker);
            }
            else
            {
                Singleton <TipProcessor> .GetInstance().EndDrama(this.GuideTipId);
            }
            if (this.TotalTime > 0)
            {
                this.timer = Singleton <CTimerManager> .GetInstance().AddTimer(this.TotalTime, 1, new CTimer.OnTimeUpHandler(this.OnTimeUp), true);
            }
            return(null);
        }
Exemple #3
0
        public override void Enter(AGE.Action _action, Track _track)
        {
            base.Enter(_action, _track);
            this.actorObj = _action.GetActorHandle(this.targetId);
            this.starTime = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

            this.totalTime = (ulong)base.length;
            if ((this.actorObj != 0) && ActorHelper.IsHostCtrlActor(ref this.actorObj))
            {
                CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FightForm.s_battleUIForm);

                if (form != null)
                {
                    this.processBar = Utility.FindChild(form.gameObject, "GoBackProcessBar");
                    if (this.processBar != null)
                    {
                        this.processBar.CustomSetActive(true);
                        Transform transform = this.processBar.transform.Find("GoBackTime");
                        this.m_process = (transform == null) ? null : transform.GetComponent <Image>();
                        this.m_process.CustomFillAmount(0f);
                    }
                }
            }
        }
 public override void Leave(AGE.Action _action, Track _track)
 {
     base.Leave(_action, _track);
     if (!this.bEyeObj)
     {
         if (this.m_particleObj != null)
         {
             this.m_particleObj.transform.parent = null;
             ActionManager.DestroyGameObject(this.m_particleObj);
         }
         GameObject gameObject = _action.GetGameObject(this.targetId);
         if ((this.targetId >= 0) && (gameObject != null))
         {
             if (this.applyActionSpeedToAnimation)
             {
                 _action.RemoveTempObject(AGE.Action.PlaySpeedAffectedType.ePSAT_Anim, gameObject);
             }
             if (this.applyActionSpeedToParticle)
             {
                 _action.RemoveTempObject(AGE.Action.PlaySpeedAffectedType.ePSAT_Fx, gameObject);
             }
             this.RemoveBullet();
             ActorHelper.DetachActorRoot(gameObject);
             ActionManager.DestroyGameObjectFromAction(_action, gameObject);
         }
     }
     if (this.actorSlot != null)
     {
         PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.parentId);
         if (actorHandle != 0)
         {
             actorHandle.handle.RemoveActorRootSlot(this.actorSlot);
         }
         this.actorSlot = null;
     }
 }
Exemple #5
0
        public void ExecCommand(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .instance.GetPlayer(this.m_playerID);

            if (player != null && player.Captain)
            {
                PoolObjHandle <ActorRoot> orignalActor = player.Captain.handle.ActorControl.GetOrignalActor();
                if (orignalActor)
                {
                    if (this.m_autoType == 1)
                    {
                        player.Captain.handle.ActorControl.SetAutoAI(true);
                    }
                    else if (this.m_autoType == 2)
                    {
                        player.Captain.handle.ActorControl.SetAutoAI(false);
                    }
                    else if (this.m_autoType == 3)
                    {
                        player.Captain.handle.ActorControl.SetOffline(true);
                    }
                }
            }
        }
Exemple #6
0
    public void SetFocusActor(PoolObjHandle <ActorRoot> focus)
    {
        if (this.MobaCamera == null)
        {
            GameObject obj2 = GameObject.Find("MainCamera");
            if (obj2 != null)
            {
                this.MobaCamera = obj2.GetComponent <Moba_Camera>();
                SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                if ((curLvelContext != null) && curLvelContext.m_isCameraFlip)
                {
                    this.MobaCamera.settings.rotation.defualtRotation = new Vector2(this.MobaCamera.settings.rotation.defualtRotation.x, 180f);
                    this.MobaCamera.currentCameraRotation             = (Vector3)this.MobaCamera.settings.rotation.defualtRotation;
                }
                this.MobaCamera.currentZoomRate = GameSettings.CameraHeightRateValue;
            }
        }
        if (this.MobaCamera != null)
        {
            this.MobaCamera.SetTargetTransform(focus);
            this.MobaCamera.SetCameraLocked(true);
        }
    }
Exemple #7
0
        public void AddHighlightForActor(PoolObjHandle <ActorRoot> actor, bool bPauseGame)
        {
            if (actor != 0)
            {
                ActorRoot handle = actor.handle;
                if (handle.InCamera)
                {
                    GameObject content = Singleton <CResourceManager> .GetInstance().GetResource("UGUI/Form/System/Dialog/WeakGuideHighlighter.prefab", typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject;

                    if (content != null)
                    {
                        GameObject widget = UnityEngine.Object.Instantiate(content) as GameObject;
                        if (widget != null)
                        {
                            if (NewbieGuideScriptControl.FormGuideMask == null)
                            {
                                NewbieGuideScriptControl.OpenGuideForm();
                            }
                            CUIFormScript formGuideMask = NewbieGuideScriptControl.FormGuideMask;
                            Transform     transform     = formGuideMask.transform;
                            Vector3       screenPoint   = (Vector3)CUIUtility.WorldToScreenPoint(Camera.main, (Vector3)handle.location);
                            Vector3       worldPosition = CUIUtility.ScreenToWorldPoint(formGuideMask.GetCamera(), screenPoint, transform.position.z);
                            Transform     transform2    = widget.transform;
                            transform2.SetSiblingIndex(1);
                            transform2.SetParent(NewbieGuideScriptControl.FormGuideMask.transform);
                            formGuideMask.InitializeWidgetPosition(widget, worldPosition);
                            transform2.position   = worldPosition;
                            transform2.localScale = Vector3.one;
                            CUIEventScript local1 = widget.AddComponent <CUIEventScript>();
                            local1.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(local1.onClick, new CUIEventScript.OnUIEventHandler(this.HighliterForActorClickHandler));
                            Singleton <CBattleGuideManager> .GetInstance().PauseGame(widget, false);
                        }
                    }
                }
            }
        }
    public void SetFocusActor(PoolObjHandle <ActorRoot> focus)
    {
        if (this.MobaCamera == null)
        {
            GameObject gameObject = GameObject.Find("MainCamera");
            if (gameObject != null)
            {
                this.MobaCamera = gameObject.GetComponent <Moba_Camera>();
                SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

                if (curLvelContext != null && curLvelContext.m_isCameraFlip)
                {
                    this.MobaCamera.settings.rotation.defualtRotation = new Vector2(this.MobaCamera.settings.rotation.defualtRotation.x, 180f);
                    this.MobaCamera.currentCameraRotation             = this.MobaCamera.settings.rotation.defualtRotation;
                }
                this.MobaCamera.currentZoomRate = this.GetZoomRate();
            }
        }
        if (this.MobaCamera != null)
        {
            this.MobaCamera.SetTargetTransform(focus);
            this.MobaCamera.SetCameraLocked(true);
        }
    }
        public PoolObjHandle <BulletSkill> SpawnBullet(SkillUseContext context, string _actionName, bool _bDeadRemove, bool _bAgeImmeExcute = false, int _bulletTypeId = 0, int _bulletUpperLimit = 0)
        {
            PoolObjHandle <BulletSkill> result = default(PoolObjHandle <BulletSkill>);

            if (context == null)
            {
                return(result);
            }
            BulletSkill bulletSkill = ClassObjPool <BulletSkill> .Get();

            bulletSkill.Init(_actionName, _bDeadRemove, _bulletTypeId);
            bulletSkill.bAgeImmeExcute = _bAgeImmeExcute;
            this.RecycleOverLimitBullte(_bulletTypeId, _bulletUpperLimit);
            if (bulletSkill.Use(this.actorPtr, context))
            {
                this.SpawnedBullets.Add(bulletSkill);
                result = new PoolObjHandle <BulletSkill>(bulletSkill);
            }
            else
            {
                bulletSkill.Release();
            }
            return(result);
        }
Exemple #10
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);
         }
     }
 }
 public void CopyData(ref MoveBulletDurationContext r)
 {
     this.length           = r.length;
     this.targetId         = r.targetId;
     this.destId           = r.destId;
     this.MoveType         = r.MoveType;
     this.targetPosition   = r.targetPosition;
     this.offsetDir        = r.offsetDir;
     this.velocity         = r.velocity;
     this.distance         = r.distance;
     this.gravity          = r.gravity;
     this.bMoveRotate      = r.bMoveRotate;
     this.bAdjustSpeed     = r.bAdjustSpeed;
     this.skillContext     = r.skillContext;
     this.destPosition     = r.destPosition;
     this.lastTime         = r.lastTime;
     this.hitHeight        = r.hitHeight;
     this.tarActor         = r.tarActor;
     this.moveActor        = r.moveActor;
     this.gravityControler = r.gravityControler;
     this.stopCondtion     = r.stopCondtion;
     this.moveDirection    = r.moveDirection;
     this.lerpDirection    = r.lerpDirection;
 }
Exemple #12
0
        public void OpenForm(PoolObjHandle <ActorRoot> _target)
        {
            if (!_target)
            {
                return;
            }
            this.curMaxHp   = _target.get_handle().ValueComponent.mActorValue[5].totalValue;
            this.curAd      = _target.get_handle().ValueComponent.mActorValue[1].totalValue;
            this.curAp      = _target.get_handle().ValueComponent.mActorValue[2].totalValue;
            this.curPhyDef  = _target.get_handle().ValueComponent.mActorValue[3].totalValue;
            this.curMgDef   = _target.get_handle().ValueComponent.mActorValue[4].totalValue;
            this.IsOpenForm = true;
            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateHpInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateEpInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateAdValueInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateApValueInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdatePhyDefValueInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateMgcDefValueInfo();
        }
 public override void NotifyDropEvent(PoolObjHandle <ActorRoot> actor)
 {
     DebugHelper.Assert(actor);
     if (actor.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster)
     {
         ResMonsterCfgInfo resMonsterCfgInfo = base.FindMonsterConfig(actor.get_handle().TheActorMeta.ConfigId);
         DebugHelper.Assert(resMonsterCfgInfo != null, "怪物数据档里面找不到id:{0}", new object[]
         {
             actor.get_handle().TheActorMeta.ConfigId
         });
         if (resMonsterCfgInfo != null)
         {
             RES_DROP_PROBABILITY_TYPE iDropProbability = resMonsterCfgInfo.iDropProbability;
             if (iDropProbability == 101)
             {
                 this.FinishDrop();
             }
             else if (this.hasRemain && iDropProbability != null && FrameRandom.Random(100u) <= iDropProbability)
             {
                 this.PlayDrop();
             }
         }
     }
 }
 public override void Enter(Action _action, Track _track)
 {
     base.Enter(_action, _track);
     this.actorObj = _action.GetActorHandle(this.targetId);
     if (this.actorObj != 0)
     {
         ObjWrapper actorControl = this.actorObj.handle.ActorControl;
         if (actorControl != null)
         {
             this.PauseAnimation();
             actorControl.TerminateMove();
             actorControl.ClearMoveCommand();
             actorControl.ForceAbortCurUseSkill();
             this.actorObj.handle.ActorControl.AddNoAbilityFlag(ObjAbilityType.ObjAbility_Move);
             this.actorObj.handle.ActorControl.AddDisableSkillFlag(SkillSlotType.SLOT_SKILL_COUNT);
             if (this.freezeHeight > 0)
             {
                 VInt3 location = this.actorObj.handle.location;
                 location.y += this.freezeHeight;
                 this.actorObj.handle.location = location;
             }
         }
     }
 }
        public override void OnCampScoreUpdated(ref SCampScoreUpdateParam prm)
        {
            if (!this.ShouldCare(ref prm))
            {
                return;
            }
            this.CachedSource   = prm.src;
            this.CachedAttacker = prm.atker;
            if (this.DataSubType == 1 && prm.HeadPoints >= 0)
            {
                this.Score = prm.HeadPoints;
            }
            else if (this.DataSubType == 2 && prm.HeadCount >= 0)
            {
                this.Score = prm.HeadCount;
            }
            bool flag = SmartCompare.Compare <int>(this.Score, this.TargetScore, this.operation);

            if (this.bCheckResults != flag)
            {
                this.bCheckResults = flag;
                this.TriggerChangedEvent();
            }
        }
        public bool SpawnBuff(PoolObjHandle <ActorRoot> inTargetActor, SkillUseContext inContext, int inSkillCombineId, ref BuffSkill newSkill, bool bExtraBuff = false)
        {
            if (!inTargetActor || inContext == null || inSkillCombineId <= 0)
            {
                newSkill = null;
                return(false);
            }
            BuffSkill buffSkill = ClassObjPool <BuffSkill> .Get();

            buffSkill.Init(inSkillCombineId);
            buffSkill.bExtraBuff = bExtraBuff;
            buffSkill.skillContext.Copy(inContext);
            buffSkill.skillContext.TargetActor = inTargetActor;
            buffSkill.skillContext.Instigator  = this.actor;
            newSkill = buffSkill;
            bool flag = buffSkill.Use(this.actorPtr);

            if (!flag)
            {
                buffSkill.Release();
                newSkill = null;
            }
            return(flag);
        }
        public void Init(PoolObjHandle <ActorRoot> _atker, PoolObjHandle <ActorRoot> _target)
        {
            PoolObjHandle <ActorRoot> poolObjHandle = _atker;

            if (_atker)
            {
                MonsterWrapper monsterWrapper = _atker.handle.ActorControl as MonsterWrapper;
                if (monsterWrapper != null && monsterWrapper.isCalledMonster && monsterWrapper.UseHostValueProperty)
                {
                    poolObjHandle = monsterWrapper.hostActor;
                }
                this.iActorLvl              = poolObjHandle.handle.ValueComponent.mActorValue.actorLvl;
                this.iActorATT              = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT].totalValue;
                this.iActorINT              = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT].totalValue;
                this.iActorMaxHp            = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue;
                this.iDEFStrike             = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYARMORHURT].totalValue;
                this.iRESStrike             = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCARMORHURT].totalValue;
                this.iDEFStrikeRate         = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_PHYARMORHURT_RATE].totalValue;
                this.iRESStrikeRate         = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_MGCARMORHURT_RATE].totalValue;
                this.iFinalHurt             = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_REALHURT].totalValue;
                this.iCritStrikeRate        = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITRATE].totalValue;
                this.iCritStrikeValue       = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_CRITICAL].totalValue;
                this.iCritStrikeEff         = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_CRITEFT].totalValue;
                this.iMagicHemophagia       = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_MAGICHEM].totalValue;
                this.iPhysicsHemophagia     = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_PHYSICSHEM].totalValue;
                this.iMagicHemophagiaRate   = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCVAMP].totalValue;
                this.iPhysicsHemophagiaRate = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYVAMP].totalValue;
                this.iHurtOutputRate        = poolObjHandle.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_HURTOUTPUTRATE].totalValue;
                this.actorType              = poolObjHandle.handle.TheActorMeta.ActorType;
            }
            else if (_target)
            {
                this.iReduceCritStrikeRate  = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_ANTICRIT].totalValue;
                this.iReduceCritStrikeValue = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_REDUCECRITICAL].totalValue;
            }
        }
Exemple #18
0
        private void OnCheckEncounter(int TimeSeq)
        {
            if (!this.ForwardCheck())
            {
                return;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

            if (hostPlayer == null || !hostPlayer.Captain || hostPlayer.Captain.get_handle().HorizonMarker == null)
            {
                return;
            }
            List <PoolObjHandle <ActorRoot> > heroActors = Singleton <GameObjMgr> .get_instance().HeroActors;

            List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = heroActors.GetEnumerator();
            while (enumerator.MoveNext())
            {
                PoolObjHandle <ActorRoot> current = enumerator.get_Current();
                if (current && current.get_handle().TheActorMeta.ConfigId == base.groupID && current.get_handle().HorizonMarker != null && current.get_handle().HorizonMarker.IsVisibleFor(hostPlayer.Captain.get_handle().TheActorMeta.ActorCamp) && this.CheckActor(ref current, ref hostPlayer.Captain))
                {
                    return;
                }
            }
        }
        public void ExecCommand(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .instance.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_Disconnect;
                        Singleton <EventRouter> .instance.BroadCastEvent <KillDetailInfo>(EventID.AchievementRecorderEvent, killDetailInfo);

                        Singleton <EventRouter> .instance.BroadCastEvent <bool, uint>(EventID.DisConnectNtf, true, cmd.playerID);
                    }
                    orignalActor.handle.ActorControl.SetOffline(true);
                }
                Singleton <CBattleSystem> .GetInstance().m_battleEquipSystem.ExecuteInOutEquipShopFrameCommand(0, ref player.Captain);
            }
        }
        public void OpenForm(PoolObjHandle <ActorRoot> _target)
        {
            if (!_target)
            {
                return;
            }
            this.curMaxHp   = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue;
            this.curAd      = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYATKPT].totalValue;
            this.curAp      = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCATKPT].totalValue;
            this.curPhyDef  = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYDEFPT].totalValue;
            this.curMgDef   = _target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCDEFPT].totalValue;
            this.IsOpenForm = true;
            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateHpInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateEpInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateAdValueInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateApValueInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdatePhyDefValueInfo();

            Singleton <CBattleSystem> .GetInstance().FightForm.UpdateMgcDefValueInfo();
        }
Exemple #21
0
        private void ShowHero(PoolObjHandle <ActorRoot> actor)
        {
            ResHeroCfgInfo dataByKey  = GameDataMgr.heroDatabin.GetDataByKey((long)actor.get_handle().TheActorMeta.ConfigId);
            GameObject     gameObject = this.m_FormScript.m_formWidgets[4];

            if (gameObject != null)
            {
                string s_Sprite_Dynamic_BustHero_Dir = CUIUtility.s_Sprite_Dynamic_BustHero_Dir;
                string heroSkinPic = CSkinInfo.GetHeroSkinPic((uint)actor.get_handle().TheActorMeta.ConfigId, 0u);
                Image  component   = gameObject.transform.GetComponent <Image>();
                if (component != null)
                {
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_BustHero_Dir + heroSkinPic, Singleton <CUIManager> .GetInstance().GetForm(CBattleHeroInfoPanel.s_battleHeroInfoForm), true, false, false, false);
                }
            }
            GameObject gameObject2 = this.m_FormScript.m_formWidgets[5];

            if (gameObject2 != null)
            {
                Text component2 = gameObject2.transform.GetComponent <Text>();
                if (component2 != null)
                {
                    component2.text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                }
            }
            GameObject gameObject3 = this.m_FormScript.m_formWidgets[6];

            if (gameObject3 != null)
            {
                Text component3 = gameObject3.transform.GetComponent <Text>();
                if (component3 != null)
                {
                    component3.text = StringHelper.UTF8BytesToString(ref dataByKey.szHeroTips);
                }
            }
        }
        public static bool OnSkillFuncInvisible(ref SSkillFuncContext inContext)
        {
            PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;

            if (inTargetObj != 0)
            {
                if (inContext.inStage == ESkillFuncStage.Enter)
                {
                    inTargetObj.handle.HorizonMarker.AddHideMark(COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT, HorizonConfig.HideMark.Skill, 1);
                }
                else if (inContext.inStage == ESkillFuncStage.Leave)
                {
                    COM_PLAYERCAMP[] othersCmp = BattleLogic.GetOthersCmp(inTargetObj.handle.TheActorMeta.ActorCamp);
                    for (int i = 0; i < othersCmp.Length; i++)
                    {
                        if (inTargetObj.handle.HorizonMarker.HasHideMark(othersCmp[i], HorizonConfig.HideMark.Skill))
                        {
                            inTargetObj.handle.HorizonMarker.AddHideMark(othersCmp[i], HorizonConfig.HideMark.Skill, -1);
                        }
                    }
                }
            }
            return(true);
        }
Exemple #23
0
        public ActorRoot GetEnemyTarget(ActorRoot InActor, int srchR, Vector3 useDirection, float srchAngle, uint filter)
        {
            ActorRoot root = null;
            ulong     num  = (ulong)(srchR * srchR);
            float     num2 = srchAngle;

            for (int i = 0; i < 3; i++)
            {
                if (i != InActor.TheActorMeta.ActorCamp)
                {
                    List <PoolObjHandle <ActorRoot> > campActors = Singleton <GameObjMgr> .GetInstance().GetCampActors((COM_PLAYERCAMP)i);

                    int count = campActors.Count;
                    for (int j = 0; j < count; j++)
                    {
                        PoolObjHandle <ActorRoot> handle = campActors[j];
                        ActorRoot target = handle.handle;
                        if (((((filter & (((int)1) << target.TheActorMeta.ActorType)) <= 0L) && !target.ActorControl.IsDeadState) && target.HorizonMarker.IsVisibleFor(InActor.TheActorMeta.ActorCamp)) && InActor.CanAttack(target))
                        {
                            VInt3 num8 = target.location - InActor.location;
                            if (num8.sqrMagnitudeLong2D < num)
                            {
                                Vector3 vector = (Vector3)(target.location - InActor.location);
                                float   num7   = Mathf.Abs(Vector3.Angle(useDirection, vector.normalized));
                                if (num7 < num2)
                                {
                                    num2 = num7;
                                    root = target;
                                }
                            }
                        }
                    }
                }
            }
            return(root);
        }
Exemple #24
0
        public void OnShenFuEffect(PoolObjHandle <ActorRoot> actor, uint shenFuId, AreaEventTrigger trigger, TriggerActionShenFu shenFu)
        {
            ShenFuObjects shenFuObjects;

            if (this._shenFuTriggerPool.TryGetValue(trigger.ID, ref shenFuObjects))
            {
                if (shenFuObjects.ShenFu != null)
                {
                    Singleton <CGameObjectPool> .GetInstance().RecycleGameObject(shenFuObjects.ShenFu);
                }
                this._shenFuTriggerPool.Remove(trigger.ID);
            }
            ShenFuInfo dataByKey = GameDataMgr.shenfuBin.GetDataByKey(shenFuId);

            if (dataByKey == null)
            {
                return;
            }
            BufConsumer bufConsumer = new BufConsumer(dataByKey.iBufId, actor, actor);

            if (bufConsumer.Use())
            {
            }
        }
Exemple #25
0
 public override void Enter(Action _action, Track _track)
 {
     this.targetActor = _action.GetActorHandle(this.targetId);
     if (!this.targetActor)
     {
         return;
     }
     this.targetActor.handle.ObjLinker.AddCustomMoveLerp(new CustomMoveLerpFunc(this.ActionMoveLerp));
     this.skillControl = this.targetActor.handle.SkillControl;
     if (this.skillControl == null || this.skillControl.SkillUseCache == null)
     {
         return;
     }
     this.bInit = true;
     if (this.moveSpeed > 0 && !this.skillControl.SkillUseCache.GetCacheMoveExpire() && this.skillControl.CurUseSkill != null)
     {
         this.skillControl.CurUseSkill.skillAbort.InitAbort(false);
         this.skillControl.CurUseSkill.skillAbort.SetAbort(SkillAbortType.TYPE_SKILL_1);
         this.skillControl.CurUseSkill.skillAbort.SetAbort(SkillAbortType.TYPE_SKILL_2);
         this.skillControl.CurUseSkill.skillAbort.SetAbort(SkillAbortType.TYPE_SKILL_3);
         this.skillControl.CurUseSkill.skillAbort.SetAbort(SkillAbortType.TYPE_SKILL_4);
         this.bStart = true;
     }
 }
 public void PlayParticle(ref PoolObjHandle <ActorRoot> _origin, ref PoolObjHandle <ActorRoot> _target, int _layer)
 {
     this.RemoveParticle();
     if (_layer == 1 && !string.IsNullOrEmpty(this.layerEffectName1))
     {
         this.CreateParticle(this.layerEffectName1, ref _origin, ref _target);
     }
     else if (_layer == 2 && !string.IsNullOrEmpty(this.layerEffectName2))
     {
         this.CreateParticle(this.layerEffectName2, ref _origin, ref _target);
     }
     else if (_layer == 3 && !string.IsNullOrEmpty(this.layerEffectName3))
     {
         this.CreateParticle(this.layerEffectName3, ref _origin, ref _target);
     }
     else if (_layer == 4 && !string.IsNullOrEmpty(this.layerEffectName4))
     {
         this.CreateParticle(this.layerEffectName4, ref _origin, ref _target);
     }
     else if (_layer == 5 && !string.IsNullOrEmpty(this.layerEffectName5))
     {
         this.CreateParticle(this.layerEffectName5, ref _origin, ref _target);
     }
 }
    private void AddActionsFromActors(DictionaryView <string, AGE.Action> actions, List <PoolObjHandle <ActorRoot> > actors)
    {
        if (actors != null)
        {
            for (int i = 0; i < actors.Count; i++)
            {
                PoolObjHandle <ActorRoot> handle = actors[i];
                ActorRoot root = handle.handle;
                this.AddBehaviorTree(root.CharInfo);
                IGameActorDataProvider actorDataProvider = Singleton <ActorDataCenter> .instance.GetActorDataProvider(GameActorDataProviderType.StaticBattleDataProvider);

                ActorStaticSkillData skillData = new ActorStaticSkillData();
                for (int j = 0; j < 8; j++)
                {
                    actorDataProvider.GetActorStaticSkillData(ref root.TheActorMeta, (ActorSkillSlot)j, ref skillData);
                    if (skillData.SkillId != 0)
                    {
                        this.AddActionsFromSkill(actions, skillData.SkillId);
                        this.AddActionsFromPassiveSkill(actions, skillData.PassiveSkillId);
                    }
                }
            }
        }
    }
Exemple #28
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);
                    }
                }
            }
        }
        public void ResetSkillLevel()
        {
            PoolObjHandle <ActorRoot> captain = Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain;

            int num = this.SkillSlotArray.Length;

            for (int i = 0; i < num; i++)
            {
                SkillSlot skillSlot = this.SkillSlotArray[i];
                if (skillSlot != null && (skillSlot.SlotType == SkillSlotType.SLOT_SKILL_1 || skillSlot.SlotType == SkillSlotType.SLOT_SKILL_2 || skillSlot.SlotType == SkillSlotType.SLOT_SKILL_3))
                {
                    skillSlot.SetSkillLevel(0);
                    if (captain == this.actorPtr && Singleton <CBattleSystem> .GetInstance().FightForm != null)
                    {
                        Singleton <CBattleSystem> .instance.FightForm.ClearSkillLvlStates(i);
                    }
                }
            }
            if (captain == this.actorPtr && Singleton <CBattleSystem> .GetInstance().FightForm != null)
            {
                Singleton <CBattleSystem> .instance.FightForm.ResetSkillButtonManager(this.actorPtr, false, SkillSlotType.SLOT_SKILL_COUNT);
            }
            this.m_iSkillPoint = 0;
        }
 public override void NotifyDropEvent(PoolObjHandle <ActorRoot> actor)
 {
     DebugHelper.Assert(actor);
     if (actor.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
     {
         ResOrganCfgInfo dataCfgInfoByCurLevelDiff = OrganDataHelper.GetDataCfgInfoByCurLevelDiff(actor.handle.TheActorMeta.ConfigId);
         DebugHelper.Assert(dataCfgInfoByCurLevelDiff != null, "can't find organ config, id={0}", new object[]
         {
             actor.handle.TheActorMeta.ConfigId
         });
         if (dataCfgInfoByCurLevelDiff == null)
         {
             return;
         }
         if (dataCfgInfoByCurLevelDiff.bOrganType == 2)
         {
             this.FinishDrop();
         }
         else if (this.hasRemain && (int)FrameRandom.Random(100u) <= MonoSingleton <GlobalConfig> .instance.OrganDropItemProbability)
         {
             this.PlayDrop();
         }
     }
 }