Beispiel #1
0
        public static void Add()
        {
            //ammonomicon stuff
            Gun gun = ETGMod.Databases.Items.NewGun("Treasure Chest", "chest");

            Game.Items.Rename("outdated_gun_mods:treasure_chest", "ans:treasure_chest");

            gun.gameObject.AddComponent <TreasureChest>();
            gun.SetShortDescription("MONEY!");
            gun.SetLongDescription("the chest of moneybeard III. \n\n said to contain riches, but built so tough that almost anything it fell on would die...");
            gun.SetupSprite(null, "chest_idle_001", 10);

            //gun stats
            gun.SetAnimationFPS(gun.shootAnimation, 24);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0f;
            gun.DefaultModule.cooldownTime        = 0.25f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.quality            = PickupObject.ItemQuality.A;
            gun.gunHandedness      = GunHandedness.TwoHanded;
            gun.preventRotation    = true;
            gun.muzzleFlashEffects = null;
            gun.SetBaseMaxAmmo(1);
            gun.encounterTrackable.EncounterGuid = "spapi says we dont need these, but i say spapi cant tell me what to do";
            gun.carryPixelOffset      = new IntVector2(-4, 17);
            gun.barrelOffset.position = new Vector3(0, 0);
            gun.muzzleFlashEffects    = null;

            //projectile stuff.
            ProjectileModule.ChargeProjectile chargeProjectile = new ProjectileModule.ChargeProjectile
            {
                Projectile = Instantiate(gun.DefaultModule.projectiles[0]),
                ChargeTime = 1f,
            };

            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProjectile
            };
            chargeProjectile.Projectile.gameObject.SetActive(false);
            chargeproj = chargeProjectile;
            //gives the gun a looping charge anim.
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 0;

            FakePrefab.MarkAsFakePrefab(chargeProjectile.Projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(chargeProjectile.Projectile);
            chargeProjectile.Projectile.baseData.damage  = 300;
            chargeProjectile.Projectile.transform.parent = gun.barrelOffset;
            chargeProjectile.Projectile.baseData.range   = 100f;
            chargeProjectile.Projectile.baseData.speed   = 30f;
            chargeProjectile.Projectile.SetProjectileSpriteRight("chest_projectile_001", 30, 23);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Beispiel #2
0
        // Token: 0x0600013F RID: 319 RVA: 0x0000D468 File Offset: 0x0000B668
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Cube Of Tungsten", "tungstencube");

            Game.Items.Rename("outdated_gun_mods:cube_of_tungsten", "bny:cube_of_tungsten");
            gun.gameObject.AddComponent <TungstenCube>();
            GunExt.SetShortDescription(gun, "THE CUBE");
            GunExt.SetLongDescription(gun, "A large cube of tungsten, perfect for chucking at your enemies!");
            GunExt.SetupSprite(gun, null, "tungstencube_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 20);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 3);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 7);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(8) as Gun, true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.9f;
            gun.DefaultModule.cooldownTime              = 1f;
            gun.DefaultModule.numberOfShotsInClip       = 1;
            gun.DefaultModule.preventFiringDuringCharge = true;
            gun.SetBaseMaxAmmo(200);
            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE ";
            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile();
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item
            };
            gun.DefaultModule.chargeProjectiles[0].ChargeTime     = 0.9f;
            gun.DefaultModule.chargeProjectiles[0].UsedProperties = ((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].UsedProperties;
            gun.DefaultModule.chargeProjectiles[0].VfxPool        = ((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].VfxPool;
            gun.DefaultModule.chargeProjectiles[0].VfxPool.type   = ((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].VfxPool.type;
            ProjectileModule.ChargeProjectile chargeProjectile = gun.DefaultModule.chargeProjectiles[0];
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].Projectile);

            chargeProjectile.Projectile = projectile;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 3;
            projectile.transform.parent = gun.barrelOffset;
            projectile.baseData.damage  = 30f;
            projectile.baseData.range   = 50f;
            projectile.baseData.force   = 350f;
            projectile.shouldRotate     = true;
            BounceProjModifier bouncy = projectile.gameObject.AddComponent <BounceProjModifier>();

            bouncy.numberOfBounces = 0;
            PierceProjModifier spook = projectile.gameObject.AddComponent <PierceProjModifier>();

            spook.penetration = 1;
            projectile.SetProjectileSpriteRight("tungstencube_projectile_001", 17, 16, true, tk2dBaseSprite.Anchor.MiddleCenter, new int?(11), new int?(5), null, null, null);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc, 1f);
            gun.AddToSubShop(ItemBuilder.ShopType.Cursula, 1f);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        // Token: 0x0600028C RID: 652 RVA: 0x000162F8 File Offset: 0x000144F8
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("HONK", "horn");

            Game.Items.Rename("outdated_gun_mods:honk", "cak:honk");
            GunExt.SetShortDescription(gun, "Prince Charming");
            GunExt.SetLongDescription(gun, "Wielded by a legendary ringmaster at one point, it was lost in the gungeon and it's magicks shifted into a violate weapon.");
            GunExt.SetupSprite(gun, null, "horn_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 6);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(15) as Gun, true, false);

            foreach (ProjectileModule projectileModule in gun.Volley.projectiles)
            {
                projectileModule.ammoCost            = 1;
                projectileModule.shootStyle          = ProjectileModule.ShootStyle.Charged;
                projectileModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                projectileModule.cooldownTime        = 1f;
                projectileModule.angleVariance       = 20f;
                projectileModule.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(projectileModule.projectiles[0]);
                projectileModule.projectiles[0] = projectile;
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage           *= 10f;
                projectile.AdditionalScaleMultiplier *= 2f;
                projectile.baseData.range            *= 0.5f;
                bool flag = projectileModule != gun.DefaultModule;
                if (flag)
                {
                    projectileModule.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
                ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f
                };
                PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                orAddComponent.penetratesBreakables = true;
                orAddComponent.penetration++;
                projectileModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
                {
                    item
                };
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(100);
            gun.quality = PickupObject.ItemQuality.B;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 3;
            gun.encounterTrackable.EncounterGuid = "HONKERWONK";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.37f, 0f);
            Horn.HornID = gun.PickupObjectId;
        }
        // Token: 0x0600013F RID: 319 RVA: 0x0000D468 File Offset: 0x0000B668
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Hammer Of The Moon", "lunarhammer");

            Game.Items.Rename("outdated_gun_mods:hammer_of_the_moon", "bny:hammer_of_the_moon");
            gun.gameObject.AddComponent <MithrixHammer>();
            GunExt.SetShortDescription(gun, "Commencement");
            GunExt.SetLongDescription(gun, "You're Gonna Need A Bigger Hammer.");
            GunExt.SetupSprite(gun, null, "lunarhammer_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 20);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 8);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 7);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(481) as Gun, true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 3.5f;
            gun.DefaultModule.cooldownTime              = 1f;
            gun.carryPixelOffset                        = new IntVector2((int)-2f, (int)-1f);
            gun.DefaultModule.numberOfShotsInClip       = 1;
            gun.DefaultModule.preventFiringDuringCharge = true;
            gun.SetBaseMaxAmmo(40);
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "The Big Ukulele";
            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile();
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item
            };
            gun.DefaultModule.chargeProjectiles[0].ChargeTime     = 1.25f;
            gun.DefaultModule.chargeProjectiles[0].UsedProperties = ((Gun)ETGMod.Databases.Items[481]).DefaultModule.chargeProjectiles[0].UsedProperties;
            gun.DefaultModule.chargeProjectiles[0].VfxPool        = ((Gun)ETGMod.Databases.Items[481]).DefaultModule.chargeProjectiles[0].VfxPool;
            gun.DefaultModule.chargeProjectiles[0].VfxPool.type   = ((Gun)ETGMod.Databases.Items[481]).DefaultModule.chargeProjectiles[0].VfxPool.type;
            MithRixOnReloadModifier mithRixOnReloadModifier = gun.gameObject.AddComponent <MithRixOnReloadModifier>();

            ProjectileModule.ChargeProjectile chargeProjectile = gun.DefaultModule.chargeProjectiles[0];
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(((Gun)ETGMod.Databases.Items[481]).DefaultModule.chargeProjectiles[0].Projectile);

            chargeProjectile.Projectile = projectile;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 5;
            projectile.transform.parent = gun.barrelOffset;
            projectile.baseData.damage  = 0f;
            projectile.baseData.range   = 0f;
            projectile.baseData.force   = 350f;
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc, 1f);
            gun.AddToSubShop(ItemBuilder.ShopType.Cursula, 1f);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.EXAMPLE_BLUEPRINTBEETLEE, true);
            gun.AddItemToDougMetaShop(1000, null);
        }
Beispiel #5
0
        public static void GunAttackHook(Action <Gun, ProjectileModule, ProjectileData, GameObject> orig, Gun self, ProjectileModule mod, ProjectileData data = null, GameObject overrideObject = null)
        {
            try
            {
                orig(self, mod, data, overrideObject);
                if (self != null && mod != null && self.GunPlayerOwner())
                {
                    if (self.GunPlayerOwner().HasPickupID(BombardierShellsID))
                    {
                        float knockbackAmt = 40f;
                        float projDamage   = 10;

                        Dictionary <ProjectileModule, ModuleShootData> moduleData = OMITBReflectionHelpers.ReflectGetField <Dictionary <ProjectileModule, ModuleShootData> >(typeof(Gun), "m_moduleData", self);

                        if (overrideObject)
                        {
                            Projectile projectile = overrideObject.GetComponent <Projectile>();
                            projDamage = projectile.baseData.damage;
                        }
                        else if (mod.shootStyle == ProjectileModule.ShootStyle.Charged && moduleData != null)
                        {
                            ProjectileModule.ChargeProjectile chargeProjectile = mod.GetChargeProjectile(moduleData[mod].chargeTime);
                            if (chargeProjectile != null)
                            {
                                Projectile projectile = chargeProjectile.Projectile;
                                projDamage = projectile.baseData.damage;
                            }
                        }
                        else
                        {
                            Projectile projectile = mod.GetCurrentProjectile(moduleData[mod], self.GunPlayerOwner());
                            projDamage = projectile.baseData.damage;
                        }

                        float multiplier = projDamage / 10;
                        knockbackAmt *= multiplier;
                        knockbackAmt  = Mathf.Min(100, knockbackAmt);

                        if (self.GunPlayerOwner().PlayerHasActiveSynergy("Forward Thinking"))
                        {
                            knockbackAmt *= -0.5f;
                        }
                        self.GunPlayerOwner().knockbackDoer.ApplyKnockback((self.GunPlayerOwner().sprite.WorldCenter - self.GunPlayerOwner().unadjustedAimPoint.XY()).normalized, knockbackAmt);
                    }
                }
            }
            catch (Exception e)
            {
                ETGModConsole.Log(e.Message);
                ETGModConsole.Log(e.StackTrace);
            }
        }
        // Token: 0x0600013F RID: 319 RVA: 0x0000D468 File Offset: 0x0000B668
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Artemis", "artemissile");

            Game.Items.Rename("outdated_gun_mods:artemis", "bny:artemis");
            gun.gameObject.AddComponent <ArtemissileRocket>();
            GunExt.SetShortDescription(gun, "Not To Be Confused With Leto");
            GunExt.SetLongDescription(gun, "A large ship-mounted missile launcher. Originally fitted with an auto-charger, the user now has to charge it manually for it to fire.");
            GunExt.SetupSprite(gun, null, "artemissile_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 20);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 2);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 1);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(384) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2.2f;
            gun.DefaultModule.cooldownTime        = 1f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.SetBaseMaxAmmo(60);

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 4;
            gun.encounterTrackable.EncounterGuid = "da beeg gun da shoota da beeg rocket";
            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.damage       = 70f;
            projectile.baseData.speed       *= 1.8f;
            projectile.baseData.range       *= 100f;
            projectile.SetProjectileSpriteRight("artemissile_projectile_001", 17, 6, true, tk2dBaseSprite.Anchor.MiddleCenter, 15, 4);
            projectile.shouldRotate = true;
            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 4f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc, 1f);
        }
Beispiel #7
0
        // Token: 0x0600013F RID: 319 RVA: 0x0000D468 File Offset: 0x0000B668
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Cube Of Tungsten", "tungstencube");

            Game.Items.Rename("outdated_gun_mods:cube_of_tungsten", "bny:cube_of_tungsten");
            gun.gameObject.AddComponent <TungstenCube>();
            GunExt.SetShortDescription(gun, "THE CUBE");
            GunExt.SetLongDescription(gun, "A large cube of tungsten, perfect for chucking at your enemies!");
            GunExt.SetupSprite(gun, null, "tungstencube_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 9);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 6);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 4);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            //gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(384) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.9f;
            gun.DefaultModule.cooldownTime        = 1f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.SetBaseMaxAmmo(200);

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

            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.damage       = 30f;
            projectile.baseData.speed       *= 1.3f;
            projectile.baseData.range       *= 100f;
            projectile.SetProjectileSpriteRight("tungstencube_projectile_001", 17, 18, true, tk2dBaseSprite.Anchor.MiddleCenter, 15, 16);
            projectile.shouldRotate = true;
            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0.9f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.quality = PickupObject.ItemQuality.C;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        private void DoChanceBulletsEffect(Projectile source)
        {
            PlayerController m_player = source.ProjectilePlayerOwner();

            if (m_player && m_player.inventory != null)
            {
                for (int j = 0; j < m_player.inventory.AllGuns.Count; j++)
                {
                    if (m_player.inventory.AllGuns[j] && !m_player.inventory.AllGuns[j].InfiniteAmmo)
                    {
                        Gun cg2 = m_player.inventory.AllGuns[j];

                        ProjectileModule defaultModule = m_player.inventory.AllGuns[j].DefaultModule;
                        if (defaultModule.shootStyle == ProjectileModule.ShootStyle.Beam)
                        {
                            BeamController.FreeFireBeam(defaultModule.GetCurrentProjectile(), m_player, m_player.CurrentGun.CurrentAngle, 3f, true);
                        }
                        else if (defaultModule.shootStyle == ProjectileModule.ShootStyle.Charged)
                        {
                            Projectile projectile = null;
                            for (int k = 0; k < 15; k++)
                            {
                                ProjectileModule.ChargeProjectile chargeProjectile = defaultModule.chargeProjectiles[UnityEngine.Random.Range(0, defaultModule.chargeProjectiles.Count)];
                                if (chargeProjectile != null)
                                {
                                    projectile = chargeProjectile.Projectile;
                                }
                                if (projectile)
                                {
                                    break;
                                }
                            }
                            if (projectile != null)
                            {
                                StartCoroutine(EraseAndReplace(source, projectile));
                            }
                        }
                        Projectile currentProjectile = defaultModule.GetCurrentProjectile();
                        if (currentProjectile != null)
                        {
                            StartCoroutine(EraseAndReplace(source, currentProjectile));
                        }
                    }
                }
            }
        }
Beispiel #9
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Tau Cannon", "taucannon");

            Game.Items.Rename("outdated_gun_mods:tau_cannon", "nn:tau_cannon");
            gun.gameObject.AddComponent <TauCannon>();
            gun.SetShortDescription("Questionable Ethics");
            gun.SetLongDescription("An ingenious way devised by scientists in the field of materials handling to dispose of spent uranium." + "\n\nWill violently overcharge if powered up for too long.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 15);
            gun.SetAnimationFPS(gun.chargeAnimation, 6);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(593) as Gun).gunSwitchGroup;
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);

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

            //GUN STATS
            gun.doesScreenShake             = true;
            gun.gunScreenShake              = (PickupObjectDatabase.GetById(37) as Gun).gunScreenShake;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime                           = 1f;
            gun.muzzleFlashEffects                   = (PickupObjectDatabase.GetById(5) as Gun).muzzleFlashEffects;
            gun.DefaultModule.angleVariance          = 2f;
            gun.DefaultModule.cooldownTime           = 0.2f;
            gun.DefaultModule.numberOfShotsInClip    = -1;
            gun.barrelOffset.transform.localPosition = new Vector3(3.18f, 0.75f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo     = 100;
            gun.gunClass = GunClass.CHARGE;
            //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                   = 15;
            projectile.baseData.speed                    = 50;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.YellowLaserCircleVFX;
            projectile.SetProjectileSpriteRight("tau_projectile1", 4, 2, false, tk2dBaseSprite.Anchor.MiddleCenter, 4, 2);
            EasyTrailBullet trail1 = projectile.gameObject.AddComponent <EasyTrailBullet>();

            trail1.TrailPos   = projectile.transform.position;
            trail1.StartWidth = 0.12f;
            trail1.EndWidth   = 0.12f;
            trail1.LifeTime   = 100f;
            trail1.BaseColor  = ExtendedColours.honeyYellow;
            trail1.EndColor   = ExtendedColours.honeyYellow;

            //CHARGE BULLET STATS
            Projectile chargeprojectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);

            chargeprojectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(chargeprojectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(chargeprojectile);
            chargeprojectile.baseData.speed                    = 50;
            chargeprojectile.baseData.damage                   = 25;
            chargeprojectile.baseData.force                   *= 2;
            chargeprojectile.hitEffects.alwaysUseMidair        = true;
            chargeprojectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.YellowLaserCircleVFX;
            chargeprojectile.SetProjectileSpriteRight("tau_projectile2", 4, 2, false, tk2dBaseSprite.Anchor.MiddleCenter, 4, 2);
            EasyTrailBullet trail2 = chargeprojectile.gameObject.AddComponent <EasyTrailBullet>();

            trail2.TrailPos   = chargeprojectile.transform.position;
            trail2.StartWidth = 0.12f;
            trail2.EndWidth   = 0.12f;
            trail2.LifeTime   = 100f;
            trail2.BaseColor  = ExtendedColours.paleYellow;
            trail2.EndColor   = ExtendedColours.paleYellow;

            //Charge 2
            Projectile chargeprojectile2 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);

            chargeprojectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(chargeprojectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(chargeprojectile2);
            chargeprojectile2.baseData.speed                    = 50;
            chargeprojectile2.baseData.force                   *= 10;
            chargeprojectile2.baseData.damage                   = 50;
            chargeprojectile2.hitEffects.alwaysUseMidair        = true;
            chargeprojectile2.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.YellowLaserCircleVFX;
            chargeprojectile2.SetProjectileSpriteRight("tau_projectile3", 4, 2, false, tk2dBaseSprite.Anchor.MiddleCenter, 4, 2);
            EasyTrailBullet trail3 = chargeprojectile2.gameObject.AddComponent <EasyTrailBullet>();

            trail3.TrailPos   = chargeprojectile2.transform.position;
            trail3.StartWidth = 0.12f;
            trail3.EndWidth   = 0.12f;
            trail3.LifeTime   = 100f;
            trail3.BaseColor  = Color.white;
            trail3.EndColor   = Color.white;

            ProjectileModule.ChargeProjectile chargeProj1 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0f,
                VfxPool    = null,
            };
            ProjectileModule.ChargeProjectile chargeProj2 = new ProjectileModule.ChargeProjectile
            {
                Projectile = chargeprojectile,
                ChargeTime = 1f,
            };
            ProjectileModule.ChargeProjectile chargeProj3 = new ProjectileModule.ChargeProjectile
            {
                Projectile = chargeprojectile2,
                ChargeTime = 2f,
            };

            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj1, chargeProj2, chargeProj3
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("TauCannon Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/taucannon_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/taucannon_clipempty");

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            TauCannonID = gun.PickupObjectId;
        }
Beispiel #10
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Anchor", "Anchor");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:anchor", "bripack:anchor");
            gun.gameObject.AddComponent <Anchor>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Careful not to take off");
            gun.SetLongDescription("This anchor was once the most valuable relic in Helicopter-Beard's collection. It would still be his, but he was disqualified for too much flight.");
            // This is required, unless you want to use the sprites of the base gun.
            // That, by default, is the pea shooter.
            // SetupSprite sets up the default gun sprite for the ammonomicon and the "gun get" popup.
            // WARNING: Add a copy of your default sprite to Ammonomicon Encounter Icon Collection!
            // That means, "sprites/Ammonomicon Encounter Icon Collection/defaultsprite.png" in your mod .zip. You can see an example of this with inside the mod folder.
            gun.SetupSprite(null, "Anchor_idle_001", 8);
            // ETGMod automatically checks which animations are available.
            // The numbers next to "shootAnimation" determine the animation fps. You can also tweak the animation fps of the reload animation and idle animation using this method.
            gun.SetAnimationFPS(gun.shootAnimation, 3);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);
            gun.SetAnimationFPS(gun.idleAnimation, 60); // usually 3
            // Every modded gun has base projectile it works with that is borrowed from other guns in the game.
            // The gun names are the names from the JSON dump! While most are the same, some guns named completely different things. If you need help finding gun names, ask a modder on the Gungeon discord.
            //gun.AddProjectileModuleFrom("ak-47", true, false);

            // Projectiles:

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            // Here we just take the default projectile module and change its settings how we want it to be.
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 5.1f;
            gun.DefaultModule.cooldownTime        = 0.1f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.SetBaseMaxAmmo(15);
            // Here we just set the quality of the gun and the "EncounterGuid", which is used by Gungeon to identify the gun.
            gun.quality = PickupObject.ItemQuality.A;
            gun.encounterTrackable.EncounterGuid = "change this for different guns, so the game doesn't think they're the same gun";
            //This block of code helps clone our projectile. Basically it makes it so things like Shadow Clone and Hip Holster keep the stats/sprite of your custom gun's projectiles.
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

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

            pierce.penetration = 100;

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            //projectile.baseData allows you to modify the base properties of your projectile module.
            //In our case, our gun uses modified projectiles from the ak-47.
            //You can modify a good number of stats but for now, let's just modify the damage and speed.
            projectile.baseData.damage       = 150f;
            projectile.baseData.speed        = 15.0f;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.baseData.force        = 50;
            projectile.BossDamageMultiplier  = 2.5f;
            projectile.ignoreDamageCaps      = true;
            projectile.pierceMinorBreakables = true;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "shovel";

            //This determines what sprite you want your projectile to use. Note this isn't necessary if you don't want to have a custom projectile sprite.
            //The x and y values determine the size of your custom projectile
            projectile.SetProjectileSpriteRight("Anchor_projectile_001", 25, 25, null, null);
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            // Charge Shot Code
            // This code did not actually get implemented, I'm just scared to get rid of it

            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(125) as Gun).DefaultModule.projectiles[0]),
                ChargeTime = 1f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            ProjectileModule.ChargeProjectile chargeProjectile = new ProjectileModule.ChargeProjectile();
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                chargeProjectile,
            };
            gun.DefaultModule.chargeProjectiles[0].ChargeTime     = 2f;
            gun.DefaultModule.chargeProjectiles[0].UsedProperties = ((Gun)global::ETGMod.Databases.Items[541]).DefaultModule.chargeProjectiles[0].UsedProperties;
            gun.DefaultModule.chargeProjectiles[0].VfxPool        = ((Gun)global::ETGMod.Databases.Items[541]).DefaultModule.chargeProjectiles[0].VfxPool;
            gun.DefaultModule.chargeProjectiles[0].VfxPool.type   = ((Gun)global::ETGMod.Databases.Items[541]).DefaultModule.chargeProjectiles[0].VfxPool.type;
            chargeProjectile.Projectile = UnityEngine.Object.Instantiate <Projectile>(((Gun)global::ETGMod.Databases.Items[541]).DefaultModule.chargeProjectiles[0].Projectile);
            chargeProjectile.Projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(chargeProjectile.Projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(chargeProjectile.Projectile);
            gun.barrelOffset.localPosition += new Vector3(1, 0f, 0f);
            chargeProjectile.Projectile.transform.parent = gun.barrelOffset;
            chargeProjectile.Projectile.baseData.range   = 100f;
            //chargeProjectile.Projectile.gameObject.AddComponent<Anchor/*An3s said deleted this*/>();
            chargeProjectile.Projectile.baseData.speed           *= 2f;
            chargeProjectile.Projectile.AdditionalScaleMultiplier = 2f;
            // I added this
            // chargeProjectile.SetProjectileSpriteRight("Anchor_projectile_001", 25, 25, null, null);

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


            // synergies :
            // Didn't implement these, thing is weird

            // Glacier: adds large explosion at end

            // Macho Brace, protein pill: Reload speed halved (make sure to change framerate)

            // Ghost bullets, zombie bullets: ghost ship, makes projectile glow, summons explosions on top of hit enemy
        }
Beispiel #11
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Galaxy Crusher", "galaxycrusher");

            Game.Items.Rename("outdated_gun_mods:galaxy_crusher", "nn:galaxy_crusher");

            var behav = gun.gameObject.AddComponent <GalaxyCrusher>();

            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalReloadAudio = "Play_ENV_water_splash_01";
            gun.SetShortDescription("Cosmic Crunch");
            gun.SetLongDescription("Tears apart the fabric of space time and good game design, allowing for ridiculous gun effects and fourth wall breaking Ammonomicon descriptions.");

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

            gun.SetAnimationFPS(gun.chargeAnimation, 13);

            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 9);

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

            //GUN STATS

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_WPN_blackhole_shot_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].eventAudio   = "Play_WPN_blackhole_charge_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].triggerEvent = true;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[22].eventAudio   = "Play_WPN_stdissuelaser_shot_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[22].triggerEvent = true;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[24].eventAudio   = "Play_WPN_stdissuelaser_shot_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[24].triggerEvent = true;

            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(228) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2f;
            gun.DefaultModule.cooldownTime           = 0.5f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(4.18f, 1.56f, 0f);
            gun.SetBaseMaxAmmo(10);
            gun.gunClass = GunClass.CHARGE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 21;

            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(169) as Gun).DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0]     = projectile;
            projectile.baseData.damage           = 20f;
            projectile.baseData.speed           *= 10f;
            projectile.AdditionalScaleMultiplier = 2f;

            //SmallerHole
            Projectile smallhole = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(169) as Gun).DefaultModule.projectiles[0]);

            smallhole.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(smallhole.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(smallhole);
            gun.DefaultModule.projectiles[0]    = smallhole;
            smallhole.baseData.damage           = 5f;
            smallhole.baseData.speed            = 5f;
            smallhole.AdditionalScaleMultiplier = 0.9f;
            BounceProjModifier bounce = smallhole.gameObject.AddComponent <BounceProjModifier>();

            bounce.numberOfBounces = 1;
            EasyTrailBullet trail4 = smallhole.gameObject.AddComponent <EasyTrailBullet>();

            trail4.TrailPos   = smallhole.transform.position;
            trail4.StartWidth = 1.56f;
            trail4.EndWidth   = 0f;
            trail4.LifeTime   = 1.5f;
            trail4.BaseColor  = Color.black;
            trail4.EndColor   = Color.black;

            SpawnProjModifier spawn = projectile.gameObject.AddComponent <SpawnProjModifier>();

            spawn.spawnProjecitlesOnDieInAir        = true;
            spawn.spawnProjectilesOnCollision       = true;
            spawn.spawnProjectilesInFlight          = false;
            spawn.spawnOnObjectCollisions           = true;
            spawn.collisionSpawnStyle               = SpawnProjModifier.CollisionSpawnStyle.RADIAL;
            spawn.numberToSpawnOnCollison           = 30;
            spawn.PostprocessSpawnedProjectiles     = true;
            spawn.projectileToSpawnOnCollision      = smallhole;
            spawn.spawnCollisionProjectilesOnBounce = false;


            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 2f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "black_hole";

            // Here we just set the quality of the gun and the "EncounterGuid", which is used by Gungeon to identify the gun.
            gun.quality = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            ID = gun.PickupObjectId;
        }
        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;
        }
Beispiel #13
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Catalyzer", "Cat");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:catalyzer", "ski:catalyzer");
            gun.gameObject.AddComponent <Catalyzer>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Activation Energy Required");

            gun.SetLongDescription("This Gun's bullets are made of chemicals on the brink of a reaction.\n\n" +
                                   "They are brimming with terrifying potential. Only the charge shot of the gun holds enough potential to catalyze the reaction of all the cations nearby.\n\n\n - Knife_to_a_Gunfight");
            // This is required, unless you want to use the sprites of the base gun.
            // That, by default, is the pea shooter.
            // SetupSprite sets up the default gun sprite for the ammonomicon and the "gun get" popup.
            // WARNING: Add a copy of your default sprite to Ammonomicon Encounter Icon Collection!
            // That means, "sprites/Ammonomicon Encounter Icon Collection/defaultsprite.png" in your mod .zip. You can see an example of this with inside the mod folder.
            gun.SetupSprite(null, "Cat_idle_001", 8);

            // ETGMod automatically checks which animations are available.
            // The numbers next to "shootAnimation" determine the animation fps. You can also tweak the animation fps of the reload animation and idle animation using this method.
            gun.SetAnimationFPS(gun.shootAnimation, 48);
            gun.SetAnimationFPS(gun.reloadAnimation, 14);
            gun.SetAnimationFPS(gun.chargeAnimation, 12);

            // Every modded gun has base projectile it works with that is borrowed from other guns in the game.
            // The gun names are the names from the JSON dump! While most are the same, some guns named completely different things. If you need help finding gun names, ask a modder on the Gungeon discord.
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetByEncounterName("Pea Shooter") as Gun, true, false);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 4;

            // Here we just take the default projectile module and change its settings how we want it to be.
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.OneHanded;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = .5f;

            gun.DefaultModule.cooldownTime        = .2f;
            gun.DefaultModule.numberOfShotsInClip = 3;
            gun.SetBaseMaxAmmo(350);
            gun.barrelOffset.transform.localPosition = new Vector3(1f, .5f, 0f);
            gun.quality = PickupObject.ItemQuality.A;
            gun.encounterTrackable.EncounterGuid = "One Herring Twitch! And Kableewy!";
            gun.muzzleFlashEffects     = null;
            gun.PreventNormalFireAudio = true;
            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.damage       = 1f;
            projectile.baseData.speed        = 8f;
            projectile.baseData.range        = 4000f;
            projectile.SetProjectileSpriteRight("cation", 30, 30, false, tk2dBaseSprite.Anchor.MiddleCenter, 30, 30);
            projectile.AdditionalScaleMultiplier = .35f;
            projectile.angularVelocity           = 500;
            projectile.transform.parent          = gun.barrelOffset;
            PierceProjModifier stab = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            stab.penetration = 200;

            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            gun.DefaultModule.projectiles[0] = projectile2;
            projectile2.baseData.damage      = 5f;
            projectile2.baseData.speed       = 10f;
            projectile2.baseData.range       = 25f;
            projectile2.SetProjectileSpriteRight("plasma", 42, 42, false, tk2dBaseSprite.Anchor.MiddleCenter, 40, 40);
            projectile2.angularVelocity           = 500;
            projectile2.AdditionalScaleMultiplier = .7f;

            projectile2.transform.parent = gun.barrelOffset;

            Gun gun2 = (Gun)PickupObjectDatabase.GetByEncounterName("Mine Cutter");

            gun.muzzleFlashEffects     = gun2.muzzleFlashEffects;
            gun.PreventNormalFireAudio = true;

            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0f
            };
            ProjectileModule.ChargeProjectile item2 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile2,
                ChargeTime = .4f
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item,
                item2
            };


            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Greek Fire", "greekfire");

            Game.Items.Rename("outdated_gun_mods:greek_fire", "nn:greek_fire");
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup;
            gun.SetShortDescription("Fire of Man");
            gun.SetLongDescription("Used by ancient civilisations as a primitive flamethrower." + "\n\nThe potent chemical mixture used to create the flames makes it remarkably dangerous.");
            gun.SetupSprite(null, "greekfire_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.chargeAnimation, 3);

            for (int i = 0; i < 4; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(698) as Gun, true, false);
            }

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 1f;
                mod.angleVariance       = 20f;
                mod.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                mod.projectiles[0] = projectile;
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage           *= 5f;
                projectile.AdditionalScaleMultiplier *= 2f;
                projectile.baseData.range            *= 0.5f;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
                PrefabStatusEffectsToApply statusE = projectile.gameObject.AddComponent <PrefabStatusEffectsToApply>();
                statusE.effects = new List <GameActorEffect>()
                {
                    StaticStatusEffects.greenFireEffect
                };
                if (projectile.gameObject.GetComponent <GoopModifier>())
                {
                    Destroy(projectile.gameObject.GetComponent <GoopModifier>());
                }
                GoopModifier goopSpawned = projectile.gameObject.AddComponent <GoopModifier>();
                goopSpawned.SpawnGoopOnCollision   = true;
                goopSpawned.InFlightSpawnFrequency = 0.05f;
                goopSpawned.InFlightSpawnRadius    = 0.5f;
                goopSpawned.SpawnGoopInFlight      = true;
                goopSpawned.CollisionSpawnRadius   = 3f;
                goopSpawned.goopDefinition         = EasyGoopDefinitions.GreenFireDef;
                PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                orAddComponent.penetratesBreakables = true;
                orAddComponent.penetration++;
                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f,
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(65);
            gun.quality  = PickupObject.ItemQuality.B;
            gun.gunClass = GunClass.FIRE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 1;

            gun.encounterTrackable.EncounterGuid = "this is Greek Fire";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.37f, 0f);
            GreekFireID = gun.PickupObjectId;
        }
Beispiel #15
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Mini Monger", "minimonger");

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

            behav.preventNormalFireAudio    = true;
            behav.overrideNormalFireAudio   = "Play_ENM_demonwall_barf_01";
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalReloadAudio = "Play_ENM_demonwall_intro_01";
            gun.SetShortDescription("Great Wall");
            gun.SetLongDescription("A scale model of the fearsome Wallmonger, used as a mock-up during it's original construction." + "\n\nWhile the Wallmonger contains hundreds of tortured souls, this only contains two or three.");
            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);
            gun.SetupSprite(null, "minimonger_idle_001", 8);


            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_ENM_demonwall_barf_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.chargeAnimation, 5);

            for (int i = 0; i < 5; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 2f;
                mod.angleVariance       = 15f;
                mod.numberOfShotsInClip = 4;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                mod.projectiles[0] = projectile;
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.speed  *= 0.5f;
                projectile.baseData.damage *= 1.6f;
                AutoDoShadowChainOnSpawn chain = projectile.gameObject.GetOrAddComponent <AutoDoShadowChainOnSpawn>();
                chain.NumberInChain = 5;
                chain.pauseLength   = 0.1f;
                projectile.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);

                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f,
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
            }
            gun.reloadTime = 2f;
            gun.SetBaseMaxAmmo(50);
            gun.gunClass = GunClass.SHOTGUN;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 3;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "Punishment Ray Lasers";

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            MiniMongerID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ghost Blade", "ghostblade");

            Game.Items.Rename("outdated_gun_mods:ghost_blade", "nn:bullet_blade+ghost_sword");
            var behav = gun.gameObject.AddComponent <BulletBladeGhostForme>();

            behav.preventNormalFireAudio   = true;
            behav.preventNormalReloadAudio = true;
            //behav.overrideNormalFireAudio = "Play_OBJ_gate_slam_01";//"Play_ENM_gunnut_swing_01";

            gun.SetShortDescription("Forged of Pure Bullet");
            gun.SetLongDescription("The hefty blade of the fearsome armoured sentinels that tread the Gungeon's Halls." + "\n\nHas claimed the life of many a careless gungeoneer with it's wide spread.");
            gun.SetupSprite(null, "ghostblade_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.chargeAnimation, 6);

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_ENM_gunnut_shockwave_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            //BURST SHOT
            BurstShot = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);
            BurstShot.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(BurstShot.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(BurstShot);
            BurstShot.baseData.damage *= 1.6f;
            BurstShot.baseData.speed  *= 0.8f;
            BurstShot.SetProjectileSpriteRight("green_enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);



            for (int i = 0; i < 46; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }

            gun.DefaultModule.ammoCost            = 1;
            gun.DefaultModule.angleVariance       = 1;
            gun.DefaultModule.cooldownTime        = 2.5f;
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.numberOfShotsInClip = 1;
            Projectile bigProjectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            gun.DefaultModule.projectiles[0] = bigProjectile;
            bigProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bigProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bigProjectile);
            bigProjectile.baseData.damage *= 4;
            SpawnProjModifier radialBurst = bigProjectile.gameObject.AddComponent <SpawnProjModifier>();

            radialBurst.spawnProjectilesInFlight      = false;
            radialBurst.spawnProjectilesOnCollision   = true;
            radialBurst.spawnProjecitlesOnDieInAir    = true;
            radialBurst.spawnOnObjectCollisions       = true;
            radialBurst.collisionSpawnStyle           = SpawnProjModifier.CollisionSpawnStyle.RADIAL;
            radialBurst.numberToSpawnOnCollison       = 30;
            radialBurst.randomRadialStartAngle        = true;
            radialBurst.PostprocessSpawnedProjectiles = true;
            radialBurst.projectileToSpawnOnCollision  = BurstShot;

            bigProjectile.SetProjectileSpriteRight("large_green_enemystyle_projectile", 18, 18, true, tk2dBaseSprite.Anchor.MiddleCenter, 16, 16);

            ProjectileModule.ChargeProjectile bigchargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = bigProjectile,
                ChargeTime = 1f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                bigchargeProj
            };


            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost            = 1;
                    mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                    mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                    mod.cooldownTime        = 2.5f;
                    mod.angleVariance       = 70f;
                    mod.numberOfShotsInClip = 1;
                    Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                    mod.projectiles[0] = projectile;
                    projectile.gameObject.SetActive(false);
                    FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                    UnityEngine.Object.DontDestroyOnLoad(projectile);
                    projectile.baseData.damage *= 1.6f;
                    projectile.baseData.speed  *= 0.6f;
                    projectile.baseData.range  *= 1f;
                    projectile.SetProjectileSpriteRight("green_enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);
                    if (mod != gun.DefaultModule)
                    {
                        mod.ammoCost = 0;
                    }
                    projectile.transform.parent = gun.barrelOffset;

                    ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                    {
                        Projectile = projectile,
                        ChargeTime = 1f,
                    };
                    mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                        chargeProj
                    };
                }
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(50);
            gun.quality = PickupObject.ItemQuality.EXCLUDED;

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


            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(3.18f, 2.0f, 0f);
            GhostBladeID = gun.PickupObjectId;
        }
Beispiel #17
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ice Bow", "icebow");

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

            gun.SetShortDescription("Arctery");
            gun.SetLongDescription("Freezes enemies." + "\n\nFerried to the Gungeon from a remote island on the edge of civilisation.");

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

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(12) as Gun, true, false);
            gun.SetAnimationFPS(gun.chargeAnimation, 3);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(8) as Gun).gunSwitchGroup;
            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 1f;
            gun.DefaultModule.angleVariance          = 0;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(0.81f, 0.81f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo = 100;

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

            gun.carryPixelOffset = new IntVector2(10, 0);
            gun.gunClass         = GunClass.ICE;
            //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   = 17f;
            projectile.baseData.speed    = 35f;
            projectile.baseData.range   *= 2f;
            projectile.AppliesFreeze     = true;
            projectile.FreezeApplyChance = 1;
            projectile.freezeEffect      = StaticStatusEffects.chaosBulletsFreeze;
            PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            pierce.penetration++;
            pierce.penetratesBreakables = true;
            projectile.SetProjectileSpriteRight("icebow_projectile", 15, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 14, 4);

            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 1,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Ice Bow Arrows", "NevernamedsItems/Resources/CustomGunAmmoTypes/icebow_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/icebow_clipempty");

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            IceBowID = gun.PickupObjectId;
        }
Beispiel #18
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Nen Fist", "nen_fist");

            Game.Items.Rename("outdated_gun_mods:nen_fist", "cel:nen_fist");
            gun.gameObject.AddComponent <NenFist>();
            gun.SetShortDescription("Hunted");
            gun.SetLongDescription("Cycles between a long range fireball, a medium range energy spear, and a powerful dash with each shot.");
            gun.SetupSprite(null, "nen_fist_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 24);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = .8f;
            gun.DefaultModule.cooldownTime        = .2f;
            gun.DefaultModule.numberOfShotsInClip = 5;
            gun.gunClass      = GunClass.FIRE;
            gun.gunHandedness = GunHandedness.HiddenOneHanded;
            Gun gun2 = PickupObjectDatabase.GetById(748) as Gun;

            gun.gunSwitchGroup          = gun2.gunSwitchGroup;
            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.SetBaseMaxAmmo(200);
            gun.DefaultModule.angleVariance = 0f;
            gun.sprite.IsPerpendicular      = true;
            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "NN doesnt watch Hunter x Hunter.";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            Projectile         nenProj1 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(336) as Gun).DefaultModule.projectiles[0]);
            PierceProjModifier pierce1  = nenProj1.gameObject.GetComponent <PierceProjModifier>();

            pierce1.penetration -= 4;
            nenProj1.AdditionalScaleMultiplier *= 1.5f;
            nenProj1.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(nenProj1.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(nenProj1);
            nenProj1.baseData.damage *= 1.5f;
            nenProj1.baseData.speed  *= 1f;
            nenProj1.transform.parent = gun.barrelOffset;
            Projectile nenProj2 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(748) as Gun).DefaultModule.chargeProjectiles[0].Projectile);

            nenProj2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(nenProj2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(nenProj2);
            nenProj2.baseData.damage *= 1f;
            nenProj2.baseData.speed  *= 1f;
            nenProj2.baseData.range   = 7.5f;
            nenProj2.transform.parent = gun.barrelOffset;
            Projectile origProj = (PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0];
            Projectile nenProj3 = UnityEngine.Object.Instantiate(origProj);

            nenProj3.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(nenProj3.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(nenProj3);
            nenProj3.baseData.damage        *= 14f;
            nenProj3.baseData.speed         *= 2f;
            nenProj3.baseData.range          = 14;
            nenProj3.sprite.renderer.enabled = false;
            PierceProjModifier orAddComponent = nenProj3.gameObject.GetOrAddComponent <PierceProjModifier>();

            nenProj3.gameObject.AddComponent <UnchangeableRangeController>();
            orAddComponent.penetration -= 50;
            nenProj3.GetComponent <TrailController>();
            nenProj3.transform.parent = gun.barrelOffset;
            NenForms.Add(nenProj1);
            NenForms.Add(nenProj2);
            NenForms.Add(nenProj3);
            ProjectileModule.ChargeProjectile chargeProj1 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = nenProj1,
                ChargeTime = 0f,
            };
            ProjectileModule.ChargeProjectile chargeProj2 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = nenProj2,
                ChargeTime = .4f,
            };
            ProjectileModule.ChargeProjectile chargeProj3 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = nenProj3,
                ChargeTime = 1.2f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                chargeProj1,
                chargeProj2,
                chargeProj3
            };
        }
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Beatdown Under", "boom");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:beatdown_under", "ski:beatdown_under");
            gun.gameObject.AddComponent <BeatDownUnder>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("You'd better take cover!");
            gun.SetLongDescription("In the time before this marvelous invention, boomerangs were thrown by hand in the great dusty frontier of gunymede's lower hemisphere. \n" +
                                   "As an adaptation to the slow speed of the boomerangs the prey of the fronteerman grew faster and faster. Eventually dodging them with ease.\n" +
                                   "The BeatDown Under, patent pending, is forged from the finest woods in the gundrominian region. " +
                                   "It increases your boomerang throwing prowes by over 150%! But dont forget to catch your boomerang or you might be in for quite a headache!" +

                                   "\n\n\n - Knife_to_a_Gunfight");;


            gun.SetupSprite(null, "boom_idle_001", 8);
            gun.SetAnimationFPS(gun.chargeAnimation, 5);

            gun.SetAnimationFPS(gun.shootAnimation, 45);
            gun.SetAnimationFPS(gun.reloadAnimation, 9);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetByEncounterName("Hegemony Rifle") as Gun, true, false);

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.TwoHanded;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;

            gun.reloadTime = 2f;
            gun.DefaultModule.numberOfShotsInClip = 6;
            gun.DefaultModule.cooldownTime        = .5f;

            gun.SetBaseMaxAmmo(900);
            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "I come from a Land down under";

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

            gun.barrelOffset.transform.localPosition = new Vector3(3f, .5f, 0f);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "sail";


            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 8f;
            projectile.baseData.speed        = 3f;
            projectile.baseData.range        = 3f;
            projectile.baseData.force        = 5;



            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            gun.DefaultModule.projectiles[0] = projectile2;
            projectile2.baseData.damage      = 15f;
            projectile2.baseData.speed       = 10f;
            projectile2.baseData.range       = 100f;
            projectile2.DefaultTintColor     = UnityEngine.Color.gray;



            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0f,
                AmmoCost   = 0,
            };
            ProjectileModule.ChargeProjectile item2 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile2,
                ChargeTime = 1f,
            };

            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item,
                item2,
            };
            projectile.transform.parent = gun.barrelOffset;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("GunLance", "GnLnc");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:gunlance", "ski:gunlance");
            gun.gameObject.AddComponent <GunLance>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("This is my BOOM STICK!");
            gun.SetLongDescription("\nA lance made from Dragun peices that has been retrofitted with a large cannon barrel and a cylinder." +
                                   " As The curse of Kaliber spread through the gungeon many weapons of old were retroactively upgraded to fill her insatiable desire for firearms.\n\n" +
                                   "Hold charge to change 3 different fire types!\n" +
                                   "No charge = swipe. \n" +
                                   "First Charge = shelling. \n" +
                                   "Second Charge = wyvernstake." +
                                   "\n\n\n - Knife_to_a_Gunfight");;


            gun.SetupSprite(null, "GnLnc_idle_001", 8);
            gun.SetAnimationFPS(gun.chargeAnimation, 5);

            gun.SetAnimationFPS(gun.shootAnimation, 45);
            gun.SetAnimationFPS(gun.reloadAnimation, 16);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetByEncounterName("Hegemony Rifle") as Gun, true, false);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 10;



            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.TwoHanded;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;

            gun.reloadTime = 2f;
            gun.DefaultModule.numberOfShotsInClip = 4;
            gun.DefaultModule.cooldownTime        = .5f;



            gun.SetBaseMaxAmmo(300);
            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "Here Comes the BOOOOOOM!";

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

            gun.barrelOffset.transform.localPosition = new Vector3(1.5f, .5f, 0f);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "sail";


            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 8f;
            projectile.baseData.speed        = 3f;
            projectile.baseData.range        = 3f;
            projectile.baseData.force        = 5;
            projectile.name = "slash";
            projectile.tag  = "slash";



            //shelling
            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(370) as Gun).DefaultModule.chargeProjectiles[1].Projectile);

            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            gun.DefaultModule.projectiles[0] = projectile2;
            projectile2.baseData.damage      = 14f;
            projectile2.baseData.speed       = 50f;
            projectile2.baseData.range       = 10f;
            projectile2.DefaultTintColor     = UnityEngine.Color.gray;
            projectile2.name = "shelling";



            //wyvernstake
            Projectile projectile3 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(370) as Gun).DefaultModule.chargeProjectiles[1].Projectile);

            projectile3.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile3.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile3);
            gun.DefaultModule.projectiles[0]      = projectile3;
            projectile3.baseData.damage           = 20f;
            projectile3.baseData.speed            = 70f;
            projectile3.baseData.range            = 80f;
            projectile3.AdditionalScaleMultiplier = 3f;
            projectile3.HasDefaultTint            = true;
            projectile3.DefaultTintColor          = UnityEngine.Color.grey;
            projectile3.AppliesKnockbackToPlayer  = true;
            projectile3.PlayerKnockbackForce      = 6;
            projectile3.name = "stake";
            UnchangeableRangeController ranger3 = projectile3.gameObject.AddComponent <UnchangeableRangeController>();

            ranger3.Awake();
            Gun swipeFlash = (Gun)PickupObjectDatabase.GetByEncounterName("Silencer");

            gun.muzzleFlashEffects.type = VFXPoolType.None;

            Gun shellingFlash = (Gun)PickupObjectDatabase.GetByEncounterName("Heck Blaster");


            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0f,
                AmmoCost   = 0,
            };
            ProjectileModule.ChargeProjectile item2 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile2,
                ChargeTime = .2f,
            };
            ProjectileModule.ChargeProjectile item3 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile3,
                ChargeTime = 2f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item,
                item2,
                item3,
            };
            projectile.transform.parent = gun.barrelOffset;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("High Velocity Rifle", "highvelocityrifle");

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

            gun.SetShortDescription("Tracked");
            gun.SetLongDescription("Advanced tech designed for private security contractors on the fringes of space." + "\n\nHolding down fire allows the operator to enter 'aim time'.");

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

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

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

            //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 *= 8f;
            projectile.baseData.force  *= 3f;
            projectile.baseData.speed  *= 6f;
            projectile.baseData.range  *= 2f;
            PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            pierce.penetration++;
            pierce.penetratesBreakables = true;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.SmoothLightBlueLaserCircleVFX;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.SetProjectileSpriteRight("highvelocityrifle_projectile", 13, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 11, 4);

            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "Toolgun Bullets";

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            HighVelocityRifleID = gun.PickupObjectId;
        }
Beispiel #22
0
        // Token: 0x0600028C RID: 652 RVA: 0x000162F8 File Offset: 0x000144F8
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Explodergun", "ExplodeCharge");

            Game.Items.Rename("outdated_gun_mods:explodergun", "cak:explodergun");
            GunExt.SetShortDescription(gun, "Crowbot");
            GunExt.SetLongDescription(gun, "A covering that can be applied to the arm. it shoots grenades at rapid pace, but has an obnoxious purple colouring.");
            GunExt.SetupSprite(gun, null, "ExplodeCharge_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 6);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(19) as Gun, true, false);



            foreach (ProjectileModule projectileModule in gun.Volley.projectiles)
            {
                projectileModule.ammoCost            = 1;
                projectileModule.shootStyle          = ProjectileModule.ShootStyle.Charged;
                projectileModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                projectileModule.cooldownTime        = 1f;
                projectileModule.angleVariance       = 20f;
                projectileModule.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(projectileModule.projectiles[0]);
                projectileModule.projectiles[0] = projectile;
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage           *= 2f;
                projectile.AdditionalScaleMultiplier *= 1.2f;
                projectile.baseData.range            *= 0.5f;
                GoopModifier goop = projectile.gameObject.AddComponent <GoopModifier>();
                bool         flag = projectileModule != gun.DefaultModule;
                if (flag)
                {
                    projectileModule.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
                ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f
                };
                PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                orAddComponent.penetratesBreakables = true;
                orAddComponent.penetration++;
                projectileModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
                {
                    item
                };
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(100);
            gun.DefaultModule.angleVariance = 0.2f;
            gun.quality = PickupObject.ItemQuality.SPECIAL;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 3;
            gun.encounterTrackable.EncounterGuid = "goboomlolololol";
            gun.gunHandedness = GunHandedness.HiddenOneHanded;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.37f, 0f);
            Explodergun.ExplodergunID = gun.PickupObjectId;
            CakeIDs.Explodergun       = gun.PickupObjectId;
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Scythe of the Jammed", "jamm_scythe");

            Game.Items.Rename("outdated_gun_mods:scythe_of_the_jammed", "spapi:scythe_of_the_jammed");
            gun.gameObject.AddComponent <SuperReapersScythe>();
            GunExt.SetShortDescription(gun, "Jammed's Favorite Gun");
            GunExt.SetLongDescription(gun, "Shoots a lot of bullets. Grants flight.\n\nThis half-scythe-half-gun is the weapon of the Jammed himself. Legends say this weapon provides the powers of the Jammed to anyone when held...");
            GunExt.SetupSprite(gun, null, "jamm_scythe_idle_001", 8);
            for (int i = 0; i < 12; i++)
            {
                GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            }
            int g = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.shootStyle = ProjectileModule.ShootStyle.Charged;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(51) as Gun).DefaultModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                mod.projectiles[0]                     = projectile;
                projectile.transform.parent            = gun.barrelOffset;
                mod.angleVariance                      = 0f;
                projectile.sprite.usesOverrideMaterial = true;
                projectile.sprite.renderer.material.SetFloat("_BlackBullet", 1f);
                projectile.sprite.renderer.material.SetFloat("_EmissivePower", -40f);
                projectile.gameObject.name  = "Jamm_Scythe_Projectile";
                projectile.ignoreDamageCaps = true;
                projectile.baseData.range   = float.MaxValue;
                projectile.baseData.damage  = 12.5f;
                mod.angleFromAim            = g * 30;
                mod.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                mod.cooldownTime        = 0.35f;
                mod.numberOfShotsInClip = 5;
                g++;
            }
            AdvancedHoveringGunSynergyProcessor processor = gun.gameObject.AddComponent <AdvancedHoveringGunSynergyProcessor>();

            processor.RequiredSynergy              = "#MINE_TOO!";
            processor.TargetGunID                  = 365;
            processor.UsesMultipleGuns             = false;
            processor.PositionType                 = HoveringGunController.HoverPosition.OVERHEAD;
            processor.AimType                      = HoveringGunController.AimType.PLAYER_AIM;
            processor.FireType                     = HoveringGunController.FireType.ON_RELOAD;
            processor.FireCooldown                 = 1.35f;
            processor.FireDuration                 = 0f;
            processor.OnlyOnEmptyReload            = false;
            processor.ShootAudioEvent              = "";
            processor.OnEveryShotAudioEvent        = "";
            processor.FinishedShootingAudioEvent   = "";
            processor.Trigger                      = AdvancedHoveringGunSynergyProcessor.TriggerStyle.CONSTANT;
            processor.NumToTrigger                 = 1;
            processor.TriggerDuration              = 0f;
            processor.ConsumesTargetGunAmmo        = false;
            processor.ChanceToConsumeTargetGunAmmo = 0f;
            gun.reloadTime = 1.35f;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode              = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart             = 9;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_ENM_cannonball_launch_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;
            gun.GetComponent <tk2dSpriteAnimator>().MuteAudio = false;
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.S;
            gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f);
            gun.encounterTrackable.EncounterGuid     = "jamm_scythe";
            gun.gunClass = GunClass.CHARGE;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(336);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventInfo = "damageEnemies";
            for (int i = 0; i < EncounterDatabase.Instance.Entries.Count; i++)
            {
                if (EncounterDatabase.Instance.Entries[i].journalData.PrimaryDisplayName == "#SREAPER_ENCNAME")
                {
                    gun.SetupUnlockOnEncounter(EncounterDatabase.Instance.Entries[i].myGuid, DungeonPrerequisite.PrerequisiteOperation.GREATER_THAN, 0);
                    break;
                }
            }
        }
        private void ReRandomiseGun(PlayerController player)
        {
            int   amountOfBulletsToShoot = 1;
            float randomFloat            = UnityEngine.Random.value;

            if (randomFloat <= 0.025f)
            {
                amountOfBulletsToShoot = 5;                        // 2.5%
            }
            else if (randomFloat <= 0.1f)
            {
                amountOfBulletsToShoot = 4;                           // 7.5%
            }
            else if (randomFloat <= 0.2f)
            {
                amountOfBulletsToShoot = 3;                           // 10%
            }
            else if (randomFloat <= 0.4f)
            {
                amountOfBulletsToShoot = 2;                           //20%
            }
            // 60%

            Gun gunToStealFrom = (PickupObjectDatabase.GetById(BraveUtility.RandomElement(viableSourceGuns)) as Gun);

            List <Projectile> ValidBullets = new List <Projectile>();

            if (gun.DefaultModule.shootStyle == ProjectileModule.ShootStyle.Charged)
            {
                Projectile projectile = null;
                for (int k = 0; k < 15; k++)
                {
                    ProjectileModule.ChargeProjectile chargeProjectile = gunToStealFrom.RawDefaultModule().chargeProjectiles[UnityEngine.Random.Range(0, gunToStealFrom.RawDefaultModule().chargeProjectiles.Count)];
                    if (chargeProjectile != null)
                    {
                        projectile = chargeProjectile.Projectile;
                    }
                    if (projectile)
                    {
                        break;
                    }
                }
                ValidBullets.Add(projectile);
            }
            else
            {
                Projectile projectile = null;
                for (int k = 0; k < 15; k++)
                {
                    Projectile proj = gunToStealFrom.RawDefaultModule().projectiles[UnityEngine.Random.Range(0, gunToStealFrom.RawDefaultModule().projectiles.Count)];
                    if (proj != null)
                    {
                        projectile = proj;
                    }
                    if (projectile)
                    {
                        break;
                    }
                }
                ValidBullets.Add(projectile);
            }
            if (gun.RawSourceVolley.projectiles.Count() > 1)
            {
                while (gun.RawSourceVolley.projectiles.Count() > 1)
                {
                    gun.RawSourceVolley.projectiles.RemoveAt(1);
                }
            }

            if (amountOfBulletsToShoot > 1)
            {
                for (int i = 0; i < (amountOfBulletsToShoot - 1); i++)
                {
                    gun.AddProjectileModuleToRawVolleyFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
                }
            }
            //ETGModConsole.Log("Amount of Bullets: " + amountOfBulletsToShoot);
            //ETGModConsole.Log("Actual Volley Modules: " + gun.RawSourceVolley.projectiles.Count());
            Projectile randomproj = UnityEngine.Object.Instantiate <Projectile>(BraveUtility.RandomElement(ValidBullets));

            randomproj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(randomproj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(randomproj);
            randomproj.baseData.damage              *= UnityEngine.Random.Range(0.5f, 2f);
            randomproj.baseData.range               *= UnityEngine.Random.Range(0.2f, 3.5f);
            randomproj.baseData.force               *= UnityEngine.Random.Range(0.25f, 3.5f);
            randomproj.baseData.speed               *= UnityEngine.Random.Range(0.15f, 2f);
            randomproj.AdditionalScaleMultiplier    *= UnityEngine.Random.Range(0.25f, 2f);
            randomproj.BossDamageMultiplier         *= UnityEngine.Random.Range(0.25f, 2f);
            randomproj.BlackPhantomDamageMultiplier *= UnityEngine.Random.Range(0.1f, 3.5f);

            float cachedCooldownTime  = UnityEngine.Random.Range(0.01f, 1.1f);
            int   cachedClipShots     = UnityEngine.Random.Range(1, 30);
            float cachedAngleVariance = UnityEngine.Random.Range(0, 25);

            gun.reloadTime = UnityEngine.Random.Range(0.1f, 2f);
            int ammo = UnityEngine.Random.Range(50, 350);

            gun.SetBaseMaxAmmo(ammo);
            gun.ammo = ammo;
            int   type = UnityEngine.Random.Range(1, 4);
            float cachedBurstCooldown = UnityEngine.Random.Range(0.01f, 0.7f);
            int   cachedBurstCount    = UnityEngine.Random.Range(1, 11);

            gun.RawDefaultModule().projectiles[0]      = randomproj;
            gun.RawDefaultModule().cooldownTime        = cachedCooldownTime;
            gun.RawDefaultModule().numberOfShotsInClip = cachedClipShots;
            gun.RawDefaultModule().angleVariance       = cachedAngleVariance;
            if (type == 1)
            {
                gun.RawDefaultModule().shootStyle = ProjectileModule.ShootStyle.SemiAutomatic;
            }
            else if (type == 2)
            {
                gun.RawDefaultModule().shootStyle = ProjectileModule.ShootStyle.Automatic;
            }
            else if (type == 3)
            {
                gun.RawDefaultModule().shootStyle        = ProjectileModule.ShootStyle.Burst;
                gun.RawDefaultModule().burstCooldownTime = cachedBurstCooldown;
                gun.RawDefaultModule().burstShotCount    = cachedBurstCount;
            }

            foreach (ProjectileModule mod in gun.RawSourceVolley.projectiles)
            {
                Projectile proj = UnityEngine.Object.Instantiate <Projectile>(randomproj);
                proj.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(proj.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(proj);
                mod.projectiles[0]      = proj;
                mod.cooldownTime        = cachedCooldownTime;
                mod.numberOfShotsInClip = cachedClipShots;
                mod.angleVariance       = cachedAngleVariance;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }

                if (type == 1)
                {
                    mod.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic;
                }
                else if (type == 2)
                {
                    mod.shootStyle = ProjectileModule.ShootStyle.Automatic;
                }
                else if (type == 3)
                {
                    mod.shootStyle        = ProjectileModule.ShootStyle.Burst;
                    mod.burstCooldownTime = cachedBurstCooldown;
                    mod.burstShotCount    = cachedBurstCount;
                }
                gun.RawSourceVolley.projectiles[0].ammoCost = 1;
                //ETGModConsole.Log("Volley Module Assignment occurred");
            }

            player.stats.RecalculateStats(player, true, false);
        }
Beispiel #25
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Maw of Vog", "Maw");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:maw_of_vog", "ski:maw_of_vog");
            gun.gameObject.AddComponent <Maw>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Through the fire and flames");
            gun.SetLongDescription("This blade was forged with the blessing of the bullet hell's canine gaurdian, Vog. The blade is very much alive acting as a cub of vog normaly would, reacting to danger and reveling in a good hunt. \n" +
                                   "This blade functions better while it is heated, swinging faster and without ceasing. \n" +
                                   "Weilders of the blade are protected, but not immune to the fires it makes" +
                                   "\n" +
                                   "Charge for ring of fire.\n" +
                                   "Statbuffs while on fire" +
                                   "\n\n\n - Knife_to_a_Gunfight");;


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

            gun.SetAnimationFPS(gun.chargeAnimation, 7);
            gun.SetAnimationFPS(gun.shootAnimation, 20);
            gun.SetAnimationFPS(gun.reloadAnimation, 4);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetByEncounterName("Hegemony Rifle") as Gun, true, false);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 9;



            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.OneHanded;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;

            gun.reloadTime = 2f;
            gun.DefaultModule.numberOfShotsInClip = 5;
            gun.DefaultModule.cooldownTime        = .5f;



            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.A;
            gun.encounterTrackable.EncounterGuid = "BURN BABY BURN!";

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

            gun.barrelOffset.transform.localPosition = new Vector3(1f, .5f, 0f);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "finished big";


            gun.muzzleFlashEffects = null;



            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 9f;
            projectile.baseData.speed        = 3f;
            projectile.baseData.range        = 3f;
            projectile.baseData.force        = 5;

            projectile.AppliesFire     = true;
            projectile.FireApplyChance = 100f;



            //Hot HOT HOT
            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            gun.DefaultModule.projectiles[0] = projectile2;
            projectile2.baseData.damage      = 15f;
            projectile2.baseData.speed       = 50f;
            projectile2.baseData.range       = 10f;

            projectile2.name = "shelling";



            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0f,
                AmmoCost   = 0,
            };
            ProjectileModule.ChargeProjectile item2 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile2,
                ChargeTime = 1.5f,
            };

            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item,
                item2,
            };

            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("Maw_reload");

            float[] offsetsX = new float[] { -.3f, -.4f, -.4f, -.4f, -.4f };
            float[] offsetsY = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, -0.0f };

            for (int i = 0; i < offsetsX.Length && i < offsetsY.Length && i < fireClip.frames.Length; i++)
            {
                int id = fireClip.frames[i].spriteId;
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY[i];
            }

            tk2dSpriteAnimationClip fireClip2 = gun.sprite.spriteAnimator.GetClipByName("Maw_fire");

            float[] offsetsX2 = new float[] { .1f, .4f, .3f, .2f, .0f };
            float[] offsetsY2 = new float[] { 1.2f, .5f, .3f, -1.2f, -.6f };

            for (int i = 0; i < offsetsX2.Length && i < offsetsY2.Length && i < fireClip2.frames.Length; i++)
            {
                int id = fireClip2.frames[i].spriteId;
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY2[i];
            }


            tk2dSpriteAnimationClip fireClip3 = gun.sprite.spriteAnimator.GetClipByName("Maw_charge");

            float[] offsetsX3 = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.6f, -0.7f, -0.7f };
            float[] offsetsY3 = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.0f };

            for (int i = 0; i < offsetsX3.Length && i < offsetsY3.Length && i < fireClip3.frames.Length; i++)
            {
                int id = fireClip3.frames[i].spriteId;
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY3[i];
            }



            projectile.transform.parent = gun.barrelOffset;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Stasis Rifle", "stasisrifle");

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

            gun.SetShortDescription("Hold Position");
            gun.SetLongDescription("Fires dangerous particle bolts that freeze time in a small radius around the impact site." + "\n\nWorks underwater.");

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

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.doesScreenShake             = true;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime  = 2f;
            gun.DefaultModule.angleVariance = 0;
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(153) as Gun).muzzleFlashEffects;

            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(2.68f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(35);
            gun.ammo     = 35;
            gun.gunClass = GunClass.CHARGE;
            gun.SetAnimationFPS(gun.chargeAnimation, 8);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 22;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_WPN_energycannon_shot";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            //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 = 17f;
            projectile.baseData.force *= 0.5f;
            projectile.baseData.speed *= 2f;
            projectile.baseData.range *= 2f;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.SmoothLightBlueLaserCircleVFX;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.SetProjectileSpriteRight("highvelocityrifle_projectile", 13, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 11, 4);
            FreezeTimeOnHitModifier freezy = projectile.gameObject.GetOrAddComponent <FreezeTimeOnHitModifier>();

            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 3,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "Toolgun Bullets";

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Beispiel #27
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Butchers Knife", "butchersknife");

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

            behav.preventNormalReloadAudio = true;
            behav.preventNormalFireAudio   = true;
            behav.overrideNormalFireAudio  = "Play_WPN_blasphemy_shot_01";
            gun.gunSwitchGroup             = (PickupObjectDatabase.GetById(417) as Gun).gunSwitchGroup;
            gun.SetShortDescription("Word of Kaliber");
            gun.SetLongDescription("Cuts enemies to bits." + "\n\nForged and sharpened by a Gun Cultist who believed she heard the voice of Kaliber speaking to her... asking her for a sacrifice... her son.");
            gun.SetupSprite(null, "butchersknife_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.chargeAnimation, 8);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 2f, StatModifier.ModifyMethod.ADDITIVE);
            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.cooldownTime  = 1f;
            gun.gunClass = GunClass.CHARGE;
            gun.DefaultModule.angleVariance       = 1f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            Projectile projectile = DataCloners.CopyFields <SuperPierceProjectile>(Instantiate(gun.DefaultModule.projectiles[0]));

            gun.DefaultModule.projectiles[0] = projectile;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage           *= 0.2f;
            projectile.baseData.speed            *= 0.7f;
            projectile.pierceMinorBreakables      = true;
            projectile.AdditionalScaleMultiplier *= 1f;
            projectile.baseData.range            *= 1000f;
            projectile.SetProjectileSpriteRight("butchersknife_projectile", 29, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 35, 14);
            projectile.specRigidbody.CollideWithTileMap = false;

            NoCollideBehaviour nocollide = projectile.gameObject.GetOrAddComponent <NoCollideBehaviour>();

            nocollide.worksOnEnemies     = false;
            nocollide.worksOnProjectiles = true;

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

            pierce.penetration = 1000;

            TickDamageBehaviour tickdmg = projectile.gameObject.GetOrAddComponent <TickDamageBehaviour>();

            tickdmg.damageSource  = "Butchers Knife";
            tickdmg.starterDamage = 3f;

            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("ButchersKnife Clip", "NevernamedsItems/Resources/CustomGunAmmoTypes/butchersknife_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/butchersknife_clipempty");

            gun.reloadTime = 5f;
            gun.SetBaseMaxAmmo(35);
            gun.quality = PickupObject.ItemQuality.S;

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

            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(0.87f, 0.25f, 0f);
            ButchersKnifeID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Gunjurer's Staff", "gunjurerswand");

            Game.Items.Rename("outdated_gun_mods:gunjurer's_staff", "nn:gunjurers_staff");
            var behav = gun.gameObject.AddComponent <GunjurersStaff>();

            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalReloadAudio = "Play_ENM_wizardred_chant_01";
            gun.SetShortDescription("Do you believe in magic?");
            gun.SetLongDescription("The lost wand of an Apprentice Gunjurer, cruelly slain by a Gungeoneer while out of his mentor's sight for but a moment...");

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

            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.chargeAnimation, 4);

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

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

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_ENM_wizardred_shoot_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].eventAudio   = "Play_ENM_wizard_charge_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].triggerEvent = true;

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Ordered;
            gun.muzzleFlashEffects.type     = VFXPoolType.None;
            gun.reloadTime = 1.5f;
            gun.DefaultModule.cooldownTime           = 0.5f;
            gun.DefaultModule.numberOfShotsInClip    = 3;
            gun.barrelOffset.transform.localPosition = new Vector3(1.31f, 0.5f, 0f);
            gun.SetBaseMaxAmmo(45);
            gun.ammo     = 45;
            gun.gunClass = GunClass.CHARGE;
            //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 = 0f;
            projectile.baseData.force  = 0f;
            projectile.baseData.speed  = 0.001f;
            NoCollideBehaviour nocollide = projectile.gameObject.AddComponent <NoCollideBehaviour>();

            nocollide.worksOnEnemies           = true;
            nocollide.worksOnProjectiles       = true;
            projectile.sprite.renderer.enabled = false;
            BulletLifeTimer timer = projectile.gameObject.AddComponent <BulletLifeTimer>();

            timer.eraseInsteadOfDie = true;
            timer.secondsTillDeath  = 1.5f;
            projectile.specRigidbody.CollideWithTileMap = false;

            SpawnGunjurerBulletScriptOnSpawn script = projectile.gameObject.AddComponent <SpawnGunjurerBulletScriptOnSpawn>();

            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0.8f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.quality = PickupObject.ItemQuality.A; //B
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            GunjurersStaffID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Bullet Blade", "bulletblade");

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

            behav.preventNormalFireAudio   = true;
            behav.preventNormalReloadAudio = true;
            //behav.overrideNormalFireAudio = "Play_OBJ_gate_slam_01";//"Play_ENM_gunnut_swing_01";

            gun.SetShortDescription("Forged of Pure Bullet");
            gun.SetLongDescription("The hefty blade of the fearsome armoured sentinels that tread the Gungeon's Halls." + "\n\nHas claimed the life of many a careless gungeoneer with it's wide spread.");
            gun.SetupSprite(null, "bulletblade_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.chargeAnimation, 6);

            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_ENM_gunnut_shockwave_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            for (int i = 0; i < 45; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 2.5f;
                mod.angleVariance       = 70f;
                mod.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                mod.projectiles[0] = projectile;
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage *= 1.6f;
                projectile.baseData.speed  *= 0.6f;
                projectile.baseData.range  *= 1f;
                projectile.SetProjectileSpriteRight("enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;

                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f,
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(50);
            gun.quality  = PickupObject.ItemQuality.B;
            gun.gunClass = GunClass.CHARGE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 4;

            tk2dSpriteAnimationClip chargeClip = gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation);

            foreach (tk2dSpriteAnimationFrame frame in chargeClip.frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(new Vector2(-0.56f, -2.31f));
                }
            }
            tk2dSpriteAnimationClip fireClip = gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation);

            foreach (tk2dSpriteAnimationFrame frame in fireClip.frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(new Vector2(-0.56f, -2.31f));
                }
            }

            gun.encounterTrackable.EncounterGuid = "this is the Bullet Blade";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(3.18f, -0.31f, 0f);
            BulletBladeID = gun.PickupObjectId;

            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.JAMMEDGUNNUT_QUEST_REWARDED, true);
        }
Beispiel #30
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Crusader mk II", "Firestrike");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:crusader_mk_ii", "ski:crusader_mk_ii");
            gun.gameObject.AddComponent <FireStrike>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Precision German Engineering");
            gun.SetLongDescription("An early version of the main thruster for many of the hegemony of man's smaller ships. This version was not strong enough for the hegemony's" +
                                   " taste so they were relegated to being used as weapons. The faster the user is moving the more powerful the projectile will be!" +

                                   "\n\n\n - Knife_to_a_Gunfight");;


            gun.SetupSprite(null, "Firestrike_idle_001", 8);
            gun.SetAnimationFPS(gun.idleAnimation, 3);
            gun.SetAnimationFPS(gun.chargeAnimation, 7);
            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(125) as Gun, true, false);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 5;



            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.TwoHanded;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;

            gun.reloadTime = 2f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.DefaultModule.cooldownTime        = .5f;


            gun.SetBaseMaxAmmo(60);

            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "Bring me another";

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

            gun.barrelOffset.transform.localPosition = new Vector3(1.5f, 0f, 0f);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "flare";
            gun.muzzleFlashEffects           = null;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0]     = projectile;
            projectile.baseData.damage           = 6f;
            projectile.baseData.speed            = 12f;
            projectile.baseData.range           *= 1.5f;
            projectile.baseData.force            = 5;
            projectile.BossDamageMultiplier      = 2;
            projectile.AppliesFire               = false;
            projectile.AdditionalScaleMultiplier = 2.5f;
            projectile.gameObject.AddComponent <PlayerVelocityBuffProjectileModifier>();

            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("Firestrike_charge");

            float[] offsetsX = new float[] { 0f, 0f, 0f, -.4f, -1.2f, -1.1f, -1.1f, -1.1f };
            float[] offsetsY = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, -0.0f, 0.0f, 0.0f, 0.0f };

            for (int i = 0; i < offsetsX.Length && i < offsetsY.Length && i < fireClip.frames.Length; i++)
            {
                int id = fireClip.frames[i].spriteId;
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY[i];
            }

            tk2dSpriteAnimationClip fireClip2 = gun.sprite.spriteAnimator.GetClipByName("Firestrike_fire");

            float[] offsetsX2 = new float[] { 1f, 2.4f, 2.2f, 2.1f, 2f, 1.9f, 2f, };
            float[] offsetsY2 = new float[] { -1.8f, -1.6f, .5f, .6f, .7f, .8f, .7f, };

            for (int i = 0; i < offsetsX2.Length && i < offsetsY2.Length && i < fireClip2.frames.Length; i++)
            {
                int id = fireClip2.frames[i].spriteId;
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY2[i];
            }

            tk2dSpriteAnimationClip fireClip3 = gun.sprite.spriteAnimator.GetClipByName("Firestrike_reload");

            float[] offsetsX3 = new float[] { 0f, 0f, 0f, 0f };
            float[] offsetsY3 = new float[] { 0.0f, 0.0f, -0.0f, 0.0f };

            for (int i = 0; i < offsetsX3.Length && i < offsetsY3.Length && i < fireClip3.frames.Length; i++)
            {
                int id = fireClip3.frames[i].spriteId;
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY3[i];
            }

            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = .3f,
                AmmoCost   = 0,
            };

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

            projectile.transform.parent = gun.barrelOffset;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }