Added in remaining ore veins, added in tin ore to ingot recipe for smelting, added in ingots.

This commit is contained in:
JoshuaNavarro 2019-08-22 19:09:58 -07:00
parent 449c3a99ae
commit a558c15f26
13 changed files with 238 additions and 61 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

View File

@ -175,7 +175,7 @@ namespace Revitalize.Framework.Crafting
/// Checks to see if the player can craft this object and if so go ahead and craft it. /// Checks to see if the player can craft this object and if so go ahead and craft it.
/// </summary> /// </summary>
/// <param name="o"></param> /// <param name="o"></param>
public void craft(StardewValley.Object o) public bool craft(StardewValley.Object o)
{ {
if (this.PlayerCanCraft()) if (this.PlayerCanCraft())
{ {
@ -183,7 +183,9 @@ namespace Revitalize.Framework.Crafting
List<Item> outPutItems = new List<Item>(); List<Item> outPutItems = new List<Item>();
ModCore.log("Can craft recipe."); ModCore.log("Can craft recipe.");
this.craft(ref playerItems, ref o); this.craft(ref playerItems, ref o);
} return true;
}
return false;
} }
} }
} }

View File

@ -33,8 +33,9 @@ namespace Revitalize.Framework.Crafting
VanillaRecipe furnace_tinOre = new VanillaRecipe(new Dictionary<Item, int>() VanillaRecipe furnace_tinOre = new VanillaRecipe(new Dictionary<Item, int>()
{ {
{ModCore.ObjectManager.resources.getOre("Tin"),1 } {ModCore.ObjectManager.resources.getOre("Tin"),5 },
}, new KeyValuePair<Item, int>(new StardewValley.Object(211,1), 3), 30, new StatCost(), false); {new StardewValley.Object(382,1),1}
}, new KeyValuePair<Item, int>(ModCore.ObjectManager.GetItem("TinIngot"), 1), 50, new StatCost(), false);
this.recipesByObjectName["Furnace"].Add("Tin Ore", furnace_tinOre); this.recipesByObjectName["Furnace"].Add("Tin Ore", furnace_tinOre);
} }
@ -95,18 +96,20 @@ namespace Revitalize.Framework.Crafting
} }
} }
public void TryToCraftRecipe(StardewValley.Object Machine) public bool TryToCraftRecipe(StardewValley.Object Machine)
{ {
if (this.DoesARecipeExistForHeldObjectName(Machine)) if (this.DoesARecipeExistForHeldObjectName(Machine))
{ {
ModCore.log("Recipe exists!"); ModCore.log("Recipe exists!");
VanillaRecipe rec = this.GetVanillaRecipeFromHeldObjectName(Machine); VanillaRecipe rec = this.GetVanillaRecipeFromHeldObjectName(Machine);
rec.craft(Machine); bool crafted=rec.craft(Machine);
this.playCraftingSound(Machine); if(crafted)this.playCraftingSound(Machine);
return crafted;
} }
else else
{ {
ModCore.log("No recipe!"); ModCore.log("No recipe!");
return false;
} }
} }

View File

@ -47,8 +47,8 @@ namespace Revitalize.Framework.Hacks
if (ObjectUtilities.IsObjectFurnace(obj) && ObjectUtilities.IsObjectHoldingItem(obj)==false) if (ObjectUtilities.IsObjectFurnace(obj) && ObjectUtilities.IsObjectHoldingItem(obj)==false)
{ {
ModCore.log("Found a furnace!"); ModCore.log("Found a furnace!");
VanillaRecipeBook.VanillaRecipes.TryToCraftRecipe(obj); bool crafted=VanillaRecipeBook.VanillaRecipes.TryToCraftRecipe(obj);
if (crafted == false) return;
obj.initializeLightSource((Vector2)(obj.TileLocation), false); obj.initializeLightSource((Vector2)(obj.TileLocation), false);
obj.showNextIndex.Value = true; obj.showNextIndex.Value = true;
/* /*

View File

@ -86,23 +86,24 @@ namespace Revitalize.Framework.Objects
} }
/// <summary>Construct an instance.</summary> /// <summary>Construct an instance.</summary>
public CustomObject(CustomObjectData PyTKData, BasicItemInformation info) public CustomObject(CustomObjectData PyTKData, BasicItemInformation info,int Stack=1)
: base(PyTKData, Vector2.Zero) : base(PyTKData, Vector2.Zero)
{ {
this.info = info; this.info = info;
this.initializeBasics(); this.initializeBasics();
this.guid = Guid.NewGuid(); this.guid = Guid.NewGuid();
this.Stack = Stack;
} }
/// <summary>Construct an instance.</summary> /// <summary>Construct an instance.</summary>
public CustomObject(CustomObjectData PyTKData, BasicItemInformation info, Vector2 TileLocation) public CustomObject(CustomObjectData PyTKData, BasicItemInformation info, Vector2 TileLocation,int Stack=1)
: base(PyTKData, TileLocation) : base(PyTKData, TileLocation)
{ {
this.info = info; this.info = info;
this.initializeBasics(); this.initializeBasics();
this.guid = Guid.NewGuid(); this.guid = Guid.NewGuid();
this.Stack = Stack;
} }
/// <summary>Sets some basic information up.</summary> /// <summary>Sets some basic information up.</summary>
@ -400,7 +401,7 @@ namespace Revitalize.Framework.Objects
float num = this.Quality < 4 ? 0.0f : (float)((Math.Cos((double)Game1.currentGameTime.TotalGameTime.Milliseconds * Math.PI / 512.0) + 1.0) * 0.0500000007450581); float num = this.Quality < 4 ? 0.0f : (float)((Math.Cos((double)Game1.currentGameTime.TotalGameTime.Milliseconds * Math.PI / 512.0) + 1.0) * 0.0500000007450581);
spriteBatch.Draw(Game1.mouseCursors, location + new Vector2(12f, (float)(Game1.tileSize - 12) + num), new Microsoft.Xna.Framework.Rectangle?(this.Quality < 4 ? new Microsoft.Xna.Framework.Rectangle(338 + (this.Quality - 1) * 8, 400, 8, 8) : new Microsoft.Xna.Framework.Rectangle(346, 392, 8, 8)), Color.White * transparency, 0.0f, new Vector2(4f, 4f), (float)(3.0 * (double)scaleSize * (1.0 + (double)num)), SpriteEffects.None, layerDepth); spriteBatch.Draw(Game1.mouseCursors, location + new Vector2(12f, (float)(Game1.tileSize - 12) + num), new Microsoft.Xna.Framework.Rectangle?(this.Quality < 4 ? new Microsoft.Xna.Framework.Rectangle(338 + (this.Quality - 1) * 8, 400, 8, 8) : new Microsoft.Xna.Framework.Rectangle(346, 392, 8, 8)), Color.White * transparency, 0.0f, new Vector2(4f, 4f), (float)(3.0 * (double)scaleSize * (1.0 + (double)num)), SpriteEffects.None, layerDepth);
} }
spriteBatch.Draw(this.displayTexture, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize * .75)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * transparency, 0f, new Vector2((float)(this.animationManager.currentAnimation.sourceRectangle.Width / 2), (float)(this.animationManager.currentAnimation.sourceRectangle.Height)), 3f, SpriteEffects.None, layerDepth); spriteBatch.Draw(this.displayTexture, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * transparency, 0f, new Vector2((float)(this.animationManager.currentAnimation.sourceRectangle.Width / 2), (float)(this.animationManager.currentAnimation.sourceRectangle.Height)), scaleSize * 4f, SpriteEffects.None, layerDepth);
} }
/// <summary>What happens when the object is drawn when held by a player.</summary> /// <summary>What happens when the object is drawn when held by a player.</summary>

View File

@ -98,17 +98,7 @@ namespace Revitalize.Framework.Objects.Items.Resources
} }
public override void drawInMenu(SpriteBatch spriteBatch, Vector2 location, float scaleSize, float transparency, float layerDepth, bool drawStackNumber, Color c, bool drawShadow)
{
if (drawStackNumber && this.maximumStackSize() > 1 && ((double)scaleSize > 0.3 && this.Stack != int.MaxValue) && this.Stack > 1)
Utility.drawTinyDigits(this.Stack, spriteBatch, location + new Vector2((float)(Game1.tileSize - Utility.getWidthOfTinyDigitString(this.Stack, 3f * scaleSize)) + 3f * scaleSize, (float)((double)Game1.tileSize - 18.0 * (double)scaleSize + 2.0)), 3f * scaleSize, 1f, Color.White);
if (drawStackNumber && this.Quality > 0)
{
float num = this.Quality < 4 ? 0.0f : (float)((Math.Cos((double)Game1.currentGameTime.TotalGameTime.Milliseconds * Math.PI / 512.0) + 1.0) * 0.0500000007450581);
spriteBatch.Draw(Game1.mouseCursors, location + new Vector2(12f, (float)(Game1.tileSize - 12) + num), new Microsoft.Xna.Framework.Rectangle?(this.Quality < 4 ? new Microsoft.Xna.Framework.Rectangle(338 + (this.Quality - 1) * 8, 400, 8, 8) : new Microsoft.Xna.Framework.Rectangle(346, 392, 8, 8)), Color.White * transparency, 0.0f, new Vector2(4f, 4f), (float)(3.0 * (double)scaleSize * (1.0 + (double)num)), SpriteEffects.None, layerDepth);
}
spriteBatch.Draw(this.displayTexture, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * transparency, 0f, new Vector2((float)(this.animationManager.currentAnimation.sourceRectangle.Width / 2), (float)(this.animationManager.currentAnimation.sourceRectangle.Height)), scaleSize*4f, SpriteEffects.None, layerDepth);
}
public override Item getOne() public override Item getOne()
{ {
@ -231,5 +221,17 @@ namespace Revitalize.Framework.Objects.Items.Resources
} }
public override void drawInMenu(SpriteBatch spriteBatch, Vector2 location, float scaleSize, float transparency, float layerDepth, bool drawStackNumber, Color c, bool drawShadow)
{
if (drawStackNumber && this.maximumStackSize() > 1 && ((double)scaleSize > 0.3 && this.Stack != int.MaxValue) && this.Stack > 1)
Utility.drawTinyDigits(this.Stack, spriteBatch, location + new Vector2((float)(Game1.tileSize - Utility.getWidthOfTinyDigitString(this.Stack, 3f * scaleSize)) + 3f * scaleSize, (float)((double)Game1.tileSize - 18.0 * (double)scaleSize + 2.0)), 3f * scaleSize, 1f, Color.White);
if (drawStackNumber && this.Quality > 0)
{
float num = this.Quality < 4 ? 0.0f : (float)((Math.Cos((double)Game1.currentGameTime.TotalGameTime.Milliseconds * Math.PI / 512.0) + 1.0) * 0.0500000007450581);
spriteBatch.Draw(Game1.mouseCursors, location + new Vector2(12f, (float)(Game1.tileSize - 12) + num), new Microsoft.Xna.Framework.Rectangle?(this.Quality < 4 ? new Microsoft.Xna.Framework.Rectangle(338 + (this.Quality - 1) * 8, 400, 8, 8) : new Microsoft.Xna.Framework.Rectangle(346, 392, 8, 8)), Color.White * transparency, 0.0f, new Vector2(4f, 4f), (float)(3.0 * (double)scaleSize * (1.0 + (double)num)), SpriteEffects.None, layerDepth);
}
spriteBatch.Draw(this.displayTexture, location + new Vector2((float)(Game1.tileSize / 2), (float)(Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * transparency, 0f, new Vector2((float)(this.animationManager.currentAnimation.sourceRectangle.Width / 2), (float)(this.animationManager.currentAnimation.sourceRectangle.Height)), scaleSize * 4f, SpriteEffects.None, layerDepth);
}
} }
} }

View File

@ -51,6 +51,8 @@ namespace Revitalize.Framework.Objects
public ResourceManager resources; public ResourceManager resources;
public Dictionary<string, CustomObject> ItemsByName;
/// <summary> /// <summary>
/// Constructor. /// Constructor.
/// </summary> /// </summary>
@ -84,6 +86,15 @@ namespace Revitalize.Framework.Objects
this.miscellaneous = new Dictionary<string, MultiTiledObject>(); this.miscellaneous = new Dictionary<string, MultiTiledObject>();
this.resources = new ResourceManager(); this.resources = new ResourceManager();
this.ItemsByName = new Dictionary<string, CustomObject>();
}
/// <summary>
/// Loads in the items for the object and resource managers.
/// </summary>
public void loadInItems()
{
this.resources.loadInItems();
} }
/// <summary> /// <summary>
@ -202,6 +213,43 @@ namespace Revitalize.Framework.Objects
} }
} }
/// <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);
}
}
/// <summary>
/// Gets an item from the list of modded items.
/// </summary>
/// <param name="Key"></param>
/// <param name="Stack"></param>
/// <returns></returns>
public CustomObject GetItem(string Key,int Stack=1)
{
if (this.ItemsByName.ContainsKey(Key))
{
Item I= this.ItemsByName[Key].getOne();
I.Stack = Stack;
return (CustomObject)I;
}
else
{
return null;
}
}
/// <summary> /// <summary>
/// Adds a new object manager to the master pool of managers. /// Adds a new object manager to the master pool of managers.
/// </summary> /// </summary>

View File

@ -2,8 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Revitalize.Framework.Factories.Objects.Resources; using Revitalize.Framework.Factories.Objects.Resources;
using Revitalize.Framework.Objects.InformationFiles; using Revitalize.Framework.Objects.InformationFiles;
@ -49,10 +47,15 @@ namespace Revitalize.Framework.Objects
this.ores = new Dictionary<string, Ore>(); this.ores = new Dictionary<string, Ore>();
this.visitedFloors = new List<int>(); this.visitedFloors = new List<int>();
}
//Loads in the items for the resource manager.
public void loadInItems()
{
this.loadInOreItems(); this.loadInOreItems();
this.serializeOreVeins(); this.serializeOreVeins();
this.loadOreVeins(); this.loadOreVeins();
} }
/// <summary> /// <summary>
@ -131,20 +134,101 @@ namespace Revitalize.Framework.Objects
OreVeinTile tinOre_0_0= new OreVeinTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Tin", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Tin"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Tin Ore Vein", "Omegasis.Revitalize.Resources.Ore.Tin", "A ore vein that is full of tin.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Tin"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Tin"), new Animation(0, 0, 16, 16)), Color.White, false, null, null), OreVeinTile tinOre_0_0= new OreVeinTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Tin", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Tin"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Tin Ore Vein", "Omegasis.Revitalize.Resources.Ore.Tin", "A ore vein that is full of tin.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Tin"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Tin"), new Animation(0, 0, 16, 16)), Color.White, false, null, null),
new InformationFiles.OreResourceInformation(this.getOre("Tin"), true, true, true, false, new List<IntRange>() new InformationFiles.OreResourceInformation(this.getOre("Tin"), true, true, true, false, new List<IntRange>()
{ {
new IntRange(1,9) new IntRange(1,20)
}, new List<IntRange>(), (i => i == 1), (i => i % 10 == 0), 1, 5, 1, 10, new IntRange(1, 3), new IntRange(1, 3), new IntRange(0, 0), new List<IntRange>() }, new List<IntRange>(), (i => i == 1), (i => i % 10 == 0), 1, 3, 1, 10, new IntRange(1, 3), new IntRange(1, 3), new IntRange(0, 0), new List<IntRange>()
{ {
new IntRange(0,0) new IntRange(0,0)
}, new List<IntRange>() }, new List<IntRange>()
{ {
new IntRange(0,9999) new IntRange(0,9999)
}, null,null, 1d, 1.0d, 0.10d, 1d, 1d, 0, 0, 0, 0), new List<ResourceInformaton>(), 4); }, null,null, 0.80d, 0.20d, 0.25d, 1d, 1d, 1, 1, 1, 1), new List<ResourceInformaton>(), 4);
OreFactoryInfo testOre_0_0_file = new OreFactoryInfo(tinOre_0_0); OreFactoryInfo tinOre_0_0_file = new OreFactoryInfo(tinOre_0_0);
OreFactoryInfo testOre_file = new OreFactoryInfo(tinOre); OreFactoryInfo tinOre_file = new OreFactoryInfo(tinOre);
ModCore.Serializer.SerializeContentFile("TinOre_0_0", testOre_0_0_file,Path.Combine(this.oreResourceDataPath,"TinOre")); ModCore.Serializer.SerializeContentFile("TinOre_0_0", tinOre_0_0_file,Path.Combine(this.oreResourceDataPath,"TinOre"));
ModCore.Serializer.SerializeContentFile("TinOre", testOre_file, Path.Combine(this.oreResourceDataPath, "TinOre")); ModCore.Serializer.SerializeContentFile("TinOre", tinOre_file, Path.Combine(this.oreResourceDataPath, "TinOre"));
OreVeinObj bauxiteOre = new OreVeinObj(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Bauxite", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Bauxite"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Bauxite Ore Vein", "Omegasis.Revitalize.Resources.Ore.Bauxite", "A ore vein that is full of bauxite ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Bauxite"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Bauxite"), new Animation(0, 0, 16, 16)), Color.White, false, null, null));
OreVeinTile bauxiteOre_0_0 = new OreVeinTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Bauxite", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Bauxite"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Bauxite Ore Vein", "Omegasis.Revitalize.Resources.Ore.Bauxite", "A ore vein that is full of bauxite ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Bauxite"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Bauxite"), new Animation(0, 0, 16, 16)), Color.White, false, null, null),
new InformationFiles.OreResourceInformation(this.getOre("Bauxite"), true, true, true, false, new List<IntRange>()
{
new IntRange(20,50)
}, new List<IntRange>(), null, (i => i % 10 == 0), 1, 3, 1, 10, new IntRange(1, 3), new IntRange(1, 3), new IntRange(0, 0), new List<IntRange>()
{
new IntRange(0,0)
}, new List<IntRange>()
{
new IntRange(0,9999)
}, null, null, .70d, 0.16d, 0.20d, 1d, 1d, 0, 0, 0, 0), new List<ResourceInformaton>(), 4);
OreFactoryInfo bauxiteOre_0_0_file = new OreFactoryInfo(bauxiteOre_0_0);
OreFactoryInfo bauxiteOre_file = new OreFactoryInfo(bauxiteOre);
ModCore.Serializer.SerializeContentFile("BauxiteOre_0_0", bauxiteOre_0_0_file, Path.Combine(this.oreResourceDataPath, "BauxiteOre"));
ModCore.Serializer.SerializeContentFile("BauxiteOre", bauxiteOre_file, Path.Combine(this.oreResourceDataPath, "BauxiteOre"));
OreVeinObj silverOre = new OreVeinObj(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Silver", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Silver"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Silver Ore Vein", "Omegasis.Revitalize.Resources.Ore.Silver", "A ore vein that is full of silver ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Silver"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Silver"), new Animation(0, 0, 16, 16)), Color.White, false, null, null));
OreVeinTile silverOre_0_0 = new OreVeinTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Silver", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Silver"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Silver Ore Vein", "Omegasis.Revitalize.Resources.Ore.Silver", "A ore vein that is full of silver ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Silver"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Silver"), new Animation(0, 0, 16, 16)), Color.White, false, null, null),
new InformationFiles.OreResourceInformation(this.getOre("Silver"), true, true, true, false, new List<IntRange>()
{
new IntRange(60,100)
}, new List<IntRange>(), null, (i => i % 10 == 0), 1, 3, 1, 10, new IntRange(1, 3), new IntRange(1, 3), new IntRange(0, 0), new List<IntRange>()
{
new IntRange(0,0)
}, new List<IntRange>()
{
new IntRange(0,9999)
}, null, null, .50d, 0.10d, 0.14d, 1d, 1d, 0, 0, 0, 0), new List<ResourceInformaton>(), 4);
OreFactoryInfo silverOre_0_0_file = new OreFactoryInfo(silverOre_0_0);
OreFactoryInfo silverOre_file = new OreFactoryInfo(silverOre);
ModCore.Serializer.SerializeContentFile("SilverOre_0_0", silverOre_0_0_file, Path.Combine(this.oreResourceDataPath, "SilverOre"));
ModCore.Serializer.SerializeContentFile("SilverOre", silverOre_file, Path.Combine(this.oreResourceDataPath, "SilverOre"));
OreVeinObj leadOre = new OreVeinObj(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Lead", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Lead"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Lead Ore Vein", "Omegasis.Revitalize.Resources.Ore.Lead", "A ore vein that is full of lead ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Lead"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Lead"), new Animation(0, 0, 16, 16)), Color.White, false, null, null));
OreVeinTile leadOre_0_0 = new OreVeinTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Lead", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Lead"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Lead Ore Vein", "Omegasis.Revitalize.Resources.Ore.Lead", "A ore vein that is full of lead ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Lead"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Lead"), new Animation(0, 0, 16, 16)), Color.White, false, null, null),
new InformationFiles.OreResourceInformation(this.getOre("Lead"), true, true, true, false, new List<IntRange>()
{
new IntRange(60,70),
new IntRange(90,120)
}, new List<IntRange>(), null, (i => i % 10 == 0), 1, 3, 1, 10, new IntRange(1, 3), new IntRange(1, 3), new IntRange(0, 0), new List<IntRange>()
{
new IntRange(0,0)
}, new List<IntRange>()
{
new IntRange(0,9999)
}, null, null, .60d, 0.13d, 0.17d, 1d, 1d, 0, 0, 0, 0), new List<ResourceInformaton>(), 4);
OreFactoryInfo leadOre_0_0_file = new OreFactoryInfo(leadOre_0_0);
OreFactoryInfo leadOre_file = new OreFactoryInfo(leadOre);
ModCore.Serializer.SerializeContentFile("LeadOre_0_0", leadOre_0_0_file, Path.Combine(this.oreResourceDataPath, "LeadOre"));
ModCore.Serializer.SerializeContentFile("LeadOre", leadOre_file, Path.Combine(this.oreResourceDataPath, "LeadOre"));
OreVeinObj titaniumOre = new OreVeinObj(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Titanium", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Titanium"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Titanium Ore Vein", "Omegasis.Revitalize.Resources.Ore.Titanium", "A ore vein that is full of lead ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Titanium"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Titanium"), new Animation(0, 0, 16, 16)), Color.White, false, null, null));
OreVeinTile titaniumOre_0_0 = new OreVeinTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Resources.Ore.Titanium", TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Titanium"), typeof(OreVeinTile), Color.White), new BasicItemInformation("Titanium Ore Vein", "Omegasis.Revitalize.Resources.Ore.Titanium", "A ore vein that is full of lead ore.", "Revitalize.Ore", Color.Black, -300, 0, false, 350, true, true, TextureManager.GetTexture(ModCore.Manifest, "Resources.Ore", "Titanium"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Resources.Ore", "Titanium"), new Animation(0, 0, 16, 16)), Color.White, false, null, null),
new InformationFiles.OreResourceInformation(this.getOre("Titanium"), true, true, true, false, new List<IntRange>()
{
new IntRange(60,70),
new IntRange(90,120)
}, new List<IntRange>(), null, (i => i % 10 == 0), 1, 3, 1, 10, new IntRange(1, 3), new IntRange(1, 3), new IntRange(0, 0), new List<IntRange>()
{
new IntRange(0,0)
}, new List<IntRange>()
{
new IntRange(0,9999)
}, null, null, .40d, 0.05d, 0.10d, 1d, 1d, 0, 0, 0, 0), new List<ResourceInformaton>(), 4);
OreFactoryInfo titaniumOre_0_0_file = new OreFactoryInfo(titaniumOre_0_0);
OreFactoryInfo titaniumOre_file = new OreFactoryInfo(titaniumOre);
ModCore.Serializer.SerializeContentFile("TitaniumOre_0_0", titaniumOre_0_0_file, Path.Combine(this.oreResourceDataPath, "TitaniumOre"));
ModCore.Serializer.SerializeContentFile("TitaniumOre", titaniumOre_file, Path.Combine(this.oreResourceDataPath, "TitaniumOre"));
} }
@ -153,8 +237,36 @@ namespace Revitalize.Framework.Objects
/// </summary> /// </summary>
private void loadInOreItems() private void loadInOreItems()
{ {
Ore tinOre = new Ore(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.TinOre", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinOre"), typeof(Ore), Color.White, true), new BasicItemInformation("Tin Ore", "Omegasis.Revitalize.Items.Resources.Ore.TinOre", "Tin ore that can be smelted into tin ingots for further use.", "Ore", Color.Silver, -300, 0, false, 85, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinOre"), new AnimationManager(), Color.White, true, null, null), 1); Ore tinOre = new Ore(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.TinOre", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinOre"), typeof(Ore), Color.White, true), new BasicItemInformation("Tin Ore", "Omegasis.Revitalize.Items.Resources.Ore.TinOre", "Tin ore that can be smelted into tin ingots for further use.", "Ore", Color.Silver, -300, 0, false, 7, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinOre"), new AnimationManager(), Color.White, true, null, null), 1);
this.ores.Add("Tin", tinOre); this.ores.Add("Tin", tinOre);
Ore bauxiteOre = new Ore(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.Bauxite", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BauxiteOre"), typeof(Ore), Color.White, true), new BasicItemInformation("Bauxite Ore", "Omegasis.Revitalize.Items.Resources.Ore.BauxiteOre", "Bauxite ore that can be smelted into aluminum ingots for further use.", "Ore", Color.Silver, -300, 0, false, 11, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "BauxiteOre"), new AnimationManager(), Color.White, true, null, null), 1);
this.ores.Add("Bauxite", bauxiteOre);
this.ores.Add("Aluminum", bauxiteOre);
Ore leadOre = new Ore(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.LeadOre", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "LeadOre"), typeof(Ore), Color.White, true), new BasicItemInformation("Lead Ore", "Omegasis.Revitalize.Items.Resources.Ore.LeadOre", "Lead ore that can be smelted into lead ingots for further use.", "Ore", Color.Silver, -300, 0, false, 15, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "LeadOre"), new AnimationManager(), Color.White, true, null, null), 1);
this.ores.Add("Lead", leadOre);
Ore silverOre = new Ore(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.SilverOre", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverOre"), typeof(Ore), Color.White, true), new BasicItemInformation("Silver Ore", "Omegasis.Revitalize.Items.Resources.Ore.SilverOre", "Silver ore that can be smelted into silver ingots for further use.", "Ore", Color.Silver, -300, 0, false, 20, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverOre"), new AnimationManager(), Color.White, true, null, null), 1);
this.ores.Add("Silver", silverOre);
Ore titaniumOre = new Ore(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.TitaniumOre", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumOre"), typeof(Ore), Color.White, true), new BasicItemInformation("Titanium Ore", "Omegasis.Revitalize.Items.Resources.Ore.TitaniumOre", "Titanium ore that can be smelted into titanium ingots for further use.", "Ore", Color.Silver, -300, 0, false, 35, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumOre"), new AnimationManager(), Color.White, true, null, null), 1);
this.ores.Add("Titanium", titaniumOre);
CustomObject tinIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.TinIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Tin Ingot", "Omegasis.Revitalize.Items.Resources.Ore.TinIngot", "A tin ingot that can be used for crafting purposes.", "Metal", Color.Silver, -300, 0, false,75, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TinIngot"), new AnimationManager(), Color.White, true, null, null), 1);
ModCore.ObjectManager.AddItem("TinIngot", tinIngot);
CustomObject aluminumIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.AluminumIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "AluminumIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Aluminum Ingot", "Omegasis.Revitalize.Items.Resources.Ore.AluminumIngot", "An aluminum ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, 0, false, 120, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "AluminumIngot"), new AnimationManager(), Color.White, true, null, null), 1);
ModCore.ObjectManager.AddItem("AluminumIngot", aluminumIngot);
CustomObject leadIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.LeadIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "LeadIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Lead Ingot", "Omegasis.Revitalize.Items.Resources.Ore.LeadIngot", "A lead ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, 0, false, 165, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "LeadIngot"), new AnimationManager(), Color.White, true, null, null), 1);
ModCore.ObjectManager.AddItem("LeadIngot", leadIngot);
CustomObject silverIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.SilverIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Silver Ingot", "Omegasis.Revitalize.Items.Resources.Ore.SilverIngot", "A silver ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, 0, false, 220, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "SilverIngot"), new AnimationManager(), Color.White, true, null, null), 1);
ModCore.ObjectManager.AddItem("SilverIngot", silverIngot);
CustomObject titaniumIngot = new CustomObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Items.Resources.Ore.TitaniumIngot", TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumIngot"), typeof(CustomObject), Color.White, true), new BasicItemInformation("Titanium Ingot", "Omegasis.Revitalize.Items.Resources.Ore.TitaniumIngot", "A titanium ingot that can be used for crafting purposes.", "Ore", Color.Silver, -300, 325, false, 35, false, false, TextureManager.GetTexture(ModCore.Manifest, "Items.Resources.Ore", "TitaniumIngot"), new AnimationManager(), Color.White, true, null, null), 1);
ModCore.ObjectManager.AddItem("TitaniumIngot", titaniumIngot);
} }
/// <summary> /// <summary>

View File

@ -180,9 +180,8 @@ namespace Revitalize
public static IManifest Manifest; public static IManifest Manifest;
/// <summary> /// <summary>
/// Keeps track of custom objects. REPLACE THIS WITH RESOUCE MANAGER. /// Keeps track of custom objects.
/// </summary> /// </summary>
//public static Dictionary<string, CustomObject> customObjects;
public static ObjectManager ObjectManager; public static ObjectManager ObjectManager;
/// <summary> /// <summary>
@ -206,36 +205,18 @@ namespace Revitalize
this.createDirectories(); this.createDirectories();
this.initailizeComponents(); this.initailizeComponents();
Serializer = new Serializer(); Serializer = new Serializer();
playerInfo = new PlayerInfo(); playerInfo = new PlayerInfo();
TextureManager.AddTextureManager(Manifest, "Furniture"); //Loads in textures to be used by the mod.
TextureManager.GetTextureManager(Manifest, "Furniture").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Objects", "Furniture")); this.loadInTextures();
TextureManager.AddTextureManager(Manifest, "InventoryMenu");
TextureManager.GetTextureManager(Manifest, "InventoryMenu").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Menus", "InventoryMenu"));
TextureManager.AddTextureManager(Manifest, "Resources.Ore");
TextureManager.GetTextureManager(Manifest, "Resources.Ore").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Objects", "Resources", "Ore"));
TextureManager.AddTextureManager(Manifest, "Items.Resources.Ore");
TextureManager.GetTextureManager(Manifest, "Items.Resources.Ore").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Items", "Resources", "Ore"));
//TextureManager.addTexture("Furniture","Oak Chair", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content","Graphics","Furniture", "Chairs", "Oak Chair.png")));
//Framework.Graphics.TextureManager.TextureManagers.Add("Furniture", new TextureManager(this.Helper.DirectoryPath, Path.Combine("Content", "Graphics", "Furniture")));
//Rename graphic files tohave spaces and comment out below lines
//TextureManager.addTexture("Furniture","Oak Chair", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content","Graphics","Furniture", "Chairs", "Oak Chair.png")));
//
//TextureManager.addTexture("Furniture", "Oak Table", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content", "Graphics", "Furniture", "Tables", "Oak Table.png")));
//TextureManager.addTexture("Furniture", "Oak Lamp", new Texture2DExtended(this.Helper, this.ModManifest, Path.Combine("Content", "Graphics", "Furniture", "Lamps", "Oak Lamp.png")));
//customObjects = new Dictionary<string, CustomObject>();
//Loads in objects to be use by the mod.
ObjectGroups = new Dictionary<string, MultiTiledObject>(); ObjectGroups = new Dictionary<string, MultiTiledObject>();
ObjectManager = new ObjectManager(Manifest); ObjectManager = new ObjectManager(Manifest);
ObjectManager.loadInItems();
ObjectsToDraw = new Dictionary<GameLocation, MultiTiledObject>(); ObjectsToDraw = new Dictionary<GameLocation, MultiTiledObject>();
//Adds in event handling for the mod.
ModHelper.Events.GameLoop.SaveLoaded += this.GameLoop_SaveLoaded; ModHelper.Events.GameLoop.SaveLoaded += this.GameLoop_SaveLoaded;
ModHelper.Events.GameLoop.TimeChanged += this.GameLoop_TimeChanged; ModHelper.Events.GameLoop.TimeChanged += this.GameLoop_TimeChanged;
ModHelper.Events.GameLoop.UpdateTicked += this.GameLoop_UpdateTicked; ModHelper.Events.GameLoop.UpdateTicked += this.GameLoop_UpdateTicked;
@ -244,13 +225,29 @@ namespace Revitalize
ModHelper.Events.Player.Warped += ObjectManager.resources.OnPlayerLocationChanged; ModHelper.Events.Player.Warped += ObjectManager.resources.OnPlayerLocationChanged;
ModHelper.Events.GameLoop.DayStarted += ObjectManager.resources.DailyResourceSpawn; ModHelper.Events.GameLoop.DayStarted += ObjectManager.resources.DailyResourceSpawn;
ModHelper.Events.Input.ButtonPressed += ObjectInteractionHacks.Input_CheckForObjectInteraction; ModHelper.Events.Input.ButtonPressed += ObjectInteractionHacks.Input_CheckForObjectInteraction;
ModHelper.Events.GameLoop.DayEnding += Serializer.DayEnding_CleanUpFilesForDeletion; ModHelper.Events.GameLoop.DayEnding += Serializer.DayEnding_CleanUpFilesForDeletion;
//ModHelper.Events.Display.Rendered += MenuHacks.EndOfDay_OnMenuChanged; //ModHelper.Events.Display.Rendered += MenuHacks.EndOfDay_OnMenuChanged;
//ModHelper.Events.GameLoop.Saved += MenuHacks.EndOfDay_CleanupForNewDay; //ModHelper.Events.GameLoop.Saved += MenuHacks.EndOfDay_CleanupForNewDay;
//Adds in recipes to the mod.
VanillaRecipeBook = new VanillaRecipeBook(); VanillaRecipeBook = new VanillaRecipeBook();
} }
/// <summary>
/// Loads in textures to be used by the mod.
/// </summary>
private void loadInTextures()
{
TextureManager.AddTextureManager(Manifest, "Furniture");
TextureManager.GetTextureManager(Manifest, "Furniture").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Objects", "Furniture"));
TextureManager.AddTextureManager(Manifest, "InventoryMenu");
TextureManager.GetTextureManager(Manifest, "InventoryMenu").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Menus", "InventoryMenu"));
TextureManager.AddTextureManager(Manifest, "Resources.Ore");
TextureManager.GetTextureManager(Manifest, "Resources.Ore").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Objects", "Resources", "Ore"));
TextureManager.AddTextureManager(Manifest, "Items.Resources.Ore");
TextureManager.GetTextureManager(Manifest, "Items.Resources.Ore").searchForTextures(ModHelper, this.ModManifest, Path.Combine("Content", "Graphics", "Items", "Resources", "Ore"));
}
private void Input_ButtonPressed(object sender, StardewModdingAPI.Events.ButtonPressedEventArgs e) private void Input_ButtonPressed(object sender, StardewModdingAPI.Events.ButtonPressedEventArgs e)
{ {
/* /*

View File

@ -250,9 +250,21 @@
<Content Include="Content\Graphics\Objects\Furniture\Tables\Oak Table.png"> <Content Include="Content\Graphics\Objects\Furniture\Tables\Oak Table.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Graphics\Objects\Resources\Ore\Bauxite.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Graphics\Objects\Resources\Ore\Lead.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Graphics\Objects\Resources\Ore\Silver.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Graphics\Objects\Resources\Ore\Tin.png"> <Content Include="Content\Graphics\Objects\Resources\Ore\Tin.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Graphics\Objects\Resources\Ore\Titanium.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\Enemies\Target.png"> <Content Include="Content\Minigames\SeasideScramble\Graphics\Enemies\Target.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>