more interaction cleanup

This commit is contained in:
commy2 2015-09-28 17:20:56 +02:00
parent f48636e633
commit 5c5a65443b
5 changed files with 44 additions and 1 deletions

View File

@ -117,7 +117,8 @@ class CfgVehicles {
class ACE_Pardon {
displayName = CSTRING(Pardon);
condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target});
statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc));
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canPardon));
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(pardon));
showDisabled = 0;
priority = 2.5;
};

View File

@ -3,6 +3,8 @@
ACE_Modifier = 0;
["pardon", {(_this select 0) addRating -rating (_this select 0)}] call EFUNC(common,addEventHandler);
["getDown", {
params ["_target"];

View File

@ -24,6 +24,8 @@ PREP(canBecomeLeader);
PREP(doBecomeLeader);
PREP(canTapShoulder);
PREP(tapShoulder);
PREP(canPardon);
PREP(pardon);
// interaction with doors
PREP(getDoor);

View File

@ -0,0 +1,20 @@
/*
* Author: commy2
* Checks if the unit can pardon the target.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
*
* Return Value:
* Unit can pardon target <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
alive _target
&& {rating _target < -2000}
&& {side group _unit == side group _target}

View File

@ -0,0 +1,18 @@
/*
* Author: commy2
* Unit pardons target unit.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["", "_target"];
["pardon", [_target], [_target]] call EFUNC(common,targetEvent);