Added in robin selling the workbench, the anvil crafting trashcans, and craftable trashcans which toss away anything put inside of them.
This commit is contained in:
parent
b6a817608f
commit
50dcdf0eb6
Binary file not shown.
After Width: | Height: | Size: 563 B |
|
@ -351,8 +351,14 @@ namespace Revitalize.Framework.Crafting
|
|||
new CraftingRecipeComponent(ModCore.ObjectManager.GetTool("HardenedHoe"),1)
|
||||
}, new CraftingRecipeComponent(ModCore.ObjectManager.GetTool("TitaniumHoe"), 1)), true));
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
AnvilRecipes.addCraftingRecipe("Trash Can", new UnlockableCraftingRecipe("Default", new Recipe(new List<CraftingRecipeComponent>()
|
||||
{
|
||||
new CraftingRecipeComponent(new StardewValley.Object((int)Enums.SDVObject.IronBar,5),5)
|
||||
}, new CraftingRecipeComponent(ModCore.ObjectManager.GetItem("TrashCan"), 1)),true));
|
||||
|
||||
if (CraftingRecipesByGroup.ContainsKey(AnvilRecipes.craftingGroup))
|
||||
{
|
||||
foreach (KeyValuePair<string, UnlockableCraftingRecipe> recipe in AnvilRecipes.craftingRecipes)
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Revitalize.Framework.Energy
|
||||
{
|
||||
public class EnergyManager
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The remaining energy left in this system.
|
||||
/// </summary>
|
||||
public int remainingEnergy;
|
||||
/// <summary>
|
||||
/// The maximum amount of energy this system can store.
|
||||
/// </summary>
|
||||
public int maxEnergy;
|
||||
|
||||
public bool requiresUpdate;
|
||||
/// <summary>
|
||||
/// How does this energy manager interface energy systems.
|
||||
/// </summary>
|
||||
public Enums.EnergyInteractionType energyInteractionType;
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see if this energy manager consumes energy.
|
||||
/// </summary>
|
||||
public bool consumesEnergy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.energyInteractionType == Enums.EnergyInteractionType.Consumes;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Checks to see if this energy manager produces energy.
|
||||
/// </summary>
|
||||
public bool producesEnergy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.energyInteractionType == Enums.EnergyInteractionType.Produces;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see if this energy manager transfers energy.
|
||||
/// </summary>
|
||||
public bool transfersEnergy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.energyInteractionType == Enums.EnergyInteractionType.Transfers;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Does this energy system have energy.
|
||||
/// </summary>
|
||||
public bool hasEnergy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.remainingEnergy > 0;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Checks to see if this energy system has any energy left.
|
||||
/// </summary>
|
||||
public bool hasMaxEnergy
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.remainingEnergy == this.maxEnergy;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Checks to see if this system can receive any energy externally.
|
||||
/// </summary>
|
||||
public bool canReceieveEnergy
|
||||
{
|
||||
get
|
||||
{
|
||||
return !this.hasMaxEnergy;
|
||||
}
|
||||
}
|
||||
|
||||
public int capacityRemaining
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.maxEnergy - this.remainingEnergy;
|
||||
}
|
||||
}
|
||||
|
||||
public EnergyManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public EnergyManager(int Capacity) : this(0, Capacity)
|
||||
{
|
||||
}
|
||||
|
||||
public EnergyManager(int CurrentEnergy, int MaxEnergy)
|
||||
{
|
||||
this.remainingEnergy = CurrentEnergy;
|
||||
this.maxEnergy = MaxEnergy;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see if this energy source has enough energy remaining.
|
||||
/// </summary>
|
||||
/// <param name="Required"></param>
|
||||
/// <returns></returns>
|
||||
public bool hasEnoughEnergy(int Required)
|
||||
{
|
||||
return this.remainingEnergy >= Required;
|
||||
}
|
||||
|
||||
|
||||
public void consumeEnergy(int amount)
|
||||
{
|
||||
int amountBeforeConsumption = this.remainingEnergy;
|
||||
this.remainingEnergy = Math.Max(0, this.remainingEnergy - amount);
|
||||
if (this.remainingEnergy != amountBeforeConsumption)
|
||||
{
|
||||
this.requiresUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void produceEnergy(int amount)
|
||||
{
|
||||
int amountBeforeProduction = this.remainingEnergy;
|
||||
this.remainingEnergy = Math.Min(this.maxEnergy, this.remainingEnergy + amount);
|
||||
if (this.remainingEnergy != amountBeforeProduction)
|
||||
{
|
||||
this.requiresUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void transferEnergyFromAnother(EnergyManager other,int amount)
|
||||
{
|
||||
if (this.canReceieveEnergy)
|
||||
{
|
||||
int actualAmount = Math.Min(amount,other.remainingEnergy);
|
||||
int selfCapacity = this.capacityRemaining;
|
||||
this.produceEnergy(Math.Min(actualAmount, selfCapacity));
|
||||
other.consumeEnergy(Math.Min(actualAmount, selfCapacity));
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void transferEnergyToAnother(EnergyManager other, int amount)
|
||||
{
|
||||
if (other.canReceieveEnergy)
|
||||
{
|
||||
int actualAmount = Math.Min(amount, this.remainingEnergy);
|
||||
int selfCapacity = other.capacityRemaining;
|
||||
other.produceEnergy(Math.Min(actualAmount, selfCapacity));
|
||||
this.consumeEnergy(Math.Min(actualAmount, selfCapacity));
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public EnergyManager Copy()
|
||||
{
|
||||
return new EnergyManager(this.maxEnergy);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Revitalize.Framework.Energy
|
||||
{
|
||||
public interface IEnergyInterface
|
||||
{
|
||||
EnergyManager EnergyManager
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -22,6 +22,17 @@ namespace Revitalize.Framework
|
|||
Left
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The types of interaction for energy that exists.
|
||||
/// </summary>
|
||||
public enum EnergyInteractionType
|
||||
{
|
||||
None,
|
||||
Produces,
|
||||
Consumes,
|
||||
Transfers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// References Stardew Valley Object id's for easier coding.
|
||||
/// </summary>
|
||||
|
|
|
@ -13,10 +13,21 @@ namespace Revitalize.Framework.Hacks
|
|||
public class ShopHacks
|
||||
{
|
||||
|
||||
public static void AddInCustomItemsToShops()
|
||||
{
|
||||
AddItemsToRobinsShop();
|
||||
AddOreToClintsShop();
|
||||
}
|
||||
|
||||
|
||||
private static void AddItemsToRobinsShop()
|
||||
{
|
||||
PyTK.Extensions.PyEvents.addToNPCShop(new InventoryItem(ModCore.ObjectManager.GetItem("Workbench", 1), 500), "Robin");
|
||||
}
|
||||
/// <summary>
|
||||
/// Adds in ore to clint's shop.
|
||||
/// </summary>
|
||||
public static void AddOreToClintsShop()
|
||||
private static void AddOreToClintsShop()
|
||||
{
|
||||
PyTK.Extensions.PyEvents.addToNPCShop(new InventoryItem(ModCore.ObjectManager.resources.getOre("Tin",1),ModCore.Configs.shops_blacksmithConfig.tinOreSellPrice), "Clint");
|
||||
PyTK.Extensions.PyEvents.addToNPCShop(new InventoryItem(ModCore.ObjectManager.resources.getOre("Bauxite", 1), ModCore.Configs.shops_blacksmithConfig.bauxiteOreSellPrice), "Clint");
|
||||
|
|
|
@ -39,8 +39,7 @@ namespace Revitalize.Framework.Menus
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// //TODO: Combine two of these to make an item grab menu.
|
||||
/// TODO: Display Item information on hover.
|
||||
/// An inventory menu that displays the contents of an inventory but doesn't do much else.
|
||||
/// </summary>
|
||||
public class InventoryMenu : IClickableMenuExtended
|
||||
{
|
||||
|
|
|
@ -304,6 +304,20 @@ namespace Revitalize.Framework.Objects
|
|||
}
|
||||
}
|
||||
|
||||
private Energy.EnergyManager _energyManager;
|
||||
public Energy.EnergyManager EnergyManager
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._energyManager;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._energyManager = value;
|
||||
this.requiresUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public bool requiresUpdate;
|
||||
public BasicItemInformation()
|
||||
|
@ -326,9 +340,10 @@ namespace Revitalize.Framework.Objects
|
|||
this.facingDirection = Enums.Direction.Down;
|
||||
this.id = "";
|
||||
this.shakeTimer = 0;
|
||||
this.EnergyManager = new Energy.EnergyManager();
|
||||
}
|
||||
|
||||
public BasicItemInformation(string name, string id, string description, string categoryName, Color categoryColor,int edibility, int fragility, bool isLamp, int price, bool canBeSetOutdoors, bool canBeSetIndoors, Texture2D texture, AnimationManager animationManager, Color drawColor, bool ignoreBoundingBox, InventoryManager Inventory, LightManager Lights)
|
||||
public BasicItemInformation(string name, string id, string description, string categoryName, Color categoryColor,int edibility, int fragility, bool isLamp, int price, bool canBeSetOutdoors, bool canBeSetIndoors, Texture2D texture, AnimationManager animationManager, Color drawColor, bool ignoreBoundingBox, InventoryManager Inventory, LightManager Lights,Energy.EnergyManager EnergyManager=null)
|
||||
{
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
|
@ -357,7 +372,8 @@ namespace Revitalize.Framework.Objects
|
|||
this.lightManager = Lights ?? new LightManager();
|
||||
this.facingDirection = Enums.Direction.Down;
|
||||
this.shakeTimer = 0;
|
||||
|
||||
|
||||
this.EnergyManager = EnergyManager ?? new Energy.EnergyManager();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -375,12 +391,12 @@ namespace Revitalize.Framework.Objects
|
|||
/// <returns></returns>
|
||||
public BasicItemInformation Copy()
|
||||
{
|
||||
return new BasicItemInformation(this.name, this.id,this.description, this.categoryName, this.categoryColor, this.edibility, this.fragility, this.isLamp, this.price, this.canBeSetOutdoors, this.canBeSetIndoors, this.animationManager.getTexture(), this.animationManager, this.drawColor, this.ignoreBoundingBox, this.inventory.Copy(), this.lightManager.Copy());
|
||||
return new BasicItemInformation(this.name, this.id,this.description, this.categoryName, this.categoryColor, this.edibility, this.fragility, this.isLamp, this.price, this.canBeSetOutdoors, this.canBeSetIndoors, this.animationManager.getTexture(), this.animationManager, this.drawColor, this.ignoreBoundingBox, this._inventory.Copy(), this._lightManager.Copy(),this._energyManager.Copy());
|
||||
}
|
||||
|
||||
public bool requiresSyncUpdate()
|
||||
{
|
||||
return this.requiresUpdate || this.animationManagerRequiresUpdate() || this.inventoryManagerRequiresUpdate() || this.lightManagerRequiresUpdate();
|
||||
return this.requiresUpdate || this.animationManagerRequiresUpdate() || this.inventoryManagerRequiresUpdate() || this.lightManagerRequiresUpdate() || this.energyManagerRequiresUpdate();
|
||||
}
|
||||
|
||||
public void forceUpdate()
|
||||
|
@ -403,12 +419,19 @@ namespace Revitalize.Framework.Objects
|
|||
else return this._lightManager.requiresUpdate;
|
||||
}
|
||||
|
||||
private bool energyManagerRequiresUpdate()
|
||||
{
|
||||
if (this._energyManager == null) return false;
|
||||
else return this._energyManager.requiresUpdate;
|
||||
}
|
||||
|
||||
public void cleanAfterUpdate()
|
||||
{
|
||||
this.requiresUpdate = false;
|
||||
this._inventory.requiresUpdate = false;
|
||||
this._animationManager.requiresUpdate = false;
|
||||
this._lightManager.requiresUpdate = false;
|
||||
this._energyManager.requiresUpdate = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ using StardustCore.Animations;
|
|||
using StardewValley;
|
||||
using StardewValley.Objects;
|
||||
using Revitalize.Framework.Utilities;
|
||||
using Revitalize.Framework.Energy;
|
||||
|
||||
namespace Revitalize.Framework.Objects
|
||||
{
|
||||
|
@ -18,7 +19,7 @@ namespace Revitalize.Framework.Objects
|
|||
// -Inventories
|
||||
|
||||
/// <summary>A custom object template.</summary>
|
||||
public class CustomObject : PySObject
|
||||
public class CustomObject : PySObject,IEnergyInterface
|
||||
{
|
||||
|
||||
public virtual string text
|
||||
|
@ -167,6 +168,29 @@ namespace Revitalize.Framework.Objects
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accesses the energy manager for all objects.
|
||||
/// </summary>
|
||||
public EnergyManager EnergyManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.info == null)
|
||||
{
|
||||
this.updateInfo();
|
||||
return this.info.EnergyManager;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.info.EnergyManager;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
this.info.EnergyManager = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The display texture for this object.</summary>
|
||||
[JsonIgnore]
|
||||
public Texture2D displayTexture => this.animationManager.getTexture();
|
||||
|
@ -355,6 +379,11 @@ namespace Revitalize.Framework.Objects
|
|||
/// <summary>What happens when a player uses a tool on this object.</summary>
|
||||
public override bool performToolAction(Tool t, GameLocation location)
|
||||
{
|
||||
if (t == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (t.GetType() == typeof(StardewValley.Tools.Axe) || t.GetType() == typeof(StardewValley.Tools.Pickaxe))
|
||||
{
|
||||
Game1.createItemDebris(this, Game1.player.getStandingPosition(), Game1.player.getDirection());
|
||||
|
@ -702,5 +731,113 @@ namespace Revitalize.Framework.Objects
|
|||
return serializedInfo;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void updateWhenCurrentLocation(GameTime time, GameLocation environment)
|
||||
{
|
||||
if (this.location == null)
|
||||
{
|
||||
this.location = environment;
|
||||
}
|
||||
base.updateWhenCurrentLocation(time, environment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of neighboring tiled objects that produce or transfer energy. This should be used for machines/objects that consume or transfer energy
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<CustomObject> GetNeighboringEnergyTransferProducers()
|
||||
{
|
||||
Vector2 tileLocation = this.TileLocation;
|
||||
List<CustomObject> customObjects = new List<CustomObject>();
|
||||
if (this.location != null)
|
||||
{
|
||||
for(int i = -1; i <= 1; i++)
|
||||
{
|
||||
for(int j = -1; j <= 1; j++)
|
||||
{
|
||||
if (i == j || i== (-j)) continue;
|
||||
|
||||
Vector2 neighborTile = tileLocation + new Vector2(i, j);
|
||||
if (this.location.isObjectAtTile((int)neighborTile.X, (int)neighborTile.Y))
|
||||
{
|
||||
StardewValley.Object obj=this.location.getObjectAtTile((int)neighborTile.X, (int)neighborTile.Y);
|
||||
if (obj is CustomObject)
|
||||
{
|
||||
if((obj as CustomObject).EnergyManager.energyInteractionType== Enums.EnergyInteractionType.Produces || (obj as CustomObject).EnergyManager.energyInteractionType == Enums.EnergyInteractionType.Transfers)
|
||||
{
|
||||
customObjects.Add((CustomObject)obj);
|
||||
}
|
||||
}
|
||||
else continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return customObjects;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of neighboring tiled objects that consume or transfer energy. This should be used for machines/objects that produce or transfer energy
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<CustomObject> GetNeighboringEnergyTransferConsumers()
|
||||
{
|
||||
Vector2 tileLocation = this.TileLocation;
|
||||
List<CustomObject> customObjects = new List<CustomObject>();
|
||||
if (this.location != null)
|
||||
{
|
||||
for (int i = -1; i <= 1; i++)
|
||||
{
|
||||
for (int j = -1; j <= 1; j++)
|
||||
{
|
||||
if (i == j || i == (-j)) continue;
|
||||
|
||||
Vector2 neighborTile = tileLocation + new Vector2(i, j);
|
||||
if (this.location.isObjectAtTile((int)neighborTile.X, (int)neighborTile.Y))
|
||||
{
|
||||
StardewValley.Object obj = this.location.getObjectAtTile((int)neighborTile.X, (int)neighborTile.Y);
|
||||
if (obj is CustomObject)
|
||||
{
|
||||
if ((obj as CustomObject).EnergyManager.energyInteractionType == Enums.EnergyInteractionType.Consumes || (obj as CustomObject).EnergyManager.energyInteractionType == Enums.EnergyInteractionType.Transfers)
|
||||
{
|
||||
customObjects.Add((CustomObject)obj);
|
||||
}
|
||||
}
|
||||
else continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return customObjects;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the appropriate energy neighbors to move energy around from/to.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<CustomObject> getAppropriateEnergyNeighbors()
|
||||
{
|
||||
if (this.EnergyManager.consumesEnergy)
|
||||
{
|
||||
return this.GetNeighboringEnergyTransferProducers();
|
||||
}
|
||||
else if(this.EnergyManager.producesEnergy)
|
||||
{
|
||||
return this.GetNeighboringEnergyTransferConsumers();
|
||||
}
|
||||
else if (this.EnergyManager.transfersEnergy)
|
||||
{
|
||||
List<CustomObject> objs = new List<CustomObject>();
|
||||
objs.AddRange(this.GetNeighboringEnergyTransferConsumers());
|
||||
objs.AddRange(this.GetNeighboringEnergyTransferProducers());
|
||||
return objs;
|
||||
}
|
||||
return new List<CustomObject>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,350 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using PyTK.CustomElementHandler;
|
||||
using Revitalize.Framework.Utilities;
|
||||
using Revitalize.Framework.Utilities.Serialization;
|
||||
using StardewValley;
|
||||
|
||||
namespace Revitalize.Framework.Objects.Extras
|
||||
{
|
||||
public class TrashCanTile : MultiTiledComponent
|
||||
{
|
||||
public override string ItemInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
string info = Revitalize.ModCore.Serializer.ToJSONString(this.info);
|
||||
string guidStr = this.guid.ToString();
|
||||
string pyTkData = ModCore.Serializer.ToJSONString(this.data);
|
||||
string offsetKey = this.offsetKey != null ? ModCore.Serializer.ToJSONString(this.offsetKey) : "";
|
||||
string container = this.containerObject != null ? this.containerObject.guid.ToString() : "";
|
||||
return info + "<" + guidStr + "<" + pyTkData + "<" + offsetKey + "<" + container;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value)) return;
|
||||
string[] data = value.Split('<');
|
||||
string infoString = data[0];
|
||||
string guidString = data[1];
|
||||
string pyTKData = data[2];
|
||||
string offsetVec = data[3];
|
||||
string containerObject = data[4];
|
||||
this.info = (BasicItemInformation)Revitalize.ModCore.Serializer.DeserializeFromJSONString(infoString, typeof(BasicItemInformation));
|
||||
this.data = Revitalize.ModCore.Serializer.DeserializeFromJSONString<CustomObjectData>(pyTKData);
|
||||
if (string.IsNullOrEmpty(offsetVec)) return;
|
||||
if (string.IsNullOrEmpty(containerObject)) return;
|
||||
this.offsetKey = ModCore.Serializer.DeserializeFromJSONString<Vector2>(offsetVec);
|
||||
Guid oldGuid = this.guid;
|
||||
this.guid = Guid.Parse(guidString);
|
||||
if (ModCore.CustomObjects.ContainsKey(this.guid))
|
||||
{
|
||||
//ModCore.log("Update item with guid: " + this.guid);
|
||||
ModCore.CustomObjects[this.guid] = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
//ModCore.log("Add in new guid: " + this.guid);
|
||||
ModCore.CustomObjects.Add(this.guid, this);
|
||||
}
|
||||
|
||||
if (this.containerObject == null)
|
||||
{
|
||||
//ModCore.log(containerObject);
|
||||
Guid containerGuid = Guid.Parse(containerObject);
|
||||
if (ModCore.CustomObjects.ContainsKey(containerGuid))
|
||||
{
|
||||
this.containerObject = (MultiTiledObject)ModCore.CustomObjects[containerGuid];
|
||||
this.containerObject.removeComponent(this.offsetKey);
|
||||
this.containerObject.addComponent(this.offsetKey, this);
|
||||
//ModCore.log("Set container object from existing object!");
|
||||
}
|
||||
else
|
||||
{
|
||||
//ModCore.log("Container hasn't been synced???");
|
||||
MultiplayerUtilities.RequestGuidObject(containerGuid);
|
||||
MultiplayerUtilities.RequestGuidObject_Tile(this.guid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.containerObject.updateInfo();
|
||||
}
|
||||
|
||||
if (ModCore.CustomObjects.ContainsKey(oldGuid) && ModCore.CustomObjects.ContainsKey(this.guid))
|
||||
{
|
||||
if (ModCore.CustomObjects[oldGuid] == ModCore.CustomObjects[this.guid] && oldGuid != this.guid)
|
||||
{
|
||||
//ModCore.CustomObjects.Remove(oldGuid);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public TrashCanTile() : base()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TrashCanTile(CustomObjectData PyTKData, BasicItemInformation Info) : base(PyTKData, Info)
|
||||
{
|
||||
this.Price = Info.price;
|
||||
}
|
||||
|
||||
public TrashCanTile(CustomObjectData PyTKData, BasicItemInformation Info, Vector2 TileLocation) : base(PyTKData, Info, TileLocation)
|
||||
{
|
||||
this.Price = Info.price;
|
||||
}
|
||||
|
||||
|
||||
public override bool performObjectDropInAction(Item dropInItem, bool probe, Farmer who)
|
||||
{
|
||||
return false; //this.pickUpItem()==PickUpState.DoNothing;
|
||||
//return base.performObjectDropInAction(dropInItem, probe, who);
|
||||
}
|
||||
|
||||
public override bool performDropDownAction(Farmer who)
|
||||
{
|
||||
return base.performDropDownAction(who);
|
||||
}
|
||||
|
||||
//Checks for any sort of interaction IF and only IF there is a held object on this tile.
|
||||
public override bool checkForAction(Farmer who, bool justCheckingForActivity = false)
|
||||
{
|
||||
MouseState mState = Mouse.GetState();
|
||||
KeyboardState keyboardState = Game1.GetKeyboardState();
|
||||
|
||||
if (mState.RightButton == ButtonState.Pressed && (!keyboardState.IsKeyDown(Keys.LeftShift) || !keyboardState.IsKeyDown(Keys.RightShift)))
|
||||
{
|
||||
return this.rightClicked(who);
|
||||
}
|
||||
|
||||
if (mState.RightButton == ButtonState.Pressed && (keyboardState.IsKeyDown(Keys.LeftShift) || keyboardState.IsKeyDown(Keys.RightShift)))
|
||||
return this.shiftRightClicked(who);
|
||||
|
||||
|
||||
//return base.checkForAction(who, justCheckingForActivity);
|
||||
|
||||
if (justCheckingForActivity)
|
||||
return true;
|
||||
|
||||
return true;
|
||||
|
||||
//return this.clicked(who);
|
||||
//return false;
|
||||
}
|
||||
|
||||
public override bool performToolAction(Tool t, GameLocation location)
|
||||
{
|
||||
return base.performToolAction(t, location);
|
||||
}
|
||||
|
||||
public override bool performUseAction(GameLocation location)
|
||||
{
|
||||
return base.performUseAction(location);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets called when there is no actively held item on the tile.
|
||||
/// </summary>
|
||||
/// <param name="who"></param>
|
||||
/// <returns></returns>
|
||||
public override bool clicked(Farmer who)
|
||||
{
|
||||
return base.clicked(who);
|
||||
}
|
||||
|
||||
public override bool rightClicked(Farmer who)
|
||||
{
|
||||
if (Game1.player.ActiveObject != null)
|
||||
{
|
||||
if (this.containerObject.info.inventory != null && Game1.activeClickableMenu == null)
|
||||
{
|
||||
this.containerObject.info.inventory.addItem(Game1.player.ActiveObject);
|
||||
Game1.player.Items.Remove(Game1.player.ActiveObject);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.containerObject.info.inventory != null && Game1.activeClickableMenu == null)
|
||||
{
|
||||
this.containerObject.info.inventory.clear();
|
||||
Game1.activeClickableMenu = new Revitalize.Framework.Menus.InventoryTransferMenu(100, 100, 500, 500, this.containerObject.info.inventory.items, this.containerObject.info.inventory.capacity);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public override bool shiftRightClicked(Farmer who)
|
||||
{
|
||||
return base.shiftRightClicked(who);
|
||||
}
|
||||
|
||||
|
||||
public override Item getOne()
|
||||
{
|
||||
TrashCanTile component = new TrashCanTile(this.data, this.info.Copy());
|
||||
component.containerObject = this.containerObject;
|
||||
component.offsetKey = this.offsetKey;
|
||||
return component;
|
||||
}
|
||||
|
||||
public override ICustomObject recreate(Dictionary<string, string> additionalSaveData, object replacement)
|
||||
{
|
||||
Vector2 offsetKey = new Vector2(Convert.ToInt32(additionalSaveData["offsetKeyX"]), Convert.ToInt32(additionalSaveData["offsetKeyY"]));
|
||||
string GUID = additionalSaveData["GUID"];
|
||||
TrashCanTile self = Revitalize.ModCore.Serializer.DeserializeGUID<TrashCanTile>(additionalSaveData["GUID"]);
|
||||
if (ModCore.IsNullOrDefault<TrashCanTile>(self)) return null;
|
||||
try
|
||||
{
|
||||
if (!Revitalize.ModCore.ObjectGroups.ContainsKey(additionalSaveData["ParentGUID"]))
|
||||
{
|
||||
MultiTiledObject obj = (MultiTiledObject)Revitalize.ModCore.Serializer.DeserializeGUID<MultiTiledObject>(additionalSaveData["ParentGUID"]);
|
||||
self.containerObject = obj;
|
||||
self.containerObject.removeComponent(offsetKey);
|
||||
self.containerObject.addComponent(offsetKey, self);
|
||||
Revitalize.ModCore.ObjectGroups.Add(additionalSaveData["ParentGUID"], obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.containerObject = Revitalize.ModCore.ObjectGroups[additionalSaveData["ParentGUID"]];
|
||||
self.containerObject.removeComponent(offsetKey);
|
||||
self.containerObject.addComponent(offsetKey, self);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ModCore.log(err);
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
public override Dictionary<string, string> getAdditionalSaveData()
|
||||
{
|
||||
Dictionary<string, string> saveData = base.getAdditionalSaveData();
|
||||
Revitalize.ModCore.Serializer.SerializeGUID(this.containerObject.childrenGuids[this.offsetKey].ToString(), this);
|
||||
this.containerObject.getAdditionalSaveData();
|
||||
return saveData;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
/// <summary>What happens when the object is drawn at a tile location.</summary>
|
||||
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
|
||||
{
|
||||
if (this.info == null)
|
||||
{
|
||||
Revitalize.ModCore.log("info is null");
|
||||
if (this.syncObject == null) Revitalize.ModCore.log("DEAD SYNC");
|
||||
}
|
||||
if (this.animationManager == null) Revitalize.ModCore.log("Animation Manager Null");
|
||||
if (this.displayTexture == null) Revitalize.ModCore.log("Display texture is null");
|
||||
|
||||
//The actual planter box being drawn.
|
||||
if (this.animationManager == null)
|
||||
{
|
||||
if (this.animationManager.getExtendedTexture() == null)
|
||||
ModCore.ModMonitor.Log("Tex Extended is null???");
|
||||
|
||||
spriteBatch.Draw(this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(y * Game1.tileSize) / 10000f));
|
||||
// Log.AsyncG("ANIMATION IS NULL?!?!?!?!");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Log.AsyncC("Animation Manager is working!");
|
||||
float addedDepth = 0;
|
||||
|
||||
|
||||
if (Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this.containerObject && this.info.facingDirection == Enums.Direction.Up)
|
||||
{
|
||||
addedDepth += (this.containerObject.Height - 1) - ((int)(this.offsetKey.Y));
|
||||
if (this.info.ignoreBoundingBox) addedDepth += 1.5f;
|
||||
}
|
||||
else if (this.info.ignoreBoundingBox)
|
||||
{
|
||||
addedDepth += 1.0f;
|
||||
}
|
||||
this.animationManager.draw(spriteBatch, this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)((y + addedDepth) * Game1.tileSize) / 10000f) + .00001f);
|
||||
try
|
||||
{
|
||||
this.animationManager.tickAnimation();
|
||||
// Log.AsyncC("Tick animation");
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ModCore.ModMonitor.Log(err.ToString());
|
||||
}
|
||||
if (this.heldObject.Value != null) SpriteBatchUtilities.Draw(spriteBatch, this, this.heldObject.Value, alpha, addedDepth);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
|
||||
{
|
||||
|
||||
if (this.info == null)
|
||||
{
|
||||
Revitalize.ModCore.log("info is null");
|
||||
if (this.syncObject == null) Revitalize.ModCore.log("DEAD SYNC");
|
||||
}
|
||||
if (this.animationManager == null) Revitalize.ModCore.log("Animation Manager Null");
|
||||
if (this.displayTexture == null) Revitalize.ModCore.log("Display texture is null");
|
||||
|
||||
//The actual planter box being drawn.
|
||||
if (this.animationManager == null)
|
||||
{
|
||||
if (this.animationManager.getExtendedTexture() == null)
|
||||
ModCore.ModMonitor.Log("Tex Extended is null???");
|
||||
|
||||
spriteBatch.Draw(this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)(y * Game1.tileSize) / 10000f));
|
||||
// Log.AsyncG("ANIMATION IS NULL?!?!?!?!");
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//Log.AsyncC("Animation Manager is working!");
|
||||
float addedDepth = 0;
|
||||
|
||||
|
||||
if (Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this.containerObject && this.info.facingDirection == Enums.Direction.Up)
|
||||
{
|
||||
addedDepth += (this.containerObject.Height - 1) - ((int)(this.offsetKey.Y));
|
||||
if (this.info.ignoreBoundingBox) addedDepth += 1.5f;
|
||||
}
|
||||
else if (this.info.ignoreBoundingBox)
|
||||
{
|
||||
addedDepth += 1.0f;
|
||||
}
|
||||
this.animationManager.draw(spriteBatch, this.displayTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * Game1.tileSize), y * Game1.tileSize)), new Rectangle?(this.animationManager.currentAnimation.sourceRectangle), this.info.drawColor * alpha, 0f, Vector2.Zero, (float)Game1.pixelZoom, this.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, Math.Max(0f, (float)((y + addedDepth) * Game1.tileSize) / 10000f) + .00001f);
|
||||
try
|
||||
{
|
||||
this.animationManager.tickAnimation();
|
||||
// Log.AsyncC("Tick animation");
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
ModCore.ModMonitor.Log(err.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
// spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)((double)tileLocation.X * (double)Game1.tileSize + (((double)tileLocation.X * 11.0 + (double)tileLocation.Y * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2), (float)((double)tileLocation.Y * (double)Game1.tileSize + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2))), new Rectangle?(new Rectangle((int)((double)tileLocation.X * 51.0 + (double)tileLocation.Y * 77.0) % 3 * 16, 128 + this.whichForageCrop * 16, 16, 16)), Color.White, 0.0f, new Vector2(8f, 8f), (float)Game1.pixelZoom, SpriteEffects.None, (float)(((double)tileLocation.Y * (double)Game1.tileSize + (double)(Game1.tileSize / 2) + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) / 10000.0));
|
||||
|
||||
}
|
||||
|
||||
public override void drawWhenHeld(SpriteBatch spriteBatch, Vector2 objectPosition, Farmer f)
|
||||
{
|
||||
if (objectPosition.X < 0) objectPosition.X *= -1;
|
||||
if (objectPosition.Y < 0) objectPosition.Y *= -1;
|
||||
base.drawWhenHeld(spriteBatch, objectPosition, f);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -196,7 +196,9 @@ 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);
|
||||
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 / 4), (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)), scaleSize, SpriteEffects.None, layerDepth);
|
||||
|
||||
|
||||
spriteBatch.Draw(this.displayTexture, location, 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, SpriteEffects.None, layerDepth);
|
||||
}
|
||||
|
||||
public override Item getOne()
|
||||
|
|
|
@ -213,7 +213,7 @@ namespace Revitalize.Framework.Objects
|
|||
{
|
||||
this.updateInfo();
|
||||
foreach (KeyValuePair<Vector2, StardewValley.Object> pair in this.objects)
|
||||
pair.Value.drawInMenu(spriteBatch, location + (pair.Key * 16), 1.0f, transparency, layerDepth, drawStackNumber, c, drawShadow);
|
||||
pair.Value.drawInMenu(spriteBatch, location + (pair.Key * 16)+new Vector2(32,32), 1.0f, transparency, layerDepth, drawStackNumber, c, drawShadow);
|
||||
//base.drawInMenu(spriteBatch, location, scaleSize, transparency, layerDepth, drawStackNumber, c, drawShadow);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,12 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Revitalize.Framework.Objects.CraftingTables;
|
||||
using Revitalize.Framework.Objects.Extras;
|
||||
using Revitalize.Framework.Objects.Furniture;
|
||||
using Revitalize.Framework.Objects.Interfaces;
|
||||
using Revitalize.Framework.Objects.Items.Tools;
|
||||
using Revitalize.Framework.Utilities;
|
||||
using StardewModdingAPI;
|
||||
using StardewValley;
|
||||
using StardustCore.Animations;
|
||||
|
@ -104,10 +107,48 @@ namespace Revitalize.Framework.Objects
|
|||
public void loadInItems()
|
||||
{
|
||||
this.resources.loadInItems();
|
||||
|
||||
this.loadInCraftingTables();
|
||||
this.loadInMachines();
|
||||
this.loadInTools();
|
||||
}
|
||||
|
||||
private void loadInCraftingTables()
|
||||
{
|
||||
MultiTiledObject WorkbenchObj = new MultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(), Color.White, false, null, null));
|
||||
CraftingTableTile workbenchTile_0_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new Animation(0, 0, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
CraftingTableTile workbenchTile_1_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new Animation(16, 0, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
CraftingTableTile workbenchTile_0_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new Animation(0, 16, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
CraftingTableTile workbenchTile_1_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Workbench"), new Animation(16, 16, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
WorkbenchObj.addComponent(new Vector2(0, 0), workbenchTile_0_0);
|
||||
WorkbenchObj.addComponent(new Vector2(1, 0), workbenchTile_1_0);
|
||||
WorkbenchObj.addComponent(new Vector2(0, 1), workbenchTile_0_1);
|
||||
WorkbenchObj.addComponent(new Vector2(1, 1), workbenchTile_1_1);
|
||||
|
||||
MultiTiledObject AnvilObj = new MultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(), Color.White, false, null, null));
|
||||
CraftingTableTile anvilTile_0_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new Animation(0, 0, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
CraftingTableTile anvilTile_1_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new Animation(16, 0, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
CraftingTableTile anvilTile_0_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new Animation(0, 16, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
CraftingTableTile anvilTile_1_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Objects.Crafting", "Anvil"), new Animation(16, 16, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
AnvilObj.addComponent(new Vector2(0, 0), anvilTile_0_0);
|
||||
AnvilObj.addComponent(new Vector2(1, 0), anvilTile_1_0);
|
||||
AnvilObj.addComponent(new Vector2(0, 1), anvilTile_0_1);
|
||||
AnvilObj.addComponent(new Vector2(1, 1), anvilTile_1_1);
|
||||
|
||||
this.AddItem("Workbench", WorkbenchObj);
|
||||
this.AddItem("Anvil", AnvilObj);
|
||||
}
|
||||
|
||||
private void loadInMachines()
|
||||
{
|
||||
MultiTiledObject trashCan = new MultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Furniture.Misc.TrashCan", TextureManager.GetTexture(ModCore.Manifest, "Furniture", "TrashCan"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Trash Can", "Omegasis.Revitalize.Furniture.Misc.TrashCan", "A trash can where you can throw away unnecessary objects. It empties out at the beginning of each new day.", "Machine", Color.SteelBlue, -300, 0, false, 650, true, true, TextureManager.GetTexture(ModCore.Manifest, "Furniture", "TrashCan"), new AnimationManager(), Color.White, true, new InventoryManager(36), null, null));
|
||||
TrashCanTile trash1 = new TrashCanTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Furniture.Misc.TrashCan", TextureManager.GetTexture(ModCore.Manifest, "Furniture", "TrashCan"), typeof(TrashCanTile), Color.White, true), new BasicItemInformation("Trash Can", "Omegasis.Revitalize.Furniture.Misc.TrashCan", "A trash can where you can throw away unnecessary objects. It empties out at the beginning of each new day.", "Machine", Color.SteelBlue, -300, 0, false, 650, true, true, TextureManager.GetTexture(ModCore.Manifest, "Furniture", "TrashCan"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Furniture", "TrashCan"), new Animation(0, 0, 16, 16)), Color.White, true, new InventoryManager(36), null, null));
|
||||
TrashCanTile trash2 = new TrashCanTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Furniture.Misc.TrashCan", TextureManager.GetTexture(ModCore.Manifest, "Furniture", "TrashCan"), typeof(TrashCanTile), Color.White, true), new BasicItemInformation("Trash Can", "Omegasis.Revitalize.Furniture.Misc.TrashCan", "A trash can where you can throw away unnecessary objects. It empties out at the beginning of each new day.", "Machine", Color.SteelBlue, -300, 0, false, 650, true, true, TextureManager.GetTexture(ModCore.Manifest, "Furniture", "TrashCan"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Furniture", "TrashCan"), new Animation(0, 16, 16, 16)), Color.White, false, new InventoryManager(36), null, null));
|
||||
trashCan.addComponent(new Vector2(0, 0), trash1);
|
||||
trashCan.addComponent(new Vector2(0, 1), trash2);
|
||||
|
||||
this.AddItem("TrashCan", trashCan);
|
||||
}
|
||||
|
||||
private void loadInTools()
|
||||
{
|
||||
PickaxeExtended bronzePick = new PickaxeExtended(new BasicItemInformation("Bronze Pickaxe", "Omegasis.Revitalize.Items.Tools.BronzePickaxe", "A sturdy pickaxe made from bronze.", "Tool", Color.SlateGray, 0, 0, false, 500, false, false, TextureManager.GetTexture(ModCore.Manifest, "Tools", "BronzePickaxe"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Tools", "BronzePickaxe"), new Animation(0, 0, 16, 16)), Color.White, true, null, null), 2, TextureManager.GetExtendedTexture(ModCore.Manifest, "Tools", "BronzePickaxeWorking"));
|
||||
|
|
|
@ -478,29 +478,6 @@ namespace Revitalize
|
|||
|
||||
//ModCore.log("Added in SSC!");
|
||||
|
||||
|
||||
MultiTiledObject WorkbenchObj = new MultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(), Color.White, false, null, null));
|
||||
CraftingTableTile workbenchTile_0_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Workbench"), new Animation(0, 0, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
CraftingTableTile workbenchTile_1_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Workbench"), new Animation(16, 0, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
CraftingTableTile workbenchTile_0_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Workbench"), new Animation(0, 16, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
CraftingTableTile workbenchTile_1_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Workbench", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Workbench", "Omegasis.Revitalize.Objects.Crafting.Workbench", "A workbench that can be used for crafting different objects.", "Crafting", Color.Brown, -300, 0, false, 500, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Workbench"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Workbench"), new Animation(16, 16, 16, 16)), Color.White, false, null, null), "Workbench");
|
||||
WorkbenchObj.addComponent(new Vector2(0,0),workbenchTile_0_0);
|
||||
WorkbenchObj.addComponent(new Vector2(1, 0), workbenchTile_1_0);
|
||||
WorkbenchObj.addComponent(new Vector2(0, 1), workbenchTile_0_1);
|
||||
WorkbenchObj.addComponent(new Vector2(1, 1), workbenchTile_1_1);
|
||||
|
||||
MultiTiledObject AnvilObj = new MultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(), Color.White, false, null, null));
|
||||
CraftingTableTile anvilTile_0_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Anvil"), new Animation(0, 0, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
CraftingTableTile anvilTile_1_0 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Anvil"), new Animation(16, 0, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
CraftingTableTile anvilTile_0_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Anvil"), new Animation(0, 16, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
CraftingTableTile anvilTile_1_1 = new CraftingTableTile(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Crafting.Anvil", TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), typeof(CraftingTableTile), Color.White, true), new BasicItemInformation("Anvil", "Omegasis.Revitalize.Objects.Crafting.Anvil", "An anvil that can be used for crafting different machines and other metalic objects.", "Crafting", Color.Brown, -300, 0, false, 2000, true, true, TextureManager.GetTexture(Manifest, "Objects.Crafting", "Anvil"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Objects.Crafting", "Anvil"), new Animation(16, 16, 16, 16)), Color.White, false, null, null), "Anvil");
|
||||
AnvilObj.addComponent(new Vector2(0, 0), anvilTile_0_0);
|
||||
AnvilObj.addComponent(new Vector2(1, 0), anvilTile_1_0);
|
||||
AnvilObj.addComponent(new Vector2(0, 1), anvilTile_0_1);
|
||||
AnvilObj.addComponent(new Vector2(1, 1), anvilTile_1_1);
|
||||
|
||||
ObjectManager.AddItem("Workbench", WorkbenchObj);
|
||||
ObjectManager.AddItem("Anvil", AnvilObj);
|
||||
}
|
||||
|
||||
private void createDirectories()
|
||||
|
@ -538,7 +515,7 @@ namespace Revitalize
|
|||
{
|
||||
this.loadContent();
|
||||
Serializer.afterLoad();
|
||||
ShopHacks.AddOreToClintsShop();
|
||||
ShopHacks.AddInCustomItemsToShops();
|
||||
ObjectInteractionHacks.AfterLoad_RestoreTrackedMachines();
|
||||
|
||||
|
||||
|
@ -546,12 +523,12 @@ namespace Revitalize
|
|||
//Game1.player.addItemToInventory(ObjectManager.getChair("Omegasis.Revitalize.Furniture.Chairs.OakChair"));
|
||||
|
||||
Game1.player.addItemToInventoryBool(ObjectManager.GetItem("Workbench"));
|
||||
|
||||
//PickaxeExtended pick = new PickaxeExtended(new BasicItemInformation("My First Pickaxe", "Omegasis.Revitalize.Items.Tools.MyFirstPickaxe", "A testing pickaxe. Does it work?", "Tool", Color.SlateGray, 0, 0, false, 500, false, false, TextureManager.GetTexture(Manifest, "Tools", "Pickaxe"), new AnimationManager(TextureManager.GetExtendedTexture(Manifest, "Tools", "Pickaxe"), new Animation(0, 0, 16, 16)), Color.White, true, null, null),2,TextureManager.GetExtendedTexture(Manifest,"Tools","TestingPickaxeWorking"));
|
||||
Game1.player.addItemsByMenuIfNecessary(new List<Item>()
|
||||
{
|
||||
new StardewValley.Object((int)Enums.SDVObject.Wood,100),
|
||||
ModCore.ObjectManager.GetItem("SteelIngot", 20)
|
||||
ModCore.ObjectManager.GetItem("SteelIngot", 20),
|
||||
ModCore.ObjectManager.GetItem("TrashCan",1)
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
<Compile Include="Framework\Crafting\UnlockableCraftingRecipe.cs" />
|
||||
<Compile Include="Framework\Crafting\VanillaRecipeBook.cs" />
|
||||
<Compile Include="Framework\Crafting\VanillaRecipe.cs" />
|
||||
<Compile Include="Framework\Energy\IEnergyInterface.cs" />
|
||||
<Compile Include="Framework\Enums\Enums.cs" />
|
||||
<Compile Include="Framework\Environment\DarkerNight.cs" />
|
||||
<Compile Include="Framework\Environment\DarkerNightConfig.cs" />
|
||||
|
@ -123,10 +124,12 @@
|
|||
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCStatusEffects\StatusEffectManager.cs" />
|
||||
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCTextureUtilities.cs" />
|
||||
<Compile Include="Framework\Objects\CraftingTables\CraftingTableTile.cs" />
|
||||
<Compile Include="Framework\Energy\EnergyManager.cs" />
|
||||
<Compile Include="Framework\Objects\Extras\ArcadeCabinetOBJ.cs" />
|
||||
<Compile Include="Framework\Objects\Extras\ArcadeCabinetTile.cs" />
|
||||
<Compile Include="Framework\Objects\BasicItemInformation.cs" />
|
||||
<Compile Include="Framework\Objects\CustomObject.cs" />
|
||||
<Compile Include="Framework\Objects\Extras\TrashCanTile.cs" />
|
||||
<Compile Include="Framework\Objects\Furniture\Bench.cs" />
|
||||
<Compile Include="Framework\Objects\Furniture\ChairMultiTiledObject.cs" />
|
||||
<Compile Include="Framework\Objects\Furniture\ChairTileComponent.cs" />
|
||||
|
@ -374,6 +377,9 @@
|
|||
<Content Include="Content\Graphics\Objects\Furniture\Lamps\Oak Lamp.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Graphics\Objects\Furniture\Misc\TrashCan.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Graphics\Objects\Furniture\Storage\Oak Cabinet.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in New Issue