mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-24 09:29:21 +03:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -16,6 +16,7 @@ class ItemMixOil : CA_Magazine {
|
||||
requiretools[] = {};
|
||||
output[] = {{"ItemJerryMixed",1}};
|
||||
input[] = {{"ItemMixOil",1},{"ItemJerrycan",1}};
|
||||
inputstrict = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
class BTR90;
|
||||
class BTR90_DZ: BTR90 {
|
||||
scope = public;
|
||||
class BTR90_DZ_Base: BTR90 {
|
||||
scope = private;
|
||||
side = TGuerrila;
|
||||
displayName = "BTR-90 DZ";
|
||||
|
||||
commanderCanSee = 2+16+32;
|
||||
gunnerCanSee = 2+16+32;
|
||||
@@ -12,18 +11,21 @@ class BTR90_DZ: BTR90 {
|
||||
typicalCargo[] = {};
|
||||
class TransportMagazines{};
|
||||
|
||||
transportMaxMagazines = 100; // Default: 100
|
||||
transportMaxWeapons = 10; // Default: 10
|
||||
//transportmaxbackpacks = ; // Default:
|
||||
|
||||
class Turrets; // External class reference
|
||||
class MainTurret; // External class reference
|
||||
};
|
||||
class BTR90_HQ;
|
||||
class BTR90_HQ_DZ: BTR90_HQ {
|
||||
class BTR90_DZ: BTR90_DZ_Base {
|
||||
scope = public;
|
||||
displayName = "BTR-90 DZ";
|
||||
|
||||
transportMaxMagazines = 100; // Default: 100
|
||||
transportMaxWeapons = 10; // Default: 10
|
||||
//transportmaxbackpacks = ; // Default:
|
||||
};
|
||||
class BTR90_HQ;
|
||||
class BTR90_HQ_DZ_Base: BTR90_HQ {
|
||||
scope = private;
|
||||
side = TGuerrila;
|
||||
displayName = "BTR-90 (HQ) DZ";
|
||||
|
||||
commanderCanSee = 2+16+32;
|
||||
gunnerCanSee = 2+16+32;
|
||||
@@ -33,19 +35,25 @@ class BTR90_HQ_DZ: BTR90_HQ {
|
||||
typicalCargo[] = {};
|
||||
class TransportMagazines{};
|
||||
|
||||
class Turrets; // External class reference
|
||||
class MainTurret; // External class reference
|
||||
};
|
||||
class BTR90_HQ_DZ: BTR90_HQ_DZ_Base {
|
||||
scope = public;
|
||||
displayName = "BTR-90 (HQ) DZ";
|
||||
|
||||
transportSoldier = 7;
|
||||
|
||||
transportMaxMagazines = 100; // Default: 100
|
||||
transportMaxWeapons = 10; // Default: 10
|
||||
//transportmaxbackpacks = ; // Default:
|
||||
|
||||
class Turrets; // External class reference
|
||||
class MainTurret; // External class reference
|
||||
};
|
||||
|
||||
// Ammo Less
|
||||
class BTR90_DZE: BTR90_DZ {
|
||||
displayName = "BTR-90 AL";
|
||||
class Turrets: Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
class MainTurret: MainTurret {
|
||||
magazines[] = {};
|
||||
};
|
||||
};
|
||||
@@ -53,7 +61,7 @@ class BTR90_DZE: BTR90_DZ {
|
||||
class BTR90_HQ_DZE: BTR90_HQ_DZ {
|
||||
displayName = "BTR-90 (HQ) AL";
|
||||
class Turrets: Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
class MainTurret: MainTurret {
|
||||
magazines[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ class M113_TK_EP1_DZ: M113_TK_EP1 {
|
||||
class M113_UN_EP1_DZE: M113_UN_EP1_DZ {
|
||||
displayName = "M113 AL";
|
||||
class Turrets: Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
class MainTurret: MainTurret {
|
||||
magazines[] = {};
|
||||
};
|
||||
};
|
||||
@@ -54,7 +54,7 @@ class M113_UN_EP1_DZE: M113_UN_EP1_DZ {
|
||||
class M113_TK_EP1_DZE: M113_TK_EP1_DZ {
|
||||
displayName = "M113 AL";
|
||||
class Turrets: Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
class MainTurret: MainTurret {
|
||||
magazines[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -36,8 +36,11 @@ if (_count == 0) exitWith {
|
||||
|
||||
_requirements = [];
|
||||
switch true do {
|
||||
case (_count <= 10): {_requirements = [["ItemGoldBar10oz",1]]};
|
||||
case (_count <= 20): {_requirements = [["ItemGoldBar10oz",2]]};
|
||||
case (_count <= 35): {_requirements = [["ItemGoldBar10oz",3]]};
|
||||
case (_count <= 50): {_requirements = [["ItemGoldBar10oz",4]]};
|
||||
case (_count <= 75): {_requirements = [["ItemGoldBar10oz",6]]};
|
||||
case (_count <= 100): {_requirements = [["ItemBriefcase100oz",1]]};
|
||||
case (_count <= 175): {_requirements = [["ItemBriefcase100oz",2]]};
|
||||
case (_count <= 250): {_requirements = [["ItemBriefcase100oz",3]]};
|
||||
|
||||
@@ -14,12 +14,13 @@ class ItemActions
|
||||
requiretools[] = {"ItemToolbox","ItemKnife"}; // (cfgweapons only)
|
||||
output[] = {{"ItemTent",1}}; // (CfgMagazines, qty)
|
||||
input[] = {{"ItemCanvas",2},{"ItemPole",2}}; // (CfgMagazines, qty)
|
||||
inputstrict = true; // (CfgMagazines input without inheritsFrom) Optional
|
||||
inputweapons[] = {"ItemToolbox"}; // consume toolbox (cfgweapons only)
|
||||
outputweapons[] = {"ItemToolbox"}; // return toolbox (cfgweapons only)
|
||||
};
|
||||
};
|
||||
};
|
||||
*/
|
||||
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
|
||||
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
|
||||
|
||||
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_63") , "PLAIN DOWN"]; };
|
||||
DZE_ActionInProgress = true;
|
||||
@@ -44,14 +45,14 @@ _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
_needNear = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "neednearby");
|
||||
if("fire" in _needNear) then {
|
||||
_isNear = {inflamed _x} count (getPosATL player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
if("workshop" in _needNear) then {
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
|
||||
if(_isNear == 0) then {
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
};
|
||||
@@ -64,10 +65,11 @@ if(_abort) exitWith {
|
||||
// diag_log format["Checking for fire: %1", _isFireNear];
|
||||
|
||||
if (_canDo) then {
|
||||
|
||||
|
||||
_selectedRecipeTools = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
||||
_selectedRecipeOutput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeOutput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeInputStrict = if ((isNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict")) && (getNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict") > 0)) then {true} else {false};
|
||||
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
|
||||
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons");
|
||||
|
||||
@@ -80,24 +82,24 @@ if (_canDo) then {
|
||||
if(isNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "randomOutput")) then {
|
||||
_randomOutput = getNumber(configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "randomOutput");
|
||||
};
|
||||
|
||||
|
||||
_craft_doLoop = true;
|
||||
_tradeComplete = 0;
|
||||
|
||||
while {_craft_doLoop} do {
|
||||
|
||||
_temp_removed_array = [];
|
||||
|
||||
|
||||
_missing = "";
|
||||
_missingTools = false;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _craft_doLoop = false; _missingTools = true; _missing = _x; };
|
||||
} forEach _selectedRecipeTools;
|
||||
|
||||
|
||||
if(!_missingTools) then {
|
||||
|
||||
|
||||
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
if (count _selectedRecipeInput > 0) then {
|
||||
@@ -105,30 +107,30 @@ if (_canDo) then {
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
_qty = { (_x == _itemIn) || (!_selectedRecipeInputStrict && configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
};
|
||||
|
||||
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
|
||||
|
||||
cutText [(localize "str_epoch_player_62"), "PLAIN DOWN"];
|
||||
|
||||
|
||||
[1,1] call dayz_HungerThirst;
|
||||
player playActionNow "Medic";
|
||||
|
||||
|
||||
[player,_sfx,0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
@@ -145,9 +147,9 @@ if (_canDo) then {
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
@@ -157,10 +159,10 @@ if (_canDo) then {
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
{
|
||||
|
||||
{
|
||||
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || _configParent == _itemIn)) then {
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || (!_selectedRecipeInputStrict && _configParent == _itemIn))) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
@@ -172,20 +174,20 @@ if (_canDo) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
|
||||
//diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
_num_removed_weapons = 0;
|
||||
{
|
||||
_num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove);
|
||||
} forEach _inputWeapons;
|
||||
if (_num_removed_weapons == (count _inputWeapons)) then {
|
||||
if (_num_removed_weapons == (count _inputWeapons)) then {
|
||||
if(_randomOutput == 1) then {
|
||||
_selectedWeapon = _outputWeapons call BIS_fnc_selectRandom;
|
||||
_outputWeapons = [_selectedWeapon];
|
||||
@@ -195,19 +197,19 @@ if (_canDo) then {
|
||||
_craft_doLoop = false;
|
||||
};
|
||||
{
|
||||
player addWeapon _x;
|
||||
player addWeapon _x;
|
||||
} forEach _outputWeapons;
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
|
||||
|
||||
if (_itemOut == "ItemWaterbottleUnfilled") then {
|
||||
|
||||
|
||||
if (_waterLevel > 0) then {
|
||||
_itemOut = format["ItemWaterbottle%1oz",_waterLevel];
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
diag_log format["Checking for water level: %1", _waterLevel];
|
||||
@@ -219,22 +221,22 @@ if (_canDo) then {
|
||||
_tradeComplete = _tradeComplete+1;
|
||||
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
|
||||
|
||||
// Add crafted item
|
||||
cutText [format[(localize "str_epoch_player_150"),_textCreate,_countOut], "PLAIN DOWN"];
|
||||
// sleep here
|
||||
// sleep here
|
||||
sleep 1;
|
||||
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
|
||||
cutText [format[(localize "str_epoch_player_151"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
@@ -244,7 +246,7 @@ if (_canDo) then {
|
||||
cutText [(localize "str_epoch_player_64"), "PLAIN DOWN"];
|
||||
_craft_doLoop = false;
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format[(localize "str_epoch_player_152"),_missingQty, _textMissing,_tradeComplete], "PLAIN DOWN"];
|
||||
|
||||
@@ -41,7 +41,7 @@ if (DZE_StaticConstructionCount > 0) then {
|
||||
}
|
||||
else {
|
||||
if (isNumber (configFile >> "CfgVehicles" >> _objType >> "constructioncount")) then {
|
||||
_limit = getNumber(configFile >> "_objType" >> _classname >> "constructioncount");
|
||||
_limit = getNumber(configFile >> "CfgVehicles" >> _objType >> "constructioncount");
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -63,10 +63,12 @@ if(!isNull _obj and alive _obj) then {
|
||||
_backpacks = getBackpackCargo _obj;
|
||||
|
||||
deleteVehicle _obj;
|
||||
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
|
||||
publicVariableServer "PVDZE_obj_Delete";
|
||||
|
||||
if (isServer) then {
|
||||
PVDZE_obj_Delete call server_deleteObj;
|
||||
} else {
|
||||
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
|
||||
publicVariableServer "PVDZE_obj_Delete";
|
||||
};
|
||||
|
||||
//Add weapons
|
||||
@@ -102,4 +104,4 @@ if(!isNull _obj and alive _obj) then {
|
||||
};
|
||||
|
||||
s_player_packtent = -1;
|
||||
DZE_ActionInProgress = false;
|
||||
DZE_ActionInProgress = false;
|
||||
|
||||
@@ -212,6 +212,7 @@ dayz_resetSelfActions = {
|
||||
s_player_removeflare = -1;
|
||||
s_player_painkiller = -1;
|
||||
s_player_studybody = -1;
|
||||
s_player_tamedog = -1;
|
||||
s_player_madsci_crtl = -1;
|
||||
s_player_parts_crtl = -1;
|
||||
s_build_Sandbag1_DZ = -1;
|
||||
@@ -709,6 +710,7 @@ if(!isDedicated) then {
|
||||
DZE_FreshSpawn = false;
|
||||
|
||||
DZE_myHaloVehicle = objNull;
|
||||
dayz_myLiftVehicle = objNull;
|
||||
|
||||
DZE_Friends = [];
|
||||
|
||||
|
||||
@@ -1353,7 +1353,7 @@ class FSM
|
||||
priority = 2.000000;
|
||||
to="ERROR__No_Player_1";
|
||||
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"(_myEpochAnim != ""1.0.4"") || (_myEpoch != ""1.0.4"") || (_myEpochB != ""1.0.4.1"") || (_myEpochSfx != ""1.0.4"")"/*%FSM</CONDITION""">*/;
|
||||
condition=/*%FSM<CONDITION""">*/"(_myEpochAnim != ""1.0.4"") || (_myEpoch != ""1.0.4"") || (_myEpochB != ""1.0.4.1"") || (_myEpochSfx != ""1.0.4.1"")"/*%FSM</CONDITION""">*/;
|
||||
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
|
||||
};
|
||||
/*%FSM</LINK>*/
|
||||
|
||||
Reference in New Issue
Block a user