예제 #1
0
 public IEnumerator FrozenToTheCore(Vector3 position)
 {
     if (gun.CurrentOwner && gun.CurrentOwner is PlayerController player)
     {
         for (int counter = 0; counter < 3; counter++)
         {
             for (int counter2 = 0; counter2 < 8; counter2++)
             {
                 GameObject gameObject = SpawnManager.SpawnProjectile(RoyalShotgun.mediumBullet.gameObject, position, Quaternion.Euler(0f, 0f, (45 * counter2)), true);
                 Projectile component  = gameObject.GetComponent <Projectile>();
                 if (component != null)
                 {
                     component.Owner           = player;
                     component.baseData.speed += 2 * counter;
                     PierceProjModifier pp = component.gameObject.AddComponent <PierceProjModifier>();
                     pp.penetration = 2;
                     player.DoPostProcessProjectile(component);
                 }
             }
         }
     }
     else
     {
         ETGModConsole.Log("nice fail");
     }
     yield break;
 }
예제 #2
0
        public void Spited(Vector3 position)
        {
            bool flag4 = Owner.HasPickupID(362);

            if (flag4)
            {
                Projectile         projectile = ((Gun)ETGMod.Databases.Items[362]).DefaultModule.projectiles[0];
                GameObject         gameObject = SpawnManager.SpawnProjectile(projectile.gameObject, position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0, 359)));
                Projectile         component2 = gameObject.GetComponent <Projectile>();
                PierceProjModifier spook      = component2.gameObject.AddComponent <PierceProjModifier>();
                spook.penetration = 5;
                {
                    component2.Owner   = Owner;
                    component2.Shooter = Owner.specRigidbody;
                }
            }
            else
            {
                Projectile         projectile = ((Gun)ETGMod.Databases.Items[19]).DefaultModule.projectiles[0];
                GameObject         gameObject = SpawnManager.SpawnProjectile(projectile.gameObject, position, Quaternion.Euler(0, 0, UnityEngine.Random.Range(0, 359)));
                Projectile         component2 = gameObject.GetComponent <Projectile>();
                PierceProjModifier spook      = component2.gameObject.AddComponent <PierceProjModifier>();
                spook.penetration = 1;
                {
                    component2.Owner   = Owner;
                    component2.Shooter = Owner.specRigidbody;
                }
            }
        }
예제 #3
0
        public override void PostProcessProjectile(Projectile projectile)
        {
            AkSoundEngine.PostEvent("Play_sling_fire_001", base.gameObject);
            AkSoundEngine.PostEvent("Play_sling_fire_001", base.gameObject);
            AkSoundEngine.PostEvent("Play_sling_fire_001", base.gameObject);
            PlayerController player = this.gun.CurrentOwner as PlayerController;

            if (projectile.GetCachedBaseDamage == 15)
            {
            }
            if (projectile.GetCachedBaseDamage == 16)
            {
                if (this.gun.ClipShotsRemaining >= 2)
                {
                    int        getclip     = this.gun.ClipShotsRemaining;
                    Projectile projectile1 = ((PickupObjectDatabase.GetByEncounterName("Sling") as Gun)).DefaultModule.chargeProjectiles[0].Projectile;
                    GameObject gameObject1 = SpawnManager.SpawnProjectile(projectile1.gameObject, player.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (player.CurrentGun == null) ? 0f : player.CurrentGun.CurrentAngle), true);
                    Projectile component1  = gameObject1.GetComponent <Projectile>();
                    component1.Owner                = player;
                    component1.baseData.damage      = 16;
                    component1.Shooter              = player.specRigidbody;
                    component1.BossDamageMultiplier = 3.3f;
                    PierceProjModifier stab3 = component1.gameObject.GetOrAddComponent <PierceProjModifier>();
                    AkSoundEngine.PostEvent("Play_sling_fire_001", base.gameObject);
                    AkSoundEngine.PostEvent("Play_sling_fire_001", base.gameObject);
                    AkSoundEngine.PostEvent("Play_sling_fire_001", base.gameObject);
                    stab3.penetration           = 1;
                    this.gun.ClipShotsRemaining = getclip - 1;
                    this.gun.GainAmmo(-1);
                }
            }
        }
예제 #4
0
        public static void FlakTime(Projectile projectile, PlayerController playerController)
        {
            Projectile projectile2 = ((Gun)ETGMod.Databases.Items[38]).DefaultModule.projectiles[0];

            for (float f = 0; f < UnityEngine.Random.Range(2f, 12f); f++)
            {
                GameObject gameObject = SpawnManager.SpawnProjectile(projectile2.gameObject, projectile.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (float)UnityEngine.Random.Range(0, 359)), true);
                Projectile component  = gameObject.GetComponent <Projectile>();
                if (component)
                {
                    component.SpawnedFromOtherPlayerProjectile = true;
                    component.Owner                     = playerController;
                    component.Shooter                   = playerController.specRigidbody;
                    component.baseData.speed            = 11.5f;
                    component.baseData.damage          *= 0.9f;
                    component.AdditionalScaleMultiplier = 0.8f;
                    component.baseData.range           *= 0.5f;
                    BounceProjModifier bounceProjModifier = component.gameObject.AddComponent <BounceProjModifier>();
                    bounceProjModifier.numberOfBounces = 2;
                }
            }
            for (float f = 0; f < UnityEngine.Random.Range(4f, 10f); f++)
            {
                GameObject gameObject2 = SpawnManager.SpawnProjectile(projectile2.gameObject, projectile.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (float)UnityEngine.Random.Range(0, 359)), true);
                Projectile component   = gameObject2.GetComponent <Projectile>();
                if (component != null)
                {
                    component.SpawnedFromOtherPlayerProjectile = true;
                    component.Owner                     = playerController;
                    component.Shooter                   = playerController.specRigidbody;
                    component.baseData.speed            = 14.5f;
                    component.baseData.damage          *= 1.25f;
                    component.AdditionalScaleMultiplier = 1.1f;
                    component.baseData.range           *= 0.25f;
                    BounceProjModifier bounceProjModifier2 = component.gameObject.AddComponent <BounceProjModifier>();
                    bounceProjModifier2.numberOfBounces = 2;
                    PierceProjModifier pierceProjModifier = projectile.gameObject.AddComponent <PierceProjModifier>();
                    pierceProjModifier.penetration = 1;
                }
            }
            for (float f = 0; f < UnityEngine.Random.Range(6f, 8f); f++)
            {
                GameObject gameObject3 = SpawnManager.SpawnProjectile(projectile2.gameObject, projectile.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (float)UnityEngine.Random.Range(0, 359)), true);
                Projectile component   = gameObject3.GetComponent <Projectile>();
                if (component)
                {
                    component.SpawnedFromOtherPlayerProjectile = true;
                    component.Owner                     = playerController;
                    component.Shooter                   = playerController.specRigidbody;
                    component.baseData.speed            = 17f;
                    component.baseData.damage          *= 1.6f;
                    component.AdditionalScaleMultiplier = 1.65f;
                    component.baseData.range           *= 0.25f;
                    BounceProjModifier bounceProjModifier3 = component.gameObject.AddComponent <BounceProjModifier>();
                    bounceProjModifier3.numberOfBounces = 2;
                    PierceProjModifier pierceProjModifier2 = projectile.gameObject.AddComponent <PierceProjModifier>();
                    pierceProjModifier2.penetration = 1;
                }
            }
        }
예제 #5
0
        public override void PostProcessProjectile(Projectile projectile)
        {
            base.PostProcessProjectile(projectile);
            PierceProjModifier modifier = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            modifier.penetration = 0;
        }
예제 #6
0
 public void EnemyDiesLol(Vector2 theposition)
 {
     try
     {
         for (int count = 0; count < 11; count++)
         {
             Projectile projectile2   = ((Gun)ETGMod.Databases.Items[51]).DefaultModule.projectiles[0];
             GameObject gameObject    = SpawnManager.SpawnProjectile(projectile2.gameObject, theposition, Quaternion.Euler(0f, 0f, (UnityEngine.Random.Range(0, 360))), true);
             Projectile component     = gameObject.GetComponent <Projectile>();
             bool       componentless = component != null;
             if (componentless)
             {
                 component.Owner           = thingy;
                 component.Shooter         = thingy.specRigidbody;
                 component.baseData.speed  = UnityEngine.Random.Range(3, 6);
                 component.baseData.damage = 12;
                 PierceProjModifier pp = component.gameObject.AddComponent <PierceProjModifier>();
                 pp.penetration = 1;
             }
         }
     } catch (Exception errorinator)
     {
         ETGModConsole.Log($"{errorinator}");
     }
 }
        public override void PostProcessProjectile(Projectile projectile)
        {
            if (projectile.GetCachedBaseDamage == 8f)
            {
                //slash
                Gun swipeFlash = (Gun)PickupObjectDatabase.GetByEncounterName("Silencer");
                PlayerController            player  = (PlayerController)this.gun.CurrentOwner;
                Vector2                     vector  = player.unadjustedAimPoint.XY() - player.CenterPosition;
                ProjectileSlashingBehaviour slasher = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();
                slasher.SlashDimensions = 45;
                slasher.SlashRange      = 3f;
                slasher.playerKnockback = 0;
                slasher.SlashVFX        = swipeFlash.muzzleFlashEffects;
                player.knockbackDoer.ApplyKnockback(vector, 25, true);
                slasher.InteractMode = SlashDoer.ProjInteractMode.DESTROY;
                gun.MoveBulletsIntoClip(1);
            }
            if (projectile.GetCachedBaseDamage == 15f)
            {
                //shelling
            }
            if (projectile.GetCachedBaseDamage == 40f)
            {
                //wyvernstake
                PierceProjModifier stabby = projectile.gameObject.AddComponent <PierceProjModifier>();
                stabby.penetration          = 5;
                stabby.penetratesBreakables = true;
                projectile.OnHitEnemy      += this.OnHitEnemy;
            }


            base.PostProcessProjectile(projectile);
        }
예제 #8
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Aerial Bombardment", "aerialbombardment");

            Game.Items.Rename("outdated_gun_mods:aerial_bombardment", "bny:aerial_bombardment");
            gun.gameObject.AddComponent <AerialBombardment>();
            gun.SetShortDescription("Unfortunate Gun");
            gun.SetLongDescription("A pocket device for calling in airstrikes. Pressing the button plays a cool riff!");
            gun.SetupSprite(null, "aerialbombardment_idle_001", 11);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 32);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 100);
            GunExt.SetAnimationFPS(gun, gun.idleAnimation, 2);
            for (int i = 0; i < 9; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(38) as Gun, true, false);
            }
            foreach (ProjectileModule projectileModule in gun.Volley.projectiles)
            {
                projectileModule.ammoCost            = 1;
                projectileModule.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                projectileModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                projectileModule.cooldownTime        = 0.9f;
                projectileModule.angleVariance       = 45f;
                projectileModule.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(projectileModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                PierceProjModifier pierce = projectile.gameObject.AddComponent <PierceProjModifier>();
                pierce.penetration          = 10;
                projectile.baseData.range   = (UnityEngine.Random.Range(3f, 9f));
                pierce.penetratesBreakables = true;
                projectile.baseData.damage  = 0;
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                gun.DefaultModule.projectiles[0] = projectile;
                bool flag = projectileModule != gun.DefaultModule;
                if (flag)
                {
                    projectileModule.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
            }
            gun.reloadTime = 1.2f;
            gun.SetBaseMaxAmmo(70);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc, 1f);
            // Here we just set the quality of the gun and the "EncounterGuid", which is used by Gungeon to identify the gun.
            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "Cheer up Bunny ^ᴗ^";
            //thanks Hunter, i really needed that, i wish you the best, cause you da best o7

            //This block of code helps clone our projectile. Basically it makes it so things like Shadow Clone and Hip Holster keep the stats/sprite of your custom gun's projectiles.
            //This block of code helps clone our projectile. Basically it makes it so things like Shadow Clone and Hip Holster keep the stats/sprite of your custom gun's projectiles.
            //projectile.baseData allows you to modify the base properties of your projectile module.
            //In our case, our gun uses modified projectiles from the ak-47.
            //Setting static values for a custom gun's projectile stats prevents them from scaling with player stats and bullet modifiers (damage, shotspeed, knockback)
            //You have to multiply the value of the original projectile you're using instead so they scale accordingly. For example if the projectile you're using as a base has 10 damage and you want it to be 6 you use this
            //In our case, our projectile has a base damage of 5.5, so we multiply it by 1.1 so it does 10% more damage from the ak-47.
            //This determines what sprite you want your projectile to use. Note this isn't necessary if you don't want to have a custom projectile sprite.
            //The x and y values determine the size of your custom projectile
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
예제 #9
0
        private void HitEnemy(Projectile projectile, SpeculativeRigidbody enemy, bool killed)
        {
            projectile.Speed           *= 1.2f;
            projectile.baseData.damage *= .8f;

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

            orAddComponent.penetratesBreakables = true;
            orAddComponent.penetration++;
            Vector2 dirVec = UnityEngine.Random.insideUnitCircle;
            float   num    = this.ChanceToSeekEnemyOnBounce;

            if (UnityEngine.Random.value < num && enemy.aiActor)
            {
                Func <AIActor, bool> isValid = (AIActor a) => a && a.HasBeenEngaged && a.healthHaver && a.healthHaver.IsVulnerable;
                AIActor closestToPosition    = BraveUtility.GetClosestToPosition <AIActor>(enemy.aiActor.ParentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All), enemy.UnitCenter, isValid, new AIActor[]
                {
                    enemy.aiActor
                });
                if (closestToPosition)
                {
                    dirVec = closestToPosition.CenterPosition - projectile.transform.position.XY();
                }
            }
            projectile.SendInDirection(dirVec, false, true);
        }
예제 #10
0
 private void OnRollStarted(PlayerController player, Vector2 velocity)
 {
     if (player.HasPickupID(315))
     {
         if (this.canDodgeShoot)
         {
             Projectile proj      = ((Gun)ETGMod.Databases.Items["burning_hand"]).DefaultModule.projectiles[0];
             GameObject obj       = SpawnManager.SpawnProjectile(proj.gameObject, player.sprite.WorldCenter, Quaternion.Euler(0, 0, BraveMathCollege.Atan2Degrees(-velocity)));
             Projectile component = obj.GetComponent <Projectile>();
             if (component != null)
             {
                 component.Owner            = player;
                 component.Shooter          = player.specRigidbody;
                 component.AppliesFire      = false;
                 component.FireApplyChance  = 0f;
                 component.baseData.damage  = 20f;
                 component.damageTypes      = CoreDamageTypes.Void;
                 component.DefaultTintColor = Color.black;
                 component.HasDefaultTint   = true;
                 PierceProjModifier component2 = component.GetComponent <PierceProjModifier>();
                 if (component2 != null)
                 {
                     component2.penetratesBreakables = true;
                 }
             }
         }
         this.canDodgeShoot = !this.canDodgeShoot;
     }
 }
예제 #11
0
 public override void PostProcessProjectile(Projectile projectile)
 {
     if (projectile && projectile.ProjectilePlayerOwner())
     {
         if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("The Bone Zone"))
         {
             HomingModifier homing = projectile.GetComponent <HomingModifier>();
             if (homing)
             {
                 homing.AngularVelocity *= 1.5f;
             }
             projectile.pierceMinorBreakables = true;
             PierceProjModifier piercing = projectile.GetComponent <PierceProjModifier>();
             if (piercing != null)
             {
                 piercing.penetration++;
             }
             else
             {
                 piercing             = projectile.gameObject.AddComponent <PierceProjModifier>();
                 piercing.penetration = 1;
             }
         }
     }
     base.PostProcessProjectile(projectile);
 }
        private IEnumerator Bounce()
        {
            Projectile projectile = ((Gun)ETGMod.Databases.Items[35]).DefaultModule.projectiles[0];

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 12; j++)
                {
                    GameObject obj3  = SpawnManager.SpawnProjectile(projectile.gameObject, base.LastOwner.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (base.LastOwner.CurrentGun == null) ? 0f : j * 30f), true);
                    Projectile proj3 = obj3.GetComponent <Projectile>();
                    if (proj3 != null)
                    {
                        proj3.Owner           = base.LastOwner;
                        proj3.Shooter         = base.LastOwner.specRigidbody;
                        proj3.baseData.speed *= 0.66f;
                        if (proj3.GetComponent <BounceProjModifier>() == null)
                        {
                            proj3.gameObject.AddComponent <BounceProjModifier>();
                        }
                        if (proj3.GetComponent <PierceProjModifier>() == null)
                        {
                            proj3.gameObject.AddComponent <PierceProjModifier>();
                        }
                        BounceProjModifier boing = proj3.GetComponent <BounceProjModifier>();
                        boing.chanceToDieOnBounce = 0;
                        boing.numberOfBounces     = 2;
                        PierceProjModifier poke = proj3.GetComponent <PierceProjModifier>();
                        poke.MaxBossImpacts = 3;
                        poke.penetration    = 6;
                        proj3.GetComponent <BounceProjModifier>().OnBounceContext += this.BounceTowardsPlayer;
                    }
                }
                yield return(new WaitForSeconds(0.5f));
            }
        }
예제 #13
0
        public static void Init()
        {
            string     itemName     = "Honey Pot";
            string     resourceName = "NevernamedsItems/Resources/honeypot_icon";
            GameObject obj          = new GameObject(itemName);
            var        item         = obj.AddComponent <HoneyPot>();

            ItemBuilder.AddSpriteToObject(itemName, resourceName, obj);
            string shortDesc = "A Little Something";
            string longDesc  = "A handy, throwable pot of sticky honey." + "\n\nSome Gundead tell whispers of buzzing coming from the Oubliette...";

            ItemBuilder.SetupItem(item, shortDesc, longDesc, "nn");
            ItemBuilder.SetCooldownType(item, ItemBuilder.CooldownType.Damage, 250);

            item.consumable = false;
            item.quality    = ItemQuality.D;

            PotProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);
            PotProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(PotProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(PotProjectile);
            PotProjectile.baseData.damage        *= 0f;
            PotProjectile.baseData.speed         *= 0.5f;
            PotProjectile.baseData.range         *= 0.5f;
            PotProjectile.collidesWithEnemies     = false;
            PotProjectile.collidesWithPlayer      = false;
            PotProjectile.collidesWithProjectiles = false;
            PotProjectile.pierceMinorBreakables   = true;
            PierceProjModifier keepComponent = PotProjectile.gameObject.GetOrAddComponent <PierceProjModifier>();

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

            Bouncing.numberOfBounces += 100;

            PotProjectile.AnimateProjectile(new List <string> {
                "honeypotproj_1",
                "honeypotproj_2",
                "honeypotproj_3",
                "honeypotproj_4",
            }, 8, true, new List <IntVector2> {
                new IntVector2(19, 16), //1
                new IntVector2(16, 19), //2
                new IntVector2(19, 16), //3
                new IntVector2(16, 19), //4
            }, AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4),
                                            AnimateBullet.ConstructListOfSameValues(true, 4),
                                            AnimateBullet.ConstructListOfSameValues(false, 4),
                                            AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4),
                                            new List <IntVector2?> {
                new IntVector2(14, 14), //1
                new IntVector2(14, 14), //2
                new IntVector2(14, 14), //3
                new IntVector2(14, 14), //3
            },
                                            AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                            AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
        }
예제 #14
0
        protected override void DoEffect(PlayerController user)
        {
            Projectile proj = ((Gun)ETGMod.Databases.Items["burning_hand"]).DefaultModule.projectiles[0];
            BraveInput instanceForPlayer = BraveInput.GetInstanceForPlayer(this.LastOwner.PlayerIDX);
            bool       flag2             = instanceForPlayer == null;
            float      z = 0;

            if (!flag2)
            {
                bool    flag3 = instanceForPlayer.IsKeyboardAndMouse(false);
                Vector2 a;
                if (flag3)
                {
                    a = this.LastOwner.unadjustedAimPoint.XY() - base.sprite.WorldCenter;
                }
                else
                {
                    bool flag4 = instanceForPlayer.ActiveActions == null;
                    if (flag4)
                    {
                        return;
                    }
                    a = instanceForPlayer.ActiveActions.Aim.Vector;
                }
                a.Normalize();
                z = BraveMathCollege.Atan2Degrees(a);
            }
            GameObject obj       = SpawnManager.SpawnProjectile(proj.gameObject, user.sprite.WorldCenter, Quaternion.Euler(0, 0, z));
            Projectile component = obj.GetComponent <Projectile>();

            if (component != null)
            {
                component.Owner           = user;
                component.Shooter         = user.specRigidbody;
                component.AppliesFire     = false;
                component.FireApplyChance = 0f;
                component.baseData.damage = 20f;
                if (UnityEngine.Random.value < 0.26f)
                {
                    component.damageTypes = CoreDamageTypes.Void;
                    component.AdditionalScaleMultiplier *= 2f;
                    component.baseData.speed            *= 2f;
                    component.DefaultTintColor           = Color.black;
                    component.HasDefaultTint             = true;
                }
                else
                {
                    component.damageTypes      = CoreDamageTypes.None;
                    component.DefaultTintColor = Color.white;
                    component.HasDefaultTint   = true;
                }
                PierceProjModifier component2 = component.GetComponent <PierceProjModifier>();
                if (component2 != null)
                {
                    component2.penetratesBreakables = true;
                }
            }
            this.usesLeft -= 1;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Heavy Assault Rifle", "heavyassaultrifle");

            Game.Items.Rename("outdated_gun_mods:heavy_assault_rifle", "nn:heavy_assault_rifle");
            gun.gameObject.AddComponent <HeavyAssaultRifle>();
            gun.SetShortDescription("It's so big...");
            gun.SetLongDescription("An oversized assault rifle from the FUTURE... which by now has already become the past.");

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

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

            gun.SetAnimationFPS(gun.shootAnimation, 15);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2.5f;
            gun.DefaultModule.cooldownTime           = 0.11f;
            gun.DefaultModule.numberOfShotsInClip    = 40;
            gun.barrelOffset.transform.localPosition = new Vector3(4.18f, 0.87f, 0f);
            gun.SetBaseMaxAmmo(250);
            gun.gunClass = GunClass.FULLAUTO;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);

            projectile.baseData.damage *= 6f;
            projectile.SetProjectileSpriteRight("heavyassaultrifle_projectile", 22, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 22, 7);

            projectile.transform.parent = gun.barrelOffset;
            PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            orAddComponent.penetratesBreakables = true;
            orAddComponent.penetration          = 5;

            gun.AddCurrentGunStatModifier(PlayerStats.StatType.MovementSpeed, 0.8f, StatModifier.ModifyMethod.MULTIPLICATIVE);
            gun.AddCurrentGunStatModifier(PlayerStats.StatType.DodgeRollSpeedMultiplier, 0.8f, StatModifier.ModifyMethod.MULTIPLICATIVE);

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("HeavyAssaultRifle Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/heavyassaultrifle_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/heavyassaultrifle_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;
            gun.quality = PickupObject.ItemQuality.S;
            gun.encounterTrackable.EncounterGuid = "this is the Heavy Assault Rifle";
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            HeavyAssaultRifleID = gun.PickupObjectId;

            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
        }
예제 #16
0
        // Token: 0x0600013F RID: 319 RVA: 0x0000D468 File Offset: 0x0000B668
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Cube Of Tungsten", "tungstencube");

            Game.Items.Rename("outdated_gun_mods:cube_of_tungsten", "bny:cube_of_tungsten");
            gun.gameObject.AddComponent <TungstenCube>();
            GunExt.SetShortDescription(gun, "THE CUBE");
            GunExt.SetLongDescription(gun, "A large cube of tungsten, perfect for chucking at your enemies!");
            GunExt.SetupSprite(gun, null, "tungstencube_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 20);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 3);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 7);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(8) as Gun, true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.9f;
            gun.DefaultModule.cooldownTime              = 1f;
            gun.DefaultModule.numberOfShotsInClip       = 1;
            gun.DefaultModule.preventFiringDuringCharge = true;
            gun.SetBaseMaxAmmo(200);
            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE THE CUBE ";
            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile();
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item
            };
            gun.DefaultModule.chargeProjectiles[0].ChargeTime     = 0.9f;
            gun.DefaultModule.chargeProjectiles[0].UsedProperties = ((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].UsedProperties;
            gun.DefaultModule.chargeProjectiles[0].VfxPool        = ((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].VfxPool;
            gun.DefaultModule.chargeProjectiles[0].VfxPool.type   = ((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].VfxPool.type;
            ProjectileModule.ChargeProjectile chargeProjectile = gun.DefaultModule.chargeProjectiles[0];
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(((Gun)ETGMod.Databases.Items[8]).DefaultModule.chargeProjectiles[0].Projectile);

            chargeProjectile.Projectile = projectile;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 3;
            projectile.transform.parent = gun.barrelOffset;
            projectile.baseData.damage  = 30f;
            projectile.baseData.range   = 50f;
            projectile.baseData.force   = 350f;
            projectile.shouldRotate     = true;
            BounceProjModifier bouncy = projectile.gameObject.AddComponent <BounceProjModifier>();

            bouncy.numberOfBounces = 0;
            PierceProjModifier spook = projectile.gameObject.AddComponent <PierceProjModifier>();

            spook.penetration = 1;
            projectile.SetProjectileSpriteRight("tungstencube_projectile_001", 17, 16, true, tk2dBaseSprite.Anchor.MiddleCenter, new int?(11), new int?(5), null, null, null);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc, 1f);
            gun.AddToSubShop(ItemBuilder.ShopType.Cursula, 1f);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
예제 #17
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Lantaka", "lantaka");

            Game.Items.Rename("outdated_gun_mods:lantaka", "nn:lantaka");
            gun.gameObject.AddComponent <Lantaka>();
            gun.SetShortDescription("Head on a Swivel");
            gun.SetLongDescription("Used once upon a time by ships to protect against pirates, this ancient gun sat in the back room of a museum for many years until a daring heist saw it make it's way to the Gungeon.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 15);
            gun.gunSwitchGroup     = (PickupObjectDatabase.GetById(49) as Gun).gunSwitchGroup;
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(9) as Gun).muzzleFlashEffects;

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 1f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(2.56f, 0.81f, 0f);
            gun.SetBaseMaxAmmo(150);
            gun.gunClass = GunClass.RIFLE;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0]         = projectile;
            projectile.transform.parent              = gun.barrelOffset;
            projectile.baseData.speed               *= 2f;
            projectile.baseData.range               *= 2f;
            projectile.baseData.damage              *= 4f;
            projectile.BossDamageMultiplier         *= 1.5f;
            projectile.BlackPhantomDamageMultiplier *= 2f;
            PierceProjModifier Piercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

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

            Bouncing.numberOfBounces = 2;
            projectile.SetProjectileSpriteRight("lantaka_projectile", 15, 15, false, tk2dBaseSprite.Anchor.MiddleCenter, 14, 14);

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Lantaka Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/lantaka_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/lantaka_clipempty");

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

            LantakaID = gun.PickupObjectId;
        }
예제 #18
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("St4ke", "st4ke");

            Game.Items.Rename("outdated_gun_mods:st4ke", "nn:st4ke");
            gun.gameObject.AddComponent <St4ke>();
            gun.SetShortDescription("For Robot Vampires");
            gun.SetLongDescription("Fires miniature tesla coils that stick into walls." + "\n\nFollowing the success of her remote diote transmitter experiment, the tinker set about seeing if she could make both ends of the tesla-relay mobile.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 17);

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

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.15f;
            gun.DefaultModule.numberOfShotsInClip    = 4;
            gun.barrelOffset.transform.localPosition = new Vector3(1.68f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(175);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup;
            gun.ammo           = 175;
            gun.gunClass       = GunClass.PISTOL;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 8f;
            projectile.pierceMinorBreakables = true;
            projectile.SetProjectileSpriteRight("st4keproj", 13, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 5);
            St4keProj          orAddComponent = projectile.gameObject.GetOrAddComponent <St4keProj>();
            PierceProjModifier piercing       = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            piercing.penetration++;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Stk4ke Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/st4ke_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/st4ke_clipempty");

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

            St4keID = gun.PickupObjectId;
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);

            LinkVFXPrefab = FakePrefab.Clone(Game.Items["shock_rounds"].GetComponent <ComplexProjectileModifier>().ChainLightningVFX);
            FakePrefab.MarkAsFakePrefab(LinkVFXPrefab);
            UnityEngine.Object.DontDestroyOnLoad(LinkVFXPrefab);
        }
예제 #19
0
        // Token: 0x0600028C RID: 652 RVA: 0x000162F8 File Offset: 0x000144F8
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("HONK", "horn");

            Game.Items.Rename("outdated_gun_mods:honk", "cak:honk");
            GunExt.SetShortDescription(gun, "Prince Charming");
            GunExt.SetLongDescription(gun, "Wielded by a legendary ringmaster at one point, it was lost in the gungeon and it's magicks shifted into a violate weapon.");
            GunExt.SetupSprite(gun, null, "horn_idle_001", 8);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 16);
            GunExt.SetAnimationFPS(gun, gun.chargeAnimation, 6);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(15) as Gun, true, false);

            foreach (ProjectileModule projectileModule in gun.Volley.projectiles)
            {
                projectileModule.ammoCost            = 1;
                projectileModule.shootStyle          = ProjectileModule.ShootStyle.Charged;
                projectileModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                projectileModule.cooldownTime        = 1f;
                projectileModule.angleVariance       = 20f;
                projectileModule.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(projectileModule.projectiles[0]);
                projectileModule.projectiles[0] = projectile;
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage           *= 10f;
                projectile.AdditionalScaleMultiplier *= 2f;
                projectile.baseData.range            *= 0.5f;
                bool flag = projectileModule != gun.DefaultModule;
                if (flag)
                {
                    projectileModule.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
                ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f
                };
                PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                orAddComponent.penetratesBreakables = true;
                orAddComponent.penetration++;
                projectileModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
                {
                    item
                };
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(100);
            gun.quality = PickupObject.ItemQuality.B;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 3;
            gun.encounterTrackable.EncounterGuid = "HONKERWONK";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.37f, 0f);
            Horn.HornID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Accelerator", "accelerator");

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

            gun.SetShortDescription("Sapper");
            gun.SetLongDescription("The projectiles of this remarkable weapon suck the speed right out of enemy bullets!" + "\n\nReverse engineered from vampires.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.2f;
            gun.DefaultModule.cooldownTime = 0.1f;
            //gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 7;
            gun.barrelOffset.transform.localPosition = new Vector3(1.75f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(210);
            gun.gunClass = GunClass.PISTOL;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

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

            projectile.gameObject.AddComponent <EnemyBulletSpeedSapperMod>();

            projectile.pierceMinorBreakables = true;
            //projectile.shouldRotate = true;
            PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            orAddComponent.penetratesBreakables = true;
            orAddComponent.penetration          = 1;

            projectile.SetProjectileSpriteRight("accelerator_projectile", 11, 9, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 8);

            projectile.transform.parent = gun.barrelOffset;


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

            WelrodID = gun.PickupObjectId;
        }
예제 #21
0
        private void OnHitEnemy(Projectile projectile, SpeculativeRigidbody enemy, bool killed)
        {
            PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            if (orAddComponent.penetration == 0)
            {
                orAddComponent.penetration++;
            }
        }
예제 #22
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Welrod", "welrod");

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

            behav.overrideNormalFireAudio = "Play_WPN_SAA_impact_01";
            behav.preventNormalFireAudio  = true;
            gun.SetShortDescription("Quiet, Quiet");
            gun.SetLongDescription("Designed for stealth assasination missions behind enemy lines, the Welrod is quiet and efficient.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime = 0.2f;
            //gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 4;
            gun.barrelOffset.transform.localPosition = new Vector3(1.18f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.gunClass = GunClass.PISTOL;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

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

            projectile.pierceMinorBreakables = true;
            //projectile.shouldRotate = true;
            PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            orAddComponent.penetratesBreakables = true;
            orAddComponent.penetration          = 1;

            projectile.SetProjectileSpriteRight("welrod_projectile", 7, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 6, 4);

            projectile.transform.parent = gun.barrelOffset;


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

            WelrodID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Seismograph", "seismograph");

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

            gun.SetShortDescription("Can Run Quake");
            gun.SetLongDescription("This gun is oddly good at predicting the seismic shaking of Gunymede's crust- it seems to always be fired moments before noticeable earthquakes.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.idleAnimation, 16);

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

            //GUN STATS
            gun.doesScreenShake             = true;
            gun.gunScreenShake              = StaticExplosionDatas.genericLargeExplosion.ss;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.3f;
            gun.DefaultModule.cooldownTime           = 0.17f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 10;
            gun.barrelOffset.transform.localPosition = new Vector3(25f / 16f, 17f / 16f, 0f);
            gun.SetBaseMaxAmmo(300);
            gun.gunClass = GunClass.PISTOL;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

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



            projectile.pierceMinorBreakables = true;
            PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            orAddComponent.penetratesBreakables = true;
            orAddComponent.penetration          = 1;

            projectile.gameObject.AddComponent <Seismograph.EarthquakeProjectileMod>();



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

            ID = gun.PickupObjectId;
        }
예제 #24
0
        public override void OnPostFired(PlayerController player, Gun gun)
        {
            AkSoundEngine.PostEvent("Stop_WPN_All", base.gameObject);
            gun.PreventNormalFireAudio = true;
            AkSoundEngine.PostEvent("Play_BOSS_agunim_move_01", base.gameObject);
            targetPoint = player.unadjustedAimPoint;
            if (shotcountcontroller == 1)
            {
                Projectile         projectile1 = ((Gun)ETGMod.Databases.Items[9]).DefaultModule.projectiles[0];
                GameObject         gameObject1 = SpawnManager.SpawnProjectile(projectile1.gameObject, player.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (player.CurrentGun == null) ? 0f : player.CurrentGun.CurrentAngle), true);
                Projectile         component1  = gameObject1.GetComponent <Projectile>();
                BounceProjModifier bounce      = component1.GetComponent <BounceProjModifier>();
                bounce.chanceToDieOnBounce = 0;
                bounce.numberOfBounces     = 6;
                PierceProjModifier stab = component1.GetComponent <PierceProjModifier>();
                stab.MaxBossImpacts = 4;
                stab.penetration    = 6;


                bool flag = component1 != null;
                if (flag)
                {
                    component1.Owner                     = player;
                    component1.Shooter                   = player.specRigidbody;
                    component1.baseData.speed            = 10f;
                    component1.baseData.range           *= 1f;
                    component1.baseData.damage           = 12f;
                    component1.angularVelocity           = 1000f;
                    component1.projectileHitHealth       = 50;
                    component1.collidesWithProjectiles   = true;
                    component1.AdditionalScaleMultiplier = 1.2f;
                    component1.pierceMinorBreakables     = true;
                    component1.HasDefaultTint            = true;
                    component1.DefaultTintColor          = UnityEngine.Color.cyan;
                }
                current_ball        = component1;
                shotcountcontroller = 0;
                Material outline = SpriteOutlineManager.GetOutlineMaterial(gun.sprite);
                outline.SetColor("_OverrideColor", new Color(63f, 236f, 165f));
            }
            else
            {
                Vector2 vector = current_ball.sprite.WorldCenter;
                Vector2 Aim    = player.unadjustedAimPoint;
                current_ball.SendInDirection(Aim - vector, false, true);

                foreach (var projectile in GetBullets())
                {
                    projectile.baseData.speed  = projectile.baseData.speed + 5;
                    projectile.baseData.damage = projectile.baseData.damage * 1.75f;
                    projectile.angularVelocity = projectile.angularVelocity * -1;
                    projectile.Update();
                    projectile.UpdateSpeed();
                }
            }
        }
예제 #25
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Hand Cannon", "handcannon");

            Game.Items.Rename("outdated_gun_mods:hand_cannon", "nn:hand_cannon");
            gun.gameObject.AddComponent <HandCannon>();
            gun.SetShortDescription("Protogun");
            gun.SetLongDescription("The earliest recorded type of real firearm. Though it is little more than a small cannon on a stick, it can spit some damaging shrapnel.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 15);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2.5f;
            gun.DefaultModule.cooldownTime           = 1f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(2.87f, 0.5f, 0f);
            gun.SetBaseMaxAmmo(190);
            gun.gunClass = GunClass.SHITTY;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage      *= 7f;
            PierceProjModifier Piercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

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

            Bouncing.numberOfBounces    = 10;
            projectile.baseData.range  *= 0.5f;
            projectile.transform.parent = gun.barrelOffset;
            projectile.SetProjectileSpriteRight("handcannon_projectile", 17, 15, false, tk2dBaseSprite.Anchor.MiddleCenter, 15, 13);

            projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(37) as Gun).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.overrideMidairDeathVFX;
            projectile.hitEffects.alwaysUseMidair        = true;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("HandCannon Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/handcannon_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/handcannon_clipempty");
            gun.muzzleFlashEffects           = (PickupObjectDatabase.GetById(53) as Gun).muzzleFlashEffects;
            gun.quality = PickupObject.ItemQuality.D;
            gun.encounterTrackable.EncounterGuid = "this is the Hand Cannon";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            HandCannonID = gun.PickupObjectId;
        }
예제 #26
0
        private void PostProcessProjectile(Projectile sourceProjectile, float effectChanceScalar)
        {
            PierceProjModifier piercing = sourceProjectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            piercing.penetration         += 5;
            piercing.penetratesBreakables = true;
            MaintainDamageOnPierce maintenance = sourceProjectile.gameObject.GetOrAddComponent <MaintainDamageOnPierce>();

            maintenance.damageMultOnPierce = 1.25f;
        }
예제 #27
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ol' Reliable", "olreliable");

            Game.Items.Rename("outdated_gun_mods:ol'_reliable", "nn:ol_reliable");
            var behav = gun.gameObject.AddComponent <OlReliable>();

            gun.SetShortDescription("Old School Cool");
            gun.SetLongDescription("This well oiled rifle was brought to the Gungeon by a student of the Gungeon Master, and is older than the Gungeon itself!" + "\n\nPassed down through the generations, Ol' Reliable has been a favourite of Gungeoneers from all walks of life.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 0);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(49) as Gun, true, false);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(5) as Gun).gunSwitchGroup;

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.2f;
            gun.DefaultModule.cooldownTime = 0.3f;
            gun.muzzleFlashEffects         = (PickupObjectDatabase.GetById(5) as Gun).muzzleFlashEffects;

            gun.DefaultModule.numberOfShotsInClip    = 5;
            gun.barrelOffset.transform.localPosition = new Vector3(2.5f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(130);
            gun.gunClass = GunClass.RIFLE;

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

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

            projectile.pierceMinorBreakables = true;

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

            orAddComponent.penetratesBreakables = true;
            orAddComponent.penetration          = 1;


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

            ID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Portal Gun", "portalgun");

            Game.Items.Rename("outdated_gun_mods:portal_gun", "nn:portal_gun");
            gun.gameObject.AddComponent <PortalGun>();
            gun.SetShortDescription("For Science");
            gun.SetLongDescription("");

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

            gun.SetAnimationFPS(gun.shootAnimation, 17);

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

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.15f;
            gun.DefaultModule.numberOfShotsInClip    = 4;
            gun.barrelOffset.transform.localPosition = new Vector3(1.68f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(175);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup;
            gun.ammo           = 175;
            gun.gunClass       = GunClass.SILLY;

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

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 8f;
            projectile.pierceMinorBreakables = true;
            projectile.SetProjectileSpriteRight("st4keproj", 13, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 5);
            St4keProj          orAddComponent = projectile.gameObject.GetOrAddComponent <St4keProj>();
            PierceProjModifier piercing       = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            piercing.penetration++;



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

            PortalGunID = gun.PickupObjectId;
            //gun.AddToSubShop(ItemBuilder.ShopType.Trorc);

            allPortals = new List <OMITBPortalController>();
        }
예제 #29
0
        public override void OnPostFired(PlayerController player, Gun gun)
        {
            AkSoundEngine.PostEvent("Stop_WPN_All", base.gameObject);
            gun.PreventNormalFireAudio = true;

            targetPoint = player.unadjustedAimPoint;
            if (shotcountcontroller == 1)
            {
                AkSoundEngine.PostEvent("Play_OBJ_hook_shot_01", base.gameObject);
                Projectile projectile1 = ((Gun)ETGMod.Databases.Items[25]).DefaultModule.projectiles[0];
                GameObject gameObject1 = SpawnManager.SpawnProjectile(projectile1.gameObject, player.CurrentGun.sprite.WorldTopLeft, Quaternion.Euler(0f, 0f, (player.CurrentGun == null) ? 0f : player.CurrentGun.CurrentAngle), true);
                Projectile component1  = gameObject1.GetComponent <Projectile>();
                setup = setup + 1;
                PierceProjModifier stab = component1.GetComponent <PierceProjModifier>();
                stab.MaxBossImpacts = 0;
                stab.penetration    = 0;

                bool flag = component1 != null;
                if (flag)
                {
                    component1.Owner   = player;
                    component1.Shooter = player.specRigidbody;

                    component1.baseData.speed      = 30f;
                    component1.baseData.range     *= 1f;
                    component1.baseData.damage     = 10f;
                    component1.AppliedStunDuration = 1f;
                    component1.AppliesStun         = true;


                    component1.pierceMinorBreakables = true;
                }
                current_ball        = component1;
                shotcountcontroller = 0;

                Gun gun3 = (Gun)PickupObjectDatabase.GetByEncounterName("Silencer");
                gun.muzzleFlashEffects = gun3.muzzleFlashEffects;
            }
            else
            {
                Vector2 vector    = player.unadjustedAimPoint.XY() - player.CenterPosition;
                float   zRotation = BraveMathCollege.Atan2Degrees(vector);
                player.StartCoroutine(this.HandleSwing(player, vector, 100f, 2.25f));
                if (Hooked_enemy != null)
                {
                    Hooked_enemy.knockbackDoer.ApplyKnockback(-1 * vector, 100f);
                }


                Gun gun3 = (Gun)PickupObjectDatabase.GetByEncounterName("Silencer");
                gun.muzzleFlashEffects = gun3.muzzleFlashEffects;
                gun.Update();
            }
            current_ball.OnHitEnemy = (Action <Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(current_ball.OnHitEnemy, new Action <Projectile, SpeculativeRigidbody, bool>(this.attach));
        }
예제 #30
0
            // Token: 0x06000120 RID: 288 RVA: 0x0000AC74 File Offset: 0x00008E74
            private void Attack()
            {
                bool flag = this.Owner == null;

                if (flag)
                {
                    this.Owner = this.m_aiActor.GetComponent <PointZero.PointZeroBehaviour>().Owner;
                }
                float num = -1f;

                List <AIActor> activeEnemies = this.Owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All);
                bool           flag2         = activeEnemies == null | activeEnemies.Count <= 0;

                if (!flag2)
                {
                    AIActor nearestEnemy = this.GetNearestEnemy(activeEnemies, this.m_aiActor.sprite.WorldCenter, out num, null);
                    bool    flag3        = nearestEnemy && num < 10f;
                    if (flag3)
                    {
                        bool flag4 = this.IsInRange(nearestEnemy);
                        if (flag4)
                        {
                            bool flag5 = !nearestEnemy.IsHarmlessEnemy && nearestEnemy.IsNormalEnemy && !nearestEnemy.healthHaver.IsDead && nearestEnemy != this.m_aiActor;
                            if (flag5)
                            {
                                Vector2        unitCenter  = this.m_aiActor.specRigidbody.UnitCenter;
                                Vector2        unitCenter2 = nearestEnemy.specRigidbody.HitboxPixelCollider.UnitCenter;
                                float          z           = BraveMathCollege.Atan2Degrees((unitCenter2 - unitCenter).normalized);
                                Projectile     projectile  = ((Gun)ETGMod.Databases.Items[576]).DefaultModule.projectiles[0];
                                GameObject     gameObject  = SpawnManager.SpawnProjectile(projectile.gameObject, this.m_aiActor.sprite.WorldCenter, Quaternion.Euler(0f, 0f, z + UnityEngine.Random.Range(-60, 60)), true);
                                Projectile     component   = gameObject.GetComponent <Projectile>();
                                HomingModifier homing      = component.gameObject.AddComponent <HomingModifier>();
                                homing.HomingRadius    = 300;
                                homing.AngularVelocity = 300;
                                PierceProjModifier spook = component.gameObject.AddComponent <PierceProjModifier>();
                                spook.penetration = 10;
                                BounceProjModifier bouncy = component.gameObject.AddComponent <BounceProjModifier>();
                                bouncy.numberOfBounces = 10;
                                bool flag6 = component != null;
                                bool flag7 = flag6;
                                if (flag7)
                                {
                                    {
                                        component.baseData.damage = 4f;
                                    }

                                    component.baseData.force     = .5f;
                                    component.collidesWithPlayer = false;
                                }
                            }
                        }
                    }
                }
            }