Exemple #1
0
        //Call this method from the Start() method of your ETGModule extension class
        public static void Init()
        {
            //The name of the item
            string itemName = "Sweating Bullets";

            //Refers to an embedded png in the project. Make sure to embed your resources! Google it.
            string resourceName = "ItemAPI/Resources/sweating_bullets_icon";

            //Create new GameObject
            GameObject obj = new GameObject(itemName);

            //Add a ActiveItem component to the object
            var item = obj.AddComponent <ExampleActive>();

            //Adds a tk2dSprite component to the object and adds your texture to the item sprite collection
            ItemBuilder.AddSpriteToObject(itemName, resourceName, obj);

            //Ammonomicon entry variables
            string shortDesc = "Is it Hot in Here?";
            string longDesc  = "While active, triples bullet damage, but reduces health to 1 hit. \n\nDon't get nervous!";

            //Adds the item to the gungeon item list, the ammonomicon, the loot table, etc.
            //"kts" here is the item pool. In the console you'd type kts:sweating_bullets
            ItemBuilder.SetupItem(item, shortDesc, longDesc, "kts");

            //Set the cooldown type and duration of the cooldown
            ItemBuilder.SetCooldownType(item, ItemBuilder.CooldownType.Damage, 500);

            //Adds a passive modifier, like curse, coolness, damage, etc. to the item. Works for passives and actives.
            ItemBuilder.AddPassiveStatModifier(item, PlayerStats.StatType.Curse, 1);

            //Set some other fields
            item.consumable = false;
            item.quality    = ItemQuality.C;

            //Create a synergy entry with hot lead as the other mandatory item.
            List <string> mandatorySynergyItems = new List <string>()
            {
                "kts:sweating_bullets", "hot_lead"
            };

            CustomSynergies.Add("Is it hotter in here?", mandatorySynergyItems);
        }
Exemple #2
0
        // Token: 0x060000C7 RID: 199 RVA: 0x00009464 File Offset: 0x00007664
        public static AdvancedSynergyEntry Add(string name, List <string> mandatoryConsoleIDs, List <string> optionalConsoleIDs = null, bool ignoreLichEyeBullets = true)
        {
            bool flag = mandatoryConsoleIDs == null || mandatoryConsoleIDs.Count == 0;
            AdvancedSynergyEntry result;

            if (flag)
            {
                ETGModConsole.Log("Synergy " + name + " has no mandatory items/guns.", false);
                result = null;
            }
            else
            {
                List <int> list  = new List <int>();
                List <int> list2 = new List <int>();
                List <int> list3 = new List <int>();
                List <int> list4 = new List <int>();
                foreach (string text in mandatoryConsoleIDs)
                {
                    PickupObject pickupObject = Game.Items[text];
                    bool         flag2        = pickupObject && pickupObject.GetComponent <Gun>();
                    if (flag2)
                    {
                        list2.Add(pickupObject.PickupObjectId);
                    }
                    else
                    {
                        bool flag3 = pickupObject && (pickupObject.GetComponent <PlayerItem>() || pickupObject.GetComponent <PassiveItem>());
                        if (flag3)
                        {
                            list.Add(pickupObject.PickupObjectId);
                        }
                    }
                }
                bool flag4 = optionalConsoleIDs != null;
                if (flag4)
                {
                    foreach (string text2 in optionalConsoleIDs)
                    {
                        PickupObject pickupObject = Game.Items[text2];
                        bool         flag5        = pickupObject && pickupObject.GetComponent <Gun>();
                        if (flag5)
                        {
                            list4.Add(pickupObject.PickupObjectId);
                        }
                        else
                        {
                            bool flag6 = pickupObject && (pickupObject.GetComponent <PlayerItem>() || pickupObject.GetComponent <PassiveItem>());
                            if (flag6)
                            {
                                list3.Add(pickupObject.PickupObjectId);
                            }
                        }
                    }
                }
                AdvancedSynergyEntry advancedSynergyEntry = new AdvancedSynergyEntry
                {
                    NameKey          = name,
                    MandatoryItemIDs = list,
                    MandatoryGunIDs  = list2,
                    OptionalItemIDs  = list3,
                    OptionalGunIDs   = list4,
                    bonusSynergies   = new List <CustomSynergyType>(),
                    statModifiers    = new List <StatModifier>()
                };
                CustomSynergies.Add(advancedSynergyEntry);
                result = advancedSynergyEntry;
            }
            return(result);
        }