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";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS20L_CAN_DESC;
sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions {
class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -79,6 +81,10 @@ class ItemJerryMixed: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed4",1}};
input[] = {{"ItemJerryMixed",1}};
};
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
};
class ItemJerryMixed4: CA_Magazine {
@@ -90,6 +96,8 @@ class ItemJerryMixed4: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS16L_CAN_DESC;
sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions {
class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -99,6 +107,10 @@ class ItemJerryMixed4: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed3",1}};
input[] = {{"ItemJerryMixed4",1}};
};
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
};
class ItemJerryMixed3: CA_Magazine {
@@ -110,6 +122,8 @@ class ItemJerryMixed3: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS12L_CAN_DESC;
sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions {
class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -119,6 +133,10 @@ class ItemJerryMixed3: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed2",1}};
input[] = {{"ItemJerryMixed3",1}};
};
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
};
class ItemJerryMixed2: CA_Magazine {
@@ -130,6 +148,8 @@ class ItemJerryMixed2: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS8L_CAN_DESC;
sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions {
class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -139,6 +159,10 @@ class ItemJerryMixed2: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerryMixed1",1}};
input[] = {{"ItemJerryMixed2",1}};
};
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
};
class ItemJerryMixed1: CA_Magazine {
@@ -150,6 +174,8 @@ class ItemJerryMixed1: CA_Magazine {
picture = "\dayz_equip\textures\equip_jerrycan_ca.paa";
descriptionShort = $STR_EPOCH_CHAINSAW_MIXEDGAS4L_CAN;
sfx = "refuel";
containerEmpty = "ItemJerrycanEmpty";
class ItemActions {
class Crafting {
text = $STR_EPOCH_CHAINSAW_MIXEDGAS_CAN_ACTION;
@@ -159,6 +185,10 @@ class ItemJerryMixed1: CA_Magazine {
output[] = {{"CSGAS",1},{"ItemJerrycanEmpty",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";
picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa";
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
{
@@ -286,7 +294,14 @@ class ItemFuelBarrel: CA_Magazine
picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa";
descriptionShort = $STR_EPOCH_FUELBARREL_DESC;
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
{
@@ -1198,6 +1213,14 @@ class ItemMethylaminBarrel : ItemOilBarrel
{
displayName = $STR_EPOCH_METHYLAMINEBARREL;
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

View File

@@ -20,10 +20,17 @@ class ItemJerrycan : ItemJerrycanEmpty
descriptionShort = $STR_ITEM_DESC_JERRYCAN;
fuelQuantity = 20;
emptycan = "ItemJerrycanEmpty";
containerEmpty = "ItemJerrycanEmpty";
//used for tent burning
fireIntensity = 6;
class ItemActions {
class Empty {
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
};
class ItemFuelcanEmpty : ItemJerrycanEmpty
@@ -46,8 +53,15 @@ class ItemFuelcan : ItemFuelcanEmpty
descriptionShort = $STR_ITEM_DESC_FUELCAN;
fuelQuantity = 5;
emptycan = "ItemFuelcanEmpty";
containerEmpty = "ItemFuelcanEmpty";
//used for tent burning
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;};
dayz_actionInProgress = true;
private ["_vehicle","_finished","_soundSource","_fuelCan","_emptyCan"];
player removeAction s_player_fillgen;
s_player_fillgen = 1;
@@ -24,16 +24,16 @@ _fuelCan = nil;
if (_finished) then {
// take fuel can and replace with empty
if(!(_vehicle getVariable ["GeneratorFilled", false]) && !isNil "_fuelCan") 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;
// mark as once filled
_vehicle setVariable ["GeneratorFilled", true,true];
// Start generator
_vehicle setVariable ["GeneratorRunning", true,true];
@@ -46,7 +46,7 @@ if (_finished) then {
localize "str_epoch_player_28" call dayz_rollingMessages;
["Working",0,[0,1,3,0]] call dayz_NutritionSystem;
};
} else {
} else {
// Start generator
_vehicle setVariable ["GeneratorRunning", true,true];
@@ -63,4 +63,4 @@ if (_finished) then {
};
dayz_actionInProgress = false;
s_player_fillgen = -1;
s_player_fillgen = -1;

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"];
//Tent Object
@@ -24,11 +27,8 @@ _matchArray = [];
} count DayZ_fuelCans;
//Make sure we have both components to create the fire.
if ((count _fuelArray == 0)) exitwith { systemChat (localize ("str_setFireFuel")); };
if ((count _matchArray == 0)) exitwith { systemChat (localize ("str_setFireMatches")); };
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
if ((count _fuelArray == 0)) exitwith { dayz_actionInProgress = false; systemChat (localize ("str_setFireFuel")); };
if ((count _matchArray == 0)) exitwith { dayz_actionInProgress = false; systemChat (localize ("str_setFireMatches")); };
//Actionmenu tools
player removeAction s_player_destroytent;
@@ -46,10 +46,9 @@ if (!_finished or (isNull _obj)) exitWith {
//Jerry can system ** Needs redoing
//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 >> "emptycan");
_emptycan = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "containerEmpty");
_fireIntensity = getNumber (configFile >> "CfgMagazines" >> _randomJerryCan >> "fireIntensity");
if !(_randomJerryCan in magazines player) exitWith {
@@ -81,4 +80,4 @@ _obj inflame true;
//_obj spawn player_fireMonitor;
localize "str_success_tent_destroyed" call dayz_rollingMessages;
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

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