Update damage handler and improve study body

Vanilla development commits applied:

3db0fe8e7a

73a63898f1

08e18d5b52

126da2dcd3

d5fa323865

d37526fcc6

5fcca134f0

c9c1fc934d
This commit is contained in:
ebaydayz
2016-08-11 15:16:46 -04:00
parent 4019d0c351
commit 7439b87779
10 changed files with 226 additions and 179 deletions

View File

@@ -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];
};
};

View File

@@ -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 {

View File

@@ -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;
};

View File

@@ -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];
diag_log format["%1(%4) - %2 - %3",_vehicle,_position,_unit,(speed _vehicle)];

View File

@@ -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;};

View File

@@ -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
};

View File

@@ -6841,14 +6841,6 @@
<French>Le feu de camp a été retiré.</French>
<Czech>Ohniště bylo odstraněno.</Czech>
</Key>
<Key ID="str_fireplace_noMatches">
<English>You need a matchbox to build a fireplace</English>
<German>You need a matchbox to build a fireplace</German>
<Russian>You need a matchbox to build a fireplace</Russian>
<Spanish>You need a matchbox to build a fireplace</Spanish>
<French>You need a matchbox to build a fireplace</French>
<Czech>You need a matchbox to build a fireplace</Czech>
</Key>
<Key ID="str_success_gutted_animal">
<English>%1 has been gutted, %2 meat steaks now on the carcass</English>
<German>Du hast das Tier (%1) ausgenommen. Vom verbleibenden Fleisch kannst du %2 Stücke abschneiden.</German>
@@ -7400,6 +7392,9 @@
<French>Il s&apos;appelait %1, il semble qu&apos;il soit mort d&apos; %2</French>
<Czech>Jmenoval se %1 a pravděpododobně zemřel %2</Czech>
</Key>
<Key ID="str_player_studybody_female">
<English>Her name was %1, it appears she died from %2</English>
</Key>
<!--
<Key ID="str_player_fail_drink">
<English>You may not drink while in a vehicle</English>
@@ -7563,6 +7558,9 @@
<French>Remplissage déjà en cours!</French>
<Czech>Doplňování paliva už probíhá!</Czech>
</Key>
<Key ID="str_death_shot">
<English>a gunshot.</English>
</Key>
<Key ID="str_death_shothead">
<English>a gunshot to the head.</English>
<German>durch einen Schuss in den Kopf.</German>
@@ -7635,6 +7633,21 @@
<French>une cause inconnue.</French>
<Czech>během neznámé činnosti.</Czech>
</Key>
<Key ID="str_death_zombie">
<English>the infected.</English>
</Key>
<Key ID="str_death_fall">
<English>falling.</English>
</Key>
<Key ID="str_death_runover">
<English>being run over.</English>
</Key>
<Key ID="str_death_eject">
<English>falling out of a moving vehicle.</English>
</Key>
<Key ID="str_death_melee">
<English>blunt force trauma.</English>
</Key>
<Key ID="str_abort_playerclose">
<English>Cannot Abort near another player!\nYou are still in Combat.</English>
<Russian>Нельзя выходить находясь рядом с другим игроком!\nВы все еще в бою!</Russian>
@@ -18066,5 +18079,8 @@
<German>Abbrechen</German>
<Czech>Zrušit</Czech>
</Key>
<Key ID="str_fireplace_noMatches">
<English>You need matches to build a fireplace</English>
</Key>
</Package>
</Project>

View File

@@ -157,12 +157,6 @@ while {1 == 1} do {
};
dayz_hunger = dayz_hunger + (_hunger / 70); //60 Updated to 80
dayz_hunger = (dayz_hunger min SleepFood) max 0;
if (dayz_hunger >= SleepFood) then {
if (r_player_blood < 10) then {
_id = [player,"starve"] spawn player_death;
};
};
//Thirst
_thirst = 2;
@@ -171,12 +165,6 @@ while {1 == 1} do {
};
dayz_thirst = dayz_thirst + (_thirst / 60) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% and + 16.6% waterloss
dayz_thirst = (dayz_thirst min SleepWater) max 0;
if (dayz_thirst >= SleepWater) then {
if (r_player_blood < 10) then {
_id = [player,"dehyd"] spawn player_death;
};
};
//diag_log format ["playerSpawn2 %1/%2",dayz_hunger,dayz_thirst];
@@ -238,15 +226,10 @@ while {1 == 1} do {
if !(player getVariable["USEC_infected",false]) then {
player setVariable["USEC_infected",true,true];
};
if (r_player_blood < 3) then {
_id = [player,"sick"] spawn player_death;
};
};
// Radiation zones rapid blood loss
if (DZE_InRadiationZone) then {
_radsound = "radzone1";
_bloodloss = 10;
if (_radTimer > 5 && _radTimer < 10) then {
@@ -359,7 +342,7 @@ while {1 == 1} do {
};
_startcombattimer = player getVariable["startcombattimer", 0];
if (_startcombattimer == 1) then { //if (_startcombattimer == 1 || _PlayerNearby) then { // do not use _PlayerNearby it makes building impossible, tthis is handled in player_onPause.sqf just fine
if (_startcombattimer == 1) then { //Do not use _PlayerNearby it makes building impossible, this is handled in player_onPause.sqf just fine
player setVariable["combattimeout", diag_tickTime + 30, false];
player setVariable["inCombat", 1, true];
player setVariable["startcombattimer", 0, false];
@@ -419,7 +402,7 @@ while {1 == 1} do {
_magazines = getMagazineCargo _x;
_backpacks = getBackpackCargo _x;
if ((count (_weapons select 0) < 1) and (count (_magazines select 0) < 1) and (count (_backpacks select 0) < 1)) then {
if ((count (_weapons select 0) < 1) and (count (_magazines select 0) < 1) and (count (_backpacks select 0) < 1)) then {
//remove vehicle, Need to ask server to remove.
diag_log format["Deleting empty nearby box: %1",_x];
PVDZ_obj_Delete = [_x,player];

View File

@@ -18,7 +18,7 @@ sched_medical_slow = { // 10 seconds
sched_medical_init = { [ []spawn{} ] };
sched_medical = { // 1 second
HIDE_FSM_VARS
private "_unconHdlr";
private ["_method","_unconHdlr"];
_unconHdlr = _this select 0;
if (r_player_blood == 12000) then {
@@ -26,9 +26,15 @@ sched_medical = { // 1 second
};
//r_player_unconscious = getVariable ["NORRN_unconscious", true];
_method = switch (true) do {
case (dayz_lastDamageSource != "none" && diag_tickTime - dayz_lastDamageTime < 30): {dayz_lastDamageSource}; //Major event takes priority for cause of death
case (dayz_lastMedicalSource != "none" && diag_tickTime - dayz_lastMedicalTime < 10): {dayz_lastMedicalSource}; //Starve, Dehyd, Sick
default {"bled"}; //No other damage sources in last 30 seconds
};
if (r_player_blood <= 0) then {
[dayz_sourceBleeding, "bled"] spawn player_death;
[dayz_sourceBleeding, _method] spawn player_death;
};
if (!canStand player) then { // be consistant with player_updateGui.sqf

View File

@@ -50,7 +50,7 @@ switch (_status) do {
_holder setVariable ["ObjectID",_objectID,true];
_holder setVariable ["ObjectUID",_objectUID,true];
_holder setVariable ["OEMPos",_pos,true];
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID ,true];};
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];};
deleteVehicle _obj;
[_weapons,_magazines,_backpacks,_holder] call server_addCargo;