Skip to content

Commit

Permalink
itemexcl.2da, item_use.2da updates
Browse files Browse the repository at this point in the history
Rather than blindly appending itemexcl, try matching for one of the original items. item_use.2da wasn't addressed at all, and now uses the same methodology.

Also fixed a minor bug where HD's upgraded weapons would list 'tieflings' (lowercase) on the usability block on EEs.
  • Loading branch information
CamDawg committed Sep 18, 2022
1 parent de08dfa commit e5414d0
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 18 deletions.
96 changes: 80 additions & 16 deletions itemupgrade/lib/items_common.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2amul01.itm THEN BEGIN
COPY ~itemupgrade/bam/c2amul01.bam~ ~override~

APPEND ~tooltip.2da~ ~c2amul01 8786 -1 -1~ // tooltip stuff

APPEND ~itemexcl.2da~ ~c2amul01 1~ // add to magic ring/magic armor exclusion list

COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^AMUL14\([ %TAB%].+\)$~ ~AMUL14\1
c2amul01\1~
BUT_ONLY IF_EXISTS

END

Expand All @@ -112,6 +115,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2anom01.itm THEN BEGIN
COPY ~itemupgrade/bam/c2anom01.bam~ ~override~

APPEND ~tooltip.2da~ ~c2anom01 12028 -1 -1~ // tooltip stuff

COPY_EXISTING ~item_use.2da~ ~override~
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^NPSHLD\([ %TAB%].+\)$~ ~NPSHLD\1
c2anom01\1~
BUT_ONLY IF_EXISTS

END

Expand Down Expand Up @@ -283,8 +291,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2chan01.itm THEN BEGIN
SAY DESC @198

COPY ~itemupgrade/bam/c2chan01.bam~ ~override~

APPEND ~itemexcl.2da~ ~c2chan01 1~ // add to magic ring/magic armor exclusion list

COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^PLAT18\([ %TAB%].+\)$~ ~PLAT18\1
c2chan01\1~
BUT_ONLY IF_EXISTS

END

Expand Down Expand Up @@ -316,13 +327,18 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2hd1.itm THEN BEGIN
SAY NAME2 @193
SAY DESC @194
PATCH_IF enhanced_edition BEGIN
LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 319 target = 1 power = 1 parameter1 = 153 parameter2 = 4 timing = 2 special = 8332 END // use 319 to make it HD-only
LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 319 target = 1 power = 1 parameter1 = 153 parameter2 = 4 timing = 2 special = 8330 END // use 319 to make it HD-only
// add normal EE poison immunities
LPF CLONE_EFFECT INT_VAR match_opcode = 25 opcode = 324 parameter2 = 55 timing = 0 duration = 0 resist_dispel = 0 savingthrow = 0 STR_VAR insert = above resource = EVAL ~%SOURCE_RES%~ END // golems/undead
LPF CLONE_EFFECT INT_VAR match_opcode = 25 opcode = 324 parameter2 = 77 timing = 0 duration = 0 resist_dispel = 0 savingthrow = 0 STR_VAR insert = above resource = EVAL ~%SOURCE_RES%~ END // poison resist >= 100
END

COPY ~itemupgrade/bam/c2hd1.bam~ ~override~

COPY_EXISTING ~item_use.2da~ ~override~
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^NPSW05\([ %TAB%].+\)$~ ~NPSW05\1
c2hd1\1~
BUT_ONLY IF_EXISTS

END

Expand All @@ -341,7 +357,7 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2hd2.itm THEN BEGIN
END
PATCH_IF enhanced_edition BEGIN
WRITE_BYTE 0x29 (THIS BOR BIT6) // adds barbarian flag for EEs
LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 319 target = 1 power = 1 parameter1 = 153 parameter2 = 4 timing = 2 special = 8332 END // use 319 to make it HD-only
LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 319 target = 1 power = 1 parameter1 = 153 parameter2 = 4 timing = 2 special = 8330 END // use 319 to make it HD-only
END

COPY ~itemupgrade/spl/c2hd2con.spl~ ~override~ // confusion effect from creeping chaos
Expand All @@ -352,6 +368,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2hd2.itm THEN BEGIN
COPY_EXISTING ~#curecon.spl~ ~override~ // if using EEFP's cure spell setup, have it also cure confusion from teleomortis
LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 2 timing = 1 parameter2 = 2 STR_VAR resource = c2hd2con END
BUT_ONLY IF_EXISTS

COPY_EXISTING ~item_use.2da~ ~override~
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^NPSW06\([ %TAB%].+\)$~ ~NPSW06\1
c2hd2\1~
BUT_ONLY IF_EXISTS

END

Expand Down Expand Up @@ -391,8 +412,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2hide01.itm THEN BEGIN
END

COPY ~itemupgrade/bam/c2hide01.bam~ ~override~

APPEND ~itemexcl.2da~ ~c2hide01 1~ // add to magic ring/magic armor exclusion list

COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^LEAT20\([ %TAB%].+\)$~ ~LEAT20\1
c2hide01\1~
BUT_ONLY IF_EXISTS

END

Expand Down Expand Up @@ -441,7 +465,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2keld01.itm THEN BEGIN

COPY ~itemupgrade/bam/c2keld01.bam~ ~override~

APPEND ~itemexcl.2da~ ~c2keld01 1~ // add to magic ring/magic armor exclusion list
COPY_EXISTING ~item_use.2da~ ~override~ // add to 319 exclusion list
~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^NPPLAT\([ %TAB%].+\)$~ ~NPPLAT\1
c2keld01\1~
BUT_ONLY IF_EXISTS

END

Expand Down Expand Up @@ -480,6 +508,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2keld02.itm THEN BEGIN
END

COPY ~itemupgrade/bam/c2keld02.bam~ ~override~

COPY_EXISTING ~item_use.2da~ ~override~
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^NPSW03\([ %TAB%].+\)$~ ~NPSW03\1
c2keld02\1~
BUT_ONLY IF_EXISTS

END

Expand Down Expand Up @@ -567,7 +600,7 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2plat01.itm THEN BEGIN

APPEND ~tooltip.2da~ ~c2plat01 12033 -1 -1~ // tooltip stuff

APPEND ~itemexcl.2da~ ~c2plat01 1~ // add to magic ring/magic armor exclusion list
APPEND ~itemexcl.2da~ ~c2plat01 1~ // add to magic ring/magic armor exclusion list (don't use plat06 replacement since it may not be on the list)

END

Expand All @@ -579,7 +612,10 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2ring01.itm THEN BEGIN

COPY ~itemupgrade/bam/c2ring01.bam~ ~override~

APPEND ~itemexcl.2da~ ~c2ring01 1~ // add to magic ring/magic armor exclusion list
COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^RING06\([ %TAB%].+\)$~ ~RING06\1
c2ring01\1~
BUT_ONLY IF_EXISTS

END

Expand All @@ -591,7 +627,10 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2ring02.itm THEN BEGIN

COPY ~itemupgrade/bam/c2ring02.bam~ ~override~

APPEND ~itemexcl.2da~ ~c2ring02 1~ // add to magic ring/magic armor exclusion list
COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^RING07\([ %TAB%].+\)$~ ~RING07\1
c2ring02\1~
BUT_ONLY IF_EXISTS

END

Expand All @@ -615,6 +654,17 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2ring03.itm THEN BEGIN
COPY ~itemupgrade/bam/sppr724b.bam~ ~override~

END

COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list, if the original rings are present
SET replace = 0
REPLACE_EVALUATE ~^\([Rr][Ii][Nn][Gg]2[789]\)\([ %TAB%].+\)$~ BEGIN
PATCH_IF !replace BEGIN
SET replace = 1
SPRINT MATCH2 ~%MATCH2%
c2ring03%MATCH2%~
END
END ~%MATCH1%%MATCH2%~
BUT_ONLY IF_EXISTS

END

Expand All @@ -634,6 +684,11 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2ring04.itm THEN BEGIN
~ohringwi.itm~ ~override~ // ee/new fixpack dupe (v11+)
LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 180 target = 1 parameter1 = 53012 timing = 2 resist_dispel = 2 STR_VAR resource = c2ring04 END
BUT_ONLY IF_EXISTS

COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^RING06\([ %TAB%].+\)$~ ~RING06\1
c2ring04\1~
BUT_ONLY IF_EXISTS

END

Expand Down Expand Up @@ -873,7 +928,7 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2sw1h01.itm THEN BEGIN
COPY ~itemupgrade/bam/c2sw1h01.bam~ ~override~
~itemupgrade/eff/c2sw1h1a.eff~ ~override~ // +4 thac0 vs. evil
~itemupgrade/eff/c2sw1h1b.eff~ ~override~ // +4 damage (slashing) vs. evil
~itemupgrade/eff/c2sw1h1c.eff~ ~override~ // filter so that c2sw1hd gets applied appropriately
~itemupgrade/eff/c2sw1h1c.eff~ ~override~ // filter so that c2sw1h1d gets applied appropriately
~itemupgrade/eff/c2sw1h1d.eff~ ~override~ // +4 damage (magic) vs. evil undead
~itemupgrade/eff/c2sw1h1e.eff~ ~override~ // 1d8+4 extra damage (magic) vs. undead

Expand Down Expand Up @@ -942,7 +997,16 @@ ACTION_IF NOT FILE_EXISTS_IN_GAME c2valy01.itm THEN BEGIN
END

COPY ~itemupgrade/bam/c2valy01.bam~ ~override~

APPEND ~itemexcl.2da~ ~c2valy01 1~ // add to magic ring/magic armor exclusion list

COPY_EXISTING ~item_use.2da~ ~override~ // add to 319 exclusion list
~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^NPCHAN\([ %TAB%].+\)$~ ~NPCHAN\1
c2valy01\1~
BUT_ONLY IF_EXISTS

END

END
COPY_EXISTING ~item_use.2da~ ~override~
~itemexcl.2da~ ~override~
PRETTY_PRINT_2DA
BUT_ONLY IF_EXISTS
7 changes: 5 additions & 2 deletions itemupgrade/lib/tob.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ COPY ~itemupgrade/bam/c2leat01.bam~ ~override~
~itemupgrade/bam/c2quiv02.bam~ ~override~
~itemupgrade/bam/c2quiv03.bam~ ~override~
~itemupgrade/bam/c2sw2h02.bam~ ~override~

APPEND ~itemexcl.2da~ ~c2leat01 1~ // add to magic ring/magic armor exclusion list

COPY_EXISTING ~itemexcl.2da~ ~override~ // add to magic ring/magic armor exclusion list
REPLACE_TEXTUALLY CASE_INSENSITIVE ~^LEAT21\([ %TAB%].+\)$~ ~LEAT21\1
c2leat01\1~
BUT_ONLY IF_EXISTS

// prompts random StringHeads if Lil +5 is being used
EXTEND_BOTTOM ~baldur25.bcs~ ~itemupgrade/bcs/lilarcor.baf~
Expand Down
4 changes: 4 additions & 0 deletions itemupgrade/readme-itemupgrades.txt
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ Version 49 (updated by CamDawg)
* A few minor adjustments to the immunity spellstate code for EE games
Version 50 (updated by CamDawg)
* Updated French translation, thanks Selphira!
* Miscellaneous typo corrections
* Azuredge +4 had the wrong minimum STR/DEX requirements, usabilities;
now uses the same throwing projectile as base weapon in case 1pp
and/or EE has changed it. Azuredge +4 should also be usable by shamans.
Expand Down Expand Up @@ -906,4 +907,7 @@ Version 50 (updated by CamDawg)
* Quiver of Plenty +3 should be usable by shamans
* The Quiver/Case/Bag of Plenty +3 will now use the same projectile as
the underlying ammunition
* On the EEs, locked down the various NPC-specific item upgrades to the
NPCs, including the exclusion of UAI if it was enforced on the
original item
* Further prep for integration with the EE Fixpack

0 comments on commit e5414d0

Please sign in to comment.