added interrogate functionality

This commit is contained in:
Mario 2019-09-25 22:48:12 +02:00
parent 47c4145a2c
commit 3bc0c87ef5
7 changed files with 109 additions and 8 deletions

View File

@ -22,6 +22,8 @@
"KPLIB_param_aceResupply",
"KPLIB_param_ammoInfluence",
"KPLIB_param_arsenalType",
"KPLIB_param_captiveIntel",
"KPLIB_param_captiveIntelRandom",
"KPLIB_param_clearVehicleCargo",
"KPLIB_param_commanderZeusMode",
"KPLIB_param_copyDistance",

View File

@ -4,7 +4,7 @@
File: fn_captive_addCaptiveAction.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-09-11
Last Update: 2019-09-24
Last Update: 2019-09-25
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
@ -59,8 +59,8 @@ if !(KPLIB_ace_enabled) then {
// Add interrogate action near FOB
[
_unit,
"interrogate captive",
[{[10] call KPLIB_fnc_resources_addIntel; deleteVehicle _unit;}, nil, -800, false, true, "", "count (_target nearEntities [KPLIB_preset_fobBuildingF, 25]) isEqualTo 1", 10]
["STR_KPLIB_ACTION_INTERROGATE", name _unit],
[{[_this select 0] call KPLIB_fnc_captive_interrogate;}, nil, -800, false, true, "", "!((nearestObjects [_target ,[KPLIB_preset_fobBuildingF], 25]) isEqualTo [])", 10]
] remoteExecCall ["KPLIB_fnc_common_addAction", 0, _unit];
true

View File

@ -0,0 +1,42 @@
/*
KPLIB_fnc_captive_interrogate
File: fn_captive_interrogate.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-09-25
Last Update: 2019-09-25
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Interrogates the unit, adds intel and deletes it.
Parameter(s):
_unit - Unit to load in vehicle [OBJECT, defaults to objNull]
Returns:
Function reached the end [BOOL]
*/
params [
["_unit", objNull, [objNull]]
];
// Exit on missing object
if (isNull _unit) exitWith {
false
};
// Calculate the intel gain
private _intel = KPLIB_param_captiveIntel;
if !(KPLIB_param_captiveIntelRandom isEqualTo 0) then {
_intel = _intel + ((round (random (KPLIB_param_captiveIntelRandom * 2))) - KPLIB_param_captiveIntelRandom);
};
// Add the intel
[_intel] call KPLIB_fnc_resources_addIntel;
// Delete the unit
deleteVehicle _unit;
true

View File

@ -54,11 +54,14 @@ if (KPLIB_ace_enabled) then {
};
// Add a killed EH to the unit, to ensure that all actions will be removed
_unit addEventHandler ["Killed", {
_unit addMPEventHandler ["MPKilled", {
// Remove all actions of the unit
removeAllActions (_this select 0);
// Remove the unload action from the vehicle if the unit is in a vehicle
private _vehicle = objectParent _this select 0;
private _vehicle = objectParent (_this select 0);
if !(isNull _vehicle) then {
_vehicle removeAction (_unit getVariable ["KPLIB_captive_unloadID", 9000]);
_vehicle removeAction ((_this select 0) getVariable ["KPLIB_captive_unloadID", 9000]);
};
}];

View File

@ -4,7 +4,7 @@
File: fn_captive_settings.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-09-12
Last Update: 2019-09-12
Last Update: 2019-09-25
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
@ -18,6 +18,30 @@
Function reached the end [BOOL]
*/
// KPLIB_param_captiveIntel
// Amount of intel which will be granted on interrogation.
// Default: 10
[
"KPLIB_param_captiveIntel",
"SLIDER",
[localize "STR_KPLIB_SETTINGS_CAPTIVE_INTELVALUE", localize "STR_KPLIB_SETTINGS_CAPTIVE_INTELVALUE_TT"],
localize "STR_KPLIB_SETTINGS_CAPTIVE",
[1, 100, 10, 1],
1,
{}
] call CBA_Settings_fnc_init;
// KPLIB_param_captiveIntelRandom
// Amount of random intel modifier on interrogation.
// Default: 5
[
"KPLIB_param_captiveIntelRandom",
"SLIDER",
[localize "STR_KPLIB_SETTINGS_CAPTIVE_INTELRANDOM", localize "STR_KPLIB_SETTINGS_CAPTIVE_INTELRANDOM_TT"],
localize "STR_KPLIB_SETTINGS_CAPTIVE",
[0, 100, 5, 1],
1,
{}
] call CBA_Settings_fnc_init;
true

View File

@ -4,7 +4,7 @@
File: functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-09-10
Last Update: 2019-09-22
Last Update: 2019-09-25
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
@ -24,6 +24,9 @@ class captive {
// Attach a captive to the escorting player
class captive_escort {};
// Interrogates the unit, adds intel and deletes it
class captive_interrogate {};
// Loads given unit into the nearest vehicle cargo seat
class captive_loadCaptive {};

View File

@ -263,6 +263,10 @@
<English>Move to aft deck</English>
<German>Zum Achterdeck bewegen</German>
</Key>
<Key ID="STR_KPLIB_ACTION_INTERROGATE">
<English>Interrogate %1</English>
<German>%1 verhören</German>
</Key>
<Key ID="STR_KPLIB_ACTION_LOADCAPTIVE">
<English>Load %1</English>
<German>%1 einladen</German>
@ -1928,6 +1932,29 @@
<Key ID="STR_KPLIB_SETTINGS_MISSION_REFUND_TT">
<English>Defines the mission abortion refund in percentage.</English>
<German>Definiert die Rückerstattung in Prozent.</German>
</Key>
<!-- CAPTIVE CATEGORY -->
<Key ID="STR_KPLIB_SETTINGS_CAPTIVE">
<English>KPLIB - Captives</English>
<German>KPLIB - Gefangene</German>
</Key>
<Key ID="STR_KPLIB_SETTINGS_CAPTIVE_INTELVALUE">
<English>Intel grant on interrogation</English>
<German>Informationszuwachs bei einer Verhörung</German>
</Key>
<Key ID="STR_KPLIB_SETTINGS_CAPTIVE_INTELVALUE_TT">
<English>Defines the amount of granted intel on Interrogation.</English>
<German>Definiert die Menge an Informationen, die bei einer Verhörung erhalten werden.</German>
</Key>
<Key ID="STR_KPLIB_SETTINGS_CAPTIVE_INTELRANDOM">
<English>Random Intel modifier on interrogation</English>
<German>Zufälliger Modifikator des Informationszuwachs bei einer Verhörung</German>
</Key>
<Key ID="STR_KPLIB_SETTINGS_CAPTIVE_INTELRANDOM_TT">
<English>Defines the random intel modifier on Interrogation, a setting of 5 will gain 5 upto 15 (+-Value) intel with an intel value of 10.</English>
<German>Definiert den zufälligen Modifikator des Informationszuwachs bei einer Verhörung, bei einer EInstellung von 5, beträgt der Zuwachs 5 bis 15 bei einem standard Nachrichtenwert von 10.</German>
</Key>
</Package>