-
Notifications
You must be signed in to change notification settings - Fork 27
Creating a potion
To create a potion, create a prefab similar to the ones here at Potions/assets/prefabs/potion/
and add the associated icon to Potions/assets/textures/potions/
.
For instance, to create a potion called "HealthBoost", the prefab should look like
{
"parent": "engine:iconItem",
"Item": {
"icon": "Potions:HealthBoostPotion1Bottle",
"stackId": "Potions:healthBoostPotion",
"consumedOnUse": true
},
"DisplayName": {
"name": "Potion of Minor Health Boost",
"description": "Increases the user's base max health by 50% for 30 seconds."
},
"Potion": {
"hasGenome": false,
"effects": [
{
"effect": "TEMP_MAX_HEALTH_BOOST",
"magnitude": 50,
"duration": 30010
}
]
},
"ItemHelp": {
"category": "Potions",
"paragraphText": [
"Increases the user's base max health by 50% for 30 seconds."
]
}
}
where "HealthBoostPotion1Bottle.png" is the name of the icon file which resides in Potions/assets/textures/potions/
,
DisplayName
and ItemHelp
carry information relevant to the potion,
the effects
field inside Potion contains a list of effects the potion carries.
All pre-defined potions in this module should have a hasGenome of false because they were not generated by the Herbalism system.
All potions should have a consumedOnUse set as true so that they exhaust after usage.
Each effect has an associated magnitude
and duration
.
Multiple effects can be used too in this fashion:
"Potion": {
"hasGenome": false,
"effects": [
{
"effect": "WALK",
"magnitude": 2,
"duration": 10100
},
{
"effect": "SWIM",
"magnitude": 2,
"duration": 10100
},
{
"effect": "JUMP",
"magnitude": 2,
"duration": 10100
}
]
}