Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add delay to Unconsciousness Captivity #3124

Merged
merged 5 commits into from
Feb 25, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions addons/medical/ACE_Settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,10 @@ class ACE_Settings {
values[] = {CSTRING(useSelection), CSTRING(useRadial), "Disabled"};
isClientSettable = 1;
};

class GVAR(delayUnconCaptive) {
displayName = CSTRING(delayUnconCaptive);
typeName = "SCALAR";
value = 10;
};
};
7 changes: 7 additions & 0 deletions addons/medical/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ class CfgVehicles {
typeName = "BOOL";
defaultValue = 1;
};

class delayUnconCaptive {
displayName = CSTRING(MedicalSettings_delayUnconCaptive_DisplayName);
description = CSTRING(MedicalSettings_delayUnconCaptive_Description);
typeName = "NUMBER";
defaultValue = 10;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ;

};

class ModuleDescription {
Expand Down
1 change: 1 addition & 0 deletions addons/medical/functions/fnc_moduleMedicalSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ if !(_activated) exitWith {};
[_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(painCoefficient), "painCoefficient"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(keepLocalSettingsSynced), "keepLocalSettingsSynced"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(delayUnconCaptive), "delayUnconCaptive"] call EFUNC(common,readSettingFromModule);
13 changes: 12 additions & 1 deletion addons/medical/functions/fnc_setUnconscious.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,19 @@ _unit setUnitPos "DOWN";
if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
[_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide);
};
// Delay Unconscious so the AI dont instant stop shooting on the unit #3121
if (GVAR(delayUnconCaptive) == 0) then {
[_unit, QGVAR(unconscious), true] call EFUNC(common,setCaptivityStatus);
} else {
[{
params ["_unit"];
if (_unit getVariable ["ACE_isUnconscious", false]) then {
[_unit, QGVAR(unconscious), true] call EFUNC(common,setCaptivityStatus);
};
},[_unit], GVAR(delayUnconCaptive)] call EFUNC(common,waitAndExecute);
};


[_unit, QGVAR(unconscious), true] call EFUNC(common,setCaptivityStatus);
_anim = [_unit] call EFUNC(common,getDeathAnim);
[_unit, _anim, 1, true] call EFUNC(common,doAnimation);
[{
Expand Down
11 changes: 10 additions & 1 deletion addons/medical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3880,5 +3880,14 @@
<Portuguese>Não existe nenhum torniquete nesta parte do corpo!</Portuguese>
<Czech>Žádné škrtidlo na této části těla!</Czech>
</Key>
<Key ID="STR_ACE_Medical_delayUnconCaptive">
<English>Todo</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_delayUnconCaptive_Description">
<English>Todo</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_delayUnconCaptive_DisplayName">
<English>Todo</English>
</Key>
</Package>
</Project>
</Project>