Fuel container can be emptied now

This commit is contained in:
A Man
2019-10-30 10:03:16 +01:00
parent d233346563
commit 276615a8f1
6 changed files with 88 additions and 21 deletions

View File

@@ -70,6 +70,8 @@ class ItemJerryMixed: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa"; picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS20L_CAN_DESC; descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS20L_CAN_DESC;
sfx = "refuel"; sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions { class ItemActions {
class Crafting { class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION; text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -79,6 +81,10 @@ class ItemJerryMixed: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed4",1}}; output[] = {{"CSGAS",1},{"ItemJerryMixed4",1}};
input[] = {{"ItemJerryMixed",1}}; input[] = {{"ItemJerryMixed",1}};
}; };
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
}; };
}; };
class ItemJerryMixed4: CA_Magazine { class ItemJerryMixed4: CA_Magazine {
@@ -90,6 +96,8 @@ class ItemJerryMixed4: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa"; picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS16L_CAN_DESC; descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS16L_CAN_DESC;
sfx = "refuel"; sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions { class ItemActions {
class Crafting { class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION; text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -99,6 +107,10 @@ class ItemJerryMixed4: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed3",1}}; output[] = {{"CSGAS",1},{"ItemJerryMixed3",1}};
input[] = {{"ItemJerryMixed4",1}}; input[] = {{"ItemJerryMixed4",1}};
}; };
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
}; };
}; };
class ItemJerryMixed3: CA_Magazine { class ItemJerryMixed3: CA_Magazine {
@@ -110,6 +122,8 @@ class ItemJerryMixed3: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa"; picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS12L_CAN_DESC; descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS12L_CAN_DESC;
sfx = "refuel"; sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions { class ItemActions {
class Crafting { class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION; text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -119,6 +133,10 @@ class ItemJerryMixed3: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed2",1}}; output[] = {{"CSGAS",1},{"ItemJerryMixed2",1}};
input[] = {{"ItemJerryMixed3",1}}; input[] = {{"ItemJerryMixed3",1}};
}; };
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
}; };
}; };
class ItemJerryMixed2: CA_Magazine { class ItemJerryMixed2: CA_Magazine {
@@ -130,6 +148,8 @@ class ItemJerryMixed2: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa"; picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS8L_CAN_DESC; descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS8L_CAN_DESC;
sfx = "refuel"; sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions { class ItemActions {
class Crafting { class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION; text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -139,6 +159,10 @@ class ItemJerryMixed2: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed1",1}}; output[] = {{"CSGAS",1},{"ItemJerryMixed1",1}};
input[] = {{"ItemJerryMixed2",1}}; input[] = {{"ItemJerryMixed2",1}};
}; };
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
}; };
}; };
class ItemJerryMixed1: CA_Magazine { class ItemJerryMixed1: CA_Magazine {
@@ -150,6 +174,8 @@ class ItemJerryMixed1: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa"; picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS4L_CAN; descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS4L_CAN;
sfx = "refuel"; sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions { class ItemActions {
class Crafting { class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION; text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -159,6 +185,10 @@ class ItemJerryMixed1: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerrycanEmpty",1}}; output[] = {{"CSGAS",1},{"ItemJerrycanEmpty",1}};
input[] = {{"ItemJerryMixed1",1}}; input[] = {{"ItemJerryMixed1",1}};
}; };
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
}; };
}; };

View File

@@ -274,6 +274,14 @@ class ItemOilBarrel: CA_Magazine
model = "\z\addons\dayz_epoch\models\oil_drum_model.p3d"; model = "\z\addons\dayz_epoch\models\oil_drum_model.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa"; picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa";
descriptionShort = $STR_EPOCH_OILBARREL_DESC; descriptionShort = $STR_EPOCH_OILBARREL_DESC;
containerEmpty = "ItemOilBarrelEmpty";
class ItemActions {
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
}; };
class ItemFuelBarrel: CA_Magazine class ItemFuelBarrel: CA_Magazine
{ {
@@ -286,7 +294,14 @@ class ItemFuelBarrel: CA_Magazine
picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa"; picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa";
descriptionShort = $STR_EPOCH_FUELBARREL_DESC; descriptionShort = $STR_EPOCH_FUELBARREL_DESC;
fireIntensity = 6; //used for tent burning fireIntensity = 6; //used for tent burning
emptycan = "ItemFuelBarrelEmpty"; containerEmpty = "ItemFuelBarrelEmpty";
class ItemActions {
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
}; };
class ItemFuelBarrelEmpty: ItemFuelBarrel class ItemFuelBarrelEmpty: ItemFuelBarrel
{ {
@@ -1198,6 +1213,14 @@ class ItemMethylaminBarrel : ItemOilBarrel
{ {
displayName = $STR_EPOCH_METHYLAMINEBARREL; displayName = $STR_EPOCH_METHYLAMINEBARREL;
descriptionShort = $STR_EPOCH_METHYLAMINEBARREL_DESC; descriptionShort = $STR_EPOCH_METHYLAMINEBARREL_DESC;
containerEmpty = "ItemMethylaminBarrelEmpty";
class ItemActions {
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
}; };
class ItemC4Charge : CA_Magazine class ItemC4Charge : CA_Magazine

View File

@@ -20,10 +20,17 @@ class ItemJerrycan : ItemJerrycanEmpty
descriptionShort = $STR_ITEM_DESC_JERRYCAN; descriptionShort = $STR_ITEM_DESC_JERRYCAN;
fuelQuantity = 20; fuelQuantity = 20;
emptycan = "ItemJerrycanEmpty"; containerEmpty = "ItemJerrycanEmpty";
//used for tent burning //used for tent burning
fireIntensity = 6; fireIntensity = 6;
class ItemActions {
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
}; };
class ItemFuelcanEmpty : ItemJerrycanEmpty class ItemFuelcanEmpty : ItemJerrycanEmpty
@@ -46,8 +53,15 @@ class ItemFuelcan : ItemFuelcanEmpty
descriptionShort = $STR_ITEM_DESC_FUELCAN; descriptionShort = $STR_ITEM_DESC_FUELCAN;
fuelQuantity = 5; fuelQuantity = 5;
emptycan = "ItemFuelcanEmpty"; containerEmpty = "ItemFuelcanEmpty";
//used for tent burning //used for tent burning
fireIntensity = 4; fireIntensity = 4;
class ItemActions {
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
}; };

View File

@@ -1,8 +1,8 @@
private ["_vehicle","_finished","_soundSource","_fuelCan","_emptyCan"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true; dayz_actionInProgress = true;
private ["_vehicle","_finished","_soundSource","_fuelCan","_emptyCan"];
player removeAction s_player_fillgen; player removeAction s_player_fillgen;
s_player_fillgen = 1; s_player_fillgen = 1;
@@ -28,7 +28,7 @@ if (_finished) then {
if(!(_vehicle getVariable ["GeneratorFilled", false]) && !isNil "_fuelCan") then { if(!(_vehicle getVariable ["GeneratorFilled", false]) && !isNil "_fuelCan") then {
if(([player,_fuelCan] call BIS_fnc_invRemove) == 1) then { if(([player,_fuelCan] call BIS_fnc_invRemove) == 1) then {
_emptyCan = getText (configFile >> "CfgMagazines" >> _fuelCan >> "emptycan"); _emptyCan = getText (configFile >> "CfgMagazines" >> _fuelCan >> "containerEmpty");
player addMagazine _emptyCan; player addMagazine _emptyCan;
// mark as once filled // mark as once filled

View File

@@ -1,3 +1,6 @@
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
private ["_emptycan","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_randomJerryCan","_fireIntensity","_dis","_sfx","_finished"]; private ["_emptycan","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_randomJerryCan","_fireIntensity","_dis","_sfx","_finished"];
//Tent Object //Tent Object
@@ -24,11 +27,8 @@ _matchArray = [];
} count DayZ_fuelCans; } count DayZ_fuelCans;
//Make sure we have both components to create the fire. //Make sure we have both components to create the fire.
if ((count _fuelArray == 0)) exitwith { systemChat (localize ("str_setFireFuel")); }; if ((count _fuelArray == 0)) exitwith { dayz_actionInProgress = false; systemChat (localize ("str_setFireFuel")); };
if ((count _matchArray == 0)) exitwith { systemChat (localize ("str_setFireMatches")); }; if ((count _matchArray == 0)) exitwith { dayz_actionInProgress = false; systemChat (localize ("str_setFireMatches")); };
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
//Actionmenu tools //Actionmenu tools
player removeAction s_player_destroytent; player removeAction s_player_destroytent;
@@ -48,8 +48,7 @@ if (!_finished or (isNull _obj)) exitWith {
//Select random can from array //Select random can from array
_randomJerryCan = _fuelArray call BIS_fnc_selectRandom; _randomJerryCan = _fuelArray call BIS_fnc_selectRandom;
_name = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "displayName"); _emptycan = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "containerEmpty");
_emptycan = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "emptycan");
_fireIntensity = getNumber (configFile >> "CfgMagazines" >> _randomJerryCan >> "fireIntensity"); _fireIntensity = getNumber (configFile >> "CfgMagazines" >> _randomJerryCan >> "fireIntensity");
if !(_randomJerryCan in magazines player) exitWith { if !(_randomJerryCan in magazines player) exitWith {

View File

@@ -1,5 +1,6 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true; dayz_actionInProgress = true;
private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype", private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype",
"_emptycan","_started","_finished","_animState","_isRefuel","_type"]; "_emptycan","_started","_finished","_animState","_isRefuel","_type"];
@@ -8,7 +9,7 @@ _cantype = _array select 0;
_vehicle = _array select 1; _vehicle = _array select 1;
_type = typeOf _vehicle; _type = typeOf _vehicle;
_canSize = getNumber(configFile >> "cfgMagazines" >> _cantype >> "fuelQuantity"); _canSize = getNumber(configFile >> "cfgMagazines" >> _cantype >> "fuelQuantity");
_emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "emptycan"); _emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "containerEmpty");
_configVeh = configFile >> "cfgVehicles" >> _type; _configVeh = configFile >> "cfgVehicles" >> _type;
_capacity = getNumber(_configVeh >> "fuelCapacity"); _capacity = getNumber(_configVeh >> "fuelCapacity");
_nameType = getText(_configVeh >> "displayName"); _nameType = getText(_configVeh >> "displayName");