Esempio n. 1
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Junk Sword", "junk1_sword");

            Game.Items.Rename("outdated_gun_mods:junk_sword", "spapi:junk_sword");
            gun.gameObject.AddComponent <JunkSwordController>();
            GunExt.SetShortDescription(gun, "Next Time... What is This?");
            GunExt.SetLongDescription(gun, "Just a sword made out of junk. Some of the junk seems enchanted and may react different the more normal junk is around.");
            GunExt.SetupSprite(gun, null, "junk1_sword_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 8);
            GunExt.AddProjectileModuleFrom(gun, "wonderboy", true, true);
            gun.DefaultModule.projectiles[0].baseData.damage = 5;
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance       = 0;
            gun.DefaultModule.ammoType            = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            gun.DefaultModule.numberOfShotsInClip = 999;
            gun.reloadTime   = 0;
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.C;
            gun.barrelOffset.transform.localPosition = new Vector3(1.750f, 0.3f, 0f);
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(574) as Gun).muzzleFlashEffects;
            gun.encounterTrackable.EncounterGuid = "junkan1_sword";
            gun.OverrideNormalFireAudioEvent     = "Play_WPN_blasphemy_shot_01";
            gun.gunClass             = GunClass.SILLY;
            gun.gunSwitchGroup       = "Shotgun";
            gun.IsHeroSword          = true;
            gun.HeroSwordDoesntBlank = true;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            JunkSwordController.NormalSwordId = gun.PickupObjectId;
            JunkSwordController.InitFormes();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(417);
        }
Esempio n. 2
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Lich's Faithful Gun", "lichs_favorite");

            Game.Items.Rename("outdated_gun_mods:lich's_faithful_gun", "spapi:lichs_faithful_gun");
            gun.gameObject.AddComponent <LichsFavoriteController>();
            GunExt.SetShortDescription(gun, "Iron Fights");
            GunExt.SetLongDescription(gun, "Doesn't shoot. Once used by the lord of the Sixth Chamber as his favorite weapon.\n\nThis gun radiates unfathomable magical power.");
            GunExt.SetupSprite(gun, null, "lichs_favorite_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance       = 0;
            gun.DefaultModule.ammoType            = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            gun.DefaultModule.cooldownTime        = 0;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.S;
            gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f);
            gun.encounterTrackable.EncounterGuid     = "lichs_favorite_gun";
            gun.gunClass = GunClass.PISTOL;
            gun.muzzleFlashEffects.type = VFXPoolType.None;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(198);
            gun.SetupUnlockOnFlag(GungeonFlags.GUNSLINGER_PAST_KILLED, true);
        }
Esempio n. 3
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Mimigun", "mimigun");

            Game.Items.Rename("outdated_gun_mods:mimigun", "spapi:mimigun");
            gun.gameObject.AddComponent <MimigunController>();
            GunExt.SetShortDescription(gun, "Baby Good Mimigun");
            GunExt.SetLongDescription(gun, "Despite most mimics being evil, and trying to stop gungeoneers in any ways, this one is good and will try to help it's owner as it can. It isn't very powerful, but as all mimics, it has the ability to mimic anything" +
                                      " it sees. It one will try to use it to help.");
            GunExt.SetupSprite(gun, null, "mimigun_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, Toolbox.GetGunById(734), true, false);
            gun.reloadTime = 2.0f;
            gun.SetBaseMaxAmmo(900);
            gun.quality = PickupObject.ItemQuality.A;
            gun.barrelOffset.transform.localPosition = new Vector3(1.85f, 0.6f, 0f);
            gun.encounterTrackable.EncounterGuid     = "mimigun_very_cute";
            gun.gunClass           = GunClass.SILLY;
            gun.gunSwitchGroup     = Toolbox.GetGunById(734).gunSwitchGroup;
            gun.muzzleFlashEffects = Toolbox.GetGunById(734).muzzleFlashEffects;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToCursulaShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(369);
            gun.SetupUnlockOnFlag(GungeonFlags.ITEMSPECIFIC_HAS_BEEN_PEDESTAL_MIMICKED, true);
            mimigunId = gun.PickupObjectId;
        }
Esempio n. 4
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Celebration", "mk1");

            Game.Items.Rename("outdated_gun_mods:celebration", "spapi:celebration");
            gun.gameObject.AddComponent <CelebrationMk1>();
            GunExt.SetShortDescription(gun, "Great For Gunparties!");
            GunExt.SetLongDescription(gun, "Shoots fireworks. Yes, fireworks.\n\nGun originally designed for being in highest-tier chests, but because of hate it got it was moved to lower-tier chests.");
            GunExt.SetupSprite(gun, null, "mk1_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            for (int i = 0; i < 3; i++)
            {
                GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            }
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.shootStyle     = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.angleVariance /= 1.25f;
                mod.ammoType       = GameUIAmmoType.AmmoType.GRENADE;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(275) as Gun).DefaultModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                mod.projectiles[0]          = projectile;
                projectile.transform.parent = gun.barrelOffset;
                projectile.name             = "Firework_Rocket";
                ExplosiveModifier explosiveMod = projectile.gameObject.AddComponent <ExplosiveModifier>();
                explosiveMod.explosionData = new ExplosionData();
                explosiveMod.explosionData.CopyFrom((PickupObjectDatabase.GetById(593) as Gun).DefaultModule.projectiles[0].GetComponent <ExplosiveModifier>().explosionData);
                explosiveMod.explosionData.effect = EnemyDatabase.GetOrLoadByGuid(RnGEnemyDatabase.GetRnGEnemyGuid(RnGEnemyDatabase.RnGEnemyType.DynaM80_Guy)).GetComponent <ExplodeOnDeath>().explosionData.effect;
                explosiveMod.IgnoreQueues         = true;
                projectile.SuppressHitEffects     = true;
                projectile.damageTypes            = CoreDamageTypes.None;
                projectile.AppliesFire            = false;
                mod.cooldownTime        = 1f;
                mod.numberOfShotsInClip = 1;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
            }
            gun.Volley.UsesShotgunStyleVelocityRandomizer = true;
            gun.Volley.DecreaseFinalSpeedPercentMin       = -10f;
            gun.Volley.IncreaseFinalSpeedPercentMax       = 10f;
            gun.reloadTime     = 2.5f;
            gun.gunSwitchGroup = Toolbox.GetGunById(39).gunSwitchGroup;
            gun.SetBaseMaxAmmo(75);
            gun.quality = PickupObject.ItemQuality.A;
            gun.barrelOffset.transform.localPosition = new Vector3(1f, 0.35f, 0f);
            gun.encounterTrackable.EncounterGuid     = "celebration_mk1";
            gun.gunClass = GunClass.EXPLOSIVE;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToCursulaShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(275);
        }
Esempio n. 5
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ugly Gun", "ugly_gun");

            Game.Items.Rename("outdated_gun_mods:ugly_gun", "spapi:ugly_gun");
            gun.gameObject.AddComponent <UglyGun>();
            GunExt.SetShortDescription(gun, "Ew!");
            GunExt.SetLongDescription(gun, "A very ugly gun. It doesn't even have a clip, how the heck does it shoot!?\n\nThis gun is a result of a mage trying to smith his own gun. That mage was very expirienced in magic and " +
                                      "enchantments, but he suck at gunsmithing.\n\nThis gun turned out to be a total fail. It has some parts missing, and light doesn't even affect it. Why the hell did you pick it up???");
            GunExt.SetupSprite(gun, null, "ugly_gun_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((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       = 12.123412342348102398f;
            projectile.baseData.speed       /= 4.412387401289374012438523f;
            projectile.SetProjectileSpriteRight("ugly_projectile_001", 11, 11);
            projectile.name        = "uGLy_PR0jeCt1L3";
            gun.clipObject         = Toolbox.CreateCustomClip("ugly_clip_001", 14, 10);
            gun.muzzleFlashEffects = Toolbox.CreateMuzzleflash("UglyMuzzleflash", new List <string> {
                "kill_me", "kill_me2"
            }, 1, new List <IntVector2> {
                new IntVector2(64, 46), new IntVector2(64, 46)
            }, new List <tk2dBaseSprite.Anchor> {
                tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft
            }, new List <Vector2> {
                Vector2.zero, Vector2.zero
            }, false, false, false, false, 0, VFXAlignment.Fixed, true, new List <float> {
                100f, 100f
            }, new List <Color> {
                Color.red,
                Color.red
            });
            gun.reloadClipLaunchFrame             = 0;
            gun.DefaultModule.cooldownTime        = 0.369817263493402345209387f;
            gun.DefaultModule.numberOfShotsInClip = 7;
            gun.reloadTime = 1.34871023948710239481f;
            gun.SetBaseMaxAmmo(513);
            gun.quality = PickupObject.ItemQuality.C;
            gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f);
            gun.encounterTrackable.EncounterGuid     = "very_ugly_gun";
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(22);
        }
Esempio n. 6
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Decagun", "decagun");

            Game.Items.Rename("outdated_gun_mods:decagun", "spapi:decagun");
            gun.gameObject.AddComponent <Decagun>();
            GunExt.SetShortDescription(gun, "A Regular Decagun");
            GunExt.SetLongDescription(gun, "In gunometry, a decagun is a ten-sided polygun or 10-gun.");
            GunExt.SetupSprite(gun, null, "decagun_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 13);
            GunExt.SetAnimationFPS(gun, gun.introAnimation, 16);
            for (int i = 0; i < 10; i++)
            {
                GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            }
            int index = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.angleVariance = 0;
                mod.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(38) as Gun).DefaultModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                mod.projectiles[0]          = projectile;
                projectile.transform.parent = gun.barrelOffset;
                projectile.baseData.damage  = 5.10f;
                projectile.baseData.speed   = 10;
                projectile.baseData.force   = 10;
                mod.cooldownTime            = 1;
                mod.numberOfShotsInClip     = 10;
                mod.positionOffset         += new Vector3(projOffsets[index].x, projOffsets[index].y, 0f);
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                else
                {
                    mod.ammoCost = 10;
                }
                index++;
            }
            gun.reloadTime = 1.10f;
            gun.SetBaseMaxAmmo(1000);
            gun.quality = PickupObject.ItemQuality.A;
            gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f);
            gun.encounterTrackable.EncounterGuid     = "decagun";
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(385);
        }
Esempio n. 7
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Suspicious Shotgun", "jail_npc_shotgun");

            Game.Items.Rename("outdated_gun_mods:suspicious_shotgun", "spapi:suspicious_shotgun");
            gun.gameObject.AddComponent <BowBowController>();
            GunExt.SetShortDescription(gun, "Covered in rainbow sparkles?");
            GunExt.SetLongDescription(gun, "A weird shotgun. Internal part of the barrel was painted in rainbow paint. A name \"Bow-Bow\" is also engraved on the barrel.\n\nThis strange shotgun was found in a cell. Probably someone forgot it there while they were moving to breach.");
            GunExt.SetupSprite(gun, null, "jail_npc_shotgun_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 8);
            for (int i = 0; i < 5; i++)
            {
                GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            }
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(51) as Gun).DefaultModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                mod.projectiles[0]          = projectile;
                projectile.transform.parent = gun.barrelOffset;
                mod.numberOfShotsInClip     = 7;
                projectile.baseData.damage  = 7f;
                mod.cooldownTime            = 0.6f;
                projectile.baseData.range  /= 2.25f;
                projectile.name             = "Suspicious_Shotgun_Projectile";
                mod.ammoType = GameUIAmmoType.AmmoType.SHOTGUN;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
            }
            gun.shellCasing                 = Toolbox.GetGunById(202).shellCasing;
            gun.reloadShellLaunchFrame      = 5;
            gun.shellCasingOnFireFrameDelay = 0;
            gun.shellsToLaunchOnFire        = 1;
            gun.shellsToLaunchOnReload      = 3;
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(200);
            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "boiled_bowler_shotga";
            gun.gunClass = GunClass.SHOTGUN;
            gun.barrelOffset.transform.localPosition = new Vector3(1.4f, 0.2f, 0f);
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(51) as Gun).muzzleFlashEffects;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToCursulaShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(100);
            gun.SetupUnlockOnFlag(GungeonFlags.BOWLER_ACTIVE_IN_FOYER, true);
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Aegis Gun", "aegis");

            Game.Items.Rename("outdated_gun_mods:aegis_gun", "spapi:aegis_gun");
            gun.gameObject.AddComponent <AegisGunController>();
            GunExt.SetShortDescription(gun, "En Guarde!");
            GunExt.SetLongDescription(gun, "Reloading shields enemy bullets.\n\nThis handgun was made out of a sword. Through, the melee abilities of the sword it was made from were completelly nullified, so this weapon doesn't anger the" +
                                      " jammed.");
            GunExt.SetupSprite(gun, null, "aegis_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(464) 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.DefaultTintColor      = new Color(1, 1, 1).WithAlpha(0.45f);
            projectile.HasDefaultTint        = true;
            projectile.name = "Explosive_Aegis_Shell";
            ExplosionData data = (PickupObjectDatabase.GetById(81) as Gun).DefaultModule.projectiles[0].GetComponent <ExplosiveModifier>().explosionData.CopyExplosionData();

            data.doDestroyProjectiles = false;
            data.doForce = false;
            data.damage *= 0.35f;
            ExplosiveModifier mod = projectile.gameObject.GetOrAddComponent <ExplosiveModifier>();

            mod.explosionData                     = data;
            gun.reloadClipLaunchFrame             = 0;
            gun.DefaultModule.cooldownTime        = 0.2f;
            gun.DefaultModule.numberOfShotsInClip = 4;
            gun.reloadTime = 1.4f;
            gun.SetBaseMaxAmmo(150);
            gun.quality            = PickupObject.ItemQuality.B;
            gun.gunSwitchGroup     = Toolbox.GetGunById(380).gunSwitchGroup;
            gun.muzzleFlashEffects = Toolbox.GetGunById(334).muzzleFlashEffects;
            gun.barrelOffset.transform.localPosition = new Vector3(0.9f, 0.55f, 0f);
            gun.encounterTrackable.EncounterGuid     = "aegis_junk";
            AdvancedDualWieldSynergyProcessor dualWieldController = gun.gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();

            dualWieldController.SynergyNameToCheck = "#SHIELD_BROS";
            dualWieldController.PartnerGunID       = 380;
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToCursulaShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(380);
        }
Esempio n. 9
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Junkan's Revenge", "junken");

            Game.Items.Rename("outdated_gun_mods:junkan's_revenge", "spapi:junkans_revenge");
            gun.gameObject.AddComponent <JunkansRevengeController>();
            GunExt.SetShortDescription(gun, "Next Time, Show No Mercy!");
            GunExt.SetLongDescription(gun, "Shoots Ser Junkan's Squires, that will promise to tear apart your enemies!");
            GunExt.SetupSprite(gun, null, "junken_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(35) as Gun).DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.name = "Junkan_Projectile";
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.SetProjectileSpriteRight("junken_proj_001", 12, 13, false, tk2dBaseSprite.Anchor.LowerLeft, false, false, 8, 10, 5, 1);
            projectile.gameObject.AddComponent <SpawnJunkanProjectileBehaviour>();
            projectile.baseData.damage            = 6f;
            gun.clipObject                        = Toolbox.CreateCustomClip("junken_clip_001", 12, 13);
            gun.reloadClipLaunchFrame             = 0;
            gun.DefaultModule.cooldownTime        = 0.625f;
            gun.DefaultModule.numberOfShotsInClip = 6;
            gun.reloadTime                        = 1.75f;
            gun.SetBaseMaxAmmo(250);
            gun.quality = PickupObject.ItemQuality.S;
            gun.barrelOffset.transform.localPosition = new Vector3(1.65f, 0.55f, 0f);
            gun.muzzleFlashEffects = Toolbox.GetGunById(81).muzzleFlashEffects;
            gun.gunSwitchGroup     = Toolbox.GetGunById(150).gunSwitchGroup;
            gun.encounterTrackable.EncounterGuid = "djunkans_rhevenge";
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.SetupUnlockOnFlag(GungeonFlags.ITEMSPECIFIC_SER_JUNKAN_MAXLVL, true);
            gun.PlaceItemInAmmonomiconAfterItemById(376);
        }
Esempio n. 10
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Big Gun", "big_gun");

            Game.Items.Rename("outdated_gun_mods:big_gun", "spapi:big_gun");
            gun.gameObject.AddComponent <BigGunController>();
            GunExt.SetShortDescription(gun, "A Gun That's Big");
            GunExt.SetLongDescription(gun, "A big gun.\n\nIn comparison with the Magnum, this one is bigger.");
            GunExt.SetupSprite(gun, null, "big_gun_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(601) as Gun, true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance = 0;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(601) 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      *= 2f;
            projectile.baseData.speed       *= 2f;
            projectile.name = "BigGun_Projectile";
            gun.DefaultModule.cooldownTime        = 0.15f;
            gun.DefaultModule.numberOfShotsInClip = 3;
            gun.reloadTime = 2.1f;
            gun.SetBaseMaxAmmo(60);
            gun.quality = PickupObject.ItemQuality.S;
            gun.barrelOffset.transform.localPosition = new Vector3(1.90f, 1.0f, 0f);
            gun.muzzleFlashEffects.type          = VFXPoolType.None;
            gun.encounterTrackable.EncounterGuid = "oh_look_this_gun_is_big";
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(601);
            AdvancedDualWieldSynergyProcessor dualWieldController = gun.gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();

            dualWieldController.SynergyNameToCheck = "#BIG_GUN_SHOTGUN-GUN";
            dualWieldController.PartnerGunID       = 601;
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Infinity", "infinity");

            Game.Items.Rename("outdated_gun_mods:infinity", "spapi:infinity");
            gun.gameObject.AddComponent <InfinityController>();
            GunExt.SetShortDescription(gun, "[sprite \"infinite-big\"]");
            GunExt.SetLongDescription(gun, "A small piece of never ending time matter, this gun might be older than the universe itself.\nEven though it isn't very powerful, it has a great potential...");
            GunExt.SetupSprite(gun, null, "infinity_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle     = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance  = 0;
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "infinity";
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((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            = 12.123412342348102398f;
            projectile.baseData.speed            /= 4.412387401289374012438523f;
            gun.DefaultModule.cooldownTime        = 0.369817263493402345209387f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.reloadTime   = 0f;
            gun.InfiniteAmmo = false;
            gun.quality      = PickupObject.ItemQuality.C;
            gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f);
            gun.encounterTrackable.EncounterGuid     = "infinity";
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(22);
            //Toolbox.CreateAmmoType("", "");
            //gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM;
            //gun.DefaultModule.customAmmoType = "ExampleUIClip";
        }
Esempio n. 12
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Lich Slayer 9000", "lich_slayer");

            Game.Items.Rename("outdated_gun_mods:lich_slayer_9000", "spapi:lich_slayer_9000");
            gun.gameObject.AddComponent <LichSlayer>();
            GunExt.SetShortDescription(gun, "Banger!");
            GunExt.SetLongDescription(gun, "This gun shoots bones that give lich an osteoporosis.\n\nMade in Zilla Industries for the most talented gungeoneer. Legends say he killed Lich, the Gungeon Master over 9000 times...");
            GunExt.SetupSprite(gun, null, "lich_slayer_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 6);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Automatic;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(812) 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;
            gun.DefaultModule.numberOfShotsInClip = 900;
            projectile.baseData.damage            = 12f;
            gun.DefaultModule.angleVariance      /= 2.5f;
            gun.DefaultModule.cooldownTime        = 0.05f;
            projectile.BossDamageMultiplier       = 1.35f;
            projectile.name            = "Lich_Slayer_Projectile";
            gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.SKULL;
            gun.reloadTime             = 1f;
            gun.SetBaseMaxAmmo(900);
            gun.quality = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "lich_slayer_9001";
            gun.gunClass = GunClass.FULLAUTO;
            gun.barrelOffset.transform.localPosition = new Vector3(2.05f, 0.60f, 0f);
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(274) as Gun).muzzleFlashEffects;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(16);
            gun.SetupUnlockOnStat(TrackedStats.TIMES_CLEARED_BULLET_HELL, DungeonPrerequisite.PrerequisiteOperation.GREATER_THAN, 9);
        }
Esempio n. 13
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Bullat Launcher", "batlauncher");

            Game.Items.Rename("outdated_gun_mods:bullat_launcher", "spapi:bullat_launcher");
            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, "batlauncher_idle_001", 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Charged;
            AdvancedGunBehaviour advancedGunBehaviour = gun.gameObject.AddComponent <AdvancedGunBehaviour>();

            advancedGunBehaviour.preventNormalFireAudio = true;
            gun.DefaultModule.angleVariance             = 0;
            gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            AIActor    bullat        = EnemyDatabase.GetOrLoadByGuid("2feb50a6a40f4f50982e89fd276f6f15");
            Projectile toInstantiate = null;

            foreach (AttackBehaviorBase behav in bullat.behaviorSpeculator.AttackBehaviors)
            {
                if (behav is AttackBehaviorGroup)
                {
                    foreach (AttackBehaviorGroup.AttackGroupItem item in (behav as AttackBehaviorGroup).AttackBehaviors)
                    {
                        if (item.Behavior is SuicideShotBehavior)
                        {
                            toInstantiate = bullat.bulletBank.GetBullet((item.Behavior as SuicideShotBehavior).bulletBankName).BulletObject.GetComponent <Projectile>();
                        }
                    }
                }
                else if (behav is SuicideShotBehavior)
                {
                    toInstantiate = bullat.bulletBank.GetBullet((behav as SuicideShotBehavior).bulletBankName).BulletObject.GetComponent <Projectile>();
                }
            }
            Projectile projectile = UnityEngine.Object.Instantiate(toInstantiate);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                new ProjectileModule.ChargeProjectile
                {
                    ChargeTime = 1.5f,
                    Projectile = projectile
                }
            };
            projectile.transform.parent    = gun.barrelOffset;
            projectile.collidesWithEnemies = true;
            projectile.baseData.damage     = 20f;
            gun.gunHandedness = GunHandedness.OneHanded;
            projectile.name   = "Bullat_Projectile";
            gun.DefaultModule.cooldownTime        = 0.5f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.DefaultModule.ammoType            = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType      = "finished small";
            gun.muzzleFlashEffects.type           = VFXPoolType.None;
            gun.reloadTime = 1.5f;
            gun.SetBaseMaxAmmo(50);
            gun.quality = PickupObject.ItemQuality.C;
            gun.barrelOffset.transform.localPosition = new Vector3(1.25f, 1.0625f, 0f);
            gun.encounterTrackable.EncounterGuid     = "batlauncher";
            gun.gunClass = GunClass.CHARGE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[1].FrameToDefinition().MakeOffset(new Vector2(-0.0625f, 0.0625f));
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[3].FrameToDefinition().MakeOffset(new Vector2(-0.0625f, 0.0625f));
            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 = 2;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(22);
            AdvancedInfiniteAmmoSynergyProcessor processor = gun.gameObject.AddComponent <AdvancedInfiniteAmmoSynergyProcessor>();

            processor.RequiredSynergy = "#KING_BULLAT_SHOOTER";
            processor.PreventsReload  = false;
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Scythe of the Jammed", "jamm_scythe");

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

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

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

            Game.Items.Rename("outdated_gun_mods:soul_orb", "spapi:soul_orb");
            SoulOrbController component = gun.gameObject.AddComponent <SoulOrbController>();

            GunExt.SetShortDescription(gun, "Contains SOUL");
            GunExt.SetLongDescription(gun, "Charges up. Firing consumes 3 charges and casts a powerful spell. Reloading swaps the spell and holding \"reload\" consumes 3 charge to heal the owner.\n\nSOUL is the essence of life in a far away kingdom. " +
                                      "It somehow works here too, even through gundead do not contain it.");
            GunExt.SetupSprite(gun, null, "soul_orb_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.angleVariance = 0;
            gun.SetBaseMaxAmmo(1);
            gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BULLET;
            Projectile oldProjectile           = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(47) as Gun).DefaultModule.projectiles[0]);
            SoulProjectileBehaviour projectile = Toolbox.CopyFields <SoulProjectileBehaviour>(oldProjectile);

            Destroy(oldProjectile);
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.AnimateProjectile(new List <string> {
                "vs_001",
                "vs_002",
                "vs_003",
                "vs_004",
                "vs_005"
            }, 16, true, new List <IntVector2> {
                new IntVector2(30, 12),
                new IntVector2(30, 12),
                new IntVector2(26, 12),
                new IntVector2(27, 14),
                new IntVector2(29, 12)
            }, Toolbox.ConstructListOfSameValues(true, 5), Toolbox.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 5), Toolbox.ConstructListOfSameValues(true, 5), Toolbox.ConstructListOfSameValues(true, 5),
                                         Toolbox.ConstructListOfSameValues <Vector3?>(null, 5), Toolbox.ConstructListOfSameValues <IntVector2?>(null, 5), Toolbox.ConstructListOfSameValues <IntVector2?>(null, 5), Toolbox.ConstructListOfSameValues <Projectile>(null, 5));
            gun.DefaultModule.cooldownTime       = 0f;
            component.preventNormalFireAudio     = true;
            component.overrideNormalFireAudio    = "Play_WPN_bsg_shot_01";
            projectile.AdditionalScaleMultiplier = 2f;
            projectile.hitEffects                 = Toolbox.GetGunById(417).DefaultModule.projectiles[0].hitEffects;
            projectile.ignoreDamageCaps           = true;
            projectile.baseData.damage            = 100f;
            gun.InfiniteAmmo                      = true;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.reloadTime                   = 0f;
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "white";
            gun.quality = PickupObject.ItemQuality.S;
            gun.barrelOffset.transform.localPosition = new Vector3(1.7f, 0.65f, 0f);
            gun.encounterTrackable.EncounterGuid     = "soul_orb";
            gun.gunClass = GunClass.PISTOL;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToTrorkShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(22);
            SoulFocusVFX = (PickupObjectDatabase.GetById(538) as SilverBulletsPassiveItem).SynergyPowerVFX;
        }
Esempio n. 17
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("High-Quality Gun", "hd");

            Game.Items.Rename("outdated_gun_mods:high-quality_gun", "spapi:high_quality_gun");
            gun.gameObject.AddComponent <HDGun>();
            GunExt.SetShortDescription(gun, "HD!");
            GunExt.SetLongDescription(gun, "Bullets charm enemies.\n\nThis gun is just magnum, but but has 4 times more pixels. Because of that, it seems very weird among all other guns, but at the same time looks kinda cool!");
            GunExt.SetupSprite(gun, null, "hd_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 13);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 12);
            GunExt.AddProjectileModuleFrom(gun, Toolbox.GetGunById(38), true, false);
            gun.gunSwitchGroup = "Magnum";
            VFXPool pool = new VFXPool();

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

            obj.SetActive(false);
            FakePrefab.MarkAsFakePrefab(obj);
            UnityEngine.Object.DontDestroyOnLoad(obj);
            tk2dSprite              sprite     = obj.AddComponent <tk2dSprite>();
            tk2dSpriteAnimator      animator   = obj.AddComponent <tk2dSpriteAnimator>();
            tk2dSpriteAnimationClip clip       = new tk2dSpriteAnimationClip();
            GameObject              origEffect = Toolbox.GetGunById(38).muzzleFlashEffects.effects[0].effects[0].effect;
            VFXObject origVfEffect             = Toolbox.GetGunById(38).muzzleFlashEffects.effects[0].effects[0];

            clip.fps    = origEffect.GetAnyComponent <tk2dSpriteAnimator>().DefaultClip.fps;
            clip.frames = new tk2dSpriteAnimationFrame[0];
            for (int i = 1; i < 4; i++)
            {
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame();
                frame.spriteId = Toolbox.VFXCollection.GetSpriteIdByName("hd_smoke_00" + i);
                Toolbox.VFXCollection.inst.spriteDefinitions[frame.spriteId] = Toolbox.VFXCollection.inst.spriteDefinitions[origEffect.GetAnyComponent <tk2dSpriteAnimator>().DefaultClip.frames[i - 1].spriteId].CopyDefinitionFrom();
                frame.spriteCollection = Toolbox.VFXCollection;
                clip.frames            = clip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            clip.wrapMode = tk2dSpriteAnimationClip.WrapMode.Once;
            clip.name     = "start";
            animator.spriteAnimator.Library       = animator.gameObject.AddComponent <tk2dSpriteAnimation>();
            animator.spriteAnimator.Library.clips = new tk2dSpriteAnimationClip[] { clip };
            animator.playAutomatically            = true;
            animator.DefaultClipId = animator.GetClipIdByName("start");
            SpriteAnimatorKiller kill = animator.gameObject.AddComponent <SpriteAnimatorKiller>();

            kill.fadeTime             = -1f;
            kill.animator             = animator;
            kill.delayDestructionTime = -1f;
            obj.gameObject.SetLayerRecursively(LayerMask.NameToLayer("Unpixelated"));
            vfObj.orphaned        = origVfEffect.orphaned;
            vfObj.attached        = origVfEffect.attached;
            vfObj.persistsOnDeath = origVfEffect.persistsOnDeath;
            vfObj.usesZHeight     = origVfEffect.usesZHeight;
            vfObj.zHeight         = origVfEffect.zHeight;
            vfObj.alignment       = origVfEffect.alignment;
            vfObj.destructible    = origVfEffect.destructible;
            vfObj.effect          = obj;
            VFXObject  vfObj2 = new VFXObject();
            GameObject obj2   = new GameObject("hd_flare");

            obj2.SetActive(false);
            FakePrefab.MarkAsFakePrefab(obj2);
            UnityEngine.Object.DontDestroyOnLoad(obj2);
            tk2dSprite              sprite2     = obj2.AddComponent <tk2dSprite>();
            tk2dSpriteAnimator      animator2   = obj2.AddComponent <tk2dSpriteAnimator>();
            tk2dSpriteAnimationClip clip2       = new tk2dSpriteAnimationClip();
            GameObject              origEffect2 = Toolbox.GetGunById(38).muzzleFlashEffects.effects[0].effects[1].effect;
            VFXObject origVfEffect2             = Toolbox.GetGunById(38).muzzleFlashEffects.effects[0].effects[1];

            clip2.fps    = origEffect2.GetAnyComponent <tk2dSpriteAnimator>().DefaultClip.fps;
            clip2.frames = new tk2dSpriteAnimationFrame[0];
            for (int i = 1; i < 6; i++)
            {
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame();
                frame.spriteId = Toolbox.VFXCollection.GetSpriteIdByName("hd_flare_00" + i);
                Toolbox.VFXCollection.inst.spriteDefinitions[frame.spriteId] = Toolbox.VFXCollection.inst.spriteDefinitions[origEffect2.GetAnyComponent <tk2dSpriteAnimator>().DefaultClip.frames[i - 1].spriteId].CopyDefinitionFrom();
                frame.spriteCollection = Toolbox.VFXCollection;
                clip2.frames           = clip2.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            clip2.wrapMode = tk2dSpriteAnimationClip.WrapMode.Once;
            clip2.name     = "start";
            animator2.spriteAnimator.Library       = animator2.gameObject.AddComponent <tk2dSpriteAnimation>();
            animator2.spriteAnimator.Library.clips = new tk2dSpriteAnimationClip[] { clip2 };
            animator2.playAutomatically            = true;
            animator2.DefaultClipId = animator2.GetClipIdByName("start");
            SpriteAnimatorKiller kill2 = animator2.gameObject.AddComponent <SpriteAnimatorKiller>();

            kill2.fadeTime             = -1f;
            kill2.animator             = animator2;
            kill2.delayDestructionTime = -1f;
            obj2.gameObject.SetLayerRecursively(LayerMask.NameToLayer("Unpixelated"));
            vfObj2.orphaned        = origVfEffect2.orphaned;
            vfObj2.attached        = origVfEffect2.attached;
            vfObj2.persistsOnDeath = origVfEffect2.persistsOnDeath;
            vfObj2.usesZHeight     = origVfEffect2.usesZHeight;
            vfObj2.zHeight         = origVfEffect2.zHeight;
            vfObj2.alignment       = origVfEffect2.alignment;
            vfObj2.destructible    = origVfEffect2.destructible;
            vfObj2.effect          = obj2;
            complex.effects        = new VFXObject[] { vfObj, vfObj2 };
            pool.effects           = new VFXComplex[] { complex };
            gun.muzzleFlashEffects = pool;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(38) as Gun).DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            gun.OverrideAngleSnap            = null;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.AppliesCharm          = true;
            projectile.CharmApplyChance      = 100f;
            projectile.baseData.damage       = 20f;
            projectile.charmEffect           = (PickupObjectDatabase.GetById(527) as BulletStatusEffectItem).CharmModifierEffect;
            projectile.GetAnySprite().spriteId = ETGMod.Databases.Items.ProjectileCollection.inst.GetSpriteIdByName("hd_bullet_001");
            ETGMod.Databases.Items.ProjectileCollection.inst.spriteDefinitions[projectile.GetAnySprite().spriteId] =
                ETGMod.Databases.Items.ProjectileCollection.inst.spriteDefinitions[(PickupObjectDatabase.GetById(38) as Gun).DefaultModule.projectiles[0].GetAnySprite().spriteId].CopyDefinitionFrom();
            gun.DefaultModule.numberOfShotsInClip = 8;
            projectile.name = "Charmingly_HD_Projectile";
            gun.reloadTime  = 1.0f;
            gun.SetBaseMaxAmmo(280);
            gun.quality = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "hd";
            gun.gunClass = GunClass.PISTOL;
            GameObject shellCasing = UnityEngine.Object.Instantiate(Toolbox.GetGunById(38).shellCasing);

            shellCasing.SetActive(false);
            FakePrefab.MarkAsFakePrefab(shellCasing);
            tk2dSpriteAnimator      gunAnim    = gun.GetComponent <tk2dSpriteAnimator>();
            tk2dSpriteAnimationClip reloadClip = gunAnim.GetClipByName(gun.reloadAnimation);

            reloadClip.frames = new tk2dSpriteAnimationFrame[0];
            foreach (string text in reloadFrames)
            {
                tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame {
                    spriteCollection = ETGMod.Databases.Items.WeaponCollection, spriteId = ETGMod.Databases.Items.WeaponCollection.GetSpriteIdByName(text)
                };
                reloadClip.frames = reloadClip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
            }
            UnityEngine.Object.DontDestroyOnLoad(shellCasing);
            shellCasing.GetAnyComponent <tk2dBaseSprite>().SetSprite(Toolbox.VFXCollection, Toolbox.VFXCollection.GetSpriteIdByName("hd_shell_001"));
            Toolbox.VFXCollection.spriteDefinitions[shellCasing.GetAnyComponent <tk2dBaseSprite>().spriteId] =
                Toolbox.GetGunById(38).shellCasing.GetAnyComponent <tk2dBaseSprite>().Collection.spriteDefinitions[Toolbox.GetGunById(38).shellCasing.GetAnyComponent <tk2dBaseSprite>().spriteId].CopyDefinitionFrom();
            shellCasing.AddComponent <AlwaysUnpixeledBehaviour>();
            gun.shellCasing            = shellCasing;
            gun.shellsToLaunchOnFire   = 0;
            gun.shellsToLaunchOnReload = 6;
            gun.reloadShellLaunchFrame = 2;
            gun.barrelOffset.transform.localPosition = new Vector3(1.0625f, 0.5625f, 0f);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToCursulaShop();
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(38);
            ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.Coolness, 3, StatModifier.ModifyMethod.ADDITIVE);
            tk2dSpriteDefinition ammonomiconDef = AmmonomiconController.ForceInstance.EncounterIconCollection.spriteDefinitions[AmmonomiconController.ForceInstance.EncounterIconCollection.GetSpriteIdByName("hd_idle_001")];

            ammonomiconDef.position1                  = new Vector3(ammonomiconDef.position1.x / 2, ammonomiconDef.position1.y / 2, ammonomiconDef.position1.z / 2);
            ammonomiconDef.position2                  = new Vector3(ammonomiconDef.position2.x / 2, ammonomiconDef.position2.y / 2, ammonomiconDef.position2.z / 2);
            ammonomiconDef.position3                  = new Vector3(ammonomiconDef.position3.x / 2, ammonomiconDef.position3.y / 2, ammonomiconDef.position3.z / 2);
            ammonomiconDef.boundsDataCenter           = new Vector3(ammonomiconDef.boundsDataCenter.x / 2, ammonomiconDef.boundsDataCenter.y / 2, ammonomiconDef.boundsDataCenter.z / 2);
            ammonomiconDef.boundsDataExtents          = new Vector3(ammonomiconDef.boundsDataExtents.x / 2, ammonomiconDef.boundsDataExtents.y / 2, ammonomiconDef.boundsDataExtents.z / 2);
            ammonomiconDef.untrimmedBoundsDataCenter  = new Vector3(ammonomiconDef.untrimmedBoundsDataCenter.x / 2, ammonomiconDef.untrimmedBoundsDataCenter.y / 2, ammonomiconDef.untrimmedBoundsDataCenter.z / 2);
            ammonomiconDef.untrimmedBoundsDataExtents = new Vector3(ammonomiconDef.untrimmedBoundsDataExtents.x / 2, ammonomiconDef.untrimmedBoundsDataExtents.y / 2, ammonomiconDef.untrimmedBoundsDataExtents.z / 2);
            List <tk2dSpriteDefinition> affected = new List <tk2dSpriteDefinition>();

            foreach (tk2dSpriteAnimationClip clip3 in gun.GetGunAnimationClips())
            {
                if (clip3.frames != null)
                {
                    foreach (tk2dSpriteAnimationFrame frame in clip3.frames)
                    {
                        if (frame != null && frame.spriteCollection != null)
                        {
                            tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                            if (def != null && !affected.Contains(def))
                            {
                                def.position1                  = new Vector3(def.position1.x / 2, def.position1.y / 2, def.position1.z / 2);
                                def.position2                  = new Vector3(def.position2.x / 2, def.position2.y / 2, def.position2.z / 2);
                                def.position3                  = new Vector3(def.position3.x / 2, def.position3.y / 2, def.position3.z / 2);
                                def.boundsDataCenter           = new Vector3(def.boundsDataCenter.x / 2, def.boundsDataCenter.y / 2, def.boundsDataCenter.z / 2);
                                def.boundsDataExtents          = new Vector3(def.boundsDataExtents.x / 2, def.boundsDataExtents.y / 2, def.boundsDataExtents.z / 2);
                                def.untrimmedBoundsDataCenter  = new Vector3(def.untrimmedBoundsDataCenter.x / 2, def.untrimmedBoundsDataCenter.y / 2, def.untrimmedBoundsDataCenter.z / 2);
                                def.untrimmedBoundsDataExtents = new Vector3(def.untrimmedBoundsDataExtents.x / 2, def.untrimmedBoundsDataExtents.y / 2, def.untrimmedBoundsDataExtents.z / 2);
                                def.RemoveOffset();
                                affected.Add(def);
                            }
                        }
                    }
                }
            }
            affected.Clear();
            int index = 0;

            foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.idleAnimation).frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null && !affected.Contains(def))
                {
                    def.MakeOffset(offsets[0][index]);
                    affected.Add(def);
                }
                index++;
            }
            index = 0;
            foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null && !affected.Contains(def))
                {
                    def.MakeOffset(offsets[1][index]);
                    affected.Add(def);
                }
                index++;
            }
            index = 0;
            foreach (tk2dSpriteAnimationFrame frame in gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null && !affected.Contains(def))
                {
                    def.MakeOffset(offsets[2][index]);
                    affected.Add(def);
                }
                index++;
            }
            AdvancedHoveringGunSynergyProcessor processor = gun.gameObject.AddComponent <AdvancedHoveringGunSynergyProcessor>();

            processor.RequiredSynergy              = "#LOW-QUALITY_HELP";
            processor.TargetGunID                  = 38;
            processor.UsesMultipleGuns             = false;
            processor.PositionType                 = HoveringGunController.HoverPosition.CIRCULATE;
            processor.AimType                      = HoveringGunController.AimType.PLAYER_AIM;
            processor.FireType                     = HoveringGunController.FireType.ON_RELOAD;
            processor.FireCooldown                 = 0.2f;
            processor.FireDuration                 = 0f;
            processor.OnlyOnEmptyReload            = false;
            processor.ShootAudioEvent              = "";
            processor.OnEveryShotAudioEvent        = "";
            processor.FinishedShootingAudioEvent   = "";
            processor.Trigger                      = AdvancedHoveringGunSynergyProcessor.TriggerStyle.CONSTANT;
            processor.NumToTrigger                 = 1;
            processor.TriggerDuration              = 0f;
            processor.ConsumesTargetGunAmmo        = false;
            processor.ChanceToConsumeTargetGunAmmo = 0f;
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Eye of the Storm", "eye");

            Game.Items.Rename("outdated_gun_mods:eye_of_the_storm", "spapi:eye_of_the_storm");
            gun.gameObject.AddComponent <StormEyeController>();
            GunExt.SetShortDescription(gun, "Legend of the Gungeon");
            GunExt.SetLongDescription(gun, "Legendary weapon, made using a framgent of the great bullet. Shoots powerful electrical bolts, and if they collide...\n\nGun from the past, now existing only as a clip, still of great power." +
                                      " Because of the overuse of the colliding, the gun collapsed, unleashing a great storm to the Gungeon.\n\nBeing made from the metal of the great bullet, from which all the gundead came, it will ignore any limitations and will hurt your " +
                                      "enemies without any mercy.");
            GunExt.SetupSprite(gun, null, "eye_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 32);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 16);
            for (int i = 0; i < 3; i++)
            {
                GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            }
            bool       upOrDown = false;
            Projectile lastProj = null;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.angleVariance = 0;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(47) as Gun).DefaultModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                mod.projectiles[0]          = projectile;
                projectile.transform.parent = gun.barrelOffset;
                projectile.baseData.damage  = 7f;
                mod.cooldownTime            = 0.6f;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                    upOrDown     = !upOrDown;
                }
                PierceProjModifier penetrateMod = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                penetrateMod.penetratesBreakables       = true;
                penetrateMod.penetration                = 999;
                penetrateMod.BeastModeLevel             = PierceProjModifier.BeastModeStatus.BEAST_MODE_LEVEL_ONE;
                penetrateMod.preventPenetrationOfActors = false;
                projectile.ignoreDamageCaps             = true;
                projectile.hitEffects = (PickupObjectDatabase.GetById(38) as Gun).DefaultModule.projectiles[0].hitEffects;
                lastProj                = projectile;
                mod.ammoType            = GameUIAmmoType.AmmoType.BLUE_SHOTGUN;
                mod.customAmmoType      = (PickupObjectDatabase.GetById(156) as Gun).DefaultModule.customAmmoType;
                mod.numberOfShotsInClip = 10;
                projectile.name         = "StormEye_Secondary_Projectile";
            }
            Gun gun2 = (Gun)ETGMod.Databases.Items["plasma_cell_gun"];

            gun.DefaultModule.customAmmoType = gun2.DefaultModule.customAmmoType;
            gun.Volley.projectiles[0].projectiles[0].SetProjectileSpriteRight("eye_proj_up_001", 8, 5);
            gun.Volley.projectiles[1].projectiles[0].SetProjectileSpriteRight("eye_proj_down_001", 8, 5);
            gun.Volley.projectiles[2].projectiles[0].SetProjectileSpriteRight("eye_proj_middle_001", 9, 5);
            lastProj.HasDefaultTint = true;
            lastProj.damageTypes    = CoreDamageTypes.Electric;
            lastProj.name           = "StormEye_Main_Projectile";
            gun.reloadTime          = 2f;
            gun.SetBaseMaxAmmo(100);
            gun.quality = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "eye_of_the_storm";
            gun.gunClass = GunClass.RIFLE;
            gun.barrelOffset.transform.localPosition = new Vector3(2.05f, 0.80f, 0f);
            gun.muzzleFlashEffects.type = VFXPoolType.None;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            AssetBundle assetBundle = ResourceManager.LoadAssetBundle("shared_auto_001");

            StormEyeController.goopDefs = new List <GoopDefinition>();
            foreach (string text in StormEyeController.goops)
            {
                GoopDefinition goopDefinition;
                try
                {
                    GameObject gameObject2 = assetBundle.LoadAsset(text) as GameObject;
                    goopDefinition = gameObject2.GetComponent <GoopDefinition>();
                }
                catch
                {
                    goopDefinition = (assetBundle.LoadAsset(text) as GoopDefinition);
                }
                goopDefinition.name = text.Replace("assets/data/goops/", "").Replace(".asset", "");
                StormEyeController.goopDefs.Add(goopDefinition);
            }
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(13);
            gun.SetupUnlockOnFlag(GungeonFlags.ACHIEVEMENT_CONSTRUCT_BULLET, true);
        }
Esempio n. 19
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 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);
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("The Sequencer", "sequencer");

            gun.idleAnimation  = "sequencer1_idle";
            gun.shootAnimation = "sequencer1_fire";
            Game.Items.Rename("outdated_gun_mods:the_sequencer", "spapi:the_sequencer");
            SequencerController controller = gun.gameObject.AddComponent <SequencerController>();

            GunExt.SetShortDescription(gun, "Change Your Mind");
            GunExt.SetLongDescription(gun, "A worn gun with an enchanted chamber. It's enchantment makes the gun change it's mood (as well as projectiles) very quickly. Like after every shot.\n\nThis gun was once worn by a famous gungeoneer and handcrafted " +
                                      "by him too. At first it was a normal gun, but a gunjurer accidentaly threw a magical spell on the chamber, enchanting it with the elements.");
            GunExt.SetupSprite(gun, null, "sequencer1_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.cooldownTime  = 0.50f;
            gun.DefaultModule.angleVariance = 0;
            //setting up fire proj.
            Projectile fireProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);

            fireProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(fireProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(fireProjectile);
            fireProjectile.transform.parent = gun.barrelOffset;
            fireProjectile.baseData.damage  = 20f;
            fireProjectile.baseData.force  /= 2f;
            fireProjectile.baseData.range   = 9999;
            fireProjectile.DefaultTintColor = Color.red;
            fireProjectile.HasDefaultTint   = true;
            fireProjectile.AppliesFire      = true;
            fireProjectile.FireApplyChance  = 100;
            fireProjectile.fireEffect       = (PickupObjectDatabase.GetById(295) as BulletStatusEffectItem).FireModifierEffect;
            fireProjectile.damageTypes      = CoreDamageTypes.Fire;
            fireProjectile.name             = "Sequencer_FireProjectile";
            SequencerController.replacementProjectiles.Add(fireProjectile);
            //setting up poison proj;
            Projectile poisonProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);

            poisonProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(poisonProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(poisonProjectile);
            poisonProjectile.transform.parent  = gun.barrelOffset;
            poisonProjectile.baseData.damage   = 20f;
            poisonProjectile.baseData.force   /= 2f;
            poisonProjectile.baseData.range    = 9999;
            poisonProjectile.DefaultTintColor  = Color.green;
            poisonProjectile.HasDefaultTint    = true;
            poisonProjectile.AppliesPoison     = true;
            poisonProjectile.PoisonApplyChance = 100;
            poisonProjectile.healthEffect      = (PickupObjectDatabase.GetById(204) as BulletStatusEffectItem).HealthModifierEffect;
            poisonProjectile.damageTypes       = CoreDamageTypes.Poison;
            poisonProjectile.name = "Sequencer_PoisonProjectile";
            SequencerController.replacementProjectiles.Add(poisonProjectile);
            //setting up electric proj;
            Projectile electricProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);

            electricProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(electricProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(electricProjectile);
            electricProjectile.transform.parent = gun.barrelOffset;
            electricProjectile.baseData.damage  = 28f;
            electricProjectile.baseData.force  /= 2f;
            electricProjectile.baseData.range   = 9999;
            electricProjectile.DefaultTintColor = Color.blue;
            electricProjectile.HasDefaultTint   = true;
            ComplexProjectileModifier chainBullets   = PickupObjectDatabase.GetById(298) as ComplexProjectileModifier;
            ChainLightningModifier    orAddComponent = electricProjectile.gameObject.GetOrAddComponent <ChainLightningModifier>();

            orAddComponent.LinkVFXPrefab       = chainBullets.ChainLightningVFX;
            orAddComponent.damageTypes         = chainBullets.ChainLightningDamageTypes;
            orAddComponent.maximumLinkDistance = chainBullets.ChainLightningMaxLinkDistance;
            orAddComponent.damagePerHit        = chainBullets.ChainLightningDamagePerHit;
            orAddComponent.damageCooldown      = chainBullets.ChainLightningDamageCooldown;
            if (chainBullets.ChainLightningDispersalParticles != null)
            {
                orAddComponent.UsesDispersalParticles        = true;
                orAddComponent.DispersalParticleSystemPrefab = chainBullets.ChainLightningDispersalParticles;
                orAddComponent.DispersalDensity      = chainBullets.ChainLightningDispersalDensity;
                orAddComponent.DispersalMinCoherency = chainBullets.ChainLightningDispersalMinCoherence;
                orAddComponent.DispersalMaxCoherency = chainBullets.ChainLightningDispersalMaxCoherence;
            }
            else
            {
                orAddComponent.UsesDispersalParticles = false;
            }
            electricProjectile.OnDestruction += controller.AddElectricGoop;
            electricProjectile.damageTypes    = CoreDamageTypes.Electric;
            electricProjectile.name           = "Sequencer_ElectricProjectile";
            SequencerController.replacementProjectiles.Add(electricProjectile);
            gun.reloadTime = 1f;
            gun.DefaultModule.numberOfShotsInClip = 3;
            gun.DefaultModule.ammoType            = GameUIAmmoType.AmmoType.CUSTOM;
            gun.SetBaseMaxAmmo(200);
            gun.DefaultModule.projectiles = new List <Projectile> {
                fireProjectile
            };
            gun.quality = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "sequencer_gun";
            gun.gunClass = GunClass.PISTOL;
            gun.barrelOffset.transform.localPosition = new Vector3(1.15f, 0.45f, 0f);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(341);
        }