Skip to content

Commit

Permalink
New component: Limit resting mechanic
Browse files Browse the repository at this point in the history
#117

manual addition
  • Loading branch information
CamDawg committed Jan 10, 2025
1 parent 4282e1c commit 5300f10
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 99 deletions.
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: 2 additions & 0 deletions cdtweaks/languages/english/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ The uninstall messages above are normal and expected.

@266000 = "Make Bears and Boars continue fighting after reaching 0 hit points [Luke (EEex)]"

@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: 2 additions & 0 deletions cdtweaks/languages/italian/weidu.tra
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ o rimpiazzata da - un'altra facente parte di uno dei mods installati.~

@266000 = "Gli Orsi e i Cinghiali continueranno a combattere dopo aver raggiunto 0 punti ferita [Luke (EEex)]"

@267000 = "Limita la meccanica del Riposo [Luke (EEex)]"

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
Expand Down
17 changes: 17 additions & 0 deletions cdtweaks/lib/comp_2670.tpa
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// Limit resting mechanic \\\\\
///// \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

WITH_SCOPE BEGIN
INCLUDE "cdtweaks\luke\misc.tph"
//
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)
202 changes: 103 additions & 99 deletions cdtweaks/readme-cdtweaks.html

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions cdtweaks/setup-cdtweaks.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,21 @@ REQUIRE_PREDICATE GAME_IS ~bgee bg2ee eet iwdee~ @25
REQUIRE_PREDICATE MOD_IS_INSTALLED ~EEex.tp2~ 0 @29
LABEL ~cd_tweaks_bears_and_boars~

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
///// \\\\\
///// 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%/limit_resting_mechanic.tra~ @7
LABEL ~cd_tweaks_limit_resting_mechanic~

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

0 comments on commit 5300f10

Please sign in to comment.