Merged branch master into release

This commit is contained in:
Glowbal 2016-10-11 19:04:14 +02:00
commit 84cbd50582
11 changed files with 117 additions and 35 deletions

View File

@ -1,3 +1,4 @@
PREP(addDogtagActions);
PREP(addDogtagItem);
PREP(bloodType);
@ -11,3 +12,4 @@ PREP(sendDogtagData);
PREP(showDogtag);
PREP(ssn);
PREP(takeDogtag);
PREP(disableFactionDogtags);

View File

@ -45,3 +45,6 @@ if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then {
}] call CBA_fnc_addEventHandler;
};
};
// disable dogtags for civilians
"CIV_F" call FUNC(disableFactionDogtags);

View File

@ -4,4 +4,6 @@ ADDON = false;
#include "XEH_PREP.hpp"
GVAR(disabledFactions) = [] call CBA_fnc_createNamespace;
ADDON = true;

View File

@ -20,4 +20,7 @@ params ["_player", "_target"];
if (isNull _target) exitWith {false};
// check if disabled for faction
if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false};
(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}

View File

@ -20,4 +20,7 @@ params ["_player", "_target"];
if (isNull _target) exitWith {false};
// check if disabled for faction
if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false};
(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}

View File

@ -0,0 +1,20 @@
/*
* Author: commy2
* Disable this faction from using dogtags.
*
* Arguments:
* 0: Faction <STRING>
*
* Return Value:
* None
*
* Example:
* "CIV_F" call ace_dogtags_fnc_disableFactionDogtags
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_faction", "", [""]]];
GVAR(disabledFactions) setVariable [_faction, true];

View File

@ -16,6 +16,8 @@
*/
#include "script_component.hpp"
#define ALERT_NEAR_ENEMY_RANGE 60
#define PARTICLE_LIFE_TIME 2
#define PARTICLE_DENSITY 20
#define PARTICLE_SIZE 1
@ -32,12 +34,29 @@
#define ORIENTATION 5.4
#define EXPANSION 1
params ["_projectile", "_timeToLive"];
params ["_projectile", "_timeToLive", "_center"];
if (isNull _projectile) exitWith {TRACE_1("null",_projectile);};
private _position = position _projectile;
// --- AI
private _nearLocalEnemies = [];
{
{
if (local _x && {[_center, side _x] call BIS_fnc_sideIsEnemy}) then { // WE WANT THE OBJECTS SIDE HERE!
_nearLocalEnemies pushBackUnique _x;
};
} forEach crew _x;
} forEach (_position nearObjects ALERT_NEAR_ENEMY_RANGE);
{
if (behaviour _x in ["SAFE", "AWARE"]) then {
_x setBehaviour "COMBAT";
};
} forEach _nearLocalEnemies;
// --- fire
private _fire = "#particlesource" createVehicleLocal _position;

View File

@ -56,7 +56,7 @@ if (getNumber (_config >> QGVAR(incendiary)) == 1) then {
private _fuzeTime = getNumber (_config >> "explosionTime");
private _timeToLive = getNumber (_config >> "timeToLive");
[FUNC(incendiary), [_projectile, _timeToLive], _fuzeTime] call CBA_fnc_waitAndExecute;
[FUNC(incendiary), [_projectile, _timeToLive, side _unit], _fuzeTime] call CBA_fnc_waitAndExecute; // WE WANT THE OBJECTS SIDE HERE!
};
// handle throw modes

View File

@ -16,6 +16,7 @@ PREP(handleDisconnect);
PREP(handleKilled);
PREP(handleUnconscious);
PREP(makeJerryCan);
PREP(maxDistanceDropNozzle);
PREP(moduleRefuelSettings);
PREP(readFuelCounter);
PREP(refuel);

View File

@ -0,0 +1,54 @@
/*
* Author: GitHawk, Jonpas
* Drops the nozzle at maximum hose distance.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Fuel Truck <OBJECT>
* 2: End Pos Offset <ARRAY>
* 3: Nozzle <OBJECT> (optional)
*
* Return Value:
* None
*
* Example:
* [player, fuelTruck, [0, 0, 0], nozzle] call ace_refuel_fnc_maxDistanceDropNozzle
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_source", "_endPosOffset", "_nozzle"];
// Exit if jerry can (no maximum distance there as it's not connected to anything)
if (_nozzle getVariable [QGVAR(jerryCan), false]) exitWith {};
// Check distance periodically to drop it at maximum hose length
[{
params ["_args", "_pfID"];
_args params [
["_unit", player, [objNull]],
["_source", objNull, [objNull]],
["_endPosOffset", [0, 0, 0], [[]], 3],
["_nozzle", (_args select 0) getVariable [QGVAR(nozzle), objNull], [objNull]]
];
if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (REFUEL_HOSE_LENGTH - 2)} || {!alive _source}) exitWith {
if !(isNull _nozzle) then {
[_unit, _nozzle] call FUNC(dropNozzle);
REFUEL_UNHOLSTER_WEAPON
[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set);
if (isNull _source || {!alive _source}) then {
private _rope = _nozzle getVariable [QGVAR(rope), objNull];
if !(isNull _rope) then {
ropeDestroy _rope;
};
deleteVehicle _nozzle;
} else {
[LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured);
};
};
[_pfID] call CBA_fnc_removePerFrameHandler;
};
}, 0, [_unit, _target, _endPosOffset, _nozzle]] call CBA_fnc_addPerFrameHandler;

View File

@ -82,6 +82,9 @@ if (isNull _nozzle) then { // func is called on fuel truck
'!isNull (_target getVariable [QGVAR(nozzle), objNull])'
];
_unit setVariable [QGVAR(ReleaseActionID), _actionID];
// Drop nozzle at maximum hose distance
[_unit, _target, _endPosOffset, _nozzle] call FUNC(maxDistanceDropNozzle);
},
"",
localize LSTRING(TakeNozzleAction),
@ -123,43 +126,15 @@ if (isNull _nozzle) then { // func is called on fuel truck
'!isNull (_target getVariable [QGVAR(nozzle), objNull])'
];
_unit setVariable [QGVAR(ReleaseActionID), _actionID];
// Drop nozzle at maximum hose distance
private _target = _nozzle getVariable QGVAR(source);
private _endPosOffset = _nozzle getVariable QGVAR(attachPos);
[_unit, _target, _endPosOffset, _nozzle] call FUNC(maxDistanceDropNozzle);
},
"",
localize LSTRING(TakeNozzleAction),
{true},
["isnotinside"]
] call EFUNC(common,progressBar);
_target = _nozzle getVariable QGVAR(source);
_endPosOffset = _nozzle getVariable QGVAR(attachPos);
};
if !(_nozzle getVariable [QGVAR(jerryCan), false]) then {
[{
params ["_args", "_pfID"];
_args params [
["_unit", player, [objNull]],
["_source", objNull, [objNull]],
["_endPosOffset", [0, 0, 0], [[]], 3],
["_nozzle", _unit getVariable [QGVAR(nozzle), objNull], [objNull]]
];
if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (REFUEL_HOSE_LENGTH - 2)} || {!alive _source}) exitWith {
if !(isNull _nozzle) then {
[_unit, _nozzle] call FUNC(dropNozzle);
REFUEL_UNHOLSTER_WEAPON
[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set);
if (isNull _source || {!alive _source}) then {
private _rope = _nozzle getVariable [QGVAR(rope), objNull];
if !(isNull _rope) then {
ropeDestroy _rope;
};
deleteVehicle _nozzle;
} else {
[LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured);
};
};
[_pfID] call cba_fnc_removePerFrameHandler;
};
}, 0, [_unit, _target, _endPosOffset]] call cba_fnc_addPerFrameHandler;
};