Ejemplo n.º 1
0
        private void loadInResourceItems()
        {
            CustomObject sand = new CustomObject(new BasicItemInformation("Sand", "Revitalize.Items.Resources.Misc.Sand", "Sand which is made from tiny rocks and can be used for smelting. Also unfun to have inside of swimwear.", "Resource", Color.Brown, -300, -300, 0, false, 2, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Misc", "Sand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null));

            this.resources.Add("Sand", sand);

            CustomObject glass_normal = new CustomObject(new BasicItemInformation("Glass", "Revitalize.Items.Resources.Misc.Glass", "Glass smelted from sand. Used in decorations and glass objects.", "Resource", Color.Brown, -300, -300, 0, false, 20, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Misc", "Glass"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null));

            this.resources.Add("Glass", glass_normal);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds in an item to be tracked by the mod's object manager.
 /// </summary>
 /// <param name="key"></param>
 /// <param name="I"></param>
 public void AddItem(string key, CustomObject I)
 {
     if (this.ItemsByName.ContainsKey(key))
     {
         throw new Exception("Item with the same key has already been added into the mod!");
     }
     else
     {
         this.ItemsByName.Add(key, I);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Get a resource from the resource maanger.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="Stack"></param>
        /// <returns></returns>
        public CustomObject getResource(string name, int Stack = 1)
        {
            Ore o = this.getOre(name, Stack);

            if (o != null)
            {
                return(o);
            }

            if (this.resources.ContainsKey(name))
            {
                CustomObject obj = (CustomObject)this.resources[name].getOne();
                obj.Stack = Stack;
                return(obj);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets a list of all of the open quarry tiles.
        /// </summary>
        /// <returns></returns>
        private List <Vector2> getOpenQuarryTiles(CustomObject obj)
        {
            List <Vector2> tiles = new List <Vector2>();

            Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(106, 13, 21, 21);
            for (int i = r.X; i <= r.X + r.Width; i++)
            {
                for (int j = r.Y; j <= r.Y + r.Height; j++)
                {
                    if (this.isTileOpenForQuarryStone(i, j) && this.canResourceBeSpawnedHere(obj, Game1.getLocationFromName("Mountain"), new Vector2(i, j)))
                    {
                        tiles.Add(new Vector2(i, j));
                    }
                }
            }
            if (tiles.Count == 0)
            {
                //ModCore.log("Quarry is full! Can't spawn more resources!");
            }
            return(tiles);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets all of the open tiles in the farm quarry.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        private List <Vector2> getFarmQuarryOpenTiles(CustomObject obj)
        {
            List <Vector2> tiles = new List <Vector2>();

            Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(5, 37, 22, 8);
            GameLocation farm = Game1.getFarm();

            for (int i = r.X; i <= r.X + r.Width; i++)
            {
                for (int j = r.Y; j <= r.Y + r.Height; j++)
                {
                    Vector2 pos = new Vector2(i, j);
                    if (farm.doesTileHavePropertyNoNull((int)pos.X, (int)pos.Y, "Type", "Back").Equals("Dirt") && this.canResourceBeSpawnedHere(obj, farm, new Vector2(i, j)))
                    {
                        tiles.Add(pos);
                    }
                }
            }
            if (tiles.Count == 0)
            {
                //ModCore.log("Quarry is full! Can't spawn more resources!");
            }
            return(tiles);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Checks to see if a resource can be spawned here.
 /// </summary>
 /// <param name="OBJ"></param>
 /// <param name="Location"></param>
 /// <param name="TilePosition"></param>
 /// <returns></returns>
 public bool canResourceBeSpawnedHere(CustomObject OBJ, GameLocation Location, Vector2 TilePosition)
 {
     return(OBJ.canBePlacedHere(Location, TilePosition) && Location.isTileLocationTotallyClearAndPlaceable(TilePosition));
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Loads in all of the ore items into the game.
        /// </summary>
        private void loadInOreItems()
        {
            Ore tinOre = new Ore(new BasicItemInformation("Tin Ore", "Revitalize.Items.Resources.Ore.TinOre", "Tin ore that can be smelted into tin ingots for further use.", "Ore", Color.Silver, -300, -300, 0, false, 7, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinOre"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            this.ores.Add("Tin", tinOre);

            Ore bauxiteOre = new Ore(new BasicItemInformation("Bauxite Ore", "Revitalize.Items.Resources.Ore.BauxiteOre", "Bauxite ore that can be smelted into aluminum ingots for further use.", "Ore", Color.Silver, -300, -300, 0, false, 11, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BauxiteOre"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            this.ores.Add("Bauxite", bauxiteOre);
            this.ores.Add("Aluminum", bauxiteOre);

            Ore leadOre = new Ore(new BasicItemInformation("Lead Ore", "Revitalize.Items.Resources.Ore.LeadOre", "Lead ore that can be smelted into lead ingots for further use.", "Ore", Color.Silver, -300, -300, 0, false, 15, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "LeadOre"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            this.ores.Add("Lead", leadOre);

            Ore silverOre = new Ore(new BasicItemInformation("Silver Ore", "Revitalize.Items.Resources.Ore.SilverOre", "Silver ore that can be smelted into silver ingots for further use.", "Ore", Color.Silver, -300, -300, 0, false, 20, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverOre"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            this.ores.Add("Silver", silverOre);

            Ore titaniumOre = new Ore(new BasicItemInformation("Titanium Ore", "Revitalize.Items.Resources.Ore.TitaniumOre", "Titanium ore that can be smelted into titanium ingots for further use.", "Ore", Color.Silver, -300, -300, 0, false, 35, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumOre"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            this.ores.Add("Titanium", titaniumOre);

            Ore prismaticOre = new Ore(new BasicItemInformation("Prismatic Nugget", "Revitalize.Items.Resources.Ore.PrismaticNugget", "Rare prismatic ore that can be smelted into a prismatic shard when seven are gathered.", "Ore", Color.Silver, -300, -300, 0, false, 200, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "PrismaticNugget"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            this.ores.Add("PrismaticNugget", prismaticOre);

            CustomObject tinIngot = new CustomObject(new BasicItemInformation("Tin Ingot", "Revitalize.Items.Resources.Ore.TinIngot", "A tin ingot that can be used for crafting purposes.", "Metal", Color.Silver, -300, -300, 0, false, 75, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("TinIngot", tinIngot);

            CustomObject aluminumIngot = new CustomObject(new BasicItemInformation("Aluminum Ingot", "Revitalize.Items.Resources.Ore.AluminumIngot", "An aluminum ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, -300, 0, false, 120, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "AluminumIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("AluminumIngot", aluminumIngot);

            CustomObject leadIngot = new CustomObject(new BasicItemInformation("Lead Ingot", "Revitalize.Items.Resources.Ore.LeadIngot", "A lead ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, -300, 0, false, 165, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "LeadIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("LeadIngot", leadIngot);

            CustomObject silverIngot = new CustomObject(new BasicItemInformation("Silver Ingot", "Revitalize.Items.Resources.Ore.SilverIngot", "A silver ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, -300, 0, false, 220, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("SilverIngot", silverIngot);

            CustomObject titaniumIngot = new CustomObject(new BasicItemInformation("Titanium Ingot", "Revitalize.Items.Resources.Ore.TitaniumIngot", "A titanium ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, -300, 0, false, 325, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("TitaniumIngot", titaniumIngot);

            CustomObject brassIngot = new CustomObject(new BasicItemInformation("Brass Ingot", "Revitalize.Items.Resources.Ore.BrassIngot", "A brass alloy ingot made from copper and aluminum. It can be used for crafting purposes.", "Ore", Color.Silver, -300, -300, 0, false, 195, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BrassIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("BrassIngot", brassIngot);

            CustomObject bronzeIngot = new CustomObject(new BasicItemInformation("Bronze Ingot", "Revitalize.Items.Resources.Ore.BronzeIngot", "A bronze alloy ingot made from copper and tin. It can be used for crafting purposes.", "Ore", Color.Silver, -300, -300, 0, false, 150, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BronzeIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("BronzeIngot", bronzeIngot);

            CustomObject electrumIngot = new CustomObject(new BasicItemInformation("Electrum Ingot", "Revitalize.Items.Resources.Ore.ElectrumIngot", "A electrum alloy ingot made from gold and silver. It can be used for crafting purposes for things that use electricity.", "Ore", Color.Silver, -300, -300, 0, false, 500, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "ElectrumIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("ElectrumIngot", electrumIngot);

            CustomObject steelIngot = new CustomObject(new BasicItemInformation("Steel Ingot", "Revitalize.Items.Resources.Ore.SteelIngot", "A steel ingot that was made by processing iron again with more coal. It can be used for crafting purposes especially for making new machines.", "Ore", Color.Silver, -300, -300, 0, false, 180, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SteelIngot"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            ModCore.ObjectManager.AddItem("SteelIngot", steelIngot);

            CustomObject bauxiteSand  = new CustomObject(new BasicItemInformation("Bauxite Sand", "Revitalize.Items.Resources.Ore.BauxiteSand", "Bauxite ore which has been crushed into sand. Smelt it to get aluminum ingots.", "Ore", Color.Silver, -300, -300, 0, false, 11, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BauxiteSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject copperSand   = new CustomObject(new BasicItemInformation("Copper Sand", "Revitalize.Items.Resources.Ore.CopperSand", "Copper ore which has been crushed into sand. Smelt it to get copper bars.", "Ore", Color.Silver, -300, -300, 0, false, 5, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "CopperSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject goldSand     = new CustomObject(new BasicItemInformation("Gold Sand", "Revitalize.Items.Resources.Ore.GoldSand", "Gold ore which has been crushed into sand. Smelt it to get gold bars.", "Ore", Color.Silver, -300, -300, 0, false, 25, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "GoldSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject ironSand     = new CustomObject(new BasicItemInformation("Iron Sand", "Revitalize.Items.Resources.Ore.IronSand", "Iron ore which has been crushed into sand. Smelt it to get iron bars.", "Ore", Color.Silver, -300, -300, 0, false, 10, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "IronSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject iridiumSand  = new CustomObject(new BasicItemInformation("Iridium Sand", "Revitalize.Items.Resources.Ore.IridiumSand", "Iridium ore which has been crushed into sand. Smelt it to get iridium bars.", "Ore", Color.Silver, -300, -300, 0, false, 100, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "IridiumSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject leadSand     = new CustomObject(new BasicItemInformation("Lead Sand", "Revitalize.Items.Resources.Ore.LeadSand", "Lead ore which has been crushed into sand. Smelt it to get lead ingots.", "Ore", Color.Silver, -300, -300, 0, false, 15, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "LeadSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject silverSand   = new CustomObject(new BasicItemInformation("Silver Sand", "Revitalize.Items.Resources.Ore.SilverSand", "Silver ore which has been crushed into sand. Smelt it to get silver ingots.", "Ore", Color.Silver, -300, -300, 0, false, 20, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject tinSand      = new CustomObject(new BasicItemInformation("Tin Sand", "Revitalize.Items.Resources.Ore.TinSand", "Tin ore which has been crushed into sand. Smelt it to get tin ingots.", "Ore", Color.Silver, -300, -300, 0, false, 7, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);
            CustomObject titaniumSand = new CustomObject(new BasicItemInformation("Copper Sand", "Revitalize.Items.Resources.Ore.TitaniumSand", "Titanium ore which has been crushed into sand. Smelt it to get titanium bars.", "Ore", Color.Silver, -300, -300, 0, false, 35, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumSand"), new AnimationManager(), Color.White, true, new Vector2(1, 1), null, null), 1);

            this.resources.Add("BauxiteSand", bauxiteSand);
            this.resources.Add("CopperSand", copperSand);
            this.resources.Add("GoldSand", goldSand);
            this.resources.Add("IronSand", ironSand);
            this.resources.Add("IridiumSand", iridiumSand);
            this.resources.Add("LeadSand", leadSand);
            this.resources.Add("SilverSand", silverSand);
            this.resources.Add("TinSand", tinSand);
            this.resources.Add("TitaniumSand", titaniumSand);
        }