コード例 #1
0
            private IEnumerator PostStart()
            {
                yield return(null);

                Dungeonator.CellData data = GameManager.Instance.Dungeon.data[((Vector2)self.LastPosition).ToIntVector2(VectorConversions.Floor)];
                Vector2 cellCenter        = data.position.ToVector2() + new Vector2(0.5f, 0.5f);

                if (registeredCells.ContainsKey(data) && beginInactive)
                {
                    VFXToolbox.DoStringSquirt("Cell Killed for Dupe Register", data.position.ToVector2() + new Vector2(0.5f, 0.5f), Color.blue);
                    UnityEngine.Object.Destroy(self.gameObject);
                    yield break;
                }
                initialCell = data;
                if (data.IsAnyFaceWall())
                {
                    VFXToolbox.DoStringSquirt("Cell Killed for Wall overlap", data.position.ToVector2() + new Vector2(0.5f, 0.5f), Color.blue);
                    UnityEngine.Object.Destroy(self.gameObject);
                    yield break;
                }

                self.transform.position = cellCenter;
                self.specRigidbody.Reinitialize();


                yield break;
            }
コード例 #2
0
 private void EndStreak(Projectile projectileResponsible)
 {
     if (projectileResponsible != null)
     {
         PunishmentRayHitOnce baseProj = projectileResponsible.GetComponent <PunishmentRayHitOnce>();
         if (baseProj != null)
         {
             return;
         }
     }
     if (this.gun.CurrentOwner != null && this.gun.CurrentOwner is PlayerController)
     {
         if (HitStreak > 0)
         {
             VFXToolbox.DoStringSquirt("STREAK LOST", this.gun.CurrentOwner.transform.position, Color.red);
         }
         int damageThreshold = 10;
         if ((this.gun.CurrentOwner as PlayerController).PlayerHasActiveSynergy("Spare The Rod"))
         {
             damageThreshold = 20;
         }
         if (HitStreak >= damageThreshold)
         {
             this.gun.CurrentOwner.healthHaver.ApplyDamage(0.5f, Vector2.zero, "STREAK LOST", CoreDamageTypes.None, DamageCategory.Normal, true, null, false);
         }
     }
     HitStreak = 0;
 }
コード例 #3
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;
        }
コード例 #4
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Red Robin", "redrobin");

            Game.Items.Rename("outdated_gun_mods:red_robin", "nn:red_robin");
            gun.gameObject.AddComponent <RedRobin>();
            gun.SetShortDescription("Healthy Option");
            gun.SetLongDescription("Deals bonus damage at full health." + "\n\nThe signature weapon of Gungeoneer 'Hearts Ferros', famous for never being shot in a gunfight... until he was.");

            gun.SetupSprite(null, "redrobin_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 13);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.15f;
            gun.DefaultModule.angleFromAim           = 0;
            gun.DefaultModule.angleVariance          = 12;
            gun.DefaultModule.numberOfShotsInClip    = 13;
            gun.barrelOffset.transform.localPosition = new Vector3(23f / 16f, 11f / 16f, 0f);
            gun.SetBaseMaxAmmo(300);
            gun.ammo     = 300;
            gun.gunClass = GunClass.SILLY;

            gun.muzzleFlashEffects = VFXToolbox.CreateVFXPool("RedRobin Muzzleflash",
                                                              new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/redrobin_muzzleflash_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/redrobin_muzzleflash_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/redrobin_muzzleflash_004",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/redrobin_muzzleflash_005",
            },
                                                              13,                               //FPS
                                                              new IntVector2(9, 16),            //Dimensions
                                                              tk2dBaseSprite.Anchor.MiddleLeft, //Anchor
                                                              false,                            //Uses a Z height off the ground
                                                              0,                                //The Z height, if used
                                                              false,
                                                              VFXAlignment.Fixed
                                                              );

            Projectile projectile = gun.DefaultModule.projectiles[0].gameObject.InstantiateAndFakeprefab().GetComponent <Projectile>();

            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 5f;
            projectile.SetProjectileSpriteRight("redrobin_projectile", 12, 6, true, tk2dBaseSprite.Anchor.MiddleCenter, 12, 6);
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.RedLaserCircleVFX;
            projectile.hitEffects.alwaysUseMidair        = true;

            gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.SMALL_BLASTER;
            gun.quality = PickupObject.ItemQuality.D;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            ID = gun.PickupObjectId;
        }
コード例 #5
0
        public static GameObject CreateCustomShellCasing(string spriteName, int pixelWidth, int pixelHeight)
        {
            GameObject casing = UnityEngine.Object.Instantiate((PickupObjectDatabase.GetById(202) as Gun).shellCasing);

            casing.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(casing.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(casing);
            casing.GetComponent <tk2dBaseSprite>().spriteId = VFXCollection.inst.GetSpriteIdByName(spriteName);
            VFXToolbox.SetupDefinitionForShellSprite(spriteName, casing.GetComponent <tk2dBaseSprite>().spriteId, pixelWidth, pixelHeight);
            return(casing);
        }
コード例 #6
0
 public void KillCell(Dungeonator.CellData targetCell)
 {
     if (registeredCells.ContainsKey(targetCell))
     {
         VFXToolbox.DoStringSquirt("Cell Killed", targetCell.position.ToVector2() + new Vector2(0.5f, 0.5f), Color.blue);
         registeredCells[targetCell].DieInAir();
         registeredCells.Remove(targetCell);
     }
     else
     {
         Debug.LogWarning("Tried to kill an unregistered cell, but we caught it.");
     }
 }
コード例 #7
0
 private void OnHitEnemy(Projectile bullet, SpeculativeRigidbody enemy, bool fatal)
 {
     if (bullet && enemy)
     {
         if (UnityEngine.Random.value <= 0.05f)
         {
             VFXToolbox.DoStringSquirt(BraveUtility.RandomElement(dialogue), enemy.Position.GetPixelVector2(), ExtendedColours.honeyYellow);
             if (bullet.ProjectilePlayerOwner() && bullet.ProjectilePlayerOwner().PlayerHasActiveSynergy("De4l 0f 4 Lif3tim3"))
             {
                 LootEngine.SpawnCurrency(enemy.Position.GetPixelVector2(), UnityEngine.Random.Range(2, 5));
             }
         }
     }
 }
コード例 #8
0
 public override void OnReloadPressed(PlayerController player, Gun gun, bool manualReload)
 {
     if (CurrentColourFiringMode == ColourType.RED)
     {
         CurrentColourFiringMode = ColourType.YELLOW;
         VFXToolbox.DoStringSquirt("YELLOW", gun.sprite.WorldCenter, ExtendedColours.honeyYellow);
     }
     else if (CurrentColourFiringMode == ColourType.YELLOW)
     {
         CurrentColourFiringMode = ColourType.BLUE;
         VFXToolbox.DoStringSquirt("BLUE", gun.sprite.WorldCenter, Color.blue);
     }
     else if (CurrentColourFiringMode == ColourType.BLUE)
     {
         CurrentColourFiringMode = ColourType.RED;
         VFXToolbox.DoStringSquirt("RED", gun.sprite.WorldCenter, Color.red);
     }
     base.OnReloadPressed(player, gun, manualReload);
 }
コード例 #9
0
 public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
 {
     base.OnReloadPressed(player, gun, bSOMETHING);
     if ((gun.ClipCapacity == gun.ClipShotsRemaining) || (gun.CurrentAmmo == gun.ClipShotsRemaining))
     {
         if (currentMode == 7)
         {
             currentMode             = 1;
             overrideAmmoConsumption = ModeAmmoCosts[currentMode];
             VFXToolbox.DoStringSquirt(ModeNames[1], player.transform.position, Color.red);
         }
         else
         {
             currentMode++;
             overrideAmmoConsumption = ModeAmmoCosts[currentMode];
             VFXToolbox.DoStringSquirt(ModeNames[currentMode], player.transform.position, Color.red);
         }
     }
 }
コード例 #10
0
        public static void InitHooks()
        {
            DisplaceHook = new Hook(
                typeof(DisplaceBehavior).GetMethod("SpawnImage", BindingFlags.Instance | BindingFlags.NonPublic),
                typeof(CompanionisedEnemyUtility).GetMethod("DisplacedImageSpawnHook", BindingFlags.Instance | BindingFlags.NonPublic),
                typeof(DisplaceBehavior));


            List <string> FriendVFXPaths = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/friendlyoverhead_vfx_001",
                "NevernamedsItems/Resources/MiscVFX/friendlyoverhead_vfx_002",
                "NevernamedsItems/Resources/MiscVFX/friendlyoverhead_vfx_003",
                "NevernamedsItems/Resources/MiscVFX/friendlyoverhead_vfx_004",
                "NevernamedsItems/Resources/MiscVFX/friendlyoverhead_vfx_005"
            };
            GameObject friendly = VFXToolbox.CreateOverheadVFX(FriendVFXPaths, "FriendlyOverhead", 10);

            FriendlyVFX = friendly;
        }
コード例 #11
0
        public void BirthCell(Dungeonator.CellData targetCell)
        {
            if (registeredCells.ContainsKey(targetCell))
            {
                Debug.LogWarning("Tried to birth a cell where a cell already lives!"); return;
            }
            else
            {
                if (!targetCell.IsAnyFaceWall())
                {
                    GameObject gameObject = SpawnManager.SpawnProjectile(GOLProjPrefab.gameObject, targetCell.position.ToVector2() + new Vector2(0.5f, 0.5f), Quaternion.identity, true);
                    gameObject.GetComponent <GameOfLifeProjectile>().beginInactive = false;
                    Projectile component = gameObject.GetComponent <Projectile>();
                    if (component != null && GameManager.Instance.PrimaryPlayer != null)
                    {
                        component.Owner   = GameManager.Instance.PrimaryPlayer;
                        component.Shooter = GameManager.Instance.PrimaryPlayer.specRigidbody;
                    }
                    VFXToolbox.DoStringSquirt("Cell Birthed", targetCell.position.ToVector2() + new Vector2(0.5f, 0.5f), Color.blue);

                    registeredCells.Add(targetCell, component);
                }
            }
        }
コード例 #12
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("W3irdstar", "w3irdstar");

            Game.Items.Rename("outdated_gun_mods:w3irdstar", "nn:w3irdstar");
            var behav = gun.gameObject.AddComponent <W3irdstar>();

            behav.overrideNormalFireAudio = "Play_WPN_seriouscannon_shot_01";
            behav.preventNormalFireAudio  = true;
            gun.SetShortDescription("Weird Champion");
            gun.SetLongDescription("This wiggly weapon proves that we are all made of... star... squooge.");

            gun.SetupSprite(null, "w3irdstar_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.idleAnimation, 10);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            gun.SetAnimationFPS(gun.chargeAnimation, 6);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);

            GameObject bulletDeath = VFXToolbox.CreateVFX("W3irdstar MidairDeath",
                                                          new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/W3irdstar/w3irdstar_impact_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/W3irdstar/w3irdstar_impact_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/W3irdstar/w3irdstar_impact_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/W3irdstar/w3irdstar_impact_004",
            },
                                                          15,                                 //FPS
                                                          new IntVector2(20, 20),             //Dimensions
                                                          tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                          false,                              //Uses a Z height off the ground
                                                          0                                   //The Z height, if used
                                                          );

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 2;

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.45f;
            gun.DefaultModule.angleVariance          = 0;
            gun.DefaultModule.numberOfShotsInClip    = 2;
            gun.barrelOffset.transform.localPosition = new Vector3(35f / 16f, 12f / 16f, 0f);
            gun.SetBaseMaxAmmo(80);
            gun.ammo     = 80;
            gun.gunClass = GunClass.SILLY;

            GameObject baseproj = gun.DefaultModule.projectiles[0].gameObject.InstantiateAndFakeprefab();

            gun.DefaultModule.projectiles[0] = baseproj.GetComponent <Projectile>();

            //BULLET STATS
            HelixProjectileButLessShit projectile = DataCloners.CopyFields <HelixProjectileButLessShit>(Instantiate(gun.DefaultModule.projectiles[0]));

            projectile.SpawnShadowBulletsOnSpawn = false;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage = 20f;
            projectile.baseData.force *= 2f;
            projectile.baseData.speed *= 0.5f;
            projectile.baseData.range  = 12f;

            projectile.hitEffects.overrideMidairDeathVFX = bulletDeath;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.SetProjectileSpriteRight("w3irdstar_largeproj", 20, 20, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 10);
            EvenRadialBurstHandler burst = projectile.gameObject.AddComponent <EvenRadialBurstHandler>();

            burst.numberToSpawn = 40;
            burst.PostProcess   = false;


            //MINI BULLETS
            GameObject split = (PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0].gameObject.InstantiateAndFakeprefab();

            HelixProjectileButLessShit projectile2 = DataCloners.CopyFields <HelixProjectileButLessShit>(split.GetComponent <Projectile>());

            projectile2.SpawnShadowBulletsOnSpawn = false;
            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            projectile2.baseData.damage = 5f;
            projectile2.baseData.range  = 20f;
            projectile2.hitEffects.overrideMidairDeathVFX = bulletDeath;
            projectile2.hitEffects.alwaysUseMidair        = true;
            projectile2.SetProjectileSpriteRight("w3irdstar_smallproj", 12, 12, true, tk2dBaseSprite.Anchor.MiddleCenter, 6, 6);

            burst.projectileToSpawn = projectile2;

            ProjectileModule.ChargeProjectile chargeproj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0.5f,
            };

            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeproj
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("W3irdstar Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/w3irdstar_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/w3irdstar_clipempty");



            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            W3irdstarID = gun.PickupObjectId;
        }
コード例 #13
0
        public IEnumerator HandleGeneration()
        {
            generationRunning = true;
            if (GameManager.Instance.Dungeon != null && GameManager.Instance.Dungeon.data != null && !Dungeon.IsGenerating)
            {
                Dictionary <Dungeonator.CellData, int> birthCandidates = new Dictionary <Dungeonator.CellData, int>();

                if (GameManager.Instance.PrimaryPlayer)
                {
                    VFXToolbox.DoStringSquirt("Generation", GameManager.Instance.PrimaryPlayer.CenterPosition, Color.red);
                }
                //1 - Any live cell with fewer than two live neighbours dies, as if by underpopulation.
                //2 - Any live cell with two or three live neighbours lives on to the next generation.
                //3 - Any live cell with more than three live neighbours dies, as if by overpopulation.
                //4 - Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

                //this is where we start a new generation. The first step is to apply any planned births or deaths from the previous generation
                if (plannedBirths != null && plannedBirths.Count > 0)
                {
                    for (int birth = plannedBirths.Count - 1; birth >= 0; birth--)//Births
                    {
                        BirthCell(plannedBirths[birth]);
                        yield return(null);
                    }
                    plannedBirths.Clear();
                }
                if (plannedDeaths != null && plannedDeaths.Count > 0)
                {
                    for (int death = plannedDeaths.Count - 1; death >= 0; death--)//Deaths
                    {
                        KillCell(plannedDeaths[death]);
                        yield return(null);
                    }
                    plannedDeaths.Clear();
                }

                //The second step is, after a frame delay, to calculate what births and deaths need to happen in the next generation
                yield return(null);

                for (int i = registeredCells.Keys.Count - 1; i >= 0; i--)
                {
                    if (registeredCells.ElementAt(i).Value == null)
                    {
                        registeredCells.Remove(registeredCells.ElementAt(i).Key);
                    }
                    else
                    {
                        List <Dungeonator.CellData> Neighbors = new List <Dungeonator.CellData>();
                        Neighbors.AddRange(GameManager.Instance.Dungeon.data.GetCellNeighbors(registeredCells.ElementAt(i).Key, true));
                        int numberOfNeighbors = NumberOfLiveCells(Neighbors);

                        //Mark cells for death in the next generation if they have more than 3 neighbors or fewer than 2
                        if (numberOfNeighbors > 3 || numberOfNeighbors < 2)
                        {
                            plannedDeaths.Add(registeredCells.ElementAt(i).Key);
                        }


                        //We need to register all empty cells and figure out how many neighbors they have to figure out if they should come alive
                        //So we iterate through all alive cells, and add all their dead neighbors to a dictionary that stores how many times they have been checked
                        //Since they are checked by each alive cell, the amount of times they have been checked will tell us how many alive neighbors they have
                        foreach (Dungeonator.CellData potNeighbor in Neighbors)
                        {
                            if (!registeredCells.ContainsKey(potNeighbor))
                            {
                                if (birthCandidates.ContainsKey(potNeighbor))
                                {
                                    birthCandidates[potNeighbor]++;
                                }
                                else
                                {
                                    birthCandidates.Add(potNeighbor, 1);
                                }
                            }
                            // yield return null;
                        }
                        foreach (Dungeonator.CellData potBirth in birthCandidates.Keys)
                        {
                            if (birthCandidates[potBirth] == 3)
                            {
                                plannedBirths.Add(potBirth);
                            }
                        }
                    }
                }
            }
            generationRunning = false;
            timer             = 0.5f;
            yield break;
        }
コード例 #14
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Stick Gun", "stickgun");

            Game.Items.Rename("outdated_gun_mods:stick_gun", "nn:stick_gun");
            var behav = gun.gameObject.AddComponent <StickGun>();

            behav.preventNormalReloadAudio = true;
            behav.preventNormalFireAudio   = true;
            behav.overrideNormalFireAudio  = "Play_PencilScratch";
            gun.SetShortDescription("Scribble");
            gun.SetLongDescription("Carried by a brave stickman as he ventured through the pages of a bored child's homework." + "\n\nHe may be long erased, but his legacy lives on.");

            gun.SetupSprite(null, "stickgun_idle_001", 8);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0.7f;
            gun.DefaultModule.cooldownTime           = 0.1f;
            gun.DefaultModule.numberOfShotsInClip    = 3;
            gun.barrelOffset.transform.localPosition = new Vector3(0.93f, 0.68f, 0f);
            gun.SetBaseMaxAmmo(222);
            gun.ammo          = 222;
            gun.gunClass      = GunClass.SHITTY;
            gun.gunHandedness = GunHandedness.OneHanded;

            //VFX
            gun.muzzleFlashEffects = VFXToolbox.CreateVFXPool("Stick Gun Muzzleflash",
                                                              new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_muzzleflash_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_muzzleflash_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_muzzleflash_003",
            },
                                                              6,                                //FPS
                                                              new IntVector2(12, 13),           //Dimensions
                                                              tk2dBaseSprite.Anchor.MiddleLeft, //Anchor
                                                              false,                            //Uses a Z height off the ground
                                                              0,                                //The Z height, if used
                                                              false,
                                                              VFXAlignment.Fixed
                                                              );

            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage = 6f;
            projectile.baseData.speed *= 1.5f;

            PierceProjModifier pierce = projectile.gameObject.AddComponent <PierceProjModifier>();

            pierce.penetration = 1;

            projectile.SetProjectileSpriteRight("stickgun_projectile", 12, 2, false, tk2dBaseSprite.Anchor.MiddleCenter, 12, 2);
            gun.DefaultModule.projectiles[0] = projectile;

            //Projectile VFX

            projectile.hitEffects.overrideMidairDeathVFX = VFXToolbox.CreateVFX("Stick Gun MidairDeath",
                                                                                new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_impact_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_impact_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_impact_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_impact_004",
            },
                                                                                6,                                  //FPS
                                                                                new IntVector2(16, 15),             //Dimensions
                                                                                tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                                                false,                              //Uses a Z height off the ground
                                                                                0                                   //The Z height, if used
                                                                                );

            projectile.hitEffects.tileMapHorizontal = VFXToolbox.CreateVFXPool("Stick Gun TileMapHoriz",
                                                                               new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_tilemaphoriz_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_tilemaphoriz_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_tilemaphoriz_003"
            },
                                                                               6,                                //FPS
                                                                               new IntVector2(12, 21),           //Dimensions
                                                                               tk2dBaseSprite.Anchor.MiddleLeft, //Anchor
                                                                               false,                            //Uses a Z height off the ground
                                                                               0                                 //The Z height, if used
                                                                               );

            projectile.hitEffects.tileMapVertical = VFXToolbox.CreateVFXPool("Stick Gun TileMapVert",
                                                                             new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_tilemapvert_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_tilemapvert_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_tilemapvert_003"
            },
                                                                             6,                                //FPS
                                                                             new IntVector2(18, 21),           //Dimensions
                                                                             tk2dBaseSprite.Anchor.MiddleLeft, //Anchor
                                                                             false,                            //Uses a Z height off the ground
                                                                             0                                 //The Z height, if used
                                                                             );

            projectile.hitEffects.enemy = VFXToolbox.CreateVFXPool("Stick Gun EnemyImpact",
                                                                   new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_enemyimpact_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_enemyimpact_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_enemyimpact_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/StickGun/stickgun_enemyimpact_004"
            },
                                                                   6,                                  //FPS
                                                                   new IntVector2(15, 16),             //Dimensions
                                                                   tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                                   false,                              //Uses a Z height off the ground
                                                                   0,                                  //The Z height, if used
                                                                   false,
                                                                   VFXAlignment.Fixed
                                                                   );

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("StickGun Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/stickgun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/stickgun_clipempty");

            gun.quality = PickupObject.ItemQuality.D;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            StickGunID = gun.PickupObjectId;
        }
コード例 #15
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Blowgun", "blowgun");

            Game.Items.Rename("outdated_gun_mods:blowgun", "nn:blowgun");
            var behav = gun.gameObject.AddComponent <Blowgun>();

            behav.preventNormalReloadAudio = true;
            gun.SetShortDescription("Huff and Puff");
            gun.SetLongDescription("Relies on lung strength to propel poisonous darts." + "\n\nRobots may need to hold it up to a cooling vent or something.");

            gun.SetupSprite(null, "blowgun_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 15);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(150) as Gun).gunSwitchGroup;

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(26) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0.5f;
            gun.DefaultModule.cooldownTime           = 0.2f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(1.12f, 0.18f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.gunClass = GunClass.POISON;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.baseData.speed       *= 2f;
            projectile.damageTypes          |= CoreDamageTypes.Poison;
            ExtremelySimplePoisonBulletBehaviour poisoning = projectile.gameObject.AddComponent <ExtremelySimplePoisonBulletBehaviour>();

            poisoning.procChance     = 1;
            poisoning.useSpecialTint = false;
            projectile.SetProjectileSpriteRight("blowgun_projectile", 16, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 15, 8);

            VFXPool HorizVFXOBj = VFXToolbox.CreateVFXPool("Blowgun Tilemap VFX Horiz",
                                                           new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/PoisonDarts/poisondart_impacthoriz_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/PoisonDarts/poisondart_impacthoriz_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/PoisonDarts/poisondart_impacthoriz_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/PoisonDarts/poisondart_impacthoriz_004",
            },
                                                           10,
                                                           new IntVector2(12, 11),
                                                           tk2dBaseSprite.Anchor.MiddleLeft,
                                                           false,
                                                           0,
                                                           true);

            projectile.hitEffects.deathTileMapHorizontal = HorizVFXOBj;
            projectile.hitEffects.tileMapHorizontal      = HorizVFXOBj;

            projectile.hitEffects.deathTileMapVertical = HorizVFXOBj;
            projectile.hitEffects.tileMapVertical      = HorizVFXOBj;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Blowgun Darts", "NevernamedsItems/Resources/CustomGunAmmoTypes/blowgun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/blowgun_clipempty");

            gun.quality = PickupObject.ItemQuality.D;
            gun.encounterTrackable.EncounterGuid = "this is the Blowgun";
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            foreach (tk2dSpriteAnimationClip clip in AdjustGunPosition.GetGunAnimationClips(gun))
            {
                foreach (tk2dSpriteAnimationFrame frame in clip.frames)
                {
                    frame.spriteCollection.spriteDefinitions[frame.spriteId].ApplyOffset(new Vector2(0, 0f));
                }
            }

            BlowgunID = gun.PickupObjectId;
        }
コード例 #16
0
        public static VFXPool CreateMuzzleflash(string name, List <string> spriteNames, int fps, List <IntVector2> spriteSizes, List <tk2dBaseSprite.Anchor> anchors, List <Vector2> manualOffsets, bool orphaned, bool attached, bool persistsOnDeath,
                                                bool usesZHeight, float zHeight, VFXAlignment alignment, bool destructible, List <float> emissivePowers, List <Color> emissiveColors)
        {
            VFXPool pool = new VFXPool();

            pool.type = VFXPoolType.All;
            VFXComplex complex = new VFXComplex();
            VFXObject  vfObj   = new VFXObject();
            GameObject obj     = new GameObject(name);

            obj.SetActive(false);
            FakePrefab.MarkAsFakePrefab(obj);
            UnityEngine.Object.DontDestroyOnLoad(obj);
            tk2dSprite              sprite   = obj.AddComponent <tk2dSprite>();
            tk2dSpriteAnimator      animator = obj.AddComponent <tk2dSpriteAnimator>();
            tk2dSpriteAnimationClip clip     = new tk2dSpriteAnimationClip();

            clip.fps    = fps;
            clip.frames = new tk2dSpriteAnimationFrame[0];
            for (int i = 0; i < spriteNames.Count; i++)
            {
                string                spriteName   = spriteNames[i];
                IntVector2            spriteSize   = spriteSizes[i];
                tk2dBaseSprite.Anchor anchor       = anchors[i];
                Vector2               manualOffset = manualOffsets[i];
                float emissivePower            = emissivePowers[i];
                Color emissiveColor            = emissiveColors[i];
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame();
                frame.spriteId = VFXCollection.GetSpriteIdByName(spriteName);
                tk2dSpriteDefinition def = VFXToolbox.SetupDefinitionForShellSprite(spriteName, frame.spriteId, spriteSize.x, spriteSize.y);
                def.ConstructOffsetsFromAnchor(anchor, def.position3);
                def.MakeOffset(manualOffset);
                def.material.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
                def.material.SetFloat("_EmissiveColorPower", emissivePower);
                def.material.SetColor("_EmissiveColor", emissiveColor);
                def.materialInst.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
                def.materialInst.SetFloat("_EmissiveColorPower", emissivePower);
                def.materialInst.SetColor("_EmissiveColor", emissiveColor);
                frame.spriteCollection = VFXCollection;
                clip.frames            = clip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            sprite.renderer.material.shader = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTintableTiltedCutoutEmissive");
            sprite.renderer.material.SetFloat("_EmissiveColorPower", emissivePowers[0]);
            sprite.renderer.material.SetColor("_EmissiveColor", emissiveColors[0]);
            clip.wrapMode = tk2dSpriteAnimationClip.WrapMode.Once;
            clip.name     = "start";
            animator.spriteAnimator.Library         = animator.gameObject.AddComponent <tk2dSpriteAnimation>();
            animator.spriteAnimator.Library.clips   = new tk2dSpriteAnimationClip[] { clip };
            animator.spriteAnimator.Library.enabled = true;
            SpriteAnimatorKiller kill = animator.gameObject.AddComponent <SpriteAnimatorKiller>();

            kill.fadeTime             = -1f;
            kill.animator             = animator;
            kill.delayDestructionTime = -1f;
            vfObj.orphaned            = orphaned;
            vfObj.attached            = attached;
            vfObj.persistsOnDeath     = persistsOnDeath;
            vfObj.usesZHeight         = usesZHeight;
            vfObj.zHeight             = zHeight;
            vfObj.alignment           = alignment;
            vfObj.destructible        = destructible;
            vfObj.effect               = obj;
            complex.effects            = new VFXObject[] { vfObj };
            pool.effects               = new VFXComplex[] { complex };
            animator.playAutomatically = true;
            animator.DefaultClipId     = animator.GetClipIdByName("start");
            return(pool);
        }
コード例 #17
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("ARC Pistol", "arcpistol");

            Game.Items.Rename("outdated_gun_mods:arc_pistol", "nn:arc_pistol");
            gun.gameObject.AddComponent <ARCPistol>();
            gun.SetShortDescription("Shocked And Loaded");
            gun.SetLongDescription("Developed by the ARC Private Security company for easy manufacture and deployment, this electrotech blaster is the epittome of the ARC brand.");

            gun.SetupSprite(null, "arcpistol_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 15);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup;

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(41) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0.7f;
            gun.DefaultModule.cooldownTime           = 0.15f;
            gun.DefaultModule.numberOfShotsInClip    = 5;
            gun.barrelOffset.transform.localPosition = new Vector3(22f / 16f, 11f / 16f, 0f);
            gun.SetBaseMaxAmmo(300);
            gun.gunClass = GunClass.PISTOL;

            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.speed       *= 5f;
            projectile.baseData.damage       = 6f;
            projectile.SetProjectileSpriteRight("arc_proj", 8, 2, false, tk2dBaseSprite.Anchor.MiddleCenter, 8, 2);
            LightningProjectileComp lightning = projectile.gameObject.GetOrAddComponent <LightningProjectileComp>();

            projectile.gameObject.AddComponent <PierceDeadActors>();

            projectile.hitEffects.overrideMidairDeathVFX = VFXToolbox.CreateVFX("ARC Impact",
                                                                                new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/electricImpact1",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/electricImpact2",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/electricImpact3",
            },
                                                                                10,                                 //FPS
                                                                                new IntVector2(44, 43),             //Dimensions
                                                                                tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                                                false,                              //Uses a Z height off the ground
                                                                                0                                   //The Z height, if used
                                                                                );
            projectile.hitEffects.alwaysUseMidair = true;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("ARC Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/arcweapon_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/arcweapon_clipempty");

            gun.quality = PickupObject.ItemQuality.C;
            ETGMod.Databases.Items.Add(gun, null, "ANY");


            ID = gun.PickupObjectId;
        }
コード例 #18
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Square Peg", "squarepeg");

            Game.Items.Rename("outdated_gun_mods:square_peg", "nn:square_peg");
            gun.gameObject.AddComponent <SquarePeg>();
            gun.SetShortDescription("In A Round Chamber");
            gun.SetLongDescription("[] A perfect example of the art of cubism.");

            gun.SetupSprite(null, "squarepeg_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 15);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(475) as Gun).gunSwitchGroup;

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.12f;
            gun.DefaultModule.numberOfShotsInClip    = 6;
            gun.barrelOffset.transform.localPosition = new Vector3((26f / 16f), (14f / 16f), 0f);
            gun.SetBaseMaxAmmo(150);
            gun.gunClass           = GunClass.PISTOL;
            gun.muzzleFlashEffects = VFXToolbox.CreateVFXPool("SquarePeg Muzzleflash",
                                                              new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_muzzleflash_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_muzzleflash_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_muzzleflash_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_muzzleflash_004",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_muzzleflash_005",
            },
                                                              12,                               //FPS
                                                              new IntVector2(23, 14),           //Dimensions
                                                              tk2dBaseSprite.Anchor.MiddleLeft, //Anchor
                                                              false,                            //Uses a Z height off the ground
                                                              0,                                //The Z height, if used
                                                              false,
                                                              VFXAlignment.Fixed
                                                              );

            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0]             = projectile;
            projectile.transform.parent                  = gun.barrelOffset;
            projectile.baseData.damage                   = 8f;
            projectile.hitEffects.overrideMidairDeathVFX = VFXToolbox.CreateVFX("SquarePeg MidairDeath",
                                                                                new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_impact_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_impact_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_impact_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/SquarePeg/squarepeg_impact_004",
            },
                                                                                12,                                 //FPS
                                                                                new IntVector2(14, 14),             //Dimensions
                                                                                tk2dBaseSprite.Anchor.MiddleCenter, //Anchor
                                                                                false,                              //Uses a Z height off the ground
                                                                                0                                   //The Z height, if used
                                                                                );
            projectile.hitEffects.alwaysUseMidair = true;

            projectile.SetProjectileSpriteRight("squarepeg_proj", 8, 8, false, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("SquarePegSquares", "NevernamedsItems/Resources/CustomGunAmmoTypes/squarepeg_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/squarepeg_clipempty");

            gun.quality = PickupObject.ItemQuality.C;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            ID = gun.PickupObjectId;
        }
コード例 #19
0
        protected override void DoEffect(PlayerController user)
        {
            IPlayerInteractable nearestInteractable = user.CurrentRoom.GetNearestInteractable(user.CenterPosition, 1f, user);

            if (!(nearestInteractable is Chest))
            {
                return;
            }

            AkSoundEngine.PostEvent("Play_ENM_electric_charge_01", user.gameObject);

            Chest rerollChest = nearestInteractable as Chest;
            int   selected    = UnityEngine.Random.Range(1, 15);

            ETGModConsole.Log(selected.ToString());

            VFXToolbox.GlitchScreenForSeconds(1.5f);


            switch (selected)
            {
            case 1:     //Blow up chest
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    Exploder.DoDefaultExplosion(rerollChest.specRigidbody.UnitCenter, Vector2.zero);
                    if (rerollChest.IsMimic)
                    {
                        OMITBReflectionHelpers.ReflectSetField <bool>(typeof(Chest), "m_isMimic", false, rerollChest);
                    }
                    rerollChest.majorBreakable.Break(Vector2.zero);
                    if (rerollChest.GetChestTier() == ChestToolbox.ChestTier.RAT)
                    {
                        UnityEngine.Object.Destroy(rerollChest.gameObject);
                    }
                }
                break;

            case 2:     //Open Chest
                rerollChest.ForceOpen(user);
                break;

            case 3:     //Break Lock
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    if (rerollChest.IsLocked)
                    {
                        rerollChest.BreakLock();
                    }
                    else
                    {
                        rerollChest.majorBreakable.Break(Vector2.zero);
                    }
                }
                break;

            case 4:     //Duplicate Chest
                DupeChest(rerollChest, user);
                break;

            case 5:     //Turn into mimic
                if (!rerollChest.IsMimic)
                {
                    rerollChest.overrideMimicChance = 100; rerollChest.MaybeBecomeMimic();
                }
                rerollChest.ForceOpen(user);
                break;

            case 6:     //Englitch
                List <GlobalDungeonData.ValidTilesets> bannedGlitchFloors = new List <GlobalDungeonData.ValidTilesets>()
                {
                    GlobalDungeonData.ValidTilesets.CATACOMBGEON,
                    GlobalDungeonData.ValidTilesets.HELLGEON,
                    GlobalDungeonData.ValidTilesets.OFFICEGEON,
                    GlobalDungeonData.ValidTilesets.FORGEGEON,
                };
                if (!bannedGlitchFloors.Contains(GameManager.Instance.Dungeon.tileIndices.tilesetId))
                {
                    rerollChest.BecomeGlitchChest();
                }
                else
                {
                    if (!rerollChest.IsMimic)
                    {
                        rerollChest.MaybeBecomeMimic();
                    }
                    rerollChest.ForceOpen(user);
                }
                break;

            case 7:     //Enrainbow
                if (UnityEngine.Random.value <= 0.65f)
                {
                    UpgradeChest(rerollChest, user);
                }
                else
                {
                    rerollChest.BecomeRainbowChest();
                }
                break;

            case 8:     //Reroll
                RerollChest(rerollChest, user);
                break;

            case 9:     //Turn into pickups
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    for (int i = 0; i < 5; i++)
                    {
                        LootEngine.SpawnItem(PickupObjectDatabase.GetById(BraveUtility.RandomElement(BabyGoodChanceKin.lootIDlist)).gameObject, rerollChest.sprite.WorldCenter, Vector2.zero, 0);
                    }
                    LootEngine.SpawnCurrency(rerollChest.sprite.WorldCenter, UnityEngine.Random.Range(5, 11));
                    user.CurrentRoom.DeregisterInteractable(rerollChest);
                    rerollChest.DeregisterChestOnMinimap();
                    UnityEngine.Object.Destroy(rerollChest.gameObject);
                }
                break;

            case 10:     //Fuse
                if (user.PlayerHasActiveSynergy("KEYGEN"))
                {
                    SpareChest(rerollChest);
                }
                else
                {
                    var type = typeof(Chest);
                    var func = type.GetMethod("TriggerCountdownTimer", BindingFlags.Instance | BindingFlags.NonPublic);
                    var ret  = func.Invoke(rerollChest, null);
                    AkSoundEngine.PostEvent("Play_OBJ_fuse_loop_01", rerollChest.gameObject);
                }
                break;

            case 11:     //Unlock
                if (rerollChest.IsLocked)
                {
                    rerollChest.ForceUnlock();
                }
                else
                {
                    rerollChest.ForceOpen(user);
                }
                break;

            case 12:     //Enjam
                rerollChest.gameObject.GetOrAddComponent <JammedChestBehav>();
                break;

            case 13:     //TeleportChest
                TeleportChest(rerollChest, user);
                break;

            case 14:     //Drill
                FauxDrill(rerollChest, user);
                break;
            }
        }
コード例 #20
0
        public override void Start()
        {
            try
            {
                ETGModConsole.Log("Once More Into The Breach started initialising...");

                //Rooms
                ZipFilePath = this.Metadata.Archive;
                FilePath    = this.Metadata.Directory + "/rooms";
                ModName     = this.Metadata.Name;

                //Tools and Toolboxes
                StaticReferences.Init();
                ExoticPlaceables.Init();
                DungeonHandler.Init();
                Tools.Init();
                ShrineFakePrefabHooks.Init();

                ShrineFactory.Init();
                OldShrineFactory.Init();

                FakePrefabHooks.Init();

                ItemBuilder.Init();
                CharApi.Init("nn");
                CustomClipAmmoTypeToolbox.Init();
                EnemyTools.Init();
                NpcApi.Hooks.Init();
                EnemyAPI.Hooks.Init();
                SaveAPIManager.Setup("nn");
                AudioResourceLoader.InitAudio();
                CurseManager.Init();
                ETGModMainBehaviour.Instance.gameObject.AddComponent <GlobalUpdate>();
                ETGModMainBehaviour.Instance.gameObject.AddComponent <CustomDarknessHandler>();
                GameOfLifeHandler.Init();
                //ETGModMainBehaviour.Instance.gameObject.AddComponent<GameOfLifeHandler>();

                //ETGModConsole.Log(Assembly.GetExecutingAssembly().FullName);

                //Challenges
                Challenges.Init();

                //Hooks n Shit
                PlayerToolsSetup.Init();
                EnemyHooks.InitEnemyHooks();
                CompanionisedEnemyUtility.InitHooks();
                MiscUnlockHooks.InitHooks();
                FloorAndGenerationToolbox.Init();
                PedestalHooks.Init();
                ExplosionHooks.Init();
                ChestToolbox.Inithooks();
                UIHooks.Init();
                ComplexProjModBeamCompatibility.Init();
                ReloadBreachShrineHooks.Init();
                metadata = this.Metadata;
                //VFX Setup
                VFXToolbox.InitVFX();
                EasyVFXDatabase.Init(); //Needs to occur before goop definition
                ShadeFlightHookFix.Init();

                //Status Effect Setup
                StaticStatusEffects.InitCustomEffects();
                PlagueStatusEffectSetup.Init();
                Confusion.Init();

                //Goop Setup
                EasyGoopDefinitions.DefineDefaultGoops();
                DoGoopEffectHook.Init();

                //Commands and Other Console Utilities
                Commands.Init();

                //Hats
                HatUtility.NecessarySetup();
                HatDefinitions.Init();

                //Gamemodes
                AllJammedState.Init();
                JammedChests.Init();

                //Exotic Object Shit

                //VFX
                LockdownStatusEffect.Initialise();

                //Testing / Debug Items
                ActiveTestingItem.Init();
                PassiveTestingItem.Init();
                BulletComponentLister.Init();
                ObjectComponentLister.Init();

                //-----------------------------------------------------ITEMS GET INITIALISED
                #region ItemInitialisation
                //Character Starters
                ShadeHand.Init();
                ShadeHeart.Init();
                //Egg Salad and Prima Bean can go here, because they were the first
                EggSalad.Init();
                PrimaBean.Init();
                //Bullet modifiers
                BashingBullets.Init();
                TitanBullets.Init();
                MistakeBullets.Init();
                FiftyCalRounds.Init();
                UnengravedBullets.Init();
                EngravedBullets.Init();
                HardReloadBullets.Init();
                NitroBullets.Init();
                SupersonicShots.Init();
                GlassRounds.Init();
                Junkllets.Init();
                BloodthirstyBullets.Init();
                CleansingRounds.Init();
                HallowedBullets.Init();
                PromethianBullets.Init();
                EpimethianBullets.Init();
                RandoRounds.Init();
                IngressBullets.Init(); //Unfinished
                HematicRounds.Init();
                FullArmourJacket.Init();
                MirrorBullets.Init();
                CrowdedClip.Init();
                BashfulShot.Init();
                OneShot.Init();
                BulletBullets.Init();
                AntimatterBullets.Init();
                SpectreBullets.Init();
                Tabullets.Init();
                TierBullets.Init(); //Unfinished
                BombardierShells.Init();
                GildedLead.Init();
                DemoterBullets.Init();
                Voodoollets.Init();
                TracerRound.Init();
                EndlessBullets.Init();
                HellfireRounds.Init();
                Birdshot.Init();
                Unpredictabullets.Init();
                WarpBullets.Init();
                BulletsWithGuns.Init();
                LaserBullets.Init();
                BalancedBullets.Init();          //Unfinished
                WoodenBullets.Init();
                ComicallyGiganticBullets.Init(); //Excluded
                KnightlyBullets.Init();
                EmptyRounds.Init();
                LongswordShot.Init();
                DrillBullets.Init();
                FoamDarts.Init();
                BatterBullets.Init();
                ElectrumRounds.Init();
                BreachingRounds.Init();
                MagnetItem.Init();
                EargesplittenLoudenboomerRounds.Init();
                TheShell.Init();
                //Status Effect Bullet Mods
                SnailBullets.Init();
                LockdownBullets.Init();
                PestiferousLead.Init();
                Shrinkshot.Init();
                //Volley Modifying Bullet Mods
                Splattershot.Init();
                BackwardsBullets.Init();
                CrossBullets.Init();
                ShadeShot.Init();
                //Insta-Kill Bullet Modifiers
                MinersBullets.Init();
                AntimagicRounds.Init();
                AlkaliBullets.Init();
                ShutdownShells.Init();
                ERRORShells.Init();
                OsteoporosisBullets.Init();
                //NonBullet Stat Changers
                MicroAIContact.Init();
                LuckyCoin.Init();
                IronSights.Init();
                Lewis.Init();
                MysticOil.Init();
                VenusianBars.Init();
                NumberOneBossMug.Init();
                LibramOfTheChambers.Init();
                OrganDonorCard.Init();
                GlassGod.Init();
                ChaosRuby.Init();
                BlobulonRage.Init();
                OverpricedHeadband.Init();
                GunslingerEmblem.Init();
                MobiusClip.Init();
                ClipOnAmmoPouch.Init();
                JawsOfDefeat.Init();
                //Armour
                ArmourBandage.Init();
                GoldenArmour.Init();
                ExoskeletalArmour.Init();
                PowerArmour.Init();
                ArmouredArmour.Init();
                //Consumable Givers
                LooseChange.Init();
                SpaceMetal.Init();
                //Blank Themed Items
                TrueBlank.Init();
                FalseBlank.Init();
                SpareBlank.Init();
                OpulentBlank.Init();
                GrimBlanks.Init();
                NNBlankPersonality.Init();
                Blombk.Init();
                Blankh.Init();
                //Key Themed Items
                BlankKey.Init();
                SharpKey.Init();
                SpareKey.Init();
                KeyChain.Init();
                KeyBullwark.Init();
                KeyBulletEffigy.Init();
                FrostKey.Init();
                ShadowKey.Init();
                Keygen.Init();
                CursedTumbler.Init();
                //Ammo Box Themed Items
                TheShellactery.Init();
                BloodyAmmo.Init();
                MengerAmmoBox.Init();
                AmmoTrap.Init();
                //Boxes and Stuff
                BloodyBox.Init();
                MaidenShapedBox.Init();
                Toolbox.Init();
                PocketChest.Init();
                DeliveryBox.Init();
                Wonderchest.Init();
                //Heart themed items
                HeartPadlock.Init();
                Mutagen.Init();
                ForsakenHeart.Init();
                HeartOfGold.Init();
                GooeyHeart.Init();
                ExaltedHeart.Init();
                CheeseHeart.Init();
                TinHeart.Init();
                //Chambers
                BarrelChamber.Init();
                GlassChamber.Init();
                FlameChamber.Init();
                Recyclinder.Init();
                Nitroglycylinder.Init();
                SpringloadedChamber.Init();
                WitheringChamber.Init();
                HeavyChamber.Init();
                CyclopeanChamber.Init();
                //Table Techs
                TableTechTable.Init();
                TableTechSpeed.Init();
                TableTechInvulnerability.Init();
                TableTechAmmo.Init();
                TableTechGuon.Init();
                TableTechNology.Init();
                UnsTableTech.Init();
                //Guon Stones
                WoodGuonStone.Init();
                YellowGuonStone.Init();
                GreyGuonStone.Init();
                GoldGuonStone.Init();
                BrownGuonStone.Init();
                CyanGuonStone.Init();
                IndigoGuonStone.Init();
                SilverGuonStone.Init();
                MaroonGuonStone.Init();
                UltraVioletGuonStone.Init();
                InfraredGuonStone.Init();
                RainbowGuonStone.Init();
                KaleidoscopicGuonStone.Init();
                GuonBoulder.Init();
                BloodglassGuonStone.Init();
                //Ammolets
                GlassAmmolet.Init();
                WickerAmmolet.Init();
                FuriousAmmolet.Init();
                SilverAmmolet.Init();
                IvoryAmmolet.Init();
                KinAmmolet.Init();
                Autollet.Init();
                Keymmolet.Init();
                Ammolock.Init();
                HepatizonAmmolet.Init();
                BronzeAmmolet.Init();
                PearlAmmolet.Init();
                NeutroniumAmmolet.Init();
                Shatterblank.Init();
                // Boots
                CycloneCylinder.Init();
                BootLeg.Init();
                BlankBoots.Init();
                BulletBoots.Init();
                //Bracelets and Jewelry
                DiamondBracelet.Init();
                PearlBracelet.Init();
                PanicPendant.Init();
                GunknightAmulet.Init();
                AmuletOfShelltan.Init();
                //Rings
                RingOfOddlySpecificBenefits.Init();
                FowlRing.Init();
                RingOfAmmoRedemption.Init();
                RiskyRing.Init();
                WidowsRing.Init();
                ShadowRing.Init();
                RingOfInvisibility.Init();
                //Holsters
                BlackHolster.Init();
                TheBeholster.Init();
                HiveHolster.Init();
                ShoulderHolster.Init();
                ArtilleryBelt.Init();
                BulletShuffle.Init();
                //Companions
                MolotovBuddy.Init();
                BabyGoodChanceKin.Init();
                Potty.Init();
                Peanut.Init();
                DarkPrince.Init();
                Diode.Init();
                DroneCompanion.Init();
                GregTheEgg.Init();
                FunGuy.Init();
                BabyGoodDet.Init();
                AngrySpirit.Init();
                Gusty.Init();
                ScrollOfExactKnowledge.Init();
                LilMunchy.Init();
                //Potions / Jars
                SpeedPotion.Init();
                LovePotion.Init();
                HoneyPot.Init();
                ChemicalBurn.Init();
                WitchsBrew.Init();
                Nigredo.Init();
                Albedo.Init();
                Citrinitas.Init();
                Rubedo.Init();
                HoleyWater.Init();
                //Remotes
                ReinforcementRadio.Init();
                //Medicine
                BloodThinner.Init();
                BoosterShot.Init();
                ShotInTheArm.Init();
                //Knives and Blades
                DaggerOfTheAimgel.Init();
                CombatKnife.Init();
                Bayonet.Init();
                //Books
                BookOfMimicAnatomy.Init();
                KalibersPrayer.Init();
                GunidaeSolvitHaatelis.Init();
                //Maps
                MapFragment.Init();
                TatteredMap.Init();
                //Clothing
                CloakOfDarkness.Init();
                TimeFuddlersRobe.Init();
                //Eyes
                CartographersEye.Init();
                BloodshotEye.Init();
                ShadesEye.Init();
                KalibersEye.Init();
                //Hands
                Lefthandedness.Init();
                NecromancersRightHand.Init();
                //Bombs
                InfantryGrenade.Init();
                DiceGrenade.Init();
                //True Misc
                Lvl2Molotov.Init();
                GoldenAppleCore.Init();
                AppleCore.Init();
                AppleActive.Init();
                LibationtoIcosahedrax.Init(); //Unfinished
                BagOfHolding.Init();
                ItemCoupon.Init();
                IdentityCrisis.Init();
                LiquidMetalBody.Init();
                GunGrease.Init();
                BomberJacket.Init();
                DragunsScale.Init();
                GTCWTVRP.Init();
                BlightShell.Init();
                BulletKinPlushie.Init();
                Kevin.Init();
                PurpleProse.Init();
                RustyCasing.Init();
                HikingPack.Init();
                GunpowderPheromones.Init();
                GunsmokePerfume.Init();
                Pestilence.Init();
                ElevatorButton.Init();
                Bullut.Init();
                GSwitch.Init();
                FaultyHoverboots.Init(); //Unfinished
                AcidAura.Init();
                HornedHelmet.Init();
                RocketMan.Init();
                Roulette.Init(); //Unfinished
                FinishedBullet.Init();
                ChanceKinEffigy.Init();
                MagickeCauldron.Init();
                Bombinomicon.Init();
                ClaySculpture.Init();
                GracefulGoop.Init();
                MrFahrenheit.Init();
                MagicQuiver.Init();
                FocalLenses.Init();
                MagicMissile.Init();
                AmberDie.Init();
                ObsidianPistol.Init();
                Showdown.Init();
                LootEngineItem.Init();
                Ammolite.Init();
                PortableHole.Init();
                CardinalsMitre.Init();
                GunjurersBelt.Init();
                GoomperorsCrown.Init();
                ChemGrenade.Init();
                EightButton.Init();
                TitaniumClip.Init();
                PaperBadge.Init();
                Permafrost.Init();
                GlassShard.Init();
                EqualityItem.Init();
                BitBucket.Init();
                Eraser.Init();
                TackShooter.Init();
                Moonrock.Init();
                Telekinesis.Init();
                TabletOfOrder.Init();
                LeadSoul.Init();
                LeadOfLife.Init();
                AWholeBulletKin.Init();
                #endregion

                //-----------------------------------------------------GUNS GET INITIALISED
                #region GunInitialisation
                //UNFINISHED / TEST GUNS
                WailingMagnum.Add();
                Defender.Add();
                TestGun.Add();
                Gunycomb.Add();
                GlobbitSMALL.Add();
                GlobbitMED.Add();
                GlobbitMEGA.Add();


                //GUNS

                //CHARACTERSTARTERS
                ElderMagnum.Add();

                //REVOLVERS
                FlayedRevolver.Add();
                G20.Add();
                MamaGun.Add();
                LovePistol.Add();
                DiscGun.Add();
                Repeatovolver.Add();
                Pista.Add();
                NNGundertale.Add();
                DiamondGun.Add();
                NNMinigun.Add();
                ShroomedGun.Add();
                GoldenRevolver.Add();
                Nocturne.Add();
                BackWarder.Add();
                Redhawk.Add();
                ToolGun.Add();
                //GENERAL HANDGUNS
                StickGun.Add();
                Glock42.Add();
                StarterPistol.Add();
                PopGun.Add();
                UnusCentum.Add();
                StunGun.Add();
                CopperSidearm.Add();
                Rekeyter.Add();
                HotGlueGun.Add();
                UpNUp.Add();
                RedRobin.Add();
                VariableGun.Add();
                CrescendoBlaster.Add();
                Glasster.Add();
                HandGun.Add();
                Viper.Add();
                DiamondCutter.Add();
                MarchGun.Add();
                RebarGun.Add();
                MinuteGun.Add();
                Ulfberht.Add();
                HeadOfTheOrder.Add();
                GunOfAThousandSins.Add();
                DoubleGun.Add();
                //SHOTGUNS
                JusticeGun.Add();
                Orgun.Add();
                Octagun.Add();
                ClownShotgun.Add();
                Ranger.Add();
                RustyShotgun.Add();
                TheBride.Add();
                TheGroom.Add();
                IrregularShotgun.Add();
                GrenadeShotgun.Add();
                Jackhammer.Add();
                SaltGun.Add();
                SoapGun.Add();
                //CANNONS
                Felissile.Add();
                HandCannon.Add();
                Lantaka.Add();
                GreekFire.Add();
                EmberCannon.Add();
                ElysiumCannon.Add();
                DisplacerCannon.Add();
                //SCI-FI GUNS
                Blasmaster.Add();
                St4ke.Add();
                RedBlaster.Add();
                BeamBlade.Add();
                Neutrino.Add();
                Rico.Add();
                TheThinLine.Add();
                RocketPistol.Add();
                Repetitron.Add();
                Dimensionaliser.Add();
                Purpler.Add();
                VacuumGun.Add();
                Oxygun.Add();
                TriBeam.Add();
                KineticBlaster.Add();
                LaserWelder.Add();
                QBeam.Add();
                HighVelocityRifle.Add();
                Demolitionist.Add();
                PumpChargeShotgun.Add();
                TheOutbreak.Add();
                Multiplicator.Add();
                PunishmentRay.Add();
                YBeam.Add();
                WallRay.Add();
                BolaGun.Add();
                AlphaBeam.Add();
                Glazerbeam.Add();
                StasisRifle.Add();
                Gravitron.Add();
                Ferrobolt.Add();
                TauCannon.Add();
                GravityGun.Add();
                GalaxyCrusher.Add();
                //ARC Weapons
                ARCPistol.Add();
                ARCShotgun.Add();
                ARCRifle.Add();
                ARCTactical.Add();
                ARCCannon.Add();
                //BOWS AND CROSSBOWS
                IceBow.Add();
                Boltcaster.Add();
                Clicker.Add();
                //ANTIQUES
                WheelLock.Add();
                Welrod.Add();
                Welgun.Add();
                TheLodger.Add();
                Gonne.Add();
                Hwacha.Add();
                FireLance.Add();
                HandMortar.Add();
                GrandfatherGlock.Add();
                GatlingGun.Add();
                Blowgun.Add();
                Gaxe.Add();
                WoodenHorse.Add();
                AgarGun.Add();
                //KNIVES AND BLADES
                Carnwennan.Add();
                MantidAugment.Add();
                //REALISTIC GUNS
                HeatRay.Add();
                BarcodeScanner.Add();
                AntimaterielRifle.Add();
                Primos1.Add();
                DartRifle.Add();
                AM0.Add();
                RiskRifle.Add();
                RiotGun.Add();
                Kalashnirang.Add();
                MaidenRifle.Add();
                Blizzkrieg.Add();
                Copygat.Add();
                Skorpion.Add();
                HeavyAssaultRifle.Add();
                DynamiteLauncher.Add();
                MarbledUzi.Add();
                BurstRifle.Add();
                OlReliable.Add();
                //MISSILE LAUNCHERS
                BottleRocket.Add();
                NNBazooka.Add();
                BoomBeam.Add();
                Pillarocket.Add();
                //ANIMAL / ORGANIC GUNS
                SporeLauncher.Add();
                PoisonDartFrog.Add();
                Corgun.Add();
                FungoCannon.Add();
                PhaserSpiderling.Add();
                Guneonate.Add();
                KillithidTendril.Add();
                Gunger.Add();
                SickWorm.Add();
                MiniMonger.Add();
                CarrionFormeTwo.Add();
                CarrionFormeThree.Add();
                Carrion.Add();
                UterinePolyp.Add();
                Wrinkler.Add();
                //BLADES
                ButchersKnife.Add();
                RapidRiposte.Add();
                //FUN GUNS
                Gumgun.Add();
                Glooper.Add();
                Accelerator.Add();
                PaintballGun.Add();
                Converter.Add();
                Spiral.Add();
                Gunshark.Add();
                FingerGuns.Add();
                OBrienFist.Add();
                GolfRifle.Add();
                Pandephonium.Add();
                Sweeper.Add();
                DeskFan.Add();
                Pencil.Add();
                SquarePeg.Add();
                Ringer.Add();
                Snaker.Add();
                GayK47.Add();
                DecretionCarbine.Add();
                RC360.Add();
                UziSpineMM.Add();
                Autogun.Add();
                Rebondir.Add();
                BigShot.Add();
                W3irdstar.Add();
                Seismograph.Add();
                BioTranstater2100.Add();
                //MAGICAL GUNS
                Icicle.Add();
                GunjurersStaff.Add();
                InitiateWand.Add();
                LightningRod.Add();
                OrbOfTheGun.Add();
                SpearOfJustice.Add();
                Protean.Add();
                BulletBlade.Add();
                Bookllet.Add();
                Lorebook.Add();
                Beastclaw.Add();
                Bullatterer.Add();
                Entropew.Add();
                Missinguno.Add();
                Paraglocks.Add();
                //CONSUMABLE FIRING GUNS
                Creditor.Add();
                Blankannon.Add();
                Viscerifle.Add();
                //ENDPAGE GUNS
                MastersGun.Add();
                Wrench.Add();
                Pumhart.Add();


                //SYNERGY FORME GUNS
                GunsharkMegasharkSynergyForme.Add();
                DiscGunSuperDiscForme.Add();
                OrgunHeadacheSynergyForme.Add();
                Wolfgun.Add();
                MinigunMiniShotgunSynergyForme.Add();
                PenPencilSynergy.Add();
                ReShelletonKeyter.Add();
                AM0SpreadForme.Add();
                BulletBladeGhostForme.Add();
                GlueGunGlueGunnerSynergy.Add();
                KingBullatterer.Add();
                WrenchNullRefException.Add();
                GatlingGunGatterUp.Add();
                GravityGunNegativeMatterForm.Add();
                GonneElder.Add();
                UterinePolypWombular.Add();
                DiamondGaxe.Add();
                RedRebondir.Add();
                DiamondCutterRangerClass.Add();
                StickGunQuickDraw.Add();
                StormRod.Add();
                UnrustyShotgun.Add();
                #endregion


                //-----------------------------------------------------SHRINES GET INITIALISED
                #region ShrineInitialisation
                InvestmentShrine.Add();
                RelodinShrine.Add();
                DagunShrine.Add();
                ArtemissileShrine.Add();
                ExecutionerShrine.Add();
                TurtleShrine.Add();
                KliklokShrine.Add();
                #endregion

                //-----------------------------------------------------NPCS GET INITIALISED
                #region NPCInitialisation
                Rusty.Init();
                Ironside.Init();
                Boomhildr.Init();
                #endregion

                ChromaGun.Add();

                //GOOD MIMIC (NEEDS TO BE INITIALISED LATER)
                GoodMimic.Add();

                //Characters
                var data = Loader.BuildCharacter("NevernamedsItems/Characters/Shade",
                                                 CustomPlayableCharacters.Shade,
                                                 new Vector3(12.3f, 21.3f),
                                                 false,
                                                 new Vector3(13.1f, 19.1f),
                                                 false,
                                                 false,
                                                 true,
                                                 true,  //Sprites used by paradox
                                                 false, //Glows
                                                 null,  //Glow Mat
                                                 null,  //Alt Skin Glow Mat
                                                 0,     //Hegemony Cost
                                                 false, //HasPast
                                                 "");   //Past ID String

                //Other Features
                MasteryReplacementOub.InitDungeonHook();
                CadenceAndOxShopPoolAdditions.Init();
                CustomHuntingQuest.Init();

                //NPCS
                TheJammomaster.Add();
                //Carto.Add();
                ShrineFactory.PlaceBreachShrines();

                //Synergy Setup, Synergy Formes, Dual Wielding, and any changes to Basegame Guns
                InitialiseSynergies.DoInitialisation();
                SynergyFormInitialiser.AddSynergyForms();
                ExistantGunModifiers.Init();

                ChamberGunAPI.Init("OnceMoreIntoTheBreach");

                //Late Hooks
                AmmoPickupHooks.Init();
                HealthPickupHooks.Init();

                ETGModConsole.Commands.AddUnit("nndebugflow", (args) => { DungeonHandler.debugFlow = !DungeonHandler.debugFlow; string status = DungeonHandler.debugFlow ? "enabled" : "disabled"; string color = DungeonHandler.debugFlow ? "00FF00" : "FF0000"; ETGModConsole.Log($"OMITB flow {status}", false); });

                //PoopySchloopy

                /* Dungeon keepDungeon = DungeonDatabase.GetOrLoadByName("base_jungle");
                 * if (keepDungeon == null) ETGModConsole.Log("Jungle null!");
                 * if (keepDungeon && keepDungeon.PatternSettings != null)
                 * {
                 *   if (keepDungeon.PatternSettings.flows != null && keepDungeon.PatternSettings.flows.Count > 0)
                 *   {
                 *       if (keepDungeon.PatternSettings.flows[0].fallbackRoomTable)
                 *       {
                 *           if (keepDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms != null)
                 *           {
                 *               if (keepDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements != null)
                 *               {
                 *                   foreach (WeightedRoom wRoom in keepDungeon.PatternSettings.flows[0].fallbackRoomTable.includedRooms.elements)
                 *                   {
                 *
                 *                       if (wRoom.room != null && !string.IsNullOrEmpty(wRoom.room.name))
                 *                       {
                 *                           ETGModConsole.Log(wRoom.room.name);
                 *                       }
                 *                   }
                 *               }
                 *               else ETGModConsole.Log("No elements");
                 *           }
                 *           else ETGModConsole.Log("No included rooms");
                 *       }
                 *       else ETGModConsole.Log("No fallback room table");
                 *   }
                 *   else ETGModConsole.Log("Flow was null or empty");
                 * }
                 * else ETGModConsole.Log("Pattern settings null");
                 * keepDungeon = null;*/

                ETGMod.StartGlobalCoroutine(this.delayedstarthandler());
                ETGModConsole.Log("'If you're reading this, I must have done something right' - NN");
            }
            catch (Exception e)
            {
                ETGModConsole.Log(e.Message);
                ETGModConsole.Log(e.StackTrace);
            }
        }
コード例 #21
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Boltcaster", "nnboltcaster");

            Game.Items.Rename("outdated_gun_mods:boltcaster", "nn:boltcaster");
            var behav = gun.gameObject.AddComponent <Boltcaster>();

            gun.SetShortDescription("It Belongs In A Museum");
            gun.SetLongDescription("An old relic of one of the many rebel groups that have risen up against- and inevitably broken against the unshakeable Hegemony of Man." + "\n\nThe magnetic mass driver orbs give it the appearance of a crossbow.");
            behav.preventNormalFireAudio  = true;
            behav.overrideNormalFireAudio = "Play_WPN_plasmarifle_shot_01";

            gun.SetupSprite(null, "nnboltcaster_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.reloadAnimation, 0);

            gun.muzzleFlashEffects = VFXToolbox.CreateVFXPool("Boltcaster Muzzleflash",
                                                              new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/Boltcaster/boltcaster_muzzleflash_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/Boltcaster/boltcaster_muzzleflash_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/Boltcaster/boltcaster_muzzleflash_003",
            },
                                                              10,                               //FPS
                                                              new IntVector2(49, 26),           //Dimensions
                                                              tk2dBaseSprite.Anchor.MiddleLeft, //Anchor
                                                              false,                            //Uses a Z height off the ground
                                                              0,                                //The Z height, if used
                                                              false,
                                                              VFXAlignment.Fixed
                                                              );



            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.1f;
            gun.DefaultModule.cooldownTime        = 0.5f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.DefaultModule.angleVariance       = 0f;
            gun.SetBaseMaxAmmo(100);
            gun.gunClass = GunClass.RIFLE;
            gun.barrelOffset.transform.localPosition = new Vector3(27f / 16f, 7f / 16f, 0f);

            //BULLET STATS
            Projectile projectile = gun.DefaultModule.projectiles[0].gameObject.InstantiateAndFakeprefab().GetComponent <Projectile>();

            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 30f;
            projectile.baseData.speed       *= 3f;
            projectile.baseData.range       *= 3f;
            projectile.SetProjectileSpriteRight("boltcaster_proj", 23, 3, true, tk2dBaseSprite.Anchor.MiddleCenter, 13, 3);
            projectile.hitEffects            = (PickupObjectDatabase.GetById(543) as Gun).DefaultModule.projectiles[0].hitEffects;
            projectile.pierceMinorBreakables = true;
            projectile.baseData.force       *= 4f;

            gun.quality = PickupObject.ItemQuality.B;

            ETGMod.Databases.Items.Add(gun, null, "ANY");

            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.BOSSRUSH_HUNTER, true);
        }
コード例 #22
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Rebar Gun", "rebargun");

            Game.Items.Rename("outdated_gun_mods:rebar_gun", "nn:rebar_gun");
            gun.gameObject.AddComponent <RebarGun>();
            gun.SetShortDescription("Raising the Bar");
            gun.SetLongDescription("An incredibly satisfying piece of industrial machinery, designed specifically for killing adorable wildlife.");

            gun.SetupSprite(null, "rebargun_idle_001", 8);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(806) as Gun).gunSwitchGroup;

            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);

            //VFX
            List <string> RebarGunImpactVFX = new List <string>()
            {
                "NevernamedsItems/Resources/MiscVFX/GunVFX/RebarGunImpactVFX2_001",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/RebarGunImpactVFX2_002",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/RebarGunImpactVFX2_003",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/RebarGunImpactVFX2_004",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/RebarGunImpactVFX2_005",
                "NevernamedsItems/Resources/MiscVFX/GunVFX/RebarGunImpactVFX2_006",
            };
            VFXPool VFXOBj = VFXToolbox.CreateVFXPool("Rebar Gun Impact VFX", RebarGunImpactVFX, 16, new IntVector2(11, 8), tk2dBaseSprite.Anchor.MiddleLeft, false, 0, true);

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(12) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.21f;
            gun.DefaultModule.cooldownTime           = 0.3f;
            gun.DefaultModule.numberOfShotsInClip    = 3;
            gun.barrelOffset.transform.localPosition = new Vector3(1.5f, 0.87f, 0f);
            gun.SetBaseMaxAmmo(170);
            gun.gunClass = GunClass.PISTOL;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.SetProjectileSpriteRight("rebargun_proj", 20, 2, false, tk2dBaseSprite.Anchor.MiddleCenter, 6, 2);
            projectile.baseData.speed *= 4f;
            projectile.baseData.damage = 20f;
            projectile.baseData.force *= 5;
            projectile.hitEffects.deathTileMapHorizontal = VFXOBj;
            projectile.hitEffects.tileMapHorizontal      = VFXOBj;

            //Custom Clip VFX
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Rebar Shells", "NevernamedsItems/Resources/CustomGunAmmoTypes/rebargun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/rebargun_clipempty");

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            //gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.PURCHASED_BLASMASTER, true);

            RebarGunID = gun.PickupObjectId;
        }