Пример #1
0
        public override void Load(TagCompound tag)
        {
            if (!tag.ContainsKey("EmitterMode"))
            {
                return;
            }

            try {
                this.SetDefinition(new EmitterDefinition(
                                       isGoreMode: tag.GetBool("EmitterMode"),
                                       type: tag.GetInt("EmitterType"),
                                       scale: tag.GetFloat("EmitterScale"),
                                       delay: tag.GetInt("EmitterDelay"),
                                       speedX: tag.GetFloat("EmitterSpeedX"),
                                       speedY: tag.GetFloat("EmitterSpeedY"),
                                       color: new Color(
                                           tag.GetByte("EmitterColorR"),
                                           tag.GetByte("EmitterColorG"),
                                           tag.GetByte("EmitterColorB")
                                           ),
                                       transparency: tag.GetByte("EmitterAlpha"),
                                       scatter: tag.GetFloat("EmitterScatter"),
                                       hasGravity: tag.GetBool("EmitterHasGrav"),
                                       hasLight: tag.GetBool("EmitterHasLight"),
                                       isActivated: tag.GetBool("EmitterIsActivated")
                                       ));
            } catch { }
        }
Пример #2
0
 public override void Load(TagCompound tag)
 {
     hasEndlessAmmo      = tag.GetBool(nameof(hasEndlessAmmo));
     useEndlessAmmoFirst = tag.GetBool(nameof(useEndlessAmmoFirst));
     UnlockedAmmo        = tag.Get <List <Item> >(nameof(UnlockedAmmo));
     SelectedAmmo        = tag.Get <List <bool> >(nameof(SelectedAmmo));
 }
Пример #3
0
        ////////////////

        public override void Load(TagCompound tag)
        {
            if (!tag.ContainsKey("hud_element_count"))
            {
                return;
            }

            //

            var        mymod   = ModContent.GetInstance <HUDElementsLibMod>();
            HUDManager hudMngr = mymod.HUDManager;

            //

            int count = tag.GetInt("hud_element_count");

            for (int i = 0; i < count; i++)
            {
                string name             = tag.GetString($"hud_element_{i}");
                float  x                = tag.GetFloat($"hud_element_x_{i}");
                float  y                = tag.GetFloat($"hud_element_y_{i}");
                bool   hasCollisionData = tag.ContainsKey($"hud_element_cc_{i}")
                                        ? (bool)tag.GetBool($"hud_element_cc_{i}")
                                        : false;
                bool?isIgnoringCollisions = hasCollisionData
                                        ? (bool?)tag.GetBool($"hud_element_c_{i}")
                                        : (bool?)null;

                hudMngr.LoadHUDElementInfo(name, x, y, isIgnoringCollisions);
            }
        }
 public override void Load(TagCompound tag)
 {
     eclipsePassed     = tag.GetBool("eclipsePassed");
     pumpkinMoonPassed = tag.GetBool("pumpkinMoonPassed");
     snowMoonPassed    = tag.GetBool("snowMoonPassed");
     downedPhantom     = tag.GetBool("downedPhantom");
     downedAbomination = tag.GetBool("downedAbomination");
     if (tag.ContainsKey("numPuriumGens"))
     {
         elementalUnleash = tag.GetBool("elementalUnleash");
         numPuriumGens    = tag.GetInt("numPuriumGens");
     }
     else
     {
         numPuriumGens    = tag.GetInt("elementalUnleash");
         elementalUnleash = numPuriumGens > 0;
     }
     downedPuritySpirit = tag.GetBool("downedPuritySpirit");
     downedChaosSpirit  = tag.GetBool("downedChaosSpirit");
     terraDeaths        = tag.GetInt("terraDeaths");
     terraCheckpoint1   = tag.GetInt("terraCheckpoint1");
     terraCheckpoint2   = tag.GetInt("terraCheckpoint2");
     terraCheckpoint3   = tag.GetInt("terraCheckpoint3");
     terraCheckpointS   = tag.GetInt("terraCheckpointS");
     downedTerraSpirit  = tag.GetBool("downedTerraSpirit");
     blushieCheckpoint  = tag.GetFloat("blushieCheckpoint");
     downedBlushie      = tag.GetBool("downedBlushie");
     FixCheckpoints();
 }
Пример #5
0
        public override void Load(Item item, TagCompound tag)
        {
            try {
                UpgradeInfo info          = item.GetGlobalItem <UpgradeInfo>(mod);
                String      baseName      = tag.GetString("baseName");
                int         baseArmor     = tag.GetInt("baseArmor");
                int         baseDamage    = tag.GetInt("baseDamage");
                int         baseCrit      = tag.GetInt("baseCrit");
                bool        upgraded      = tag.GetBool("upgraded");
                bool        elemented     = tag.GetBool("elemented");
                bool        broken        = tag.GetBool("broken");
                String      elementType   = tag.GetString("elementType");
                int         elementDamage = tag.GetInt("elementDamage");
                int         level         = tag.GetInt("level");
                int         modifier      = tag.GetInt("modifier");
                String      socket1       = tag.GetString("socket1");
                String      socket2       = tag.GetString("socket2");
                String      socket3       = tag.GetString("socket3");
                String      modName       = tag.GetString("modName");

                if (ModLoader.GetMod(modName) != null)
                {
                    info.SetProperties(baseName, baseArmor, baseDamage, baseCrit, upgraded, elemented, broken, elementType, elementDamage, level, modifier, socket1, socket2, socket3, item);
                }
                else
                {
                    info.ResetProperties();
                }
            }
            catch (Exception e) {
                ErrorLogger.Log(e.ToString());
            }
        }
Пример #6
0
        public override void Load(TagCompound tag)
        {
            AddTime = tag.GetIntArray("AddTime");
            tTime   = tag.GetInt("tTime");

            Body = tag.GetBool("Body");
            if (Body)
            {
                BodyType   = tag.GetString("BodyType");
                Health     = tag.GetIntArray("Health");
                Mana       = tag.GetIntArray("Mana");
                Health2    = tag.GetIntArray("Health2");
                Mana       = tag.GetIntArray("Mana");
                Eyes       = tag.Get <Color>("Eyes");
                Skin       = tag.Get <Color>("Skin");
                HairC      = tag.Get <Color>("HairC");
                Hair       = tag.GetInt("Hair");
                Shirt      = tag.Get <Color>("Shirt");
                UnderShirt = tag.Get <Color>("UnderShirt");
                Pants      = tag.Get <Color>("Pants");
                Shoes      = tag.Get <Color>("Shoes");
                Gender     = tag.GetBool("Gender");
            }

            Fetuses = tag.GetInt("Fetuses");
        }
Пример #7
0
 public override void Load(TagCompound tag)
 {
     LoadSlain(tag);
     tag.GetBool("DownedVortex");
     tag.GetBool("DownedNebula");
     tag.GetBool("DownedStardust");
     tag.GetBool("DownedSolar");
 }
Пример #8
0
 public override void Load(TagCompound tag)
 {
     BetterZoom.zoom           = tag.GetFloat("zoom");
     BetterZoom.uiScale        = tag.GetFloat("uiscale");
     BetterZoom.flipBackground = tag.GetBool("flipbackground");
     BetterZoom.hotbarScale    = tag.GetFloat("hotbarscale");
     BetterZoom.zoomBackground = tag.GetBool("zoombackground");
 }
Пример #9
0
 public override void Load(TagCompound tag)
 {
     CurrentQuest   = tag.GetInt("Current");
     CompletedToday = tag.GetBool("Today");
     CompletedTotal = tag.GetInt("Total");
     PirateQuest    = tag.GetBool("PirateQuest");
     QuestKills     = tag.GetInt("QuestKills");
 }
Пример #10
0
 public override void Load(TagCompound tag)
 {
     score             = tag.GetInt("score");
     exampleLifeFruits = tag.GetInt("exampleLifeFruits");
     // nonStopParty was added after the initial ExampleMod release. Read https://github.com/blushiemagic/tModLoader/wiki/Saving-and-loading-using-TagCompound#mod-version-updates for information about how to handle version updates in your mod without messing up current users of your mod.
     nonStopParty = tag.GetBool("nonStopParty");
     examplePersonGiftReceived = tag.GetBool(nameof(examplePersonGiftReceived));
 }
Пример #11
0
        public override void Load(TagCompound tag)
        {
            AutoTrashItems   = tag.Get <List <Item> >("AutoTrashItems");
            AutoTrashEnabled = tag.GetBool("AutoTrashEnabled");
            NoValue          = tag.GetBool(nameof(NoValue));

            AutoTrash.instance.autoTrashListUI?.UpdateNeeded();
        }
Пример #12
0
 public override void Load(TagCompound tag)
 {
     base.Load(tag);
     choseJob    = tag.GetBool("choseJob");
     job         = tag.GetInt("job");
     armorJob    = tag.GetInt("armorJob");
     defeatedWoF = tag.GetBool("defeatedWoF");
     rogueBonus  = tag.GetBool("rogueBonus");
 }
Пример #13
0
            public override void CustomLoadQuest(string QuestKey, TagCompound Reader, int ModVersion)
            {
                int Version = Reader.GetInt(QuestKey + "_Version");

                LunaTalkedAboutTutorial = Reader.GetBool(QuestKey + "_TalkedAboutTuto");
                CallingStep             = Reader.GetByte(QuestKey + "_CallTutoStep");
                OrderTutorialStep       = Reader.GetByte(QuestKey + "_OrderTutoStep");
                TalkedAboutTentants     = Reader.GetBool(QuestKey + "_TenantTutoStep");
            }
Пример #14
0
 public override void Load(TagCompound tag)
 {
     DownedMarx1 = false;
     DownedMarx2 = false;
     DownedMarx3 = false;
     DownedMarx1 = tag.GetBool("DownedMarx1");
     DownedMarx2 = tag.GetBool("DownedMarx2");
     DownedMarx3 = tag.GetBool("DownedMarx3");
 }
Пример #15
0
        public override void Load(TagCompound tag)
        {
            voidTier2Unlocked = tag.GetBool("tier2");
            voidTier3Unlocked = tag.GetBool("tier3");
            voidTier4Unlocked = tag.GetBool("tier4");
            voidAffinity      = tag.GetInt("affinity");

            UIManager.OpenVoidUI();
        }
Пример #16
0
 public override void Load(TagCompound tag)
 {
     warDemon    = tag.GetBool("warDemon");
     mageDemon   = tag.GetBool("mageDemon");
     shootDemon  = tag.GetBool("shootDemon");
     summonDemon = tag.GetBool("summonDemon");
     demonPower  = tag.GetInt("demonPower");
     demonPower  = tag.GetInt("currentPower");
 }
Пример #17
0
 public override void Load(TagCompound tag)
 {
     tvEquip       = tag.GetBool("Ks");
     tvEquip       = tag.GetBool("Virus");
     wofEquip      = tag.GetBool("Wof");
     heartEmblem   = tag.GetInt("HEmblem");
     goldenStars   = tag.GetInt("GStars");
     lunarStars    = tag.GetInt("LStars");
     lunarBlessing = tag.GetBool("LBlessing");
 }
Пример #18
0
 public override void Load(TagCompound tag)
 {
     itemList      = tag.GetIntArray(nameof(itemList));
     itemStackList = tag.GetIntArray(nameof(itemStackList));
     ChestType     = tag.GetAsShort(nameof(ChestType));
     ChestName     = tag.GetString(nameof(ChestName));
     inventorySpot = tag.GetAsInt(nameof(inventorySpot));
     firstTick     = tag.GetBool(nameof(firstTick));
     GotChest      = tag.GetBool(nameof(GotChest));
 }
Пример #19
0
        public override void Load(TagCompound tag)
        {
            //Perm
            kingSlimeEffect = tag.GetBool("kingSlimeEffect");
            eoCEffect       = tag.GetBool("eoCEffect");

            //Life / mana

            lifeFractals = tag.GetInt("lifeFractals");
            manaFractals = tag.GetInt("manaFractals");
        }
Пример #20
0
 public override void LoadData(TagCompound tag)
 {
     partyUpgrades = tag.GetIntArray("partyUpgrades");
     playerCreated = tag.GetBool("playerCreated");
     playerDied    = tag.GetBool("playerDied");
     if (tag.ContainsKey("playerSpawn"))
     {
         originalSpawnPoint = tag.Get <Vector2>("playerSpawn");
     }
     KingdomTerrahearts.instance.ShowDialogUI();
 }
Пример #21
0
            public override void CustomLoadQuest(string QuestKey, TagCompound Reader, int ModVersion)
            {
                byte Version = Reader.GetByte(QuestKey + "_Version");

                for (int i = 0; i < 4; i++)
                {
                    SolidificationRequestGiven[i] = Reader.GetBool(QuestKey + "_SolReq_" + i);
                    SolidificationUnlocked[i]     = Reader.GetBool(QuestKey + "_SolUnlock_" + 1);
                }
                SpokeToLeopoldAboutTheEmotionalPigs = Reader.GetBool(QuestKey + "_LeopoldKnows");
                UnlockedBland = Reader.GetBool(QuestKey + "_BlandUnlocked");
            }
Пример #22
0
 public override void Load(TagCompound tag)
 {
     if (tag.ContainsKey("Starjinx Active?"))
     {
         StarjinxActive = tag.GetBool("Starjinx Active?");
     }
     if (tag.ContainsKey("Starjinx Defeated?"))
     {
         StarjinxDefeated = tag.GetBool("Starjinx Defeated?");
     }
     SpawnedStarjinx = false;
 }
Пример #23
0
            public override void CustomLoadQuest(string QuestKey, TagCompound Reader, int ModVersion)
            {
                int Version = Reader.GetInt("Version");

                if (Version > 0)
                {
                    BlueDialogueStep    = Reader.GetByte("BlueDialogueStep");
                    BlueWasPresent      = Reader.GetBool("BlueWasPresent");
                    SpokeToBluePosQuest = Reader.GetBool("SpokeToBluePosQuest");
                    SpottedZacksOnce    = Reader.GetByte("SpottedZacksonce");
                }
            }
Пример #24
0
        public static BagPickup Load(TagCompound tag)
        {
            var bP = new BagPickup(0, false)
            {
                contained        = tag.Get <List <Item> >(nameof(contained)),
                limit            = tag.GetInt(nameof(limit)),
                doPickup         = tag.GetBool(nameof(doPickup)),
                starterBagOpened = tag.GetBool(nameof(starterBagOpened))
            };

            return(bP);
        }
Пример #25
0
        public override void Load(TagCompound tag)
        {
            vitricTopLeft   = tag.Get <Vector2>(nameof(vitricTopLeft));
            AnyBossDowned   = tag.GetBool(nameof(AnyBossDowned));
            GlassBossDowned = tag.GetBool(nameof(GlassBossDowned));
            SealOpen        = tag.GetBool(nameof(SealOpen));

            ForceStarfall = tag.GetBool(nameof(ForceStarfall));

            NPCUpgrades = tag.GetIntArray(nameof(NPCUpgrades));

            PureTiles      = (List <Vector2>)tag.GetList <Vector2>(nameof(PureTiles));
            PureSpawnPoint = tag.Get <Vector2>(nameof(PureSpawnPoint));


            for (int k = 0; k <= PureTiles.Count - 1; k++)
            {
                for (int i = (int)PureTiles[k].X - 16; i <= (int)PureTiles[k].X + 16; i++)
                {
                    for (int j = (int)PureTiles[k].Y - 16; j <= (int)PureTiles[k].Y + 16; j++)
                    {
                        Tile target = Main.tile[i, j];
                        if (target != null)
                        {
                            if (target.type == (ushort)mod.TileType("StonePure"))
                            {
                                target.type = TileID.Stone;
                            }
                            if (target.type == (ushort)mod.TileType("OreIvory"))
                            {
                                target.type = (ushort)mod.TileType("OreEbony");
                            }
                            if (target.type == (ushort)mod.TileType("VoidDoorOff"))
                            {
                                target.type = (ushort)mod.TileType("VoidDoorOn");
                            }
                        }
                    }
                }
            }

            foreach (NPC npc in Main.npc)
            {
                if (npc.townNPC)
                {
                    npc.life = 250 + NPCUpgrades[0] * 50;
                }
            }
            PureTiles.Clear();
            PureTiles = new List <Vector2> {
            };
        }
Пример #26
0
 public override void Load(TagCompound tag)
 {
     resetDefaultColors = false;
     if ((tag.ContainsKey("Race") && RaceLoader.TryGetRace(tag.GetString("Race"), out var loadedRace)) || (tag.ContainsKey("PlayerRace") && RaceLoader.TryGetRaceFromLegacyId(tag.GetInt("PlayerRace"), out loadedRace)))
     {
         race = loadedRace;
     }
     RaceStats       = tag.GetBool("RaceStats");
     GotStatToggler  = tag.GetBool("GotStatToggler");
     GotRaceItems    = tag.GetBool("GotRaceItems");
     IsNewCharacter1 = tag.GetBool("IsNewCharacter1");
     IsNewCharacter2 = tag.GetBool("IsNewCharacter2");
     race.Load(player);
 }
 /// <summary>
 /// Load the mod settings.
 /// </summary>
 public override void Load(TagCompound tag)
 {
     SetWings(false, ItemIO.Load(tag.GetCompound(WingsTag)));
     SetWings(true, ItemIO.Load(tag.GetCompound(VanityWingsTag)));
     SetDye(ItemIO.Load(tag.GetCompound(WingDyeTag)));
     EquipSlot.ItemVisible = tag.GetBool(HiddenTag);
 }
Пример #28
0
        public override void Load(TagCompound tag)
        {
            IList <int>  skillKeys         = tag.GetList <int>("hamonSkillKeys");
            IList <bool> skillValues       = tag.GetList <bool>("hamonSkillValues");
            IList <int>  requirementKeys   = tag.GetList <int>("hamonRequirementKeys");
            IList <int>  requirementValues = tag.GetList <int>("hamonRequirementValues");
            IList <int>  levelKeys         = tag.GetList <int>("hamonLevelKeys");
            IList <int>  levelValues       = tag.GetList <int>("hamonLevelValues");

            skillPointsAvailable = tag.GetInt("hamonSkillPoints");
            learnedAnyAbility    = tag.GetBool("learnedAnyAbility");

            /*for (int i = 0; i < keys.Count; i++)
             * {
             *  if (learnedHamonSkills.ContainsKey(keys[i]))
             *  {
             *      learnedHamonSkills[keys[i]] = values[i];
             *  }
             * }*/

            //if (learnedHamonSkills.Count != 0)
            learnedHamonSkills = skillKeys.Zip(skillValues, (key, value) => new { Key = key, Value = value }).ToDictionary(newKey => newKey.Key, newValue => newValue.Value);

            //if (hamonAmountRequirements.Count != 0)
            hamonAmountRequirements = requirementKeys.Zip(requirementValues, (key, value) => new { Key = key, Value = value }).ToDictionary(newKey => newKey.Key, newValue => newValue.Value);

            //if (hamonSkillLevels.Count != 0)
            hamonSkillLevels = levelKeys.Zip(levelValues, (key, value) => new { Key = key, Value = value }).ToDictionary(newKey => newKey.Key, newValue => newValue.Value);
        }
Пример #29
0
        public override void Load(Item item, TagCompound tag)
        {
            TagCompound statBonusTC = tag.GetCompound("StatBonuses");

            this.wasQualified = tag.GetBool("WasQualified");
            this.statBonus.Clear();

            if (this.wasQualified)
            {
                this.quality = (ItemQuality)Enum.Parse(ItemQuality.Common.GetType(), tag.GetString("Quality"));
                foreach (var x in statBonusTC)
                {
                    // Fix for potential error due to removing Intellect from stats
                    if (x.Key != "Intellect")
                    {
                        this.statBonus.Add(x.Key, (int)x.Value);
                    }
                }

                if (this.quality == ItemQuality.Unique)
                {
                    item.expert = true;
                }
            }
        }
Пример #30
0
 public override void Load(TagCompound tag)
 {
     engaged          = tag.GetBool("engaged");
     size             = tag.GetInt("size");
     rotationVelocity = tag.GetFloat("direction");
     rotationOffset   = tag.GetFloat("rotationOffset");
 }
Пример #31
0
        public static void Load(Item item, TagCompound tag)
        {
            if (tag.Count == 0)
            {
                item.netDefaults(0);
                return;
            }

            string modName = tag.GetString("mod");
            if (modName == "Terraria")
            {
                item.netDefaults(tag.GetInt("id"));
                if (tag.HasTag("legacyData"))
                    LoadLegacyModData(item, tag.GetByteArray("legacyData"), tag.GetBool("hasGlobalSaving"));
            }
            else
            {
                int type = ModLoader.GetMod(modName)?.ItemType(tag.GetString("name")) ?? 0;
                if (type > 0)
                {
                    item.netDefaults(type);
                    if (tag.HasTag("legacyData"))
                        LoadLegacyModData(item, tag.GetByteArray("legacyData"), tag.GetBool("hasGlobalSaving"));
                    else
                        item.modItem.Load(tag.GetCompound("data"));
                }
                else
                {
                    item.netDefaults(ModLoader.GetMod("ModLoader").ItemType("MysteryItem"));
                    ((MysteryItem)item.modItem).Setup(tag);
                }
            }

            item.Prefix(tag.GetByte("prefix"));
            item.stack = tag.GetTag<int?>("stack") ?? 1;
            item.favorited = tag.GetBool("fav");

            if (!(item.modItem is MysteryItem))
                LoadGlobals(item, tag.GetList<TagCompound>("globalData"));
        }