diff --git a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf index 3ad0b948..33f0367f 100644 --- a/Sources/epoch_code/compile/EPOCH_consumeItem.sqf +++ b/Sources/epoch_code/compile/EPOCH_consumeItem.sqf @@ -42,7 +42,8 @@ if (_inputCount >= 3) then { _removeItem = {([player,_this] call BIS_fnc_invRemove) == 1}; _unifiedInteract = { - if (_item call _removeItem) then { + private _removed = _item call _removeItem; + if (_removed) then { if (_interactReturnOnUse != "") then { _interactReturnOnUse call EPOCH_fnc_addItemOverflow; }; @@ -53,6 +54,7 @@ _unifiedInteract = { }; } foreach _interactAttributes; }; + _removed }; switch _interactOption do { @@ -288,18 +290,16 @@ switch _interactOption do { case 13: { //Heal Player _vehicles = player nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 6]; _vehicle = cursorTarget; - if (_vehicle in _vehicles) then { - if (damage _vehicle != 0 || {_x > 0} count ((getallhitpointsdamage _vehicle) select 2) > 0) then { - if (_item call _removeItem) then { - [_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; - ["Healed other player", 5] call Epoch_message; - }; - }; - } else { - if (damage player != 0 || {_x > 0} count ((getallhitpointsdamage player) select 2) > 0) then { - if (_item call _removeItem) then { - [player,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; + if !(_vehicle in _vehicles) then { + _vehicle = player; + }; + if (damage _vehicle != 0 || {_x > 0} count ((getallhitpointsdamage _vehicle) select 2) > 0) then { + if (_item call _removeItem) then { + [_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; + if (_vehicle isEqualTo player) then { ["Healed yourself", 5] call Epoch_message; + } else { + ["Healed other player", 5] call Epoch_message; }; }; }; @@ -311,7 +311,7 @@ switch _interactOption do { ["Unpacked backpack", 5] call Epoch_message; }; }; - + case 15: { // Read _msg = getArray(missionConfigFile >> "CfgReadingDocuments" >> _item >> "displayMessage"); if!(_msg isEqualTo [])then{ @@ -322,7 +322,35 @@ switch _interactOption do { ["This document can't be read yet. Blame DirtySanchez!",5] call Epoch_message; }; }; - + + case 16: { //Heal hitpoint with most damage first + _vehicle = player; + if (damage _vehicle != 0 || {_x > 0} count ((getallhitpointsdamage _vehicle) select 2) > 0) then { + if (call _unifiedInteract) then { + _highestDMG = 0; + _currentHIT = -1; + _currentDMG = 0; + { + _currentDMG = _x; + if (_currentDMG > _highestDMG) then { + _highestDMG = _currentDMG; + _currentHIT = _forEachIndex; + }; + }forEach ((getAllHitPointsDamage _vehicle) param [2,[]]); + if (_highestDMG > 0) then { + _newDMG = ((_highestDMG - 0.5) max 0); + [_vehicle,[[_currentHIT,_newDMG]],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; + } else { + if ((damage _vehicle) > 0) then { + [_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2]; + }; + }; + private _itemName = _item call EPOCH_itemDisplayName; + [format["Used %1 on yourself",_itemName], 5] call Epoch_message; + }; + }; + }; + default { ["Found nothing", 5] call Epoch_message; }; diff --git a/Sources/epoch_config/Configs/CfgItemInteractions.hpp b/Sources/epoch_config/Configs/CfgItemInteractions.hpp index 84c21f32..b57ea424 100644 --- a/Sources/epoch_config/Configs/CfgItemInteractions.hpp +++ b/Sources/epoch_config/Configs/CfgItemInteractions.hpp @@ -172,7 +172,7 @@ class CfgItemInteractions }; class WhiskeyNoodle : Drink_base { - interactAttributes[] = {{"Thirst",800},{"Toxicity",-1},{"Radiation",-1},{"Stamina",50},{"Alcohol",10}}; + interactAttributes[] = {{"Thirst",400},{"Toxicity",-1},{"Radiation",-1},{"Stamina",50},{"Alcohol",10},{"BloodP",1}}; }; class water_epoch : Drink_Jar_base { @@ -538,7 +538,7 @@ class CfgItemInteractions { interactAction = 6; interactText = "USE"; - interactAttributes[] = {{"Toxicity",-50}}; + interactAttributes[] = {{"Toxicity",-5}}; }; class Pumpkin : Default { @@ -862,42 +862,39 @@ class CfgItemInteractions class ItemBottlePlastic_Dirty: Drink_base { interactAttributes[] = {{"Thirst",500},{"Toxicity",5,1},{"Stamina",50},{"Radiation",2,1}}; - interactReturnOnUse = "ItemBottlePlastic_Empty"; + interactReturnOnUse = "ItemBottlePlastic_Empty"; }; class ItemCanteen_Dirty : Drink_base { interactAttributes[] = {{"Thirst",1000},{"Toxicity",5,1},{"Stamina",50},{"Radiation",2,1}}; - interactReturnOnUse = "ItemCanteen_Empty"; + interactReturnOnUse = "ItemCanteen_Empty"; }; - class adrenaline_epoch : FAK + class adrenaline_epoch : Drink_base { - interactAction = 13; // Radiation consume item action needed + interactText = "USE"; // todo digest system to give attributes over time + interactAttributes[] = {{"Thirst",-50},{"Stamina",120},{"BloodP",20},{"Toxicity",5}}; + }; + class atropine_epoch : Drink_base + { + interactText = "USE"; // todo digest system to give attributes over time + interactAttributes[] = {{"Thirst",-50},{"Stamina",-20},{"Toxicity",-5},{"Immunity",-1}}; + }; + class morphine_epoch : Default + { + interactAction = 16; // currently heals most damaged hitpoint first on self and gives attributes interactText = "USE"; + interactAttributes[] = {{"Thirst",-20},{"Stamina",-50},{"Toxicity",5},{"BloodP",5}}; }; - class atropine_epoch : FAK + class caffeinepills_epoch : Food_base { - interactAction = 13; // Radiation consume item action needed - interactText = "USE"; + // todo digest system to give attributes over time (some type of boost system is needed as well as new action to feed it) + interactAttributes[] = {{"Thirst",-20},{"Stamina",50},{"Toxicity",1}}; }; - class morphine_epoch : FAK + class orlistat_epoch : Food_base { - interactAction = 13; // part specific healing action needed - interactText = "USE"; - interactAttributes[] = {{"Thirst",-50},{"Stamina",-20}}; - }; - class caffeinepills_epoch : FAK - { - interactAction = 1; // some type of boost system is needed as well as new action to feed it - interactText = "EAT"; - interactAttributes[] = {{"Thirst",-20},{"Stamina",50}}; - - }; - class orlistat_epoch : FAK - { - interactAction = 1; // some type of boost system is needed as well as new action to feed it - interactText = "EAT"; - interactAttributes[] = {{"Thirst",-20},{"Stamina",50}}; + // todo should reduce hunger downtick for a duration, if too much is taken causes bowel issues? + interactAttributes[] = {{"Thirst",-20},{"Hunger",25},{"BloodP",-1}}; }; }; /*[[[end]]]*/