Add launcher handling to advanced trading

This commit is contained in:
ebaydayz
2016-10-31 13:07:07 -04:00
parent cd48b883a7
commit 866358e4d0
10 changed files with 125 additions and 17 deletions

View File

@@ -68,7 +68,7 @@
[CHANGED] With R3Fweight on overburdened players are now forced to move slowly instead of being knocked out. The scream was also removed. #1145 @icomrade @ebaydayz [CHANGED] With R3Fweight on overburdened players are now forced to move slowly instead of being knocked out. The scream was also removed. #1145 @icomrade @ebaydayz
[CHANGED] Abort and respawn are now disabled immediately in the pause menu onLoad to compensate for low fps delay. @ebaydayz [CHANGED] Abort and respawn are now disabled immediately in the pause menu onLoad to compensate for low fps delay. @ebaydayz
[CHANGED] Player_onPause is now customizable by admins along with the new unscheduled fn_pauseMenuChecks. #1340 @Rimblock @ebaydayz [CHANGED] Player_onPause is now customizable by admins along with the new unscheduled fn_pauseMenuChecks. #1340 @Rimblock @ebaydayz
[CHANGED] Satchel charges and mines now take one inventory slot instead of two. @ebaydayz [CHANGED] Satchel charges, mines and launcher rounds now take one inventory slot instead of multiple. @ebaydayz
[FIXED] Zombies now target and attack players correctly with 1.8.8 code [FIXED] Zombies now target and attack players correctly with 1.8.8 code
[FIXED] Server position sync bug after falling unconscious. Fixes AI on server not seeing the player after knock out and position revert after relog. #1522 @ebaydayz [FIXED] Server position sync bug after falling unconscious. Fixes AI on server not seeing the player after knock out and position revert after relog. #1522 @ebaydayz

View File

@@ -4,7 +4,7 @@ class CfgMagazines
class CA_Magazine; class CA_Magazine;
class HandGrenade; class HandGrenade;
class TimeBomb; class TimeBomb;
class CA_LauncherMagazine;
//Weapon magazines //Weapon magazines

View File

@@ -0,0 +1,81 @@
// Use single slot for everything, let R3F weight handle load
class M136 : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class Javelin : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class AT13 : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class PG7V : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class PG7VL : PG7V {
type = WeaponSlotItem;
};
class PG7VR : PG7V {
type = WeaponSlotItem;
};
class OG7 : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class PG9_AT : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class OG9_HE : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class Stinger : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class SMAW_HEDP : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class SMAW_HEAA : SMAW_HEDP {
type = WeaponSlotItem;
};
class MAAWS_HEDP : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class MAAWS_HEAT : MAAWS_HEDP {
type = WeaponSlotItem;
};
class Strela : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class RPG18 : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class Igla : Strela {
type = WeaponSlotItem;
};
class 2Rnd_Igla : Igla {
type = WeaponSlotItem;
};
class NLAW : CA_LauncherMagazine {
type = WeaponSlotItem;
};
class Dragon_EP1 : CA_LauncherMagazine {
type = WeaponSlotItem;
};

View File

@@ -17,5 +17,6 @@
#include "Misc.hpp" //CZ550, Lee-Enfield, Winchester 1866 #include "Misc.hpp" //CZ550, Lee-Enfield, Winchester 1866
#include "Shotgun.hpp" #include "Shotgun.hpp"
#include "Arrows.hpp" #include "Arrows.hpp"
#include "LauncherAmmo.hpp"
#undef COMBINE_MAG #undef COMBINE_MAG

View File

@@ -50,10 +50,12 @@ if (_selection == 2) then { //gear
_allowedBinocular = 2; _allowedBinocular = 2;
_duplicate = false; _duplicate = false;
{ {
_type = getNumber (configFile >> "CfgWeapons" >> _x >> "type"); switch getNumber (configFile >> "CfgWeapons" >> _x >> "type") do {
if (_type == 2) then { _allowedSidearm = 0; }; // WeaponSlotHandGun (occupies pistol slot) case 2: {_allowedSidearm = 0;}; //Pistol
if (_type == 4096) then { _allowedBinocular = _allowedBinocular - 1; }; // WeaponSlotBinocular case 4: {_allowedBackpacks = 0;}; //Launcher
if (_type == 131072) then { _allowedTools = _allowedTools - 1; }; // WeaponSlotInventory (toolbelt slot) case 4096: {_allowedBinocular = _allowedBinocular - 1;}; //Binocular slot
case 131072: {_allowedTools = _allowedTools - 1;}; //Toolbelt slot
};
if (_x in _toolClasses) exitWith {_duplicate = true;}; // Forbid purchasing duplicate tools into gear if (_x in _toolClasses) exitWith {_duplicate = true;}; // Forbid purchasing duplicate tools into gear
} count (weapons player); } count (weapons player);

View File

@@ -66,7 +66,7 @@ if (Z_SingleCurrency) then {
if ('PistolCore' in _parentClasses) then { if ('PistolCore' in _parentClasses) then {
_sidearmToBuy = _sidearmToBuy + (_x select 9); _sidearmToBuy = _sidearmToBuy + (_x select 9);
} else { } else {
_primaryToBuy = _primaryToBuy + (_x select 9); _primaryToBuy = _primaryToBuy + (_x select 9); //Include launchers in this count since they also take up 10 slots in backpack
}; };
}; };
_priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9)); _priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9));

View File

@@ -15,10 +15,13 @@ if (_selection == 2) then { //gear
_allowedPrimary = if (_p != "") then {0} else {1}; _allowedPrimary = if (_p != "") then {0} else {1};
if (DZE_TwoPrimaries == 2 && dayz_onBack == "") then { _allowedPrimary = _allowedPrimary + 1; }; if (DZE_TwoPrimaries == 2 && dayz_onBack == "") then { _allowedPrimary = _allowedPrimary + 1; };
_backpack = unitBackpack player;
_allowedBackpacks = if (isNull _backpack) then {1} else {0};
_allowedSidearm = 1; _allowedSidearm = 1;
{ {
if (getNumber (configFile >> "CfgWeapons" >> _x >> "type") == 2) exitWith { // 2 = WeaponSlotHandGun (occupies pistol slot) switch getNumber (configFile >> "CfgWeapons" >> _x >> "type") do {
_allowedSidearm = 0; case 2: {_allowedSidearm = 0;}; //Pistol
case 4: {_allowedBackpacks = 0;}; //Launcher
}; };
} count (weapons player); } count (weapons player);
@@ -34,9 +37,6 @@ if (_selection == 2) then { //gear
, _pic , _pic
]; ];
_backpack = unitBackpack player;
_allowedBackpacks = if (isNull _backpack) then {1} else {0};
_returnArray = [_allowedMags, _allowedWeapons, _allowedBackpacks]; _returnArray = [_allowedMags, _allowedWeapons, _allowedBackpacks];
}; };

View File

@@ -20,10 +20,18 @@ class PG7VR
{ {
weight = 4.5; weight = 4.5;
}; };
class PG9_AT
{
weight = 4.5;
};
class OG7 class OG7
{ {
weight = 2; weight = 2;
}; };
class OG9_HE
{
weight = 2;
};
class RPG18 class RPG18
{ {
weight = 1.2; weight = 1.2;
@@ -36,6 +44,10 @@ class Igla
{ {
weight = 11; weight = 11;
}; };
class 2Rnd_Igla
{
weight = 22;
};
class Strela class Strela
{ {
weight = 10; weight = 10;
@@ -60,11 +72,15 @@ class SMAW_HEDP
{ {
weight = 6; weight = 6;
}; };
class MAAWS_HEAA class MAAWS_HEDP
{ {
weight = 6; weight = 6;
}; };
class MAAWS_HEDP class MAAWS_HEAT
{
weight = 6;
};
class NLAW
{ {
weight = 6; weight = 6;
}; };

View File

@@ -24,6 +24,10 @@ class MAAWS
{ {
weight = 7.5; weight = 7.5;
}; };
class BAF_NLAW_Launcher
{
weight = 7.5;
};
class M47Launcher_EP1 class M47Launcher_EP1
{ {
weight = 7; weight = 7;
@@ -52,6 +56,10 @@ class MetisLauncher
{ {
weight = 16; weight = 16;
}; };
class Javelin
{
weight = 16;
};
class Igla class Igla
{ {
weight = 7; weight = 7;

View File

@@ -15017,11 +15017,11 @@
<Russian>У вас нет рюкзака.</Russian> <Russian>У вас нет рюкзака.</Russian>
</Key> </Key>
<Key ID="STR_EPOCH_TRADE_HAVE_BACKPACK"> <Key ID="STR_EPOCH_TRADE_HAVE_BACKPACK">
<English>You already have a backpack.</English> <English>You already have a backpack or launcher.</English>
<German>Du hast bereits einen Rucksack.</German> <German>Du hast bereits einen Rucksack.</German>
</Key> </Key>
<Key ID="STR_EPOCH_TRADE_ONE_BACKPACK"> <Key ID="STR_EPOCH_TRADE_ONE_BACKPACK">
<English>You can only buy one backpack into your gear.</English> <English>You can only buy one backpack or launcher into your gear.</English>
<German>Du hast nur einen Rucksack in deine Ausrüstung kaufen.</German> <German>Du hast nur einen Rucksack in deine Ausrüstung kaufen.</German>
</Key> </Key>
<Key ID="STR_EPOCH_TRADE_OFFER"> <Key ID="STR_EPOCH_TRADE_OFFER">