Enchantments

Enchantments make it possible to specify custom effects provided by item, bionic or mutation.

Fields

id

(string) Unique identifier for this enchantment.

has

(string) How an enchantment determines if it is in the right location in order to qualify for being active.

This field is relevant only for items.

Values:

  • HELD (default) - when in your inventory
  • WIELD - when wielded in your hand
  • WORN - when worn as armor

condition

(string) How an enchantment determines if you are in the right environments in order for the enchantment to qualify for being active.

Values:

  • ALWAYS (default) - Always active
  • UNDERGROUND - When the owner of the item is below Z-level 0
  • ABOVEGROUND - When the owner of the item is at or above Z-level 0
  • UNDERWATER - When the owner is in swimmable terrain
  • NIGHT - When it is night time
  • DUSK - When it is dusk
  • DAY - When it is day time
  • DAWN - When it is dawn
  • ACTIVE - whenever the item, mutation, bionic, or whatever the enchantment is attached to is active.
  • INACTIVE - the opposite of ACTIVE

emitter

(string) Identifier of an emitter that's active as long as this enchantment is active. Default: no emitter.

ench_effects

(array) Grants effects of specified intensity as long as this enchantment is active.

Syntax for single entry:

{
  // (required) Identifier of the effect
  "effect": "effect_identifier",

  // (required) Intensity. Setting to 1 works for effects that do not actually have intensities.
  "intensity": 2
}

hit_you_effect

(array) List of spells that may be cast when enchantment is active and character melee attacks a creature.

Syntax for single entry:

{
  // (required) Identifier of the spell
  "id": "spell_identifier",

  // If true, the spell is centered on the character's location.
  // If false, the spell is centered on the attacking creature.
  // Default: false
  "hit_self": false,

  // Chance to trigger, one in X.
  // Default: 1
  "once_in": 1,

  // Message for when the spell is triggered for you.
  // %1$s is your name, %2$s is creature's
  // Default: no message
  "message": "You pierce %2$s with Magic Piercing!",

  // Message for when the spell in triggered for an NPC.
  // %1$s is their name, %2$s is creature's
  // Default: no message
  "npc_message": "%1$s pierces %2$s with Magic Piercing!",

  // TODO: broken?
  "min_level": 1,

  // TODO: broken?
  "max_level": 2
}

hit_me_effect

(array) List of spells that may be cast when enchantment is active and character gets melee attacked by a creature.

Same syntax as for hit_you_effect.

mutations

(array) List of mutations temporarily granted while enchantment is active.

intermittent_activation

(object) Rules that specify random effects which occur while enchantment is active.

Syntax:

{
  // List of checks to run on every turn while enchantment is active.
  "effects": [
    {
      // Average activation frequency.
      // The exact chance to pass is "one in (X converted to turns)" per turn.
      "frequency": "5 minutes",

      // List of spells to cast if the check passed.
      "spell_effects": [
        {
          // (required) Identifier of the spell
          "id": "nasty_random_effect",

          // TODO: broken?
          "min_level": 1,

          // TODO: broken?
          "max_level": 5
          // TODO: other fields appear to be loaded, but unused
        }
      ]
    }
  ]
}

values

(array) List of miscellaneous character/item values to modify.

Syntax for single entry:

{
  // (required) Value ID to modify, refer to list below.
  "value": "VALUE_ID_STRING",

  // Additive bonus. Optional integer number, default is 0.
  // Ignored for:
  // METABOLISM, MANA_REGEN, STAMINA_CAP, STAMINA_REGEN, THIRST, FATIGUE
  "add": 13,

  // Multiplicative bonus. Optional, default is 0.
  "multiply": -0.3
}

Additive bonus is applied separately from multiplicative, like so:

bonus = add + base_value * multiply

Thus, a multiply value of -0.8 is -80%, and a multiply of 2.5 is +250%. When modifying integer values, final bonus is rounded towards 0 (truncated).

When multiple enchantments (e.g. one from an item and one from a bionic) modify the same value, their bonuses are added together without rounding, then the sum is rounded (if necessary) before being applied to the base value.

Since there's no limit on number of enchantments the character can have at a time, the final calculated values have hardcoded bounds to prevent unintended behavior.

For all basegame values see here

Flags

(array) of enchantment_flag_id values

For all basegame values see here

Immune Effects

(array) of effect_type_id values

Prevents recieving these effects, but any present effects will persist

Immune Fields

(array) of field_type_id values

Prevents environmental effects of fields from being applied

Examples

[
  {
    "//": "On-hit effect for ink glands mutation, implemented via enchantment.",
    "type": "enchantment",
    "id": "MEP_INK_GLAND_SPRAY",
    "hit_me_effect": [
      {
        "id": "generic_blinding_spray_1",
        "hit_self": false,
        "once_in": 15,
        "message": "Your ink glands spray some ink into %2$s's eyes.",
        "npc_message": "%1$s's ink glands spay some ink into %2$s's eyes."
      }
    ]
  },
  {
    "//": "This one would look good on a katana for an anime mod.",
    "type": "enchantment",
    "id": "ENCH_ULTIMATE_ASSKICK",
    "has": "WIELD",
    "condition": "ALWAYS",
    "ench_effects": [{ "effect": "invisibility", "intensity": 1 }],
    "hit_you_effect": [{ "id": "AEA_FIREBALL" }],
    "hit_me_effect": [{ "id": "AEA_HEAL" }],
    "mutations": ["KILLER", "PARKOUR"],
    "values": [{ "value": "STRENGTH", "multiply": 1.1, "add": -5 }],
    "intermittent_activation": {
      "effects": [
        {
          "frequency": "1 hour",
          "spell_effects": [
            { "id": "AEA_ADRENALINE" }
          ]
        }
      ]
    },
    "flags": ["FOOD_POISON_IMMUNE"],
    "immune_fields": ["fd_fire"],
    "immune_effects": ["poison"]
    }
  }
]

Enchantment Values

{
  "id": "RANGED_DAMAGE", // Id of enchantment
  "type": "enchantment_value", // Needed type
  "can_add": true, // Weather adding to the enchantment value will do anything; Default true
  "can_mult": true, // Weather multiplying to the enchantment value will do anything; Default true
  "can_max": false, // Weather getting the maximum value of this type will do anything; Default false
  "desc": "Affects Outgoing Ranged Damage", // Description of the enchantment used in some menus
  "increase_good": true, // Color for enchantment descriptions, if true > 0 or > 1 == green else == red
  "suffixes": [ // All the suffixes. These appear as `RANGED_DAMAGE_XXX` in this case
    ["BASH", "Affects Outgoing Ranged Bash Damage"], // Suffixes reference the value of the parent in calculations automatically
    ["CUT", "Affects Outgoing Ranged Cut Damage"], // The second value here is the description of the enchantment
    ["DARK", "Affects Outgoing Ranged Dark Damage"],
    ["LIGHT", "Affects Outgoing Ranged Light Damage"],
    ["PSI", "Affects Outgoing Ranged Psi Damage"],
    ["STAB", "Affects Outgoing Ranged Stab Damage"],
    ["BULLET", "Affects Outgoing Ranged Ballistic Damage"],
    ["HEAT", "Affects Outgoing Ranged Heat Damage"],
    ["COLD", "Affects Outgoing Ranged Cold Damage"],
    ["ELECTRIC", "Affects Outgoing Ranged Electric Damage"],
    ["ACID", "Affects Outgoing Ranged Acid Damage"],
    ["BIOLOGICAL", "Affects Outgoing Ranged Biological Damage"],
    ["TRUE", "Affects Outgoing Ranged True Damage"],
  ],
}

Basegame Enchantment Value ID List

Character values

STRENGTH

Strength stat. base_value here is the base stat value. The final value cannot go below 0.

DEXTERITY

Dexterity stat. base_value here is the base stat value. The final value cannot go below 0.

PERCEPTION

Perception stat. base_value here is the base stat value. The final value cannot go below 0.

INTELLIGENCE

Intelligence stat. base_value here is the base stat value. The final value cannot go below 0.

HEALTH_POINTS

Hit points stat. base_value here is the base health value, The final value cannot go below 1.

SPEED

Character speed. base_value here is character speed including pain/hunger/weight penalties. Final speed value cannot go below 25% of base speed.

ATTACK_COST

Melee attack cost. The lower, the better. base_value here is attack cost for given weapon including modifiers from stats and skills. The final value cannot go below 25.

MOVE_COST

Movement cost. base_value here is tile movement cost including modifiers from clothing and traits. The final value cannot go below 20.

FLAT_MOVE_COST

Movement cost effect on flat ground. base_value here is movement cost partially through processing. The final value cannot go below 20 like MOVE_COST. This stacks with MOVE_COST

OBSTACLE_MOVE_COST

Movement cost effect on obstacles. base_value here is initial move cost. The final value cannot go below 100. Stacks with MOVE_COST, done before it.

SWIM_MOVE_COST

Movement cost effect while swimming The fianl value cannot go below 30. This does NOT stack with MOVE_COST

READING_SPEED

Speed of reading books. base_value is final reading speed in moves. The final value cannot go below 1 second.

CRAFTING_SPEED

Crafting speed. base_value is a multiplier of crafting speed. Calculated after all other multipliers

CONSTRUCTION_SPEED

Construction speed. base_value is a multiplier of construction speed for vehicles and furniture/terrain. Calculated after all other multipliers

It has two children:

  • CONSTRUCTION_SPEED_CON
  • CONSTRUCTION_SPEED_VEH

That would only work for furniture/terrain or vehicles respectively

METABOLISM

Metabolic rate. This modifier ignores add field. base_value here is PLAYER_HUNGER_RATE modified by traits. The final value cannot go below 0.

MANA_CAP

Mana capacity. base_value here is character's base mana capacity modified by traits. The final value cannot go below 0.

MANA_REGEN

Mana regeneration rate. This modifier ignores add field. base_value here is character's base mana gain rate modified by traits. The final value cannot go below 0.

STAMINA_CAP

Stamina capacity. This modifier ignores add field. base_value here is character's base stamina capacity modified by traits. The final value cannot go below 10% of PLAYER_MAX_STAMINA.

STAMINA_REGEN

Stamina regeneration rate. This modifier ignores add field. base_value here is character's base stamina gain rate modified by mouth encumbrance. The final value cannot go below 0.

THIRST

Thirst gain rate. base_value here is character's base thirst gain rate. The final value cannot go below 0.

FATIGUE

Fatigue gain rate. base_value here is character's base fatigue gain rate. The final value cannot go below 0.

MENDING_MULT

Edits the multiplier to broken limb mending rate. base_value is regen mod post mutations ( default 0.25 ) Final value range is 0.0 to 1.0

HEARING

Multiplier to hearing. base_value is the final multiplier to hearing. Final value cannot go below 0.

NOISE

Footstep noise value. base_value is the post-mutaiton multiplier to noise. Final value cannot go below 0.

SCENT

Scent value. base_value is the post-mutation scent value Final value cannot go below 0

STEALTH

Stealth modifier value higher value increases stealth, lower value decreases it. base_value is the post mutation value Clamped between 20 and 160. With 160 being 60% more visible and 20 being 80% less visible

BODYTEMP_X

Modifier to bodytemp accepted ranges Appropriate values are BODYTEMP_MIN: minimum temp for comfort BODYTEMP_MAX: maximum temp for comfort

BODYTEMP_SLEEP

Additional bodytemp given during sleep base_value is the mutation/previous enchantment values There is no limit

BODYTEMP_SPEED

Additional speed change for COLDBLOOD4 characters base_value is the mutation value or 0 There is no current limit

SLEEP_PAIN_THRESHOLD

Additional pain required for being woken up base_value is the base sleep pain value Minimum value is 1

SLEEP_DB_RESIST

Modifier to the amount of noise above environemental required to be woken up base_value is 20 There is no minimum nor maximum value

CLIMATE_CONTROL

Moves temperature felt by the player towards a point. base_value is the current temperature felt by the player It will increase or decrease based off if it is below or above normal temperature ( including mutations ) It has two children:

  • CLIMATE_CONTROL_COOLING
  • CLIMATE_CONTROL_HEATING

That would only heat or cool respectively

LIE

Modifier to Lie chance base_value is post skill effects Under 0 and above 100 has no change

PERSUADE

Same as LIE but for persuasion

INTIMIDATE

Same as LIE but for intimidation

HEALTHY_MULT

Edit to healthy. base_value is 1

FALL_DAMAGE_MULT

Modifier to fall damage multiplier, base_value is post mutations and other modifiers Cannot go below 0

CARRY_STORAGE

Modifier to carryable storage. base_value is current storage in mililiters Cannot go below 0

CARRY_WEIGHT

Modifier to carryable weight. base_value is current storage in mililiters Cannot go below 0

OVERMAP_SIGHT

Modifier to overmap sight. base_value is the best mutation value. Maximum is 3

EFFECTIVE_FOCUS

Modifier to focus. base_value is current focus There is no limit

BONUS_DODGE

Additional dodges per turn before dodge penalty kicks in. base_value here is character's base dodges per turn before penalty (usually 1). The final value can go below 0, which results in penalty to dodge roll.

BLISTER_COUNT

Effective heat armor modifier to gaining the blister effect. base_value is the number of blisters. The final value can go below 0, which would never blister the character. Or it could go higher and always blister the character.

LUMINATION

Lumination around the player when active. You cannot add nor multiply this enchantment, only max value works. The final value will not go below 0, and the maximum value is uncapped.

NIGHT_VISION

Night vision value for the player. EFFECT_NIGHT_VISION or GNV_EFFECT is 10.0 while GNVE_EFFECT is 18.0 Only max works, and it will take the highest of enchantment and other night vision effects

CLAIRVOYANCE

Clairvoyance value for the player. CLAIRVOYANCE_SUPER is 40.0 while CLAIRVOYANCE_PLUS is 8.0 And CLAIRVOYANCE is 3 Only max works, and it will take the highest of enchantment and other clairvoyance effects

ARMOR_X

Incoming damage modifier. Applied after Active Defense System bionic but before the damage is absorbed by items. Note that base_value here is incoming damage value of corresponding type, so positive add and greater than 1 mul will increase damage received by the character. Each damage type has its own enchant value in addition to the globally applied value ARMOR:

  • ARMOR_ACID
  • ARMOR_BASH
  • ARMOR_BIOLOGICAL
  • ARMOR_BULLET
  • ARMOR_COLD
  • ARMOR_CUT
  • ARMOR_LIGHT
  • ARMOR_DARK
  • ARMOR_PSI
  • ARMOR_ELECTRIC
  • ARMOR_HEAT
  • ARMOR_STAB
  • ARMOR_TRUE
SKILL_LEVEL

Character wide skill level modifier. base_value is the current skill level of the player In addition there are the following children of this enchantment

  • SKILL_LEVEL_BARTER
  • SKILL_LEVEL_SPEECH
  • SKILL_LEVEL_COMPUTER
  • SKILL_LEVEL_FIRSTAID
  • SKILL_LEVEL_MECHANICS
  • SKILL_LEVEL_TRAPS
  • SKILL_LEVEL_DRIVING
  • SKILL_LEVEL_SWIMMING
  • SKILL_LEVEL_FABRICATION
  • SKILL_LEVEL_COOKING
  • SKILL_LEVEL_TAILOR
  • SKILL_LEVEL_SURVIVAL
  • SKILL_LEVEL_ELECTRONICS
  • SKILL_LEVEL_ARCHERY
  • SKILL_LEVEL_GUN
  • SKILL_LEVEL_LAUNCHER
  • SKILL_LEVEL_PISTOL
  • SKILL_LEVEL_RIFLE
  • SKILL_LEVEL_SHOTGUN
  • SKILL_LEVEL_SMG
  • SKILL_LEVEL_THROW
  • SKILL_LEVEL_MELEE
  • SKILL_LEVEL_BASHING
  • SKILL_LEVEL_CUTTING
  • SKILL_LEVEL_DODGE
  • SKILL_LEVEL_STABBING
  • SKILL_LEVEL_UNARMED
SKILL_EXP

Character wide skill exp gain modifier. base_value is the exp gained by whatever is being done Warning: this value can only be multiplied, not added In addition there are the following children of this enchantment

  • SKILL_EXP_BARTER
  • SKILL_EXP_SPEECH
  • SKILL_EXP_COMPUTER
  • SKILL_EXP_FIRSTAID
  • SKILL_EXP_MECHANICS
  • SKILL_EXP_TRAPS
  • SKILL_EXP_DRIVING
  • SKILL_EXP_SWIMMING
  • SKILL_EXP_FABRICATION
  • SKILL_EXP_COOKING
  • SKILL_EXP_TAILOR
  • SKILL_EXP_SURVIVAL
  • SKILL_EXP_ELECTRONICS
  • SKILL_EXP_ARCHERY
  • SKILL_EXP_GUN
  • SKILL_EXP_LAUNCHER
  • SKILL_EXP_PISTOL
  • SKILL_EXP_RIFLE
  • SKILL_EXP_SHOTGUN
  • SKILL_EXP_SMG
  • SKILL_EXP_THROW
  • SKILL_EXP_MELEE
  • SKILL_EXP_BASHING
  • SKILL_EXP_CUTTING
  • SKILL_EXP_DODGE
  • SKILL_EXP_STABBING
  • SKILL_EXP_UNARMED

Item values

ITEM_ATTACK_COST

Attack cost (melee or throwing) for this item. Ignores condition / location, and is always active. base_value here is base item attack cost. Note that the final value cannot go below 0.

ITEM_DAMAGE_X

Melee damage of this item. Ignores condition / location, and is always active. base_value here is base item damage of corresponding type. Note that the final value cannot go below 0. There is the global damage modifier ITEM_DAMAGE in addition to the supported damage types:

  • ITEM_DAMAGE_BASH
  • ITEM_DAMAGE_CUT
  • ITEM_DAMAGE_STAB
  • ITEM_DAMAGE_BULLET
  • ITEM_DAMAGE_ACID
  • ITEM_DAMAGE_BIOLOGICAL
  • ITEM_DAMAGE_COLD
  • ITEM_DAMAGE_DARK
  • ITEM_DAMAGE_ELECTRIC
  • ITEM_DAMAGE_FIRE
  • ITEM_DAMAGE_LIGHT
  • ITEM_DAMAGE_PSI
  • ITEM_DAMAGE_TRUE
ITEM_ARMOR_X

Incoming damage modifier for this item, applied before the damage is absorbed by the item. Note that base_value here is incoming damage value of corresponding type, so positive add and greater than 1 mul will increase damage received by the character. Each damage type has its own enchant value, in addition to the global ITEM_ARMOR:

  • ITEM_ARMOR_ACID
  • ITEM_ARMOR_BASH
  • ITEM_ARMOR_BIOLOGICAL
  • ITEM_ARMOR_BULLET
  • ITEM_ARMOR_COLD
  • ITEM_ARMOR_CUT
  • ITEM_ARMOR_LIGHT
  • ITEM_ARMOR_DARK
  • ITEM_ARMOR_PSI
  • ITEM_ARMOR_ELECTRIC
  • ITEM_ARMOR_HEAT
  • ITEM_ARMOR_STAB
  • ITEM_ARMOR_TRUE

Enchantment Flag

{
  "id": "NEARSIGHTED",               // Id of the enchantment flag
  "type": "enchantment_flag",        // Needed type
  "conflicts": [ "FIX_NEARSIGHTED" ] // Array of other enchantment_flags of which it cancels
},

All noted effects apply to the character in possession of the enchantment granting thing

Basegame Enchantment Flag ID List

Sight

UNDERWATER_SIGHT

Makes sight underwater uninhibited

SLEEP_SIGHT

Allows sight while sleeping

NEARSIGHTED

Restricts vision greatly, solved by some glasses

FIX_NEARSIGHTED

Conflict to NEARSIGHTED, cures and removes it

BLIND

Prevents seeing any tile, bumping into walls does reveal them

FIX_BLIND

Conflict to BLIND, cures and removes it

INFRARED_VISION

Gain infrared vision

ELECTROSENSE

Can see robots and electrical creatures through walls

Consumption

EAT_ROTTEN

Gives the ability to eat rotten food safely.

ONLY_EAT_ROTTEN

Gives significant penalty to eating fresh food, still allows drinking fresh liquids

EAT_ROTTEN_MORALE

Gives no morale penalty to eating rotten food

CONSUME_UNCLEAN

Gives the ability to drink unclean liquids and eat unclean foods

FOOD_PARASITE_IMMUNE

Prevents gaining parasites from consuming food

FOOD_POISON_IMMUNE

Prevents gaining poison from consuming food

Miscellaneous

ALARMCLOCK

Gives the ability to set an alarm while sleeping

INTENAL_ALARMCLOCK

Has the effects of ALARMCLOCK, but does not produce sound It also should prevent sleeping through it.

VIEW_DRONE_CAM

Allows viewing any creature with effect_drone_marker, generally applied by PHOTOGRAPH robots

RADIO

Gives the effects of having a radio

THERMOMETER

Gives the effects of having a themometer

WATCH

Gives the ability to see the precise time

FIRE_FIELD_IMMUNE

Provides immunity to fire fields.