예제 #1
0
 public void Init(BuffHolderComponent _buffHolder)
 {
     this.sourceActor = _buffHolder.actorPtr;
     base.ActionName  = StringHelper.UTF8BytesToString(ref this.cfgData.szActionName);
     this.curLayer    = 1;
     this.immuneTime  = 0;
     this.curTime     = 0;
     this.lastMaxTime = (this.cfgData.iLastMaxTime != 0) ? this.cfgData.iLastMaxTime : 0x7fffffff;
 }
예제 #2
0
 public void Init(BuffHolderComponent _buffHolder)
 {
     this.buffHolder  = _buffHolder;
     this.sourceActor = _buffHolder.actorPtr;
     for (int i = 0; i < 7; i++)
     {
         this.changeSkillSlot[i].changeCount   = 0;
         this.changeSkillSlot[i].initSkillID   = 0;
         this.changeSkillSlot[i].changeSkillID = 0;
     }
 }
예제 #3
0
 public override void OnUse()
 {
     base.OnUse();
     this.name               = string.Empty;
     this.isMovable          = true;
     this.isRotatable        = true;
     this.myTransform        = null;
     this.ActorMesh          = null;
     this.ActorMeshAnimation = null;
     this._bVisible          = true;
     this._bInitVisibleDelay = 0;
     this._bInCamera         = false;
     this.ObjID              = 0u;
     this.TheActorMeta       = default(ActorMeta);
     this.TheStaticData      = default(ActorStaticData);
     this.SelfPtr.Release();
     this.ObjLinker                   = null;
     this.ActorControl                = null;
     this.ActorAgent                  = null;
     this.MovementComponent           = null;
     this.SkillControl                = null;
     this.ValueComponent              = null;
     this.HurtControl                 = null;
     this.HudControl                  = null;
     this.AnimControl                 = null;
     this.BuffHolderComp              = null;
     this.MatHurtEffect               = null;
     this.ShadowEffect                = null;
     this.EquipComponent              = null;
     this.DefaultAttackModeControl    = null;
     this.LockTargetAttackModeControl = null;
     this.PetControl                  = null;
     this.OriginalActorMesh           = null;
     this.OriginalMeshAnim            = null;
     this.shape = null;
     this.slotList.Clear();
     this.bChildUpdate             = false;
     this.SMNode                   = null;
     this._location                = VInt3.zero;
     this._forward                 = VInt3.forward;
     this._rotation                = Quaternion.identity;
     this.groundY                  = 0;
     this.hasReachedNavEdge        = false;
     this.pickFlyY                 = 0;
     this.AttackOrderReady         = true;
     this.bOneKiller               = false;
     this.CharInfo                 = null;
     this.HorizonMarker            = null;
     this.BornPos                  = VInt3.zero;
     this.isRecycled               = false;
     this.BornPos                  = VInt3.zero;
     this.PositionRecords          = null;
     this.PositionRecordsLastStamp = 0f;
 }
예제 #4
0
 public void Init(BuffHolderComponent _buffHolder)
 {
     this.protectValue                    = 0;
     this.buffHolder                      = _buffHolder;
     this.limiteMaxHpHurt.bValid          = false;
     this.m_uiProtectTotalValue           = 0u;
     this.m_uiProtectValueFromHero        = 0u;
     this.m_uiBeProtectedTotalValue       = 0u;
     this.m_uiBeProtectedValueToHeroPhys  = 0u;
     this.m_uiBeProtectedValueToHeroMagic = 0u;
     this.m_uiBeProtectedValueToHeroReal  = 0u;
 }
예제 #5
0
 public void Init(BuffHolderComponent _buffHolder, PoolObjHandle <ActorRoot> _originator, uint _markType)
 {
     this.sourceActor = _buffHolder.actorPtr;
     this.originActor = _originator;
     if (this.cfgData != null)
     {
         this.ActionName     = StringHelper.UTF8BytesToString(ref this.cfgData.szActionName);
         this.bAgeImmeExcute = (this.cfgData.bAgeImmeExcute == 1);
     }
     this.markParticle.Init(this.cfgData);
     this.SetCurLayer(1);
     this.immuneTime    = 0;
     this.triggerCDTime = 0;
     this.curTime       = 0;
     this.markType      = _markType;
     this.lastMaxTime   = ((this.cfgData.iLastMaxTime != 0) ? this.cfgData.iLastMaxTime : 2147483647);
 }
예제 #6
0
 public void Init(BuffHolderComponent _buffHolder)
 {
     this.buffHolder = _buffHolder;
     this.Clear();
 }
예제 #7
0
        private bool UseImpl(PoolObjHandle <ActorRoot> user)
        {
            if (((base.skillContext == null) || (base.skillContext.TargetActor == 0)) || (this.cfgData == null))
            {
                return(false);
            }
            BuffHolderComponent buffHolderComp = base.skillContext.TargetActor.handle.BuffHolderComp;

            if (buffHolderComp == null)
            {
                return(false);
            }
            if (!this.CheckUseRule(base.skillContext))
            {
                return(false);
            }
            if (!buffHolderComp.overlayRule.CheckOverlay(this))
            {
                return(false);
            }
            bool  flag    = false;
            bool  flag2   = false;
            VInt3 forward = VInt3.forward;

            switch (base.skillContext.AppointType)
            {
            case SkillRangeAppointType.Pos:
                flag = true;
                break;

            case SkillRangeAppointType.Directional:
                flag2   = true;
                forward = base.skillContext.UseVector;
                break;

            case SkillRangeAppointType.Track:
                flag    = true;
                flag2   = true;
                forward = base.skillContext.EndVector - base.skillContext.UseVector;
                if (forward.sqrMagnitudeLong < 1L)
                {
                    forward = VInt3.forward;
                }
                break;
            }
            GameObject obj2 = (base.skillContext.Originator == 0) ? null : base.skillContext.Originator.handle.gameObject;
            GameObject obj3 = (base.skillContext.TargetActor == 0) ? null : base.skillContext.TargetActor.handle.gameObject;

            GameObject[] objArray1 = new GameObject[] { obj2, obj3 };
            base.curAction = new PoolObjHandle <AGE.Action>(ActionManager.Instance.PlayAction(base.ActionName, true, false, objArray1));
            if (base.curAction == 0)
            {
                return(false);
            }
            this.curAction.handle.onActionStop += new ActionStopDelegate(this.OnActionStoped);
            this.curAction.handle.refParams.AddRefParam("SkillObj", this);
            this.curAction.handle.refParams.AddRefParam("SkillContext", base.skillContext);
            this.curAction.handle.refParams.AddRefParam("TargetActor", base.skillContext.TargetActor);
            this.curAction.handle.refParams.SetRefParam("_BulletPos", base.skillContext.EffectPos);
            this.curAction.handle.refParams.SetRefParam("_BulletDir", base.skillContext.EffectDir);
            if (flag)
            {
                this.curAction.handle.refParams.SetRefParam("_TargetPos", base.skillContext.UseVector);
            }
            if (flag2)
            {
                this.curAction.handle.refParams.SetRefParam("_TargetDir", forward);
            }
            if (this.cfgData != null)
            {
                SkillSlotType slotType  = base.skillContext.SlotType;
                int           iDuration = this.cfgData.iDuration;
                if ((slotType >= SkillSlotType.SLOT_SKILL_1) && (slotType <= SkillSlotType.SLOT_SKILL_3))
                {
                    int skillLevel = 1;
                    if ((base.skillContext.Originator != 0) && (base.skillContext.Originator.handle.SkillControl != null))
                    {
                        SkillSlot slot = null;
                        base.skillContext.Originator.handle.SkillControl.TryGetSkillSlot(slotType, out slot);
                        if (slot != null)
                        {
                            skillLevel = slot.GetSkillLevel();
                        }
                    }
                    skillLevel = (skillLevel >= 1) ? skillLevel : 1;
                    iDuration += (skillLevel - 1) * this.cfgData.iDurationGrow;
                }
                if ((((base.skillContext.Originator != 0) && (base.skillContext.Originator.handle != null)) && ((base.skillContext.Originator.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (base.skillContext.Originator.handle.TheStaticData.TheHeroOnlyInfo.AttackDistanceType == 2))) && (this.cfgData.iLongRangeReduction > 0))
                {
                    iDuration = (iDuration * this.cfgData.iLongRangeReduction) / 0x2710;
                }
                this.curAction.handle.ResetLength(iDuration, false);
                if (this.cfgData.dwEffectType == 2)
                {
                    this.DealTenacity(base.skillContext.TargetActor);
                }
            }
            bool flag3 = true;

            if ((this.cfgData.dwShowType != 0) || (this.cfgData.dwFloatTextID > 0))
            {
                BuffSkill skill = null;
                if (((base.skillContext.TargetActor == 0) || (base.skillContext.TargetActor.handle == null)) || ((base.skillContext.TargetActor.handle.BuffHolderComp == null) || (base.skillContext.TargetActor.handle.BuffHolderComp.SpawnedBuffList == null)))
                {
                    return(false);
                }
                for (int i = 0; i < base.skillContext.TargetActor.handle.BuffHolderComp.SpawnedBuffList.Count; i++)
                {
                    skill = base.skillContext.TargetActor.handle.BuffHolderComp.SpawnedBuffList[i];
                    if (((skill != null) && (skill.cfgData != null)) && (skill.cfgData.iCfgID == this.cfgData.iCfgID))
                    {
                        flag3 = false;
                        break;
                    }
                }
                if (flag3)
                {
                    SpawnBuffEventParam param = new SpawnBuffEventParam(this.cfgData.dwShowType, this.cfgData.dwFloatTextID, base.skillContext.TargetActor);
                    Singleton <GameSkillEventSys> .GetInstance().SendEvent <SpawnBuffEventParam>(GameSkillEventDef.Event_SpawnBuff, base.skillContext.TargetActor, ref param, GameSkillEventChannel.Channel_HostCtrlActor);
                }
            }
            base.skillContext.TargetActor.handle.BuffHolderComp.AddBuff(this);
            if ((this.cfgData.dwEffectType == 2) && (this.cfgData.dwShowType != 2))
            {
                LimitMoveEventParam param2 = new LimitMoveEventParam(base.CurAction.handle.length, base.SkillID, base.skillContext.TargetActor);
                Singleton <GameSkillEventSys> .GetInstance().SendEvent <LimitMoveEventParam>(GameSkillEventDef.AllEvent_LimitMove, base.skillContext.TargetActor, ref param2, GameSkillEventChannel.Channel_AllActor);
            }
            if (base.bAgeImmeExcute)
            {
                this.curAction.handle.UpdateLogic((int)Singleton <FrameSynchr> .GetInstance().FrameDelta);
            }
            return(true);
        }
예제 #8
0
        private bool UseImpl(PoolObjHandle <ActorRoot> user)
        {
            if (this.skillContext == null || !this.skillContext.TargetActor || this.cfgData == null)
            {
                return(false);
            }
            BuffHolderComponent buffHolderComp = this.skillContext.TargetActor.get_handle().BuffHolderComp;

            if (buffHolderComp == null)
            {
                return(false);
            }
            if (!this.CheckUseRule(this.skillContext))
            {
                return(false);
            }
            if (!buffHolderComp.overlayRule.CheckOverlay(this))
            {
                return(false);
            }
            bool  flag  = false;
            bool  flag2 = false;
            VInt3 value = VInt3.forward;

            switch (this.skillContext.AppointType)
            {
            case 2:
                flag = true;
                break;

            case 3:
                flag2 = true;
                value = this.skillContext.UseVector;
                if (this.skillContext.TargetID != 0u)
                {
                    PoolObjHandle <ActorRoot> actor = Singleton <GameObjMgr> .GetInstance().GetActor(this.skillContext.TargetID);

                    if (actor)
                    {
                        Vector3 vector = actor.get_handle().myTransform.position - user.get_handle().myTransform.position;
                        vector.y = 0f;
                        vector.Normalize();
                        value = (VInt3)vector;
                    }
                }
                break;

            case 4:
                flag  = true;
                flag2 = true;
                value = this.skillContext.EndVector - this.skillContext.UseVector;
                if (value.get_sqrMagnitudeLong() < 1L)
                {
                    value = VInt3.forward;
                }
                break;
            }
            GameObject gameObject  = (!this.skillContext.Originator) ? null : this.skillContext.Originator.get_handle().gameObject;
            GameObject gameObject2 = (!this.skillContext.TargetActor) ? null : this.skillContext.TargetActor.get_handle().gameObject;

            this.curAction = new PoolObjHandle <Action>(ActionManager.Instance.PlayAction(this.ActionName, true, false, new GameObject[]
            {
                gameObject,
                gameObject2
            }));
            if (!this.curAction)
            {
                return(false);
            }
            this.curAction.get_handle().onActionStop += new ActionStopDelegate(this.OnActionStoped);
            this.curAction.get_handle().refParams.AddRefParam("SkillObj", this);
            this.curAction.get_handle().refParams.AddRefParam("SkillContext", this.skillContext);
            this.curAction.get_handle().refParams.AddRefParam("TargetActor", this.skillContext.TargetActor);
            this.curAction.get_handle().refParams.SetRefParam("_BulletPos", this.skillContext.EffectPos);
            this.curAction.get_handle().refParams.SetRefParam("_BulletDir", this.skillContext.EffectDir);
            if (flag)
            {
                this.curAction.get_handle().refParams.SetRefParam("_TargetPos", this.skillContext.UseVector);
            }
            if (flag2)
            {
                this.curAction.get_handle().refParams.SetRefParam("_TargetDir", value);
            }
            if (this.cfgData != null)
            {
                SkillSlotType slotType = this.skillContext.SlotType;
                int           num      = this.cfgData.iDuration;
                if (slotType >= SkillSlotType.SLOT_SKILL_1 && slotType <= SkillSlotType.SLOT_SKILL_3)
                {
                    int num2 = 1;
                    if (this.skillContext.Originator && this.skillContext.Originator.get_handle().SkillControl != null)
                    {
                        SkillSlot skillSlot = null;
                        this.skillContext.Originator.get_handle().SkillControl.TryGetSkillSlot(slotType, out skillSlot);
                        if (skillSlot != null)
                        {
                            num2 = skillSlot.GetSkillLevel();
                        }
                    }
                    num2 = ((num2 >= 1) ? num2 : 1);
                    num += (num2 - 1) * this.cfgData.iDurationGrow;
                }
                if (this.skillContext.Originator && this.skillContext.Originator.get_handle() != null && this.skillContext.Originator.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && this.skillContext.Originator.get_handle().TheStaticData.TheHeroOnlyInfo.AttackDistanceType == 2 && this.cfgData.iLongRangeReduction > 0)
                {
                    num = num * this.cfgData.iLongRangeReduction / 10000;
                }
                this.curAction.get_handle().ResetLength(num, false);
                if (this.cfgData.bEffectType == 2)
                {
                    this.DealTenacity(this.skillContext.TargetActor);
                }
            }
            bool flag3 = true;

            if (this.cfgData.bShowType != 0 || this.cfgData.bFloatTextID > 0)
            {
                if (!this.skillContext.TargetActor || this.skillContext.TargetActor.get_handle() == null || this.skillContext.TargetActor.get_handle().BuffHolderComp == null || this.skillContext.TargetActor.get_handle().BuffHolderComp.SpawnedBuffList == null)
                {
                    return(false);
                }
                for (int i = 0; i < this.skillContext.TargetActor.get_handle().BuffHolderComp.SpawnedBuffList.get_Count(); i++)
                {
                    BuffSkill buffSkill = this.skillContext.TargetActor.get_handle().BuffHolderComp.SpawnedBuffList.get_Item(i);
                    if (buffSkill != null && buffSkill.cfgData != null && buffSkill.cfgData.iCfgID == this.cfgData.iCfgID)
                    {
                        flag3 = false;
                        break;
                    }
                }
                if (flag3)
                {
                    SpawnBuffEventParam spawnBuffEventParam = new SpawnBuffEventParam((uint)this.cfgData.bShowType, (uint)this.cfgData.bFloatTextID, this.skillContext.TargetActor);
                    Singleton <GameSkillEventSys> .GetInstance().SendEvent <SpawnBuffEventParam>(GameSkillEventDef.Event_SpawnBuff, this.skillContext.TargetActor, ref spawnBuffEventParam, GameSkillEventChannel.Channel_HostCtrlActor);
                }
            }
            this.skillContext.TargetActor.get_handle().BuffHolderComp.AddBuff(this);
            if (this.cfgData.bEffectType == 2 && this.cfgData.bShowType != 2)
            {
                LimitMoveEventParam limitMoveEventParam = new LimitMoveEventParam(base.CurAction.get_handle().length, this.SkillID, this.skillContext.TargetActor);
                Singleton <GameSkillEventSys> .GetInstance().SendEvent <LimitMoveEventParam>(GameSkillEventDef.AllEvent_LimitMove, this.skillContext.TargetActor, ref limitMoveEventParam, GameSkillEventChannel.Channel_AllActor);
            }
            if (this.bAgeImmeExcute)
            {
                this.curAction.get_handle().UpdateLogic((int)Singleton <FrameSynchr> .GetInstance().FrameDelta);
            }
            return(true);
        }
예제 #9
0
 public void UninitActor()
 {
     if (this.HurtControl != null)
     {
         this.HurtControl.Uninit();
     }
     if (this.MovementComponent != null)
     {
         this.MovementComponent.Uninit();
     }
     if (this.SkillControl != null)
     {
         this.SkillControl.Uninit();
     }
     if (this.HudControl != null)
     {
         this.HudControl.Uninit();
     }
     if (this.AnimControl != null)
     {
         this.AnimControl.Uninit();
     }
     if (this.BuffHolderComp != null)
     {
         this.BuffHolderComp.Uninit();
     }
     if (this.EffectControl != null)
     {
         this.EffectControl.Uninit();
     }
     if (this.ActorControl != null)
     {
         this.ActorControl.Uninit();
     }
     if (this.HorizonMarker != null)
     {
         this.HorizonMarker.Uninit();
     }
     if (this.ValueComponent != null)
     {
         this.ValueComponent.Uninit();
     }
     if (this.EquipComponent != null)
     {
         this.EquipComponent.Uninit();
     }
     if (this.PetControl != null)
     {
         this.PetControl.Uninit();
     }
     if (this.HurtControl != null)
     {
         this.HurtControl.Release();
         this.HurtControl = null;
     }
     if (this.MovementComponent != null)
     {
         this.MovementComponent.Release();
         this.MovementComponent = null;
     }
     if (this.SkillControl != null)
     {
         this.SkillControl.Release();
         this.SkillControl = null;
     }
     if (this.HudControl != null)
     {
         this.HudControl.Release();
         this.HudControl = null;
     }
     if (this.AnimControl != null)
     {
         this.AnimControl.Release();
         this.AnimControl = null;
     }
     if (this.BuffHolderComp != null)
     {
         this.BuffHolderComp.Release();
         this.BuffHolderComp = null;
     }
     if (this.EffectControl != null)
     {
         this.EffectControl.Release();
         this.EffectControl = null;
     }
     if (this.HorizonMarker != null)
     {
         this.HorizonMarker.Release();
         this.HorizonMarker = null;
     }
     if (this.ActorControl != null)
     {
         this.ActorControl.Release();
         this.ActorControl = null;
     }
     if (this.ValueComponent != null)
     {
         this.ValueComponent.Release();
         this.ValueComponent = null;
     }
     if (this.EquipComponent != null)
     {
         this.EquipComponent.Release();
         this.EquipComponent = null;
     }
     if (this.DefaultAttackModeControl != null)
     {
         this.DefaultAttackModeControl.Release();
         this.DefaultAttackModeControl = null;
     }
     if (this.LockTargetAttackModeControl != null)
     {
         this.LockTargetAttackModeControl.Release();
         this.LockTargetAttackModeControl = null;
     }
     if (this.PetControl != null)
     {
         this.PetControl.Release();
         this.PetControl = null;
     }
 }
예제 #10
0
 public void Init(BuffHolderComponent _buffHolder)
 {
 }
예제 #11
0
        public override bool Use(PoolObjHandle <ActorRoot> user, SkillUseContext context)
        {
            if (((context == null) || (context.TargetActor == 0)) || (this.cfgData == null))
            {
                return(false);
            }
            this.skillContext = context.Clone();
            BuffHolderComponent buffHolderComp = context.TargetActor.handle.BuffHolderComp;

            if (buffHolderComp == null)
            {
                return(false);
            }
            if (!this.CheckUseRule(context))
            {
                return(false);
            }
            if (!buffHolderComp.overlayRule.CheckOverlay(this))
            {
                return(false);
            }
            bool  flag    = false;
            bool  flag2   = false;
            VInt3 forward = VInt3.forward;

            switch (context.AppointType)
            {
            case SkillRangeAppointType.Pos:
                flag = true;
                break;

            case SkillRangeAppointType.Directional:
                flag2   = true;
                forward = context.UseVector;
                break;

            case SkillRangeAppointType.Track:
                flag    = true;
                flag2   = true;
                forward = context.EndVector - context.UseVector;
                if (forward.sqrMagnitudeLong < 1L)
                {
                    forward = VInt3.forward;
                }
                break;
            }
            GameObject obj2 = (context.Originator == 0) ? null : context.Originator.handle.gameObject;
            GameObject obj3 = (context.TargetActor == 0) ? null : context.TargetActor.handle.gameObject;

            GameObject[] objArray1 = new GameObject[] { obj2, obj3 };
            base.curAction = ActionManager.Instance.PlayAction(base.ActionName, true, false, objArray1);
            if (base.curAction == null)
            {
                return(false);
            }
            base.curAction.onActionStop += new ActionStopDelegate(this.OnActionStoped);
            base.curAction.refParams.AddRefParam("SkillObj", this);
            base.curAction.refParams.AddRefParam("SkillContext", context);
            base.curAction.refParams.AddRefParam("TargetActor", context.TargetActor);
            base.curAction.refParams.SetRefParam("_BulletPos", context.EffectPos);
            base.curAction.refParams.SetRefParam("_BulletDir", context.EffectDir);
            if (flag)
            {
                base.curAction.refParams.SetRefParam("_TargetPos", context.UseVector);
            }
            if (flag2)
            {
                base.curAction.refParams.SetRefParam("_TargetDir", forward);
            }
            if (this.cfgData != null)
            {
                SkillSlotType slotType  = context.SlotType;
                int           iDuration = this.cfgData.iDuration;
                if ((slotType >= SkillSlotType.SLOT_SKILL_1) && (slotType <= SkillSlotType.SLOT_SKILL_3))
                {
                    int skillLevel = 1;
                    if ((context.Originator != 0) && (context.Originator.handle.SkillControl != null))
                    {
                        SkillSlot slot = null;
                        context.Originator.handle.SkillControl.TryGetSkillSlot(slotType, out slot);
                        if (slot != null)
                        {
                            skillLevel = slot.GetSkillLevel();
                        }
                    }
                    skillLevel = (skillLevel >= 1) ? skillLevel : 1;
                    iDuration += (skillLevel - 1) * this.cfgData.iDurationGrow;
                }
                base.curAction.ResetLength(iDuration, false);
                if (this.cfgData.dwEffectType == 2)
                {
                    this.DealTenacity(context.TargetActor);
                }
            }
            context.TargetActor.handle.BuffHolderComp.AddBuff(this);
            if (this.cfgData.dwShowType != 0)
            {
                SpawnBuffEventParam param = new SpawnBuffEventParam(this.cfgData.dwShowType, context.TargetActor);
                Singleton <GameSkillEventSys> .GetInstance().SendEvent <SpawnBuffEventParam>(GameSkillEventDef.Event_SpawnBuff, context.TargetActor, ref param, GameSkillEventChannel.Channel_HostCtrlActor);
            }
            if ((this.cfgData.dwEffectType == 2) && (this.cfgData.dwShowType != 2))
            {
                LimitMoveEventParam param2 = new LimitMoveEventParam(base.CurAction.length, base.SkillID, context.TargetActor);
                Singleton <GameSkillEventSys> .GetInstance().SendEvent <LimitMoveEventParam>(GameSkillEventDef.Event_LimitMove, context.TargetActor, ref param2, GameSkillEventChannel.Channel_AllActor);
            }
            return(true);
        }
예제 #12
0
 public void Init(BuffHolderComponent _buffHolder)
 {
     this.protectValue           = 0;
     this.buffHolder             = _buffHolder;
     this.limiteMaxHpHurt.bValid = false;
 }