Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
0.9.47
Browse files Browse the repository at this point in the history
invisibility purge fix, semi_spont update
  • Loading branch information
subtledoctor committed Feb 23, 2023
1 parent 9b47cdf commit 5244490
Show file tree
Hide file tree
Showing 4 changed files with 256 additions and 97 deletions.
2 changes: 1 addition & 1 deletion TomeAndBlood/TomeAndBlood.tp2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BACKUP ~weidu_external/backup/TomeAndBlood~
AUTHOR ~aquadrizzt~
VERSION ~0.9.46~
VERSION ~0.9.47~

ALWAYS

Expand Down
8 changes: 5 additions & 3 deletions TomeAndBlood/comp/setup_spell_tweaks.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,16 @@ END
//change Dispel Illusion to Invisibility Purge______________________________________
//
COPY_EXISTING ~sppr309.spl~ ~override~
READ_LONG 0x08 spell_name
READ_LONG 0x50 spell_desc
PATCH_FOR_EACH second IN ~6~ ~12~ ~18~ ~24~ ~30~ BEGIN // do this more often
LPF CLONE_EFFECT INT_VAR match_opcode = 146 match_duration = %second% duration = (%second% - 2) STR_VAR match_resource = ~sppr309d~ END
LPF CLONE_EFFECT INT_VAR match_opcode = 146 match_duration = %second% duration = (%second% - 4) STR_VAR match_resource = ~sppr309d~ END
END
LPF ADD_SPELL_EFFECT INT_VAR opcode = 101 target = 2 power = 3 parameter2 = 20 timing = 0 duration = 30 END
IF_EXISTS

COPY_EXISTING ~sppr309.spl~ ~override/spwi322.spl~
READ_LONG 0x08 spell_name
READ_LONG 0x50 spell_desc
WRITE_SHORT 0x1c 1
WRITE_SHORT 0x22 16
WRITE_BYTE 0x25 3
Expand All @@ -394,7 +395,7 @@ COPY_EXISTING ~sppr309.spl~ ~override/spwi322.spl~
IF_EXISTS

COPY_EXISTING ~scrl6k.itm~ ~override~
WRITE_LONG 0x1c %spell_name%
WRITE_LONG 0x0c %spell_name%
WRITE_LONG 0x54 %spell_desc%
WRITE_ASCII 0x3a ~sppr309a~ #8
IF_EXISTS BUT_ONLY
Expand Down Expand Up @@ -535,6 +536,7 @@ COPY_EXISTING ~spwi310.spl~ ~override~
SAY NAME1 @6413
SAY UNIDENTIFIED_DESC @6414
WRITE_BYTE 0x27 2
LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 69 opcode = 337 parameter1 = 20 parameter2 = 101 timing = 1 duration = 0 END
LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 69 opcode = 205 parameter1 = 0 parameter2 = 5 END
LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 insert_point = 0 STR_VAR resource = ~spwi310~ END
IF_EXISTS BUT_ONLY
Expand Down
70 changes: 70 additions & 0 deletions TomeAndBlood/lib/semi_spont/misc_functions.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,73 @@ END
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////


DEFINE_PATCH_FUNCTION QD_ADD_EMPTY_SPELL_HEADER
INT_VAR
type = 1
location = 4
target = 1
target_count = 0
range = 0
required_level = 1
speed = 0
projectile = 1
copy_header = 0
insert_point = ~-1~
STR_VAR
icon = ~~
RET
insert_point
BEGIN
SET hs = 0x28
READ_LONG 0x64 ho
READ_SHORT 0x68 hc
READ_LONG 0x6a eo
SET insert_point = (insert_point > hc || insert_point < 0) ? hc : insert_point
SET copy_header = (copy_header < 0) ? 0 : copy_header
PATCH_IF (copy_header > hc) BEGIN
PATCH_WARN ~WARNING: Unable to copy %copy_header%th header, %SOURCE_FILE% contains only %hc% headers!~
END ELSE BEGIN
INSERT_BYTES (ho + insert_point * hs) hs
SET hc += 1
SET eo += hs
PATCH_IF (copy_header) BEGIN
READ_SHORT (ho + (copy_header - 1) * hs + 0x1e) ec
READ_SHORT (ho + (copy_header - 1) * hs + 0x20) ei
READ_ASCII (eo + ei * 0x30) effs (ec * 0x30)
READ_ASCII (ho + (copy_header - 1) * hs) copy (hs)
WRITE_ASCIIE (ho + insert_point * hs) ~%copy%~ (hs)
END
WRITE_SHORT 0x68 hc
WRITE_LONG 0x6a eo
READ_SHORT 0x70 ei // technically, it is a counter
FOR (i = ho; i < ho + hc * hs; i += hs) BEGIN
READ_SHORT (i + 0x1e) ec
WRITE_SHORT (i + 0x20) ei
SET ei += ec
END
PATCH_IF (copy_header) BEGIN
READ_SHORT (ho + insert_point * hs + 0x1e) ec
READ_SHORT (ho + insert_point * hs + 0x20) ei
INSERT_BYTES (eo + ei * 0x30) (ec * 0x30)
WRITE_ASCIIE (eo + ei * 0x30) ~%effs%~ (ec * 0x30)
END ELSE BEGIN
SET off = ho + insert_point * hs
WRITE_BYTE off type
WRITE_BYTE (off + 0x2) location
WRITE_ASCIIE (off + 0x4) ~%icon%~ (8)
WRITE_BYTE (off + 0xc) target
WRITE_BYTE (off + 0xd) target_count
WRITE_SHORT (off + 0xe) range
WRITE_SHORT (off + 0x10) required_level
WRITE_LONG (off + 0x12) speed
WRITE_SHORT (off + 0x26) projectile
END
END
END


////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////

Loading

0 comments on commit 5244490

Please sign in to comment.