2015-01-11 19:32:51 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi
|
2015-01-11 23:13:47 +00:00
|
|
|
*
|
2015-01-11 19:32:51 +00:00
|
|
|
* Forces a civilian to the ground. (chance of failure).
|
2015-01-11 23:13:47 +00:00
|
|
|
*
|
2015-01-11 19:32:51 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: Unit to be sent away (Object)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* none
|
|
|
|
*/
|
2015-01-11 23:13:47 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 19:32:51 +00:00
|
|
|
|
|
|
|
#define RADIUS 10
|
|
|
|
|
|
|
|
private ["_unit", "_chance", "_x"];
|
|
|
|
|
|
|
|
_unit = _this select 0;
|
|
|
|
|
2015-01-12 04:20:02 +00:00
|
|
|
ACE_player playActionNow "GestureGo"; // put something else here.
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-01-12 04:20:02 +00:00
|
|
|
if (count (weapons ACE_player) > 0) then {
|
2015-01-11 19:32:51 +00:00
|
|
|
_chance = 0.8;
|
|
|
|
} else {
|
|
|
|
_chance = 0.5;
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
if (count (weapons _unit) == 0 and random 1 < _chance) then {
|
|
|
|
[-2, {
|
|
|
|
_this setUnitPos "DOWN";
|
|
|
|
}, _x] call CBA_fnc_globalExecute;
|
|
|
|
};
|
|
|
|
} foreach (_unit nearEntities ["Civilian", RADIUS]);
|