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));
    }
示例#2
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));
    }