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

            Game.Items.Rename("outdated_gun_mods:viscerifle", "nn:viscerifle");
            gun.gameObject.AddComponent <Viscerifle>();
            gun.SetShortDescription("Bloody Stream");
            gun.SetLongDescription("Fires hearts and armour as ammunition." + "\n\nThis, by definition, is not a rifle. The name is purely marketing." + "\n\nFires nothing if fired while invincible.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 0;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0.8f;

            gun.DefaultModule.angleVariance       = 0f;
            gun.DefaultModule.cooldownTime        = 0.5f;
            gun.DefaultModule.numberOfShotsInClip = 10;
            gun.CanGainAmmo = false;
            gun.barrelOffset.transform.localPosition = new Vector3(1.5f, 0.81f, 0f);
            gun.SetBaseMaxAmmo(0);
            gun.gunClass = GunClass.SHITTY;


            //HEART 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      *= 20f;
            projectile.pierceMinorBreakables = true;
            projectile.baseData.speed       *= 1f;
            projectile.ignoreDamageCaps      = true;
            projectile.baseData.range       *= 10f;
            projectile.SetProjectileSpriteRight("viscerifle_heart_projectile", 16, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 16, 7);
            GoopModifier blood = projectile.gameObject.AddComponent <GoopModifier>();

            blood.goopDefinition         = EasyGoopDefinitions.BlobulonGoopDef;
            blood.SpawnGoopInFlight      = true;
            blood.InFlightSpawnFrequency = 0.05f;
            blood.InFlightSpawnRadius    = 1f;
            blood.SpawnGoopOnCollision   = true;
            blood.CollisionSpawnRadius   = 2f;

            //SHADE BULLETS
            shadeProjectile = ProjectileSetupUtility.MakeProjectile(56, 20, 35, 23);
            shadeProjectile.SetProjectileSpriteRight("shadeviscerifle_proj", 16, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 16, 7);

            //ARMOUR
            armourProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            armourProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(armourProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(armourProjectile);
            armourProjectile.baseData.damage      *= 24f;
            armourProjectile.ignoreDamageCaps      = true;
            armourProjectile.baseData.speed       *= 1f;
            armourProjectile.baseData.range       *= 10;
            armourProjectile.pierceMinorBreakables = true;
            armourProjectile.SetProjectileSpriteRight("viscerifle_armour_projectile", 12, 8, false, tk2dBaseSprite.Anchor.MiddleCenter, 12, 8);
            armourProjectile.transform.parent = gun.barrelOffset;
            BlankOnHitModifier blankingArmour = armourProjectile.gameObject.GetOrAddComponent <BlankOnHitModifier>();

            blankingArmour.useTinyBlank = false;


            //CREST
            crestProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            crestProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(crestProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(crestProjectile);
            crestProjectile.ignoreDamageCaps      = true;
            crestProjectile.baseData.damage      *= 1000f;
            crestProjectile.baseData.speed       *= 1f;
            crestProjectile.baseData.range       *= 10;
            crestProjectile.pierceMinorBreakables = true;
            crestProjectile.SetProjectileSpriteRight("viscerifle_crest_projectile", 12, 9, false, tk2dBaseSprite.Anchor.MiddleCenter, 12, 9);
            crestProjectile.transform.parent = gun.barrelOffset;
            BlankOnHitModifier blankingCrest = crestProjectile.gameObject.GetOrAddComponent <BlankOnHitModifier>();

            blankingCrest.useTinyBlank = false;
            BounceProjModifier Bouncing = crestProjectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            Bouncing.numberOfBounces = 1;

            //FUCKYOUPROJECTILE
            fuckyouprojectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
            fuckyouprojectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(fuckyouprojectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(fuckyouprojectile);
            fuckyouprojectile.baseData.damage *= 0f;
            fuckyouprojectile.baseData.speed  *= 0f;
            fuckyouprojectile.baseData.range  *= 0;
            DieFuckYou fuckingdie = fuckyouprojectile.gameObject.GetOrAddComponent <DieFuckYou>();

            fuckyouprojectile.sprite.renderer.enabled = false;
            fuckyouprojectile.transform.parent        = gun.barrelOffset;


            projectile.transform.parent = gun.barrelOffset;

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

            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.PURCHASED_VISCERIFLE, true);
            gun.AddItemToGooptonMetaShop(23);
        }
Пример #2
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Sweeper", "sweeper");

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

            gun.SetShortDescription("B)");
            gun.SetLongDescription("Used for clearing minefields with it's forceful blast.\n\n" + "The numbers, what do they mean!?");

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

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

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

            //GUN STATS
            int iterator = 1;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.5f;
                mod.angleVariance       = 20f;
                mod.numberOfShotsInClip = 8;
                mod.projectiles.Clear();

                if (iterator != 1) //Numbers
                {
                    int ForIterator = 1;
                    for (int i = 0; i < 8; i++)
                    {
                        Projectile projectile = ProjectileSetupUtility.MakeProjectile(86, ForIterator, 15, 23);
                        projectile.hitEffects.alwaysUseMidair = true;
                        switch (ForIterator)
                        {
                        case 1:
                            projectile.SetProjectileSpriteRight("sweeper_1", 6, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 4, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.BlueGuonTransitionVFX;
                            break;

                        case 2:
                            projectile.SetProjectileSpriteRight("sweeper_2", 7, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 5, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.GreenGuonTransitionVFX;
                            break;

                        case 3:
                            projectile.SetProjectileSpriteRight("sweeper_3", 7, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 5, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.RedGuonTransitionVFX;
                            break;

                        case 4:
                            projectile.SetProjectileSpriteRight("sweeper_4", 7, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 5, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.BlueGuonTransitionVFX;
                            break;

                        case 5:
                            projectile.SetProjectileSpriteRight("sweeper_5", 7, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 5, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.RedGuonTransitionVFX;
                            break;

                        case 6:
                            projectile.SetProjectileSpriteRight("sweeper_6", 7, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 5, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.CyanGuonTransitionVFX;
                            break;

                        case 7:
                            projectile.SetProjectileSpriteRight("sweeper_7", 7, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 5, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.GreyGuonTransitionVFX;
                            break;

                        case 8:
                            projectile.SetProjectileSpriteRight("sweeper_8", 7, 10, false, tk2dBaseSprite.Anchor.MiddleCenter, 5, 8);
                            projectile.hitEffects.overrideMidairDeathVFX = RainbowGuonStone.GreyGuonTransitionVFX;
                            break;
                        }
                        mod.projectiles.Add(projectile);
                        ForIterator++;
                    }
                }
                else //Bomb
                {
                    Projectile projectile = ProjectileSetupUtility.MakeProjectile(86, 9, 10, 18);
                    projectile.SetProjectileSpriteRight("sweeper_bomb", 13, 13, false, tk2dBaseSprite.Anchor.MiddleCenter, 11, 11);
                    ExplosiveModifier boom = projectile.gameObject.GetOrAddComponent <ExplosiveModifier>();
                    boom.doExplosion   = true;
                    boom.explosionData = StaticExplosionDatas.explosiveRoundsExplosion;
                    mod.projectiles.Add(projectile);
                }



                gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
                gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Sweeper Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/sweeper_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/sweeper_clipempty");
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                iterator++;
            }

            gun.reloadTime = 1.4f;
            gun.barrelOffset.transform.localPosition = new Vector3(25f / 16f, 11f / 16f, 0f);
            gun.SetBaseMaxAmmo(80);
            gun.gunClass = GunClass.SHOTGUN;

            //CLIP OBJECT
            gun.gameObject.transform.Find("Clip").transform.position = new Vector3(6 / 16f, 9 / 16f); //used to position where your clips will spawn
            gun.clipObject            = BreakAbleAPI.BreakableAPIToolbox.GenerateDebrisObject("NevernamedsItems/Resources/Debris/sweeper_clip.png", true, 1, 5, 60, 20, null, 1, null, null, 1).gameObject;
            gun.reloadClipLaunchFrame = 3;                                                            //the frame on which the clip/s will spawn when the gun reloads
            gun.clipsToLaunchOnReload = 1;                                                            //self explanatory

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM;
            gun.Volley.UsesShotgunStyleVelocityRandomizer = true;

            ID = gun.PickupObjectId;
        }