Skip to content

Commit

Permalink
Fitness perk + various tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
armazac committed Oct 24, 2016
1 parent 8402a2f commit f2928bf
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 202 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ while {_count < _numgroups} do {
_town = _this select 2;
_tskid = _this select 3;

_townpop = server getVariable [format["population%1",_town],0];

private ["_size","_active","_alive"];
sleep 20;
_size = count _soldiers;
Expand All @@ -177,6 +179,7 @@ while {_count < _numgroups} do {
};
}foreach(_soldiers);
if(count _alive <= _lostat) then {
_townpop remoteExec ["influence",0,false];
[_tskid, "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
_active = false;
}else{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ if((_ao select [0,1]) in ["A","E","I","O","a","e","i","o"]) then {_an = "An"};
if(_objective in OT_needsThe) then {
_o = "The ";
};
format["We have captured %1%2",_o,_town] remoteExec ["notify_good",0,false];
_effect = "";
if(_objective == "fuel depot") then {
_efect = "(Vehicles are now cheaper)";
};
format["Resistance has captured %1%2 (+100 Influence) %3",_o,_objective,_effect] remoteExec ["notify_good",0,false];
100 remoteExec ["influenceSilent",0,false];
}else{
if(((count _inrange) / (count _alive)) > 0.7) then {
//check for any alive enemies
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
closedialog 0;
createDialog "OT_dialog_char";
openMap false;

disableSerialization;

private _fitness = player getVariable ["OT_fitness",1];

private _ctrl = (findDisplay 8003) displayCtrl 1100;
_ctrl ctrlSetStructuredText parseText format["<t size=""2"">Fitness</t><br/><t size=""1.1"">Level %1</t><br/><t size=""0.7"">Increases the distance you can sprint</t>",_fitness];

getFitnessPrice = {
private _fitness = player getVariable ["OT_fitness",1];
private _price = 10;
if(_fitness == 2) then {
_price = 100;
};
if(_fitness == 3) then {
_price = 500;
};
if(_fitness == 4) then {
_price = 1000;
};
_price;
};

private _price = [] call getFitnessPrice;
ctrlSetText [1600,format["Increase Level (-%1 Influence)",_price]];

if(_fitness == 5) then {
ctrlShow [1600,false];
};

buyFitness = {
disableSerialization;

private _fitness = player getVariable ["OT_fitness",1];
private _price = [] call getFitnessPrice;
private _inf = player getVariable ["influence",0];

if(_inf < _price) exitWith {"You do not have enough influence" call notify_minor};

_fitness = _fitness + 1;
player setVariable ["OT_fitness",_fitness,true];
if(_fitness == 5) then {
ctrlEnable [1600,false];
};
player setVariable ["influence",_inf - _price,true];

private _ctrl = (findDisplay 8003) displayCtrl 1100;
_ctrl ctrlSetStructuredText parseText format["<t size=""2"">Fitness</t><br/><t size=""1.1"">Level %1</t><br/><t size=""0.7"">Increases the distance you can sprint</t>",_fitness];
_price = [] call getFitnessPrice;
ctrlSetText [1600,format["Increase Level (-%1 Influence)",_price]];

if(_fitness == 5) then {
ctrlShow [1600,false];
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ call {
player reveal _veh;
format["You bought a Quadcopter",_cls call ISSE_Cfg_Vehicle_GetName] call notify_minor;
playSound "3DEN_notificationDefault";
hint "To use a UAV, scroll your mouse wheel to 'Open UAV Terminal' then right click your green copter on the ground and 'Connect terminal to UAV'";
};
if(_cls in OT_allVehicles) exitWith {
_pos = (getpos player) findEmptyPosition [5,100,_cls];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,6 @@ class OT_dialog_command
// GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Xeqozy)
////////////////////////////////////////////////////////

class RscButton_1600: RscButton
{
idc = 1600;
text = "Fast Travel Unit/s"; //--- ToDo: Localize;
x = 0.0204687 * safezoneW + safezoneX;
y = 0.39 * safezoneH + safezoneY;
w = 0.0876563 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Fast travels all selected units that are not currently wanted (not implemented yet)"; //--- ToDo: Localize;
};
class RscButton_1601: RscButton
{
idc = 1601;
Expand All @@ -142,16 +132,6 @@ class OT_dialog_command
tooltip = "Commands first unit selected to walk to and open the closest container to them"; //--- ToDo: Localize;
action = "closeDialog 0;[] spawn openInventory;";
};
class RscButton_1603: RscButton
{
idc = 1603;
text = "Rearm"; //--- ToDo: Localize;
x = 0.0204687 * safezoneW + safezoneX;
y = 0.566 * safezoneH + safezoneY;
w = 0.0876563 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Commands all selected units to find ammo in the surrounding area (not implemented yet)"; //--- ToDo: Localize;
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////
Expand Down Expand Up @@ -226,8 +206,8 @@ class OT_dialog_main

class controls
{
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Giqadi)
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Bagoqi)
////////////////////////////////////////////////////////

class RscButton_1600: RscButton
Expand All @@ -254,104 +234,104 @@ class OT_dialog_main
class RscButton_1601: RscButton
{
idc = 1601;
action = "closeDialog 0;createDialog 'OT_dialog_place'";

text = "Place"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
y = 0.577 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.066 * safezoneH;
action = "closeDialog 0;createDialog 'OT_dialog_place'";
tooltip = "Place smaller items around houses you own or at friendly bases";
tooltip = "Place smaller items around houses you own or at friendly bases"; //--- ToDo: Localize;
};
class RscButton_1602: RscButton
{
idc = 1602;
action = "closeDialog 0;[] spawn buildMenu";

text = "Build"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
y = 0.654 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.066 * safezoneH;
action = "closeDialog 0;[] spawn buildMenu";
tooltip = "Build structures in towns and at bases";
tooltip = "Build structures in towns and at bases"; //--- ToDo: Localize;
};
class RscButton_1603: RscButton
{
idc = 1603;
action = "[] spawn manageRecruits;";

text = "Manage Recruits"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
y = 0.731 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.066 * safezoneH;
action = "[] spawn manageRecruits;";
};
class RscPicture_1200: RscPicture
{
idc = 1200;

text = "#(argb,8,8,3)color(0,0,0,0)";
x = 0.762969 * safezoneW + safezoneX;
y = 0.368 * safezoneH + safezoneY;
w = 0.113437 * safezoneW;
h = 0.143 * safezoneH;
x = 45.5 * GUI_GRID_W + GUI_GRID_X;
y = 6.5 * GUI_GRID_H + GUI_GRID_Y;
w = 11 * GUI_GRID_W;
h = 6.5 * GUI_GRID_H;
};
class RscButton_1605: RscButton
{
idc = 1605;
action = "closeDialog 0;[] spawn talkToCiv";

text = "Talk"; //--- ToDo: Localize;
x = 0.881562 * safezoneW + safezoneX;
y = 0.522 * safezoneH + safezoneY;
w = 0.113437 * safezoneW;
h = 0.044 * safezoneH;
action = "closeDialog 0;[] spawn talkToCiv";
};
};
class RscPicture_1201: RscPicture
{
idc = 1201;

text = "#(argb,8,8,3)color(0,0,0,0)";
x = 0.762969 * safezoneW + safezoneX;
y = 0.632 * safezoneH + safezoneY;
w = 0.113437 * safezoneW;
h = 0.143 * safezoneH;
x = 45.5 * GUI_GRID_W + GUI_GRID_X;
y = 18.5 * GUI_GRID_H + GUI_GRID_Y;
w = 11 * GUI_GRID_W;
h = 6.5 * GUI_GRID_H;
};
class RscButton_1608: RscButton
{
idc = 1608;
action = "closeDialog 0;[] call buyBuilding";

text = "Buy"; //--- ToDo: Localize;
action = "closeDialog 0;[] call buyBuilding";
x = 0.881562 * safezoneW + safezoneX;
y = 0.786 * safezoneH + safezoneY;
w = 0.113437 * safezoneW;
h = 0.044 * safezoneH;
tooltip = "Purchase this building";
tooltip = "Purchase this building"; //--- ToDo: Localize;
};
class RscButton_1609: RscButton
{
idc = 1609;
action = "closeDialog 0;[] call leaseBuilding";

text = "Lease"; //--- ToDo: Localize;
x = 0.881562 * safezoneW + safezoneX;
y = 0.841 * safezoneH + safezoneY;
w = 0.0515625 * safezoneW;
h = 0.044 * safezoneH;
action = "closeDialog 0;[] call leaseBuilding";
tooltip = "Lease this building";
tooltip = "Lease this building"; //--- ToDo: Localize;
};
class RscButton_1610: RscButton
{
idc = 1610;
action = "closeDialog 0;[] spawn setHome";

text = "Set Home"; //--- ToDo: Localize;
action = "closeDialog 0;[] spawn setHome";
x = 0.943438 * safezoneW + safezoneX;
y = 0.841 * safezoneH + safezoneY;
w = 0.0515625 * safezoneW;
h = 0.044 * safezoneH;
tooltip = "Make this your home (respawn point)";
tooltip = "Make this your home (respawn point)"; //--- ToDo: Localize;
};
class RscStructuredText_1101: RscStructuredText
{
Expand All @@ -373,13 +353,84 @@ class OT_dialog_main
h = 0.143 * safezoneH;
colorBackground[] = {0,0,0,0.4};
};
class RscButton_1611: RscButton
{
idc = 1611;
action = "[] spawn characterSheet;";

text = "Character Sheet"; //--- ToDo: Localize;
x = 0.00499997 * safezoneW + safezoneX;
y = 0.808 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.066 * safezoneH;
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////



};
};
class OT_dialog_char
{
idd=8003;
movingenable=false;

class controls
{
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Pejity)
////////////////////////////////////////////////////////

class RscStructuredText_1100: RscStructuredText
{
idc = 1100;
text = ""; //--- ToDo: Localize;
x = 0.273125 * safezoneW + safezoneX;
y = 0.269 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.143 * safezoneH;
colorBackground[] = {0,0,0,0.5};
colorActive[] = {0,0,0,0.5};
};
class RscButton_1600: RscButton
{
idc = 1600;
text = "Increase Level (-10 Influence)"; //--- ToDo: Localize;
x = 0.273125 * safezoneW + safezoneX;
y = 0.423 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.044 * safezoneH;
action="[] call buyFitness;"
};
class RscStructuredText_1101: RscStructuredText
{
idc = 1101;
text = "<t size=""2"">TBC</t><br/><t size=""1.1"">Level 1</t><br/>More perks coming soon"; //--- ToDo: Localize;
x = 0.427812 * safezoneW + safezoneX;
y = 0.269 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.143 * safezoneH;
colorBackground[] = {0,0,0,0.3};
colorActive[] = {0,0,0,0.3};
};
class RscStructuredText_1102: RscStructuredText
{
idc = 1102;
text = "<t size=""2"">TBC</t><br/><t size=""1.1"">Level 1</t><br/>More perks coming soon"; //--- ToDo: Localize;
x = 0.5825 * safezoneW + safezoneX;
y = 0.269 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.143 * safezoneH;
colorBackground[] = {0,0,0,0.3};
colorActive[] = {0,0,0,0.3};
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////
}
}


class OT_dialog_tute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,22 @@ while {true} do {
[_x,"Lease Income",format["Lease income for this period: $%1",_lease]] call BIS_fnc_createLogRecord;
};
}foreach(allPlayers);
_inf remoteExec ["influence",0,false];


_numPlayers = count(allPlayers);
if(isNil "_total") then {_total = 0};
_perPlayer = round(_total / _numPlayers);
if(_perPlayer > 0) then {
_inf remoteExec ["influenceSilent",0,false];
{
_money = _x getVariable ["money",0];
_x setVariable ["money",_money+_perPlayer,true];
[_x,"Tax Income",format["Tax income for this period: $%1",_perPlayer]] call BIS_fnc_createLogRecord;
[_x,"Tax Income",format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf]] call BIS_fnc_createLogRecord;
}foreach(allPlayers);
format ["Tax income: $%1",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber] remoteExec ["notify_good",0,true];
};
format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf] remoteExec ["notify_good",0,true];
}else{
_inf remoteExec ["influence",0,false];
};

waitUntil {sleep 5;(date select 3) != _lasthour}; //do actions on the hour
};
Expand Down
Loading

0 comments on commit f2928bf

Please sign in to comment.