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

@@ -19,11 +19,6 @@ class MeleeHatchet: MeleeWeapon
};
class ItemActions
{
class Use
{
text="$STR_ACTIONS_CHOPWOOD";
script="spawn player_chopWood;";
};
class Toolbelt
{
text="Add to Toolbelt";

View File

@@ -11,7 +11,7 @@ TradeInprogress = true;
if((currentWeapon player) != "MeleeHatchet") exitWith {TradeInprogress = false; cutText [(localize "str_epoch_player_54"), "PLAIN DOWN"]; };
// allowed trees list move this later
_trees = ["t_larix3s.p3d","t_pyrus2s.p3d","str_briza_kriva.p3d","dd_borovice.p3d","les_singlestrom_b.p3d","les_singlestrom.p3d","smrk_velky.p3d","smrk_siroky.p3d","smrk_maly.p3d","les_buk.p3d","str krovisko vysoke.p3d","str_fikovnik_ker.p3d","str_fikovnik.p3d","str vrba.p3d","hrusen2.p3d","str dub jiny.p3d","str lipa.p3d","str briza.p3d","p_akat02s.p3d","jablon.p3d","p_buk.p3d","str_topol.p3d","str_topol2.p3d","p_osika.p3d","t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_ficusb2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_01.p3d","palm_02.p3d","palm_03.p3d","palm_04.p3d","palm_09.p3d","palm_10.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d"];
_trees = DZE_trees;
//_item = _this;
call gear_ui_init;

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

View File

@@ -90,6 +90,10 @@ fnc_usec_damageType = {
if ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")) then {
_type = 2;
};
if (_ammo isKindof "Melee") then {
_type = 3;
};
_type;
};