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);
        }
示例#2
0
        public override void PostProcessProjectile(Projectile projectile)
        {
            if (projectile.GetCachedBaseDamage == 8f)
            {
                //slash

                PlayerController            player  = (PlayerController)this.gun.CurrentOwner;
                Vector2                     vector  = player.unadjustedAimPoint.XY() - player.CenterPosition;
                ProjectileSlashingBehaviour slasher = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();
                slasher.SlashDimensions = 90;
                slasher.SlashRange      = 3f;
                slasher.playerKnockback = 0;

                slasher.InteractMode = SlashDoer.ProjInteractMode.IGNORE;
            }
            if (projectile.GetCachedBaseDamage == 15f)
            {
                PlayerController            player  = (PlayerController)this.gun.CurrentOwner;
                Vector2                     vector  = player.unadjustedAimPoint.XY() - player.CenterPosition;
                ProjectileSlashingBehaviour slasher = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();
                slasher.SlashDimensions            = 90;
                slasher.SlashRange                 = 3f;
                slasher.DestroyBaseAfterFirstSlash = false;
                slasher.playerKnockback            = 0;

                slasher.InteractMode = SlashDoer.ProjInteractMode.IGNORE;

                StartCoroutine(RingOfFire());
            }

            base.PostProcessProjectile(projectile);
        }
示例#3
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("testing gun", "wand");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:testing_gun", "ski:testing_gun");
            gun.gameObject.AddComponent <testing_gun>();

            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Check 1 testing testing");
            gun.SetLongDescription("bopmo bip!");
            // This is required, unless you want to use the sprites of the base gun.
            // That, by default, is the pea shooter.
            // SetupSprite sets up the default gun sprite for the ammonomicon and the "gun get" popup.
            // WARNING: Add a copy of your default sprite to Ammonomicon Encounter Icon Collection!
            // That means, "sprites/Ammonomicon Encounter Icon Collection/defaultsprite.png" in your mod .zip. You can see an example of this with inside the mod folder.
            gun.SetupSprite(null, "wand_idle_001", 8);
            // ETGMod automatically checks which animations are available.
            // The numbers next to "shootAnimation" determine the animation fps. You can also tweak the animation fps of the reload animation and idle animation using this method.
            gun.SetAnimationFPS(gun.shootAnimation, 24);
            // Every modded gun has base projectile it works with that is borrowed from other guns in the game.
            // The gun names are the names from the JSON dump! While most are the same, some guns named completely different things. If you need help finding gun names, ask a modder on the Gungeon discord.

            gun.AddProjectileModuleFrom("ak-47", true, false);
            //I would reccomend replacing the line above with 'gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(id) as Gun, true, false);'
            //'id' in that code I just gave you should be the numerical Id of the gun you want your projectiles to be based off of.
            gun.DefaultModule.angleVariance = 1f;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.0f;
            gun.DefaultModule.cooldownTime        = 1f;
            gun.DefaultModule.numberOfShotsInClip = 2;
            gun.SetBaseMaxAmmo(200);


            gun.quality = PickupObject.ItemQuality.B;
            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           = 10f;
            projectile.baseData.speed           *= 0f;
            projectile.baseData.range            = 7f;
            projectile.AdditionalScaleMultiplier = 1f;

            projectile.transform.parent = gun.barrelOffset;

            ProjectileSlashingBehaviour slasher = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slasher.doSpinAttack = true;

            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public override void PostProcessProjectile(Projectile projectile)
        {
            //swing hitbox
            ProjectileSlashingBehaviour slasher = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slasher.SlashDimensions = 120f;
            slasher.SlashRange      = 3.4f;
            slasher.SlashDamage     = 15f;

            StartCoroutine(Chimecontroller());

            base.PostProcessProjectile(projectile);
        }
        public override void PostProcessProjectile(Projectile projectile)
        {   // outer pull
            ProjectileSlashingBehaviour slasher1 = projectile.gameObject.GetOrAddComponent <ProjectileSlashingBehaviour>();

            slasher1.SlashRange      = 15f;
            slasher1.SlashDimensions = 30;
            slasher1.SlashVFX.type   = VFXPoolType.None;
            slasher1.DoSound         = false;
            // innner pull
            PlayerController player      = (PlayerController)this.gun.CurrentOwner;
            Projectile       projectile1 = ((Gun)ETGMod.Databases.Items[3]).DefaultModule.projectiles[0];
            GameObject       gameObject  = SpawnManager.SpawnProjectile(projectile1.gameObject, player.CurrentGun.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (player.CurrentGun == null) ? 0f : player.CurrentGun.CurrentAngle), true);
            Projectile       component   = gameObject.GetComponent <Projectile>();

            component.baseData.force  = -9;
            component.baseData.damage = .5f;
            component.Owner           = player;
            ProjectileSlashingBehaviour slasher2 = component.gameObject.GetOrAddComponent <ProjectileSlashingBehaviour>();

            slasher2.SlashRange      = 15f;
            slasher2.SlashDimensions = 5;
            slasher2.SlashVFX.type   = VFXPoolType.None;
            slasher2.DoSound         = false;
            //inner repel
            Projectile projectile2 = ((Gun)ETGMod.Databases.Items[3]).DefaultModule.projectiles[0];
            GameObject gameObject2 = SpawnManager.SpawnProjectile(projectile2.gameObject, player.CurrentGun.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (player.CurrentGun == null) ? 0f : player.CurrentGun.CurrentAngle), true);
            Projectile component2  = gameObject2.GetComponent <Projectile>();

            component2.baseData.force      = 9;
            component2.StunApplyChance     = 100f;
            component2.AppliesStun         = true;
            component2.AppliedStunDuration = .5f;
            component2.baseData.damage     = 1f;
            component2.Owner = player;
            ProjectileSlashingBehaviour slasher3 = component2.gameObject.GetOrAddComponent <ProjectileSlashingBehaviour>();

            slasher3.SlashRange      = 2.2f;
            slasher3.SlashDimensions = 20;
            slasher3.SlashVFX.type   = VFXPoolType.None;
            slasher3.DoSound         = false;


            Vector2 vector = player.unadjustedAimPoint.XY() - player.CenterPosition;

            player.StartCoroutine(this.HandleSwing(player, vector, .2f, 3f));



            base.PostProcessProjectile(projectile);
        }
示例#6
0
 public override void PostProcessProjectile(Projectile projectile)
 {
     if (shotcountcontroller != 1)
     {
         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 = 60;
         slasher.SlashRange      = 3f;
         slasher.playerKnockback = 0;
         slasher.SlashVFX        = swipeFlash.muzzleFlashEffects;
         player.knockbackDoer.ApplyKnockback(vector, 25, true);
         slasher.InteractMode = SlashDoer.ProjInteractMode.IGNORE;
     }
     base.PostProcessProjectile(projectile);
 }
示例#7
0
        public override void PostProcessProjectile(Projectile projectile)
        {
            AkSoundEngine.PostEvent("Stop_WPN_All", base.gameObject);
            AkSoundEngine.PostEvent("Play_PET_wolf_bite_01", base.gameObject);

            if (projectile.GetCachedBaseDamage == 9f)
            {
                //slash

                PlayerController            player  = (PlayerController)this.gun.CurrentOwner;
                Vector2                     vector  = player.unadjustedAimPoint.XY() - player.CenterPosition;
                ProjectileSlashingBehaviour slasher = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();
                slasher.SlashDimensions = 90;
                slasher.SlashRange      = 3f;
                slasher.playerKnockback = 0;

                if (player.CurrentFireMeterValue > 0)
                {
                    slasher.SlashDamage = 5;
                }
                slasher.InteractMode = SlashDoer.ProjInteractMode.IGNORE;
            }
            if (projectile.GetCachedBaseDamage == 15f)
            {
                PlayerController            player  = (PlayerController)this.gun.CurrentOwner;
                Vector2                     vector  = player.unadjustedAimPoint.XY() - player.CenterPosition;
                ProjectileSlashingBehaviour slasher = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();
                slasher.SlashDimensions = 90;
                slasher.SlashRange      = 3f;

                slasher.playerKnockback = 0;

                slasher.InteractMode = SlashDoer.ProjInteractMode.IGNORE;

                StartCoroutine(RingOfFire());
            }
            StartCoroutine(AfterImages());

            base.PostProcessProjectile(projectile);
        }
示例#8
0
        public override void PostProcessProjectile(Projectile projectile)
        {
            PlayerController player      = (PlayerController)this.gun.CurrentOwner;
            Projectile       projectile2 = ((Gun)ETGMod.Databases.Items[384]).DefaultModule.projectiles[0];
            GameObject       gameObject  = SpawnManager.SpawnProjectile(projectile2.gameObject, player.CurrentGun.sprite.WorldCenter, Quaternion.Euler(0f, 0f, (player.CurrentGun == null) ? 0f : player.CurrentGun.CurrentAngle), true);
            Projectile       component   = gameObject.GetComponent <Projectile>();
            bool             flag        = component != null;

            if (flag)
            {
                component.Owner = player;
                Vector2 vector = player.unadjustedAimPoint.XY() - player.CenterPosition;
                ProjectileSlashingBehaviour slasher = component.gameObject.AddComponent <ProjectileSlashingBehaviour>();
                slasher.SlashDimensions = 120;
                slasher.SlashRange      = 4f;
                slasher.SlashVFX.type   = VFXPoolType.None;
                slasher.SlashDamage     = 10 + SpeedMult / 25;
                slasher.playerKnockback = 0;
                slasher.InteractMode    = SlashDoer.ProjInteractMode.REFLECT;
            }

            base.PostProcessProjectile(projectile);
        }
        public override void PostProcessProjectile(Projectile projectile)
        {
            if (projectile.GetCachedBaseDamage == 8f)
            {
                //slash
                Gun swipeFlash = (Gun)PickupObjectDatabase.GetByEncounterName("sling");
                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;
            }
            if (projectile.GetCachedBaseDamage == 15f)
            {
                //boomer
            }


            base.PostProcessProjectile(projectile);
        }