[
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_EFFECTS_ACCEPTANCE",
    "//": "Mainly good effects, since your unstable grasp on reality will strengthen with the distorted reality of the portal storms.",
    "recurrence": [ "5 minutes", "15 minutes" ],
    "condition": {
      "and": [
        { "u_has_trait": "PORTAL_DEPENDENT" },
        {
          "or": [
            { "is_weather": "portal_storm" },
            { "and": [ { "is_weather": "early_portal_storm" }, { "x_in_y_chance": { "x": 5, "y": 10 } } ] },
            { "and": [ { "is_weather": "distant_portal_storm" }, { "x_in_y_chance": { "x": 6, "y": 10 } } ] },
            { "and": [ { "is_weather": "near_portal_storm" }, { "x_in_y_chance": { "x": 8, "y": 10 } } ] },
            { "and": [ { "u_has_effect": "pd_strengthened_reality" }, { "x_in_y_chance": { "x": 1, "y": 10 } } ] }
          ]
        },
        { "not": { "u_has_worn_with_flag": "DIMENSIONAL_ANCHOR" } }
      ]
    },
    "deactivate_condition": {
      "not": {
        "or": [
          { "u_has_trait": "PORTAL_DEPENDENT" },
          { "is_weather": "portal_storm" },
          { "is_weather": "early_portal_storm" },
          { "is_weather": "near_portal_storm" },
          { "is_weather": "distant_portal_storm" },
          { "u_has_effect": "pd_strengthened_reality" }
        ]
      }
    },
    "effect": {
      "run_eocs": {
        "id": "EOC_PDEPENDENT_STRONG_WEAK_EFFECTS_ACCEPTANCE",
        "condition": { "math": [ "ps_str", ">", "4" ] },
        "effect": {
          "weighted_list_eocs": [
            [ "EOC_PORTAL_DEPENDENT_MESSAGES_GOOD", 10 ],
            [ "EOC_PORTAL_DEPENDENT_MORALE_GOOD", 6 ],
            [ "EOC_PORTAL_DEPENDENT_FOCUS_GOOD", 3 ],
            [ "EOC_PORTAL_DEPENDENT_ACCEPTANCE", 1 ]
          ]
        },
        "false_effect": {
          "weighted_list_eocs": [
            [ "EOC_PORTAL_DEPENDENT_MESSAGES_GOOD", 10 ],
            [ "EOC_PORTAL_DEPENDENT_MORALE_GOOD", 5 ],
            [ "EOC_PORTAL_DEPENDENT_FOCUS_GOOD", 2 ]
          ]
        }
      }
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MORALE_GOOD",
    "//": "Morale buff for feeling connected to your original reality/wavelength.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You feel a warm sense of being at home.", "type": "good" },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 10,
        "max_bonus": 20,
        "duration": "60 minutes",
        "decay_start": "60 minutes"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE",
    "//": "Some small effects as you feel yourself more stable.",
    "condition": { "not": { "u_has_trait": "REALITY_GRASP" } },
    "effect": {
      "run_eocs": [
        {
          "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE_TIMER",
          "condition": { "days_since_cataclysm": 60 },
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_ACCEPTANCE_1", 4 ],
              [ "EOC_PORTAL_DEPENDENT_ACCEPTANCE_2", 3 ],
              [ "EOC_PORTAL_DEPENDENT_ACCEPTANCE_3", 2 ],
              [ "EOC_PORTAL_DEPENDENT_ACCEPTANCE_4", 1 ]
            ]
          },
          "false_effect": { "weighted_list_eocs": [ [ "EOC_PORTAL_DEPENDENT_ACCEPTANCE_1", 2 ], [ "EOC_PORTAL_DEPENDENT_ACCEPTANCE_2", 1 ] ] }
        }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE_1",
    "//": "Your feel faintly more accepted by the world, it could be related with the decay of reality in here.",
    "effect": [
      { "u_message": "You suddenly feel a weight you didn't know you had on you, being lifted away.", "type": "good" },
      { "math": [ "u_pain()", "-=", "5" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE_2",
    "//": "Your feel more accepted by the world, it could be related with the decay of reality in here.",
    "effect": [
      {
        "u_message": "You suddenly feel wakeful and energized, as if something that was slowing you down is now gone.",
        "type": "good"
      },
      { "math": [ "u_val('fatigue')", "-=", "20" ] },
      { "math": [ "u_val('stamina')", "+=", "20" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE_3",
    "//": "Your feel even more accepted by the world, it could be related with the decay of reality in here.",
    "effect": [
      { "u_message": "You suddenly feel as if invisible shackles are being lifted away…", "type": "good" },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 20,
        "max_bonus": 40,
        "duration": "60 minutes",
        "decay_start": "60 minutes"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE_4",
    "//": "Your feel greatly more accepted by the world, your body partially stabilizes itself in this reality if you are outside.",
    "condition": {
      "or": [
        { "is_weather": "portal_storm" },
        { "is_weather": "early_portal_storm" },
        { "is_weather": "near_portal_storm" },
        { "is_weather": "distant_portal_storm" }
      ]
    },
    "effect": {
      "run_eocs": {
        "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE_OUTSIDE",
        "condition": "u_is_outside",
        "effect": [
          {
            "u_message": "You suddenly feel a profound sense of belonging take root inside you, spreading throughout your body.  It fades quickly, but something warm remains…",
            "type": "good"
          },
          { "u_add_trait": "REALITY_GRASP" }
        ],
        "false_effect": {
          "u_message": "You suddenly feel a profound sense of belonging take root inside you, but then abruptly grow cold.  You reach out for it, but it's gone now, taken away by the indoors.  You long for the sky…",
          "type": "warning"
        }
      }
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_FOCUS_GOOD",
    "//": "Your mind gains focus as an effect of your connection with the portal storms.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "Everything suddenly feels more clear.", "type": "good" },
      { "math": [ "u_val('focus')", "+=", "10" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MESSAGES_GOOD",
    "//": "Messages about good things that you hear/see related to your condition.",
    "condition": { "and": [ { "not": { "u_has_effect": "sleep" } }, "u_can_see" ] },
    "effect": [ { "u_message": "PORTAL_DEPENDENT_MESSAGES_VARIED_GOOD", "snippet": true, "type": "good" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_EFFECTS_REJECTION",
    "//": "This should be mainly bad effects, since your unstable grasp on reality will further weaken when the reality stabilizes in lack of portal storms.",
    "recurrence": [ "15 minutes", "100 minutes" ],
    "condition": {
      "and": [
        { "u_has_trait": "PORTAL_DEPENDENT" },
        {
          "not": {
            "or": [
              { "u_has_effect": "pd_strengthened_reality" },
              { "is_weather": "portal_storm" },
              { "is_weather": "early_portal_storm" },
              { "is_weather": "near_portal_storm" },
              { "is_weather": "distant_portal_storm" }
            ]
          }
        },
        { "not": { "u_has_worn_with_flag": "DIMENSIONAL_ANCHOR" } }
      ]
    },
    "deactivate_condition": {
      "or": [
        { "not": { "u_has_trait": "PORTAL_DEPENDENT" } },
        {
          "or": [
            { "u_has_effect": "pd_strengthened_reality" },
            { "is_weather": "portal_storm" },
            { "is_weather": "early_portal_storm" },
            { "is_weather": "near_portal_storm" },
            { "is_weather": "distant_portal_storm" }
          ]
        }
      ]
    },
    "effect": {
      "run_eocs": {
        "id": "EOC_PDEPENDENT_STRONG_WEAK_EFFECTS_REJECTION",
        "condition": { "not": { "u_has_trait": "REALITY_GRASP" } },
        "effect": {
          "weighted_list_eocs": [
            [ "EOC_PORTAL_DEPENDENT_MESSAGES_BAD", 18 ],
            [ "EOC_PORTAL_DEPENDENT_MORALE_BAD", 6 ],
            [ "EOC_PORTAL_DEPENDENT_FOCUS_BAD", 5 ],
            [ "EOC_PORTAL_DEPENDENT_SHAKES", 4 ],
            [ "EOC_PORTAL_DEPENDENT_NAUSEA", 4 ],
            [ "EOC_PORTAL_DEPENDENT_STUN", 3 ],
            [ "EOC_PORTAL_DEPENDENT_DOWNED", 3 ],
            [ "EOC_PORTAL_DEPENDENT_STATS_BAD", 3 ],
            [ "EOC_PORTAL_TELEPORT_STUCK_START", 3 ],
            [ "EOC_PORTAL_DEPENDENT_PAIN", 2 ],
            [ "EOC_PORTAL_DEPENDENT_PAIN_CONSTANT", 1 ],
            [ "EOC_PORTAL_DEPENDENT_DAMAGE_CONSTANT", 1 ]
          ]
        },
        "false_effect": {
          "weighted_list_eocs": [
            [ "EOC_PORTAL_DEPENDENT_MESSAGES_BAD", 10 ],
            [ "EOC_PORTAL_DEPENDENT_MORALE_BAD", 3 ],
            [ "EOC_PORTAL_DEPENDENT_FOCUS_BAD", 2 ],
            [ "EOC_PORTAL_DEPENDENT_SHAKES", 1 ],
            [ "EOC_PORTAL_DEPENDENT_NAUSEA", 1 ]
          ]
        }
      }
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MORALE_BAD",
    "//": "Morale debuff for feeling rejected by this reality.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You suddenly feel like you shouldn't be here.", "type": "bad" },
      {
        "u_add_morale": "morale_feeling_bad",
        "bonus": -10,
        "max_bonus": -30,
        "duration": "40 minutes",
        "decay_start": "10 minutes"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_FOCUS_BAD",
    "//": "Your mind losses focus as an effect of your unstable condition.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You try to recall what you were about to do, but you can't focus…", "type": "bad" },
      { "math": [ "u_val('focus')", "-=", "10" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_STATS_BAD",
    "//": "Stats debuffs as consequence of your unstable condition.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      {
        "run_eocs": {
          "id": "EOC_PORTAL_DEPENDENT_STATS_EFFECTS",
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_STR_BAD", 1 ],
              [ "EOC_PORTAL_DEPENDENT_DEX_BAD", 1 ],
              [ "EOC_PORTAL_DEPENDENT_PER_BAD", 1 ],
              [ "EOC_PORTAL_DEPENDENT_INT_BAD", 1 ]
            ]
          }
        }
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_STR_BAD",
    "//": "Strength debuff as consequence of your unstable condition.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You suddenly feel feeble.  Your muscles wobble.", "type": "bad" },
      { "u_add_effect": "pd_str_bad", "duration": "50 minutes" },
      { "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_STR_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DEX_BAD",
    "//": "Dextery debuff as consequence of your unstable condition.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You suddenly feel a sharp pain in your hand.  You reach out to grab it, and miss.", "type": "bad" },
      { "u_add_effect": "pd_dex_bad", "duration": "50 minutes" },
      { "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_DEX_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_PER_BAD",
    "//": "Perception debuff as consequence of your unstable condition.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You blink one time, and everything seems bigger.", "type": "bad" },
      { "u_add_effect": "pd_per_bad", "duration": "50 minutes" },
      { "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_PER_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_INT_BAD",
    "//": "Intelligence debuff as consequence of your unstable condition.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You stop to think, but you can't seem to remember about what.", "type": "bad" },
      { "u_add_effect": "pd_int_bad", "duration": "50 minutes" },
      { "queue_eocs": "EOC_PORTAL_DEPENDENT_MESSAGES_INT_BAD", "time_in_future": [ "10 minutes", "40 minutes" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_SHAKES",
    "//": "Occasional shakes as consequence of your unstable condition.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "You feel anxious for no reason.", "type": "bad" },
      { "u_add_effect": "shakes", "duration": "5 minutes" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_NAUSEA",
    "//": "Occasional nausea as consequence of your unstable condition.",
    "effect": [
      { "u_message": "You suddenly feel as if your stomach and its contents are fighting.", "type": "bad" },
      { "u_add_effect": "nausea", "duration": "5 minutes", "intensity": 2 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_STUN",
    "//": "The world doesn't like your presence, stunning you for a moment.",
    "effect": [
      { "u_message": "For a brief moment, you feel rejected by the world.", "type": "bad" },
      { "u_add_effect": "stunned", "duration": 1 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DOWNED",
    "//": "Your body lacks physical substance for a moment, tripping you.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "Gravity suddenly exerts immense pressure, forcing you to the ground!", "type": "bad" },
      { "u_add_effect": "downed", "duration": 1 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DAMAGE_CONSTANT",
    "//": "Your body is being strongly rejected for a few minutes.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      { "u_message": "Your vision suddenly fills with cold sparks.  You feel so alone…", "type": "bad" },
      { "u_add_effect": "pd_rejection", "duration": "15 minutes", "intensity": 2 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_PAIN_CONSTANT",
    "//": "Your body is being faintly rejected for a few minutes.",
    "condition": { "not": { "u_has_effect": "sleep" } },
    "effect": [
      {
        "u_message": "Faint sparks surround your body as you suffer with every action you take, as if you weren't intended to do them.",
        "type": "bad"
      },
      { "u_add_effect": "pd_rejection", "duration": "7 minutes" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_PAIN",
    "//": "The world rejects you with violence for a second, this is intended to occur even while sleeping.",
    "effect": [
      {
        "u_message": "Faint sparks suddenly appear and disappear around you, as if rejecting your very existence.  Pain flares across your body.",
        "type": "bad"
      },
      { "math": [ "u_pain()", "+=", "10" ] }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MESSAGES_BAD",
    "//": "Messages about strange/bad things that you hear/see/feel/dream related to your condition.",
    "effect": {
      "run_eocs": [
        {
          "id": "EOC_PORTAL_DEPENDENT_MESSAGES_BAD_AWAKE",
          "condition": { "not": { "u_has_effect": "sleep" } },
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_MESSAGES_VARIED_BAD", 1 ],
              [ "EOC_PORTAL_DEPENDENT_MESSAGES_STR_BAD", 1 ],
              [ "EOC_PORTAL_DEPENDENT_MESSAGES_DEX_BAD", 1 ],
              [ "EOC_PORTAL_DEPENDENT_MESSAGES_PER_BAD", 1 ],
              [ "EOC_PORTAL_DEPENDENT_MESSAGES_INT_BAD", 1 ]
            ]
          },
          "false_effect": [ { "u_message": "PORTAL_DEPENDENT_MESSAGES_DREAMS", "snippet": true, "type": "mixed" } ]
        }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MESSAGES_VARIED_BAD",
    "//": "Varied messages about strange/bad things that you hear/see related to your condition.",
    "condition": { "and": [ { "not": { "u_has_effect": "sleep" } }, "u_can_see" ] },
    "effect": [ { "u_message": "PORTAL_DEPENDENT_MESSAGES_VARIED_BAD", "snippet": true, "type": "mixed" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MESSAGES_STR_BAD",
    "//": "Messages about strange/bad things that you feel in your body related to your condition.",
    "condition": { "and": [ { "not": { "u_has_effect": "sleep" } }, "u_can_see" ] },
    "effect": [ { "u_message": "PORTAL_DEPENDENT_MESSAGES_STR_BAD", "snippet": true, "type": "mixed" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MESSAGES_DEX_BAD",
    "//": "Messages about strange/bad things that you suffer with your hands related to your condition.",
    "condition": { "and": [ { "not": { "u_has_effect": "sleep" } }, "u_can_see" ] },
    "effect": [ { "u_message": "PORTAL_DEPENDENT_MESSAGES_DEX_BAD", "snippet": true, "type": "mixed" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MESSAGES_PER_BAD",
    "//": "Messages about strange/bad things that you perceive because of your condition.",
    "condition": { "and": [ { "not": { "u_has_effect": "sleep" } }, "u_can_see" ] },
    "effect": [ { "u_message": "PORTAL_DEPENDENT_MESSAGES_PER_BAD", "snippet": true, "type": "mixed" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_MESSAGES_INT_BAD",
    "//": "Messages about strange/bad things that you think/feel/do related to your mental condition.",
    "condition": { "and": [ { "not": { "u_has_effect": "sleep" } }, "u_can_see" ] },
    "effect": [ { "u_message": "PORTAL_DEPENDENT_MESSAGES_INT_BAD", "snippet": true, "type": "mixed" } ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD",
    "//": "Rewards for Portal Dependent characters that survive the dimensional experience of a portal dungeon.",
    "effect": {
      "switch": { "global_val": "var", "var_name": "portal_dungeon_level" },
      "cases": [
        {
          "case": 0,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_0", 16 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_1", 3 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_2", 1 ]
            ]
          }
        },
        {
          "case": 1,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_0", 6 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_1", 12 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_2", 2 ]
            ]
          }
        },
        {
          "case": 2,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_0", 1 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_1", 5 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_2", 12 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_3", 2 ]
            ]
          }
        },
        {
          "case": 3,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_1", 2 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_2", 5 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_3", 12 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_4", 1 ]
            ]
          }
        },
        {
          "case": 4,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_2", 2 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_3", 6 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_4", 12 ]
            ]
          }
        }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_0",
    "//": "Basic reward for experiencing a different reality when your own fabric of reality is damaged.",
    "effect": [
      {
        "u_message": "You feel invigorated by what you just experienced, so…  What is this feeling of regret for leaving that place?",
        "type": "good"
      },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 20,
        "max_bonus": 40,
        "duration": "120 minutes",
        "decay_start": "60 minutes"
      }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_1",
    "//": "Standard reward for experiencing a different reality and integrating a little with it.",
    "effect": [
      {
        "u_message": "You feel like the shackles of your body are loosening a little.  The world seems to accept your distorted presence for now.  You wonder if what you currently feel would have been greater if only you had gone deeper…",
        "type": "good"
      },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 20,
        "max_bonus": 40,
        "duration": "180 minutes",
        "decay_start": "80 minutes"
      },
      { "u_add_effect": "pd_strengthened_reality", "duration": "2 days" }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_2",
    "//": "Improved reward for experiencing a different reality and integrating a little with it.",
    "effect": [
      {
        "u_message": "You suddenly feel in calm, your body a little faster, and your surroundings less hostile than what you remember.  Before this new sensation passes away though, you hear a little voice in your head saying \"deeper…\"",
        "type": "good"
      },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 20,
        "max_bonus": 40,
        "duration": "240 minutes",
        "decay_start": "100 minutes"
      },
      { "u_add_effect": "pd_strengthened_reality", "duration": "5 days", "intensity": 2 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_3",
    "//": "Big reward for experiencing a different reality and partially integrating your self with it.",
    "effect": [
      {
        "u_message": "You return to your reality with a sense of ecstasy, your body feels great, your shackles have come loose and you feel powerful because of it.  But you can feel it, this exhilarating feeling is only the beginning, you need to go deeper…",
        "type": "good"
      },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 25,
        "max_bonus": 40,
        "duration": "260 minutes",
        "decay_start": "120 minutes"
      },
      { "u_add_effect": "pd_strengthened_reality", "duration": "8 days", "intensity": 3 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_4",
    "//": "Great reward for experiencing a different reality, partially integrating with it and bringing some of that reality with you.",
    "effect": [
      {
        "u_message": "You feel in communion with the world around you, the world is no longer rejecting you, at least for now, YOU are rejecting IT.  Your whole body craves for what you could have gained if only you had gone a little deeper…",
        "type": "good"
      },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 25,
        "max_bonus": 40,
        "duration": "280 minutes",
        "decay_start": "140 minutes"
      },
      { "u_add_effect": "pd_strengthened_reality", "duration": "11 days", "intensity": 4 }
    ]
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_FINAL_REWARD",
    "//": "Rewards for Portal Dependent characters that survive the last level of a portal dungeon.",
    "effect": {
      "switch": { "global_val": "var", "var_name": "portal_dungeon_level" },
      "cases": [
        {
          "case": 5,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_3", 6 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_4", 10 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_5", 4 ]
            ]
          }
        },
        {
          "case": 6,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_3", 4 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_4", 8 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_5", 8 ]
            ]
          }
        },
        {
          "case": 7,
          "effect": {
            "weighted_list_eocs": [
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_3", 1 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_4", 6 ],
              [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_5", 13 ]
            ]
          }
        },
        {
          "case": 8,
          "effect": {
            "weighted_list_eocs": [ [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_4", 2 ], [ "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_5", 18 ] ]
          }
        },
        { "case": 9, "effect": [ { "run_eocs": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_5" } ] }
      ]
    }
  },
  {
    "type": "effect_on_condition",
    "id": "EOC_PORTAL_DEPENDENT_DUNGEON_REWARD_5",
    "//": "Final reward for experiencing a whole different reality, allowing you to partially anchor yourself to reality again.",
    "effect": [
      {
        "run_eocs": {
          "id": "EOC_PORTAL_DEPENDENT_ACCEPTANCE_TRAIT",
          "condition": { "not": { "u_has_trait": "REALITY_GRASP" } },
          "effect": [
            {
              "u_message": "You suddenly feel a profound sense of belonging take root inside you, spreading throughout your body.  It fades quickly, but something warm remains…",
              "type": "good"
            },
            { "u_add_trait": "REALITY_GRASP" }
          ],
          "false_effect": [
            {
              "u_message": "You suddenly feel a profound sense of belonging take root inside you, temporally amplifying your grasp of reality.  For some time you will be the master of your surroundings.",
              "type": "good"
            },
            { "u_add_effect": "pd_strengthened_reality", "duration": "14 days", "intensity": 4 }
          ]
        }
      },
      {
        "u_add_morale": "morale_feeling_good",
        "bonus": 30,
        "max_bonus": 60,
        "duration": "300 minutes",
        "decay_start": "150 minutes"
      }
    ]
  }
]
