Skip to content

Commit

Permalink
Merge pull request #125 from ArmaOverthrow/dev
Browse files Browse the repository at this point in the history
0.7.3.3
  • Loading branch information
armazac authored Apr 28, 2017
2 parents f3679f8 + c7793f7 commit 36be43a
Show file tree
Hide file tree
Showing 35 changed files with 668 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,20 @@ if(_currentCls != "") then {
if(isNil "_plastic") then {
_plastic = 0;
};
_timetoproduce = _base + (round (_wood+1)) + (round (_steel * 3)) + (round (_plastic * 10));
_b = _base;
if(_base > 240) then {
_b = 240;
};
if(_base > 10000) then {
_b = 360;
};
if(_base > 20000) then {
_b = 480;
};
if(_base > 50000) then {
_b = 600;
};
_timetoproduce = _b + (round (_wood+1)) + (round (_steel * 3)) + (round (_plastic * 10));
if(_timetoproduce > 2880) then {_timetoproduce = 2880};
if(_timetoproduce < 10) then {_timetoproduce = 10};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ buildOnMouseMove = {
modeTarget setPos modeValue;
modeVisual setPos modeValue;
modeVisual setVectorDirAndUp [[0,0,-1],[0,1,0]];
modeTarget setVectorDirAndUp [[0,1,0],[0,1,0]];

if(modeMode == 0) then {
if(surfaceIsWater modeValue or (modeTarget distance modeCenter > modeMax) or ({!(_x isKindOf "Man") and (typeof _x != OT_item_Flag) and !(_x == modeTarget) and !(_x == modeVisual)} count(nearestObjects [modeTarget,[],10]) > 0)) then {
Expand Down Expand Up @@ -158,18 +159,31 @@ buildMoveCam = {
};

buildOnKeyUp = {
_key = _this select 1;
if (_key == 42 or _key == 54) then {
//Shift
OT_shiftHeld = false;
};
if(_this select 2) then {
buildCamRotating = false;
};
};

OT_shiftHeld = false;

buildRotation = 0;

buildOnKeyDown = {
_key = _this select 1;
_handled = false;
if(_this select 2) then {
buildCamRotating = true;
};
call {
if (_key == 42 or _key == 54) exitWith {
//Shift
OT_shiftHeld = true;
};
if (_key == 17) exitWith {
//W
_handled = true;
Expand All @@ -196,7 +210,7 @@ buildOnKeyDown = {
};

if(isNull modeTarget) exitWith {};
_dir = getDir modeTarget;
_dir = buildRotation;

if(_key == 57 and modeMode == 1) exitWith {
//Space
Expand All @@ -222,13 +236,15 @@ buildOnKeyDown = {
_newdir = _dir - _amt;
if(_newdir < 0) then {_newdir = 359};
modeTarget setDir (_newdir);
buildRotation = _newDir;
};
if (_key == 18) exitWith {
//E
_handled = true;
_newdir = _dir + _amt;
if(_newdir > 359) then {_newdir = 0};
modeTarget setDir (_newdir);
buildRotation = _newDir;
};
};
_handled
Expand Down Expand Up @@ -287,9 +303,11 @@ buildOnMouseUp = {
_clu enableDynamicSimulation true;
};
deleteVehicle modeVisual;

if(OT_shiftHeld) then {
modeSelected call build;
};
};
if(!isNull modeTarget and !canBuildHere) then {
if(!canBuildHere) then {
"You cannot build that there" call notify_minor;
};
};
Expand Down Expand Up @@ -368,10 +386,10 @@ build = {
modeVisual allowDamage false;
modeTarget setMass 0;
modeVisual setMass 0;
modeTarget setDir (getDir buildCam);
modeTarget setDir buildRotation;
modeTarget allowDamage false;

_txt = format ["<t size='1.1' color='#eeeeee'>%1</t><br/><t size='0.8' color='#bbbbbb'>$%2</t><br/><t size='0.4' color='#bbbbbb'>%3</t><br/><br/><t size='0.5' color='#bbbbbb'>Q,E = Rotate (Shift for smaller)<br/>Space = Change Type<br/>Left Click = Build It<br/>Right Click = Move Camera<br/>Mouse Wheel = Zoom</t>",_name,[modePrice, 1, 0, true] call CBA_fnc_formatNumber,_description];
_txt = format ["<t size='1.1' color='#eeeeee'>%1</t><br/><t size='0.8' color='#bbbbbb'>$%2</t><br/><t size='0.4' color='#bbbbbb'>%3</t><br/><br/><t size='0.5' color='#bbbbbb'>Q,E = Rotate (Shift for smaller)<br/>Space = Change Type<br/>Left Click = Build It<br/>Right Click = Move Camera<br/>Mouse Wheel = Zoom<br/>Shift = Build multiple</t>",_name,[modePrice, 1, 0, true] call CBA_fnc_formatNumber,_description];
[_txt, [safeZoneX + (0.8 * safeZoneW), (0.2 * safeZoneW)], 0.5, 10, 0, 0, 2] spawn bis_fnc_dynamicText;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ buyPerk = {
_txt = format["<t size=""2"">Trade</t><br/><t size=""1.1"">Level %1</t><br/><t size=""0.7"">Ability to negotiate better purchasing prices</t>",_fitness];
};
if(_perk == "stealth") then {
_txt = format["<t size=""2"">Stealth</t><br/><t size=""1.1"">Level %1</t><br/><t size=""0.7"">Less chance of NATO finding illegal items</t>",_fitness];
_txt = format["<t size=""2"">Stealth</t><br/><t size=""1.1"">Level %1</t><br/><t size=""0.7"">Less chance of people recognizing you or finding illegal items</t>",_fitness];
};

_ctrl ctrlSetStructuredText parseText _txt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@

private _veh = vehicle player;

private _isgen = call OT_fnc_playerIsGeneral;

if((_veh getVariable ["owner",""]) != (getplayeruid player)) then {
ctrlEnable [1605,false];
}else{
if(_veh getVariable ["OT_locked",false]) then {
ctrlSetText [1605,"Unlock Vehicle"];
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,8 @@ if(count _possible > 0) then {
};
};
}else{
ctrlEnable [1605,true];
ctrlEnable [1605,false];
ctrlEnable [1606,false];
ctrlSetText [1605,"Give Money"];
_type = "Player";
};
_civTxt = format["
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ _options pushback ["Accept",{
[OT_currentMissionData select 6,OT_currentMissionFaction,OT_currentMissionFactionName] spawn (OT_currentMissionData select 2);
}];

_options pushback ["I'll get back to you",{
//Do nothing really
}];

_options pushback ["Decline",{
//clear this mission so a new one will generate
OT_currentMissionData = nil;
[] call OT_fnc_getLocalMission;
}];

_options pushback ["Cancel",{
OT_currentMissionData = nil;
}];

_options spawn playerDecision;
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ _options pushback ["Accept",{
[OT_currentMissionData select 6,OT_currentMissionFaction,OT_currentMissionFactionName] spawn (OT_currentMissionData select 2);
}];

_options pushback ["I'll get back to you",{
//Do nothing really
}];

_options pushback ["Decline",{
//clear this mission so a new one will generate
OT_currentMissionData = nil;
[] call OT_fnc_getMission;
_civ = OT_interactingWith;
[_civ getvariable ["faction",""],_civ getvariable ["factionrepname",""]] call OT_fnc_getMission;
}];

_options pushback ["Cancel",{
OT_currentMissionData = nil;
}];

_options spawn playerDecision;
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ private _doSalvage = {
private _steel = 3;
private _plastic = 0;
private _cost = cost getVariable [typeof _wreck,[100,0,0,0]];
if((_cost select 2) > 10) then {
_steel = 4;
};
if((_cost select 2) > 20) then {
_steel = 5;
};
if((_cost select 2) > 40) then {
_steel = 6;
};
Expand Down Expand Up @@ -31,7 +37,7 @@ private _doSalvage = {
}else{
format["Salvaged: %1 x Steel",_steel] call notify_minor;
};

deleteVehicle _wreck;
};

private _objects = player nearEntities [["Car","ReammoBox_F","Air","Ship"],20];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if(typename _data != "ARRAY") exitWith {
"No save found, starting new game" remoteExec ["hint",bigboss,true];
};

private _cc = 0;

{
_key = _x select 0;
_val = _x select 1;
Expand Down Expand Up @@ -46,6 +48,7 @@ if(typename _data != "ARRAY") exitWith {
if(_key == "vehicles") then {
if(typename _val == "ARRAY") then {
_set = false;
_ccc = 0;
{
_type = _x select 0;

Expand All @@ -70,6 +73,9 @@ if(typename _data != "ARRAY") exitWith {
if(count (_x select 7) > 2) then {
[_veh, (_x select 7) select 2] call ace_refuel_fnc_setFuel;
};
if(count (_x select 7) > 3) then {
_veh setVariable ["OT_locked",(_x select 7) select 3,true];
};
};

_veh setPosATL _pos;
Expand Down Expand Up @@ -164,6 +170,10 @@ if(typename _data != "ARRAY") exitWith {
_mrkid setMarkerText format ["Camp %1",server getvariable [format["name%1",_owner],""]];
};
};
if(_ccc == 10) then {
_ccc = 0;
sleep 0.1;
};
}foreach(_val);
};
};
Expand All @@ -179,6 +189,11 @@ if(typename _data != "ARRAY") exitWith {
};
server setvariable [_key,_val,true];
};
_cc = _cc + 1;
if(_cc == 100) then {
_cc = 0;
sleep 0.1;
};
}foreach(_data);
sleep 0.1;
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,51 @@ if !([getpos player,_typecls] call OT_fnc_canPlace) exitWith {
};
};

modeValue = 0;
modeTarget = objNULL;
if(isNil "modeValue") then {
modeValue = 0;
};

modeTarget = objNULL;
modeRedo = false;
if(isNil "modeRotation") then {
modeRotation = 180;
};

if(_cost > 0) then {
_txt = format ["<t size='1.1' color='#eeeeee'>%1</t><br/><t size='0.8' color='#bbbbbb'>$%2</t><br/><t size='0.4' color='#bbbbbb'>%3</t><br/><br/><t size='0.5' color='#bbbbbb'>Q,E = Rotate<br/>Space = Change Type<br/>Enter = Done<br/>Esc = Cancel</t>",_typecls,[_cost, 1, 0, true] call CBA_fnc_formatNumber,_description];
_txt = format ["<t size='1.1' color='#eeeeee'>%1</t><br/><t size='0.8' color='#bbbbbb'>$%2</t><br/><t size='0.4' color='#bbbbbb'>%3</t><br/><br/><t size='0.5' color='#bbbbbb'>Q,E = Rotate<br/>Space = Change Type<br/>Enter = Done<br/>Shift = Rotate faster/Place multiple<br/>Esc = Cancel</t>",_typecls,[_cost, 1, 0, true] call CBA_fnc_formatNumber,_description];
[_txt, [safeZoneX + (0.8 * safeZoneW), (0.2 * safeZoneW)], 0.5, 10, 0, 0, 2] spawn bis_fnc_dynamicText;


_keyhandler = {
_handled = false;
_key = _this select 1;

_p = getDir modeTarget;
_v = getDir player;
_c = 360;

_dir = _c-((_c-_p)-(_c-_v));
if(_dir >= 360) then {_dir = _dir - 360};
_dir = modeRotation;

call {
if(_key == 19) exitWith {
//R

};
if (_key == 16) exitWith {
//Q
_handled = true;
_newdir = _dir - 1;
if(_newdir < 0) then {_newdir = 359};
_amt = 1;
if(_this select 2) then {_amt = 45};
_newdir = _dir - _amt;
if(_newdir < 0) then {_newdir = _newdir + 360};
modeTarget setDir (_newdir);
modeRotation = _newDir;
};
if (_key == 18) exitWith {
//E
_handled = true;
_newdir = _dir + 1;
if(_newdir > 359) then {_newdir = 0};
_amt = 1;
if(_this select 2) then {_amt = 45};
_newdir = _dir + _amt;
if(_newdir > 359) then {_newdir = _newdir - 360};
modeTarget setDir (_newdir);
modeRotation = _newDir;
};
if(_key == 57) exitWith {
//Space
Expand All @@ -79,7 +90,7 @@ if(_cost > 0) then {
if(_cls == "B_Boat_Transport_01_F") then {
_dir = _dir + 90;
};
modeTarget remoteExec ["enableSimulationGlobal false",2,false];
[modeTarget,false] remoteExec ["enableSimulationGlobal",2];
if(_cls == OT_item_Map) then {
modeTarget setObjectTextureGlobal [0,"\ot\ui\maptanoa.paa"];
};
Expand All @@ -95,6 +106,9 @@ if(_cost > 0) then {
//Enter
_handled = true;
modeFinished = true;
if(_this select 2) then {
modeRedo = true;
};
};
if(_key == 1) exitWith {
//ESC
Expand All @@ -107,21 +121,17 @@ if(_cost > 0) then {
_cls = modeValues select modeValue;
_handlerId = (findDisplay 46) displayAddEventHandler ["KeyDown",_keyhandler];
modeTarget = createVehicle [_cls, [0,0,0], [], 0, "CAN_COLLIDE"];
modeTarget remoteExec ["enableSimulationGlobal false",2];
modeTarget enableSimulation false;
[modeTarget,false] remoteExec ["enableSimulationGlobal",2];
if(_cls == OT_item_Map) then {
modeTarget setObjectTextureGlobal [0,"\ot\ui\maptanoa.paa"];
};
modeTarget enableSimulationGlobal false;


clearWeaponCargoGlobal modeTarget;
clearMagazineCargoGlobal modeTarget;
clearBackpackCargoGlobal modeTarget;
clearItemCargoGlobal modeTarget;

modeTarget attachTo [player,attachAt];

modeTarget setDir modeRotation;
if(_cls == "B_Boat_Transport_01_F") then {
_p = getDir modeTarget;
_v = getDir player;
Expand All @@ -146,8 +156,11 @@ if(_cost > 0) then {
if ([getpos player,_typecls] call OT_fnc_canPlace) then {
[-_cost] call money;
modeTarget setPosATL [getPosATL modeTarget select 0,getPosATL modeTarget select 1,getPosATL player select 2];
modeTarget remoteExec ["enableSimulationGlobal true",2];
modeTarget enableSimulation true;
if !((typeof modeTarget) in OT_miscables) then {
[modeTarget,true] remoteExec ["enableSimulationGlobal",2];
}else{
[modeTarget,false] remoteExec ["enableSimulationGlobal",2];
};
modeTarget setVariable ["owner",getPlayerUID player,true];
modeTarget remoteExec["initObjectLocal",0,modeTarget];
if(_typecls == "Base" or _typecls == "Camp") then {
Expand Down Expand Up @@ -241,4 +254,8 @@ if(_cost > 0) then {
modeTarget = nil;
modeCancelled = nil;
modeFinished = nil;
modeValue = nil;
if(modeRedo) then {
_typecls call placementMode;
}else{
modeValue = nil;
}
Loading

0 comments on commit 36be43a

Please sign in to comment.