mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
WIP Selectable high thirst/hunger consequence
This commit is contained in:
parent
831bf92ca1
commit
389defeac1
@ -27,15 +27,25 @@ if ((_thirst > 99.9 || {_hunger > 99.9}) && {random 1 < 0.5}) exitWith {
|
||||
// Exit if unit is not awake, below are animation based consequences
|
||||
if !(_player call EFUNC(common,isAwake)) exitWith {};
|
||||
|
||||
// Set unit unconscious with 45s cooldown (chance based on how high thirst/hunger are)
|
||||
// Trigger high thirst/hunger consequence
|
||||
if (
|
||||
GETEGVAR(medical,enabled,false) &&
|
||||
{(CBA_missionTime - XGVAR(lastUnconEvent)) > 45} &&
|
||||
{(_thirst > 85 || {_hunger > 85}) && {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}}
|
||||
{(_thirst > 85 || {_hunger > 85})}
|
||||
) exitWith {
|
||||
if (XGVAR(nearDepletedConsequence) == 1) then { // Set unit unconscious with a 45s cooldown
|
||||
if (
|
||||
(CBA_missionTime - XGVAR(lastUnconEvent)) > 45 &&
|
||||
{random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}
|
||||
) then {
|
||||
[_player, true, 5, true] call EFUNC(medical,setUnconscious);
|
||||
XGVAR(lastUnconEvent) = CBA_missionTime;
|
||||
};
|
||||
} else { // Add pain
|
||||
if (ACE_Player getVariable [QEGVAR(medical,pain), 0] < 0.1) then {
|
||||
[ACE_Player, 0.1] call ace_medical_fnc_adjustPainLevel;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// Make unit fall if moving fast
|
||||
if ((_thirst > 93 || {_hunger > 93}) && {speed _player > 1} && {isNull objectParent _player}) exitWith {
|
||||
|
@ -45,6 +45,15 @@
|
||||
true
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[
|
||||
QXGVAR(nearDepletedConsequence),
|
||||
"LIST",
|
||||
[LSTRING(NearDepletedConsequence_DisplayName), LSTRING(NearDepletedConsequence_Description)],
|
||||
LSTRING(DisplayName),
|
||||
[[0, 1], [LSTRING(NearDepletedConsequence_Pain), LSTRING(NearDepletedConsequence_Unconsciousness)], 1],
|
||||
true
|
||||
] call CBA_fnc_addSetting;
|
||||
|
||||
[
|
||||
QXGVAR(waterSourceActions),
|
||||
"LIST",
|
||||
|
@ -115,6 +115,21 @@
|
||||
<Spanish>Tiempo sin agua</Spanish>
|
||||
<Turkish>Susuz Kalma Süresi</Turkish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Field_Rations_NearDepletedConsequence_DisplayName">
|
||||
<English>Consequence of extreme thirst/hunger</English>
|
||||
<German>Folge von extremen Durst/Hunger</German>
|
||||
<Italian>Conseguenze di sete/fame estrema</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Field_Rations_NearDepletedConsequence_Pain">
|
||||
<English>Pain</English>
|
||||
<German>Schmerzen</German>
|
||||
<Italian>Dolore</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Field_Rations_NearDepletedConsequence_Unconsciousness">
|
||||
<English>Fainting</English>
|
||||
<German>Ohnmacht</German>
|
||||
<Italian>Svenimenti</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Field_Rations_TimeWithoutWater_Description">
|
||||
<English>How long should a person be able to go without water (hours).</English>
|
||||
<Chinese>一個單位脫水之前能支撐多久(單位為小時)。</Chinese>
|
||||
|
Loading…
Reference in New Issue
Block a user