From 985d205ec21396d81cc193058e73794383c512f0 Mon Sep 17 00:00:00 2001 From: icomrade Date: Tue, 27 May 2014 12:40:42 -0400 Subject: [PATCH] Customize self transfusion settings --- CHANGE LOG 1.0.5.txt | 3 ++- SQF/dayz_code/init/variables.sqf | 4 +++- SQF/dayz_code/medical/publicEH/medTransfuse.sqf | 12 ++++++++---- SQF/dayz_code/medical/self_transfusion.sqf | 7 ++++--- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGE LOG 1.0.5.txt b/CHANGE LOG 1.0.5.txt index 197517d10..66dab81c7 100644 --- a/CHANGE LOG 1.0.5.txt +++ b/CHANGE LOG 1.0.5.txt @@ -4,6 +4,7 @@ [ADDED] Variable DZE_ForceNameTagsInTrader to force name tags in traders. @Skaronator @Fank [ADDED] Switch seats in all vehicles. @icomrade [ADDED] Self transfusions (works in vehicles) must be enabled in mission using DZE_SelfTransfuse. @icomrade +[NOTE] You may customize transfusion settings for self transfusions using DZE_selfTransfuse_Values = [blood amount, infection chance, cool-down (seconds)]; @icomrade [ADDED] Default player skin for fresh spawns, selected randomly DZE_defaultSkin = [["Male skin1","Male skin2"],["Female skin1","Female skin2"]]. @icomrade [ADDED] The USEC CH53 Super Stallion to the dynamic vehicle lists & trader. @Namindu @raginruffalo [ADDED] The BAF Merlin has been added to the neutral aircraft trader under Unarmed Helicopters. @raginruffalo @@ -22,6 +23,6 @@ [CHANGED] You may again switch skins while wearing a backpack. @icomrade [CHANGED] Replaced variable DefaultBackpackWeapon = ""; with DefaultBackpackItems = [""]; which accepts both weapons and magazines. @icomrade -[INFO]Server admins should add requiredSecureId = 2; to their server.cfg to prevent uid spoofing. +[INFO] Server admins should add requiredSecureId = 2; to their server.cfg to prevent uid spoofing. [INFO] Models/textures by Paul Tomany. @Sequisha. [INFO] Special thanks to http://verthosting.com for hosting our development server. diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index cc1703f74..049ef04ee 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -525,7 +525,9 @@ if(isNil "DZE_DamageBeforeMaint") then { if(isNil "DZE_StaticConstructionCount") then { DZE_StaticConstructionCount = 0; }; - +if (isNil "DZE_selfTransfuse_Values") then { + DZE_selfTransfuse_Values = [12000, 15, 300]; +}; // needed on server if(isNil "DZE_PlotPole") then { diff --git a/SQF/dayz_code/medical/publicEH/medTransfuse.sqf b/SQF/dayz_code/medical/publicEH/medTransfuse.sqf index 9f510cab0..610eb6c02 100644 --- a/SQF/dayz_code/medical/publicEH/medTransfuse.sqf +++ b/SQF/dayz_code/medical/publicEH/medTransfuse.sqf @@ -1,13 +1,17 @@ -// animHealed.sqf -private ["_array","_unit","_display","_control","_rndInfection","_TransfusionInfection"]; +private ["_selfTransValues","_unit","_display","_control","_rndInfection","_TransfusionInfection"]; disableserialization; _unit = _this select 0; _rndInfection = (random 15); _TransfusionInfection = (_rndInfection < 1); - if (_unit == player) then { - r_player_blood = r_player_bloodTotal; + if ((count _this) > 1) then { + _selfTransValues = _this select 1; + r_player_blood = (_selfTransValues select 0); + _TransfusionInfection = ((random (_selfTransValues select 1)) < 1); + } else { + r_player_blood = r_player_bloodTotal; + }; r_player_lowblood = false; 10 fadeSound 1; "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; diff --git a/SQF/dayz_code/medical/self_transfusion.sqf b/SQF/dayz_code/medical/self_transfusion.sqf index 5bb7d884f..2457ab7d4 100644 --- a/SQF/dayz_code/medical/self_transfusion.sqf +++ b/SQF/dayz_code/medical/self_transfusion.sqf @@ -1,8 +1,9 @@ -private ["_started","_finished","_animState","_isMedic","_num_removed","_unit","_lastused"]; +private ["_started","_finished","_animState","_isMedic","_num_removed","_unit","_lastused","_timeout"]; if (!DZE_SelfTransfuse) exitWith {}; _unit = player; _lastused = selfTransfusionTime; -if ((round(time - _lastused)) <= 300) exitWith {cutText [format[(localize "str_actions_medical_18"),(300 - (round(time - _lastused)))] , "PLAIN DOWN"]}; +_timeout = (DZE_selfTransfuse_Values select 3); +if ((round(time - _lastused)) <= _timeout) exitWith {cutText [format[(localize "str_actions_medical_18"),(_timeout - (round(time - _lastused)))] , "PLAIN DOWN"]}; call fnc_usec_medic_removeActions; r_action = false; @@ -46,7 +47,7 @@ if (_finished) then { if (vehicle player != player) then { (findDisplay 106) closeDisplay 0; }; - [_unit] call player_medTransfuse; + [_unit, DZE_selfTransfuse_Values] call player_medTransfuse; }; } else { r_interrupt = false;