Skip to content

Commit

Permalink
Patch inquisitor true seeing (#119)
Browse files Browse the repository at this point in the history
* Patch inquisitor true seeing

* Changelog line

* Check globals

* Verbose flag
  • Loading branch information
lambda-dom authored Jun 17, 2023
1 parent a05140f commit 2dbb151
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 18 deletions.
1 change: 1 addition & 0 deletions spell_rev/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 3 additions & 0 deletions spell_rev/components/main_component.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -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~
Expand Down
32 changes: 14 additions & 18 deletions spell_rev/lib/imprisonment.tph
Original file line number Diff line number Diff line change
Expand Up @@ -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~
Expand All @@ -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~
Expand Down Expand Up @@ -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
Expand Down
45 changes: 45 additions & 0 deletions spell_rev/lib/inquisitor_true_seeing.tph
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2dbb151

Please sign in to comment.