//public static GameObject PlagueOverheadVFX;

        public static void Init()
        {
            ConfusionDecoyTarget = new GameObject();
            SpeculativeRigidbody orAddComponent = ConfusionDecoyTarget.GetOrAddComponent <SpeculativeRigidbody>();
            PixelCollider        pixelCollider  = new PixelCollider();

            pixelCollider.ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual;
            pixelCollider.CollisionLayer         = CollisionLayer.EnemyCollider;
            pixelCollider.ManualWidth            = 5;
            pixelCollider.ManualHeight           = 5;
            pixelCollider.ManualOffsetX          = 0;
            pixelCollider.ManualOffsetY          = 0;
            orAddComponent.PixelColliders        = new List <PixelCollider>
            {
                pixelCollider
            };
            ConfusionDecoyTarget.AddComponent <ConfusionDecoyTargetController>();
            ConfusionDecoyTarget.MakeFakePrefab();



            //Setup the standard Plague effect

            StaticStatusEffects.ConfusionEffect = StatusEffectHelper.GenerateConfusionEfffect(5);
        }
Ejemplo n.º 2
0
        public static void Init()
        {
            PlagueOverheadVFX = VFXToolbox.CreateOverheadVFX(PlagueVFXPaths, "PlagueOverhead", 7);
            GameActorPlagueEffect StandPlague = StatusEffectHelper.GeneratePlagueEffect(100, 2, true, ExtendedColours.plaguePurple, true, ExtendedColours.plaguePurple);

            StaticStatusEffects.StandardPlagueEffect = StandPlague;
        }
Ejemplo n.º 3
0
 public override void PostProcessProjectile(Projectile projectile)
 {
     if (projectile && projectile.ProjectilePlayerOwner())
     {
         if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("Micro Aggressions"))
         {
             if (UnityEngine.Random.value <= 0.1f)
             {
                 projectile.AdjustPlayerProjectileTint(ExtendedColours.vibrantOrange, 2);
                 projectile.statusEffectsToApply.Add(StatusEffectHelper.GenerateSizeEffect(5, new Vector2(0.4f, 0.4f)));
             }
         }
     }
     base.PostProcessProjectile(projectile);
 }
Ejemplo n.º 4
0
        private void PostProcessBeam(BeamController beam, SpeculativeRigidbody hitRigidBody, float tickrate)
        {
            float procChance = 0.09f;

            beam.AdjustPlayerBeamTint(ExtendedColours.vibrantOrange, 1, 0f);
            GameActor gameActor = hitRigidBody.gameActor;

            if (!gameActor)
            {
                return;
            }
            if (UnityEngine.Random.value < BraveMathCollege.SliceProbability(procChance, tickrate))
            {
                hitRigidBody.gameActor.ApplyEffect(StatusEffectHelper.GenerateSizeEffect(10, new Vector2(0.4f, 0.4f)));
            }
        }
        public void BlankModHook(Action <SilencerInstance, BlankModificationItem, Vector2, PlayerController> orig, SilencerInstance silencer, BlankModificationItem bmi, Vector2 centerPoint, PlayerController user)
        {
            orig(silencer, bmi, centerPoint, user);

            if (user.HasPickupID(BronzeAmmoletID))
            {
                RoomHandler    currentRoom   = user.CurrentRoom;
                List <AIActor> activeEnemies = currentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All);
                if (activeEnemies != null)
                {
                    for (int i = 0; i < activeEnemies.Count; i++)
                    {
                        if (UnityEngine.Random.value <= 0.5f)
                        {
                            activeEnemies[i].ApplyEffect(StatusEffectHelper.GenerateSizeEffect(10, new Vector2(0.4f, 0.4f)));
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void PostProcessProjectile(Projectile sourceProjectile, float effectChanceScalar)
        {
            float procChance = 0.09f;

            procChance *= effectChanceScalar;
            bool DoFirstShotOverrideSynergy = (Owner.CurrentGun.LastShotIndex == 0) && Owner.PlayerHasActiveSynergy("Added Effect - Shrink");
            bool DoLastShotOverrideSynergy  = (Owner.CurrentGun.LastShotIndex == Owner.CurrentGun.ClipCapacity - 1) && Owner.PlayerHasActiveSynergy("Topaz Weapon");

            try
            {
                if (UnityEngine.Random.value <= procChance || DoFirstShotOverrideSynergy || DoLastShotOverrideSynergy)
                {
                    sourceProjectile.RuntimeUpdateScale(0.7f);
                    sourceProjectile.AdjustPlayerProjectileTint(ExtendedColours.vibrantOrange, 2);
                    sourceProjectile.statusEffectsToApply.Add(StatusEffectHelper.GenerateSizeEffect(10, new Vector2(0.4f, 0.4f)));
                }
            }
            catch (Exception e)
            {
                ETGModConsole.Log(e.Message);
            }
        }
Ejemplo n.º 7
0
        public void BlankModHook(Action <SilencerInstance, BlankModificationItem, Vector2, PlayerController> orig, SilencerInstance silencer, BlankModificationItem bmi, Vector2 centerPoint, PlayerController user)
        {
            orig(silencer, bmi, centerPoint, user);

            if (user.HasPickupID(AmmolockID))
            {
                GameActorSpeedEffect Lockdown      = StatusEffectHelper.GenerateLockdown(10);
                RoomHandler          currentRoom   = user.CurrentRoom;
                List <AIActor>       activeEnemies = currentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All);
                if (activeEnemies != null)
                {
                    for (int i = 0; i < activeEnemies.Count; i++)
                    {
                        AIActor aiactor = activeEnemies[i];
                        aiactor.gameActor.ApplyEffect(Lockdown, 1f, null);
                        if (user.PlayerHasActiveSynergy("Under Lock And Key") && aiactor.healthHaver)
                        {
                            aiactor.healthHaver.ApplyDamage(7 * user.carriedConsumables.KeyBullets, Vector2.zero, "Under Lock And Key");
                        }
                    }
                }
            }
        }
        public void AIActorMods(AIActor target)
        {
            //ETGModConsole.Log("ran");

            if (target)
            {
                //ETGModConsole.Log("passed target check");

                if (target.IsBlackPhantom && target.healthHaver && !target.healthHaver.IsBoss)
                {
                    //ETGModConsole.Log("target was jammed");

                    float procChance = 1;
                    if (AllJammedState.AllJammedActive)
                    {
                        procChance = 0.5f;
                    }
                    if (UnityEngine.Random.value <= procChance)
                    {
                        // ETGModConsole.Log("procced");
                        GameActorCharmEffect charm = StatusEffectHelper.GenerateCharmEffect(13);
                        target.ApplyEffect(charm);
                        if (UnityEngine.Random.value <= 0.5f)
                        {
                            target.IgnoreForRoomClear = true;
                            KillOnRoomClear kill = target.gameObject.GetOrAddComponent <KillOnRoomClear>();
                            if (EasyEnemyTypeLists.MultiPhaseEnemies.Contains(target.EnemyGuid) || EasyEnemyTypeLists.EnemiesWithInvulnerablePhases.Contains(target.EnemyGuid))
                            {
                                EraseFromExistenceOnRoomClear destroyTrickyEnemy = target.gameObject.AddComponent <EraseFromExistenceOnRoomClear>();
                                destroyTrickyEnemy.Delay = 1f;
                            }
                        }
                    }
                }
            }
        }
        public static void DefineDefaultGoops()
        {
            //Sets up the goops that have to be extracted from asset bundles
            AssetBundle assetBundle = ResourceManager.LoadAssetBundle("shared_auto_001");

            EasyGoopDefinitions.goopDefs = new List <GoopDefinition>();
            foreach (string text in EasyGoopDefinitions.goops)
            {
                GoopDefinition goopDefinition;
                try
                {
                    GameObject gameObject = assetBundle.LoadAsset(text) as GameObject;
                    goopDefinition = gameObject.GetComponent <GoopDefinition>();
                }
                catch
                {
                    goopDefinition = (assetBundle.LoadAsset(text) as GoopDefinition);
                }
                goopDefinition.name = text.Replace("assets/data/goops/", "").Replace(".asset", "");
                EasyGoopDefinitions.goopDefs.Add(goopDefinition);
            }
            List <GoopDefinition> list = EasyGoopDefinitions.goopDefs;

            //Define the asset bundle goops
            FireDef         = EasyGoopDefinitions.goopDefs[0];
            OilDef          = EasyGoopDefinitions.goopDefs[1];
            PoisonDef       = EasyGoopDefinitions.goopDefs[2];
            BlobulonGoopDef = EasyGoopDefinitions.goopDefs[3];
            WebGoop         = EasyGoopDefinitions.goopDefs[4];
            WaterGoop       = EasyGoopDefinitions.goopDefs[5];

            //HONEY GOOP - An Amber Goop that slows enemies and players
            #region HoneyGoop
            HoneyGoop = new GoopDefinition();
            HoneyGoop.CanBeIgnited                     = false;
            HoneyGoop.damagesEnemies                   = false;
            HoneyGoop.damagesPlayers                   = false;
            HoneyGoop.baseColor32                      = ExtendedColours.honeyYellow;
            HoneyGoop.goopTexture                      = ResourceExtractor.GetTextureFromResource("NevernamedsItems/Resources/honey_standard_base_001.png");
            HoneyGoop.usesLifespan                     = false;
            HoneyGoop.playerStepsChangeLifetime        = true;
            HoneyGoop.playerStepsLifetime              = 2.5f;
            HoneyGoop.AppliesSpeedModifier             = true;
            HoneyGoop.AppliesSpeedModifierContinuously = true;
            HoneyGoop.SpeedModifierEffect              = StaticStatusEffects.HoneySpeedMod;

            PlayerFriendlyHoneyGoop = UnityEngine.Object.Instantiate <GoopDefinition>(HoneyGoop);
            PlayerFriendlyHoneyGoop.SpeedModifierEffect       = StaticStatusEffects.FriendlyHoneySpeedMod;
            PlayerFriendlyHoneyGoop.playerStepsChangeLifetime = false;
            #endregion

            //PROPULSION GOOP - An orange goop that speeds up enemies and players
            #region PropulsionGoop
            PropulsionGoop = new GoopDefinition();
            PropulsionGoop.CanBeIgnited                     = false;
            PropulsionGoop.damagesEnemies                   = false;
            PropulsionGoop.damagesPlayers                   = false;
            PropulsionGoop.baseColor32                      = ExtendedColours.vibrantOrange;
            PropulsionGoop.goopTexture                      = PoisonDef.goopTexture;
            PropulsionGoop.lifespan                         = 30f;
            PropulsionGoop.usesLifespan                     = true;
            PropulsionGoop.AppliesSpeedModifier             = true;
            PropulsionGoop.AppliesSpeedModifierContinuously = true;
            PropulsionGoop.SpeedModifierEffect              = StaticStatusEffects.PropulsionGoopSpeedMod;
            #endregion

            //PLAYER FRIENDLY WEB GOOP - A web-textured goop that slows down enemies, but not players.
            #region PlayerFriendlyWebGoop
            GoopDefinition midInitWeb = UnityEngine.Object.Instantiate <GoopDefinition>(WebGoop);
            midInitWeb.playerStepsChangeLifetime = false;
            midInitWeb.SpeedModifierEffect       = StaticStatusEffects.FriendlyWebGoopSpeedMod;
            PlayerFriendlyWebGoop = midInitWeb;
            #endregion

            //PIT GOOP - A black goop that sucks enemies down into itself
            #region PitGoop
            PitGoop = new GoopDefinition();
            PitGoop.CanBeIgnited   = false;
            PitGoop.damagesEnemies = false;
            PitGoop.damagesPlayers = false;
            PitGoop.baseColor32    = Color.black;
            PitGoop.goopTexture    = ResourceExtractor.GetTextureFromResource("NevernamedsItems/Resources/pitgooptex.png");
            PitGoop.usesLifespan   = true;
            PitGoop.lifespan       = 30f;
            #endregion

            //PLAGUE GOOP - A sickly purple goop that damages enemies over time, and makes them leave a trail that enplagues other enemies.
            #region PlagueGoop
            PlagueGoop = new GoopDefinition();
            PlagueGoop.CanBeIgnited          = false;
            PlagueGoop.damagesEnemies        = false;
            PlagueGoop.damagesPlayers        = false;
            PlagueGoop.baseColor32           = ExtendedColours.plaguePurple;
            PlagueGoop.goopTexture           = PoisonDef.goopTexture;
            PlagueGoop.lifespan              = 10;
            PlagueGoop.usesLifespan          = true;
            PlagueGoop.HealthModifierEffect  = StaticStatusEffects.StandardPlagueEffect;
            PlagueGoop.AppliesDamageOverTime = true;
            #endregion

            //ENEMYFRIENDLY POISON - Poison that doesnt hurt enemies
            #region EnemyFriendlyPoisonGoop
            GoopDefinition midInitPois = UnityEngine.Object.Instantiate <GoopDefinition>(PoisonDef);
            midInitPois.damagesEnemies       = false;
            midInitPois.HealthModifierEffect = StatusEffectHelper.GeneratePoison(3, false, 4);
            EnemyFriendlyPoisonGoop          = midInitPois;
            #endregion

            //ENEMYFRIENDLY FIRE - Fire that doesn't hurt enemies
            #region EnemyFriendlyFireGoop
            GoopDefinition midInitFire = UnityEngine.Object.Instantiate <GoopDefinition>(FireDef);
            midInitFire.damagesEnemies               = false;
            midInitFire.damagePerSecondtoEnemies     = 0;
            midInitFire.fireBurnsEnemies             = false;
            midInitFire.AppliesDamageOverTime        = false;
            midInitFire.fireDamagePerSecondToEnemies = 0;
            EnemyFriendlyFireGoop = midInitFire;
            #endregion

            //PLAYERFRIENDLY POISON - Poison that doesnt hurt the player
            #region PlayerFriendlyPoisonGoop
            GoopDefinition midInitFrenPois = UnityEngine.Object.Instantiate <GoopDefinition>(PoisonDef);
            midInitFrenPois.damagesEnemies       = true;
            midInitFrenPois.damagesPlayers       = false;
            midInitFrenPois.HealthModifierEffect = StatusEffectHelper.GeneratePoison(3, true, 4, false);
            PlayerFriendlyPoisonGoop             = midInitFrenPois;
            #endregion

            //ENEMYFRIENDLY FIRE - Fire that doesn't hurt enemies
            #region PlayerFriendlyFireGoop
            GoopDefinition midInitFrenFire = UnityEngine.Object.Instantiate <GoopDefinition>(FireDef);
            midInitFrenFire.damagesPlayers     = false;
            midInitFrenFire.fireDamageToPlayer = 0;
            PlayerFriendlyFireGoop             = midInitFrenFire;
            #endregion
        }
Ejemplo n.º 10
0
        public override void PostProcessProjectile(Projectile projectile)
        {
            base.PostProcessProjectile(projectile);
            switch (currentMode)
            {
            case 1:     //Increase
                EnemyScaleUpdaterMod scaleIncrease = projectile.gameObject.GetOrAddComponent <EnemyScaleUpdaterMod>();
                scaleIncrease.targetScale            = new Vector2(1.25f, 1.25f);
                scaleIncrease.multiplyExisting       = true;
                scaleIncrease.addScaleEffectsToEnemy = true;
                break;

            case 2:     //Decrease
                EnemyScaleUpdaterMod scaleDecrease = projectile.gameObject.GetOrAddComponent <EnemyScaleUpdaterMod>();
                scaleDecrease.targetScale            = new Vector2(0.75f, 0.75f);
                scaleDecrease.multiplyExisting       = true;
                scaleDecrease.addScaleEffectsToEnemy = true;
                break;

            case 3:     //ApplyStatus
                StatusEffectBulletMod effectMod = projectile.gameObject.AddComponent <StatusEffectBulletMod>();
                effectMod.pickRandom = true;
                effectMod.datasToApply.AddRange(new List <StatusEffectBulletMod.StatusData>()
                {
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StaticStatusEffects.chaosBulletsFreeze,
                        applyChance = 1,
                        applyTint   = false,
                    },
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StaticStatusEffects.charmingRoundsEffect,
                        applyChance = 1,
                        applyTint   = false,
                    },
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StaticStatusEffects.greenFireEffect,
                        applyChance = 1,
                        applyTint   = false,
                    },
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StaticStatusEffects.StandardPlagueEffect,
                        applyChance = 1,
                        applyTint   = false,
                    },
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StaticStatusEffects.tripleCrossbowSlowEffect,
                        applyChance = 1,
                        applyTint   = false,
                    },
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StaticStatusEffects.hotLeadEffect,
                        applyChance = 1,
                        applyTint   = false,
                    },
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StaticStatusEffects.irradiatedLeadEffect,
                        applyChance = 1,
                        applyTint   = false,
                    },
                    new StatusEffectBulletMod.StatusData()
                    {
                        effect      = StatusEffectHelper.GenerateLockdown(4),
                        applyChance = 1,
                        applyTint   = false,
                    },
                });
                break;

            case 4:     //SpawnKin
                SpawnEnemyOnDestructionMod kinSpawn = projectile.gameObject.GetOrAddComponent <SpawnEnemyOnDestructionMod>();
                kinSpawn.pickRandom = true;
                kinSpawn.EnemiesToSpawn.AddRange(new List <string>()
                {
                    EnemyGuidDatabase.Entries["bullet_kin"],
                    EnemyGuidDatabase.Entries["mutant_bullet_kin"],
                    EnemyGuidDatabase.Entries["cardinal"],
                    EnemyGuidDatabase.Entries["shroomer"],
                    EnemyGuidDatabase.Entries["ashen_bullet_kin"],
                    EnemyGuidDatabase.Entries["fallen_bullet_kin"],
                    EnemyGuidDatabase.Entries["ak47_bullet_kin"],
                    EnemyGuidDatabase.Entries["bandana_bullet_kin"],
                    EnemyGuidDatabase.Entries["veteran_bullet_kin"],
                    EnemyGuidDatabase.Entries["treadnaughts_bullet_kin"],
                    EnemyGuidDatabase.Entries["brollet"],
                    EnemyGuidDatabase.Entries["skullet"],
                    EnemyGuidDatabase.Entries["skullmet"],
                    EnemyGuidDatabase.Entries["gummy_spent"],
                    EnemyGuidDatabase.Entries["red_shotgun_kin"],
                    EnemyGuidDatabase.Entries["blue_shotgun_kin"],
                    EnemyGuidDatabase.Entries["veteran_shotgun_kin"],
                    EnemyGuidDatabase.Entries["mutant_shotgun_kin"],
                    EnemyGuidDatabase.Entries["executioner"],
                    EnemyGuidDatabase.Entries["ashen_shotgun_kin"],
                    EnemyGuidDatabase.Entries["bullat"],
                    EnemyGuidDatabase.Entries["shotgat"],
                    EnemyGuidDatabase.Entries["grenat"],
                    EnemyGuidDatabase.Entries["spirat"],
                    EnemyGuidDatabase.Entries["grenade_kin"],
                    EnemyGuidDatabase.Entries["dynamite_kin"],
                    EnemyGuidDatabase.Entries["m80_kin"],
                    EnemyGuidDatabase.Entries["tazie"],
                    EnemyGuidDatabase.Entries["rubber_kin"],
                    EnemyGuidDatabase.Entries["sniper_shell"],
                    EnemyGuidDatabase.Entries["professional"],
                });
                break;

            case 5:     //SpawnTable
                SpawnGameObjectOnDestructionMod tableSpawn = projectile.gameObject.GetOrAddComponent <SpawnGameObjectOnDestructionMod>();
                tableSpawn.objectsToPickFrom.AddRange(new List <GameObject>()
                {
                    EasyPlaceableObjects.TableVertical,
                    EasyPlaceableObjects.TableHorizontal,
                    EasyPlaceableObjects.TableHorizontalStone,
                    EasyPlaceableObjects.TableVerticalStone,
                    EasyPlaceableObjects.FoldingTable,
                });
                break;

            case 6:     //SpawnBarrel
                SpawnGameObjectOnDestructionMod barrelSpawn = projectile.gameObject.GetOrAddComponent <SpawnGameObjectOnDestructionMod>();
                barrelSpawn.objectsToPickFrom.AddRange(new List <GameObject>()
                {
                    EasyPlaceableObjects.ExplosiveBarrel,
                    EasyPlaceableObjects.MetalExplosiveBarrel,
                    EasyPlaceableObjects.OilBarrel,
                    EasyPlaceableObjects.PoisonBarrel,
                    EasyPlaceableObjects.WaterBarrel
                });
                break;

            case 7:     //Erase
                EraseEnemyBehav erase = projectile.gameObject.GetOrAddComponent <EraseEnemyBehav>();
                erase.doSparks = true;
                break;
            }
        }