Exemple #1
0
    // Use this for initialization
    protected override void Awake()
    {
        ability   = AbilityIDList.getAbility(AbilityID.tornado);
        statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject);

        base.Awake();
    }
Exemple #2
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();
    }
Exemple #3
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();
 }
Exemple #4
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;
    }
Exemple #5
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>();
     }
 }
    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));
    }
    // 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();
    }
    public void Apply(GameObject go)
    {
        StatBuffs buffs = go.GetComponent <StatBuffs>();

        if (buffs == null)
        {
            buffs = go.AddComponent <StatBuffs>();
        }

        foreach (Buff buff in simpleBuffs)
        {
            buffs.addBuff(buff.remainingDuration, buff.stat.property, buff.stat.addedValue, buff.stat.increasedValue, buff.stat.moreValues, buff.stat.quotientValues, null, buff.name);
        }
        foreach (TaggedBuff buff in taggedBuffs)
        {
            buffs.addBuff(buff.remainingDuration, buff.stat.property, buff.stat.addedValue, buff.stat.increasedValue, buff.stat.moreValues, buff.stat.quotientValues, buff.stat.tagList, buff.name);
        }
    }
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.abyssalEchoes);
        base.Awake();
        AbilityEventListener ael = GetComponent <AbilityEventListener>();

        if (ael)
        {
            ael.onKillEvent += onKill;
        }
        aoc       = GetComponent <AbilityObjectConstructor>();
        statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject);

        if (statBuffs == null)
        {
            statBuffs = gameObject.AddComponent <StatBuffs>();
        }
    }
Exemple #10
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.swipe);
        AbilityEventListener listener = GetComponent <AbilityEventListener>();

        if (!listener)
        {
            listener = gameObject.AddComponent <AbilityEventListener>();
        }
        listener.onKillEvent += SummonOnKill;
        listener.onHitEvent  += OnHit;
        base.Awake();
        statBuffs = GetComponent <StatBuffs>();
        if (statBuffs == null)
        {
            statBuffs = gameObject.AddComponent <StatBuffs>();
        }
    }
Exemple #11
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.manaStrike);
        base.Awake();
        mana = GetComponent <BaseMana>();
        AbilityEventListener ael = GetComponent <AbilityEventListener>();

        if (ael)
        {
            ael.onHitEvent  += onHit;
            ael.onKillEvent += onKill;
            ael.onCritEvent += onCrit;
        }
        aoc = GetComponent <AbilityObjectConstructor>();
        lightningDisplacement = new Vector3(0f, 1f, 0f);
        statBuffs             = GetComponent <StatBuffs>();
        if (statBuffs == null)
        {
            statBuffs = gameObject.AddComponent <StatBuffs>();
        }
    }
Exemple #12
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.sacrifice);
        dotTag.Add(Tags.AbilityTags.DoT);
        AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject);

        listener.onKillEvent += OnKill;
        BaseHealth health = GetComponent <BaseHealth>();

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

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

        mana           = GetComponent <BaseMana>();
        baseStats      = GetComponent <BaseStats>();
        boneNovaOffset = new Vector3(0f, 1.2f, 0f);
        base.Awake();
    }
Exemple #13
0
    // Use this for initialization
    protected override void Awake()
    {
        ability = AbilityIDList.getAbility(AbilityID.marrowShards);
        physTag.Add(Tags.AbilityTags.Physical);
        AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject);

        listener.onKillEvent += OnKill;
        listener.onCritEvent += OnCrit;
        health = GetComponent <BaseHealth>();
        if (health)
        {
            statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject);

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

        mana               = GetComponent <BaseMana>();
        baseStats          = GetComponent <BaseStats>();
        boneNovaOffset     = new Vector3(0f, 1.2f, 0f);
        spiritEscapeOffset = new Vector3(0f, 1.1f, 0f);
        spiritEscapePrefab = PrefabList.getPrefab("spiritEscape");
        base.Awake();
    }
Exemple #14
0
    public void Apply(GameObject go)
    {
        // check for minion statuses
        if (onlyApplyToCreatorsMinions)
        {
            // check for creator
            CreationReferences refences = go.GetComponent <CreationReferences>();
            if (!refences)
            {
                return;
            }
            if (refences.creator != myReferences.creator)
            {
                return;
            }

            // check for ability
            if (onlyApplyToMinionFromAbility)
            {
                if (requiredAbility == null)
                {
                    return;
                }
                if (refences.thisAbility != requiredAbility)
                {
                    return;
                }
            }
        }
        // also check for ability if the creator does not need to be checked
        else if (onlyApplyToMinionFromAbility)
        {
            if (requiredAbility == null)
            {
                return;
            }
            CreationReferences refences = go.GetComponent <CreationReferences>();
            if (!refences)
            {
                return;
            }
            if (refences.thisAbility != requiredAbility)
            {
                return;
            }
        }

        StatBuffs buffs = go.GetComponent <StatBuffs>();

        if (buffs == null)
        {
            buffs = go.AddComponent <StatBuffs>();
        }

        foreach (Buff buff in simpleBuffs)
        {
            buffs.addBuff(buff.remainingDuration, buff.stat.property, buff.stat.addedValue, buff.stat.increasedValue, buff.stat.moreValues, buff.stat.quotientValues, null, buff.name);
        }
        foreach (TaggedBuff buff in taggedBuffs)
        {
            buffs.addBuff(buff.remainingDuration, buff.stat.property, buff.stat.addedValue, buff.stat.increasedValue, buff.stat.moreValues, buff.stat.quotientValues, buff.stat.tagList, buff.name);
        }
    }
Exemple #15
0
    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);
    }
Exemple #16
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        if (chanceToBleed > 0)
        {
            ChanceToApplyStatusOnEnemyHit chanceTo = abilityObject.AddComponent <ChanceToApplyStatusOnEnemyHit>();
            chanceTo.chance       = chanceToBleed;
            chanceTo.statusEffect = StatusEffectList.getEffect(StatusEffectID.Bleed);
        }

        if (chanceToPlague > 0)
        {
            ChanceToApplyStatusOnEnemyHit chanceTo = abilityObject.AddComponent <ChanceToApplyStatusOnEnemyHit>();
            chanceTo.chance       = chanceToPlague;
            chanceTo.statusEffect = StatusEffectList.getEffect(StatusEffectID.Plague);
        }

        if (chanceToBlindingPoison > 0)
        {
            ChanceToApplyStatusOnEnemyHit chanceTo = abilityObject.AddComponent <ChanceToApplyStatusOnEnemyHit>();
            chanceTo.chance       = chanceToBlindingPoison;
            chanceTo.statusEffect = StatusEffectList.getEffect(StatusEffectID.BlindingPoison);
        }

        if (chanceToShredArmour > 0)
        {
            ChanceToApplyStatusOnEnemyHit chanceTo = abilityObject.AddComponent <ChanceToApplyStatusOnEnemyHit>();
            chanceTo.chance       = chanceToShredArmour;
            chanceTo.statusEffect = StatusEffectList.getEffect(StatusEffectID.ArmourShred);
        }

        if (poisonSpitChance > 0)
        {
            float rand = Random.Range(0f, 1f);
            if (rand < poisonSpitChance)
            {
                if (!usingAbility)
                {
                    usingAbility = GetComponent <UsingAbility>();
                }
                if (usingAbility)
                {
                    usingAbility.UseAbility(AbilityIDList.getAbility(AbilityID.poisonSpit), targetLocation + new Vector3(0, -1.1f, 0), false, false);
                }
            }
        }

        if (increasedHitDamage != 0)
        {
            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.increaseAllDamage(increasedHitDamage);
                //holder.addBaseDamage(DamageType.PHYSICAL, holder.getBaseDamage(DamageType.PHYSICAL) * increasedDamage);
            }
        }

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

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

        if (moreDamageAgainstBlinded != 0)
        {
            // create the conditional
            DamageConditionalEffect    conditionalEffect = new DamageConditionalEffect();
            HasStatusEffectConditional conditional       = new HasStatusEffectConditional();
            conditional.statusEffect      = StatusEffectID.Blind;
            conditionalEffect.conditional = conditional;
            conditionalEffect.effect      = new DamageEffectMoreDamage(moreDamageAgainstBlinded);
            // add the conditional to all damage stats holders
            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.baseDamageStats.conditionalEffects.Add(conditionalEffect);
            }
        }

        if (moreDamageAgainstPoisonBlinded != 0)
        {
            // create the conditional
            DamageConditionalEffect    conditionalEffect = new DamageConditionalEffect();
            HasStatusEffectConditional conditional       = new HasStatusEffectConditional();
            conditional.statusEffect      = StatusEffectID.BlindingPoison;
            conditionalEffect.conditional = conditional;
            conditionalEffect.effect      = new DamageEffectMoreDamage(moreDamageAgainstPoisonBlinded);
            // add the conditional to all damage stats holders
            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.baseDamageStats.conditionalEffects.Add(conditionalEffect);
            }
        }

        if (dodgeRatingOnAttack != 0 || poisonDamageOnAttack != 0 || dotDamageOnAttack != 0)
        {
            StatBuffs statBuffs = GetComponent <StatBuffs>();
            if (statBuffs == null)
            {
                statBuffs = gameObject.AddComponent <StatBuffs>();
            }
            if (dodgeRatingOnAttack != 0)
            {
                statBuffs.addBuff(4f, Tags.Properties.DodgeRating, dodgeRatingOnAttack, 0, null, null);
            }
            if (poisonDamageOnAttack != 0)
            {
                List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>();
                tagList.Add(Tags.AbilityTags.Poison);
                statBuffs.addBuff(4f, Tags.Properties.Damage, 0, poisonDamageOnAttack, null, null, tagList);
            }
            if (dotDamageOnAttack != 0)
            {
                List <Tags.AbilityTags> tagList = new List <Tags.AbilityTags>();
                tagList.Add(Tags.AbilityTags.DoT);
                statBuffs.addBuff(4f, Tags.Properties.Damage, 0, dotDamageOnAttack, null, null, tagList);
            }
        }


        return(abilityObject);
    }