diff --git a/spell_rev/changelog.md b/spell_rev/changelog.md index 892cc071..08f1fc53 100644 --- a/spell_rev/changelog.md +++ b/spell_rev/changelog.md @@ -53,6 +53,7 @@ The most salient ones are: 25. [Missing projectile in Avenger's chromatic orb](https://github.com/Gibberlings3/SpellRevisions/pull/117): patch by mercurier. 26. [Patching hidespl.2da instead of overriding](https://github.com/Gibberlings3/SpellRevisions/pull/116): as the name says; instead of overwriting `hidespl.2da` tables, patch them. 27. [Imprisonment vs. Freedom patches](https://github.com/Gibberlings3/SpellRevisions/pull/118): +28. [Patch inquisitor true seeing](https://github.com/Gibberlings3/SpellRevisions/pull/119): ## Earlier versions. diff --git a/spell_rev/components/main_component.tpa b/spell_rev/components/main_component.tpa index 154769f8..6f3bb6e2 100644 --- a/spell_rev/components/main_component.tpa +++ b/spell_rev/components/main_component.tpa @@ -3357,6 +3357,9 @@ INCLUDE ~spell_rev\lib\refinements.tph~ // refinements spells reverted back to //Imprisonment patches. INCLUDE "%MOD_FOLDER%/lib/imprisonment.tph" +//True sight patches. +INCLUDE "%MOD_FOLDER%/lib/inquisitor_true_seeing.tph" + //// SECTYPE FIXES FOR VANILLA MESS and some more// INCLUDE ~spell_rev\lib\kreso_extra.tph~ diff --git a/spell_rev/lib/imprisonment.tph b/spell_rev/lib/imprisonment.tph index 983b1107..003116e2 100644 --- a/spell_rev/lib/imprisonment.tph +++ b/spell_rev/lib/imprisonment.tph @@ -13,9 +13,7 @@ BUT_ONLY //Set sectype in Imprisonment. WITH_SCOPE BEGIN - OUTER_INNER_PATCH "" BEGIN - LPF get_spell_res STR_VAR spell = "WIZARD_IMPRISONMENT" RET res_name = resource END - END + LAF get_spell_res STR_VAR spell = "WIZARD_IMPRISONMENT" RET res_name = resource END ACTION_IF NOT ("%res_name%" STRING_EQUAL_CASE "*") BEGIN COPY_EXISTING ~%res_name%.spl~ ~override~ @@ -27,9 +25,7 @@ END //Patch freedom spell. WITH_SCOPE BEGIN - OUTER_INNER_PATCH "" BEGIN - LPF get_spell_res STR_VAR spell = "WIZARD_FREEDOM" RET res_name = resource END - END + LAF get_spell_res STR_VAR spell = "WIZARD_FREEDOM" RET res_name = resource END ACTION_IF NOT ("%res_name%" STRING_EQUAL_CASE "*") BEGIN COPY_EXISTING ~%res_name%.spl~ ~override~ @@ -61,18 +57,18 @@ WITH_SCOPE BEGIN BEGIN LAF get_spell_res STR_VAR spell = EVAL "%spell%" RET res_name = resource END ACTION_IF NOT ("%res_name%" STRING_EQUAL_CASE "*") BEGIN - COPY_EXISTING ~%res_name%.spl~ ~override~ - LPF CLONE_EFFECT INT_VAR - check_globals = 0 - match_opcode = 101 //Immunity to effect. - match_parameter2 = 213 //Maze. - opcode = 206 //Protection from spell. - parameter1 = 0 //Zero out. - parameter2 = 0 - STR_VAR - resource = EVAL "%res_name_imp%" - insert = "below" - END + COPY_EXISTING ~%res_name%.spl~ ~override~ + LPF CLONE_EFFECT INT_VAR + check_globals = 0 + match_opcode = 101 //Immunity to effect. + match_parameter2 = 213 //Maze. + opcode = 206 //Protection from spell. + parameter1 = 0 //Zero out. + parameter2 = 0 + STR_VAR + resource = EVAL "%res_name_imp%" + insert = "below" + END END ELSE BEGIN FAIL "imprisonment.tph: spell '%spell%' not found." END diff --git a/spell_rev/lib/inquisitor_true_seeing.tph b/spell_rev/lib/inquisitor_true_seeing.tph new file mode 100644 index 00000000..e776ba2a --- /dev/null +++ b/spell_rev/lib/inquisitor_true_seeing.tph @@ -0,0 +1,45 @@ +//Libraries. +INCLUDE "%MOD_FOLDER%/lib/utilities/utilities.tpa" + +//Functions. +DEFINE_PATCH_FUNCTION patch_true_seeing_immunities STR_VAR spell = "" BEGIN + LPF CLONE_EFFECT INT_VAR + check_globals = 0 + verbose = 1 + match_opcode = 142 //Display icon. + match_parameter2 = 108 //True seeeing. + opcode = 206 //Protection from spell. + parameter1 = 0 //Zero out. + parameter2 = 0 + STR_VAR + resource = EVAL "%spell%" + insert = "last" + END +END + +//Main loop. +WITH_SCOPE BEGIN + LAF get_spell_res STR_VAR spell = "INQUIS_TRUE_SIGHT" RET spell_to_patch = resource END + ACTION_IF ("%spell_to_patch%" STRING_EQUAL_CASE "*") BEGIN + FAIL "inquisitor_true_seeing.tph: spell 'INQUIS_TRUE_SIGHT' not found." + END + + COPY_EXISTING ~%spell_to_patch%.spl~ ~override~ + PATCH_FOR_EACH spell IN + "WIZARD_OBSCURING_MIST" + "CLERIC_OBSCURING_MIST" + "WIZARD_SPOOK" + "WIZARD_KNOW_ALIGNMENT" + BEGIN + LPF get_spell_res STR_VAR spell = EVAL "%spell%" RET res_name = resource END + PATCH_IF NOT ("%spell%" STRING_EQUAL_CASE "*") BEGIN + LPF patch_true_seeing_immunities STR_VAR spell = EVAL "%res_name%" END + END ELSE BEGIN + PATCH_FAIL "inquisitor_true_seeing.tph: spell '%spell%' not found." + END + END + + //Shadow door aux spell mazing. + LPF patch_true_seeing_immunities STR_VAR spell = "spwi505d" END + BUT_ONLY +END