Fire - Add drop weapon setting (#8578)

* Fix casing of stringtable keys

* Use CBA_fnc_addSetting

* Move burn reactions to function, add setting for weapon throwing

* Fix stringtable keys in settings

* Use stringtable entries from common component

* Update addons/fire/stringtable.xml

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>

* Update addons/fire/stringtable.xml

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
This commit is contained in:
Filip Maciejewski 2021-10-26 14:09:45 +02:00 committed by GitHub
parent 5468f180f0
commit 08dff76593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 47 deletions

View File

@ -1440,6 +1440,10 @@
<Chinese>只限玩家</Chinese>
<Turkish>Sadece oyuncular</Turkish>
</Key>
<Key ID="STR_ACE_Common_aiOnly">
<English>AI only</English>
<Polish>Tylko dla AI</Polish>
</Key>
<Key ID="STR_ACE_Common_playersAndAI">
<English>Players and AI</English>
<Russian>Игроков и ботов</Russian>

View File

@ -2,6 +2,7 @@ PREP(burn);
PREP(isBurning);
PREP(isPlant);
PREP(burnIndicator);
PREP(burnReaction);
PREP(fireManagerPFH);
PREP(medical_progress);

View File

@ -228,13 +228,7 @@ if (_isBurning) exitWith {};
};
};
if ((_unit isEqualTo vehicle _unit) && { !(currentWeapon _unit isEqualTo "") }) then {
[_unit] call EFUNC(hitreactions,throwWeapon);
};
private _soundID = floor (1 + random 15);
private _sound = format [QGVAR(scream_%1), _soundID];
[QGVAR(playScream), [_sound, _unit]] call CBA_fnc_globalEvent;
[_unit] call FUNC(burnReaction);
};
// Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/

View File

@ -0,0 +1,27 @@
#include "script_component.hpp"
/*
* Author: Brandon (TCVM), veteran29
* Handles burning reactions of an unit, like screaming or throwing the weapons away due to pain.
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
params ["_unit"];
if (
GVAR(dropWeapon) > 0
&& {_unit in _unit && { !(currentWeapon _unit isEqualTo "") }}
&& {!isPlayer _unit || GVAR(dropWeapon >= 2)}
) then {
[_unit] call EFUNC(hitreactions,throwWeapon);
};
private _soundID = floor (1 + random 15);
private _sound = format [QGVAR(scream_%1), _soundID];
[QGVAR(playScream), [_sound, _unit]] call CBA_fnc_globalEvent;

View File

@ -1,19 +1,31 @@
[
QGVAR(enabled), "CHECKBOX",
["STR_A3_OPTIONS_ENABLED", LSTRING(setting_description)],
LSTRING(category_displayName),
["STR_A3_OPTIONS_ENABLED", LSTRING(Setting_Description)],
LSTRING(Category_DisplayName),
true, // default value
true, // isGlobal
{[QGVAR(fireEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)},
true // Needs mission restart
] call CBA_settings_fnc_init;
] call CBA_fnc_addSetting;
[
QGVAR(enableFlare), "CHECKBOX",
[LSTRING(setting_flareEnable), LSTRING(setting_flareDescription)],
LSTRING(category_displayName),
[LSTRING(Setting_FlareEnable), LSTRING(Setting_FlareDescription)],
LSTRING(Category_DisplayName),
false, // default value
true, // isGlobal
{[QGVAR(flareEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)},
true // Needs mission restart
] call CBA_settings_fnc_init;
] call CBA_fnc_addSetting;
[
QGVAR(dropWeapon), "LIST",
[LSTRING(Setting_DropWeapon), LSTRING(Setting_DropWeapon_Description)],
LSTRING(Category_DisplayName),
[
[0,1,2],
[localize "STR_A3_OPTIONS_DISABLED", ELSTRING(common,aiOnly), ELSTRING(common,playersAndAI)],
1
],
true // isGlobal
] call CBA_fnc_addSetting;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Fire">
<Key ID="STR_ACE_Fire_category_displayName">
<Key ID="STR_ACE_Fire_Category_DisplayName">
<English>ACE Fire</English>
<Japanese>ACE 火災</Japanese>
<French>ACE Feu</French>
@ -22,26 +22,34 @@
<Russian>Тушение</Russian>
<Polish>Gaszenie ognia</Polish>
</Key>
<Key ID="STR_ACE_Fire_setting_description">
<Key ID="STR_ACE_Fire_Setting_Description">
<English>Allow units to catch fire</English>
<Japanese>ユニットへ着火を許可</Japanese>
<French>Définit si les unités peuvent prendre feu ou non.</French>
<Russian>Включает возгорание</Russian>
<Polish>Zezwól jednostkom na zapalenie się</Polish>
</Key>
<Key ID="STR_ACE_Fire_setting_flareEnable">
<Key ID="STR_ACE_Fire_Setting_FlareEnable">
<English>Enable fire-flare at night</English>
<Japanese>夜間にフレア効果を有効化</Japanese>
<French>Halo lumineux la nuit</French>
<Russian>Включает сверкание пламени</Russian>
<Polish>Włącza efekt flary od ognia w nocy</Polish>
</Key>
<Key ID="STR_ACE_Fire_setting_flareDescription">
<Key ID="STR_ACE_Fire_Setting_FlareDescription">
<English>Uses a flare effect to increase fire intensity at night</English>
<Japanese>夜間に火災の強さを上昇させるフレア効果を有効化します。</Japanese>
<French>Ajoute un effet de halo lumineux afin d'accroitre l'intensité du feu durant la nuit.</French>
<Russian>Включает ореол пламени для большей интенсивности ночью</Russian>
<Polish>Używa efektu flary, aby zwiększyć jasność w nocy</Polish>
</Key>
<Key ID="STR_ACE_Fire_Setting_DropWeapon">
<English>Drop Weapons When on Fire</English>
<Polish>Włącz wyrzucanie broni podczas płonięcia</Polish>
</Key>
<Key ID="STR_ACE_Fire_Setting_DropWeapon_Description">
<English>Controls whether units drop their weapons when on fire.</English>
<Polish>Powoduje że jednostki wyrzucają swoją broń gdy płoną.</Polish>
</Key>
</Package>
</Project>