public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { if (extraStats != null && extraStats.Count > 0) { BuffParent component = abilityObject.GetComponent <BuffParent>(); if (component) { component.taggedStats.AddRange(extraStats); } } return(abilityObject); }
public void Apply(GameObject hitObject) { GameObject effect = Instantiate(statusEffect.effectObject, hitObject.transform); StatusDamage statusDamage = effect.GetComponent <StatusDamage>(); TaggedStatsHolder myTaggedStatsHolder = GetComponent <TaggedStatsHolder>(); ProtectionClass protection = hitObject.GetComponent <ProtectionClass>(); if (protection) { if (statusDamage && myTaggedStatsHolder) { TaggedStatsHolder taggedStatsHolder = effect.AddComponent <TaggedStatsHolder>(); taggedStatsHolder.simpleStats.AddRange(myTaggedStatsHolder.simpleStats); taggedStatsHolder.taggedStats.AddRange(myTaggedStatsHolder.taggedStats); // apply DoT damage foreach (TaggedStatsHolder.TaggableStat taggableStat in taggedStatsHolder.taggedStats) { if (taggableStat.tagList.Contains(Tags.AbilityTags.DoT)) { taggableStat.tagList.Remove(Tags.AbilityTags.DoT); } } // build damage stats if necessary foreach (DamageStatsHolder holder in effect.GetComponents <DamageStatsHolder>()) { holder.damageStats = DamageStats.buildDamageStats(holder, taggedStatsHolder); } } // add creation reference CreationReferences myReferences = GetComponent <CreationReferences>(); if (myReferences) { CreationReferences references = effect.AddComponent <CreationReferences>(); references.creator = myReferences.creator; references.thisAbility = myReferences.thisAbility; } // add alignment AlignmentManager myAlignmentManager = GetComponent <AlignmentManager>(); if (myAlignmentManager) { AlignmentManager alignmentManager = effect.AddComponent <AlignmentManager>(); alignmentManager.alignment = myAlignmentManager.alignment; } // apply shock effect if (statusEffect.effectID == 13) { TaggedStatsHolder tsh = GetComponent <TaggedStatsHolder>(); if (tsh) { float shockEffect = tsh.GetStatValue(Tags.Properties.IncreasedShockEffect); BuffParent pb = effect.GetComponent <BuffParent>(); if (shockEffect != 0 && pb) { foreach (TaggedStatsHolder.TaggableStat stat in pb.taggedStats) { stat.addedValue *= (1 + shockEffect); stat.increasedValue *= (1 + shockEffect); } } } } // apply protection.effectControl.AddEffect(effect, effect.GetComponent <StatusEffect>()); } }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { // add additional duration if (additionalDuration != 0) { DestroyAfterDuration durationObject = abilityObject.GetComponent <DestroyAfterDuration>(); if (durationObject != null) { durationObject.duration += additionalDuration; } } // add additional ward regen if (additionalWardRegen > 0) { BuffParent protectionObject = abilityObject.GetComponent <BuffParent>(); if (protectionObject != null) { protectionObject.wardRegen += additionalWardRegen; } } // add additional elemental protection if (additionalElementalProtection != 0 || igniteChanceGranted != 0 || grantsColdDamage || grantsLightningDamage) { BuffParent protectionObject = abilityObject.GetComponent <BuffParent>(); if (protectionObject != null) { if (additionalElementalProtection != 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.FireProtection, new List <Tags.AbilityTags>()); stat.addedValue = additionalElementalProtection; protectionObject.taggedStats.Add(stat); TaggedStatsHolder.TaggableStat stat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.ColdProtection, new List <Tags.AbilityTags>()); stat2.addedValue = additionalElementalProtection; protectionObject.taggedStats.Add(stat2); TaggedStatsHolder.TaggableStat stat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.LightningProtection, new List <Tags.AbilityTags>()); stat3.addedValue = additionalElementalProtection; protectionObject.taggedStats.Add(stat3); } if (igniteChanceGranted != 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.IgniteChance, new List <Tags.AbilityTags>()); stat.addedValue = igniteChanceGranted; protectionObject.taggedStats.Add(stat); } if (grantsColdDamage) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Cold); TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); stat.increasedValue = 0.4f; protectionObject.taggedStats.Add(stat); } if (grantsLightningDamage) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Lightning); TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); stat.increasedValue = 0.4f; protectionObject.taggedStats.Add(stat); } } } // allow casting on allies if (canCastOnAllies) { abilityObject.GetComponent <AttachToCreatorOnCreation>().runOnCreation = false; abilityObject.AddComponent <AttachToNearestAllyOnCreation>(); abilityObject.AddComponent <StartsAtTarget>(); } // set damage threshold if (abilityObject.GetComponent <RetaliateWhenParentHit>()) { abilityObject.GetComponent <RetaliateWhenParentHit>().damageTakenTrigger = (int)damageThreshold; } // aoe damage if (aoeDamage != 0) { RepeatedlyDamageEnemiesWithinRadius repeatDamage = abilityObject.GetComponent <RepeatedlyDamageEnemiesWithinRadius>(); if (repeatDamage == null) { repeatDamage = abilityObject.AddComponent <RepeatedlyDamageEnemiesWithinRadius>(); } if (repeatDamage.baseDamageStats.damage == null) { repeatDamage.baseDamageStats.damage = new List <DamageStatsHolder.DamageTypesAndValues>(); } repeatDamage.baseDamageStats.damage.Add(new DamageStatsHolder.DamageTypesAndValues(DamageType.FIRE, aoeDamage)); repeatDamage.damageInterval = 0.33f; repeatDamage.radius = aoeRadius; repeatDamage.baseDamageStats.addedDamageScaling = 0.17f; repeatDamage.tags.Add(Tags.AbilityTags.AoE); repeatDamage.tags.Add(Tags.AbilityTags.Spell); repeatDamage.tags.Add(Tags.AbilityTags.DoT); foreach (Transform child in abilityObject.transform) { if (child.name == "Circle") { child.gameObject.SetActive(true); child.transform.localScale = new Vector3(1.3f * aoeRadius / 3.5f, 1, 1.3f * aoeRadius / 3.5f); } } } // igniting if (ignitesInAoe) { CastAfterDuration cad = abilityObject.AddComponent <CastAfterDuration>(); cad.ability = AbilityIDList.getAbility(AbilityID.invisibleIgniteNova); if (increasedIgniteFrequency != 0) { if (increasedIgniteFrequency >= 0.9f) { increasedIgniteFrequency = 0.9f; } cad.interval /= (1 + increasedIgniteFrequency); } } // mutating fireball if (fireballIgniteChance != 0 || fireballPierces || increasedFireballDamage != 0) { FireballMutator fireballMutator = abilityObject.AddComponent <FireballMutator>(); fireballMutator.increasedDamage = increasedFireballDamage; fireballMutator.igniteChance = fireballIgniteChance; if (fireballPierces) { fireballMutator.targetsToPierce += 1000; } } return(abilityObject); }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { BuffParent buffObject = abilityObject.GetComponent <BuffParent>(); // add additional duration if (additionalDuration != 0) { DestroyAfterDuration durationObject = abilityObject.GetComponent <DestroyAfterDuration>(); if (durationObject != null) { durationObject.duration += additionalDuration; } } // add additional block chance if (additionalBlockChance > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockChance, new List <Tags.AbilityTags>()); stat.addedValue = additionalBlockChance; buffObject.taggedStats.Add(stat); } // add additional block protections if (additionalBlockElementalProtection != 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockFireProtection, new List <Tags.AbilityTags>()); stat.addedValue = additionalBlockElementalProtection; buffObject.taggedStats.Add(stat); TaggedStatsHolder.TaggableStat stat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockColdProtection, new List <Tags.AbilityTags>()); stat2.addedValue = additionalBlockElementalProtection; buffObject.taggedStats.Add(stat2); TaggedStatsHolder.TaggableStat stat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockLightningProtection, new List <Tags.AbilityTags>()); stat3.addedValue = additionalBlockElementalProtection; buffObject.taggedStats.Add(stat3); } // add additional block armour if (additionalBlockArmour != 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockArmor, new List <Tags.AbilityTags>()); stat.addedValue = additionalBlockArmour; buffObject.taggedStats.Add(stat); } // add additional armour if (additionalArmour != 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Armour, new List <Tags.AbilityTags>()); stat.addedValue = additionalArmour; buffObject.taggedStats.Add(stat); } // allow casting on allies if (canCastOnAllies) { abilityObject.GetComponent <AttachToCreatorOnCreation>().runOnCreation = false; abilityObject.AddComponent <AttachToNearestAllyOnCreation>(); abilityObject.AddComponent <StartsAtTarget>(); } //adds ward gain on block if (wardOnBlock > 0) { List <Tags.AbilityTags> onBlock = new List <Tags.AbilityTags> (); onBlock.Add(Tags.AbilityTags.Block); TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.WardGain, onBlock); stat.addedValue = wardOnBlock; buffObject.taggedStats.Add(stat); } // ensure that reduced mana penalty is not greater than 1 float newReducedManaPenalty = reducedManaPenalty; if (newReducedManaPenalty > 1) { newReducedManaPenalty = 1; } // reduced mana penalties if (reducedManaPenalty != 0) { // reduce the "less" penalty intrinsic to the skill TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.ManaDrain, new List <Tags.AbilityTags>()); // reducing a 20% less penalty by 40% is the same as adding a 10% more multiplier stat.moreValues.Add(-newReducedManaPenalty); buffObject.taggedStats.Add(stat); } // add reduced mana regen (after being altered by reduced mana penalties) if (extraManaDrain != 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.ManaDrain, new List <Tags.AbilityTags>()); stat.addedValue = extraManaDrain; buffObject.taggedStats.Add(stat); } // add ward retention if (additionalWardRetention != 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.WardRetention, new List <Tags.AbilityTags>()); stat.addedValue = additionalWardRetention; buffObject.taggedStats.Add(stat); } // ice nova if (castsFrostNova) { CastAfterDuration cad = abilityObject.AddComponent <CastAfterDuration>(); cad.limitCasts = false; cad.interval = 3f / (1 + increasedFrostNovaFrequency); cad.ability = AbilityIDList.getAbility(AbilityID.frostNova); FrostNovaMutator novaMutator = abilityObject.AddComponent <FrostNovaMutator>(); novaMutator.increasedDamage = novaDamage; novaMutator.addedCritChance = novaCritChance; novaMutator.addedCritMultiplier = novaCritMulti; } // add additional ward regen if (additionalWardRegen > 0) { BuffParent protectionObject = abilityObject.GetComponent <BuffParent>(); if (protectionObject != null) { protectionObject.wardRegen += additionalWardRegen; } } return(abilityObject); }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { float newAddedVoidDamage = addedVoidDamage; if (addedVoidReducedByAttackSpeed != 0) { float voidDamageToAdd = addedVoidReducedByAttackSpeed; if (baseStats) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Melee); float increasedAttackSpeed = baseStats.GetStatValue(Tags.Properties.AttackSpeed, tagList) - 1; voidDamageToAdd *= (1 - increasedAttackSpeed); } if (voidDamageToAdd > 0) { newAddedVoidDamage += voidDamageToAdd; } } ShieldRushEndMutator mutator = abilityObject.AddComponent <ShieldRushEndMutator>(); mutator.increasedDamage = increasedDamage; mutator.increasedRadius = increasedRadius; mutator.timeRotChance = timeRotChance; mutator.increasesDamageTaken = increasesDamageTaken; mutator.increasesDoTDamageTaken = increasesDoTDamageTaken; mutator.increasedStunChance = increasedStunChance; mutator.addedCritMultiplier = addedCritMultiplier; mutator.addedCritChance = addedCritChance; mutator.leaveDelayed = leaveDelayed; mutator.increasedDelayLength = increasedDelayLength; mutator.delayIncreasedDamage = delayIncreasedDamage; mutator.delayIncreasedRadius = delayIncreasedRadius; mutator.delayTimeRotChance = delayTimeRotChance; mutator.delayIncreasesDamageTaken = delayIncreasesDamageTaken; mutator.delayIncreasesDoTDamageTaken = delayIncreasesDoTDamageTaken; mutator.delayIncreasedStunChance = delayIncreasedStunChance; mutator.delayAddedCritMultiplier = delayAddedCritMultiplier; mutator.delayAddedCritChance = delayAddedCritChance; mutator.addedVoidDamage = newAddedVoidDamage + additionalAoEAddedVoidDamage; if (newAddedVoidDamage > 0) { foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>()) { holder.addBaseDamage(DamageType.VOID, addedVoidDamage); } } if (moreTravelDamageAgainstFullHealth != 0) { // create the conditional DamageConditionalEffect conditionalEffect = new DamageConditionalEffect(); conditionalEffect.conditional = new FullHealthConditional(); conditionalEffect.effect = new DamageEffectMoreDamage(moreTravelDamageAgainstFullHealth); // add the conditional to all damage stats holders foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>()) { holder.baseDamageStats.conditionalEffects.Add(conditionalEffect); } } if (forwardVoidBeam) { CreateAbilityObjectOnStart component = abilityObject.AddComponent <CreateAbilityObjectOnStart>(); component.abilityToInstantiate = Ability.getAbility(AbilityID.forwardVoidBeam); component.aimingMethod = CreateAbilityObjectOnStart.AimingMethod.TargetDirection; component.createAtStartLocation = true; } if (backwardsVoidBeam) { CreateAbilityObjectOnDeath component = abilityObject.AddComponent <CreateAbilityObjectOnDeath>(); component.abilityToInstantiate = Ability.getAbility(AbilityID.backwardsVoidBeam); component.aimingMethod = CreateAbilityObjectOnDeath.AimingMethod.TravelDirection; } if (returnToStart) { ReturnCasterToOlderPosition component = abilityObject.AddComponent <ReturnCasterToOlderPosition>(); component.increasePositionAgeWithAge = true; component.positionAge = 0f; component.restoreMana = restoreMana; component.additionalAgeForManaRestoration = 0.35f; component.whenToMoveCaster = ReturnCasterToOlderPosition.StartOrEnd.End; } if (percentCurrentHealthLostOnCast != 0 && health) { health.HealthDamage(health.currentHealth * percentCurrentHealthLostOnCast); } if (increasedTravelDamage != 0) { foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>()) { holder.increaseAllDamage(increasedTravelDamage); } } if (increasedTravelStunChance != 0) { foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>()) { holder.baseDamageStats.increasedStunChance += increasedStunChance; } } if (statsWhileTravelling != null && statsWhileTravelling.Count > 0) { BuffParent bp = abilityObject.GetComponent <BuffParent>(); if (!bp) { bp = abilityObject.AddComponent <BuffParent>(); } List <TaggedStatsHolder.TaggableStat> stats = new List <TaggedStatsHolder.TaggableStat>(); foreach (TaggedStatsHolder.TaggableStat stat in statsWhileTravelling) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(stat); stats.Add(newStat); } bp.taggedStats.AddRange(stats); } if (increasedRadius > 0) { foreach (CreateOnDeath cod in abilityObject.GetComponents <CreateOnDeath>()) { cod.increasedRadius = increasedRadius; cod.increasedHeight = increasedRadius; } } return(abilityObject); }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { // add additional duration if (increasedDuration != 0) { DestroyAfterDuration durationObject = abilityObject.GetComponent <DestroyAfterDuration>(); if (durationObject != null) { durationObject.duration *= (1 + increasedDuration); } } // set damage threshold if (additionalRetaliations != 0) { RetaliateWhenParentHit retaliator = abilityObject.GetComponent <RetaliateWhenParentHit>(); if (retaliator) { retaliator.retaliationsRemaining += additionalRetaliations; } } // add dark blade retaliation if (darkBladeRetaliationChance > 0) { if (Random.Range(0f, 1f) < darkBladeRetaliationChance) { RetaliateWhenParentHit retaliator = abilityObject.AddComponent <RetaliateWhenParentHit>(); retaliator.limitRetaliations = true; retaliator.onlyCountHitDamage = true; retaliator.ability = Ability.getAbility(AbilityID.darkBlade); retaliator.damageTakenTrigger = 1; retaliator.destroyAfterLastRetaliation = false; retaliator.sourceOfAbility = RetaliateWhenParentHit.SourceOfAbilityObjectConstructor.Parent; retaliator.retaliationsRemaining = 1; } } // stats while prepped if (statsWhilePrepped != null && statsWhilePrepped.Count > 0) { BuffParent bp = abilityObject.GetComponent <BuffParent>(); if (!bp) { bp = abilityObject.AddComponent <BuffParent>(); } List <TaggedStatsHolder.TaggableStat> stats = new List <TaggedStatsHolder.TaggableStat>(); foreach (TaggedStatsHolder.TaggableStat stat in statsWhilePrepped) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(stat); stats.Add(newStat); } bp.taggedStats.AddRange(stats); } return(abilityObject); }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { float newIncreasedRadius = increasedRadius; if (increasedRadiusWhileNotUsingAShield > 0) { if (!weaponInfoHolder) { weaponInfoHolder = GetComponent <WeaponInfoHolder>(); } if (weaponInfoHolder && !weaponInfoHolder.hasShield) { newIncreasedRadius = increasedRadiusWhileNotUsingAShield; } } TempestHitMutator hitMutator = abilityObject.AddComponent <TempestHitMutator>(); hitMutator.addedCritMultiplier = addedCritMultiplier; hitMutator.addedCritChance = addedCritChance; hitMutator.increasedDamage = increasedDamage; hitMutator.timeRotChance = timeRotChance; hitMutator.moreDamageAgainstFullHealth = moreDamageAgainstFullHealth; hitMutator.increasedRadius = newIncreasedRadius; hitMutator.igniteChance = igniteChance; hitMutator.addedVoidDamage = addedVoidDamage; hitMutator.moreDamageAgainstTimeRotting = moreDamageAgainstTimeRotting; if (increasedDamageWhileNotUsingAShield > 0) { if (!weaponInfoHolder) { weaponInfoHolder = GetComponent <WeaponInfoHolder>(); } if (weaponInfoHolder && !weaponInfoHolder.hasShield) { hitMutator.increasedDamage += increasedDamageWhileNotUsingAShield; } } if (newIncreasedRadius != 0) { foreach (Transform child in abilityObject.transform) { child.localScale = new Vector3(child.localScale.x * (1 + newIncreasedRadius), child.localScale.y, child.localScale.z * (1 + newIncreasedRadius)); } } if (statsWhileSpinning != null && statsWhileSpinning.Count > 0) { BuffParent bp = abilityObject.GetComponent <BuffParent>(); if (!bp) { bp = abilityObject.AddComponent <BuffParent>(); } List <TaggedStatsHolder.TaggableStat> stats = new List <TaggedStatsHolder.TaggableStat>(); foreach (TaggedStatsHolder.TaggableStat stat in statsWhileSpinning) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(stat); stats.Add(newStat); } if (!weaponInfoHolder) { weaponInfoHolder = GetComponent <WeaponInfoHolder>(); } if (weaponInfoHolder && !weaponInfoHolder.hasShield) { foreach (TaggedStatsHolder.TaggableStat stat in statsWhileSpinningIfNotUsingAShield) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(stat); stats.Add(newStat); } } bp.taggedStats.AddRange(stats); } if (castsAbyssalOrb) { CastAfterDuration cad = abilityObject.AddComponent <CastAfterDuration>(); cad.ability = Ability.getAbility(AbilityID.abyssalOrb); cad.interval = 1f / (1f + increasedAbyssalOrbFrequence); cad.randomAiming = true; } if (pulls) { RepeatedlyPullEnemiesWithinRadius component = abilityObject.AddComponent <RepeatedlyPullEnemiesWithinRadius>(); component.radius = 5f * (1 + increasedPullRadius); component.distanceMultiplier = 0.98f; if (strongerPull) { component.distanceMultiplier = 0.96f; } component.interval = 0.02f; //CastAfterDuration cad = abilityObject.AddComponent<CastAfterDuration>(); //cad.ability = Ability.getAbility(AbilityID.bigPull); //cad.interval = 0.5f; //cad.age = Random.Range(0.1f, 0.9f); //BigPullMutator mut = abilityObject.AddComponent<BigPullMutator>(); //mut.increasedRadius = increasedPullRadius; } return(abilityObject); }