[
  {
    "type": "effect_on_condition",
    "id": "test_EOC_CAFFEINE_ADDICTION",
    "condition": { "math": [ "rand(2000) <= addiction_rational(2000, 20, u_addiction_intensity('test_caffeine'))" ] },
    "effect": [
      { "u_add_morale": "morale_craving_caffeine", "bonus": -5, "max_bonus": -30 },
      {
        "if": {
          "and": [
            { "math": [ "u_val('stim') > u_addiction_intensity('test_caffeine') * -10" ] },
            { "math": [ "rand(10) < u_addiction_intensity('test_caffeine') * -10" ] }
          ]
        },
        "then": { "math": [ "u_val('stim')--" ] }
      },
      {
        "if": {
          "and": [
            { "math": [ "u_addiction_intensity('test_caffeine') >= 8" ] },
            { "math": [ "rand(392) < u_addiction_intensity('test_caffeine')" ] }
          ]
        },
        "then": { "u_add_effect": "shakes", "duration": "2 minutes" }
      }
    ]
  },
  {
    "//": "Intentionally hardcoded (builtin)",
    "type": "addiction_type",
    "id": "test_nicotine",
    "name": "Nicotine Withdrawal",
    "type_name": "nicotine",
    "description": "Intelligence - 1;   Occasional cravings",
    "craving_morale": "morale_craving_nicotine",
    "builtin": "nicotine_effect"
  },
  {
    "//": "Intentionally JSONified (effect_on_condition)",
    "type": "addiction_type",
    "id": "test_caffeine",
    "name": "Caffeine Withdrawal",
    "type_name": "caffeine",
    "description": "Strength - 1;   Slight sluggishness;   Occasional cravings",
    "craving_morale": "morale_craving_caffeine",
    "effect_on_condition": "test_EOC_CAFFEINE_ADDICTION"
  }
]
