From 7b57e00a879e263a5fec21d0450aa3c2e5b9943f Mon Sep 17 00:00:00 2001 From: subtledoctor Date: Fri, 22 Mar 2019 12:23:20 -0400 Subject: [PATCH] 0.75.27 targeting changes --- faiths_and_powers/Faiths_and_Powers.tp2 | 2 +- .../lib/create_sphere_system.tpa | 114 ++++++------------ 2 files changed, 36 insertions(+), 80 deletions(-) diff --git a/faiths_and_powers/Faiths_and_Powers.tp2 b/faiths_and_powers/Faiths_and_Powers.tp2 index da0cf7fb..e404bcb3 100644 --- a/faiths_and_powers/Faiths_and_Powers.tp2 +++ b/faiths_and_powers/Faiths_and_Powers.tp2 @@ -2,7 +2,7 @@ BACKUP ~faiths_and_powers/backup~ AUTHOR ~SubtleD and Grammarsalad~ -VERSION ~0.75.26~ +VERSION ~0.75.27~ //README ~faiths_and_powers/readme-pnp.html~ diff --git a/faiths_and_powers/lib/create_sphere_system.tpa b/faiths_and_powers/lib/create_sphere_system.tpa index 324b817e..2b3f4ff3 100644 --- a/faiths_and_powers/lib/create_sphere_system.tpa +++ b/faiths_and_powers/lib/create_sphere_system.tpa @@ -425,7 +425,7 @@ LAM d5_minor_access_levels ACTION_PHP_EACH spellsphere AS spl => sph BEGIN // OUTER_SET lvl = spl_1 - OUTER_SET mlvl = (%lvl% + 1) + OUTER_SET mlvl = (%lvl% + %d5_minor_shift%) OUTER_SET flvl = (%lvl% - 1) // ACTION_IF !(~%sph%~ STRING_EQUAL_CASE ~universal~) BEGIN @@ -496,14 +496,14 @@ ACTION_PHP_EACH spellsphere AS spl => sph BEGIN END SAY_EVALUATED 0x50 ~%new_desc%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY COPY_EXISTING ~%sphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%the_spell%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY ACTION_IF (%lvl% = 1) OR (%lvl% = 7) BEGIN COPY_EXISTING ~%fsphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%the_spell%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY END END ACTION_IF (%lvl% != %spell_lvl%) BEGIN @@ -545,10 +545,10 @@ ACTION_PHP_EACH spellsphere AS spl => sph BEGIN END SAY_EVALUATED 0x50 ~%new_desc%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY COPY_EXISTING ~%sphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%priest_res%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY ACTION_IF (%lvl% = 1) OR (%lvl% = 7) BEGIN COPY_EXISTING ~%fsphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%priest_res%~ END @@ -589,9 +589,10 @@ ACTION_PHP_EACH spellsphere AS spl => sph BEGIN ELSE BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = %eff_target% power = %lvl% parameter1 = 0 parameter2 = 1 timing = 2 STR_VAR resource = EVAL ~%the_spell%~ END END + IF_EXISTS BUT_ONLY COPY_EXISTING ~%msphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%minor_res%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY END ACTION_IF (1 < %lvl%) BEGIN COPY_EXISTING ~%the_spell%.spl~ ~override/%focus_res%.spl~ @@ -605,7 +606,7 @@ ACTION_PHP_EACH spellsphere AS spl => sph BEGIN SET abil_number = (%abil_number% - 1) WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 END - READ_BYTE (%eff_offset% + 0x02) eff_target +// READ_BYTE (%eff_offset% + 0x02) eff_target LPF DELETE_EFFECT INT_VAR match_probability2 = 0 END PATCH_IF (%abil_target% = 4) BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = %lvl% parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%the_spell%~ END @@ -620,11 +621,12 @@ ACTION_PHP_EACH spellsphere AS spl => sph BEGIN END END ELSE BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = %eff_target% power = %lvl% parameter1 = 0 parameter2 = 1 timing = 2 STR_VAR resource = EVAL ~%the_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 2 power = %lvl% parameter1 = 0 parameter2 = 1 timing = 2 STR_VAR resource = EVAL ~%the_spell%~ END END + IF_EXISTS BUT_ONLY COPY_EXISTING ~%fsphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%focus_res%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY END END // end type = priest spells // @@ -646,90 +648,43 @@ ACTION_PHP_EACH spellsphere AS spl => sph BEGIN END COPY_EXISTING ~%sphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%priest_res%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY ACTION_IF (%lvl% = 7) BEGIN - COPY_EXISTING ~%fsphere%.spl~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%priest_res%~ END - BUT_ONLY + COPY_EXISTING ~%fsphere%.spl~ ~override~ + LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%priest_res%~ END + IF_EXISTS BUT_ONLY END ACTION_IF (%lvl% < 4) BEGIN - COPY_EXISTING ~%the_spell%.spl~ ~override/%minor_res%.spl~ - WRITE_SHORT 0x1c 2 - LPF ALTER_SPELL_HEADER INT_VAR location = 2 END - PATCH_IF (%d5_minor_shift% = 1) BEGIN + ACTION_IF (%d5_minor_shift% > 0) BEGIN + COPY_EXISTING ~%the_spell%.spl~ ~override/%minor_res%.spl~ + WRITE_SHORT 0x1c 2 + LPF ALTER_SPELL_HEADER INT_VAR location = 2 END WRITE_LONG 0x34 %mlvl% - END - PATCH_IF (%d5_minor_shift% = 0) BEGIN - WRITE_LONG 0x34 %lvl% - END - READ_LONG 0x64 abil_offset - READ_SHORT 0x68 abil_number - READ_BYTE (%abil_offset% + 0x0c) abil_target - READ_SHORT (%abil_offset% + 0x0e) abil_range - READ_LONG 0x6a eff_offset - WHILE (%abil_number% > 0) BEGIN - SET abil_number = (%abil_number% - 1) - WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 - END - READ_BYTE (%eff_offset% + 0x02) eff_target - LPF DELETE_EFFECT INT_VAR match_probability2 = 0 END - PATCH_IF (%abil_target% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = %lvl% parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%the_spell%~ END - PATCH_IF (%abil_range% < 35) BEGIN - PATCH_IF (%abil_range% > 4) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR range = (%abil_range% - 3) END - END - PATCH_IF (%abil_range% < 5) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END // what the hell?? why did I do this?? - // LPF ALTER_SPELL_HEADER INT_VAR range = 2 END // maybe this is what I meant to do - END - END - END - ELSE BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = %eff_target% power = %lvl% parameter1 = 0 parameter2 = 1 timing = 2 STR_VAR resource = EVAL ~%the_spell%~ END - END - COPY_EXISTING ~%msphere%.spl~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%minor_res%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY + COPY_EXISTING ~%msphere%.spl~ ~override~ + LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%minor_res%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%d5_minor_shift% = 0) BEGIN + COPY_EXISTING ~%msphere%.spl~ ~override~ + LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%priest_res%~ END + IF_EXISTS BUT_ONLY + END END - ACTION_IF (1 < %lvl%) BEGIN + ACTION_IF (%lvl% > 1) BEGIN COPY_EXISTING ~%the_spell%.spl~ ~override/%focus_res%.spl~ WRITE_SHORT 0x1c 2 LPF ALTER_SPELL_HEADER INT_VAR location = 2 END WRITE_LONG 0x34 %flvl% - READ_LONG 0x64 abil_offset - READ_SHORT 0x68 abil_number - READ_BYTE (%abil_offset% + 0x0c) abil_target - READ_SHORT (%abil_offset% + 0x0e) abil_range - READ_LONG 0x6a eff_offset - WHILE (%abil_number% > 0) BEGIN - SET abil_number = (%abil_number% - 1) - WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 - END - READ_BYTE (%eff_offset% + 0x02) eff_target - LPF DELETE_EFFECT INT_VAR match_probability2 = 0 END - PATCH_IF (%abil_target% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = %lvl% parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%the_spell%~ END - PATCH_IF (%abil_range% < 35) BEGIN - PATCH_IF (%abil_range% > 4) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR range = (%abil_range% - 3) END - END - PATCH_IF (%abil_range% < 5) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END // what the hell?? why did I do this?? - // LPF ALTER_SPELL_HEADER INT_VAR range = 2 END // maybe this is what I meant to do - END - END - END - ELSE BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = %eff_target% power = %lvl% parameter1 = 0 parameter2 = 1 timing = 2 STR_VAR resource = EVAL ~%the_spell%~ END - END + IF_EXISTS BUT_ONLY COPY_EXISTING ~%fsphere%.spl~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode=171 STR_VAR match_resource=~SPWI101~ resource = EVAL ~%focus_res%~ END - BUT_ONLY + IF_EXISTS BUT_ONLY END END END END +/* ACTION_IF (~%sph%~ STRING_EQUAL_CASE ~universal~) BEGIN ACTION_IF (FILE_CONTAINS_EVALUATED (~spell.ids~ ~%spl%~)) BEGIN LAF RES_NUM_OF_SPELL_NAME STR_VAR spell_name = EVAL ~%spl%~ RET spell_res spell_num END @@ -744,6 +699,7 @@ ACTION_PHP_EACH spellsphere AS spl => sph BEGIN BUT_ONLY END END +*/ END //__________________________________________________________________________________