Ejemplo n.º 1
0
        public static GameObject BuildPrefab()
        {
            var bomb = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_spin_001.png", new GameObject("Lvl2Molotov"));

            bomb.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bomb);

            var animator   = bomb.AddComponent <tk2dSpriteAnimator>();
            var collection = (PickupObjectDatabase.GetById(108) as SpawnObjectPlayerItem).objectToSpawn.GetComponent <tk2dSpriteAnimator>().Library.clips[0].frames[0].spriteCollection;

            //DEPLOYMENT
            var deployAnimation = SpriteBuilder.AddAnimation(animator, collection, new List <int>
            {
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_spin_004.png", collection),
            }, "lvl2mol_throw", tk2dSpriteAnimationClip.WrapMode.Once);

            deployAnimation.fps = 12;
            foreach (var frame in deployAnimation.frames)
            {
                frame.eventLerpEmissiveTime  = 0.5f;
                frame.eventLerpEmissivePower = 30f;
            }

            var explodeAnimation = SpriteBuilder.AddAnimation(animator, collection, new List <int>
            {
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_burst_001.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_burst_002.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_burst_003.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_burst_004.png", collection),
            }, "lvl2mol_burst", tk2dSpriteAnimationClip.WrapMode.Once);

            explodeAnimation.fps = 16;
            foreach (var frame in explodeAnimation.frames)
            {
                frame.eventLerpEmissiveTime  = 0.5f;
                frame.eventLerpEmissivePower = 30f;
            }

            var armedAnimation = SpriteBuilder.AddAnimation(animator, collection, new List <int>
            {
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_spin_001.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_spin_002.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_spin_003.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/lvl2molotov_spin_004.png", collection),
            }, "lvl2mol_default", tk2dSpriteAnimationClip.WrapMode.LoopSection);

            armedAnimation.fps       = 10.0f;
            armedAnimation.loopStart = 0;
            foreach (var frame in armedAnimation.frames)
            {
                frame.eventLerpEmissiveTime  = 0.5f;
                frame.eventLerpEmissivePower = 30f;
            }

            CustomThrowableObject throwable = new CustomThrowableObject
            {
                doEffectOnHitGround  = true,
                OnThrownAnimation    = "lvl2mol_throw",
                OnHitGroundAnimation = "lvl2mol_burst",
                DefaultAnim          = "lvl2mol_default",
                destroyOnHitGround   = false,
                thrownSoundEffect    = "Play_OBJ_item_throw_01",
                effectSoundEffect    = "Play_OBJ_glassbottle_shatter_01",
            };

            bomb.AddComponent <CustomThrowableObject>(throwable);
            bomb.AddComponent <LvL2MolotovEffect>();
            return(bomb);
        }
Ejemplo n.º 2
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Redhawk", "redhawk");

            Game.Items.Rename("outdated_gun_mods:redhawk", "nn:redhawk");
            gun.gameObject.AddComponent <Redhawk>();
            gun.SetShortDescription("Rugged");
            gun.SetLongDescription("An ancient masterwork, rumoured to be an unreleased Edwin classical original." + "\n\nThe Redhawk's bullets seem to rip and rend the exact right strands of sinew and muscle to cripple any foe.");

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

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

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

            //GUN STATS
            gun.muzzleFlashEffects          = (PickupObjectDatabase.GetById(58) as Gun).muzzleFlashEffects;
            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.DefaultModule.numberOfShotsInClip    = 6;
            gun.barrelOffset.transform.localPosition = new Vector3(26f / 16f, 11f / 16f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.gunClass = GunClass.PISTOL;
            gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.MEDIUM_BLASTER;

            //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       = 8;
            projectile.baseData.force        = 4f;
            projectile.baseData.speed        = 45f;
            projectile.hitEffects            = (PickupObjectDatabase.GetById(32) as Gun).DefaultModule.projectiles[0].hitEffects;

            projectile.SetProjectileSpriteRight("laserwelder_proj", 10, 3, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 3);
            projectile.hitEffects.CenterDeathVFXOnProjectile = true;

            ProjWeaknessModifier weakness = projectile.gameObject.AddComponent <ProjWeaknessModifier>();

            weakness.chanceToApply = 0.33f;


            List <string> BeamAnimPaths = new List <string>()
            {
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trail_001",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trail_002",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trail_003",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trail_004",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trail_005",
            };
            List <string> ImpactAnimPaths = new List <string>()
            {
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trailstart_001",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trailstart_002",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trailstart_003",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trailstart_004",
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trailstart_005",
            };

            projectile.AddTrailToProjectile(
                "NevernamedsItems/Resources/TrailSprites/laserwelder_trail_001",
                new Vector2(17, 5),
                new Vector2(0, 6),
                BeamAnimPaths, 20,
                ImpactAnimPaths, 20,
                0.1f,
                -1,
                -1,
                true
                );

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

            ID = gun.PickupObjectId;
        }
Ejemplo n.º 3
0
        public static void Init()
        {
            m_SprenOrbitalItem = PickupObjectDatabase.GetById(578).GetComponent <SprenOrbitalItem>();

            if (!m_SprenOrbitalItem)
            {
                return;
            }

            GameObject sprunObject = new GameObject("Sprun");

            sprunObject.AddComponent <SprunButBetter>();
            sprunObject.AddComponent <tk2dSprite>();
            DuplicateSprite(sprunObject.GetComponent <tk2dSprite>(), m_SprenOrbitalItem.GetComponent <tk2dSprite>());

            SprunButBetter sprun = sprunObject.GetComponent <SprunButBetter>();

            ItemBuilder.SetupItem(sprun, "The Way of Guns", "Transforms into a powerful weapon upon using a blank.\n\nThis Bullet Sprite will transform into an enormously powerful radiant energy weapon under certain circumstances." +
                                  " Traditionally, this means showing proficiency in bridge delivery and maintenance. If no bridge is available, however, it will take less important things like courage or determination into consideration.", "cel");


            sprun.itemName       = "Sprun But Better";
            sprun.PickupObjectId = 578;
            sprun.quality        = m_SprenOrbitalItem.quality;
            sprun.additionalMagnificenceModifier = m_SprenOrbitalItem.additionalMagnificenceModifier;
            sprun.ItemSpansBaseQualityTiers      = m_SprenOrbitalItem.ItemSpansBaseQualityTiers;
            sprun.ItemRespectsHeartMagnificence  = m_SprenOrbitalItem.ItemRespectsHeartMagnificence;
            sprun.associatedItemChanceMods       = m_SprenOrbitalItem.associatedItemChanceMods;
            sprun.contentSource             = m_SprenOrbitalItem.contentSource;
            sprun.ShouldBeExcludedFromShops = m_SprenOrbitalItem.ShouldBeExcludedFromShops;
            sprun.CanBeDropped = m_SprenOrbitalItem.CanBeDropped;
            sprun.PreventStartingOwnerFromDropping = m_SprenOrbitalItem.PreventStartingOwnerFromDropping;
            sprun.PersistsOnDeath   = m_SprenOrbitalItem.PersistsOnDeath;
            sprun.RespawnsIfPitfall = m_SprenOrbitalItem.RespawnsIfPitfall;
            sprun.PreventStartingOwnerFromDropping = m_SprenOrbitalItem.PreventStartingOwnerFromDropping;
            sprun.IgnoredByRat = m_SprenOrbitalItem.IgnoredByRat;
            sprun.SaveFlagToSetOnAcquisition  = m_SprenOrbitalItem.SaveFlagToSetOnAcquisition;
            sprun.ForcedPositionInAmmonomicon = m_SprenOrbitalItem.ForcedPositionInAmmonomicon;
            sprun.UsesCustomCost             = m_SprenOrbitalItem.UsesCustomCost;
            sprun.CustomCost                 = m_SprenOrbitalItem.CustomCost;
            sprun.PersistsOnPurchase         = m_SprenOrbitalItem.PersistsOnPurchase;
            sprun.CanBeSold                  = m_SprenOrbitalItem.CanBeSold;
            sprun.passiveStatModifiers       = m_SprenOrbitalItem.passiveStatModifiers;
            sprun.ArmorToGainOnInitialPickup = m_SprenOrbitalItem.ArmorToGainOnInitialPickup;
            sprun.minimapIcon                = m_SprenOrbitalItem.minimapIcon;

            sprun.OrbitalPrefab         = m_SprenOrbitalItem.OrbitalPrefab;
            sprun.OrbitalFollowerPrefab = m_SprenOrbitalItem.OrbitalFollowerPrefab;
            sprun.HasUpgradeSynergy     = m_SprenOrbitalItem.HasUpgradeSynergy;
            sprun.CanBeMimicked         = m_SprenOrbitalItem.CanBeMimicked;
            sprun.modifiers             = m_SprenOrbitalItem.modifiers;
            sprun.synergyModifiers      = m_SprenOrbitalItem.synergyModifiers;
            sprun.BreaksUponContact     = m_SprenOrbitalItem.BreaksUponContact;
            sprun.BreaksUponOwnerDamage = m_SprenOrbitalItem.BreaksUponOwnerDamage;
            sprun.BreakVFX = m_SprenOrbitalItem.BreakVFX;

            sprun.LimitGunId             = m_SprenOrbitalItem.LimitGunId;
            sprun.LimitDuration          = m_SprenOrbitalItem.LimitDuration;
            sprun.IdleAnimation          = m_SprenOrbitalItem.IdleAnimation;
            sprun.GunChangeAnimation     = m_SprenOrbitalItem.GunChangeAnimation;
            sprun.GunChangeMoreAnimation = m_SprenOrbitalItem.GunChangeMoreAnimation;
            sprun.BackchangeAnimation    = m_SprenOrbitalItem.BackchangeAnimation;

            m_SprenOrbitalItem.quality = ItemQuality.EXCLUDED;

            sprunObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(sprunObject);
            DontDestroyOnLoad(sprunObject);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("carrion_third_form", "carrionformthree");

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

            behav.preventNormalFireAudio = true;
            gun.SetShortDescription("");
            gun.SetLongDescription("");

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

            gun.SetAnimationFPS(gun.shootAnimation, 13);
            gun.SetAnimationFPS(gun.idleAnimation, 13);
            gun.isAudioLoop = true;
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);

            //GUN STATS
            gun.doesScreenShake             = true;
            gun.DefaultModule.ammoCost      = 5;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Beam;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.cooldownTime           = 0.001f;
            gun.DefaultModule.numberOfShotsInClip    = 600;
            gun.DefaultModule.ammoType               = GameUIAmmoType.AmmoType.BEAM;
            gun.barrelOffset.transform.localPosition = new Vector3(0.75f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(600);
            gun.ammo = 600;

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

            //SUB TENTACLE
            #region subtentacle
            Projectile subTendrilProj = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

            BasicBeamController subTendrilComp = subTendrilProj.GenerateBeamPrefab(
                "NevernamedsItems/Resources/BeamSprites/carrionsubtendril_mid_001",
                new Vector2(4, 2),
                new Vector2(0, 1),
                new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/carrionsubtendril_mid_001"
            },
                13,
                //Impact
                null,
                -1,
                null,
                null,
                //End
                new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/carrionsubtendril_end_001"
            },
                13,
                new Vector2(6, 2),
                new Vector2(0, 1),
                //Beginning
                new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/carrionsubtendril_start_001"
            },
                13,
                new Vector2(7, 2),
                new Vector2(0, 1),
                //Other Variables
                0
                );

            subTendrilProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(subTendrilProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(subTendrilProj);
            subTendrilProj.baseData.damage = 10f;
            subTendrilProj.baseData.force *= 1f;
            subTendrilProj.baseData.range  = 5.5f;
            subTendrilComp.ProjectileAndBeamMotionModule = new HelixProjectileMotionModule();
            subTendrilComp.boneType              = BasicBeamController.BeamBoneType.Projectile;
            subTendrilComp.penetration           = 1;
            subTendrilComp.homingRadius          = 10;
            subTendrilComp.homingAngularVelocity = 1000;
            CarrionSubTendrilController subtendril = subTendrilProj.gameObject.AddComponent <CarrionSubTendrilController>();
            #endregion

            //MAIN TENTACLE
            #region maintentacle
            List <string> BeamAnimPaths = new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_mid_001",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_mid_002",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_mid_003",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_mid_004",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_mid_005",
            };
            List <string> BeamEndPaths = new List <string>()
            {
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_end_001",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_end_002",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_end_003",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_end_004",
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_end_005",
            };

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

            BasicBeamController beamComp = projectile.GenerateBeamPrefab(
                "NevernamedsItems/Resources/BeamSprites/carrionformthree_mid_001",
                new Vector2(16, 5),
                new Vector2(0, 6),
                BeamAnimPaths,
                13,
                //Impact
                null,
                -1,
                null,
                null,
                //End
                BeamEndPaths,
                13,
                new Vector2(10, 5),
                new Vector2(0, 6),
                //Beginning
                null,
                -1,
                null,
                null,
                //Other Variables
                0
                );

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage = 50f;
            projectile.baseData.force *= 1f;
            projectile.baseData.range  = 16;
            projectile.baseData.speed *= 3;

            beamComp.boneType              = BasicBeamController.BeamBoneType.Projectile;
            beamComp.startAudioEvent       = "Play_WPN_demonhead_shot_01";
            beamComp.endAudioEvent         = "Stop_WPN_All";
            beamComp.penetration           = 5;
            beamComp.homingRadius          = 10;
            beamComp.homingAngularVelocity = 500;
            beamComp.ProjectileScale      *= 1.2f;

            CarrionMainTendrilController mainTendril = projectile.gameObject.AddComponent <CarrionMainTendrilController>();
            mainTendril.subTendrilPrefab = subTendrilProj.gameObject;

            projectile.gameObject.AddComponent <CarrionMovementTentacles>();

            gun.DefaultModule.projectiles[0] = projectile;
            #endregion

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "Carrion Clip";

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

            Carrion.CarrionForme3ID = gun.PickupObjectId;
        }
Ejemplo n.º 5
0
        public static GameObject BuildPrefab(string name, string guid, string defaultSpritePath, IntVector2 hitboxOffset, IntVector2 hitBoxSize, bool HasAiShooter, bool UsesAttackGroup = false)
        {
            if (BossBuilder.Dictionary.ContainsKey(guid))
            {
                ETGModConsole.Log("BossBuilder: Yea something went wrong. Complain to Neighborino about it.");
                return(null);
            }
            var prefab = GameObject.Instantiate(behaviorSpeculatorPrefab);

            prefab.name = name;

            //setup misc components
            var sprite = SpriteBuilder.SpriteFromResource(defaultSpritePath, prefab).GetComponent <tk2dSprite>();

            sprite.SetUpSpeculativeRigidbody(hitboxOffset, hitBoxSize).CollideWithOthers = true;
            prefab.AddComponent <tk2dSpriteAnimator>();
            prefab.AddComponent <AIAnimator>();

            //setup knockback
            var knockback = prefab.AddComponent <KnockbackDoer>();

            knockback.weight = 1;



            //setup health haver
            var healthHaver = prefab.AddComponent <HealthHaver>();

            healthHaver.RegisterBodySprite(sprite);
            healthHaver.PreventAllDamage = false;
            healthHaver.SetHealthMaximum(15000);
            healthHaver.FullHeal();

            //setup AI Actor
            var aiActor = prefab.AddComponent <AIActor>();

            aiActor.State     = AIActor.ActorState.Normal;
            aiActor.EnemyGuid = guid;
            aiActor.HasShadow = false;
            //setup behavior speculator
            var bs = prefab.GetComponent <BehaviorSpeculator>();

            bs.MovementBehaviors = new List <MovementBehaviorBase>();
            bs.TargetBehaviors   = new List <TargetBehaviorBase>();
            bs.OverrideBehaviors = new List <OverrideBehaviorBase>();
            bs.OtherBehaviors    = new List <BehaviorBase>();
            bs.AttackBehaviorGroup.AttackBehaviors = new List <AttackBehaviorGroup.AttackGroupItem>();
            if (HasAiShooter)
            {
                var actor = EnemyDatabase.GetOrLoadByGuid("01972dee89fc4404a5c408d50007dad5");
                behaviorSpeculatorPrefab = GameObject.Instantiate(actor.gameObject);
                foreach (Transform child in behaviorSpeculatorPrefab.transform)
                {
                    if (child != behaviorSpeculatorPrefab.transform)
                    {
                        GameObject.DestroyImmediate(child);
                    }
                }

                foreach (var comp in behaviorSpeculatorPrefab.GetComponents <Component>())
                {
                    if (comp.GetType() != typeof(BehaviorSpeculator))
                    {
                        GameObject.DestroyImmediate(comp);
                    }
                }

                GameObject.DontDestroyOnLoad(behaviorSpeculatorPrefab);
                FakePrefab.MarkAsFakePrefab(behaviorSpeculatorPrefab);
                behaviorSpeculatorPrefab.SetActive(false);
            }
            else
            {
                AIBulletBank aibulletBank = prefab.AddComponent <AIBulletBank>();
            }

            //Add to enemy database
            EnemyDatabaseEntry enemyDatabaseEntry = new EnemyDatabaseEntry()
            {
                myGuid          = guid,
                placeableWidth  = 2,
                placeableHeight = 2,
                isNormalEnemy   = true
            };

            EnemyDatabase.Instance.Entries.Add(enemyDatabaseEntry);
            BossBuilder.Dictionary.Add(guid, prefab);


            //finalize
            GameObject.DontDestroyOnLoad(prefab);
            FakePrefab.MarkAsFakePrefab(prefab);
            prefab.SetActive(false);

            return(prefab);
        }
Ejemplo n.º 6
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("Sir lot o lance", "lnc");

            // "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:sir_lot_o_lance", "ski:sir_lot_o_lance");
            gun.gameObject.AddComponent <Lance>();
            //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("Now with 100% less horse");
            gun.SetLongDescription("\nThis is a terribly worn lance made from metal and dragun peices. It seems to have been forged as an attempt to relive adventures of a diffrent time. However, since this is the gungeon, this lance has been equipt with rocket bosters to avoid Kaliber's curse. \n\n");

            // 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, "lnc_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, 2);
            // 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("camera_gun", true, true);

            // Here we just take the default projectile module and change its settings how we want it to be.
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass                          = GunClass.SILLY;
            gun.gunHandedness                     = GunHandedness.HiddenOneHanded;
            gun.InfiniteAmmo                      = true;
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime                        = 0f;
            gun.DefaultModule.numberOfShotsInClip = int.MaxValue;
            gun.DefaultModule.cooldownTime        = .001f;
            gun.muzzleFlashEffects.type           = VFXPoolType.None;

            gun.quality = PickupObject.ItemQuality.C;
            gun.encounterTrackable.EncounterGuid = "Big Pokey STICK!";
            //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 projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            gun.barrelOffset.transform.localPosition = new Vector3(3.1875f, .5f, 0f);
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            //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.
            projectile.baseData.damage          = 5f;
            projectile.baseData.speed          *= .20f;
            projectile.baseData.range           = .00001f;
            projectile.PlayerKnockbackForce     = -9f;
            projectile.AppliesKnockbackToPlayer = true;
            projectile.baseData.force           = 45;
            projectile.AppliesStun         = true;
            projectile.AppliedStunDuration = .2f;
            projectile.StunApplyChance     = 1;


            projectile.transform.parent = gun.barrelOffset;



            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Greek Fire", "greekfire");

            Game.Items.Rename("outdated_gun_mods:greek_fire", "nn:greek_fire");
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup;
            gun.SetShortDescription("Fire of Man");
            gun.SetLongDescription("Used by ancient civilisations as a primitive flamethrower." + "\n\nThe potent chemical mixture used to create the flames makes it remarkably dangerous.");
            gun.SetupSprite(null, "greekfire_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.chargeAnimation, 3);

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

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.Charged;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 1f;
                mod.angleVariance       = 20f;
                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           *= 5f;
                projectile.AdditionalScaleMultiplier *= 2f;
                projectile.baseData.range            *= 0.5f;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
                PrefabStatusEffectsToApply statusE = projectile.gameObject.AddComponent <PrefabStatusEffectsToApply>();
                statusE.effects = new List <GameActorEffect>()
                {
                    StaticStatusEffects.greenFireEffect
                };
                if (projectile.gameObject.GetComponent <GoopModifier>())
                {
                    Destroy(projectile.gameObject.GetComponent <GoopModifier>());
                }
                GoopModifier goopSpawned = projectile.gameObject.AddComponent <GoopModifier>();
                goopSpawned.SpawnGoopOnCollision   = true;
                goopSpawned.InFlightSpawnFrequency = 0.05f;
                goopSpawned.InFlightSpawnRadius    = 0.5f;
                goopSpawned.SpawnGoopInFlight      = true;
                goopSpawned.CollisionSpawnRadius   = 3f;
                goopSpawned.goopDefinition         = EasyGoopDefinitions.GreenFireDef;
                PierceProjModifier orAddComponent = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                orAddComponent.penetratesBreakables = true;
                orAddComponent.penetration++;
                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f,
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(65);
            gun.quality  = PickupObject.ItemQuality.B;
            gun.gunClass = GunClass.FIRE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 1;

            gun.encounterTrackable.EncounterGuid = "this is Greek Fire";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(1.37f, 0.37f, 0f);
            GreekFireID = gun.PickupObjectId;
        }
Ejemplo n.º 8
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("boneblaster", "boneblaster");

            // "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:boneblaster", "cak:boneblaster");
            gun.gameObject.AddComponent <boneblaster>();
            //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("Megalovanity");
            gun.SetLongDescription("A gungeoneer reduced to only bone and determination once used this as his weapon.");
            // 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, "boneblaster_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, 6);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            // 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(PickupObjectDatabase.GetById(812) as Gun, true, false);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(383) as Gun, true, false);
            // Here we just take the default projectile module and change its settings how we want it to be.
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2;
            gun.DefaultModule.cooldownTime        = 0.1f;
            gun.DefaultModule.numberOfShotsInClip = 10;
            gun.SetBaseMaxAmmo(1500);
            gun.DefaultModule.angleVariance = 0f;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.SKULL;
            // 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;
            gun.encounterTrackable.EncounterGuid = "boneblaster";
            //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 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;
            gun.barrelOffset.localPosition  += new Vector3(0.3f, 0.5f, 0f);
            //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.
            projectile.baseData.damage          *= 4.5f;
            projectile.baseData.speed           *= 0.2f;
            projectile.AdditionalScaleMultiplier = 2f;
            projectile.transform.parent          = gun.barrelOffset;
            //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");
        }
Ejemplo n.º 9
0
 public static void BuildSynergyPrefab()
 {
     if (synergyPrefab == null && !CompanionBuilder.companionDictionary.ContainsKey("Synergy_Cross_Chamber"))
     {
         synergyPrefab = CompanionBuilder.BuildPrefab("Synergy Cross Chamber", "Synergy_Cross_Chamber", "LichItems/Resources/CrossChamber/IdleRight/tomb_idle_right_001", new IntVector2(0, 0), new IntVector2(14, 16));
         var           companion = synergyPrefab.AddComponent <CompanionController>();
         PixelCollider collider  = new PixelCollider();
         collider.ColliderGenerationMode = PixelCollider.PixelColliderGeneration.Manual;
         collider.CollisionLayer         = CollisionLayer.PlayerHitBox;
         collider.ManualWidth            = 14;
         collider.ManualHeight           = 16;
         collider.ManualOffsetX          = 0;
         collider.ManualOffsetY          = 0;
         KnockbackDoer knockback = companion.gameObject.GetOrAddComponent <KnockbackDoer>();
         knockback.weight = 100f;
         companion.aiActor.IsNormalEnemy = false;
         companion.CanInterceptBullets   = true;
         companion.specRigidbody.PrimaryPixelCollider.CollisionLayer = CollisionLayer.PlayerCollider;
         companion.specRigidbody.PixelColliders.Add(collider);
         companion.gameObject.AddComponent <IgnoreEnemyCollisions>();
         companion.specRigidbody.AddCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.EnemyHitBox));
         companion.specRigidbody.AddCollisionLayerIgnoreOverride(CollisionMask.LayerToMask(CollisionLayer.EnemyCollider));
         companion.specRigidbody.CollideWithOthers = true;
         companion.aiActor.CollisionDamage         = 0f;
         companion.aiActor.MovementSpeed           = 3f;
         companion.aiActor.CanDropCurrency         = false;
         companion.healthHaver.PreventAllDamage    = false;
         GameObject gunAttachPointObject = new GameObject("GunAttachPoint");
         FakePrefab.MarkAsFakePrefab(gunAttachPointObject);
         UnityEngine.Object.DontDestroyOnLoad(gunAttachPointObject);
         Transform gunAttachPoint = gunAttachPointObject.transform;
         gunAttachPoint.parent        = synergyPrefab.transform;
         gunAttachPoint.localPosition = new Vector3(-0.1250f, 0.3125f, 0f);
         GameObject hand = SpriteBuilder.SpriteFromResource("LichItems/Resources/CrossChamber/Hand/hand_001", new GameObject("SynergyCrossChamberHand"));
         FakePrefab.MarkAsFakePrefab(hand);
         UnityEngine.Object.DontDestroyOnLoad(hand);
         LichsBookItem.ConstructOffsetsFromAnchor(hand.GetComponent <tk2dBaseSprite>().GetCurrentSpriteDef(), tk2dBaseSprite.Anchor.MiddleCenter);
         PlayerHandController handController = hand.AddComponent <PlayerHandController>();
         handController.ForceRenderersOff = false;
         handController.attachPoint       = null;
         handController.handHeightFromGun = 0.05f;
         SetupBasicAIShooter(synergyPrefab, 38 /*38 is the id of magnum*/, gunAttachPoint, hand);
         synergyPrefab.AddAnimation("idle_right", "LichItems/Resources/CrossChamber/IdleRight", 4, AnimationType.Idle, DirectionType.TwoWayHorizontal);
         synergyPrefab.AddAnimation("idle_left", "LichItems/Resources/CrossChamber/IdleLeft", 4, AnimationType.Idle, DirectionType.TwoWayHorizontal);
         synergyPrefab.AddAnimation("run_right", "LichItems/Resources/CrossChamber/MoveRight", 10, AnimationType.Move, DirectionType.TwoWayHorizontal);
         synergyPrefab.AddAnimation("run_left", "LichItems/Resources/CrossChamber/MoveLeft", 10, AnimationType.Move, DirectionType.TwoWayHorizontal);
         synergyPrefab.AddAnimation("hit_left", "LichItems/Resources/CrossChamber/HitLeft", 6, AnimationType.Hit, DirectionType.TwoWayHorizontal).wrapMode   = tk2dSpriteAnimationClip.WrapMode.Once;
         synergyPrefab.AddAnimation("hit_right", "LichItems/Resources/CrossChamber/HitRight", 6, AnimationType.Hit, DirectionType.TwoWayHorizontal).wrapMode = tk2dSpriteAnimationClip.WrapMode.Once;
         BehaviorSpeculator component = CrossChamber.synergyPrefab.GetComponent <BehaviorSpeculator>();
         component.MovementBehaviors.Add(new CompanionFollowPlayerBehavior
         {
             IdleAnimations = new string[]
             {
                 "idle"
             },
             DisableInCombat = false
         });
         component.TargetBehaviors = new List <TargetBehaviorBase>
         {
             new TargetPlayerBehavior
             {
                 Radius              = 35f,
                 LineOfSight         = true,
                 ObjectPermanence    = true,
                 SearchInterval      = 0.25f,
                 PauseOnTargetSwitch = false,
                 PauseTime           = 0.25f
             }
         };
         component.AttackBehaviors = new List <AttackBehaviorBase>
         {
             new ShootGunBehavior()
             {
                 GroupCooldownVariance        = -1f,
                 LineOfSight                  = true,
                 WeaponType                   = WeaponType.AIShooterProjectile,
                 OverrideBulletName           = "default",
                 BulletScript                 = null,
                 FixTargetDuringAttack        = false,
                 StopDuringAttack             = false,
                 LeadAmount                   = 0f,
                 LeadChance                   = 1f,
                 RespectReload                = true,
                 MagazineCapacity             = 6,
                 ReloadSpeed                  = 2f,
                 EmptiesClip                  = false,
                 SuppressReloadAnim           = false,
                 TimeBetweenShots             = -1f,
                 PreventTargetSwitching       = false,
                 OverrideAnimation            = string.Empty,
                 OverrideDirectionalAnimation = string.Empty,
                 HideGun                      = false,
                 UseLaserSight                = false,
                 UseGreenLaser                = false,
                 PreFireLaserTime             = -1f,
                 AimAtFacingDirectionWhenSafe = false
             }
         };
         AIBulletBank bulletBank = synergyPrefab.GetOrAddComponent <AIBulletBank>();
         bulletBank.Bullets = new List <AIBulletBank.Entry>
         {
             new AIBulletBank.Entry()
             {
                 Name = "default",
                 OverrideProjectile = true,
                 ProjectileData     = new ProjectileData()
                 {
                     damage  = 10f,
                     speed   = 16f,
                     range   = 60f,
                     force   = 20f,
                     damping = 0f,
                     UsesCustomAccelerationCurve     = false,
                     AccelerationCurve               = null,
                     CustomAccelerationCurveDuration = 0f,
                     IgnoreAccelCurveTime            = 0f,
                     onDestroyBulletScript           = null
                 },
                 BulletObject = null
             }
         };
         bulletBank.useDefaultBulletIfMissing = false;
         bulletBank.transforms = new List <Transform>
         {
             synergyPrefab.transform
         };
         bulletBank.rampBullets                   = false;
         bulletBank.rampStartHeight               = 0f;
         bulletBank.rampTime                      = 0f;
         bulletBank.OverrideGun                   = null;
         bulletBank.OnProjectileCreated           = null;
         bulletBank.OnProjectileCreatedWithSource = null;
         bulletBank.FixedPlayerPosition           = null;
     }
 }
Ejemplo n.º 10
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("Maw of Vog", "Maw");

            // "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:maw_of_vog", "ski:maw_of_vog");
            gun.gameObject.AddComponent <Maw>();
            //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("Through the fire and flames");
            gun.SetLongDescription("This blade was forged with the blessing of the bullet hell's canine gaurdian, Vog. The blade is very much alive acting as a cub of vog normaly would, reacting to danger and reveling in a good hunt. \n" +
                                   "This blade functions better while it is heated, swinging faster and without ceasing. \n" +
                                   "Weilders of the blade are protected, but not immune to the fires it makes" +
                                   "\n" +
                                   "Charge for ring of fire.\n" +
                                   "Statbuffs while on fire" +
                                   "\n\n\n - Knife_to_a_Gunfight");;


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

            gun.SetAnimationFPS(gun.chargeAnimation, 7);
            gun.SetAnimationFPS(gun.shootAnimation, 20);
            gun.SetAnimationFPS(gun.reloadAnimation, 4);

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetByEncounterName("Hegemony Rifle") as Gun, true, false);
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 9;



            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.OneHanded;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;

            gun.reloadTime = 2f;
            gun.DefaultModule.numberOfShotsInClip = 5;
            gun.DefaultModule.cooldownTime        = .5f;



            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.A;
            gun.encounterTrackable.EncounterGuid = "BURN BABY BURN!";

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

            gun.barrelOffset.transform.localPosition = new Vector3(1f, .5f, 0f);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "finished big";


            gun.muzzleFlashEffects = null;



            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 9f;
            projectile.baseData.speed        = 3f;
            projectile.baseData.range        = 3f;
            projectile.baseData.force        = 5;

            projectile.AppliesFire     = true;
            projectile.FireApplyChance = 100f;



            //Hot HOT HOT
            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

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

            projectile2.name = "shelling";



            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = 0f,
                AmmoCost   = 0,
            };
            ProjectileModule.ChargeProjectile item2 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile2,
                ChargeTime = 1.5f,
            };

            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item,
                item2,
            };

            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("Maw_reload");

            float[] offsetsX = new float[] { -.3f, -.4f, -.4f, -.4f, -.4f };
            float[] offsetsY = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, -0.0f };

            for (int i = 0; i < offsetsX.Length && i < offsetsY.Length && i < fireClip.frames.Length; i++)
            {
                int id = fireClip.frames[i].spriteId;
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY[i];
            }

            tk2dSpriteAnimationClip fireClip2 = gun.sprite.spriteAnimator.GetClipByName("Maw_fire");

            float[] offsetsX2 = new float[] { .1f, .4f, .3f, .2f, .0f };
            float[] offsetsY2 = new float[] { 1.2f, .5f, .3f, -1.2f, -.6f };

            for (int i = 0; i < offsetsX2.Length && i < offsetsY2.Length && i < fireClip2.frames.Length; i++)
            {
                int id = fireClip2.frames[i].spriteId;
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY2[i];
            }


            tk2dSpriteAnimationClip fireClip3 = gun.sprite.spriteAnimator.GetClipByName("Maw_charge");

            float[] offsetsX3 = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.6f, -0.7f, -0.7f };
            float[] offsetsY3 = new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.0f };

            for (int i = 0; i < offsetsX3.Length && i < offsetsY3.Length && i < fireClip3.frames.Length; i++)
            {
                int id = fireClip3.frames[i].spriteId;
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX3[i];
                fireClip3.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY3[i];
            }



            projectile.transform.parent = gun.barrelOffset;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
        public static void InitPrefabs(AssetBundle expandSharedAssets1)
        {
            List <string> m_DoorOpenSprites = new List <string>()
            {
                "EXSecretDoor_Open_00",
                "EXSecretDoor_Open_01",
                "EXSecretDoor_Open_02",
                "EXSecretDoor_Open_03",
                "EXSecretDoor_Open_04",
                "EXSecretDoor_Open_05",
                "EXSecretDoor_Open_06",
                "EXSecretDoor_Open_07"
            };

            List <string> m_DoorCloseSprites = new List <string>()
            {
                "EXSecretDoor_Close_00",
                "EXSecretDoor_Close_01",
                "EXSecretDoor_Close_02",
                "EXSecretDoor_Close_03",
                "EXSecretDoor_Close_04",
                "EXSecretDoor_Close_05",
                "EXSecretDoor_Close_06",
                "EXSecretDoor_Close_07",
            };

            EXSecretDoorMinimapIcon = expandSharedAssets1.LoadAsset <GameObject>("EXSecretDoor_MinimapIcon");
            ItemBuilder.AddSpriteToObject(EXSecretDoorMinimapIcon, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_MinimapIcon"), false, false);

            EXSecretDoor                               = expandSharedAssets1.LoadAsset <GameObject>("EX Secret Door Entrance");
            EXSecretDoor_Frame_Top                     = EXSecretDoor.transform.Find("EX Secret Door Top").gameObject;
            EXSecretDoor_Frame_Bottom                  = EXSecretDoor.transform.Find("EX Secret Door Bottom").gameObject;
            EXSecretDoor_Background                    = EXSecretDoor.transform.Find("EX Secret Door Background").gameObject;
            EXSecretDoor_Light                         = EXSecretDoor.transform.Find("EX Secret Door Light").gameObject;
            EXSecretDoor_Frame_Top.layer               = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Frame_Bottom.layer            = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Background.layer              = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Light.layer                   = LayerMask.NameToLayer("FG_Critical");
            EXSecretDoor_Frame_Top.transform.parent    = EXSecretDoor.transform;
            EXSecretDoor_Frame_Bottom.transform.parent = EXSecretDoor.transform;
            EXSecretDoor_Background.transform.parent   = EXSecretDoor.transform;
            EXSecretDoor_Light.transform.parent        = EXSecretDoor.transform;

            ItemBuilder.AddSpriteToObject(EXSecretDoor, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Open_00"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Frame_Top, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Frame_Top"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Frame_Bottom, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Frame_Bottom"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Background, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Background"), false, false);
            ItemBuilder.AddSpriteToObject(EXSecretDoor_Light, expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Light_Red"), false, false);


            tk2dSprite m_DoorBorderTopSprite = EXSecretDoor_Frame_Top.GetComponent <tk2dSprite>();

            m_DoorBorderTopSprite.HeightOffGround = 3;
            SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Frame_NoDecal_Top"), m_DoorBorderTopSprite.Collection);

            tk2dSprite m_DoorBorderBottomSprite = EXSecretDoor_Frame_Bottom.GetComponent <tk2dSprite>();

            m_DoorBorderBottomSprite.HeightOffGround = -0.5f;

            tk2dSprite m_DoorSprite = EXSecretDoor.GetComponent <tk2dSprite>();

            m_DoorSprite.HeightOffGround = -1.5f;

            tk2dSprite m_DoorBackgroundSprite = EXSecretDoor_Background.GetComponent <tk2dSprite>();

            m_DoorBackgroundSprite.HeightOffGround = -2f;

            tk2dSprite m_DoorLightSprite = EXSecretDoor_Light.GetComponent <tk2dSprite>();

            m_DoorLightSprite.HeightOffGround = 3.5f;

            SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>("EXSecretDoor_Light_Green"), m_DoorLightSprite.Collection);

            foreach (string spriteName in m_DoorOpenSprites)
            {
                if (spriteName != "EXSecretDoor_Open_00")
                {
                    SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>(spriteName), m_DoorSprite.Collection);
                }
            }
            foreach (string spriteName in m_DoorCloseSprites)
            {
                SpriteBuilder.AddSpriteToCollection(expandSharedAssets1.LoadAsset <Texture2D>(spriteName), m_DoorSprite.Collection);
            }

            ExpandUtility.GenerateSpriteAnimator(EXSecretDoor, ClipFps: 10);

            tk2dSpriteAnimator m_DoorAnimator = EXSecretDoor.GetComponent <tk2dSpriteAnimator>();

            ExpandUtility.AddAnimation(m_DoorAnimator, m_DoorSprite.Collection, m_DoorOpenSprites, "door_open", frameRate: 10);
            ExpandUtility.AddAnimation(m_DoorAnimator, m_DoorSprite.Collection, m_DoorCloseSprites, "door_close", frameRate: 10);

            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 64), offset: new IntVector2(16, 0));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.HighObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 14));
            ExpandUtility.GenerateOrAddToRigidBody(EXSecretDoor, CollisionLayer.LowObstacle, PixelCollider.PixelColliderGeneration.Manual, CanBeCarried: false, IsTrigger: true, UsesPixelsAsUnitSize: true, dimensions: new IntVector2(32, 32), offset: new IntVector2(16, 12));

            ExpandSecretDoorPlacable m_SecretDoorComponent = EXSecretDoor.AddComponent <ExpandSecretDoorPlacable>();

            m_SecretDoorComponent.DoorTopBorderObject    = EXSecretDoor_Frame_Top;
            m_SecretDoorComponent.DoorBottomBorderObject = EXSecretDoor_Frame_Bottom;
            m_SecretDoorComponent.DoorBackgroundObject   = EXSecretDoor_Background;
            m_SecretDoorComponent.DoorLightObject        = EXSecretDoor_Light;

            GameObject m_RatLock = ExpandPrefabs.RatJailDoorPlacable.gameObject.GetComponent <InteractableDoorController>().WorldLocks[0].gameObject;

            EXSecretDoor_Lock = EXSecretDoor.transform.Find("EX Secret Door Lock").gameObject;
            tk2dSprite EXLockSprite = EXSecretDoor_Lock.AddComponent <tk2dSprite>();

            ExpandUtility.DuplicateSprite(EXLockSprite, m_RatLock.GetComponent <tk2dSprite>());
            EXLockSprite.HeightOffGround = -0.3f;

            tk2dSpriteAnimator m_EXLockAnimator = ExpandUtility.DuplicateSpriteAnimator(EXSecretDoor_Lock, m_RatLock.GetComponent <tk2dSpriteAnimator>(), true);

            InteractableLock m_EXLock = EXSecretDoor_Lock.AddComponent <InteractableLock>();

            m_EXLock.Suppress       = m_RatLock.GetComponent <InteractableLock>().Suppress;
            m_EXLock.lockMode       = InteractableLock.InteractableLockMode.RESOURCEFUL_RAT;
            m_EXLock.JailCellKeyId  = m_RatLock.GetComponent <InteractableLock>().JailCellKeyId;
            m_EXLock.IdleAnimName   = m_RatLock.GetComponent <InteractableLock>().IdleAnimName;
            m_EXLock.UnlockAnimName = m_RatLock.GetComponent <InteractableLock>().UnlockAnimName;
            m_EXLock.NoKeyAnimName  = m_RatLock.GetComponent <InteractableLock>().NoKeyAnimName;
            m_EXLock.SpitAnimName   = m_RatLock.GetComponent <InteractableLock>().SpitAnimName;
            m_EXLock.BustedAnimName = m_RatLock.GetComponent <InteractableLock>().BustedAnimName;

            m_SecretDoorComponent.Lock = m_EXLock;
            EXSecretDoor_Lock.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));

            EXSecretDoorDestination      = UnityEngine.Object.Instantiate(EXSecretDoor);
            EXSecretDoorDestination.name = "EX Secret Door (Exit)";
            ExpandSecretDoorExitPlacable m_ExitDoorComponent = EXSecretDoorDestination.AddComponent <ExpandSecretDoorExitPlacable>();

            m_ExitDoorComponent.MinimapIcon = ExpandPrefabs.exit_room_basic.associatedMinimapIcon;

            m_ExitDoorComponent.DoorBackgroundObject   = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorBackgroundObject;
            m_ExitDoorComponent.DoorBottomBorderObject = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorBottomBorderObject;
            m_ExitDoorComponent.DoorLightObject        = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorLightObject;
            m_ExitDoorComponent.DoorTopBorderObject    = EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().DoorTopBorderObject;
            UnityEngine.Object.Destroy(EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>().Lock.gameObject);
            UnityEngine.Object.Destroy(EXSecretDoorDestination.GetComponent <ExpandSecretDoorPlacable>());


            Dungeon    Base_Castle  = DungeonDatabase.GetOrLoadByName("Base_Castle");
            GameObject m_NormalLock = (Base_Castle.PatternSettings.flows[0].sharedInjectionData[1].InjectionData[0].exactRoom.placedObjects[0].nonenemyBehaviour as SecretFloorInteractableController).WorldLocks[0].gameObject;

            // Setup copy with no rat decal and normal lock instead of rat lock. A general purpose version of the Mini-Elevator.
            EXSecretDoor_Normal      = UnityEngine.Object.Instantiate(EXSecretDoor);
            EXSecretDoor_Normal.name = "EX Secret Door 2 (Entrance)";

            Vector3 Lock2PositionOffset = (EXSecretDoor_Normal.transform.position + new Vector3(1.22f, 0.34f));

            ExpandSecretDoorPlacable m_SecretDoor2Component = EXSecretDoor_Normal.GetComponent <ExpandSecretDoorPlacable>();

            m_SecretDoor2Component.isHollowsElevator = false;
            UnityEngine.Object.Destroy(m_SecretDoor2Component.Lock.gameObject);
            m_SecretDoor2Component.DoorTopBorderObject.GetComponent <tk2dSprite>().SetSprite("EXSecretDoor_Frame_NoDecal_Top");
            GameObject m_LockObject2 = UnityEngine.Object.Instantiate(m_NormalLock, Lock2PositionOffset, Quaternion.identity);

            m_LockObject2.gameObject.SetLayerRecursively(LayerMask.NameToLayer("FG_Critical"));
            m_LockObject2.GetComponent <InteractableLock>().sprite.HeightOffGround = 1.7f;
            m_LockObject2.GetComponent <InteractableLock>().sprite.UpdateZDepth();
            // m_LockObject2.SetActive(false);
            m_LockObject2.transform.SetParent(EXSecretDoor_Normal.transform, true);
            m_SecretDoor2Component.Lock = m_LockObject2.GetComponent <InteractableLock>();


            /*m_ExitDoorComponent.DoorBackgroundObject.SetActive(false);
             * m_ExitDoorComponent.DoorBottomBorderObject.SetActive(false);
             * m_ExitDoorComponent.DoorLightObject.SetActive(false);
             * m_ExitDoorComponent.DoorTopBorderObject.SetActive(false);*/
            EXSecretDoor_Normal.SetActive(false);
            EXSecretDoorDestination.SetActive(false);
            FakePrefab.MarkAsFakePrefab(EXSecretDoor_Normal);
            FakePrefab.MarkAsFakePrefab(EXSecretDoorDestination);
            UnityEngine.Object.DontDestroyOnLoad(EXSecretDoor_Normal);
            UnityEngine.Object.DontDestroyOnLoad(EXSecretDoorDestination);

            Base_Castle  = null;
            m_NormalLock = null;
        }
Ejemplo n.º 12
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("Sydney Sleeper", "piss");

            // "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:sydney_sleeper", "cak:sydney_sleeper");
            gun.gameObject.AddComponent <SydneySleeper>();
            //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("Jarate");
            gun.SetLongDescription("Professionals have standards. Unfortunatly, whoever made this gun did not.");
            // 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, "piss_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, 20);
            gun.SetAnimationFPS(gun.reloadAnimation, 3);
            // 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(PickupObjectDatabase.GetById(12) as Gun, true, false);
            // Here we just take the default projectile module and change its settings how we want it to be.
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime                        = 0.7f;
            gun.ForceLaserSight                   = true;
            gun.LaserSightIsGreen                 = true;
            gun.CriticalChance                    = 0.05f;
            gun.DefaultModule.cooldownTime        = 0.3f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            gun.SetBaseMaxAmmo(50);

            gun.ForceLaserSight             = true;
            gun.DefaultModule.angleVariance = 0f;
            gun.barrelOffset.localPosition += new Vector3(0.5f, -0.4f, 0f);
            gun.gunSwitchGroup     = (PickupObjectDatabase.GetById(5) as Gun).gunSwitchGroup;
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(5) as Gun).muzzleFlashEffects;
            // 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.B;
            gun.encounterTrackable.EncounterGuid = "iampissgun";
            //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 projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            gun.CriticalChance = 0.1f;
            //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.
            projectile.baseData.damage *= 0.5f;
            projectile.baseData.speed  *= 1f;
            projectile.transform.parent = gun.barrelOffset;
            //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
            projectile.SetProjectileSpriteRight("piss_projectile", 14, 5, null, null);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddItemToTrorcMetaShop(100, 100);
            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.EXAMPLE_BLUEPRINTTRUCK, true);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc, 1f);
            CakeIDs.PissGun = gun.PickupObjectId;
        }
Ejemplo n.º 13
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ice Bow", "icebow");

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

            gun.SetShortDescription("Arctery");
            gun.SetLongDescription("Freezes enemies." + "\n\nFerried to the Gungeon from a remote island on the edge of civilisation.");

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

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(12) as Gun, true, false);
            gun.SetAnimationFPS(gun.chargeAnimation, 3);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(8) as Gun).gunSwitchGroup;
            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 1f;
            gun.DefaultModule.angleVariance          = 0;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(0.81f, 0.81f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo = 100;

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

            gun.carryPixelOffset = new IntVector2(10, 0);
            gun.gunClass         = GunClass.ICE;
            //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   = 17f;
            projectile.baseData.speed    = 35f;
            projectile.baseData.range   *= 2f;
            projectile.AppliesFreeze     = true;
            projectile.FreezeApplyChance = 1;
            projectile.freezeEffect      = StaticStatusEffects.chaosBulletsFreeze;
            PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            pierce.penetration++;
            pierce.penetratesBreakables = true;
            projectile.SetProjectileSpriteRight("icebow_projectile", 15, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 14, 4);

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

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Ice Bow Arrows", "NevernamedsItems/Resources/CustomGunAmmoTypes/icebow_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/icebow_clipempty");

            gun.quality = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            IceBowID = gun.PickupObjectId;
        }
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Scythe of the Jammed", "jamm_scythe");

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

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

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

            Game.Items.Rename("outdated_gun_mods:dynamite_launcher", "nn:dynamite_launcher");
            gun.gameObject.AddComponent <DynamiteLauncher>();
            gun.SetShortDescription("Dynamight makes Dynaright");
            gun.SetLongDescription("Fires a potent stick of nitroglycerin." + "\n\nCreated by mad Nitra Gunsmith, before he realised that he didn't have hands.");

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

            gun.outOfAmmoAnimation = "empty";

            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(150) 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.Random;
            gun.reloadTime = 2f;
            gun.DefaultModule.cooldownTime           = 1f;
            gun.DefaultModule.numberOfShotsInClip    = 1;
            gun.barrelOffset.transform.localPosition = new Vector3(1.56f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(40);
            gun.gunClass = GunClass.EXPLOSIVE;
            //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      *= 6f;
            projectile.baseData.speed       *= 0.4f;
            projectile.baseData.range       *= 1f;
            BounceProjModifier Bouncing = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();

            Bouncing.numberOfBounces = 1;
            ExplosiveModifier exploding = projectile.gameObject.GetOrAddComponent <ExplosiveModifier>();

            exploding.doExplosion   = true;
            exploding.explosionData = StaticExplosionDatas.customDynamiteExplosion;

            projectile.pierceMinorBreakables = true;


            projectile.AnimateProjectile(new List <string> {
                "dynamiteproj_1",
                "dynamiteproj_2",
                "dynamiteproj_3",
                "dynamiteproj_4",
            }, 8, true, new List <IntVector2> {
                new IntVector2(14, 15), //1
                new IntVector2(15, 14), //2
                new IntVector2(14, 15), //3
                new IntVector2(15, 14), //4
            }, AnimateBullet.ConstructListOfSameValues(false, 4), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4), AnimateBullet.ConstructListOfSameValues(true, 4), AnimateBullet.ConstructListOfSameValues(false, 4),
                                         AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Dynamite Launcher Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/dynamitelauncher_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/dynamitelauncher_clipempty");

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

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

            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.NITRA_QUEST_REWARDED, true);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("King Bullatterer", "kingbullatterer");

            Game.Items.Rename("outdated_gun_mods:king_bullatterer", "nn:bullatterer+king_bullatterer");
            gun.gameObject.AddComponent <Bullatterer>();
            gun.SetShortDescription("djahksdhkssdfdfssdf");
            gun.SetLongDescription("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            gun.SetupSprite(null, "kingbullatterer_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 13);
            gun.SetAnimationFPS(gun.idleAnimation, 13);
            for (int i = 0; i < 13; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) as Gun, true, false);
            }
            gun.muzzleFlashEffects.type = VFXPoolType.None;

            //GUN STATS
            gun.reloadTime = 1.5f;
            gun.barrelOffset.transform.localPosition = new Vector3(1.25f, 0.43f, 0f);
            gun.SetBaseMaxAmmo(400);
            gun.ammo = 400;

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

            bouncerProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bouncerProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bouncerProj);
            bouncerProj.baseData.damage *= 1.2f;
            bouncerProj.baseData.speed  *= 0.65f;
            bouncerProj.SetProjectileSpriteRight("yellow_enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);

            BounceProjModifier bouncing = bouncerProj.gameObject.GetOrAddComponent <BounceProjModifier>();

            bouncing.numberOfBounces = 1;

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

            bullatSpawnerProj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bullatSpawnerProj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bullatSpawnerProj);
            bullatSpawnerProj.baseData.damage        *= 0f;
            bullatSpawnerProj.sprite.renderer.enabled = false;
            bullatSpawnerProj.pierceMinorBreakables   = true;
            SpawnEnemyOnBulletSpawn orAddComponent = bullatSpawnerProj.gameObject.GetOrAddComponent <SpawnEnemyOnBulletSpawn>();

            orAddComponent.companioniseEnemy              = true;
            orAddComponent.deleteProjAfterSpawn           = true;
            orAddComponent.enemyBulletDamage              = 15f;
            orAddComponent.guidToSpawn                    = EnemyGuidDatabase.Entries["bullat"];
            orAddComponent.ignoreSpawnedEnemyForGoodMimic = true;
            orAddComponent.killSpawnedEnemyOnRoomClear    = true;
            orAddComponent.procChance                  = 1f;
            orAddComponent.scaleEnemyDamage            = true;
            orAddComponent.scaleEnemyProjSize          = true;
            orAddComponent.scaleEnemyProjSpeed         = true;
            orAddComponent.doPostProcessOnEnemyBullets = false;

            int i2 = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.numberOfShotsInClip = 15;
                mod.cooldownTime        = 0.55f;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.shootStyle          = ProjectileModule.ShootStyle.Automatic;


                if (i2 <= 0) //bullatProj
                {
                    mod.ammoCost       = 1;
                    mod.angleVariance  = 0.01f;
                    mod.angleFromAim   = 0f;
                    mod.projectiles[0] = bullatSpawnerProj;
                    i2++;
                }
                else if (i2 == 1) //0 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 0f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 2) //30 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 30f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 3) //60 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 60f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 4) //90 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 90f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 5) //120 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 120f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 6) //150 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 150f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 7) //180 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = 180f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 8) //-30 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -30f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 9) //-60 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -60f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 10) //-90 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -90f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 == 11) //-120 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -120f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
                else if (i2 >= 12) //-150 degrees
                {
                    mod.ammoCost       = 0;
                    mod.angleVariance  = 7f;
                    mod.angleFromAim   = -150f;
                    mod.projectiles[0] = bouncerProj;
                    i2++;
                }
            }

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

            KingBullattererID = gun.PickupObjectId;
        }
Ejemplo n.º 17
0
        public static void Init()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("High-Quality Gun", "hd");

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Game.Items.Rename("outdated_gun_mods:bullat_launcher", "spapi:bullat_launcher");
            GunExt.SetShortDescription(gun, "Fires Bullats");
            GunExt.SetLongDescription(gun, "Shoots angry bullats.\n\nCatching Bullats is fairly easy and every good gundead hunter has to have a Bullat collection. Frifle through had an idea to weaponize his collection, and made this gun.");
            GunExt.SetupSprite(gun, null, "batlauncher_idle_001", 16);
            GunExt.AddProjectileModuleFrom(gun, "klobb", true, false);
            gun.DefaultModule.shootStyle = ProjectileModule.ShootStyle.Charged;
            AdvancedGunBehaviour advancedGunBehaviour = gun.gameObject.AddComponent <AdvancedGunBehaviour>();

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

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

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

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

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

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

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

            StormEyeController.goopDefs = new List <GoopDefinition>();
            foreach (string text in StormEyeController.goops)
            {
                GoopDefinition goopDefinition;
                try
                {
                    GameObject gameObject2 = assetBundle.LoadAsset(text) as GameObject;
                    goopDefinition = gameObject2.GetComponent <GoopDefinition>();
                }
                catch
                {
                    goopDefinition = (assetBundle.LoadAsset(text) as GoopDefinition);
                }
                goopDefinition.name = text.Replace("assets/data/goops/", "").Replace(".asset", "");
                StormEyeController.goopDefs.Add(goopDefinition);
            }
            gun.AddToBlacksmithShop();
            gun.RemovePeskyQuestionmark();
            gun.PlaceItemInAmmonomiconAfterItemById(13);
            gun.SetupUnlockOnFlag(GungeonFlags.ACHIEVEMENT_CONSTRUCT_BULLET, true);
        }
Ejemplo n.º 20
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("Sheila LMG", "tur");

            // "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:sheila_lmg", "ski:sheila_lmg");
            gun.gameObject.AddComponent <Sheila_LMG>();
            //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("Queen of all LMGs");
            gun.SetLongDescription("This monsterous mammoth of a gun was so powerful that it can only be weilded by attaching it to a mounting brace." +
                                   "\n\n\n - Knife_to_a_Gunfight");;


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


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

            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetByEncounterName("RUBE-ADYNE prototype") as Gun, true, false);

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 6;

            gun.gunHandedness               = GunHandedness.TwoHanded;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 7f;
            gun.DefaultModule.numberOfShotsInClip = 300;
            gun.DefaultModule.cooldownTime        = .05f;
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.SPECIAL;
            gun.encounterTrackable.EncounterGuid = "She's a beaut!";

            Gun shellingFlash = (Gun)PickupObjectDatabase.GetByEncounterName("m16");

            gun.muzzleFlashEffects = shellingFlash.muzzleFlashEffects;

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

            gun.barrelOffset.transform.localPosition = new Vector3(1.8f, .5f, 0f);
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "sail";
            gun.shellsToLaunchOnFire         = 4;
            Gun gun2 = PickupObjectDatabase.GetById(84) as Gun;

            gun.shellCasing = gun2.shellCasing;


            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 6f;
            projectile.baseData.speed       *= 2f;
            projectile.baseData.range       *= 1f;
            projectile.baseData.force        = 10f;
            BounceProjModifier bnc = projectile.GetComponent <BounceProjModifier>();

            bnc.numberOfBounces = 0;


            projectile.transform.parent = gun.barrelOffset;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Ejemplo n.º 21
0
        // Token: 0x060000A0 RID: 160 RVA: 0x000063DC File Offset: 0x000045DC
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Ruinous Effigy", "syntest");

            Game.Items.Rename("outdated_gun_mods:ruinous_effigy", "bot:ruinous_effigy");
            gun.gameObject.AddComponent <RuinousEffigy>();
            gun.SetShortDescription("test");
            gun.SetLongDescription("From many wings of ruin blows a wind that will reshape this dead world.");
            GunExt.SetupSprite(gun, null, "syntest_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 24);

            //Gun component = Game.Items["shellegun"].GetComponent<Gun>();


            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(121) as Gun, true, false);
            //gun.DefaultModule.projectiles[0] = component.alternateVolley.projectiles[0].projectiles[0];
            Gun gun3 = PickupObjectDatabase.GetById(383) as Gun;

            //gun.alternateVolley = gun3.Volley;



            //gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.CUSTOM;
            //gun.DefaultModule.customAmmoType = "hammer";

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Beam;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Ordered;
            gun.reloadTime = 1.2f;

            gun.DefaultModule.cooldownTime = 0f;
            gun.InfiniteAmmo = true;
            gun.DefaultModule.numberOfShotsInClip = 7;
            gun.SetBaseMaxAmmo(0);
            //gun.gunHandedness = GunHandedness.TwoHanded;

            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            Gun gun2 = PickupObjectDatabase.GetById(145) as Gun;

            //gun.IsUndertaleGun = true;

            //gun.DefaultModule.ammoType = gun3.DefaultModule.ammoType;

            //gun.DefaultModule.customAmmoType = gun3.DefaultModule.customAmmoType;
            //gun.DefaultModule.ammoType = GameUIAmmoType.AmmoType.SKULL;
            //gun.DefaultModule.customAmmoType =

            gun.DefaultModule.angleVariance = 0f;
            gun.muzzleFlashEffects          = gun2.muzzleFlashEffects;



            //gun.DefaultModule.customAmmoType = "locrtfsf_idle_001";
            //Gun gun3 = PickupObjectDatabase.GetById(504) as Gun;

            //gun.DefaultModule.customAmmoType = gun3.CustomAmmoType;
            Guid.NewGuid().ToString();
            //gun.encounterTrackable.EncounterGuid = "why wont you work please work im going mad";
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            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.AppliesFire = false;
            var beam = projectile.gameObject.AddComponent <BasicBeamController>();

            //projectile.sprite.GetSpriteIdByName("ruinous_rffigy_beam_middle_001");
            //beam.sprite.GetSpriteIdByName("ruinous_rffigy_beam_middle_001");
            //beam.ContinueBeamArtToWall = true;
            beam.AdjustPlayerBeamTint(new Color(0.56470588235f, 0.01176470588f, 0.98823529411f), 0, 0);
            //projectile.DefaultTintColor = ;
            //projectile.HasDefaultTint = true;
            //projectile.SetBeamProjectileSpriteRight("ruinous_rffigy_beam_middle_001", 16, 16, null, null);
            //projectile.beam
            //projectile.baseData.speed *= 0.7f;
            ///	projectile.SetProjectileSpriteRight("locrtfsf_projectile_001", 7, 7, null, null);

            gunId = gun.PickupObjectId;

            gun.PlaceItemInAmmonomiconAfterItemById(563);
            gun.RemovePeskyQuestionmark();
        }
Ejemplo n.º 22
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Guneonate", "guneonate");

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

            behav.overrideNormalFireAudio   = "Play_VO_bashellisk_hiss_01";
            behav.overrideNormalReloadAudio = "Play_BOSS_bashellisk_swallow_01";
            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            gun.SetShortDescription("Babyconda");
            gun.SetLongDescription("A hatchling ammoconda, formed from fresh discarded bullet casings." + "\n\nIt seems to have self esteem issues.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.idleAnimation, 10);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);

            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.45f;
            gun.DefaultModule.angleVariance          = 0;
            gun.DefaultModule.numberOfShotsInClip    = 3;
            gun.barrelOffset.transform.localPosition = new Vector3(2.0f, 0.25f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.ammo     = 200;
            gun.gunClass = GunClass.SILLY;

            //BULLET STATS
            HelixProjectileButLessShit projectile = DataCloners.CopyFields <HelixProjectileButLessShit>(Instantiate(gun.DefaultModule.projectiles[0]));

            projectile.SpawnShadowBulletsOnSpawn = true;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage *= 2f;
            projectile.baseData.force  *= 1f;
            projectile.baseData.speed  *= 0.5f;
            projectile.baseData.range  *= 2f;
            PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            pierce.penetration++;
            pierce.penetratesBreakables = true;
            //AutoDoShadowChainOnSpawn snakeness = projectile.gameObject.GetOrAddComponent<AutoDoShadowChainOnSpawn>();

            projectile.NumberInChain = 5;
            projectile.pauseLength   = 0.05f;
            projectile.SetProjectileSpriteRight("12x12_yellowenemy_projectile", 12, 12, true, tk2dBaseSprite.Anchor.MiddleCenter, 10, 10);


            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Guneonate Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/guneonate_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/guneonate_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;

            gun.quality = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            GuneonateID = gun.PickupObjectId;
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Creates a custom chest.
        /// </summary>
        /// <param name="idleSprite">The pathway to the idle sprite. Setup like how you would do an item. Do not put an idle inside of the spritePaths list!</param>
        /// <param name="gameObjectName">The name of the chest's game object</param>
        /// <param name="hitboxOffset">The offset of the hitbox. Idk what this does but you can tinker with it if you need to.</param>
        /// <param name="hitboxDimensions">Start at the size of the chest's idle dimensions and tinker with the values until they feel right</param>
        /// <param name="spritePaths">A list of the chest's sprite paths.</param>
        /// <param name="lootTableIdsAndWeights">Uses a custom class I made called ItemAndWeight that allows me to have a list with mutliple types per item in it. Just make a list of ItemAndWeights like this: new ItemAndWeight {itemID = "the gun/passive/active's id", itemWeight = "x" (Best left at 1), itemCanHaveDupes = false/true (idk what this really means but I would add it.)}; </param>
        /// <param name="sTierChance">The chance to get an S tier item from the chest's loot pool.</param>
        /// <param name="aTierChance">The chance to get an A tier item from the chest's loot pool.</param>
        /// <param name="bTierChance">The chance to get a B tier item from the chest's loot pool.</param>
        /// <param name="cTierChance">The chance to get a C tier item from the chest's loot pool.</param>
        /// <param name="dTierChance">The chance to get a D tier item from the chest's loot pool.</param>
        /// <param name="isLocked">If the chest is locked.</param>
        /// <param name="type">If the chest is a Passive/Active chest, a Gun chest, or unspecified.</param>
        /// <param name="potentialPrefab">If you are using a RealPrefab, put it here. If you don't know what this means or aren't using one, leave this null.</param>
        public static Chest CreateChest(string idleSprite, string gameObjectName, IntVector2 hitboxOffset, IntVector2 hitboxDimensions, List <string> spritePaths, List <ItemAndWeight> lootTableIdsAndWeights, float sTierChance, float aTierChance, float bTierChance, float cTierChance, float dTierChance, ChestType type = ChestType.Unspecified, bool isLocked = true, GameObject potentialPrefab = null)
        {
            try
            {
                GameObject obj = SpriteBuilder.SpriteFromResource(idleSprite, potentialPrefab == null ? new GameObject(gameObjectName) : potentialPrefab);
                obj.SetActive(false);
                FakePrefab.MarkAsFakePrefab(obj);
                UnityEngine.Object.DontDestroyOnLoad(obj);
                tk2dSprite           sprite = obj.GetComponent <tk2dSprite>();
                SpeculativeRigidbody body   = sprite.SetUpSpeculativeRigidbody(hitboxOffset, hitboxDimensions);
                body.PrimaryPixelCollider.CollisionLayer = CollisionLayer.HighObstacle;
                tk2dSpriteAnimator animator = obj.AddComponent <tk2dSpriteAnimator>();
                animator.Library         = animator.gameObject.AddComponent <tk2dSpriteAnimation>();
                animator.Library.clips   = new tk2dSpriteAnimationClip[0];
                animator.Library.enabled = true;
                List <int> appearIds  = new List <int>();
                List <int> breakIds   = new List <int>();
                List <int> openIds    = new List <int>();
                string     zeroHpName = "";
                foreach (string text in spritePaths)
                {
                    if (text.Contains("appear"))
                    {
                        appearIds.Add(SpriteBuilder.AddSpriteToCollection(text, obj.GetComponent <tk2dBaseSprite>().Collection));
                    }
                    else if (text.Contains("break"))
                    {
                        if (text.EndsWith("001"))
                        {
                            int id = SpriteBuilder.AddSpriteToCollection(text, obj.GetComponent <tk2dBaseSprite>().Collection);
                            zeroHpName = obj.GetComponent <tk2dBaseSprite>().Collection.inst.spriteDefinitions[id].name;
                        }
                        else
                        {
                            breakIds.Add(SpriteBuilder.AddSpriteToCollection(text, obj.GetComponent <tk2dBaseSprite>().Collection));
                        }
                    }
                    else if (text.Contains("open"))
                    {
                        openIds.Add(SpriteBuilder.AddSpriteToCollection(text, obj.GetComponent <tk2dBaseSprite>().Collection));
                    }
                    else
                    {
                        appearIds.Add(SpriteBuilder.AddSpriteToCollection(text, obj.GetComponent <tk2dBaseSprite>().Collection));
                    }
                }
                appearIds.Add(sprite.spriteId);
                tk2dSpriteAnimationClip openClip = new tk2dSpriteAnimationClip {
                    name = "open", fps = 10, frames = new tk2dSpriteAnimationFrame[0]
                };
                foreach (int id in openIds)
                {
                    tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame
                    {
                        spriteId         = id,
                        spriteCollection = obj.GetComponent <tk2dBaseSprite>().Collection
                    };
                    openClip.frames = openClip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
                }
                openClip.wrapMode      = tk2dSpriteAnimationClip.WrapMode.Once;
                animator.Library.clips = animator.Library.clips.Concat(new tk2dSpriteAnimationClip[] { openClip }).ToArray();
                tk2dSpriteAnimationClip appearClip = new tk2dSpriteAnimationClip {
                    name = "appear", fps = 10, frames = new tk2dSpriteAnimationFrame[0]
                };
                foreach (int id in appearIds)
                {
                    tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame
                    {
                        spriteId         = id,
                        spriteCollection = obj.GetComponent <tk2dBaseSprite>().Collection
                    };
                    appearClip.frames = appearClip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
                }
                appearClip.wrapMode    = tk2dSpriteAnimationClip.WrapMode.Once;
                animator.Library.clips = animator.Library.clips.Concat(new tk2dSpriteAnimationClip[] { appearClip }).ToArray();
                tk2dSpriteAnimationClip breakClip = new tk2dSpriteAnimationClip {
                    name = "break", fps = 10, frames = new tk2dSpriteAnimationFrame[0]
                };
                foreach (int id in breakIds)
                {
                    tk2dSpriteAnimationFrame frame = new tk2dSpriteAnimationFrame
                    {
                        spriteId         = id,
                        spriteCollection = obj.GetComponent <tk2dBaseSprite>().Collection
                    };
                    breakClip.frames = breakClip.frames.Concat(new tk2dSpriteAnimationFrame[] { frame }).ToArray();
                }
                breakClip.wrapMode     = tk2dSpriteAnimationClip.WrapMode.Once;
                animator.Library.clips = animator.Library.clips.Concat(new tk2dSpriteAnimationClip[] { breakClip }).ToArray();
                Chest chestController = obj.AddComponent <Chest>();
                chestController.spawnCurve = new AnimationCurve
                {
                    keys = new Keyframe[] { new Keyframe {
                                                time = 0f, value = 0f, inTangent = 3.562501f, outTangent = 3.562501f
                                            }, new Keyframe {
                                                time       = 1f, value = 1.0125f, inTangent = 0.09380959f,
                                                outTangent = 0.09380959f
                                            } }
                };

                GenericLootTable Table;
                Table = UnityEngine.Object.Instantiate <GenericLootTable>(GameManager.Instance.RewardManager.ItemsLootTable);
                Table.defaultItemDrops          = new WeightedGameObjectCollection();
                Table.defaultItemDrops.elements = new List <WeightedGameObject>();
                foreach (ItemAndWeight itemAndWeight in lootTableIdsAndWeights)
                {
                    Table.defaultItemDrops.elements.Add(new WeightedGameObject()
                    {
                        pickupId = itemAndWeight.itemID,
                        weight   = itemAndWeight.itemWeight,
                        forceDuplicatesPossible = itemAndWeight.itemCanHaveDupes,
                        additionalPrerequisites = new DungeonPrerequisite[0]
                    });
                }
                chestController.openAnimName   = "open";
                chestController.spawnAnimName  = "appear";
                chestController.majorBreakable = obj.AddComponent <MajorBreakable>();
                chestController.majorBreakable.spriteNameToUseAtZeroHP         = zeroHpName;
                chestController.majorBreakable.usesTemporaryZeroHitPointsState = true;
                chestController.breakAnimName = "break";
                chestController.VFX_GroundHit = new GameObject("example thingy");
                chestController.VFX_GroundHit.transform.parent = chestController.transform;
                chestController.VFX_GroundHit.SetActive(false);
                chestController.groundHitDelay      = 5f;
                chestController.overrideMimicChance = 0f;
                chestController.lootTable           = new LootData();
                chestController.lootTable.lootTable = Table;
                chestController.lootTable.S_Chance  = sTierChance;
                chestController.lootTable.A_Chance  = aTierChance;
                chestController.lootTable.B_Chance  = bTierChance;
                chestController.lootTable.C_Chance  = cTierChance;
                chestController.lootTable.D_Chance  = dTierChance;
                switch (type)
                {
                case ChestType.Unspecified:
                    chestController.ChestType = Chest.GeneralChestType.UNSPECIFIED;
                    break;

                case ChestType.PassiveActive:
                    chestController.ChestType = Chest.GeneralChestType.ITEM;
                    break;

                case ChestType.Gun:
                    chestController.ChestType = Chest.GeneralChestType.WEAPON;
                    break;
                }
                chestController.IsLocked = isLocked;
                return(chestController);
            }
            catch (Exception e)
            {
                ETGModConsole.Log("Something BROKE when making a chestController! Error is: " + e.ToString());
                return(null);
            }
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Mantid Augment", "mantidaugment");

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

            behav.preventNormalFireAudio = true;

            gun.SetShortDescription("Flashy and Lethal");
            gun.SetLongDescription("A cybernetic augment concealed in the forearm, this cruel blade extends to slash at your enemies with inhuman speed.");

            gun.SetupSprite(null, "mantidaugment_idle_001", 8);
            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);
            gun.AddCurrentGunStatModifier(PlayerStats.StatType.MovementSpeed, 1f, StatModifier.ModifyMethod.ADDITIVE);
            gun.SetAnimationFPS(gun.shootAnimation, 20);
            gun.SetAnimationFPS(gun.reloadAnimation, 12);

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

            //GUN STATS
            gun.gunHandedness               = GunHandedness.HiddenOneHanded;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.BEAM;
            gun.reloadTime = 1f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.cooldownTime           = 0.01f;
            gun.DefaultModule.numberOfShotsInClip    = 100;
            gun.barrelOffset.transform.localPosition = new Vector3(1.56f, 0.56f, 0f);
            gun.SetBaseMaxAmmo(2077);
            gun.ammo     = 2077;
            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        *= 2f;
            projectile.baseData.force         *= 0.5f;
            projectile.sprite.renderer.enabled = false;
            NoCollideBehaviour nocollide = projectile.gameObject.AddComponent <NoCollideBehaviour>();

            nocollide.worksOnEnemies     = true;
            nocollide.worksOnProjectiles = true;
            projectile.specRigidbody.CollideWithTileMap = false;
            ProjectileSlashingBehaviour slashing = projectile.gameObject.AddComponent <ProjectileSlashingBehaviour>();

            slashing.DestroyBaseAfterFirstSlash          = true;
            slashing.SlashDamageUsesBaseProjectileDamage = true;
            slashing.slashParameters        = new SlashData();
            slashing.slashParameters.hitVFX = (PickupObjectDatabase.GetById(369) as Gun).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.tileMapVertical;

            gun.DefaultModule.projectiles[0] = projectile;

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

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            MantidAugmentID = gun.PickupObjectId;
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Pandephonium", "pandephonium");

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

            gun.SetShortDescription("Chaostric Melody");
            gun.SetLongDescription("The bullets from this peculiar brass shotgun seem to want revenge against their creator. Even though they can't do any real harm, this won't stop them trying.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 15);

            gun.barrelOffset.transform.localPosition = new Vector3(3.37f, 0.93f, 0f);

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

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

            twentyDamageProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(twentyDamageProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(twentyDamageProjectile);
            twentyDamageProjectile.baseData.damage = 3.5f;
            twentyDamageProjectile.baseData.speed *= 1f;
            twentyDamageProjectile.baseData.range *= 100f;
            twentyDamageProjectile.gameObject.AddComponent <PandephoniumBounce>();
            twentyDamageProjectile.AdditionalScaleMultiplier *= 0.5f;

            int i2 = 1;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.numberOfShotsInClip = 3;
                mod.cooldownTime        = 0.5f;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;


                if (i2 < 5)
                {
                    float offsetStart = 0.2f;
                    offsetStart       *= i2;
                    mod.positionOffset = new Vector2(0, -offsetStart);
                }
                else if (i2 > 5)
                {
                    float offsetStart = 0.2f;
                    offsetStart       *= (i2 - 5);
                    mod.positionOffset = new Vector2(0, offsetStart);
                }
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                mod.angleVariance  = 0f;
                mod.projectiles[0] = twentyDamageProjectile;
                i2++;
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(200);
            gun.gunClass = GunClass.SHOTGUN;
            gun.quality  = PickupObject.ItemQuality.B;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            PandephoniumID = gun.PickupObjectId;
        }
Ejemplo n.º 26
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("O'Brien Fist", "obrienfist");

            Game.Items.Rename("outdated_gun_mods:o'brien_fist", "nn:obrien_fist");
            gun.gameObject.AddComponent <OBrienFist>();
            gun.SetShortDescription("Bathe In the Fire");
            gun.SetLongDescription("The limb of a lumbering tortured golem who sought the Gungeon to sate his bloodlust." + "\n\nYour enemies will run, or face your rage.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 16);

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

            //GUN STATS
            gun.gunHandedness               = GunHandedness.HiddenOneHanded;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.08f;
            gun.DefaultModule.angleVariance          = 7;
            gun.muzzleFlashEffects                   = (PickupObjectDatabase.GetById(23) as Gun).muzzleFlashEffects;
            gun.DefaultModule.numberOfShotsInClip    = 30;
            gun.barrelOffset.transform.localPosition = new Vector3(17f / 16f, 2f / 16f, 0f);
            gun.SetBaseMaxAmmo(500);
            gun.ammo     = 500;
            gun.gunClass = GunClass.FULLAUTO;

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

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

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

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

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

            splitter.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(splitter.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(splitter);
            splitter.sprite.renderer.enabled = false;
            SneakyShotgunComponent sneakyShot = splitter.gameObject.GetOrAddComponent <SneakyShotgunComponent>();

            sneakyShot.eraseSource               = true;
            sneakyShot.doVelocityRandomiser      = true;
            sneakyShot.postProcess               = true;
            sneakyShot.projPrefabToFire          = flame;
            sneakyShot.scaleOffOwnerAccuracy     = true;
            sneakyShot.numToFire                 = 6;
            sneakyShot.angleVariance             = 45f;
            sneakyShot.overrideProjectileSynergy = "The Green Room Pale";
            sneakyShot.synergyProjectilePrefab   = flame2;

            gun.DefaultModule.finalProjectile             = splitter;
            gun.DefaultModule.usesOptionalFinalProjectile = true;
            gun.DefaultModule.numberOfFinalProjectiles    = 1;

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            ID = gun.PickupObjectId;
        }
Ejemplo n.º 27
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.

            GunExt.AddProjectileModuleFrom(gun, "AK-47", true, true);

            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0f;
            gun.gunClass   = GunClass.SILLY;
            gun.reloadTime = 1f;
            gun.DefaultModule.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.cooldownTime        = 1f;
            gun.DefaultModule.numberOfShotsInClip = 20;
            gun.InfiniteAmmo = true;
            gun.SetBaseMaxAmmo(1000);
            // 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.B;
            gun.encounterTrackable.EncounterGuid = "Debug.logError('frick');";
            //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 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 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.
            projectile.baseData.damage = 1f;
            projectile.baseData.speed *= 1f;
            projectile.baseData.range  = .001f;
            projectile.baseData.force  = 0f;

            projectile.pierceMinorBreakables = true;

            projectile.transform.parent = gun.barrelOffset;


            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Ejemplo n.º 28
0
 public static void MakeFakePrefab(this GameObject target)
 {
     target.SetActive(false);
     FakePrefab.MarkAsFakePrefab(target);
     UnityEngine.Object.DontDestroyOnLoad(target);
 }
Ejemplo n.º 29
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Rusty Shotgun", "rustyshotgun");

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

            gun.SetShortDescription("Past It's Prime");
            gun.SetLongDescription("This shotgun was cast aside to rust in a gutter years ago. Some of it's shots never even manage to fire!" + "\n\nPerhaps it just needs an understanding user to let it shine.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 13);
            gun.SetAnimationFPS(gun.idleAnimation, 5);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(51) as Gun).gunSwitchGroup;

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

            //GUN STATS
            int iterator = 0;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.5f;
                mod.angleVariance       = 20f;
                mod.numberOfShotsInClip = 3;
                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.range *= 0.7f;
                projectile.baseData.damage = 8f;
                if (iterator.isEven())
                {
                    BounceProjModifier Bouncing = projectile.gameObject.GetOrAddComponent <BounceProjModifier>();
                    Bouncing.numberOfBounces = 1;
                }
                else
                {
                    PierceProjModifier pierce = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                    pierce.penetration = 1;
                }
                InstantDestroyProjOnSpawn death = projectile.gameObject.AddComponent <InstantDestroyProjOnSpawn>();
                death.chance = 0.25f;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
                iterator++;
            }

            gun.reloadTime = 1.5f;
            gun.barrelOffset.transform.localPosition = new Vector3(2.0f, 0.62f, 0f);
            gun.SetBaseMaxAmmo(200);
            gun.gunClass = GunClass.SHOTGUN;
            //BULLET STATS
            gun.quality = PickupObject.ItemQuality.D;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            gun.Volley.UsesShotgunStyleVelocityRandomizer = true;

            RustyShotgunID = gun.PickupObjectId;
            gun.SetupUnlockOnCustomStat(CustomTrackedStats.RUSTY_ITEMS_STOLEN, 0, DungeonPrerequisite.PrerequisiteOperation.GREATER_THAN);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Pillarocket", "pillarocket");

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

            behav.preventNormalFireAudio    = true;
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalFireAudio   = "Play_ENM_statue_stomp_01";
            behav.overrideNormalReloadAudio = "Play_ENM_statue_charge_01";
            gun.SetShortDescription("Ancient Shrine");
            gun.SetLongDescription("Fires vengeful effigies, under your command." + "\n\nInhabited by the souls of ancient gundead heroes.");

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


            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(37) as Gun).gunSwitchGroup;
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(39) as Gun, true, false);

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 4f;
            gun.DefaultModule.cooldownTime        = 2f;
            gun.DefaultModule.angleVariance       = 20;
            gun.DefaultModule.numberOfShotsInClip = 4;
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(372) as Gun).muzzleFlashEffects;
            gun.barrelOffset.transform.localPosition = new Vector3(2.18f, 1.68f, 0f);
            gun.SetBaseMaxAmmo(30);
            gun.ammo = 30;

            //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.speed        = 6.5f;
            projectile.baseData.damage       = 80f;
            projectile.baseData.range        = 100;
            projectile.baseData.force        = 10;
            projectile.pierceMinorBreakables = true;
            RemoteBulletsProjectileBehaviour remote = projectile.gameObject.GetOrAddComponent <RemoteBulletsProjectileBehaviour>();

            remote.trackingTime = 1000;
            PillarocketFiring firing = projectile.gameObject.GetOrAddComponent <PillarocketFiring>();

            projectile.AnimateProjectile(new List <string> {
                "pillarocket_proj_001",
                "pillarocket_proj_002",
                "pillarocket_proj_003",
                "pillarocket_proj_004",
                "pillarocket_proj_005",
                "pillarocket_proj_006",
                "pillarocket_proj_007",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_008",
                "pillarocket_proj_009",
                "pillarocket_proj_010",
                "pillarocket_proj_011",
                "pillarocket_proj_012",
                "pillarocket_proj_013",
                "pillarocket_proj_014",
            }, 20,                                                                                                        //FPS
                                         true,                                                                            //LOOPS
                                         AnimateBullet.ConstructListOfSameValues <IntVector2>(new IntVector2(15, 8), 20), //PIXELSIZES
                                         AnimateBullet.ConstructListOfSameValues(false, 20),                              //LIGHTENEDS
                                         AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleLeft, 20),   //ANCHORS
                                         AnimateBullet.ConstructListOfSameValues(false, 20),                              //ANCHORSCHANGECOLLIDERS
                                         AnimateBullet.ConstructListOfSameValues(false, 20),
                                         AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 20),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(new IntVector2(15, 6), 20),
                                         AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 20),
                                         AnimateBullet.ConstructListOfSameValues <Projectile>(null, 20));

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Pillarocket Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/pillarocket_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/pillarocket_clipempty");

            gun.DefaultModule.projectiles[0] = projectile;
            gun.gunClass = GunClass.EXPLOSIVE;
            gun.quality  = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");

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

            akproj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(akproj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(akproj);
            akproj.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);
            PillarocketAKProj = akproj;

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

            magnum.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(magnum.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(magnum);
            magnum.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);
            PillarocketMagnumProj = magnum;

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

            shotproj.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(shotproj.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(shotproj);
            shotproj.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);
            PillarocketShotgunProj = shotproj;
            ID = gun.PickupObjectId;
        }