From 7439b87779a77456d0ec0880fa3d18c308d73ba3 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 11 Aug 2016 15:16:46 -0400 Subject: [PATCH] Update damage handler and improve study body Vanilla development commits applied: https://github.com/DayZMod/DayZ/commit/3db0fe8e7a3df0c2ab9e0f6bb220acf84e450da3 https://github.com/DayZMod/DayZ/commit/73a63898f11501c4aad83ead106c90b3e49461ac https://github.com/DayZMod/DayZ/commit/08e18d5b526f8f8ee570fed1a3640d217f7fa83b https://github.com/DayZMod/DayZ/commit/126da2dcd38a03d5583627607a78d37ad7f64091 https://github.com/DayZMod/DayZ/commit/d5fa3238656c06f8a8c1996d748130002ab2a7f6 https://github.com/DayZMod/DayZ/commit/d37526fcc62a3291fe3b7135bacb4fb172184989 https://github.com/DayZMod/DayZ/commit/5fcca134f05ddf3e4b9458cf9fe54154a9575616 https://github.com/DayZMod/DayZ/commit/c9c1fc934d449b33a9ef3bf14a82b5a40d93874b --- SQF/dayz_code/actions/study_body.sqf | 23 +- SQF/dayz_code/compile/fn_damageHandler.sqf | 269 ++++++++++-------- SQF/dayz_code/compile/fn_damageHandlerZ.sqf | 4 +- SQF/dayz_code/compile/vehicle_getOut.sqf | 9 +- SQF/dayz_code/init/variables.sqf | 16 +- SQF/dayz_code/medical/setup_functions_med.sqf | 17 +- SQF/dayz_code/stringtable.xml | 32 ++- SQF/dayz_code/system/player_spawn_2.sqf | 21 +- .../system/scheduler/sched_medical.sqf | 12 +- .../compile/server_handleSafeGear.sqf | 2 +- 10 files changed, 226 insertions(+), 179 deletions(-) diff --git a/SQF/dayz_code/actions/study_body.sqf b/SQF/dayz_code/actions/study_body.sqf index cb00246fb..7a1e0df36 100644 --- a/SQF/dayz_code/actions/study_body.sqf +++ b/SQF/dayz_code/actions/study_body.sqf @@ -1,17 +1,22 @@ -private["_body","_name","_method","_methodStr"]; +private["_body","_name","_method","_methodStr","_message"]; _body = _this select 3; _name = _body getVariable["bodyName","unknown"]; _method = _body getVariable["deathType","unknown"]; _methodStr = localize format ["str_death_%1",_method]; -_killingBlow = _body getVariable "KillingBlow"; +_killingBlow = _body getVariable ["KillingBlow",objNull]; -format[localize "str_player_studybody",_name,_methodStr] call dayz_rollingMessages; +// "His/Her name was %1, it appears he/she died from %2" +_message = if (_body isKindOf "SurvivorW2_DZ") then {"str_player_studybody_female"} else {"str_player_studybody"}; -if (typeName _killingBlow == "OBJECT") then { - _ConfirmedHumanKills = _killingBlow getVariable ["ConfirmedHumanKills",0]; - _killingBlow setVariable ["ConfirmedHumanKills",(_ConfirmedHumanKills + 1),true]; -} else { - _ConfirmedBanditKills = _killingBlow getVariable ["ConfirmedBanditKills",0]; - _killingBlow setVariable ["ConfirmedBanditKills",(_ConfirmedBanditKills + 1),true]; +format[localize _message,_name,_methodStr] call dayz_rollingMessages; + +if (!(isNull _killingBlow) AND {(isPlayer _killingBlow)}) then { + if (typeName _killingBlow == "OBJECT") then { + _ConfirmedHumanKills = _killingBlow getVariable ["ConfirmedHumanKills",0]; + _killingBlow setVariable ["ConfirmedHumanKills",(_ConfirmedHumanKills + 1),true]; + } else { + _ConfirmedBanditKills = _killingBlow getVariable ["ConfirmedBanditKills",0]; + _killingBlow setVariable ["ConfirmedBanditKills",(_ConfirmedBanditKills + 1),true]; + }; }; \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index 9148f6a52..60b1cabea 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -1,13 +1,11 @@ scriptName "Functions\misc\fn_damageHandler.sqf"; + /*********************************************************** - - Modifyed by Alby - PROCESS DAMAGE TO A UNIT - Function - [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler; ************************************************************/ -private ["_unit","_hit","_damage","_unconscious","_source","_ammo","_Viralzed","_isMinor","_isHeadHit","_isPlayer","_isBandit","_punishment","_humanityHit","_myKills","_wpst","_sourceDist","_sourceWeap","_scale","_type","_nrj","_rndPain","_hitPain","_wound","_isHit","_isbleeding","_rndBleed","_hitBleed","_isInjured","_lowBlood","_rndInfection","_hitInfection","_isCardiac","_chance","_breakaleg","_model","_isZombieHit"]; +private ["_HitBy","_end","_unit","_hit","_damage","_unconscious","_source","_ammo","_Viralzed","_isMinor","_isHeadHit","_isPlayer","_isBandit","_punishment","_humanityHit","_myKills","_wpst","_sourceDist","_sourceWeap","_scale","_type","_nrj","_rndPain","_hitPain","_wound","_isHit","_isbleeding","_rndBleed","_hitBleed","_isInjured","_lowBlood","_rndInfection","_hitInfection","_isCardiac","_chance","_falling","_model","_isZombieHit"]; _unit = _this select 0; _hit = _this select 1; _damage = _this select 2; @@ -15,20 +13,54 @@ _unconscious = _unit getVariable ["NORRN_unconscious", false]; _source = _this select 3; _isPZombie = player isKindOf "PZombie_VB"; _ammo = _this select 4; -_isZombieHit = (_ammo == "zombie"); _model = typeOf player; _Viralzed = typeOf _source in DayZ_ViralZeds; _isMinor = (_hit in USEC_MinorWounds); _isHeadHit = (_hit == "head_hit"); _isPlayer = (isPlayer _source); +_isZombieHit = _ammo == "zombie"; -// anti-hack for local explosions (HelicopterExploSmall, HelicopterExploBig, SmallSecondary...) spawned by hackers -//diag_log [ diag_ticktime, __FILE__, _this]; -_breakaleg = (((_hit == "legs") AND {(_source==_unit)}) AND {((_ammo=="") AND {(Dayz_freefall select 1 > 3)})}) /*AND {(abs(time - (Dayz_freefall select 0))<1)}*/; -if ( (!_breakaleg) AND {(((isNull _source) OR {(_unit == _source)}) AND {((_ammo == "") OR {({damage _x > 0.9} count((getposATL vehicle _unit) nearEntities [["Air", "LandVehicle", "Ship"],15]) == 0) AND (count nearestObjects [getPosATL vehicle _unit, ["TrapItems"], 30] == 0)})})}) exitWith {0}; +//Ignore none part dmg. +if (_hit == "") exitwith { 0 }; + +_falling = (((_hit == "legs") AND {(_source==_unit)}) AND {((_ammo=="") AND {(Dayz_freefall select 1 > 3)})}); + +//Simple hack to help with a few issues from direct damage to physic based damage. ***until 2.0*** + if (isNull dayz_getout) then { + _vehicleArray = nearestObjects [(getposATL (vehicle _unit)),["Car","Helicopter","Motorcycle","Ship"],3]; + { + if ((speed _x > 10) or (speed _x < 8)) exitwith { dayz_HitBy = _x; }; + } count _vehicleArray; + }; + + //Lets see if the player has been struck by a moving vehicle. + if (!isNull dayz_HitBy) then { _ammo = "RunOver"; }; + if ((_hit == "Legs") AND {(_ammo == "RunOver")}) then { dayz_HitBy = objNull; }; + + //If a vehicle is moveing faster then 15 lets register some kind of direct damage rather then relying on indirect/physics damage. + if (!isNull dayz_getout && diag_tickTime - dayz_getoutTime < 5) then { _ammo = "Dragged"; }; + if ((_hit == "Legs") AND {(_ammo == "Dragged")}) then { dayz_getout = objNull; }; + + _end = false; + + if (!_falling) then { + //No _ammo type exit, indirect/physics damage. + if (_ammo == "") exitwith { _end = true; }; + + //If _source contains no object exit. But lets not exit if the unit returns player. Maybe its his own fault. + if (isNull _source) exitwith { _end = true; }; + }; + + + if (_end) exitwith { 0 }; +//End Simple hack for damage ***until 2.0*** + + +if (_unit == player) then { +//Set player in combat + _unit setVariable["startcombattimer", 1]; + _unit setVariable["inCombat", 1, true]; -if (_unit == player) then -{ if (_hit == "") then { if ((_source != player) and _isPlayer && alive player) then @@ -56,8 +88,8 @@ if (_unit == player) then {!_isPZombie}); _humanityHit = 0; - if (!_punishment && {(DayZ_LastHumanityChange + 3) < diag_tickTime}) then { - DayZ_LastHumanityChange = diag_tickTime; + if (!_punishment && {(dayz_lastHumanityChange + 3) < diag_tickTime}) then { + dayz_lastHumanityChange = diag_tickTime; _myKills = 200 - (((player getVariable ["humanKills",0]) / 3) * 150); // how many non bandit players have I (the shot/damaged player) killed? // punish my killer 200 for shooting a surivor @@ -68,7 +100,7 @@ if (_unit == player) then }; // In the case of outrageous damage (crashes, explosions, desync repeated headshots); cap the limit on humanity lost. - [_source,_humanityHit] spawn { + [_source,_humanityHit] spawn { private ["_source","_humanityHit"]; _source = _this select 0; _humanityHit = _this select 1; @@ -85,10 +117,6 @@ if (_unit == player) then private ["_unit"]; _unit = _this select 0; localize "str_player_tranquilized" call dayz_rollingMessages; - //systemChat format ["YOU HAVE BEEN TRANQUILISED"]; - //uiSleep 2; - // 0 fadeSound 0.05; - //uiSleep 5; [_unit,0.01] call fnc_usec_damageUnconscious; _unit setVariable ["NORRN_unconscious", true, true]; r_player_timeout = round(random 60); @@ -140,92 +168,30 @@ if (_unit == player) then }; }; }; -}; - -//Pure blood damage -_scale = 200; -_type = 0; -if ((_ammo isKindof "Grenade") or (_ammo isKindof "ShellBase") or (_ammo isKindof "TimeBombCore") or (_ammo isKindof "BombCore") or (_ammo isKindof "MissileCore") or (_ammo isKindof "RocketCore") or (_ammo isKindof "FuelExplosion") or (_ammo isKindof "GrenadeBase")) then { - _type = 1; -}; -if ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")) then { - _type = 2; -}; - -if (_damage > 0.4) then { - if (!_isZombieHit) then { - _scale = _scale + 50; //250 - }; - //Start body part scale - if (_isZombieHit) then { - //_scale = _scale * 3; //600 = Normal, 900 = Viral - _scale = getNumber (configFile >> "CfgVehicles" >> (typeOf _source) >> "damageScale"); - if (dayz_DamageMultiplier > 1) then { - _scale = _scale * dayz_DamageMultiplier; - }; - //diag_log format["%1, DamageScale: %2",__FILE__,_scaleNew]; - }; - - if (_isHeadHit) then { - _scale = _scale * 2; //700 = Normal, 900 = Viral, 500 = wild - }; - - //End body part scale - if ((isPlayer _source) and !(player == _source)) then { - _scale = _scale + 800; - if (_isHeadHit) then { - _scale = _scale + 500; - }; - }; - switch (_type) do { - case 1: {_scale = _scale + 200}; - case 2: {_scale = _scale + 200}; - }; - if (_unit == player) then { - //diag_log ("DAMAGE: player hit by " + (typeOf _source) + " in " + _hit + " with " + _ammo + " for " + str(_damage) + " scaled " + str(_damage * _scale) + " Conscious " + str (!_unconscious)); - diag_log format["DAMAGE: player hit by %1 in %2 with %3 for %4 scaled to %5, Conscious %6",(typeOf _source),_hit,if (_ammo == "") then { "" } else { _ammo },(str(_damage)),(str(_damage * _scale)),(str (!_unconscious))]; - r_player_blood = r_player_blood - (_damage * _scale); - }; -}; - - -//Record Damage to Minor parts (legs, arms) -if (_hit in USEC_MinorWounds) then { - private ["_type"]; - if (_isZombieHit) then { - if (_hit == "legs") then { - [_unit,_hit,(_damage / 6)] call object_processHit; - } else { - [_unit,_hit,(_damage / 4)] call object_processHit; - }; - } else { - if (_breakaleg) then { - _nrj = ((Dayz_freefall select 1)*20) / 100; - _gravity = 9.81 min (2*(Dayz_freefall select 1)/((0.00001 + (Dayz_freefall select 2))^2)); - _nrj2 = _gravity * (Dayz_freefall select 1); - //diag_log [ "handler freefall", _nrj, _nrj2, Dayz_freefall]; - if (random(_nrj2 / (5 * 9.81)) > 0.5) then { // freefall from 5m => 1/2 chance to get hit legs registered - diag_log[__FILE__, "Legs damage registered from freefall, damage:",_damage,"gravity:", _gravity, - "height:", (Dayz_freefall select 1), "blood loss", (_nrj2 * 25) ]; - [_unit,_hit,_damage] call object_processHit; - } else { - [_unit,"arms",(_damage / 6)] call object_processHit; // prevent broken legs due to arma bugs - }; - if (_nrj2 > 30) then { - (3 min (_nrj2/100)) call fnc_usec_bulletHit; // red flash - r_player_blood = 0 max (r_player_blood - (_nrj2 * 25)); - }; - } else { - [_unit,_hit,(_damage / 2)] call object_processHit; - }; - [_unit,_hit,(_damage / 2)] call object_processHit; + + dayz_lastDamageSource = switch (true) do { + case (_falling): {"fall"}; + case (_isZombieHit): {"zombie"}; + case (_ammo == "RunOver"): {"runover"}; + case (_ammo == "Dragged"): {"eject"}; + case (_ammo in MeleeAmmo): {"melee"}; + case (!isNil "_wpst" && {!(_wpst select 0 in ["","Throw"])}): {"shot"}; + default {"none"}; }; + if (dayz_lastDamageSource != "none") then {dayz_lastDamageTime = diag_tickTime;}; }; -if (_unit == player) then { -//Set player in combat - _unit setVariable["startcombattimer", 1]; - _unit setVariable["inCombat", 1, true]; +//Pure base blood damage +_scale = 200; + +//Ammo Type Setup +_type = switch true do { + case ((_ammo isKindof "Grenade") or (_ammo isKindof "ShellBase") or (_ammo isKindof "TimeBombCore") or (_ammo isKindof "BombCore") or (_ammo isKindof "MissileCore") or (_ammo isKindof "RocketCore") or (_ammo isKindof "FuelExplosion") or (_ammo isKindof "GrenadeBase")): { 1 }; + case ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")): { 2 }; + case (_isZombieHit): { 3 }; + case (_ammo == "RunOver"): { 4 }; + case (_ammo == "Dragged"): { 5 }; + default { 0 }; }; //Shake the cam, frighten them! @@ -239,13 +205,45 @@ if (_damage > 0.1) then { }; }; -if (_damage > 0.4) then { - //Pain and Infection +if (_damage > 0.4) then { + //Scale damage based on headhits. + if (_isHeadHit) then { + _scale = _scale * 2; //700 = Normal, 900 = Viral, 500 = wild + }; + + //End body part scale + //??????????? + if ((isPlayer _source) and !(player == _source)) then { + _scale = _scale + 800; + if (_isHeadHit) then { + _scale = _scale + 500; + }; + }; + + //Modify base scale based on the types, Allows us to modify specific types of damage if needed. + switch (_type) do { + //Explosions + case 1: {_scale = _scale + 300}; + //Bullet types + case 2: {_scale = _scale + 150}; + //Zombies + case 3: {_scale = getNumber (configFile >> "CfgVehicles" >> (typeOf _source) >> "damageScale"); if (dayz_DamageMultiplier > 1) then {_scale = _scale * dayz_DamageMultiplier;};}; + //Dragged + case 4: {_scale = _scale - 150}; + //RunOver + case 5: {_scale = 25}; + }; + + //Display some info in the players log file. if (_unit == player) then { + diag_log format["DAMAGE: player hit by %1 in %2 with %3 for %4 scaled to %5, Conscious %6",(typeOf _source),_hit,if (_ammo == "") then { "" } else { _ammo },(str(_damage)),(str(_damage * _scale)),(str (!_unconscious))]; + r_player_blood = r_player_blood - (_damage * _scale); + + //Pain and Infection _rndPain = floor(random 10); _hitPain = (_rndPain < _damage); - if ((_isHeadHit) or (_damage > 1.2 and _hitPain)) then { + if ((_isHeadHit) or (_hitPain)) then { _hitPain = true; }; @@ -253,10 +251,6 @@ if (_damage > 0.4) then { r_player_inpain = true; player setVariable["USEC_inPain",true,true]; }; - - if ((_damage > 1.5) and _isHeadHit) then { - if (_isZombieHit) then {_id = [_source,"shothead",1] spawn player_death;} else {_id = [_source,"shothead"] spawn player_death;}; - }; }; //Create wound and cause bleed @@ -265,20 +259,16 @@ if (_damage > 0.4) then { _isbleeding = false; _isScratched = false; - switch true do { - default { - _rndBleed = floor(random 100); - _rndBleedChance = getNumber (configFile >> "CfgVehicles" >> (typeOf _source) >> "BleedChance"); - _hitBleed = (_rndBleed < _rndBleedChance); + + _rndBleed = floor(random 100); + _rndBleedChance = getNumber (configFile >> "CfgVehicles" >> (typeOf _source) >> "BleedChance"); + _hitBleed = (_rndBleed < _rndBleedChance); - if (_hitBleed) then { - _isbleeding = true; - }; - }; + if (_hitBleed) then { + _isbleeding = true; }; - if (_isZombieHit) then { - + if (_type == 3) then { if (!_isHit && _isbleeding && !_isPZombie) then { //Create Wound _unit setVariable["hit_"+_wound,true,true]; @@ -297,6 +287,7 @@ if (_damage > 0.4) then { dayz_sourceBleeding = _source; }; }; + //Set ability to give blood _lowBlood = _unit getVariable["USEC_lowBlood",false]; if (!_lowBlood) then { @@ -308,10 +299,9 @@ if (_damage > 0.4) then { //HitInfection from zombies if ((!r_player_infected) and !(r_player_Sepsis select 0)) then { - if (_isZombieHit) then { + if (_type == 3) then { _rndSepsis = floor(random 100); _sepsisChance = getNumber (configFile >> "CfgVehicles" >> (typeOf _source) >> "sepsisChance"); - //_hitInfection = (_rndInfection < _infectionChance); if (_rndSepsis < _sepsisChance) then { r_player_Sepsis = [true, diag_tickTime]; @@ -321,7 +311,7 @@ if (_damage > 0.4) then { }; }; } else { - if(!_isHit && !_isPZombie) then { + if (!_isHit && !_isPZombie) then { //Create Wound _unit setVariable["hit_"+_wound,true,true]; PVDZ_hlt_Bleed = [_unit,_wound,_damage]; @@ -347,6 +337,39 @@ if (_damage > 0.4) then { }; }; +//Record Damage to Minor parts (legs, arms) +if (_hit in USEC_MinorWounds) then { + if (_type == 3) then { + if (_hit == "legs") then { + [_unit,_hit,(_damage / 6)] call object_processHit; + } else { + [_unit,_hit,(_damage / 4)] call object_processHit; + }; + } else { + if (_falling) then { + _nrj = ((Dayz_freefall select 1)*20) / 100; + _gravity = 9.81 min (2*(Dayz_freefall select 1)/((0.00001 + (Dayz_freefall select 2))^2)); + _nrj2 = _gravity * (Dayz_freefall select 1); + //diag_log [ "handler freefall", _nrj, _nrj2, Dayz_freefall]; + if (random(_nrj2 / (5 * 9.81)) > 0.5) then { // freefall from 5m => 1/2 chance to get hit legs registered + diag_log[__FILE__, "Legs damage registered from freefall, damage:",_damage,"gravity:", _gravity, + "height:", (Dayz_freefall select 1), "blood loss", (_nrj2 * 25) ]; + [_unit,_hit,_damage] call object_processHit; + } else { + [_unit,"arms",(_damage / 6)] call object_processHit; // prevent broken legs due to arma bugs + }; + if (_nrj2 > 30) then { + (3 min (_nrj2/100)) call fnc_usec_bulletHit; // red flash + r_player_blood = 0 max (r_player_blood - (_nrj2 * 25)); + }; + } else { + [_unit,_hit,(_damage / 2)] call object_processHit; + }; + + [_unit,_hit,(_damage / 2)] call object_processHit; + }; +}; + if (_type == 1) then { /* BALISTIC DAMAGE @@ -391,7 +414,7 @@ if (_type == 2) then { }; }; -if (_isZombieHit) then { +if (_type == 3) then { if (!_unconscious and !_isMinor and _isHeadHit) then { _chance = random 1; if ((_damage > 0.8) and (_chance < 0.5)) then { diff --git a/SQF/dayz_code/compile/fn_damageHandlerZ.sqf b/SQF/dayz_code/compile/fn_damageHandlerZ.sqf index 8a27a45e4..d72635b1f 100644 --- a/SQF/dayz_code/compile/fn_damageHandlerZ.sqf +++ b/SQF/dayz_code/compile/fn_damageHandlerZ.sqf @@ -9,9 +9,7 @@ _damage = _this select 2; _hitter = _this select 3; _projectile = _this select 4; -_meleeAmmo = ["Hatchet_Swing_Ammo","Machete_Swing_Ammo","Crowbar_Swing_Ammo","Bat_Swing_Ammo","BatBarbed_Swing_Ammo","Fishing_Swing_Ammo","BatNailed_Swing_Ammo","Sledge_Swing_Ammo"]; - -if (_projectile in _meleeAmmo) then { +if (_projectile in MeleeAmmo) then { _damage = _damage * 10; }; diff --git a/SQF/dayz_code/compile/vehicle_getOut.sqf b/SQF/dayz_code/compile/vehicle_getOut.sqf index 7a00d8684..0df444670 100644 --- a/SQF/dayz_code/compile/vehicle_getOut.sqf +++ b/SQF/dayz_code/compile/vehicle_getOut.sqf @@ -27,6 +27,13 @@ if (_unit == player) then { localize "str_actions_exitBlocked" call dayz_rollingMessages; }; + + + //Lets make sure we can process some dmg from ejecting from the vehicle even traveling at lower speeds. + if (((speed _vehicle) > 15) or ((speed _vehicle) < 10)) then { + dayz_getout = _vehicle; + dayz_getoutTime = diag_tickTime; + }; }; -diag_log format["%1 - %2 - %3",_vehicle,_position,_unit]; \ No newline at end of file +diag_log format["%1(%4) - %2 - %3",_vehicle,_position,_unit,(speed _vehicle)]; \ No newline at end of file diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 8a5b1cced..72ce5e953 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -26,10 +26,6 @@ Message_3_time = 0; //OpenTarget timer OpenTarget_Time = 0; -//Brute force fix -keypadCancel = false; -keyPadReset = {uiSleep 2; keypadCancel = false;}; - ///Player classes AllPlayers = ["Survivor_DZ","Survivor1_DZ","SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWsequishaD_DZ","SurvivorWsequisha_DZ","SurvivorWpink_DZ","SurvivorW3_DZ","Bandit2_DZ","BanditW2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ"]; DayZ_Male = ["Survivor_DZ","Survivor1_DZ","Survivor2_DZ","Survivor3_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","Bandit2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ"]; @@ -38,6 +34,7 @@ DayZ_Female = ["SurvivorW2_DZ","BanditW1_DZ","BanditW2_DZ","SurvivorWcombat_DZ", //Classnames for specific items MeleeWeapons = ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeBaseball","MeleeBaseBallBat","MeleeBaseBallBatBarbed","MeleeBaseBallBatNails","MeleeFishingPole","MeleeSledge"]; MeleeMagazines = ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Bat_Swing","BatBarbed_Swing","BatNails_Swing","Fishing_Swing","Sledge_Swing"]; +MeleeAmmo = ["Hatchet_Swing_Ammo","Crowbar_Swing_Ammo","Machete_Swing_Ammo","Bat_Swing_Ammo","BatBarbed_Swing_Ammo","BatNailed_Swing_Ammo","Fishing_Swing_Ammo","Sledge_Swing_Ammo","Chainsaw_Swing_Ammo"]; Dayz_fishingItems = ["MeleeFishingPole"]; Dayz_plants = ["Dayz_Plant1","Dayz_Plant2","Dayz_Plant3"]; Dayz_attachment_array = ["Attachment_ACG","Attachment_AIM"]; @@ -387,7 +384,7 @@ PVDZ_obj_Publish = []; // Used for eventhandler to spawn a mirror of players ten PVCDZ_obj_HideBody = objNull; //DayZ settings -DayZ_LastHumanityChange = diag_tickTime; +dayz_lastHumanityChange = diag_tickTime; dayz_maxAnimals = 5; dayz_maxPlants = 3; dayz_animalDistance = 600; @@ -484,6 +481,8 @@ switch (dayz_presets) do { //call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\achievements_init.sqf"; // EPOCH ADDITIONS +keypadCancel = false; //Brute force fix +keyPadReset = {uiSleep 2; keypadCancel = false;}; canbuild = true; dayz_combination = ""; dayz_disallowedVault = ["TentStorage","BuiltItems","ModularItems","DZE_Base_Object","Generator_DZ"]; @@ -594,6 +593,10 @@ if (!isDedicated) then { dayz_temperaturmin = 27; //TeeChange //player special variables + dayz_lastDamageSource = "none"; + dayz_lastDamageTime = 0; + dayz_lastMedicalSource = "none"; + dayz_lastMedicalTime = 0; dayz_lastClothesChange = 0; dayZ_lastPlayerUpdate = 0; dayz_hunger = 0; @@ -661,6 +664,9 @@ if (!isDedicated) then { dayz_dodge = false; Dayz_constructionContext = []; Dayz_freefall = [ time, 0, 0.1 ]; + dayz_getout = objNull; + dayz_getoutTime = 0; + dayz_HitBy = objNull; // EPOCH ADDITIONS if (isNil "DZE_BackpackAntiTheft") then {DZE_BackpackAntiTheft = false;}; diff --git a/SQF/dayz_code/medical/setup_functions_med.sqf b/SQF/dayz_code/medical/setup_functions_med.sqf index 27dd63255..ff004c5c3 100644 --- a/SQF/dayz_code/medical/setup_functions_med.sqf +++ b/SQF/dayz_code/medical/setup_functions_med.sqf @@ -129,7 +129,6 @@ fnc_usec_calculateBloodPerSec = { _bloodLossPerSec = 0; _bloodGainPerSec = 0; - if (dayz_thirst >= SleepWater) then { _bloodLossPerSec = _bloodLossPerSec + 10; }; @@ -138,7 +137,6 @@ fnc_usec_calculateBloodPerSec = { _bloodLossPerSec = _bloodLossPerSec + 10; }; - if (r_player_injured) then { _bloodLossPerSec = 10; @@ -152,7 +150,7 @@ fnc_usec_calculateBloodPerSec = { }; //Sepsis - if (!r_player_infected) then { + if (!r_player_infected) then { if (r_player_Sepsis select 0) then { _time = diag_tickTime - (r_player_Sepsis select 1); if (_time > 900) then { @@ -175,9 +173,7 @@ fnc_usec_calculateBloodPerSec = { player setVariable ["sepsisStarted", _time]; }; }; - }; - - if (r_player_infected) then { + } else { _bloodLossPerSec = _bloodLossPerSec + 3; }; @@ -227,7 +223,14 @@ _tempVal = round(100*(1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperat r_player_foodstack ]; */ - + dayz_lastMedicalSource = switch (true) do { + case (dayz_thirst >= SleepWater): {"dehyd"}; //10 + case (dayz_hunger >= SleepFood): {"starve"}; //10 + case (r_player_infected): {"sick"}; //3 + default {"none"}; //reset + }; + if (_bloodPerSec < 0 && dayz_lastMedicalSource != "none") then {dayz_lastMedicalTime = diag_tickTime;}; + r_player_bloodpersec = _bloodPerSec; _bloodPerSec }; diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index fd010d756..afbe2f33d 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -6841,14 +6841,6 @@ Le feu de camp a été retiré. Ohniště bylo odstraněno. - - You need a matchbox to build a fireplace - You need a matchbox to build a fireplace - You need a matchbox to build a fireplace - You need a matchbox to build a fireplace - You need a matchbox to build a fireplace - You need a matchbox to build a fireplace - %1 has been gutted, %2 meat steaks now on the carcass Du hast das Tier (%1) ausgenommen. Vom verbleibenden Fleisch kannst du %2 Stücke abschneiden. @@ -7400,6 +7392,9 @@ Il s'appelait %1, il semble qu'il soit mort d' %2 Jmenoval se %1 a pravděpododobně zemřel %2 + + Her name was %1, it appears she died from %2 +