예제 #1
0
        public static string GetResourceName(AGE.Action _action, string _resName, bool _bUseAdvanceSkin)
        {
            uint            num;
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");

            if (((refParamObject == null) || (refParamObject.Originator == 0)) || ((refParamObject.Originator.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero) || (refParamObject.Originator.handle.ActorControl == null)))
            {
                return(_resName);
            }
            HeroWrapper actorControl = (HeroWrapper)refParamObject.Originator.handle.ActorControl;

            if ((actorControl == null) || !actorControl.GetSkinCfgID(out num))
            {
                return(_resName);
            }
            int           length   = _resName.LastIndexOf('/');
            StringBuilder builder  = new StringBuilder(_resName);
            StringBuilder builder2 = new StringBuilder(actorControl.GetSkinEffectPath());

            if (length < 0)
            {
                return(_resName);
            }
            builder.Remove(0, length);
            builder2.Append(builder);
            if (_bUseAdvanceSkin)
            {
                int advanceSkinIndex = actorControl.GetAdvanceSkinIndex();
                if (advanceSkinIndex > 0)
                {
                    builder2.AppendFormat("_level{0}", advanceSkinIndex);
                }
            }
            return(builder2.ToString());
        }
예제 #2
0
        private void OnDeadExtraEffect(PoolObjHandle <ActorRoot> _attack)
        {
            BuffSkill       skill        = null;
            ResDT_SkillFunc outSkillFunc = null;

            if (_attack != 0)
            {
                for (int i = 0; i < _attack.handle.BuffHolderComp.SpawnedBuffList.Count; i++)
                {
                    skill = _attack.handle.BuffHolderComp.SpawnedBuffList[i];
                    if ((skill != null) && skill.FindSkillFunc(0x21, out outSkillFunc))
                    {
                        int inSkillCombineId = skill.CustomParams[0];
                        int num3             = skill.CustomParams[1];
                        int num4             = skill.CustomParams[2];
                        int typeMask         = skill.CustomParams[3];
                        int typeSubMask      = skill.CustomParams[4];
                        if ((num4 != 0) && this.CheckTargetSubType(typeMask, typeSubMask))
                        {
                            SkillUseContext inContext = new SkillUseContext();
                            inContext.SetOriginator(_attack);
                            _attack.handle.SkillControl.SpawnBuff(_attack, inContext, inSkillCombineId, true);
                        }
                    }
                }
            }
        }
예제 #3
0
        public void OnDead(PoolObjHandle <ActorRoot> _attack)
        {
            if (this.clearRule != null)
            {
                this.clearRule.CheckBuffNoClear(RES_SKILLFUNC_CLEAR_RULE.RES_SKILLFUNC_CLEAR_DEAD);
            }
            BuffSkill       inBuff       = null;
            ResDT_SkillFunc outSkillFunc = null;

            for (int i = 0; i < this.SpawnedBuffList.Count; i++)
            {
                inBuff = this.SpawnedBuffList[i];
                if ((inBuff != null) && inBuff.FindSkillFunc(0x20, out outSkillFunc))
                {
                    int  reviveTime  = inBuff.CustomParams[0];
                    int  reviveLife  = inBuff.CustomParams[1];
                    bool autoReset   = inBuff.CustomParams[2] == 1;
                    bool bBaseRevive = inBuff.CustomParams[3] == 0;
                    bool bCDReset    = inBuff.CustomParams[4] == 1;
                    base.actor.ActorControl.SetReviveContext(reviveTime, reviveLife, autoReset, bBaseRevive, bCDReset);
                    this.RemoveBuff(inBuff);
                }
                if ((((base.actor.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (_attack != 0)) && ((_attack.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && (inBuff != null))) && ((inBuff.cfgData != null) && (inBuff.cfgData.bIsInheritByKiller == 1)))
                {
                    this.RemoveBuff(inBuff);
                    SkillUseContext inContext = new SkillUseContext();
                    inContext.SetOriginator(_attack);
                    _attack.handle.SkillControl.SpawnBuff(_attack, inContext, inBuff.SkillID, true);
                }
            }
            this.OnDeadExtraEffect(_attack);
        }
예제 #4
0
 public void UpperTrigger(PoolObjHandle <ActorRoot> _originator, SkillUseContext inUseContext)
 {
     if (this.curLayer >= this.cfgData.iTriggerLayer && this.cfgData.iTriggerLayer > 0)
     {
         this.Trigger(_originator, inUseContext);
     }
 }
예제 #5
0
 public bool Use(PoolObjHandle <ActorRoot> user, SkillUseContext context)
 {
     this.skillContext.Copy(context);
     this.skillContext.Instigator = this;
     DebugHelper.Assert(this.skillContext.Originator);
     return(base.Use(user));
 }
예제 #6
0
        public static string GetResourceName(Action _action, string _resName, bool _bUseAdvanceSkin)
        {
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");

            if (refParamObject != null && refParamObject.Originator && refParamObject.Originator.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && refParamObject.Originator.get_handle().ActorControl != null)
            {
                HeroWrapper heroWrapper = (HeroWrapper)refParamObject.Originator.get_handle().ActorControl;
                uint        num;
                if (heroWrapper != null && heroWrapper.GetSkinCfgID(out num))
                {
                    int           num2           = _resName.LastIndexOf('/');
                    StringBuilder stringBuilder  = new StringBuilder(_resName);
                    StringBuilder stringBuilder2 = new StringBuilder(heroWrapper.GetSkinEffectPath());
                    if (num2 >= 0)
                    {
                        stringBuilder.Remove(0, num2);
                        stringBuilder2.Append(stringBuilder);
                        if (_bUseAdvanceSkin)
                        {
                            int advanceSkinIndex = heroWrapper.GetAdvanceSkinIndex();
                            if (advanceSkinIndex > 0)
                            {
                                stringBuilder2.AppendFormat("_level{0}", advanceSkinIndex);
                            }
                        }
                        return(stringBuilder2.ToString());
                    }
                }
            }
            return(_resName);
        }
예제 #7
0
        private void TriggerAction(PoolObjHandle <ActorRoot> _originator)
        {
            SkillUseContext context = new SkillUseContext();

            context.SetOriginator(_originator);
            context.TargetActor = this.sourceActor;
            this.Use(_originator, context);
        }
예제 #8
0
        private void OnDamageExtraEffect(PoolObjHandle <ActorRoot> _attack, SkillSlotType _slotType)
        {
            BuffSkill       inBuff       = null;
            ResDT_SkillFunc outSkillFunc = null;

            if (_attack != 0)
            {
                for (int i = 0; i < _attack.handle.BuffHolderComp.SpawnedBuffList.Count; i++)
                {
                    inBuff = _attack.handle.BuffHolderComp.SpawnedBuffList[i];
                    if ((inBuff != null) && inBuff.FindSkillFunc(0x21, out outSkillFunc))
                    {
                        bool flag             = false;
                        bool flag2            = true;
                        int  inSkillCombineId = inBuff.CustomParams[0];
                        int  num3             = inBuff.CustomParams[1];
                        int  num4             = inBuff.CustomParams[2];
                        int  typeMask         = inBuff.CustomParams[3];
                        int  typeSubMask      = inBuff.CustomParams[4];
                        int  num7             = inBuff.CustomParams[5];
                        if ((num4 == 0) && this.CheckTargetSubType(typeMask, typeSubMask))
                        {
                            if (num3 == 0)
                            {
                                flag = true;
                            }
                            else if ((num3 & (((int)1) << _slotType)) > 0)
                            {
                                flag = true;
                            }
                            if (num7 > 0)
                            {
                                if ((Singleton <FrameSynchr> .GetInstance().LogicFrameTick - inBuff.controlTime) >= num7)
                                {
                                    flag2 = true;
                                }
                                else
                                {
                                    flag2 = false;
                                }
                            }
                            if (flag && flag2)
                            {
                                SkillUseContext inContext = new SkillUseContext();
                                inContext.SetOriginator(_attack);
                                _attack.handle.SkillControl.SpawnBuff(base.actorPtr, inContext, inSkillCombineId, true);
                                inBuff.controlTime = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                                if (num7 == -1)
                                {
                                    _attack.handle.BuffHolderComp.RemoveBuff(inBuff);
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #9
0
        private int ResistDeadDamage(ref HurtDataInfo _hurt, int _hurtValue)
        {
            BuffSkill       inBuff       = null;
            ResDT_SkillFunc outSkillFunc = null;

            if ((this.buffHolder != null) && (this.buffHolder.actor != null))
            {
                ActorRoot actor = this.buffHolder.actor;
                for (int i = 0; i < actor.BuffHolderComp.SpawnedBuffList.Count; i++)
                {
                    inBuff = actor.BuffHolderComp.SpawnedBuffList[i];
                    if ((inBuff != null) && inBuff.FindSkillFunc(0x36, out outSkillFunc))
                    {
                        int inSkillCombineId = inBuff.CustomParams[0];
                        if (inBuff.CustomParams[1] == 0)
                        {
                            if (actor.ValueComponent.actorHp <= _hurtValue)
                            {
                                SkillUseContext inContext = new SkillUseContext();
                                inContext.SetOriginator(_hurt.atker);
                                actor.SkillControl.SpawnBuff(actor.SelfPtr, inContext, inSkillCombineId, true);
                                this.buffHolder.RemoveBuff(inBuff);
                                DefaultGameEventParam prm = new DefaultGameEventParam(this.buffHolder.actorPtr, _hurt.atker);
                                Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorImmuneDeadHurt, ref prm);

                                _hurtValue = 0;
                            }
                        }
                        else
                        {
                            SkillUseContext context2 = new SkillUseContext();
                            context2.SetOriginator(_hurt.atker);
                            actor.SkillControl.SpawnBuff(actor.SelfPtr, context2, inSkillCombineId, true);
                            this.buffHolder.RemoveBuff(inBuff);
                            _hurtValue = 0;
                        }
                    }
                    if (((_hurt.atkSlot == SkillSlotType.SLOT_SKILL_0) && (inBuff != null)) && inBuff.FindSkillFunc(0x43, out outSkillFunc))
                    {
                        int num4 = inBuff.CustomParams[0];
                        int num5 = inBuff.CustomParams[4];
                        switch (num4)
                        {
                        case 1:
                            _hurtValue = (_hurtValue * (0x2710 - num5)) / 0x2710;
                            break;

                        case 0:
                            _hurtValue -= num5;
                            break;
                        }
                    }
                }
            }
            return(_hurtValue);
        }
예제 #10
0
        public PoolObjHandle <ActorRoot> GetTargetActor()
        {
            SkillUseContext skillUseContext = this.GetSkillUseContext();

            if (skillUseContext == null)
            {
                return(new PoolObjHandle <ActorRoot>(null));
            }
            return(skillUseContext.TargetActor);
        }
예제 #11
0
 public void SetCacheSkillContext(IFrameCommand cmd, SkillUseContext _context)
 {
     if (this.cacheSkill)
     {
         this.cacheSkillCommand  = cmd;
         this.cacheSkillContext  = _context;
         this.bCacheCommonAttack = false;
         this.cacheSkillExpire   = false;
     }
 }
예제 #12
0
 private void EnableEquipBuff(CEquipBuffInfo equipBuffInfo)
 {
     if (!equipBuffInfo.m_isEnabled)
     {
         SkillUseContext inContext = new SkillUseContext();
         inContext.SetOriginator(base.actorPtr);
         base.actor.SkillControl.SpawnBuff(base.actorPtr, inContext, (int)equipBuffInfo.m_buffID, false);
         equipBuffInfo.m_isEnabled = true;
     }
 }
예제 #13
0
 public bool Use(PoolObjHandle <ActorRoot> user, SkillUseContext context)
 {
     base.skillContext.Copy(context);
     base.skillContext.Instigator = this;
     DebugHelper.Assert((bool)base.skillContext.Originator);
     if (!base.Use(user))
     {
         return(false);
     }
     return(true);
 }
예제 #14
0
 private bool CheckUseRule(SkillUseContext context)
 {
     if (context.TargetActor.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_ImmuneNegative) && ((this.cfgData.dwEffectType == 1) || (this.cfgData.dwEffectType == 2)))
     {
         return(false);
     }
     if (context.TargetActor.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_ImmuneControl) && (this.cfgData.dwEffectType == 2))
     {
         return(false);
     }
     return(true);
 }
예제 #15
0
 public override void OnUse()
 {
     base.OnUse();
     this.overlayCount = 0;
     this.controlTime  = 0L;
     Array.Clear(this.CustomParams, 0, this.CustomParams.Length);
     this.bExtraBuff   = false;
     this.cfgData      = null;
     this.battleParam  = null;
     this.skillContext = null;
     this.ulStartTime  = 0L;
 }
예제 #16
0
 public void Trigger(PoolObjHandle <ActorRoot> _originator, SkillUseContext inUseContext)
 {
     if (this.immuneTime == 0)
     {
         if (this.cfgData != null && this.cfgData.bLayerEffect == 1)
         {
             this.skillContext.MarkCount = this.curLayer;
         }
         this.DecLayer(this.cfgData.iCostLayer);
         this.immuneTime = this.cfgData.iImmuneTime;
         this.TriggerAction(_originator, inUseContext);
     }
 }
예제 #17
0
        private void TriggerAction(PoolObjHandle <ActorRoot> _originator, SkillUseContext inUseContext)
        {
            SkillUseParam skillUseParam = default(SkillUseParam);

            skillUseParam.Init();
            skillUseParam.SetOriginator(_originator);
            skillUseParam.TargetActor = this.sourceActor;
            if (inUseContext != null)
            {
                skillUseParam.bExposing = inUseContext.bExposing;
            }
            this.Use(_originator, ref skillUseParam);
        }
예제 #18
0
        public void RecoverClearBuff()
        {
            int inSkillCombineId = 0;

            for (int i = 0; i < this.CacheBufferList.Count; i++)
            {
                inSkillCombineId = this.CacheBufferList[i];
                SkillUseContext inContext = new SkillUseContext();
                inContext.SetOriginator(this.buffHolder.actorPtr);
                this.buffHolder.actor.SkillControl.SpawnBuff(this.buffHolder.actorPtr, inContext, inSkillCombineId, false);
            }
            this.CacheBufferList.Clear();
        }
예제 #19
0
 public override bool Use(PoolObjHandle <ActorRoot> user, SkillUseContext context)
 {
     if (context != null)
     {
         context.Instigator = this;
         DebugHelper.Assert((bool)context.Originator);
     }
     if (!base.Use(user, context))
     {
         return(false);
     }
     return(true);
 }
예제 #20
0
 private SkillUseContext(SkillUseContext rhs)
 {
     this.GatherTime  = 1;
     this.SlotType    = rhs.SlotType;
     this.AppointType = rhs.AppointType;
     this.TargetID    = rhs.TargetID;
     this.UseVector   = rhs.UseVector;
     this.EndVector   = rhs.EndVector;
     this.TargetActor = rhs.TargetActor;
     this.Originator  = rhs.Originator;
     this.Instigator  = rhs.Instigator;
     this.bSpecialUse = rhs.bSpecialUse;
     this.GatherTime  = rhs.GatherTime;
 }
예제 #21
0
        protected void Trigger()
        {
            SkillUseContext context = new SkillUseContext(this.passiveSkill.SlotType);

            context.SetOriginator(this.sourceActor);
            if (this.triggerActor == 0)
            {
                context.TargetActor = this.sourceActor;
            }
            else
            {
                context.TargetActor = this.triggerActor;
            }
            this.passiveSkill.Use(this.sourceActor, context);
            this.deltaTime = this.cfgData.iCoolDown;
        }
예제 #22
0
        private void TriggerAction(PoolObjHandle <ActorRoot> _originator, SkillUseContext inUseContext, int triggerLayer)
        {
            SkillUseParam skillUseParam = default(SkillUseParam);

            skillUseParam.Init();
            skillUseParam.SetOriginator(_originator);
            skillUseParam.TargetActor = this.sourceActor;
            if (inUseContext != null)
            {
                skillUseParam.bExposing    = inUseContext.bExposing;
                skillUseParam.uiFromId     = inUseContext.uiFromId;
                skillUseParam.skillUseFrom = inUseContext.skillUseFrom;
                skillUseParam.MarkCount    = triggerLayer;
            }
            this.Use(_originator, ref skillUseParam);
        }
예제 #23
0
 public void Copy(SkillUseContext rhs)
 {
     this.SlotType    = rhs.SlotType;
     this.AppointType = rhs.AppointType;
     this.TargetID    = rhs.TargetID;
     this.UseVector   = rhs.UseVector;
     this.EndVector   = rhs.EndVector;
     this.EffectPos   = rhs.EffectPos;
     this.EffectDir   = rhs.EffectDir;
     this.BulletPos   = rhs.BulletPos;
     this.TargetActor = rhs.TargetActor;
     this.Originator  = rhs.Originator;
     this.Instigator  = rhs.Instigator;
     this.bSpecialUse = rhs.bSpecialUse;
     this.GatherTime  = rhs.GatherTime;
     this.EffectCount = rhs.EffectCount;
     this.MarkCount   = rhs.MarkCount;
 }
예제 #24
0
        public PoolObjHandle <BulletSkill> SpawnBullet(SkillUseContext context, string _actionName, bool _bDeadRemove)
        {
            PoolObjHandle <BulletSkill> handle = new PoolObjHandle <BulletSkill>();

            if (context != null)
            {
                BulletSkill item = ClassObjPool <BulletSkill> .Get();

                item.Init(_actionName, _bDeadRemove);
                if (item.Use(base.actorPtr, context.Clone()))
                {
                    this.SpawnedBullets.Add(item);
                    return(new PoolObjHandle <BulletSkill>(item));
                }
                item.Release();
            }
            return(handle);
        }
예제 #25
0
 public override bool Use(PoolObjHandle <ActorRoot> user, SkillUseContext context)
 {
     if (context != null)
     {
         context.SetOriginator(user);
         context.Instigator = user;
     }
     if (!base.Use(user, context))
     {
         return(false);
     }
     this.skillAbort.InitAbort(false);
     this.bDelayAbortSkill   = false;
     this.bProtectAbortSkill = false;
     if ((context != null) && (context.SlotType == SkillSlotType.SLOT_SKILL_0))
     {
         this.SetSkillSpeed(user);
     }
     return(true);
 }
예제 #26
0
 public void AutoTrigger(PoolObjHandle <ActorRoot> _originator, SkillUseContext inUseContext)
 {
     if (this.curLayer + 1 >= this.cfgData.iMaxLayer && this.cfgData.bAutoTrigger == 1)
     {
         if (this.triggerCDTime == 0)
         {
             this.AddLayer(1);
             this.triggerCDTime = this.cfgData.iCDTime;
             this.Trigger(_originator, inUseContext);
         }
         else
         {
             this.curTime = 0;
         }
     }
     else
     {
         this.AddLayer(1);
     }
 }
예제 #27
0
        public bool SpawnBuff(PoolObjHandle <ActorRoot> inTargetActor, SkillUseContext inContext, int inSkillCombineId, bool bExtraBuff = false)
        {
            if (((inTargetActor == 0) || (inContext == null)) || (inSkillCombineId <= 0))
            {
                return(false);
            }
            BuffSkill skill = ClassObjPool <BuffSkill> .Get();

            skill.Init(inSkillCombineId);
            skill.bExtraBuff = bExtraBuff;
            skill.skillContext.Copy(inContext);
            skill.skillContext.TargetActor = inTargetActor;
            skill.skillContext.Instigator  = base.actor;
            bool flag = skill.Use(base.actorPtr);

            if (!flag)
            {
                skill.Release();
            }
            return(flag);
        }
예제 #28
0
        public bool Use()
        {
            BuffSkill inBuff = ClassObjPool <BuffSkill> .Get();

            inBuff.Init(this.BuffID);
            if (inBuff.cfgData == null)
            {
                inBuff.Release();
                return(false);
            }
            SkillUseContext context = new SkillUseContext(SkillSlotType.SLOT_SKILL_VALID, this.TargetActor.handle.ObjID);

            context.SetOriginator(this.SrcActor);
            if (!inBuff.Use(this.SrcActor, context))
            {
                inBuff.Release();
                return(false);
            }
            this.buffSkill = new BuffFense(inBuff);
            return(true);
        }
예제 #29
0
        private bool InternalUseSkill(SkillUseContext context, bool bImmediate = false)
        {
            SkillSlot slot;

            if (context == null)
            {
                return(false);
            }
            if (!this.TryGetSkillSlot(context.SlotType, out slot))
            {
                return(false);
            }
            slot.ReadySkillObj();
            Skill skillObj = slot.SkillObj;

            if (!skillObj.Use(base.actorPtr, context))
            {
                return(false);
            }
            if (!bImmediate)
            {
                this.CurUseSkill     = skillObj;
                this.CurUseSkillSlot = slot;
            }
            this.SkillInfoStatistic(ref slot);
            this.bIsLastAtkUseSkill = this.bIsCurAtkUseSkill;
            if (context.SlotType == SkillSlotType.SLOT_SKILL_0)
            {
                this.bIsCurAtkUseSkill = false;
            }
            else
            {
                this.bIsCurAtkUseSkill = true;
            }
            ActorSkillEventParam param = new ActorSkillEventParam(base.GetActor(), context.SlotType);

            Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.Event_UseSkill, base.GetActor(), ref param, GameSkillEventChannel.Channel_AllActor);

            return(true);
        }
 public void Copy(SkillUseContext rhs)
 {
     this.SlotType    = rhs.SlotType;
     this.AppointType = rhs.AppointType;
     this.TargetID    = rhs.TargetID;
     this.UseVector   = rhs.UseVector;
     this.EndVector   = rhs.EndVector;
     this.EffectPos   = rhs.EffectPos;
     this.EffectDir   = rhs.EffectDir;
     this.BulletPos   = rhs.BulletPos;
     this.TargetActor = rhs.TargetActor;
     this.Originator  = rhs.Originator;
     this.Instigator  = rhs.Instigator;
     this.bSpecialUse = rhs.bSpecialUse;
     this.GatherTime  = rhs.GatherTime;
     this.EffectCount = rhs.EffectCount;
     this.EffectCountInSingleTrigger = rhs.EffectCountInSingleTrigger;
     this.MarkCount    = rhs.MarkCount;
     this.bExposing    = rhs.bExposing;
     this.skillUseFrom = rhs.skillUseFrom;
     this.uiFromId     = rhs.uiFromId;
 }