Пример #1
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Justice", "justice");

            Game.Items.Rename("outdated_gun_mods:justice", "nn:justice");
            gun.gameObject.AddComponent <JusticeGun>();
            gun.SetShortDescription("Served");
            gun.SetLongDescription("Bello's trusty shotgun, custom made for his big, burly hands.");

            gun.SetupSprite(null, "justice_idle_001", 8);
            //ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.GlobalPriceMultiplier, 0.925f, StatModifier.ModifyMethod.MULTIPLICATIVE);

            gun.SetAnimationFPS(gun.shootAnimation, 8);
            gun.SetAnimationFPS(gun.reloadAnimation, 8);
            gun.AddPassiveStatModifier(PlayerStats.StatType.GlobalPriceMultiplier, 0.8f, StatModifier.ModifyMethod.MULTIPLICATIVE);

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

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.6f;
                mod.angleVariance       = 45f;
                mod.numberOfShotsInClip = 5;
                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       *= 1.2f;
                projectile.pierceMinorBreakables = true;
                JusticeBurstHandler BurstPop = projectile.gameObject.AddComponent <JusticeBurstHandler>();

                projectile.SetProjectileSpriteRight("justice_projectile", 12, 12, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 10);
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
            }

            gun.reloadTime = 2f;
            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.barrelOffset.transform.localPosition = new Vector3(3.12f, 0.93f, 0f);
            gun.SetBaseMaxAmmo(80);
            gun.gunClass = GunClass.SHOTGUN;
            //BULLET STATS
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Justice Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/justice_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/justice_clipempty");

            // 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 = "this is Justice";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            JusticeID = gun.PickupObjectId;
            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.ANGERED_BELLO, true);
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Super Bullat Launcher", "superbatlauncher");

            Game.Items.Rename("outdated_gun_mods:super_bullat_launcher", "spapi:bullat_launcher+king_bullat_shooter");
            GunExt.SetShortDescription(gun, "Fires Bullats");
            GunExt.SetLongDescription(gun, "Shoots angry bullats.\n\nCatching Bullats is fairly easy and every good gundead hunter has to have a Bullat collection. Frifle through had an idea to weaponize his collection, and made this gun.");
            GunExt.SetupSprite(gun, null, "superbatlauncher_idle_001", 12);
            for (int i = 0; i < 12; i++)
            {
                GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            }
            int j = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.angleVariance       = 0;
                mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                mod.cooldownTime        = 0.5f;
                mod.numberOfShotsInClip = 10;
                Projectile projectile = Instantiate(Toolbox.GetGunById(38).DefaultModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                DontDestroyOnLoad(projectile);
                projectile.transform.parent = gun.barrelOffset;
                projectile.baseData.damage  = 15f;
                projectile.name             = "SuperBullat_Projectile";
                BounceProjModifier modifier = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();
                modifier.numberOfBounces = 1;
                mod.chargeProjectiles    = new List <ProjectileModule.ChargeProjectile>
                {
                    new ProjectileModule.ChargeProjectile
                    {
                        ChargeTime = 1.5f,
                        Projectile = projectile
                    }
                };
                mod.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
                mod.customAmmoType = "finished small";
                mod.angleFromAim   = j * 30;
                j++;
            }
            AdvancedGunBehaviour advancedGunBehaviour = gun.gameObject.AddComponent <AdvancedGunBehaviour>();

            advancedGunBehaviour.preventNormalFireAudio = true;
            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.reloadTime    = 1.5f;
            gun.gunHandedness = GunHandedness.OneHanded;
            gun.SetBaseMaxAmmo(50);
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.EXCLUDED;
            gun.barrelOffset.transform.localPosition = new Vector3(1.625f, 1.5625f, 0f);
            gun.encounterTrackable.EncounterGuid     = "superbatlauncher";
            gun.gunClass = GunClass.CHARGE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio    = "Play_ENM_bullat_tackle_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent  = true;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].eventAudio   = "Play_ENM_bullat_charge_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].triggerEvent = true;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 1;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(22);
        }
Пример #3
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Flipflop", "flipflop");

            Game.Items.Rename("outdated_gun_mods:flipflop", "nn:flipflop");
            gun.gameObject.AddComponent <FlipFlop>();
            gun.SetShortDescription("");
            gun.SetLongDescription("");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);

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

            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(5) as Gun).muzzleFlashEffects;
            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Burst;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.2f;
            gun.DefaultModule.burstShotCount         = 4;
            gun.DefaultModule.burstCooldownTime      = 0.1f;
            gun.DefaultModule.cooldownTime           = 0.25f;
            gun.DefaultModule.numberOfShotsInClip    = 8;
            gun.DefaultModule.angleVariance          = 3.5f;
            gun.barrelOffset.transform.localPosition = new Vector3(2.68f, 0.87f, 0f);
            gun.SetBaseMaxAmmo(240);
            gun.ammo     = 240;
            gun.gunClass = GunClass.RIFLE;

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

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

            PierceDeadActors piercedead = projectile.gameObject.AddComponent <PierceDeadActors>();

            projectile.SetProjectileSpriteRight("burstrifle_proj", 7, 4, true, tk2dBaseSprite.Anchor.MiddleCenter, 7, 4);
            EasyTrailBullet trail4 = projectile.gameObject.AddComponent <EasyTrailBullet>();

            trail4.TrailPos   = projectile.transform.position;
            trail4.StartWidth = 0.25f;
            trail4.EndWidth   = 0f;
            trail4.LifeTime   = 0.1f;
            trail4.BaseColor  = ExtendedColours.honeyYellow;
            trail4.EndColor   = ExtendedColours.honeyYellow;

            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(647) as Gun).DefaultModule.projectiles[0].hitEffects.tileMapVertical.effects[0].effects[0].effect;
            projectile.transform.parent = gun.barrelOffset;

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

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

            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
            ID = gun.PickupObjectId;
        }
Пример #4
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Wall-Ray", "wallray");

            Game.Items.Rename("outdated_gun_mods:wall-ray", "nn:wall_ray");
            var behav = gun.gameObject.AddComponent <WallRay>();

            behav.preventNormalFireAudio = true;
            gun.SetShortDescription("90 Degrees Are Best Degrees");
            gun.SetLongDescription("Creates two beams at ninety degree angles from the direction aimed." + "\n\nInvented and used primarily for window washing.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 8);
            gun.isAudioLoop = true;
            gun.gunClass    = GunClass.SHITTY;
            int iterator = 0;

            for (int i = 0; i < 2; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                if (iterator == 0)
                {
                    mod.angleFromAim = 90; mod.positionOffset = new Vector2(0, 0.56f);
                }
                if (iterator == 1)
                {
                    mod.angleFromAim = -90; mod.positionOffset = new Vector2(0, -0.56f);
                }

                mod.ammoCost = 10;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                mod.shootStyle          = ProjectileModule.ShootStyle.Beam;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.001f;
                mod.numberOfShotsInClip = -1;
                mod.angleVariance       = 0;
                mod.ammoType            = GameUIAmmoType.AmmoType.BEAM;

                List <string> BeamAnimPaths = new List <string>()
                {
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_mid_001",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_mid_002",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_mid_003",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_mid_004",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_mid_005",
                };
                List <string> BeamStartPaths = new List <string>()
                {
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_start_001",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_start_002",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_start_003",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_start_004",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_start_005",
                };
                List <string> BeamImpactPaths = new List <string>()
                {
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_impact_001",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_impact_002",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_impact_003",
                    "NevernamedsItems/Resources/BeamSprites/thickredbeam_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/thickredbeam_mid_001",
                    new Vector2(9, 9),
                    new Vector2(0, 1),
                    BeamAnimPaths,
                    13,
                    //Impact
                    BeamImpactPaths,
                    13,
                    new Vector2(3, 3),
                    new Vector2(5, 5),
                    //End
                    null,
                    -1,
                    null,
                    null,
                    //Beginning
                    BeamStartPaths,
                    13,
                    new Vector2(9, 9),
                    new Vector2(0, 1),
                    //Other Variables
                    100
                    );

                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage = 25f;
                projectile.baseData.force *= 2f;
                projectile.baseData.range *= 10;
                projectile.baseData.speed *= 10f;
                beamComp.boneType          = BasicBeamController.BeamBoneType.Projectile;

                beamComp.interpolateStretchedBones = false;
                if (iterator == 0)
                {
                    beamComp.endAudioEvent   = "Stop_WPN_All";
                    beamComp.startAudioEvent = "Play_WPN_moonscraperLaser_shot_01";
                }
                iterator++;

                mod.projectiles[0] = projectile;
            }

            //GUN STATS
            gun.doesScreenShake         = false;
            gun.reloadTime              = 1f;
            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.barrelOffset.transform.localPosition = new Vector3(1.56f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(2000);
            gun.ammo = 2000;

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

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("OMITB GenericRed Laser", "NevernamedsItems/Resources/CustomGunAmmoTypes/genericredbeam_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/genericbeam_clipempty");

            gun.quality = PickupObject.ItemQuality.C;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #5
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Agar Gun", "agargun");

            Game.Items.Rename("outdated_gun_mods:agar_gun", "nn:agar_gun");
            gun.gameObject.AddComponent <AgarGun>();
            gun.SetShortDescription("Feeda Me");
            gun.SetLongDescription("An old historical remnant reinvigorated for bio warfare." + "\n\nThe final shot launches a hungry macrobacteria, who gobbles up agar to fuel its own destructive power.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 0);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(33) as Gun).gunSwitchGroup;
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(33) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.15f;
            gun.DefaultModule.cooldownTime           = 0.15f;
            gun.DefaultModule.numberOfShotsInClip    = 15;
            gun.barrelOffset.transform.localPosition = new Vector3(48f / 16f, 8f / 16, 0f);
            gun.SetBaseMaxAmmo(470);
            gun.ammo     = 470;
            gun.gunClass = GunClass.FULLAUTO;

            //BULLET STATS
            #region MainBullet
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 5f;
            BounceProjModifier bounce = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();
            bounce.numberOfBounces = 2;
            projectile.gameObject.AddComponent <AgarGunSmallProj>();

            projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(33) as Gun).DefaultModule.projectiles[0].hitEffects.overrideMidairDeathVFX;
            projectile.hitEffects.alwaysUseMidair        = true;

            //ANIMATE BULLET
            projectile.AnimateProjectile(new List <string> {
                "agargun_smallproj_1",
                "agargun_smallproj_2",
                "agargun_smallproj_1",
                "agargun_smallproj_3",
            }, 12, true, AnimateBullet.ConstructListOfSameValues(new IntVector2(12, 11), 4),
                                         AnimateBullet.ConstructListOfSameValues(true, 4),
                                         AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4),
                                         AnimateBullet.ConstructListOfSameValues(true, 4),
                                         AnimateBullet.ConstructListOfSameValues(false, 4),
                                         AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                         AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));

            projectile.SetProjectileSpriteRight("agargun_smallproj_1", 12, 11, true, tk2dBaseSprite.Anchor.MiddleCenter, 12, 11);
            #endregion
            #region SubProjectile
            Projectile subProj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            subProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(subProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(subProj);
            subProj.baseData.damage = 10f;
            subProj.baseData.speed *= 0.7f;
            subProj.baseData.range *= 2f;
            subProj.gameObject.AddComponent <PierceProjModifier>();
            subProj.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(755) as Gun).DefaultModule.projectiles[0].hitEffects.overrideMidairDeathVFX;
            subProj.hitEffects.alwaysUseMidair        = true;

            subProj.gameObject.AddComponent <AgarGunBigProj>();

            //ANIMATE BULLET
            subProj.AnimateProjectile(new List <string> {
                "agargun_bigproj_1",
                "agargun_bigproj_2",
                "agargun_bigproj_1",
                "agargun_bigproj_3",
            }, 12, true, AnimateBullet.ConstructListOfSameValues(new IntVector2(17, 12), 4),
                                      AnimateBullet.ConstructListOfSameValues(true, 4),
                                      AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4),
                                      AnimateBullet.ConstructListOfSameValues(true, 4),
                                      AnimateBullet.ConstructListOfSameValues(false, 4),
                                      AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4),
                                      AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                      AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                      AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));

            subProj.SetProjectileSpriteRight("agargun_bigproj_1", 17, 12, true, tk2dBaseSprite.Anchor.MiddleCenter, 17, 12);
            #endregion

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

            //gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM;
            //gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("AM0 Ammo Boxes", "NevernamedsItems/Resources/CustomGunAmmoTypes/am0_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/am0_clipempty");
            gun.quality = PickupObject.ItemQuality.C;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            gun.AddToSubShop(ItemBuilder.ShopType.Goopton);
            ID = gun.PickupObjectId;
        }
Пример #6
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Fungo Cannon", "fungocannon");

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

            behav.preventNormalFireAudio   = true;
            behav.preventNormalReloadAudio = true;
            gun.SetShortDescription("PLOOMPH");
            gun.SetLongDescription("A mutated fungun from the Oubliette." + "\n\nThough horrific genetic anomalies have stripped it of it's face and legs, it still retains it's deadly spores.");
            gun.SetupSprite(null, "fungocannon_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.chargeAnimation, 6);
            gun.gunClass = GunClass.CHARGE;
            for (int i = 0; i < 20; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 1f;
                mod.angleVariance       = 360f;
                mod.numberOfShotsInClip = 5;
                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.SetProjectileSpriteRight("enemystylespore_projectile", 14, 14, true, tk2dBaseSprite.Anchor.MiddleCenter, 14, 14);
                FungoRandomBullets orAddComponent = projectile.gameObject.GetOrAddComponent <FungoRandomBullets>();
                projectile.baseData.speed  *= 0.2f;
                projectile.baseData.damage *= 2f;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }

                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 0.5f,
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
            }

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("FungoCannon Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/fungocannon_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/fungocannon_clipempty");

            gun.reloadTime = 1.4f;
            gun.SetBaseMaxAmmo(200);
            gun.quality = PickupObject.ItemQuality.C;

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

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

            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(1.56f, 0.62f, 0f);
            FungoCannonID = gun.PickupObjectId;
        }
        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");
        }
Пример #8
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("SpecialGUN", "special_gun");

            Game.Items.Rename("outdated_gun_mods:specialgun", "spapi:specialgun");
            GunExt.SetShortDescription(gun, "GunAPI When?");
            GunExt.SetLongDescription(gun, "Gun made by a sentient golden lock. Smites all things unworthy of living in Gungeon.\n\nThe word \"BAD\" can be heard from inside.");
            GunExt.SetupSprite(gun, null, "special_gun_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 11);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 11);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            AdvancedGunBehaviour behav = gun.gameObject.AddComponent <AdvancedGunBehaviour>();

            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalReloadAudio = "Play_WPN_magnum_reload_01";
            gun.gunSwitchGroup              = "BeholsterEye";
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            SpecialGunProjectile projectile = Toolbox.CopyFields <SpecialGunProjectile>(UnityEngine.Object.Instantiate((PickupObjectDatabase.GetById(35) as 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            = 10f;
            projectile.baseData.speed             = 20f;
            gun.carryPixelOffset                 += new IntVector2(1, 0);
            gun.DefaultModule.cooldownTime        = 0.15f;
            gun.DefaultModule.numberOfShotsInClip = 7;
            gun.reloadTime = 0.78f;
            gun.SetBaseMaxAmmo(100);
            gun.muzzleFlashEffects = Toolbox.GetGunById(53).muzzleFlashEffects;
            gun.quality            = PickupObject.ItemQuality.S;
            gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f);
            gun.encounterTrackable.EncounterGuid     = "special_gun";
            gun.gunClass = GunClass.PISTOL;
            int index = 0;

            foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.idleAnimation).frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(offsets[0][index]);
                }
                index++;
            }
            index = 0;
            foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(offsets[1][index]);
                }
                index++;
            }
            index = 0;
            foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(offsets[2][index]);
                }
                index++;
            }
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.idleAnimation).frames   = new tk2dSpriteAnimationFrame[0];
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames  = new tk2dSpriteAnimationFrame[0];
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames = new tk2dSpriteAnimationFrame[0];
            index = 0;
            foreach (string name in spriteNames[0])
            {
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteId = ETGMod.Databases.Items.WeaponCollection.GetSpriteIdByName(name), spriteCollection = ETGMod.Databases.Items.WeaponCollection
                };
                Toolbox.Add(ref gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.idleAnimation).frames, frame);
                index++;
            }
            index = 0;
            foreach (string name in spriteNames[1])
            {
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteId = ETGMod.Databases.Items.WeaponCollection.GetSpriteIdByName(name), spriteCollection = ETGMod.Databases.Items.WeaponCollection
                };
                Toolbox.Add(ref gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames, frame);
                index++;
            }
            index = 0;
            foreach (string name in spriteNames[2])
            {
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteId = ETGMod.Databases.Items.WeaponCollection.GetSpriteIdByName(name), spriteCollection = ETGMod.Databases.Items.WeaponCollection
                };
                Toolbox.Add(ref gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames, frame);
                index++;
            }
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames[3].eventAudio   = "Play_WPN_SAA_spin_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames[3].triggerEvent = true;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(22);
            GameObject         obj      = SpriteBuilder.SpriteFromResource("SpecialItemPack/Resources/rad_vfx_bad_intro_001", new GameObject("SmiteVFX")).ProcessGameObject();
            tk2dSpriteAnimator animator = obj.AddComponent <tk2dSpriteAnimator>();

            animator.Library = obj.AddComponent <tk2dSpriteAnimation>();
            tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip {
                name = "idle", fps = 7, frames = new tk2dSpriteAnimationFrame[0], wrapMode = tk2dSpriteAnimationClip.WrapMode.Once
            };

            foreach (string spritePath in smiteVFXSpritePaths)
            {
                int id = SpriteBuilder.AddSpriteToCollection(spritePath, SpriteBuilder.itemCollection);
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteId = id, spriteCollection = SpriteBuilder.itemCollection
                };
                frame.FrameToDefinition().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter, frame.FrameToDefinition().position3);
                Toolbox.Add(ref clip.frames, frame);
            }
            animator.Library.clips     = new tk2dSpriteAnimationClip[] { clip };
            animator.playAutomatically = true;
            animator.DefaultClipId     = animator.GetClipIdByName("idle");
            SpriteAnimatorKiller kill = animator.gameObject.AddComponent <SpriteAnimatorKiller>();

            kill.fadeTime             = -1f;
            kill.animator             = animator;
            kill.delayDestructionTime = -1f;
            SmiteVFX = obj;
            GameObject         obj2      = SpriteBuilder.SpriteFromResource("SpecialItemPack/Resources/rad_vfx_bad_intro_001", new GameObject("SmiteVFX")).ProcessGameObject();
            tk2dSpriteAnimator animator2 = obj2.AddComponent <tk2dSpriteAnimator>();

            animator2.Library = obj2.AddComponent <tk2dSpriteAnimation>();
            tk2dSpriteAnimationClip clip2 = new tk2dSpriteAnimationClip {
                name = "idle", fps = 7, frames = new tk2dSpriteAnimationFrame[0], wrapMode = tk2dSpriteAnimationClip.WrapMode.Once
            };

            foreach (string spritePath in notSmiteVFXSpritePaths)
            {
                int id = SpriteBuilder.AddSpriteToCollection(spritePath, SpriteBuilder.itemCollection);
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteId = id, spriteCollection = SpriteBuilder.itemCollection
                };
                frame.FrameToDefinition().ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.MiddleCenter, frame.FrameToDefinition().position3);
                Toolbox.Add(ref clip2.frames, frame);
            }
            animator2.Library.clips     = new tk2dSpriteAnimationClip[] { clip2 };
            animator2.playAutomatically = true;
            animator2.DefaultClipId     = animator2.GetClipIdByName("idle");
            SpriteAnimatorKiller kill2 = animator2.gameObject.AddComponent <SpriteAnimatorKiller>();

            kill2.fadeTime             = -1f;
            kill2.animator             = animator2;
            kill2.delayDestructionTime = -1f;
            NotSmiteVFX = obj2;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Half Gauge Shotgun", ".5_gauge");

            Game.Items.Rename("outdated_gun_mods:half_gauge_shotgun", "ski:half_gauge_shotgun");
            gun.gameObject.AddComponent <punt>();
            gun.SetShortDescription("Screw that general direction!");
            gun.SetLongDescription("Invented by McGee Larvey Oddballed this gun was designed to aid the vision impared in their duck hunting adventures. " +
                                   "While the idea was good at heart McGee failed to comprehend the full weight of his actions until his sight damaged brother shot out the entire side of his barn. " +
                                   "But at least he hit something... " +
                                   "\n" +
                                   "The knockback of this gun alone is enough to rip it clean out of your hands upon firing" +
                                   "" +
                                   "\n\n- Knife_to_a_gunfight");
            gun.SetupSprite(null, ".5_gauge_idle_001", 1);
            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.reloadAnimation, 14);
            gun.SetAnimationFPS(gun.idleAnimation, 1);

            System.Random angle = new System.Random();
            for (int i = 0; i < 100; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(157) as Gun, true, false);
                gun.gunSwitchGroup = (PickupObjectDatabase.GetById(157) as Gun).gunSwitchGroup;
            }
            foreach (ProjectileModule projectileModule in gun.Volley.projectiles)
            {
                projectileModule.ammoCost      = 1;
                projectileModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
                projectileModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
                projectileModule.cooldownTime  = 1f;
                int angleint = angle.Next(1, 40);
                projectileModule.angleVariance       = angleint;
                projectileModule.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(projectileModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                projectileModule.projectiles[0]      = projectile;
                projectile.baseData.range            = 20f;
                projectile.baseData.speed            = angleint + 20;
                projectile.baseData.damage           = 2f;
                projectile.AdditionalScaleMultiplier = .3f;
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.AppliesKnockbackToPlayer = true;
                projectile.PlayerKnockbackForce     = 3f;
                gun.DefaultModule.ammoType          = GameUIAmmoType.AmmoType.BLUE_SHOTGUN;
                gun.DefaultModule.projectiles[0]    = projectile;
                bool flag = projectileModule != gun.DefaultModule;
                gun.PreventNormalFireAudio = true;
            }

            gun.PreventNormalFireAudio     = true;
            gun.reloadTime                 = 1.5f;
            gun.DefaultModule.cooldownTime = .20f;

            gun.SetBaseMaxAmmo(3000);
            gun.CurrentAmmo        = 3000;
            gun.muzzleFlashEffects = null;
            gun.quality            = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "I can hit the broad side of the barn";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #10
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("Neon Desimator", "Neon_desimator");

            // "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:neon_desimator", "ski:neon_desimator");
            gun.gameObject.AddComponent <Neon>();
            //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("High voltage!");
            gun.SetLongDescription("Crits against wet enemies! Some enemies are wet naturally others will need to be forced into it." +
                                   "\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, "Neon_desimator_idle_001", 3);


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

            gun.AddProjectileModuleFrom("dl45", true, true);


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

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

            gun.reloadTime = 2f;
            gun.DefaultModule.numberOfShotsInClip = 9;
            gun.DefaultModule.cooldownTime        = .25f;



            gun.SetBaseMaxAmmo(300);
            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "*Krzirrrrt!";

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

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "samus";
            Gun flash = (Gun)PickupObjectDatabase.GetByEncounterName("Void Core Assault Rifle");

            gun.barrelOffset.transform.localPosition = new Vector3(2f, .7f, 0f);
            gun.muzzleFlashEffects = flash.muzzleFlashEffects;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 5f;
            projectile.baseData.speed        = 15f;
            projectile.baseData.range        = 20f;
            projectile.baseData.force        = 5;


            gun.sprite.usesOverrideMaterial = true;

            Material mat = new Material(EnemyDatabase.GetOrLoadByName("GunNut").sprite.renderer.material);

            mat.SetColor("_EmissiveColor", new Color32(255, 5, 5, 255));
            mat.SetFloat("_EmissiveColorPower", 6f);
            mat.SetFloat("_EmissivePower", 4);

            MeshRenderer component = gun.GetComponent <MeshRenderer>();

            if (!component)
            {
                ETGModConsole.Log("nope");
                return;
            }
            Material[] sharedMaterials = component.sharedMaterials;
            for (int i = 0; i < sharedMaterials.Length; i++)
            {
                if (sharedMaterials[i].shader == mat)
                {
                    return;
                }
            }
            Array.Resize <Material>(ref sharedMaterials, sharedMaterials.Length + 1);
            Material material = new Material(mat);

            material.SetTexture("_MainTex", sharedMaterials[0].GetTexture("_MainTex"));
            sharedMaterials[sharedMaterials.Length - 1] = material;
            component.sharedMaterials = sharedMaterials;



            projectile.transform.parent = gun.barrelOffset;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #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("Catalyzer", "Cat");

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

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

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

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

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

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

            gun.DefaultModule.cooldownTime        = .2f;
            gun.DefaultModule.numberOfShotsInClip = 3;
            gun.SetBaseMaxAmmo(350);
            gun.barrelOffset.transform.localPosition = new Vector3(1f, .5f, 0f);
            gun.quality = PickupObject.ItemQuality.A;
            gun.encounterTrackable.EncounterGuid = "One Herring Twitch! And Kableewy!";
            gun.muzzleFlashEffects     = null;
            gun.PreventNormalFireAudio = true;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 1f;
            projectile.baseData.speed        = 8f;
            projectile.baseData.range        = 4000f;
            projectile.SetProjectileSpriteRight("cation", 30, 30, false, tk2dBaseSprite.Anchor.MiddleCenter, 30, 30);
            projectile.AdditionalScaleMultiplier = .35f;
            projectile.angularVelocity           = 500;
            projectile.transform.parent          = gun.barrelOffset;
            PierceProjModifier stab = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            stab.penetration = 200;

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

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

            projectile2.transform.parent = gun.barrelOffset;

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

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

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


            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #12
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Master's Gun", "mastersgun");

            Game.Items.Rename("outdated_gun_mods:master's_gun", "nn:masters_gun");
            gun.gameObject.AddComponent <MastersGun>();
            gun.SetShortDescription("Firing On All Cylinders");
            gun.SetLongDescription("A humongous firearm, created by the Gungeon's Master to fire the legendary master rounds, though he never truly finished it." + "\n\nAfter it's recent rediscovery, the Blacksmith managed to finish the spectacular weapon, and even forged Master-Sized bullet replicas for ammo." + "\n\nNothing can beat the gun's original purpose though, so getting your grubby hands on some master rounds would be good.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 11);

            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.muzzleFlashEffects                   = (PickupObjectDatabase.GetById(37) as Gun).muzzleFlashEffects;
            gun.DefaultModule.cooldownTime           = 0.4f;
            gun.DefaultModule.numberOfShotsInClip    = 6;
            gun.barrelOffset.transform.localPosition = new Vector3(3.62f, 1.81f, 0f);
            gun.SetBaseMaxAmmo(50);
            gun.gunClass = GunClass.PISTOL;
            //DEFAULT BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage      *= 10f;
            projectile.ignoreDamageCaps      = true;
            projectile.baseData.speed       *= 1f;
            projectile.pierceMinorBreakables = true;
            PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            orAddComponent.penetratesBreakables = true;
            orAddComponent.penetration++;
            projectile.SetProjectileSpriteRight("mastersgun_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12);
            projectile.transform.parent = gun.barrelOffset;

            //KEEP BULLET STATS
            keepProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            keepProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(keepProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(keepProjectile);
            keepProjectile.baseData.damage      *= 16f;
            keepProjectile.ignoreDamageCaps      = true;
            keepProjectile.baseData.speed       *= 1f;
            keepProjectile.pierceMinorBreakables = true;
            PierceProjModifier keepComponent = keepProjectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            keepComponent.penetratesBreakables = true;
            keepComponent.penetration++;
            BounceProjModifier Bouncing = keepProjectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            Bouncing.numberOfBounces = 5;
            keepProjectile.SetProjectileSpriteRight("mastersgun_keep_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12);
            keepProjectile.transform.parent = gun.barrelOffset;
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup;

            //PROPER BULLET STATS
            properProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            properProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(properProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(properProjectile);
            properProjectile.baseData.damage      *= 16f;
            properProjectile.ignoreDamageCaps      = true;
            properProjectile.baseData.speed       *= 1f;
            properProjectile.pierceMinorBreakables = true;
            PierceProjModifier properComponent = properProjectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            properComponent.penetratesBreakables = true;
            properComponent.penetration++;
            ApplyLockdownBulletBehaviour properLockdown = properProjectile.gameObject.GetOrAddComponent <ApplyLockdownBulletBehaviour>();

            properLockdown.duration = 6;

            properProjectile.SetProjectileSpriteRight("mastersgun_proper_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12);
            properProjectile.transform.parent = gun.barrelOffset;

            //MINES BULLET STATS
            minesProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            minesProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(minesProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(minesProjectile);
            minesProjectile.baseData.damage      *= 16f;
            minesProjectile.ignoreDamageCaps      = true;
            minesProjectile.baseData.speed       *= 1f;
            minesProjectile.pierceMinorBreakables = true;
            PierceProjModifier minesComponent = minesProjectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            minesComponent.penetratesBreakables = true;
            minesComponent.penetration++;
            ExtremelySimplePoisonBulletBehaviour minesPoisoning = minesProjectile.gameObject.GetOrAddComponent <ExtremelySimplePoisonBulletBehaviour>();

            minesPoisoning.procChance     = 1;
            minesPoisoning.useSpecialTint = false;
            minesProjectile.SetProjectileSpriteRight("mastersgun_mines_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12);
            minesProjectile.transform.parent = gun.barrelOffset;

            //HOLLOW BULLET STATS
            hollowProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            hollowProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(hollowProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(hollowProjectile);
            hollowProjectile.baseData.damage      *= 16f;
            hollowProjectile.ignoreDamageCaps      = true;
            hollowProjectile.baseData.speed       *= 1f;
            hollowProjectile.pierceMinorBreakables = true;
            PierceProjModifier hollowComponent = hollowProjectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            hollowComponent.penetratesBreakables = true;
            hollowComponent.penetration++;
            SimpleFreezingBulletBehaviour freezing = hollowProjectile.gameObject.GetOrAddComponent <SimpleFreezingBulletBehaviour>();

            freezing.procChance            = 1;
            freezing.useSpecialTint        = false;
            freezing.freezeAmount          = 150;
            freezing.freezeAmountForBosses = 100;
            hollowProjectile.SetProjectileSpriteRight("mastersgun_hollow_projectile", 27, 12, false, tk2dBaseSprite.Anchor.MiddleCenter, 27, 12);
            hollowProjectile.transform.parent = gun.barrelOffset;

            //FORGE BULLET STATS
            forgeProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            forgeProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(forgeProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(forgeProjectile);
            forgeProjectile.baseData.damage      *= 20f;
            forgeProjectile.ignoreDamageCaps      = true;
            forgeProjectile.baseData.speed       *= 1f;
            forgeProjectile.pierceMinorBreakables = true;
            PierceProjModifier forgeComponent = forgeProjectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            forgeComponent.penetratesBreakables = true;
            forgeComponent.penetration++;
            ExtremelySimpleStatusEffectBulletBehaviour burning = forgeProjectile.gameObject.GetOrAddComponent <ExtremelySimpleStatusEffectBulletBehaviour>();

            burning.onFiredProcChance = 1;
            burning.usesFireEffect    = true;
            burning.fireEffect        = StaticStatusEffects.hotLeadEffect;
            burning.useSpecialTint    = false;
            forgeProjectile.SetProjectileSpriteRight("mastersgun_forge_projectile", 33, 18, false, tk2dBaseSprite.Anchor.MiddleLeft, 27, 12);
            forgeProjectile.transform.parent = gun.barrelOffset;

            gun.quality = PickupObject.ItemQuality.S; //S
            gun.encounterTrackable.EncounterGuid = "this is the Master's Gun";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #13
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Disc Gun", "discgun");

            Game.Items.Rename("outdated_gun_mods:disc_gun", "nn:disc_gun");
            gun.gameObject.AddComponent <DiscGun>();
            gun.SetShortDescription("Bad Choices");
            gun.SetLongDescription("Fires sharp, bouncing discs." + "\n\nCapable of hurting it's bearer, because someone thought that would be funny.");

            gun.SetupSprite(null, "discgun_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 14);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime        = 0.25f;
            gun.DefaultModule.numberOfShotsInClip = 10;
            gun.SetBaseMaxAmmo(300);
            //gun.DefaultModule.positionOffset = new Vector3(1f, 0f, 0f);
            gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.68f, 0f);
            gun.gunClass = GunClass.PISTOL;

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

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage      *= 4f;
            projectile.baseData.range       *= 20f;
            projectile.baseData.speed       *= 0.4f;
            projectile.SetProjectileSpriteRight("discgun_projectile", 15, 15, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 9);
            SelfHarmBulletBehaviour SuicidalTendancies = projectile.gameObject.AddComponent <SelfHarmBulletBehaviour>();

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

            Piercing.penetratesBreakables = true;
            Piercing.penetration         += 10;
            BounceProjModifier Bouncing = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            Bouncing.numberOfBounces = 10;

            projectile.transform.parent      = gun.barrelOffset;
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Disc Gun Discs", "NevernamedsItems/Resources/CustomGunAmmoTypes/discgun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/discgun_clipempty");
            gun.quality = PickupObject.ItemQuality.D;

            gun.encounterTrackable.EncounterGuid = "this is the Disc Gun";
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            DiscGunID = gun.PickupObjectId;

            string bleh = "Not a Bot, if you're sniffing around in my code, lookin to steal for the Nuclear Throne Mode, you're a stinker. It's cool, I'm a stinker too, just wanted to let you know";

            if (bleh == null)
            {
                ETGModConsole.Log("BOT WHAT THE F**K DID YOU DO");
            }
        }
Пример #14
0
        /// <summary>
        /// Used to create new VFX. Place sprites inside of Mods/YourModFolder/sprites/VFX Collection, inside the EtG directory. Each parameter that is a list must have an entry for each sprite of the animation
        /// </summary>
        /// <param name="name">The name of the VFX</param>
        /// <param name="spriteNames">The name of the sprites for the VFX, like VFX_001, VFX_002, etc.</param>
        /// <param name="fps">The frame rate the animation will play at</param>
        /// <param name="spriteSizes">The size of each sprite in the animation. Must have an IntVector2 entry for each sprite in the animation</param>
        /// <param name="anchors">I don't know what exactly this does</param>
        /// <param name="manualOffsets">I don't know what exactly this does</param>
        /// <param name="orphaned">I don't know what exactly this does</param>
        /// <param name="attached">I don't know what exactly this does</param>
        /// <param name="persistsOnDeath">Best left false</param>
        /// <param name="usesZHeight">Change if needed</param>
        /// <param name="zHeight">Change if needed, but usually left at 0</param>
        /// <param name="alignment">Leave at Fixed</param>
        /// <param name="destructible">Always set to true</param>
        /// <param name="emissivePowers">Doesn't seem to work, set all entries at 0. Might cause bugs if tinkered with</param>
        /// <param name="emissiveColors">Does't seem to work, set all entries to VFXLibrary.emptyColor. Might cause bugs if tinkered with</param>
        /// <returns></returns>
        public static VFXPool CreateMuzzleflash(string name, List <string> spriteNames, int fps, List <IntVector2> spriteSizes, List <tk2dBaseSprite.Anchor> anchors, List <Vector2> manualOffsets, bool orphaned, bool attached, bool persistsOnDeath,
                                                bool usesZHeight, float zHeight, VFXAlignment alignment, bool destructible, List <float> emissivePowers, List <Color> emissiveColors)
        {
            VFXPool pool = new VFXPool();

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

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

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

            kill.fadeTime             = -1f;
            kill.animator             = animator;
            kill.delayDestructionTime = -1f;
            vfObj.orphaned            = orphaned;
            vfObj.attached            = attached;
            vfObj.persistsOnDeath     = persistsOnDeath;
            vfObj.usesZHeight         = usesZHeight;
            vfObj.zHeight             = zHeight;
            vfObj.alignment           = alignment;
            vfObj.destructible        = destructible;
            vfObj.effect               = obj;
            complex.effects            = new VFXObject[] { vfObj };
            pool.effects               = new VFXComplex[] { complex };
            animator.playAutomatically = true;
            animator.DefaultClipId     = animator.GetClipIdByName("start");
            return(pool);
        }
Пример #15
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("Copper Chariot", "chariot");

            // "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:copper_chariot", "ski:copper_chariot");
            gun.gameObject.AddComponent <CopperChariot>();

            //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("Blinding Speed!");
            gun.SetLongDescription("The ghost of a gun nut gaurds the weilder of this blade. While the blade itself is too weak to be used your new astral companion will be happy to provide assistance.\n\n" +
                                   "__________________________________\n\n" +
                                   "Copper Chariot's bullets cant hurt you but the initial swing can, even then i have made it so you will not sustain damage from the hit. Reloading will draw him back and firing your first shot while in combat will push him out.");
            // 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, "chariot_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.

            GunExt.AddProjectileModuleFrom(gun, "AK-47", true, true);

            gun.muzzleFlashEffects          = null;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0f;
            gun.gunClass   = GunClass.SILLY;
            gun.reloadTime = .5f;
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.cooldownTime        = 1.5f;
            gun.DefaultModule.numberOfShotsInClip = 40;
            gun.InfiniteAmmo = true;
            gun.SetBaseMaxAmmo(1000);
            // 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 = "hora hora hora hora!";
            //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.baseData.range  = .00000001f;
            projectile.baseData.force  = 0f;

            projectile.pierceMinorBreakables = true;

            projectile.transform.parent = gun.barrelOffset;


            ETGMod.Databases.Items.Add(gun, null, "ANY");
            UnityEngine.Object.Destroy(projectile.GetAnySprite());
        }
Пример #16
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Pumhart", "pumhart");

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

            gun.SetShortDescription("Mega Bore");
            gun.SetLongDescription("A magnificent example of bombard weaponry, built to slay giants!" + "\n\nNormally impossible for a single person to wield, Gunymede's reduced gravity somewhat allows this ridiculous feat.");

            gun.SetupSprite(null, "pumhart_idle_001", 8);
            gun.SetAnimationFPS(gun.chargeAnimation, 1);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            gun.AddCurrentGunStatModifier(PlayerStats.StatType.MovementSpeed, 0.6f, StatModifier.ModifyMethod.MULTIPLICATIVE);
            gun.AddCurrentGunStatModifier(PlayerStats.StatType.DodgeRollSpeedMultiplier, 0.6f, StatModifier.ModifyMethod.MULTIPLICATIVE);
            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime                           = 5f;
            gun.muzzleFlashEffects                   = (PickupObjectDatabase.GetById(37) as Gun).muzzleFlashEffects;
            gun.DefaultModule.cooldownTime           = 5f;
            gun.DefaultModule.angleVariance          = 0;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(6.43f, 1.81f, 0f);
            gun.SetBaseMaxAmmo(10);
            gun.ammo     = 10;
            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 = 100f;
            projectile.baseData.force *= 10f;
            projectile.baseData.speed *= 1f;
            projectile.baseData.range *= 100f;
            PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            pierce.penetration += 70;
            MaintainDamageOnPierce maintainDMG = projectile.gameObject.GetOrAddComponent <MaintainDamageOnPierce>();

            pierce.penetratesBreakables = true;
            BlockEnemyProjectilesMod block = projectile.gameObject.GetOrAddComponent <BlockEnemyProjectilesMod>();

            block.projectileSurvives = true;
            BounceProjModifier bounce = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            bounce.numberOfBounces      += 70;
            bounce.additionalScreenShake = (PickupObjectDatabase.GetById(37) as Gun).DefaultModule.chargeProjectiles[0].Projectile.GetComponent <BounceProjModifier>().additionalScreenShake;
            projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(37) as Gun).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.overrideMidairDeathVFX;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.SetProjectileSpriteRight("pumhart_proj", 48, 48, false, tk2dBaseSprite.Anchor.MiddleCenter, 30, 30);

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

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

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

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

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

            foreach (tk2dSpriteAnimationFrame frame in fireClip.frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(new Vector2(-2.12f, -1.75f));
                }
            }
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup;

            gun.gunScreenShake = new ScreenShakeSettings(5f, 1f, 0.5f, 0.5f);
            PumhartID          = gun.PickupObjectId;
        }
Пример #17
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Blue Chamber", "blue_chamber");

            Game.Items.Rename("outdated_gun_mods:blue_chamber", "spapi:blue_chamber");
            gun.gameObject.AddComponent <BlueChamberController>();
            GunExt.SetShortDescription(gun, "\"it shoots stuff\"");
            GunExt.SetLongDescription(gun, "Even through this gun seems a chamber, it's actually a gun.\n\nKills the weak.");
            GunExt.SetupSprite(gun, null, "blue_chamber_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 10);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 10);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(761) as Gun).DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1.6f
                }
            };
            projectile.transform.parent = gun.barrelOffset;
            projectile.RemoveComponent <KthuliberProjectileController>();
            projectile.gameObject.AddComponent <KillTheWeakBehaviour>();
            projectile.name                       = "BlueChamber_Projectile";
            gun.reloadClipLaunchFrame             = 0;
            gun.DefaultModule.cooldownTime        = 2f;
            gun.DefaultModule.numberOfShotsInClip = 10;
            gun.reloadTime             = 2f;
            gun.DefaultModule.ammoCost = 6;
            gun.SetBaseMaxAmmo(666);
            gun.quality = PickupObject.ItemQuality.C;
            gun.barrelOffset.transform.localPosition = new Vector3(1.3f, 0.65f, 0f);
            gun.gunSwitchGroup = "Kthulu";
            gun.encounterTrackable.EncounterGuid = "blue_chamber";
            gun.muzzleFlashEffects.type          = VFXPoolType.None;
            gun.gunClass = GunClass.PISTOL;
            ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.Curse, 2f);
            ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.Health, 2f);
            ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.RateOfFire, 0.15f);
            tk2dSpriteAnimator animator = gun.GetComponent <tk2dSpriteAnimator>();

            for (int i = animator.GetClipByName(gun.chargeAnimation).frames.Length - 2; i > -1; i--)
            {
                tk2dSpriteAnimationFrame frame2 = animator.GetClipByName(gun.chargeAnimation).frames[i];
                tk2dSpriteAnimationFrame frame  = new tk2dSpriteAnimationFrame {
                    spriteId = frame2.spriteId, spriteCollection = frame2.spriteCollection
                };
                animator.GetClipByName(gun.shootAnimation).frames = animator.GetClipByName(gun.shootAnimation).frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            animator.GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            animator.GetClipByName(gun.chargeAnimation).loopStart = 15;
            animator.GetClipByName(gun.shootAnimation).frames[0].FrameToDefinition().MakeOffset(new Vector2(-0.125f, 0.125f));
            animator.GetClipByName(gun.shootAnimation).frames[1].FrameToDefinition().MakeOffset(new Vector2(0.0625f, -0.0625f));
            animator.GetClipByName(gun.shootAnimation).frames[2].FrameToDefinition().MakeOffset(new Vector2(-0.0625f, 0.0625f));
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(22);
        }
        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("Hell's Bell", "bell");

            // "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:hell's_bell", "ski:hell's_bell");
            gun.gameObject.AddComponent <Hells_bells>();
            //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("Hell tones");
            gun.SetLongDescription("This bell, dispite its name, does not come from bullet hell. It was the main clocktower bell of the leadlords cathedral. " +
                                   "The Bell's heath was maintained for countless years by an unfortunatly named priest, Hell. " +
                                   "Hell died shortly after mixing up AC and DC currents when he was attempting to fix the bell's automated chiming system." +
                                   "\n\n\n - Knife_to_a_Gunfight");;


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

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

            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 = 4;



            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 = 1;
            gun.DefaultModule.cooldownTime        = .5f;
            gun.SetBaseMaxAmmo(100);
            gun.quality = PickupObject.ItemQuality.A;
            gun.encounterTrackable.EncounterGuid = "Dong!";


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

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


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



            Gun swipeFlash = (Gun)PickupObjectDatabase.GetByEncounterName("Blasphemy");

            gun.muzzleFlashEffects.type = VFXPoolType.None;



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


            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item,
            };
            projectile.transform.parent = gun.barrelOffset;
            //charge offests
            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("bell_charge");

            float[] offsetsX = new float[] { 0.0f, 0.0f, 0.0f, -.5f, -.5f };
            float[] offsetsY = new float[] { 0f, .5f, 1.5f, 2f, 2f };
            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];
            }

            //fire offests
            tk2dSpriteAnimationClip fireClip2 = gun.sprite.spriteAnimator.GetClipByName("bell_fire");

            float[] offsetsX2 = new float[] { 0.0f, 0.0f };
            float[] offsetsY2 = new float[] { .1f, 0f };
            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];
            }

            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #19
0
        public static void BuildPrefab()
        {
            ExpandPrefabs.EXFriendlyForgeHammer = new GameObject("Friendly_Forge_Hammer")
            {
                layer = 22
            };

            GameObject m_HitEffectObject      = Instantiate(ExpandPrefabs.ForgeHammer.GetComponent <ForgeHammerController>().HitEffectAnimator.gameObject);
            GameObject m_TargetAnimatorObject = Instantiate(ExpandPrefabs.ForgeHammer.GetComponent <ForgeHammerController>().TargetAnimator.gameObject);
            GameObject m_ShadowObject         = Instantiate(ExpandPrefabs.ForgeHammer.GetComponent <ForgeHammerController>().ShadowAnimator.gameObject);
            GameObject m_ShootPointObject     = Instantiate(ExpandPrefabs.ForgeHammer.GetComponent <ForgeHammerController>().ShootPoint.gameObject);

            m_ShootPointObject.name = ExpandPrefabs.ForgeHammer.GetComponent <ForgeHammerController>().ShootPoint.gameObject.name;

            m_HitEffectObject.transform.parent      = ExpandPrefabs.EXFriendlyForgeHammer.transform;
            m_TargetAnimatorObject.transform.parent = ExpandPrefabs.EXFriendlyForgeHammer.transform;
            m_ShadowObject.transform.parent         = ExpandPrefabs.EXFriendlyForgeHammer.transform;
            m_ShootPointObject.transform.parent     = ExpandPrefabs.EXFriendlyForgeHammer.transform;

            ExpandPrefabs.EXFriendlyForgeHammer.SetActive(false);

            m_ShadowObject.GetComponent <tk2dSpriteAnimator>().playAutomatically = false;
            m_ShadowObject.GetComponent <tk2dSpriteAnimator>().DefaultClipId     = 28;

            tk2dSprite m_NewHammerSprite = ExpandPrefabs.EXFriendlyForgeHammer.AddComponent <tk2dSprite>();

            ExpandUtility.DuplicateSprite(m_NewHammerSprite, ExpandPrefabs.ForgeHammer.GetComponent <tk2dSprite>());

            tk2dSpriteAnimation m_SourceHammerAnimationLibrary = ExpandPrefabs.ForgeHammer.GetComponent <tk2dSpriteAnimator>().Library;
            tk2dSpriteAnimation m_HammerAnimationLibrary       = ExpandPrefabs.EXFriendlyForgeHammer.AddComponent <tk2dSpriteAnimation>();

            List <tk2dSpriteAnimationClip> m_Clips = new List <tk2dSpriteAnimationClip>();

            foreach (tk2dSpriteAnimationClip clip in m_SourceHammerAnimationLibrary.clips)
            {
                if (!string.IsNullOrEmpty(clip.name))
                {
                    if (clip.name.ToLower().StartsWith("hammer_right_out"))
                    {
                        m_Clips.Add(ExpandUtility.DuplicateAnimationClip(clip));
                    }
                    else if (clip.name.ToLower().StartsWith("hammer_left_out"))
                    {
                        m_Clips.Add(ExpandUtility.DuplicateAnimationClip(clip));
                    }
                    else if (clip.name.ToLower().StartsWith("hammer_right_slam"))
                    {
                        m_Clips.Add(ExpandUtility.DuplicateAnimationClip(clip));
                    }
                    else if (clip.name.ToLower().StartsWith("hammer_left_slam"))
                    {
                        m_Clips.Add(ExpandUtility.DuplicateAnimationClip(clip));
                    }
                }
            }

            if (m_Clips.Count > 0)
            {
                m_HammerAnimationLibrary.clips = m_Clips.ToArray();
            }

            ExpandUtility.GenerateSpriteAnimator(ExpandPrefabs.EXFriendlyForgeHammer, m_HammerAnimationLibrary, 0, 0, false, false, false, false, false, false, 0, 0, false, false, false);

            ExpandUtility.GenerateOrAddToRigidBody(ExpandPrefabs.EXFriendlyForgeHammer, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, true, true, false, false, false, false, false, true, new IntVector2(30, 24), new IntVector2(16, 24));
            ExpandUtility.GenerateOrAddToRigidBody(ExpandPrefabs.EXFriendlyForgeHammer, CollisionLayer.LowObstacle, PixelCollider.PixelColliderGeneration.Manual, true, true, false, false, false, false, false, true, new IntVector2(30, 8), new IntVector2(16, 16));

            AIBulletBank m_HammerBulletBank = ExpandPrefabs.EXFriendlyForgeHammer.AddComponent <AIBulletBank>();

            m_HammerBulletBank.useDefaultBulletIfMissing = true;
            m_HammerBulletBank.transforms = new List <Transform>(0);
            m_HammerBulletBank.Bullets    = new List <AIBulletBank.Entry>()
            {
                new AIBulletBank.Entry()
                {
                    Name                             = "default",
                    BulletObject                     = ExpandPrefabs.EXFriendlyForgeHammerBullet,
                    OverrideProjectile               = false,
                    PlayAudio                        = false,
                    AudioSwitch                      = string.Empty,
                    AudioEvent                       = string.Empty,
                    AudioLimitOncePerFrame           = false,
                    AudioLimitOncePerAttack          = false,
                    MuzzleLimitOncePerFrame          = false,
                    MuzzleInheritsTransformDirection = false,
                    SpawnShells                      = false,
                    ShellForce                       = 1.75f,
                    ShellForceVariance               = 0.75f,
                    DontRotateShell                  = false,
                    ShellGroundOffset                = 0,
                    ShellsLimitOncePerFrame          = false,
                    rampBullets                      = false,
                    rampStartHeight                  = 0,
                    rampTime                         = 0,
                    conditionalMinDegFromNorth       = 0,
                    forceCanHitEnemies               = true,
                    suppressHitEffectsIfOffscreen    = false,
                    preloadCount                     = 0,
                    ProjectileData                   = new ProjectileData()
                    {
                        damage  = 0,
                        speed   = 0,
                        range   = 0,
                        damping = 0,
                        UsesCustomAccelerationCurve     = false,
                        AccelerationCurve               = new AnimationCurve(),
                        CustomAccelerationCurveDuration = 0,
                        onDestroyBulletScript           = new BulletScriptSelector()
                        {
                            scriptTypeName = string.Empty
                        }
                    },
                    MuzzleFlashEffects = new VFXPool()
                    {
                        type = VFXPoolType.None, effects = new VFXComplex[0]
                    }
                }
            };

            GoopDefinition m_HammerGoopDefinition = Instantiate(ExpandPrefabs.ForgeHammer.GetComponent <ForgeHammerController>().GoopToDo);

            ExpandForgeHammerComponent EXFriendlyHammerController = ExpandPrefabs.EXFriendlyForgeHammer.AddComponent <ExpandForgeHammerComponent>();

            EXFriendlyHammerController.HitEffectAnimator = m_HitEffectObject.GetComponent <tk2dSpriteAnimator>();
            EXFriendlyHammerController.TargetAnimator    = m_TargetAnimatorObject.GetComponent <tk2dSpriteAnimator>();
            EXFriendlyHammerController.ShadowAnimator    = m_ShadowObject.GetComponent <tk2dSpriteAnimator>();
            EXFriendlyHammerController.ShootPoint        = m_ShootPointObject.transform;
            EXFriendlyHammerController.GoopToDo          = m_HammerGoopDefinition;

            FakePrefab.MarkAsFakePrefab(ExpandPrefabs.EXFriendlyForgeHammer);
            DontDestroyOnLoad(ExpandPrefabs.EXFriendlyForgeHammer);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Vacuum Gun", "vacuumgun");

            Game.Items.Rename("outdated_gun_mods:vacuum_gun", "nn:vacuum_gun");
            gun.gameObject.AddComponent <VacuumGun>();
            gun.SetShortDescription("Ranged Weapon");
            gun.SetLongDescription("Pressing reload sucks up nearby blobs, and uses them as ammo. Cannot gain ammo by any other method." + "\n\nDesigned specifically to combat Blobulonian creatures, in the case of a potential re-emergence of the empire." + "\n\nZZZZZZZ");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime  = 1f;
            gun.ammo        = 0;
            gun.CanGainAmmo = false;
            gun.DefaultModule.cooldownTime           = 0.3f;
            gun.DefaultModule.numberOfShotsInClip    = 10000;
            gun.barrelOffset.transform.localPosition = new Vector3(1.75f, 0.81f, 0f);
            gun.SetBaseMaxAmmo(10000);
            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);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 30f;
            projectile.baseData.speed       *= 1f;
            projectile.baseData.range       *= 1f;
            projectile.SetProjectileSpriteRight("vacuumgun_projectile", 16, 14, false, tk2dBaseSprite.Anchor.MiddleCenter, 15, 13);
            GoopModifier gooper = projectile.gameObject.AddComponent <GoopModifier>();

            gooper.SpawnGoopInFlight    = false;
            gooper.SpawnGoopOnCollision = true;
            gooper.CollisionSpawnRadius = 2;
            gooper.goopDefinition       = EasyGoopDefinitions.BlobulonGoopDef;
            CustomImpactSoundBehav sound = projectile.gameObject.AddComponent <CustomImpactSoundBehav>();

            sound.ImpactSFX = "Play_BlobulonDeath";

            projectile.transform.parent = gun.barrelOffset;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Vacuum Gun Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/vacuumgun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/vacuumgun_clipempty");

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

            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.PURCHASED_VACUUMGUN, true);
            gun.AddItemToGooptonMetaShop(16);
            gun.AddToSubShop(ItemBuilder.ShopType.Goopton);
        }
Пример #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("Scrapper", "scrapper");

            // "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:scrapper", "cak:scrapper");
            gun.gameObject.AddComponent <Scrapper>();
            //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("Animacatonic");
            gun.SetLongDescription("A gun constructed out of scrapped parts. It requires oil to fire it's unusual ammunition. Unfortunatly, it tends to spill this oil out. Clearly the work of an amateur.");
            // 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, "scrapper_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, 14);
            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.GetById(26) as Gun, true, false);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(26) as Gun, true, false);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(26) as Gun, true, false);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(26) as Gun, true, false);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(26) as Gun, true, false);
            // Here we just take the default projectile module and change its settings how we want it to be.
            gun.reloadTime = 1f;
            gun.barrelOffset.localPosition += new Vector3(0.5f, 0f, 0f);
            // 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.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "scrapper";
            gun.DefaultModule.ammoType           = GameUIAmmoType.AmmoType.SKULL;
            //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.

            //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");

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(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              *= 0.5f;
                projectile.baseData.speed               *= 0.8f;
                projectile.transform.parent              = gun.barrelOffset;
                projectile.AdditionalScaleMultiplier     = 1f;
                projectile.BlackPhantomDamageMultiplier *= 1.2f;
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.4f;
                mod.numberOfShotsInClip = 7;
                mod.projectiles[0]      = projectile;
                mod.cooldownTime        = 0.6f;
                mod.numberOfShotsInClip = 7;
                mod.angleVariance       = 25f;
            }
        }
Пример #22
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Berserker Rifle", "ragerifle");

            Game.Items.Rename("outdated_gun_mods:berserker_rifle", "rtr:berserker_rifle");
            gun.gameObject.AddComponent <RageRifle>();
            gun.SetShortDescription("Unstoppable Frenzy");
            gun.SetLongDescription("Contains pure and unfettered rage.\n\n" +
                                   "Simply holding this gun can turn even the most peaceful beings into bloodthirsty killing machines.");
            gun.SetupSprite(null, "ragerifle_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 24);

            gun.SetAnimationFPS(gun.reloadAnimation, 4);
            Gun targetGun = PickupObjectDatabase.GetById(762) as Gun;

            gun.AddProjectileModuleFrom("klobb", true, false);
            gun.SetBaseMaxAmmo(666);
            RandomProjectileReplacementItem berserkPrefab = PickupObjectDatabase.GetById(524).GetComponent <RandomProjectileReplacementItem>();
            Projectile berserkProj = berserkPrefab.ReplacementProjectile;

            Gun projGun = PickupObjectDatabase.GetById(329) as Gun;

            gun.DefaultModule.usesOptionalFinalProjectile = true;
            gun.DefaultModule.numberOfFinalProjectiles    = 2;
            gun.DefaultModule.finalProjectile             = berserkProj;
            gun.DefaultModule.finalCustomAmmoType         = targetGun.DefaultModule.customAmmoType;
            gun.DefaultModule.finalAmmoType = targetGun.DefaultModule.ammoType;

            gun.DefaultModule.ammoCost   = 1;
            gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Automatic;
            gun.damageModifier           = 1;
            gun.reloadTime = 1.5f;
            gun.DefaultModule.cooldownTime            = 0.05f;
            gun.DefaultModule.numberOfShotsInClip     = 22;
            gun.DefaultModule.angleVariance           = 40f;
            gun.barrelOffset.transform.localPosition += new Vector3(1f, 0f, 0);
            gun.quality = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "ragerifle";
            gun.gunClass     = GunClass.RIFLE;
            gun.CanBeDropped = true;

            Gun muzzleGun = PickupObjectDatabase.GetById(519) as Gun;

            gun.muzzleFlashEffects = muzzleGun.muzzleFlashEffects;

            Gun component = PickupObjectDatabase.GetById(37) as Gun;

            gun.finalMuzzleFlashEffects = component.muzzleFlashEffects;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            //CREATES NEW PROJECTILE
            Projectile NewProjectileBerserk = Instantiate <Projectile>(projGun.DefaultModule.chargeProjectiles[1].Projectile);

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

            //SETS PROJECTILE STATS
            NewProjectileBerserk.AdditionalScaleMultiplier *= 0.6f;
            NewProjectileBerserk.baseData.damage            = 4f;
        }
        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("Black Stabbith", "stab");

            // "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:black_stabbith", "ski:black_stabbith");
            gun.gameObject.AddComponent <BlackStabbith>();
            //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("Judge jury and executioner");
            gun.SetLongDescription("This blade of blades was weilded by a terrifying vigilanty of justice. This style of blade is typically reserved for executions however this blade takes its duty one step further. If the convicted manages to escape the initial blow a flurry of blades will manifest to cripple their escape. " +
                                   "\n\n\n - Knife_to_a_Gunfight" +
                                   "___________________________________________");
            gun.SetupSprite(null, "stab_idle_001", 8);
            gun.SetAnimationFPS(gun.chargeAnimation, 5);
            gun.SetAnimationFPS(gun.shootAnimation, 50);
            gun.SetAnimationFPS(gun.reloadAnimation, 24);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 4;
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(541) as Gun, true, false);

            gun.DefaultModule.ammoCost                  = 1;
            gun.DefaultModule.angleVariance             = 0f;
            gun.DefaultModule.shootStyle                = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle             = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.preventFiringDuringCharge = true;
            Gun gun3 = (Gun)ETGMod.Databases.Items["wonderboy"];

            gun.muzzleFlashEffects         = gun3.muzzleFlashEffects;
            gun.reloadTime                 = 1f;
            gun.DefaultModule.cooldownTime = .0f;

            gun.DefaultModule.numberOfShotsInClip = 5;
            gun.SetBaseMaxAmmo(75);
            gun.quality = PickupObject.ItemQuality.B;

            gun.encounterTrackable.EncounterGuid = "stab stab stab";
            //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.damage = 11f;
            projectile.baseData.speed  = 1f;
            projectile.baseData.range  = 1f;

            projectile.transform.parent = gun.barrelOffset;

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

            float[] offsetsX = new float[] { 0.0f, 0.0f, -.4f, -.4f, -.4f };
            float[] offsetsY = new float[] { 0.0f, .6f, 1.5f, 1.5f, 1.5f };
            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("stab_fire");

            float[] offsetsX2 = new float[] { -.4f, -.1f, .1f, .1f, 0.0f, };
            float[] offsetsY2 = new float[] { 1.5f, 1f, .5f, 0.0f, 0.0f, };
            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].position3.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY2[i];
            }
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #24
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("Cursed Katana", "cursedkatana");

            // "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:cursed_katana", "cak:cursed_katana");
            gun.gameObject.AddComponent <CursedKatana>();
            //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("Cutting Word");
            gun.SetLongDescription("Swordplay is forbidden, and only the most powerful or most ignorant individuals can get away with using any melee weaponry.");
            // 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, "cursedkatana_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, 15);
            gun.SetAnimationFPS(gun.reloadAnimation, 6);
            // Every modded gun has base projectile it works with that is borrowed from other guns in the game.
            GunExt.AddProjectileModuleFrom(gun, "wonderboy", true, true);
            gun.HeroSwordDoesntBlank = true;
            // 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.
            // 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.01f;
            gun.DefaultModule.cooldownTime        = 0.8f;
            gun.DefaultModule.numberOfShotsInClip = 999999999;
            gun.SetBaseMaxAmmo(1000);
            gun.InfiniteAmmo = true;
            gun.barrelOffset.localPosition           += new Vector3(0f, 0.5f, 0f);
            gun.barrelOffset.transform.localPosition += new Vector3(0f, -1f, 0f);
            // 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.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "cursedkatana";
            //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]);
            Gun        gun3       = (Gun)ETGMod.Databases.Items["wonderboy"];

            gun.muzzleFlashEffects = gun3.muzzleFlashEffects;
            gun.gunClass           = GunClass.SILLY;
            gun.gunSwitchGroup     = "Shotgun";
            gun.IsHeroSword        = true;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            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          *= 2.5f;
            projectile.baseData.speed           *= 2.5f;
            projectile.transform.parent          = gun.barrelOffset;
            projectile.AdditionalScaleMultiplier = 8f;
            projectile.baseData.range            = 10f;
            gun.CanBeDropped = false;
            //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");
        }
Пример #25
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Rekeyter", "rekeyter");

            Game.Items.Rename("outdated_gun_mods:rekeyter", "nn:rekeyter");
            gun.gameObject.AddComponent <Rekeyter>();
            gun.SetShortDescription("Click");
            gun.SetLongDescription("A key clumsily fused to a grip and trigger. Low chance to open chests." + "\n\nHidden sidearm of the infamous criminal Locke Smith.");

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

            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(95) as Gun).gunSwitchGroup;

            gun.SetAnimationFPS(gun.shootAnimation, 15);

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

            //GUN STATS
            gun.DefaultModule.ammoCost          = 1;
            gun.DefaultModule.shootStyle        = ProjectileModule.ShootStyle.Burst;
            gun.DefaultModule.burstShotCount    = 2;
            gun.DefaultModule.burstCooldownTime = 0.11f;
            gun.DefaultModule.sequenceStyle     = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.5f;
            gun.DefaultModule.numberOfShotsInClip    = 10;
            gun.barrelOffset.transform.localPosition = new Vector3(1.93f, 0.81f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.gunClass = GunClass.PISTOL;

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

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

            KeyBulletBehaviour unlocking = projectile.gameObject.GetOrAddComponent <KeyBulletBehaviour>();

            unlocking.useSpecialTint = false;
            unlocking.procChance     = 0.1f;
            ScaleProjectileStatOffConsumableCount keyDamage = projectile.gameObject.GetOrAddComponent <ScaleProjectileStatOffConsumableCount>();

            keyDamage.multiplierPerLevelOfStat = 0.1f;
            keyDamage.projstat       = ScaleProjectileStatOffConsumableCount.ProjectileStatType.DAMAGE;
            keyDamage.consumableType = ScaleProjectileStatOffConsumableCount.ConsumableType.KEYS;

            projectile.SetProjectileSpriteRight("rekeyter_projectile", 17, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 17, 6);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Rekeyter Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/rekeyter_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/rekeyter_clipempty");
            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "this is the Rekeyter";
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            gun.AddToSubShop(ItemBuilder.ShopType.Flynt);
            RekeyterID = gun.PickupObjectId;
        }
Пример #26
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Cpt Boombeard's Cutlass", "brd");

            Game.Items.Rename("outdated_gun_mods:cpt_boombeard's_cutlass", "ski:cpt_boombeard's_cutlass");
            gun.gameObject.AddComponent <Beard>();
            gun.SetShortDescription("Now with Real Dynamite!");
            gun.SetLongDescription("Infamous Captain Boombeard was known for interlacing his beard with explosives to terrify his opponents. Unfortunatly for him this idea was terrible as he managed to burn off his beard." +
                                   "\n\nGive a hearty chuckle to alert your crew its time to have some fun! ");

            gun.SetupSprite(null, "brd_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.reloadAnimation, 8);

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

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.gunHandedness = GunHandedness.OneHanded;
            gun.reloadTime    = .1f;
            gun.DefaultModule.cooldownTime        = 1f;
            gun.DefaultModule.numberOfShotsInClip = 20;
            gun.SetBaseMaxAmmo(400);

            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "Summon the megaladon!";

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

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage      *= 3f;
            projectile.baseData.range        = 1;
            projectile.baseData.speed       *= 1f;
            projectile.transform.parent      = gun.barrelOffset;
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "black_revolver_big";
            ProjectileSlashingBehaviour slash = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slash.SlashDamage     = 20;
            slash.SlashRange      = 3;
            slash.SlashDimensions = 90f;
            slash.InteractMode    = SlashDoer.ProjInteractMode.DESTROY;
            Beard.BuildPrefab();
            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("brd_fire");

            float[] offsetsX = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
            float[] offsetsY = new float[] { -0f, -1f, -1f, -1f, -1f };
            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];
            }
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Пример #27
0
        // Token: 0x06000061 RID: 97 RVA: 0x00005358 File Offset: 0x00003558
        public static void BuildPrefab()
        {
            bool flag  = GlowingWomb.WombPrefab != null || CompanionBuilder.companionDictionary.ContainsKey(GlowingWomb.guid);
            bool flag2 = flag;

            if (!flag2)
            {
                GlowingWomb.WombPrefab = CompanionBuilder.BuildPrefab("Glowing Womb", GlowingWomb.guid, GlowingWomb.spritePaths[0], new IntVector2(3, 2), new IntVector2(8, 9));
                GlowingWomb.WombBehavior wombBehavior = GlowingWomb.WombPrefab.AddComponent <GlowingWomb.WombBehavior>();
                AIAnimator aiAnimator = wombBehavior.aiAnimator;
                aiAnimator.MoveAnimation = new DirectionalAnimation
                {
                    Type      = DirectionalAnimation.DirectionType.TwoWayHorizontal,
                    Flipped   = new DirectionalAnimation.FlipType[2],
                    AnimNames = new string[]
                    {
                        "run_right",
                        "run_left"
                    }
                };
                aiAnimator.IdleAnimation = new DirectionalAnimation
                {
                    Type      = DirectionalAnimation.DirectionType.TwoWayHorizontal,
                    Flipped   = new DirectionalAnimation.FlipType[2],
                    AnimNames = new string[]
                    {
                        "idle_right",
                        "idle_left"
                    }
                };
                bool flag3 = GlowingWomb.wombCollection == null;
                if (flag3)
                {
                    GlowingWomb.wombCollection = SpriteBuilder.ConstructCollection(GlowingWomb.WombPrefab, "Womb_Collection");
                    UnityEngine.Object.DontDestroyOnLoad(GlowingWomb.wombCollection);
                    for (int i = 0; i < GlowingWomb.spritePaths.Length; i++)
                    {
                        SpriteBuilder.AddSpriteToCollection(GlowingWomb.spritePaths[i], GlowingWomb.wombCollection);
                    }
                    SpriteBuilder.AddAnimation(wombBehavior.spriteAnimator, GlowingWomb.wombCollection, new List <int>
                    {
                        0,
                        1
                    }, "idle_left", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 5f;
                    SpriteBuilder.AddAnimation(wombBehavior.spriteAnimator, GlowingWomb.wombCollection, new List <int>
                    {
                        2,
                        3
                    }, "idle_right", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 5f;
                    SpriteBuilder.AddAnimation(wombBehavior.spriteAnimator, GlowingWomb.wombCollection, new List <int>
                    {
                        4,
                        5
                    }, "run_left", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 14f;
                    SpriteBuilder.AddAnimation(wombBehavior.spriteAnimator, GlowingWomb.wombCollection, new List <int>
                    {
                        6,
                        7
                    }, "run_right", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 14f;
                }
                wombBehavior.aiActor.SetIsFlying(true, "HONK", false, true);
                wombBehavior.aiActor.MovementSpeed = 7f;
                wombBehavior.specRigidbody.Reinitialize();
                wombBehavior.specRigidbody.CollideWithTileMap = false;
                wombBehavior.aiActor.CanTargetEnemies         = true;
                BehaviorSpeculator behaviorSpeculator = wombBehavior.behaviorSpeculator;
                behaviorSpeculator.AttackBehaviors.Add(new GlowingWomb.WombAttackBehavior());
                behaviorSpeculator.MovementBehaviors.Add(new GlowingWomb.ApproachEnemiesBehavior());
                behaviorSpeculator.MovementBehaviors.Add(new CompanionFollowPlayerBehavior
                {
                    IdleAnimations = new string[]
                    {
                        "idle"
                    }
                });
                UnityEngine.Object.DontDestroyOnLoad(GlowingWomb.WombPrefab);
                FakePrefab.MarkAsFakePrefab(GlowingWomb.WombPrefab);
                GlowingWomb.WombPrefab.SetActive(false);
            }
        }
Пример #28
0
        // Token: 0x06000061 RID: 97 RVA: 0x00005358 File Offset: 0x00003558
        public static void BuildPrefab()
        {
            bool flag  = HappyLad.PenguinPrefab != null || CompanionBuilder.companionDictionary.ContainsKey(HappyLad.guid);
            bool flag2 = flag;

            if (!flag2)
            {
                HappyLad.PenguinPrefab = CompanionBuilder.BuildPrefab("Happy Lad", HappyLad.guid, HappyLad.spritePaths[0], new IntVector2(1, 0), new IntVector2(7, 12));
                HappyLad.PenguinBehavior penguinBehavior = HappyLad.PenguinPrefab.AddComponent <HappyLad.PenguinBehavior>();
                AIAnimator aiAnimator = penguinBehavior.aiAnimator;
                aiAnimator.MoveAnimation = new DirectionalAnimation
                {
                    Type      = DirectionalAnimation.DirectionType.TwoWayHorizontal,
                    Flipped   = new DirectionalAnimation.FlipType[2],
                    AnimNames = new string[]
                    {
                        "run_right",
                        "run_left"
                    }
                };
                aiAnimator.IdleAnimation = new DirectionalAnimation
                {
                    Type      = DirectionalAnimation.DirectionType.TwoWayHorizontal,
                    Flipped   = new DirectionalAnimation.FlipType[2],
                    AnimNames = new string[]
                    {
                        "idle_right",
                        "idle_left"
                    }
                };
                bool flag3 = HappyLad.iceCollection == null;
                if (flag3)
                {
                    HappyLad.iceCollection = SpriteBuilder.ConstructCollection(HappyLad.PenguinPrefab, "Ice_Collection");
                    UnityEngine.Object.DontDestroyOnLoad(HappyLad.iceCollection);
                    for (int i = 0; i < HappyLad.spritePaths.Length; i++)
                    {
                        SpriteBuilder.AddSpriteToCollection(HappyLad.spritePaths[i], HappyLad.iceCollection);
                    }
                    SpriteBuilder.AddAnimation(penguinBehavior.spriteAnimator, HappyLad.iceCollection, new List <int>
                    {
                        0,
                        1
                    }, "idle_left", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 5f;
                    SpriteBuilder.AddAnimation(penguinBehavior.spriteAnimator, HappyLad.iceCollection, new List <int>
                    {
                        2,
                        3
                    }, "idle_right", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 5f;
                    SpriteBuilder.AddAnimation(penguinBehavior.spriteAnimator, HappyLad.iceCollection, new List <int>
                    {
                        0,
                        1
                    }, "run_left", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 5f;
                    SpriteBuilder.AddAnimation(penguinBehavior.spriteAnimator, HappyLad.iceCollection, new List <int>
                    {
                        2,
                        3
                    }, "run_right", tk2dSpriteAnimationClip.WrapMode.Loop).fps = 5f;
                }
                penguinBehavior.aiActor.MovementSpeed = 7f;
                penguinBehavior.specRigidbody.Reinitialize();
                penguinBehavior.specRigidbody.CollideWithTileMap = false;
                penguinBehavior.aiActor.CanTargetEnemies         = true;
                BehaviorSpeculator behaviorSpeculator = penguinBehavior.behaviorSpeculator;
                behaviorSpeculator.MovementBehaviors.Add(new CompanionFollowCursorBehaviour
                {
                    IdleAnimations = new string[]
                    {
                        "idle"
                    }
                });
                UnityEngine.Object.DontDestroyOnLoad(HappyLad.PenguinPrefab);
                FakePrefab.MarkAsFakePrefab(HappyLad.PenguinPrefab);
                HappyLad.PenguinPrefab.SetActive(false);
            }
        }
Пример #29
0
        public static void Add()
        {
            //Setting the display name of the gun and telling Gungeon what sprite prefix to look for in the mod's sprite files
            Gun gun = ETGMod.Databases.Items.NewGun("PPPPP", "cannon_factory");

            //Necessary line when using GunAPI
            Game.Items.Rename("outdated_gun_mods:ppppp", "bb:ppppp");
            //Adding this script to the gun

            gun.gameObject.AddComponent <CannonFactory>();

            //Setting the short description of the gun
            GunExt.SetShortDescription(gun, "Man the Cannons!");
            //Setting the long description of the gun
            GunExt.SetLongDescription(gun, "The Pirate's Personal Portable Plunder Producer, often abbreviated as the PPPPP, is a pirate's dream, as the name would suggest.\n\nWho wouldn't want a gun that shoots bullets that are cannons that shoot bullets?\n\nUsage: Shoots rotating cannons that can be fired by pressing E or interacting near them.");
            //Setting up the default sprite for the Ammonomicon and FPS of the gun
            GunExt.SetupSprite(gun, null, "cannon_factory_idle_001", 10);
            //Making it so that when the fire button is held down for a prolonged period of time, the firing animation loops from frame 2 rather than starting from the beginning
            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("cannon_factory_fire");

            fireClip.wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            fireClip.loopStart = 2;
            //Setting up the FPS for each of the gun's animations
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 10);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 10);
            GunExt.SetAnimationFPS(gun, gun.idleAnimation, 10);

            //Setting the gun's projectile, which must come from a gun in the base game. In this case, I chose the gun with an ID of 37, which is Serious Cannon
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(37) as Gun, true, false);
            //Setting the ammo cost of the gun
            gun.DefaultModule.ammoCost = 1;
            //Setting the shoot style of the gun (between automatic, semi automatic, or charged)
            gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Automatic;
            //This determines the order that the gun should fire each of its projectiles, which is useless here because the gun only has one projectile
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            //Setting the reload time of the gun
            gun.reloadTime = 3f;
            //Setting the fire rate of the gun, in cooldown time between shots
            gun.DefaultModule.cooldownTime = 0.75f;
            //Setting the clip size of the gun
            gun.DefaultModule.numberOfShotsInClip = 5;
            //Setting the location at which projectiles are fired from the gun
            gun.barrelOffset.position += new Vector3(1f, 0.4f, 0f);
            //Setting the maximum ammo of the gun
            gun.SetBaseMaxAmmo(150);
            //Setting the rarity of the gun
            gun.quality = PickupObject.ItemQuality.A;

            //Setting the encounter GUID of the gun which can be anything as long as it's not the same as another gun's. In this case the GUID is "pirate" written in hexadecimal
            gun.encounterTrackable.EncounterGuid = "706972617465";
            //These lines allow the projectile to be easily cloned by things such as shadow clone or shadow bullets
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(((Gun)global::ETGMod.Databases.Items[37]).DefaultModule.chargeProjectiles[0].Projectile);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            //Setting the speed of the projectile
            projectile.baseData.speed = 0.87f;
            //Setting the number of bounces of the projectile to 0
            BounceProjModifier bounce = projectile.GetComponent <BounceProjModifier>();

            bounce.numberOfBounces = 0;
            //Setting the number of pierces of the projectile to 3
            PierceProjModifier pierce = projectile.GetComponent <PierceProjModifier>();

            pierce.penetratesBreakables = true;
            pierce.penetration          = 3;
            pierce.MaxBossImpacts       = 3;
            //Making it so that the projectile spawns at the correct location
            projectile.transform.parent = gun.barrelOffset;

            //Changing the sprite of the projectile to a custom one. In this case, a simple cannon
            projectile.SetProjectileSpriteRight("cannon_projectile", 19, 12, 15, 9);
            //Adding the gun to the item database
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            //Setting the angular velocity of the projectile. This is important because it is what makes it rotate
            projectile.angularVelocity = 180;

            //Adding a few synergies to the gun
            CustomSynergies.Add("ARRRR-C", new List <string>
            {
                "bb:ppppp"
            }, new List <string>
            {
                "remote_bullets",
                "ibomb_companion_app",
                "fortunes_favor",
                "rc_rocket"
            }, true);

            CustomSynergies.Add("Pirate Prowess", new List <string>
            {
                "bb:ppppp"
            }, new List <string>
            {
                "serious_cannon",
                "corsair",
                "scope",
                "eyepatch",
                "ring_of_chest_friendship",
                "map",
                "crutch"
            }, true);
        }
Пример #30
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("testing wand", "wand");

            // "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:testing_wand", "ski:testing_wand");
            gun.gameObject.AddComponent <testing_gun>();
            //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("Check 1 testing testing");
            gun.SetLongDescription("bopmo bip!");
            // 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, "wand_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.ForceImmediateReload(false);
            gun.reloadTime = 2f;
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.Burst;
            gun.DefaultModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.burstShotCount      = 1;
            gun.DefaultModule.burstCooldownTime   = 1;
            gun.DefaultModule.cooldownTime        = .5f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.SetBaseMaxAmmo(200);
            // 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 = "Debug.logError('frick');";
            //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 *= 10f;
            projectile.baseData.speed  *= 3f;
            projectile.DefaultTintColor = UnityEngine.Color.magenta;
            projectile.HasDefaultTint   = true;

            projectile.transform.parent = gun.barrelOffset;


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