Skip to content

Commit

Permalink
Merge branch 'master' into unlock-malaria-civs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kexanone committed Jan 11, 2021
2 parents 7c06533 + 45d94aa commit a92a56d
Show file tree
Hide file tree
Showing 40 changed files with 451 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Community Base Addons
[![](https://img.shields.io/travis/CBATeam/CBA_A3.svg?style=flat-square)](https://travis-ci.org/CBATeam/CBA_A3)
[![](https://img.shields.io/badge/Changelog-Link-orange.svg?style=flat-square)](https://github.com/CBATeam/CBA_A3/issues?q=is%3Aclosed+milestone%3A3.15)
[![](https://img.shields.io/badge/Release-3.15.1-blue.svg?style=flat-square)](https://github.com/CBATeam/CBA_A3/releases/latest)
[![](https://img.shields.io/badge/Release-3.15.2-blue.svg?style=flat-square)](https://github.com/CBATeam/CBA_A3/releases/latest)
[![](https://img.shields.io/badge/Github-Wiki-lightgrey.svg?style=flat-square)](https://github.com/CBATeam/CBA_A3/wiki)
[![](https://img.shields.io/badge/BIF-Thread-lightgrey.svg?style=flat-square)](https://forums.bistudio.com/topic/168277-cba-community-base-addons-arma-3)
[![](https://img.shields.io/badge/Function-Documentation-yellow.svg?style=flat-square)](https://cbateam.github.io/CBA_A3/docs/files/overview-txt.html)
Expand Down
51 changes: 51 additions & 0 deletions addons/ai/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class CfgVehicles {
class B_TargetSoldier;
class CBA_B_InvisibleTarget: B_TargetSoldier {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetSoldier);
scope = 2;
scopeCurator = 2;
scopeArsenal = 0;
Expand All @@ -14,6 +15,7 @@ class CfgVehicles {
class O_TargetSoldier;
class CBA_O_InvisibleTarget: O_TargetSoldier {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetSoldier);
scope = 2;
scopeCurator = 2;
scopeArsenal = 0;
Expand All @@ -26,6 +28,7 @@ class CfgVehicles {
class I_TargetSoldier;
class CBA_I_InvisibleTarget: I_TargetSoldier {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetSoldier);
scope = 2;
scopeCurator = 2;
scopeArsenal = 0;
Expand All @@ -35,6 +38,54 @@ class CfgVehicles {
class HitPoints {};
};

class CBA_B_InvisibleTargetVehicle: CBA_B_InvisibleTarget {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetVehicle);
model = QPATHTOF(InvisibleTargetVehicle.p3d);
crewVulnerable = 0;
type = 1;
cost = 1000000;
};

class CBA_O_InvisibleTargetVehicle: CBA_O_InvisibleTarget {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetVehicle);
model = QPATHTOF(InvisibleTargetVehicle.p3d);
crewVulnerable = 0;
type = 1;
cost = 1000000;
};

class CBA_I_InvisibleTargetVehicle: CBA_I_InvisibleTarget {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetVehicle);
model = QPATHTOF(InvisibleTargetVehicle.p3d);
crewVulnerable = 0;
type = 1;
cost = 1000000;
};

class CBA_B_InvisibleTargetAir: CBA_B_InvisibleTargetVehicle {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetAir);
type = 2;
cost = 10000000;
};

class CBA_O_InvisibleTargetAir: CBA_O_InvisibleTargetVehicle {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetAir);
type = 2;
cost = 10000000;
};

class CBA_I_InvisibleTargetAir: CBA_I_InvisibleTargetVehicle {
author = "$STR_CBA_Author";
displayName = CSTRING(InvisibleTargetAir);
type = 2;
cost = 10000000;
};

class Strategic;
class CBA_BuildingPos: Strategic {
author = "$STR_CBA_Author";
Expand Down
Binary file modified addons/ai/InvisibleTarget.p3d
Binary file not shown.
Binary file added addons/ai/InvisibleTargetVehicle.p3d
Binary file not shown.
7 changes: 6 additions & 1 deletion addons/ai/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
class CfgPatches {
class ADDON {
name = CSTRING(component);
units[] = {"CBA_B_InvisibleTarget","CBA_O_InvisibleTarget","CBA_I_InvisibleTarget","CBA_BuildingPos"};
units[] = {
"CBA_B_InvisibleTarget","CBA_O_InvisibleTarget","CBA_I_InvisibleTarget",
"CBA_B_InvisibleTargetVehicle","CBA_O_InvisibleTargetVehicle","CBA_I_InvisibleTargetVehicle",
"CBA_B_InvisibleTargetAir","CBA_O_InvisibleTargetAir","CBA_I_InvisibleTargetAir",
"CBA_BuildingPos"
};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"cba_common"};
Expand Down
28 changes: 28 additions & 0 deletions addons/ai/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,34 @@
<Japanese>AI の建物内での位置</Japanese>
<Chinese>AI在建築物內位置</Chinese>
<French>Position IA bâtiment</French>
<Russian>ИИ Место строительства</Russian>
<Polish>Pozycja AI w budynku</Polish>
</Key>
<Key ID="STR_CBA_AI_InvisibleTargetSoldier">
<English>Invisible Target Soldier</English>
<German>Unsichtbares Ziel - Soldat</German>
<Chinese>隱形目標士兵</Chinese>
<French>Cible invisible - Soldat</French>
<Spanish>Soldado objetivo invisible</Spanish>
<Italian>Soldato obiettivo invisibile</Italian>
<Polish>Żołnierz - niewidoczny cel</Polish>
<Russian>Невидимая цель - солдат</Russian>
<Czech>Neviditelný cíl (voják)</Czech>
<Portuguese>Soldado alvo invisível</Portuguese>
<Korean>보이지 않는 표적 병사</Korean>
<Chinesesimp>看不见的目标士兵</Chinesesimp>
<Japanese>隠れた標的兵士</Japanese>
<Turkish>Görünmez Hedef Asker</Turkish>
</Key>
<Key ID="STR_CBA_AI_InvisibleTargetVehicle">
<English>Invisible Target Vehicle</English>
<German>Unsichtbares Ziel - Fahrzeug</German>
<French>Cible invisible - Véhicule</French>
</Key>
<Key ID="STR_CBA_AI_InvisibleTargetAir">
<English>Invisible Target Airplane</English>
<German>Unsichtbares Ziel - Flugzeug</German>
<French>Cible invisible - Avion</French>
</Key>
</Package>
</Project>
1 change: 1 addition & 0 deletions addons/common/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class CfgFunctions {
PATHTO_FNC(addBinocularMagazine);
PATHTO_FNC(removeBinocularMagazine);
PATHTO_FNC(randomizeFacewear);
PATHTO_FNC(canAddItem);
};

class Cargo {
Expand Down
136 changes: 136 additions & 0 deletions addons/common/fnc_canAddItem.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#include "script_component.hpp"
/* ----------------------------------------------------------------------------
Function: CBA_fnc_canAddItem
Description:
Checks if unit has enough free space in inventory to store item.
Doesn't take current unit load into account unlike canAdd command.
Parameters:
_unit - Unit <OBJECT>
_item - Item to store <STRING>
_count - Item count <NUMBER> (Default: 1)
_checkUniform - Check space in uniform <BOOLEAN> (Default: true)
_checkVest - Check space in vest <BOOLEAN> (Default: true)
_checkBackpack - Check space in backpack <BOOLEAN> (Default: true)
Returns:
True if unit has free space, false otherwise <BOOLEAN>
Examples:
(begin example)
[player, "acc_flashlight"] call CBA_fnc_canAddItem
[player, "30Rnd_556x45_Stanag", 7, false, true, false] call CBA_fnc_canAddItem
(end)
Author:
Dystopian
---------------------------------------------------------------------------- */
SCRIPT(canAddItem);

params [
["_unit", objNull, [objNull]],
["_item", "", [""]],
["_count", 1, [0]],
["_checkUniform", true, [false]],
["_checkVest", true, [false]],
["_checkBackpack", true, [false]]
];

if (isNull _unit || {_item isEqualTo ""}) exitWith {false};

#define TYPE_VEST 701
#define TYPE_UNIFORM 801
#define TYPE_BACKPACK 901

if (isNil QGVAR(itemMassAllowedSlots)) then {
GVAR(itemMassAllowedSlots) = [] call CBA_fnc_createNamespace;
};

(GVAR(itemMassAllowedSlots) getVariable [_item, []]) params ["_mass", "_allowedSlots"];

if (isNil "_mass") then {
_allowedSlots = [TYPE_UNIFORM, TYPE_VEST, TYPE_BACKPACK];
private _cfgWeaponsItem = configFile >> "CfgWeapons" >> _item;
private _cfgMagazinesItem = configFile >> "CfgMagazines" >> _item;
private _cfgGlassesItem = configFile >> "CfgGlasses" >> _item;
switch true do {
case (isClass _cfgWeaponsItem): {
private _cfgItemInfo = _cfgWeaponsItem >> "ItemInfo";
private _cfgWeaponSlotsInfo = _cfgWeaponsItem >> "WeaponSlotsInfo";
if (isNumber (_cfgItemInfo >> "mass")) then {
_mass = getNumber (_cfgItemInfo >> "mass");
} else {
_mass = getNumber (_cfgWeaponSlotsInfo >> "mass");
};

{
if (isArray _x) exitWith {
_allowedSlots = getArray _x;
};
} forEach [
_cfgWeaponsItem >> "allowedSlots",
_cfgItemInfo >> "allowedSlots",
_cfgWeaponSlotsInfo >> "allowedSlots"
];
};
case (isClass _cfgMagazinesItem): {
_mass = getNumber (_cfgMagazinesItem >> "mass");
private _cfgAllowedSlots = _cfgMagazinesItem >> "allowedSlots";
if (isArray _cfgAllowedSlots) then {
_allowedSlots = getArray _cfgAllowedSlots;
};
};
case (isClass _cfgGlassesItem): {
_mass = getNumber (_cfgGlassesItem >> "mass");
};
default {
_mass = -1;
_allowedSlots = [];
};
};
TRACE_3("caching",_item,_mass,_allowedSlots);
GVAR(itemMassAllowedSlots) setVariable [_item, [_mass, _allowedSlots]];
};

if (_mass == -1) exitWith {false}; // item doesn't exist

if (
_checkUniform
&& {TYPE_UNIFORM in _allowedSlots}
&& {
_mass == 0
|| {
// each time subtract whole number of items which can be put in container
_count = _count - floor (getContainerMaxLoad uniform _unit * (1 - loadUniform _unit) / _mass);
_count <= 0
}
}
) exitWith {true};

if (
_checkVest
&& {TYPE_VEST in _allowedSlots}
&& {
_mass == 0
|| {
_count = _count - floor (getContainerMaxLoad vest _unit * (1 - loadVest _unit) / _mass);
_count <= 0
}
}
) exitWith {true};

if (
_checkBackpack
&& {TYPE_BACKPACK in _allowedSlots}
&& {
_mass == 0
|| {
_count = _count - floor (getContainerMaxLoad backpack _unit * (1 - loadBackpack _unit) / _mass);
_count <= 0
}
}
) exitWith {true};

false
2 changes: 2 additions & 0 deletions addons/common/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Italian>Prima deve far partire una missione.</Italian>
<Czech>První musíte zapnout misi.</Czech>
<Chinese>你必須先加載世界或執行一個任務。</Chinese>
<Russian>Вначале необходимо запустить миссию.</Russian>
</Key>
<Key ID="STR_cba_common_WeaponsCategory">
<English>CBA Weapons</English>
Expand All @@ -35,6 +36,7 @@
<Turkish>CBA Silahları</Turkish>
<Chinese>CBA 武器</Chinese>
<French>CBA Armes</French>
<Russian>CBA Оружие</Russian>
</Key>
</Package>
</Project>
20 changes: 20 additions & 0 deletions addons/disposable/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<Turkish>Community Base Addons - Tek Kullanımlık Silahlar</Turkish>
<French>Community Base Addons - Armes à usage unique</French>
<Chinese>社群基礎模組 - 一次性武器</Chinese>
<Russian>Community Base Addons - Одноразовое оружие</Russian>
<Polish>Community Base Addons - Bronie jednorazowe</Polish>
</Key>
<Key ID="STR_CBA_disposable_DropUsedLauncher">
<English>Drop Used Disposable Launcher</English>
Expand All @@ -18,6 +20,8 @@
<Turkish>Kullanılan Tek Kullanımlık Roketleri At</Turkish>
<Chinese>丟棄使用過的一次性發射器</Chinese>
<French>Lâcher le lanceur usagé</French>
<Russian>Выбрасывать использованный одноразовый гранатомёт</Russian>
<Polish>Wyrzuć zużyty przedmiot</Polish>
</Key>
<Key ID="STR_CBA_disposable_DropNever">
<English>Never</English>
Expand All @@ -27,6 +31,8 @@
<Turkish>Asla</Turkish>
<Chinese>永不</Chinese>
<French>Jamais</French>
<Russian>Никогда</Russian>
<Polish>Nigdy</Polish>
</Key>
<Key ID="STR_CBA_disposable_DropNeverTooltip">
<English>Don't automatically drop the used disposable launcher.</English>
Expand All @@ -36,6 +42,8 @@
<Turkish>Otomatik olarak tek kullanımlık roketleri atma.</Turkish>
<Chinese>不要自動丟棄一次性使用之發射器</Chinese>
<French>Ne lâche jamais automatiquement le lanceur usagé.</French>
<Russian>Не выбрасывать автоматически использованный одноразовый гранатомёт.</Russian>
<Polish>Nie wyrzucaj automatycznie wyrzutni jednorazowej.</Polish>
</Key>
<Key ID="STR_CBA_disposable_DropAIOnly">
<English>AI Only</English>
Expand All @@ -45,6 +53,8 @@
<Turkish>Sadece AI</Turkish>
<Chinese>只有AI</Chinese>
<French>IA seulement</French>
<Russian>Только ИИ</Russian>
<Polish>Tylko AI</Polish>
</Key>
<Key ID="STR_CBA_disposable_DropAIOnlyTooltip">
<English>Only AI drops the used disposable launcher.</English>
Expand All @@ -54,6 +64,8 @@
<Turkish>Sadece yapay zeka tek kullanımlık roketleri atar.</Turkish>
<Chinese>只有AI才會丟棄使用過的一次性發射器</Chinese>
<French>Seules les unités IA lâchent leur lanceur après emploi.</French>
<Russian>Только ИИ выбрасывает использованный одноразовый гранатомёт.</Russian>
<Polish>Tylko AI wyrzuca wyrzutnie jednorazową.</Polish>
</Key>
<Key ID="STR_CBA_disposable_DropSelectedAnotherWeapon">
<English>Selected Another Weapon</English>
Expand All @@ -63,6 +75,8 @@
<Turkish>Başka Bir Silah Seçince</Turkish>
<Chinese>選擇其他武器</Chinese>
<French>Si autre arme sélectionnée</French>
<Russian>Выбрано другое оружие</Russian>
<Polish>Wybierz inną Broń</Polish>
</Key>
<Key ID="STR_CBA_disposable_DropSelectedAnotherWeaponTooltip">
<English>Automatically drop the used disposable launcher as soon as another weapon is selected.</English>
Expand All @@ -72,6 +86,8 @@
<Turkish>Başka bir silah seçildiği zaman otomatik olarak tek kullanımlık roketleri at.</Turkish>
<Chinese>當切換別的武器時自動丟棄一次性發射器。</Chinese>
<French>Lâche automatiquement le lanceur usagé dès qu'une autre arme est sélectionnée.</French>
<Russian>Автоматически выбрасывать использованный одноразовый гранатомёт, как только будет выбрано другие оружие.</Russian>
<Polish>Automatycznie wyrzucaj wyrzutnie jednorazową gdy tylko zostanie wybrana kolejna broń.</Polish>
</Key>
<Key ID="STR_CBA_disposable_ReplaceDisposableLauncher">
<English>Replace Disposable Launcher</English>
Expand All @@ -81,6 +97,8 @@
<Turkish>Tek Kullanımlık Roketleri Değiştir</Turkish>
<Chinese>替換掉一次性發射器</Chinese>
<French>Remplacer le lanceur à usage unique</French>
<Russian>Заменять одноразовые гранатомёты</Russian>
<Polish>Zamien wyrzutnie jednorazową</Polish>
</Key>
<Key ID="STR_CBA_disposable_ReplaceDisposableLauncherTooltip">
<English>If enabled, disposable launchers can only be used once. Ammunition for disposable launchers in containers and vehicles will be replaced with loaded disposable launchers. If disabled, disposable launchers can be reloaded after use.</English>
Expand All @@ -90,6 +108,8 @@
<Turkish>Eğer bu ayar açıksa, tek kullanımlık roketler sadece bir kere kullanılabilir. Tek kullanımlık rokeyler için cephane başka tek kullanımlık roketler ile değiştirilir. Bu ayar kapalıyken tek kullanımlık roketler de birçok kez kullanılabilir.</Turkish>
<Chinese>啟用時,將會把載具或容器裡面給於一次性發射器的彈藥換成一次性發射器本身,並且使其只能使用一次。如果關閉,一次性發射器即可再度裝填</Chinese>
<French>Si activé, les lanceurs à usage unique ne peuvent être utilisés qu'une seule fois. Les munitions pour lanceurs à usage unique situés dans les conteneurs et les véhicules seront remplacées par des lanceurs à usage unique chargés. Si désactivé, les lanceurs à usage unique peuvent être rechargés après emploi.</French>
<Russian>Если включено, одноразовые гранатомёты могут быть использованы лишь один раз. Боеприпасы для них в контейнерах и технике будут заменены на соответствующие им заряженные одноразовые гранатомёты. Если выключено, одноразовые гранатомёты могут быть перезаряжены и использованы повторно.</Russian>
<Polish>Gdy ta opcja jest włączona wyrzutnie jednorazowe mogą być użyte tylko raz, Amunicja do wyrzutni jednorazowych dostępna w kontenerach i pojazdach zostanie zamieniona w załadowaną wyrzutnie jednorazową. Jeżeli ta opcja jest wyłączona, wtedy wyrzutnie jednorazowe nie zostaną przeładowane po użyciu.</Polish>
</Key>
</Package>
</Project>
Empty file removed addons/ee/$NOBIN$
Empty file.
Loading

0 comments on commit a92a56d

Please sign in to comment.