public void SetGun(Items.Gun gun)
 {
     if (_gun != null)
     {
         DeactivateGun();
         _gun.SetAmmoCount(_ammoCount);
         _playerInventoryComponent.AddItem(_gun);
     }
     _gun = gun;
     _outfitComponent.ChangeGunSkin(_gun.GetGunType());
     _ammoCount = _gun.GetAmmoCount();
     ActivateGun();
 }
예제 #2
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("R.G.G.", "r.g.g.");

            RGG.rng_gun = gun;

            Game.Items.Rename("outdated_gun_mods:r.g.g.", "cel:r.g.g.");
            gun.gameObject.AddComponent <RGG>();
            gun.SetShortDescription("ShortDescription.txt");
            gun.SetLongDescription("Stats randomize each run. \n\nA gun from the fabled 3rd dimension, it has become unstable in this realm and is constantly shifting.");


            gun.SetupSprite(null, "r.g.g._idle_001", 8);

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

            gun.AddProjectileModuleFrom("ak-47", true, false);

            gun.sprite.IsPerpendicular      = true;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = RGG.rng_gun.reloadTime;
            gun.DefaultModule.cooldownTime        = RGG.rng_gun.DefaultModule.cooldownTime;
            gun.DefaultModule.numberOfShotsInClip = RGG.rng_gun.DefaultModule.numberOfShotsInClip;
            gun.muzzleFlashEffects = RGG.rng_gun.muzzleFlashEffects;
            gun.SetBaseMaxAmmo(RGG.rng_gun.GetBaseMaxAmmo());
            gun.quality  = PickupObject.ItemQuality.D;
            gun.gunClass = GunClass.SILLY;
            gun.encounterTrackable.EncounterGuid = "Thanks for the idea Reto! <3";
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
            gun.AddToSubShop(ItemBuilder.ShopType.Cursula);
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;

            projectile.transform.parent = gun.barrelOffset;

            if (SaveAPIManager.GetFlag(CustomDungeonFlags.EYESTRAINDISABLE) == true)
            {
                gun.sprite.usesOverrideMaterial = true;
                Material material = gun.sprite.renderer.material;
                material.shader = ShaderCache.Acquire("Brave/Internal/Glitch");
                material.SetFloat("_GlitchInterval", 0.05f);
                material.SetFloat("_DispProbability", 0.4f);
                material.SetFloat("_DispIntensity", 0.04f);
                material.SetFloat("_ColorProbability", 0.4f);
                material.SetFloat("_ColorIntensity", 0.04f);

                Material material2 = projectile.sprite.renderer.material;
                projectile.sprite.renderer.material = material;
                material2.shader = ShaderCache.Acquire("Brave/Internal/Glitch");
                material2.SetFloat("_GlitchInterval", 0.08f);
                material2.SetFloat("_DispProbability", 0.3f);
                material2.SetFloat("_DispIntensity", 0.014f);
                material2.SetFloat("_ColorProbability", 0.45f);
                material2.SetFloat("_ColorIntensity", 0.033f);
            }
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            RandomizeStats();
        }
예제 #3
0
 public override void OnPostFired(PlayerController player, Gun gun)
 {
 }
예제 #4
0
 public override void OnPostFired(PlayerController player, Gun gun)
 {
     gun.PreventNormalFireAudio = true;
     AkSoundEngine.PostEvent("Play_WPN_smileyrevolver_shot_01", gameObject);
 }
예제 #5
0
 public override void OnPostFired(PlayerController player, Gun gun)
 {
     gun.PreventNormalFireAudio = false;
     player.StartCoroutine(this.BackBlast(player));
 }
예제 #6
0
        public static void Add()
        {

            Gun gun = ETGMod.Databases.Items.NewGun("Plasma Cannon", "plasma_cannon");
            Game.Items.Rename("outdated_gun_mods:plasma_cannon", "cel:plasma_cannon");
            gun.gameObject.AddComponent<PlasmaCannon>();
            gun.SetShortDescription("Spelunk'd");
            gun.SetLongDescription("Shoots extremely powerful explosions. Use with extreme caution.\n\nIt was built by aliens from Earth's moon, but sadly the recoil proved to be too strong for them to use it easily.");
            gun.SetupSprite(null, "plasma_cannon_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 18);
            gun.SetAnimationFPS(gun.reloadAnimation, 6);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.DefaultModule.ammoCost = 1;
            gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2f;
            gun.DefaultModule.angleVariance = 0f;
            gun.DefaultModule.cooldownTime = .2f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.InfiniteAmmo = true;
            gun.DefaultModule.ammoType = (PickupObjectDatabase.GetById(16) as Gun).DefaultModule.ammoType;
            Gun gun2 = PickupObjectDatabase.GetById(32) as Gun;
            gun.muzzleFlashEffects = gun2.muzzleFlashEffects;
            gun.SetBaseMaxAmmo(150);
            gun.barrelOffset.transform.localPosition = new Vector3(1.2f, .3f);
            gun.quality = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "Good Luck Kiddo.";
            gun.sprite.IsPerpendicular = true;
            gun.gunClass = GunClass.EXPLOSIVE;
            Projectile projectile = UnityEngine.Object.Instantiate<Projectile>(gun.DefaultModule.projectiles[0]);
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent = gun.barrelOffset;
            projectile.baseData.damage *= 3;
            projectile.baseData.range *= 10000;
            projectile.baseData.speed *= 4;
            projectile.shouldRotate = true;
            //projectile.AppliesKnockbackToPlayer = true;
            //projectile.PlayerKnockbackForce = 100;
            Gun gun3 = PickupObjectDatabase.GetById(32) as Gun;
            gun.gunSwitchGroup = gun3.gunSwitchGroup;
            projectile.SetProjectileSpriteRight("plasma_shot", 32, 20, null, null);
            AIActor Firecracker = EnemyDatabase.GetOrLoadByGuid("4d37ce3d666b4ddda8039929225b7ede");
            ExplosiveModifier Spelunked = projectile.gameObject.AddComponent<ExplosiveModifier>();

            ExplosionData YourAreDecease = new ExplosionData
            {
                damageRadius = 5f,
                damageToPlayer = 0.5f,
                doDamage = true,
                damage = 35f,
                doExplosionRing = true,
                doDestroyProjectiles = true,
                doForce = true,
                debrisForce = 100f,
                pushRadius = 7f,
                force = 50f,
                preventPlayerForce = false,
                explosionDelay = 0f,
                usesComprehensiveDelay = false,
                doScreenShake = false,
                playDefaultSFX = true,
                effect = Firecracker.GetComponent<ExplodeOnDeath>().explosionData.effect,
                forceUseThisRadius = true,
                //AssetBundle assetBundle = ResourceManager.LoadAssetBundle("shared_auto_001");
                //  GameObject TestingVFX = assetBundle.LoadAsset<GameObject>("VFX_Dust_Explosion");
            };
            Spelunked.explosionData = YourAreDecease;
            Spelunked.IgnoreQueues = true;

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

            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);

        }
예제 #7
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Firework Rifle", "firework_rifle");

            Game.Items.Rename("outdated_gun_mods:firework_rifle", "cel:firework_rifle");
            gun.gameObject.AddComponent <FireworkRifle>();
            gun.SetShortDescription("Bang, Bang, Bang! Here We Go!");
            gun.SetLongDescription("Shoots powerful fireworks.\n\nThis gun came from a world caught in an eternal struggle for balance. It was created to celebrate the journey of a hero.");

            gun.SetupSprite(null, "firework_rifle_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 18);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);
            gun.AddProjectileModuleFrom("ak-47", true, false);

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = .8f;
            gun.DefaultModule.angleVariance       = 4f;
            gun.DefaultModule.cooldownTime        = .2f;
            gun.DefaultModule.numberOfShotsInClip = 12;
            gun.DefaultModule.ammoType            = (PickupObjectDatabase.GetById(16) as Gun).DefaultModule.ammoType;
            Gun gun2 = PickupObjectDatabase.GetById(32) as Gun;

            gun.muzzleFlashEffects = gun2.muzzleFlashEffects;
            gun.SetBaseMaxAmmo(150);
            gun.barrelOffset.transform.localPosition = new Vector3(2, .3f);
            gun.quality = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "pewpewgoboomboomdeath.";
            gun.sprite.IsPerpendicular           = true;
            gun.gunClass = GunClass.EXPLOSIVE;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.shouldRotate          = true;
            projectile.SetProjectileSpriteRight("firework_proj", 13, 7, null, null);
            AIActor           Firecracker = EnemyDatabase.GetOrLoadByGuid("5f15093e6f684f4fb09d3e7e697216b4");
            ExplosiveModifier GetFucked   = projectile.gameObject.AddComponent <ExplosiveModifier>();

            ExplosionData die = new ExplosionData
            {
                damageRadius         = 1.5f,
                damageToPlayer       = 0f,
                doDamage             = true,
                damage               = 15f,
                doExplosionRing      = true,
                doDestroyProjectiles = true,
                doForce              = true,
                debrisForce          = 5f,
                pushRadius           = 1.6f,
                force = 8f,
                preventPlayerForce     = true,
                explosionDelay         = 0f,
                usesComprehensiveDelay = false,
                doScreenShake          = false,
                playDefaultSFX         = true,
                effect = Firecracker.GetComponent <ExplodeOnDeath>().explosionData.effect,
                //AssetBundle assetBundle = ResourceManager.LoadAssetBundle("shared_auto_001");
                //  GameObject TestingVFX = assetBundle.LoadAsset<GameObject>("VFX_Dust_Explosion");
            };

            GetFucked.explosionData = die;


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

            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
        }
예제 #8
0
        private void Oil(PlayerController player, Gun gun)
        {
            var ddgm = DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(Library.goopDefs[0]);

            ddgm.TimedAddGoopCircle(Owner.sprite.WorldCenter, 3f, .1f);
        }
예제 #9
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Prime Cannon", "prime_cannon");

            Game.Items.Rename("outdated_gun_mods:prime_cannon", "cel:prime_cannon");
            gun.gameObject.AddComponent <PrimeCannon>();
            gun.SetShortDescription("Leedle");
            gun.SetLongDescription("u-u");
            gun.SetupSprite(null, "prime_cannon_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 4);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.SMALL_BULLET;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime     = 0f;
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(19) as Gun).gunSwitchGroup;
            gun.DefaultModule.angleVariance       = 0f;
            gun.DefaultModule.cooldownTime        = 1f;
            gun.DefaultModule.numberOfShotsInClip = 150;
            Gun gun2 = PickupObjectDatabase.GetById(15) as Gun;

            gun.muzzleFlashEffects = gun2.muzzleFlashEffects;
            gun.SetBaseMaxAmmo(150);
            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "For what purpose are you reading this????? why would you?? creep.";
            gun.sprite.IsPerpendicular           = true;
            gun.gunClass = GunClass.RIFLE;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0]          = projectile;
            gun.barrelOffset.transform.localPosition -= new Vector3(0, .4f);
            projectile.transform.parent = gun.barrelOffset;
            AIActor           Grenat    = EnemyDatabase.GetOrLoadByGuid("b4666cb6ef4f4b038ba8924fd8adf38f");
            ExplosiveModifier GetFucked = projectile.gameObject.AddComponent <ExplosiveModifier>();
            ExplosionData     die       = new ExplosionData
            {
                damageRadius         = 1.5f,
                damageToPlayer       = 0f,
                doDamage             = true,
                damage               = 20f,
                doExplosionRing      = true,
                doDestroyProjectiles = true,
                doForce              = true,
                debrisForce          = 5f,
                pushRadius           = 1.6f,
                force = 8f,
                preventPlayerForce     = true,
                explosionDelay         = 0f,
                usesComprehensiveDelay = false,
                doScreenShake          = false,
                playDefaultSFX         = true,
                effect = Grenat.GetComponent <ExplodeOnDeath>().explosionData.effect
            };

            GetFucked.explosionData = die;
            projectile.SetProjectileSpriteRight("prime_bomb", 9, 9, null, null);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
예제 #10
0
        protected override void DoEffect(PlayerController user)
        {
            ScrapCount += 1;

            AkSoundEngine.PostEvent("Play_OBJ_chest_open_01", base.gameObject);

            user.CurrentGun.ammo = 0;
            user.inventory.DestroyCurrentGun();

            if (ScrapCount == 1)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                //   LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(821).gameObject, user);
            }

            if (ScrapCount == 2)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
            }

            if (ScrapCount == 3)
            {
                PickupObject byId = PickupObjectDatabase.GetById(78);
                LootEngine.SpawnItem(byId.gameObject, user.specRigidbody.UnitCenter, Vector2.up, 1f, false, true, false);
                LootEngine.SpawnItem(byId.gameObject, user.specRigidbody.UnitCenter, Vector2.up, 1.5f, false, true, false);
            }

            if (ScrapCount == 4)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
            }

            if (ScrapCount == 5)
            {
                if (this.GunRando == FiGun.NONE)
                {
                    Gun fallout = PickupObjectDatabase.GetByName(this.falloutGun) as Gun;
                    Gun tesla   = PickupObjectDatabase.GetByName(this.teslaGun) as Gun;
                    Gun phazor  = PickupObjectDatabase.GetByName(this.phazorGun) as Gun;

                    this.GunRando = (DwarvenHammer.FiGun)UnityEngine.Random.Range(1, 4);

                    if (this.GunRando == FiGun.TESLA)
                    {
                        this.m_player.inventory.AddGunToInventory(tesla, true);
                    }
                    if (this.GunRando == FiGun.PHAZOR)
                    {
                        this.m_player.inventory.AddGunToInventory(phazor, true);
                    }
                    if (GunRando == FiGun.FALLOUT)
                    {
                        this.m_player.inventory.AddGunToInventory(fallout, true);
                    }
                }
            }
            if (ScrapCount >= 6)
            {
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(120).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
                LootEngine.GivePrefabToPlayer(PickupObjectDatabase.GetById(565).gameObject, user);
            }
        }
예제 #11
0
 public override void OnPostFired(PlayerController player, Gun gun)
 {
     gun.PreventNormalFireAudio = true;
     AkSoundEngine.PostEvent("Play_ENV_puddle_zap_01", gameObject);
 }
예제 #12
0
 public override void OnAutoReload(PlayerController player, Gun gun)
 {
     base.OnAutoReload(player, gun);
     //forme = 1;
 }
예제 #13
0
        public static void Add()
        {
            string shorthandName = "ion_fist";
            Gun    gun           = ETGMod.Databases.Items.NewGun("Ion Fist", shorthandName);

            Game.Items.Rename("outdated_gun_mods:" + shorthandName, "cel:" + shorthandName);
            gun.gameObject.AddComponent <IonFist>();
            gun.SetShortDescription("Casually Approach Child");
            gun.SetLongDescription("Charge up for powerful dashes. Grants melee immunity and flight while dashing. A fully-charged dash reflects projectiles.\n\nThis guantlet is charged to the brim with ions. Simply touching another object creates a powerful electric surge.");
            gun.SetupSprite(null, shorthandName + "_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 24);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.SetBaseMaxAmmo(180);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.2f;
            gun.DefaultModule.cooldownTime = 0.5f;
            gun.gunClass = GunClass.CHARGE;
            gun.DefaultModule.numberOfShotsInClip = 5;
            gun.quality = PickupObject.ItemQuality.A;
            gun.muzzleFlashEffects.type          = VFXPoolType.None;
            gun.DefaultModule.angleVariance      = 0f;
            gun.encounterTrackable.EncounterGuid = "ion dash fist gun owo";
            gun.sprite.IsPerpendicular           = true;
            Projectile projectile1 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(153) as Gun).DefaultModule.projectiles[0]);

            projectile1.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile1.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile1);
            gun.DefaultModule.projectiles[0] = projectile1;
            projectile1.gameObject.AddComponent <UnchangeableRangeController>();
            projectile1.baseData.damage          *= 1.2f;
            projectile1.baseData.speed           *= 1f;
            projectile1.baseData.force           *= 1f;
            projectile1.baseData.range            = 4f;
            projectile1.AdditionalScaleMultiplier = 1.1f;
            projectile1.transform.parent          = gun.barrelOffset;
            projectile1.sprite.renderer.enabled   = false;
            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(153) as Gun).DefaultModule.projectiles[0]);

            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            gun.DefaultModule.projectiles[0] = projectile2;
            gun.gunHandedness = GunHandedness.HiddenOneHanded;
            projectile2.gameObject.AddComponent <UnchangeableRangeController>();
            projectile2.baseData.damage          *= 2.5f;
            projectile2.baseData.speed           *= .75f;
            projectile2.baseData.force           *= 1f;
            projectile2.baseData.range            = 7.5f;
            projectile2.AdditionalScaleMultiplier = 1.1f;
            projectile2.transform.parent          = gun.barrelOffset;
            projectile2.sprite.renderer.enabled   = false;
            Projectile projectile3 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(153) as Gun).DefaultModule.projectiles[0]);

            projectile3.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile3.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile3);
            gun.DefaultModule.projectiles[0] = projectile3;
            projectile3.gameObject.AddComponent <UnchangeableRangeController>();
            projectile3.baseData.damage          *= 5f;
            projectile3.baseData.speed           *= .75f;
            projectile3.baseData.force           *= 1f;
            projectile3.baseData.range            = 14f;
            projectile3.AdditionalScaleMultiplier = 1.1f;
            projectile3.transform.parent          = gun.barrelOffset;
            projectile3.sprite.renderer.enabled   = false;
            ProjectileModule.ChargeProjectile chargeProj1 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = projectile1,
                ChargeTime = .0f,
            };
            ProjectileModule.ChargeProjectile chargeProj2 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = projectile2,
                ChargeTime = .6f,
            };
            ProjectileModule.ChargeProjectile chargeProj3 = new ProjectileModule.ChargeProjectile()
            {
                Projectile = projectile3,
                ChargeTime = 1.2f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                chargeProj1,
                chargeProj2,
                chargeProj3
            };

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