Skip to content

Commit

Permalink
Rebalancing of static weapons
Browse files Browse the repository at this point in the history
  • Loading branch information
armazac committed Aug 25, 2016
1 parent 4fbca15 commit 014ce5a
Show file tree
Hide file tree
Showing 34 changed files with 206 additions and 116 deletions.
4 changes: 2 additions & 2 deletions AI/carDealer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
{[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit]};
{[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit]};

_unit forceAddUniform (AIT_clothes_carDealers call BIS_fnc_selectRandom);

Expand Down
2 changes: 1 addition & 1 deletion AI/checkpoint.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ while {!(isNull _group) and count (units _group) > 0} do {

{
_cls = _x select 0;
if(_cls in AIT_allWeapons + AIT_allMagazines + AIT_illegalHeadgear + AIT_illegalVests + AIT_illegalItems) exitWith {
if(_cls in AIT_allWeapons + AIT_allMagazines + AIT_illegalHeadgear + AIT_illegalVests + AIT_illegalItems + AIT_allStaticBackpacks) exitWith {
_msg = "NATO found illegal items";
_unit setCaptive false;
{
Expand Down
6 changes: 2 additions & 4 deletions AI/civilian.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);

_counter = 0;
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];

_unit forceAddUniform (AIT_clothes_locals call BIS_fnc_selectRandom);

Expand Down
2 changes: 1 addition & 1 deletion AI/civilianGroup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ private ["_group","_home","_pos","_start","_wp","_buildings","_idx","_end"];

_group = _this select 0;
_home = _this select 1;
_pos = getpos _home;
_pos = _home;

_start = getpos ((units _group) select 0);

Expand Down
4 changes: 2 additions & 2 deletions AI/crimLeader.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
_unit forceAddUniform (AIT_CRIM_Clothes call BIS_fnc_selectRandom);


Expand Down
4 changes: 2 additions & 2 deletions AI/criminal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
_unit forceAddUniform (AIT_CRIM_Clothes call BIS_fnc_selectRandom);

removeAllItems _unit;
Expand Down
4 changes: 2 additions & 2 deletions AI/gunDealer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];

_unit setVariable ["NOAI",true,false];

Expand Down
4 changes: 2 additions & 2 deletions AI/harbor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];

_unit forceAddUniform (AIT_clothes_harbor call BIS_fnc_selectRandom);

Expand Down
4 changes: 2 additions & 2 deletions AI/mobBoss.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
_unit forceAddUniform AIT_clothes_mob;

removeAllItems _unit;
Expand Down
4 changes: 2 additions & 2 deletions AI/mobster.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
_unit forceAddUniform AIT_clothes_mob;

removeAllItems _unit;
Expand Down
4 changes: 2 additions & 2 deletions AI/shopkeeper.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

_unit setFace (AIT_faces_local call BIS_fnc_selectRandom);
_unit setSpeaker (AIT_voices_local call BIS_fnc_selectRandom);
[_unit, (AIT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (AIT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
_unit forceAddUniform (AIT_clothes_shops call BIS_fnc_selectRandom);

_unit setvariable ["owner","self"];
Expand Down
49 changes: 20 additions & 29 deletions actions/buy.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -84,47 +84,38 @@ call {
};
if(_cls in AIT_allMagazines) exitWith {
player setVariable ["money",_money-_price,true];

_house = player getVariable "home";
_box = false;
{
_owner = _x getVariable "owner";
if(!isNil "_owner") then {
if(_owner == getplayerUID player) exitWith {_box = _x};
};
}foreach(nearestObjects [getpos player, [AIT_item_Storage],1200]);
if(typename _box == "OBJECT") then {
_box addMagazineCargo [_cls,1];
"Delivered to your closest ammobox" call notify_minor;
}else{
player addMagazine _cls;
};
player addMagazine _cls;
playSound "3DEN_notificationDefault";
};
_b = player getVariable "shopping";
_bp = _b getVariable "shop";

_s = [];
_active = server getVariable [format["activeshopsin%1",_town],[]];
{
_pos = _x select 0;
if(format["%1",_pos] == _bp) exitWith {
_s = _x select 1;
};
}foreach(_active);

_handled = true;
if(_cls in AIT_allBackpacks) then {
if(_cls in (AIT_allBackpacks + AIT_allStaticBackpacks)) then {
if(backpack player != "") exitWith {"You already have a backpack" call notify_minor;_handled = false};
}else{
if!([player,_cls] call canFit) exitWith {"There is not enough room in your inventory" call notify_minor;_handled = false};
};
if(_handled) then {

if(_handled) then {
playSound "3DEN_notificationDefault";
if (_cls in AIT_illegalItems) exitWith {
player setVariable ["money",_money-_price,true];
player addItem _cls;
};
if (_cls in AIT_allStaticBackpacks) exitWith {
player setVariable ["money",_money-_price,true];
player addBackpack _cls;
};
_b = player getVariable ["shopping",objNull];
_bp = _b getVariable "shop";

_s = [];
_active = server getVariable [format["activeshopsin%1",_town],[]];
{
_pos = _x select 0;
if(format["%1",_pos] == _bp) exitWith {
_s = _x select 1;
};
}foreach(_active);

_done = false;
_soldout = false;
_stockidx = 0;
Expand Down
6 changes: 3 additions & 3 deletions actions/placementMode.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(_cost > _money) exitWith {format["You cannot afford that, you need $%1",_cost

if !([getpos player,_typecls] call canPlace) exitWith {
call {
if(_typecls == "Camp") exitWith {"Camps cannot be near a structure you already own" call notify_minor};
if(_typecls == "Camp") exitWith {"Camps cannot be near another building" call notify_minor};
if(_typecls == "Base") exitWith {"Bases cannot be near a town, NATO installation or existing base" call notify_minor};
"You must be near a base, camp or owned structure" call notify_minor
};
Expand Down Expand Up @@ -192,15 +192,15 @@ if(_cost > 0) then {
call {
if(_typecls == "Camp") exitWith {"Camps cannot be near a structure you already own" call notify_minor};
if(_typecls == "Base") exitWith {"Bases cannot be near a town, NATO installation or existing base" call notify_minor};
"You must be near a base, camp or owned structure" call notify_minor
"You must be near a base or owned building" call notify_minor
};
detach modeTarget;
deleteVehicle modeTarget;
};
};
}else{
if(_typecls != "Camp" and _typecls != "Base") then {
"To place this item you must be near a base or a building/camp that you own" call notify_minor;
"To place this item you must be near a base or a building that you own" call notify_minor;
}else{
"You cannot place a camp/base near a building you own. Bases must also be built away from towns." call notify_minor;
};
Expand Down
17 changes: 3 additions & 14 deletions dialogs/place.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class AIT_dialog_place

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

class RscButton_1600: RscButton
Expand Down Expand Up @@ -139,18 +139,7 @@ class AIT_dialog_place
w = 0.0928125 * safezoneW;
h = 0.088 * safezoneH;
tooltip = "Creates a fast travel destination for all friendlies, allows building of military structures"; //--- ToDo: Localize;
};
class RscButton_1607: RscButton
{
idc = 1607;
text = "Deploy"; //--- ToDo: Localize;
x = 0.422656 * safezoneW + safezoneX;
y = 0.687 * safezoneH + safezoneY;
w = 0.154687 * safezoneW;
h = 0.099 * safezoneH;
tooltip = "Deploy a static weapon or rubber boat"; //--- ToDo: Localize;
action = "closeDialog 0;'Deploy' spawn placementMode";
};
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////
Expand Down
Binary file added equip/m/m_100rnd_127x99_mag.paa
Binary file not shown.
11 changes: 1 addition & 10 deletions events/entityKilled.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@ _killer = _this select 1;
_killer setVariable ["lastkill",time,true];
_town = (getpos _me) call nearestTown;

if(isPlayer _me) exitWith {
_myuid = getPlayerUID _me;
_me setVariable ["spawntrack",true,false]; //Tells the spawner to consider this dead body within spawn distance
{
_uid = _x getVariable "player_uid";
if(_uid == _myuid and _x != _me) then {
deleteVehicle _x;
};
}foreach(allDeadMen);
};
if(isPlayer _me) exitWith {};

_garrison = _me getvariable "garrison";
_vehgarrison = _me getvariable "vehgarrison";
Expand Down
2 changes: 1 addition & 1 deletion factions/GUER.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ while {true} do {
if(((side _x == resistance) or (_x call hasOwner)) and (alive _x) and (!isPlayer _x)) then {};
};
sleep 0.01;
}foreach(allunits);
}foreach(allunits);
spawner setVariable ["track",_track,false];
};
1 change: 1 addition & 0 deletions funcs/canPlace.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if !(_isbase) then {
_estate = _pos call getNearestRealEstate;
if(typename _estate == "ARRAY") then {
_b = _estate select 0;
if(typeof _b == AIT_item_Tent) exitWith {_canplace = false};
if(_b call hasOwner) then {
_owner = _b getVariable "owner";
if(_owner != getplayeruid player) then {
Expand Down
2 changes: 1 addition & 1 deletion funcs/getPrice.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _cls = _this select 1;
_standing = _this select 2;
_price = 0;

if(_cls in (AIT_allWeapons + AIT_allMagazines + AIT_illegalItems)) then {
if(_cls in (AIT_allWeapons + AIT_allMagazines + AIT_illegalItems + AIT_allStaticBackpacks)) then {
_stock = server getVariable format["gunstock%1",_town];
{
if((_x select 0) == _cls) exitWith {_price = _x select 1};
Expand Down
2 changes: 1 addition & 1 deletion funcs/inSpawnDistance.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
({alive _x and (_this distance _x) < AIT_spawnDistance} count (allPlayers + (spawner getVariable ["track",[]])) > 0)
({(alive _x or typename (_x getVariable ["player_uid",false]) == "STRING") and (_this distance _x) < AIT_spawnDistance} count (allPlayers + alldeadmen + (spawner getVariable ["track",[]])) > 0)
/*
//So zeus spawns, a'la ALiVE
_zeus = getpos curatorCamera;
Expand Down
4 changes: 2 additions & 2 deletions funcs/info.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ ISSE_Cfg_MagazineInfo = {
""
};

_DescLong = if (isText(_cfg >> "Library" >> "libTextDesc")) then {
getText(_cfg >> "Library" >>"libTextDesc")
_DescLong = if (isText(_cfg >> "descriptionShort")) then {
getText(_cfg >> "descriptionShort")
}
else {
""
Expand Down
34 changes: 34 additions & 0 deletions funcs/progressBar.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
if (!hasInterface) exitWith {};

_counter = _this select 0;
_del = _this select 1;

if !(_del) then {
with uiNamespace do {
ctrlDelete (uiNamespace getVariable "pBar");
ctrlDelete (uiNamespace getVariable "pBartext");
pBar = findDisplay 46 ctrlCreate ["RscProgress", -1];
pBar ctrlSetPosition [ 0.345, -0.2 ];
pBar progressSetPosition 0;
pBar ctrlSetTextColor [0,0.5,0,1];
pBar ctrlCommit 0;

[ "TIMER", "onEachFrame", {
params[ "_start", "_end" ];
_progress = linearConversion[ _start, _end, time, 0, 1 ];
(uiNamespace getVariable "pBar") progressSetPosition _progress;

if ( _progress > 1 ) then {
[ "TIMER", "onEachFrame" ] call BIS_fnc_removeStackedEventHandler;
ctrlDelete (uiNamespace getVariable "pBar");

};
}, [ time, time + _counter ] ] call BIS_fnc_addStackedEventHandler;
};
}
else {
with uiNamespace do {
ctrlDelete (uiNamespace getVariable "pBar");
ctrlDelete (uiNamespace getVariable "pBartext");
};
};
1 change: 1 addition & 0 deletions initFuncs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ displayShopPic = compileFinal preProcessFileLineNumbers "funcs\displayShopPic.sq
dumpStuff = compileFinal preProcessFileLineNumbers "funcs\dumpStuff.sqf";
takeStuff = compileFinal preProcessFileLineNumbers "funcs\takeStuff.sqf";
canPlace = compileFinal preProcessFileLineNumbers "funcs\canPlace.sqf";
progressBar = compileFinal preProcessFileLineNumbers "funcs\progressBar.sqf";

//AI init
initCivilian = compileFinal preProcessFileLineNumbers "AI\civilian.sqf";
Expand Down
Loading

0 comments on commit 014ce5a

Please sign in to comment.