Skip to content

Commit

Permalink
[Aftershock] Add the Esper scenario (#74279)
Browse files Browse the repository at this point in the history
* Initial commit

* Add profession powers

* Power maintenance infrastructure

* Finish profession definition

* Add concentration infrastructure

* Add consequences

* Add practice recipes

* Fix loading errors

* Focus handling

* Update data/mods/Aftershock/player/proficiencies.json

Co-authored-by: John Candlebury <[email protected]>

---------

Co-authored-by: John Candlebury <[email protected]>
  • Loading branch information
Standing-Storm and John-Candlebury authored Jun 10, 2024
1 parent b7f634c commit 62b7550
Show file tree
Hide file tree
Showing 20 changed files with 1,303 additions and 1 deletion.
233 changes: 233 additions & 0 deletions data/mods/Aftershock/EOC/esper_eoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
[
{
"type": "effect_on_condition",
"id": "EOC_CONDITION_ESPER_TRAIT_AND_SCHOOL_LIST",
"condition": {
"and": [ { "u_has_trait": "ESPER" }, { "or": [ { "compare_string": [ "AFS_TELEPATH", { "context_val": "school" } ] } ] } ]
},
"effect": [ ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSI_PRACTICE_FOCUS_MOD",
"condition": { "math": [ "u_val('focus')", ">=", "75" ] },
"effect": [ { "math": [ "u_val('focus')", "-=", "50" ] } ],
"false_effect": [ { "run_eocs": "EOC_AFS_PSI_PRACTICE_FOCUS_MOD_2" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSI_PRACTICE_FOCUS_MOD_2",
"condition": { "math": [ "u_val('focus')", ">=", "50" ] },
"effect": [ { "math": [ "u_val('focus')", "-=", "25" ] } ],
"false_effect": [ { "run_eocs": "EOC_AFS_PSI_PRACTICE_FOCUS_MOD_3" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSI_PRACTICE_FOCUS_MOD_3",
"condition": { "math": [ "u_val('focus')", ">=", "34" ] },
"effect": [ { "math": [ "u_val('focus')", "-=", "10" ] } ],
"false_effect": [ { "run_eocs": "EOC_AFS_PSI_PRACTICE_FOCUS_MOD_4" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSI_PRACTICE_FOCUS_MOD_4",
"condition": { "math": [ "u_val('focus')", ">=", "30" ] },
"effect": [ { "math": [ "u_val('focus')", "-=", "5" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_ESPER_CHANNEL_COSTS_FOCUS",
"eoc_type": "EVENT",
"required_event": "spellcasting_finish",
"condition": { "and": [ { "test_eoc": "EOC_CONDITION_ESPER_TRAIT_AND_SCHOOL_LIST" }, { "math": [ "u_val('focus')", ">=", "15" ] } ] },
"effect": [ { "math": [ "u_val('focus')", "-=", "1" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_CONCENTRATION_COSTS_FOCUS",
"condition": {
"and": [ { "math": [ "u_vitamin('vitamin_afs_maintained_powers')", ">", "0" ] }, { "math": [ "u_val('focus')", ">=", "15" ] } ]
},
"effect": [ { "math": [ "u_val('focus')", "-=", "1" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_ESPER_CONSEQUENCES_VALUE_INCREASER",
"eoc_type": "EVENT",
"required_event": "spellcasting_finish",
"condition": { "test_eoc": "EOC_CONDITION_ESPER_TRAIT_AND_SCHOOL_LIST" },
"effect": [
{
"run_eocs": [
{
"id": "EOC_AFS_ESPER_CONSEQUENCES_VALUE_INCREASER_2",
"condition": { "math": [ "u_esper_repeated_channeling_value", "<", "20" ] },
"effect": [ { "math": [ "u_esper_repeated_channeling_value", "+=", "rng(1,5)" ] } ]
}
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_ESPER_CONSEQUENCES_VALUE_DECREASER",
"recurrence": [ "3 seconds", "30 seconds" ],
"global": true,
"run_for_npcs": true,
"condition": { "math": [ "u_esper_repeated_channeling_value", ">", "0" ] },
"effect": [ { "math": [ "u_esper_repeated_channeling_value", "-=", "1" ] } ],
"false_effect": [ { "math": [ "u_esper_repeated_channeling_value", "=", "0" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_POWER_MAINTENANCE_PLUS_ONE",
"effect": [ { "math": [ "u_vitamin('vitamin_afs_maintained_powers')", "+=", "1" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_POWER_MAINTENANCE_MINUS_ONE",
"effect": [ { "math": [ "u_vitamin('vitamin_afs_maintained_powers')", "-=", "1" ] } ]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_END_PSI_POWERS_MAINTAINED",
"effect": [
{
"run_eocs": [
"EOC_AFS_TELEPATH_REMOVE_TELEPATHIC_SHIELD",
"EOC_AFS_TELEPATH_REMOVE_SENSE_MINDS",
"EOC_AFS_TELEPATH_REMOVE_TELEPATHIC_SUGGESTION"
]
},
{ "math": [ "u_vitamin('vitamin_afs_maintained_powers')", "=", "0" ] }
]
},
{
"type": "effect_on_condition",
"id": "EOC_CONCENTRATION_SUCCESS_PROFICIENCY",
"condition": {
"and": [
{ "not": { "u_has_proficiency": "prof_concentration_basic" } },
{ "math": [ "u_vitamin('vitamin_afs_maintained_powers')", ">", "0" ] }
]
},
"effect": [ { "math": [ "u_proficiency('prof_concentration_basic', 'format': 'percent')", "+=", "rand(4) / 24" ] } ],
"//": "adds 0% - 0.16% experience per run",
"false_effect": {
"run_eocs": [
{
"id": "EOC_CONCENTRATION_SUCCESS_PROFICIENCY_INT",
"condition": {
"and": [
{ "not": { "u_has_proficiency": "prof_concentration_intermediate" } },
{ "math": [ "u_vitamin('vitamin_afs_maintained_powers')", ">", "0" ] }
]
},
"effect": [ { "math": [ "u_proficiency('prof_concentration_intermediate', 'format': 'percent')", "+=", "rand(4) / 48" ] } ],
"false_effect": {
"run_eocs": [
{
"id": "EOC_CONCENTRATION_SUCCESS_PROFICIENCY_MASTER",
"condition": {
"and": [
{ "not": { "u_has_proficiency": "prof_concentration_master" } },
{ "math": [ "u_vitamin('vitamin_afs_maintained_powers')", ">", "0" ] }
]
},
"effect": [ { "math": [ "u_proficiency('prof_concentration_master', 'format': 'percent')", "+=", "rand(4) / 96" ] } ]
}
]
}
}
]
}
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSIONICS_ADVERSE_EVENTS",
"eoc_type": "EVENT",
"required_event": "spellcasting_finish",
"condition": { "and": [ { "test_eoc": "EOC_CONDITION_ESPER_TRAIT_AND_SCHOOL_LIST" } ] },
"effect": [
{ "math": [ "u_latest_channeled_power_difficulty", "=", "_difficulty" ] },
{
"weighted_list_eocs": [
[ "EOC_AFS_PSIONICS_ADVERSE_EVENT_NOSEBLEED", 1 ],
[ "EOC_AFS_PSIONICS_ADVERSE_EVENT_HEADACHE", 1 ],
[ "EOC_AFS_PSIONICS_ADVERSE_EVENT_HEALTH_PENALTY", 1 ]
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSIONICS_ADVERSE_EVENT_NOSEBLEED",
"condition": {
"x_in_y_chance": {
"x": {
"math": [
"(u_esper_repeated_channeling_value * 8) + (u_latest_channeled_power_difficulty * 3) + ((vitamin_afs_maintained_powers * 8) * vitamin_afs_maintained_powers)"
]
},
"y": 1000
}
},
"effect": [
{ "u_message": "As you unleash your powers, blood drips from your nose.", "type": "bad" },
{ "u_add_effect": "bleed", "intensity": 1, "target_part": "head", "duration": "5 minutes" },
{ "math": [ "u_hp('head')", "-=", "1" ] }
]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSIONICS_ADVERSE_EVENT_HEADACHE",
"condition": {
"x_in_y_chance": {
"x": {
"math": [
"(u_esper_repeated_channeling_value * 8) + (u_latest_channeled_power_difficulty * 3) + ((vitamin_afs_maintained_powers * 8) * vitamin_afs_maintained_powers)"
]
},
"y": 1000
}
},
"effect": [
{ "u_message": "As you unleash your powers, your head begins to throb.", "type": "bad" },
{ "u_add_effect": "effect_afs_esper_headache", "duration": { "math": [ "rng(900,3600)" ] } }
]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSIONICS_ADVERSE_EVENT_HEALTH_PENALTY",
"condition": {
"x_in_y_chance": {
"x": {
"math": [
"(u_esper_repeated_channeling_value * 8) + (u_latest_channeled_power_difficulty * 3) + ((vitamin_afs_maintained_powers * 8) * vitamin_afs_maintained_powers)"
]
},
"y": 1000
}
},
"effect": [
{ "u_message": "As you unleash your powers, you feel enervated.", "type": "bad" },
{ "u_add_effect": "effect_afs_esper_health_penalty", "duration": "30 seconds" }
]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSI_SKILL_INCREASE_ON_USE_INITIALIZE",
"eoc_type": "EVENT",
"required_event": "spellcasting_finish",
"condition": { "test_eoc": "EOC_CONDITION_ESPER_TRAIT_AND_SCHOOL_LIST" },
"effect": [
{ "math": [ "u_latest_channeled_power_difficulty", "=", "_difficulty" ] },
{ "run_eocs": "EOC_AFS_PSI_SKILL_INCREASE_ON_USE_FINALIZE" }
]
},
{
"type": "effect_on_condition",
"id": "EOC_AFS_PSI_SKILL_INCREASE_ON_USE_FINALIZE",
"effect": [ { "math": [ "u_skill_exp('metaphysics', 'format': 'raw')", "+=", "150 * u_latest_channeled_power_difficulty" ] } ]
}
]
59 changes: 59 additions & 0 deletions data/mods/Aftershock/EOC/esper_recipe_learning_eoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[
{
"type": "effect_on_condition",
"id": "EOC_AFS_TELEPATH_RECIPE_TEACHER",
"eoc_type": "EVENT",
"required_event": "game_begin",
"condition": { "u_has_trait": "AFS_TELEPATH" },
"effect": [ { "run_eocs": "EOC_TEACH_AFS_TELEPATH_CONTEMPLATE_RECIPES" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_TEACH_AFS_TELEPATH_CONTEMPLATE_RECIPES",
"effect": [
{
"run_eocs": [
"EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_SHIELD",
"EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_SUGGESTION",
"EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_MIND_SENSE",
"EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_CONFUSION",
"EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_BLAST"
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_SHIELD",
"condition": { "and": [ { "u_has_trait": "AFS_TELEPATH" }, { "math": [ "u_spell_level('afs_telepathic_shield')", ">=", "0" ] } ] },
"effect": [ { "u_learn_recipe": "practice_afs_telepathic_shield" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_MIND_SENSE",
"condition": {
"and": [ { "u_has_trait": "AFS_TELEPATH" }, { "math": [ "u_spell_level('afs_telepathic_mind_sense')", ">=", "0" ] } ]
},
"effect": [ { "u_learn_recipe": "practice_afs_telepathic_mind_sense" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_SUGGESTION",
"condition": {
"and": [ { "u_has_trait": "AFS_TELEPATH" }, { "math": [ "u_spell_level('afs_telepathic_suggestion')", ">=", "0" ] } ]
},
"effect": [ { "u_learn_recipe": "practice_afs_telepathic_suggestion" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_CONFUSION",
"condition": { "and": [ { "u_has_trait": "AFS_TELEPATH" }, { "math": [ "u_spell_level('afs_telepathic_confusion')", ">=", "0" ] } ] },
"effect": [ { "u_learn_recipe": "practice_afs_telepathic_confusion" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_CHECK_GAMEBEGIN_AFS_TELEPATH_RECIPE_BLAST",
"condition": { "and": [ { "u_has_trait": "AFS_TELEPATH" }, { "math": [ "u_spell_level('afs_telepathic_blast')", ">=", "0" ] } ] },
"effect": [ { "u_learn_recipe": "practice_afs_telepathic_blast" } ]
}
]
Loading

0 comments on commit 62b7550

Please sign in to comment.