Update Painkillers and Antibiotics

- Painkillers are in different pill counts available now, same as antibiotics
- the strings of painkillers and antibiotics have the pill count displayed in the name
This commit is contained in:
A Man
2020-04-06 20:03:14 +02:00
parent 9aeceebb6f
commit b4b8860cf0
12 changed files with 456 additions and 104 deletions

View File

@@ -1,27 +1,46 @@
private "_unit";
private ["_unit","_medsUsed"];
_unit = (_this select 3) select 0;
call fnc_usec_medic_removeActions;
r_action = false;
player removeMagazine "ItemPainkiller";
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Gear";
};
if (_unit == player) then {
//Self Healing
[player,player] call player_medPainkiller;
localize "str_actions_medical_painkillers_self" call dayz_rollingMessages;
if (count _this > 2) then {
_unit = (_this select 3) select 0;
_medsUsed = nil;
} else {
// Heal another player
PVDZ_send = [_unit,"Painkiller",[_unit,player]];
publicVariableServer "PVDZ_send";
// Give humanity
20 call player_humanityChange;
format [localize "str_actions_medical_painkillers_give",(name _unit)] call dayz_rollingMessages;
_unit = _this select 0;
_medsUsed = _this select 1;
};
if (isNil "_medsUsed") then {
{
if (_x in magazines player) exitWith {
// Set painkillers if not defined (used when giving to somebody)
_medsUsed = _x;
};
} count ["ItemPainkiller","ItemPainkiller1","ItemPainkiller2","ItemPainkiller3","ItemPainkiller4","ItemPainkiller5","ItemPainkiller6"];
};
if !(isNil "_medsUsed") then {
//Remove one table from the box.
[_medsUsed,"medical"] call dayz_reduceItems;
call fnc_usec_medic_removeActions;
r_action = false;
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Gear";
};
if (_unit == player) then {
//Self Healing
[player,player] call player_medPainkiller;
localize "str_actions_medical_painkillers_self" call dayz_rollingMessages;
} else {
// Heal another player
PVDZ_send = [_unit,"Painkiller",[_unit,player]];
publicVariableServer "PVDZ_send";
// Give humanity
20 call player_humanityChange;
format [localize "str_actions_medical_painkillers_give",(name _unit)] call dayz_rollingMessages;
};
};