initial files

This commit is contained in:
Samuele Lorefice
2025-05-24 16:17:33 +02:00
commit 9e023649ac
477 changed files with 118566 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
params ["_amount", ["_negative", false]];
if (!isServer) exitWith {};
if (KP_liberation_civrep_debug > 0) then {[format ["changeCR called - Parameters [%1, %2]", _amount, _negative], "CIVREP"] call KPLIB_fnc_log;};
if (_negative) then {
KP_liberation_civ_rep = KP_liberation_civ_rep - _amount;
} else {
KP_liberation_civ_rep = KP_liberation_civ_rep + _amount;
};
KP_liberation_civ_rep = -100 max (KP_liberation_civ_rep min 100);
// Set correct resistance standing
private _resistanceEnemy = [0, 1] select (KP_liberation_civ_rep < 25);
private _resistanceFriendly = [0, 1] select (KP_liberation_civ_rep >= -25);
GRLIB_side_resistance setFriend [GRLIB_side_enemy, _resistanceEnemy];
GRLIB_side_enemy setFriend [GRLIB_side_resistance, _resistanceEnemy];
GRLIB_side_resistance setFriend [GRLIB_side_friendly, _resistanceFriendly];
GRLIB_side_friendly setFriend [GRLIB_side_resistance, _resistanceFriendly];
if (KP_liberation_civrep_debug > 0) then {[format ["changeCR finished - New value: %1", KP_liberation_civ_rep], "CIVREP"] call KPLIB_fnc_log;};
if (KP_liberation_civrep_debug > 0) then {[format ["%1 getFriend %2: %3 - %1 getFriend %4: %5", GRLIB_side_resistance, GRLIB_side_enemy, (GRLIB_side_resistance getFriend GRLIB_side_enemy), GRLIB_side_friendly, (GRLIB_side_resistance getFriend GRLIB_side_friendly)], "CIVREP"] call KPLIB_fnc_log;};

View File

@@ -0,0 +1,11 @@
params ["_sector"];
private _return = 0;
if (KP_liberation_cr_param_buildings) then {
_return = count (nearestObjects [markerPos _sector, ["House"], 1.5 * GRLIB_capture_size] select {(damage _x == 0) && !((typeOf _x) in KP_liberation_cr_ign_buildings)});
} else {
_return = count (nearestObjects [markerPos _sector, ["House"], 1.5 * GRLIB_capture_size] select {(alive _x) && !((typeOf _x) in KP_liberation_cr_ign_buildings)});
};
_return

View File

@@ -0,0 +1,25 @@
params ["_sector"];
if (_sector in sectors_bigtown || _sector in sectors_capture) then {
private _penalty = 0;
{
if (_sector == (_x select 0)) exitWith {_penalty = (_x select 1) - ([_sector] call F_cr_getBuildings)};
} forEach KP_liberation_cr_sectorbuildings;
stats_civilian_buildings_destroyed = stats_civilian_buildings_destroyed + _penalty;
_penalty = _penalty * KP_liberation_cr_building_penalty;
if (_penalty > 0) then {
[1, [(_penalty / KP_liberation_cr_building_penalty)]] remoteExec ["KPLIB_fnc_crGlobalMsg"];
};
if (_sector in sectors_bigtown) then {
[(2 * KP_liberation_cr_sector_gain - _penalty), false] spawn F_cr_changeCR;
} else {
[(KP_liberation_cr_sector_gain - _penalty), false] spawn F_cr_changeCR;
};
[format ["Civilian sector %1 (%2) captured. Penalty: %3", markerText _sector, _sector, _penalty], "CIVREP"] call KPLIB_fnc_log;
};

View File

@@ -0,0 +1,11 @@
/*
f_kp_cr_woundedAnim.sqf
Author: veteran29
Description:
Play random wounded animation on given unit
*/
params ["_unit"];
private _anim = selectRandom ["Acts_CivilInjuredHead_1", "Acts_CivilInjuredArms_1", "Acts_CivilInjuredChest_1", "Acts_CivilInjuredLegs_1", "Acts_CivilInjuredGeneral_1", "Acts_SittingWounded_loop"];
[_unit, _anim] remoteExec ["switchMove"];