Skip to content

Commit

Permalink
Merge pull request #1672 from Vdauphin/master_daily
Browse files Browse the repository at this point in the history
UPDATE: 1.24 to 1.25
  • Loading branch information
Vdauphin authored Feb 2, 2025
2 parents fb26d56 + 86941b3 commit 9ef01f9
Show file tree
Hide file tree
Showing 45 changed files with 650 additions and 1,417 deletions.
25 changes: 16 additions & 9 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf

Large diffs are not rendered by default.

48 changes: 30 additions & 18 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/def/param.hpp

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ params [

private _array = nearestObjects [_logistic, ["ACE_bodyBagObject", "CAManBase"], 10];
_array = _array select {
alive _x && (
(_x isKindOf "CAManBase" &&
side group _x isEqualTo btc_enemy_side) ||
_x isKindOf "ACE_bodyBagObject"
)
_x isKindOf "CAManBase" ||
_x isKindOf "ACE_bodyBagObject"
};
if (_array isEqualTo []) exitWith {
localize "STR_BTC_HAM_O_BODYBAG_NO" call CBA_fnc_notify;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ private _ticket = 0;
private _UID = _bodyBag getVariable ["btc_UID", ""];
private _players = [];
if (_UID isEqualTo "") then {
if (alive _bodyBag && _bodyBag isKindOf "CAManBase") then {
if (
alive _bodyBag &&
_bodyBag isKindOf "CAManBase" &&
side group _bodyBag isEqualTo btc_enemy_side
) then {
_ticket = btc_body_prisonerTicket;

switch (btc_p_respawn_ticketsFromPrisoners) do {
Expand Down
8 changes: 4 additions & 4 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/cache/create.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Description:
Parameters:
_cache_pos - Position of the cache. [Array]
_p_chem - Allow chemical cache. [Boolean]
_probabilityNotChemical - Probability to not create a chemical cache. [Number]
_probabilityChemical - Probability to create a chemical cache. [Number]
Returns:
Expand All @@ -28,13 +28,13 @@ Author:

params [
["_cache_pos", btc_cache_pos, [[]]],
["_p_chem", btc_p_chem, [true]],
["_probabilityNotChemical", 0.5, [0]]
["_p_chem", btc_p_chem_cache_probability > 0, [true]],
["_probabilityChemical", btc_p_chem_cache_probability, [0]]
];

private _isChem = false;
if (_p_chem) then {
_isChem = random 1 > _probabilityNotChemical;
_isChem = random 1 < _probabilityChemical;
};
private _cacheType = selectRandom (btc_cache_type select 0);
btc_cache_obj = _cacheType createVehicle _cache_pos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Author:
---------------------------------------------------------------------------- */

if !(btc_p_chem) exitWith {};
if !(btc_p_chem_sides || (btc_p_chem_cache_probability > 0)) exitWith {};

private _bodyParts = ["head","body","hand_l","hand_r","leg_l","leg_r"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Author:
---------------------------------------------------------------------------- */

if !(btc_p_chem) exitWith {};
if !(btc_p_chem_sides || (btc_p_chem_cache_probability > 0)) exitWith {};

params [
["_minDistance", 5, [2]]
Expand Down
5 changes: 5 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/city/activate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ if (_civKilled isNotEqualTo []) then {
[[_city, _civKilled], btc_civ_fnc_createFlower] call btc_delay_fnc_exec;
};

private _grave = _city getVariable ["btc_rep_graves", []];
if (_grave isNotEqualTo []) then {
[[_city, _grave], btc_civ_fnc_createGrave] call btc_delay_fnc_exec;
};

[{
params ["_has_en", "_city", "_cachingRadius"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ btc_tags_server = btc_tags_server - [objNull];

(_city getVariable ["btc_civ_flowers", []]) call CBA_fnc_deleteEntity;

(_city getVariable ["btc_civ_graves", []]) call CBA_fnc_deleteEntity;

if (btc_debug_log) then {
[format ["count data_units = %1", count _data_units], __FILE__, [false]] call btc_debug_fnc_message;
[format ["count data_animals = %1", count _data_animals], __FILE__, [false]] call btc_debug_fnc_message;
Expand Down
50 changes: 50 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/civ/createGrave.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

/* ----------------------------------------------------------------------------
Function: btc_civ_fnc_createGrave
Description:
Create graves and add flower bouquets next to them.
Parameters:
_city - City. [Object]
_graves - Array of grave around city. [Array]
Returns:
Examples:
(begin example)
[btc_city_all get 1, [[getPosASL player, getDir player, "ACE_Grave"]]] call btc_civ_fnc_createGrave;
(end)
Author:
Vdauphin
---------------------------------------------------------------------------- */

params [
["_city", objNull, [objNull]],
["_graves", [], [[]]]
];

_city setVariable [
"btc_civ_graves",
_graves apply {
_x params ["_posASL", "_dir", "_graveType"];

private _grave = createVehicle [_graveType, [0, 0, 0], [], 0, "NONE"];
_grave setPosASL _posASL;
_grave setDir _dir;
_grave setVectorUp surfaceNormal _posASL;

_flowers = [];
for "_i" from 0 to (1 + round random 2) do {
_flowers pushBack createSimpleObject [
selectRandom btc_type_flowers,
[[_posASL vectorAdd [0, 0, 0.2], 0.2, 0.8, _dir, true]] call CBA_fnc_randPosArea
];
(_flowers select _i) setDir random 360;
};

[_flowers, _grave]
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ Author:
params [
["_group", grpNull, [grpNull]],
["_active_city", objNull, [objNull]],
["_area", btc_patrol_area, [0]],
["_p_chem", btc_p_chem, [false]]
["_area", btc_patrol_area, [0]]
];

if (isNil "btc_civilian_id") then {btc_civilian_id = -1;};
Expand Down
4 changes: 4 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ if (isServer) then {
btc_civ_fnc_create_patrol = compileScript ["core\fnc\civ\create_patrol.sqf"];
btc_civ_fnc_evacuate = compileScript ["core\fnc\civ\evacuate.sqf"];
btc_civ_fnc_createFlower = compileScript ["core\fnc\civ\createFlower.sqf"];
btc_civ_fnc_createGrave = compileScript ["core\fnc\civ\createGrave.sqf"];

//DATA
btc_data_fnc_add_group = compileScript ["core\fnc\data\add_group.sqf"];
Expand Down Expand Up @@ -168,6 +169,7 @@ if (isServer) then {
btc_rep_fnc_notify = compileScript ["core\fnc\rep\notify.sqf"];
btc_rep_fnc_killed = compileScript ["core\fnc\rep\killed.sqf"];
btc_rep_fnc_wheelChange = compileScript ["core\fnc\rep\wheelChange.sqf"];
btc_rep_fnc_grave = compileScript ["core\fnc\rep\grave.sqf"];

//RESPAWN
btc_respawn_fnc_addTicket = compileScript ["core\fnc\respawn\addTicket.sqf"];
Expand Down Expand Up @@ -195,6 +197,7 @@ if (isServer) then {
btc_side_fnc_EMP = compileScript ["core\fnc\side\EMP.sqf"];
btc_side_fnc_removeRubbish = compileScript ["core\fnc\side\removeRubbish.sqf"];
btc_side_fnc_pandemic = compileScript ["core\fnc\side\pandemic.sqf"];
btc_side_fnc_massacre = compileScript ["core\fnc\side\massacre.sqf"];

//TAG
btc_tag_fnc_initArea = compileScript ["core\fnc\tag\initArea.sqf"];
Expand Down Expand Up @@ -351,6 +354,7 @@ if (!isDedicated) then {
btc_fob_fnc_rallypointAssemble = compileScript ["core\fnc\fob\rallypointAssemble.sqf"];
btc_fob_fnc_redeploy = compileScript ["core\fnc\fob\redeploy.sqf"];
btc_fob_fnc_redeployCheck = compileScript ["core\fnc\fob\redeployCheck.sqf"];
btc_fob_fnc_addInteraction = compileScript ["core\fnc\fob\addInteraction.sqf"];

//INT
btc_int_fnc_add_actions = compileScript ["core\fnc\int\add_actions.sqf"];
Expand Down
8 changes: 5 additions & 3 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ private _cities_status = +(profileNamespace getVariable [format ["btc_hm_%1_citi
_x params ["_id", "_initialized", "_spawn_more", "_occupied", "_data_units", "_has_ho", "_ho_units_spawned", "_ieds", "_has_suicider",
["_data_animals", [], [[]]],
["_data_tags", [], [[]]],
["_civKilled", [], [[]]]
["_civKilled", [], [[]]],
["_graves", [], [[]]]
];

private _city = btc_city_all get _id;
Expand All @@ -49,6 +50,7 @@ private _cities_status = +(profileNamespace getVariable [format ["btc_hm_%1_citi
_city setVariable ["data_animals", _data_animals];
_city setVariable ["data_tags", _data_tags];
_city setVariable ["btc_rep_civKilled", _civKilled];
_city setVariable ["btc_rep_graves", _graves];

if (btc_debug) then {
private _marker = _city getVariable ["marker", ""];
Expand Down Expand Up @@ -100,7 +102,7 @@ btc_cache_pos = _cache_pos;
btc_cache_n = _cache_n;
btc_cache_info = _cache_info;

[_cache_pos, btc_p_chem, [1, 0] select _isChem] call btc_cache_fnc_create;
[_cache_pos, btc_p_chem_cache_probability > 0, [1, 0] select _isChem] call btc_cache_fnc_create;
btc_cache_obj setVariable ["btc_cache_unitsSpawned", _cache_unitsSpawned];

btc_cache_markers = [];
Expand Down Expand Up @@ -274,7 +276,7 @@ private _markers_properties = +(profileNamespace getVariable [format ["btc_hm_%1
["_markerChannel", 0, [0]]
];

private _marker = createMarker [format ["_USER_DEFINED #0/%1/%2", _forEachindex, _markerChannel], _markerPos, _markerChannel];
private _marker = createMarker [format ["_USER_DEFINED #0/%1/%2 btc_hm", _forEachindex, _markerChannel], _markerPos, _markerChannel];
_marker setMarkerText _markerText;
_marker setMarkerColor _markerColor;
_marker setMarkerType _markerType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ _object_data params [
["_turretMagazines", [], [[]]],
["_customName", "", [""]],
["_tagTexture", "", [""]],
["_properties", [], [[]]]
["_properties", [], [[]]],
["_playerKiller", "", [""]]
];

private _obj = createVehicle [_type, ASLToATL _pos, [], 0, "CAN_COLLIDE"];
Expand Down Expand Up @@ -76,5 +77,9 @@ if (_properties isNotEqualTo []) then {
([_obj] + _properties) call btc_veh_fnc_propertiesSet;
};

if (_playerKiller isNotEqualTo "") then {
_obj setVariable ["btc_rep_playerKiller", _playerKiller];
};

[_obj] call btc_log_fnc_init;
[_obj, _cargo, _inventory] call btc_db_fnc_loadCargo;
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/load_old.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ btc_cache_pos = _cache_pos;
btc_cache_n = _cache_n;
btc_cache_info = _cache_info;

[_cache_pos, btc_p_chem, [1, 0] select _isChem] call btc_cache_fnc_create;
[_cache_pos, btc_p_chem_cache_probability > 0, [1, 0] select _isChem] call btc_cache_fnc_create;
btc_cache_obj setVariable ["btc_cache_unitsSpawned", _cache_unitsSpawned];

btc_cache_markers = [];
Expand Down
7 changes: 6 additions & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Author:
["_dogtagDataTaken", [], [[]]],
["_turretMagazines", [], [[]]],
["_customName", "", [""]],
["_properties", [], [[]]]
["_properties", [], [[]]],
["_playerKiller", "", [""]]
];

private _l = createVehicle [_type, getPosATL _obj, [], 0, "CAN_COLLIDE"];
Expand Down Expand Up @@ -66,6 +67,10 @@ Author:
if (_properties isNotEqualTo []) then {
([_l] + _properties) call btc_veh_fnc_propertiesSet;
};

if (_playerKiller isNotEqualTo "") then {
_l setVariable ["btc_rep_playerKiller", _playerKiller];
};
} forEach _cargo;

//set inventory content for weapons, magazines and items
Expand Down
5 changes: 4 additions & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/save.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private _cities_status = [];
_city_status pushBack (_y getVariable ["data_animals", []]);
_city_status pushBack (_y getVariable ["data_tags", []]);
_city_status pushBack (_y getVariable ["btc_rep_civKilled", []]);
_city_status pushBack (_y getVariable ["btc_rep_graves", []]);

_cities_status pushBack _city_status;
if (btc_debug_log) then {
Expand Down Expand Up @@ -146,7 +147,8 @@ private _vehiclesInCargo = _vehicles - _vehiclesNotInCargo;
["_turretMagazines", [], [[]]],
["_notuse", "", [""]],
["_tagTexture", "", [""]],
["_properties", [], [[]]]
["_properties", [], [[]]],
["_playerKiller", "", [""]]
];

private _data = [];
Expand All @@ -165,6 +167,7 @@ private _vehiclesInCargo = _vehicles - _vehiclesNotInCargo;
_data pushBack _turretMagazines;
_data pushBack _tagTexture;
_data pushBack _properties;
_data pushBack _playerKiller;

private _fakeViV = isVehicleCargo attachedTo _x;
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ private _cargo = (_object getVariable ["ace_cargo_loaded", []]) apply {
_x call btc_body_fnc_dogtagGet,
magazinesAllTurrets _x,
_x getVariable ["ace_cargo_customName", ""],
[_x] call btc_veh_fnc_propertiesGet
[_x] call btc_veh_fnc_propertiesGet,
_x getVariable ["btc_rep_playerKiller", ""]
]
};
};
Expand All @@ -56,5 +57,6 @@ _data pushBack (magazinesAllTurrets _object);
_data pushBack (_object getVariable ["ace_cargo_customName", ""]);
_data pushBack (_object getVariable ["btc_tag_vehicle", ""]);
_data pushBack ([_object] call btc_veh_fnc_propertiesGet);
_data pushBack (_object getVariable ["btc_rep_playerKiller", ""]);

_data
7 changes: 6 additions & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/player.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ _player addEventHandler ["WeaponAssembled", {
_this remoteExecCall ["btc_log_fnc_init", 2];
}] call CBA_fnc_addEventHandler;

if (btc_p_chem) then {
if (btc_p_chem_sides || (btc_p_chem_cache_probability > 0)) then {
// Add biopsy
[missionNamespace, "probingEnded", btc_chem_fnc_biopsy] call BIS_fnc_addScriptedEventHandler;

Expand Down Expand Up @@ -136,3 +136,8 @@ if (btc_p_respawn_ticketsAtStart >= 0) then {
params ["_unit", "_flag"];
_flag remoteExecCall ["btc_log_fnc_init", 2];
}] call CBA_fnc_addEventHandler;

["ace_flags_placed", {
params ["_player", "_flag", "_item"];
_flag remoteExecCall ["btc_log_fnc_init", 2];
}] call CBA_fnc_addEventHandler;
23 changes: 19 additions & 4 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/eh/server.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ if (btc_p_auto_db) then {
};
}];
};
if (btc_p_chem) then {

if (btc_p_chem_sides || (btc_p_chem_cache_probability > 0)) then {
["ace_cargoLoaded", btc_chem_fnc_propagate] call CBA_fnc_addEventHandler;
["AllVehicles", "GetIn", {[_this select 0, _this select 2] call btc_chem_fnc_propagate}] call CBA_fnc_addClassEventHandler;
["DeconShower_01_F", "init", {
Expand Down Expand Up @@ -133,8 +134,8 @@ if (btc_p_respawn_ticketsAtStart >= 0) then {
_unit in btc_body_deadPlayers
) then {
deleteMarker (_unit getVariable ["btc_body_deadMarker", ""]);
private _deadUnits = [[[_unit]] call btc_body_fnc_get] call btc_body_fnc_create;
private _deadUnit = _deadUnits select 0;
private _deadUnits = [[[_unit]] call btc_body_fnc_get] call btc_body_fnc_create;
_deadUnit = _deadUnits select 0;
btc_body_deadPlayers pushBack _deadUnit;
};
}];
Expand All @@ -156,4 +157,18 @@ if (btc_p_respawn_ticketsAtStart >= 0) then {
params ["_explosive", "_dir", "_pitch", "_unit"];
_explosive setVariable ["btc_side", side group _unit];
btc_explosives pushBack _this;
}] call CBA_fnc_addEventHandler;
}] call CBA_fnc_addEventHandler;

["ace_placedInBodyBag", {
params ["_patient", "_bodyBag", "_isGrave", "_medic"];
if (
isNil {_patient getVariable "btc_rep_playerKiller"}
) exitWith {};

private _killer = _patient getVariable "btc_rep_playerKiller";
if (_isGrave) then {
[btc_rep_fnc_grave, [_bodyBag, _medic], 0.2] call CBA_fnc_waitAndExecute;
} else {
_bodyBag setVariable ["btc_rep_playerKiller", _killer];
};
}] call CBA_fnc_addEventHandler;
Loading

0 comments on commit 9ef01f9

Please sign in to comment.