Skip to content
Open
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
7 changes: 7 additions & 0 deletions gamedata/configs/text/eng/ui_st_body_health_system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,11 @@
<text>This option makes it possible to safely uninstall the addon.\n1) Enable it\n2) Load a game if you haven't already\n3) Make sure all items were removed\n4) Make a save, exit and disable the addon</text>
</string>

<string id="ui_mcm_body_health_system_chance_damage_on_footstep">
<text>Chance to receive damage while sprinting</text>
</string>
<string id="ui_mcm_body_health_system_chance_damage_on_footstep_desc">
<text>Damages the actor while sprinting with broken legs</text>
</string>

</string_table>
6 changes: 6 additions & 0 deletions gamedata/configs/text/rus/ui_st_body_health_system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,11 @@
<text>��� ����� ��������� ��������� ������� �����.\n1) �������� �����\n2) ��������� ����, ���� �� ����� ��� �� �������\n3) ���������, ��� ��� �������� ���� �������\n4) �����������, ������� � ��������� �����</text>
</string>

<string id="ui_mcm_body_health_system_chance_damage_on_footstep">
<text>���� �������� ���� ��� ����</text>
</string>
<string id="ui_mcm_body_health_system_chance_damage_on_footstep_desc">
<text>������� ���� ��������� ��� ���� �� ���������� ������</text>
</string>

</string_table>
39 changes: 22 additions & 17 deletions gamedata/scripts/zzz_player_injuries.script
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ local cms_restores_hp_too = zzz_player_injuries_mcm.get_config("CMS_RESTORES_HP_
bhs_exp_mode = zzz_player_injuries_mcm.get_config("BHS_EXPERIMENTAL_MODE")
local bhs_bleed = zzz_player_injuries_mcm.get_config("BHS_BLEEDTHROUGH")
local fall_mult = zzz_player_injuries_mcm.get_config("FALL_MULT")
local chance_damage_on_footstep = zzz_player_injuries_mcm.get_config("chance_damage_on_footstep")

local regen=0 -- Don't change that. Use mcm instead. Automatic blue health regeneration on each limb. Setting it to 90000 would mean each 90 seconds 1 health point restores
if natural_regeneration then
Expand Down Expand Up @@ -1696,23 +1697,9 @@ local function actor_on_footstep(material,power,hud_view,flags)

-- printf("hit_power: " .. (hit_power))
local file
local chance = math.random(1,100)
if (hit_power > 0) and (state_cooldown < time_global()) and (chance<=35) then
if zzz_player_injuries_mcm.get_config("new_voice_sounds") then
local helmet = (db.actor:item_in_slot(12) or db.actor:get_current_outfit())
local sound_play = math.random(1,13)
if helmet then
muffle = ""
else
muffle = ""
end
file = "bhs\\" .. muffle .. "pain_" .. sound_play
else
file = "actor\\pain_" .. sound_play
end

file_to_say = sound_object( file )
file_to_say:play(db.actor,0,sound_object.s2d)
local chance_to_damage = math.random(1,100)
if (hit_power > 0) and (state_cooldown < time_global()) and (chance_to_damage <= chance_damage_on_footstep) then
play_actor_on_footstep_voice_over()

level.add_pp_effector("blur_bhs.ppe", math.random(655808, 655820), false)

Expand All @@ -1730,6 +1717,24 @@ local function actor_on_footstep(material,power,hud_view,flags)


end

function play_actor_on_footstep_voice_over()
local sound_play = math.random(1,13)
if zzz_player_injuries_mcm.get_config("new_voice_sounds") then
local helmet = (db.actor:item_in_slot(12) or db.actor:get_current_outfit())
if helmet then
muffle = ""
else
muffle = ""
end
file = "bhs\\" .. muffle .. "pain_" .. sound_play
else
file = "actor\\pain_" .. sound_play
end
Comment thread
coderabbitai[bot] marked this conversation as resolved.

file_to_say = sound_object( file )
file_to_say:play(db.actor,0,sound_object.s2d)
end
------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------

Expand Down
4 changes: 3 additions & 1 deletion gamedata/scripts/zzz_player_injuries_mcm.script
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ local defaults = {
["DAMAGE_MULT"] = 3.5,
["FALL_MULT"] = 2.0,
["BHS_EXPERIMENTAL_MODE"] = false,
["BHS_BLEEDTHROUGH"] = true
["BHS_BLEEDTHROUGH"] = true,
["chance_damage_on_footstep"] = 35
}

function get_config(key)
Expand All @@ -59,6 +60,7 @@ function on_mcm_load()
{id = "arm_animation_power", type = "track", val = 2, min=0.1,max=2,step=0.1, def = 1},
{id = "head_penalty_minimum_hp", type = "track", val = 2, min=1,max=20,step=1, def = 12},
{id = "head_animation_power", type = "track", val = 2, min=0.1,max=2,step=0.1, def = 1},
{id = "chance_damage_on_footstep", type = "track", val = 2, min=1,max=100,step=1, def = 35},
{id = "divider", type = "line"},
{id = "NEW_OPTIONS", type = "desc", clr = {200, 200, 255, 200}, text = "ui_mcm_body_health_system_NEW_OPTIONS"},
{id = "divider", type = "line"},
Expand Down