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

Commit 5244490

Browse files
committed
0.9.47
invisibility purge fix, semi_spont update
1 parent 9b47cdf commit 5244490

File tree

4 files changed

+256
-97
lines changed

4 files changed

+256
-97
lines changed

TomeAndBlood/TomeAndBlood.tp2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BACKUP ~weidu_external/backup/TomeAndBlood~
22
AUTHOR ~aquadrizzt~
3-
VERSION ~0.9.46~
3+
VERSION ~0.9.47~
44

55
ALWAYS
66

TomeAndBlood/comp/setup_spell_tweaks.tpa

+5-3
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,16 @@ END
376376
//change Dispel Illusion to Invisibility Purge______________________________________
377377
//
378378
COPY_EXISTING ~sppr309.spl~ ~override~
379+
READ_LONG 0x08 spell_name
380+
READ_LONG 0x50 spell_desc
379381
PATCH_FOR_EACH second IN ~6~ ~12~ ~18~ ~24~ ~30~ BEGIN // do this more often
380382
LPF CLONE_EFFECT INT_VAR match_opcode = 146 match_duration = %second% duration = (%second% - 2) STR_VAR match_resource = ~sppr309d~ END
381383
LPF CLONE_EFFECT INT_VAR match_opcode = 146 match_duration = %second% duration = (%second% - 4) STR_VAR match_resource = ~sppr309d~ END
382384
END
385+
LPF ADD_SPELL_EFFECT INT_VAR opcode = 101 target = 2 power = 3 parameter2 = 20 timing = 0 duration = 30 END
383386
IF_EXISTS
384387

385388
COPY_EXISTING ~sppr309.spl~ ~override/spwi322.spl~
386-
READ_LONG 0x08 spell_name
387-
READ_LONG 0x50 spell_desc
388389
WRITE_SHORT 0x1c 1
389390
WRITE_SHORT 0x22 16
390391
WRITE_BYTE 0x25 3
@@ -394,7 +395,7 @@ COPY_EXISTING ~sppr309.spl~ ~override/spwi322.spl~
394395
IF_EXISTS
395396

396397
COPY_EXISTING ~scrl6k.itm~ ~override~
397-
WRITE_LONG 0x1c %spell_name%
398+
WRITE_LONG 0x0c %spell_name%
398399
WRITE_LONG 0x54 %spell_desc%
399400
WRITE_ASCII 0x3a ~sppr309a~ #8
400401
IF_EXISTS BUT_ONLY
@@ -535,6 +536,7 @@ COPY_EXISTING ~spwi310.spl~ ~override~
535536
SAY NAME1 @6413
536537
SAY UNIDENTIFIED_DESC @6414
537538
WRITE_BYTE 0x27 2
539+
LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 69 opcode = 337 parameter1 = 20 parameter2 = 101 timing = 1 duration = 0 END
538540
LPF CLONE_EFFECT INT_VAR silent = 1 multi_match = 1 match_opcode = 69 opcode = 205 parameter1 = 0 parameter2 = 5 END
539541
LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 insert_point = 0 STR_VAR resource = ~spwi310~ END
540542
IF_EXISTS BUT_ONLY

TomeAndBlood/lib/semi_spont/misc_functions.tpa

+70
Original file line numberDiff line numberDiff line change
@@ -633,3 +633,73 @@ END
633633
////////////////////////////////////////////////////////////////////////
634634
////////////////////////////////////////////////////////////////////////
635635

636+
637+
DEFINE_PATCH_FUNCTION QD_ADD_EMPTY_SPELL_HEADER
638+
INT_VAR
639+
type = 1
640+
location = 4
641+
target = 1
642+
target_count = 0
643+
range = 0
644+
required_level = 1
645+
speed = 0
646+
projectile = 1
647+
copy_header = 0
648+
insert_point = ~-1~
649+
STR_VAR
650+
icon = ~~
651+
RET
652+
insert_point
653+
BEGIN
654+
SET hs = 0x28
655+
READ_LONG 0x64 ho
656+
READ_SHORT 0x68 hc
657+
READ_LONG 0x6a eo
658+
SET insert_point = (insert_point > hc || insert_point < 0) ? hc : insert_point
659+
SET copy_header = (copy_header < 0) ? 0 : copy_header
660+
PATCH_IF (copy_header > hc) BEGIN
661+
PATCH_WARN ~WARNING: Unable to copy %copy_header%th header, %SOURCE_FILE% contains only %hc% headers!~
662+
END ELSE BEGIN
663+
INSERT_BYTES (ho + insert_point * hs) hs
664+
SET hc += 1
665+
SET eo += hs
666+
PATCH_IF (copy_header) BEGIN
667+
READ_SHORT (ho + (copy_header - 1) * hs + 0x1e) ec
668+
READ_SHORT (ho + (copy_header - 1) * hs + 0x20) ei
669+
READ_ASCII (eo + ei * 0x30) effs (ec * 0x30)
670+
READ_ASCII (ho + (copy_header - 1) * hs) copy (hs)
671+
WRITE_ASCIIE (ho + insert_point * hs) ~%copy%~ (hs)
672+
END
673+
WRITE_SHORT 0x68 hc
674+
WRITE_LONG 0x6a eo
675+
READ_SHORT 0x70 ei // technically, it is a counter
676+
FOR (i = ho; i < ho + hc * hs; i += hs) BEGIN
677+
READ_SHORT (i + 0x1e) ec
678+
WRITE_SHORT (i + 0x20) ei
679+
SET ei += ec
680+
END
681+
PATCH_IF (copy_header) BEGIN
682+
READ_SHORT (ho + insert_point * hs + 0x1e) ec
683+
READ_SHORT (ho + insert_point * hs + 0x20) ei
684+
INSERT_BYTES (eo + ei * 0x30) (ec * 0x30)
685+
WRITE_ASCIIE (eo + ei * 0x30) ~%effs%~ (ec * 0x30)
686+
END ELSE BEGIN
687+
SET off = ho + insert_point * hs
688+
WRITE_BYTE off type
689+
WRITE_BYTE (off + 0x2) location
690+
WRITE_ASCIIE (off + 0x4) ~%icon%~ (8)
691+
WRITE_BYTE (off + 0xc) target
692+
WRITE_BYTE (off + 0xd) target_count
693+
WRITE_SHORT (off + 0xe) range
694+
WRITE_SHORT (off + 0x10) required_level
695+
WRITE_LONG (off + 0x12) speed
696+
WRITE_SHORT (off + 0x26) projectile
697+
END
698+
END
699+
END
700+
701+
702+
////////////////////////////////////////////////////////////////////////
703+
////////////////////////////////////////////////////////////////////////
704+
////////////////////////////////////////////////////////////////////////
705+

0 commit comments

Comments
 (0)