public override GameObject adapt(GameObject entity) { // aura if (extraLeafShieldStats != null && extraLeafShieldStats.Count > 0) { LeafShieldMutator mutator = entity.AddComponent <LeafShieldMutator>(); mutator.extraStats.AddRange(extraLeafShieldStats); } // roots if (castsEntanglingRoots) { EntanglingRootsMutator mutator = entity.AddComponent <EntanglingRootsMutator>(); mutator.increasedDamage = rootsIncreasedDamage; mutator.increasedRadius = rootsIncreasedRadius; mutator.addedPatches = rootsAddedPatches; mutator.patchesInLine = rootsPatchesInLine; mutator.vineOnKillChance = rootsVineOnKillChance; mutator.increasedDuration = rootsIncreasedDuration; mutator.healingNovaChance = rootsHealingNovaChance; } // vale orb mutator ValeOrbMutator orbMutator = entity.AddComponent <ValeOrbMutator>(); orbMutator.extraProjectiles = orbExtraProjectiles; orbMutator.targetsToPierce = orbTargetsToPierce; orbMutator.increasedCastSpeed = orbIncreasedCastSpeed; orbMutator.fireInSequence = orbFireInSequence; orbMutator.chanceForDoubleDamage = orbChanceForDoubleDamage; orbMutator.increasedDamage = orbIncreasedDamage; orbMutator.moreDamageAgainstPoisoned = orbMoreDamageAgainstPoisoned; orbMutator.moreDamageAgainstBleeding = orbMoreDamageAgainstBleeding; // vines if (summonsVines) { SummonVineAtTargetMutator mutator = entity.AddComponent <SummonVineAtTargetMutator>(); mutator.extraVines = extraVines; } return(base.adapt(entity)); }
public override void updateMutator() { EntanglingRootsMutator mutator = PlayerFinder.getPlayer().GetComponent <EntanglingRootsMutator>(); float increasedDamage = 0f; float addedPoisonDamage = 0f; float increasedArea = 0f; float initialHitIncreasedDamage = 0f; float initialHitChanceToPoison = 0f; int addedPatches = 0; bool patchesInLine = false; float vineOnKillChance = 0f; float increasedBuffDuration = 0f; float damageBuff = 0f; float poisonChanceToWolves = 0f; float bleedchanceToBears = 0f; float castSpeedToSpriggans = 0f; bool healSpriggans = false; bool meleeScalingInitialHit = false; bool InitialHitAlwaysStuns = false; float increasedDuration = 0f; float increasedManaCost = 0f; float manaEfficiency = 0f; float healingNovaChance = 0f; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { if (node.name == "Entangling Roots Tree Vine On Kill") { vineOnKillChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Entangling Roots Tree Repeat Damage") { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Entangling Roots Tree Increased Duration") { increasedDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; increasedBuffDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } if (node.name == "Entangling Roots Tree Repeat Poison Chance") { addedPoisonDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.24f; } if (node.name == "Entangling Roots Tree Increased Area") { increasedArea += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; } if (node.name == "Entangling Roots Tree Patches") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { addedPatches += 2; increasedArea += -0.6f; increasedManaCost += 0.2f; } } if (node.name == "Entangling Roots Tree Additional Patches") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { addedPatches += 1; increasedDuration += -0.3f; increasedDamage += -0.1f; } } if (node.name == "Entangling Roots Tree Line") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { patchesInLine = true; } } if (node.name == "Entangling Roots Tree Damage Buff") { damageBuff += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Entangling Roots Tree Buff Duration") { increasedBuffDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Entangling Roots Tree Wolf Poison") { poisonChanceToWolves += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.34f; } if (node.name == "Entangling Roots Tree Bear Bleed") { bleedchanceToBears += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.34f; } if (node.name == "Entangling Roots Tree Spriggan Cast Speed") { castSpeedToSpriggans += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Entangling Roots Tree Heal Spriggans") { healSpriggans = (node.GetComponent <SkillTreeNode>().pointsAllocated > 0); } if (node.name == "Entangling Roots Tree Healing Nova") { healingNovaChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.34f; } if (node.name == "Entangling Roots Tree Mana Duration") { manaEfficiency += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; increasedDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.15f; } if (node.name == "Entangling Roots Tree Melee Initial Hit") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { meleeScalingInitialHit = true; increasedManaCost += 0.3f; } } if (node.name == "Entangling Roots Tree Initial Hit Damage") { initialHitIncreasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Entangling Roots Tree Initial Hit Long Stun") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { InitialHitAlwaysStuns = true; increasedManaCost += 0.1f; } } } mutator.increasedDamage = increasedDamage; mutator.addedPoisonDamage = addedPoisonDamage; mutator.increasedRadius = Mathf.Sqrt(increasedArea + 1) - 1; mutator.initialHitIncreasedDamage = initialHitIncreasedDamage; mutator.initialHitChanceToPoison = initialHitChanceToPoison; mutator.addedPatches = addedPatches; mutator.patchesInLine = patchesInLine; mutator.vineOnKillChance = vineOnKillChance; mutator.increasedBuffDuration = increasedBuffDuration; mutator.damageBuff = damageBuff; mutator.poisonChanceToWolves = poisonChanceToWolves; mutator.bleedchanceToBears = bleedchanceToBears; mutator.castSpeedToSpriggans = castSpeedToSpriggans; mutator.healSpriggans = healSpriggans; mutator.meleeScalingInitialHit = meleeScalingInitialHit; mutator.InitialHitAlwaysStuns = InitialHitAlwaysStuns; mutator.increasedDuration = increasedDuration; mutator.increasedManaCost = increasedManaCost; mutator.addedManaCostDivider = manaEfficiency; mutator.healingNovaChance = healingNovaChance; }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { // changing the repeated hit mutator if (increasedDamage != 0 || addedPoisonDamage != 0 || increasedRadius != 0) { EntanglingRootsHitMutator hitMutator = abilityObject.AddComponent <EntanglingRootsHitMutator>(); hitMutator.increasedDamage = increasedDamage; hitMutator.addedPoisonDamage = addedPoisonDamage; hitMutator.increasedRadius = increasedRadius; } // create the initial hit CastInLine initialiHitCreator = abilityObject.AddComponent <CastInLine>(); initialiHitCreator.ability = AbilityIDList.getAbility(AbilityID.entanglingRootsInitialHit); initialiHitCreator.casts = 1; initialiHitCreator.distancePerCast = 0; initialiHitCreator.targetPoint = targetLocation; // changing the initial hit mutator EntanglingRootsInitialHitMutator initialHitMutator = abilityObject.AddComponent <EntanglingRootsInitialHitMutator>(); initialHitMutator.increasedDamage = initialHitIncreasedDamage; initialHitMutator.chanceToPoison = initialHitChanceToPoison; initialHitMutator.increasedRadius = increasedRadius; initialHitMutator.increasedBuffDuration = increasedBuffDuration; initialHitMutator.damageBuff = damageBuff; initialHitMutator.poisonChanceToWolves = poisonChanceToWolves; initialHitMutator.bleedchanceToBears = bleedchanceToBears; initialHitMutator.castSpeedToSpriggans = castSpeedToSpriggans; initialHitMutator.healSpriggans = healSpriggans; initialHitMutator.meleeScalingInitialHit = meleeScalingInitialHit; initialHitMutator.alwaysStuns = InitialHitAlwaysStuns; // creating extra patches if (addedPatches > 0) { // add extra casts if (patchesInLine) { CastInLine component = abilityObject.AddComponent <CastInLine>(); component.ability = AbilityIDList.getAbility(AbilityID.entanglingRoots); component.casts = addedPatches; component.distancePerCast = 4; component.targetPoint = targetLocation; } else { CastAtRandomPointAfterDuration component = abilityObject.AddComponent <CastAtRandomPointAfterDuration>(); component.ability = AbilityIDList.getAbility(AbilityID.entanglingRoots); component.duration = 0.01f; component.limitCasts = true; component.remainingCasts = addedPatches; component.radius = 5f; } // copy mutator EntanglingRootsMutator mutator = abilityObject.AddComponent <EntanglingRootsMutator>(); mutator.increasedDamage = increasedDamage; mutator.addedPoisonDamage = addedPoisonDamage; mutator.increasedRadius = increasedRadius; mutator.initialHitIncreasedDamage = initialHitIncreasedDamage; mutator.initialHitChanceToPoison = initialHitChanceToPoison; mutator.increasedBuffDuration = increasedBuffDuration; mutator.damageBuff = damageBuff; mutator.poisonChanceToWolves = poisonChanceToWolves; mutator.bleedchanceToBears = bleedchanceToBears; mutator.castSpeedToSpriggans = castSpeedToSpriggans; mutator.healSpriggans = healSpriggans; mutator.meleeScalingInitialHit = meleeScalingInitialHit; mutator.InitialHitAlwaysStuns = InitialHitAlwaysStuns; mutator.increasedDuration = increasedDuration; mutator.healingNovaChance = healingNovaChance; } if (increasedDuration != 0) { DestroyAfterDuration dad = abilityObject.GetComponent <DestroyAfterDuration>(); if (dad) { dad.duration *= (1 + increasedDuration); } } if (increasedRadius != 0) { foreach (MagicalFX.FX_Tentacle_ultimate vfx in abilityObject.GetComponentsInChildren <MagicalFX.FX_Tentacle_ultimate>()) { vfx.SpreadMin *= (1 + increasedRadius); vfx.SpreadMax *= (1 + increasedRadius); vfx.SpreadSpawn *= (1 + increasedRadius); vfx.Number = (int)(((float)vfx.Number) * (1 + increasedRadius)); } } if (healingNovaChance > 0) { float rand = Random.Range(0f, 1f); if (rand < healingNovaChance) { CreateAbilityObjectOnDeath component = abilityObject.AddComponent <CreateAbilityObjectOnDeath>(); component.abilityToInstantiate = AbilityIDList.getAbility(AbilityID.healingNova); } } return(abilityObject); }