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

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

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

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

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

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

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

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

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

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

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


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

            gun.DefaultModule.projectiles[0] = projectile;

            gun.quality = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            GuneonateID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("W3irdstar", "w3irdstar");

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

            burst.projectileToSpawn = projectile2;

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

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

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



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