Skip to content

Commit

Permalink
[Xedra Evolved] Add the To Bless the Sacred Weapon charm (#75249)
Browse files Browse the repository at this point in the history
* Initial commit

* Add "HEDGE_ENCHANTED" flag

* Rework EoC logic

* Only trigger on successful hit

* Fixes

* Color-code BLESSED_WEAPON flag
  • Loading branch information
Standing-Storm authored Jul 26, 2024
1 parent 3c5c6c7 commit a1981d3
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 8 deletions.
10 changes: 10 additions & 0 deletions data/mods/Xedra_Evolved/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,15 @@
"id": "ELECTROKINETIC_CHARGEABLE",
"type": "json_flag",
"info": "This item can be recharged by an electrokinetic"
},
{
"id": "HEDGE_ENCHANTED",
"type": "json_flag",
"info": "This item has a <good>charm</good> on it."
},
{
"id": "BLESSED_WEAPON",
"type": "json_flag",
"info": "This weapon does <good>extra damage</good> against creatures of the <info>Nether</info>."
}
]
10 changes: 5 additions & 5 deletions data/mods/Xedra_Evolved/items/hedge_magic_items.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"material": [ "leather", "veggy" ],
"color": "green",
"symbol": ",",
"flags": [ "ONE_PER_LAYER", "SKINTIGHT", "NO_UNLOAD", "NO_RELOAD", "MUNDANE" ],
"flags": [ "ONE_PER_LAYER", "SKINTIGHT", "NO_UNLOAD", "NO_RELOAD", "MUNDANE", "HEDGE_ENCHANTED" ],
"use_action": {
"type": "transform",
"need_charges": 1,
Expand All @@ -138,7 +138,7 @@
"material": [ "leather", "veggy" ],
"color": "green",
"symbol": ",",
"flags": [ "ONE_PER_LAYER", "SKINTIGHT", "NO_UNLOAD", "NO_RELOAD" ],
"flags": [ "ONE_PER_LAYER", "SKINTIGHT", "NO_UNLOAD", "NO_RELOAD", "HEDGE_ENCHANTED" ],
"revert_to": "item_hedge_see_fae_necklace_done",
"revert_msg": "Your otherworldly senses fade.",
"relic_data": {
Expand Down Expand Up @@ -173,7 +173,7 @@
"material": "wool",
"symbol": "*",
"color": "green_green",
"flags": [ "SINGLE_USE" ],
"flags": [ "SINGLE_USE", "HEDGE_ENCHANTED" ],
"use_action": {
"type": "place_trap",
"trap": "tr_fae_snare",
Expand All @@ -196,7 +196,7 @@
"fun": -5,
"symbol": "q",
"color": "blue",
"flags": [ "EATEN_COLD" ],
"flags": [ "EATEN_COLD", "HEDGE_ENCHANTED" ],
"phase": "solid",
"use_action": {
"type": "effect_on_conditions",
Expand Down Expand Up @@ -256,7 +256,7 @@
"name": { "str": "bearskin talisman" },
"copy-from": "item_hedge_turn_into_bear_off",
"description": "A heavy fur mantle attached to the skull of a bear. When you put it on, the charm will take effect and grant you the bear's power.",
"extend": { "flags": [ "NO_TAKEOFF", "SKINCHANGED" ] },
"extend": { "flags": [ "NO_TAKEOFF", "SKINCHANGED", "HEDGE_ENCHANTED" ] },
"use_action": {
"type": "effect_on_conditions",
"description": "Activate to remove the mantle and end the magic.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"looks_like": "cookbook",
"symbol": "?",
"color": "brown",
"use_action": { "type": "learn_spell", "spells": [ "hedge_evil_eye_ward", "hedge_see_nether_eye_paste" ] }
"use_action": { "type": "learn_spell", "spells": [ "hedge_evil_eye_ward", "hedge_see_nether_eye_paste", "hedge_bless_steel_weapon" ] }
},
{
"id": "spellbook_hedge_doctor_book",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
{ "material": "hc_steel", "wielded_only": true },
{ "material": "ch_steel", "wielded_only": true },
{ "material": "lc_steel_chain", "wielded_only": true },
{ "material": "mc_steel_chain", "worn_only": true },
{ "material": "mc_steel_chain", "wielded_only": true },
{ "material": "hc_steel_chain", "wielded_only": true },
{ "material": "ch_steel_chain", "wielded_only": true }
],
Expand Down Expand Up @@ -458,7 +458,7 @@
{ "material": "hc_steel", "wielded_only": true },
{ "material": "ch_steel", "wielded_only": true },
{ "material": "lc_steel_chain", "wielded_only": true },
{ "material": "mc_steel_chain", "worn_only": true },
{ "material": "mc_steel_chain", "wielded_only": true },
{ "material": "hc_steel_chain", "wielded_only": true },
{ "material": "ch_steel_chain", "wielded_only": true }
],
Expand Down
6 changes: 6 additions & 0 deletions data/mods/Xedra_Evolved/requirements/spell_components.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,11 @@
"id": "spell_components_hedge_walk_on_water",
"type": "requirement",
"components": [ [ [ "alder_bark", 1 ], [ "tanbark", 1 ], [ "birchbark", 1 ], [ "willowbark", 1 ] ] ]
},
{
"id": "spell_components_hedge_bless_steel_weapon",
"type": "requirement",
"tools": [ [ [ "candle_lit", -1 ] ] ],
"components": [ [ [ "salt", 15 ] ], [ [ "wild_herbs", 30 ] ] ]
}
]
88 changes: 88 additions & 0 deletions data/mods/Xedra_Evolved/spells/hedge_magic_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,93 @@
]
},
"effect": [ { "u_lose_effect": "effect_hedge_walk_on_water" } ]
},
{
"type": "effect_on_condition",
"id": "EOC_HEDGE_BLESS_STEEL_WEAPON",
"effect": {
"u_run_inv_eocs": "random",
"search_data": [
{ "material": "iron", "wielded_only": true },
{ "material": "steel", "wielded_only": true },
{ "material": "lc_steel", "wielded_only": true },
{ "material": "mc_steel", "wielded_only": true },
{ "material": "hc_steel", "wielded_only": true },
{ "material": "ch_steel", "wielded_only": true },
{ "material": "lc_steel_chain", "wielded_only": true },
{ "material": "mc_steel_chain", "wielded_only": true },
{ "material": "hc_steel_chain", "wielded_only": true },
{ "material": "ch_steel_chain", "wielded_only": true }
],
"true_eocs": [
{
"id": "EOC_HEDGE_BLESS_STEEL_WEAPON_EFFECT",
"effect": [
{ "npc_set_flag": "BLESSED_WEAPON" },
{ "npc_set_flag": "HEDGE_ENCHANTED" },
{
"u_message": "You pass the weapon through the candleflame after rubbing the mixture of salt and herbs on it while slowly reciting the words of the charm, and when you have finished you feel a sense of surety while holding it",
"type": "good"
}
]
}
]
}
},
{
"type": "effect_on_condition",
"id": "EOC_BLESSED_WEAPON_ATTACKS",
"//": "This same EoC will account for other weapons with the BLESSED_WEAPON flag--it also requires the presence of the HEDGE_ENCHANTED flag to trigger damage removing the enchantment",
"eoc_type": "EVENT",
"required_event": "character_melee_attacks_monster",
"condition": { "and": [ { "u_has_wielded_with_flag": "BLESSED_WEAPON" }, { "math": [ "_hits", "!=", "false" ] } ] },
"effect": [
{
"run_eocs": [
{
"id": "EOC_BLESSED_WEAPON_ATTACKS_2",
"condition": {
"or": [
{ "npc_has_species": "NETHER" },
{ "npc_has_species": "ABERRATION" },
{ "npc_has_species": "NETHER_EMANATION" },
{ "npc_has_species": "HORROR" }
]
},
"effect": [
{ "npc_location_variable": { "context_val": "nether_hellbeast" } },
{
"u_cast_spell": { "id": "hedge_blessed_weapon_nether_damage" },
"loc": { "context_val": "nether_hellbeast" }
},
{ "run_eocs": "EOC_HEDGE_BLESSED_WEAPON_LOSE_CHARM" }
],
"false_effect": [ { "run_eocs": "EOC_HEDGE_BLESSED_WEAPON_LOSE_CHARM" } ]
}
]
}
]
},
{
"type": "effect_on_condition",
"id": "EOC_HEDGE_BLESSED_WEAPON_LOSE_CHARM",
"condition": { "u_has_wielded_with_flag": "HEDGE_ENCHANTED" },
"effect": [
{
"u_run_inv_eocs": "random",
"search_data": [ { "flags": [ "HEDGE_ENCHANTED" ], "wielded_only": true } ],
"true_eocs": [
{
"id": "EOC_HEDGE_BLESS_STEEL_WEAPON_ATTACKS_CHECK_DAMAGE",
"condition": { "math": [ "n_hp('ALL')", "<", "n_hp_max('bp_null') * 0.90" ] },
"effect": [
{ "npc_unset_flag": "BLESSED_WEAPON" },
{ "npc_unset_flag": "HEDGE_ENCHANTED" },
{ "u_message": "You no longer feel a sense of purity from your weapon", "type": "bad" }
]
}
]
}
]
}
]
35 changes: 35 additions & 0 deletions data/mods/Xedra_Evolved/spells/hedge_magic_spells.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,5 +412,40 @@
"components": "spell_components_hedge_walk_on_water",
"max_level": 1,
"base_casting_time": 1000
},
{
"id": "hedge_bless_steel_weapon",
"type": "SPELL",
"name": "To Bless the Sacred Weapon",
"description": "Ensorcell an iron or steel weapon that you are holding so it does additional damage to unholy creatures when used in melee combat. If the weapon is too damaged, the charm will cease to function.",
"message": "",
"flags": [ "VERBAL", "SOMATIC", "NO_FAIL", "NO_HANDS" ],
"valid_targets": [ "self" ],
"difficulty": 1,
"spell_class": "HEDGE_MAGIC",
"skill": "survival",
"effect": "effect_on_condition",
"effect_str": "EOC_HEDGE_BLESS_STEEL_WEAPON",
"shape": "blast",
"components": "spell_components_hedge_bless_steel_weapon",
"max_level": 1,
"base_casting_time": 2880000
},
{
"id": "hedge_blessed_weapon_nether_damage",
"type": "SPELL",
"name": "Blessed Weapon Nether Damage",
"description": "This is the extra damage a blessed weapon does to Nether creatures. It's a bug if you have it directly.",
"message": "",
"flags": [ "SILENT", "NO_EXPLOSION_SFX", "RANDOM_DAMAGE" ],
"valid_targets": [ "hostile" ],
"effect": "attack",
"shape": "blast",
"damage_type": "pure",
"min_damage": 5,
"max_damage": 25,
"min_range": 1,
"max_range": 1,
"targeted_monster_species": [ "NETHER", "ABERRATION", "HORROR", "NETHER_EMANATION" ]
}
]

0 comments on commit a1981d3

Please sign in to comment.