Skip to content

Commit

Permalink
2.5
Browse files Browse the repository at this point in the history
improved support for vanilla spell lists and spell tables
  • Loading branch information
subtledoctor committed Dec 14, 2023
1 parent ce0c29c commit fea3790
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 220 deletions.
20 changes: 20 additions & 0 deletions 5E_spellcasting/5E_settings.ini
@@ -0,0 +1,20 @@

//__________________________________________________________________________________
//__________________________________________________________________________________
//
// 5E SPELLCASTING SETTINGS
//__________________________________________________________________________________
//__________________________________________________________________________________


OUTER_SET custom_casting_tables = 0 // set to 1 to use casting slot tables supplied by the mod

OUTER_SET reduced_cleric_memorize = 1 // set to 0 to use the unnerfed cleric table for memorization

OUTER_SET druids_on_cleric_table = 1 // set to 0 to keep the vanilla druid memorization table

/*
NOTE: changing those last two variables to 0 will give clerics/druids LOTS of memorization slots
and LOTS of casting slots, which will be a major power boost (never mind the WIS bonus slots)
as well as a pretty severe nerf to shamans by comparison. YMMV.
*/
11 changes: 3 additions & 8 deletions 5E_spellcasting/5E_spellcasting.tp2
@@ -1,14 +1,16 @@
BACKUP ~weidu_external/backup/5E_spellcasting~
AUTHOR ~SubtleD~

VERSION ~2.2~
VERSION ~2.5~

ALWAYS

INCLUDE ~5E_spellcasting/lib/semi_spontaneous.tpa~

INCLUDE ~5E_spellcasting/comp/5E_casting.tpa~

INCLUDE ~5E_spellcasting/5E_settings.ini~

END

ASK_EVERY_COMPONENT
Expand All @@ -24,13 +26,6 @@ LANGUAGE
~5E_spellcasting/lang/french/setup.tra~


/*
***** set something up where, when NPCs leave the party, they cast a spell that removes
all 206 effects in d5zz206.spl. (Just copy zz206 and remove all the op146 effects.) And
sets a local variable. Then on rejoining, if that local variable is set, cast zz206.
*/


//set all Vancian casters to use 5E system____________________________________________
//
BEGIN @100
Expand Down
336 changes: 128 additions & 208 deletions 5E_spellcasting/comp/5E_casting.tpa

Large diffs are not rendered by default.

67 changes: 66 additions & 1 deletion 5E_spellcasting/lib/semi_spont/semi_misc_functions.tpa
@@ -1,5 +1,5 @@

// v11.5 - fixed Identify for Vancian casting
// v12 - added define_priest_spells function

/*

Expand All @@ -13,6 +13,9 @@ functions in this file:
- semi_armor_casting - line
sets armor to block arcane 5E casting

- define_priest_spells
collects all priest spells and sorts by who gets what

- free_known_spells - line
input a free_spell (can run multiple free_spells for the same list_spell)
outputs a list_spell that adds the free_spells to one's spellbook
Expand Down Expand Up @@ -510,6 +513,68 @@ END // end define function
//__________________________________________________________________________________


DEFINE_ACTION_MACRO define_priest_spells BEGIN

// sorts priest spells by who gets what

COPY_EXISTING ~mxsplpal.2da~ ~override~
COUNT_2DA_COLS cols
PATCH_IF (cols > 1) BEGIN
SET max_lvl_pal = cols
END
BUT_ONLY

COPY_EXISTING ~mxsplran.2da~ ~override~
COUNT_2DA_COLS cols
PATCH_IF (cols > 1) BEGIN
SET max_lvl_ran = cols
END
BUT_ONLY

COPY_EXISTING_REGEXP ~^[Ss][Pp][Pp][Rr][1-7][0-5a-zA-Z][0-9a-zA-Z]\.spl$~ ~override~
PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN
PATCH_IF !(FILE_CONTAINS_EVALUATED (~hidespl.2da~ ~%SOURCE_RES%~)) BEGIN
READ_SHORT 0x1c spl_typ
READ_LONG 0x34 spl_lvl
PATCH_IF (spl_typ = 2) BEGIN
READ_BYTE 0x21 exclude
PATCH_IF ((exclude BAND 0b11000000) = 0b10000000) BEGIN // valid for clerics
SPRINT $cleric_valid_spells(~%SOURCE_RES%~)~1~
PATCH_IF (spl_lvl <= %max_lvl_pal%) BEGIN
SPRINT $paladin_valid_spells(~%SOURCE_RES%~)~1~
END
END
PATCH_IF ((exclude BAND 0b11000000) = 0b01000000) BEGIN // valid for druids
SPRINT $druid_valid_spells(~%SOURCE_RES%~)~1~
PATCH_IF (spl_lvl <= %max_lvl_ran%) BEGIN
SPRINT $ranger_valid_spells(~%SOURCE_RES%~)~1~
END
END
PATCH_IF ((exclude BAND 0b11000000) = 0b00000000) BEGIN // valid for both
SPRINT $cleric_valid_spells(~%SOURCE_RES%~)~1~
SPRINT $druid_valid_spells(~%SOURCE_RES%~)~1~
PATCH_IF (spl_lvl <= %max_lvl_pal%) BEGIN
SPRINT $paladin_valid_spells(~%SOURCE_RES%~)~1~
END
PATCH_IF (spl_lvl <= %max_lvl_ran%) BEGIN
SPRINT $ranger_valid_spells(~%SOURCE_RES%~)~1~
END
END
PATCH_IF ((exclude BAND 0b11000000) = 0b11000000) BEGIN // valid for neither
SPRINT $shaman_only_spells(~%SOURCE_RES%~)~1~
END
END
END
END
BUT_ONLY

END // end macro


//__________________________________________________________________________________
//__________________________________________________________________________________


DEFINE_ACTION_FUNCTION free_known_spells STR_VAR free_spell = ~~ list_spell = ~~ BEGIN

/*
Expand Down
4 changes: 3 additions & 1 deletion 5E_spellcasting/lib/semi_spontaneous.tpa
Expand Up @@ -1286,7 +1286,8 @@ ACTION_IF (FILE_EXISTS_IN_GAME ~d5zclons.2da~) BEGIN
BUT_ONLY

ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__spheres.d5~) BEGIN
COPY_EXISTING_REGEXP ~^[Ss][Pp][Pp][Rr][1-7]\([0-4][0-9]\|50\)\.spl$~ ~override~
COPY_EXISTING_REGEXP ~^[Ss][Pp][Pp][Rr][1-7][0-5a-zA-Z][0-9a-zA-Z]\.spl$~ ~override~
PATCH_IF !(FILE_CONTAINS_EVALUATED (~hidespl.2da~ ~%SOURCE_RES%~)) OR !(~%SOURCE_RES%~ STRING_MATCHES_REGEXP ~[Ss][Pp][Pp][Rr][1-7]50~) BEGIN
SET spl_ind = 0
INNER_ACTION BEGIN
ACTION_IF (FILE_CONTAINS_EVALUATED (~d5zclons.2da~ ~%SOURCE_RES%~)) BEGIN
Expand All @@ -1308,6 +1309,7 @@ ACTION_IF (FILE_EXISTS_IN_GAME ~d5zclons.2da~) BEGIN
END
APPEND ~d5zclons.2da~ ~%spl_ind% %SOURCE_RES% %SOURCE_RES% divine no ~ UNLESS ~%SOURCE_RES% %SOURCE_RES%~
END
END
BUT_ONLY
END // end no FnP

Expand Down
2 changes: 1 addition & 1 deletion 5E_spellcasting/readme-5E_spellcasting.html
Expand Up @@ -9,7 +9,7 @@
<body>
<h1>SubtleMods: D&D 5th Edition-style Spellcasting</h1>
<div class="section">
<p><strong> Version 2.1 </strong><br />
<p><strong> Version 2.5 </strong><br />
<strong> Languages:</strong> English</p>
<p><strong>Author: <a href="http://forums.gibberlings3.net/index.php?showuser=6306">The Subtle Doctor</a></strong></p>
<p><strong><a href="https://github.com/UnearthedArcana/5E_spellcasting">Home page</a></strong></p>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -9,7 +9,7 @@
<body>
<h1>SubtleMods: D&D 5th Edition-style Spellcasting</h1>
<div class="section">
<p><strong> Version 2.1 </strong><br />
<p><strong> Version 2.5 </strong><br />
<strong> Languages:</strong> English</p>
<p><strong>Author: <a href="http://forums.gibberlings3.net/index.php?showuser=6306">The Subtle Doctor</a></strong></p>
<p><strong><a href="https://github.com/UnearthedArcana/5E_spellcasting">Home page</a></strong></p>
Expand Down

0 comments on commit fea3790

Please sign in to comment.