Exemplo n.º 1
0
 private void PostProcessProj(Projectile bullet, float scaler)
 {
     if (bullet.GetComponent <BulletFromBulletWithGun>() == null)
     {
         if (bullet.GetComponent <SpawnProjModifier>() != null)
         {
             SpawnProjModifier extantMod = bullet.gameObject.GetComponent <SpawnProjModifier>();
             if (extantMod.spawnProjectilesInFlight)
             {
                 extantMod.inFlightSpawnCooldown *= 0.5f;
             }
             else
             {
                 extantMod.spawnProjectilesInFlight      = true;
                 extantMod.inFlightAimAtEnemies          = true;
                 extantMod.usesComplexSpawnInFlight      = true;
                 extantMod.inFlightSpawnCooldown         = 0.5f;
                 extantMod.PostprocessSpawnedProjectiles = true;
                 if (Owner.PlayerHasActiveSynergy("Bullets With Knives"))
                 {
                     extantMod.projectileToSpawnInFlight = swordProjectile;
                 }
                 else
                 {
                     extantMod.projectileToSpawnInFlight = projectileToSpawn;
                 }
             }
         }
         else
         {
             SpawnProjModifier mod = bullet.gameObject.GetOrAddComponent <SpawnProjModifier>();
             mod.spawnProjectilesInFlight      = true;
             mod.inFlightAimAtEnemies          = true;
             mod.inFlightSpawnCooldown         = 0.5f;
             mod.usesComplexSpawnInFlight      = true;
             mod.PostprocessSpawnedProjectiles = true;
             mod.numToSpawnInFlight            = 1;
             if (Owner.PlayerHasActiveSynergy("Bullets With Knives"))
             {
                 mod.projectileToSpawnInFlight = swordProjectile;
             }
             else
             {
                 mod.projectileToSpawnInFlight = projectileToSpawn;
             }
         }
     }
 }
        public override void PostProcessProjectile(Projectile projectile)
        {
            if (projectile.Owner is PlayerController)
            {
                PlayerController      player   = projectile.Owner as PlayerController;
                LorebookFantasyBullet loreness = projectile.gameObject.GetComponent <LorebookFantasyBullet>();
                if (loreness != null)
                {
                    if (loreness.Class == LorebookFantasyBullet.PartyMember.KNIGHT)
                    {
                        if (player.PlayerHasActiveSynergy("Level 20 Fighter"))
                        {
                            projectile.baseData.damage *= 1.25f;
                            projectile.baseData.speed  *= 1.15f;
                            projectile.UpdateSpeed();
                            PierceProjModifier knightPiercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                            knightPiercing.penetration += 5;
                            MakeLookLikeJammedBullet(projectile);
                        }
                    }
                    else if (loreness.Class == LorebookFantasyBullet.PartyMember.ROGUE)
                    {
                        if (player.PlayerHasActiveSynergy("Level 20 Rogue"))
                        {
                            projectile.baseData.damage *= 1.25f;
                            ExtremelySimpleStatusEffectBulletBehaviour roguePoisoning = projectile.gameObject.GetOrAddComponent <ExtremelySimpleStatusEffectBulletBehaviour>();
                            roguePoisoning.usesPoisonEffect = true;
                            roguePoisoning.poisonEffect     = StaticStatusEffects.irradiatedLeadEffect;
                            MakeLookLikeJammedBullet(projectile);
                        }
                    }
                    else if (loreness.Class == LorebookFantasyBullet.PartyMember.WIZARD)
                    {
                        if (player.PlayerHasActiveSynergy("Level 20 Wizard"))
                        {
                            projectile.baseData.damage *= 1.25f;
                            SpawnProjModifier WizardShooting = projectile.gameObject.GetComponent <SpawnProjModifier>();
                            if (WizardShooting != null)
                            {
                                WizardShooting.inFlightSpawnCooldown = 0.35f;
                            }
                            MakeLookLikeJammedBullet(projectile);
                        }
                    }
                    else if (loreness.Class == LorebookFantasyBullet.PartyMember.BARD)
                    {
                        if (player.PlayerHasActiveSynergy("Level 20 Bard"))
                        {
                            projectile.baseData.damage *= 1.25f;
                            GameActorCharmEffect UpgradedCharm = new GameActorCharmEffect
                            {
                                duration         = StaticStatusEffects.charmingRoundsEffect.duration * 3,
                                TintColor        = StaticStatusEffects.charmingRoundsEffect.TintColor,
                                DeathTintColor   = StaticStatusEffects.charmingRoundsEffect.DeathTintColor,
                                effectIdentifier = "Upgraded Bard Charm",
                                AppliesTint      = true,
                                AppliesDeathTint = true,
                                resistanceType   = EffectResistanceType.Charm,

                                //Eh
                                OverheadVFX        = StaticStatusEffects.charmingRoundsEffect.OverheadVFX,
                                AffectsEnemies     = true,
                                AffectsPlayers     = false,
                                AppliesOutlineTint = false,
                                OutlineTintColor   = StaticStatusEffects.charmingRoundsEffect.OutlineTintColor,
                                PlaysVFXOnActor    = false,
                            };
                            ExtremelySimpleStatusEffectBulletBehaviour BardCharming = projectile.gameObject.GetComponent <ExtremelySimpleStatusEffectBulletBehaviour>();
                            BardCharming.charmEffect     = UpgradedCharm;
                            BardCharming.usesCharmEffect = true;
                            MakeLookLikeJammedBullet(projectile);
                        }
                    }
                }
            }
            base.PostProcessProjectile(projectile);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Lorebook", "lorebook");

            Game.Items.Rename("outdated_gun_mods:lorebook", "nn:lorebook");

            var behav = gun.gameObject.AddComponent <Lorebook>();

            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalFireAudio   = "Play_ENM_wizard_summon_01";
            behav.overrideNormalReloadAudio = "Play_ENM_book_blast_01";

            gun.SetShortDescription("Party Cohesion");
            gun.SetLongDescription("Summons brave and noble bullet warriors of several different classes to destroy everything in sight and wreak havoc." + "\n(Like real heroes!)" + "\n\nThis magical tome of stories and scenarios was stolen from one of the most evil creatures in the Gungeon; a Lore Gunjurer.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 18);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            //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           = 0.6f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 4;
            gun.barrelOffset.transform.localPosition = new Vector3(0.93f, 0.87f, 0f);
            gun.SetBaseMaxAmmo(110);
            gun.gunClass = GunClass.SILLY;
            Projectile wizardSpellProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            wizardSpellProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(wizardSpellProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(wizardSpellProjectile);
            wizardSpellProjectile.baseData.damage *= 1f;
            wizardSpellProjectile.baseData.speed  *= 0.7f;
            wizardSpellProjectile.baseData.range  *= 5f;
            wizardSpellProjectile.SetProjectileSpriteRight("smallspark_projectile", 7, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 6, 6);

            Projectile wizardProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            wizardProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(wizardProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(wizardProjectile);
            wizardProjectile.baseData.damage *= 3f;
            wizardProjectile.baseData.speed  *= 0.08f;
            wizardProjectile.baseData.range  *= 5f;
            LorebookFantasyBullet wizardClassing = wizardProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>();

            wizardClassing.Class = LorebookFantasyBullet.PartyMember.WIZARD;
            wizardProjectile.pierceMinorBreakables = true;
            SpawnProjModifier wizardshot = wizardProjectile.gameObject.GetOrAddComponent <SpawnProjModifier>();

            wizardshot.usesComplexSpawnInFlight      = true;
            wizardshot.spawnOnObjectCollisions       = false;
            wizardshot.spawnProjecitlesOnDieInAir    = false;
            wizardshot.spawnProjectilesOnCollision   = false;
            wizardshot.spawnProjectilesInFlight      = true;
            wizardshot.projectileToSpawnInFlight     = wizardSpellProjectile;
            wizardshot.inFlightAimAtEnemies          = true;
            wizardshot.inFlightSpawnCooldown         = 1.15f;
            wizardshot.numberToSpawnOnCollison       = 0;
            wizardshot.numToSpawnInFlight            = 1;
            wizardshot.PostprocessSpawnedProjectiles = true;
            HomingModifier wizardHoming = wizardProjectile.gameObject.AddComponent <HomingModifier>();

            wizardHoming.AngularVelocity = 120f;
            wizardHoming.HomingRadius    = 1000f;
            BounceProjModifier wizardBouncing = wizardProjectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            wizardBouncing.numberOfBounces = 10;
            wizardProjectile.AnimateProjectile(new List <string> {
                "playerwizardprojectile_001",
                "playerwizardprojectile_002",
                "playerwizardprojectile_003",
                "playerwizardprojectile_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(17, 22), //1
                new IntVector2(17, 22), //2
                new IntVector2(17, 22), //3
                new IntVector2(17, 22), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 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(11, 16), //1
                new IntVector2(11, 16), //2
                new IntVector2(11, 16), //3
                new IntVector2(11, 16), //3
            },
                                               AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                               AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
            wizardProjectile.shouldFlipHorizontally = true;

            Projectile bardProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            bardProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bardProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bardProjectile);
            bardProjectile.baseData.damage *= 4f;
            bardProjectile.baseData.range  *= 5f;
            bardProjectile.baseData.speed  *= 0.25f;
            LorebookFantasyBullet bardClassing = bardProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>();

            bardClassing.Class = LorebookFantasyBullet.PartyMember.BARD;
            bardProjectile.pierceMinorBreakables = true;
            HomingModifier bardHoming = bardProjectile.gameObject.AddComponent <HomingModifier>();

            bardHoming.AngularVelocity = 120f;
            bardHoming.HomingRadius    = 1000f;
            ExtremelySimpleStatusEffectBulletBehaviour bardCharming = bardProjectile.gameObject.AddComponent <ExtremelySimpleStatusEffectBulletBehaviour>();

            bardCharming.usesCharmEffect = true;
            bardCharming.charmEffect     = StaticStatusEffects.charmingRoundsEffect;
            BounceProjModifier bardBouncing = bardProjectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            bardBouncing.numberOfBounces = 10;
            bardProjectile.AnimateProjectile(new List <string> {
                "playerbardbullet_001",
                "playerbardbullet_002",
                "playerbardbullet_003",
                "playerbardbullet_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(16, 15), //1
                new IntVector2(16, 15), //2
                new IntVector2(16, 15), //3
                new IntVector2(16, 15), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 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(10, 9), //1
                new IntVector2(10, 9), //2
                new IntVector2(10, 9), //3
                new IntVector2(10, 9), //3
            },
                                             AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                             AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
            bardProjectile.shouldFlipHorizontally = true;


            Projectile rogueProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            rogueProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(rogueProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(rogueProjectile);
            rogueProjectile.baseData.damage *= 4f;
            rogueProjectile.baseData.speed  *= 0.3f;
            rogueProjectile.baseData.range  *= 5f;
            LorebookFantasyBullet rogueClassing = rogueProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>();

            rogueClassing.Class = LorebookFantasyBullet.PartyMember.ROGUE;
            rogueProjectile.shouldFlipHorizontally = true;
            rogueProjectile.pierceMinorBreakables  = true;
            HomingModifier rogueHoming = rogueProjectile.gameObject.AddComponent <HomingModifier>();

            rogueHoming.AngularVelocity = 120f;
            rogueHoming.HomingRadius    = 1000f;
            BounceProjModifier rogueBouncing = rogueProjectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            rogueBouncing.numberOfBounces = 10;
            //Set Up Teleport Effect
            GameObject BaseEnemyRogueBullet         = EnemyDatabase.GetOrLoadByGuid("56fb939a434140308b8f257f0f447829").bulletBank.GetBullet("rogue").BulletObject;
            Projectile BaseEnemyProjectileComponent = BaseEnemyRogueBullet.GetComponent <Projectile>();

            if (BaseEnemyProjectileComponent != null)
            {
                TeleportProjModifier tp = BaseEnemyProjectileComponent.GetComponent <TeleportProjModifier>();
                if (tp != null)
                {
                    PlayerProjectileTeleportModifier rogueTeleport = rogueProjectile.gameObject.AddComponent <PlayerProjectileTeleportModifier>();
                    rogueTeleport.teleportVfx          = tp.teleportVfx;
                    rogueTeleport.teleportCooldown     = tp.teleportCooldown;
                    rogueTeleport.teleportPauseTime    = tp.teleportPauseTime;
                    rogueTeleport.trigger              = PlayerProjectileTeleportModifier.TeleportTrigger.DistanceFromTarget;
                    rogueTeleport.distToTeleport       = tp.distToTeleport * 2f;
                    rogueTeleport.behindTargetDistance = tp.behindTargetDistance;
                    rogueTeleport.leadAmount           = tp.leadAmount;
                    rogueTeleport.minAngleToTeleport   = tp.minAngleToTeleport;
                    rogueTeleport.numTeleports         = tp.numTeleports;
                    rogueTeleport.type = PlayerProjectileTeleportModifier.TeleportType.BehindTarget;
                }
                else
                {
                    ETGModConsole.Log("Base Eney TeleportProjModifier was null???");
                }
            }
            else
            {
                ETGModConsole.Log("Base Enemy Rogue Bullet had no projectile component???");
            }
            rogueProjectile.AnimateProjectile(new List <string> {
                "playerroguebullet_001",
                "playerroguebullet_002",
                "playerroguebullet_003",
                "playerroguebullet_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(16, 15), //1
                new IntVector2(16, 15), //2
                new IntVector2(16, 15), //3
                new IntVector2(16, 15), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 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(10, 9), //1
                new IntVector2(10, 9), //2
                new IntVector2(10, 9), //3
                new IntVector2(10, 9), //3
            },
                                              AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                              AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));

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

            knightProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(knightProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(knightProjectile);
            knightProjectile.baseData.range  *= 5f;
            knightProjectile.baseData.damage *= 5f;
            LorebookFantasyBullet knightClassing = knightProjectile.gameObject.GetOrAddComponent <LorebookFantasyBullet>();

            knightClassing.Class = LorebookFantasyBullet.PartyMember.KNIGHT;
            knightProjectile.pierceMinorBreakables = true;
            knightProjectile.baseData.speed       *= 0.25f;
            HomingModifier knightHoming = knightProjectile.gameObject.AddComponent <HomingModifier>();

            knightHoming.AngularVelocity = 120f;
            knightHoming.HomingRadius    = 1000f;
            BounceProjModifier knightBouncing = knightProjectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            knightBouncing.numberOfBounces = 10;
            knightProjectile.AnimateProjectile(new List <string> {
                "playerknightbullet_001",
                "playerknightbullet_002",
                "playerknightbullet_003",
                "playerknightbullet_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(19, 15), //1
                new IntVector2(19, 15), //2
                new IntVector2(19, 15), //3
                new IntVector2(19, 15), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 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(13, 9), //1
                new IntVector2(13, 9), //2
                new IntVector2(13, 9), //3
                new IntVector2(13, 9), //3
            },
                                               AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                               AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
            knightProjectile.shouldFlipHorizontally = true;


            gun.DefaultModule.projectiles[0] = knightProjectile;
            gun.DefaultModule.projectiles.Add(wizardProjectile);
            gun.DefaultModule.projectiles.Add(bardProjectile);
            gun.DefaultModule.projectiles.Add(rogueProjectile);



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

            LorebookID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ghost Blade", "ghostblade");

            Game.Items.Rename("outdated_gun_mods:ghost_blade", "nn:bullet_blade+ghost_sword");
            var behav = gun.gameObject.AddComponent <BulletBladeGhostForme>();

            behav.preventNormalFireAudio   = true;
            behav.preventNormalReloadAudio = true;
            //behav.overrideNormalFireAudio = "Play_OBJ_gate_slam_01";//"Play_ENM_gunnut_swing_01";

            gun.SetShortDescription("Forged of Pure Bullet");
            gun.SetLongDescription("The hefty blade of the fearsome armoured sentinels that tread the Gungeon's Halls." + "\n\nHas claimed the life of many a careless gungeoneer with it's wide spread.");
            gun.SetupSprite(null, "ghostblade_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.chargeAnimation, 6);

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_ENM_gunnut_shockwave_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            //BURST SHOT
            BurstShot = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);
            BurstShot.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(BurstShot.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(BurstShot);
            BurstShot.baseData.damage *= 1.6f;
            BurstShot.baseData.speed  *= 0.8f;
            BurstShot.SetProjectileSpriteRight("green_enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);



            for (int i = 0; i < 46; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }

            gun.DefaultModule.ammoCost            = 1;
            gun.DefaultModule.angleVariance       = 1;
            gun.DefaultModule.cooldownTime        = 2.5f;
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.numberOfShotsInClip = 1;
            Projectile bigProjectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            gun.DefaultModule.projectiles[0] = bigProjectile;
            bigProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bigProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bigProjectile);
            bigProjectile.baseData.damage *= 4;
            SpawnProjModifier radialBurst = bigProjectile.gameObject.AddComponent <SpawnProjModifier>();

            radialBurst.spawnProjectilesInFlight      = false;
            radialBurst.spawnProjectilesOnCollision   = true;
            radialBurst.spawnProjecitlesOnDieInAir    = true;
            radialBurst.spawnOnObjectCollisions       = true;
            radialBurst.collisionSpawnStyle           = SpawnProjModifier.CollisionSpawnStyle.RADIAL;
            radialBurst.numberToSpawnOnCollison       = 30;
            radialBurst.randomRadialStartAngle        = true;
            radialBurst.PostprocessSpawnedProjectiles = true;
            radialBurst.projectileToSpawnOnCollision  = BurstShot;

            bigProjectile.SetProjectileSpriteRight("large_green_enemystyle_projectile", 18, 18, true, tk2dBaseSprite.Anchor.MiddleCenter, 16, 16);

            ProjectileModule.ChargeProjectile bigchargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = bigProjectile,
                ChargeTime = 1f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                bigchargeProj
            };


            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost            = 1;
                    mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                    mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                    mod.cooldownTime        = 2.5f;
                    mod.angleVariance       = 70f;
                    mod.numberOfShotsInClip = 1;
                    Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                    mod.projectiles[0] = projectile;
                    projectile.gameObject.SetActive(false);
                    FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                    UnityEngine.Object.DontDestroyOnLoad(projectile);
                    projectile.baseData.damage *= 1.6f;
                    projectile.baseData.speed  *= 0.6f;
                    projectile.baseData.range  *= 1f;
                    projectile.SetProjectileSpriteRight("green_enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);
                    if (mod != gun.DefaultModule)
                    {
                        mod.ammoCost = 0;
                    }
                    projectile.transform.parent = gun.barrelOffset;

                    ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                    {
                        Projectile = projectile,
                        ChargeTime = 1f,
                    };
                    mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                        chargeProj
                    };
                }
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(50);
            gun.quality = PickupObject.ItemQuality.EXCLUDED;

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


            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(3.18f, 2.0f, 0f);
            GhostBladeID = gun.PickupObjectId;
        }
Exemplo n.º 5
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Galaxy Crusher", "galaxycrusher");

            Game.Items.Rename("outdated_gun_mods:galaxy_crusher", "nn:galaxy_crusher");

            var behav = gun.gameObject.AddComponent <GalaxyCrusher>();

            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalReloadAudio = "Play_ENV_water_splash_01";
            gun.SetShortDescription("Cosmic Crunch");
            gun.SetLongDescription("Tears apart the fabric of space time and good game design, allowing for ridiculous gun effects and fourth wall breaking Ammonomicon descriptions.");

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

            gun.SetAnimationFPS(gun.chargeAnimation, 13);

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

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

            //GUN STATS

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].eventAudio   = "Play_WPN_blackhole_shot_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation).frames[0].triggerEvent = true;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].eventAudio   = "Play_WPN_blackhole_charge_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[0].triggerEvent = true;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[22].eventAudio   = "Play_WPN_stdissuelaser_shot_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[22].triggerEvent = true;

            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[24].eventAudio   = "Play_WPN_stdissuelaser_shot_01";
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).frames[24].triggerEvent = true;

            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(228) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2f;
            gun.DefaultModule.cooldownTime           = 0.5f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(4.18f, 1.56f, 0f);
            gun.SetBaseMaxAmmo(10);
            gun.gunClass = GunClass.CHARGE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 21;

            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(169) as 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           *= 10f;
            projectile.AdditionalScaleMultiplier = 2f;

            //SmallerHole
            Projectile smallhole = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(169) as Gun).DefaultModule.projectiles[0]);

            smallhole.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(smallhole.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(smallhole);
            gun.DefaultModule.projectiles[0]    = smallhole;
            smallhole.baseData.damage           = 5f;
            smallhole.baseData.speed            = 5f;
            smallhole.AdditionalScaleMultiplier = 0.9f;
            BounceProjModifier bounce = smallhole.gameObject.AddComponent <BounceProjModifier>();

            bounce.numberOfBounces = 1;
            EasyTrailBullet trail4 = smallhole.gameObject.AddComponent <EasyTrailBullet>();

            trail4.TrailPos   = smallhole.transform.position;
            trail4.StartWidth = 1.56f;
            trail4.EndWidth   = 0f;
            trail4.LifeTime   = 1.5f;
            trail4.BaseColor  = Color.black;
            trail4.EndColor   = Color.black;

            SpawnProjModifier spawn = projectile.gameObject.AddComponent <SpawnProjModifier>();

            spawn.spawnProjecitlesOnDieInAir        = true;
            spawn.spawnProjectilesOnCollision       = true;
            spawn.spawnProjectilesInFlight          = false;
            spawn.spawnOnObjectCollisions           = true;
            spawn.collisionSpawnStyle               = SpawnProjModifier.CollisionSpawnStyle.RADIAL;
            spawn.numberToSpawnOnCollison           = 30;
            spawn.PostprocessSpawnedProjectiles     = true;
            spawn.projectileToSpawnOnCollision      = smallhole;
            spawn.spawnCollisionProjectilesOnBounce = false;


            ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 2f,
            };
            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                chargeProj
            };

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "black_hole";

            // 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.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            ID = gun.PickupObjectId;
        }
Exemplo n.º 6
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Big Shot", "bigshot");

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

            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalReloadAudio = "Play_NowsYourChanceToBeABigShot";
            gun.SetShortDescription("Now's Your Chance!");
            gun.SetLongDescription("The sign4ture weap0n of a [ONCE IN A LIFETIME OPPORTUNITY] that came to the Gungeon [ON AN ALL EXPENSES PAID HOLIDAY] seeking $$fr33$$! KROMER." + "\n\nYou're fill3d with [Hyperlink Blocked.].");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(519) as Gun).gunSwitchGroup;
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.reloadAnimation).wrapMode = tk2dSpriteAnimationClip.WrapMode.Loop;

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1.6f;
            gun.DefaultModule.cooldownTime           = 0.45f;
            gun.DefaultModule.numberOfShotsInClip    = 3;
            gun.barrelOffset.transform.localPosition = new Vector3(1.75f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo     = 100;
            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       = 29.99f;
            projectile.baseData.speed       *= 0.7f;
            projectile.baseData.range       *= 2f;
            //ANIMATE BULLET
            projectile.AnimateProjectile(new List <string> {
                "bigshot_orangeproj_001",
                "bigshot_orangeproj_002",
                "bigshot_orangeproj_003",
            }, 10, true, new List <IntVector2> {
                new IntVector2(17, 16),  //1
                new IntVector2(17, 16),  //2
                new IntVector2(17, 16),  //3
            },
                                         AnimateBullet.ConstructListOfSameValues(true, 3),
                                         AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 3),
                                         AnimateBullet.ConstructListOfSameValues(true, 3),
                                         AnimateBullet.ConstructListOfSameValues(false, 3),
                                         AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 3),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 3),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 3),
                                         AnimateBullet.ConstructListOfSameValues <Projectile>(null, 3));
            projectile.gameObject.AddComponent <BigShotProjectileComp>();
            projectile.DestroyMode = Projectile.ProjectileDestroyMode.BecomeDebris;
            projectile.SetProjectileSpriteRight("bigshot_orangeproj_001", 17, 16, true, tk2dBaseSprite.Anchor.MiddleCenter, 17, 16);

            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            projectile2.baseData.damage = 29.99f;
            projectile2.baseData.speed *= 0.7f;
            projectile2.baseData.range *= 2f;

            //ANIMATE BULLET
            projectile2.AnimateProjectile(new List <string> {
                "bigshot_pinkproj_001",
                "bigshot_pinkproj_002",
                "bigshot_pinkproj_003",
            }, 16, true, new List <IntVector2> {
                new IntVector2(17, 15), //1
                new IntVector2(17, 15), //2
                new IntVector2(17, 15), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 3),
                                          AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 3),
                                          AnimateBullet.ConstructListOfSameValues(true, 3),
                                          AnimateBullet.ConstructListOfSameValues(false, 3),
                                          AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 3),
                                          AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 3),
                                          AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 3),
                                          AnimateBullet.ConstructListOfSameValues <Projectile>(null, 3));
            projectile2.SetProjectileSpriteRight("bigshot_pinkproj_001", 17, 15, true, tk2dBaseSprite.Anchor.MiddleCenter, 17, 15);
            projectile2.DestroyMode = Projectile.ProjectileDestroyMode.BecomeDebris;
            projectile2.gameObject.AddComponent <BigShotProjectileComp>();
            gun.DefaultModule.projectiles.Add(projectile2);


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

            BigShotID = gun.PickupObjectId;



            //SPAMTON HEAD
            Projectile spamtonHead = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);

            spamtonHead.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(spamtonHead.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(spamtonHead);
            spamtonHead.baseData.damage                   = 7f;
            spamtonHead.baseData.speed                   *= 1.2f;
            spamtonHead.hitEffects.alwaysUseMidair        = true;
            spamtonHead.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.WhiteCircleVFX;
            spamtonHead.AnimateProjectile(new List <string> {
                "spamtonhead_001",
                "spamtonhead_002",
            }, 4, true, new List <IntVector2> {
                new IntVector2(10, 13), //1
                new IntVector2(10, 11), //2
            }, AnimateBullet.ConstructListOfSameValues(true, 2),
                                          AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 2),
                                          AnimateBullet.ConstructListOfSameValues(true, 2),
                                          AnimateBullet.ConstructListOfSameValues(false, 2),
                                          AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 2),
                                          AnimateBullet.ConstructListOfSameValues <IntVector2?>(new IntVector2(5, 5), 2),
                                          AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 2),
                                          AnimateBullet.ConstructListOfSameValues <Projectile>(null, 2));
            spamtonHead.SetProjectileSpriteRight("spamtonhead_001", 10, 13, true, tk2dBaseSprite.Anchor.MiddleCenter, 5, 5);

            //PIPIS
            Projectile pipisProj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            pipisProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(pipisProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(pipisProj);
            pipisProj.baseData.damage = 29.99f;
            pipisProj.baseData.speed *= 0.7f;
            pipisProj.baseData.range *= 0.7f;
            pipisProj.AnimateProjectile(new List <string> {
                "pipis_001",
                "pipis_002",
                "pipis_003",
                "pipis_004",
            }, 8, true, new List <IntVector2> {
                new IntVector2(12, 12), //1
                new IntVector2(12, 12), //2
                new IntVector2(12, 12), //3
                new IntVector2(12, 12), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 4),
                                        AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4),
                                        AnimateBullet.ConstructListOfSameValues(true, 4),
                                        AnimateBullet.ConstructListOfSameValues(false, 4),
                                        AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4),
                                        AnimateBullet.ConstructListOfSameValues <IntVector2?>(new IntVector2(5, 5), 4),
                                        AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                        AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
            pipisProj.SetProjectileSpriteRight("pipis_001", 12, 12, true, tk2dBaseSprite.Anchor.MiddleCenter, 5, 5);
            pipisProj.DestroyMode = Projectile.ProjectileDestroyMode.BecomeDebris;
            pipisProj.gameObject.AddComponent <BigShotProjectileComp>();
            SpawnProjModifier projMod = pipisProj.gameObject.AddComponent <SpawnProjModifier>();

            projMod.spawnOnObjectCollisions      = true;
            projMod.spawnProjecitlesOnDieInAir   = true;
            projMod.spawnProjectilesOnCollision  = true;
            projMod.spawnProjectilesInFlight     = false;
            projMod.collisionSpawnStyle          = SpawnProjModifier.CollisionSpawnStyle.FLAK_BURST;
            projMod.alignToSurfaceNormal         = true;
            projMod.numberToSpawnOnCollison      = 5;
            projMod.projectileToSpawnOnCollision = spamtonHead;
            pipis = pipisProj;
        }
Exemplo n.º 7
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Killithid Tendril", "killithidtendril");

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

            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalFireAudio   = "Play_ENM_squidface_cast_01";
            behav.overrideNormalReloadAudio = "Play_ENM_squidface_chant_01";
            gun.SetShortDescription("Wiggle Wiggle");
            gun.SetLongDescription("A tadpole of the Killithid species, capable of opening up portals to it's home dimension." + "\n\nWhile currently dormant, one day it will become active and burrow into the head of a sapient humanoid, eat their brain, and turn them into another Killithid.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 10);

            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(35) as Gun).gunSwitchGroup;
            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.Ordered;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.4f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 200;
            gun.barrelOffset.transform.localPosition = new Vector3(0.93f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.ammo     = 200;
            gun.gunClass = GunClass.SILLY;
            Projectile subproj = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            subproj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(subproj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(subproj);
            subproj.baseData.damage = 8f;
            subproj.SetProjectileSpriteRight("enemystyleproj", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);
            subProjectile = subproj;


            //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 = 15f;
            projectile.baseData.speed  = 0;
            RandomRoomPosBehaviour roompos  = projectile.gameObject.AddComponent <RandomRoomPosBehaviour>();
            BulletLifeTimer        lifespan = projectile.gameObject.AddComponent <BulletLifeTimer>();

            lifespan.secondsTillDeath = 15f;
            PierceProjModifier piercing = projectile.gameObject.AddComponent <PierceProjModifier>();

            piercing.penetration          = 100;
            piercing.penetratesBreakables = true;
            SpawnProjModifier firing = projectile.gameObject.AddComponent <SpawnProjModifier>();

            firing.InFlightSourceTransform               = projectile.transform;
            firing.projectileToSpawnInFlight             = subProjectile;
            firing.PostprocessSpawnedProjectiles         = true;
            firing.spawnProjectilesInFlight              = true;
            firing.spawnProjecitlesOnDieInAir            = false;
            firing.spawnOnObjectCollisions               = false;
            firing.inFlightAimAtEnemies                  = true;
            firing.usesComplexSpawnInFlight              = true;
            firing.numToSpawnInFlight                    = 1;
            firing.inFlightSpawnCooldown                 = 1;
            projectile.baseData.force                   *= 1.2f;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.YellowLaserCircleVFX;
            projectile.AnimateProjectile(new List <string> {
                "goopyproj_001",
                "goopyproj_002",
                "goopyproj_003",
                "goopyproj_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(16, 16),
                new IntVector2(20, 20),
                new IntVector2(24, 24),
                new IntVector2(20, 20),
            }, AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4), AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(false, 4),
                                         AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4), AnimateBullet.ConstructListOfSameValues <IntVector2?>(new IntVector2(16, 16), 4), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));

            gun.DefaultModule.projectiles[0] = projectile;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("KillithidTendril Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/killithidtendril_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/killithidtendril_clipempty");

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            KillithidTendrilID = gun.PickupObjectId;
        }
        public override void PostProcessProjectile(Projectile projectile)
        {
            if (projectile && projectile.ProjectilePlayerOwner())
            {
                List <int> possibleForms = new List <int>();
                if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("Poisbulonial"))
                {
                    possibleForms.Add(1);
                    projectile.statusEffectsToApply.Add(StaticStatusEffects.irradiatedLeadEffect);
                }
                if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("Blizzbulonial"))
                {
                    possibleForms.Add(2);
                    projectile.statusEffectsToApply.Add(StaticStatusEffects.frostBulletsEffect);
                }
                if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("Leadbulonial"))
                {
                    possibleForms.Add(3);
                    projectile.statusEffectsToApply.Add(StaticStatusEffects.hotLeadEffect);
                }
                if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("Poopulonial"))
                {
                    possibleForms.Add(4);
                    projectile.statusEffectsToApply.Add(StaticStatusEffects.tripleCrossbowSlowEffect);
                }
                if (possibleForms.Count > 0)
                {
                    int randomGoopForm = BraveUtility.RandomElement(possibleForms);
                    switch (randomGoopForm)
                    {
                    case 1:
                        projectile.gameObject.GetComponent <GoopModifier>().goopDefinition = EasyGoopDefinitions.PoisonDef;
                        projectile.damageTypes |= CoreDamageTypes.Poison;
                        projectile.AdjustPlayerProjectileTint(ExtendedColours.poisonGreen, 1);
                        break;

                    case 2:
                        projectile.gameObject.GetComponent <GoopModifier>().goopDefinition = EasyGoopDefinitions.WaterGoop;
                        projectile.damageTypes |= CoreDamageTypes.Ice;
                        projectile.AdjustPlayerProjectileTint(ExtendedColours.skyblue, 1);
                        break;

                    case 3:
                        projectile.gameObject.GetComponent <GoopModifier>().goopDefinition = EasyGoopDefinitions.FireDef;
                        projectile.damageTypes |= CoreDamageTypes.Fire;
                        projectile.AdjustPlayerProjectileTint(Color.grey, 1);
                        break;

                    case 4:
                        projectile.AdjustPlayerProjectileTint(ExtendedColours.brown, 1);
                        break;
                    }
                }
                if (projectile.ProjectilePlayerOwner().PlayerHasActiveSynergy("Bloodbulonial"))
                {
                    SpawnProjModifier spawnpoj = projectile.gameObject.AddComponent <SpawnProjModifier>();
                    spawnpoj.projectileToSpawnOnCollision  = (PickupObjectDatabase.GetById(38) as Gun).DefaultModule.projectiles[0];
                    spawnpoj.PostprocessSpawnedProjectiles = true;
                    spawnpoj.numberToSpawnOnCollison       = 10;
                    spawnpoj.spawnOnObjectCollisions       = true;
                    spawnpoj.spawnProjecitlesOnDieInAir    = true;
                    spawnpoj.spawnProjectilesInFlight      = false;
                    spawnpoj.spawnProjectilesOnCollision   = true;
                    spawnpoj.randomRadialStartAngle        = true;
                }
            }
            base.PostProcessProjectile(projectile);
        }
Exemplo n.º 9
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ulfberht", "ulfbehrt");

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

            gun.SetShortDescription("+VLFBEHT+");
            gun.SetLongDescription("Part of an ancient series of guns from a widespread and respected family of Gunsmiths, now lost to time." + "\n\nCrusty, rusty firearms such as this one are the only evidence of their existence...");

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

            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(38) as Gun).muzzleFlashEffects;

            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 = 0.8f;
            gun.DefaultModule.cooldownTime           = 0.25f;
            gun.DefaultModule.numberOfShotsInClip    = 7;
            gun.DefaultModule.angleVariance          = 10;
            gun.barrelOffset.transform.localPosition = new Vector3(24f / 16f, 13f / 16f, 0f);
            gun.SetBaseMaxAmmo(150);
            gun.ammo     = 150;
            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);
            projectile.baseData.damage                   = 7f;
            projectile.baseData.range                    = 5f;
            projectile.baseData.speed                   *= 0.9f;
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(761) as Gun).DefaultModule.projectiles[0].hitEffects.overrideMidairDeathVFX;

            SpawnProjModifier spawner = projectile.gameObject.AddComponent <SpawnProjModifier>();

            spawner.spawnProjecitlesOnDieInAir        = true;
            spawner.spawnProjectilesInFlight          = false;
            spawner.spawnProjectilesOnCollision       = true;
            spawner.spawnOnObjectCollisions           = true;
            spawner.spawnCollisionProjectilesOnBounce = true;
            spawner.randomRadialStartAngle            = true;
            GameObject proj2 = (PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0].gameObject.InstantiateAndFakeprefab();

            proj2.GetComponent <Projectile>().AdditionalScaleMultiplier = 0.8f;
            proj2.GetComponent <Projectile>().baseData.damage           = 3;
            spawner.projectileToSpawnOnCollision  = proj2.GetComponent <Projectile>();
            spawner.collisionSpawnStyle           = SpawnProjModifier.CollisionSpawnStyle.RADIAL;
            spawner.fireRandomlyInAngle           = true;
            spawner.PostprocessSpawnedProjectiles = true;
            spawner.numberToSpawnOnCollison       = 5;

            projectile.SetProjectileSpriteRight("ulfbehrt_proj", 11, 9, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 7);
            gun.DefaultModule.projectiles[0] = projectile;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Ulfbehrt Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/ulfbehrt_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/ulfbehrt_clipempty");

            gun.quality = PickupObject.ItemQuality.D;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            ID = gun.PickupObjectId;
        }
Exemplo n.º 10
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("ARC Cannon", "arccannon");

            Game.Items.Rename("outdated_gun_mods:arc_cannon", "nn:arc_cannon");
            gun.gameObject.AddComponent <ARCCannon>();
            gun.SetShortDescription("All Lightning");
            gun.SetLongDescription("The ARC Cannon was commissioned from the ARC Private Security Company by the Sultan of a distant planet, who now spends his free time striking ships from the sky and declaring himself a god.");

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

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

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(ARCPistol.ID) as Gun, true, false);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(153) as Gun).gunSwitchGroup;

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(228) as Gun).muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 3f;
            gun.DefaultModule.cooldownTime           = 1f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(45f / 16f, 16f / 16f, 0f);
            gun.SetBaseMaxAmmo(40);
            gun.gunClass = GunClass.RIFLE;
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "ARC Bullets";

            //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;
            LightningProjectileComp lightning = projectile.gameObject.GetComponent <LightningProjectileComp>();

            lightning.lightningWidth = 7;

            ExplosiveModifier explode = projectile.gameObject.AddComponent <ExplosiveModifier>();

            explode.explosionData = new ExplosionData()
            {
                breakSecretWalls = false,
                //effect = (PickupObjectDatabase.GetById(36) as Gun).DefaultModule.chargeProjectiles[1].Projectile.projectile.hitEffects.overrideEarlyDeathVfx,
                effect               = EasyVFXDatabase.ShittyElectricExplosion,
                doDamage             = true,
                damageRadius         = 3,
                damageToPlayer       = 0,
                damage               = 40,
                debrisForce          = 20,
                doExplosionRing      = true,
                doDestroyProjectiles = true,
                doForce              = true,
                doScreenShake        = true,
                playDefaultSFX       = true,
                force = 20,
            };

            Projectile subLightning = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(ARCPistol.ID) as Gun).DefaultModule.projectiles[0]);

            subLightning.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(subLightning.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(subLightning);
            subLightning.baseData.damage = 5f;
            LightningProjectileComp lightning2 = subLightning.gameObject.GetComponent <LightningProjectileComp>();

            subLightning.projectile.gameObject.AddComponent <PierceProjModifier>();
            lightning2.targetEnemies = false;

            SpawnProjModifier flakLightning = projectile.gameObject.AddComponent <SpawnProjModifier>();

            flakLightning.numberToSpawnOnCollison           = 5;
            flakLightning.numToSpawnInFlight                = 0;
            flakLightning.PostprocessSpawnedProjectiles     = true;
            flakLightning.projectileToSpawnOnCollision      = subLightning;
            flakLightning.randomRadialStartAngle            = true;
            flakLightning.spawnCollisionProjectilesOnBounce = true;
            flakLightning.spawnOnObjectCollisions           = true;
            flakLightning.spawnProjecitlesOnDieInAir        = true;
            flakLightning.spawnProjectilesOnCollision       = true;
            flakLightning.spawnProjectilesInFlight          = false;
            flakLightning.alignToSurfaceNormal              = true;

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


            ID = gun.PickupObjectId;
        }