public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { if (additionalDuration > 0) { DestroyAfterDuration durationObject = abilityObject.GetComponent <DestroyAfterDuration>(); if (durationObject != null) { durationObject.duration += additionalDuration; } } // increase the strength of the pull if (pullMultiplier != 1) { RepeatedlyPullEnemiesWithinRadius pull = abilityObject.GetComponent <RepeatedlyPullEnemiesWithinRadius>(); if (pull) { pull.distanceMultiplier = 1 - (1 - pull.distanceMultiplier) * pullMultiplier; } } if (increasedBasePhysicalDamage > 0) { foreach (DamageStatsHolder damage in abilityObject.GetComponents <DamageStatsHolder>()) { damage.addBaseDamage(DamageType.PHYSICAL, damage.getBaseDamage(DamageType.PHYSICAL) * increasedBasePhysicalDamage); } } if (fireTornado) { // change the vfx foreach (Transform t in abilityObject.transform) { if (t.name == "TornadoVFX") { t.gameObject.SetActive(false); } if (t.name == "Tornado_Fire") { t.gameObject.SetActive(true); } } // change the damage to fire foreach (DamageStatsHolder damage in abilityObject.GetComponents <DamageStatsHolder>()) { damage.addBaseDamage(DamageType.FIRE, damage.getBaseDamage(DamageType.PHYSICAL)); damage.addBaseDamage(DamageType.PHYSICAL, -damage.getBaseDamage(DamageType.PHYSICAL)); } } if (castsLightning) { RepeatedlyCastAtNearestEnemyWithinRadius cast = abilityObject.AddComponent <RepeatedlyCastAtNearestEnemyWithinRadius>(); cast.abilityToCast = AbilityIDList.getAbility(AbilityID.lesserLightning); cast.castInterval = lightningInterval; cast.radius = lightningRange; } if (stationary) { abilityObject.GetComponent <UnityEngine.AI.NavMeshAgent>().speed = 0f; Destroy(abilityObject.GetComponent <RandomNavmeshMovement>()); } if (attaches) { Destroy(abilityObject.GetComponent <UnityEngine.AI.NavMeshAgent>()); Destroy(abilityObject.GetComponent <RandomNavmeshMovement>()); AttachToCreatorOnCreation component = abilityObject.AddComponent <AttachToCreatorOnCreation>(); component.replaceExistingBuff = false; component.displacement = new Vector3(0, 1f, 0); } if (leavesStormOrbs) { CastAtRandomPointAfterDuration cast = abilityObject.AddComponent <CastAtRandomPointAfterDuration>(); cast.ability = Ability.getAbility(AbilityID.delayedStormOrb); cast.duration = 1f / (1 + increasedStormOrbFrequency); cast.radius = 0.5f; cast.limitCasts = false; } if (ignitesInAoe) { CastAfterDuration cad = abilityObject.AddComponent <CastAfterDuration>(); cad.ability = Ability.getAbility(AbilityID.invisibleIgniteNova); cad.interval = 1f / (1 + increasedIgniteFrequency); cad.limitCasts = false; } if (movementSpeedOnCast != 0 || manaRegenOnCast != 0 || attackAndCastSpeedOnCast != 0) { float buffDuration = 2f * (1 + increasedBuffDuration); if (movementSpeedOnCast != 0) { statBuffs.addBuff(buffDuration, Tags.Properties.Movespeed, 0, movementSpeedOnCast, null, null, null, "tornadoMovementSpeed"); } if (manaRegenOnCast != 0) { statBuffs.addBuff(buffDuration, Tags.Properties.ManaRegen, 0, manaRegenOnCast, null, null, null, "tornadoManaRegen"); } if (attackAndCastSpeedOnCast != 0) { statBuffs.addBuff(buffDuration, Tags.Properties.AttackSpeed, 0, attackAndCastSpeedOnCast, null, null, null, "tornadoAttackSpeed"); statBuffs.addBuff(buffDuration, Tags.Properties.CastSpeed, 0, attackAndCastSpeedOnCast, null, null, null, "tornadoCastSpeed"); } } return(abilityObject); }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { // attach mutators Glacier1Mutator g1m = abilityObject.AddComponent <Glacier1Mutator>(); g1m.chanceToCreateIceVortex = chanceToCreateIceVortexGlobal + chanceToCreateIceVortex1; g1m.chillChance = chillChanceGlobal + chillChance1; g1m.increasedDamage = increasedDamage1; g1m.moreDamageAgainstChilled = moreDamageAgainstChilled; g1m.increasedStunChance = increasedStunChance; g1m.addedCritChance = addedCritChance; g1m.chanceForSuperIceVortex = chanceForSuperIceVortex; Glacier2Mutator g2m = abilityObject.AddComponent <Glacier2Mutator>(); g2m.chanceToCreateIceVortex = chanceToCreateIceVortexGlobal + chanceToCreateIceVortex2; g2m.chillChance = chillChanceGlobal + chillChance2; g2m.increasedDamage = increasedDamage2; g2m.moreDamageAgainstChilled = moreDamageAgainstChilled; g2m.increasedStunChance = increasedStunChance; g2m.addedCritChance = addedCritChance; g2m.chanceForSuperIceVortex = chanceForSuperIceVortex; Glacier3Mutator g3m = abilityObject.AddComponent <Glacier3Mutator>(); g3m.chanceToCreateIceVortex = chanceToCreateIceVortexGlobal + chanceToCreateIceVortex3; g3m.chillChance = chillChanceGlobal + chillChance3; g3m.increasedDamage = increasedDamage3; g3m.moreDamageAgainstChilled = moreDamageAgainstChilled; g3m.increasedStunChance = increasedStunChance; g3m.addedCritChance = addedCritChance; g3m.chanceForSuperIceVortex = chanceForSuperIceVortex; // reverse order of explosions if (reverseExplosions) { CastAfterDuration cad1 = null; CastAfterDuration cad3 = null; foreach (CastAfterDuration cad in abilityObject.GetComponents <CastAfterDuration>()) { if (cad.ability == AbilityIDList.getAbility(AbilityID.glacier1)) { cad1 = cad; } else if (cad.ability == AbilityIDList.getAbility(AbilityID.glacier3)) { cad3 = cad; } } if (cad1 && cad3) { cad1.ability = AbilityIDList.getAbility(AbilityID.glacier3); cad3.ability = AbilityIDList.getAbility(AbilityID.glacier1); } } // remove the largest explosion if (removeLargestExplosion) { CastAfterDuration cadToDestroy = null; foreach (CastAfterDuration cad in abilityObject.GetComponents <CastAfterDuration>()) { if (cad.ability == AbilityIDList.getAbility(AbilityID.glacier3)) { cadToDestroy = cad; } } cadToDestroy.enabled = false; Destroy(cadToDestroy); } // make all the explosions occur at the target location if (noMovement) { abilityObject.GetComponent <AbilityMover>().speed = 0; abilityObject.AddComponent <StartsAtTarget>(); } return(abilityObject); }
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) { // get a reference to the child's SummonEntityOnDeath component, this the component that makes the wolf SummonEntityOnDeath summoner = abilityObject.GetComponent <SummonEntityOnDeath>(); // add additional stats summoner.statList.AddRange(statList); // crit on cast buff if (critFromManaCost && mana && statBuffs) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CriticalChance, null); stat.increasedValue = mana.getManaCost(ability) * 0.01f; statBuffs.addTaggedBuff(new TaggedBuff(stat, 4f, "Summon wraith mana crit")); } // add corpse consumption stats bool corpseConsumed = false; if (corpseStatList != null && corpseStatList.Count > 0 && health && health.alignmentManager && health.alignmentManager.alignment != null) { float closestDistance = float.MaxValue; Dying closestDying = null; float distance = 0f; // check all corpses to find the closest foreach (Dying dying in Dying.all) { // check that the entity is dying and is an enemy if (dying.isDying() && dying.myHealth && dying.myHealth.alignmentManager && health.alignmentManager.alignment.foes.Contains(dying.myHealth.alignmentManager.alignment)) { // find the distance distance = Maths.manhattanDistance(dying.transform.position, targetLocation); // don't consume very distant corpses if (distance <= 8f) { // if a closest one hasn't been found yet this is the closest if (closestDying == null) { closestDying = dying; closestDistance = distance; } // otherwise compare distances else { if (distance < closestDistance) { closestDying = dying; closestDistance = distance; } } } } } // consume the closest corpse if (closestDying) { closestDying.setDelays(0f, 0f); corpseConsumed = true; // apply the stats summoner.statList.AddRange(corpseStatList); // create a death vfx Instantiate(spiritEscapePrefab).transform.position = closestDying.transform.position + spiritEscapeOffset; } } float realBloodWraithChance = 0f; if (corpseConsumed) { realBloodWraithChance = bloodWraithChance; } // summon a different type of wraith if (flameWraithChance != 0 || realBloodWraithChance != 0 || putridWraithChance != 0) { float rand = Random.Range(0f, 1f); if (rand < flameWraithChance) { summoner.entity = flameWraithPrefab; } else if (rand < flameWraithChance + realBloodWraithChance) { summoner.entity = bloodWraithPrefab; } else if (rand < flameWraithChance + realBloodWraithChance + putridWraithChance) { summoner.entity = putridWraithPrefab; } } if (targetting == WraithTargetType.onSpot) { StartsTowardsTarget component = abilityObject.GetComponent <StartsTowardsTarget>(); if (component) { component.active = false; } if (summoner) { summoner.distance = 0.5f; } } if (targetting == WraithTargetType.atTarget) { StartsTowardsTarget component = abilityObject.GetComponent <StartsTowardsTarget>(); if (component) { component.active = false; } abilityObject.AddComponent <StartsAtTarget>(); } // delayed wraith casts if (delayedWraiths > 0) { CastAfterDuration cad = abilityObject.AddComponent <CastAfterDuration>(); cad.ability = ability; cad.interval = 0.5f * (1 - reducedWraithInterval); cad.limitCasts = true; cad.remainingCasts = delayedWraiths; DestroyAfterDuration dad = abilityObject.GetComponent <DestroyAfterDuration>(); dad.duration = (0.5f * (1 + delayedWraiths)) * (1f - reducedWraithInterval); SummonWraithMutator mutator = abilityObject.AddComponent <SummonWraithMutator>(); // copy stats mutator.reducedHealthDrain = reducedHealthDrain; mutator.stationary = stationary; mutator.flameWraithChance = flameWraithChance; mutator.bloodWraithChance = realBloodWraithChance; mutator.putridWraithChance = putridWraithChance; // wraith prefabs mutator.flameWraithPrefab = flameWraithPrefab; mutator.bloodWraithPrefab = bloodWraithPrefab; mutator.putridWraithPrefab = putridWraithPrefab; // delayed wraith changes mutator.targetting = WraithTargetType.onSpot; mutator.delayedWraiths = 0; mutator.reducedWraithInterval = 0f; mutator.critFromManaCost = false; mutator.healOnCrit = 0f; // stats and corpse stats (does not consume multiple corpses) mutator.statList.AddRange(statList); if (corpseConsumed) { mutator.statList.AddRange(corpseStatList); } } // change the adapter WraithAdapter adapter = abilityObject.AddComponent <WraithAdapter>(); adapter.reducedHealthDrain = reducedHealthDrain; adapter.stationary = stationary; 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) { if (increasedSpeed != 0) { AbilityMover component = abilityObject.GetComponent <AbilityMover>(); if (component) { component.speed *= 1 + increasedSpeed; } } if (convertToCold) { foreach (Transform child in abilityObject.transform) { if (child.name == "VolcanicOrbVFX") { child.gameObject.SetActive(false); } if (child.name == "FrozenOrbVFX") { child.gameObject.SetActive(true); } } foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>()) { holder.addBaseDamage(DamageType.COLD, holder.getBaseDamage(DamageType.FIRE)); holder.addBaseDamage(DamageType.FIRE, -holder.getBaseDamage(DamageType.FIRE)); } foreach (CreateOnDeath cod in abilityObject.GetComponents <CreateOnDeath>()) { cod.objectsToCreateOnDeath.Clear(); //cod.objectsToCreateOnDeath.Add(new CreateOnDeath.GameObjectHolder(PrefabList.getPrefab("QuickIceCircleVFX"))); } } ShrapnelMutator shrapMut = abilityObject.AddComponent <ShrapnelMutator>(); shrapMut.increasedDamage = increasedShrapnelDamage; shrapMut.increasedSpeed = increasedShrapnelSpeed; shrapMut.increasedStunChance = increasedShrapnelStunChance; shrapMut.convertToCold = convertToCold; shrapMut.pierces = shrapnelPierces; shrapMut.chillChance = chillChance; shrapMut.moreDamageInstances = moreDamageInstances; shrapMut.moreDamageAgainstChilled = moreShrapnelDamageAgainstChilled; shrapMut.addedProjectiles = addedShrapnelProjectiles; if (chillChance > 0) { ChanceToApplyStatusOnEnemyHit newComponent = abilityObject.AddComponent <ChanceToApplyStatusOnEnemyHit>(); newComponent.statusEffect = StatusEffectList.getEffect(StatusEffectID.Chill); newComponent.chance = chillChance; } if (increasedDuration != 0 || baseDurationis2) { DestroyAfterDuration dad = abilityObject.GetComponent <DestroyAfterDuration>(); if (dad) { if (baseDurationis2) { dad.duration = 2f + (1f * increasedDuration); } else { dad.duration *= (1f + increasedDuration); } } } if (leavesExplosion) { CreateAbilityObjectOnDeath component = abilityObject.AddComponent <CreateAbilityObjectOnDeath>(); component.abilityToInstantiate = AbilityIDList.getAbility(AbilityID.fireCircle); component.offset = new Vector3(0f, -1f, 0f); FireCircleMutator circleMut = abilityObject.AddComponent <FireCircleMutator>(); circleMut.chillChance = chillChance; circleMut.convertToCold = convertToCold; circleMut.igniteChance = explosionIgniteChance; circleMut.increasedDamage = increasedExplosionDamage; } if (delayedExpolosionAtStart) { CastAfterDuration component = abilityObject.AddComponent <CastAfterDuration>(); component.ability = AbilityIDList.getAbility(AbilityID.delayedFireCircle); component.limitCasts = true; component.remainingCasts = 1; component.age = 10f; component.interval = 1f; component.offset = new Vector3(0f, -1.3f, 0f); DelayedFireCircleMutator circleMut = abilityObject.AddComponent <DelayedFireCircleMutator>(); circleMut.chillChance = chillChance; circleMut.convertToCold = convertToCold; circleMut.igniteChance = explosionIgniteChance; circleMut.increasedDamage = increasedExplosionDamage; } if (leavesExplosiveGround) { CastAfterDuration cad = abilityObject.AddComponent <CastAfterDuration>(); if (convertToCold) { cad.ability = AbilityIDList.getAbility(AbilityID.shatteringGround); } else { cad.ability = AbilityIDList.getAbility(AbilityID.explosiveGround); } cad.limitCasts = false; cad.interval = 0.79f / (1f + increasedExplosiveGroundFrequency); cad.age = 0.6f / (1f + increasedExplosiveGroundFrequency); } if (increasedDamage != 0) { foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>()) { holder.increaseAllDamage(increasedDamage); } } 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); }