Skip to content

Commit d48920e

Browse files
committed
Entangle, Web, Grease
1 parent a265f7f commit d48920e

File tree

4 files changed

+341
-0
lines changed

4 files changed

+341
-0
lines changed

eefixpack/files/tph/luke/7eyes/7eyes.tph

+12
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@ BEGIN
2727
INCLUDE "eefixpack/files/tph/luke/7eyes/deafness.tph"
2828
LAF "DEAFNESS" END
2929
END
30+
WITH_SCOPE BEGIN
31+
INCLUDE "eefixpack/files/tph/luke/7eyes/entangle.tph"
32+
LAF "ENTANGLE" END
33+
END
3034
WITH_SCOPE BEGIN
3135
INCLUDE "eefixpack/files/tph/luke/7eyes/feeblemindedness.tph"
3236
LAF "FEEBLEMINDEDNESS" END
3337
END
38+
WITH_SCOPE BEGIN
39+
INCLUDE "eefixpack/files/tph/luke/7eyes/grease.tph"
40+
LAF "GREASE" END
41+
END
3442
WITH_SCOPE BEGIN
3543
INCLUDE "eefixpack/files/tph/luke/7eyes/hold_creature.tph"
3644
LAF "HOLD_CREATURE" END
@@ -63,4 +71,8 @@ BEGIN
6371
INCLUDE "eefixpack/files/tph/luke/7eyes/stun.tph"
6472
LAF "STUN" END
6573
END
74+
WITH_SCOPE BEGIN
75+
INCLUDE "eefixpack/files/tph/luke/7eyes/web.tph"
76+
LAF "WEB" END
77+
END
6678
END
+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
DEFINE_ACTION_FUNCTION "ENTANGLE"
2+
BEGIN
3+
WITH_SCOPE BEGIN
4+
LAF "ADD_IDS_ENTRY" STR_VAR "idsFile" = "splstate" "identifier" = "ENTANGLE_IMMUNITY" END
5+
//
6+
ACTION_MATCH 1 WITH
7+
(GAME_IS ~bgee~) BEGIN
8+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
9+
// parent file => child resref
10+
"bdbow06.spl" => "" // used by "bdbow06.itm" (Corwin's Bow +1)
11+
"bdimpale.spl" => "bdimpent" // Impale
12+
"bdshamb.spl" => ""
13+
"hgnya01.itm" => "hgnya01" // Quarterstaff (unused...?)
14+
"mound.itm" => "mound" // used by Shambling Mounds
15+
"%BLACK_DRAGON_PLANT%.spl" => ""
16+
"%CLERIC_ENTANGLE%.spl" => ""
17+
"spwm111.spl" => "" // Entangle (wild magic)
18+
END
19+
END
20+
(GAME_IS ~bg2ee eet~) BEGIN
21+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
22+
// parent file => child resref
23+
"hgnya01.itm" => "hgnya01" // Quarterstaff (used by "nyalee.cre")
24+
"mound.itm" => "mound" // used by Shambling Mounds
25+
"%BLACK_DRAGON_PLANT%.spl" => ""
26+
"%CLERIC_ENTANGLE%.spl" => ""
27+
"spwm111.spl" => "" // Entangle (wild surge)
28+
"sw1h58.itm" => "sw1h58" // Short Sword of Mask +4
29+
"sw1h59.itm" => "sw1h59" // Short Sword of Mask +5
30+
END
31+
END
32+
(GAME_IS ~iwdee~) BEGIN
33+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
34+
// parent file => child resref
35+
"gasp.itm" => "gaspent0"
36+
"gasp.spl" => "gaspent1"
37+
"holdfst.itm" => "hldfst" // Holdfast Arrow +1
38+
"holdfst.spl" => ""
39+
"shmblr.itm" => "shmblr" // Shambling Mound
40+
"%CLERIC_ENTANGLE%" => ""
41+
"spwm111" => "" // Entangle (wild magic)
42+
"talongf.itm" => "tlngf" // Talon of the Gloomfrost +4
43+
"talongf.spl" => ""
44+
END
45+
END
46+
DEFAULT
47+
FAIL "Game not supported"
48+
END
49+
/* Main */
50+
ACTION_PHP_EACH "patch_data" AS "parent_file" => "child_resref" BEGIN
51+
COPY_EXISTING "%parent_file%" "override"
52+
// Transfer effects onto a new SPL file (if needed)
53+
PATCH_IF ("%child_resref%" STRING_COMPARE_CASE "") BEGIN
54+
LAUNCH_PATCH_FUNCTION "gt_extract_effects_as_subspell"
55+
INT_VAR
56+
"effectID" = 154
57+
STR_VAR
58+
"subspell_resref" = "%child_resref%"
59+
"string" = "Entangled"
60+
"icon" = "144"
61+
"splstate" = "ENTANGLE_IMMUNITY"
62+
END
63+
END ELSE BEGIN
64+
LAUNCH_PATCH_FUNCTION "gt_reorder_effect_stack" INT_VAR "effectID" = 154 END
65+
END
66+
BUT_ONLY_IF_IT_CHANGES IF_EXISTS
67+
END
68+
END
69+
END
70+
71+
/////////////////////////////////////////////////////////////////
72+
/*
73+
74+
Collect SPL/ITM files to check
75+
76+
*/
77+
//////////////////////////////////////////////////////////////////
78+
79+
/*
80+
WITH_SCOPE BEGIN
81+
OUTER_SET "count_spl" = 0
82+
OUTER_SET "count_itm" = 0
83+
COPY_EXISTING_REGEXP - "^.+\.\(spl\|itm\)$" "override"
84+
PATCH_MATCH "%DEST_EXT%" WITH
85+
"itm" BEGIN
86+
GET_OFFSET_ARRAY "ab_array" ITM_V10_HEADERS
87+
TEXT_SPRINT "filename" "rearrange_itm"
88+
END
89+
"spl" BEGIN
90+
GET_OFFSET_ARRAY "ab_array" SPL_V10_HEADERS
91+
TEXT_SPRINT "filename" "rearrange_spl"
92+
END
93+
DEFAULT
94+
PATCH_FAIL "~%DEST_FILE%~"
95+
END
96+
PHP_EACH "ab_array" AS "ab_ind" => "ab_off" BEGIN
97+
PATCH_IF SHORT_AT ("%ab_off%" + 0x1E) > 1 BEGIN
98+
GET_OFFSET_ARRAY2 "fx_array" "%ab_off%" SPL_V10_HEAD_EFFECTS
99+
PHP_EACH "fx_array" AS "fx_ind" => "fx_off" BEGIN
100+
PATCH_MATCH SHORT_AT "%fx_off%" WITH
101+
154 BEGIN
102+
INNER_ACTION BEGIN
103+
ACTION_IF ("%DEST_EXT%" STRING_EQUAL_CASE "itm") BEGIN
104+
OUTER_SET "count_itm" += 1
105+
APPEND_OUTER "%MOD_FOLDER%/%filename%.txt" "%count_itm%) ~%DEST_FILE%~ => ability #%ab_ind%, position #%fx_ind%" UNLESS "%DEST_FILE%"
106+
END ELSE BEGIN
107+
OUTER_SET "count_spl" += 1
108+
APPEND_OUTER "%MOD_FOLDER%/%filename%.txt" "%count_spl%) ~%DEST_FILE%~ => ability #%ab_ind%, position #%fx_ind%" UNLESS "%DEST_FILE%"
109+
END
110+
END
111+
END
112+
DEFAULT
113+
END
114+
END
115+
END
116+
END
117+
BUT_ONLY_IF_IT_CHANGES
118+
END
119+
*/
+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
DEFINE_ACTION_FUNCTION "GREASE"
2+
BEGIN
3+
WITH_SCOPE BEGIN
4+
LAF "ADD_IDS_ENTRY" STR_VAR "idsFile" = "splstate" "identifier" = "GREASE_IMMUNITY" END
5+
//
6+
ACTION_MATCH 1 WITH
7+
(GAME_IS ~bgee~) BEGIN
8+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
9+
// parent file => child resref
10+
"%MIMIC_GLUE%.spl" => "%MIMIC_GLUE%a"
11+
"%WIZARD_GREASE%.spl" => ""
12+
END
13+
END
14+
(GAME_IS ~bg2ee eet~) BEGIN
15+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
16+
// parent file => child resref
17+
"kuosper.itm" => "kuosper"
18+
"%MIMIC_GLUE%.spl" => "%MIMIC_GLUE%a"
19+
"%WIZARD_GREASE%.spl" => ""
20+
END
21+
END
22+
(GAME_IS ~iwdee~) BEGIN
23+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
24+
// parent file => child resref
25+
END
26+
END
27+
DEFAULT
28+
FAIL "Game not supported"
29+
END
30+
/* Main */
31+
ACTION_PHP_EACH "patch_data" AS "parent_file" => "child_resref" BEGIN
32+
COPY_EXISTING "%parent_file%" "override"
33+
// Transfer effects onto a new SPL file (if needed)
34+
PATCH_IF ("%child_resref%" STRING_COMPARE_CASE "") BEGIN
35+
LAUNCH_PATCH_FUNCTION "gt_extract_effects_as_subspell"
36+
INT_VAR
37+
"effectID" = 158
38+
STR_VAR
39+
"subspell_resref" = "%child_resref%"
40+
"string" = "Greased"
41+
"icon" = "145"
42+
"splstate" = "GREASE_IMMUNITY"
43+
END
44+
END ELSE BEGIN
45+
LAUNCH_PATCH_FUNCTION "gt_reorder_effect_stack" INT_VAR "effectID" = 158 END
46+
END
47+
BUT_ONLY_IF_IT_CHANGES IF_EXISTS
48+
END
49+
END
50+
END
51+
52+
/////////////////////////////////////////////////////////////////
53+
/*
54+
55+
Collect SPL/ITM files to check
56+
57+
*/
58+
//////////////////////////////////////////////////////////////////
59+
60+
/*
61+
WITH_SCOPE BEGIN
62+
OUTER_SET "count_spl" = 0
63+
OUTER_SET "count_itm" = 0
64+
COPY_EXISTING_REGEXP - "^.+\.\(spl\|itm\)$" "override"
65+
PATCH_MATCH "%DEST_EXT%" WITH
66+
"itm" BEGIN
67+
GET_OFFSET_ARRAY "ab_array" ITM_V10_HEADERS
68+
TEXT_SPRINT "filename" "rearrange_itm"
69+
END
70+
"spl" BEGIN
71+
GET_OFFSET_ARRAY "ab_array" SPL_V10_HEADERS
72+
TEXT_SPRINT "filename" "rearrange_spl"
73+
END
74+
DEFAULT
75+
PATCH_FAIL "~%DEST_FILE%~"
76+
END
77+
PHP_EACH "ab_array" AS "ab_ind" => "ab_off" BEGIN
78+
PATCH_IF SHORT_AT ("%ab_off%" + 0x1E) > 1 BEGIN
79+
GET_OFFSET_ARRAY2 "fx_array" "%ab_off%" SPL_V10_HEAD_EFFECTS
80+
PHP_EACH "fx_array" AS "fx_ind" => "fx_off" BEGIN
81+
PATCH_MATCH SHORT_AT "%fx_off%" WITH
82+
158 BEGIN
83+
INNER_ACTION BEGIN
84+
ACTION_IF ("%DEST_EXT%" STRING_EQUAL_CASE "itm") BEGIN
85+
OUTER_SET "count_itm" += 1
86+
APPEND_OUTER "%MOD_FOLDER%/%filename%.txt" "%count_itm%) ~%DEST_FILE%~ => ability #%ab_ind%, position #%fx_ind%" UNLESS "%DEST_FILE%"
87+
END ELSE BEGIN
88+
OUTER_SET "count_spl" += 1
89+
APPEND_OUTER "%MOD_FOLDER%/%filename%.txt" "%count_spl%) ~%DEST_FILE%~ => ability #%ab_ind%, position #%fx_ind%" UNLESS "%DEST_FILE%"
90+
END
91+
END
92+
END
93+
DEFAULT
94+
END
95+
END
96+
END
97+
END
98+
BUT_ONLY_IF_IT_CHANGES
99+
END
100+
*/
+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
DEFINE_ACTION_FUNCTION "WEB"
2+
BEGIN
3+
WITH_SCOPE BEGIN
4+
LAF "ADD_IDS_ENTRY" STR_VAR "idsFile" = "splstate" "identifier" = "WEB_IMMUNITY" END
5+
//
6+
ACTION_MATCH 1 WITH
7+
(GAME_IS ~bgee~) BEGIN
8+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
9+
// parent file => child resref
10+
"bdspidga.spl" => "" // Web Tangle (Gargantuan Spider)
11+
"bdwyrmt.spl" => "bdwyrmtw" // Tail Constriction
12+
"magiweb.itm" => "magiweb" // unused...?
13+
"spdr201.spl" => "" // Web (Avenger)
14+
"%FIGURINE_SPIDER_WEB%.spl" => ""
15+
"%WIZARD_WEB%.spl" => ""
16+
END
17+
END
18+
(GAME_IS ~bg2ee eet~) BEGIN
19+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
20+
// parent resref => child resref
21+
"kuobolt3.itm" => "kuobolt3" // Kuo-toan Bolt
22+
"magiweb.itm" => "magiweb" // unused...?
23+
"spdr201.spl" => "" // Web (Avenger)
24+
"%MIMIC_WEB%.spl" => ""
25+
"%FIGURINE_SPIDER_WEB%.spl" => ""
26+
"%WIZARD_WEB%.spl" => ""
27+
"wand14.itm" => "wand14" // Web sack
28+
END
29+
END
30+
(GAME_IS ~iwdee~) BEGIN
31+
ACTION_DEFINE_ASSOCIATIVE_ARRAY "patch_data" BEGIN
32+
// parent file => child resref
33+
"spdr201" => ""
34+
"%WIZARD_WEB%" => ""
35+
END
36+
END
37+
DEFAULT
38+
FAIL "Game not supported"
39+
END
40+
/* Main */
41+
ACTION_PHP_EACH "patch_data" AS "parent_file" => "child_resref" BEGIN
42+
COPY_EXISTING "%parent_file%" "override"
43+
// Transfer effects onto a new SPL file (if needed)
44+
PATCH_IF ("%child_resref%" STRING_COMPARE_CASE "") BEGIN
45+
LAUNCH_PATCH_FUNCTION "gt_extract_effects_as_subspell"
46+
INT_VAR
47+
"effectID" = 157
48+
STR_VAR
49+
"subspell_resref" = "%child_resref%"
50+
"string" = "Webbed, Held, Constricted"
51+
"icon" = "129"
52+
"splstate" = "WEB_IMMUNITY"
53+
END
54+
END ELSE BEGIN
55+
LAUNCH_PATCH_FUNCTION "gt_reorder_effect_stack" INT_VAR "effectID" = 157 END
56+
END
57+
BUT_ONLY_IF_IT_CHANGES IF_EXISTS
58+
END
59+
END
60+
END
61+
62+
/////////////////////////////////////////////////////////////////
63+
/*
64+
65+
Collect SPL/ITM files to check
66+
67+
*/
68+
//////////////////////////////////////////////////////////////////
69+
70+
/*
71+
WITH_SCOPE BEGIN
72+
OUTER_SET "count_spl" = 0
73+
OUTER_SET "count_itm" = 0
74+
COPY_EXISTING_REGEXP - "^.+\.\(spl\|itm\)$" "override"
75+
PATCH_MATCH "%DEST_EXT%" WITH
76+
"itm" BEGIN
77+
GET_OFFSET_ARRAY "ab_array" ITM_V10_HEADERS
78+
TEXT_SPRINT "filename" "rearrange_itm"
79+
END
80+
"spl" BEGIN
81+
GET_OFFSET_ARRAY "ab_array" SPL_V10_HEADERS
82+
TEXT_SPRINT "filename" "rearrange_spl"
83+
END
84+
DEFAULT
85+
PATCH_FAIL "~%DEST_FILE%~"
86+
END
87+
PHP_EACH "ab_array" AS "ab_ind" => "ab_off" BEGIN
88+
PATCH_IF SHORT_AT ("%ab_off%" + 0x1E) > 1 BEGIN
89+
GET_OFFSET_ARRAY2 "fx_array" "%ab_off%" SPL_V10_HEAD_EFFECTS
90+
PHP_EACH "fx_array" AS "fx_ind" => "fx_off" BEGIN
91+
PATCH_MATCH SHORT_AT "%fx_off%" WITH
92+
157 BEGIN
93+
INNER_ACTION BEGIN
94+
ACTION_IF ("%DEST_EXT%" STRING_EQUAL_CASE "itm") BEGIN
95+
OUTER_SET "count_itm" += 1
96+
APPEND_OUTER "%MOD_FOLDER%/%filename%.txt" "%count_itm%) ~%DEST_FILE%~ => ability #%ab_ind%, position #%fx_ind%" UNLESS "%DEST_FILE%"
97+
END ELSE BEGIN
98+
OUTER_SET "count_spl" += 1
99+
APPEND_OUTER "%MOD_FOLDER%/%filename%.txt" "%count_spl%) ~%DEST_FILE%~ => ability #%ab_ind%, position #%fx_ind%" UNLESS "%DEST_FILE%"
100+
END
101+
END
102+
END
103+
DEFAULT
104+
END
105+
END
106+
END
107+
END
108+
BUT_ONLY_IF_IT_CHANGES
109+
END
110+
*/

0 commit comments

Comments
 (0)