예제 #1
0
        private void RequestUseSkillGeneralMode()
        {
            bool  flag  = false;
            Skill skill = (this.NextSkillObj == null) ? this.SkillObj : this.NextSkillObj;

            this.skillIndicator.SetFixedPrefabShow(false);
            this.skillIndicator.SetGuildPrefabShow(false);
            this.skillIndicator.SetGuildWarnPrefabShow(false);
            if (((Time.realtimeSinceStartup - this.keyPressTime) >= 0.1f) && (((skill != null) && (skill.cfgData != null)) && this.IsEnableSkillSlot()))
            {
                if (Singleton <SkillDetectionControl> .GetInstance().Detection((SkillUseRule)skill.cfgData.dwSkillUseRule, this))
                {
                    flag = this.SendRequestUseSkill();
                    if (flag)
                    {
                        this.keyPressTime = Time.realtimeSinceStartup;
                    }
                }
                if (!flag)
                {
                    ActorSkillEventParam param = new ActorSkillEventParam(this.Actor, SkillSlotType.SLOT_SKILL_0);
                    Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.Event_NoSkillTarget, this.Actor, ref param, GameSkillEventChannel.Channel_HostCtrlActor);
                }
            }
        }
 private void onActorUseSkill(ref ActorSkillEventParam _prm)
 {
     if (this.localParams[1] == 1)
     {
         if (!this.sourceActor || this.sourceActor.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)
         {
             return;
         }
         HeroWrapper heroWrapper = this.sourceActor.handle.ActorControl as HeroWrapper;
         if (heroWrapper == null || heroWrapper.GetCallActor() != _prm.src)
         {
             return;
         }
     }
     else if (_prm.src != this.sourceActor)
     {
         return;
     }
     if (this.localParams[0] == 0)
     {
         this.bTrigger = true;
     }
     else if ((this.localParams[0] & 1 << (int)_prm.slot) > 0)
     {
         this.bTrigger = true;
     }
 }
예제 #3
0
 public void SendSkillShortageEvent()
 {
     if (!this.IsEnergyEnough)
     {
         ActorSkillEventParam param = new ActorSkillEventParam(this.Actor, SkillSlotType.SLOT_SKILL_0);
         Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.Enent_EnergyShortage, this.Actor, ref param, GameSkillEventChannel.Channel_HostCtrlActor);
     }
 }
예제 #4
0
 public void SendSkillCooldownEvent()
 {
     if (!this.IsCDReady)
     {
         ActorSkillEventParam param = new ActorSkillEventParam(this.Actor, SkillSlotType.SLOT_SKILL_0);
         Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.Event_SkillCooldown, this.Actor, ref param, GameSkillEventChannel.Channel_HostCtrlActor);
     }
 }
예제 #5
0
        public bool ImmuneDamage(ref HurtDataInfo hurt)
        {
            if (((hurt.atkSlot == SkillSlotType.SLOT_SKILL_0) && (hurt.atker != 0)) && ((hurt.atker.handle.ActorControl != null) && hurt.atker.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Blindness)))
            {
                ActorSkillEventParam param = new ActorSkillEventParam(hurt.target, SkillSlotType.SLOT_SKILL_0);
                Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.AllEvent_Blindess, hurt.target, ref param, GameSkillEventChannel.Channel_AllActor);

                return(true);
            }
            return((hurt.target != 0) && hurt.target.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_ImmuneNegative));
        }
예제 #6
0
 public void SendProtectEvent(int type, int changeValue)
 {
     if (changeValue != 0)
     {
         this.protectValue += changeValue;
         this.buffHolder.actor.ActorControl.OnShieldChange(type, changeValue);
         if (this.protectValue == 0)
         {
             ActorSkillEventParam actorSkillEventParam = new ActorSkillEventParam(this.buffHolder.actorPtr, SkillSlotType.SLOT_SKILL_0);
             Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.Event_ProtectDisappear, this.buffHolder.actorPtr, ref actorSkillEventParam, GameSkillEventChannel.Channel_HostCtrlActor);
         }
     }
 }
예제 #7
0
 private void onActorUseSkill(ref ActorSkillEventParam _prm)
 {
     if (_prm.src == base.sourceActor)
     {
         if (base.localParams[0] == 0)
         {
             this.bTrigger = true;
         }
         else if ((base.localParams[0] & (((int)1) << _prm.slot)) > 0)
         {
             this.bTrigger = true;
         }
     }
 }
예제 #8
0
 private void onActorUseSkill(ref ActorSkillEventParam _prm)
 {
     if (_prm.src != this.sourceActor)
     {
         return;
     }
     if (this.localParams[0] == 0)
     {
         this.bTrigger = true;
     }
     else if ((this.localParams[0] & 1 << (int)_prm.slot) > 0)
     {
         this.bTrigger = true;
     }
 }
예제 #9
0
 private void onUseSkill(ref ActorSkillEventParam prm)
 {
     if (ActorHelper.IsHostCtrlActor(ref prm.src))
     {
         int length = this.TriggerMatches.Length;
         for (int i = 0; i < length; i++)
         {
             CTriggerMatch match = this.TriggerMatches[i];
             if (match != null)
             {
                 PoolObjHandle<ActorRoot> src = new PoolObjHandle<ActorRoot>(null);
                 PoolObjHandle<ActorRoot> atker = new PoolObjHandle<ActorRoot>(null);
                 if (this.FilterMatch(EGlobalGameEvent.UseSkill, match, src, atker, (ActorSkillEventParam) prm, i))
                 {
                     this.DoTriggering(match, src, atker, (ActorSkillEventParam) prm);
                 }
             }
         }
     }
 }
예제 #10
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);
        }
        private bool InternalUseSkill(ref SkillUseParam param, bool bImmediate = false)
        {
            SkillSlot skillSlot;

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

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

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

            return(true);
        }
예제 #12
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);
                    }
                }
            }
        }
예제 #13
0
        public bool FilterMatch(EGlobalGameEvent inEventType, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, object param, CTriggerMatch match, int inMatchIndex)
        {
            if (!this.CheckDifficulty())
            {
                return(false);
            }
            if (((this.GlobalVariable != 0) && (Singleton <BattleLogic> .instance.m_globalTrigger != null)) && (this.GlobalVariable != Singleton <BattleLogic> .instance.m_globalTrigger.CurGlobalVariable))
            {
                return(false);
            }
            if (this.bCaptainSrc && ((src == 0) || (src != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.bCaptainAtker && ((atker == 0) || (atker != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.SrcActorCond != null)
            {
                foreach (STriggerCondActor actor in this.SrcActorCond)
                {
                    if (!actor.FilterMatch(ref src))
                    {
                        return(false);
                    }
                }
            }
            if (this.AtkerActorCond != null)
            {
                foreach (STriggerCondActor actor2 in this.AtkerActorCond)
                {
                    if (!actor2.FilterMatch(ref atker))
                    {
                        return(false);
                    }
                }
            }
            switch (inEventType)
            {
            case EGlobalGameEvent.SpawnGroupDead:
            {
                if (match.Originator == null)
                {
                    break;
                }
                CommonSpawnGroup component = match.Originator.GetComponent <CommonSpawnGroup>();
                SpawnGroup       group2    = match.Originator.GetComponent <SpawnGroup>();
                if ((component == null) || (component == (param as CommonSpawnGroup)))
                {
                    if ((group2 == null) || (group2 == (param as SpawnGroup)))
                    {
                        break;
                    }
                    return(false);
                }
                return(false);
            }

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

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

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

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

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

            case EGlobalGameEvent.SkillUseCanceled:
            {
                DefaultSkillEventParam param3 = (DefaultSkillEventParam)param;
                if (param3.slot == this.skillSlot)
                {
                    break;
                }
                return(false);
            }
            }
            return(true);
        }
예제 #14
0
        public int TakeDamage(ref HurtDataInfo hurt)
        {
            int nAddHp  = 0;
            int actorHp = 0;
            int num3    = this.CriticalDamagePart(ref hurt);
            int num4    = 0x26ac + FrameRandom.Random(200);

            base.actor.BuffHolderComp.OnDamageExtraValueEffect(ref hurt, hurt.atker, hurt.atkSlot);
            if (hurt.hurtType == HurtTypeDef.Therapic)
            {
                nAddHp = (this.CommonDamagePart(ref hurt) * num4) / 0x2710;
                if (hurt.iAddTotalHurtType == 1)
                {
                    nAddHp += (nAddHp * hurt.iAddTotalHurtValue) / 0x2710;
                }
                else
                {
                    nAddHp += hurt.iAddTotalHurtValue;
                }
                actorHp = base.actor.ValueComponent.actorHp;
                base.actor.ActorControl.ReviveHp(nAddHp);
                actorHp = base.actor.ValueComponent.actorHp - actorHp;
            }
            else
            {
                if (((hurt.atkSlot == SkillSlotType.SLOT_SKILL_0) && (hurt.atker != 0)) && ((hurt.atker.handle.ActorControl != null) && hurt.atker.handle.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_Blindness)))
                {
                    ActorSkillEventParam param = new ActorSkillEventParam(hurt.target, SkillSlotType.SLOT_SKILL_0);
                    Singleton <GameSkillEventSys> .GetInstance().SendEvent <ActorSkillEventParam>(GameSkillEventDef.Event_Blindess, hurt.target, ref param, GameSkillEventChannel.Channel_AllActor);

                    return(0);
                }
                bool flag = (hurt.atker != 0) && hurt.atker.handle.bOneKiller;
                int  num5 = base.actor.ValueComponent.actorHp;
                nAddHp = (((((((this.CommonDamagePart(ref hurt) * (0x2710 - this.ReduceDamagePart(ref hurt, hurt.hurtType))) / 0x2710) * (0x2710 + num3)) / 0x2710) * num4) / 0x2710) + hurt.attackInfo.iFinalHurt) - base.actor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_REALHURTLESS].totalValue;
                nAddHp = (nAddHp * (0x2710 - base.actor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_PROPERTY_HURTREDUCERATE].totalValue)) / 0x2710;
                int extraHurtOutputRate = base.actor.BuffHolderComp.GetExtraHurtOutputRate(hurt.atker);
                nAddHp = ((nAddHp * ((0x2710 + hurt.attackInfo.iHurtOutputRate) + extraHurtOutputRate)) / 0x2710) * hurt.gatherTime;
                if (nAddHp < 0)
                {
                    nAddHp = 0;
                }
                if (hurt.atker != 0)
                {
                    nAddHp = (nAddHp * Singleton <BattleLogic> .GetInstance().clashAddition.CalcDamageAddition(hurt.atker.handle.TheStaticData.TheBaseAttribute.ClashMark, base.actor.TheStaticData.TheBaseAttribute.ClashMark)) / 0x2710;
                }
                nAddHp = base.actor.BuffHolderComp.OnDamage(ref hurt, nAddHp);
                this.Hemophagia(ref hurt, nAddHp);
                actorHp = base.actor.ValueComponent.actorHp;
                base.actor.ValueComponent.actorHp -= nAddHp;
                actorHp = base.actor.ValueComponent.actorHp - actorHp;
                if (flag)
                {
                    base.actor.ValueComponent.actorHp = 0;
                    actorHp = num5 * -1;
                }
                if (((hurt.atker != 0) && (base.actor.TheActorMeta.ActorCamp != hurt.atker.handle.TheActorMeta.ActorCamp)) && (base.actor.ValueComponent.actorHp > 0))
                {
                    base.actor.ActorControl.AddHurtSelfActor(hurt.atker);
                }
            }
            HurtEventResultInfo prm = new HurtEventResultInfo(base.GetActor(), hurt.atker, hurt, nAddHp, actorHp, num3);

            Singleton <GameEventSys> .instance.SendEvent <HurtEventResultInfo>(GameEventDef.Event_ActorDamage, ref prm);

            return(actorHp);
        }