[
  {
    "type": "effect_on_condition",
    "id": "changing_initiate_check",
    "//": "Give player the CHANGING trait when they have enough basic mutagen in their blood.",
    "recurrence": [ "30 m", "45 m" ],
    "condition": {
      "and": [
        { "compare_num": [ { "u_val": "vitamin", "name": "mutagen" }, ">=", { "const": 450 } ] },
        { "not": { "u_has_flag": "CHANGING" } }
      ]
    },
    "deactivate_condition": { "u_has_flag": "CHANGING" },
    "effect": [
      {
        "weighted_list_eocs": [ [ "changing_failed", 2500 ], [ "changing_successful", { "u_val": "vitamin", "name": "mutagen" } ] ]
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "changing_failed",
    "condition": { "one_in_chance": 4 },
    "effect": [ { "u_message": "<CHANGING_FAILED>", "type": "bad" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "changing_successful",
    "effect": [ { "u_message": "<CHANGING_SUCCESS>", "type": "mixed" }, { "u_add_trait": "CHANGING" }, { "u_mutate": 0 } ]
  },
  {
    "type": "effect_on_condition",
    "id": "changing_reqs_not_met",
    "condition": { "one_in_chance": 3 },
    "effect": [
      { "u_message": "<CHANGING_ENDS>", "type": "bad" },
      { "u_lose_trait": "CHANGING" },
      { "arithmetic": [ { "u_val": "vitamin", "name": "mutagen" }, "=", { "const": 0 } ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "changing_mutate",
    "//": "Time for mutation!",
    "recurrence": [ "1 h", "6 h" ],
    "condition": { "and": [ { "u_has_flag": "CHANGING" } ] },
    "deactivate_condition": { "not": { "u_has_flag": "CHANGING" } },
    "effect": [
      {
        "run_eocs": [
          {
            "id": "changing_mutate2",
            "//": "Mutate!",
            "condition": { "compare_num": [ { "u_val": "vitamin", "name": "mutagen" }, ">=", { "const": 300 } ] },
            "effect": [
              { "u_message": "You feel a deep, churning sensation fill your body.", "type": "mixed" },
              { "u_mutate": 0 },
              { "arithmetic": [ { "u_val": "vitamin", "name": "mutagen" }, "-=", { "const": 60 } ] },
              { "arithmetic": [ { "u_val": "vitamin", "name": "mutagen" }, "-=", { "rand": 80 } ] }
            ],
            "false_effect": [ { "run_eocs": [ "changing_reqs_not_met" ] } ]
          }
        ]
      }
    ]
  },
  {
    "type": "snippet",
    "category": "<CHANGING_FAILED>",
    "text": [
      "You feel a shift in your body, but it quickly reverts.",
      "Your flesh has taken on an impatient wriggling sensation.",
      "Your skin feels like wax.  Or wet clay.",
      "You feel as though you're on the cusp of something, if you just give it a bit more time…",
      "Your vision swims.  You feel dizzy.",
      "It won't be long now.  Your innards flex and twist in anticipatory contortions."
    ]
  },
  {
    "type": "snippet",
    "category": "<CHANGING_SUCCESS>",
    "text": [
      "You begin to feel a sickeningly beautiful ache, the feeling of your cells tearing apart and recombining in strange new patterns.",
      "Your body is slowly reshaping itself!",
      "Every muscle you have begins to minutely spasm and cramp as your body starts morphing, slowly, in unearthly new ways.",
      "You feel your chest wriggle and begin to palpitate.  Here we go.",
      "Tiny ripples begin appearing in your skin and radiating outward like waves.  It is indescribably uncomfortable."
    ]
  },
  {
    "type": "snippet",
    "category": "<CHANGING_ENDS>",
    "text": [
      "You can palpably feel the churning sensation within fade, your mutation cut short by a lack of nutrients.",
      "The strain of mutation fades, leaving a throbbing sensation like a bad headache.  Or an afterglow.",
      "You're pulled back to reality as your body stops warping, leaving you in your current state for the time being.",
      "Your mutation abruptly ends from a lack of nutrients.  Back to Earth for now."
    ]
  }
]
