Skip to content

Commit

Permalink
[XEDRA Evolved] Lucid Dreams Spell Fixes (CleverRaven#71159)
Browse files Browse the repository at this point in the history
* Make Lucid Dreams effect end after duration.

* Effect thirst, radiation, and blood

* Linting + minor bug fix

* Wording Change

* Prevent Lucid Dreams beginning again if ended prematurely via mutation

* Convert logic to effect

* Lint

* Logic fix

* Logic fix
  • Loading branch information
b3brodie authored Jan 23, 2024
1 parent 751aac4 commit 7ef7572
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 19 deletions.
8 changes: 8 additions & 0 deletions data/mods/Xedra_Evolved/effects/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,14 @@
"name": [ "Arisen" ],
"desc": [ "Like the phoenix, you have been reborn." ]
},
{
"type": "effect_type",
"id": "effect_lucid_dream",
"name": [ "Lucid Dreaming" ],
"rating": "good",
"dur_add_perc": 0,
"desc": [ "While you may just be dreaming, you are still capable of affecting the world." ]
},
{
"type": "effect_type",
"id": "effect_salamander_smoke_form",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Xedra_Evolved/mutations/temporary.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"valid": false,
"starting_trait": false,
"purifiable": false,
"activated_eocs": [ "EOC_LUCID_DREAM" ]
"activated_eocs": [ "EOC_LUCID_DREAM_FORCE_END" ]
},
{
"type": "mutation",
Expand Down
4 changes: 2 additions & 2 deletions data/mods/Xedra_Evolved/spells/dreamer_spells.json
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,12 @@
"id": "dreamer_lucid_dreams",
"type": "SPELL",
"name": "Lucid Dreams",
"description": "Whole world is your dream. In your dream, you are barely affected by the world, including your own death. Once ends, you wake up.",
"description": "The line between reality and your dreams shrinks enormously. In this dream you are barely affected by reality, with most changes to your body reverting when you wake up. While it may end your dream, not even death can touch you.",
"teachable": false,
"skill": "deduction",
"valid_targets": [ "self" ],
"effect": "effect_on_condition",
"effect_str": "EOC_LUCID_DREAM",
"effect_str": "EOC_LUCID_DREAM_SWITCH",
"shape": "blast",
"base_casting_time": { "math": [ "u_has_trait('LUCID_DREAM') ? 0 : 1000" ] },
"base_energy_cost": { "math": [ "u_has_trait('LUCID_DREAM') ? 0 : 900" ] },
Expand Down
70 changes: 54 additions & 16 deletions data/mods/Xedra_Evolved/spells/spell_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,28 @@
},
{
"type": "effect_on_condition",
"id": "EOC_LUCID_DREAM",
"condition": { "u_has_trait": "LUCID_DREAM" },
"id": "EOC_LUCID_DREAM_START",
"eoc_type": "EVENT",
"required_event": "character_gains_effect",
"condition": { "compare_string": [ "effect_lucid_dream", { "context_val": "effect" } ] },
"effect": [
{ "u_location_variable": { "u_val": "lucid_dream_teleport" }, "min_radius": 0, "max_radius": 0 },
{ "math": [ "u_hp_before_lucid", "=", "u_hp('ALL') / 6" ] },
{ "math": [ "u_pain_before_lucid", "=", "u_pain()" ] },
{ "math": [ "u_kcal_before_lucid", "=", "u_val('stored_kcal')" ] },
{ "math": [ "u_thirst_before_lucid", "=", "u_val('thirst')" ] },
{ "math": [ "u_blood_before_lucid", "=", "u_vitamin('blood')" ] },
{ "math": [ "u_redcells_before_lucid", "=", "u_vitamin('redcells')" ] },
{ "math": [ "u_rad_before_lucid", "=", "u_val('rad')" ] },
{ "u_add_trait": "LUCID_DREAM" }
]
},
{
"type": "effect_on_condition",
"id": "EOC_LUCID_DREAM_END",
"eoc_type": "EVENT",
"required_event": "character_loses_effect",
"condition": { "compare_string": [ "effect_lucid_dream", { "context_val": "effect" } ] },
"effect": [
{
"u_message": "You wake up.",
Expand All @@ -196,26 +216,44 @@
{ "math": [ "u_hp('ALL')", "=", "u_hp_before_lucid" ] },
{ "math": [ "u_pain()", "=", "u_pain_before_lucid" ] },
{ "math": [ "u_val('stored_kcal')", "=", "u_kcal_before_lucid" ] },
{ "math": [ "u_val('thirst')", "=", "u_thirst_before_lucid" ] },
{ "math": [ "u_vitamin('blood')", "=", "u_blood_before_lucid" ] },
{ "math": [ "u_vitamin('redcells')", "=", "u_redcells_before_lucid" ] },
{ "math": [ "u_val('rad')", "=", "u_rad_before_lucid" ] },
{ "u_lose_effect": "bleed" },
{ "u_lose_trait": "LUCID_DREAM" }
],
"false_effect": [
{ "u_location_variable": { "u_val": "lucid_dream_teleport" }, "min_radius": 0, "max_radius": 0 },
{ "math": [ "u_hp_before_lucid", "=", "u_hp('ALL') / 6" ] },
{ "math": [ "u_pain_before_lucid", "=", "u_pain()" ] },
{ "math": [ "u_kcal_before_lucid", "=", "u_val('stored_kcal')" ] },
{ "u_add_trait": "LUCID_DREAM" },
{
"queue_eocs": "EOC_BOOM_RANDOM",
"time_in_future": { "math": [ "((u_spell_level('dreamer_lucid_dreams')+1)*700)" ] }
}
]
},
{
"id": "EOC_DUST_REBORN",
"type": "effect_on_condition",
"id": "EOC_LUCID_DREAM_SWITCH",
"condition": { "u_has_effect": "effect_lucid_dream" },
"effect": [ { "queue_eocs": "EOC_LUCID_DREAM_FORCE_END" } ],
"false_effect": { "queue_eocs": "EOC_LUCID_DREAM_FORCE_START" }
},
{
"type": "effect_on_condition",
"id": "EOC_LUCID_DREAM_FORCE_END",
"effect": [ { "u_lose_effect": "effect_lucid_dream" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_LUCID_DREAM_FORCE_START",
"effect": [
{ "u_add_effect": "effect_lucid_dream", "duration": { "math": [ "(u_spell_level('dreamer_lucid_dreams')+1)*700" ] } }
]
},
{
"id": "EOC_LUCID_REBIRTH",
"type": "effect_on_condition",
"eoc_type": "PREVENT_DEATH",
"condition": { "u_has_trait": "LUCID_DREAM" },
"effect": [ "u_prevent_death", { "math": [ "u_hp('ALL')", "=", "1" ] }, { "queue_eocs": "EOC_LUCID_DREAM" } ]
"condition": { "u_has_effect": "effect_lucid_dream" },
"effect": [
{ "math": [ "u_vitamin('blood')", "=", "u_blood_before_lucid" ] },
"u_prevent_death",
{ "math": [ "u_hp('ALL')", "=", "1" ] },
{ "queue_eocs": "EOC_LUCID_DREAM_FORCE_END" }
]
},
{
"type": "effect_on_condition",
Expand Down

0 comments on commit 7ef7572

Please sign in to comment.