removed old tree harvest action added new one

This commit is contained in:
[VB]AWOL
2013-11-06 20:56:12 -06:00
parent 527ed3283b
commit da0ece239f
8 changed files with 89 additions and 8 deletions

View File

@@ -14,6 +14,11 @@ _isPZombie = player isKindOf "PZombie_VB";
_source = _this select 3;
_ammo = _this select 4;
_type = [_damage,_ammo] call fnc_usec_damageType;
if (_type == 3) then {
_damage = _damage * 0.024;
};
_isMinor = (_hit in USEC_MinorWounds);
_isHeadHit = (_hit == "head_hit");
//_evType = "";
@@ -89,7 +94,7 @@ if (_damage > 0.4) then {
if (_unitIsPlayer) then {
//Cause blood loss
//Log Damage
//diag_log ("DAMAGE: player hit by " + typeOf _source + " in " + _hit + " with " + _ammo + " for " + str(_damage) + " scaled " + str(_damage * _scale));
diag_log ("DAMAGE: player hit by " + typeOf _source + " in " + _hit + " with " + _ammo + " for " + str(_damage) + " scaled " + str(_damage * _scale));
r_player_blood = r_player_blood - (_damage * _scale);
};
};

View File

@@ -9,7 +9,14 @@ _unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
//_source = _this select 3;
//_ammo = _this select 4;
_ammo = _this select 4;
_type = [_damage,_ammo] call fnc_usec_damageType;
if (_type == 3) then {
_damage = _damage * 0.024;
};
_total = _damage;
//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));

View File

@@ -10,6 +10,11 @@ _hitter = _this select 3;
_projectile = _this select 4;
if (local _zed) then {
if (_projectile isKindOf "Melee") then {
_damage = _damage * 0.024;
};
if (_damage > 1 and _projectile != "") then {
//Record deliberate critical damages
switch (_selection) do {

View File

@@ -17,6 +17,9 @@ dayz_combat = 1;
if (_ammo isKindOf "Melee") exitWith {
_unit playActionNow "GestureSwing";
// harvest wood check
_id = _this spawn player_harvest;
};
//Smoke Grenade

View File

@@ -0,0 +1,62 @@
private ["_unit","_ammo","_distance","_weapon","_projectile","_endPos","_dir","_doWait","_vel"];
_unit = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;
_projectile = _this select 6;
if (_ammo isKindOf "Hatchet_Swing_Ammo") then {
_findNearestTree = [];
{
if("" == typeOf _x) then {
if (alive _x) then {
_objName = _x call DZE_getModelName;
// Exit since we found a tree
if (_objName in DZE_trees) exitWith {
_findNearestTree set [(count _findNearestTree),_x];
};
};
};
} foreach nearestObjects [getPosATL player, [], 20];
//diag_log ("POSITION: " + str(_endPos));
if (count(_findNearestTree) >= 1) then {
_tree = _findNearestTree select 0;
// get 2d distance
_distance2d = [player, _tree] call BIS_fnc_distance2D;
if(_distance2d <= 5) then {
// damage must be going down
_damage = damage _tree;
if (DZE_TEMP_treedmg < _damage) then {
//diag_log ("DAMAGE: " + str(damage _tree));
_countOut = 1;
_itemOut = "PartWoodPile";
_nearByPile= nearestObjects [getPosATL player, ["WeaponHolder"],2];
if (count _nearByPile == 0) then {
_item = createVehicle ["WeaponHolder", getPosATL player, [], 1, "CAN_COLLIDE"];
_item addMagazineCargoGlobal [_itemOut,_countOut];
player reveal _item;
} else {
_item = _nearByPile select 0;
_item addMagazineCargoGlobal [_itemOut,_countOut];
};
_distance = 60;
[_unit,_distance,false,getPosATL player] spawn player_alertZombies;
};
DZE_TEMP_treedmg = _damage;
};
};
};