1.7.5.D1202

This commit is contained in:
A Clark
2012-12-07 20:29:23 -06:00
parent 73f951f1cf
commit 5521090b9e
74 changed files with 1258 additions and 576 deletions

View File

@@ -1,18 +1,20 @@
private["_unit","_targets","_move","_damage","_wound","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_result","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
private["_unit","_vehicle","_targets","_move","_rnd","_wound","_dir","_hpList","_hp","_damage","_chance","_strH","_dam","_total","_result","_tPos","_zPos","_inAngle","_cantSee","_isZombieInside","_building","_isPlayerInside"];
_unit = _this;
_vehicle = (vehicle player);
_targets = _unit getVariable ["targets",[]];
if (!(_vehicle in _targets) and ((random 1) < 0.9)) exitWith {};
//if (!(_vehicle in _targets)) exitWith {};
//Do the attack
_move = "ZombieStandingAttack1";
_rnd = 0;
_wound = "";
if (r_player_unconscious) then {
if (r_player_unconscious && _vehicle == player) then {
_unit doMove (getPos player);
_rnd = round(random 4) + 1;
_move = "ZombieFeed" + str(_rnd);
} else {
_unit doMove (getPos player);
_rnd = round(random 9) + 1;
_move = "ZombieStandingAttack" + str(_rnd);
};
@@ -27,46 +29,41 @@ if (_vehicle != player) then {
_hpList = _vehicle call vehicle_getHitpoints;
_hp = _hpList call BIS_fnc_selectRandom;
_wound = getText(configFile >> "cfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> _hp >> "name");
_total = 0;
_damage = random 0.03;
_chance = round(random 12);
if(["Glass",_hp,false] call fnc_inString) then {
_damage = 0.03;
_strH = "hit_" + (_wound);
_dam = _vehicle getVariable [_strH,0];
_total = (_dam + _damage);
};
if(["Wheel",_hp,false] call fnc_inString) then {
_damage = 0.02;
_strH = "hit_" + (_wound);
_dam = _vehicle getVariable [_strH,0];
_total = (_dam + _damage);
};
if(["Body",_hp,false] call fnc_inString) then {
_damage = 0.01;
_strH = "hit_" + (_wound);
_dam = _vehicle getVariable [_strH,0];
_total = (_dam + _damage);
};
if(["Engine",_hp,false] call fnc_inString) then {
_damage = 0.01;
_strH = "hit_" + (_wound);
_dam = _vehicle getVariable [_strH,0];
_total = (_dam + _damage);
};
if(["Fuel",_hp,false] call fnc_inString) then {
if ((_wound == "Glass1") or (_wound == "Glass2") or (_wound == "Glass3") or (_wound == "Glass4") or (_wound == "Glass5") or (_wound == "Glass6")) then {
[_unit,"hit",0,false] call dayz_zombieSpeak;
_damage = 0.01;
_strH = "hit_" + (_wound);
_dam = _vehicle getVariable [_strH,0];
_total = (_dam + _damage);
//diag_log ("Hitpoints " +str(_wound) +str(_total));
//_result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
//dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
//publicVariable "dayzHitV";
if (_total >= 1) then {
if ((_chance % 4) == 0) then {
if ((_vehicle isKindOf "ATV_Base_EP1") or (_vehicle isKindOf "Motorcycle")) then { player action ["eject", _vehicle] };
};
if (r_player_blood < (r_player_bloodTotal * 0.8)) then {
_wound = DAYZ_woundHit call BIS_fnc_selectRandomWeighted;
} else {
_wound = DAYZ_woundHit_ok call BIS_fnc_selectRandomWeighted;
};
_damage = 0.1 + random (1.2);
//diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
//publicVariable "dayzHit";
[_unit,"hit",0,false] call dayz_zombieSpeak;
} else {
_result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
publicVariable "dayzHitV";
};
};
if(_total > 0) then {
[_unit,"hit",0,false] call dayz_zombieSpeak;
_result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
publicVariable "dayzHitV";
};
} else {
//Did he hit?
if ((_unit distance player) <= 3) then {
@@ -87,8 +84,8 @@ if (_vehicle != player) then {
_damage = 0.1 + random (1.2);
//diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
dayzHit = [player,_wound, _damage, _unit,"zombie"];
publicVariable "dayzHit";
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
//publicVariable "dayzHit";
[_unit,"hit",0,false] call dayz_zombieSpeak;
} else {
/*
@@ -97,8 +94,8 @@ if (_vehicle != player) then {
_damage = 0.1 + random (1.2);
//diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
dayzHit = [player,_wound, _damage, _unit,"zombie"];
publicVariable "dayzHit";
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
//publicVariable "dayzHit";
[_unit,"hit",0,false] call dayz_zombieSpeak;
};
*/