コード例 #1
0
        public override void Load(TagCompound tag)
        {
            VitricBiome.X      = (int)tag.Get <Vector2>("VitricBiomePos").X;
            VitricBiome.Y      = (int)tag.Get <Vector2>("VitricBiomePos").Y;
            VitricBiome.Width  = (int)tag.Get <Vector2>("VitricBiomeSize").X;
            VitricBiome.Height = (int)tag.Get <Vector2>("VitricBiomeSize").Y;

            SquidNPCProgress      = tag.GetInt("SquidNPCProgress");
            SquidBossArena.X      = (int)tag.Get <Vector2>("SquidBossArenaPos").X;
            SquidBossArena.Y      = (int)tag.Get <Vector2>("SquidBossArenaPos").Y;
            SquidBossArena.Width  = (int)tag.Get <Vector2>("SquidBossArenaSize").X;
            SquidBossArena.Height = (int)tag.Get <Vector2>("SquidBossArenaSize").Y;
            permafrostCenter      = tag.GetInt("PermafrostCenter");

            flags = (WorldFlags)tag.GetInt(nameof(flags));

            TagCompound tag1 = tag.GetCompound(nameof(TownUpgrades));
            Dictionary <string, bool> targetDict = new Dictionary <string, bool>();

            foreach (KeyValuePair <string, object> pair in tag1)
            {
                targetDict.Add(pair.Key, tag1.GetBool(pair.Key));
            }

            TownUpgrades = targetDict;

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

            RiftLocation = tag.Get <Vector2>(nameof(RiftLocation));

            Chungus  = tag.GetFloat("Chungus");
            Chungus += 0.01f;

            knownRecipies = (List <string>)tag.GetList <string>("Recipies");

            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++)
                    {
                        PurifyTransformation.RevertTile(i, j);
                    }
                }
            }

            PureTiles.Clear();

            foreach (Key key in KeyInventory)
            {
                Content.GUI.KeyInventory.keys.Add(new Content.GUI.KeyIcon(key, false));
            }

            //setup overlays
            cathedralOverlay = new Cutaway(GetTexture("StarlightRiver/Assets/Bosses/SquidBoss/CathedralOver"), SquidBossArena.TopLeft() * 16);
        }
コード例 #2
0
        public static void CreateCutaways()
        {
            //TODO: Create new overlay for this when the structure is done

            /*var templeCutaway = new Cutaway(GetTexture("StarlightRiver/Assets/Backgrounds/TempleCutaway"), new Vector2(VitricBiome.Center.X - 47, VitricBiome.Center.Y + 5) * 16);
             * templeCutaway.inside = n => n.GetModPlayer<BiomeHandler>().ZoneGlassTemple;
             * CutawayHandler.NewCutaway(templeCutaway);*/

            cathedralOverlay        = new Cutaway(GetTexture("StarlightRiver/Assets/Bosses/SquidBoss/CathedralOver"), SquidBossArena.TopLeft() * 16);
            cathedralOverlay.inside = CheckForSquidArena;
            CutawayHandler.NewCutaway(cathedralOverlay);
        }