示例#1
0
    public void sendForward(GameObject caster)
    {
        if (SceneLoader.instance && SceneLoader.instance.sceneLoading)
        {
            return;
        }

        // force wait
        StateController stateController = caster.GetComponent <StateController>();

        if (stateController && stateController.waiting && (!stateController.currentState || stateController.currentState.priority < 95))
        {
            stateController.forceChangeState(stateController.waiting);
        }

        // send forward in time
        GameObject tardis = new GameObject();

        tardis.transform.position = caster.transform.position;
        tardis.AddComponent <SelfDestroyer>();
        DisableChildrenForDurationThenRelease chameleonCircuit = tardis.AddComponent <DisableChildrenForDurationThenRelease>();

        chameleonCircuit.duration = duration;
        CreateOnDeath cod = tardis.AddComponent <CreateOnDeath>();

        cod.objectsToCreateOnDeath.Add(new CreateOnDeath.GameObjectHolder(PrefabList.getPrefab("AnomalyEndEffect")));

        chameleonCircuit.disableSceneLoaderForDuration = true;
        chameleonCircuit.tag        = "Persistent";
        chameleonCircuit.nextParent = caster.transform.parent;
        caster.transform.parent     = tardis.transform;
    }
    public void sendForward(GameObject enemy)
    {
        if (enemy.transform.parent == null)
        {
            // force wait
            StateController stateController = enemy.GetComponent <StateController>();
            if (stateController && stateController.waiting && (!stateController.currentState || stateController.currentState.priority < 95))
            {
                stateController.forceChangeState(stateController.waiting);
            }

            // send forward in time
            GameObject tardis = new GameObject();
            tardis.transform.position = enemy.transform.position;
            enemy.transform.parent    = tardis.transform;
            tardis.AddComponent <SelfDestroyer>();
            DisableChildrenForDurationThenRelease chameleonCircuit = tardis.AddComponent <DisableChildrenForDurationThenRelease>();
            chameleonCircuit.duration = duration;
            CreateOnDeath cod = tardis.AddComponent <CreateOnDeath>();
            cod.objectsToCreateOnDeath.Add(new CreateOnDeath.GameObjectHolder(PrefabList.getPrefab("AnomalyEndEffect")));
        }
    }
示例#3
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        if (dontAttach)
        {
            AttachToNearestAllyOnCreation component = abilityObject.GetComponent <AttachToNearestAllyOnCreation>();
            component.runOnCreation = false;
        }

        if (dontMoveToTarget)
        {
            StartsAtTarget component = abilityObject.GetComponent <StartsAtTarget>();
            component.active = false;
        }

        if (noVFX)
        {
            CreateOnDeath cod = abilityObject.GetComponent <CreateOnDeath>();
            if (cod)
            {
                cod.objectsToCreateOnDeath.Clear();
            }
        }

        BoneNovaProjectileMutator mutator = abilityObject.AddComponent <BoneNovaProjectileMutator>();

        mutator.increasedSpeed      = increasedSpeed;
        mutator.pierces             = pierces;
        mutator.increasedDamage     = increasedDamage;
        mutator.increasedStunChance = increasedStunChance;
        mutator.bleedChance         = bleedChance;
        mutator.addedCritChance     = addedCritChance;
        mutator.addedCritMultiplier = addedCritMultiplier;
        mutator.cone         = cone;
        mutator.randomAngles = randomAngles;
        mutator.moreDamageAgainstBleeding = moreDamageAgainstBleeding;

        return(abilityObject);
    }
示例#4
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        if (splatterChance > 0 && (!mana || mana.currentMana > 0) && (splatterChance >= 1 || splatterChance > (Random.Range(0f, 1f))))
        {
            // splatter trigger
            CreateAbilityObjectOnDeath component = abilityObject.AddComponent <CreateAbilityObjectOnDeath>();
            component.abilityToInstantiate = Ability.getAbility(AbilityID.bloodSplatter);

            // splatter mutator
            BloodSplatterMutator mutator = abilityObject.AddComponent <BloodSplatterMutator>();
            mutator.increasedRadius               = splatter_increasedRadius;
            mutator.increasedDamage               = splatter_increasedDamage;
            mutator.chanceToPoison                = splatter_chanceToPoison;
            mutator.armourReductionChance         = splatter_armourReductionChance;
            mutator.armourReduction               = splatter_armourReduction;
            mutator.armourReductionStacks         = splatter_armourReductionStacks;
            mutator.increasedArmourDebuffDuration = splatter_increasedArmourDebuffDuration;
            mutator.increasedDamagePerMinion      = splatter_increasedDamagePerMinion;
            mutator.minionBuffs = splatter_minionBuffs;
            mutator.reducesDarkProtectionInstead = splatter_reducesDarkProtectionInstead;
            mutator.necrotic = necrotic;
        }


        if (necrotic)
        {
            // replace vfx
            CreateOnDeath cod = abilityObject.GetComponent <CreateOnDeath>();
            if (cod && cod.objectsToCreateOnDeath != null && cod.objectsToCreateOnDeath.Count > 0)
            {
                cod.objectsToCreateOnDeath[0] = new CreateOnDeath.GameObjectHolder(PrefabList.getPrefab("NecroticRipBloodOnDeathVFX"));
            }

            // convert damage
            foreach (DamageStatsHolder damage in abilityObject.GetComponents <DamageStatsHolder>())
            {
                damage.convertAllDamageOfType(DamageType.PHYSICAL, DamageType.NECROTIC);
            }
        }

        if (targetsAlliesInstead)
        {
            // change the damage component to hit allies (only hits minions by default)
            DamageEnemyOnHit damageComponent = abilityObject.GetComponent <DamageEnemyOnHit>();
            DamageAllyOnHit  component       = abilityObject.AddComponent <DamageAllyOnHit>();
            component.baseDamageStats = damageComponent.baseDamageStats;
            damageComponent.deactivate();
            Destroy(damageComponent);

            // make sure it still creates a blood orb
            CreateResourceReturnAbilityObjectOnEnemyHit component2 = abilityObject.GetComponent <CreateResourceReturnAbilityObjectOnEnemyHit>();
            component2.hitsAlliesInstead = true;

            // change the targetting
            MoveToNearestEnemyOnCreation moveComponent = abilityObject.GetComponent <MoveToNearestEnemyOnCreation>();
            if (moveComponent)
            {
                moveComponent.moveToAllyInstead = true;
            }
        }


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

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

        if (addedHealthGained != 0 || increasedHealthGained != 0 || manaGained != 0 || convertHealthToWard || necrotic)
        {
            CreateResourceReturnAbilityObjectOnEnemyHit component = abilityObject.GetComponent <CreateResourceReturnAbilityObjectOnEnemyHit>();

            // check if this behaviour needs to be removed
            if (increasedHealthGained < -1 && manaGained <= 0)
            {
                component.deactivated = true;
            }
            // if it does not then change its values
            else
            {
                component.health += addedHealthGained;
                component.health *= (1 + increasedHealthGained);
                if (increasedHealthGainedPerAttunement != 0)
                {
                    component.health *= (1 + baseStats.GetStatValue(Tags.Properties.Attunement) * increasedHealthGainedPerAttunement);
                }
                component.mana += manaGained;
                if (convertHealthToWard)
                {
                    component.ward   = component.health;
                    component.health = 0;
                }
                if (necrotic)
                {
                    component.abilityObject = Ability.getAbility(AbilityID.necroticReturn);
                }
            }
        }


        if (increasedStunChance != 0)
        {
            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.baseDamageStats.increasedStunChance += increasedStunChance;
            }
        }

        // increase damage based on the number of minions
        float realIncreasedDamage = increasedDamage;

        if (increasedDamagePerMinion != 0)
        {
            if (tracker && tracker.summons != null)
            {
                realIncreasedDamage += increasedDamagePerMinion * tracker.summons.Count;
            }
        }


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

        if (moreDamageInstances != null && moreDamageInstances.Count > 0)
        {
            float moreDamage = 1f;
            foreach (float instance in moreDamageInstances)
            {
                moreDamage *= 1 + instance;
            }

            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.increaseAllDamage(moreDamage - 1);
            }
        }

        return(abilityObject);
    }
示例#5
0
    public override GameObject Mutate(GameObject abilityObject, Vector3 location, Vector3 targetLocation)
    {
        if (increasedRadius != 0)
        {
            foreach (CreateOnDeath cod in abilityObject.GetComponents <CreateOnDeath>())
            {
                cod.increasedRadius = increasedRadius;
                cod.increasedHeight = increasedRadius;
            }
            foreach (CapsuleCollider col in abilityObject.GetComponents <CapsuleCollider>())
            {
                col.height *= (1 + increasedRadius);
                col.radius *= (1 + increasedRadius);
            }
        }

        if (necrotic)
        {
            // replace vfx
            CreateOnDeath cod = abilityObject.GetComponent <CreateOnDeath>();
            if (cod && cod.objectsToCreateOnDeath != null && cod.objectsToCreateOnDeath.Count > 0)
            {
                cod.objectsToCreateOnDeath[0] = new CreateOnDeath.GameObjectHolder(PrefabList.getPrefab("NecroticBloodSplatterOnDeathVFX"));
            }

            // convert damage
            foreach (DamageStatsHolder damage in abilityObject.GetComponents <DamageStatsHolder>())
            {
                damage.convertAllDamageOfType(DamageType.PHYSICAL, DamageType.NECROTIC);
            }
        }

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

        if (armourReductionChance > 0 && Random.Range(0f, 1f) < armourReductionChance)
        {
            DebuffOnEnemyHit component = abilityObject.AddComponent <DebuffOnEnemyHit>();
            if (reducesDarkProtectionInstead)
            {
                if (armourReductionStacks)
                {
                    component.addDebuffToList(Tags.Properties.DarkProtection, armourReduction, 0f, null, null, 4f * (1 + increasedArmourDebuffDuration));
                }
                else
                {
                    component.addDebuffToList(Tags.Properties.DarkProtection, armourReduction, 0f, null, null, 4f * (1 + increasedArmourDebuffDuration), null, "blood splatter armour reduction");
                }
            }
            else
            {
                if (armourReductionStacks)
                {
                    component.addDebuffToList(Tags.Properties.Armour, armourReduction, 0f, null, null, 4f * (1 + increasedArmourDebuffDuration));
                }
                else
                {
                    component.addDebuffToList(Tags.Properties.Armour, armourReduction, 0f, null, null, 4f * (1 + increasedArmourDebuffDuration), null, "blood splatter armour reduction");
                }
            }
        }

        if (minionBuffs != null && minionBuffs.Count > 0)
        {
            string        buffName  = "blood splatter buff";
            BuffOnAllyHit component = abilityObject.AddComponent <BuffOnAllyHit>();
            component.onlyApplyToCreatorsMinions = true;
            for (int i = 0; i < minionBuffs.Count; i++)
            {
                string fullBuffName = buffName + minionBuffs[i].property;
                foreach (Tags.AbilityTags _tag in minionBuffs[i].tagList)
                {
                    fullBuffName += _tag;
                }
                component.addBuffToList(minionBuffs[i].property, minionBuffs[i].addedValue, minionBuffs[i].increasedValue, minionBuffs[i].moreValues,
                                        minionBuffs[i].quotientValues, 4f, minionBuffs[i].tagList, fullBuffName);
            }
        }


        if (increasedStunChance != 0)
        {
            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.baseDamageStats.increasedStunChance += increasedStunChance;
            }
        }


        // increase damage based on the number of minions
        float realIncreasedDamage = increasedDamage;

        if (increasedDamagePerMinion != 0)
        {
            if (references && references.creator)
            {
                SummonTracker tracker = references.creator.GetComponent <SummonTracker>();
                if (tracker && tracker.summons != null)
                {
                    realIncreasedDamage += increasedDamagePerMinion * tracker.summons.Count;
                }
            }
        }


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

        if (moreDamageInstances != null && moreDamageInstances.Count > 0)
        {
            float moreDamage = 1f;
            foreach (float instance in moreDamageInstances)
            {
                moreDamage *= 1 + instance;
            }

            foreach (DamageStatsHolder holder in abilityObject.GetComponents <DamageStatsHolder>())
            {
                holder.increaseAllDamage(moreDamage - 1);
            }
        }

        return(abilityObject);
    }