Example #1
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;
        }
Example #2
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("Sheila LMG", "tur");

            // "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:sheila_lmg", "ski:sheila_lmg");
            gun.gameObject.AddComponent <Sheila_LMG>();
            //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("Queen of all LMGs");
            gun.SetLongDescription("This monsterous mammoth of a gun was so powerful that it can only be weilded by attaching it to a mounting brace." +
                                   "\n\n\n - Knife_to_a_Gunfight");;


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


            gun.SetAnimationFPS(gun.shootAnimation, 40);
            gun.SetAnimationFPS(gun.reloadAnimation, 3);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetByEncounterName("RUBE-ADYNE prototype") as Gun, true, false);

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 6;

            gun.gunHandedness               = GunHandedness.TwoHanded;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 7f;
            gun.DefaultModule.numberOfShotsInClip = 300;
            gun.DefaultModule.cooldownTime        = .05f;
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.SPECIAL;
            gun.encounterTrackable.EncounterGuid = "She's a beaut!";

            Gun shellingFlash = (Gun)PickupObjectDatabase.GetByEncounterName("m16");

            gun.muzzleFlashEffects = shellingFlash.muzzleFlashEffects;

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

            gun.barrelOffset.transform.localPosition = new Vector3(1.8f, .5f, 0f);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "sail";
            gun.shellsToLaunchOnFire         = 4;
            Gun gun2 = PickupObjectDatabase.GetById(84) as Gun;

            gun.shellCasing = gun2.shellCasing;


            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 6f;
            projectile.baseData.speed       *= 2f;
            projectile.baseData.range       *= 1f;
            projectile.baseData.force        = 10f;
            BounceProjModifier bnc = projectile.GetComponent <BounceProjModifier>();

            bnc.numberOfBounces = 0;


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

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

            behav.preventNormalFireAudio = true;

            gun.SetShortDescription("Flashy and Lethal");
            gun.SetLongDescription("A cybernetic augment concealed in the forearm, this cruel blade extends to slash at your enemies with inhuman speed.");

            gun.SetupSprite(null, "mantidaugment_idle_001", 8);
            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);
            gun.AddCurrentGunStatModifier(PlayerStats.StatType.MovementSpeed, 1f, StatModifier.ModifyMethod.ADDITIVE);
            gun.SetAnimationFPS(gun.shootAnimation, 20);
            gun.SetAnimationFPS(gun.reloadAnimation, 12);

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

            //GUN STATS
            gun.gunHandedness               = GunHandedness.HiddenOneHanded;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.BEAM;
            gun.reloadTime = 1f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.cooldownTime           = 0.01f;
            gun.DefaultModule.numberOfShotsInClip    = 100;
            gun.barrelOffset.transform.localPosition = new Vector3(1.56f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(2077);
            gun.ammo     = 2077;
            gun.gunClass = GunClass.FULLAUTO;
            //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        *= 2f;
            projectile.baseData.force         *= 0.5f;
            projectile.sprite.renderer.enabled = false;
            NoCollideBehaviour nocollide = projectile.gameObject.AddComponent <NoCollideBehaviour>();

            nocollide.worksOnEnemies     = true;
            nocollide.worksOnProjectiles = true;
            projectile.specRigidbody.CollideWithTileMap = false;
            ProjectileSlashingBehaviour slashing = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slashing.DestroyBaseAfterFirstSlash          = true;
            slashing.SlashDamageUsesBaseProjectileDamage = true;
            slashing.slashParameters        = new SlashData();
            slashing.slashParameters.hitVFX = (PickupObjectDatabase.GetById(369) as Gun).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.tileMapVertical;

            gun.DefaultModule.projectiles[0] = projectile;

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

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            MantidAugmentID = gun.PickupObjectId;
        }
Example #4
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("boneblaster", "boneblaster");

            // "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:boneblaster", "cak:boneblaster");
            gun.gameObject.AddComponent <boneblaster>();
            //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("Megalovanity");
            gun.SetLongDescription("A gungeoneer reduced to only bone and determination once used this as his weapon.");
            // 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, "boneblaster_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, 6);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            // 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.GetById(812) as Gun, true, false);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(383) 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 = 2;
            gun.DefaultModule.cooldownTime        = 0.1f;
            gun.DefaultModule.numberOfShotsInClip = 10;
            gun.SetBaseMaxAmmo(1500);
            gun.DefaultModule.angleVariance = 0f;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.SKULL;
            // 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;
            gun.encounterTrackable.EncounterGuid = "boneblaster";
            //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]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            gun.barrelOffset.localPosition  += new Vector3(0.3f, 0.5f, 0f);
            //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.
            //Setting static values for a custom gun's projectile stats prevents them from scaling with player stats and bullet modifiers (damage, shotspeed, knockback)
            //You have to multiply the value of the original projectile you're using instead so they scale accordingly. For example if the projectile you're using as a base has 10 damage and you want it to be 6 you use this
            //In our case, our projectile has a base damage of 5.5, so we multiply it by 1.1 so it does 10% more damage from the ak-47.
            projectile.baseData.damage          *= 4.5f;
            projectile.baseData.speed           *= 0.2f;
            projectile.AdditionalScaleMultiplier = 2f;
            projectile.transform.parent          = gun.barrelOffset;
            //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
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Init()
        {
            Gun shotgun = ETGMod.Databases.Items.NewGun("HotShot Shotgun", (PickupObjectDatabase.GetById(51) as Gun), "hotshot_shotgun");

            Game.Items.Rename("outdated_gun_mods:hotshot_shotgun", "ex:hotshot_shotgun");
            shotgun.SetShortDescription("You aren't supposed to have this...");
            shotgun.SetLongDescription("The gun used by Hot Shot Shotgun Kin.");
            // GunExt.SetupSprite(shotgun, null, "bootleg_shotgun_idle_001", 18);
            shotgun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(51).name, true, false);
            // shotgun.barrelOffset.localPosition -= new Vector3(0.3f, 0.2f, 0);
            shotgun.barrelOffset.localPosition = (PickupObjectDatabase.GetById(51) as Gun).barrelOffset.localPosition;
            if ((PickupObjectDatabase.GetById(51) as Gun).muzzleOffset && shotgun.muzzleOffset)
            {
                shotgun.muzzleOffset.transform.localPosition = (PickupObjectDatabase.GetById(51) as Gun).muzzleOffset.localPosition;
            }
            shotgun.reloadTime = 1.8f;
            shotgun.gunClass   = GunClass.SHOTGUN;
            shotgun.ammo       = 150;
            shotgun.SetBaseMaxAmmo(150);
            shotgun.quality        = PickupObject.ItemQuality.EXCLUDED;
            shotgun.gunSwitchGroup = "Shotgun";
            shotgun.encounterTrackable.EncounterGuid = "dc52f8e79c7c4a679238643a5bcb49c3";
            ETGMod.Databases.Items.Add(shotgun);
            HotShotShotGunID = shotgun.PickupObjectId;

            Projectile ShotgunProjectileComponent = EnemyDatabase.GetOrLoadByGuid("128db2f0781141bcb505d8f00f9e4d47").gameObject.GetComponent <AIBulletBank>().Bullets[0].BulletObject.GetComponent <Projectile>();

            // ExpandUtility.DuplicateComponent(ShotgunProjectileComponent, shotgun.DefaultModule.projectiles[0]);
            shotgun.DefaultModule.projectiles[0] = ShotgunProjectileComponent;
            ProjectileVolleyData shotGunVollyData = ScriptableObject.CreateInstance <ProjectileVolleyData>();

            shotGunVollyData.projectiles = new List <ProjectileModule>()
            {
                shotgun.DefaultModule,
                new ProjectileModule(),
                new ProjectileModule(),
                new ProjectileModule(),
                new ProjectileModule(),
                new ProjectileModule(),
            };
            shotGunVollyData.UsesBeamRotationLimiter      = false;
            shotGunVollyData.BeamRotationDegreesPerSecond = 30;
            shotGunVollyData.ModulesAreTiers = false;
            shotGunVollyData.UsesShotgunStyleVelocityRandomizer = true;
            shotGunVollyData.DecreaseFinalSpeedPercentMin       = -15;
            shotGunVollyData.IncreaseFinalSpeedPercentMax       = 15;

            JsonUtility.FromJsonOverwrite(JsonUtility.ToJson(shotgun.DefaultModule), shotGunVollyData.projectiles[1]);
            JsonUtility.FromJsonOverwrite(JsonUtility.ToJson(shotgun.DefaultModule), shotGunVollyData.projectiles[2]);
            JsonUtility.FromJsonOverwrite(JsonUtility.ToJson(shotgun.DefaultModule), shotGunVollyData.projectiles[3]);
            JsonUtility.FromJsonOverwrite(JsonUtility.ToJson(shotgun.DefaultModule), shotGunVollyData.projectiles[4]);
            JsonUtility.FromJsonOverwrite(JsonUtility.ToJson(shotgun.DefaultModule), shotGunVollyData.projectiles[5]);
            shotGunVollyData.projectiles[1].ammoType = GameUIAmmoType.AmmoType.SMALL_BULLET;
            shotGunVollyData.projectiles[2].ammoType = GameUIAmmoType.AmmoType.SMALL_BULLET;
            shotGunVollyData.projectiles[3].ammoType = GameUIAmmoType.AmmoType.SMALL_BULLET;
            shotGunVollyData.projectiles[4].ammoType = GameUIAmmoType.AmmoType.SMALL_BULLET;
            shotGunVollyData.projectiles[5].ammoType = GameUIAmmoType.AmmoType.SMALL_BULLET;
            shotgun.Volley = shotGunVollyData;
            // ShotgunProjectileComponent.gameObject.transform.localPosition = shotgun.barrelOffset.localPosition;

            HotShot_ShotGun = shotgun;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Pillarocket", "pillarocket");

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

            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalFireAudio   = "Play_ENM_statue_stomp_01";
            behav.overrideNormalReloadAudio = "Play_ENM_statue_charge_01";
            gun.SetShortDescription("Ancient Shrine");
            gun.SetLongDescription("Fires vengeful effigies, under your command." + "\n\nInhabited by the souls of ancient gundead heroes.");

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


            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup;
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(39) as Gun, true, false);

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 4f;
            gun.DefaultModule.cooldownTime        = 2f;
            gun.DefaultModule.angleVariance       = 20;
            gun.DefaultModule.numberOfShotsInClip = 4;
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(372) as Gun).muzzleFlashEffects;
            gun.barrelOffset.transform.localPosition = new Vector3(2.18f, 1.68f, 0f);
            gun.SetBaseMaxAmmo(30);
            gun.ammo = 30;

            //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.speed        = 6.5f;
            projectile.baseData.damage       = 80f;
            projectile.baseData.range        = 100;
            projectile.baseData.force        = 10;
            projectile.pierceMinorBreakables = true;
            RemoteBulletsProjectileBehaviour remote = projectile.gameObject.GetOrAddComponent <RemoteBulletsProjectileBehaviour>();

            remote.trackingTime = 1000;
            PillarocketFiring firing = projectile.gameObject.GetOrAddComponent <PillarocketFiring>();

            projectile.AnimateProjectile(new List <string> {
                "pillarocket_proj_001",
                "pillarocket_proj_002",
                "pillarocket_proj_003",
                "pillarocket_proj_004",
                "pillarocket_proj_005",
                "pillarocket_proj_006",
                "pillarocket_proj_007",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_009",
                "pillarocket_proj_010",
                "pillarocket_proj_011",
                "pillarocket_proj_012",
                "pillarocket_proj_013",
                "pillarocket_proj_014",
            }, 20,                                                                                                        //FPS
                                         true,                                                                            //LOOPS
                                         AnimateBullet.ConstructListOfSameValues <IntVector2>(new IntVector2(15, 8), 20), //PIXELSIZES
                                         AnimateBullet.ConstructListOfSameValues(false, 20),                              //LIGHTENEDS
                                         AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleLeft, 20),   //ANCHORS
                                         AnimateBullet.ConstructListOfSameValues(false, 20),                              //ANCHORSCHANGECOLLIDERS
                                         AnimateBullet.ConstructListOfSameValues(false, 20),
                                         AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 20),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(new IntVector2(15, 6), 20),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 20),
                                         AnimateBullet.ConstructListOfSameValues <Projectile>(null, 20));

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Pillarocket Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/pillarocket_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/pillarocket_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;
            gun.gunClass = GunClass.EXPLOSIVE;
            gun.quality  = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            Projectile akproj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(15) as Gun).DefaultModule.projectiles[0]);

            akproj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(akproj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(akproj);
            akproj.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);
            PillarocketAKProj = akproj;

            Projectile magnum = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(38) as Gun).DefaultModule.projectiles[0]);

            magnum.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(magnum.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(magnum);
            magnum.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);
            PillarocketMagnumProj = magnum;

            Projectile shotproj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(51) as Gun).DefaultModule.projectiles[0]);

            shotproj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(shotproj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(shotproj);
            shotproj.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);
            PillarocketShotgunProj = shotproj;
            ID = gun.PickupObjectId;
        }
Example #7
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("Sydney Sleeper", "piss");

            // "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:sydney_sleeper", "cak:sydney_sleeper");
            gun.gameObject.AddComponent <SydneySleeper>();
            //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("Jarate");
            gun.SetLongDescription("Professionals have standards. Unfortunatly, whoever made this gun did not.");
            // 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, "piss_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, 20);
            gun.SetAnimationFPS(gun.reloadAnimation, 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(PickupObjectDatabase.GetById(12) 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                        = 0.7f;
            gun.ForceLaserSight                   = true;
            gun.LaserSightIsGreen                 = true;
            gun.CriticalChance                    = 0.05f;
            gun.DefaultModule.cooldownTime        = 0.3f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.SetBaseMaxAmmo(50);

            gun.ForceLaserSight             = true;
            gun.DefaultModule.angleVariance = 0f;
            gun.barrelOffset.localPosition += new Vector3(0.5f, -0.4f, 0f);
            gun.gunSwitchGroup     = (PickupObjectDatabase.GetById(5) as Gun).gunSwitchGroup;
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(5) as Gun).muzzleFlashEffects;
            // 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.B;
            gun.encounterTrackable.EncounterGuid = "iampissgun";
            //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]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            gun.CriticalChance = 0.1f;
            //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.
            //Setting static values for a custom gun's projectile stats prevents them from scaling with player stats and bullet modifiers (damage, shotspeed, knockback)
            //You have to multiply the value of the original projectile you're using instead so they scale accordingly. For example if the projectile you're using as a base has 10 damage and you want it to be 6 you use this
            //In our case, our projectile has a base damage of 5.5, so we multiply it by 1.1 so it does 10% more damage from the ak-47.
            projectile.baseData.damage *= 0.5f;
            projectile.baseData.speed  *= 1f;
            projectile.transform.parent = gun.barrelOffset;
            //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("piss_projectile", 14, 5, null, null);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddItemToTrorcMetaShop(100, 100);
            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.EXAMPLE_BLUEPRINTTRUCK, true);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc, 1f);
            CakeIDs.PissGun = gun.PickupObjectId;
        }
Example #8
0
        // Token: 0x060000A0 RID: 160 RVA: 0x000063DC File Offset: 0x000045DC
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Lost Sidearm", "locrtfsf_alt");

            Game.Items.Rename("outdated_gun_mods:lost_sidearm", "bot:lost_gun_alt");
            gun.gameObject.AddComponent <LostGunAlt>();
            gun.SetShortDescription("No longer lost");
            gun.SetLongDescription("A weapons once belonging by a strange treveler.");
            gun.SetupSprite(null, "locrtfsf_alt_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 24);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(32) as Gun, true, false);

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.2f;
            //	gun.barrelOffset.transform.localPosition += new Vector3(1f, 0f, 0f);
            gun.DefaultModule.cooldownTime = 0.25f;
            gun.InfiniteAmmo = true;
            gun.DefaultModule.numberOfShotsInClip = 7;
            gun.SetBaseMaxAmmo(0);
            gun.gunHandedness = GunHandedness.OneHanded;
            gun.quality       = PickupObject.ItemQuality.EXCLUDED;
            Gun gun2 = PickupObjectDatabase.GetById(32) as Gun;
            Gun gun3 = PickupObjectDatabase.GetById(504) as Gun;

            gun.muzzleFlashEffects = gun2.muzzleFlashEffects;
            //gun.DefaultModule.ammoType = gun3.DefaultModule.ammoType;

            //gun.DefaultModule.customAmmoType = gun3.DefaultModule.customAmmoType;
            gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM;
            //gun.DefaultModule.customAmmoType =


            gun.muzzleFlashEffects = gun2.muzzleFlashEffects;



            //gun.DefaultModule.customAmmoType = "locrtfsf_alt_idle_001";

            //gun.encounterTrackable.EncounterGuid = "why wont you work please work im going mad2";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            Guid.NewGuid().ToString();
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.baseData.damage       = 6f;

            //projectile.baseData.speed *= 0.7f;
            //projectile.SetProjectileSpriteRight("locrtfsf_projectile_001", 7, 7, null, null);

            gunId = gun.PickupObjectId;



            //gun.DefaultModule.customAmmoType = gun3.DefaultModule.customAmmoType;
            //gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM;
            //gun.DefaultModule.customAmmoType =



            //	gun.DefaultModule.customAmmoType = "locrtfsf_idle_001";
            //Gun gun3 = PickupObjectDatabase.GetById(504) as Gun;
            //gun.DefaultModule.customAmmoType = gun3.CustomAmmoType;

            //gun.encounterTrackable.EncounterGuid = "why wont you work please work im going mad";
        }
        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("Sir lot o lance", "lnc");

            // "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:sir_lot_o_lance", "ski:sir_lot_o_lance");
            gun.gameObject.AddComponent <Lance>();
            //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("Now with 100% less horse");
            gun.SetLongDescription("\nThis is a terribly worn lance made from metal and dragun peices. It seems to have been forged as an attempt to relive adventures of a diffrent time. However, since this is the gungeon, this lance has been equipt with rocket bosters to avoid Kaliber's curse. \n\n" +
                                   "By far the most effective way to use this weapon is to slightly tilt it toward your adversary whilst you charge them." +
                                   "\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, "lnc_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, 2);
            // 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("camera_gun", true, true);

            // 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.HiddenOneHanded;
            gun.InfiniteAmmo                = true;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;

            gun.reloadTime = 0f;
            gun.DefaultModule.numberOfShotsInClip = int.MaxValue;
            gun.DefaultModule.cooldownTime        = .01f;
            gun.muzzleFlashEffects.type           = VFXPoolType.None;

            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "Big Pokey STICK!";

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

            gun.barrelOffset.transform.localPosition = new Vector3(0f, .5f, 0f);
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;

            projectile.baseData.damage          = 0f;
            projectile.baseData.speed          *= .20f;
            projectile.baseData.range           = .001f;
            projectile.PlayerKnockbackForce     = -7f;
            projectile.AppliesKnockbackToPlayer = true;
            projectile.baseData.force           = 45;
            projectile.AppliesStun         = true;
            projectile.AppliedStunDuration = .3f;
            projectile.StunApplyChance     = 1;


            projectile.transform.parent = gun.barrelOffset;


            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Example #10
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Red Diamond Cutter", "reddiamondcutter");

            Game.Items.Rename("outdated_gun_mods:red_diamond_cutter", "nn:diamond_cutter+ranger_class");
            var behav = gun.gameObject.AddComponent <DiamondCutterRangerClass>();

            behav.preventNormalReloadAudio = true;
            behav.preventNormalFireAudio   = true;
            behav.overrideNormalFireAudio  = "Play_WPN_blasphemy_shot_01";
            gun.SetShortDescription("Face It!");
            gun.SetLongDescription("Fires piercing gemstones." + "\n\nLeft in a chest by a powerful warrior of shimmering crystal... who didn't show up to work today.");

            gun.SetupSprite(null, "reddiamondcutter_idle_001", 8);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);

            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(97) as Gun).muzzleFlashEffects;

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

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.2f;
                mod.numberOfShotsInClip = 3;
                mod.angleVariance       = 20f;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage                   = 10f;
                projectile.baseData.speed                   *= 1.5f;
                projectile.hitEffects.alwaysUseMidair        = true;
                projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(506) as Gun).DefaultModule.projectiles[0].hitEffects.overrideMidairDeathVFX;

                PierceProjModifier pierce = projectile.gameObject.AddComponent <PierceProjModifier>();
                pierce.penetration = 10;
                MaintainDamageOnPierce maintain = projectile.gameObject.AddComponent <MaintainDamageOnPierce>();
                maintain.damageMultOnPierce      = 1.2f;
                projectile.pierceMinorBreakables = true;

                projectile.SetProjectileSpriteRight("diamondcutter_proj", 23, 13, false, tk2dBaseSprite.Anchor.MiddleCenter, 17, 5);
                mod.projectiles[0] = projectile;
                mod.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
                mod.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("RedDiamondCutter Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/reddiamondcutter_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/diamondcutter_clipempty");
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
            }


            gun.reloadTime = 0.8f;
            gun.barrelOffset.transform.localPosition = new Vector3(1.81f, 1.43f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo     = 100;
            gun.gunClass = GunClass.SILLY;

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

            //BULLET STATS


            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            RedDiamondCutterID = gun.PickupObjectId;
        }
Example #11
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
        }
Example #12
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Pop Gun", "popgun");

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

            behav.preventNormalReloadAudio = true;
            gun.SetShortDescription("Pop Goes");
            gun.SetLongDescription("A children's toy." + "\n\nFires pellets on a string to be reeled back into the barrel. Deals more damage while it's shots are being yanked back in.");

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

            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(28) as Gun).muzzleFlashEffects;

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0.7f;
            gun.DefaultModule.cooldownTime           = 0.7f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(1.31f, 0.43f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo     = 100;
            gun.gunClass = GunClass.SILLY;

            //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 = 10f;
            projectile.baseData.speed *= 1f;
            projectile.baseData.range *= 10f;

            projectile.gameObject.AddComponent <PopGunBullet>();

            BounceProjModifier bounce = projectile.gameObject.AddComponent <BounceProjModifier>();

            bounce.numberOfBounces += 10;

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

            pierce.penetration = 10;

            projectile.pierceMinorBreakables = true;

            projectile.SetProjectileSpriteRight("popgun_proj", 7, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 6, 6);
            gun.DefaultModule.projectiles[0] = projectile;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("PopGun Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/popgun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/popgun_clipempty");

            gun.quality = PickupObject.ItemQuality.D;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            PopGunID = gun.PickupObjectId;
        }
Example #13
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Unrusty Shotgun", "unrustyshotgun");

            Game.Items.Rename("outdated_gun_mods:unrusty_shotgun", "nn:rusty_shotgun+proper_care_and_maintenance");
            var behav = gun.gameObject.AddComponent <UnrustyShotgun>();

            gun.SetShortDescription("Past It's Prime");
            gun.SetLongDescription("This shotgun was cast aside to rust in a gutter years ago. Some of it's shots never even manage to fire!" + "\n\nPerhaps it just needs an understanding user to let it shine.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 13);
            gun.SetAnimationFPS(gun.idleAnimation, 5);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(51) as Gun).gunSwitchGroup;

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

            //GUN STATS
            int iterator = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.5f;
                mod.angleVariance       = 10f;
                mod.numberOfShotsInClip = 3;
                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.range *= 0.7f;
                projectile.baseData.damage = 8f;
                if (iterator.isEven())
                {
                    BounceProjModifier Bouncing = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();
                    Bouncing.numberOfBounces = 1;
                }
                else
                {
                    PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                    pierce.penetration = 1;
                }
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
                iterator++;
            }

            gun.reloadTime = 1.5f;
            gun.barrelOffset.transform.localPosition = new Vector3(2.0f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.gunClass = GunClass.SHOTGUN;
            //BULLET STATS
            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            gun.Volley.UsesShotgunStyleVelocityRandomizer = true;

            UnrustyShotgunID = gun.PickupObjectId;
        }
Example #14
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("Lich's Trigger Hand", "hand");

            // "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:lich's_trigger_hand", "ski:lich's_trigger_hand");
            gun.gameObject.AddComponent <Za_hando>();

            //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("I'll scrape you away!");
            gun.SetLongDescription("The lich was infamous for scooping up the gundead to use as ammunitions. Though the trigger finger has been torn off, much of its original power still remains.\n\n" +
                                   "_____________________________________________________\n\n" +
                                   "This weapon consumes all entities in a ~3 meter range when reloading, EXCEPT for Major Bosses, Mimics, NPcs and Companions.");
            // 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, "hand_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, 8);
            gun.SetAnimationFPS(gun.reloadAnimation, 8);
            // 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("balloon_gun", true, true);
            // 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.DefaultModule.angleVariance = 0f;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.HiddenOneHanded;
            gun.reloadTime    = 1.5f;
            gun.DefaultModule.cooldownTime        = .01f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.SetBaseMaxAmmo(300);
            // 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 = "Oi Josuke!";
            //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]);

            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.
            //Setting static values for a custom gun's projectile stats prevents them from scaling with player stats and bullet modifiers (damage, shotspeed, knockback)
            //You have to multiply the value of the original projectile you're using instead so they scale accordingly. For example if the projectile you're using as a base has 10 damage and you want it to be 6 you use this
            //In our case, our projectile has a base damage of 5.5, so we multiply it by 1.1 so it does 10% more damage from the ak-47.
            projectile.baseData.damage        *= 0f;
            projectile.baseData.speed         *= 1f;
            projectile.baseData.range          = 1.5f;
            projectile.baseData.force          = -15;
            projectile.AppliedStunDuration     = 2.5f;
            projectile.StunApplyChance         = 100f;
            projectile.AppliesStun             = true;
            projectile.HasDefaultTint          = true;
            projectile.DefaultTintColor        = UnityEngine.Color.blue;
            projectile.collidesWithProjectiles = true;
            projectile.projectileHitHealth     = 100;

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

            Game.Items.Rename("outdated_gun_mods:dimensionaliser", "nn:dimensionaliser");
            gun.gameObject.AddComponent <Dimensionaliser>();
            gun.SetShortDescription("The Multiverse!");
            gun.SetLongDescription("Opens portals to random segments of the multiverse, letting kaliber-knows-what through." + "\n\n");

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

            gun.SetAnimationFPS(gun.shootAnimation, 14);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 2f;
            gun.DefaultModule.angleVariance          = 7;
            gun.muzzleFlashEffects                   = (PickupObjectDatabase.GetById(89) as Gun).muzzleFlashEffects;
            gun.DefaultModule.numberOfShotsInClip    = 2;
            gun.barrelOffset.transform.localPosition = new Vector3(0.81f, 0.43f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo     = 100;
            gun.gunClass = GunClass.SILLY;
            Projectile portalSubProj = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            portalSubProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(portalSubProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(portalSubProj);
            portalSubProj.baseData.damage = 5f;
            portalSubProj.baseData.speed *= 1f;
            portalSubProj.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.GreenLaserCircleVFX;
            portalSubProj.hitEffects.alwaysUseMidair        = true;
            portalSubProj.SetProjectileSpriteRight("dimensionaliser_projectile", 12, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 5);

            Projectile portal = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            portal.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(portal.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(portal);
            portal.baseData.damage = 0f;
            portal.baseData.speed  = 0f;
            portal.specRigidbody.CollideWithTileMap = false;
            portal.pierceMinorBreakables            = true;
            DimensionaliserPortal portalComp = portal.gameObject.GetOrAddComponent <DimensionaliserPortal>();

            portalComp.subProj = portalSubProj;
            NoCollideBehaviour noCollide = portal.gameObject.GetOrAddComponent <NoCollideBehaviour>();

            noCollide.worksOnEnemies                 = true;
            noCollide.worksOnProjectiles             = true;
            portal.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.GreenLaserCircleVFX;
            portal.hitEffects.alwaysUseMidair        = true;
            portal.AnimateProjectile(new List <string> {
                "dimensionaliser_portal_001",
                "dimensionaliser_portal_002",
                "dimensionaliser_portal_003",
                "dimensionaliser_portal_004",
                "dimensionaliser_portal_005",
                "dimensionaliser_portal_006",
                "dimensionaliser_portal_007",
                "dimensionaliser_portal_008",
                "dimensionaliser_portal_009",
                "dimensionaliser_portal_010", //TEN
                "dimensionaliser_portal_011",
                "dimensionaliser_portal_012",
                "dimensionaliser_portal_013",
                "dimensionaliser_portal_014",
                "dimensionaliser_portal_015",
                "dimensionaliser_portal_016",
                "dimensionaliser_portal_017",
                "dimensionaliser_portal_018",
                "dimensionaliser_portal_019",
                "dimensionaliser_portal_020", //TEN
                "dimensionaliser_portal_021",
                "dimensionaliser_portal_022",
                "dimensionaliser_portal_023",
                "dimensionaliser_portal_024",
                "dimensionaliser_portal_025",
                "dimensionaliser_portal_026",
                "dimensionaliser_portal_027",
                "dimensionaliser_portal_028",
                "dimensionaliser_portal_029",
                "dimensionaliser_portal_030", //TEN
                "dimensionaliser_portal_031",
                "dimensionaliser_portal_032",
                "dimensionaliser_portal_033",
                "dimensionaliser_portal_034",
                "dimensionaliser_portal_035",
                "dimensionaliser_portal_036",
                "dimensionaliser_portal_037",
                "dimensionaliser_portal_038",
                "dimensionaliser_portal_039",
                "dimensionaliser_portal_040", //TEN
                "dimensionaliser_portal_041",
                "dimensionaliser_portal_042",
                "dimensionaliser_portal_043",
                "dimensionaliser_portal_044",
                "dimensionaliser_portal_045",
                "dimensionaliser_portal_046",
                "dimensionaliser_portal_047",
                "dimensionaliser_portal_048",
                "dimensionaliser_portal_049",
                "dimensionaliser_portal_050", //TEN
                "dimensionaliser_portal_051",
                "dimensionaliser_portal_052",
                "dimensionaliser_portal_053",
                "dimensionaliser_portal_054",
                "dimensionaliser_portal_055",
                "dimensionaliser_portal_056",
                "dimensionaliser_portal_057",
                "dimensionaliser_portal_058",
                "dimensionaliser_portal_059",
                "dimensionaliser_portal_060", //TEN
                "dimensionaliser_portal_061",
                "dimensionaliser_portal_062",
                "dimensionaliser_portal_063",
                "dimensionaliser_portal_064",
                "dimensionaliser_portal_065",
                "dimensionaliser_portal_066",
                "dimensionaliser_portal_067",
                "dimensionaliser_portal_068",
                "dimensionaliser_portal_069",
                "dimensionaliser_portal_070", //TEN
                "dimensionaliser_portal_071",
                "dimensionaliser_portal_072",
                "dimensionaliser_portal_073",
                "dimensionaliser_portal_074",
                "dimensionaliser_portal_075",
                "dimensionaliser_portal_076",
                "dimensionaliser_portal_077",
                "dimensionaliser_portal_078",
                "dimensionaliser_portal_079",
                "dimensionaliser_portal_080", //TEN
                "dimensionaliser_portal_081",
                "dimensionaliser_portal_082",
                "dimensionaliser_portal_083",
                "dimensionaliser_portal_084",
                "dimensionaliser_portal_085",
                "dimensionaliser_portal_086",
                "dimensionaliser_portal_087",
                "dimensionaliser_portal_088",
                "dimensionaliser_portal_089",
                "dimensionaliser_portal_090",                                                                           //TEN
            },
                                     40,                                                                                //FPS
                                     true,                                                                              //Loops
                                     AnimateBullet.ConstructListOfSameValues(new IntVector2(55, 55), 90),               //Sprite Sizes
                                     AnimateBullet.ConstructListOfSameValues(true, 90),                                 //Lightened
                                     AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 90),   //Anchors
                                     AnimateBullet.ConstructListOfSameValues(true, 90),                                 //Anchors Change Colliders
                                     AnimateBullet.ConstructListOfSameValues(false, 90),                                //Fixes Scales
                                     AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 90),                      //Manual Offsets
                                     AnimateBullet.ConstructListOfSameValues <IntVector2?>(new IntVector2(30, 30), 90), //Collider Pixel Sizes
                                     AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 90),                   //Override Collider Offsets
                                     AnimateBullet.ConstructListOfSameValues <Projectile>(null, 90));


            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 = 1f;
            projectile.baseData.speed *= 3f;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.GreenLaserCircleVFX;
            projectile.hitEffects.alwaysUseMidair        = true;
            DimensionaliserProjectile dimensionaliserProj = projectile.gameObject.GetOrAddComponent <DimensionaliserProjectile>();

            dimensionaliserProj.portalPrefab = portal.gameObject;
            projectile.SetProjectileSpriteRight("dimensionaliser_projectile", 12, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 5);
            gun.DefaultModule.projectiles[0] = projectile;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Dimensionaliser Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/dimensionaliser_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/dimensionaliser_clipempty");

            gun.quality = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            DimensionaliserID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Sick Worm", "sickworm");

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

            behav.preventNormalFireAudio = true;
            gun.SetShortDescription("Projectile Vomit");
            gun.SetLongDescription("A rare example of Gungeon Gigantism, this worm has developed a remarkable evolutionary defence mechanism; regurgitating high-speed digestive juices at potential predators.");

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

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

            //GUN STATS
            gun.doesScreenShake             = false;
            gun.DefaultModule.ammoCost      = 10;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Beam;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.cooldownTime           = 0.001f;
            gun.DefaultModule.numberOfShotsInClip    = 2000;
            gun.DefaultModule.ammoType               = GameUIAmmoType.AmmoType.BEAM;
            gun.barrelOffset.transform.localPosition = new Vector3(1.06f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(2000);
            gun.ammo     = 2000;
            gun.gunClass = GunClass.SILLY;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).loopStart = 1;

            List <string> BeamAnimPaths = new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/sickworm_mid_001",
            };
            List <string> BeamEndPaths = new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/sickworm_end_001",
            };

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

            BasicBeamController beamComp = projectile.GenerateBeamPrefab(
                "NevernamedsItems/Resources/BeamSprites/sickworm_mid_001",
                new Vector2(8, 8),
                new Vector2(0, 1),
                BeamAnimPaths,
                9,
                //Impact
                null,
                -1,
                null,
                null,
                //End
                BeamEndPaths,
                9,
                new Vector2(8, 8),
                new Vector2(0, 1),
                //Beginning
                null,
                -1,
                null,
                null
                );

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage = 30f;
            projectile.baseData.force *= 1f;
            projectile.baseData.range  = 7f;
            projectile.baseData.speed *= 0.7f;

            beamComp.penetration = 2;
            beamComp.boneType    = BasicBeamController.BeamBoneType.Projectile;
            beamComp.interpolateStretchedBones = false;
            beamComp.endAudioEvent             = "Stop_WPN_All";
            beamComp.startAudioEvent           = "Play_WPN_SeriousCannon_Scream_01";


            Projectile spewProj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            spewProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(spewProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(spewProj);
            spewProj.SetProjectileSpriteRight("sickworm_projectile", 5, 5, false, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);
            spewProj.baseData.damage = 2;
            RandomProjectileStatsComponent randomStats = spewProj.gameObject.AddComponent <RandomProjectileStatsComponent>();

            randomStats.randomScale = true;
            randomStats.randomSpeed = true;

            BeamProjSpewModifier spew = projectile.gameObject.AddComponent <BeamProjSpewModifier>();

            spew.bulletToSpew     = spewProj;
            spew.accuracyVariance = 5;


            gun.DefaultModule.projectiles[0] = projectile;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("SickWorm Clip", "NevernamedsItems/Resources/CustomGunAmmoTypes/sickworm_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/sickworm_clipempty");

            gun.quality = PickupObject.ItemQuality.A; //D
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Grandfather Glock", "grandfatherglock");

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

            behav.overrideNormalReloadAudio = "Play_BOSS_mineflayer_bellshot_01";
            behav.preventNormalReloadAudio  = true;
            gun.SetShortDescription("It's About Time");
            gun.SetLongDescription("Fires bullets in directions that correspond to it's hands in order to tell the current time." + "\n\nThe Gunslinger's clock was too large for the case," +
                                   "\nSo it sat ninety years on the floor." +
                                   "\nIt was longer by half than the old man himself," +
                                   "\nThough it weighed not a pennyweight more." +
                                   "\n\nIt was forged on the morn on the day that he was born," +
                                   "\nAnd was always his treasure and pride." +
                                   "\nBut it jammed, hard, never to shoot again," +
                                   "\nWhen the old man died.");

            gun.SetupSprite(null, "grandfatherglock_idle_001", 8);
            gun.gunSwitchGroup          = (PickupObjectDatabase.GetById(56) as Gun).gunSwitchGroup;
            gun.muzzleFlashEffects.type = VFXPoolType.None;


            gun.SetAnimationFPS(gun.shootAnimation, 12);

            for (int i = 0; i < 3; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            }
            //Easy Variables to Change all the Modules
            float AllModCooldown  = 0.35f;
            int   AllModClipshots = 12;


            int i2 = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                if (i2 <= 0) //Hour hand
                {
                    mod.ammoCost            = 0;
                    mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                    mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                    mod.cooldownTime        = AllModCooldown;
                    mod.angleVariance       = 0.1f;
                    mod.numberOfShotsInClip = AllModClipshots;

                    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.baseData.speed       *= 0.6f;
                    projectile.baseData.range       *= 2f;
                    projectile.pierceMinorBreakables = true;
                    TimeBasedBulletAimer orAddComponent = projectile.gameObject.GetOrAddComponent <TimeBasedBulletAimer>();
                    orAddComponent.aimType = TimeBasedBulletAimer.ClockHandAimType.HOUR_HAND;
                    projectile.SetProjectileSpriteRight("grandfatherglock_hourhand_projectile", 19, 11, true, tk2dBaseSprite.Anchor.MiddleCenter, 18, 10);
                    i2++;
                }
                else if (i2 == 1) //Minute hand
                {
                    mod.ammoCost            = 1;
                    mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                    mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                    mod.cooldownTime        = AllModCooldown;
                    mod.angleVariance       = 0.1f;
                    mod.numberOfShotsInClip = AllModClipshots;

                    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      *= 3f;
                    projectile.baseData.speed       *= 0.7f;
                    projectile.pierceMinorBreakables = true;
                    projectile.baseData.range       *= 2f;
                    TimeBasedBulletAimer orAddComponent = projectile.gameObject.GetOrAddComponent <TimeBasedBulletAimer>();
                    orAddComponent.aimType = TimeBasedBulletAimer.ClockHandAimType.MINUTE_HAND;
                    projectile.SetProjectileSpriteRight("grandfatherglock_minutehand_projectile", 26, 9, true, tk2dBaseSprite.Anchor.MiddleCenter, 25, 8);
                    i2++;
                }
                else if (i2 >= 2) //Second hand
                {
                    mod.ammoCost            = 0;
                    mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                    mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                    mod.cooldownTime        = AllModCooldown;
                    mod.angleVariance       = 0.1f;
                    mod.numberOfShotsInClip = AllModClipshots;

                    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      *= 1f;
                    projectile.pierceMinorBreakables = true;
                    projectile.baseData.speed       *= 0.7f;
                    projectile.baseData.range       *= 2f;
                    //TrailController trail = projectile.gameObject.GetOrAddComponent<TrailController>();

                    TimeBasedBulletAimer orAddComponent = projectile.gameObject.GetOrAddComponent <TimeBasedBulletAimer>();
                    orAddComponent.aimType = TimeBasedBulletAimer.ClockHandAimType.SECOND_HAND;
                    projectile.SetProjectileSpriteRight("grandfatherglock_secondhand_projectile", 22, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 21, 4);
                    i2++;
                }
            }
            gun.reloadTime = 1.4f;
            gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.68f, 0f);
            gun.SetBaseMaxAmmo(300);

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Grandfather Glock Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/grandfatherglock_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/grandfatherglock_clipempty");

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

            GrandfatherGlockID = gun.PickupObjectId;
        }
Example #18
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;
        }
Example #19
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;
        }
        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;
        }
Example #21
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()
        {
            // 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("Holstergeist 5000", "Succ");

            // "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:holstergeist_5000", "ski:holstergeist_5000");
            gun.gameObject.AddComponent <Succ>();
            //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("Some Dust Bunnys Worst Nightmare");
            gun.SetLongDescription("Ashes to ashes... \n" +
                                   "Dust to dust... \n" +
                                   "To more dust.. \n" +
                                   "Where did all this dust come from?\n" +
                                   "Capture up to 5 enemies in your bag and fire them upon reloading. " +
                                   "Reload can be done at full ammo. " +
                                   "Enemies loaded Over 5 get deleted. " +
                                   "Some enemies shoot with a delay because of how they spawn in. " +
                                   "Enemies with more health will put up more of a fight when you capture them. \n" +
                                   "Now you too can hit a dude with another dude!" +
                                   "\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, "Succ_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, 10);
            gun.SetAnimationFPS(gun.reloadAnimation, 8);
            // 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("Hegemony Rifle") 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      = 2;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2f;
            gun.DefaultModule.cooldownTime        = .05f;
            gun.DefaultModule.numberOfShotsInClip = 60;
            gun.SetBaseMaxAmmo(2000);
            gun.CurrentAmmo                  = 2000;
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "red_beam";
            gun.muzzleFlashEffects           = null;
            gun.usesContinuousFireAnimation  = true;
            // 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 = "https://www.youtube.com/watch?v=GKRA7-ZqxSM";
            //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]);

            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.
            //Setting static values for a custom gun's projectile stats prevents them from scaling with player stats and bullet modifiers (damage, shotspeed, knockback)
            //You have to multiply the value of the original projectile you're using instead so they scale accordingly. For example if the projectile you're using as a base has 10 damage and you want it to be 6 you use this
            //In our case, our projectile has a base damage of 5.5, so we multiply it by 1.1 so it does 10% more damage from the ak-47.
            projectile.baseData.damage  = 0f;
            projectile.baseData.speed  *= 1f;
            projectile.baseData.force   = -2f;
            projectile.transform.parent = gun.barrelOffset;



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

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

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

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

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



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

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

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

            gun.quality = PickupObject.ItemQuality.B;

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

            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.BOSSRUSH_HUNTER, true);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Rico", "rico");

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

            behav.preventNormalFireAudio = true;
            gun.SetShortDescription("Cosmic Ray Spallation");
            gun.SetLongDescription("The lack of any radiation filtering on this homemade energy blaster causes it's playload to ricochet uncontrollably off of surfaces!");

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

            gun.SetAnimationFPS(gun.shootAnimation, 9);
            gun.isAudioLoop = true;
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            gun.gunHandedness = GunHandedness.OneHanded;
            //GUN STATS
            gun.doesScreenShake             = false;
            gun.DefaultModule.ammoCost      = 5;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Beam;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.cooldownTime           = 0.001f;
            gun.DefaultModule.numberOfShotsInClip    = 1000;
            gun.DefaultModule.ammoType               = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType         = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Rico Laser", "NevernamedsItems/Resources/CustomGunAmmoTypes/rico_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/genericbeam_clipempty");
            gun.barrelOffset.transform.localPosition = new Vector3(1.31f, 0.49f, 0f);
            gun.SetBaseMaxAmmo(1000);
            gun.ammo     = 1000;
            gun.gunClass = GunClass.BEAM;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).loopStart = 1;

            List <string> BeamAnimPaths = new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/limebeam_mid_001",
                "NevernamedsItems/Resources/BeamSprites/limebeam_mid_002",
                "NevernamedsItems/Resources/BeamSprites/limebeam_mid_003",
                "NevernamedsItems/Resources/BeamSprites/limebeam_mid_004",
            };
            List <string> BeamImpactPaths = new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/limebeam_impact_001",
                "NevernamedsItems/Resources/BeamSprites/limebeam_impact_002",
                "NevernamedsItems/Resources/BeamSprites/limebeam_impact_003",
                "NevernamedsItems/Resources/BeamSprites/limebeam_impact_004",
            };

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

            BasicBeamController beamComp = projectile.GenerateBeamPrefab(
                "NevernamedsItems/Resources/BeamSprites/limebeam_mid_001",
                new Vector2(6, 4),
                new Vector2(0, 1),
                BeamAnimPaths,
                9,
                //Impact
                BeamImpactPaths,
                13,
                new Vector2(4, 4),
                new Vector2(7, 7),
                //End
                null,
                -1,
                null,
                null,
                //Beginning
                null,
                -1,
                null,
                null
                );

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage = 7f;
            projectile.baseData.force *= 1f;
            projectile.baseData.range *= 200;

            projectile.baseData.speed *= 10f;
            beamComp.boneType          = BasicBeamController.BeamBoneType.Straight;
            beamComp.reflections       = 7;
            beamComp.startAudioEvent   = "Play_WPN_radiationlaser_shot_01";
            beamComp.endAudioEvent     = "Stop_WPN_All";
            //beamComp.interpolateStretchedBones = false;

            gun.DefaultModule.projectiles[0] = projectile;

            gun.quality = PickupObject.ItemQuality.C; //D
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            RicoID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("King Bullatterer", "kingbullatterer");

            Game.Items.Rename("outdated_gun_mods:king_bullatterer", "nn:bullatterer+king_bullatterer");
            gun.gameObject.AddComponent <Bullatterer>();
            gun.SetShortDescription("djahksdhkssdfdfssdf");
            gun.SetLongDescription("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            gun.SetupSprite(null, "kingbullatterer_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 13);
            gun.SetAnimationFPS(gun.idleAnimation, 13);
            for (int i = 0; i < 13; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }
            gun.muzzleFlashEffects.type = VFXPoolType.None;

            //GUN STATS
            gun.reloadTime = 1.5f;
            gun.barrelOffset.transform.localPosition = new Vector3(1.25f, 0.43f, 0f);
            gun.SetBaseMaxAmmo(400);
            gun.ammo = 400;

            Projectile bouncerProj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            bouncerProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bouncerProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bouncerProj);
            bouncerProj.baseData.damage *= 1.2f;
            bouncerProj.baseData.speed  *= 0.65f;
            bouncerProj.SetProjectileSpriteRight("yellow_enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);

            BounceProjModifier bouncing = bouncerProj.gameObject.GetOrAddComponent <BounceProjModifier>();

            bouncing.numberOfBounces = 1;

            Projectile bullatSpawnerProj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            bullatSpawnerProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bullatSpawnerProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bullatSpawnerProj);
            bullatSpawnerProj.baseData.damage        *= 0f;
            bullatSpawnerProj.sprite.renderer.enabled = false;
            bullatSpawnerProj.pierceMinorBreakables   = true;
            SpawnEnemyOnBulletSpawn orAddComponent = bullatSpawnerProj.gameObject.GetOrAddComponent <SpawnEnemyOnBulletSpawn>();

            orAddComponent.companioniseEnemy              = true;
            orAddComponent.deleteProjAfterSpawn           = true;
            orAddComponent.enemyBulletDamage              = 15f;
            orAddComponent.guidToSpawn                    = EnemyGuidDatabase.Entries["bullat"];
            orAddComponent.ignoreSpawnedEnemyForGoodMimic = true;
            orAddComponent.killSpawnedEnemyOnRoomClear    = true;
            orAddComponent.procChance                  = 1f;
            orAddComponent.scaleEnemyDamage            = true;
            orAddComponent.scaleEnemyProjSize          = true;
            orAddComponent.scaleEnemyProjSpeed         = true;
            orAddComponent.doPostProcessOnEnemyBullets = false;

            int i2 = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.numberOfShotsInClip = 15;
                mod.cooldownTime        = 0.55f;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.shootStyle          = ProjectileModule.ShootStyle.Automatic;


                if (i2 <= 0) //bullatProj
                {
                    mod.ammoCost       = 1;
                    mod.angleVariance  = 0.01f;
                    mod.angleFromAim   = 0f;
                    mod.projectiles[0] = bullatSpawnerProj;
                    i2++;
                }
                else if (i2 == 1) //0 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 0f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 2) //30 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 30f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 3) //60 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 60f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 4) //90 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 90f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 5) //120 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 120f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 6) //150 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 150f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 7) //180 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 180f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 8) //-30 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -30f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 9) //-60 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -60f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 10) //-90 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -90f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 11) //-120 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -120f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 >= 12) //-150 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -150f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
            }

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

            KingBullattererID = gun.PickupObjectId;
        }
Example #26
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("violin-ce", "vio");

            // "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:violin-ce", "ski:violin-ce");
            gun.gameObject.AddComponent <violin>();
            //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("A bet well won");
            gun.SetLongDescription("A Fiddle won from the lord of the jammed himself in a contest.\n\n" +
                                   "Draw your bow and play till your tired. Then rest up and go again.");
            // 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, "vio_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, 24);
            // 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("Camera_Gun", true, true);

            // 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 = 5f;
            gun.LocalActiveReload           = true;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Burst;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2f;
            gun.GainsRateOfFireAsContinueAttack       = true;
            gun.RateOfFireMultiplierAdditionPerSecond = 1.5f;
            gun.DefaultModule.burstShotCount          = 999;
            gun.DefaultModule.cooldownTime            = 3f;
            gun.DefaultModule.numberOfShotsInClip     = clip;
            gun.SetBaseMaxAmmo(5000);
            // 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.B;
            gun.encounterTrackable.EncounterGuid = "Im the best thats ever been";
            //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]);

            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.
            //Setting static values for a custom gun's projectile stats prevents them from scaling with player stats and bullet modifiers (damage, shotspeed, knockback)
            //You have to multiply the value of the original projectile you're using instead so they scale accordingly. For example if the projectile you're using as a base has 10 damage and you want it to be 6 you use this
            //In our case, our projectile has a base damage of 5.5, so we multiply it by 1.1 so it does 10% more damage from the ak-47.
            projectile.baseData.damage *= 1f;
            projectile.baseData.speed  *= 1f;
            projectile.transform.parent = gun.barrelOffset;


            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Example #27
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Guneonate", "guneonate");

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

            behav.overrideNormalFireAudio   = "Play_VO_bashellisk_hiss_01";
            behav.overrideNormalReloadAudio = "Play_BOSS_bashellisk_swallow_01";
            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            gun.SetShortDescription("Babyconda");
            gun.SetLongDescription("A hatchling ammoconda, formed from fresh discarded bullet casings." + "\n\nIt seems to have self esteem issues.");

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

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

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.45f;
            gun.DefaultModule.angleVariance          = 0;
            gun.DefaultModule.numberOfShotsInClip    = 3;
            gun.barrelOffset.transform.localPosition = new Vector3(2.0f, 0.25f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.ammo     = 200;
            gun.gunClass = GunClass.SILLY;

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

            projectile.SpawnShadowBulletsOnSpawn = true;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage *= 2f;
            projectile.baseData.force  *= 1f;
            projectile.baseData.speed  *= 0.5f;
            projectile.baseData.range  *= 2f;
            PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            pierce.penetration++;
            pierce.penetratesBreakables = true;
            //AutoDoShadowChainOnSpawn snakeness = projectile.gameObject.GetOrAddComponent<AutoDoShadowChainOnSpawn>();

            projectile.NumberInChain = 5;
            projectile.pauseLength   = 0.05f;
            projectile.SetProjectileSpriteRight("12x12_yellowenemy_projectile", 12, 12, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 10);


            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Guneonate Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/guneonate_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/guneonate_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;

            gun.quality = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            GuneonateID = gun.PickupObjectId;
        }
Example #28
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Alchemical Gun", "alchemiser");

            Game.Items.Rename("outdated_gun_mods:alchemical_gun", "rtr:alchemical_gun");
            gun.gameObject.AddComponent <Alchemiser>();
            gun.SetShortDescription("Toxic Transmutation");
            gun.SetLongDescription("Transmutes poisoned enemies. Reload to create dangerous poisonous liquid.\n\n" +
                                   "The Alchemical Gun was created by an ancient denizen of the Oubliette. Some say the toxic environment was used by its owner to test the gun's capabilities. However, many suggest he had merely lost his mind being trapped in the sewers for so long.");
            gun.SetupSprite(null, "alchemiser_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.reloadAnimation, 8);
            Gun targetGun  = PickupObjectDatabase.GetById(577) as Gun;
            Gun targetGun2 = PickupObjectDatabase.GetById(577) as Gun;

            gun.AddProjectileModuleFrom(targetGun2, true, false);
            gun.SetBaseMaxAmmo(300);
            gun.DefaultModule.customAmmoType = targetGun.DefaultModule.customAmmoType;
            gun.DefaultModule.ammoType       = targetGun.DefaultModule.ammoType;
            gun.DefaultModule.ammoCost       = 1;
            gun.DefaultModule.shootStyle     = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.damageModifier = 1;
            gun.reloadTime     = 1.3f;
            gun.barrelOffset.transform.localPosition += new Vector3(-0.1f, -0f, 0);
            gun.DefaultModule.cooldownTime            = 0.2f;
            gun.DefaultModule.numberOfShotsInClip     = 10;
            gun.DefaultModule.angleVariance           = 6f;
            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "alchemiser";
            gun.gunClass     = GunClass.RIFLE;
            gun.CanBeDropped = true;
            Gun component = PickupObjectDatabase.GetById(61) as Gun;

            gun.muzzleFlashEffects = component.muzzleFlashEffects;

            //CREATES NEW PROJECTILE
            Projectile NewProjectileAlch = Instantiate <Projectile>(targetGun.DefaultModule.projectiles[0]);

            NewProjectileAlch.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(NewProjectileAlch.gameObject);
            DontDestroyOnLoad(NewProjectileAlch);
            gun.DefaultModule.projectiles[0]   = NewProjectileAlch;
            NewProjectileAlch.transform.parent = gun.barrelOffset;

            NewProjectileAlch.AdditionalScaleMultiplier *= 1.1f;

            AssetBundle assetBundle = ResourceManager.LoadAssetBundle("shared_auto_001");

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

            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Example #29
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("O'Brien Fist", "obrienfist");

            Game.Items.Rename("outdated_gun_mods:o'brien_fist", "nn:obrien_fist");
            gun.gameObject.AddComponent <OBrienFist>();
            gun.SetShortDescription("Bathe In the Fire");
            gun.SetLongDescription("The limb of a lumbering tortured golem who sought the Gungeon to sate his bloodlust." + "\n\nYour enemies will run, or face your rage.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 16);

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

            //GUN STATS
            gun.gunHandedness               = GunHandedness.HiddenOneHanded;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.08f;
            gun.DefaultModule.angleVariance          = 7;
            gun.muzzleFlashEffects                   = (PickupObjectDatabase.GetById(23) as Gun).muzzleFlashEffects;
            gun.DefaultModule.numberOfShotsInClip    = 30;
            gun.barrelOffset.transform.localPosition = new Vector3(17f / 16f, 2f / 16f, 0f);
            gun.SetBaseMaxAmmo(500);
            gun.ammo     = 500;
            gun.gunClass = GunClass.FULLAUTO;

            Projectile flame = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(336) as Gun).DefaultModule.projectiles[0]);

            flame.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(flame.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(flame);

            Projectile flame2 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(722) as Gun).DefaultModule.projectiles[0]);

            flame2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(flame2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(flame2);

            Projectile splitter = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            splitter.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(splitter.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(splitter);
            splitter.sprite.renderer.enabled = false;
            SneakyShotgunComponent sneakyShot = splitter.gameObject.GetOrAddComponent <SneakyShotgunComponent>();

            sneakyShot.eraseSource               = true;
            sneakyShot.doVelocityRandomiser      = true;
            sneakyShot.postProcess               = true;
            sneakyShot.projPrefabToFire          = flame;
            sneakyShot.scaleOffOwnerAccuracy     = true;
            sneakyShot.numToFire                 = 6;
            sneakyShot.angleVariance             = 45f;
            sneakyShot.overrideProjectileSynergy = "The Green Room Pale";
            sneakyShot.synergyProjectilePrefab   = flame2;

            gun.DefaultModule.finalProjectile             = splitter;
            gun.DefaultModule.usesOptionalFinalProjectile = true;
            gun.DefaultModule.numberOfFinalProjectiles    = 1;

            gun.quality = PickupObject.ItemQuality.A;
            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;
        }