diff --git a/gamedata/configs/text/eng/ui_st_body_health_system.xml b/gamedata/configs/text/eng/ui_st_body_health_system.xml index 6cf6351..7021238 100644 --- a/gamedata/configs/text/eng/ui_st_body_health_system.xml +++ b/gamedata/configs/text/eng/ui_st_body_health_system.xml @@ -273,4 +273,11 @@ 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 + + Chance to receive damage while sprinting + + + Damages the actor while sprinting with broken legs + + \ No newline at end of file diff --git a/gamedata/configs/text/rus/ui_st_body_health_system.xml b/gamedata/configs/text/rus/ui_st_body_health_system.xml index 7f1a952..e634b3c 100644 --- a/gamedata/configs/text/rus/ui_st_body_health_system.xml +++ b/gamedata/configs/text/rus/ui_st_body_health_system.xml @@ -275,5 +275,11 @@ Эта опция позволяет безопасно удалить аддон.\n1) Включите опцию\n2) Загрузите игру, если вы этого еще не сделали\n3) Убедитесь, что все предметы были удалены\n4) Сохранитесь, выйдите и отключите аддон + + Шанс получить урон при беге + + + Наносит урон персонажу при беге со сломанными ногами + \ No newline at end of file diff --git a/gamedata/scripts/zzz_player_injuries.script b/gamedata/scripts/zzz_player_injuries.script index c538476..4b04633 100644 --- a/gamedata/scripts/zzz_player_injuries.script +++ b/gamedata/scripts/zzz_player_injuries.script @@ -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 @@ -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) @@ -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 + + file_to_say = sound_object( file ) + file_to_say:play(db.actor,0,sound_object.s2d) +end ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ diff --git a/gamedata/scripts/zzz_player_injuries_mcm.script b/gamedata/scripts/zzz_player_injuries_mcm.script index 7c4a774..7bf6aa5 100644 --- a/gamedata/scripts/zzz_player_injuries_mcm.script +++ b/gamedata/scripts/zzz_player_injuries_mcm.script @@ -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) @@ -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"},