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)); } }
public StatFromAbilityUse(TaggedStatsHolder.TaggableStat _stat, List <Tags.AbilityTags> _requiredTags, float _duration, string _name, WeaponRequirementType _weaponRequirement = WeaponRequirementType.NoRequirement) { stat = _stat; requiredTags = _requiredTags; duration = _duration; name = _name; weaponRequirement = _weaponRequirement; }
public override GameObject adapt(GameObject entity) { // apply temporary stat buffs StatBuffs statBuffs = Comp <StatBuffs> .GetOrAdd(entity); TaggedStatsHolder.TaggableStat stat = null; TaggedBuff buff; for (int i = 0; i < tempStats.Count; i++) { stat = new TaggedStatsHolder.TaggableStat(tempStats[i]); buff = new TaggedBuff(stat, 15f); statBuffs.addTaggedBuff(buff); } return(base.adapt(entity)); }
public override void updateMutator() { VolatileReversalMutator mutator = PlayerFinder.getPlayer().GetComponent <VolatileReversalMutator>(); float increasedDamage = 0f; float increasedArea = 0f; float timeRotChance = 0f; float increasesDamageTaken = 0f; float increasesDoTDamageTaken = 0f; float increasedStunChance = 0f; bool voidRiftAtStart = false; bool voidRiftAtEnd = false; List <TaggedStatsHolder.TaggableStat> statsWhileOnCooldown = new List <TaggedStatsHolder.TaggableStat>(); List <TaggedStatsHolder.TaggableStat> statOnUse = new List <TaggedStatsHolder.TaggableStat>(); float percentCooldownRecoveredOnKill = 0f; float additionalSecondsBack = 0f; bool noHealthRestoration = false; bool noManaRestoration = false; bool healsOrDamagesAtRandom = false; float healOrDamagePercent = 0f; float increasedCooldownRecoverySpeed = 0f; AbilityObjectConstructor aoc = null; ChargeManager chargeManager = null; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { if (node.name == "Volatile Reversal Tree Rift At Start") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { voidRiftAtStart = true; } } if (node.name == "Volatile Reversal Tree Increased Damage") { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.22f; } if (node.name == "Volatile Reversal Tree Dot Damage Taken") { increasesDoTDamageTaken += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Volatile Reversal Tree Stun Chance") { increasedStunChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; } if (node.name == "Volatile Reversal Tree Rift At End") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { voidRiftAtStart = true; } } if (node.name == "Volatile Reversal Tree Increased Area") { increasedArea += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; } if (node.name == "Volatile Reversal Tree Damage Taken") { increasesDoTDamageTaken += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Volatile Reversal Tree Time Rot") { timeRotChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Volatile Reversal Tree Reduced Cooldown On Kill") { percentCooldownRecoveredOnKill += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.03f; } if (node.name == "Volatile Reversal Tree Movespeed") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, new List <Tags.AbilityTags>()); stat.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.12f; statOnUse.Add(stat); } } if (node.name == "Volatile Reversal Tree Attack and Cast Speed") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, new List <Tags.AbilityTags>()); stat.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.12f; statOnUse.Add(stat); TaggedStatsHolder.TaggableStat stat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, new List <Tags.AbilityTags>()); stat2.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.12f; statOnUse.Add(stat2); } } if (node.name == "Volatile Reversal Tree No Health Restored") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { noHealthRestoration = true; increasedCooldownRecoverySpeed += 2f; } } if (node.name == "Volatile Reversal Tree Random Heal") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { healsOrDamagesAtRandom = true; healOrDamagePercent = node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } } if (node.name == "Volatile Reversal Tree Cooldown vs Regen") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { increasedCooldownRecoverySpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.HealthRegen, new List <Tags.AbilityTags>()); stat.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.1f; statsWhileOnCooldown.Add(stat); } } if (node.name == "Volatile Reversal Tree Goes Back Further") { additionalSecondsBack += node.GetComponent <SkillTreeNode>().pointsAllocated * 1f; } if (node.name == "Volatile Reversal Tree Cooldown vs Damage Taken") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { increasedCooldownRecoverySpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, new List <Tags.AbilityTags>()); stat.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; statsWhileOnCooldown.Add(stat); } } if (node.name == "Volatile Reversal Tree No Mana Restored") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { noManaRestoration = true; increasedCooldownRecoverySpeed += 4f; } } if (node.name == "Volatile Reversal Tree Dodge On Cooldown") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DodgeRating, new List <Tags.AbilityTags>()); stat.addedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 50f; statsWhileOnCooldown.Add(stat); } } } mutator.increasedDamage = increasedDamage; mutator.increasedRadius = Mathf.Sqrt(increasedArea + 1) - 1; mutator.timeRotChance = timeRotChance; mutator.increasesDamageTaken = increasesDamageTaken; mutator.increasesDoTDamageTaken = increasesDoTDamageTaken; mutator.increasedStunChance = increasedStunChance; mutator.voidRiftAtStart = voidRiftAtStart; mutator.voidRiftAtEnd = voidRiftAtEnd; mutator.statsWhileOnCooldown = statsWhileOnCooldown; mutator.statOnUse = statOnUse; mutator.percentCooldownRecoveredOnKill = percentCooldownRecoveredOnKill; mutator.additionalSecondsBack = additionalSecondsBack; mutator.noHealthRestoration = noHealthRestoration; mutator.noManaRestoration = noManaRestoration; mutator.healsOrDamagesAtRandom = healsOrDamagesAtRandom; mutator.healOrDamagePercent = healOrDamagePercent; mutator.addedChargeRegen = ability.chargesGainedPerSecond * increasedCooldownRecoverySpeed; }
public override void updateMutator() { GameObject player = PlayerFinder.getPlayer(); SummonSkeletonMutator mutator = player.GetComponent <SummonSkeletonMutator>(); float additionalDuration = 0f; int additionalSkeletons = 0; int additionalWarlords = 0; bool limitDuration = false; List <TaggedStatsHolder.TaggableStat> statList = new List <TaggedStatsHolder.TaggableStat>(); List <TaggedStatsHolder.TaggableStat> warlordStatList = new List <TaggedStatsHolder.TaggableStat>(); List <TaggedStatsHolder.TaggableStat> corpseStatList = new List <TaggedStatsHolder.TaggableStat>(); List <TaggedStatsHolder.TaggableStat> corpseSelfBuffStatList = new List <TaggedStatsHolder.TaggableStat>(); List <TaggedStatsHolder.TaggableStat> skeleDiedRecentlyStats = new List <TaggedStatsHolder.TaggableStat>(); bool usesPoisonArrow = false; float increasedPoisonArrowCooldownSpeed = 0f; float increasedPoisonArrowCooldown = 0f; bool poisonArrowPierces = false; bool poisonArrowInaccurate = false; float poisonArrowIncreasedDamage = 0f; int poisonArrowDelayedAttacks = 0; bool usesMultishot = false; float increasedMultishotCooldownSpeed = 0f; bool usesDeathSlash = false; float increasedDeathSlashCooldownRecovery = 0f; bool usesNecroticMortar = false; float increasedNecroticMortarCooldownRecovery = 0f; bool usesInspire = false; float increasedInspireCooldownRecovery = 0f; bool cannotSummonWarriors = false; bool cannotSummonMages = false; bool canSummonArchers = false; bool canSummonWarlords = false; float healthOnSkeletonDeath = 0f; float wardOnSkeletonDeath = 0f; float manaOnSkeletonDeath = 0f; int additionalSkeletonsPerCast = 0; bool healSkeletonOnSkeletonDeath = false; float increasedManaCost = 0f; float manaEfficiency = 0f; SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Summon Skeleton Tree Damage And Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.05f; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Death Slash") { if (skillTreeNode.pointsAllocated > 0) { usesDeathSlash = true; } } if (node.name == "Summon Skeleton Tree Slash Cooldown") { if (skillTreeNode.pointsAllocated > 0) { increasedDeathSlashCooldownRecovery = 0.5f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Skeleton Tree Physical Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Physical); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.2f); statList.Add(newStat); } } if (node.name == "Summon Skeleton Tree Commander") { if (skillTreeNode.pointsAllocated > 0) { canSummonWarlords = true; increasedManaCost += 0.3f; } } if (node.name == "Summon Skeleton Tree Commander Damage") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.3f); warlordStatList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Additional Commander") { if (skillTreeNode.pointsAllocated > 0) { additionalWarlords += 1; } } if (node.name == "Summon Skeleton Tree Inspire") { if (skillTreeNode.pointsAllocated > 0) { usesInspire = true; } } if (node.name == "Summon Skeleton Tree Inspire Cooldown") { if (skillTreeNode.pointsAllocated > 0) { increasedInspireCooldownRecovery = 0.5f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Skeleton Tree Attack Speed And Leech") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.05f); statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat3.moreValues.Add(skillTreeNode.pointsAllocated * 0.05f); statList.Add(newStat3); List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Physical); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.PercentLifeLeech, tagList2); newStat2.addedValue = skillTreeNode.pointsAllocated * 0.05f; statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Armour Vs Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * -0.15f); statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Armour, null); newStat2.addedValue = skillTreeNode.pointsAllocated * 150f; statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree No Mages") { if (skillTreeNode.pointsAllocated > 0) { cannotSummonMages = true; } } if (node.name == "Summon Skeleton Tree Necrotic Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Necrotic); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.2f); statList.Add(newStat); } } if (node.name == "Summon Skeleton Tree Mortar") { if (skillTreeNode.pointsAllocated > 0) { usesNecroticMortar = true; } } if (node.name == "Summon Skeleton Tree Mortar Cooldown") { if (skillTreeNode.pointsAllocated > 0) { increasedNecroticMortarCooldownRecovery = 0.5f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Skeleton Tree Cast Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.08f); statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Necrotic Vs Phys Res") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Necrotic); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.25f); statList.Add(newStat); List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Physical); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, tagList2); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree No Warriors") { if (skillTreeNode.pointsAllocated > 0) { cannotSummonWarriors = true; } } if (node.name == "Summon Skeleton Tree Additional Skeletons Per Cast") { if (skillTreeNode.pointsAllocated > 0) { additionalSkeletonsPerCast += skillTreeNode.pointsAllocated; increasedManaCost += skillTreeNode.pointsAllocated * 1.1f; } } //if (node.name == "Summon Skeleton Tree One Skele Per Cast") //{ // if (skillTreeNode.pointsAllocated > 0) // { // onlySummonOneSkeletonAtOnce = true; // additionalSkeletons += 2; // } //} if (node.name == "Summon Skeleton Tree Corpse Consumption") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.3f); corpseStatList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Corpse Damage Reduction") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * -0.12f); corpseStatList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Corpse Cast Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.12f); corpseSelfBuffStatList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.12f); corpseStatList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Health") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.2f); statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Max Skeles Vs Life Drain") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CurrentHealthDrain, null); newStat2.addedValue = skillTreeNode.pointsAllocated * 0.03f; skeleDiedRecentlyStats.Add(newStat2); additionalSkeletons += skillTreeNode.pointsAllocated; } } if (node.name == "Summon Skeleton Tree Vitality") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Vitality, null); newStat2.addedValue = skillTreeNode.pointsAllocated * 1; statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Limit Duration") { if (skillTreeNode.pointsAllocated > 0) { limitDuration = true; increasedManaCost += 0.3f; } } if (node.name == "Summon Skeleton Tree Max Skeles Vs Mana Cost") { if (skillTreeNode.pointsAllocated > 0) { additionalSkeletons += skillTreeNode.pointsAllocated; increasedManaCost += skillTreeNode.pointsAllocated * 0.1f; } } if (node.name == "Summon Skeleton Tree Ward On Skele Death") { wardOnSkeletonDeath += node.GetComponent <SkillTreeNode>().pointsAllocated * 10; } if (node.name == "Summon Skeleton Tree Mana On Skele Death") { wardOnSkeletonDeath += node.GetComponent <SkillTreeNode>().pointsAllocated * 5; } if (node.name == "Summon Skeleton Tree Spell Damage On Skele Death") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Spell); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList2); newStat2.increasedValue = skillTreeNode.pointsAllocated * 0.25f; skeleDiedRecentlyStats.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Archers") { if (skillTreeNode.pointsAllocated > 0) { canSummonArchers = true; } } if (node.name == "Summon Skeleton Tree Poison Arrow") { if (skillTreeNode.pointsAllocated > 0) { usesPoisonArrow = true; } } if (node.name == "Summon Skeleton Tree Piercing Poison Arrow") { if (skillTreeNode.pointsAllocated > 0) { poisonArrowPierces = true; increasedPoisonArrowCooldown += 0.4f; } } if (node.name == "Summon Skeleton Tree Poison Arrow Cooldown") { if (skillTreeNode.pointsAllocated > 0) { increasedPoisonArrowCooldownSpeed = 0.5f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Skeleton Tree Poison Arrow Inaccuracy") { if (skillTreeNode.pointsAllocated > 0) { poisonArrowInaccurate = true; poisonArrowIncreasedDamage = 0.7f; } } if (node.name == "Summon Skeleton Tree Poison Arrow Extra Arrows") { if (skillTreeNode.pointsAllocated > 0) { poisonArrowDelayedAttacks += 1 * skillTreeNode.pointsAllocated; increasedPoisonArrowCooldown += 0.3f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Skeleton Tree Bleed Chance") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Physical); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BleedChance, tagList); newStat.addedValue = skillTreeNode.pointsAllocated * 0.25f; statList.Add(newStat); } } if (node.name == "Summon Skeleton Tree Bow Attack Speed") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Bow); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); statList.Add(newStat); } } if (node.name == "Summon Skeleton Tree Bow Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Bow); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.25f); statList.Add(newStat); } } if (node.name == "Summon Skeleton Tree Multishot") { if (skillTreeNode.pointsAllocated > 0) { usesMultishot = true; } } if (node.name == "Summon Skeleton Tree Multishot Cooldown") { if (skillTreeNode.pointsAllocated > 0) { increasedMultishotCooldownSpeed = 0.5f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Skeleton Tree Elemental Protection") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.HealthRegen, null); newStat.addedValue = skillTreeNode.pointsAllocated * 5f; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.ElementalProtection, null); newStat2.addedValue = skillTreeNode.pointsAllocated * 50f; statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Max Skeles vs Attack Speed") { if (skillTreeNode.pointsAllocated > 0) { additionalSkeletons += 1; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * -0.05f; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat2.increasedValue = skillTreeNode.pointsAllocated * -0.05f; statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Mana Efficiency") { if (skillTreeNode.pointsAllocated > 0) { manaEfficiency += skillTreeNode.pointsAllocated * 0.2f; TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CriticalChance, null); newStat2.increasedValue = skillTreeNode.pointsAllocated * 0.2f; statList.Add(newStat2); } } if (node.name == "Summon Skeleton Tree Heal Skeleton On Skeleton Death") { if (skillTreeNode.pointsAllocated > 0) { healSkeletonOnSkeletonDeath = true; } } } // second loop to react to whether there is no skeleton limit foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Summon Skeleton Tree Half Skeletons") { if (skillTreeNode.pointsAllocated > 0) { // if you have the node that turns the number limit into a duration limit reduce the duration if (limitDuration) { additionalDuration = ((20f + additionalDuration) * 0.4f) - 20; } // otherwise reduce the number else { additionalSkeletons = Mathf.CeilToInt((4f + (float)additionalSkeletons) / 2) - 4; } TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.35f); statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.35f); statList.Add(newStat2); // avoid buffing warlords, by adding equivalent bonuses as quotient modifiers TaggedStatsHolder.TaggableStat newStat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat3.quotientValues.Add(skillTreeNode.pointsAllocated * 0.35f); warlordStatList.Add(newStat3); TaggedStatsHolder.TaggableStat newStat4 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat4.quotientValues.Add(skillTreeNode.pointsAllocated * 0.35f); warlordStatList.Add(newStat4); } } // needs to know whether to give duration or health if (node.name == "Summon Skeleton Tree Additional Duration") { if (skillTreeNode.pointsAllocated > 0) { if (limitDuration) { additionalDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 4; } else { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.addedValue = skillTreeNode.pointsAllocated * 14f; statList.Add(newStat); } } } } // update the mutator mutator.additionalDuration = additionalDuration; mutator.additionalSkeletons = additionalSkeletons; mutator.additionalWarlords = additionalWarlords; mutator.limitDuration = limitDuration; mutator.statList = statList; mutator.warlordStatList = warlordStatList; mutator.corpseStatList = corpseStatList; mutator.corpseSelfBuffStatList = corpseSelfBuffStatList; mutator.skeleDiedRecentlyStats = skeleDiedRecentlyStats; mutator.usesPoisonArrow = usesPoisonArrow; mutator.increasedPoisonArrowCooldownSpeed = increasedPoisonArrowCooldownSpeed; mutator.increasedPoisonArrowCooldown = increasedPoisonArrowCooldown; mutator.poisonArrowPierces = poisonArrowPierces; mutator.poisonArrowInaccurate = poisonArrowInaccurate; mutator.poisonArrowIncreasedDamage = poisonArrowIncreasedDamage; mutator.poisonArrowDelayedAttacks = poisonArrowDelayedAttacks; mutator.usesMultishot = usesMultishot; mutator.increasedMultishotCooldownSpeed = increasedMultishotCooldownSpeed; mutator.usesDeathSlash = usesDeathSlash; mutator.increasedDeathSlashCooldownRecovery = increasedDeathSlashCooldownRecovery; mutator.usesNecroticMortar = usesNecroticMortar; mutator.increasedNecroticMortarCooldownRecovery = increasedNecroticMortarCooldownRecovery; mutator.usesInspire = usesInspire; mutator.increasedInspireCooldownRecovery = increasedInspireCooldownRecovery; mutator.cannotSummonWarriors = cannotSummonWarriors; mutator.cannotSummonMages = cannotSummonMages; mutator.canSummonArchers = canSummonArchers; mutator.canSummonWarlords = canSummonWarlords; mutator.healthOnSkeletonDeath = healthOnSkeletonDeath; mutator.wardOnSkeletonDeath = wardOnSkeletonDeath; mutator.manaOnSkeletonDeath = manaOnSkeletonDeath; mutator.additionalSkeletonsPerCast = additionalSkeletonsPerCast; mutator.healSkeletonOnSkeletonDeath = healSkeletonOnSkeletonDeath; mutator.increasedManaCost = increasedManaCost; mutator.addedManaCostDivider = manaEfficiency; // update existing wolves if (player.GetComponent <SummonTracker>()) { // get a list of existing skeletons List <SummonChangeTracker> skeles = new List <SummonChangeTracker>(); SummonChangeTracker changeTracker = null; CreationReferences references = null; foreach (Summoned summon in player.GetComponent <SummonTracker>().summons) { changeTracker = summon.GetComponent <SummonChangeTracker>(); references = summon.GetComponent <CreationReferences>(); if (references && changeTracker) { if (references.thisAbility == ability || references.thisAbility == summonWarrior || references.thisAbility == summonMage || references.thisAbility == summonArcher || references.thisAbility == summonWarlord || references.thisAbility == summonBrawler) { skeles.Add(changeTracker); } } } // update the skeletons foreach (SummonChangeTracker skele in skeles) { skele.changeStats(statList); skele.changeLimitDuration(limitDuration, summonArcher.abilityPrefab.GetComponent <SummonEntityOnDeath>().duration + additionalDuration); } } }
public override void updateMutator() { GameObject player = PlayerFinder.getPlayer(); SummonWraithMutator mutator = player.GetComponent <SummonWraithMutator>(); bool canTarget = false; List <TaggedStatsHolder.TaggableStat> statList = new List <TaggedStatsHolder.TaggableStat>(); List <TaggedStatsHolder.TaggableStat> corpseStatList = new List <TaggedStatsHolder.TaggableStat>(); int delayedWraiths = 0; float reducedWraithInterval = 0f; bool instantWraiths = false; bool critFromManaCost = false; float healOnCrit = 0f; float reducedHealthDrain = 0f; bool stationary = false; float flameWraithChance = 0f; float putridWraithChance = 0f; float bloodWraithChance = 0f; bool cooldown = false; float reducedCooldown = 0f; float increasedCastSpeed = 0f; float increasedManaCost = 0f; float manaEfficiency = 0f; SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Summon Wraith Tree Can Target") { if (skillTreeNode.pointsAllocated > 0) { canTarget = true; increasedManaCost += 0.2f; } } if (node.name == "Summon Wraith Tree Stationary") { if (skillTreeNode.pointsAllocated > 0) { stationary = true; TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.4f); statList.Add(newStat2); TaggedStatsHolder.TaggableStat newStat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, null); newStat3.moreValues.Add(skillTreeNode.pointsAllocated * -1f); statList.Add(newStat3); } } if (node.name == "Summon Wraith Tree Melee Attack Speed") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); statList.Add(newStat); } } if (node.name == "Summon Wraith Tree Multiple Wraiths") { if (skillTreeNode.pointsAllocated > 0) { delayedWraiths += 3; cooldown = true; increasedManaCost += 0.8f; } } if (node.name == "Summon Wraith Tree Reduced Cooldown") { if (skillTreeNode.pointsAllocated > 0) { reducedCooldown += 0.1f * skillTreeNode.pointsAllocated; reducedWraithInterval += 0.1f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Additional Wraith") { if (skillTreeNode.pointsAllocated > 0) { delayedWraiths += 1 * skillTreeNode.pointsAllocated; increasedManaCost += 0.1f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Instant Wraiths") { if (skillTreeNode.pointsAllocated > 0) { instantWraiths = true; } } if (node.name == "Summon Wraith Tree Increased Health") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat3.moreValues.Add(skillTreeNode.pointsAllocated * 0.2f); statList.Add(newStat3); } } if (node.name == "Summon Wraith Tree Corpse Consumption") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.3f); corpseStatList.Add(newStat2); } } if (node.name == "Summon Wraith Tree Corpse Health") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.25f); corpseStatList.Add(newStat2); } } if (node.name == "Summon Wraith Tree Corpse Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); corpseStatList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); corpseStatList.Add(newStat2); TaggedStatsHolder.TaggableStat newStat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, null); newStat3.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); corpseStatList.Add(newStat3); } } if (node.name == "Summon Wraith Tree Blood Wraith Chance") { if (skillTreeNode.pointsAllocated > 0) { bloodWraithChance += 0.2f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Added Necrotic Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Necrotic); tagList.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.addedValue = skillTreeNode.pointsAllocated * 4f; statList.Add(newStat); List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Necrotic); tagList2.Add(Tags.AbilityTags.Spell); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList2); newStat2.addedValue = skillTreeNode.pointsAllocated * 4f; statList.Add(newStat2); } } if (node.name == "Summon Wraith Tree Cast Speed and Mana Efficiency") { if (skillTreeNode.pointsAllocated > 0) { manaEfficiency += 0.14f * skillTreeNode.pointsAllocated; increasedCastSpeed += 0.7f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Move Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, null); newStat2.increasedValue = skillTreeNode.pointsAllocated * 0.15f; corpseStatList.Add(newStat2); } } if (node.name == "Summon Wraith Tree Flame Wraith Chance") { if (skillTreeNode.pointsAllocated > 0) { flameWraithChance += 0.11f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Mana Crit") { if (skillTreeNode.pointsAllocated > 0) { critFromManaCost = true; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CriticalChance, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.2f); corpseStatList.Add(newStat); } } if (node.name == "Summon Wraith Tree Wraith Crit Chance") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CriticalChance, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.3f); corpseStatList.Add(newStat); } } if (node.name == "Summon Wraith Tree Wraith Crit Multiplier") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CriticalMultiplier, null); newStat.addedValue = skillTreeNode.pointsAllocated * 0.4f; corpseStatList.Add(newStat); } } if (node.name == "Summon Wraith Tree Necrotic Leech") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Necrotic); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.2f); statList.Add(newStat); List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Necrotic); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.PercentLifeLeech, tagList2); newStat2.addedValue = skillTreeNode.pointsAllocated * 0.1f; statList.Add(newStat2); } } if (node.name == "Summon Wraith Tree Tanky") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * 0.4f); corpseStatList.Add(newStat2); increasedManaCost += 0.1f * skillTreeNode.pointsAllocated; increasedCastSpeed -= 0.05f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Melee Poison Chance") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.PoisonChance, tagList2); newStat2.addedValue = skillTreeNode.pointsAllocated * 0.2f; statList.Add(newStat2); } } if (node.name == "Summon Wraith Tree Putrid Wraith Chance") { if (skillTreeNode.pointsAllocated > 0) { putridWraithChance += 0.11f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Reduced Drain") { if (skillTreeNode.pointsAllocated > 0) { reducedHealthDrain += 0.12f * skillTreeNode.pointsAllocated; } } if (node.name == "Summon Wraith Tree Health On Crit") { if (skillTreeNode.pointsAllocated > 0) { healOnCrit += 10f * skillTreeNode.pointsAllocated; } } } // update the mutator if (canTarget) { mutator.targetting = SummonWraithMutator.WraithTargetType.atTarget; } else { mutator.targetting = SummonWraithMutator.WraithTargetType.normal; } if (cooldown) { mutator.addedCharges = 1; mutator.addedChargeRegen = 0.17f * (1f - reducedCooldown); } else { mutator.addedCharges = 0; mutator.addedChargeRegen = 0; } if (instantWraiths) { // set wraith interval reducedWraithInterval = 0.8f; // reduce number of wraiths delayedWraiths = (int)(Mathf.Ceil((1 + delayedWraiths) * 0.66f) - 1); } mutator.statList = statList; mutator.corpseStatList = corpseStatList; mutator.delayedWraiths = delayedWraiths; mutator.reducedWraithInterval = reducedWraithInterval; mutator.critFromManaCost = critFromManaCost; mutator.healOnCrit = healOnCrit; mutator.reducedHealthDrain = reducedHealthDrain; mutator.stationary = stationary; mutator.flameWraithChance = flameWraithChance; mutator.putridWraithChance = putridWraithChance; mutator.bloodWraithChance = bloodWraithChance; mutator.increasedCastSpeed = increasedCastSpeed; mutator.increasedManaCost = increasedManaCost; mutator.addedManaCostDivider = manaEfficiency; // update existing wolves if (player.GetComponent <SummonTracker>()) { // get a list of existing wraiths List <SummonChangeTracker> skeles = new List <SummonChangeTracker>(); SummonChangeTracker changeTracker = null; CreationReferences references = null; foreach (Summoned summon in player.GetComponent <SummonTracker>().summons) { changeTracker = summon.GetComponent <SummonChangeTracker>(); references = summon.GetComponent <CreationReferences>(); if (references && changeTracker) { if (references.thisAbility == ability) { skeles.Add(changeTracker); } } } // update the wraiths foreach (SummonChangeTracker skele in skeles) { skele.changeStats(statList); } } }
public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation) { if (voidRiftAtStart) { CreateAbilityObjectOnStart component = abilityObject.AddComponent <CreateAbilityObjectOnStart>(); component.abilityToInstantiate = Ability.getAbility(AbilityID.voidRift); component.createAtStartLocation = true; } if (voidRiftAtEnd) { CreateAbilityObjectOnDeath component = abilityObject.AddComponent <CreateAbilityObjectOnDeath>(); component.abilityToInstantiate = Ability.getAbility(AbilityID.voidRift); } if (voidRiftAtStart || voidRiftAtEnd) { VoidRiftMutator mut = abilityObject.AddComponent <VoidRiftMutator>(); mut.increasedDamage = increasedDamage; mut.increasedRadius = increasedRadius; mut.increasedStunChance = increasedStunChance; mut.increasesDoTDamageTaken = increasesDoTDamageTaken; mut.timeRotChance = timeRotChance; mut.increasesDamageTaken = increasesDamageTaken; } // apply stats on cooldown float cooldown = getCooldown(); StatBuffs buffs = GetComponent <StatBuffs>(); if (!buffs) { buffs = gameObject.AddComponent <StatBuffs>(); } foreach (TaggedStatsHolder.TaggableStat stat in statsWhileOnCooldown) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(stat); buffs.addTaggedBuff(new TaggedBuff(newStat, cooldown)); } // apply stats on use float duration = 2 + additionalSecondsBack; foreach (TaggedStatsHolder.TaggableStat stat in statOnUse) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(stat); buffs.addTaggedBuff(new TaggedBuff(newStat, duration)); } if (noHealthRestoration || noManaRestoration) { ReturnCasterToOlderPosition component = abilityObject.GetComponent <ReturnCasterToOlderPosition>(); if (noHealthRestoration) { component.restoreHealth = false; } if (noManaRestoration) { component.restoreMana = false; } } if (healsOrDamagesAtRandom && health) { float rand = Random.Range(0f, 1f); if (rand < 0.8f) { health.Heal((health.maxHealth - health.currentHealth) * healOrDamagePercent); } else { health.HealthDamage(health.currentHealth * healOrDamagePercent); } } return(abilityObject); }
public override void updateMutator() { GameObject player = PlayerFinder.getPlayer(); SummonSprigganMutator mutator = player.GetComponent <SummonSprigganMutator>(); float vineCooldownRecovery = 0f; float increasedVineCooldown = 0f; float rootsCooldownRecovery = 0f; // aura List <TaggedStatsHolder.TaggableStat> extraLeafShieldStats = new List <TaggedStatsHolder.TaggableStat>(); // vale orb int orbExtraProjectiles = 0; int orbTargetsToPierce = 0; float orbIncreasedCastSpeed = 0f; bool orbFireInSequence = false; float orbChanceForDoubleDamage = 0f; float orbIncreasedDamage = 0f; float orbMoreDamageAgainstPoisoned = 0f; float orbMoreDamageAgainstBleeding = 0f; // entangling roots bool castsEntanglingRoots = false; float rootsIncreasedDamage = 0f; float rootsIncreasedRadius = 0f; int rootsAddedPatches = 0; bool rootsPatchesInLine = false; float rootsVineOnKillChance = 0f; float rootsIncreasedDuration = 0f; float rootsHealingNovaChance = 0f; // vines bool summonsVines = false; int extraVines = 0; List <TaggedStatsHolder.TaggableStat> statList = new List <TaggedStatsHolder.TaggableStat>(); SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Spriggan Tree Summons Vines") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { summonsVines = true; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * -0.1f; statList.Add(newStat); } } if (node.name == "Spriggan Tree Vines Cooldown") { vineCooldownRecovery += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; } if (node.name == "Spriggan Tree Three Vines") { if (skillTreeNode.pointsAllocated > 0) { increasedVineCooldown += node.GetComponent <SkillTreeNode>().pointsAllocated * 1f; extraVines += node.GetComponent <SkillTreeNode>().pointsAllocated * 1; } } if (node.name == "Spriggan Tree Vine Health") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Minion); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, tagList); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.3f; statList.Add(newStat); } } if (node.name == "Spriggan Tree Vine Damage") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Minion); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.2f; statList.Add(newStat); } } if (node.name == "Spriggan Tree Aura Regen") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.HealthRegen, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.25f; extraLeafShieldStats.Add(newStat); } } if (node.name == "Spriggan Tree Aura Damage") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.1f; extraLeafShieldStats.Add(newStat); } } if (node.name == "Spriggan Tree Aura Life On Kill") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Kill); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.LifeGain, null); newStat.addedValue = skillTreeNode.pointsAllocated * 5f; extraLeafShieldStats.Add(newStat); } } if (node.name == "Spriggan Tree Health") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.15f; statList.Add(newStat); } } if (node.name == "Spriggan Tree Armour And Protections") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Armour, null); newStat.addedValue = skillTreeNode.pointsAllocated * 50f; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.ElementalProtection, null); newStat2.addedValue = skillTreeNode.pointsAllocated * 50f; statList.Add(newStat2); } } if (node.name == "Spriggan Tree Uses Entangling Roots") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { castsEntanglingRoots = true; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * -0.1f; statList.Add(newStat); } } if (node.name == "Spriggan Tree Entangling Roots Damage") { rootsIncreasedDamage = skillTreeNode.pointsAllocated * 0.25f; } if (node.name == "Spriggan Tree Entangling Roots Patches") { rootsAddedPatches += node.GetComponent <SkillTreeNode>().pointsAllocated; rootsIncreasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.2f; } if (node.name == "Spriggan Tree Entangling Roots Line") { rootsPatchesInLine = (node.GetComponent <SkillTreeNode>().pointsAllocated > 0); } if (node.name == "Spriggan Tree Entangling Roots Duration") { rootsIncreasedDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Spriggan Tree Entangling Roots Healing Nova") { rootsHealingNovaChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.5f; } if (node.name == "Spriggan Tree Entangling Roots Cooldown") { rootsCooldownRecovery += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.35f; rootsIncreasedDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.15f; } if (node.name == "Spriggan Tree Spell Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Spell); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.12f); statList.Add(newStat); } } if (node.name == "Spriggan Tree Orb Projectiles") { orbExtraProjectiles += node.GetComponent <SkillTreeNode>().pointsAllocated * 2; orbIncreasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.2f; } if (node.name == "Spriggan Tree Orb Sequence") { if (skillTreeNode.pointsAllocated > 0) { orbFireInSequence = true; orbIncreasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.2f; } } if (node.name == "Spriggan Tree Orb VS Bleeding") { orbMoreDamageAgainstBleeding += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; } if (node.name == "Spriggan Tree Orb VS Poison") { orbMoreDamageAgainstPoisoned += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; } } // update the mutator mutator.vineCooldownRecovery = vineCooldownRecovery; mutator.rootsCooldownRecovery = rootsCooldownRecovery; // aura mutator.extraLeafShieldStats = extraLeafShieldStats; // vale orb mutator.orbExtraProjectiles = orbExtraProjectiles; mutator.orbTargetsToPierce = orbTargetsToPierce; mutator.orbIncreasedCastSpeed = orbIncreasedCastSpeed; mutator.orbFireInSequence = orbFireInSequence; mutator.orbChanceForDoubleDamage = orbChanceForDoubleDamage; mutator.orbIncreasedDamage = orbIncreasedDamage; mutator.orbMoreDamageAgainstPoisoned = orbMoreDamageAgainstPoisoned; mutator.orbMoreDamageAgainstBleeding = orbMoreDamageAgainstBleeding; // entangling roots mutator.castsEntanglingRoots = castsEntanglingRoots; mutator.rootsIncreasedDamage = rootsIncreasedDamage; mutator.rootsIncreasedRadius = rootsIncreasedRadius; mutator.rootsAddedPatches = rootsAddedPatches; mutator.rootsPatchesInLine = rootsPatchesInLine; mutator.rootsVineOnKillChance = rootsVineOnKillChance; mutator.rootsIncreasedDuration = rootsIncreasedDuration; mutator.rootsHealingNovaChance = rootsHealingNovaChance; // vines mutator.summonsVines = summonsVines; mutator.extraVines = extraVines; mutator.increasedVineCooldown = increasedVineCooldown; // update existing spriggans if (player.GetComponent <SummonTracker>()) { // get a list of existing bears List <SummonChangeTracker> spriggans = new List <SummonChangeTracker>(); foreach (Summoned summon in player.GetComponent <SummonTracker>().summons) { if (summon.GetComponent <CreationReferences>() && summon.GetComponent <CreationReferences>().thisAbility == ability && summon.GetComponent <SummonChangeTracker>()) { spriggans.Add(summon.GetComponent <SummonChangeTracker>()); } } // update the bears foreach (SummonChangeTracker spriggan in spriggans) { spriggan.changeStats(statList); } } }
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 StatWithWeaponRequirement(TaggedStatsHolder.TaggableStat _stat, WeaponRequirementType _weaponRequirement) { stat = _stat; weaponRequirement = _weaponRequirement; }
public override void updateMutator() { ShieldRushMutator mutator = PlayerFinder.getPlayer().GetComponent <ShieldRushMutator>(); List <TaggedStatsHolder.TaggableStat> statsWhileTravelling = new List <TaggedStatsHolder.TaggableStat>(); float increasedDamage = 0f; float increasedArea = 0f; float addedCritMultiplier = 0f; float addedCritChance = 0f; bool leaveDelayed = false; float increasedDelayLength = 0f; float delayIncreasedDamage = 0f; float delayAddedCritMultiplier = 0f; float delayAddedCritChance = 0f; float increasedTravelDamage = 0f; float increasedTravelStunChance = 0f; bool forwardVoidBeam = false; bool backwardsVoidBeam = false; bool noShieldRequirement = false; bool returnToStart = false; bool restoreMana = false; float percentCurrentHealthLostOnCast = 0f; float addedVoidDamage = 0f; float additionalAoEAddedVoidDamage = 0f; float addedVoidReducedByAttackSpeed = 0f; float moreTravelDamageAgainstFullHealth = 0f; float increasedManaCost = 0f; float manaEfficiency = 0f; bool cooldown = false; int addedCharges = 0; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { if (node.name == "Shield Rush Tree Damage While Travelling") { increasedTravelDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Shield Rush Tree Damage Against Full Health While Travelling") { moreTravelDamageAgainstFullHealth += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; } if (node.name == "Shield Rush Tree Forwards Beam") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { forwardVoidBeam = true; increasedManaCost += 0.2f; } } if (node.name == "Shield Rush Tree Backwards Beam") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { backwardsVoidBeam = true; increasedManaCost += 0.1f; } } if (node.name == "Shield Rush Tree No Shield Requirement") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { noShieldRequirement = true; addedVoidDamage += 5f; increasedManaCost += 0.3f; } } if (node.name == "Shield Rush Tree AoE Void Damage") { additionalAoEAddedVoidDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 5f; } if (node.name == "Shield Rush Tree Attack Speed Reduced Void Damage") { addedVoidReducedByAttackSpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 7f; } if (node.name == "Shield Rush Tree Mana Efficiency") { manaEfficiency += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Shield Rush Tree Less Damage Taken") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, new List <Tags.AbilityTags>()); stat.moreValues.Add(node.GetComponent <SkillTreeNode>().pointsAllocated * -0.1f); statsWhileTravelling.Add(stat); } } if (node.name == "Shield Rush Tree Travel Stun Chance") { increasedTravelStunChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.35f; } if (node.name == "Shield Rush Tree Return To Start") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { returnToStart = true; } } if (node.name == "Shield Rush Tree Mana Restore") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { restoreMana = true; cooldown = true; manaEfficiency += node.GetComponent <SkillTreeNode>().pointsAllocated * 2f; } } if (node.name == "Shield Rush Tree Adds Charges") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { addedCharges += node.GetComponent <SkillTreeNode>().pointsAllocated; TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, new List <Tags.AbilityTags>()); stat.moreValues.Add(node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f); statsWhileTravelling.Add(stat); } } if (node.name == "Shield Rush Tree No Cooldown") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { percentCurrentHealthLostOnCast = 0.15f; cooldown = false; } } if (node.name == "Shield Rush Tree Increase AoE") { increasedArea += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.35f; } if (node.name == "Shield Rush Tree Area Damage") { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Shield Rush Tree Area Crit Chance") { addedCritChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.04f; } if (node.name == "Shield Rush Tree Area Crit Multi") { addedCritMultiplier += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; } if (node.name == "Shield Rush Tree Second Aoe") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.2f; leaveDelayed = true; } } if (node.name == "Shield Rush Tree Second Aoe Damage And Delay") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { delayIncreasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.45f; increasedDelayLength += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } } if (node.name == "Shield Rush Tree Second Aoe Crit Chance") { addedCritChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.04f; } if (node.name == "Shield Rush Tree Second Aoe Crit Multi") { addedCritMultiplier += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; } } if (cooldown) { mutator.addedCharges = 1 + addedCharges; mutator.addedChargeRegen = 0.1f; } else { mutator.addedCharges = 0; mutator.addedChargeRegen = 0; } mutator.statsWhileTravelling = new List <TaggedStatsHolder.TaggableStat>(); mutator.increasedDamage = increasedDamage; mutator.addedCritMultiplier = addedCritMultiplier; mutator.addedCritChance = addedCritChance; mutator.leaveDelayed = leaveDelayed; mutator.increasedDelayLength = increasedDelayLength; mutator.delayIncreasedDamage = delayIncreasedDamage; mutator.delayAddedCritMultiplier = delayAddedCritMultiplier; mutator.delayAddedCritChance = delayAddedCritChance; mutator.increasedTravelDamage = increasedTravelDamage; mutator.increasedTravelStunChance = increasedTravelStunChance; mutator.forwardVoidBeam = forwardVoidBeam; mutator.backwardsVoidBeam = backwardsVoidBeam; mutator.noShieldRequirement = noShieldRequirement; mutator.returnToStart = returnToStart; mutator.restoreMana = restoreMana; mutator.percentCurrentHealthLostOnCast = percentCurrentHealthLostOnCast; mutator.addedVoidDamage = addedVoidDamage; mutator.additionalAoEAddedVoidDamage = additionalAoEAddedVoidDamage; mutator.addedVoidReducedByAttackSpeed = addedVoidReducedByAttackSpeed; mutator.increasedRadius = Mathf.Sqrt(increasedArea + 1) - 1; mutator.moreTravelDamageAgainstFullHealth = moreTravelDamageAgainstFullHealth; mutator.increasedManaCost = increasedManaCost; mutator.addedManaCostDivider = manaEfficiency; }
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 void updateMutator() { VengeanceMutator mutator = PlayerFinder.getPlayer().GetComponent <VengeanceMutator>(); float increasedDuration = 0f; int additionalRetaliations = 0; float darkBladeRetaliationChance = 0f; List <TaggedStatsHolder.TaggableStat> statsWhilePrepped = new List <TaggedStatsHolder.TaggableStat>(); float increasedDamageWhileBelowHalfHealth = 0f; float increasedAttackSpeed = 0f; float increasedDamage = 0f; float increasedStunChance = 0f; float moreDamageAgaintDamaged = 0f; float reducedDamageTakenOnHit = 0f; float darkBladeOnVengeanceHitChance = 0f; float darkBladeOnVengeanceKillChance = 0f; float darkBladeOnRiposteKillChance = 0f; float darkBladeOnRiposteHitChance = 0f; float voidEssenceOnVengeanceKillChance = 0f; float voidEssenceOnRiposteHitChance = 0f; // dark blade float armourShredChance = 0f; bool noPierce = false; float chanceForDoubleDamage = 0f; float increasedDarkBladeDamage = 0f; float moreDamageAgainstStunned = 0f; float increasedProjectileSpeed = 0f; int chains = 0; float increasedDarkBladeStunChance = 0f; bool hasChained = false; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { if (node.name == "Vengeance Tree Double Retaliation") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { additionalRetaliations += 1; increasedAttackSpeed -= 0.1f; } } if (node.name == "Vengeance Tree Damage While Prepped") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, new List <Tags.AbilityTags>()); stat.increasedValue = node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; statsWhilePrepped.Add(stat); } } if (node.name == "Vengeance Tree Damage Additional Retaliations") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { additionalRetaliations += node.GetComponent <SkillTreeNode>().pointsAllocated; TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, new List <Tags.AbilityTags>()); stat.moreValues.Add(node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f); statsWhilePrepped.Add(stat); } } if (node.name == "Vengeance Tree Attack Speed") { increasedAttackSpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.06f; } if (node.name == "Vengeance Tree Damage Below Half Health") { increasedDamageWhileBelowHalfHealth += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } if (node.name == "Vengeance Tree Dark Blade On Vengeance Hit") { darkBladeOnVengeanceHitChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.05f; } if (node.name == "Vengeance Tree Dark Blade On Riposte Hit") { darkBladeOnRiposteHitChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Vengeance Tree Dark Blade Double Damage Chance") { chanceForDoubleDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } if (node.name == "Vengeance Tree Dark Blade Armour Shred Chance") { armourShredChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Vengeance Tree Dark Blade Speed") { increasedProjectileSpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } if (node.name == "Vengeance Tree Dark Blade Chains") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { chains += 1; noPierce = true; increasedDarkBladeDamage += -0.15f; } } if (node.name == "Vengeance Tree Dark Blade Additional Chain") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { chains += node.GetComponent <SkillTreeNode>().pointsAllocated; increasedProjectileSpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.25f; } } if (node.name == "Vengeance Tree Dark Blade On Riposte Kill") { darkBladeOnRiposteKillChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Vengeance Tree Dark Blade On Vengeance Kill") { darkBladeOnVengeanceKillChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Vengeance Tree Damage Against Damaged Enemies") { moreDamageAgaintDamaged += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } if (node.name == "Vengeance Tree Damage VS Stun Chance") { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; increasedStunChance += node.GetComponent <SkillTreeNode>().pointsAllocated * -0.15f; } if (node.name == "Vengeance Tree Dark Blade Retaliation") { darkBladeRetaliationChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Vengeance Tree Reduced Damage Taken") { reducedDamageTakenOnHit += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.05f; } if (node.name == "Vengeance Tree Void Essence On Riposte Hit") { voidEssenceOnRiposteHitChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } if (node.name == "Vengeance Tree Void Essence On Vengeance Kill") { voidEssenceOnVengeanceKillChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } } mutator.increasedDuration = increasedDuration; mutator.additionalRetaliations = additionalRetaliations; mutator.darkBladeRetaliationChance = darkBladeRetaliationChance; mutator.statsWhilePrepped = statsWhilePrepped; mutator.increasedDamageWhileBelowHalfHealth = increasedDamageWhileBelowHalfHealth; mutator.increasedAttackSpeed = increasedAttackSpeed; mutator.increasedDamage = increasedDamage; mutator.increasedStunChance = increasedStunChance; mutator.moreDamageAgaintDamaged = moreDamageAgaintDamaged; mutator.reducedDamageTakenOnHit = reducedDamageTakenOnHit; mutator.darkBladeOnVengeanceHitChance = darkBladeOnVengeanceHitChance; mutator.darkBladeOnVengeanceKillChance = darkBladeOnVengeanceKillChance; mutator.darkBladeOnRiposteKillChance = darkBladeOnRiposteKillChance; mutator.voidEssenceOnVengeanceKillChance = voidEssenceOnVengeanceKillChance; mutator.voidEssenceOnRiposteHitChance = voidEssenceOnRiposteHitChance; mutator.darkBladeOnRiposteHitChance = darkBladeOnRiposteHitChance; DarkBladeMutator mutator2 = PlayerFinder.getPlayer().GetComponent <DarkBladeMutator>(); mutator2.armourShredChance = armourShredChance; mutator2.noPierce = noPierce; mutator2.chanceForDoubleDamage = chanceForDoubleDamage; mutator2.increasedDamage = increasedDarkBladeDamage; mutator2.moreDamageAgainstStunned = moreDamageAgainstStunned; mutator2.increasedProjectileSpeed = increasedProjectileSpeed; mutator2.chains = chains; mutator2.increasedStunChance = increasedDarkBladeStunChance; mutator2.hasChained = hasChained; }
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); }
public override void updateMutator() { TempestMutator mutator = PlayerFinder.getPlayer().GetComponent <TempestMutator>(); List <TaggedStatsHolder.TaggableStat> statsWhileSpinning = new List <TaggedStatsHolder.TaggableStat>(); List <TaggedStatsHolder.TaggableStat> statsWhileSpinningIfNotUsingAShield = new List <TaggedStatsHolder.TaggableStat>(); float addedCritMultiplier = 0f; float addedCritChance = 0f; float increasedDamage = 0f; float timeRotChance = 0f; float moreDamageAgainstFullHealth = 0f; float increasedArea = 0f; float igniteChance = 0f; float moreDamageAgainstTimeRotting = 0f; float parabolicVoidOrbOnHitChance = 0f; bool castsAbyssalOrb = false; float increasedAbyssalOrbFrequence = 0f; float addedVoidDamage = 0f; float increasedDamageWhileNotUsingAShield = 0f; float addedManaDrain = 0f; bool pulls = false; float increasedPullArea = 0f; float increasedAreaWhileNotUsingAShield = 0f; bool strongerPull = false; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { if (node.name == "Tempest Tree Added Void Damage") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { addedVoidDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 2f; List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Void); TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, tagList); stat.moreValues.Add(node.GetComponent <SkillTreeNode>().pointsAllocated * -0.05f); statsWhileSpinning.Add(stat); } } if (node.name == "Tempest Tree Parabolic Void Orb") { parabolicVoidOrbOnHitChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.08f; } if (node.name == "Tempest Tree Time Rot Chance") { timeRotChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Tempest Tree Ignite Chance") { igniteChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Tempest Tree Damage Against Time Rot") { moreDamageAgainstTimeRotting += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; } if (node.name == "Tempest Tree Damage And Mana Drain") { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; addedManaDrain += node.GetComponent <SkillTreeNode>().pointsAllocated * 1f; } if (node.name == "Tempest Tree Abyssal Orb") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { castsAbyssalOrb = true; } } if (node.name == "Tempest Tree Abyssal Orb Frequency") { increasedAbyssalOrbFrequence += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; } if (node.name == "Tempest Tree Pulls") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { pulls = true; } } if (node.name == "Tempest Tree Pull Area") { increasedPullArea += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.5f; } //if (node.name == "Tempest Tree Damage vs Speed") //{ // if (node.GetComponent<SkillTreeNode>().pointsAllocated > 0) // { // increasedDamage += node.GetComponent<SkillTreeNode>().pointsAllocated * 0.15f; // TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, new List<Tags.AbilityTags>()); // stat.moreValues.Add(node.GetComponent<SkillTreeNode>().pointsAllocated * -0.05f); // statsWhileSpinning.Add(stat); // } //} if (node.name == "Tempest Tree Area") { increasedArea += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Tempest Tree Increased Damage") { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Tempest Tree Increased Speed") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { addedManaDrain += node.GetComponent <SkillTreeNode>().pointsAllocated * 1f; TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, new List <Tags.AbilityTags>()); stat.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; statsWhileSpinning.Add(stat); } } if (node.name == "Tempest Tree Crit Chance And Mana Drain") { addedCritChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.04f; addedManaDrain += node.GetComponent <SkillTreeNode>().pointsAllocated * 1f; } if (node.name == "Tempest Tree Crit Damage And Mana Drain") { addedCritMultiplier += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; addedManaDrain += node.GetComponent <SkillTreeNode>().pointsAllocated * 1f; } if (node.name == "Tempest Tree No Shield Damage") { increasedDamageWhileNotUsingAShield += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; } if (node.name == "Tempest Tree No Shield AoE") { increasedAreaWhileNotUsingAShield += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.5f; } if (node.name == "Tempest Tree No Shield Leech") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.PercentLifeLeech, tagList); stat.addedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.07f; statsWhileSpinningIfNotUsingAShield.Add(stat); } } if (node.name == "Tempest Tree No Shield Block") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockChance, new List <Tags.AbilityTags>()); stat.addedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.05f; statsWhileSpinningIfNotUsingAShield.Add(stat); TaggedStatsHolder.TaggableStat stat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockArmor, new List <Tags.AbilityTags>()); stat2.addedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 100f; statsWhileSpinningIfNotUsingAShield.Add(stat2); } } if (node.name == "Tempest Tree No Shield Block Protection") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.BlockElementalProtection, new List <Tags.AbilityTags>()); stat3.addedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 200f; statsWhileSpinningIfNotUsingAShield.Add(stat3); } } if (node.name == "Tempest Tree Less Mana Drain") { increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.05f; addedManaDrain += node.GetComponent <SkillTreeNode>().pointsAllocated * -1f; } if (node.name == "Tempest Tree No Shield Mana Regen") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.ManaRegen, new List <Tags.AbilityTags>()); stat3.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; statsWhileSpinningIfNotUsingAShield.Add(stat3); } } if (node.name == "Tempest Tree Mana Regen") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat3 = new TaggedStatsHolder.TaggableStat(Tags.Properties.ManaRegen, new List <Tags.AbilityTags>()); stat3.increasedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.15f; statsWhileSpinning.Add(stat3); } } if (node.name == "Tempest Tree Mana Regen And Damage Taken") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { addedManaDrain += node.GetComponent <SkillTreeNode>().pointsAllocated * -4f; List <Tags.AbilityTags> tags = new List <Tags.AbilityTags>(); tags.Add(Tags.AbilityTags.Fire); TaggedStatsHolder.TaggableStat stat4 = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, tags); stat4.moreValues.Add(node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f); statsWhileSpinning.Add(stat4); List <Tags.AbilityTags> tags2 = new List <Tags.AbilityTags>(); tags2.Add(Tags.AbilityTags.Cold); TaggedStatsHolder.TaggableStat stat1 = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, tags2); stat1.moreValues.Add(node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f); statsWhileSpinning.Add(stat1); List <Tags.AbilityTags> tags3 = new List <Tags.AbilityTags>(); tags3.Add(Tags.AbilityTags.Lightning); TaggedStatsHolder.TaggableStat stat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, tags3); stat2.moreValues.Add(node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f); statsWhileSpinning.Add(stat2); } } if (node.name == "Tempest Tree Armour And Protection") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Armour, new List <Tags.AbilityTags>()); stat.addedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 40f; statsWhileSpinning.Add(stat); TaggedStatsHolder.TaggableStat stat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.ElementalProtection, new List <Tags.AbilityTags>()); stat2.addedValue += node.GetComponent <SkillTreeNode>().pointsAllocated * 40f; statsWhileSpinning.Add(stat2); } } if (node.name == "Tempest Tree Doesn't Move") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { strongerPull = true; increasedDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.5f; TaggedStatsHolder.TaggableStat stat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, new List <Tags.AbilityTags>()); stat.moreValues.Add(-1f); statsWhileSpinning.Add(stat); } } } TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.ManaDrain, new List <Tags.AbilityTags>()); newStat.addedValue = addedManaDrain; statsWhileSpinning.Add(newStat); mutator.statsWhileSpinning = statsWhileSpinning; mutator.statsWhileSpinningIfNotUsingAShield = statsWhileSpinningIfNotUsingAShield; mutator.addedCritMultiplier = addedCritMultiplier; mutator.addedCritChance = addedCritChance; mutator.increasedDamage = increasedDamage; mutator.timeRotChance = timeRotChance; mutator.moreDamageAgainstFullHealth = moreDamageAgainstFullHealth; mutator.increasedRadius = Mathf.Sqrt(increasedArea + 1) - 1; mutator.igniteChance = igniteChance; mutator.moreDamageAgainstTimeRotting = moreDamageAgainstTimeRotting; mutator.parabolicVoidOrbOnHitChance = parabolicVoidOrbOnHitChance; mutator.castsAbyssalOrb = castsAbyssalOrb; mutator.increasedAbyssalOrbFrequence = increasedAbyssalOrbFrequence; mutator.addedVoidDamage = addedVoidDamage; mutator.increasedDamageWhileNotUsingAShield = increasedDamageWhileNotUsingAShield; mutator.increasedRadiusWhileNotUsingAShield = Mathf.Sqrt(increasedArea + increasedAreaWhileNotUsingAShield + 1) - 1; mutator.strongerPull = strongerPull; mutator.pulls = pulls; mutator.increasedPullRadius = Mathf.Sqrt(increasedPullArea + 1) - 1; }
public override void updateMutator() { GameObject player = PlayerFinder.getPlayer(); SummonWolfMutator mutator = player.GetComponent <SummonWolfMutator>(); float additionalDuration = 0f; int wolfLimit = 1; bool limittedWolfDuration = false; bool dontFollow = false; float addedManaCostDivider = 0f; float increasedCooldownRecoverySpeed = 0f; float addedCharges = 0; bool leaps = false; float increasedLeapCooldownRecovery = 0f; bool retaliatesWithLightning = false; List <TaggedStatsHolder.TaggableStat> statList = new List <TaggedStatsHolder.TaggableStat>(); SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Summon Wolf Skill Tree Additional Duration") { additionalDuration += node.GetComponent <SkillTreeNode>().pointsAllocated * 4; } if (node.name == "Summon Wolf Skill Tree Added Health") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.addedValue = skillTreeNode.pointsAllocated * 70; statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Added Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Movespeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.1f; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, null); newStat2.increasedValue = skillTreeNode.pointsAllocated * 0.1f; statList.Add(newStat2); } } if (node.name == "Summon Wolf Skill Tree Added Health Regen") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.HealthRegen, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.75f; statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Wolf Limit") { limittedWolfDuration = (node.GetComponent <SkillTreeNode>().pointsAllocated > 0); } if (node.name == "Summon Wolf Skill Tree Additional Wolves") { wolfLimit += node.GetComponent <SkillTreeNode>().pointsAllocated * 1; addedCharges += node.GetComponent <SkillTreeNode>().pointsAllocated * 1; if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * -0.2f); statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Dont Follow") { if (skillTreeNode.pointsAllocated > 0) { dontFollow = true; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.addedValue = skillTreeNode.pointsAllocated * 300; statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Mana") { addedManaCostDivider += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Summon Wolf Skill Tree Cooldown") { increasedCooldownRecoverySpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.3f; } if (node.name == "Summon Wolf Skill Tree Damage") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.2f); statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Damage And Cooldown") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.6f); statList.Add(newStat); increasedCooldownRecoverySpeed -= 0.3f; } } if (node.name == "Summon Wolf Skill Tree Health And Cooldown") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.addedValue = skillTreeNode.pointsAllocated * 300; statList.Add(newStat); increasedCooldownRecoverySpeed -= 0.3f; } } if (node.name == "Summon Wolf Skill Tree Bleed Chance") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BleedChance, null); newStat.addedValue = skillTreeNode.pointsAllocated * 0.17f; statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree DoT Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.DoT); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.5f); statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Dodge Rating") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DodgeRating, null); newStat.addedValue = skillTreeNode.pointsAllocated * 70f; statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Melee Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.25f); statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Leaps") { if (skillTreeNode.pointsAllocated > 0) { leaps = true; } } if (node.name == "Summon Wolf Skill Tree Leap Cooldown") { increasedLeapCooldownRecovery += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.5f; } if (node.name == "Summon Wolf Skill Tree Lightning Retaliation") { if (skillTreeNode.pointsAllocated > 0) { retaliatesWithLightning = true; List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Lightning); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.DamageTaken, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.15f); statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Lightning Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Lightning); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.3f); statList.Add(newStat); } } if (node.name == "Summon Wolf Skill Tree Melee Lightning Damage") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Lightning); tagList.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.addedValue = skillTreeNode.pointsAllocated * 5f; statList.Add(newStat); } } } // update the mutator mutator.additionalDuration = additionalDuration; mutator.wolfLimit = wolfLimit; mutator.limittedWolfDuration = limittedWolfDuration; mutator.dontFollow = dontFollow; mutator.addedManaCostDivider = addedManaCostDivider; mutator.addedChargeRegen = ability.chargesGainedPerSecond * increasedCooldownRecoverySpeed; mutator.addedCharges = addedCharges; mutator.statList.Clear(); mutator.statList.AddRange(statList); mutator.leaps = leaps; mutator.increasedLeapCooldownRecovery = increasedLeapCooldownRecovery; mutator.retaliatesWithLightning = retaliatesWithLightning; // update existing wolves if (player.GetComponent <SummonTracker>()) { // get a list of existing wolves List <SummonChangeTracker> wolves = new List <SummonChangeTracker>(); foreach (Summoned summon in player.GetComponent <SummonTracker>().summons) { if (summon.GetComponent <CreationReferences>() && summon.GetComponent <CreationReferences>().thisAbility == ability && summon.GetComponent <SummonChangeTracker>()) { wolves.Add(summon.GetComponent <SummonChangeTracker>()); } } // update the wolves foreach (SummonChangeTracker wolf in wolves) { wolf.changeStats(statList); wolf.changeFollowsCreator(!dontFollow, player); wolf.changeLimitDuration(limittedWolfDuration, ability.abilityPrefab.GetComponent <SummonEntityOnDeath>().duration + additionalDuration); } } }
public override void updateMutator() { RipBloodMutator mutator = PlayerFinder.getPlayer().GetComponent <RipBloodMutator>(); float increasedArea = 0f; float splatter_increasedDamage = 0f; float splatter_increasedStunChance = 0f; float splatter_chanceToPoison = 0f; float splatter_armourReductionChance = 0f; float splatter_armourReduction = 0f; bool splatter_armourReductionStacks = false; float splatter_increasedArmourDebuffDuration = 0f; float splatter_increasedDamagePerMinion = 0f; bool splatter_reducesDarkProtectionInstead = false; List <TaggedStatsHolder.TaggableStat> splatter_minionBuffs = new List <TaggedStatsHolder.TaggableStat>(); float splatterChance = 0f; float increasedDamage = 0f; float increasedStunChance = 0f; float chanceToBleed = 0f; float chanceToPoison = 0f; float increasedDamagePerMinion = 0f; float increasedCastSpeed = 0f; float addedHealthGained = 0f; float increasedHealthGained = 0f; float increasedHealthGainedPerAttunement = 0f; float manaGained = 0f; bool convertHealthToWard = false; bool freeWhenOutOfMana = false; bool targetsAlliesInstead = false; bool necrotic = false; bool recastOnKill = false; float manaEfficiency = 0f; float increasedManaCost = 0f; List <TaggedStatsHolder.TaggableStat> onHitBuffs = new List <TaggedStatsHolder.TaggableStat>(); SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Rip Blood Tree Splatter Chance") { if (skillTreeNode.pointsAllocated > 0) { splatterChance += 0.17f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Always Splatter") { if (skillTreeNode.pointsAllocated > 0) { splatterChance += 1f; increasedManaCost += 1.2f; } } if (node.name == "Rip Blood Tree Area") { if (skillTreeNode.pointsAllocated > 0) { increasedArea += 0.25f; } } if (node.name == "Rip Blood Tree Splatter Damage") { if (skillTreeNode.pointsAllocated > 0) { splatter_increasedDamage += 0.15f; splatter_increasedStunChance += 0.15f; } } if (node.name == "Rip Blood Tree Armour Reduction") { if (skillTreeNode.pointsAllocated > 0) { splatter_armourReductionChance += 0.3f; splatter_armourReduction += 30f; } } if (node.name == "Rip Blood Tree Additional Armour Reduction") { if (skillTreeNode.pointsAllocated > 0) { splatter_armourReduction += 30f; } } if (node.name == "Rip Blood Tree Additional Reduction Chance") { if (skillTreeNode.pointsAllocated > 0) { splatter_armourReductionChance += 0.18f; } } if (node.name == "Rip Blood Tree Reduction Duration") { if (skillTreeNode.pointsAllocated > 0) { splatter_increasedArmourDebuffDuration += 0.3f; } } if (node.name == "Rip Blood Tree Vitality Reduction") { if (skillTreeNode.pointsAllocated > 0) { splatter_reducesDarkProtectionInstead = true; } } if (node.name == "Rip Blood Tree Buff Minion Damage") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat2.increasedValue = skillTreeNode.pointsAllocated * 0.3f; splatter_minionBuffs.Add(newStat2); } } if (node.name == "Rip Blood Tree Damage Per Minion") { if (skillTreeNode.pointsAllocated > 0) { splatter_increasedDamagePerMinion += 0.02f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Buff Minion Attack Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.1f; splatter_minionBuffs.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.AttackSpeed, null); newStat2.increasedValue = skillTreeNode.pointsAllocated * 0.1f; splatter_minionBuffs.Add(newStat2); } } if (node.name == "Rip Blood Tree Buff Minion Leech") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Physical); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.PercentLifeLeech, tagList2); newStat2.addedValue = skillTreeNode.pointsAllocated * 0.1f; splatter_minionBuffs.Add(newStat2); } } if (node.name == "Rip Blood Tree Cast Speed") { if (skillTreeNode.pointsAllocated > 0) { increasedCastSpeed += 0.06f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Mana Efficiency Vs Damage") { if (skillTreeNode.pointsAllocated > 0) { manaEfficiency += 0.5f * skillTreeNode.pointsAllocated; increasedDamage += -0.05f * skillTreeNode.pointsAllocated; splatter_increasedDamage += -0.05f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Free When Out Of Mana") { if (skillTreeNode.pointsAllocated > 0) { freeWhenOutOfMana = true; increasedHealthGained = -0.3f; } } if (node.name == "Rip Blood Tree Added Health Gained") { if (skillTreeNode.pointsAllocated > 0) { addedHealthGained += 3f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree More Health Per Attunement") { if (skillTreeNode.pointsAllocated > 0) { increasedHealthGainedPerAttunement += 0.04f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Mana Gained") { if (skillTreeNode.pointsAllocated > 0) { manaGained += 2f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Targets Minions") { if (skillTreeNode.pointsAllocated > 0) { targetsAlliesInstead = true; increasedHealthGained += 0.7f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Bleed Chance") { if (skillTreeNode.pointsAllocated > 0) { chanceToBleed += 0.2f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Blood Splatter Poison") { if (skillTreeNode.pointsAllocated > 0) { splatter_chanceToPoison += 0.2f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Spell Damage On Hit") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList2 = new List <Tags.AbilityTags>(); tagList2.Add(Tags.AbilityTags.Spell); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList2); newStat2.addedValue = skillTreeNode.pointsAllocated * 0.05f; onHitBuffs.Add(newStat2); } } if (node.name == "Rip Blood Tree Upfront Damage") { if (skillTreeNode.pointsAllocated > 0) { increasedDamage += 0.15f; } } if (node.name == "Rip Blood Tree Upfront Damage Per Minion") { if (skillTreeNode.pointsAllocated > 0) { increasedDamagePerMinion += 0.015f * skillTreeNode.pointsAllocated; } } if (node.name == "Rip Blood Tree Necrotic") { if (skillTreeNode.pointsAllocated > 0) { necrotic = true; } } } foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Rip Blood Tree Cast Again On Kill") { if (skillTreeNode.pointsAllocated > 0) { recastOnKill = true; increasedHealthGained -= 100f; manaGained = 0f; } } } foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Rip Blood Tree Splatter Debuff Stacks") { if (skillTreeNode.pointsAllocated > 0) { splatter_armourReductionStacks = true; splatter_armourReduction *= 0.4f; } } if (node.name == "Rip Blood Tree Bleed To Poison") { if (skillTreeNode.pointsAllocated > 0) { chanceToPoison = chanceToBleed; chanceToBleed = 0f; } } if (node.name == "Rip Blood Tree Health To Ward") { if (skillTreeNode.pointsAllocated > 0) { // half health gained increasedHealthGained *= 0.5f; increasedHealthGained -= 0.5f; // convert to ward convertHealthToWard = true; } } } mutator.splatter_increasedRadius = Mathf.Sqrt(increasedArea + 1) - 1; mutator.splatter_increasedDamage = splatter_increasedDamage; mutator.splatter_increasedStunChance = splatter_increasedStunChance; mutator.splatter_chanceToPoison = splatter_chanceToPoison; mutator.splatter_armourReductionChance = splatter_armourReductionChance; mutator.splatter_armourReduction = splatter_armourReduction; mutator.splatter_armourReductionStacks = splatter_armourReductionStacks; mutator.splatter_increasedArmourDebuffDuration = splatter_increasedArmourDebuffDuration; mutator.splatter_increasedDamagePerMinion = splatter_increasedDamagePerMinion; mutator.splatter_reducesDarkProtectionInstead = splatter_reducesDarkProtectionInstead; mutator.splatter_minionBuffs = splatter_minionBuffs; mutator.splatterChance = splatterChance; mutator.increasedDamage = increasedDamage; mutator.increasedStunChance = increasedStunChance; mutator.chanceToBleed = chanceToBleed; mutator.chanceToPoison = chanceToPoison; mutator.increasedDamagePerMinion = increasedDamagePerMinion; mutator.increasedCastSpeed = increasedCastSpeed; mutator.addedHealthGained = addedHealthGained; mutator.increasedHealthGained = increasedHealthGained; mutator.increasedHealthGainedPerAttunement = increasedHealthGainedPerAttunement; mutator.manaGained = manaGained; mutator.convertHealthToWard = convertHealthToWard; mutator.freeWhenOutOfMana = freeWhenOutOfMana; mutator.targetsAlliesInstead = targetsAlliesInstead; mutator.necrotic = necrotic; mutator.recastOnKill = recastOnKill; mutator.onHitBuffs = onHitBuffs; mutator.addedManaCostDivider = manaEfficiency; mutator.increasedManaCost = increasedManaCost; }
public override void updateMutator() { SacrificeMutator mutator = PlayerFinder.getPlayer().GetComponent <SacrificeMutator>(); float nova_increasedSpeed = 0f; bool nova_pierces = false; float nova_increasedDamage = 0f; float nova_increasedStunChance = 0f; float nova_bleedChance = 0f; float nova_addedCritChance = 0f; float nova_addedCritMultiplier = 0f; float nova_moreDamageAgainstBleeding = 0f; float boneNovaChance = 0f; float moreDamageAgainstBleeding = 0f; float increasedDotDamageOnCast = 0f; float increasedDamage = 0f; float increasedStunChance = 0f; float increasedDamagePerMinion = 0f; float increasedArea = 0f; float increasedAreaWith3OrMoreMinions = 0f; float increasedCastSpeed = 0f; float chanceToIgnite = 0f; float addedFireDamage = 0f; float bloodWraithChance = 0f; List <TaggedStatsHolder.TaggableStat> bloodWraithStats = new List <TaggedStatsHolder.TaggableStat>(); float increasedBloodWraithSize = 0f; float increasedDamageIfDetonatedMinionHasMoreHealth = 0f; float increasedDamageWithOneMinion = 0f; bool chainsBetweenMinions = false; float manaEfficiency = 0f; float increasedManaCost = 0f; bool cooldown = false; int addedCharges = 0; List <TaggedStatsHolder.TaggableStat> onHitBuffs = new List <TaggedStatsHolder.TaggableStat>(); SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Sacrifice Tree Damage Vs Mana Cost") { if (skillTreeNode.pointsAllocated > 0) { increasedDamage += 0.15f * skillTreeNode.pointsAllocated; increasedManaCost += 0.05f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Damage If Minion Has More Health") { if (skillTreeNode.pointsAllocated > 0) { increasedDamageIfDetonatedMinionHasMoreHealth += 0.35f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Damage If Only One Minion") { if (skillTreeNode.pointsAllocated > 0) { increasedDamageIfDetonatedMinionHasMoreHealth += 0.35f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Added Fire Damage") { if (skillTreeNode.pointsAllocated > 0) { addedFireDamage += 6f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Ignite Chance") { if (skillTreeNode.pointsAllocated > 0) { chanceToIgnite += 0.34f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Mana Efficiency and DoT on Cast") { if (skillTreeNode.pointsAllocated > 0) { manaEfficiency += 0.13f * skillTreeNode.pointsAllocated; increasedDotDamageOnCast += 0.13f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Damage Vs Bleeding") { if (skillTreeNode.pointsAllocated > 0) { moreDamageAgainstBleeding += 0.2f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Damage Per Minion") { if (skillTreeNode.pointsAllocated > 0) { increasedDamagePerMinion += 0.015f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Blood Wraith") { if (skillTreeNode.pointsAllocated > 0) { bloodWraithChance += 0.15f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Blood Wraith Bleed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BleedChance, null); newStat.addedValue = skillTreeNode.pointsAllocated * 0.34f; bloodWraithStats.Add(newStat); } } if (node.name == "Sacrifice Tree Blood Wraith Health And Damage") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.3f); bloodWraithStats.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.3f); bloodWraithStats.Add(newStat2); } } if (node.name == "Sacrifice Tree Blood Wraith Size") { if (skillTreeNode.pointsAllocated > 0) { cooldown = true; increasedBloodWraithSize += 0.4f; bloodWraithChance += 1f; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 1f); bloodWraithStats.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 1f); bloodWraithStats.Add(newStat2); } } if (node.name == "Sacrifice Tree Blood Wraith Leech") { if (skillTreeNode.pointsAllocated > 0) { bloodWraithChance += 0.05f * skillTreeNode.pointsAllocated; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.PercentLifeLeech, null); newStat.addedValue = skillTreeNode.pointsAllocated * 0.25f; bloodWraithStats.Add(newStat); } } if (node.name == "Sacrifice Tree Bone Nova") { if (skillTreeNode.pointsAllocated > 0) { boneNovaChance += 1f; increasedManaCost += 0.2f; } } if (node.name == "Sacrifice Tree Bone Nova Speed") { if (skillTreeNode.pointsAllocated > 0) { nova_increasedSpeed += 0.25f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Bone Nova Damage") { if (skillTreeNode.pointsAllocated > 0) { nova_increasedDamage += 0.25f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Bone Nova Pierces") { if (skillTreeNode.pointsAllocated > 0) { nova_pierces = true; } } if (node.name == "Sacrifice Tree Bone Nova Bleed Chance") { if (skillTreeNode.pointsAllocated > 0) { nova_bleedChance += 0.25f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree DoT Damage On Cast") { if (skillTreeNode.pointsAllocated > 0) { increasedDotDamageOnCast += 0.2f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Area And Stun Chance") { if (skillTreeNode.pointsAllocated > 0) { increasedArea += 0.2f * skillTreeNode.pointsAllocated; increasedStunChance += 0.2f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Area With Three Minions") { if (skillTreeNode.pointsAllocated > 0) { increasedAreaWith3OrMoreMinions += 0.4f * skillTreeNode.pointsAllocated; } } if (node.name == "Sacrifice Tree Chains") { if (skillTreeNode.pointsAllocated > 0) { chainsBetweenMinions = true; increasedManaCost += 0.9f; } } } if (cooldown) { mutator.addedCharges = 1 + addedCharges; mutator.addedChargeRegen = 0.125f; } else { mutator.addedCharges = 0; mutator.addedChargeRegen = 0; } mutator.nova_increasedSpeed = nova_increasedSpeed; mutator.nova_pierces = nova_pierces; mutator.nova_increasedDamage = nova_increasedDamage; mutator.nova_increasedStunChance = nova_increasedStunChance; mutator.nova_bleedChance = nova_bleedChance; mutator.nova_addedCritChance = nova_addedCritChance; mutator.nova_addedCritMultiplier = nova_addedCritMultiplier; mutator.nova_moreDamageAgainstBleeding = nova_moreDamageAgainstBleeding; mutator.boneNovaChance = boneNovaChance; mutator.moreDamageAgainstBleeding = moreDamageAgainstBleeding; mutator.increasedDotDamageOnCast = increasedDotDamageOnCast; mutator.increasedDamage = increasedDamage; mutator.increasedStunChance = increasedStunChance; mutator.increasedDamagePerMinion = increasedDamagePerMinion; mutator.increasedArea = increasedArea; mutator.increasedAreaWith3OrMoreMinions = increasedAreaWith3OrMoreMinions; mutator.increasedCastSpeed = increasedCastSpeed; mutator.chanceToIgnite = chanceToIgnite; mutator.addedFireDamage = addedFireDamage; mutator.bloodWraithChance = bloodWraithChance; mutator.bloodWraithStats = bloodWraithStats; mutator.increasedBloodWraithSize = increasedBloodWraithSize; mutator.increasedDamageIfDetonatedMinionHasMoreHealth = increasedDamageIfDetonatedMinionHasMoreHealth; mutator.increasedDamageWithOneMinion = increasedDamageWithOneMinion; mutator.chainsBetweenMinions = chainsBetweenMinions; mutator.addedManaCostDivider = manaEfficiency; mutator.increasedManaCost = increasedManaCost; }
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 void updateMutator() { GameObject player = PlayerFinder.getPlayer(); ThornTotemMutator mutator = player.GetComponent <ThornTotemMutator>(); float additionalDuration = 0f; int totemLimit = 2; float addedManaCostDivider = 0f; float increasedCooldownRecoverySpeed = 0f; float addedCharges = 0; float poisonCloudChance = 0f; int extraProjectiles = 0; bool homing = false; float chanceForDoubleDamage = 0f; float chanceToShredArmour = 0f; float chanceToPoison = 0f; float reducedSpread = 0f; float increasedThornTotemAttackDamage = 0f; int targetsToPierce = 0; float increasedManaCost = 0f; float increasedSpeed = 0f; List <TaggedStatsHolder.TaggableStat> statList = new List <TaggedStatsHolder.TaggableStat>(); SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Thorn Totem Tree More Totems") { if (skillTreeNode.pointsAllocated > 0) { totemLimit += skillTreeNode.pointsAllocated * 1; addedCharges += skillTreeNode.pointsAllocated * 1; increasedManaCost += skillTreeNode.pointsAllocated * 0.4f; additionalDuration += skillTreeNode.pointsAllocated * 3; } } if (node.name == "Thorn Totem Tree Cooldown") { increasedCooldownRecoverySpeed += skillTreeNode.pointsAllocated * 0.3f; } if (node.name == "Thorn Totem Tree Mana Efficiency") { addedManaCostDivider += skillTreeNode.pointsAllocated * 0.35f; } if (node.name == "Thorn Totem Tree Poison Cloud") { poisonCloudChance += skillTreeNode.pointsAllocated * 0.25f; } if (node.name == "Thorn Totem Tree Poison Chance") { chanceToPoison += skillTreeNode.pointsAllocated * 0.143f; } if (node.name == "Thorn Totem Tree Extra Projectiles") { extraProjectiles += skillTreeNode.pointsAllocated * 1; } if (node.name == "Thorn Totem Tree Homing") { if (skillTreeNode.pointsAllocated > 0) { homing = true; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * -0.25f); statList.Add(newStat); } } if (node.name == "Thorn Totem Tree Damage vs Cast Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.18f); statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat2.moreValues.Add(skillTreeNode.pointsAllocated * -0.05f); statList.Add(newStat2); } } if (node.name == "Thorn Totem Tree Armour Shred Chance") { chanceForDoubleDamage += skillTreeNode.pointsAllocated * 0.143f; } if (node.name == "Thorn Totem Tree Reduced Spread") { reducedSpread += skillTreeNode.pointsAllocated * 40f; } if (node.name == "Thorn Totem Tree Physical Damage vs Distance And Speed") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Physical); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.18f); statList.Add(newStat); increasedSpeed += skillTreeNode.pointsAllocated * -0.1f; } } if (node.name == "Thorn Totem Tree More Health") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.moreValues.Add(skillTreeNode.pointsAllocated * 0.1f); statList.Add(newStat); } } if (node.name == "Thorn Totem Tree Increased Speed") { if (skillTreeNode.pointsAllocated > 0) { increasedSpeed += skillTreeNode.pointsAllocated * 0.2f; } } if (node.name == "Thorn Totem Tree Double Damage Chance") { chanceForDoubleDamage += skillTreeNode.pointsAllocated * 0.17f; } } // update the mutator mutator.additionalDuration = additionalDuration; mutator.totemLimit = totemLimit; mutator.addedManaCostDivider = addedManaCostDivider; mutator.addedChargeRegen = ability.chargesGainedPerSecond * increasedCooldownRecoverySpeed; mutator.addedCharges = addedCharges; mutator.statList.Clear(); mutator.statList.AddRange(statList); mutator.poisonCloudChance = poisonCloudChance; mutator.extraProjectiles = extraProjectiles; mutator.homing = homing; mutator.chanceForDoubleDamage = chanceForDoubleDamage; mutator.chanceToShredArmour = chanceToShredArmour; mutator.chanceToPoison = chanceToPoison; mutator.reducedSpread = reducedSpread; mutator.increasedThornTotemAttackDamage = increasedThornTotemAttackDamage; mutator.targetsToPierce = targetsToPierce; mutator.increasedManaCost = increasedManaCost; mutator.increasedSpeed = increasedSpeed; // update existing totems if (player.GetComponent <SummonTracker>()) { // get a list of existing wolves List <SummonChangeTracker> totems = new List <SummonChangeTracker>(); foreach (Summoned summon in player.GetComponent <SummonTracker>().summons) { if (summon.GetComponent <CreationReferences>() && summon.GetComponent <CreationReferences>().thisAbility == ability && summon.GetComponent <SummonChangeTracker>()) { totems.Add(summon.GetComponent <SummonChangeTracker>()); } } // update the wolves foreach (SummonChangeTracker totem in totems) { totem.changeStats(statList); totem.changeLimitDuration(true, ability.abilityPrefab.GetComponent <SummonEntityOnDeath>().duration + additionalDuration); } } }
public override void updateMutator() { GameObject player = PlayerFinder.getPlayer(); SummonBearMutator mutator = player.GetComponent <SummonBearMutator>(); bool thornBear = false; bool Retaliates = false; float thornPoisonChance = 0f; float thornBurstBleedChance = 0f; float thornBurstAddedSpeed = 0f; float clawTotemOnKillChance = 0f; float ThornAttackChanceForDoubleDamage = 0f; float ThornAttackChanceToShredArmour = 0f; bool usesSwipe = false; float increasedSwipeCooldownRecovery = 0f; int thornAttackEnemiesToPierce = 0; float thornCooldown = 0f; float percentReducedRetaliationThreshold = 0f; List <TaggedStatsHolder.TaggableStat> statList = new List <TaggedStatsHolder.TaggableStat>(); SkillTreeNode skillTreeNode; foreach (SkillTreeNode node in GetComponentsInChildren <SkillTreeNode>()) { skillTreeNode = node.GetComponent <SkillTreeNode>(); if (node.name == "Summon Bear Skill Tree Thorn Bear") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { thornBear = true; percentReducedRetaliationThreshold = 0.6f; } } if (node.name == "Summon Bear Skill Tree Thorn Attack Double Damage") { ThornAttackChanceForDoubleDamage += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Summon Bear Skill Tree Thorn Attack Pierce") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * -0.1f; statList.Add(newStat); thornAttackEnemiesToPierce += 10000; } } if (node.name == "Summon Bear Skill Tree Thorn Attack Armour Shred") { ThornAttackChanceToShredArmour += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Summon Bear Skill Tree Cast Speed") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CastSpeed, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.08f; statList.Add(newStat); } } if (node.name == "Summon Bear Skill Tree Retaliates") { Retaliates = (node.GetComponent <SkillTreeNode>().pointsAllocated > 0); } if (node.name == "Summon Bear Skill Tree Thorn Poison") { thornPoisonChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.2f; } if (node.name == "Summon Bear Skill Tree Thorn Attack Cooldown") { if (node.GetComponent <SkillTreeNode>().pointsAllocated > 0) { thornCooldown += 4; TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.moreValues.Add(0.08f); statList.Add(newStat); } } if (node.name == "Summon Bear Skill Tree Thorn Burst Bleed") { thornBurstBleedChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.25f; } if (node.name == "Summon Bear Skill Tree Thorn Burst Speed") { thornBurstAddedSpeed += node.GetComponent <SkillTreeNode>().pointsAllocated * 2.4f; } if (node.name == "Summon Bear Skill Tree Claw Totem") { clawTotemOnKillChance += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.1f; } if (node.name == "Summon Bear Skill Tree Swipe") { usesSwipe = (node.GetComponent <SkillTreeNode>().pointsAllocated > 0); } if (node.name == "Summon Bear Skill Tree Swipe Cooldown") { increasedSwipeCooldownRecovery += node.GetComponent <SkillTreeNode>().pointsAllocated * 0.4f; } if (node.name == "Summon Bear Skill Tree Melee Damage And Stun") { if (skillTreeNode.pointsAllocated > 0) { List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>(); tagList.Add(Tags.AbilityTags.Melee); TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, tagList); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.15f; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.IncreasedStunChance, tagList); newStat2.addedValue = skillTreeNode.pointsAllocated * 0.15f; statList.Add(newStat2); } } if (node.name == "Summon Bear Skill Tree Added Health And Tenacity") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Health, null); newStat.addedValue = skillTreeNode.pointsAllocated * 100; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Tenacity, null); newStat2.addedValue = skillTreeNode.pointsAllocated * 100; statList.Add(newStat2); } } if (node.name == "Summon Bear Skill Tree Damage And Bleed Chance") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.BleedChance, null); newStat.addedValue = skillTreeNode.pointsAllocated * 0.1f; statList.Add(newStat); TaggedStatsHolder.TaggableStat newStat2 = new TaggedStatsHolder.TaggableStat(Tags.Properties.Damage, null); newStat2.increasedValue = skillTreeNode.pointsAllocated * 0.15f; statList.Add(newStat2); } } if (node.name == "Summon Bear Skill Tree Armour") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.Armour, null); newStat.addedValue = skillTreeNode.pointsAllocated * 150f; statList.Add(newStat); } } if (node.name == "Summon Bear Skill Tree Crit Chance") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CriticalChance, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.4f; statList.Add(newStat); } } if (node.name == "Summon Bear Skill Tree Crit Damage") { if (skillTreeNode.pointsAllocated > 0) { TaggedStatsHolder.TaggableStat newStat = new TaggedStatsHolder.TaggableStat(Tags.Properties.CriticalMultiplier, null); newStat.increasedValue = skillTreeNode.pointsAllocated * 0.3f; statList.Add(newStat); } } } // update the mutator mutator.thornBear = thornBear; mutator.Retaliates = Retaliates; mutator.thornPoisonChance = thornPoisonChance; mutator.thornBurstBleedChance = thornBurstBleedChance; mutator.clawTotemOnKillChance = clawTotemOnKillChance; mutator.thornBurstAddedSpeed = thornBurstAddedSpeed; mutator.ThornAttackChanceForDoubleDamage = ThornAttackChanceForDoubleDamage; mutator.ThornAttackChanceToShredArmour = ThornAttackChanceToShredArmour; mutator.usesSwipe = usesSwipe; mutator.increasedSwipeCooldownRecovery = increasedSwipeCooldownRecovery; mutator.thornAttackEnemiesToPierce = thornAttackEnemiesToPierce; mutator.thornCooldown = thornCooldown; mutator.percentReducedRetaliationThreshold = percentReducedRetaliationThreshold; // update existing bears if (player.GetComponent <SummonTracker>()) { // get a list of existing bears List <SummonChangeTracker> bears = new List <SummonChangeTracker>(); foreach (Summoned summon in player.GetComponent <SummonTracker>().summons) { if (summon.GetComponent <CreationReferences>() && summon.GetComponent <CreationReferences>().thisAbility == ability && summon.GetComponent <SummonChangeTracker>()) { bears.Add(summon.GetComponent <SummonChangeTracker>()); } } // update the bears foreach (SummonChangeTracker bear in bears) { bear.changeStats(statList); } } }
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) { 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); }