/// <summary> /// Replace base behaviour by returning an instance of <see cref="CookingTool"/>. /// </summary> public override Item getOne() { CookingTool tool = new CookingTool(upgradeLevel: this.UpgradeLevel); tool._GetOneFrom(this); return(tool); }
/// <summary> /// Creates a *functional* <see cref="CookingTool"/> with the <paramref name="upgradeLevel"/> *correctly* applied to the result. /// </summary> public static CookingTool Create(int upgradeLevel) { CookingTool cookingTool = new CookingTool(upgradeLevel : upgradeLevel) { UpgradeLevel = upgradeLevel }; return(cookingTool); }
/// <summary> /// please instantiate with <see cref="CookingTool.Create"/> method thanks bye /// </summary> /// <param name="upgradeLevel"></param> public CookingTool(int upgradeLevel) : base( name : CookingTool.InternalName, description : CookingTool.CookingToolDescription(upgradeLevel : upgradeLevel), upgradeLevel : upgradeLevel, parentSheetIndex : -1, menuViewIndex : -1) { // hello this is a new class thanks // do not bully }
/// <summary> /// Replace base behaviour by drawing from our custom <see cref="ModEntry.SpriteSheet"/> instead of <see cref="Game1.toolSpriteSheet"/>. /// </summary> public override void drawInMenu(SpriteBatch spriteBatch, Vector2 location, float scaleSize, float transparency, float layerDepth, StackDrawType drawStackNumber, Color color, bool drawShadow) { const int size = 16; spriteBatch.Draw( texture: ModEntry.SpriteSheet, position: location + new Vector2(size) / 2 * Game1.pixelZoom, sourceRectangle: CookingTool.CookingToolSourceRectangle(upgradeLevel: this.UpgradeLevel), color: color * transparency, rotation: 0f, origin: new Vector2(size) / 2, scale: Game1.pixelZoom * scaleSize, effects: SpriteEffects.None, layerDepth: layerDepth); }
public static void AddToShopStock(Dictionary <ISalable, int[]> itemPriceAndStock, Farmer who) { // Upgrade cooking equipment at the blacksmith if (ModEntry.Config.AddCookingToolProgression && who == Game1.player && CookingTool.CanBeUpgraded()) { int quantity = 1; int upgradeLevel = ModEntry.Instance.States.Value.CookingToolLevel + 1; int upgradePrice = ModEntry.Instance.Helper.Reflection.GetMethod( typeof(Utility), "priceForToolUpgradeLevel") .Invoke <int>(upgradeLevel); int extraMaterialIndex = ModEntry.Instance.Helper.Reflection.GetMethod( typeof(Utility), "indexOfExtraMaterialForToolUpgrade") .Invoke <int>(upgradeLevel); itemPriceAndStock.Add( CookingTool.Create(upgradeLevel: upgradeLevel), new int[] { upgradePrice / 2, quantity, extraMaterialIndex }); } }
public const int LegacyCookingToolSheetIndex = 17; // DEPRECATED /// <summary> /// Parameterless constructor for XML serialisation using <see cref="SpaceCore.Api.RegisterSerializerType"/>. /// </summary> public CookingTool() : this(upgradeLevel : CookingTool.GetEffectiveGlobalToolUpgradeLevel()) { }
protected override string loadDisplayName() { return(CookingTool.CookingToolDisplayName()); }