Exemplo n.º 1
0
        protected virtual DamageRequest CreateDamageRequest(AuraState state)
        {
            var attributeMultiplier = 1f;
            var isCriticalStrike    = false;

            if (affectedBySpellPower)
            {
                attributeMultiplier *= state.Source.System.AttributeSystem.SpellPower.Remap();
            }

            if (canCrit)
            {
                if (Random.Range(0f, 1f) < state.Source.System.AttributeSystem.CriticalStrikeRating.Remap())
                {
                    isCriticalStrike     = true;
                    attributeMultiplier *= critMultiplier;
                }
            }

            var damageSource = state.Source.System.Origin.gameObject;

            return(new DamageRequest(baseDamage * attributeMultiplier * state.Stacks,
                                     isCriticalStrike,
                                     damageSource,
                                     allowMitigation
                                        ? DamageRequest.WithMitigation
                                        : DamageRequest.NoMitigation));
        }
Exemplo n.º 2
0
 void Start()
 {
     image                 = GetComponent <Image>();
     state                 = 0;
     lerpState             = 0;
     initialColor          = image.color;
     image.color           = new Color(initialColor.r, initialColor.g, initialColor.b, 0);
     backAndForthDirection = true;
 }
Exemplo n.º 3
0
        private IEnumerator DamageCoroutine(AuraState state)
        {
            if (!state.Target.Has(out HealthSystem.HealthSystem healthSystem))
            {
                yield break;
            }

            while (state.Stacks > 0)
            {
                healthSystem.Damage(CreateDamageRequest(state));
                yield return(new WaitForSeconds(period));
            }
        }
Exemplo n.º 4
0
        public override void Removed(AuraState state)
        {
            var attribute = state.Target.AttributeSystem.Get(attributeName);

            switch (type)
            {
            case AttributeAuraType.Add:
                attribute.RemoveAddition(useAuraAsReference ? this : (object)state.Source);
                break;

            case AttributeAuraType.Multiply:
                attribute.RemoveMultiplier(useAuraAsReference ? this : (object)state.Source);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        public static bool Prefix(AbstractActor ___owner, ref ButtonState __result)
        {
            if (!AuraTable.TryGetValue(___owner, out AuraState auraState))
            {
                AuraTable[___owner] = auraState = new AuraState();
            }

            unchecked
            {
                if (auraState.LastUpdate++ % _updateInterval == 0)
                {
                    return(true);
                }
            }

            __result = auraState.LastState;
            return(false);
        }
Exemplo n.º 6
0
        public void Used(AuraState auraState)
        {
            switch (onUse)
            {
            case OnUse.RemoveStack:
                auraState.RemoveStack();
                break;

            case OnUse.Remove:
                auraState.Remove();
                break;

            case OnUse.DoNothing:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 7
0
 public void ShineStop()
 {
     lerpState      = 0;
     initialColor.a = image.color.a;
     state          = AuraState.ShineDown;
 }
Exemplo n.º 8
0
		public static bool HasAnyFlag(this AuraStateMask mask, AuraState state)
		{
			return (mask & (AuraStateMask)(1 << ((int)state - 1))) != 0;
		}
Exemplo n.º 9
0
 public virtual void RemovedStack(AuraState state)
 {
 }
Exemplo n.º 10
0
 public virtual void AppliedStack(AuraState state)
 {
 }
Exemplo n.º 11
0
 public override void Removed(AuraState state)
 {
     state.CoroutineShouldStop = true;
 }
Exemplo n.º 12
0
 public void ShineStart()
 {
     lerpState = 0;
     state     = AuraState.ShineUp;
 }
Exemplo n.º 13
0
 public float CalculateCritChanceAddition(AuraState auraState)
 {
     return(addCritChance * auraState.Stacks);
 }
Exemplo n.º 14
0
 public static bool HasAnyFlag(this AuraStateMask mask, AuraState state)
 {
     return((mask & (AuraStateMask)(1 << (int)(state - 1U &
                                               (AuraState.RejuvenationOrRegrowth | AuraState.DeadlyPoison)))
             ) != AuraStateMask.None);
 }
Exemplo n.º 15
0
 public float CalculateBaseDamageMultiplier(AuraState auraState)
 {
     return(multiplyBaseDamage * auraState.Stacks);
 }
Exemplo n.º 16
0
 public static bool HasAnyFlag(this AuraStateMask mask, AuraState state)
 {
     return((mask & (AuraStateMask)(1 << ((int)state - 1))) != 0);
 }
Exemplo n.º 17
0
    void Update()
    {
        float alpha;

        switch (state)
        {
        case AuraState.Invisible:
            image.color = Color.clear;
            break;

        case AuraState.ShineUp:
            lerpState += Time.deltaTime * TransitionSharpness;
            if (lerpState >= 1)
            {
                lerpState = 1;
            }
            alpha       = Mathf.Lerp(0, MinAlpha, lerpState);
            image.color = new Color(initialColor.r, initialColor.g, initialColor.b, alpha);
            if (lerpState >= 1)
            {
                lerpState = 0; state++;
            }
            break;

        case AuraState.BackAndForth:
            if (backAndForthDirection)
            {
                lerpState += Time.deltaTime * TransitionSharpness;
                if (lerpState >= 1)
                {
                    lerpState = 1; backAndForthDirection = false;
                }
            }
            else
            {
                lerpState -= Time.deltaTime * TransitionSharpness;
                if (lerpState <= 0)
                {
                    lerpState = 0; backAndForthDirection = true;
                }
            }
            alpha       = Mathf.Lerp(MinAlpha, MaxAlpha, lerpState);
            image.color = new Color(initialColor.r, initialColor.g, initialColor.b, alpha);
            break;

        case AuraState.ShineDown:
            lerpState += Time.deltaTime * TransitionSharpness;
            if (lerpState >= 1)
            {
                lerpState = 1;
                state     = 0;
            }
            alpha       = Mathf.Lerp(initialColor.a, 0, lerpState);
            image.color = new Color(initialColor.r, initialColor.g, initialColor.b, alpha);
            break;

        default:
            state = 0;
            break;
        }
    }
Exemplo n.º 18
0
 public float CalculateBaseHealMultiplier(AuraState auraState)
 {
     return(multiplyBaseHeal * auraState.Stacks);
 }
        // 239      3.3.0

        /// <inheritdoc />
        public SpellEntry(int spellId, uint category, uint dispel, SpellMechanic mechanic, SpellAtribute attributes, SpellAtributeEx attributesEx, SpellAtributeEx2 attributesEx2, SpellAtributeEx3 attributesEx3, SpellAtributeEx4 attributesEx4, SpellAtributeEx5 attributesEx5, SpellAtributeEx6 attributesEx6, SpellAtributeEx7 attributesEx7, ulong stances, ulong stancesNot, uint targets, CreatureTypeMask targetCreatureType, uint requiresSpellFocus, uint facingCasterFlags, AuraState casterAuraState, AuraState targetAuraState, AuraState casterAuraStateNot, AuraState targetAuraStateNot, uint casterAuraSpell, uint targetAuraSpell, uint excludeCasterAuraSpell, uint excludeTargetAuraSpell, uint castingTimeIndex, uint recoveryTime, uint categoryRecoveryTime, SpellInteruptFlags interruptFlags, SpellAuraInterruptFlags auraInterruptFlags, SpellChannelInterruptFlags channelInterruptFlags, ProcFlags procFlags, uint procChance, uint procCharges, uint maxLevel, uint baseLevel, uint spellLevel, uint durationIndex, SpellCostPower powerType, uint manaCost, uint manaCostPerlevel, uint manaPerSecond, uint manaPerSecondPerLevel, uint rangeIndex, float speed, uint modalNextSpell, uint stackAmount, RequiredReagentData reagentsRequired, ItemClassType equippedItemClass, int equippedItemSubClassMask, InventoryTypeMask equippedItemInventoryTypeMask, SpellEffectData spellEffectInformation, SpellVisualData spellVisual, uint spellIconId, uint activeIconId, uint spellPriority, LocalizedStringDBC <TStringType> spellName, LocalizedStringDBC <TStringType> rank, LocalizedStringDBC <TStringType> description, LocalizedStringDBC <TStringType> toolTip, uint manaCostPercentage, uint startRecoveryCategory, uint startRecoveryTime, uint maxTargetLevel, SpellFamilyName spellFamilyName, Flags96 <uint> spellFamilyFlags, uint maxAffectedTargets, SpellDamageClassType dmgClass, SpellPreventionType preventionType, uint stanceBarOrder, SpellEffectDataChunk <float> dmgMultiplier, uint minFactionId, uint minReputation, uint requiredAuraVision, SpellTotemDataChunk <uint> totemCategory, int areaGroupId, SpellSchoolMask schoolMask, uint runeCostId, uint spellMissileId, uint powerDisplayId, SpellEffectDataChunk <float> damageCoeficient, uint spellDescriptionVariableId, uint spellDifficultyId)
        {
            SpellId                = spellId;
            Category               = category;
            Dispel                 = dispel;
            Mechanic               = mechanic;
            Attributes             = attributes;
            AttributesEx           = attributesEx;
            AttributesEx2          = attributesEx2;
            AttributesEx3          = attributesEx3;
            AttributesEx4          = attributesEx4;
            AttributesEx5          = attributesEx5;
            AttributesEx6          = attributesEx6;
            AttributesEx7          = attributesEx7;
            Stances                = stances;
            StancesNot             = stancesNot;
            Targets                = targets;
            TargetCreatureType     = targetCreatureType;
            RequiresSpellFocus     = requiresSpellFocus;
            FacingCasterFlags      = facingCasterFlags;
            CasterAuraState        = casterAuraState;
            TargetAuraState        = targetAuraState;
            CasterAuraStateNot     = casterAuraStateNot;
            TargetAuraStateNot     = targetAuraStateNot;
            CasterAuraSpell        = casterAuraSpell;
            TargetAuraSpell        = targetAuraSpell;
            ExcludeCasterAuraSpell = excludeCasterAuraSpell;
            ExcludeTargetAuraSpell = excludeTargetAuraSpell;
            CastingTimeIndex       = castingTimeIndex;
            RecoveryTime           = recoveryTime;
            CategoryRecoveryTime   = categoryRecoveryTime;
            InterruptFlags         = interruptFlags;
            AuraInterruptFlags     = auraInterruptFlags;
            ChannelInterruptFlags  = channelInterruptFlags;
            ProcFlags              = procFlags;
            ProcChance             = procChance;
            ProcCharges            = procCharges;
            MaxLevel               = maxLevel;
            BaseLevel              = baseLevel;
            SpellLevel             = spellLevel;
            DurationIndex          = durationIndex;
            PowerType              = powerType;
            ManaCost               = manaCost;
            ManaCostPerlevel       = manaCostPerlevel;
            ManaPerSecond          = manaPerSecond;
            ManaPerSecondPerLevel  = manaPerSecondPerLevel;
            RangeIndex             = rangeIndex;
            Speed                         = speed;
            ModalNextSpell                = modalNextSpell;
            StackAmount                   = stackAmount;
            ReagentsRequired              = reagentsRequired;
            EquippedItemClass             = equippedItemClass;
            EquippedItemSubClassMask      = equippedItemSubClassMask;
            EquippedItemInventoryTypeMask = equippedItemInventoryTypeMask;
            SpellEffectInformation        = spellEffectInformation;
            SpellVisual                   = spellVisual;
            SpellIconID                   = spellIconId;
            ActiveIconID                  = activeIconId;
            SpellPriority                 = spellPriority;
            SpellName                     = spellName;
            Rank                       = rank;
            Description                = description;
            ToolTip                    = toolTip;
            ManaCostPercentage         = manaCostPercentage;
            StartRecoveryCategory      = startRecoveryCategory;
            StartRecoveryTime          = startRecoveryTime;
            MaxTargetLevel             = maxTargetLevel;
            SpellFamilyName            = spellFamilyName;
            SpellFamilyFlags           = spellFamilyFlags;
            MaxAffectedTargets         = maxAffectedTargets;
            DmgClass                   = dmgClass;
            PreventionType             = preventionType;
            StanceBarOrder             = stanceBarOrder;
            DmgMultiplier              = dmgMultiplier;
            MinFactionId               = minFactionId;
            MinReputation              = minReputation;
            RequiredAuraVision         = requiredAuraVision;
            TotemCategory              = totemCategory;
            AreaGroupId                = areaGroupId;
            SchoolMask                 = schoolMask;
            RuneCostID                 = runeCostId;
            SpellMissileID             = spellMissileId;
            PowerDisplayId             = powerDisplayId;
            DamageCoeficient           = damageCoeficient;
            SpellDescriptionVariableID = spellDescriptionVariableId;
            SpellDifficultyId          = spellDifficultyId;
        }
Exemplo n.º 20
0
 public override void Applied(AuraState state)
 {
     state.StartCoroutine(DamageCoroutine(state));
 }