Merge pull request #2050 from worldwidesorrow/master

Add option to give another player an antibacterial wipe.
This commit is contained in:
worldwidesorrow
2019-12-12 05:15:14 -06:00
committed by GitHub
8 changed files with 54 additions and 13 deletions

View File

@@ -19,7 +19,7 @@ call {
if (_item == "ItemPainkiller") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\painkiller.sqf";}; if (_item == "ItemPainkiller") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\painkiller.sqf";};
if (_item == "ItemAntibiotic") exitWith {[player,"ItemAntibiotic"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";}; if (_item == "ItemAntibiotic") exitWith {[player,"ItemAntibiotic"] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";};
if (_item == "ItemBloodbag") exitWith {[player,"ItemBloodbag"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";}; if (_item == "ItemBloodbag") exitWith {[player,"ItemBloodbag"] execVM "\z\addons\dayz_code\medical\selfbloodbag.sqf";};
if (_item == "ItemAntibacterialWipe") exitWith {execVM "\z\addons\dayz_code\medical\wipes.sqf";}; if (_item == "ItemAntibacterialWipe") exitWith {[0,0,0,[player]] execVM "\z\addons\dayz_code\medical\wipes.sqf";};
if (_item == "ItemHeatPack") exitWith {player removeMagazine "ItemHeatPack"; r_player_warming_heatpack = [true, diag_tickTime]; localize "str_player_27" call dayz_rollingMessages;}; //dayz_temperatur = (dayz_temperatur + 5) min dayz_temperaturmax; if (_item == "ItemHeatPack") exitWith {player removeMagazine "ItemHeatPack"; r_player_warming_heatpack = [true, diag_tickTime]; localize "str_player_27" call dayz_rollingMessages;}; //dayz_temperatur = (dayz_temperatur + 5) min dayz_temperaturmax;
if (_item == "equip_woodensplint") exitWith {[0,0,0,[player,"equip_woodensplint"]] execVM "\z\addons\dayz_code\medical\brokeBones.sqf";}; if (_item == "equip_woodensplint") exitWith {[0,0,0,[player,"equip_woodensplint"]] execVM "\z\addons\dayz_code\medical\brokeBones.sqf";};
if (_item == "ItemSepsisBandage") exitWith {[0,0,0,[player,"ItemSepsisBandage"]] execVM "\z\addons\dayz_code\medical\bandage.sqf";}; if (_item == "ItemSepsisBandage") exitWith {[0,0,0,[player,"ItemSepsisBandage"]] execVM "\z\addons\dayz_code\medical\bandage.sqf";};

View File

@@ -8,7 +8,7 @@ scriptName "Functions\misc\fn_damageActions.sqf";
- [] call fnc_usec_damageActions; - [] call fnc_usec_damageActions;
************************************************************/ ************************************************************/
private ["_dragged","_menClose","_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasAntibiotics","_hasBloodBag","_vehClose","_action1","_action2","_action3","_playerMagazines","_isFriendly"]; private ["_hasABWipes","_dragged","_menClose","_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasAntibiotics","_hasBloodBag","_vehClose","_action1","_action2","_action3","_playerMagazines","_isFriendly"];
_menClose = cursorTarget; _menClose = cursorTarget;
_hasPatient = alive _menClose; _hasPatient = alive _menClose;
@@ -141,6 +141,7 @@ if (isPlayer cursorTarget) then {
_hasSplint = "equip_woodensplint" in _playerMagazines; _hasSplint = "equip_woodensplint" in _playerMagazines;
_hasPainkillers = "ItemPainkiller" in _playerMagazines; _hasPainkillers = "ItemPainkiller" in _playerMagazines;
_hasAntibiotics = Array_Any(_playerMagazines, {_this in _antibiotics}); _hasAntibiotics = Array_Any(_playerMagazines, {_this in _antibiotics});
_hasABWipes = "ItemAntibacterialWipe" in _playerMagazines;
if (dayz_classicBloodBagSystem) then { if (dayz_classicBloodBagSystem) then {
_hasBloodBag = "ItemBloodbag" in _playerMagazines; _hasBloodBag = "ItemBloodbag" in _playerMagazines;
} else { } else {
@@ -177,12 +178,18 @@ if (isPlayer cursorTarget) then {
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true]; _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true];
r_player_actions set [count r_player_actions,_action]; r_player_actions set [count r_player_actions,_action];
}; };
//Sepsis //Allow player to give sepsis bandage
if((_injured || {_hasSepsis}) && {_hasSepsisBandage}) then { if((_injured || {_hasSepsis}) && {_hasSepsisBandage}) then {
r_action = true; r_action = true;
_action = _unit addAction [localize "str_actions_medical_04_sepsis", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true]; _action = _unit addAction [localize "str_actions_medical_04_sepsis", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true];
r_player_actions set [count r_player_actions,_action]; r_player_actions set [count r_player_actions,_action];
}; };
//Allow player to give antibacterial wipe
if(_hasSepsis && {_hasABWipes}) then {
r_action = true;
_action = _unit addAction [format[localize "str_actions_medical_08a",localize "STR_ITEM_DESC_WIPES"], "\z\addons\dayz_code\medical\wipes.sqf",[_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Epinephrine //Allow player to give Epinephrine
if(_unconscious && {_hasEpi}) then { if(_unconscious && {_hasEpi}) then {
r_action = true; r_action = true;
@@ -217,7 +224,7 @@ if (isPlayer cursorTarget) then {
} else { } else {
_tempArray = []; _tempArray = [];
{ // This was a TODO by the Vanilla Mod devs. { // This was a TODO by the Vanilla Mod devs.
if (_x in magazines player && {!(_x in _tempArray)}) then { if (_x in _playerMagazines && {!(_x in _tempArray)}) then {
_displayName = getText(configFile >> "cfgMagazines" >> _x >> "displayName"); _displayName = getText(configFile >> "cfgMagazines" >> _x >> "displayName");
_action = _unit addAction [format[localize "str_actions_medical_08a",_displayName], "\z\addons\dayz_code\medical\transfusion.sqf",[_unit,_x], 0, true, true]; _action = _unit addAction [format[localize "str_actions_medical_08a",_displayName], "\z\addons\dayz_code\medical\transfusion.sqf",[_unit,_x], 0, true, true];
r_player_actions set [count r_player_actions,_action]; r_player_actions set [count r_player_actions,_action];

View File

@@ -79,6 +79,7 @@ if (!isDedicated) then {
player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf"; player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf"; player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
player_medAntiBiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf"; player_medAntiBiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf";
player_medABWipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medABwipe.sqf";
//actions //actions
userActionConditions = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\userActionConditions.sqf"; userActionConditions = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\userActionConditions.sqf";

View File

@@ -255,6 +255,7 @@ if (!isDedicated) then {
"PVCDZ_hlt_Transfuse" addPublicVariableEventHandler {(_this select 1) spawn player_medTransfuse; }; "PVCDZ_hlt_Transfuse" addPublicVariableEventHandler {(_this select 1) spawn player_medTransfuse; };
"PVCDZ_hlt_PainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller}; "PVCDZ_hlt_PainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
"PVCDZ_hlt_AntiB" addPublicVariableEventHandler {(_this select 1) call player_medAntiBiotics}; "PVCDZ_hlt_AntiB" addPublicVariableEventHandler {(_this select 1) call player_medAntiBiotics};
"PVCDZ_hlt_Wipe" addPublicVariableEventHandler {(_this select 1) call player_medABWipe};
"PVCDZ_OpenTarget_Reset" addPublicVariableEventHandler { OpenTarget_Time = diag_tickTime; }; //reset OpenTarget timer "PVCDZ_OpenTarget_Reset" addPublicVariableEventHandler { OpenTarget_Time = diag_tickTime; }; //reset OpenTarget timer
"PVCDZ_plr_Legs" addPublicVariableEventHandler { "PVCDZ_plr_Legs" addPublicVariableEventHandler {

View File

@@ -0,0 +1,12 @@
private ["_unit","_medic"];
_unit = _this select 0;
_medic = _this select 1;
r_player_Sepsis = [false, 0];
_unit setVariable ["USEC_Sepsis", false, true];
_unit setVariable ["sepsisStarted", nil];
if (_medic != player) then {
format [localize "str_actions_medical_general_received",(name _medic),localize "STR_ITEM_DESC_WIPES"] call dayz_rollingMessages;
};

View File

@@ -1,4 +1,6 @@
private "_finished"; private ["_finished","_unit"];
_unit = (_this select 3) select 0;
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true; dayz_actionInProgress = true;
@@ -18,10 +20,23 @@ if (vehicle player == player) then {
}; };
if (_finished) then { if (_finished) then {
r_player_Sepsis = [false, 0]; if (_unit == player) then {
player setVariable ["USEC_Sepsis", false, true]; // Self healing
player setVariable ["sepsisStarted", nil]; r_player_Sepsis = [false, 0];
localize "str_actions_medical_wipe_self" call dayz_rollingMessages; _unit setVariable ["USEC_Sepsis", false, true];
_unit setVariable ["sepsisStarted", nil];
localize "str_actions_medical_wipe_self" call dayz_rollingMessages;
} else {
// Heal another player
PVDZ_send = [_unit,"AntiBacterialWipe",[_unit,player]];
publicVariableServer "PVDZ_send";
// Give humanity
[20,0] call player_humanityChange;
format[localize "str_actions_medical_general_give",localize "STR_ITEM_DESC_WIPES",(name _unit)] call dayz_rollingMessages;
};
} else { } else {
player addMagazine "ItemAntibacterialWipe"; player addMagazine "ItemAntibacterialWipe";
}; };

View File

@@ -6124,12 +6124,12 @@
<German>Desinfektionstücher</German> <German>Desinfektionstücher</German>
</Key> </Key>
<Key ID="STR_ITEM_DESC_WIPES"> <Key ID="STR_ITEM_DESC_WIPES">
<English>Antibacterial Wipe.</English> <English>Antibacterial Wipe</English>
<Russian>Антибактериальные салфетки.</Russian> <Russian>Антибактериальные салфетки</Russian>
<Spanish>Gasa estéril con plata antibacteriana.</Spanish> <Spanish>Gasa estéril con plata antibacteriana</Spanish>
<French>Lingette antibactérienne</French> <French>Lingette antibactérienne</French>
<Czech>Antibakteriální ubrousky</Czech> <Czech>Antibakteriální ubrousky</Czech>
<German>Antibakterielle Desinfektionstücher, mit welchen Wunden gereinigt und desinfiziert werden können.</German> <German>Antibakterielle Desinfektionstücher, mit welchen Wunden gereinigt und desinfiziert werden können</German>
</Key> </Key>
<Key ID="STR_ITEM_NAME_FISHINGPOLE"> <Key ID="STR_ITEM_NAME_FISHINGPOLE">
<English>Fishing Pole</English> <English>Fishing Pole</English>

View File

@@ -108,6 +108,11 @@ call {
_owner publicVariableClient "PVCDZ_hlt_AntiB"; _owner publicVariableClient "PVCDZ_hlt_AntiB";
}; };
if (_variable == "AntiBacterialWipe") exitWith {
PVCDZ_hlt_Wipe = _arraytosend;
_owner publicVariableClient "PVCDZ_hlt_Wipe";
};
if (_variable == "Legs") exitWith { if (_variable == "Legs") exitWith {
PVCDZ_plr_Legs = _arraytosend; PVCDZ_plr_Legs = _arraytosend;
_owner publicVariableClient "PVCDZ_plr_Legs"; _owner publicVariableClient "PVCDZ_plr_Legs";