Skip to content

Commit

Permalink
Merge pull request #245 from gruppe-adler/fuelDrainForHeli
Browse files Browse the repository at this point in the history
Fuel drain for heli
  • Loading branch information
nomisum authored May 26, 2019
2 parents 62fc2db + 95e11d0 commit 58a7602
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 27 deletions.
25 changes: 19 additions & 6 deletions BC_buyables/factions/usa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ class USA {
condition = "true";
code = "[(_this select 0), [['mud','mud_olive'] select BC_IS_WOODLAND,1], ['tailgateHide',0,'tailgate_open',0,'cage_fold',0]] call BIS_fnc_initVehicle;";
vehicleInit = "[[],[]]";
};

class rhsusf_M978A4_usarmy_wd{
displayName = "HEMMTT FUEL";
description = "Fuel Truck.";
stock = 1;
spawnEmpty = 1;
wheelCargo = 3;
condition = "BC_IS_WOODLAND";
vehicleInit = "[['rhs_woodland',1],['hide_spare',0]]";
code = "(_this select 0) setVariable ['ace_rearm_isSupplyVehicle', false, true]; (_this select 0) setVariable ['ACE_isRepairVehicle', false, true];";
};

class rhsusf_M978A4_usarmy_d: rhsusf_M978A4_usarmy_wd {
condition = "!BC_IS_WOODLAND";
vehicleInit = "[['rhs_desert',1],['hide_spare',0]]";
};
};

Expand All @@ -69,7 +85,7 @@ class USA {
description = "1 GPS\nNO Thermals\nNO Benches";
price = 10;
stock = 2;
code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];(_this select 0) disableTIEquipment true;";
code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];(_this select 0) disableTIEquipment true; [(_this select 0)] call BC_setup_fnc_fuelDrain;";
spawnEmpty = 1;
vehicleInit = "[[],[]]";
};
Expand Down Expand Up @@ -106,11 +122,8 @@ class USA {
condition = "!BC_IS_WOODLAND";
vehicleInit = "[['rhs_desert',1],['hide_spare',0]]";
};


};


class Support {
displayName = "Support";
kindOf = "Vehicles";
Expand Down Expand Up @@ -174,7 +187,7 @@ class USA {
displayName = "UH-60M";
description = "1 GPS\nFRIES equipped";
stock = 7;
code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];[(_this select 0)] call ace_fastroping_fnc_equipFRIES;";
code = "(_this select 0) addItemCargoGlobal ['ACE_NVG_Wide',2];(_this select 0) addItemCargoGlobal ['ItemGPS',1];[(_this select 0)] call ace_fastroping_fnc_equipFRIES;[(_this select 0)] call BC_setup_fnc_fuelDrain;";
spawnEmpty = 1;
vehicleInit = "[[],[]]";
};
Expand Down Expand Up @@ -212,4 +225,4 @@ class USA {
spawnEmpty = 1;
};
};
};
};
6 changes: 3 additions & 3 deletions BC_buyables/params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ class BUYABLES_BLUFOR
title = "Blufor";
values[] = {0, 1, 2};
texts[] = {"bwGM", "USA", "USATanks"};
default = 0;
default = 1;
};

class BUYABLES_OPFOR
{
title = "Opfor";
values[] = {0, 1, 2};
texts[] = {"nvaGM", "Russia", "RussiaTanks"};
default = 0;
};
default = 1;
};
6 changes: 4 additions & 2 deletions BC_setup/cfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ class BC_setup {
class isOnWater;
class openSpawnDialog;
class teleportPlayer;
class TFARsettings { preInit = 1; };
class TFARsettings { preInit = 1; };
};

class server {
file = BC_setup\functions\server;

class defineWoodland { preInit = 1; };
class findRandomPos;
class fuelDrain;
class getHighestRankOfSide;
class getIslandCfgEntry { preInit = 1; };
class initialSpawnServer;
class registerDynamicGroup;
class removeFuelStations { postInit = 1; };
class showLeaderInformation;
class teleportAI;
class teleportAI;
};
};
16 changes: 16 additions & 0 deletions BC_setup/functions/server/fn_fuelDrain.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
params ["_heli"];

diag_log format ["fuelDrain %1", _heli];

[{
params ["_args", "_handle"];
_args params ["_heli"];

if (!alive _heli) exitWith { [_handle] call CBA_fnc_removePerFrameHandler; };

private _fuel = fuel _heli;
if (_fuel > 0 && isEngineOn _heli) then {
_heli setFuel (_fuel -0.001);
};

},1,[_heli]] call CBA_fnc_addPerFrameHandler;
20 changes: 20 additions & 0 deletions BC_setup/functions/server/fn_removeFuelStations.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if !(isServer) exitWith {};

private _pumps = nearestObjects [
[(worldSize/2), (worldSize/2), 0],
[
"Land_fs_feed_F", // Gas Station Pump (Altis)
"Land_FuelStation_01_pump_F", // Tanoa
"Land_FuelStation_02_pump_F",
"Land_FuelStation_Feed_F", // Stratis/Esseker
"Land_A_FuelStation_Shed", // Esseker/Chernarus
"Land_A_FuelStation_Feed" // Chernarus
],
worldSize,
true
];

{
_x setFuelCargo 0; // necessary?
[_x, 0] call ace_refuel_fnc_setFuel;
}forEach _pumps;
22 changes: 10 additions & 12 deletions description.ext
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// ISLAND CONFIGS
#include "cfgIslands.hpp"


#include "node_modules\grad-fortifications\grad_fortifications.hpp"
#include "node_modules\@gruppe-adler\replay\ui\defines.hpp"
#include "node_modules\@gruppe-adler\replay\ui\dialog.hpp"
Expand All @@ -13,10 +12,10 @@
#include "BC_buymenu\dialog\baseRsc.hpp"
#include "node_modules\grad-listBuymenu\grad_listBuymenu.hpp"

class CfgFunctions {
class CfgFunctions {
#include "BC_buymenu\cfgFunctions.hpp"
#include "BC_loadouts\cfgFunctions.hpp"

#include "grad_carryBoat\cfgFunctions.hpp"
#include "grad_islands\cfgFunctions.hpp"
#include "grad_civMarker\cfgFunctions.hpp"
Expand All @@ -30,7 +29,6 @@ class CfgFunctions {

#include "node_modules\grad-loadout\cfgFunctions.hpp"
#include "node_modules\grad-fortifications\cfgFunctions.hpp"

};

class RscTitles {
Expand Down Expand Up @@ -208,18 +206,18 @@ class Params
default = 0;
};

class ace_map_BFT_Enabled {
class ace_map_BFT_Enabled {
title = "Bluforce-Tracking active";
ACE_setting = 1;
values[] = {0, 1};
texts[] = {"False", "True"};
default = 1;
default = 1;
};
class PREPARATION_TIME {
title = "Preparation time";
values[] = {0,60,120,180,240,300,480,600,900};
texts[] = {"off","1min","2min","3min","4min","5min","8min","10min","15min"};
default = 300;
class PREPARATION_TIME {
title = "Preparation time";
values[] = {0,60,120,180,240,300,480,600,900};
texts[] = {"off","1min","2min","3min","4min","5min","8min","10min","15min"};
default = 300;
};
};

Expand Down Expand Up @@ -311,7 +309,7 @@ class CfgSounds
{
#include "grad_carryBoat\cfgSounds.hpp"
#include "BC_buymenu\cfgSounds.hpp"

class beam
{
name = "beam";
Expand Down
8 changes: 4 additions & 4 deletions mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class EditorData
};
class Camera
{
pos[]={1574.1765,13.194629,5206.876};
dir[]={0.86957532,-0.47109181,-0.14889812};
up[]={0.4644171,0.88202244,-0.07951919};
aside[]={-0.16880248,-2.3601169e-006,-0.98577642};
pos[]={1515.5316,138.04147,5505.4727};
dir[]={0.7568146,-0.56710517,0.3253994};
up[]={0.52104467,0.82358593,0.22403164};
aside[]={0.39503929,-1.7117709e-006,-0.91880232};
};
};
binarizationWanted=0;
Expand Down

0 comments on commit 58a7602

Please sign in to comment.