Skip to content

Commit

Permalink
Heal by travel & rest nerfed
Browse files Browse the repository at this point in the history
- Heal on rest - 6 hours (matches in-game description of Healing Rate)
- Heal on worldmap - 24 hours (in game it says "1 HP at the end of the day", this is good enough approximation)
  • Loading branch information
phobos2077 committed May 25, 2024
1 parent 07c6462 commit d3be4f0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
18 changes: 14 additions & 4 deletions root/mods/ecco/misc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ heal_mult_max=2.0
skill_max=150


[HEALING]
[HEALING_SKILLS]
; 1 to enable healing skill use modifications (including skill boost items), 0 to disable
skill_use_mod=1

Expand All @@ -56,15 +56,25 @@ skill_uses_per_day=4
; HP amount multiplier on critical success rolls
crit_success_mult=2.0

; First Aid skill Default: 1,5
; First Aid HP restore range. Default: 1,5
first_aid_hp=5,10

; Default: 4,10
; Doctor/Repair skill HP restore range. Default: 4,10
doctor_hp=10,20
; Default: 4,10

; Healer perk HP restore bonus range. Default: 4,10
healer_perk_hp=5,10


[HEALING_REST]
; Rest heal interval, in game minutes. Default is 180 (3h, in-game description of Healing Rate says 6, but it's lying).
heal_time_rest=360
; Worldmap heal interval, in game minutes. In vanilla it heals once per real time second and doesn't use game time.
; Set to 0 for vanilla behavior.
; Set to -1 to disable healing
heal_time_travel=1440


[CAR_TRAVEL]
; 1 to enable or 0 to disable all car tweaks
enable_tweaks=1
Expand Down
21 changes: 17 additions & 4 deletions scripts_src/_pbs_main/gl_pbs_healing_skills.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#include "../_pbs_headers/ecco_log.h"
#include "../_pbs_headers/ecco_msg.h"

#define INI_FILE INI_MISC
#define INI_SECTION "HEALING"

#define COMBAT_STATE_FLEEING (4)

#define obj_is_critter(obj) (obj_type(obj) == OBJ_TYPE_CRITTER)
Expand Down Expand Up @@ -443,6 +440,20 @@ end
#define _varstr(var) ("; "#var" = " + ini_##var)
#define _rngstr(var) ("; "#var" = " + debug_array_str(ini_##var))

#define INI_FILE INI_MISC
#define INI_SECTION "HEALING_SKILLS"
#define INI_SECTION_REST "HEALING_REST"

procedure apply_rest_heal_time_tweaks begin
variable
healRest := get_ini_value_def(INI_FILE, INI_SECTION_REST, "heal_time_rest", 180),
healTravel := get_ini_value_def(INI_FILE, INI_SECTION_REST, "heal_time_travel", 0);

set_rest_heal_time(healRest);
set_worldmap_heal_time(healTravel);
debug_log_fmt("Passive healing times set: rest = %d, worldmap = %d", healRest, healTravel);
end

procedure start begin
if (game_loaded) then begin
if (get_int_from_ini(INI_FILE, INI_SECTION, "skill_use_mod") <= 0) then return;
Expand All @@ -461,6 +472,8 @@ procedure start begin
register_hook_proc(HOOK_USESKILL, useskill_hook);
register_hook_proc(HOOK_DESCRIPTIONOBJ, descriptionobj_hook);

//set_rest_heal_time(1);
debug_log("Healing Skill mod enabled.");

call apply_rest_heal_time_tweaks;
end
end

0 comments on commit d3be4f0

Please sign in to comment.