Skip to content

Commit

Permalink
Medical - Add fracture chance setting (#7396)
Browse files Browse the repository at this point in the history
  • Loading branch information
mharis001 authored Feb 22, 2020
1 parent 1a2487d commit a7bd05d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 130 deletions.
2 changes: 1 addition & 1 deletion addons/main/script_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 1.96
#define REQUIRED_CBA_VERSION {3,12,2}
#define REQUIRED_CBA_VERSION {3,14,0}

#ifdef COMPONENT_BEAUTIFIED
#define COMPONENT_NAME QUOTE(ACE3 - COMPONENT_BEAUTIFIED)
Expand Down
13 changes: 11 additions & 2 deletions addons/medical/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
LSTRING(Category),
[[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(Limping_LimpOnOpenWounds), LSTRING(Limping_LimpRequiresStitching)], 1],
true,
{[QGVAR(limping), _this] call EFUNC(common,cbaSettings_settingChanged)},
{},
true
] call CBA_settings_fnc_init;

Expand All @@ -16,7 +16,16 @@
LSTRING(Category),
[[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(Fractures_SplintHealsFully), LSTRING(Fractures_SplintHasEffects)], 1],
true,
{[QGVAR(fractures), _this] call EFUNC(common,cbaSettings_settingChanged)},
{},
true
] call CBA_settings_fnc_init;

[
QGVAR(fractureChance),
"SLIDER",
[LSTRING(FractureChance_DisplayName), LSTRING(FractureChance_Description)],
LSTRING(Category),
[0, 1, 0.8, 2, true],
true
] call CBA_settings_fnc_init;

Expand Down
128 changes: 5 additions & 123 deletions addons/medical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<Spanish>Posibilidad de recuperar la conciencia</Spanish>
</Key>
<Key ID="STR_ACE_Medical_SpontaneousWakeUpChance_Description">
<English>The probablity that a unit with stable vitals will wake up from unconsciousness (checked every 15 seconds).</English>
<English>The probability that a person with stable vitals will wake up from unconsciousness (checked every 15 seconds).</English>
<German>Wahrscheinlichkeit, dass eine bewusstlose Person mit stabilen Vitalwerten wieder aufwacht (Überprüfung alle 15 Sekunden)</German>
<Japanese>容体が安定しているユニットが気絶する確率を決定できます。(15 秒毎に確認)</Japanese>
<Russian>Вероятность, что стабилизированный юнит очнется от потери сознания (Проверяется каждые 15 сек)</Russian>
Expand Down Expand Up @@ -163,85 +163,11 @@
<Spanish>Las férulas sanan, pero no pueden correr</Spanish>
<German>Schienen heilen, aber ermöglichen kein Sprinten</German>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_remoteControlledAI_DisplayName">
<English>Remote Controlled AI</English>
<German>Ferngesteuerte KI-Einheiten</German>
<Spanish>IA controlada remotamente</Spanish>
<Portuguese>IA controlada remotamente</Portuguese>
<Polish>Zdalnie sterowane AI</Polish>
<Czech>Vzdáleně ovládané AI</Czech>
<French>IA contrôlées à distance</French>
<Hungarian>Távvezérelt AI</Hungarian>
<Russian>Зевса считать ботом</Russian>
<Italian>IA Controllate in Remoto</Italian>
<Japanese>遠隔操作された AI</Japanese>
<Korean>인공지능 원격조종</Korean>
<Chinesesimp>遥控AI</Chinesesimp>
<Chinese>遙控AI</Chinese>
<Key ID="STR_ACE_Medical_FractureChance_DisplayName">
<English>Fracture Chance</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_remoteControlledAI_Description">
<English>Treat remote controlled units as AI not players?</English>
<German>Legt fest, ob ferngesteuerte Einheiten als KI anstatt als Spieler behandelt werden sollen.</German>
<Spanish>¿Tratar unidades remotamente controladas como IA?</Spanish>
<Portuguese>Tratar unidades remotamente controladas como IA?</Portuguese>
<Polish>Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy?</Polish>
<Czech>Ošetřit vzdáleně ovládané jednotky jako AI, ne jako hráče?</Czech>
<French>Définit si les unités contrôlées à distance sont traitées comme des IA, et non comme des joueurs.</French>
<Hungarian>Távvezérelt egységek AI-ként, nem játékosként való kezelése?</Hungarian>
<Russian>Обрабатывать дистанционно управляемых юнитов как ботов, а не как игроков?</Russian>
<Italian>Considera le unità controllate in remoto come IA e non come giocatori?</Italian>
<Japanese>遠隔操作された AI を非プレイヤーとして扱いますか?</Japanese>
<Korean>원격 조작하는 AI는 비 플레이어로 취급합니까?</Korean>
<Chinesesimp>以医疗AI的方式医疗被遥控的单位</Chinesesimp>
<Chinese>以醫療AI的方式醫療被遙控的單位</Chinese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_preventInstaDeath_DisplayName">
<English>Prevent instant death</English>
<Russian>Откл. мгновенную смерть</Russian>
<Polish>Wyłącz natychmiastową śmierć</Polish>
<Spanish>Prevenir muerte instantánea</Spanish>
<German>Verhindere direkten Tod</German>
<Czech>Zabránit okamžité smrti</Czech>
<Portuguese>Previnir morte instantânea</Portuguese>
<French>Empêcher la mort instantanée</French>
<Hungarian>Azonnali halál kiiktatása</Hungarian>
<Italian>Previeni morte istantanea</Italian>
<Japanese>即死の防止</Japanese>
<Korean>즉사 방지</Korean>
<Chinesesimp>防止当场死亡</Chinesesimp>
<Chinese>防止當場死亡</Chinese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_preventInstaDeath_Description">
<English>Have a unit move to unconscious instead of death</English>
<Russian>Бойцы теряют сознание вместо того, чтобы умирать</Russian>
<Polish>Spraw, aby jednostka została przeniesiona do stanu nieprzytomności zamiast ginąć na miejscu od śmiertelnych obrażeń</Polish>
<Spanish>Mover una unidad a inconsciente en vez de a muerta</Spanish>
<German>Lässt eine Einheit bewusstlos werden anstatt zu sterben</German>
<Czech>Jednotka upadne do bezvědomí namísto smrti</Czech>
<Portuguese>Fazer a unidade ficar inconsciente invés de morrer</Portuguese>
<French>Force une unité à perdre connaissance, au lieu de mourir sur le coup.</French>
<Hungarian>Egy egység kerüljön eszméletlen állapotba a halott helyett</Hungarian>
<Italian>Imposta un'unità come incosciente invece di morta</Italian>
<Japanese>ユニットの即死を防止する為に気絶へ移行させます</Japanese>
<Korean>인원의 즉사를 방지코자 즉사 대신 기절시킵니다</Korean>
<Chinesesimp>伤者最严重只会立即进入昏迷,而非立即死亡</Chinesesimp>
<Chinese>傷者最嚴重只會無意識,而非立即死亡</Chinese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_Module_Description">
<English>Provides a medical system for both players and AI.</English>
<Russian>Включает медицинскую систему как для игроков, так и для ботов.</Russian>
<Polish>Moduł ten dostarcza system medyczny dla graczy oraz AI.</Polish>
<Spanish>Proporciona un sistema médico para jugadores e IA.</Spanish>
<German>Aktiviert ein Sanitätssystem für Spieler und KI.</German>
<Czech>Poskytuje zdravotní systém pro hráče a AI.</Czech>
<Portuguese>Proporciona o sistema médico para os jogadores e a IA.</Portuguese>
<French>Fournit un système médical aussi bien pour les joueurs que pour les IA.</French>
<Hungarian>Egy orvosi rendszert ad játékosok és AI-k számára.</Hungarian>
<Italian>Fornisce un sistema medico sia per giocatori che IA.</Italian>
<Japanese>プレイヤーと AI の両方へ医療システムを提供します。</Japanese>
<Korean>의료 시스템을 플레이어 및 인공지능에게 제공합니다.</Korean>
<Chinesesimp>医疗系统将同时对玩家与AI发生作用</Chinesesimp>
<Chinese>醫療系統將同時對玩家與AI發生作用</Chinese>
<Key ID="STR_ACE_Medical_FractureChance_Description">
<English>The probability of a fracture causing wound resulting in a fracture.</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_enableFor_DisplayName">
<English>Enabled for</English>
Expand Down Expand Up @@ -339,50 +265,6 @@
<Chinesesimp>设定人员是否会因为载具冲撞别的物件而产生伤害?</Chinesesimp>
<Chinese>設定人員是否會因為載具衝撞別的物件而產生傷害?</Chinese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_healHitPointAfterAdvBandage_DisplayName">
<English>Heal hitpoints</English>
<German>Heile Trefferpunkte</German>
<Polish>Lecz hitpointy</Polish>
<Spanish>Curar puntos de vida</Spanish>
<Russian>Исцелять части тела</Russian>
<Portuguese>Curar hitpoints</Portuguese>
<Czech>Léčit hitponty</Czech>
<Italian>Cura Hitpoints</Italian>
<French>Guérir les blessures</French>
<Japanese>ヒットポイントの回復</Japanese>
<Korean>체력 회복</Korean>
<Chinesesimp>完整治疗</Chinesesimp>
<Chinese>完整治療</Chinese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_healHitPointAfterAdvBandage_Description">
<English>Heal fully bandaged hitpoints</English>
<German>Heile verbundene Trefferpunkte</German>
<Polish>Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność.</Polish>
<Spanish>Curar miembros totalmente vendados</Spanish>
<Russian>Исцелять полностью перебинтованные части тела</Russian>
<Portuguese>Curar totalmente hitpoints enfaixados</Portuguese>
<Czech>Heal fully bandaged hitpoints</Czech>
<Italian>Cura Hitpoints completamente bendati</Italian>
<French>Les plaies entièrement bandées seront guéries.</French>
<Japanese>包帯によりヒットポイントを完全に回復します。</Japanese>
<Korean>붕대를 감아서 체력을 회복</Korean>
<Chinese>繃帶是否會完整恢復生命值</Chinese>
</Key>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_Module_Description">
<English>Configure the treatment settings from ACE Basic Medical</English>
<German>Behandlungseinstellungen der Standard ACE-Medizin konfigurieren</German>
<Spanish>Configure las opciones de tratamiento del sistema médico básico de ACE</Spanish>
<Polish>Skonfiguruj ustawienia leczenia podstawowego systemu medycznego ACE</Polish>
<French>Configurer les paramètres de traitement à partir de "ACE médical basique".</French>
<Italian>Configura le impostazioni trattamenti per ACE Medical di base</Italian>
<Portuguese>Configura as opções de tratamento do sistema médico básico do ACE</Portuguese>
<Russian>Настройка лечения в базовой медицинской системе ACE</Russian>
<Japanese>ACE ベーシック医療による設定で、治療を設定します。</Japanese>
<Korean>ACE 기본 의료에 대한 치료 설정 수정</Korean>
<Chinesesimp>设定ACE基本医疗的规则</Chinesesimp>
<Chinese>設定ACE基本醫療的規則</Chinese>
<Czech>Nastavit nastavení léčby z ACE Zdravotnické Základní</Czech>
</Key>
<Key ID="STR_ACE_Medical_AnyTime">
<English>Anytime</English>
<German>Jederzeit</German>
Expand Down
21 changes: 17 additions & 4 deletions addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,28 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra
#endif

switch (true) do {
case (_causeFracture && {EGVAR(medical,fractures) > 0} && {_bodyPartNToAdd > 1} && {_woundDamage > FRACTURE_DAMAGE_THRESHOLD}): {
TRACE_1("limb fracture",_bodyPartNToAdd);
case (
_causeFracture
&& {EGVAR(medical,fractures) > 0}
&& {_bodyPartNToAdd > 1}
&& {_woundDamage > FRACTURE_DAMAGE_THRESHOLD}
&& {random 1 < EGVAR(medical,fractureChance)}
): {
private _fractures = GET_FRACTURES(_unit);
_fractures set [_bodyPartNToAdd, 1];
_unit setVariable [VAR_FRACTURES, _fractures, true];
[QEGVAR(medical,fracture), [_unit, _bodyPartNToAdd]] call CBA_fnc_localEvent; // local event for fracture

[QEGVAR(medical,fracture), [_unit, _bodyPartNToAdd]] call CBA_fnc_localEvent;
TRACE_1("Limb fracture",_bodyPartNToAdd);

_updateDamageEffects = true;
};
case (_causeLimping && {EGVAR(medical,limping) > 0} && {_bodyPartNToAdd > 3} && {_woundDamage > LIMPING_DAMAGE_THRESHOLD}): {
case (
_causeLimping
&& {EGVAR(medical,limping) > 0}
&& {_bodyPartNToAdd > 3}
&& {_woundDamage > LIMPING_DAMAGE_THRESHOLD}
): {
_updateDamageEffects = true;
};
};
Expand Down

0 comments on commit a7bd05d

Please sign in to comment.