mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cleaned up repair function headers and some code
This commit is contained in:
parent
85cc662fa4
commit
701c98e0da
@ -1,12 +1,17 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Called from init eventhandler. Checks if the vehicles class already has the actions initialized. Otherwise add all available repair options.
|
||||
* Checks if the vehicles class already has the actions initialized, otherwise add all available repair options. Calleed from init EH.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: vehicle <OBJECT>
|
||||
* 0: Vehicle <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [vehicle] call ace_repair_fnc_addRepairActions
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]
|
||||
|
@ -4,11 +4,16 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: vehicle to repair <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_canRemoveTrack
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -4,11 +4,16 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: vehicle to repair <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_canRemoveWheel
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -3,17 +3,19 @@
|
||||
* Check if the repair action can be performed.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The caller <OBJECT>
|
||||
* 1: The target <OBJECT>
|
||||
* 2: Selection name <STRING>
|
||||
* 3: ACE_Engineeral_Treatments Classname <STRING>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
* 3: Repair Action Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Can Treat <BOOL>
|
||||
* Can Repair <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* ["something", player] call ace_repair_fnc_canRepair
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_caller", "_target", "_hitPoint", "_className"];
|
||||
|
@ -3,12 +3,17 @@
|
||||
* Check if the unit can replace given wheel of the vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing (Object)
|
||||
* 1: vehicle to repair (Object)
|
||||
* 2: Selected hitpoint (String)
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_canRepairTrack
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
@ -34,4 +39,3 @@ if (typeName _wheel == "OBJECT") then {
|
||||
if (isNull _wheel || damage _wheel >= 1) exitWith {false};
|
||||
|
||||
alive _target && {_target getHitPointDamage _hitPoint > 0}
|
||||
|
||||
|
@ -3,12 +3,17 @@
|
||||
* Check if the unit can replace given wheel of the vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing (Object)
|
||||
* 1: vehicle to repair (Object)
|
||||
* 2: Selected hitpoint (String)
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hipoint"] call ace_repair_fnc_canReplaceTrack
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
@ -34,4 +39,3 @@ if (typeName _wheel == "OBJECT") then {
|
||||
if (isNull _wheel) exitWith {false};
|
||||
|
||||
alive _target && {_target getHitPointDamage _hitPoint >= 1}
|
||||
|
||||
|
@ -3,12 +3,17 @@
|
||||
* Check if the unit can replace given wheel of the vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing (Object)
|
||||
* 1: vehicle to repair (Object)
|
||||
* 2: Selected hitpoint (String)
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_canReplaceWheel
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
@ -40,4 +45,3 @@ if (typeName _wheel == "OBJECT") then {
|
||||
if (isNull _wheel) exitWith {false};
|
||||
|
||||
alive _target && {_target getHitPointDamage _hitPoint >= 1}
|
||||
|
||||
|
@ -1,13 +1,19 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
*
|
||||
* Called by repair action / progress bar. Raise events to set the new hitpoint damage.
|
||||
*
|
||||
* Arguments:
|
||||
* Stuff from progress bar.
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_doFullRepair
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,13 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Called by repair action / progress bar. Raise events to set the new hitpoint damage.
|
||||
*
|
||||
* Arguments:
|
||||
* Stuff from progress bar.
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_doRemoveTrack
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,13 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Called by repair action / progress bar. Raise events to set the new hitpoint damage.
|
||||
*
|
||||
* Arguments:
|
||||
* Stuff from progress bar.
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_doRemoveWheel
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -3,10 +3,17 @@
|
||||
* Called by repair action / progress bar. Raise events to set the new hitpoint damage.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Stuff from progress bar. <ARRAY>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_doRepair
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -3,10 +3,18 @@
|
||||
* Called by repair action / progress bar. Raise events to set the new hitpoint damage.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Stuff from progress bar. <ARRAY>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
* 3: Repair Action Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doRepairTrack
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -3,10 +3,18 @@
|
||||
* Called by repair action / progress bar. Raise events to set the new hitpoint damage.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Stuff from progress bar. <ARRAY>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
* 3: Repair Action Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doReplaceTrack
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -3,10 +3,18 @@
|
||||
* Called by repair action / progress bar. Raise events to set the new hitpoint damage.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Stuff from progress bar. <ARRAY>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
* 3: Repair Action Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doReplaceWheel
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,4 +1,18 @@
|
||||
// by comm2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Returns the damage threshold based on settings and unit type.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Rpair Damage Threshold <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_repair_fnc_getPostRepairDamage
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
@ -3,10 +3,16 @@
|
||||
* Returns the wheel hitpoints and their selections.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: A vehicle <Object>
|
||||
* 0: Vehicle <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Wheel positions in model coordinates. <Array>
|
||||
* 0: Wheel hitpoints <ARRAY>
|
||||
* 1: Wheel hitpoint selections in model coordinates <ARRAY>
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_getWheelHitPointsWithSelections
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -3,28 +3,30 @@
|
||||
* Check if the engineer has all items.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Engineer <OBJECT>
|
||||
* 1: Patient <OBJECT>
|
||||
* 2: Items <ARRAY<STRING>>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Items required <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Has the items <BOOL>
|
||||
* Has Items <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [engineer, [items]] call ace_repair_fnc_hasItems
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_engineer", "_items"];
|
||||
TRACE_2("params",_engineer,_items);
|
||||
params ["_unit", "_items"];
|
||||
TRACE_2("params",_unit,_items);
|
||||
|
||||
private ["_return"];
|
||||
|
||||
_return = true;
|
||||
{
|
||||
if (typeName _x == "ARRAY" && {({[_engineer, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith {
|
||||
if (typeName _x == "ARRAY" && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith {
|
||||
_return = false;
|
||||
};
|
||||
if (typeName _x == "STRING" && {!([_engineer, _x] call EFUNC(common,hasItem))}) exitwith {
|
||||
if (typeName _x == "STRING" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitwith {
|
||||
_return = false;
|
||||
};
|
||||
} forEach _items;
|
||||
|
@ -1,13 +1,16 @@
|
||||
/*
|
||||
* Author: Glowbal, KoffeinFlummi, commy2
|
||||
* Check if a unit is any engineer class
|
||||
* Check if a unit is any engineer class.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The Unit <OBJECT>
|
||||
* 1: Class <NUMBER> <OPTIONAL>
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Class <NUMBER> (Optional)
|
||||
*
|
||||
* Return Value:
|
||||
* Is in of engineer class <BOOL>
|
||||
* Is Engineer Class <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit, 1] call ace_repair_fnc_isEngineer
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
@ -1,16 +1,18 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Checks if a unit is in a repair facility
|
||||
* Checks if a unit is in a repair facility.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The Unit <OBJECT>
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Is inside a repair facility <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_repair_fnc_isInRepairFacility
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object"];
|
||||
|
@ -1,16 +1,18 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi
|
||||
* Checks if a unit is in a engineeral vehicle.
|
||||
* Checks if a unit is near an engineering vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: unit to be checked <OBJECT>
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Is unit in engineeral vehicle? <BOOL>
|
||||
* Is near engineering vehicle <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit] call ace_repair_fnc_isNearRepairVehicle
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
@ -1,12 +1,15 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if vehicle is a engineeral vehicle
|
||||
* Check if vehicle is a engineering vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The Vehicle <OBJECT>
|
||||
* 0: Vehicle <OBJECT>
|
||||
*
|
||||
* ReturnValue:
|
||||
* Is in of engineer class <BOOL>
|
||||
* Is engineering vehicle <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [vehicle] call ace_repair_fnc_isRepairVehicle
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
@ -1,18 +1,20 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Assign an engineer role to a unit
|
||||
* Assign an engineer role to a unit.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
* 0: The module logic <OBJECT>
|
||||
* 1: Synchronized units <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* function = "ace_repair_fnc_moduleAssignEngineer"
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic"];
|
||||
|
@ -1,18 +1,20 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Assign an repair facility
|
||||
* Assign a repair facility.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
* 0: The module logic <OBJECT>
|
||||
* 1: Synchronized units <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* function = "ace_repair_fnc_moduleAssignRepairFacility"
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic"];
|
||||
|
@ -1,18 +1,20 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Assign an repair vehicle
|
||||
* Assign a repair vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
* 0: The module logic <OBJECT>
|
||||
* 1: Synchronized units <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* function = "ace_repair_fnc_moduleAssignRepairVehicle"
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic"];
|
||||
|
@ -1,12 +1,17 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Module for adjusting the repair damage settings
|
||||
* Adjusts repair damage settings.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 0: The module logic <OBJECT>
|
||||
* 1: Synchronized units <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* function = "ace_repair_fnc_moduleRepairSettings"
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -3,29 +3,31 @@
|
||||
* Used to normalize dependant hitpoints. May overwrite some global variables that are named like hitpoints or "Total" though...
|
||||
*
|
||||
* Arguments:
|
||||
* 0: A local vehicle with hitpoints. <OBJECT>
|
||||
* 0: Local Vehicle <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [vehicle] call ace_repair_fnc_normalizeHitPoints
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle"];
|
||||
TRACE_1("params",_vehicle);
|
||||
|
||||
// can't execute all commands if the vehicle isn't local. exit here.
|
||||
// Can't execute all commands if the vehicle isn't local, exit if that's so
|
||||
if !(local _vehicle) exitWith {};
|
||||
|
||||
private ["_hitPoints", "_config"];
|
||||
private ["_hitPoints", "_config", "_dependentHitPoints", "_dependentHitPointScripts", "_damage"];
|
||||
|
||||
_hitPoints = [_vehicle] call EFUNC(common,getHitPoints);
|
||||
|
||||
_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints";
|
||||
|
||||
// define global variables. Needed to parse the depends config entries. Also find dependent hitpoints.
|
||||
|
||||
private ["_dependentHitPoints", "_dependentHitPointScripts"];
|
||||
|
||||
_dependentHitPoints = [];
|
||||
_dependentHitPointScripts = [];
|
||||
|
||||
@ -33,21 +35,14 @@ Total = damage _vehicle;
|
||||
|
||||
{
|
||||
missionNamespace setVariable [_x, _vehicle getHitPointDamage _x];
|
||||
|
||||
if (isText (_config >> _x >> "depends")) then {
|
||||
_dependentHitPoints pushBack _x;
|
||||
_dependentHitPointScripts pushBack compile getText (_config >> _x >> "depends");
|
||||
};
|
||||
|
||||
} forEach _hitPoints;
|
||||
|
||||
// apply normalized damage to all dependand hitpoints
|
||||
|
||||
{
|
||||
private "_damage";
|
||||
|
||||
_damage = call (_dependentHitPointScripts select _forEachIndex);
|
||||
|
||||
_vehicle setHitPointDamage [_x, _damage];
|
||||
|
||||
} forEach _dependentHitPoints;
|
||||
|
@ -1,19 +1,21 @@
|
||||
/*
|
||||
* Author: Glowbal, KoffeinFlummi
|
||||
* Starts the repair process
|
||||
* Starts the repair process.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The engineer <OBJECT>
|
||||
* 1: The patient <OBJECT>
|
||||
* 2: SelectionName <STRING>
|
||||
* 3: repair classname <STRING>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT
|
||||
* 2: Selected hitpoint <STRING>
|
||||
* 3: Repair Action Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Succesful repair started <BOOL>
|
||||
* Succesful Repair Started <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_repair
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_caller", "_target", "_hitPoint", "_className"];
|
||||
|
@ -1,15 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
*
|
||||
* Start a repair action and open progress bar.
|
||||
* Starts a repair action with a progress bar.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing (Object)
|
||||
* 1: vehicle to repair (Object)
|
||||
* 2: Selected hitpoint (String)
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_repairVehicle
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,16 +1,21 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, Glowbal
|
||||
* Callback when the repair fails
|
||||
* Callback when repair fails.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The engineer <OBJECT>
|
||||
* 1: The patient <OBJECT>
|
||||
* 2: SelectionName <STRING>
|
||||
* 3: Treatment classname <STRING>
|
||||
* 4: Items available <ARRAY<STRING>>
|
||||
* 0: Arguments <ARRAY>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT
|
||||
* 2: Selected hitpoint <STRING>
|
||||
* 3: Repair Action Classname <STRING>
|
||||
* 4: None
|
||||
* 5: Items available <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* nil
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [[unit, vehicle, "hitpoint", "classname", nil, [items]]] call ace_repair_fnc_repair_failure
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -1,20 +1,22 @@
|
||||
/*
|
||||
* Author: KoffeinFlummi, Glowbal
|
||||
* Callback when the repair is completed
|
||||
* Callback when repair completes.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The engineer <OBJECT>
|
||||
* 1: The patient <OBJECT>
|
||||
* 2: SelectionName <STRING>
|
||||
* 3: Treatment classname <STRING>
|
||||
* 4: Items available <ARRAY<STRING>>
|
||||
* 0: Arguments <ARRAY>
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT
|
||||
* 2: Selected hitpoint <STRING>
|
||||
* 3: Repair Action Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* nil
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [[unit, vehicle, "hitpoint", "classname"]] call ace_repair_fnc_repair_success
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_args"];
|
||||
|
@ -1,13 +1,18 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Sets the structural damage of a vehicle without altering the hitPoints. Requires local vehicle.
|
||||
* Sets the structural damage of a vehicle without altering the hitPoints, requires local vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: vehicle to damage <OBJECT>
|
||||
* 1: Total damage <NUMBER>
|
||||
* 0: Local Vehicle to Damage <OBJECT>
|
||||
* 1: Total Damage <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [vehicle, 0.5] call ace_repair_fnc_setDamage
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,14 +1,19 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Set the hitpoint damage and change the structural damage acordingly. Requires local vehicle.
|
||||
* Set the hitpoint damage and change the structural damage acordingly, requires local vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: vehicle
|
||||
* 1: hitpoint
|
||||
* 2: damage
|
||||
* 0: Local Vehicle to Damage <OBJECT>
|
||||
* 1: Selected hitpoint <STRING>
|
||||
* 2: Total Damage <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* NONE
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [vehicle, "hitpoint", 0.5] call ace_repair_fnc_setHitPointDamage
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,4 +1,20 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Spawns an object of specified string, at specified position with specified damage taken.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Item classname <STRING>
|
||||
* 1: Position <ARRAY>
|
||||
* 2: Damage <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["classname", [0, 0, 0], 1] call ace_repair_fnc_spawnObject
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_item", "_position", ["_damage", 0]];
|
||||
|
@ -3,22 +3,24 @@
|
||||
* Use Equipment if any is available.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Engineer <OBJECT>
|
||||
* 2: Item <STRING>
|
||||
* 0: Unit <OBJECT>
|
||||
* 2: Item classname <STRING>
|
||||
*
|
||||
* ReturnValue:
|
||||
* <NIL>
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, "classname"] call ace_repair_fnc_useItem
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_engineer", "_item"];
|
||||
TRACE_2("params",_engineer,_item);
|
||||
params ["_unit", "_item"];
|
||||
TRACE_2("params",_unit,_item);
|
||||
|
||||
if ([_engineer, _item] call EFUNC(common,hasItem)) exitwith {
|
||||
[[_engineer, _item], QUOTE(EFUNC(common,useItem)), _engineer] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
[true, _engineer];
|
||||
if ([_unit, _item] call EFUNC(common,hasItem)) exitwith {
|
||||
[[_unit, _item], QUOTE(EFUNC(common,useItem)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
[true, _unit];
|
||||
};
|
||||
[false, objNull];
|
||||
|
@ -3,19 +3,21 @@
|
||||
* Use Equipment items if any is available.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Engineer <OBJECT>
|
||||
* 1: Items <ARRAY<STRING>>
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Item classnames <ARRAY>
|
||||
*
|
||||
* ReturnValue:
|
||||
* <NIL>
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [unit, ["classname1", "classname2"]] call ace_repair_fnc_useItems
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_engineer", "_items"];
|
||||
TRACE_2("params",_engineer,_items);
|
||||
params ["_unit", "_items"];
|
||||
TRACE_2("params",_unit,_items);
|
||||
|
||||
private ["_itemUsedInfo", "_itemsUsedBy"];
|
||||
|
||||
@ -24,14 +26,14 @@ _itemsUsedBy = [];
|
||||
// handle a one of type use item
|
||||
if (typeName _x == "ARRAY") then {
|
||||
{
|
||||
_itemUsedInfo = [_engineer, _x] call FUNC(useItem);
|
||||
_itemUsedInfo = [_unit, _x] call FUNC(useItem);
|
||||
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
|
||||
} forEach _x;
|
||||
};
|
||||
|
||||
// handle required item
|
||||
if (typeName _x == "STRING") then {
|
||||
_itemUsedInfo = [_engineer, _x] call FUNC(useItem);
|
||||
_itemUsedInfo = [_unit, _x] call FUNC(useItem);
|
||||
if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]};
|
||||
};
|
||||
} forEach _items;
|
||||
|
Loading…
Reference in New Issue
Block a user