Example #1
0
        private static void MakeFinalToolProciencyAdjustments()
        {
            var addedProficiency = AddedToolProficencies.SingleOrDefault(x => x.Key == CurrentTool).Value;

            if (addedProficiency <= 0)
            {
                return;
            }
            Logger.LogVerbose(
                $"Removing {addedProficiency} temporary levels from {ToolTypeLookup.ToolTypes.Single(x => x.Key == CurrentTool).Value} skill.");
            switch (CurrentTool)
            {
            case ToolType.Hoe:
            case ToolType.WateringCan:
                Game1.player.addedFarmingLevel.Value -= addedProficiency;
                break;

            case ToolType.FishingRod:
                Game1.player.addedFishingLevel.Value -= addedProficiency;
                break;

            case ToolType.Axe:
                Game1.player.addedForagingLevel.Value -= addedProficiency;
                break;

            case ToolType.Pickaxe:
                Game1.player.addedMiningLevel.Value -= addedProficiency;
                break;

            case null:
                Logger.LogVerbose("Tool is not recognized for proficiency.");
                break;

            default:
                Logger.LogWarning("Unknown tool type proficiency detected, no proficiency adjusted.");
                break;
            }
            if (!(Game1.player.Stamina >= StaminaBeforeToolUse))
            {
                return;
            }
            Logger.LogVerbose("Added proficiency would have resulted in 0 or negative energy consumption, consuming a single energy point by default.");
            Game1.player.Stamina = StaminaBeforeToolUse--;
            StaminaBeforeToolUse = 0;
        }
Example #2
0
        private static void AdjustTemporaryToolProfiency()
        {
            var addedProficiency = AddedToolProficencies.SingleOrDefault(x => x.Key == CurrentTool).Value;

            if (addedProficiency <= 0)
            {
                return;
            }
            Logger.LogVerbose(
                $"Adding {addedProficiency} temporary levels to {ToolTypeLookup.ToolTypes.Single(x => x.Key == CurrentTool).Value} skill.");
            StaminaBeforeToolUse = Game1.player.Stamina;
            switch (CurrentTool)
            {
            case ToolType.Hoe:
            case ToolType.WateringCan:
                Game1.player.addedFarmingLevel.Value += addedProficiency;
                break;

            case ToolType.FishingRod:
                Game1.player.addedFishingLevel.Value += addedProficiency;
                break;

            case ToolType.Axe:
                Game1.player.addedForagingLevel.Value += addedProficiency;
                break;

            case ToolType.Pickaxe:
                Game1.player.addedMiningLevel.Value += addedProficiency;
                break;

            case null:
                Logger.LogVerbose("Tool is not recognized for profieciency.");
                break;

            default:
                Logger.LogWarning("Unknown tool type proficiency detected, no proficiency adjusted.");
                break;
            }
        }