Medical - Add setting to drop weapon on unconsciousness (#8433)

* added chance of dropping weapon on unconsciousness

* Moved throwWeapon to common

* Fixed spelling error

* wording changes

* typo

* fix usgae in burn reaction

* Update addons/medical_status/stringtable.xml

* Update addons/medical_status/functions/fnc_setUnconsciousState.sqf

* Update addons/medical_status/stringtable.xml

* move condition

* derp

---------

Co-authored-by: BrettMayson <brett@mayson.io>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
This commit is contained in:
Broström.A | Evul 2023-09-09 08:17:24 +02:00 committed by GitHub
parent 81daaba3ea
commit eaea6f29b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 3 deletions

View File

@ -190,6 +190,7 @@ PREP(toBin);
PREP(toBitmask);
PREP(toHex);
PREP(toNumber);
PREP(throwWeapon);
PREP(unhideUnit);
PREP(uniqueElements);
PREP(uniqueItems);

View File

@ -11,7 +11,7 @@
* Weapon Holder
*
* Example:
* player call ace_hitreactions_fnc_throwWeapon
* player call ace_common_fnc_throwWeapon
*
* Public: No
*/

View File

@ -21,7 +21,7 @@ if (
&& {_unit in _unit && {(currentWeapon _unit) isNotEqualTo ""}}
&& {!isPlayer _unit || GVAR(dropWeapon >= 2)}
) then {
[_unit] call EFUNC(hitreactions,throwWeapon);
[_unit] call EFUNC(common,throwWeapon);
};
if (_unit isKindOf "CAManBase") then {

View File

@ -1,4 +1,3 @@
PREP(fallDown);
PREP(getRandomAnimation);
PREP(throwWeapon);

View File

@ -45,6 +45,10 @@ if (_active) then {
while {dialog} do {
closeDialog 0;
};
if (EGVAR(medical,dropWeaponUnconsciousChance) != 0 && {random 1 <= EGVAR(medical,dropWeaponUnconsciousChance)}) then {
_unit call EFUNC(common,throwWeapon);
};
};
// Unlock controls for copilot if unit is pilot of aircraft
if (vehicle _unit isKindOf "Air" && {_unit == driver vehicle _unit}) then {

View File

@ -24,3 +24,12 @@
[0, 25, 1, 1],
true
] call CBA_fnc_addSetting;
[
QEGVAR(medical,dropWeaponUnconsciousChance),
"SLIDER",
[LSTRING(DropWeaponUnconsciousChance_DisplayName), LSTRING(DropWeaponUnconsciousChance_Description)],
ELSTRING(medical,Category),
[0, 1, 0, 2, true],
true
] call CBA_fnc_addSetting;

View File

@ -117,5 +117,11 @@
<Turkish>IV Torbalardan sıvının ne kadar hızlı aktığını kontrol eder. IV Torba hacim değişikliği şu şekilde hesaplanır: zaman aralıkları iv saniye başına değişim (4.1667 mL / s) akış hızı (bu katsayı).</Turkish>
<Korean>수액용기에서 얼마나 빨리 들어가는 지를 정합니다. 초당 4.16ml * 계수를 적용받습니다.</Korean>
</Key>
<Key ID="STR_ACE_Medical_Status_DropWeaponUnconsciousChance_DisplayName">
<English>Weapon Drop Chance</English>
</Key>
<Key ID="STR_ACE_Medical_Status_DropWeaponUnconsciousChance_Description">
<English>Chance for a player to drop their weapon when going unconscious.\nHas no effect on AI.</English>
</Key>
</Package>
</Project>