[
  {
    "type": "effect_on_condition",
    "id": "bad_food_mood_debuff",
    "recurrence": [ "1 hours", "2 hours" ],
    "condition": { "u_has_effect": "bad_food_ennui" },
    "//": "duration doesn't matter, since morale is added every hour, therefore it will always be mismatched with bad_food_ennui; instead, if you loose bad_food_ennui effect, you will lost the mood debuff also",
    "effect": [
      {
        "u_add_morale": "morale_bad_protein_bar",
        "bonus": { "math": [ "u_vitamin('bad_food') / -10" ] },
        "max_bonus": { "math": [ "u_vitamin('bad_food') / -4" ] },
        "duration": "1 days",
        "decay_start": "1 days"
      }
    ],
    "false_effect": [ { "u_lose_morale": "morale_bad_protein_bar" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_social_satisfied",
    "recurrence": [ "1 minutes", "5 minutes" ],
    "condition": { "u_has_effect": "social_satisfied" },
    "effect": [ { "u_add_morale": "morale_social", "bonus": 6, "max_bonus": 6, "duration": "1 days", "decay_start": "1 days" } ],
    "false_effect": [ { "u_lose_morale": "morale_social" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_social_dissatisfied",
    "recurrence": [ "1 minutes", "5 minutes" ],
    "condition": { "u_has_effect": "social_dissatisfied" },
    "effect": [
      {
        "u_add_morale": "morale_asocial",
        "bonus": { "math": [ "u_effect_intensity('social_dissatisfied') * -7" ] },
        "max_bonus": -21,
        "duration": "1 days",
        "decay_start": "1 days"
      }
    ],
    "false_effect": [ { "u_lose_morale": "morale_social_dissatisfied" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_asocial_satisfied",
    "recurrence": [ "1 minutes", "5 minutes" ],
    "condition": { "u_has_effect": "asocial_satisfied" },
    "effect": [ { "u_add_morale": "morale_asocial", "bonus": 10, "max_bonus": 10, "duration": "1 days", "decay_start": "1 days" } ],
    "false_effect": [ { "u_lose_morale": "morale_asocial" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_asocial_dissatisfied",
    "recurrence": [ "1 minutes", "5 minutes" ],
    "condition": { "u_has_effect": "asocial_dissatisfied" },
    "effect": [
      {
        "u_add_morale": "morale_social",
        "bonus": { "math": [ "u_effect_intensity('asocial_dissatisfied') * -7" ] },
        "max_bonus": -21,
        "duration": "1 days",
        "decay_start": "1 days"
      }
    ],
    "false_effect": [ { "u_lose_morale": "morale_asocial_dissatisfied" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "eoc_conjunctivitis_sting",
    "recurrence": [ "45 minutes", "120 minutes" ],
    "condition": { "and": [ { "u_has_effect": "conjunctivitis", "bodypart": "eyes" }, { "not": { "u_has_effect": "sleep" } } ] },
    "effect": [
      {
        "u_add_effect": "smoke_eyes",
        "duration": 300,
        "intensity": { "math": [ "u_effect_intensity('smoke_eyes', 'bodypart': 'eyes') + 1" ] },
        "target_part": "eyes"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_dermatik_visible_INIT",
    "eoc_type": "EVENT",
    "required_event": "character_gains_effect",
    "condition": { "compare_string": [ "dermatik", { "context_val": "effect" } ] },
    "effect": [ { "copy_var": { "context_val": "bodypart" }, "target_var": { "global_val": "IMPREGNATED_BODYPART" } } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DERMATIK_BIRTH_INIT",
    "recurrence": [ "3 minutes", "10 minutes" ],
    "condition": { "and": [ { "math": [ "u_vitamin('dermatik_larva_size') >= 1440" ] }, { "x_in_y_chance": { "x": 1, "y": 3 } } ] },
    "effect": { "u_lose_effect": "dermatik" }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DERMATIK_BIRTH",
    "eoc_type": "EVENT",
    "required_event": "character_loses_effect",
    "condition": { "compare_string": [ "dermatik", { "context_val": "effect" } ] },
    "effect": [
      {
        "if": { "math": [ "u_vitamin('dermatik_larva_size') >= 1440" ] },
        "then": [
          { "if": { "u_has_effect": "sleep" }, "then": { "u_lose_effect": "sleep" } },
          { "math": [ "NUM_LARVA = u_val('size')" ] },
          {
            "u_message": "<global_val:NUM_LARVA> dermatik larvae bursts out of the bulge of flesh on your <global_val:IMPREGNATED_BODYPART>!",
            "type": "bad"
          },
          {
            "u_spawn_monster": "mon_dermatik_larva",
            "real_count": { "global_val": "NUM_LARVA" },
            "min_radius": 1,
            "max_radius": 4
          },
          { "u_set_field": "fd_blood", "radius": 1, "intensity": 3 },
          { "turn_cost": "6 seconds" },
          { "math": [ "HOW_MUCH_WILL_THIS_SUCK = rng(21, 30)" ] },
          { "math": [ "u_vitamin('blood')", "-=", "HOW_MUCH_WILL_THIS_SUCK * 100" ] },
          { "math": [ "u_vitamin('redcells')", "-=", "HOW_MUCH_WILL_THIS_SUCK * 100" ] },
          {
            "u_add_effect": "bleed",
            "target_part": { "global_val": "IMPREGNATED_BODYPART" },
            "duration": { "math": [ "HOW_MUCH_WILL_THIS_SUCK * 60" ] }
          },
          { "math": [ "u_pain('type': 'perceived')", "+=", "HOW_MUCH_WILL_THIS_SUCK * 2" ] },
          { "math": [ "u_hp(IMPREGNATED_BODYPART)", "-=", "HOW_MUCH_WILL_THIS_SUCK * 2" ] }
        ],
        "else": { "math": [ "u_vitamin('mutant_toxin')", "+=", "u_vitamin('dermatik_larva_size') / 3" ] }
      },
      { "u_lose_effect": "dermatik_visible" },
      { "math": [ "u_vitamin('dermatik_larva_size') = 0" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_DERMATIK_FORMICATION",
    "condition": {
      "and": [
        { "u_has_effect": "dermatik" },
        { "not": { "u_has_effect": "formication" } },
        { "not": { "u_has_effect": "took_antihistamine" } },
        { "x_in_y_chance": { "x": 1, "y": { "math": [ "max(360, 2000 - u_vitamin('dermatik_larva_size'))" ] } } }
      ]
    },
    "effect": [
      { "u_message": "The growth in your <global_val:IMPREGNATED_BODYPART> itches!", "type": "bad" },
      {
        "u_add_effect": "formication",
        "duration": 360,
        "target_part": { "global_val": "IMPREGNATED_BODYPART" },
        "intensity": { "math": [ "u_effect_intensity('dermatik_visible', 'bodypart': IMPREGNATED_BODYPART)" ] }
      }
    ]
  }
]
