Ejemplo n.º 1
0
 // Use this for initialization
 protected override void Awake()
 {
     ability   = AbilityIDList.getAbility(AbilityID.shieldRush);
     health    = GetComponent <BaseHealth>();
     baseStats = GetComponent <BaseStats>();
     base.Awake();
 }
Ejemplo n.º 2
0
    // Use this for initialization
    protected override void Awake()
    {
        ability   = AbilityIDList.getAbility(AbilityID.tornado);
        statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject);

        base.Awake();
    }
Ejemplo n.º 3
0
 public void onKill(Ability _ability, GameObject target)
 {
     if (snakeOnKillChance > 0 && (_ability == ability))
     {
         float rand = Random.Range(0f, 1f);
         if (rand < snakeOnKillChance)
         {
             if (!usingAbility)
             {
                 usingAbility = GetComponent <UsingAbility>();
             }
             if (usingAbility)
             {
                 usingAbility.UseAbility(AbilityIDList.getAbility(AbilityID.summonSerpent), target.transform.position, false, false);
             }
         }
     }
     if (lifeOnKill != 0 && (_ability == ability))
     {
         float rand = Random.Range(0f, 1f);
         if (rand < lifeOnKill)
         {
             if (!baseHealth)
             {
                 baseHealth = GetComponent <BaseHealth>();
             }
             if (baseHealth)
             {
                 baseHealth.Heal(lifeOnKill);
             }
         }
     }
 }
Ejemplo n.º 4
0
    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 duration
        summoner.duration += additionalDuration;

        // add additional stats
        summoner.statList.AddRange(statList);
        summoner.limit = 3 + additionalSkeletons;

        // change limit type
        if (limitDuration)
        {
            summoner.limitNumber   = false;
            summoner.limitDuration = true;
        }

        // change the adapter
        SkeletonAdapter adapter = abilityObject.AddComponent <SkeletonAdapter>();

        adapter.tempStats = tempStats;

        // add extra abilities
        if (usesDeathSlash)
        {
            adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.deathSlash), 1, 0.2f * (1 + increasedDeathSlashCooldownRecovery), 0f, 1.2f, 1.6f, 11.8f, false));
        }

        return(abilityObject);
    }
Ejemplo n.º 5
0
 public void OnHit(Ability _ability, GameObject target)
 {
     if (firstHit)
     {
         firstHit = false;
         // buffs
         if (increasedDamageOnFirstHit != 0)
         {
             statBuffs.addBuff(4f, Tags.Properties.Damage, 0, increasedDamageOnFirstHit, null, null);
         }
         if (increasedAttackSpeedOnFirstHit != 0)
         {
             statBuffs.addBuff(4f, Tags.Properties.AttackSpeed, 0, increasedAttackSpeedOnFirstHit, null, null, null, "Swipe attack speed");
             statBuffs.addBuff(4f, Tags.Properties.CastSpeed, 0, increasedAttackSpeedOnFirstHit, null, null, null, "Swipe cast speed");
         }
         if (increasedCritChanceOnFirstHit != 0)
         {
             statBuffs.addBuff(4f, Tags.Properties.CriticalChance, 0, increasedCritChanceOnFirstHit, null, null, null, "Swipe crit chance");
         }
         if (addedCritMultiOnFirstHit != 0)
         {
             statBuffs.addBuff(4f, Tags.Properties.CriticalMultiplier, addedCritMultiOnFirstHit, 0, null, null, null, "Swipe crit multi");
         }
         // wolf
         float random = Random.Range(0f, 1f);
         if (!usingAbility)
         {
             usingAbility = GetComponent <UsingAbility>();
         }
         if (random < spiritWolvesOnFirstHitChance)
         {
             usingAbility.UseAbility(AbilityIDList.getAbility(AbilityID.spiritWolves), lastTargetPosition, false, false);
         }
     }
 }
Ejemplo n.º 6
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.summonSkeleton);
        base.Awake();
        summonWarrior = Ability.getAbility(AbilityID.summonSkeletonWarrior);
        summonMage    = Ability.getAbility(AbilityID.summonSkeletonMage);
        summonArcher  = Ability.getAbility(AbilityID.summonSkeletonArcher);
        summonWarlord = Ability.getAbility(AbilityID.summonSkeletonWarlord);
        summonBrawler = Ability.getAbility(AbilityID.summonSkeletonBrawler);

        skeletonAbilities.Add(ability);
        skeletonAbilities.Add(summonWarrior);
        skeletonAbilities.Add(summonMage);
        skeletonAbilities.Add(summonArcher);
        skeletonAbilities.Add(summonWarlord);
        skeletonAbilities.Add(summonBrawler);

        summonTracker = Comp <SummonTracker> .GetOrAdd(gameObject);

        summonTracker.newSummonEvent += onNewSummon;

        protectionClass = GetComponent <ProtectionClass>();
        if (protectionClass)
        {
            health = protectionClass.healthClass;
        }
        else
        {
            health = GetComponent <BaseHealth>();
        }
        mana = GetComponent <BaseMana>();

        statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject);
    }
Ejemplo n.º 7
0
    public override GameObject adapt(GameObject entity)
    {
        if (poisonCloudChance > 0)
        {
            float rand = Random.Range(0f, 1f);
            if (rand < poisonCloudChance)
            {
                UseAbilityOnActorDeath comp = entity.AddComponent <UseAbilityOnActorDeath>();
                comp.abilityToInstantiate = AbilityIDList.getAbility(AbilityID.poisonCloud);
            }
        }

        ThornTotemAttackMutator ttam = entity.GetComponent <ThornTotemAttackMutator>();

        if (!ttam)
        {
            ttam = entity.AddComponent <ThornTotemAttackMutator>();
        }
        ttam.extraProjectiles      = extraProjectiles;
        ttam.homing                = homing;
        ttam.chanceForDoubleDamage = chanceForDoubleDamage;
        ttam.chanceToShredArmour   = chanceToShredArmour;
        ttam.chanceToPoison        = chanceToPoison;
        ttam.reducedSpread         = reducedSpread;
        ttam.increasedDamage       = increasedThornTotemAttackDamage;
        ttam.targetsToPierce       = targetsToPierce;
        ttam.increasedSpeed        = increasedSpeed;

        return(base.adapt(entity));
    }
Ejemplo n.º 8
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.summonWraith);
        health  = GetComponent <BaseHealth>();
        mana    = GetComponent <BaseMana>();

        if (health)
        {
            statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject);

            tracker = Comp <SummonTracker> .GetOrAdd(gameObject);

            AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject);

            listener.onCritEvent += OnCrit;
        }

        // get wraith prefabs
        if (flameWraithPrefab == null)
        {
            Ability wraithAbility = Ability.getAbility(AbilityID.summonFlameWraith);
            if (wraithAbility && wraithAbility.abilityPrefab)
            {
                SummonEntityOnDeath summon = wraithAbility.abilityPrefab.GetComponent <SummonEntityOnDeath>();
                if (summon)
                {
                    flameWraithPrefab = summon.entity;
                }
            }

            wraithAbility = Ability.getAbility(AbilityID.summonPutridWraith);
            if (wraithAbility && wraithAbility.abilityPrefab)
            {
                SummonEntityOnDeath summon = wraithAbility.abilityPrefab.GetComponent <SummonEntityOnDeath>();
                if (summon)
                {
                    putridWraithPrefab = summon.entity;
                }
            }

            wraithAbility = Ability.getAbility(AbilityID.summonBloodWraith);
            if (wraithAbility && wraithAbility.abilityPrefab)
            {
                SummonEntityOnDeath summon = wraithAbility.abilityPrefab.GetComponent <SummonEntityOnDeath>();
                if (summon)
                {
                    bloodWraithPrefab = summon.entity;
                }
            }
        }

        // spirit escape prefab
        if (spiritEscapePrefab == null)
        {
            spiritEscapePrefab = PrefabList.getPrefab("spiritEscape");
        }

        base.Awake();
    }
Ejemplo n.º 9
0
 public void GainManaOnHit(Ability _ability, GameObject target)
 {
     if (percentManaGainedOnHit > 0 && (_ability == ability || _ability == AbilityIDList.getAbility(AbilityID.glacier1) ||
                                        _ability == AbilityIDList.getAbility(AbilityID.glacier2) || _ability == AbilityIDList.getAbility(AbilityID.glacier3)))
     {
         mana.gainMana(percentManaGainedOnHit * mana.maxMana);
     }
 }
Ejemplo n.º 10
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        if (chanceForChainingIceNova > 0)
        {
            float rand2 = Random.Range(0f, 1f);
            if (rand2 < chanceForChainingIceNova)
            {
                CreateAbilityObjectOnNewEnemtHit newComponent = abilityObject.AddComponent <CreateAbilityObjectOnNewEnemtHit>();
                newComponent.abilityToInstantiate = AbilityIDList.getAbility(AbilityID.delayerForChainingIceNova);
            }
        }

        if (chillChance > 0)
        {
            ChanceToApplyStatusOnEnemyHit newComponent = abilityObject.AddComponent <ChanceToApplyStatusOnEnemyHit>();
            newComponent.statusEffect = StatusEffectList.getEffect(StatusEffectID.Chill);
            newComponent.chance       = chillChance;
        }

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

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

        if (canTarget)
        {
            abilityObject.AddComponent <StartsAtTarget>();
        }

        if (ignites)
        {
            ApplyStatusOnEnemyHit apply = abilityObject.AddComponent <ApplyStatusOnEnemyHit>();
            apply.statusEffect = StatusEffectList.getEffect(StatusEffectID.Ignite);
        }

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

        return(abilityObject);
    }
Ejemplo n.º 11
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.hammerThrow);
        base.Awake();
        mana   = GetComponent <BaseMana>();
        health = GetComponent <BaseHealth>();
        AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject);

        ael.onHitEvent += OnHit;
    }
Ejemplo n.º 12
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.tempest);
        base.Awake();
        AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject);

        ael.onHitEvent  += OnHit;
        aoc              = GetComponent <AbilityObjectConstructor>();
        weaponInfoHolder = GetComponent <WeaponInfoHolder>();
    }
Ejemplo n.º 13
0
 public override void setAbility()
 {
     ability = AbilityIDList.getAbility(AbilityID.summonSkeleton);
     // get ability references
     summonWarrior = Ability.getAbility(AbilityID.summonSkeletonWarrior);
     summonMage    = Ability.getAbility(AbilityID.summonSkeletonMage);
     summonArcher  = Ability.getAbility(AbilityID.summonSkeletonArcher);
     summonWarlord = Ability.getAbility(AbilityID.summonSkeletonWarlord);
     summonBrawler = Ability.getAbility(AbilityID.summonSkeletonBrawler);
 }
Ejemplo n.º 14
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.volatileReversal);
        AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject);

        ael.onKillEvent += OnKill;
        chargeManager    = GetComponent <ChargeManager>();
        health           = GetComponent <BaseHealth>();
        base.Awake();
    }
Ejemplo n.º 15
0
 public void OnKill(Ability _ability, GameObject target)
 {
     if (protectionClass && explosionWardGainedOnKillChance > 0 && _ability == AbilityIDList.getAbility(AbilityID.lightningExplosion))
     {
         float rand = Random.Range(0f, 1f);
         if (rand < explosionWardGainedOnKillChance)
         {
             protectionClass.currentWard += explosionWardGainedOnKill;
         }
     }
 }
Ejemplo n.º 16
0
 // Use this for initialization
 protected override void Awake()
 {
     ability   = AbilityIDList.getAbility(AbilityID.lightningBlast);
     statBuffs = GetComponent <StatBuffs>();
     if (statBuffs == null)
     {
         statBuffs = gameObject.AddComponent <StatBuffs>();
     }
     protectionClass = GetComponent <ProtectionClass>();
     base.Awake();
 }
Ejemplo n.º 17
0
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.entanglingRoots);
        base.Awake();
        AbilityEventListener eventListener = GetComponent <AbilityEventListener>();

        if (eventListener)
        {
            eventListener.onKillEvent += OnKill;
        }
        usingAbility = GetComponent <UsingAbility>();
    }
Ejemplo n.º 18
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.serpentStrike);
        AbilityEventListener listener = GetComponent <AbilityEventListener>();

        if (!listener)
        {
            listener = gameObject.AddComponent <AbilityEventListener>();
        }
        listener.onKillEvent += onKill;
        listener.onCritEvent += onCrit;
        base.Awake();
    }
Ejemplo n.º 19
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.glacier);
        mana    = GetComponent <BaseMana>();
        AbilityEventListener eventListener = GetComponent <AbilityEventListener>();

        if (eventListener)
        {
            eventListener.onKillEvent += GainManaOnKill;
            eventListener.onHitEvent  += GainManaOnHit;
        }
        base.Awake();
    }
Ejemplo n.º 20
0
 public void OnKill(Ability _ability, GameObject target)
 {
     if (_ability == ability)
     {
         if (thornTrailOnKillChance > 0)
         {
             float rand = Random.Range(0f, 1f);
             if (rand < thornTrailOnKillChance)
             {
                 ua.UseAbility(AbilityIDList.getAbility(AbilityID.thornTrail), transform.position + transform.forward, false, false);
             }
         }
     }
 }
Ejemplo n.º 21
0
 public void OnKill(Ability _ability, GameObject target)
 {
     if (vineOnKillChance > 0 && usingAbility && target)
     {
         if (_ability == ability || _ability == AbilityIDList.getAbility(AbilityID.entanglingRootsHit) || _ability == AbilityIDList.getAbility(AbilityID.entanglingRootsInitialHit))
         {
             float rand = Random.Range(0f, 1f);
             if (rand < vineOnKillChance)
             {
                 usingAbility.UseAbility(AbilityIDList.getAbility(AbilityID.summonVineAtTarget), target.transform.position, false, false);
             }
         }
     }
 }
Ejemplo n.º 22
0
    public override GameObject adapt(GameObject entity)
    {
        if (thornBear)
        {
            // activate thorns
            foreach (EntityObjectIndicator eoi in entity.GetComponentsInChildren <EntityObjectIndicator>(true))
            {
                if (eoi.objectType == EntityObjectIndicator.EntityObjectType.Thorn)
                {
                    eoi.gameObject.SetActive(true);
                }
            }

            // change attack
            ThornTotemAttackMutator ttam = entity.AddComponent <ThornTotemAttackMutator>();
            ttam.singleProjectile          = true;
            ttam.firstProjectileIsAccurate = true;
            ttam.increasedDamage           = 3f;
            ttam.chanceForDoubleDamage     = ThornAttackChanceForDoubleDamage;
            ttam.chanceToShredArmour       = ThornAttackChanceToShredArmour;
            ttam.chanceToPoison            = thornPoisonChance;
            ttam.targetsToPierce           = thornAttackEnemiesToPierce;
        }

        if (retaliates)
        {
            ThornBurstMutator tbm = entity.AddComponent <ThornBurstMutator>();
            tbm.chanceToPoison = thornPoisonChance;
            tbm.chanceToBleed  = thornBurstBleedChance;
            tbm.addedSpeed     = thornBurstAddedSpeed;
        }

        if (clawTotemOnKillChance > 0)
        {
            ChanceToCastOnKill ctcok = entity.AddComponent <ChanceToCastOnKill>();
            ctcok.summonerCasts = true;
            ctcok.castChance    = clawTotemOnKillChance;
            ctcok.ability       = AbilityIDList.getAbility(AbilityID.summonClawTotem);
        }


        if (swipes)
        {
            SwipeMutator sm = entity.AddComponent <SwipeMutator>();
            sm.addedPhysicalDamage = 32;
        }

        return(base.adapt(entity));
    }
Ejemplo n.º 23
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.staticOrb);
        base.Awake();
        AbilityEventListener eventListener = GetComponent <AbilityEventListener>();

        if (eventListener)
        {
            eventListener.onKillEvent += OnKill;
            eventListener.onHitEvent  += OnHit;
        }
        protectionClass = GetComponent <ProtectionClass>();
        mana            = GetComponent <BaseMana>();
        usingAbility    = GetComponent <UsingAbility>();
    }
Ejemplo n.º 24
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.vengeance);
        base.Awake();
        mana   = GetComponent <BaseMana>();
        health = GetComponent <BaseHealth>();
        AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject);

        statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject);

        ua = GetComponent <UsingAbility>();

        ael.onHitEvent += OnHit;
        ael.onHitEvent += OnKill;
    }
    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 duration
        summoner.duration += additionalDuration;

        // add additional stats
        summoner.statList.AddRange(statList);
        summoner.limit = 3 + additionalSkeletons;

        // change the limit type
        if (limitDuration)
        {
            summoner.limitNumber   = false;
            summoner.limitDuration = true;
        }

        SkeletonArcherAdapter adapter = abilityObject.AddComponent <SkeletonArcherAdapter>();

        adapter.tempStats.AddRange(tempStats);
        adapter.pierces         = poisonArrowPierces;
        adapter.inaccurate      = poisonArrowInaccurate;
        adapter.increasedDamage = poisonArrowIncreasedDamage;
        adapter.delayedAttacks  = poisonArrowDelayedAttacks;
        adapter.usesPoisonArrow = usesPoisonArrow;

        // add extra abilities
        if (usesMultishot)
        {
            adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.multishot), 1, 0.17f * (1 + increasedMultishotCooldownSpeed), 0f, 8f, 9f, 11.8f, false));
        }

        // avoid dividing by 0
        if (increasedPoisonArrowCooldown == -1)
        {
            increasedPoisonArrowCooldown = -0.9f;
        }

        // add extra abilities
        if (usesPoisonArrow)
        {
            adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.poisonArrow), 1, 0.25f * (1 + increasedPoisonArrowCooldownSpeed) / (1 + increasedPoisonArrowCooldown), 0f, 8f, 9f, 11.8f, false));
        }

        return(abilityObject);
    }
Ejemplo n.º 26
0
 // Use this for initialization
 protected override void Awake()
 {
     ability = AbilityIDList.getAbility(AbilityID.nova);
     base.Awake();
     if (GetComponent <AbilityEventListener>())
     {
         GetComponent <AbilityEventListener>().onKillEvent += GainWardOnKill;
         GetComponent <AbilityEventListener>().onHitEvent  += OnHit;
     }
     protectionClass = GetComponent <ProtectionClass>();
     statBuffs       = GetComponent <StatBuffs>();
     if (!statBuffs)
     {
         statBuffs = gameObject.AddComponent <StatBuffs>();
     }
 }
Ejemplo n.º 27
0
    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>();

        SprigganAdapter adapter = abilityObject.AddComponent <SprigganAdapter>();

        if (castsEntanglingRoots)
        {
            adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.entanglingRoots), 1f, (1f / baseRootsCooldown) * (1 + rootsCooldownRecovery), 0f, 5f, 6f, 11f, false));
        }

        if (summonsVines)
        {
            adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.summonVineAtTarget), 1f, (1f / baseVineCooldown) * (1 + vineCooldownRecovery) / (1 + increasedVineCooldown), 0f, 9f, 10f, 11f, false));
        }


        adapter.extraLeafShieldStats = new List <TaggedStatsHolder.TaggableStat>();
        adapter.extraLeafShieldStats.AddRange(extraLeafShieldStats);

        // vale orb
        adapter.orbExtraProjectiles          = orbExtraProjectiles;
        adapter.orbTargetsToPierce           = orbTargetsToPierce;
        adapter.orbIncreasedCastSpeed        = orbIncreasedCastSpeed;
        adapter.orbFireInSequence            = orbFireInSequence;
        adapter.orbChanceForDoubleDamage     = orbChanceForDoubleDamage;
        adapter.orbIncreasedDamage           = orbIncreasedDamage;
        adapter.orbMoreDamageAgainstPoisoned = orbMoreDamageAgainstPoisoned;
        adapter.orbMoreDamageAgainstBleeding = orbMoreDamageAgainstBleeding;

        // entangling roots
        adapter.castsEntanglingRoots   = castsEntanglingRoots;
        adapter.rootsIncreasedDamage   = rootsIncreasedDamage;
        adapter.rootsIncreasedRadius   = rootsIncreasedRadius;
        adapter.rootsAddedPatches      = rootsAddedPatches;
        adapter.rootsPatchesInLine     = rootsPatchesInLine;
        adapter.rootsVineOnKillChance  = rootsVineOnKillChance;
        adapter.rootsIncreasedDuration = rootsIncreasedDuration;
        adapter.rootsHealingNovaChance = rootsHealingNovaChance;

        // vines
        adapter.summonsVines = summonsVines;
        adapter.extraVines   = extraVines;

        return(abilityObject);
    }
Ejemplo n.º 28
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.ripBlood);
        AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject);

        listener.onHitEvent  += OnHit;
        listener.onKillEvent += OnKill;
        statBuffs             = Comp <StatBuffs> .GetOrAdd(gameObject);

        tracker = Comp <SummonTracker> .GetOrAdd(gameObject);

        aoc = Comp <AbilityObjectConstructor> .GetOrAdd(gameObject);

        mana      = GetComponent <BaseMana>();
        baseStats = GetComponent <BaseStats>();
        base.Awake();
    }
Ejemplo n.º 29
0
    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>();

        BearAdapter adapter = abilityObject.AddComponent <BearAdapter>();

        // give the wolf weak leap if necessary
        if (thornBear)
        {
            adapter.thornBear = true;

            // Add ability
            if (thornCooldown > 0)
            {
                adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.thornTotemAttack), 1f, 1f / thornCooldown, 2f, 7f, 8f, 11f, false));
            }
            else
            {
                adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.thornTotemAttack), 0, 0, 0, 7f, 8f, 11f, false));
            }
            adapter.ThornAttackChanceToShredArmour   = ThornAttackChanceToShredArmour;
            adapter.ThornAttackChanceForDoubleDamage = ThornAttackChanceForDoubleDamage;
            adapter.thornAttackEnemiesToPierce       = thornAttackEnemiesToPierce;
        }

        if (usesSwipe)
        {
            // Add ability
            adapter.extraAbilities.Add(new EntityAdapter.ExtraAbility(AbilityIDList.getAbility(AbilityID.swipe), 1, 0.2f * (1 + increasedSwipeCooldownRecovery), 0, 1f, 1.3f, 4f, false));
            adapter.swipes = usesSwipe;
        }

        if (Retaliates)
        {
            adapter.retaliates = true;
            adapter.retaliators.Add(new EntityAdapter.Retaliator(AbilityIDList.getAbility(AbilityID.thornBurst), Mathf.RoundToInt(75f * (1f - percentReducedRetaliationThreshold)), Mathf.RoundToInt(75f * (1f - percentReducedRetaliationThreshold) * 0.75f)));
            adapter.thornBurstAddedSpeed  = thornBurstAddedSpeed;
            adapter.thornBurstBleedChance = thornBurstBleedChance;
        }

        adapter.thornPoisonChance     = thornPoisonChance;
        adapter.clawTotemOnKillChance = clawTotemOnKillChance;

        return(abilityObject);
    }
Ejemplo n.º 30
0
 public void ResetCooldown(Ability _ability, GameObject target)
 {
     // if reset cooldown on kill is true and there was a kill from this ability then reset the cooldown
     if (resetCooldownOnKill && (_ability == ability || _ability == AbilityIDList.getAbility(AbilityID.furyLeapAoe) ||
                                 (lightningKillsResetCooldown && _ability == AbilityIDList.getAbility(AbilityID.furyLeapLightning))))
     {
         GetComponent <ChargeManager>().addAbilityCharges(ability, 1);
     }
     else if (chanceToResetCooldownOnAnyKill > 0f)
     {
         float rand = Random.Range(0f, 1f);
         if (rand < chanceToResetCooldownOnAnyKill)
         {
             GetComponent <ChargeManager>().addAbilityCharges(ability, 1);
         }
     }
 }