1.7.5.D1216

This commit is contained in:
A Clark
2012-12-17 13:16:34 -06:00
parent 08793009ae
commit 0faab1b8ff
34 changed files with 641 additions and 469 deletions

View File

@@ -1,32 +1,21 @@
private["_isZombie","_unit","_vehicle","_targets","_move","_rnd","_wound","_type","_dir","_hpList","_hp","_damage","_chance","_strH","_dam","_total","_result","_tPos","_zPos","_inAngle","_cantSee","_isZombieInside","_building","_isPlayerInside"];
_unit = _this;
private["_unit","_targets","_move","_damage","_wound","_index","_cnt","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_result","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
_unit = _this select 0;
_type = _this select 1;
_vehicle = (vehicle player);
_isZombie = _unit isKindOf "zZombie_base";
if(_isZombie) then {
_type = "zombie";
} else {
_type = "dog";
};
_targets = _unit getVariable ["targets",[]];
//if (!(_vehicle in _targets)) exitWith {};
//Do the attack
_move = "ZombieStandingAttack1";
_rnd = 0;
_wound = "";
if (r_player_unconscious && _vehicle == player) then {
_unit doMove (getPos player);
if (r_player_unconscious && _vehicle == player && _type == "zombie") then {
_rnd = round(random 4) + 1;
_move = "ZombieFeed" + str(_rnd);
} else {
_unit doMove (getPos player);
if (_type == "dog") then {
_move = "Dog_Attack";
} else {
if (_type == "zombie") then {
_rnd = round(random 9) + 1;
_move = "ZombieStandingAttack" + str(_rnd);
} else {
_move = "Dog_Attack";
};
};
_dir = [_unit,player] call BIS_Fnc_dirTo;
@@ -59,9 +48,15 @@ if (_vehicle != player) 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;
_cnt = count (DAYZ_woundHit select 1);
_index = floor (random _cnt);
_index = (DAYZ_woundHit select 1) select _index;
_wound = (DAYZ_woundHit select 0) select _index;
} else {
_cnt = count (DAYZ_woundHit_ok select 1);
_index = floor (random _cnt);
_index = (DAYZ_woundHit_ok select 1) select _index;
_wound = (DAYZ_woundHit_ok select 0) select _index;
};
_damage = 0.1 + random (1.2);
//diag_log ("START DAM: Player Hit on " + _wound + " for " + str(_damage));
@@ -88,13 +83,22 @@ if (_vehicle != player) then {
_cantSee = [_unit,_vehicle] call dayz_losCheck;
if (!_cantSee) then {
if (_type == "dog") then {
_wound = DAYZ_woundHit_dog call BIS_fnc_selectRandomWeighted;
_cnt = count (DAYZ_woundHit_dog select 1);
_index = floor (random _cnt);
_index = (DAYZ_woundHit_dog select 1) select _index;
_wound = (DAYZ_woundHit_dog select 0) select _index;
_damage = 0.3 + random (1.0);
} else {
if (r_player_blood < (r_player_bloodTotal * 0.8)) then {
_wound = DAYZ_woundHit call BIS_fnc_selectRandomWeighted;
_cnt = count (DAYZ_woundHit select 1);
_index = floor (random _cnt);
_index = (DAYZ_woundHit select 1) select _index;
_wound = (DAYZ_woundHit select 0) select _index;
} else {
_wound = DAYZ_woundHit_ok call BIS_fnc_selectRandomWeighted;
_cnt = count (DAYZ_woundHit_ok select 1);
_index = floor (random _cnt);
_index = (DAYZ_woundHit_ok select 1) select _index;
_wound = (DAYZ_woundHit_ok select 0) select _index;
};
_damage = 0.1 + random (1.2);
};
@@ -103,7 +107,7 @@ if (_vehicle != player) then {
[player, _wound, _damage, _unit,"zombie"] call fnc_usec_damageHandler;
//dayzHit = [player,_wound, _damage, _unit,"zombie"];
//publicVariable "dayzHit";
if (_type == "dog") then { [_unit,"dog_growl",0,false] call dayz_zombieSpeak; } else { [_unit,"hit",0,false] call dayz_zombieSpeak; };
[_unit,"hit",0,false] call dayz_zombieSpeak;
} else {
/*
_isZombieInside = [_unit,_building] call fnc_isInsideBuilding;