diff --git a/data/mods/Xedra_Evolved/effects/effects.json b/data/mods/Xedra_Evolved/effects/effects.json index 4e420099cc777..13e5d87ce605f 100644 --- a/data/mods/Xedra_Evolved/effects/effects.json +++ b/data/mods/Xedra_Evolved/effects/effects.json @@ -1032,50 +1032,6 @@ "//": "Empty name and description to hide effect. This is just a tracker to make learning gossamer recipes take time.", "rating": "mixed" }, - { - "type": "effect_type", - "id": "spell_karma_arms_eff", - "name": [ "Karma" ], - "desc": [ "Ethereal hands appear behind your back, making you looks like an ancient god." ], - "apply_message": "Ethereal, transparent arms grow from your shoulders and glow.", - "remove_message": "The cyan arms grow dim and finally disappear.", - "rating": "good", - "enchantments": [ - { - "condition": "ALWAYS", - "modified_bodyparts": [ - { "gain": "karma_arm_up_r" }, - { "gain": "karma_arm_up_l" }, - { "gain": "karma_arm_lw_r" }, - { "gain": "karma_arm_lw_l" } - ] - } - ] - }, - { - "type": "effect_type", - "id": "stalker_eyes_eff", - "name": [ "Stalker's Vision" ], - "desc": [ "Your eyes transform into the orbits of an unknown creature.  You now see much better in the light and dark." ], - "apply_message": "Your vision gets dark for a moment, and in a second, a whole new world is revealed under your eyes.", - "remove_message": "A great new world under your eyes disappears.", - "blocks_effects": [ "glare" ], - "rating": "good", - "//": "not actual replacement yet, because i'm afraid of how wearing stuff may interact with it", - "enchantments": [ { "condition": "ALWAYS", "modified_bodyparts": [ { "gain": "stalker_eyes" } ] } ] - }, - { - "type": "effect_type", - "id": "devil_tail_eff", - "name": [ "Devil's Tail" ], - "desc": [ - "While not actually a devil's, this long, triangular pointed tail can stretch very far, allowing it to easily kill someone nearby." - ], - "apply_message": "You feel like your spine stretched enormously.", - "remove_message": "Your devil tail disappear in the air.", - "rating": "good", - "enchantments": [ { "condition": "ALWAYS", "modified_bodyparts": [ { "gain": "devil_tail" } ] } ] - }, { "type": "effect_type", "id": "mutagen_plantkin", diff --git a/data/mods/Xedra_Evolved/mutations/temporary.json b/data/mods/Xedra_Evolved/mutations/temporary.json index 1e5c445108d9f..b30c697353e24 100644 --- a/data/mods/Xedra_Evolved/mutations/temporary.json +++ b/data/mods/Xedra_Evolved/mutations/temporary.json @@ -23,5 +23,58 @@ "id": "ench_giant_growth_size_bonuses", "condition": "ALWAYS", "values": [ { "value": "MAX_HP", "multiply": 0.4 } ] + }, + { + "type": "mutation", + "id": "karma_arms", + "name": { "str": "Karma" }, + "active": true, + "points": 1, + "visibility": 10, + "description": "Ethereal hands appear behind your back, making you looks like an ancient god.", + "valid": false, + "starting_trait": false, + "purifiable": false, + "activated_eocs": [ "EOC_KARMA_ARMS_INITIATE" ], + "enchantments": [ + { + "condition": "ALWAYS", + "modified_bodyparts": [ + { "gain": "karma_arm_up_r" }, + { "gain": "karma_arm_up_l" }, + { "gain": "karma_arm_lw_r" }, + { "gain": "karma_arm_lw_l" } + ] + } + ] + }, + { + "type": "mutation", + "id": "devil_tail", + "name": { "str": "Devil's Tail" }, + "active": true, + "points": 1, + "visibility": 6, + "description": "While not actually a devil's, this long, triangular pointed tail can stretch very far, allowing it to easily kill someone nearby.", + "valid": false, + "starting_trait": false, + "purifiable": false, + "activated_eocs": [ "EOC_DEVIL_TAIL_INITIATE" ], + "enchantments": [ { "condition": "ALWAYS", "modified_bodyparts": [ { "gain": "devil_tail" } ] } ] + }, + { + "type": "mutation", + "id": "stalker_eyes", + "name": { "str": "Stalker's Vision" }, + "active": true, + "points": 1, + "visibility": 1, + "description": "Your eyes transform into the orbits of an unknown creature.  You now see much better in the light and dark.", + "//": "not actual replacement yet, because i'm afraid of how wearing stuff may interact with it", + "valid": false, + "starting_trait": false, + "purifiable": false, + "activated_eocs": [ "EOC_STALKER_EYES_INITIATE" ], + "enchantments": [ { "condition": "ALWAYS", "modified_bodyparts": [ { "gain": "stalker_eyes" } ] } ] } ] diff --git a/data/mods/Xedra_Evolved/obsoletion_and_migration/effects.json b/data/mods/Xedra_Evolved/obsoletion_and_migration/effects.json new file mode 100644 index 0000000000000..2e9b2898a42d9 --- /dev/null +++ b/data/mods/Xedra_Evolved/obsoletion_and_migration/effects.json @@ -0,0 +1,20 @@ +[ + { + "type": "effect_type", + "id": "spell_karma_arms_eff", + "name": [ "" ], + "desc": [ "" ] + }, + { + "type": "effect_type", + "id": "stalker_eyes_eff", + "name": [ "" ], + "desc": [ "" ] + }, + { + "type": "effect_type", + "id": "devil_tail_eff", + "name": [ "" ], + "desc": [ "" ] + } +] diff --git a/data/mods/Xedra_Evolved/obsoletion_and_migration/mutations.json b/data/mods/Xedra_Evolved/obsoletion_and_migration/mutations.json deleted file mode 100644 index 37a0c5ba5c7ff..0000000000000 --- a/data/mods/Xedra_Evolved/obsoletion_and_migration/mutations.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "type": "TRAIT_MIGRATION", - "id": "karma_arms", - "remove": true - }, - { - "type": "TRAIT_MIGRATION", - "id": "stalker_eyes", - "remove": true - }, - { - "type": "TRAIT_MIGRATION", - "id": "devil_tail", - "remove": true - } -] diff --git a/data/mods/Xedra_Evolved/spells/dreamer_spells.json b/data/mods/Xedra_Evolved/spells/dreamer_spells.json index 7b166ebb5ee38..6db78a31c61b1 100644 --- a/data/mods/Xedra_Evolved/spells/dreamer_spells.json +++ b/data/mods/Xedra_Evolved/spells/dreamer_spells.json @@ -562,73 +562,64 @@ "id": "spell_karma_arms", "type": "SPELL", "name": "Karma Arms", - "description": "Four transparent arms grow out of your body. You have full control over them, and who knows what power they contain.", + "description": "Four transparent arms emit out of your body indefinitely, until you toggle them off. They work as a so desirable additional pair of arms, and who knows what power they contain.", "teachable": false, - "//": "obvious reference for 'Submachine' by Mateusz Skutnik, albeit no portals", + "//": "obvious reference for 'Submachine' by Mateusz Skutnik, albeit no portals; maybe should actually make it a single arm, that can draw portals.", "valid_targets": [ "self" ], - "effect": "attack", - "effect_str": "spell_karma_arms_eff", + "effect": "effect_on_condition", + "effect_str": "EOC_KARMA_ARMS_INITIATE", "shape": "blast", - "flags": [ "NO_LEGS", "NO_HANDS", "SILENT", "NO_EXPLOSION_SFX" ], + "flags": [ "NO_LEGS", "NO_HANDS", "SILENT", "NO_EXPLOSION_SFX", "NO_FAIL" ], "skill": "deduction", "spell_class": "DREAMER", "energy_source": "MANA", "difficulty": 10, - "base_casting_time": 2000, - "base_energy_cost": 1800, - "final_energy_cost": 600, - "energy_increment": -50, + "base_casting_time": { "math": [ "u_has_trait('karma_arms') ? 0 : 200000" ] }, + "base_energy_cost": { "math": [ "u_has_trait('karma_arms') ? 0 : 200" ] }, "max_level": { "math": [ "dreamer_level(1)" ] }, - "min_duration": { "math": [ "spell_time(u_val('time: 15 m'))" ] }, - "max_duration": { "math": [ "spell_time(u_val('time: 24 h'))" ] }, - "duration_increment": { "math": [ "spell_time(u_val('time: 15 m'))" ] } + "min_duration": { "math": [ "((u_spell_level('spell_karma_arms')+1)*500)*100" ] }, + "max_duration": { "math": [ "((u_spell_level('spell_karma_arms')+1)*500)*100" ] } }, { "id": "spell_stalker_eyes", "type": "SPELL", "name": "Stalker's Oculars", - "description": "Your own eyes are replaced with the eyeballs of an unknown creature. Compound from billions of red crosses inside void dark sclera, they can see much more clearly than any natural creature.", + "description": "Your own eyes are replaced with the eyeballs of an unknown creature, indefinitely, until you toggle them off. Compound from billions of red crosses inside void dark sclera, they can see much more clearly than any natural creature.", "teachable": false, "valid_targets": [ "self" ], - "effect": "attack", - "effect_str": "stalker_eyes_eff", + "effect": "effect_on_condition", + "effect_str": "EOC_STALKER_EYES_INITIATE", "shape": "blast", - "flags": [ "NO_LEGS", "NO_HANDS", "SILENT", "NO_EXPLOSION_SFX" ], + "flags": [ "NO_LEGS", "NO_HANDS", "SILENT", "NO_EXPLOSION_SFX", "NO_FAIL" ], "skill": "deduction", "spell_class": "DREAMER", "energy_source": "MANA", "difficulty": 7, - "base_casting_time": 1000, - "base_energy_cost": 700, - "final_energy_cost": 400, - "energy_increment": -50, + "base_casting_time": { "math": [ "u_has_trait('stalker_eyes') ? 0 : 100000" ] }, + "base_energy_cost": { "math": [ "u_has_trait('stalker_eyes') ? 0 : 200" ] }, "max_level": { "math": [ "dreamer_level(1)" ] }, - "min_duration": { "math": [ "spell_time(u_val('time: 15 m'))" ] }, - "max_duration": { "math": [ "spell_time(u_val('time: 24 h'))" ] }, - "duration_increment": { "math": [ "spell_time(u_val('time: 15 m'))" ] } + "min_duration": { "math": [ "((u_spell_level('spell_stalker_eyes')+1)*1300)*100" ] }, + "max_duration": { "math": [ "((u_spell_level('spell_stalker_eyes')+1)*1300)*100" ] } }, { "id": "spell_devil_tail", "type": "SPELL", "name": "Devil's Tail", - "description": "A stretchy tail appears from the base of your spine, instinctively aiding you in battle or moving to defend you.", + "description": "A stretchy tail appears from the base of your spine, instinctively aiding you in battle or moving to defend you indefinitely, until you toggle them off.", "teachable": false, "valid_targets": [ "self" ], - "effect": "attack", - "effect_str": "devil_tail_eff", + "effect": "effect_on_condition", + "effect_str": "EOC_DEVIL_TAIL_INITIATE", "shape": "blast", - "flags": [ "NO_LEGS", "NO_HANDS", "SILENT", "NO_EXPLOSION_SFX" ], + "flags": [ "NO_LEGS", "NO_HANDS", "SILENT", "NO_EXPLOSION_SFX", "NO_FAIL" ], "skill": "deduction", "spell_class": "DREAMER", "energy_source": "MANA", "difficulty": 8, - "base_casting_time": 1500, - "base_energy_cost": 1100, - "final_energy_cost": 500, - "energy_increment": -50, + "base_casting_time": { "math": [ "u_has_trait('devil_tail') ? 0 : 150000" ] }, + "base_energy_cost": { "math": [ "u_has_trait('devil_tail') ? 0 : 100" ] }, "max_level": { "math": [ "dreamer_level(1)" ] }, - "min_duration": { "math": [ "spell_time(u_val('time: 15 m'))" ] }, - "max_duration": { "math": [ "spell_time(u_val('time: 24 h'))" ] }, - "duration_increment": { "math": [ "spell_time(u_val('time: 15 m'))" ] } + "min_duration": { "math": [ "((u_spell_level('spell_devil_tail')+1)*900)*100" ] }, + "max_duration": { "math": [ "((u_spell_level('spell_devil_tail')+1)*900)*100" ] } } ] diff --git a/data/mods/Xedra_Evolved/spells/spell_eocs.json b/data/mods/Xedra_Evolved/spells/spell_eocs.json index a16dff7950500..8239dcb586fe5 100644 --- a/data/mods/Xedra_Evolved/spells/spell_eocs.json +++ b/data/mods/Xedra_Evolved/spells/spell_eocs.json @@ -64,5 +64,104 @@ "type": "effect_on_condition", "id": "EOC_EATER_DROSS_FUN_3", "effect": [ { "u_add_morale": "morale_ate_dross", "bonus": 100, "max_bonus": 200, "duration": "120 h", "decay_start": "60 h" } ] + }, + { + "type": "effect_on_condition", + "id": "EOC_KARMA_ARMS_INITIATE", + "condition": { "not": { "u_has_trait": "karma_arms" } }, + "effect": [ + { "u_message": "Ethereal, transparent arms appear behind your shoulders and glow.", "type": "good" }, + { "u_add_trait": "karma_arms" }, + { + "queue_eocs": "EOC_KARMA_ARMS_CONTINUE", + "time_in_future": { "math": [ "((u_spell_level('spell_karma_arms')+1)*500)" ] } + } + ], + "false_effect": [ + { "u_lose_trait": "karma_arms" }, + { "u_message": "The cyan arms grow dim and finally disappear.", "type": "neutral" } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_KARMA_ARMS_CONTINUE", + "condition": { "and": [ { "u_has_trait": "karma_arms" }, { "math": [ "u_val('mana')", ">=", "200" ] } ] }, + "effect": [ + { "math": [ "u_val('mana')", "-=", "200" ] }, + { "u_message": "Floating arms behind you flicker a bit, but still glow.", "type": "good" }, + { + "queue_eocs": "EOC_KARMA_ARMS_CONTINUE", + "time_in_future": { "math": [ "((u_spell_level('spell_karma_arms')+1)*500)" ] } + } + ], + "false_effect": [ + { "u_lose_trait": "karma_arms" }, + { "u_message": "The cyan arms grow dim and finally disappear.", "type": "neutral" } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_DEVIL_TAIL_INITIATE", + "condition": { "not": { "u_has_trait": "devil_tail" } }, + "effect": [ + { "u_message": "You feel like your spine stretched enormously.", "type": "good" }, + { "u_add_trait": "devil_tail" }, + { + "queue_eocs": "EOC_DEVIL_TAIL_CONTINUE", + "time_in_future": { "math": [ "((u_spell_level('spell_devil_tail')+1)*900)" ] } + } + ], + "false_effect": [ { "u_lose_trait": "devil_tail" }, { "u_message": "Your devil tail disappear in the air.", "type": "neutral" } ] + }, + { + "type": "effect_on_condition", + "id": "EOC_DEVIL_TAIL_CONTINUE", + "condition": { "and": [ { "u_has_trait": "devil_tail" }, { "math": [ "u_val('mana')", ">=", "100" ] } ] }, + "effect": [ + { "math": [ "u_val('mana')", "-=", "100" ] }, + { "u_message": "Your devilish tail stretches and twist playfully.", "type": "good" }, + { + "queue_eocs": "EOC_DEVIL_TAIL_CONTINUE", + "time_in_future": { "math": [ "((u_spell_level('spell_devil_tail')+1)*900)" ] } + } + ], + "false_effect": [ { "u_lose_trait": "devil_tail" }, { "u_message": "Your devil tail disappear in the air.", "type": "neutral" } ] + }, + { + "type": "effect_on_condition", + "id": "EOC_STALKER_EYES_INITIATE", + "condition": { "not": { "u_has_trait": "stalker_eyes" } }, + "effect": [ + { + "u_message": "Your vision gets dark for a moment, and in a second, a whole new world is revealed under your eyes.", + "type": "good" + }, + { "u_add_trait": "stalker_eyes" }, + { + "queue_eocs": "EOC_STALKER_EYES_CONTINUE", + "time_in_future": { "math": [ "((u_spell_level('spell_stalker_eyes')+1)*1300)" ] } + } + ], + "false_effect": [ + { "u_lose_trait": "stalker_eyes" }, + { "u_message": "A great new world under your eyes disappears.", "type": "neutral" } + ] + }, + { + "type": "effect_on_condition", + "id": "EOC_STALKER_EYES_CONTINUE", + "condition": { "and": [ { "u_has_trait": "stalker_eyes" }, { "math": [ "u_val('mana')", ">=", "200" ] } ] }, + "effect": [ + { "math": [ "u_val('mana')", "-=", "200" ] }, + { "u_message": "Your sight darkens for a second, but then turn back.", "type": "good" }, + { + "queue_eocs": "EOC_STALKER_EYES_CONTINUE", + "time_in_future": { "math": [ "((u_spell_level('spell_stalker_eyes')+1)*1300)" ] } + } + ], + "false_effect": [ + { "u_lose_trait": "stalker_eyes" }, + { "u_message": "A great new world under your eyes disappears.", "type": "neutral" } + ] } ] diff --git a/doc/NPCs.md b/doc/NPCs.md index 6d58d85868d89..720fead8ecae9 100644 --- a/doc/NPCs.md +++ b/doc/NPCs.md @@ -1413,6 +1413,7 @@ _function arguments are `d`oubles (or sub-expressions), `s`trings, or `v`[ariabl | effect_intensity(`s`/`v`,...) | ✅ | ❌ | u, n | Return the characters intensity of effect.
Variable is effect ID.

Optional kwargs:
`bodypart`: `s`/`v` - Specify the bodypart to get/set intensity of effect.

Example:
`"condition": { "math": [ "u_effect_intensity('bite', 'bodypart': 'torso')", ">", "1"] }`| | encumbrance(`s`/`v`) | ✅ | ❌ | u, n | Return the characters total encumbrance of a body part.
Variable is bodypart ID.
For items, returns typical encumbrance of the item.

Example:
`"condition": { "math": [ "u_encumbrance('torso')", ">", "0"] }`| | field_strength(`s`/`v`) | ✅ | ❌ | u, n, global | Return the strength of a field on the tile.
Variable is field ID.

Optional kwargs:
`location`: `v` - center search on this location

The `location` kwarg is mandatory in the global scope.

Examples:
`"condition": { "math": [ "u_field_strength('fd_blood')", ">", "5" ] }`

`"condition": { "math": [ "field_strength('fd_blood_insect', 'location': u_search_loc)", ">", "5" ] }`| +| has_trait(`s`/`v`) | ✅ | ❌ | u, n | Check whether the actor has a trait. Meant to be used as condition for ternaries. Arguemnt is trait ID.

Example:
`"condition": { "math": [ "u_blorg", "=", "u_has_trait('FEEBLE') ? 100 : 15" ] }`| | hp(`s`/`v`) | ✅ | ✅ | u, n | Return or set the characters hp.
Variable is bodypart ID. If omitted, get sum of all bodypart or set all bodypart.
For items, returns current amount of damage required to destroy item. Variable is not required.

Example:
`"condition": { "math": [ "hp('torso')", ">", "100"] }`| | hp_max(`s`/`v`) | ✅ | ❌ | u, n | Return the characters max amount of hp on a body part.
Variable is bodypart ID.
For items, returns max amount of damage required to destroy item. Variable is not required.
Example:
`"condition": { "math": [ "u_hp_max('torso')", ">=", "100"] }`| | game_option(`s`/`v`) | ✅ | ❌ | N/A
(global) | Return the numerical value of a game option
Example:
`"condition": { "math": [ "game_option('NPC_SPAWNTIME')", ">=", "5"] }`| diff --git a/src/math_parser_diag.cpp b/src/math_parser_diag.cpp index 640fb057664f6..0e332c2e34a6b 100644 --- a/src/math_parser_diag.cpp +++ b/src/math_parser_diag.cpp @@ -284,6 +284,14 @@ std::function field_strength_eval( char scope, }; } +std::function has_trait_eval( char scope, + std::vector const ¶ms, diag_kwargs const &/* kwargs */ ) +{ + return [beta = is_beta( scope ), tid = params[0] ]( dialogue const & d ) { + return d.actor( beta )->has_trait( trait_id( tid.str( d ) ) ); + }; +} + std::function hp_eval( char scope, std::vector const ¶ms, diag_kwargs const &/* kwargs */ ) { diff --git a/src/math_parser_diag.h b/src/math_parser_diag.h index 6a6151fa2b21b..33f8c3af4a01b 100644 --- a/src/math_parser_diag.h +++ b/src/math_parser_diag.h @@ -109,6 +109,7 @@ decl_diag_eval dodge_eval; decl_diag_eval effect_intensity_eval; decl_diag_eval encumbrance_eval; decl_diag_eval field_strength_eval; +decl_diag_eval has_trait_eval; decl_diag_eval hp_eval; decl_diag_ass hp_ass; decl_diag_eval hp_max_eval; @@ -155,6 +156,7 @@ inline std::map const dialogue_eval_f{ { "encumbrance", { "un", 1, encumbrance_eval } }, { "field_strength", { "ung", 1, field_strength_eval } }, { "game_option", { "g", 1, option_eval } }, + { "has_trait", { "un", 1, has_trait_eval } }, { "hp", { "un", -1, hp_eval } }, { "hp_max", { "un", 1, hp_max_eval } }, { "item_count", { "un", 1, item_count_eval } },