Skip to content

Commit

Permalink
Collated v34.1 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMWWallace committed Sep 18, 2021
1 parent c206cff commit d88fc7d
Show file tree
Hide file tree
Showing 31 changed files with 350 additions and 107 deletions.
2 changes: 1 addition & 1 deletion stratagems/beholder/beholder.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ DEFINE_ACTION_FUNCTION beholder_antimagic BEGIN
OUTER_SET ds_mode=enhanced_edition? 1 : 0

MAKE_PATCH
delete_effect => ~opcode is_in [112 58 60]~ // remove item-removal effects overlay
delete_effect => ~opcode is_in [112 58 60 142]~ // remove item-removal effects overlay and casting-failure icon (replicated in dw#bhpan)
patch_ability_inline => ~projectile=>1~ // direct gaze attack - no projectile
patch_effect_inline => ~match=>"duration=20" duration=>6~ // 1-rd duration for antimagic effect
add_effect_inline => ~number_to_add=>6 opcode=>58 target=>2 timing=>4 duration=>"entry_index + 1"~ // once-per-second dispels
Expand Down
13 changes: 13 additions & 0 deletions stratagems/beholder/ssl/beholder_antimagic.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ THEN DO
Action(EyestalkFriendly,BEHOLDER_ANTIMAGIC_RAY)
END

///////////////////////////////////////////////////
// Destroy illusions
////////////////////////////////////////////////

IF TRIGGER
IgnoreBlock(NoAntimagicEye)
TargetBlock(EnemiesInOrder)
TriggerBlock(EasyPlus)
Gender(scstarget,ILLUSIONARY)
THEN DO
Action(Eyestalk,BEHOLDER_ANTIMAGIC_RAY|100|100)
END

///////////////////////////////////////////////////
// Disable spellcasters
////////////////////////////////////////////////
Expand Down
5 changes: 3 additions & 2 deletions stratagems/caster_shared/ai_initialise.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ DEFINE_ACTION_FUNCTION ai_initialise BEGIN
LAF run STR_VAR file=ds_iwd locbase=ds END
END


// bespoke detection of timestop

ACTION_IF is_bg2 BEGIN
Expand All @@ -25,9 +26,9 @@ DEFINE_ACTION_FUNCTION ai_initialise BEGIN
LAF invisibility_animations END
END

/// build prebuff spells
/// build prebuff spells - MOVED as it needs to come after the spell-system changes

LAF build_prebuff_spells END
// LAF build_prebuff_spells END

/// make curse spell
ACTION_IF is_bg2 BEGIN
Expand Down
17 changes: 17 additions & 0 deletions stratagems/caster_shared/anon.2da
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
WIZARD_CONJURE_FIRE_ELEMENTAL
WIZARD_CONJURE_EARTH_ELEMENTAL
WIZARD_CONJURE_AIR_ELEMENTAL
WIZARD_INVISIBLE_STALKER
WIZARD_ANIMATE_DEAD
CLERIC_CONJURE_EARTH_ELEMENTAL
CLERIC_CONJURE_FIRE_ELEMENTAL
CLERIC_AERIAL_SERVANT
CLERIC_CONJURE_ANIMALS
CLERIC_ANIMAL_SUMMONING_1
CLERIC_ANIMAL_SUMMONING_2
CLERIC_ANIMAL_SUMMONING_3
CLERIC_CALL_WOODLAND_BEINGS
CLERIC_STALKER
CLERIC_GIANT_INSECT
CLERIC_ANIMATE_DEAD
CLERIC_ANIMATE_SKELETON_WARRIOR
4 changes: 2 additions & 2 deletions stratagems/caster_shared/caster_definitions.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ BEGIN_ACTION_DEFINITION
Range(Player6,50)
ACTION
RESPONSE #scsprob1
ApplySpell(Myself,scsargument1)
ReallyForceSpellRES("%scsargument1_ANON%",Myself)
RemoveSpell(scsargument1)
Continue()
END
Expand All @@ -603,7 +603,7 @@ BEGIN_ACTION_DEFINITION
Range(Player6,50)
ACTION
RESPONSE #scsprob1
ApplySpell(Myself,scsargument1)
ReallyForceSpellRES("%scsargument1_ANON%",Myself)
RemoveSpell(scsargument1)
IncrementGlobal("l7_priest_spells","LOCALS",1)
Continue()
Expand Down
32 changes: 24 additions & 8 deletions stratagems/caster_shared/caster_shared.tph
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,32 @@ DEFINE_ACTION_FUNCTION build_prebuff_spells BEGIN
LAUNCH_ACTION_MACRO read_in_spellcodes
LAF read_in_list STR_VAR file=~prebuff.2da~ RET list END
OUTER_WHILE ~%list%~ STRING_COMPARE_CASE ~~ BEGIN
LAF return_first_entry STR_VAR list RET list spell_ID=entry END
// PRINT "building prebuff spell, data %spell_ID%"
LAF build_prebuff_spell STR_VAR spell_ID RET fullname newcode END
// PRINT "...done"
ACTION_IF !FILE_CONTAINS_EVALUATED (~%data_loc%/instant_prebuff_spells.2da~ ~%newcode%~) BEGIN
LAF log_this STR_VAR file=instant_prebuff_spells.2da input=~%fullname%_PREBUFF %newcode%~ END
END
LAF return_first_entry STR_VAR list RET list spell_ID=entry END
LAF build_prebuff_spell STR_VAR spell_ID RET fullname newcode END
ACTION_IF !FILE_CONTAINS_EVALUATED (~%data_loc%/instant_prebuff_spells.2da~ ~%newcode%~) BEGIN
LAF log_this STR_VAR file=instant_prebuff_spells.2da input=~%fullname%_PREBUFF %newcode%~ END
END
END
LAF read_in_list STR_VAR file=anon.2da RET list END
OUTER_WHILE ~%list%~ STRING_COMPARE_CASE ~~ BEGIN
LAF return_first_entry STR_VAR list RET list spell_ID=entry END
ACTION_IF IDS_OF_SYMBOL (spell "%spell_ID%")>=0 BEGIN
LAF RES_NUM_OF_SPELL_NAME STR_VAR spell_name="%spell_ID%" RET spell_res END
ACTION_IF FILE_EXISTS_IN_GAME "%spell_res%.spl" BEGIN
OUTER_PATCH_SAVE new_res "%spell_res%" BEGIN
REPLACE_TEXTUALLY "SPWI" "DWAW"
REPLACE_TEXTUALLY "SPPR" "DWAP"
END
COPY_EXISTING "%spell_res%.spl" "override/%new_res%.spl"
WRITE_LONG 0x8 "-1"
END
ACTION_IF !FILE_CONTAINS_EVALUATED (~%data_loc%/instant_prebuff_spells.2da~ ~%new_res%~) BEGIN
LAF log_this STR_VAR file=instant_prebuff_spells.2da input=~%spell_ID%_ANON %new_res%~ END
END
END
END
END

END

//////////////////////////////////////////////////////////////////////////////////////////////////////////
//// performs a swap of spells, stored in the master "spell" thread
Expand Down
24 changes: 23 additions & 1 deletion stratagems/doc/readme-stratagems.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ <h2>Table of Contents</h2>
(Finding this folder for the Enhanced Edition can be a bit tricky; it's the folder with "CHITIN.KEY" in it.)</p>
<p>On Enhanced-Edition installs, SCS requires version 2.6 of the game (for all I know it works on 2.5 and earlier, but I don't officially support it).</p>
<p><strong>Batch mode installation option</strong></br />
SCS, like any multi-component mod, normally asks about a component, installs it, then asks about the next component. Since some of SCS's components can take a while to install, this can be tedious. Version 34 ships with an experimental 'batch mode': if you select this (by installing the 'batch mode' component, which should be the first component offered to you) then SCS will ask about all components first, then install all of them. After you've done this, a file (stratagems.bat) will be created in the weidu_external/batch subfolder in your main game folder; clicking on it will uninstall and reinstall all your chosen options. Batch mode is currently only available for Windows installs (basically because I don't know how batch files work in OSX or Linux and don't have a testing environment for them).
SCS, like any multi-component mod, normally asks about a component, installs it, then asks about the next component. Since some of SCS's components can take a while to install, this can be tedious. Version 34 ships with an experimental 'batch mode': if you select this (by installing the 'batch mode' component, which should be the first component offered to you) then SCS will ask about all components first but will not install them. After you have chosen your components, you will be offered a new component, 'finish batch mode installation', which will then install all of them. After you've done this, a file (stratagems.bat) will be created in the weidu_external/batch subfolder in your main game folder; clicking on it will uninstall and reinstall all your chosen options. (An optional alternative is to create the stratagems.bat folder but not install anything.) Batch mode is currently only available for Windows installs (basically because I don't know how batch files work in OSX or Linux and don't have a testing environment for them).
</p>
<p><strong>Special Note for Siege of Dragonspear from Steam/GOG<br />
</strong>Good Old Games (GOG) and Steam both package the additional content for Siege of Dragonspear in a method that WeiDU, the tool used to install this mod, cannot access. You must run a program called <a href="https://forums.beamdog.com/discussion/50441/modmerge-merge-your-steam-gog-zip-based-dlc-into-something-weidu-nearinfinity-dltcep-can-use/p1">Modmerge</a> on your SoD installation before you can install this or any other WeiDU-based mod. </p>
Expand Down Expand Up @@ -2150,6 +2150,28 @@ <h3>Override files</h3>
<li>Drow katanas are not automatically identified.</li>
<li>A few other miscellaneous typos fixed.</li>
</ul>
<b>Incremental updates</b>
<ul>
<li>Version 33.1 (bugs mostly identified by Tresset and jmerry on the Beamdog forums, so thanks)
<ul>
<li>Aec'letec can now be killed on EE installs (critical incompability with 2.6).</li>
<li>Revised batch mode a bit to deal better with reinstalls.</li>
<li>Fixed a library-file glitch which was preventing installation of IWD spells on some installs.</li>
<li>Creatures that are summoned offscreen by mages and priests are now summoned using the correct level of the spell, instead of the lowest level.</li>
<li>Wand of Spell Striking now reduces MR by 20% rather than a level-dependent amount.</li>
<li>Rakshasas and liches are no longer immune to the cleric version of True Seeing.</li>
<li>Mind flayers have grown tired of waiting for unber hulks to turn up and now work with umber hulks instead (typo in level-dependent spawn component).</li>
<li>Improved the handling of non-English-language numbers in the 'increased cost of Spellhold' component.</li>
<li>Carsa's new dialog entries are now tra-ified, so they can be translated into non-English languages; so are a couple of stray phrases from the spell tweaks. (Thanks to Roberciik for spotting these.)</li>
<li>Smarter Mages modifies Mae'var's Shadow Armor so that it permits spellcasting, rather than removing it entirely from the game. (I thought of just giving it to someone else but the description is a very good fit to Mae'var specifically.)</li>
<li>The 'casting failure' icon from beholder/hive mother antimagic rays now has the correct duration.</li>
<li>7th and 8th level druids no longer illegally get Iron Skins.</li>
<li>Beholders now use their central eye to destroy illusions (e.g. the Mislead spell clone).</li>
<li>Rearranged the order in which we install Detectable Spells and the spell-tweak system, hopefully sorting out a minor compatibility issue with SR.</li>
<li>Fire Elemental token now grants correct Dexterity and number of attacks.</li>
<li>Externalised a couple of stray English ph

</ul>
</div>
<div class="ribbon_rectangle_h3"><h3>Version 33 (May 2020)</h3></div>
<div class="ribbon_triangle_h2-l"></div>
Expand Down
4 changes: 2 additions & 2 deletions stratagems/gameplay/shapeshift.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dw#shwol 13124 13144 31488 iwolf 2 0 0
dw#shwyv 13125 13145 40960 iswospdr 2 0 0 3 2 4 18 76 17 3 0 2 100 1
dw#shsal 13126 13146 59648 iplysala 2 0 0 3 1 8 18 76 19 2 0 1 100 1
dw#shspi 13127 13147 31235 iswospdr 2 0 0 3 1 4 16 0 16 0 0 3 100 1
dw#shfir 13128 13148 29456 ishape07 4 0 0 0 1 10 22 0 24 -5 0 2 100 2
dw#shfir 13128 13148 29456 ishape07 4 0 0 0 1 10 22 0 25 -5 0 2 100 2
dw#shear 13129 13149 29440 ishape06 4 0 0 0 2 10 25 0 10 -5 0 2 75 2
>>>>>>>>

Expand Down Expand Up @@ -226,7 +226,7 @@ DEFINE_ACTION_FUNCTION shapeshift_token_extras BEGIN

// fire elemental: haste, THAC0=2, fire resistance, fire aura, immunity to weapons, fire damage
LAF edit_item STR_VAR item=dw#shfir
editstring=~add_effect_global_inline=>"opcode=>16"
editstring=~add_effect_global_inline=>"opcode=>16 parameter2=>2"
add_effect_global_inline=>"opcode=>120 parameter2=>2"
add_effect_global_inline=>"opcode=>54 parameter1=>2 parameter2=>1"
add_effect_global_inline=>"opcode=>30 parameter1=>100 parameter2=>1"
Expand Down
18 changes: 10 additions & 8 deletions stratagems/gameplay/spellhold_cost.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ DEFINE_ACTION_FUNCTION spellhold_cost
STR_VAR version="0" // this is the cost in thousands of gp
BEGIN
// work out variables
OUTER_SET asking_price_thousands=version
OUTER_SET asking_price=version *1000
OUTER_SET asking_price_minus_one = asking_price - 1
OUTER_SET temp=(version *3)/4
OUTER_SET actual_price=temp* 1000
OUTER_SET actual_price_thousands=(version *3) / 4
OUTER_SET actual_price=actual_price_thousands* 1000
OUTER_SET actual_price_minus_one = actual_price - 1
OUTER_SET threshold_price=asking_price / 4
OUTER_SET threshold_price_minus_one=threshold_price - 1
Expand All @@ -15,11 +16,12 @@ BEGIN
// swap strings

ACTION_FOR_EACH tlk_entry IN 6601 20944 20945 20970 20990 20991 21032 21512 21832 22046 34187 49061 49071 49839 49841 49844 BEGIN
LAF substitute_tlk_entry INT_VAR tlk_entry
STR_VAR arguments= ~ "20[, \.]?000" => "%asking_price_string%"
"15[, \.]?000" => "%actual_price_string%"
~
END
ACTION_GET_STRREF tlk_entry string
OUTER_PATCH_SAVE string "%string%" BEGIN
REPLACE_TEXTUALLY "20\([, \.]?\)\(000\)" "%asking_price_thousands%\1\2"
REPLACE_TEXTUALLY "15\([, \.]?\)\(000\)" "%actual_price_thousands%\1\2"
END
STRING_SET_EVALUATE tlk_entry "%string%"
END


Expand All @@ -28,7 +30,7 @@ BEGIN
PartyGoldLT(50000) => PartyGoldLT(%asking_price%)
PartyGoldLT(15000) => PartyGoldLT(%actual_price%)
PartyGoldLT(5000) => PartyGoldLT(%threshold_price%)
PartyGoldGT(49999) => PartyGoldGT(%asking_price_minus_one%)
PartyGoldGT(4999) => PartyGoldGT(%asking_price_minus_one%)
PartyGoldGT(19999) => PartyGoldGT(%asking_price_minus_one%)
PartyGoldGT(14999) => PartyGoldGT(%actual_price_minus_one%)
PartyGoldGT(4999) => PartyGoldGT(%threshold_price_minus_one%)
Expand Down
47 changes: 29 additions & 18 deletions stratagems/initial/initial.tpa
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ DEFINE_ACTION_FUNCTION initial BEGIN
// spellbook, for debugging
LAF run STR_VAR file=universal_spellbook locbase=spell tra=spell END


////////////////////////
///// BG2
////////////////////////
Expand Down Expand Up @@ -292,27 +293,37 @@ DEFINE_ACTION_FUNCTION initial BEGIN
END

////////////////////////
///// Spell core
///// The old AI-initialise bit (must *precede* spell_core because if SR is installed we need to load friendly_fiends, which has high-level scripting that needs DS and the difficulty system)
////////////////////////

LAF speed_debug STR_VAR string="Running spell edits" END
OUTER_SPRINT component_loc caster_shared
LAF run STR_VAR file=ai_initialise END
OUTER_SPRINT component_loc initial
CLEAR_IDS_MAP // make sure any changes to splstate/stats are logged


LAF install_spell_core END

////////////////////////
///// Update antimagic descriptions to reflect any changes
///// Spell core
////////////////////////

LAF run STR_VAR file=correct_antimagic_descriptors locbase=spell tra=spell END

LAF install_spell_core END

////////////////////////
///// The old AI-initialise bit
///// Prebuffs (must *follow* spell_core so we replicate the modified spells)
////////////////////////

OUTER_SPRINT component_loc caster_shared
LAF build_prebuff_spells END
OUTER_SPRINT component_loc initial // yes, the architecture here has got hideously tangled, why do you ask?


////////////////////////
///// Update antimagic descriptions to reflect any changes
////////////////////////

OUTER_SPRINT component_loc caster_shared
LAF run STR_VAR file=ai_initialise END
OUTER_SPRINT component_loc initial
CLEAR_IDS_MAP // make sure any changes to splstate/stats are logged
LAF run STR_VAR file=correct_antimagic_descriptors locbase=spell tra=spell END



Expand Down Expand Up @@ -471,15 +482,15 @@ END
///////////////////////////////////////////////////////////////////////////

DEFINE_ACTION_FUNCTION detectable_items BEGIN
LAF check_ini STR_VAR ini=~AI_Does_Not_Detect_Items~ RET value END
ACTION_IF !value BEGIN
LAF check_ini STR_VAR ini=~AI_Is_Omniscient~ RET omniscient=value END
LAF check_ini STR_VAR ini=~AI_Does_Not_Detect_Items~ RET do_not_detect=value END
LAF check_ini STR_VAR ini=~AI_Is_Omniscient~ RET omniscient=value END
LAF include STR_VAR file=item_labels.tpa END
LAF item_labels INT_VAR omniscient END
LAF run STR_VAR file=immunity_labels END
END ELSE BEGIN // need a blank autolib.slb
COPY ~.../stratagems-inline/blank~ ~%workspace%/autolib.slb~
END
LAF item_labels INT_VAR omniscient do_not_detect END
ACTION_IF do_not_detect BEGIN
LAF ds_resolve_stat STR_VAR id=ENCHANTMENT_IMMUNITY END
END ELSE BEGIN
LAF run STR_VAR file=immunity_labels END
END
END

///////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions stratagems/initial/item_labels.tpa
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
DEFINE_ACTION_FUNCTION item_labels
INT_VAR omniscient=0
do_not_detect=0
BEGIN

<<<<<<<< .../stratagems-inline/autolib.slb
Expand Down
2 changes: 2 additions & 0 deletions stratagems/lang/english/mage.tra
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@217 = ~An invisible wall of force has blocked the doorway.~
@302 = ~Split Mind~
@304 = ~Fear Aura~
@400 = ~Spellcasting is not disabled~
@401 = ~Hide In Shadows~ // note to translators: this must be, exactly, the beginning part of the 'hide in shadows' string in the description text for leat08.itm. How much of the line doesn't really matter (enough that no other line in that description starts with this string). Don't include any + signs.
@1101 = ~Hmmm... what was that?~
@1102 = ~Strange... let's see what a little divination will show.~
@1103 = ~Show yourself! You cannot hide from a mage!~
Expand Down
7 changes: 6 additions & 1 deletion stratagems/lang/english/setup.tra
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
@23 = ~Make Power-Word: Blind single-target~
@27 = ~Modmerge is required before mods can be installed on this game. Check the readme for more information and a link to download Modmerge.~

@28=~Finish batch mode installation~
@29="Install batched components"
@30="Create batch-install file (and uninstall any installed components)"

@31 = ~Remove the Shield of Balduran from the game~
@32 = ~Remove the invisibility power of the Staff of the Magi~
@33 = ~Move Vhailor's Helm into Throne of Bhaal~
Expand Down Expand Up @@ -218,4 +222,5 @@
@50008 = ~This component is only for Icewind Dale: Enhanced Edition~
@50009 = ~This component is not compatible with Icewind Dale: Enhanced Edition~
@50010 = ~This component is incompatible with the Tweaks Anthology component that prevents humans from dual-classing~
@50011 = ~Batch mode is only available for Windows installs~
@50011 = ~Batch mode is only available for Windows installs~
@50012 = ~This component is only used in batch mode~
3 changes: 2 additions & 1 deletion stratagems/lang/english/spell.tra
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ Upon learning how to cast 7th level spells, a bard may also create a full Spell
@1010="

The combat protection spells dispelled by Breach are"
@1011="and"

@1020=" +1/level (maximum "

@1021="d"
@1100="This reverses any previous life energy level drain of the creature by a force or monster." // NOTE TO TRANSLATORS: must be exact string from description of 'Lesser Restoration' spell
@1101="This reverses any previous life energy level drain of the creature by a force or monster." // NOTE TO TRANSLATORS: must be exact string from description of 'Greater Restoration' spell
@1102="This reverses any previous life energy level drain of the creature by a force or monster, and restores lost ability score points from sources such as the strength-draining touch of a Shadow or the thought-devouring attacks of a Mind Flayer."
Expand Down
Loading

0 comments on commit d88fc7d

Please sign in to comment.