コード例 #1
0
        private void DoSuperBody(byte nSLV)
        {
            var tDurationMillis = 60000;
            int superBodySkillID;

            // set only if-statements instead of else-if statements if we enable stackable auras
            if (Parent.Buffs.Contains((int)Skills.BMAGE_AURA_BLUE) || Parent.Buffs.Contains((int)Skills.BMAGE_AURA_BLUE_ADVANCED))
            {
                tDurationMillis  = 10000;
                superBodySkillID = (int)Skills.BMAGE_SUPER_BODY_BLUE;
            }
            else if (Parent.Buffs.Contains((int)Skills.BMAGE_AURA_DARK) || Parent.Buffs.Contains((int)Skills.BMAGE_AURA_DARK_ADVANCED))
            {
                superBodySkillID = (int)Skills.BMAGE_SUPER_BODY_DARK;
            }
            else if (Parent.Buffs.Contains((int)Skills.BMAGE_AURA_YELLOW) || Parent.Buffs.Contains((int)Skills.BMAGE_AURA_YELLOW_ADVANCED))
            {
                superBodySkillID = (int)Skills.BMAGE_SUPER_BODY_YELLOW;
            }
            else
            {
                throw new InvalidOperationException("Trying to cast super body when no auras are active.");
            }

            var auraBoost = new BuffSkill(superBodySkillID, nSLV);

            auraBoost.GenerateAuraSkill(SecondaryStatFlag.SuperBody, tDurationMillis);
            Parent.Buffs.Add(auraBoost);
        }
コード例 #2
0
        public void Leave(Action _action, Track _track)
        {
            if (this.bTriggerMode && this.attackActor)
            {
                int count = this.TriggeredBuffContextList.get_Count();
                for (int i = 0; i < count; i++)
                {
                    HitTriggerDurationContext.STriggeredBuffContext sTriggeredBuffContext = this.TriggeredBuffContextList.get_Item(i);
                    if (sTriggeredBuffContext.actor)
                    {
                        this.attackActor.get_handle().SkillControl.RemoveBuff(sTriggeredBuffContext.actor, sTriggeredBuffContext.buffId);
                    }
                }
                this.TriggeredBuffContextList.Clear();
            }
            int count2 = this.RemoveSkillList.get_Count();

            for (int j = 0; j < this.RemoveSkillList.get_Count(); j++)
            {
                BuffSkill buffSkill = this.RemoveSkillList.get_Item(j);
                if (buffSkill != null && !buffSkill.isFinish)
                {
                    if (buffSkill.skillContext.TargetActor)
                    {
                        buffSkill.skillContext.TargetActor.get_handle().BuffHolderComp.RemoveBuff(buffSkill);
                    }
                }
            }
            this.RemoveSkillList.Clear();
        }
コード例 #3
0
        private void InitContext(Action _action)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(1);
            PoolObjHandle <ActorRoot> handle2     = _action.GetActorHandle(0);

            if ((actorHandle != 0) && (handle2 != 0))
            {
                SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                BuffSkill       skill          = _action.refParams.GetRefParamObject <BuffSkill>("SkillObj");
                ResDT_SkillFunc outSkillFunc   = null;
                if ((skill != null) && skill.FindSkillFunc((int)this.SkillFuncType, out outSkillFunc))
                {
                    this.m_context.inTargetObj  = actorHandle;
                    this.m_context.inOriginator = handle2;
                    this.m_context.inUseContext = refParamObject;
                    this.m_context.inSkillFunc  = outSkillFunc;
                    this.m_context.LocalParams  = new ResDT_IntParamArrayNode[6];
                    for (int i = 0; i < 6; i++)
                    {
                        this.m_context.LocalParams[i]        = new ResDT_IntParamArrayNode();
                        this.m_context.LocalParams[i].iParam = 0;
                    }
                    this.m_context.inAction       = _action;
                    this.m_context.inBuffSkill    = new PoolObjHandle <BuffSkill>(skill);
                    this.m_context.inDoCount      = 0;
                    this.m_context.inOverlayCount = skill.GetOverlayCount();
                    this.m_context.inLastEffect   = true;
                    this.m_context.InitSkillFuncContext();
                    this.bInit = true;
                }
            }
        }
コード例 #4
0
    protected override BuffSkill Createbuff()
    {
        Buff b = new Buff(PrimaryAttributeName.Luck, Buff.BuffType.Absolute, 0);

        b.onBuff = (tar) => {
            if (tar is NPCController)
            {
                (tar as NPCController).AttackTo(user.transform);
            }
        };
        b.endBuff = (tar) => {
            if (tar && user && tar is NPCController)
            {
                (tar as NPCController).RemoveAttackTo(user.transform);
            }
        };
        BuffSkill sk = new BuffSkill(SkillName.Taunt, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 3f, new Buff[] {
            b,
            new Buff(SecondaryAttributeName.PhysicalDeffence, Buff.BuffType.Relative, -.2f),
            new Buff(SecondaryAttributeName.PhysicalDamage, Buff.BuffType.Relative, -.2f)
        });

        sk.effect = DebuffEffectPrefab;
        return(sk);
    }
コード例 #5
0
    // ================================= BUFF RELATED ====================================

    // -----------------------------------------------------------------------------------
    // UCE_ApplyBuff
    // -----------------------------------------------------------------------------------
    public virtual void UCE_ApplyBuff(BuffSkill buff, int level = 1, float successChance = 1f, float modifier = 0f)
    {
        if (buff == null || successChance <= 0)
        {
            return;
        }

        // -- check for buff/nerf blocking

        if (
            (buff.disadvantageous && skills.buffs.Any(x => x.blockNerfs)) ||
            (!buff.disadvantageous && skills.buffs.Any(x => x.blockBuffs))
            )
        {
            return;
        }

        // -- check apply chance and apply

        if (UCE_CheckChance(successChance, modifier))
        {
            skills.AddOrRefreshBuff(new Buff(buff, level));
            UCE_SpawnEffect(this, buff);
        }
    }
コード例 #6
0
    protected override BuffSkill Createbuff()
    {
        Buff b = new Buff(PrimaryAttributeName.Luck, Buff.BuffType.Absolute, 0);

        b.onBuff = (tar) => {
            if (tar is BaseCharacterBehavior)
            {
                (tar as BaseCharacterBehavior).OnDamaged += HealingShield_OnDamaged;
            }
            ;
        };
        b.endBuff = (tar) => {
            if (tar && user && tar is BaseCharacterBehavior)
            {
                (tar as BaseCharacterBehavior).OnDamaged -= HealingShield_OnDamaged;
            }
        };
        BuffSkill sk = new BuffSkill(SkillName.HealingShield, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 3f, new Buff[] {
            b,
            new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, -.5f)
        });

        sk.effect = DebuffEffectPrefab;
        return(sk);
    }
コード例 #7
0
ファイル: BuffSkill.cs プロジェクト: tarikkarsi/PAPIOnline
        public override IBuffSkill CloneBuffSkill()
        {
            BuffSkill clone = new BuffSkill();

            CloneAbstractBuffSkill(clone);
            return(clone);
        }
コード例 #8
0
        private void DoDice(int nSkillID, byte nSLV)
        {
            Parent.Buffs.Remove(nSkillID);

            var newBuff = new BuffSkill(nSkillID, nSLV);

            newBuff.State = (byte)(Constants.Rand.Next(6) + 1);

            var effect = new UserEffectPacket(UserEffect.SkillAffectedSelect)
            {
                nSelect  = (byte)newBuff.State,
                nSkillID = nSkillID,
                nSLV     = nSLV
            };

            effect.BroadcastEffect(Parent);

            if (newBuff.State <= 1)
            {
                return;
            }

            newBuff.GenerateDice();

            Parent.Buffs.Add(newBuff);
        }
コード例 #9
0
    new protected void CopyDataFrom(Skill from)
    {
        base.CopyDataFrom(from);
        BuffSkill a = from as BuffSkill;

        m_sourceUnit = a.m_sourceUnit;
        m_appendBuff = a.m_appendBuff;
    }
コード例 #10
0
    protected virtual void giveCharacterBuff(BaseCharacterBehavior character)
    {
        int  stationCount = 1;
        bool isGarrisoner = false;

        for (int i = 0; i < stationNPC.Length; i++)
        {
            if (stationNPC[i] != null && stationNPC[i].IsInGarrison)
            {
                stationCount++;
                if (stationNPC[i] == character)
                {
                    isGarrisoner = true;
                }
            }
        }

        if (Tags.IsCompanion(this, character))
        {
            //Buff
            //全第一屬性+5% *駐防數+1
            //生命回復+50%,能量/法力回復+10% * 駐防數+1
            //視野400%(駐防者)/200%(一般)
            //造成傷害+10%(駐防者)/+5%(一般) * 駐防數+1
            //傷害降低 塔的傷害降低的一半(駐防者)/(5%*駐防數+1)
            BuffSkill buff = new BuffSkill(SkillName.WarBlessing, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] {
                new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, .05f * stationCount),
                new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, .05f * stationCount),
                new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, .05f * stationCount),
                new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, .05f * stationCount),
                new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, .05f * stationCount),
                new Buff(SecondaryAttributeName.HealthRecoverRate, Buff.BuffType.Relative, .5f * stationCount),
                new Buff(SecondaryAttributeName.EnergyRecoverRate, Buff.BuffType.Relative, .1f * stationCount),
                new Buff(SecondaryAttributeName.ManaRecoverRate, Buff.BuffType.Relative, .1f * stationCount),
                new Buff(SecondaryAttributeName.Vision, Buff.BuffType.Relative, isGarrisoner?3f: 1f),
                new Buff(StaticAttributeName.DamageMake, Buff.BuffType.Absolute, (isGarrisoner?.1f : .05f) * stationCount),
                new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, -(isGarrisoner?DamageReduce : .05f * stationCount))
            }, false);
            buff.SetCaster(character);
            buff.Cast(character);
        }
        else
        {
            //Debuff
            //全第一屬性-5% *1+駐防數
            //受到傷害+3% * 駐防數
            BuffSkill buff = new BuffSkill(SkillName.WarRepression, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] {
                new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, -.05f * stationCount),
                new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, -.05f * stationCount),
                new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, -.05f * stationCount),
                new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, -.05f * stationCount),
                new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, -.05f * stationCount),
                new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, .03f * (stationCount - 1))
            }, false);
            buff.SetCaster(character);
            buff.Cast(character);
        }
    }
コード例 #11
0
    public virtual void RemoveBuff(SkillName buff)
    {
        BuffSkill bsk = buffs.Find(b => b.skillName == buff);

        if (bsk != null)
        {
            bsk.RemoveBuff(this);
        }
    }
コード例 #12
0
 protected override void AddEffectOnWeaponHit(Damagable character)
 {
     if (character.GetComponent <BaseCharacterBehavior>() != null)
     {
         BuffSkill sk = CreateArmorBreakDebuff();
         sk.SetCaster(user);
         //Debug.Log(target.name + "on debuff");
         sk.Cast(character.GetComponent <BaseCharacterBehavior>());
     }
 }
コード例 #13
0
    // =================================== HELPERS =======================================

    // -----------------------------------------------------------------------------------
    // UCE_SpawnEffect
    // Same as SpawnEffect that is found in skill effects of the core asset. It has been
    // put here because its required for almost every skill. Prevents duplicate code.
    // -----------------------------------------------------------------------------------
    public void UCE_SpawnEffect(Entity caster, BuffSkill buff)
    {
        if (buff.effect != null)
        {
            GameObject go = Instantiate(buff.effect.gameObject, transform.position, Quaternion.identity);
            go.GetComponent <BuffSkillEffect>().caster   = caster;
            go.GetComponent <BuffSkillEffect>().target   = this;
            go.GetComponent <BuffSkillEffect>().buffName = buff.name;
            NetworkServer.Spawn(go);
        }
    }
コード例 #14
0
    protected override BuffSkill Createbuff()
    {
        BuffSkill sk = new BuffSkill(SkillName.Heal, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 6f, new Buff[] {
            new ConsumedStatusBuff(ConsumedAttributeName.Health, Buff.BuffType.Absolute, 0,
                                   healingMount,
                                   healingMount / 12, .5f),
        }, true);

        sk.effect = DebuffEffectPrefab;
        return(sk);
    }
コード例 #15
0
    public void AddBuff(BuffSkill buff)
    {
        buff.gameObject.SetActive(true);
        HpUI.PutBuffOnGrid(buff);
        buffDictionary.Add(buff.skillData.Name, buff);

        if (null != buffSkill)
        {
            buffSkill(buff, true);
        }
    }
コード例 #16
0
    protected override BuffSkill Createbuff()
    {
        BuffSkill sk = new BuffSkill(SkillName.Thander, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 6f, new Buff[] {
            new ConsumedStatusBuff(ConsumedAttributeName.Health, Buff.BuffType.Absolute, 0,
                                   0,
                                   0, 0f),
            new Buff(SecondaryAttributeName.MoveSpeed, Buff.BuffType.Relative, -.9f)
        }, false);

        sk.effect = DebuffEffectPrefab;
        return(sk);
    }
コード例 #17
0
    BuffSkill CreateArmorBreakDebuff()
    {
        BuffSkill sk = new BuffSkill(SkillName.ArmorBreak, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 9f, new Buff[] {
            new Buff(SecondaryAttributeName.PhysicalDeffence, Buff.BuffType.Relative, -.5f),
            new Buff(SecondaryAttributeName.MagicalDeffence, Buff.BuffType.Relative, -.5f),
            new Buff(SecondaryAttributeName.SkillDeffence, Buff.BuffType.Relative, -.5f),
            new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, -.5f)
        });

        sk.effect = DebuffEffectPrefab;
        return(sk);
    }
コード例 #18
0
 private void HandleTeleportMastery(int nSkillID, byte nSLV)
 {
     if (!Parent.Buffs.Contains(nSkillID))
     {
         var newBuff = new BuffSkill(nSkillID, nSLV);
         newBuff.Generate(0);
         Parent.Buffs.Add(newBuff);
     }
     else
     {
         Parent.Buffs.Remove(nSkillID);
     }
 }
コード例 #19
0
 // -----------------------------------------------------------------------------------
 // UCE_RemoveBuff
 // -----------------------------------------------------------------------------------
 public virtual void UCE_RemoveBuff(BuffSkill buff)
 {
     for (int i = 0; i < skills.buffs.Count; ++i)
     {
         if (skills.buffs[i].data == buff)
         {
             if (skills.buffs[i].data.cannotRemove)
             {
                 skills.buffs.RemoveAt(i);
                 return;
             }
         }
     }
 }
コード例 #20
0
        public void AddSkillBuff(int nSkillID, int nSLV, double durationMultiplier = 1.0, int nOption = 0)
        {
            if (nSkillID == (int)Skills.MECHANIC_SAFETY)
            {
                nOption = Parent.Stats.SecondaryStats.rBeholder;
            }

            if (GetOrDefault(nSkillID) is BuffSkill bs)
            {
                if (bs.nSLV < nSLV)
                {
                    bs.nSLV = (byte)nSLV;
                }

                bs.State = nOption;

                UpdateBuffInfo(bs);
            }
            else
            {
                var newBuff = new BuffSkill(nSkillID, (byte)nSLV);

                if (newBuff.Template.Morph > 0)
                {
                    newBuff.State = Parent.Stats.nGender;                     // haxed
                }

                newBuff.Generate(durationMultiplier);

                if (newBuff.StatType != SecondaryStatFlag.None_DONT_USE)                 // TODO phase this out
                {
                    RemoveIf(b => b.StatType == newBuff.StatType);
                }

                if (newBuff.Template.HasAffected)
                {
                    var effect = new UserEffectPacket(UserEffect.SkillAffected)
                    {
                        nSkillID = nSkillID,
                    };

                    effect.BroadcastEffect(Parent);
                }

                newBuff.State = nOption;

                Add(newBuff);
            }
        }
コード例 #21
0
        public SkillView(BuffSkill skill)
        {
            var powerValue = string.Empty;
            var sheets     = Game.Game.instance.TableSheets;
            var buffs      = BuffFactory.GetBuffs(skill, sheets.SkillBuffSheet, sheets.BuffSheet);

            if (buffs.Count > 0)
            {
                var buff = buffs[0];
                powerValue = buff.RowData.StatModifier.ToString();
            }

            iconSprite.Value = skill.SkillRow.GetIcon();
            name.Value       = skill.SkillRow.GetLocalizedName();
            power.Value      = $"{L10nManager.Localize("UI_SKILL_EFFECT")}: {powerValue}";
            chance.Value     = $"{L10nManager.Localize("UI_SKILL_CHANCE")}: {skill.Chance}%";
        }
コード例 #22
0
    // -----------------------------------------------------------------------------------
    // UCE_RemoveBuff
    // -----------------------------------------------------------------------------------
    public virtual void UCE_RemoveBuff(BuffSkill buff, float successChance = 1f, float modifier = 0f)
    {
        if (buff == null || successChance <= 0)
        {
            return;
        }

        for (int i = 0; i < skills.buffs.Count; ++i)
        {
            if (skills.buffs[i].data == buff && UCE_CheckChance(successChance, modifier))
            {
                if (!skills.buffs[i].data.cannotRemove)
                {
                    skills.buffs.RemoveAt(i);
                    return;
                }
            }
        }
    }
コード例 #23
0
 protected override void giveCharacterBuff(BaseCharacterBehavior character)
 {
     if (Tags.IsCompanion(this, character))
     {
         //Buff
         //全第一屬性+5% *駐防數+1
         //生命回復+50%,能量/法力回復+10% * 駐防數+1
         //視野400%(駐防者)/200%(一般)
         //造成傷害+10%(駐防者)/+5%(一般) * 駐防數+1
         //傷害降低 塔的傷害降低的一半(駐防者)/(5%*駐防數+1)
         BuffSkill buff = new BuffSkill(SkillName.WarBlessing, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] {
             new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, .2f),
             new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, .2f),
             new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, .2f),
             new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, .2f),
             new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, .2f),
             new Buff(SecondaryAttributeName.HealthRecoverRate, Buff.BuffType.Relative, 2f),
             new Buff(SecondaryAttributeName.EnergyRecoverRate, Buff.BuffType.Relative, .4f),
             new Buff(SecondaryAttributeName.ManaRecoverRate, Buff.BuffType.Relative, .4f),
             new Buff(SecondaryAttributeName.Vision, Buff.BuffType.Relative, 3f),
             new Buff(StaticAttributeName.DamageMake, Buff.BuffType.Absolute, .4f),
             new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, -.2f)
         }, false);
         buff.SetCaster(character);
         buff.Cast(character);
     }
     else
     {
         //Debuff
         //全第一屬性-5% *1+駐防數
         //受到傷害+3% * 駐防數
         BuffSkill buff = new BuffSkill(SkillName.WarRepression, 0, 0, 0, 0, 0, ConsumedAttributeName.Health, 0, 15f, new Buff[] {
             new Buff(PrimaryAttributeName.Power, Buff.BuffType.Relative, -.2f),
             new Buff(PrimaryAttributeName.Agility, Buff.BuffType.Relative, -.2f),
             new Buff(PrimaryAttributeName.Constitution, Buff.BuffType.Relative, -.2f),
             new Buff(PrimaryAttributeName.Wisdom, Buff.BuffType.Relative, -.2f),
             new Buff(PrimaryAttributeName.Spirit, Buff.BuffType.Relative, -.2f),
             new Buff(StaticAttributeName.DamageTakeFix, Buff.BuffType.Absolute, .1f)
         }, false);
         buff.SetCaster(character);
         buff.Cast(character);
     }
 }
コード例 #24
0
        public void AddAura(SecondaryStatFlag nType, int dwCharIdFrom, int nAuraSkillID, int nAuraLevel)
        {
            // TODO fuse removal logic with SecondaryStatValues class
            AbstractBuff existingBuff = null;

            foreach (var buff in this)
            {
                if (buff.StatType == nType)
                {
                    if (nAuraSkillID == buff.nSkillID)
                    {
                        if (buff.nSLV >= nAuraLevel)
                        {
                            return;
                        }
                    }
                    existingBuff = buff;
                    break;
                }
            }

            Remove(existingBuff);

            // client expects two packets, so we generate two but only save one (cuz cant save same key twice)
            var auraBuff = new BuffSkill(nAuraSkillID, (byte)nAuraLevel);

            auraBuff.GenerateAuraSkill(SecondaryStatFlag.Aura);
            Parent.Buffs.Add(auraBuff);

            auraBuff.Stat.Clear();             // recycling ftw
            auraBuff.dwCharFromId = dwCharIdFrom;

            auraBuff.GenerateAuraSkill(nType);
            Parent.Buffs.Add(auraBuff);
            auraBuff.Stat.Add(SecondaryStatFlag.Aura,
                              new SecondaryStatEntry
            {
                nValue = nAuraSkillID,
                rValue = nAuraLevel,
                tValue = -1000,
            });
        }
コード例 #25
0
        public override void Process(AGE.Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle    = _action.GetActorHandle(1);
            PoolObjHandle <ActorRoot> handle2        = _action.GetActorHandle(0);
            SkillUseContext           refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            BuffSkill       skill        = _action.refParams.GetRefParamObject <BuffSkill>("SkillObj");
            ResDT_SkillFunc outSkillFunc = null;

            if ((skill != null) && skill.FindSkillFunc((int)this.SkillFuncType, out outSkillFunc))
            {
                SSkillFuncContext inContext = new SSkillFuncContext {
                    inTargetObj    = actorHandle,
                    inOriginator   = handle2,
                    inUseContext   = refParamObject,
                    inSkillFunc    = outSkillFunc,
                    inStage        = ESkillFuncStage.Enter,
                    inAction       = new PoolObjHandle <AGE.Action>(_action),
                    inBuffSkill    = new PoolObjHandle <BuffSkill>(skill),
                    inOverlayCount = skill.GetOverlayCount(),
                    inLastEffect   = false
                };
                if (refParamObject != null)
                {
                    inContext.inEffectCount = refParamObject.EffectCount;
                    inContext.inMarkCount   = refParamObject.MarkCount;
                }
                inContext.InitSkillFuncContext();
                skill.SetBuffLevel(inContext.iSkillLevel);
                inContext.LocalParams = new SSkillFuncIntParam[6];
                for (int i = 0; i < 6; i++)
                {
                    inContext.LocalParams[i]        = new SSkillFuncIntParam();
                    inContext.LocalParams[i].iParam = 0;
                }
                if (!Singleton <BattleLogic> .GetInstance().isRuning || Singleton <BattleLogic> .GetInstance().isGameOver)
                {
                    return;
                }
                this.m_bSucceeded = Singleton <SkillFuncDelegator> .GetInstance().DoSkillFunc((int)this.SkillFuncType, ref inContext);
            }
            base.Process(_action, _track);
        }
コード例 #26
0
        public static bool OnSkillFuncSuckBlood(ref SSkillFuncContext inContext)
        {
            PoolObjHandle <ActorRoot> inOriginator = inContext.inOriginator;

            if (!inOriginator)
            {
                return(false);
            }
            ResDT_SkillFunc skillFunc = null;

            if (inContext.inStage != ESkillFuncStage.Leave)
            {
                int num    = 0;
                int iParam = inContext.inSkillFunc.astSkillFuncParam[0].iParam;
                int num2   = 0;
                if (inContext.inAction.handle.refParams.GetRefParam("HurtValue", ref num))
                {
                    for (int i = 0; i < inOriginator.handle.BuffHolderComp.SpawnedBuffList.get_Count(); i++)
                    {
                        BuffSkill buffSkill = inOriginator.handle.BuffHolderComp.SpawnedBuffList.get_Item(i);
                        if (buffSkill != null && buffSkill.FindSkillFunc(64, out skillFunc))
                        {
                            int skillFuncParam = buffSkill.GetSkillFuncParam(skillFunc, 0, false);
                            if (skillFuncParam == 1)
                            {
                                num2 += buffSkill.GetSkillFuncParam(skillFunc, 4, false);
                            }
                        }
                    }
                    int num3 = (int)((long)num * (long)iParam / 10000L * (long)(10000 + num2) / 10000L);
                    if (num3 > 0)
                    {
                        int num4 = inOriginator.handle.ValueComponent.actorHp;
                        inOriginator.handle.ActorControl.ReviveHp(num3);
                        num4 = inOriginator.handle.ValueComponent.actorHp - num4;
                        HemophagiaEventResultInfo hemophagiaEventResultInfo = new HemophagiaEventResultInfo(inOriginator, num4);
                        Singleton <GameEventSys> .instance.SendEvent <HemophagiaEventResultInfo>(GameEventDef.Event_Hemophagia, ref hemophagiaEventResultInfo);
                    }
                }
            }
            return(true);
        }
コード例 #27
0
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle    = _action.GetActorHandle(1);
            PoolObjHandle <ActorRoot> actorHandle2   = _action.GetActorHandle(0);
            SkillUseContext           refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            BuffSkill       refParamObject2          = _action.refParams.GetRefParamObject <BuffSkill>("SkillObj");
            ResDT_SkillFunc inSkillFunc = null;

            if (refParamObject2 != null && refParamObject2.FindSkillFunc((int)this.SkillFuncType, out inSkillFunc))
            {
                SSkillFuncContext sSkillFuncContext = default(SSkillFuncContext);
                sSkillFuncContext.inTargetObj    = actorHandle;
                sSkillFuncContext.inOriginator   = actorHandle2;
                sSkillFuncContext.inUseContext   = refParamObject;
                sSkillFuncContext.inSkillFunc    = inSkillFunc;
                sSkillFuncContext.inStage        = ESkillFuncStage.Enter;
                sSkillFuncContext.inAction       = new PoolObjHandle <Action>(_action);
                sSkillFuncContext.inBuffSkill    = new PoolObjHandle <BuffSkill>(refParamObject2);
                sSkillFuncContext.inOverlayCount = refParamObject2.GetOverlayCount();
                sSkillFuncContext.inLastEffect   = false;
                if (refParamObject != null)
                {
                    sSkillFuncContext.inEffectCount = refParamObject.EffectCount;
                    sSkillFuncContext.inEffectCountInSingleTrigger = refParamObject.EffectCountInSingleTrigger;
                    sSkillFuncContext.inMarkCount = refParamObject.MarkCount;
                }
                sSkillFuncContext.InitSkillFuncContext();
                refParamObject2.SetBuffLevel(sSkillFuncContext.iSkillLevel);
                sSkillFuncContext.LocalParams = new SSkillFuncIntParam[8];
                for (int i = 0; i < 8; i++)
                {
                    sSkillFuncContext.LocalParams[i]        = default(SSkillFuncIntParam);
                    sSkillFuncContext.LocalParams[i].iParam = 0;
                }
                if (!Singleton <BattleLogic> .GetInstance().isRuning || Singleton <BattleLogic> .GetInstance().isGameOver)
                {
                    return;
                }
                this.m_bSucceeded = Singleton <SkillFuncDelegator> .GetInstance().DoSkillFunc((int)this.SkillFuncType, ref sSkillFuncContext);
            }
            base.Process(_action, _track);
        }
コード例 #28
0
        private void InitContext(Action _action)
        {
            PoolObjHandle <ActorRoot> actorHandle  = _action.GetActorHandle(1);
            PoolObjHandle <ActorRoot> actorHandle2 = _action.GetActorHandle(0);

            if (!actorHandle || !actorHandle2)
            {
                return;
            }
            SkillUseContext refParamObject  = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
            BuffSkill       refParamObject2 = _action.refParams.GetRefParamObject <BuffSkill>("SkillObj");
            ResDT_SkillFunc inSkillFunc     = null;

            if (refParamObject2 != null && refParamObject2.FindSkillFunc(this.SkillFuncType, out inSkillFunc))
            {
                this.m_context.inTargetObj  = actorHandle;
                this.m_context.inOriginator = actorHandle2;
                this.m_context.inUseContext = refParamObject;
                this.m_context.inSkillFunc  = inSkillFunc;
                this.m_context.LocalParams  = new SSkillFuncIntParam[8];
                for (int i = 0; i < 8; i++)
                {
                    this.m_context.LocalParams[i]        = default(SSkillFuncIntParam);
                    this.m_context.LocalParams[i].iParam = 0;
                }
                this.m_context.inAction       = new PoolObjHandle <Action>(_action);
                this.m_context.inBuffSkill    = new PoolObjHandle <BuffSkill>(refParamObject2);
                this.m_context.inDoCount      = 0;
                this.m_context.inOverlayCount = refParamObject2.GetOverlayCount();
                this.m_context.inLastEffect   = true;
                if (refParamObject != null)
                {
                    this.m_context.inEffectCount = refParamObject.EffectCount;
                    this.m_context.inEffectCountInSingleTrigger = refParamObject.EffectCountInSingleTrigger;
                    this.m_context.inMarkCount = refParamObject.MarkCount;
                }
                this.m_context.InitSkillFuncContext();
                refParamObject2.SetBuffLevel(this.m_context.iSkillLevel);
                this.bInit = true;
            }
        }
コード例 #29
0
        //public AbstractBuff GetByType(SecondaryStatFlag type) => this.FirstOrDefault(c => c.StatType == type);

        ///// <summary>
        ///// This is not foolproof, it only checks the buff StatType variable and returns the first
        /////		stat entry that is equal to nType in the Stat collection.
        ///// </summary>
        ///// <param name="nType"></param>
        ///// <param name="nDefaultValue"></param>
        ///// <returns></returns>
        //public int nOptionData(SecondaryStatFlag nType, int nDefaultValue = 0)
        //{
        //	// TODO phase this whole function out, its bad

        //	foreach (var item in this)
        //	{
        //		if (item.StatType != nType) continue;

        //		foreach (var stat in item.Stat)
        //		{
        //			if (stat.Key != nType) continue;

        //			return stat.Value.nValue;
        //		}
        //	}

        //	return nDefaultValue;
        //}

        public void DoCombatOrders(int nSkillID, byte nSLV)
        {
            if (GetOrDefault(nSkillID) is BuffSkill curCO && curCO.nSLV >= nSLV)
            {
                UpdateBuffInfo(curCO);
                return;
            }

            var entry = new BuffSkill(nSkillID, nSLV);

            entry.State = (int)entry.Template.X(nSLV);
            entry.Generate();
            Add(entry);

            // TODO just make nSLV look at combat orders SecondaryStat value instead of modifying all these

            foreach (var skill in Parent.Skills)
            {
                if (skill.nSLV > 0 && skill.nSkillID != nSkillID)                 // combat orders will affect hidden skills but not itself
                {
                    skill.CombatOrders = entry.State;
                }
            }
        }
コード例 #30
0
    public double    buffTimeEnd; // server time. double for long term precision.

    // constructors
    public Buff(BuffSkill data, int level)
    {
        Hash        = data.name.GetStableHashCode();
        this.level  = level;
        buffTimeEnd = NetworkTime.time + data.buffTime.Get(level); // start buff immediately
    }