Пример #1
0
 public void addBuffToList(Tags.Properties property, float addedValue, float increasedValue, List <float> moreValues, List <float> quotientValues, float duration, List <Tags.AbilityTags> tags = null, string _name = "")
 {
     if (tags == null)
     {
         TaggedStatsHolder.Stat debuff = new TaggedStatsHolder.Stat(property);
         debuff.addedValue     = addedValue;
         debuff.increasedValue = increasedValue;
         if (moreValues != null)
         {
             debuff.moreValues.AddRange(moreValues);
         }
         if (quotientValues != null)
         {
             debuff.quotientValues.AddRange(quotientValues);
         }
         simpleBuffs.Add(new Buff(debuff, duration, _name));
     }
     else
     {
         TaggedStatsHolder.TaggableStat debuff = new TaggedStatsHolder.TaggableStat(property, tags);
         debuff.addedValue     = addedValue;
         debuff.increasedValue = increasedValue;
         if (moreValues != null)
         {
             debuff.moreValues.AddRange(moreValues);
         }
         if (quotientValues != null)
         {
             debuff.quotientValues.AddRange(quotientValues);
         }
         taggedBuffs.Add(new TaggedBuff(debuff, duration, _name));
     }
 }
Пример #2
0
 public void OnKill(Ability _ability, GameObject target)
 {
     if (_ability && _ability == Ability.getAbility(AbilityID.erasingStrikeHit))
     {
         // void beams
         killsSinceUse++;
         if (killsSinceUse >= 5 && ua && voidBeamsOnkill)
         {
             killsSinceUse = -10000;
             ua.UseAbility(Ability.getAbility(AbilityID.playerVoidBeams), transform.position + transform.forward, false, false);
         }
         // stationary void beam
         if (!ua)
         {
             ua = GetComponent <UsingAbility>();
         }
         if (stationaryVoidBeamChance != 0 && ua)
         {
             if ((Random.Range(0f, 1f) < stationaryVoidBeamChance) && target)
             {
                 ua.UseAbility(Ability.getAbility(AbilityID.stationaryVoidBeam), target.transform.position, false, false);
             }
         }
         // mana and health
         if (mana && manaGainedOnKill != 0)
         {
             mana.currentMana += manaGainedOnKill; if (mana.currentMana > mana.maxMana)
             {
                 mana.currentMana = mana.maxMana;
             }
         }
         if (health && percentLifeGainedOnKill != 0 && target)
         {
             BaseHealth targetHealth = target.GetComponent <BaseHealth>();
             if (targetHealth)
             {
                 health.Heal(targetHealth.maxHealth * percentLifeGainedOnKill);
             }
         }
         // move speed
         if (movementSpeedOnKill != 0)
         {
             TaggedStatsHolder.Stat stat = new TaggedStatsHolder.Stat(Tags.Properties.Movespeed);
             stat.increasedValue = movementSpeedOnKill;
             Buff buff = new Buff(stat, 4f);
             statBuffs.addBuff(buff);
         }
     }
 }
Пример #3
0
 public void OnHit(Ability _ability, GameObject target)
 {
     if (_ability == ability || _ability == AbilityIDList.getAbility(AbilityID.iceNova) || _ability == AbilityIDList.getAbility(AbilityID.lightningNova) || _ability == AbilityIDList.getAbility(AbilityID.fireNova))
     {
         if (chanceToGainWardOnHit > 0)
         {
             float rand = Random.Range(0f, 1f);
             if (rand < chanceToGainWardOnHit && protectionClass)
             {
                 protectionClass.currentWard += wardOnHit * (1 + increasedWardGained);
             }
         }
         if (shockEffectOnHit > 0)
         {
             TaggedStatsHolder.Stat newStat = new TaggedStatsHolder.Stat(Tags.Properties.IncreasedShockEffect);
             newStat.addedValue = shockEffectOnHit;
             Buff newBuff = new Buff();
             newBuff.stat = newStat;
             newBuff.remainingDuration = 4f;
             newBuff.name = "Nova shock effect";
             statBuffs.addBuff(newBuff);
         }
     }
 }
Пример #4
0
 public void GainWardOnKill(Ability _ability, GameObject target)
 {
     if (_ability == ability || _ability == AbilityIDList.getAbility(AbilityID.iceNova) || _ability == AbilityIDList.getAbility(AbilityID.lightningNova) || _ability == AbilityIDList.getAbility(AbilityID.fireNova))
     {
         if (chanceToGainWardOnKill > 0)
         {
             float rand = Random.Range(0f, 1f);
             if (rand < chanceToGainWardOnKill && protectionClass)
             {
                 protectionClass.GainWard(wardOnKill * (1 + increasedWardGained));
             }
         }
         if (wardRetentionOnKill > 0)
         {
             TaggedStatsHolder.Stat newStat = new TaggedStatsHolder.Stat(Tags.Properties.WardRetention);
             newStat.addedValue = wardRetentionOnKill;
             Buff newBuff = new Buff();
             newBuff.stat = newStat;
             newBuff.remainingDuration = 4f;
             newBuff.name = "Nova ward retention";
             statBuffs.addBuff(newBuff);
         }
     }
 }
Пример #5
0
    public override void updateMutator()
    {
        AbyssalEchoesMutator mutator = PlayerFinder.getPlayer().GetComponent <AbyssalEchoesMutator>();
        bool  noChain                 = false;
        bool  pullsOnHit              = false;
        float increasedPullStrength   = 0f;
        float increasedArea           = 0f;
        float speedDebuff             = 0f;
        float armourDebuff            = 0f;
        float increasedDebuffStrength = 0f;
        float increasedDebuffDuration = 0f;
        float dotTakenDebuff          = 0f;
        bool  dotTakenDebuffStacks    = false;

        int   additionalCasts = 0;
        float increasedDelay  = 0f;

        List <TaggedStatsHolder.Stat> stackingStatsOnKill = new List <TaggedStatsHolder.Stat>();

        float healthRegenOnKill = 0f;
        float manaRegenOnKill   = 0f;

        float increasedNonStackingBuffDuration = 0f;
        float movementSpeedOnKill      = 0f;
        float attackAndCastSpeedOnKill = 0f;

        float increasedCastSpeed = 0f;

        float increasedDamage   = 0f;
        float manaEfficiency    = 0f;
        float increasedManaCost = 0f;
        bool  stacks            = false;

        foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>())
        {
            if (node.name == "Abyssal Echoes Tree No Chain")
            {
                if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0)
                {
                    noChain         = true;
                    manaEfficiency += 0.4f;
                    increasedArea  += 0.4f;
                }
            }
            if (node.name == "Abyssal Echoes Tree Pulls On Hit")
            {
                if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0)
                {
                    pullsOnHit         = true;
                    increasedManaCost += 0.35f;
                }
            }
            if (node.name == "Abyssal Echoes Tree Pull Strength")
            {
                increasedPullStrength += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f;
            }
            if (node.name == "Abyssal Echoes Tree Increased Area")
            {
                increasedArea += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f;
            }
            if (node.name == "Abyssal Echoes Tree Speed Debuff")
            {
                speedDebuff += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.05f;
            }
            if (node.name == "Abyssal Echoes Tree Armour Debuff")
            {
                armourDebuff += node.GetComponent <SkillTreeNode>().pointsAllocated * 20f;
            }
            if (node.name == "Abyssal Echoes Tree Debuff Duration")
            {
                increasedDebuffDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f;
            }
            if (node.name == "Abyssal Echoes Tree Debuff Strength")
            {
                increasedDebuffStrength += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f;
            }
            if (node.name == "Abyssal Echoes Tree Mana Efficiency And Cast Speed")
            {
                increasedCastSpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.05f;
                manaEfficiency     += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f;
            }
            if (node.name == "Abyssal Echoes Tree Hit Damage")
            {
                increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f;
            }
            if (node.name == "Abyssal Echoes Tree Stacks")
            {
                stacks = (node.GetComponent <SkillTreeNode>().pointsAllocated > 0);
            }
            if (node.name == "Abyssal Echoes Tree Casts Again")
            {
                additionalCasts   += node.GetComponent <SkillTreeNode>().pointsAllocated * 1;
                increasedManaCost += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.35f;
            }
            if (node.name == "Abyssal Echoes Tree Increased Delay")
            {
                increasedDelay += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f;
                manaEfficiency += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f;
            }
            if (node.name == "Abyssal Echoes Tree Additional Casts")
            {
                additionalCasts   += node.GetComponent <SkillTreeNode>().pointsAllocated * 1;
                increasedManaCost += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.35f;
            }
            if (node.name == "Abyssal Echoes Tree DoT Taken Debuff")
            {
                dotTakenDebuff += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f;
            }
            if (node.name == "Abyssal Echoes Tree DoT Taken Debuff Stacks")
            {
                if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0)
                {
                    dotTakenDebuffStacks = true;
                    dotTakenDebuff      *= 0.5f;
                }
            }
            if (node.name == "Abyssal Echoes Tree Health Regen On Kill")
            {
                if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0)
                {
                    TaggedStatsHolder.Stat stat = new TaggedStatsHolder.Stat(Tags.Properties.HealthRegen);
                    stat.increasedValue = node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f;
                    stackingStatsOnKill.Add(stat);
                }
            }
            if (node.name == "Abyssal Echoes Tree Tenacity On Kill")
            {
                if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0)
                {
                    TaggedStatsHolder.Stat stat = new TaggedStatsHolder.Stat(Tags.Properties.Tenacity);
                    stat.addedValue = node.GetComponent <SkillTreeNode>().pointsAllocated * 15f;
                    stackingStatsOnKill.Add(stat);
                }
            }
            if (node.name == "Abyssal Echoes Tree All Regen On Kill")
            {
                healthRegenOnKill += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f;
                manaRegenOnKill   += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.05f;
            }
            if (node.name == "Abyssal Echoes Tree On Kill Buff Duration")
            {
                increasedNonStackingBuffDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f;
            }
            if (node.name == "Abyssal Echoes Tree Movement Speed On Kill")
            {
                movementSpeedOnKill += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f;
            }
            if (node.name == "Abyssal Echoes Tree Attack And Cast Speed On Kill")
            {
                attackAndCastSpeedOnKill += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f;
            }
        }

        mutator.noChain                 = noChain;
        mutator.pullsOnHit              = pullsOnHit;
        mutator.increasedPullStrength   = increasedPullStrength;
        mutator.increasedRadius         = Mathf.Sqrt(increasedArea + 1) - 1;
        mutator.speedDebuff             = speedDebuff;
        mutator.armourDebuff            = armourDebuff;
        mutator.increasedDebuffStrength = increasedDebuffStrength;
        mutator.increasedDebuffDuration = increasedDebuffDuration;
        mutator.dotTakenDebuff          = dotTakenDebuff;
        mutator.dotTakenDebuffStacks    = dotTakenDebuffStacks;

        mutator.additionalCasts = additionalCasts;
        mutator.increasedDelay  = increasedDelay;

        mutator.stackingStatsOnKill = stackingStatsOnKill;

        mutator.healthRegenOnKill = healthRegenOnKill;
        mutator.manaRegenOnKill   = manaRegenOnKill;

        mutator.increasedNonStackingBuffDuration = increasedNonStackingBuffDuration;
        mutator.movementSpeedOnKill      = movementSpeedOnKill;
        mutator.attackAndCastSpeedOnKill = attackAndCastSpeedOnKill;

        mutator.increasedCastSpeed = increasedCastSpeed;

        mutator.increasedDamage      = increasedDamage;
        mutator.addedManaCostDivider = manaEfficiency;
        mutator.increasedManaCost    = increasedManaCost;
        mutator.stacks = stacks;
    }
Пример #6
0
 public void OnHit(Ability _ability, GameObject target)
 {
     // vengeance
     if (_ability && _ability == ability)
     {
         if (reducedDamageTakenOnHit != 0)
         {
             TaggedStatsHolder.Stat newStat = new TaggedStatsHolder.Stat(Tags.Properties.DamageTaken);
             newStat.increasedValue = -reducedDamageTakenOnHit;
             Buff buff = new Buff(newStat, 2f);
             statBuffs.addBuff(buff);
         }
         if (darkBladeOnVengeanceHitChance != 0)
         {
             if (!ua)
             {
                 ua = GetComponent <UsingAbility>();
             }
             if (Random.Range(0f, 1f) < darkBladeOnVengeanceHitChance && ua)
             {
                 if (target)
                 {
                     ua.UseAbility(Ability.getAbility(AbilityID.darkBlade), target.transform.position, false, false);
                 }
                 else
                 {
                     ua.UseAbility(Ability.getAbility(AbilityID.darkBlade), target.transform.position + new Vector3(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f)), false, false);
                 }
             }
         }
     }
     // riposte
     if (_ability && _ability == Ability.getAbility(AbilityID.riposteRetaliationHit))
     {
         if (!ua)
         {
             ua = GetComponent <UsingAbility>();
         }
         if (voidEssenceOnRiposteHitChance != 0 && ua)
         {
             if (Random.Range(0f, 1f) < voidEssenceOnRiposteHitChance)
             {
                 if (target)
                 {
                     ua.UseAbility(Ability.getAbility(AbilityID.voidEssence), target.transform.position, false, false);
                 }
                 else
                 {
                     ua.UseAbility(Ability.getAbility(AbilityID.voidEssence), transform.position, false, false);
                 }
             }
         }
         if (darkBladeOnRiposteHitChance != 0)
         {
             if (Random.Range(0f, 1f) < darkBladeOnRiposteHitChance && ua)
             {
                 if (target)
                 {
                     ua.UseAbility(Ability.getAbility(AbilityID.darkBlade), target.transform.position, false, false);
                 }
                 else
                 {
                     ua.UseAbility(Ability.getAbility(AbilityID.darkBlade), target.transform.position + new Vector3(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f)), false, false);
                 }
             }
         }
     }
 }
Пример #7
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        // increasedDamageToFirstEnemyHit is removed for additional chains, so it can be applied without checks
        if (increasedDamage != 0 || increasedDamageToFirstEnemyHit != 0)
        {
            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.increaseAllDamage(increasedDamage + increasedDamageToFirstEnemyHit);
            }
        }

        if (chains > 0)
        {
            ChainOnHit chain = abilityObject.AddComponent <ChainOnHit>();
            chain.chainsRemaining = chains;
            chain.abilityToChain  = ability;

            // add a copy of this mutator to the ability object, but remove the chains (because it will chain anyway), the increased damage to first enemy hit, and the on cast stuff
            LightningBlastMutator newMutator = abilityObject.AddComponent <LightningBlastMutator>();
            newMutator.chains = 0;
            increasedDamageToFirstEnemyHit   = 0;
            newMutator.increasedDamage       = increasedDamage;
            newMutator.lightningStrikeChance = lightningStrikeChance;
            newMutator.chanceToBlind         = chanceToBlind;

            // add the increased damage per chain
            newMutator.increasedDamage += increasedDamagePerChain;

            // add increased damage to last enemy hit if appropriate
            if (chain.chainsRemaining == 0)
            {
                newMutator.increasedDamage += increasedDamageToLastEnemy;
            }
        }


        // on cast stuff
        if (lightningProtectionOnCast != 0 || elementalProtectionOnCast != 0)
        {
            Buff buff = new Buff();
            TaggedStatsHolder.Stat stat = new TaggedStatsHolder.Stat(Tags.Properties.LightningProtection);
            stat.addedValue        = (lightningProtectionOnCast + elementalProtectionOnCast) * (1 + increasedProtectionOnCast);
            buff.stat              = stat;
            buff.remainingDuration = 3 * (1 + increasedProtectionDuration);
            statBuffs.addBuff(buff);
        }

        if (elementalProtectionOnCast != 0)
        {
            Buff buff = new Buff();
            TaggedStatsHolder.Stat stat = new TaggedStatsHolder.Stat(Tags.Properties.ColdProtection);
            stat.addedValue        = (elementalProtectionOnCast) * (1 + increasedProtectionOnCast);
            buff.stat              = stat;
            buff.remainingDuration = 3 * (1 + increasedProtectionDuration);
            statBuffs.addBuff(buff);
        }

        if (elementalProtectionOnCast != 0)
        {
            Buff buff = new Buff();
            TaggedStatsHolder.Stat stat = new TaggedStatsHolder.Stat(Tags.Properties.FireProtection);
            stat.addedValue        = (elementalProtectionOnCast) * (1 + increasedProtectionOnCast);
            buff.stat              = stat;
            buff.remainingDuration = 3 * (1 + increasedProtectionDuration);
            statBuffs.addBuff(buff);
        }

        if (wardOnCast != 0)
        {
            float rand = Random.Range(0f, 1f);
            if (rand < wardOnCastChance)
            {
                protectionClass.currentWard += wardOnCast;
            }
        }

        if (lightningDamageOnCast != 0)
        {
            List <Tags.AbilityTags> tags = new List <Tags.AbilityTags>();
            tags.Add(Tags.AbilityTags.Lightning);
            TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tags);
            stat.increasedValue = lightningDamageOnCast;
            TaggedBuff buff = new TaggedBuff();
            buff.stat = stat;
            buff.remainingDuration = 3 * (1 + increasedDamageBuffDuration);
            statBuffs.addTaggedBuff(buff);
        }

        if (increasedStunChance != 0)
        {
            foreach (DamageStatsHolder damage in abilityObject.GetComponents <DamageStatsHolder>())
            {
                damage.baseDamageStats.increasedStunChance += increasedStunChance;
            }
        }


        // maybe cast lightning too
        if (lightningStrikeChance > 0)
        {
            float rand = Random.Range(0f, 1f);
            if (rand <= lightningStrikeChance)
            {
                AbilityObjectConstructor aoc = GetComponent <AbilityObjectConstructor>();
                if (aoc)
                {
                    aoc.constructAbilityObject(AbilityIDList.getAbility(AbilityID.lightning), targetLocation, targetLocation);
                }
            }
        }

        // maybe blind
        if (chanceToBlind > 0)
        {
            ChanceToApplyStatusOnEnemyHit ctasoeh = abilityObject.AddComponent <ChanceToApplyStatusOnEnemyHit>();
            ctasoeh.chance       = chanceToBlind;
            ctasoeh.statusEffect = StatusEffectList.getEffect(StatusEffectID.Blind);
        }


        return(abilityObject);
    }
Пример #8
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        VoidRiftMutator voidRiftMutator = Comp <VoidRiftMutator> .GetOrAdd(abilityObject);

        voidRiftMutator.increasedDamage              = voidRift_increasedDamage;
        voidRiftMutator.increasedRadius              = voidRift_increasedRadius;
        voidRiftMutator.timeRotChance                = voidRift_timeRotChance;
        voidRiftMutator.increasesDamageTaken         = voidRift_increasesDamageTaken;
        voidRiftMutator.increasesDoTDamageTaken      = voidRift_increasesDoTDamageTaken;
        voidRiftMutator.increasedStunChance          = voidRift_increasedStunChance;
        voidRiftMutator.moreDamageAgainstStunned     = voidRift_moreDamageAgainstStunned;
        voidRiftMutator.igniteChance                 = voidRift_igniteChance;
        voidRiftMutator.moreDamageAgainstIgnited     = voidRift_damageAgainstIgnited;
        voidRiftMutator.moreDamageAgainstTimeRotting = voidRift_damageAgainstTimeRotting;
        if (voidRift_noGrowth)
        {
            voidRiftMutator.areaGainOnNearbyDeath   = 0f;
            voidRiftMutator.damageGainOnNearbyDeath = 0f;
        }
        else
        {
            voidRiftMutator.areaGainOnNearbyDeath   *= (1 + voidRift_increasedAreaGrowth);
            voidRiftMutator.damageGainOnNearbyDeath *= (1 + voidRift_increasedDamageGrowth);
        }

        if (dealsDamage)
        {
            SphereCollider col = abilityObject.AddComponent <SphereCollider>();
            col.radius    = 0.3f;
            col.isTrigger = true;
        }


        if (increasedDamage != 0)
        {
            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.increaseAllDamage(increasedDamage);
            }
        }

        if (movementSpeedOnCast != 0)
        {
            TaggedStatsHolder.Stat stat = new TaggedStatsHolder.Stat(Tags.Properties.Movespeed);
            stat.increasedValue = movementSpeedOnCast;
            Buff buff = new Buff(stat, 4f);
            statBuffs.addBuff(buff);
        }

        if (orbitsCaster)
        {
            SpiralMovement movement = abilityObject.AddComponent <SpiralMovement>();
            movement.outwardDistance       = 2f + increasedOrbitDistance;
            movement.angleChangedPerSecond = 180f;
            movement.constantVelocity      = SpiralMovement.ConstantType.AngularVelocity;
            movement.centreOnCaster        = true;
            movement.offsetFromTransform   = new Vector3(0, 1, 0);
            movement.outwardSpeed          = 0f;
            movement.randomStartAngle      = true;
        }

        if (castsAbyssalOrb)
        {
            CastAtRandomPointAfterDuration component = abilityObject.AddComponent <CastAtRandomPointAfterDuration>();
            component.ability    = Ability.getAbility(AbilityID.abyssalOrb);
            component.radius     = 5f;
            component.limitCasts = false;
            component.duration   = 3f / (1f + increasedAbyssalOrbFrequency);
        }

        if (voidEruptionOnDeath)
        {
            CreateAbilityObjectOnDeath component = abilityObject.AddComponent <CreateAbilityObjectOnDeath>();
            component.abilityToInstantiate = Ability.getAbility(AbilityID.voidEruption);
            component.aimingMethod         = CreateAbilityObjectOnDeath.AimingMethod.Random;
        }

        if (increasedDuration != 0)
        {
            DestroyAfterDuration dad = abilityObject.GetComponent <DestroyAfterDuration>();
            if (dad)
            {
                dad.duration *= (1 + increasedDuration);
            }
        }


        return(abilityObject);
    }