Merge remote-tracking branch 'origin' into medical-rewrite

This commit is contained in:
commy2 2016-10-11 19:14:13 +02:00
commit ed6688c899
16 changed files with 132 additions and 42 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

@ -53,7 +53,12 @@ if (_hasBeenAttached && {isNull attachedTo _unit}) exitWith {
_dummy setVelocity [0,0,-6];
//Check if fast rope is finished
if (((getPos _unit select 2) < 0.2) || {ropeLength _ropeTop == 34.5} || {vectorMagnitude (velocity _vehicle) > 5} || {!(alive _unit)} || {captive _unit}) exitWith {
if (
((getPos _unit select 2) < 0.2)
|| {ropeLength _ropeTop == 34.5}
|| {vectorMagnitude (velocity _vehicle) > 5}
|| {!([_unit] call EFUNC(common,isAwake))}
) exitWith {
detach _unit;
//Reset rope

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

@ -85,7 +85,7 @@ private _size = 2 * sqrt (1 / _distance) * (call EFUNC(common,getZoom));
drawIcon3D [
format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen],
[[1,0.25,0.25,0.5*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen,
[[1,0.25,0.25,0.6*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen,
_pL,
_size,
_size,

View File

@ -12,7 +12,7 @@
#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
// MINIMAL required version for the Mod. Components can specify others..
#define REQUIRED_VERSION 1.62
#define REQUIRED_VERSION 1.64
#define REQUIRED_CBA_VERSION {3,1,0}
#ifdef COMPONENT_BEAUTIFIED

View File

@ -35,3 +35,6 @@ GVAR(showNamesTime) = -10;
call FUNC(updateSettings);
};
}] call CBA_fnc_addEventHandler;
// civilians don't use military ranks
["CIV_F", ["","","","","","",""]] call FUNC(setFactionRankIcons);

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;
};

View File

@ -32,14 +32,14 @@
- Install `make` and `gcc`
```
sudo apt-get make gcc
sudo apt-get install make gcc
```
- Install `ruby 2.0`, `rbuy2.0-dev` and `ruby-switch`
- Install `ruby2.0`, `rbuy2.0-dev` and `ruby-switch`
```
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt update
sudo apt install ruby2.0 ruby2.0-dev ruby-switch
sudo apt-get update
sudo apt-get install ruby2.0 ruby2.0-dev ruby-switch
```
- Set Ruby version