Skip to content

Commit

Permalink
Merge pull request #131 from ultranoobian/master
Browse files Browse the repository at this point in the history
v0.5.0 Release candidate
  • Loading branch information
ultranoobian authored Mar 9, 2017
2 parents 8d256f7 + 0c3499c commit 6c08cd7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 15 deletions.
16 changes: 14 additions & 2 deletions source/INIT.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ if (!isMultiplayer) then {
if (isMultiplayer) then {

// Get the variables from the parameters lobby
_revive_activated = paramsArray select 0; // Revives, true or false
DUWSMP_CP_death_cost = paramsArray select 1;
_revive_activated = ["Revive", 1] call BIS_fnc_getParamValue;
DUWSMP_CP_death_cost = ["DeathPenalty", 1] call BIS_fnc_getParamValue;
staminaEnabled = ["Stamina", 0] call BIS_fnc_getParamValue;

if(staminaEnabled == 0) then {
staminaEnabled = false;
} else {
staminaEnabled = true;
};

if (support_armory_available) then {
hq_blu1 addaction ["<t color='#ff0066'>Armory (VA)</t>","bisArsenal.sqf", "", 0, true, true, "", "_this == player"];
{
Expand Down Expand Up @@ -152,6 +160,10 @@ if (hasInterface) then {
// init High Command
_handle = [] execVM "dialog\hc_init.sqf";
[] execVM "dialog\startup\weather_client.sqf";

if(!staminaEnabled) then {
player enableStamina false;
};
};

if (!isMultiplayer) then {
Expand Down
5 changes: 4 additions & 1 deletion source/duws_revive/respawnClicked.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ DUWS_player_injured = false;
player setpos [getpos hq_blu1 select 0, (getpos hq_blu1 select 1)+10];
player allowdamage true;

closedialog 0;
if(!staminaEnabled) then {
player enableStamina false;
};

closedialog 0;
11 changes: 9 additions & 2 deletions source/params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ class Params {
default = true;
};

class DeatPenalty {
class DeathPenalty {
title = "CP death penalty";
values[] = {1,2,3,4,5,6,7,8,9,10,0};
texts[] = {"1","2","3","4","5","6","7","8","9","10","No penalty"};
default = 1;
};
}

class Stamina {
title = "Stamina System";
values[] = {1,0};
texts[] = {"On","Off"};
default = 1;
};
}
41 changes: 31 additions & 10 deletions source/support/veh_refit.sqf
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
_vehicle = false;
_mounted_veh = vehicle player;
_uav = false;
_connected_uav = getConnectedUAV player;
_distanceFromHQ = 0;

if (commandpointsblu1<2) exitWith
if (commandpointsblu1<2) exitWith
{
["info",["Not enough command points","Not enough Command Points (2CP required)"]] call bis_fnc_showNotification;
};

if (_mounted_veh==player) exitWith {
Hint "You must be inside a vehicle to refit it."
if(_mounted_veh == player) then { // No vehicle to refit
if(!isNull _connected_uav) then { // UAV to refit
_uav = true;
_distanceFromHQ = hq_blu1 distance _connected_uav;
};
} else { // Vehicle takes priority over UAV;
_vehicle = true;
_distanceFromHQ = hq_blu1 distance _mounted_veh;
};

// check if near the officer
if ((hq_blu1 distance player)>100) exitWith {
["veh_refit_hint",["Too far away","Your vehicle must be near the base"]] call bis_fnc_showNotification;
if(!_vehicle && !_uav) exitWith {
hint "You must be connected to or inside a vehicle to refit it";
};

if (_distanceFromHQ > 100) exitWith {
["veh_refit_hint",["Too far away","Your vehicle must be near the base"]] call bis_fnc_showNotification;
};

if(_vehicle) then {
_mounted_veh setDamage 0;
_mounted_veh setFuel 1;
_mounted_veh setVehicleAmmoDef 1;
};

if(_uav) then { // If refitting UAV, check UAV distance from HQ.
_connected_uav setDamage 0;
_connected_uav setFuel 1;
_connected_uav setVehicleAmmoDef 1;
};

commandpointsblu1 = commandpointsblu1 - 2;
publicVariable "commandpointsblu1";
_mounted_veh setDamage 0;
_mounted_veh setFuel 1;
_mounted_veh setVehicleAmmoDef 1;
["veh_refit_hint",["Vehicle ready !","Your vehicle has been rearmed, refueled and repaired"]] call bis_fnc_showNotification;

0 comments on commit 6c08cd7

Please sign in to comment.