Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New component: Limit resting mechanic #117

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cdtweaks/languages/english/limit_resting_mechanic.tra
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@0 = "Tweaks Anthology: The Party can rest at most once per day"
2 changes: 1 addition & 1 deletion cdtweaks/languages/english/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ The uninstall messages above are normal and expected.

@266000 = "Weapon Finesse feat for Thieves [Luke]"

@267000 = "Dual-Wield feat for Rangers [Luke]"
@267000 = "Limit Resting Mechanic [Luke (EEex)]"

@268000 = ~"Force" the Archer kit to use bows [Luke]~

Expand Down
1 change: 1 addition & 0 deletions cdtweaks/languages/italian/limit_resting_mechanic.tra
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@0 = "Tweaks Anthology: Il Gruppo può riposare al massimo una volta al giorno"
2 changes: 1 addition & 1 deletion cdtweaks/languages/italian/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ o rimpiazzata da - un'altra facente parte di uno dei mods installati.~

@266000 = "Aggiungi talento Arma Preferita per i Ladri [Luke]"

@267000 = "Aggiungi talento Doppia-Presa per i Ranger [Luke]"
@267000 = "Limita la meccanica del Riposo [Luke (EEex)]"

@269000 = "Armatura vs. Destrezza in stile NWN [Luke]"

Expand Down
10 changes: 6 additions & 4 deletions cdtweaks/lib/comp_2670.tpa
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// Dual-wield feat for Rangers \\\\\
///// Limit resting mechanic \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

WITH_SCOPE BEGIN
INCLUDE "cdtweaks\luke\misc.tph"
INCLUDE "cdtweaks\lib\dual_wield.tph"
WITH_TRA "cdtweaks\languages\english\dual_wield.tra" "cdtweaks\languages\%LANGUAGE%\dual_wield.tra" BEGIN
LAF "DUAL_WIELD" END
//
INCLUDE "cdtweaks\lib\limit_resting_mechanic.tph"
//
WITH_TRA "cdtweaks\languages\english\limit_resting_mechanic.tra" "cdtweaks\languages\%LANGUAGE%\limit_resting_mechanic.tra" BEGIN
LAF "LIMIT_RESTING_MECHANIC" END
END
END
6 changes: 6 additions & 0 deletions cdtweaks/lib/limit_resting_mechanic.tph
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DEFINE_ACTION_FUNCTION "LIMIT_RESTING_MECHANIC"
BEGIN
OUTER_SET "feedback_strref" = RESOLVE_STR_REF (@0)
//
LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Misc Tweaks (Rule Changes)" "sourceFileSpec" = "cdtweaks\luke\lua\rule_changes\limit_resting_mechanic.lua" "destRes" = "m_gtrule" END
END
27 changes: 27 additions & 0 deletions cdtweaks/luke/lua/rule_changes/limit_resting_mechanic.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--[[
+------------------------------------------------------------------------------+
| cdtweaks, Limit resting mechanic (at most once every 24 in-game hours) |
+------------------------------------------------------------------------------+
| scripted resting will not be blocked; however, it will still reset the timer |
+------------------------------------------------------------------------------+
--]]

EEex_Action_AddSpriteStartedActionListener(function(sprite, action)
if sprite.m_typeAI.m_EnemyAlly == 2 and action.m_actionID == 96 then -- if [PC] and "Rest()"
sprite:applyEffect({
["effectID"] = 0x141, -- Remove effects by resource (321)
["res"] = "GTRULE01",
["sourceID"] = sprite.m_id,
["sourceTarget"] = sprite.m_id,
})
--
sprite:applyEffect({
["effectID"] = 0x152, -- Disable rest or save (338)
["effectAmount"] = %feedback_strref%,
["duration"] = 7200,
["m_sourceRes"] = "GTRULE01",
["sourceID"] = sprite.m_id,
["sourceTarget"] = sprite.m_id,
})
end
end)
4 changes: 2 additions & 2 deletions cdtweaks/readme-cdtweaks.html
Original file line number Diff line number Diff line change
Expand Up @@ -1008,9 +1008,9 @@ <h3> <a id="contents_rules" name="contents_rules"></a>Rule Changes </h3>
<p> This component aims at implementing 3E Weapon Finesse feat for Thieves.</p>
<p> As a result, after installing it, every time a Thief is wielding a small blade (f.i. daggers, short swords, wakizashis, etc...) or a club/mace, his/her THAC0 will scale with Dexterity (as per the <code>MISSILE</code> column of <a href="https://gibberlings3.github.io/iesdp/files/2da/2da_bgee/dexmod.htm"><code>dexmod.2da</code></a>) instead of Strength.</p>
<p> As a completely artificial example, suppose a Thief has 9 Strength and 18 Dexterity. Upon equipping a dagger, he/she will gain a THAC0 bonus of <code>2</code> (instead of <code>0</code>). Note that nothing happens if the bonus from Strength is better (or equal) than the bonus from Dexterity. </p>
<p> <strong>Dual-Wield feat for Rangers [Luke]</strong><br />
<p> <strong>Limit Resting Mechanic [Luke]</strong><br />
<em><abbr title="Enhanced Edition">EEex</abbr></em></p>
<p> This component simply forces Rangers to wield light armors (or no armor) in order to benefit from Two-Weapon Fighting.</p>
<p> This component simply forces the Party to rest at most once per 24 in-game hours (does not prevent scripted resting).</p>
<p> <strong>NWN-ish Armor vs. Dexterity [Luke]</strong><br />
<em><abbr title="Enhanced Edition">EEex</abbr></em></p>
<p> This component simply &quot;forces&quot; characters to wield light armors (or no armor) if they have high Dexterity.
Expand Down
7 changes: 4 additions & 3 deletions cdtweaks/setup-cdtweaks.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -2825,16 +2825,17 @@ LABEL ~cd_tweaks_weapon_finesse~
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// Dual-Wield feat for Rangers \\\\\
///// Limit resting mechanic \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

BEGIN @267000 DESIGNATED 2670
GROUP @9
REQUIRE_PREDICATE GAME_IS "bgee bg2ee eet iwdee" @25
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ 0 @29
REQUIRE_PREDICATE FILE_EXISTS ~cdtweaks/languages/%LANGUAGE%/dual_wield.tra~ @7
LABEL ~cd_tweaks_dual_wield~
REQUIRE_PREDICATE FILE_EXISTS ~cdtweaks/languages/%LANGUAGE%/limit_resting_mechanic.tra~ @7
LABEL ~cd_tweaks_limit_resting_mechanic~

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
Expand Down