public static AdvancedSynergyEntry CreateSynergy(string name, List <int> mandatoryIds, List <int> optionalIds = default, bool activeWhenGunsUnequipped = true, List <StatModifier> statModifiers = default, bool ignoreLichsEyeBullets = false,
                                                         int numberObjectsRequired = 2, bool suppressVfx = false, bool requiresAtLeastOneGunAndOneItem = false, List <CustomSynergyType> bonusSynergies = default)
        {
            AdvancedSynergyEntry entry = new AdvancedSynergyEntry();
            string key = "#" + name.ToUpper().Replace(" ", "_").Replace("'", "").Replace(",", "").Replace(".", "");

            entry.NameKey = key;
            SpecialItemModule.Strings.Synergies.Set(key, name);
            foreach (int id in mandatoryIds)
            {
                bool isGun = false;
                if (PickupObjectDatabase.GetById(id) is Gun)
                {
                    isGun = true;
                }
                if (isGun)
                {
                    entry.MandatoryGunIDs.Add(id);
                }
                else
                {
                    entry.MandatoryItemIDs.Add(id);
                }
            }
            if (optionalIds != null)
            {
                foreach (int id in optionalIds)
                {
                    bool isGun = false;
                    if (PickupObjectDatabase.GetById(id) is Gun)
                    {
                        isGun = true;
                    }
                    if (isGun)
                    {
                        entry.OptionalGunIDs.Add(id);
                    }
                    else
                    {
                        entry.OptionalItemIDs.Add(id);
                    }
                }
            }
            entry.ActiveWhenGunUnequipped = activeWhenGunsUnequipped;
            entry.statModifiers           = new List <StatModifier>();
            if (statModifiers != null)
            {
                foreach (StatModifier mod in statModifiers)
                {
                    if (mod != null)
                    {
                        entry.statModifiers.Add(mod);
                    }
                }
            }
            entry.IgnoreLichEyeBullets            = ignoreLichsEyeBullets;
            entry.NumberObjectsRequired           = numberObjectsRequired;
            entry.SuppressVFX                     = suppressVfx;
            entry.RequiresAtLeastOneGunAndOneItem = requiresAtLeastOneGunAndOneItem;
            entry.bonusSynergies                  = new List <CustomSynergyType>();
            if (bonusSynergies != null)
            {
                foreach (CustomSynergyType type in bonusSynergies)
                {
                    entry.bonusSynergies.Add(type);
                }
            }
            synergies.Add(entry);
            GameManager.Instance.SynergyManager.synergies = GameManager.Instance.SynergyManager.synergies.Concat(new AdvancedSynergyEntry[] { entry }).ToArray();
            return(entry);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Bullet Blade", "bulletblade");

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

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

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

            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);

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

            for (int i = 0; i < 45; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) 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        = 2.5f;
                mod.angleVariance       = 70f;
                mod.numberOfShotsInClip = 1;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                mod.projectiles[0] = projectile;
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                projectile.baseData.damage *= 1.6f;
                projectile.baseData.speed  *= 0.6f;
                projectile.baseData.range  *= 1f;
                projectile.SetProjectileSpriteRight("enemystyle_projectile", 10, 10, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 8);
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;

                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f,
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
            }
            gun.reloadTime = 1f;
            gun.SetBaseMaxAmmo(50);
            gun.quality  = PickupObject.ItemQuality.B;
            gun.gunClass = GunClass.CHARGE;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 4;

            tk2dSpriteAnimationClip chargeClip = gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation);

            foreach (tk2dSpriteAnimationFrame frame in chargeClip.frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(new Vector2(-0.56f, -2.31f));
                }
            }
            tk2dSpriteAnimationClip fireClip = gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.shootAnimation);

            foreach (tk2dSpriteAnimationFrame frame in fireClip.frames)
            {
                tk2dSpriteDefinition def = frame.spriteCollection.spriteDefinitions[frame.spriteId];
                if (def != null)
                {
                    def.MakeOffset(new Vector2(-0.56f, -2.31f));
                }
            }

            gun.encounterTrackable.EncounterGuid = "this is the Bullet Blade";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(3.18f, -0.31f, 0f);
            BulletBladeID = gun.PickupObjectId;

            gun.SetupUnlockOnCustomFlag(CustomDungeonFlags.JAMMEDGUNNUT_QUEST_REWARDED, true);
        }
Example #3
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Enforcers Law", "enforcersgun");

            Game.Items.Rename("outdated_gun_mods:enforcers_law", "bny:enforcers_law");
            gun.gameObject.AddComponent <EnforcersLaw>();
            gun.SetShortDescription("Enforce Of Nature!");
            gun.SetLongDescription("A common, yet effective shotgun type used by Enforcers to supress riots, or whole alien populations. Usually accompanied by riot shields.");
            gun.SetupSprite(null, "enforcersgun_idle_001", 11);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 12);
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 5);
            GunExt.SetAnimationFPS(gun, gun.idleAnimation, 1);
            for (int i = 0; i < 6; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(35) as Gun, true, false);
            }
            foreach (ProjectileModule projectileModule in gun.Volley.projectiles)
            {
                projectileModule.ammoCost            = 1;
                projectileModule.shootStyle          = ProjectileModule.ShootStyle.Burst;
                projectileModule.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                projectileModule.cooldownTime        = 0.9f;
                projectileModule.angleVariance       = 10f;
                projectileModule.numberOfShotsInClip = 6;
                projectileModule.burstShotCount      = 2;
                projectileModule.burstCooldownTime   = 0.15f;
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(projectileModule.projectiles[0]);
                projectile.gameObject.SetActive(false);
                projectileModule.projectiles[0] = projectile;
                PierceProjModifier pierce = projectile.gameObject.AddComponent <PierceProjModifier>();
                pierce.penetration                   = 5;
                projectile.baseData.range            = 9f;
                pierce.penetratesBreakables          = true;
                projectile.baseData.damage           = 5f;
                projectile.AdditionalScaleMultiplier = 0.5f;
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                bool flag = projectileModule != gun.DefaultModule;
                if (flag)
                {
                    projectileModule.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
            }
            gun.carryPixelOffset += new IntVector2((int)5f, (int)-1f);
            gun.reloadTime        = 2.3f;
            gun.SetBaseMaxAmmo(180);
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(93) as Gun).muzzleFlashEffects;
            gun.quality            = PickupObject.ItemQuality.B;
            gun.encounterTrackable.EncounterGuid = "WEE WOO WEE WOO WEE WOO WEE WOO";
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            List <string> mandatoryConsoleIDs1 = new List <string>
            {
                "bny:enforcers_law"
            };
            List <string> optionalConsoleID1s = new List <string>
            {
                "betrayers_shield",
                "chaff_grenade",
                "laser_sight",
                "shield_of_the_maiden",
                "armor_of_thorns",
                "heavy_boots",
                "gunboots",
                "blast_helmet",
                "galactic_medal_of_valor",
                "full_metal_jacket",
                "crisis_stone"
            };

            CustomSynergies.Add("Protect And Serve", mandatoryConsoleIDs1, optionalConsoleID1s, true);
        }
        internal void AddDefaultCommands()
        {
            _LoggerSubscriber = (logger, loglevel, indent, str) => {
                PrintLine(logger.String(loglevel, str, indent: indent), color: _LoggerColors[loglevel]);
            };


            AddCommand("!!", (args, histindex) => {
                if (histindex - 1 < 0)
                {
                    throw new Exception("Can't run previous command (history is empty).");
                }
                return(History.Execute(histindex.Value - 1));
            });

            AddCommand("!'", (args, histindex) => {
                if (histindex - 1 < 0)
                {
                    throw new Exception("Can't run previous command (history is empty).");
                }
                return(History.Entries[histindex.Value - 1]);
            });

            AddCommand("echo", (args) => {
                return(string.Join(" ", args.ToArray()));
            }).WithSubCommand("hello", (args) => {
                return("Hello, world!\nHello, world!\nHello, world!\nHello, world!\nHello, world!\nHello, world!");
            });

            AddGroup("debug")
            .WithSubCommand("spawn-rand-chest", (args) => {
                var chest = GameManager.Instance.RewardManager.SpawnTotallyRandomChest(GameManager.Instance.PrimaryPlayer.CurrentRoom.GetRandomAvailableCellDumb());
                return(chest.name);
            })
            //.WithSubCommand("force-dual-wield", (args) => {
            //    if (args.Count < 1) throw new Exception("At least 1 argument required.");
            //    var partner_id = int.Parse(args[0]);
            //    var player = GameManager.Instance.PrimaryPlayer;
            //    var gun = player.inventory.CurrentGun;
            //    var partner_gun = PickupObjectDatabase.GetById(partner_id) as Gun;
            //    player.inventory.AddGunToInventory(partner_gun);
            //    var forcer = gun.gameObject.AddComponent<DualWieldForcer>();
            //    forcer.Gun = gun;
            //    forcer.PartnerGunID = partner_gun.PickupObjectId;
            //    forcer.TargetPlayer = player;
            //    return "Done";
            //})
            .WithSubCommand("unexclude-all-items", (args) => {
                foreach (var ent in PickupObjectDatabase.Instance.Objects)
                {
                    if (ent == null)
                    {
                        continue;
                    }
                    ent.quality = PickupObject.ItemQuality.SPECIAL;
                }
                return("Done");
            })
            .WithSubCommand("activate-all-synergies", (args) => {
                foreach (var ent in GameManager.Instance.SynergyManager.synergies)
                {
                    if (ent == null)
                    {
                        continue;
                    }
                    ent.ActivationStatus = SynergyEntry.SynergyActivation.ACTIVE;
                }
                return("Done");
            })
            .WithSubCommand("character", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("At least 1 argument required.");
                }
                var player_controller = ModUntitled.Characters[args[0]];
                if (player_controller == null)
                {
                    throw new Exception($"Character '{args[0]}' doesn't exist.");
                }
                ModUntitled.Instance.StartCoroutine(_ChangeCharacter(player_controller, args.Count > 1));
                return($"Changed character to {args[0]}");
            })
            .WithSubCommand("parser-bounds-test", (args) => {
                var text           = "echo Hello! \"Hello world!\" This\\ is\\ great \"It\"works\"with\"\\ wacky\" stuff\" \\[\\] \"\\[\\]\" [e[echo c][echo h][echo [echo \"o\"]] \"hel\"[echo lo][echo !]]";
                CurrentCommandText = text;
                return(null);
            })
            .WithSubCommand("giveid", (args) => {
                if (args.Count < 1)
                {
                    throw new Exception("Exactly 1 argument required.");
                }
                var pickup_obj = PickupObjectDatabase.Instance.InternalGetById(int.Parse(args[0]));

                if (pickup_obj == null)
                {
                    return("Item ID {args[0]} doesn't exist!");
                }

                LootEngine.TryGivePrefabToPlayer(pickup_obj.gameObject, GameManager.Instance.PrimaryPlayer, true);
                return(pickup_obj.EncounterNameOrDisplayName);
            });

            //AddGroup("pool")
            //.WithSubGroup(
            //    new Group("items")
            //    .WithSubCommand("idof", (args) => {
            //        if (args.Count < 1) throw new Exception("Exactly 1 argument required (numeric ID).");
            //        var id = int.Parse(args[0]);
            //        foreach (var pair in ModUntitled.Items.Pairs) {
            //            if (pair.Value.PickupObjectId == id) return pair.Key;
            //        }
            //        return "Entry not found.";
            //    })
            //    .WithSubCommand("nameof", (args) => {
            //        if (args.Count < 1) throw new Exception("Exactly 1 argument required (ID).");
            //        var id = args[0];
            //        foreach (var pair in ModUntitled.Items.Pairs) {
            //            if (pair.Key == id) return _GetPickupObjectName(pair.Value);
            //        }
            //        return "Entry not found.";
            //    })
            //    .WithSubCommand("numericof", (args) => {
            //        if (args.Count < 1) throw new Exception("Exactly 1 argument required (ID).");
            //        var id = args[0];
            //        foreach (var pair in ModUntitled.Items.Pairs) {
            //            if (pair.Key == id) return pair.Value.PickupObjectId.ToString();
            //        }
            //        return "Entry not found.";
            //    })
            //    .WithSubCommand("list", (args) => {
            //        var s = new StringBuilder();
            //        var pairs = new List<KeyValuePair<string, PickupObject>>();
            //        foreach (var pair in ModUntitled.Items.Pairs) {
            //            pairs.Add(pair);
            //        }
            //        foreach (var pair in pairs) {
            //            if (_GetPickupObjectName(pair.Value) == "NO NAME") {
            //                s.AppendLine($"[{pair.Key}] {_GetPickupObjectName(pair.Value)}");
            //            }
            //        }
            //        pairs.Sort((x, y) => string.Compare(_GetPickupObjectName(x.Value), _GetPickupObjectName(y.Value)));
            //        foreach (var pair in pairs) {
            //            if (_GetPickupObjectName(pair.Value) == "NO NAME") continue;
            //            s.AppendLine($"[{pair.Key}] {_GetPickupObjectName(pair.Value)}");
            //        }
            //        return s.ToString();
            //    })
            //    .WithSubCommand("random", (args) => {
            //        return ModUntitled.Items.RandomKey;
            //    })
            //);

            AddCommand("summon", (args) => {
                var player = GameManager.Instance.PrimaryPlayer;
                if (player == null)
                {
                    throw new Exception("No player");
                }
                var cell   = player.CurrentRoom.GetRandomAvailableCellDumb();
                var entity = AIActor.Spawn(ModUntitled.Enemies[args[0]], cell, player.CurrentRoom, true, AIActor.AwakenAnimationType.Default, true);

                if (ModUntitled.Enemies.HasTag(args[0], ModUntitled.EnemyTags.Friendly))
                {
                    entity.CompanionOwner    = player;
                    entity.CompanionSettings = new ActorCompanionSettings();
                    entity.CanTargetPlayers  = false;
                    var companion            = entity.GetComponent <CompanionController>();
                    if (companion != null)
                    {
                        companion.Initialize(player);
                        if (companion.specRigidbody)
                        {
                            PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(companion.specRigidbody, null, false);
                        }
                    }
                }

                var name = args[0];
                if (entity.encounterTrackable?.journalData?.PrimaryDisplayName != null)
                {
                    name = StringTableManager.GetEnemiesString(entity.encounterTrackable?.journalData?.PrimaryDisplayName);
                }

                return(name);
            });

            //AddCommand("listmods", (args) => {
            //    var s = new StringBuilder();

            //    s.AppendLine("Loaded mods:");
            //    foreach (var mod in ModUntitled.ModLoader.LoadedMods) {
            //        _GetModInfo(s, mod);
            //    }
            //    return s.ToString();
            //});

            AddCommand("lua", (args) => {
                LuaMode = true;
                return("[entered lua mode]");
            });

            AddCommand("give", (args) => {
                LootEngine.TryGivePrefabToPlayer(ModUntitled.Items[args[0]].gameObject, GameManager.Instance.PrimaryPlayer, true);
                return(args[0]);
            });

            AddGroup("dump")
            .WithSubCommand("synergy_chest", (args) => {
                System.Console.WriteLine(ObjectDumper.Dump(GameManager.Instance.RewardManager.Synergy_Chest, depth: 10));
                return("Dumped to log");
            })
            .WithSubCommand("synergies", (args) => {
                var id = 0;
                foreach (var synergy in GameManager.Instance.SynergyManager.synergies)
                {
                    if (synergy.NameKey != null)
                    {
                        var name = StringTableManager.GetSynergyString(synergy.NameKey);
                        System.Console.WriteLine($"== SYNERGY ID {id} NAME {name} ==");
                    }
                    else
                    {
                        System.Console.WriteLine($"== SYNERGY ID {id} ==");
                    }
                    System.Console.WriteLine($"  ACTIVATION STATUS: {synergy.ActivationStatus}");
                    System.Console.WriteLine($"  # OF OBJECTS REQUIRED: {synergy.NumberObjectsRequired}");
                    System.Console.WriteLine($"  ACTIVE WHEN GUN UNEQUIPPED?: {synergy.ActiveWhenGunUnequipped}");
                    System.Console.WriteLine($"  REQUIRES AT LEAST ONE GUN AND ONE ITEM?: {synergy.RequiresAtLeastOneGunAndOneItem}");
                    System.Console.WriteLine($"  MANDATORY GUNS:");
                    foreach (var itemid in synergy.MandatoryGunIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  OPTIONAL GUNS:");
                    foreach (var itemid in synergy.OptionalGunIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  MANDATORY ITEMS:");
                    foreach (var itemid in synergy.MandatoryItemIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  OPTIONAL ITEMS:");
                    foreach (var itemid in synergy.OptionalItemIDs)
                    {
                        System.Console.WriteLine($"  - {_GetPickupObjectName(PickupObjectDatabase.GetById(itemid))}");
                    }
                    System.Console.WriteLine($"  BONUS SYNERGIES:");
                    foreach (var bonus in synergy.bonusSynergies)
                    {
                        System.Console.WriteLine($"  - {bonus}");
                    }
                    System.Console.WriteLine($"  STAT MODIFIERS:");
                    foreach (var statmod in synergy.statModifiers)
                    {
                        System.Console.WriteLine($"  - STAT: {statmod.statToBoost}");
                        System.Console.WriteLine($"    AMOUNT: {statmod.amount}");
                        System.Console.WriteLine($"    MODIFY TYPE: {statmod.modifyType}");
                        System.Console.WriteLine($"    PERSISTS ON COOP DEATH?: {statmod.PersistsOnCoopDeath}");
                        System.Console.WriteLine($"    IGNORED FOR SAVE DATA?: {statmod.ignoredForSaveData}");
                    }
                    id++;
                }
                return("Dumped to log");
            })
            .WithSubCommand("items", (args) => {
                var b  = new StringBuilder();
                var db = PickupObjectDatabase.Instance.Objects;
                for (int i = 0; i < db.Count; i++)
                {
                    PickupObject obj  = null;
                    string nameprefix = "";
                    string name       = null;
                    try {
                        obj = db[i];
                    } catch {
                        name = "[ERROR: failed getting object by index]";
                    }
                    if (obj != null)
                    {
                        try {
                            var displayname = obj.encounterTrackable.journalData.PrimaryDisplayName;
                            name            = StringTableManager.ItemTable[displayname].GetWeightedString();
                        } catch {
                            name = "[ERROR: failed getting ammonomicon name]";
                        }
                        if (name == null)
                        {
                            try {
                                name = obj.EncounterNameOrDisplayName;
                            } catch {
                                name = "[ERROR: failed getting encounter or display name]";
                            }
                        }
                    }
                    if (name == null && obj != null)
                    {
                        name = "[NULL NAME (but object is not null)]";
                    }

                    name = $"{nameprefix} {name}";

                    if (name != null)
                    {
                        b.AppendLine($"{i}: {name}");
                        _Logger.Info($"{i}: {name}");
                    }
                }
                return(b.ToString());
            });

            AddGroup("log")
            .WithSubCommand("sub", (args) => {
                if (_Subscribed)
                {
                    return("Already subscribed.");
                }
                Logger.Subscribe(_LoggerSubscriber);
                _Subscribed = true;
                return("Done.");
            })
            .WithSubCommand("unsub", (args) => {
                if (!_Subscribed)
                {
                    return("Not subscribed yet.");
                }
                Logger.Unsubscribe(_LoggerSubscriber);
                _Subscribed = false;
                return("Done.");
            })
            .WithSubCommand("level", (args) => {
                if (args.Count == 0)
                {
                    return(_LogLevel.ToString().ToLowerInvariant());
                }
                else
                {
                    switch (args[0])
                    {
                    case "debug": _LogLevel = Logger.LogLevel.Debug; break;

                    case "info": _LogLevel = Logger.LogLevel.Info; break;

                    case "warn": _LogLevel = Logger.LogLevel.Warn; break;

                    case "error": _LogLevel = Logger.LogLevel.Error; break;

                    default: throw new Exception($"Unknown log level '{args[0]}");
                    }
                    return("Done.");
                }
            });
            //// test commands to dump collection
            //AddGroup("texdump")
            //.WithSubCommand("collection", (args) =>
            //{
            //    if (args.Count == 0)
            //    {
            //        return "No name specified";
            //    }
            //    else
            //    {
            //        string collectionName = args[0];
            //        Animation.Collection.Dump(collectionName);
            //        return "Successfull";
            //    }
            //});
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Lorebook", "lorebook");

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

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

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

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

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

            gun.SetAnimationFPS(gun.shootAnimation, 18);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;
            gun.DefaultModule.cooldownTime           = 0.6f;
            gun.muzzleFlashEffects.type              = VFXPoolType.None;
            gun.DefaultModule.numberOfShotsInClip    = 4;
            gun.barrelOffset.transform.localPosition = new Vector3(0.93f, 0.87f, 0f);
            gun.SetBaseMaxAmmo(110);
            gun.gunClass = GunClass.SILLY;
            Projectile wizardSpellProjectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(86) as Gun).DefaultModule.projectiles[0]);

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

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

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

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

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

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

            wizardBouncing.numberOfBounces = 10;
            wizardProjectile.AnimateProjectile(new List <string> {
                "playerwizardprojectile_001",
                "playerwizardprojectile_002",
                "playerwizardprojectile_003",
                "playerwizardprojectile_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(17, 22), //1
                new IntVector2(17, 22), //2
                new IntVector2(17, 22), //3
                new IntVector2(17, 22), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 4),
                                               AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4),
                                               AnimateBullet.ConstructListOfSameValues(true, 4),
                                               AnimateBullet.ConstructListOfSameValues(false, 4),
                                               AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4),
                                               new List <IntVector2?> {
                new IntVector2(11, 16), //1
                new IntVector2(11, 16), //2
                new IntVector2(11, 16), //3
                new IntVector2(11, 16), //3
            },
                                               AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                               AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
            wizardProjectile.shouldFlipHorizontally = true;

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

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

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

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

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

            bardBouncing.numberOfBounces = 10;
            bardProjectile.AnimateProjectile(new List <string> {
                "playerbardbullet_001",
                "playerbardbullet_002",
                "playerbardbullet_003",
                "playerbardbullet_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(16, 15), //1
                new IntVector2(16, 15), //2
                new IntVector2(16, 15), //3
                new IntVector2(16, 15), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 4),
                                             AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4),
                                             AnimateBullet.ConstructListOfSameValues(true, 4),
                                             AnimateBullet.ConstructListOfSameValues(false, 4),
                                             AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4),
                                             new List <IntVector2?> {
                new IntVector2(10, 9), //1
                new IntVector2(10, 9), //2
                new IntVector2(10, 9), //3
                new IntVector2(10, 9), //3
            },
                                             AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                             AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
            bardProjectile.shouldFlipHorizontally = true;


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

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

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

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

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

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

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

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

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

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

            knightBouncing.numberOfBounces = 10;
            knightProjectile.AnimateProjectile(new List <string> {
                "playerknightbullet_001",
                "playerknightbullet_002",
                "playerknightbullet_003",
                "playerknightbullet_004",
            }, 10, true, new List <IntVector2> {
                new IntVector2(19, 15), //1
                new IntVector2(19, 15), //2
                new IntVector2(19, 15), //3
                new IntVector2(19, 15), //3
            }, AnimateBullet.ConstructListOfSameValues(true, 4),
                                               AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 4),
                                               AnimateBullet.ConstructListOfSameValues(true, 4),
                                               AnimateBullet.ConstructListOfSameValues(false, 4),
                                               AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 4),
                                               new List <IntVector2?> {
                new IntVector2(13, 9), //1
                new IntVector2(13, 9), //2
                new IntVector2(13, 9), //3
                new IntVector2(13, 9), //3
            },
                                               AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 4),
                                               AnimateBullet.ConstructListOfSameValues <Projectile>(null, 4));
            knightProjectile.shouldFlipHorizontally = true;


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



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

            LorebookID = gun.PickupObjectId;
        }
Example #6
0
        public static void Init(string modName)
        {
            Gun ChamberGun = PickupObjectDatabase.GetById(647) as Gun;
            ChamberGunProcessor extantProcessor = ChamberGun.GetComponent <ChamberGunProcessor>();

            if (extantProcessor)
            {
                AdvancedChamberGunController newProcessor = ChamberGun.gameObject.AddComponent <AdvancedChamberGunController>();
                newProcessor.RefillsOnFloorChange = true;
                newProcessor.primeHandlerModName  = modName;
                //newProcessor.hyperDebugMode = true;

                if (AdvancedChamberGunController.floorFormeDatas == null)
                {
                    AdvancedChamberGunController.floorFormeDatas = new List <AdvancedChamberGunController.ChamberGunData>();
                }

                #region SetupVanillaFloors
                //KEEP
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 2,
                    indexValue           = 1,
                    correspondingFormeID = 647,
                    viableMasterRounds   = new List <int>()
                    {
                        469,
                    }
                });
                //OUBLIETTE
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 4,
                    indexValue           = 1.5f,
                    correspondingFormeID = 657,
                    viableMasterRounds   = new List <int>()
                    {
                    }
                });
                //GUNGEON PROPER
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 1,
                    indexValue           = 2,
                    correspondingFormeID = 660,
                    viableMasterRounds   = new List <int>()
                    {
                        471,
                    }
                });
                //ABBEY
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 8,
                    indexValue           = 2.5f,
                    correspondingFormeID = 806,
                    viableMasterRounds   = new List <int>()
                    {
                    }
                });
                //MINES
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 16,
                    indexValue           = 3,
                    correspondingFormeID = 807,
                    viableMasterRounds   = new List <int>()
                    {
                        468,
                    }
                });
                //RAT FLOOR
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 32768,
                    indexValue           = 3.5f,
                    correspondingFormeID = 808,
                    viableMasterRounds   = new List <int>()
                    {
                    }
                });
                //HOLLOW
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 32,
                    indexValue           = 4,
                    correspondingFormeID = 659,
                    viableMasterRounds   = new List <int>()
                    {
                        470,
                    }
                });
                //R&G DEPT
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 2048,
                    indexValue           = 4.5f,
                    correspondingFormeID = 823,
                    viableMasterRounds   = new List <int>()
                    {
                    }
                });
                //FORGE
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 64,
                    indexValue           = 5,
                    correspondingFormeID = 658,
                    viableMasterRounds   = new List <int>()
                    {
                        467,
                    }
                });
                //BULLET HELL
                AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                {
                    modName              = "Vanilla Gungeon",
                    floorTilesetID       = 128,
                    indexValue           = 6,
                    correspondingFormeID = 763,
                    viableMasterRounds   = new List <int>()
                    {
                    }
                });
                #endregion

                ETGMod.StartGlobalCoroutine(postStart(newProcessor, modName));

                UnityEngine.Object.Destroy(extantProcessor);
                Debug.Log($"Mod '{modName}' correctly initialised the ChamberGunAPI and is the prime handler.");
            }
            else
            {
                Debug.Log($"Mod '{modName}' did not alter the Chamber Gun, as the Chamber Gun was already altered.");
            }
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Gaxe", "gaxe");

            Game.Items.Rename("outdated_gun_mods:gaxe", "nn:gaxe");
            gun.gameObject.AddComponent <Gaxe>();
            gun.SetShortDescription("Diggy Diggy");
            gun.SetLongDescription("Advanced powder-powered mining tech only recently developed for use in the Black Powder Mine.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(335) as Gun).gunSwitchGroup;

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

            gun.reloadTime = 1f;
            gun.barrelOffset.transform.localPosition = new Vector3(2.62f, 1.12f, 0f);
            gun.SetBaseMaxAmmo(150);
            gun.gunClass = GunClass.PISTOL;
            //BULLET STATS

            bool iterator = false;

            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                if (iterator == false)
                {
                    mod.ammoCost = 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.transform.parent = gun.barrelOffset;
                    projectile.baseData.range  *= 2;
                    projectile.baseData.speed  *= 1.5f;
                    projectile.baseData.damage  = 7;
                    iterator = true;
                }
                else
                {
                    mod.ammoCost = 0;
                    Projectile projectile = UnityEngine.Object.Instantiate <Projectile>((PickupObjectDatabase.GetById(56) as Gun).DefaultModule.projectiles[0]);
                    mod.projectiles[0] = projectile;
                    projectile.gameObject.SetActive(false);
                    FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                    projectile.transform.parent = gun.barrelOffset;
                    UnityEngine.Object.DontDestroyOnLoad(projectile);
                    projectile.baseData.range *= 0.1f;
                    projectile.baseData.damage = 15;
                    projectile.specRigidbody.CollideWithTileMap = false;
                    projectile.pierceMinorBreakables            = true;
                    PierceProjModifier piercing = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();
                    piercing.penetration = 100;
                    MaintainDamageOnPierce maintenance = projectile.gameObject.GetOrAddComponent <MaintainDamageOnPierce>();
                    projectile.SetProjectileSpriteRight("gaxe_projectile", 12, 40, true, tk2dBaseSprite.Anchor.MiddleCenter, 8, 30);
                    DamageSecretWalls damageWalls = projectile.gameObject.GetOrAddComponent <DamageSecretWalls>();
                    //damageWalls.damageToDeal = 10f;
                }
                mod.shootStyle          = ProjectileModule.ShootStyle.SemiAutomatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.35f;
                mod.angleVariance       = 5f;
                mod.numberOfShotsInClip = 5;
            }

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Gaxe Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/gaxe_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/gaxe_clipempty");

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

            GaxeID = gun.PickupObjectId;
        }
Example #8
0
 public static void PlaceItemInAmmonomiconAfterItemById(this PickupObject item, int id)
 {
     item.ForcedPositionInAmmonomicon = PickupObjectDatabase.GetById(id).ForcedPositionInAmmonomicon;
 }
Example #9
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>();
            PickupObject item = PickupObjectDatabase.GetById(291);
            //setup knockback
            var knockback = prefab.AddComponent <KnockbackDoer>();

            knockback.weight = 1;
            SpriteBuilder.AddSpriteToCollection("FrostAndGunfireItems/Resources/roomimic_bosscard", SpriteBuilder.ammonomiconCollection);



            //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,
                path            = guid,
                isInBossTab     = true,
                encounterGuid   = guid,
            };

            EnemyDatabase.Instance.Entries.Add(enemyDatabaseEntry);
            BossBuilder.Dictionary.Add(guid, prefab);
            //finalize
            GameObject.DontDestroyOnLoad(prefab);
            FakePrefab.MarkAsFakePrefab(prefab);
            prefab.SetActive(false);

            return(prefab);
        }
Example #10
0
        private void HandleBroken(MinorBreakable mb)
        {
            PlayerController player = this.Owner;

            if (player.HasPickupID(532) || player.HasPickupID(214))
            {
                float value = UnityEngine.Random.Range(0.0f, 1.0f);
                if (value < 0.1)
                {
                    LootEngine.SpawnItem(PickupObjectDatabase.GetById(68).gameObject, mb.sprite.WorldCenter, Vector2.zero, 1f, false, false, false);
                }
            }

            if (player.CurrentRoom.HasActiveEnemies(RoomHandler.ActiveEnemyType.All))
            {
                if (mb && mb != null)
                {
                    float          num           = 10f;
                    List <AIActor> activeEnemies = this.Owner.CurrentRoom.GetActiveEnemies(RoomHandler.ActiveEnemyType.All);
                    bool           flag3         = activeEnemies == null | activeEnemies.Count <= 0;
                    bool           flag4         = !flag3;
                    if (flag4)
                    {
                        AIActor nearestEnemy = this.GetNearestEnemy(activeEnemies, mb.sprite.WorldCenter, out num, null);
                        if (nearestEnemy && nearestEnemy != null)
                        {
                            if (player.HasPickupID(152) && player.CurrentGun.PickupObjectId == 152)
                            {
                                Vector2    unitCenter  = mb.sprite.WorldCenter;
                                Vector2    unitCenter2 = nearestEnemy.specRigidbody.HitboxPixelCollider.UnitCenter;
                                float      z           = BraveMathCollege.Atan2Degrees((unitCenter2 - unitCenter).normalized);
                                Projectile projectile  = ((Gun)ETGMod.Databases.Items[152]).DefaultModule.projectiles[0];
                                GameObject gameObject  = SpawnManager.SpawnProjectile(projectile.gameObject, mb.sprite.WorldCenter, Quaternion.Euler(0f, 0f, z), true);
                                Projectile component   = gameObject.GetComponent <Projectile>();
                                bool       flag11      = component != null;
                                if (flag11)
                                {
                                    component.Owner                 = player;
                                    component.baseData.range       *= 5f;
                                    component.pierceMinorBreakables = true;
                                    component.collidesWithPlayer    = false;
                                }
                            }

                            if (player.HasPickupID(7))
                            {
                                Vector2    unitCenter  = mb.sprite.WorldCenter;
                                Vector2    unitCenter2 = nearestEnemy.specRigidbody.HitboxPixelCollider.UnitCenter;
                                float      z           = BraveMathCollege.Atan2Degrees((unitCenter2 - unitCenter).normalized);
                                Projectile projectile  = ((Gun)ETGMod.Databases.Items[7]).DefaultModule.projectiles[0];
                                GameObject gameObject  = SpawnManager.SpawnProjectile(projectile.gameObject, mb.sprite.WorldCenter, Quaternion.Euler(0f, 0f, z), true);
                                Projectile component   = gameObject.GetComponent <Projectile>();
                                bool       flag11      = component != null;
                                if (flag11)
                                {
                                    component.Owner                 = player;
                                    component.baseData.range       *= 5f;
                                    component.pierceMinorBreakables = true;
                                    component.collidesWithPlayer    = false;
                                }
                            }

                            else if (!player.HasPickupID(7) && player.CurrentGun.PickupObjectId != 152)
                            {
                                Vector2    unitCenter  = mb.sprite.WorldCenter;
                                Vector2    unitCenter2 = nearestEnemy.specRigidbody.HitboxPixelCollider.UnitCenter;
                                float      z           = BraveMathCollege.Atan2Degrees((unitCenter2 - unitCenter).normalized);
                                Projectile projectile  = ((Gun)ETGMod.Databases.Items[15]).DefaultModule.projectiles[0];
                                GameObject gameObject  = SpawnManager.SpawnProjectile(projectile.gameObject, mb.sprite.WorldCenter, Quaternion.Euler(0f, 0f, z), true);
                                Projectile component   = gameObject.GetComponent <Projectile>();
                                bool       flag11      = component != null;
                                if (flag11)
                                {
                                    component.Owner                 = player;
                                    component.baseData.range       *= 5f;
                                    component.pierceMinorBreakables = true;
                                    component.collidesWithPlayer    = false;
                                }
                            }
                        }



                        else
                        {
                            return;
                        }
                    }
                }
            }
        }
 public static void DoSetup()
 {
     foreach (ETGModule mod in ETGMod.AllMods)
     {
         if (mod != null)
         {
             if (mod.Metadata != null && mod.Metadata.Name != null)
             {
                 if (mod.Metadata.Name.Contains("Planetside Of Gunymede"))
                 {
                     ModInstallFlags.PlanetsideOfGunymededInstalled = true;
                 }
                 if (mod.Metadata.Name.Contains("FrostAndGunfireItems"))
                 {
                     ModInstallFlags.FrostAndGunfireInstalled = true;
                 }
                 if (mod.Metadata.Name.Contains("Prismatismas"))
                 {
                     ModInstallFlags.PrismatismInstalled = true;
                     if (PickupObjectDatabase.GetByEncounterName("Jeremy the Blobulon"))
                     {
                         PrismatismItemIDs.JeremyTheBlobulonID = PickupObjectDatabase.GetByEncounterName("Jeremy the Blobulon").PickupObjectId;
                     }
                 }
                 if (mod.Metadata.Name.Contains("SpecialAPI's Stuff"))
                 {
                     ModInstallFlags.SpecialAPIsStuffInstalled = true;
                     if (PickupObjectDatabase.GetByEncounterName("Round King"))
                     {
                         SpecialAPIsStuffIDs.RoundKingID = PickupObjectDatabase.GetByEncounterName("Round King").PickupObjectId;
                     }
                     if (PickupObjectDatabase.GetByEncounterName("Crown of the Jammed"))
                     {
                         SpecialAPIsStuffIDs.CrownOfTheJammedID = PickupObjectDatabase.GetByEncounterName("Crown of the Jammed").PickupObjectId;
                     }
                 }
                 if (mod.Metadata.Name.Contains("ExpandTheGungeon"))
                 {
                     ModInstallFlags.ExpandTheGungeonInstalled = true;
                     if (PickupObjectDatabase.GetByEncounterName("Baby Sitter"))
                     {
                         ExpandTheGungeonIDs.BabySitterID = PickupObjectDatabase.GetByEncounterName("Baby Sitter").PickupObjectId;
                     }
                     if (PickupObjectDatabase.GetByEncounterName("Baby Good Hammer"))
                     {
                         ExpandTheGungeonIDs.BabyGoodHammerID = PickupObjectDatabase.GetByEncounterName("Baby Good Hammer").PickupObjectId;
                     }
                 }
                 if (mod.Metadata.Name.Contains("Hunter's ror2 items"))
                 {
                     ModInstallFlags.RORItemsInstalled = true;
                     if (PickupObjectDatabase.GetByEncounterName("Will the Wisp"))
                     {
                         RORItemIDs.WillTheWispID = PickupObjectDatabase.GetByEncounterName("Will the Wisp").PickupObjectId;
                     }
                 }
                 if (mod.Metadata.Name.Contains("CelsItems"))
                 {
                     ModInstallFlags.CelsItemsInstalled = true;
                     if (PickupObjectDatabase.GetByEncounterName("Pet Rock"))
                     {
                         CelsItemIDs.PetRockID = ETGMod.Databases.Items["Pet Rock"].PickupObjectId;
                     }
                 }
                 if (mod.Metadata.Name.Contains("KTS Item Pack"))
                 {
                     ModInstallFlags.KylesItemsInstalled = true;
                     if (PickupObjectDatabase.GetByEncounterName("Capture Sphere"))
                     {
                         KylesItemIDs.CaptureSphereID = PickupObjectDatabase.GetByEncounterName("Capture Sphere").PickupObjectId;
                     }
                 }
                 if (mod.Metadata.Name.Contains("Some Bunnys Item Pack"))
                 {
                     ModInstallFlags.SomeBunnysItemsInstalled = true;
                     if (PickupObjectDatabase.GetByEncounterName("Soul In A Jar"))
                     {
                         SomeBunnysItemIDs.SoulInAJarID = PickupObjectDatabase.GetByEncounterName("Soul In A Jar").PickupObjectId;
                     }
                     if (PickupObjectDatabase.GetByEncounterName("Gun Soul Phylactery"))
                     {
                         SomeBunnysItemIDs.GunSoulPhylacteryID = PickupObjectDatabase.GetByEncounterName("Gun Soul Phylactery").PickupObjectId;
                     }
                     if (PickupObjectDatabase.GetByEncounterName("Gunthemimic"))
                     {
                         SomeBunnysItemIDs.GunthemimicID = PickupObjectDatabase.GetByEncounterName("Gunthemimic").PickupObjectId;
                     }
                     if (PickupObjectDatabase.GetByEncounterName("Casemimic"))
                     {
                         SomeBunnysItemIDs.CasemimicID = PickupObjectDatabase.GetByEncounterName("Casemimic").PickupObjectId;
                     }
                     if (PickupObjectDatabase.GetByEncounterName("Blasphemimic"))
                     {
                         SomeBunnysItemIDs.BlasphemimicID = PickupObjectDatabase.GetByEncounterName("Blasphemimic").PickupObjectId;
                     }
                 }
                 if (mod.Metadata.Name.Contains("[Retrash's] Custom Items Collection"))
                 {
                     ModInstallFlags.RetrashItemsInstalled = true;
                 }
             }
         }
     }
 }
        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("Coffee Shotgun", "hot");

            // "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:coffee_shotgun", "ski:coffee_shotgun");
            gun.gameObject.AddComponent <hot_coffee>();
            //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("Three shots of expresso");
            gun.SetLongDescription("scalding hot and highly throwable.");
            // 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, "hot_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, 8);
            gun.SetAnimationFPS(gun.reloadAnimation, 20);
            // 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.

            // 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 = 10f;

            GunExt.AddProjectileModuleFrom(gun, "AK-47", true, false);
            gun.Volley                            = (PickupObjectDatabase.GetById(51) as Gun).Volley;
            gun.singleModule                      = (PickupObjectDatabase.GetById(51) as Gun).singleModule;
            gun.RawSourceVolley                   = (PickupObjectDatabase.GetById(51) as Gun).RawSourceVolley;
            gun.alternateVolley                   = (PickupObjectDatabase.GetById(51) as Gun).alternateVolley;
            gun.PreventOutlines                   = true;
            gun.reloadTime                        = 1f;
            gun.gunClass                          = GunClass.SHOTGUN;
            gun.DefaultModule.cooldownTime        = 1.2f;
            gun.DefaultModule.numberOfShotsInClip = 3;
            gun.SetBaseMaxAmmo(600);
            // 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 = "Capitalism Juice";

            //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  *= 1.5f;
            projectile.transform.parent = gun.barrelOffset;



            //projectile.transform.parent = gun.barrelOffset;


            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Example #13
0
        public void PlaceRandomJunkEnemies(Dungeon dungeon, RoomHandler roomHandler)
        {
            if (dungeon.IsGlitchDungeon)
            {
                return;
            }
            if (dungeon.tileIndices.tilesetId == GlobalDungeonData.ValidTilesets.RATGEON)
            {
                return;
            }

            if (Random.value <= 0.85f)
            {
                return;
            }

            int RandomEnemiesPlaced  = 0;
            int RandomEnemiesSkipped = 0;
            int MaxEnemies           = 1;
            int iterations           = 0;

            if (Random.value <= 0.1f)
            {
                MaxEnemies = 2;
            }

            if (dungeon.data.rooms == null | dungeon.data.rooms.Count <= 0)
            {
                return;
            }

            List <int> roomList = Enumerable.Range(0, dungeon.data.rooms.Count).ToList();

            roomList = roomList.Shuffle();

            if (roomHandler != null)
            {
                roomList = new List <int>(new int[] { dungeon.data.rooms.IndexOf(roomHandler) });
            }

            while (iterations < roomList.Count && RandomEnemiesPlaced < MaxEnemies)
            {
                RoomHandler currentRoom = dungeon.data.rooms[roomList[iterations]];
                PrototypeDungeonRoom.RoomCategory roomCategory = currentRoom.area.PrototypeRoomCategory;
                try {
                    if (currentRoom != null && !string.IsNullOrEmpty(currentRoom.GetRoomName()) &&
                        currentRoom.HasActiveEnemies(RoomHandler.ActiveEnemyType.RoomClear) && !currentRoom.IsMaintenanceRoom() &&
                        !currentRoom.IsSecretRoom && !currentRoom.IsWinchesterArcadeRoom && !currentRoom.IsGunslingKingChallengeRoom &&
                        !currentRoom.GetRoomName().StartsWith("Boss Foyer") && !currentRoom.GetRoomName().StartsWith(ExpandRoomPrefabs.Expand_Keep_TreeRoom.name) &&
                        !currentRoom.GetRoomName().StartsWith(ExpandRoomPrefabs.Expand_Keep_TreeRoom2.name))
                    {
                        if (roomCategory != PrototypeDungeonRoom.RoomCategory.BOSS && roomCategory != PrototypeDungeonRoom.RoomCategory.ENTRANCE &&
                            roomCategory != PrototypeDungeonRoom.RoomCategory.REWARD && roomCategory != PrototypeDungeonRoom.RoomCategory.EXIT)
                        {
                            if (RandomEnemiesPlaced >= MaxEnemies)
                            {
                                break;
                            }

                            List <IntVector2> m_CachedPositions       = new List <IntVector2>();
                            IntVector2?       RandomGlitchEnemyVector = GetRandomAvailableCellForEnemy(dungeon, currentRoom, m_CachedPositions);

                            if (RandomGlitchEnemyVector.HasValue)
                            {
                                if (Random.value <= 0.5f)
                                {
                                    m_GlitchEnemyDatabase.SpawnGlitchedRaccoon(currentRoom, RandomGlitchEnemyVector.Value, false, AIActor.AwakenAnimationType.Spawn, true);
                                }
                                else
                                {
                                    m_GlitchEnemyDatabase.SpawnGlitchedTurkey(currentRoom, RandomGlitchEnemyVector.Value, false, AIActor.AwakenAnimationType.Spawn, true);
                                }
                            }
                            else
                            {
                                RandomEnemiesSkipped++;
                            }

                            RandomEnemiesPlaced++;
                        }
                    }
                    iterations++;
                } catch (System.Exception ex) {
                    if (ExpandStats.debugMode)
                    {
                        ETGModConsole.Log("[DEBUG] Exception while setting up or placing enemy for current room" /*+ currentRoom.GetRoomName()*/, false);
                    }
                    if (ExpandStats.debugMode)
                    {
                        ETGModConsole.Log("[DEBUG] Skipping current room...", false);
                    }
                    if (ExpandStats.debugMode)
                    {
                        ETGModConsole.Log(ex.Message + ex.StackTrace + ex.Source, false);
                    }
                    if (RandomEnemiesPlaced >= MaxEnemies)
                    {
                        break;
                    }
                    iterations++;
                }
            }
            if (ExpandStats.debugMode)
            {
                ETGModConsole.Log("[DEBUG] Max Number of Junk Enemies assigned to floor: " + MaxEnemies, false);
                ETGModConsole.Log("[DEBUG] Number of Junk Enemies placed: " + RandomEnemiesPlaced, false);
                ETGModConsole.Log("[DEBUG] Number of Junk Enemies skipped: " + RandomEnemiesSkipped, false);
                if (RandomEnemiesPlaced <= 0)
                {
                    ETGModConsole.Log("[DEBUG] Error: No Junk Enemies have been placed!", false);
                }
            }
            if (RandomEnemiesPlaced > 0)
            {
                AIActor[] actors = FindObjectsOfType <AIActor>();
                if (actors != null & actors.Length > 0)
                {
                    foreach (AIActor actor in actors)
                    {
                        if (!string.IsNullOrEmpty(actor.ActorName))
                        {
                            if (actor.ActorName == "Junk Raccoon")
                            {
                                actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(127));
                                if (Random.value <= 0.2f)
                                {
                                    actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(127));
                                }
                                else
                                {
                                    if (Random.value <= 0.1f)
                                    {
                                        actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(74));
                                    }
                                    else
                                    {
                                        actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(85));
                                    }
                                }
                                if (Random.value <= 0.01f)
                                {
                                    if (GameManager.Instance.PrimaryPlayer.HasPickupID(641))
                                    {
                                        actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(74));
                                    }
                                    else
                                    {
                                        actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(641));
                                    }
                                }
                                else if (Random.value <= 0.01f)
                                {
                                    if (GameManager.Instance.PrimaryPlayer.HasPickupID(580))
                                    {
                                        actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(74));
                                    }
                                    else
                                    {
                                        actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(580));
                                    }
                                }
                            }
                            else if (actor.ActorName == "Junk Turkey")
                            {
                                if (BraveUtility.RandomBool())
                                {
                                    actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(600));
                                }
                                else
                                {
                                    actor.AdditionalSafeItemDrops.Add(PickupObjectDatabase.GetById(78));
                                }
                            }
                        }
                    }
                }
            }
            Destroy(m_GlitchEnemyDatabase);
            return;
        }
Example #14
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Felissile", "felissile");

            Game.Items.Rename("outdated_gun_mods:felissile", "nn:felissile");
            gun.gameObject.AddComponent <Felissile>();
            gun.SetShortDescription("What's New?");
            gun.SetLongDescription("Fires a rocket on the first shot of it's clip." + "\n\nOnce part of a peculiar XXXS Size mech suit.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 15);

            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 = 2.5f;
            gun.DefaultModule.cooldownTime           = 0.25f;
            gun.DefaultModule.numberOfShotsInClip    = 10;
            gun.barrelOffset.transform.localPosition = new Vector3(1.12f, 0.37f, 0f);
            gun.SetBaseMaxAmmo(500);

            gun.DefaultModule.usesOptionalFinalProjectile = true;
            gun.DefaultModule.numberOfFinalProjectiles    = 9;
            gun.gunClass = GunClass.EXPLOSIVE;
            //BULLET STATS
            Projectile missileProjectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            missileProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(missileProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(missileProjectile);
            gun.DefaultModule.projectiles[0]  = missileProjectile;
            missileProjectile.baseData.damage = 15f;
            ExplosiveModifier explosion = missileProjectile.gameObject.GetComponent <ExplosiveModifier>();

            if (explosion)
            {
                Destroy(explosion);
            }
            ExplosiveModifier explosiveModifier = missileProjectile.gameObject.AddComponent <ExplosiveModifier>();

            explosiveModifier.doExplosion      = true;
            explosiveModifier.explosionData    = FelissileExplosion;
            missileProjectile.baseData.range  *= 0.5f;
            missileProjectile.baseData.speed  *= 3f;
            missileProjectile.transform.parent = gun.barrelOffset;
            missileProjectile.SetProjectileSpriteRight("felissile_rocket_projectile", 16, 11, false, tk2dBaseSprite.Anchor.MiddleCenter, 14, 3);



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

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.speed *= 1.1f;
            projectile.baseData.damage = 11f;
            projectile.SetProjectileSpriteRight("felissile_normal_projectile", 10, 9, true, tk2dBaseSprite.Anchor.MiddleCenter, 9, 8);
            projectile.hitEffects.alwaysUseMidair        = true;
            projectile.hitEffects.overrideMidairDeathVFX = EasyVFXDatabase.WhiteCircleVFX;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Felissile Rockets", "NevernamedsItems/Resources/CustomGunAmmoTypes/felissile_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/felissile_clipempty");

            //gun.DefaultModule.finalAmmoType = GameUIAmmoType.AmmoType.CUSTOM;
            //gun.DefaultModule.finalCustomAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Felissile Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/minutegun_clipempty", "NevernamedsItems/Resources/CustomGunAmmoTypes/minutegun_clipfull");

            gun.DefaultModule.finalProjectile = projectile;
            gun.gunHandedness = GunHandedness.HiddenOneHanded;

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

            ID = gun.PickupObjectId;
        }
Example #15
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("Giant Rat", "rat");

            // "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:giant_rat", "ski:giant_rat");
            gun.gameObject.AddComponent <RatGun>();
            //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("He makes all the rulez");
            gun.SetLongDescription("This rat is far larger than any youve seen before! He wants you to carry him to the depths of the gungeon; you can't say no he makes the rulez." +
                                   "Fear not those who cross the path of the giant rat never live to tell the tale.");
            // 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, "rat_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);
            gun.SetAnimationFPS(gun.reloadAnimation, 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, PickupObjectDatabase.GetById(542) 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.angleVariance = 2f;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Burst;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 1f;

            gun.muzzleFlashEffects                = null;
            gun.gunHandedness                     = GunHandedness.TwoHanded;
            gun.DefaultModule.burstShotCount      = 10000;
            gun.DefaultModule.cooldownTime        = .0f;
            gun.DefaultModule.numberOfShotsInClip = 1000;
            gun.InfiniteAmmo    = true;
            gun.doesScreenShake = false;

            // 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 = "Now I get to be the giant rat";
            //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 *= 5f;
            projectile.baseData.speed  *= 0f;
            projectile.transform.parent = gun.barrelOffset;


            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
Example #16
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Head of the Order", "headoftheorder");

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

            behav.preventNormalFireAudio  = true;
            behav.overrideNormalFireAudio = "Play_ENM_highpriest_blast_01";
            gun.SetShortDescription("Guns, Immortal");
            gun.SetLongDescription("Though torn from the rest of it's corporeal form, the immortal soul of the High Priest remains bound to this weapon.");
            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);
            gun.SetupSprite(null, "headoftheorder_idle_001", 8);

            gun.SetAnimationFPS(gun.shootAnimation, 10);

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

            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Ordered;
            gun.reloadTime = 2f;
            gun.DefaultModule.cooldownTime        = 0.65f;
            gun.DefaultModule.numberOfShotsInClip = 6;
            gun.muzzleFlashEffects = (PickupObjectDatabase.GetById(79) as Gun).muzzleFlashEffects;
            gun.barrelOffset.transform.localPosition = new Vector3(1.62f, 0.75f, 0f);
            gun.SetBaseMaxAmmo(100);
            gun.ammo     = 100;
            gun.gunClass = GunClass.PISTOL;
            //BULLET STATS
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage      *= 6f;
            projectile.baseData.force       *= 2f;
            projectile.baseData.speed       *= 2f;
            projectile.pierceMinorBreakables = true;
            HomingModifier homing = projectile.gameObject.GetOrAddComponent <HomingModifier>();

            homing.HomingRadius    = 20f;
            homing.AngularVelocity = 400;

            projectile.AnimateProjectile(new List <string> {
                "atomic_projectile_001",
                "atomic_projectile_002",
                "atomic_projectile_003",
                "atomic_projectile_004",
                "atomic_projectile_005",
                "atomic_projectile_006",
                "atomic_projectile_007",
                "atomic_projectile_008",
                "atomic_projectile_009",
                "atomic_projectile_010",
            }, 15, true, AnimateBullet.ConstructListOfSameValues <IntVector2>(new IntVector2(24, 20), 10), AnimateBullet.ConstructListOfSameValues(true, 10), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 10), AnimateBullet.ConstructListOfSameValues(true, 10), AnimateBullet.ConstructListOfSameValues(false, 10),
                                         AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 10), AnimateBullet.ConstructListOfSameValues <IntVector2?>(new IntVector2(8, 8), 10), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 10), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 10));

            gun.DefaultModule.projectiles[0] = projectile;

            gun.quality = PickupObject.ItemQuality.S;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            HeadOfTheOrderID = gun.PickupObjectId;
        }
Example #17
0
        public static IEnumerator postStart(AdvancedChamberGunController newProcessor, string modName)
        {
            yield return(null);

            //These variables are for debugging to keep track of how many things were added to the gun
            int newFormesAdded    = 0;
            int masterRoundsAdded = 0;

            //Define a master list
            List <int> FormestoCheck    = new List <int>();
            List <int> MasteriesToCheck = new List <int>();

            //Nullchecks 4-ever
            if (ETGModMainBehaviour.Instance == null || ETGModMainBehaviour.Instance.gameObject == null)
            {
                Debug.LogError($"ChamberGunAPI ({modName}): ETGModMainBehaviour.Instance OR ETGModMainBehaviour.Instance.gameObject was NULL.");
                yield break;
            }
            //Here we check the ETGMod main object for any components with the name of the delivery component.
            foreach (Component component in ETGModMainBehaviour.Instance.gameObject.GetComponents <Component>())
            {
                if (component.GetType().ToString().ToLower().Contains("etgmodchambergundeliverycomponent"))
                {
                    //If the component is present we use reflection to get the lists it contains and adds them to the master list we defined earlier
                    List <int> formeIDsInComp   = (List <int>)ReflectionHelper.GetValue(component.GetType().GetField("chamberGunFormIDs"), component);
                    List <int> masteryIDsInComp = (List <int>)ReflectionHelper.GetValue(component.GetType().GetField("chamberGunMasteryIDs"), component);
                    string     compModName      = (string)ReflectionHelper.GetValue(component.GetType().GetField("modName"), component);
                    if (formeIDsInComp != null && formeIDsInComp.Count > 0)
                    {
                        //Add the list of Forme IDs to the master list
                        FormestoCheck.AddRange(formeIDsInComp);
                    }
                    if (masteryIDsInComp != null && masteryIDsInComp.Count > 0)
                    {
                        //Add the list of Mastery IDs to the master list.
                        MasteriesToCheck.AddRange(masteryIDsInComp);
                    }
                    Debug.Log($"ChamberGunAPI ({modName}): Detected Delivery Component from Mod '{compModName}' with {formeIDsInComp.Count} formes and {masteryIDsInComp.Count} additional masteries.");
                }
            }

            //If the formes to check master list is not empty or null, we iterate through it
            if (FormestoCheck != null && FormestoCheck.Count > 0)
            {
                foreach (int id in FormestoCheck)
                {
                    //Get the pickupobject corresponding to the ID
                    PickupObject gunPickObj = PickupObjectDatabase.GetById(id);
                    if (gunPickObj == null)
                    {
                        Debug.LogError($"ChamberGunAPI ({modName}): A mod attempted to add item ID {id} as a forme, but that ID does not exist!");
                    }
                    if (!(gunPickObj is Gun))
                    {
                        Debug.LogError($"ChamberGunAPI ({modName}): A mod attempted to add item ID {id} as a forme, but that ID does not correspond to a Gun.");
                    }

                    //Iterate through each component in the pickupobject looking for the one containing all the actual info on the forme
                    bool foundCompOnThisID = false;
                    foreach (Component component in gunPickObj.GetComponents <Component>())
                    {
                        if (component.GetType().ToString().ToLower().Contains("customchambergunform"))
                        {
                            foundCompOnThisID = true;

                            //Use reflection to get all the necessary values off the component
                            string     modname           = (string)ReflectionHelper.GetValue(component.GetType().GetField("modName"), component);
                            int        desiredTileset    = (int)ReflectionHelper.GetValue(component.GetType().GetField("floorTilesetID"), component);
                            List <int> validMasterRounds = (List <int>)ReflectionHelper.GetValue(component.GetType().GetField("viableMasterRounds"), component);
                            int        correspondingForm = (int)ReflectionHelper.GetValue(component.GetType().GetField("correspondingFormeID"), component);
                            float      index             = (float)ReflectionHelper.GetValue(component.GetType().GetField("indexValue"), component);

                            //Some debugging messages for when shit inevitably goes wrong
                            Debug.Log($"ChamberGunAPI ({modName}): Adding cross mod chamber gun form with the following criteria -> ModName({modName}), TilesetID({desiredTileset}), GunID({correspondingForm}), Index({index})");
                            if (string.IsNullOrEmpty(modname) || modname == "Unset")
                            {
                                Debug.LogWarning($"ChamberGunAPI ({modName}): Trying to add a form with no modname set, this may make things difficult to debug!");
                            }

                            if (validMasterRounds == null)
                            {
                                validMasterRounds = new List <int>()
                                {
                                };
                            }

                            //Actually Add forms to the processor
                            AdvancedChamberGunController.floorFormeDatas.Add(new AdvancedChamberGunController.ChamberGunData()
                            {
                                modName              = modname,
                                floorTilesetID       = desiredTileset,
                                indexValue           = index,
                                correspondingFormeID = correspondingForm,
                                viableMasterRounds   = validMasterRounds,
                            });
                            newFormesAdded += 1;
                        }
                    }
                    if (foundCompOnThisID == false)
                    {
                        //If iterating through every component on the gun didn't find a proper component, we shit out an error here
                        Debug.LogError($"ChamberGunAPI ({modName}): A mod attempted to add item ID {id} as a forme, but that ID did not possess a data component?");
                    }
                }
            }
            //Do the same with the Masteries list
            if (MasteriesToCheck != null && MasteriesToCheck.Count > 0)
            {
                foreach (int id in MasteriesToCheck)
                {
                    //Get the pickupobject corresponding to the ID
                    PickupObject masteryObj = PickupObjectDatabase.GetById(id);
                    if (masteryObj == null)
                    {
                        Debug.LogError($"ChamberGunAPI ({modName}): A mod attempted to add item ID {id} as a custom mastery, but that ID does not exist!");
                    }

                    //Iterate through each component on the item
                    bool foundCompOnThisID = false;
                    foreach (Component component in masteryObj.GetComponents <Component>())
                    {
                        if (component.GetType().ToString().ToLower().Contains("customchambergunmasterround"))
                        {
                            foundCompOnThisID = true;
                            string modname      = (string)ReflectionHelper.GetValue(component.GetType().GetField("modName"), component);
                            int    tilesetID    = (int)ReflectionHelper.GetValue(component.GetType().GetField("floorTilesetID"), component);
                            bool   foundTileset = false;

                            //Iterate through each form data in the list to see if there's a form that matches the set tileset id of the mastery
                            foreach (AdvancedChamberGunController.ChamberGunData data in AdvancedChamberGunController.floorFormeDatas)
                            {
                                if (data.floorTilesetID == tilesetID)
                                {
                                    //If the ids match, add the mastery id to that form's list of valid mastery IDs
                                    if (data.viableMasterRounds == null)
                                    {
                                        data.viableMasterRounds = new List <int>()
                                        {
                                        }
                                    }
                                    ;
                                    data.viableMasterRounds.Add(masteryObj.PickupObjectId);
                                    Debug.Log($"ChamberGunAPI ({modName}): Mod '{modname}' added a viable Master round with the Id {masteryObj.PickupObjectId} to the viable master rounds of floor tileset id {tilesetID}.");
                                    masterRoundsAdded++;
                                    foundTileset = true;
                                }
                            }
                            if (!foundTileset)
                            {
                                //If the code is unable to find a valid id in the form list, spit out this error
                                Debug.LogError($"ChamberGunAPI ({modName}): Mod {modname} failed to add viable Master Round with ID {masteryObj.PickupObjectId} because the target floor id ({tilesetID}) does not exist in the custom forme list.");
                            }
                        }
                    }
                    if (!foundCompOnThisID)
                    {
                        //Shit out an error if we didn't find the component
                        Debug.LogError($"ChamberGunAPI ({modName}): A mod attempted to add item ID {id} as a custom mastery, but the item at that ID does not have a data component?");
                    }
                }
            }

            Debug.Log($"Mod '{modName}' correctly completed postStart, adding {newFormesAdded} new formes and {masterRoundsAdded} new valid master rounds.");
            yield break;
        }
    }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Royal Guard's Knife", "royal_guard's_knife");

            Game.Items.Rename("outdated_gun_mods:royal_guard's_knife", "sts:royal_guard's_knife");
            gun.gameObject.AddComponent <RoyalGuardsKnife>();
            gun.SetShortDescription("Stab Stab Stab");
            gun.SetLongDescription("A weak hunting knife used by The Royal Guard for cutting up game or sawing rope.");
            gun.SetupSprite(null, "royal_guard's_knife_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.SetAnimationFPS(gun.reloadAnimation, 2);
            gun.AddProjectileModuleFrom("38_special", true, false);
            gun.DefaultModule.ammoType      = GameUIAmmoType.AmmoType.SMALL_BULLET;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.SemiAutomatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 0f;
            gun.DefaultModule.angleVariance       = 0f;
            gun.DefaultModule.cooldownTime        = .2f;
            gun.DefaultModule.numberOfShotsInClip = 350;
            Gun gun2 = PickupObjectDatabase.GetById(151) as Gun;

            gun.muzzleFlashEffects.type = VFXPoolType.None;
            gun.SetBaseMaxAmmo(350);
            gun.barrelOffset.transform.localPosition = new Vector3(0.75f, 0f, 0f);
            gun.quality = PickupObject.ItemQuality.EXCLUDED;
            gun.encounterTrackable.EncounterGuid = "Fuckfuckfuckfuckpleaseworkpleasefuckingworkpleasepleasework.";
            gun.sprite.IsPerpendicular           = true;
            gun.gunClass = GunClass.NONE;
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.transform.parent      = gun.barrelOffset;
            projectile.baseData.damage      *= .5f;
            VFXPool fuckyouyoustupidfuckingvfxihateyousofuckingmuchyougoddamnmistakefuckyourubelaswellihateyousomuchformakingthevfxpoolcodesofuckingbadAAAAAAAAAAAAAAAAAAAAAAAAA = VFXLibrary.CreateMuzzleflash("royal_guard's_knife_slash", new List <string> {
                "royal_guard's_knife_slash_001", "royal_guard's_knife_slash_002", "royal_guard's_knife_slash_003", "royal_guard's_knife_slash_004",
            }, 10, new List <IntVector2> {
                new IntVector2(27, 27), new IntVector2(27, 27), new IntVector2(27, 27), new IntVector2(27, 27),
            }, new List <tk2dBaseSprite.Anchor> {
                tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft, tk2dBaseSprite.Anchor.MiddleLeft
            }, new List <Vector2> {
                Vector2.zero, Vector2.zero, Vector2.zero, Vector2.zero,
            }, false, false, false, false, 0, VFXAlignment.Fixed, true, new List <float> {
                0, 0, 0, 0
            }, new List <Color> {
                VFXLibrary.emptyColor, VFXLibrary.emptyColor, VFXLibrary.emptyColor, VFXLibrary.emptyColor,
            });

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

            slashingBehaviour.SlashVFX        = fuckyouyoustupidfuckingvfxihateyousofuckingmuchyougoddamnmistakefuckyourubelaswellihateyousomuchformakingthevfxpoolcodesofuckingbadAAAAAAAAAAAAAAAAAAAAAAAAA;
            slashingBehaviour.SlashDimensions = 65;
            slashingBehaviour.SlashRange      = 2.5f;

            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.AddToSubShop(ItemBuilder.ShopType.Goopton);
            gun.AddToSubShop(ItemBuilder.ShopType.Trorc);
        }
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Orgun", "orgun");

            Game.Items.Rename("outdated_gun_mods:orgun", "nn:orgun");
            gun.gameObject.AddComponent <Orgun>();
            gun.SetShortDescription("My Heart Will Go On");
            gun.SetLongDescription("Hespera, the Pride of Venus, always wished that her fighting spirit, her courage... her heart, if you will, would go on to inspire and aid others." + "\n\nShe never realised how literal that would be.");

            gun.SetupSprite(null, "orgun_idle_001", 8);
            //ItemBuilder.AddPassiveStatModifier(gun, PlayerStats.StatType.GlobalPriceMultiplier, 0.925f, StatModifier.ModifyMethod.MULTIPLICATIVE);

            gun.SetAnimationFPS(gun.shootAnimation, 8);
            gun.SetAnimationFPS(gun.idleAnimation, 5);
            gun.AddPassiveStatModifier(PlayerStats.StatType.Health, 1f, StatModifier.ModifyMethod.ADDITIVE);

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

            //GUN STATS
            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.Burst;
                mod.burstShotCount      = 2;
                mod.burstCooldownTime   = 0.2f;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;
                mod.cooldownTime        = 0.5f;
                mod.angleVariance       = 20f;
                mod.numberOfShotsInClip = 6;
                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.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(369) as Gun).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.tileMapVertical.effects[0].effects[0].effect;
                projectile.hitEffects.alwaysUseMidair        = true;
                projectile.baseData.damage *= 1.4f;
                projectile.baseData.speed  *= 1.2f;
                GoopModifier blood = projectile.gameObject.AddComponent <GoopModifier>();
                blood.goopDefinition         = EasyGoopDefinitions.BlobulonGoopDef;
                blood.SpawnGoopInFlight      = true;
                blood.InFlightSpawnFrequency = 0.05f;
                blood.InFlightSpawnRadius    = 1f;
                blood.SpawnGoopOnCollision   = true;
                blood.CollisionSpawnRadius   = 2f;
                projectile.SetProjectileSpriteRight("orgun_projectile", 12, 7, true, tk2dBaseSprite.Anchor.MiddleCenter, 7, 7);
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                projectile.transform.parent = gun.barrelOffset;
            }

            gun.reloadTime = 1.3f;
            gun.barrelOffset.transform.localPosition = new Vector3(2.62f, 0.81f, 0f);
            gun.SetBaseMaxAmmo(80);
            gun.gunClass = GunClass.SHOTGUN;
            //BULLET STATS
            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("Orgun Bullets", "NevernamedsItems/Resources/CustomGunAmmoTypes/orgun_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/orgun_clipempty");


            // 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.A;
            gun.encounterTrackable.EncounterGuid = "this is the Orgun";
            ETGMod.Databases.Items.Add(gun, null, "ANY");

            OrgunID = gun.PickupObjectId;
            gun.SetupUnlockOnCustomMaximum(CustomTrackedMaximums.MAX_HEART_CONTAINERS_EVER, 7, DungeonPrerequisite.PrerequisiteOperation.GREATER_THAN);
        }
        public static GameObject BuildPrefab()
        {
            var bomb = SpriteBuilder.SpriteFromResource("NevernamedsItems/Resources/ThrowableActives/infantrygrenade_throw_001.png", new GameObject("InfantryGrenade"));

            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;

            var deployAnimation = SpriteBuilder.AddAnimation(animator, collection, new List <int>
            {
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/infantrygrenade_throw_001.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/infantrygrenade_throw_002.png", collection),
            }, "infantrygrenade_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/infantrygrenade_explode_001.png", collection),
            }, "infantrygrenade_explode", tk2dSpriteAnimationClip.WrapMode.Once);

            explodeAnimation.fps = 30;
            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/infantrygrenade_throw_001.png", collection),
                SpriteBuilder.AddSpriteToCollection("NevernamedsItems/Resources/ThrowableActives/infantrygrenade_throw_002.png", collection),
            }, "infantrygrenade_primed", tk2dSpriteAnimationClip.WrapMode.LoopSection);

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

            var audioListener = bomb.AddComponent <AudioAnimatorListener>();

            audioListener.animationAudioEvents = new ActorAudioEvent[]
            {
                new ActorAudioEvent
                {
                    eventName = "Play_OBJ_mine_beep_01",
                    eventTag  = "beep"
                }
            };

            ProximityMine proximityMine = new ProximityMine
            {
                explosionData = new ExplosionData
                {
                    useDefaultExplosion = false,
                    doDamage            = true,
                    forceUseThisRadius  = false,
                    damageRadius        = 3f,
                    damageToPlayer      = 0,
                    damage                       = 30,
                    breakSecretWalls             = false,
                    secretWallsRadius            = 3.5f,
                    forcePreventSecretWallDamage = false,
                    doDestroyProjectiles         = true,
                    doForce                      = true,
                    pushRadius                   = 3,
                    force                  = 25,
                    debrisForce            = 12.5f,
                    preventPlayerForce     = false,
                    explosionDelay         = 0.1f,
                    usesComprehensiveDelay = false,
                    comprehensiveDelay     = 0,
                    playDefaultSFX         = false,

                    doScreenShake = true,
                    ss            = new ScreenShakeSettings
                    {
                        magnitude               = 1,
                        speed                   = 6.5f,
                        time                    = 0.22f,
                        falloff                 = 0,
                        direction               = new Vector2(0, 0),
                        vibrationType           = ScreenShakeSettings.VibrationType.Auto,
                        simpleVibrationStrength = Vibration.Strength.Medium,
                        simpleVibrationTime     = Vibration.Time.Normal
                    },
                    doStickyFriction             = true,
                    doExplosionRing              = true,
                    isFreezeExplosion            = false,
                    freezeRadius                 = 5,
                    IsChandelierExplosion        = false,
                    rotateEffectToNormal         = false,
                    ignoreList                   = new List <SpeculativeRigidbody>(),
                    overrideRangeIndicatorEffect = null,
                    effect       = StaticExplosionDatas.explosiveRoundsExplosion.effect,
                    freezeEffect = null,
                },
                explosionStyle           = ProximityMine.ExplosiveStyle.TIMED,
                detectRadius             = 3.5f,
                explosionDelay           = 1f,
                usesCustomExplosionDelay = false,
                customExplosionDelay     = 0.1f,
                deployAnimName           = "infantrygrenade_throw",
                explodeAnimName          = "infantrygrenade_explode",
                idleAnimName             = "infantrygrenade_primed",



                MovesTowardEnemies       = false,
                HomingTriggeredOnSynergy = false,
                HomingDelay  = 3.25f,
                HomingRadius = 10,
                HomingSpeed  = 4,
            };

            var boom = bomb.AddComponent <ProximityMine>(proximityMine);


            return(bomb);
        }
Example #21
0
        private void OnEnemyDamaged(float damage, bool fatal, HealthHaver enemy)
        {
            bool flag = fatal && enemy.aiActor;

            if (flag)
            {
                {
                    int  numure = UnityEngine.Random.Range(0, 4);
                    bool fuckye = numure == 0 | numure == 1 | numure == 2;
                    if (fuckye)
                    {
                        bool flag3 = this.mimicGuids.Contains(enemy.aiActor.EnemyGuid);
                        if (flag3)
                        {
                            int id = BraveUtility.RandomElement <int>(BunnysFoot.Lootdrops);
                            LootEngine.SpawnItem(PickupObjectDatabase.GetById(id).gameObject, enemy.specRigidbody.UnitCenter, Vector2.down, .7f, false, true, false);
                        }
                    }
                    bool fuckye1 = numure == 3;
                    if (fuckye1)
                    {
                        PickupObject.ItemQuality itemQuality = PickupObject.ItemQuality.D;
                        bool flag3 = enemy.aiActor.EnemyGuid == "2ebf8ef6728648089babb507dec4edb7";
                        if (flag3)
                        {
                            itemQuality = PickupObject.ItemQuality.D;
                            this.SpawnBonusItem(enemy, itemQuality);
                        }
                        else
                        {
                            bool flag4 = enemy.aiActor.EnemyGuid == "d8d651e3484f471ba8a2daa4bf535ce6";
                            if (flag4)
                            {
                                itemQuality = PickupObject.ItemQuality.C;
                                this.SpawnBonusItem(enemy, itemQuality);
                            }
                            else
                            {
                                bool flag5 = enemy.aiActor.EnemyGuid == "abfb454340294a0992f4173d6e5898a8";
                                if (flag5)
                                {
                                    itemQuality = PickupObject.ItemQuality.B;
                                    this.SpawnBonusItem(enemy, itemQuality);
                                }
                                else
                                {
                                    bool flag6 = enemy.aiActor.EnemyGuid == "d8fd592b184b4ac9a3be217bc70912a2";
                                    if (flag6)
                                    {
                                        itemQuality = PickupObject.ItemQuality.A;
                                        this.SpawnBonusItem(enemy, itemQuality);
                                    }
                                    else
                                    {
                                        bool flag7 = enemy.aiActor.EnemyGuid == "6450d20137994881aff0ddd13e3d40c8";
                                        if (flag7)
                                        {
                                            itemQuality = PickupObject.ItemQuality.S;
                                            this.SpawnBonusItem(enemy, itemQuality);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Example #22
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("Time Erasure Gun", "timerase");

            // "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:time_erasure_gun", "cak:time_erasure_gun");
            gun.gameObject.AddComponent <Timerase>();
            //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("Timey Whimey");
            gun.SetLongDescription("A gun capable of wounding time itself. One would think another legendary weapon would be similar, but this gun does so in a different manner.");
            // 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, "timerase_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, 14);
            gun.SetAnimationFPS(gun.reloadAnimation, 8);
            // 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(153) 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.DefaultModule.cooldownTime        = 0.2f;
            gun.DefaultModule.numberOfShotsInClip = 3;
            gun.SetBaseMaxAmmo(50);
            gun.barrelOffset.localPosition += new Vector3(-0.1f, 0f, 0f);
            // 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.D;
            gun.muzzleFlashEffects = null;
            gun.emptyAnimation     = "timerase_empty_001";
            gun.encounterTrackable.EncounterGuid = "timegungggggilikeyacutg";
            //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          *= 0.7f;
            projectile.baseData.speed           *= 0.75f;
            projectile.transform.parent          = gun.barrelOffset;
            projectile.AdditionalScaleMultiplier = 1f;
            projectile.collidesWithEnemies       = true;
            projectile.IgnoreTileCollisionsFor(5);
            gun.CanBeDropped = true;
            //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");
            CakeIDs.TimeGun = gun.PickupObjectId;
        }
Example #23
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Mini Monger", "minimonger");

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

            behav.preventNormalFireAudio    = true;
            behav.overrideNormalFireAudio   = "Play_ENM_demonwall_barf_01";
            behav.preventNormalReloadAudio  = true;
            behav.overrideNormalReloadAudio = "Play_ENM_demonwall_intro_01";
            gun.SetShortDescription("Great Wall");
            gun.SetLongDescription("A scale model of the fearsome Wallmonger, used as a mock-up during it's original construction." + "\n\nWhile the Wallmonger contains hundreds of tortured souls, this only contains two or three.");
            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 1f, StatModifier.ModifyMethod.ADDITIVE);
            gun.SetupSprite(null, "minimonger_idle_001", 8);


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

            gun.SetAnimationFPS(gun.shootAnimation, 10);
            gun.SetAnimationFPS(gun.chargeAnimation, 5);

            for (int i = 0; i < 5; i++)
            {
                gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(86) 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        = 2f;
                mod.angleVariance       = 15f;
                mod.numberOfShotsInClip = 4;
                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.speed  *= 0.5f;
                projectile.baseData.damage *= 1.6f;
                AutoDoShadowChainOnSpawn chain = projectile.gameObject.GetOrAddComponent <AutoDoShadowChainOnSpawn>();
                chain.NumberInChain = 5;
                chain.pauseLength   = 0.1f;
                projectile.SetProjectileSpriteRight("pillarocket_subprojectile", 5, 5, true, tk2dBaseSprite.Anchor.MiddleCenter, 3, 3);

                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }
                ProjectileModule.ChargeProjectile chargeProj = new ProjectileModule.ChargeProjectile
                {
                    Projectile = projectile,
                    ChargeTime = 1f,
                };
                mod.chargeProjectiles = new List <ProjectileModule.ChargeProjectile> {
                    chargeProj
                };
            }
            gun.reloadTime = 2f;
            gun.SetBaseMaxAmmo(50);
            gun.gunClass = GunClass.SHOTGUN;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            gun.GetComponent <tk2dSpriteAnimator>().GetClipByName(gun.chargeAnimation).loopStart = 3;

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = "Punishment Ray Lasers";

            gun.quality = PickupObject.ItemQuality.A;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            MiniMongerID = gun.PickupObjectId;
        }
Example #24
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Butchers Knife", "butchersknife");

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

            behav.preventNormalReloadAudio = true;
            behav.preventNormalFireAudio   = true;
            behav.overrideNormalFireAudio  = "Play_WPN_blasphemy_shot_01";
            gun.gunSwitchGroup             = (PickupObjectDatabase.GetById(417) as Gun).gunSwitchGroup;
            gun.SetShortDescription("Word of Kaliber");
            gun.SetLongDescription("Cuts enemies to bits." + "\n\nForged and sharpened by a Gun Cultist who believed she heard the voice of Kaliber speaking to her... asking her for a sacrifice... her son.");
            gun.SetupSprite(null, "butchersknife_idle_001", 8);
            gun.SetAnimationFPS(gun.shootAnimation, 16);
            gun.SetAnimationFPS(gun.chargeAnimation, 8);
            gun.SetAnimationFPS(gun.reloadAnimation, 1);
            gun.AddProjectileModuleFrom(PickupObjectDatabase.GetById(56) as Gun, true, false);
            gun.AddPassiveStatModifier(PlayerStats.StatType.Curse, 2f, StatModifier.ModifyMethod.ADDITIVE);
            //GUN STATS
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.DefaultModule.cooldownTime  = 1f;
            gun.gunClass = GunClass.CHARGE;
            gun.DefaultModule.angleVariance       = 1f;
            gun.DefaultModule.numberOfShotsInClip = 1;
            Projectile projectile = DataCloners.CopyFields <SuperPierceProjectile>(Instantiate(gun.DefaultModule.projectiles[0]));

            gun.DefaultModule.projectiles[0] = projectile;
            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            projectile.baseData.damage           *= 0.2f;
            projectile.baseData.speed            *= 0.7f;
            projectile.pierceMinorBreakables      = true;
            projectile.AdditionalScaleMultiplier *= 1f;
            projectile.baseData.range            *= 1000f;
            projectile.SetProjectileSpriteRight("butchersknife_projectile", 29, 7, false, tk2dBaseSprite.Anchor.MiddleCenter, 35, 14);
            projectile.specRigidbody.CollideWithTileMap = false;

            NoCollideBehaviour nocollide = projectile.gameObject.GetOrAddComponent <NoCollideBehaviour>();

            nocollide.worksOnEnemies     = false;
            nocollide.worksOnProjectiles = true;

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

            pierce.penetration = 1000;

            TickDamageBehaviour tickdmg = projectile.gameObject.GetOrAddComponent <TickDamageBehaviour>();

            tickdmg.damageSource  = "Butchers Knife";
            tickdmg.starterDamage = 3f;

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

            gun.DefaultModule.ammoType       = GameUIAmmoType.AmmoType.CUSTOM;
            gun.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("ButchersKnife Clip", "NevernamedsItems/Resources/CustomGunAmmoTypes/butchersknife_clipfull", "NevernamedsItems/Resources/CustomGunAmmoTypes/butchersknife_clipempty");

            gun.reloadTime = 5f;
            gun.SetBaseMaxAmmo(35);
            gun.quality = PickupObject.ItemQuality.S;

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

            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.barrelOffset.transform.localPosition = new Vector3(0.87f, 0.25f, 0f);
            ButchersKnifeID = gun.PickupObjectId;
        }
        private void TakeItem(PlayerController player)
        {
            if (PickupObjectDatabase.GetById(ItemID) && (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite) != null && player.HasPassiveItem(ItemID))
            {
                m_Interacted = true;
            }
            else
            {
                return;
            }

            GameObject m_SubSpriteObject = new GameObject("Item Display Object", new Type[] { typeof(tk2dSprite) })
            {
                layer = 0
            };

            m_SubSpriteObject.transform.position = (transform.position + new Vector3(0.35f, 1.3f));
            ExpandUtility.DuplicateSprite(m_SubSpriteObject.GetComponent <tk2dSprite>(), (PickupObjectDatabase.GetById(ItemID).sprite as tk2dSprite));
            if (m_ParentRoom != null)
            {
                m_SubSpriteObject.transform.parent = m_ParentRoom.hierarchyParent;
            }
            m_SubSpriteObject.GetComponent <tk2dSprite>().HeightOffGround = 3f;
            m_SubSpriteObject.GetComponent <tk2dSprite>().UpdateZDepth();
            player.RemovePassiveItem(ItemID);

            if (m_TargetDoor && m_TargetDoor.GetComponent <tk2dSpriteAnimator>() && m_TargetDoor.GetComponent <SpeculativeRigidbody>())
            {
                AkSoundEngine.PostEvent("Play_OBJ_plate_press_01", gameObject);
                StartCoroutine(DelayedDoorOpen(m_TargetDoor));
            }

            SpriteOutlineManager.RemoveOutlineFromSprite(sprite, false);
        }
Example #26
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("Jackpot Of Greed", "pot");

            // "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:jackpot_of_greed", "cak:jackpot_of_greed");
            gun.gameObject.AddComponent <JackpotOfGreed>();
            //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("Midas Touch");
            gun.SetLongDescription("Priceless, but useless in the Gungeon where normal currency has no meaning. Conjures infinite gold coins.");
            // 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, "pot_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, 13);
            // 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(56) 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.DefaultModule.cooldownTime        = 0.3f;
            gun.DefaultModule.numberOfShotsInClip = 10;
            gun.SetBaseMaxAmmo(500);
            gun.InfiniteAmmo = true;
            gun.barrelOffset.localPosition += new Vector3(0.2f, 0.05f, 0f);
            Gun gun3 = (Gun)ETGMod.Databases.Items["demon_head"];

            gun.muzzleFlashEffects = gun3.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 = "JackpotOfGreed";
            //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 *= 1.2f;
            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("pot_projectile", 8, 8, null, null);
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            gun.PlaceItemInAmmonomiconAfterItemById(197);
            gun.SetupUnlockOnStat(TrackedStats.TIMES_CLEARED_GUNGEON, 50f, DungeonPrerequisite.PrerequisiteOperation.GREATER_THAN);
        }
Example #27
0
        public static tk2dSpriteDefinition SetupDefinitionForProjectileSprite(string name, int id, int pixelWidth, int pixelHeight, bool lightened = true, int?overrideColliderPixelWidth = null, int?overrideColliderPixelHeight = null,
                                                                              int?overrideColliderOffsetX = null, int?overrideColliderOffsetY = null, Projectile overrideProjectileToCopyFrom = null)
        {
            if (overrideColliderPixelWidth == null)
            {
                overrideColliderPixelWidth = pixelWidth;
            }
            if (overrideColliderPixelHeight == null)
            {
                overrideColliderPixelHeight = pixelHeight;
            }
            if (overrideColliderOffsetX == null)
            {
                overrideColliderOffsetX = 0;
            }
            if (overrideColliderOffsetY == null)
            {
                overrideColliderOffsetY = 0;
            }
            float thing              = 16;
            float thing2             = 16;
            float trueWidth          = (float)pixelWidth / thing;
            float trueHeight         = (float)pixelHeight / thing;
            float colliderWidth      = (float)overrideColliderPixelWidth.Value / thing2;
            float colliderHeight     = (float)overrideColliderPixelHeight.Value / thing2;
            float colliderOffsetX    = (float)overrideColliderOffsetX.Value / thing2;
            float colliderOffsetY    = (float)overrideColliderOffsetY.Value / thing2;
            tk2dSpriteDefinition def = ETGMod.Databases.Items.ProjectileCollection.inst.spriteDefinitions[(overrideProjectileToCopyFrom ??
                                                                                                           (PickupObjectDatabase.GetById(lightened ? 47 : 12) as Gun).DefaultModule.projectiles[0]).GetAnySprite().spriteId].CopyDefinitionFrom();

            def.boundsDataCenter           = new Vector3(trueWidth / 2f, trueHeight / 2f, 0f);
            def.boundsDataExtents          = new Vector3(trueWidth, trueHeight, 0f);
            def.untrimmedBoundsDataCenter  = new Vector3(trueWidth / 2f, trueHeight / 2f, 0f);
            def.untrimmedBoundsDataExtents = new Vector3(trueWidth, trueHeight, 0f);
            def.texelSize           = new Vector2(1 / 16f, 1 / 16f);
            def.position0           = new Vector3(0f, 0f, 0f);
            def.position1           = new Vector3(0f + trueWidth, 0f, 0f);
            def.position2           = new Vector3(0f, 0f + trueHeight, 0f);
            def.position3           = new Vector3(0f + trueWidth, 0f + trueHeight, 0f);
            def.colliderVertices    = new Vector3[2];
            def.colliderVertices[0] = new Vector3(colliderOffsetX, colliderOffsetY, 0f);
            def.colliderVertices[1] = new Vector3(colliderWidth / 2, colliderHeight / 2);
            def.name = name;
            ETGMod.Databases.Items.ProjectileCollection.inst.spriteDefinitions[id] = def;
            return(def);
        }
Example #28
0
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("AM-0 Spread Forme", "am0spreadforme");

            Game.Items.Rename("outdated_gun_mods:am-0_spread_forme", "nn:am0+spreadshot");
            gun.gameObject.AddComponent <AM0SpreadForme>();
            gun.SetShortDescription("Fires Ammunition");
            gun.SetLongDescription("" + "\n\nThis gun is comically stuffed with whole ammo boxes.");

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

            gun.SetAnimationFPS(gun.shootAnimation, 12);
            gun.gunSwitchGroup = (PickupObjectDatabase.GetById(519) as Gun).gunSwitchGroup;

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

            //GUN STATS
            gun.reloadTime = 0.8f;
            gun.barrelOffset.transform.localPosition = new Vector3(2.43f, 0.75f, 0f);
            gun.SetBaseMaxAmmo(500);
            gun.ammo = 500;



            foreach (ProjectileModule mod in gun.Volley.projectiles)
            {
                mod.angleVariance       = 35;
                mod.cooldownTime        = 0.11f;
                mod.numberOfShotsInClip = 30;
                mod.ammoCost            = 1;
                mod.shootStyle          = ProjectileModule.ShootStyle.Automatic;
                mod.sequenceStyle       = ProjectileModule.ProjectileSequenceStyle.Random;

                //BULLET STATS
                Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(mod.projectiles[0]);
                projectile.gameObject.SetActive(false);
                FakePrefab.MarkAsFakePrefab(projectile.gameObject);
                UnityEngine.Object.DontDestroyOnLoad(projectile);
                mod.projectiles[0]          = projectile;
                projectile.baseData.damage *= 0.55f;
                projectile.baseData.speed  *= 0.7f;
                projectile.baseData.range  *= 2f;
                if (mod != gun.DefaultModule)
                {
                    mod.ammoCost = 0;
                }

                projectile.AnimateProjectile(new List <string> {
                    "spreadammoproj_1",
                    "spreadammoproj_2",
                    "spreadammoproj_3",
                    "spreadammoproj_4",
                    "spreadammoproj_5",
                    "spreadammoproj_6",
                    "spreadammoproj_7",
                    "spreadammoproj_8",
                    "spreadammoproj_9",
                    "spreadammoproj_10",
                    "spreadammoproj_11",
                    "spreadammoproj_12",
                    "spreadammoproj_13",
                    "spreadammoproj_14",
                    "spreadammoproj_15",
                    "spreadammoproj_16"
                }, 16, true, new List <IntVector2> {
                    new IntVector2(11, 14), //1
                    new IntVector2(13, 16), //2            All frames are 13x16 except select ones that are 11-14
                    new IntVector2(13, 16), //3
                    new IntVector2(13, 16), //4
                    new IntVector2(11, 14), //5
                    new IntVector2(13, 16), //6
                    new IntVector2(13, 16), //7
                    new IntVector2(13, 16), //8
                    new IntVector2(11, 14), //9
                    new IntVector2(13, 16), //10
                    new IntVector2(13, 16), //11
                    new IntVector2(13, 16), //12
                    new IntVector2(11, 14), //13
                    new IntVector2(13, 16), //14
                    new IntVector2(13, 16), //15
                    new IntVector2(13, 16), //16
                }, AnimateBullet.ConstructListOfSameValues(false, 16), AnimateBullet.ConstructListOfSameValues(tk2dBaseSprite.Anchor.MiddleCenter, 16), AnimateBullet.ConstructListOfSameValues(true, 16), AnimateBullet.ConstructListOfSameValues(false, 16),
                                             AnimateBullet.ConstructListOfSameValues <Vector3?>(null, 16), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 16), AnimateBullet.ConstructListOfSameValues <IntVector2?>(null, 16), AnimateBullet.ConstructListOfSameValues <Projectile>(null, 16));

                projectile.SetProjectileSpriteRight("spreadammoproj_1", 11, 14, false, tk2dBaseSprite.Anchor.MiddleCenter, 11, 14);



                projectile.transform.parent = gun.barrelOffset;
            }

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

            AM0SpreadFormeID = gun.PickupObjectId;
        }
Example #29
0
 public static void AddSynergyForms()
 {
     //------------------------------------------------------SYNERGY FORMES
     #region PreBigUpdate
     //GUNSHARK - MEGASHARK SYNERGY FORM
     AdvancedTransformGunSynergyProcessor MegaSharkSynergyForme = (PickupObjectDatabase.GetById(Gunshark.GunsharkID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     MegaSharkSynergyForme.NonSynergyGunId = Gunshark.GunsharkID;
     MegaSharkSynergyForme.SynergyGunId    = GunsharkMegasharkSynergyForme.GunsharkMegasharkSynergyFormeID;
     MegaSharkSynergyForme.SynergyToCheck  = "Megashark";
     //DISC GUN - SUPER DISC FORM
     AdvancedTransformGunSynergyProcessor SuperDiscSynergyForme = (PickupObjectDatabase.GetById(DiscGun.DiscGunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     SuperDiscSynergyForme.NonSynergyGunId = DiscGun.DiscGunID;
     SuperDiscSynergyForme.SynergyGunId    = DiscGunSuperDiscForme.DiscGunSuperDiscSynergyFormeID;
     SuperDiscSynergyForme.SynergyToCheck  = "Super Disc";
     //ORGUN - HEADACHE FORM
     AdvancedTransformGunSynergyProcessor HeadacheSynergyForme = (PickupObjectDatabase.GetById(Orgun.OrgunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     HeadacheSynergyForme.NonSynergyGunId = Orgun.OrgunID;
     HeadacheSynergyForme.SynergyGunId    = OrgunHeadacheSynergyForme.OrgunHeadacheSynergyFormeID;
     HeadacheSynergyForme.SynergyToCheck  = "Headache";
     //MINI GUN - MINI SHOTGUN FORM
     AdvancedTransformGunSynergyProcessor MiniShotgunSynergyForme = (PickupObjectDatabase.GetById(NNMinigun.MiniGunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     MiniShotgunSynergyForme.NonSynergyGunId = NNMinigun.MiniGunID;
     MiniShotgunSynergyForme.SynergyGunId    = MinigunMiniShotgunSynergyForme.MiniShotgunID;
     MiniShotgunSynergyForme.SynergyToCheck  = "Mini Shotgun";
     //DOGGUN - DISCORD AND RHYME (WOLFGUN) FORME
     AdvancedTransformGunSynergyProcessor WolfgunSynergyForme = (PickupObjectDatabase.GetById(Corgun.DoggunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     WolfgunSynergyForme.NonSynergyGunId = Corgun.DoggunID;
     WolfgunSynergyForme.SynergyGunId    = Wolfgun.WolfgunID;
     WolfgunSynergyForme.SynergyToCheck  = "Discord and Rhyme";
     #endregion
     #region BigUpdate (1.14)
     //PENCIL - MIGHTIER THAN THE GUN FORME
     AdvancedTransformGunSynergyProcessor MightierThanTheGunForme = (PickupObjectDatabase.GetById(Pencil.pencilID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     MightierThanTheGunForme.NonSynergyGunId = Pencil.pencilID;
     MightierThanTheGunForme.SynergyGunId    = PenPencilSynergy.penID;
     MightierThanTheGunForme.SynergyToCheck  = "Mightier Than The Gun";
     //REKEYTER - RESHELLETONKEYTER
     AdvancedTransformGunSynergyProcessor ReShelletonKeyterForme = (PickupObjectDatabase.GetById(Rekeyter.RekeyterID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     ReShelletonKeyterForme.NonSynergyGunId = Rekeyter.RekeyterID;
     ReShelletonKeyterForme.SynergyGunId    = ReShelletonKeyter.ReShelletonKeyterID;
     ReShelletonKeyterForme.SynergyToCheck  = "ReShelletonKeyter";
     //AM0 - SPREAD FORME
     AdvancedTransformGunSynergyProcessor AM0SpreadForm = (PickupObjectDatabase.GetById(AM0.AM0ID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     AM0SpreadForm.NonSynergyGunId = AM0.AM0ID;
     AM0SpreadForm.SynergyGunId    = AM0SpreadForme.AM0SpreadFormeID;
     AM0SpreadForm.SynergyToCheck  = "Spreadshot";
     //BULLET BLADE - GHOST SWORD
     AdvancedTransformGunSynergyProcessor GhostBladeForme = (PickupObjectDatabase.GetById(BulletBlade.BulletBladeID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     GhostBladeForme.NonSynergyGunId = BulletBlade.BulletBladeID;
     GhostBladeForme.SynergyGunId    = BulletBladeGhostForme.GhostBladeID;
     GhostBladeForme.SynergyToCheck  = "GHOST SWORD!!!";
     //HOT GLUE GUN - GLUE GUNNER
     AdvancedTransformGunSynergyProcessor GlueGunnerForme = (PickupObjectDatabase.GetById(HotGlueGun.HotGlueGunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     GlueGunnerForme.NonSynergyGunId = HotGlueGun.HotGlueGunID;
     GlueGunnerForme.SynergyGunId    = GlueGunGlueGunnerSynergy.GlueGunnerID;
     GlueGunnerForme.SynergyToCheck  = "Glue Gunner";
     //BULLATTERER - KING BULLATTERER
     AdvancedTransformGunSynergyProcessor KingBullattererForme = (PickupObjectDatabase.GetById(Bullatterer.BullattererID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     KingBullattererForme.NonSynergyGunId = Bullatterer.BullattererID;
     KingBullattererForme.SynergyGunId    = KingBullatterer.KingBullattererID;
     KingBullattererForme.SynergyToCheck  = "King Bullatterer";
     //WRENCH - NULL REFERENCE EXCEPTION
     AdvancedTransformGunSynergyProcessor NullReferenceExceptionForme = (PickupObjectDatabase.GetById(Wrench.WrenchID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     NullReferenceExceptionForme.NonSynergyGunId = Wrench.WrenchID;
     NullReferenceExceptionForme.SynergyGunId    = WrenchNullRefException.NullWrenchID;
     NullReferenceExceptionForme.SynergyToCheck  = "NullReferenceException";
     //GRAVITY GUN - NEGATIVE MATTER
     AdvancedTransformGunSynergyProcessor NegativeMatterSynergyForm = (PickupObjectDatabase.GetById(GravityGun.GravityGunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     NegativeMatterSynergyForm.NonSynergyGunId = GravityGun.GravityGunID;
     NegativeMatterSynergyForm.SynergyGunId    = GravityGunNegativeMatterForm.GravityGunNegativeMatterID;
     NegativeMatterSynergyForm.SynergyToCheck  = "Negative Matter";
     //GATLING GUN - GATTER UP
     AdvancedTransformGunSynergyProcessor GatGunSynergy = (PickupObjectDatabase.GetById(GatlingGun.GatlingGunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     GatGunSynergy.NonSynergyGunId = GatlingGun.GatlingGunID;
     GatGunSynergy.SynergyGunId    = GatlingGunGatterUp.GatGunID;
     GatGunSynergy.SynergyToCheck  = "Gatter Up";
     //GONNE - DISCWORLD
     AdvancedTransformGunSynergyProcessor DiscworldSynergy = (PickupObjectDatabase.GetById(Gonne.GonneID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     DiscworldSynergy.NonSynergyGunId = Gonne.GonneID;
     DiscworldSynergy.SynergyGunId    = GonneElder.ElderGonneId;
     DiscworldSynergy.SynergyToCheck  = "Discworld";
     #endregion
     #region ShadowsAndSorcery
     //UTERINE POLYP --- WOMBULAR
     AdvancedTransformGunSynergyProcessor WombularPolypForme = (PickupObjectDatabase.GetById(UterinePolyp.UterinePolypID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     WombularPolypForme.NonSynergyGunId = UterinePolyp.UterinePolypID;
     WombularPolypForme.SynergyGunId    = UterinePolypWombular.WombularPolypID;
     WombularPolypForme.SynergyToCheck  = "Wombular";
     //GAXE ---- DIAMOND GAXE
     AdvancedTransformGunSynergyProcessor DiamondGaxeSyn = (PickupObjectDatabase.GetById(Gaxe.GaxeID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     DiamondGaxeSyn.NonSynergyGunId = Gaxe.GaxeID;
     DiamondGaxeSyn.SynergyGunId    = DiamondGaxe.DiamondGaxeID;
     DiamondGaxeSyn.SynergyToCheck  = "Diamond Gaxe";
     //REBONDIR ---- Rebondissement
     AdvancedTransformGunSynergyProcessor Rebondissement = (PickupObjectDatabase.GetById(Rebondir.RebondirID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     Rebondissement.NonSynergyGunId = Rebondir.RebondirID;
     Rebondissement.SynergyGunId    = RedRebondir.RedRebondirID;
     Rebondissement.SynergyToCheck  = "Rebondissement";
     //DIAMOND CUTTER ------- Ranger Class
     AdvancedTransformGunSynergyProcessor RangerClass = (PickupObjectDatabase.GetById(DiamondCutter.DiamondCutterID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     RangerClass.NonSynergyGunId = DiamondCutter.DiamondCutterID;
     RangerClass.SynergyGunId    = DiamondCutterRangerClass.RedDiamondCutterID;
     RangerClass.SynergyToCheck  = "Ranger Class";
     //STICK GUN ---------- Quick, Draw!
     AdvancedTransformGunSynergyProcessor QuickDraw = (PickupObjectDatabase.GetById(StickGun.StickGunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     QuickDraw.NonSynergyGunId = StickGun.StickGunID;
     QuickDraw.SynergyGunId    = StickGunQuickDraw.FullAutoStickGunID;
     QuickDraw.SynergyToCheck  = "Quick, Draw!";
     //LIGHTNING ROD ------ Storm Rod
     AdvancedTransformGunSynergyProcessor StormRodSyn = (PickupObjectDatabase.GetById(LightningRod.LightningRodID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     StormRodSyn.NonSynergyGunId = LightningRod.LightningRodID;
     StormRodSyn.SynergyGunId    = StormRod.StormRodID;
     StormRodSyn.SynergyToCheck  = "Storm Rod";
     //RUSTY SHOTGUN -------- Proper Care And Maintenance
     AdvancedTransformGunSynergyProcessor ProperCareNMaintenance = (PickupObjectDatabase.GetById(RustyShotgun.RustyShotgunID) as Gun).gameObject.AddComponent <AdvancedTransformGunSynergyProcessor>();
     ProperCareNMaintenance.NonSynergyGunId = RustyShotgun.RustyShotgunID;
     ProperCareNMaintenance.SynergyGunId    = UnrustyShotgun.UnrustyShotgunID;
     ProperCareNMaintenance.SynergyToCheck  = "Proper Care & Maintenance";
     #endregion
     //-------------------------------------------------------------DUAL WIELDING
     #region Dual Wielding
     //STUN GUN & TRANQ GUN
     AdvancedDualWieldSynergyProcessor StunTranqDualSTUN = (PickupObjectDatabase.GetById(StunGun.StunGunID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     StunTranqDualSTUN.PartnerGunID       = 42;
     StunTranqDualSTUN.SynergyNameToCheck = "Non Lethal Solutions";
     AdvancedDualWieldSynergyProcessor StunTranqDualTRANK = (PickupObjectDatabase.GetById(42) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     StunTranqDualTRANK.PartnerGunID       = StunGun.StunGunID;
     StunTranqDualTRANK.SynergyNameToCheck = "Non Lethal Solutions";
     //BLOWGUN & POISON DART FROG
     AdvancedDualWieldSynergyProcessor BlowFrogDualBLOW = (PickupObjectDatabase.GetById(Blowgun.BlowgunID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     BlowFrogDualBLOW.PartnerGunID       = PoisonDartFrog.PoisonDartFrogID;
     BlowFrogDualBLOW.SynergyNameToCheck = "Dartistry";
     AdvancedDualWieldSynergyProcessor BlowFrogDualFROG = (PickupObjectDatabase.GetById(PoisonDartFrog.PoisonDartFrogID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     BlowFrogDualFROG.PartnerGunID       = Blowgun.BlowgunID;
     BlowFrogDualFROG.SynergyNameToCheck = "Dartistry";
     //BOOKLLET & LOREBOOK
     AdvancedDualWieldSynergyProcessor BooklletLorebookDualLORE = (PickupObjectDatabase.GetById(Lorebook.LorebookID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     BooklletLorebookDualLORE.PartnerGunID       = Bookllet.BooklletID;
     BooklletLorebookDualLORE.SynergyNameToCheck = "Librarian";
     AdvancedDualWieldSynergyProcessor BooklletLorebookDualBOOK = (PickupObjectDatabase.GetById(Bookllet.BooklletID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     BooklletLorebookDualBOOK.PartnerGunID       = Lorebook.LorebookID;
     BooklletLorebookDualBOOK.SynergyNameToCheck = "Librarian";
     //WELROD & WELGUN
     AdvancedDualWieldSynergyProcessor WelWelDualROD = (PickupObjectDatabase.GetById(Welrod.WelrodID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     WelWelDualROD.PartnerGunID       = Welgun.WelgunID;
     WelWelDualROD.SynergyNameToCheck = "Wel Wel Wel";
     AdvancedDualWieldSynergyProcessor WelWelDualGUN = (PickupObjectDatabase.GetById(Welgun.WelgunID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     WelWelDualGUN.PartnerGunID       = Welrod.WelrodID;
     WelWelDualGUN.SynergyNameToCheck = "Wel Wel Wel";
     //SHOTGUN WEDDING
     AdvancedDualWieldSynergyProcessor WeddingBride = (PickupObjectDatabase.GetById(TheBride.TheBrideID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     WeddingBride.PartnerGunID       = TheGroom.TheGroomID;
     WeddingBride.SynergyNameToCheck = "Shotgun Wedding";
     AdvancedDualWieldSynergyProcessor WeddingGroom = (PickupObjectDatabase.GetById(TheGroom.TheGroomID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     WeddingGroom.PartnerGunID       = TheBride.TheBrideID;
     WeddingGroom.SynergyNameToCheck = "Shotgun Wedding";
     //SUPER BOUNCE BROS
     AdvancedDualWieldSynergyProcessor SBBRico = (PickupObjectDatabase.GetById(Rico.RicoID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     SBBRico.PartnerGunID       = Rebondir.RebondirID;
     SBBRico.SynergyNameToCheck = "Super Bounce Bros";
     AdvancedDualWieldSynergyProcessor SBBRebondir = (PickupObjectDatabase.GetById(Rebondir.RebondirID) as Gun).gameObject.AddComponent <AdvancedDualWieldSynergyProcessor>();
     SBBRebondir.PartnerGunID       = Rico.RicoID;
     SBBRebondir.SynergyNameToCheck = "Super Bounce Bros";
     #endregion
 }
Example #30
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);
        }