Stardew Valley
0 of 0

File information

Last updated

Original upload

Created by

aedenthorn

Uploaded by

aedenthorn

Virus scan

Safe to use

About this mod

Lets modders trigger buffs using Content Patcher.

Requirements
Permissions and credits
Changelogs
Donations
This mod opens up the game's buff system for flexible triggering of buffs based on Content Patcher conditions.

An example content.json file looks like this:

{
    "Format": "1.28.4",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.BuffFramework/dictionary",
            "LogName": "",
            "Entries": {
                "aedenthorn.JacketBuff": {
                    "shirt": "Midnight Dog Jacket",
                    "which": 28,
                    "source": "aedenthorn.MidnightDogJacketBuff",
                    "displaySource": "Midnight Dog Jacket Buff"
                }
            }
        }
    ]
}

This applies the Squid Ink Ravioli buff when a player wears the Midnight Dog Jacket.


Here is a full template of the many fields you can use:

{
    "Format": "1.28.4",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.BuffFramework/dictionary",
            "LogName": "",
            "Entries": {
                "aedenthorn.BuffTestCP": {
                    "which": -1,
                    "sheetIndex": -1,
                    "glow": {
                        "R": 255,
                        "G": 0,
                        "B": 255,
                        "A": 255
                    },
                    "consume": null,
                    "duration": null,
                    "hat": null,
                    "shirt": null,
                    "pants": null,
                    "boots": null,
                    "ring": null,
                    "farming": null,
                    "fishing": null,
                    "mining": null,
                    "digging": null,
                    "luck": null,
                    "foraging": null,
                    "crafting": null,
                    "maxStamina": null,
                    "magneticRadius": null,
                    "speed": 5,
                    "defense": null,
                    "attack": null,
                    "healthRegen": null,
                    "staminaRegen": null,
                    "source": "aedenthorn.BuffTestCP",
                    "displaySource": "Test Buff",
                    "description": "Speedy!",
                    "buffId": 42424201,
                    "glowRate": 0.1,
                    "sound": "yoba",
                    "texturePath": null,
                    "textureX": null,
                    "textureY": null,
                    "textureWidth": null,
                    "textureHeight": null,
                    "textureScale": null,
                }
            }
        }
    ]
}


which can be set to one of the game's built-in buffs:

  • 6 - Full
  • 7 - Quenched
  • 12 - Burnt
  • 13 - Slimed
  • 14 - Jinxed
  • 17 - Tipsy
  • 18 - Spooked
  • 19 - Frozen
  • 20 - Warrior Energy
  • 21 - Invincible
  • 22 - Adrenaline Rush
  • 23 - Oil of Garlic
  • 24 - Monster Musk
  • 25 - Nauseous
  • 26 - Darkness
  • 27 - Weakness
  • 28 - Squid Ink Ravioli

If which is set to -1 or omitted, the built-in buff list is not used and you must set the buffId field. If you do set which, omit the buffId field.

sheetIndex lets you choose a buff icon from the game's built-in icon list in Tilesheets/BuffIcons.

Whether which is set or not, modders can tweak each of the buff's attributes listed in the example above. Any attribute omitted or set to null will not be tweaked.

sound is played when the buff is triggered.

texturePath
lets you create a custom buff icon - use Content Patcher to direct it to your mod's buff icon.


Conditions

consume can be set to the name of an edible item to trigger the buff when the item is eaten. If you are not using a vanilla buff from the above list, you must set buff duration manually by adding a duration value in seconds.

Any of hat, shirt, pants, boots, ring can be set to only activate the buff while the player is wearing the item(s) specified by name.


An example of a mod that uses this framework is After Midnight Speed Buff.


SMAPI mods can also access this mod's dictionary. An example of a SMAPI mod that uses this framework is Birthday Buff.


Technical

Requires SMAPI.

Implements a Generic Mod Config Menu interface to change config settings in-game.

Code is at https://github.com/aedenthorn/StardewValleyMods.

If you want to complain or ask for help or help me test my mods, you can visit my Discord server.

A list of all my mods for Stardew Valley is available at https://www.nexusmods.com/stardewvalley/articles/895.