mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
04e41a4d5a
* add variable full repair time * enable compile cache * Fix stupid * whoops * incremental full repair * cleanup function header * ignore hitpoints inFullRepairProgress * fix getHitPointsToIgnore * final cleanup * don't show repair hint while doing full repair * make this all work * fix stupid put this back in place * Add setting for speedup when near repair facility/vehicle enable compile cache * refactor near repair facility/vehicle checks * remove skipping hint from do_repair better for feedback this way * git diff stuff * use functions directly in ACE_Repair.hpp * add check for vehicle proximity * add a new line * switch to multiply by setting instead * speed boost settings, remove exit addRepairActions * stringtable * remove speed boost settings * fix things, add forceDisplayName * name in function header * fix TRACE * add animation looping * remove systemChat Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com> * add time coefficient setting * move to repair category * time coefficient max and default values --------- Co-authored-by: Salluci <69561145+Salluci@users.noreply.github.com> Co-authored-by: Filip Maciejewski <veteran29@users.noreply.github.com>
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Returns the damage threshold based on settings and unit type.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit that does the repairing <OBJECT>
|
|
* 1: Override for full repair <BOOL> (default: false)
|
|
*
|
|
* Return Value:
|
|
* 0: Repair Damage Threshold <NUMBER>
|
|
*
|
|
* Example:
|
|
* [unit] call ace_repair_fnc_getPostRepairDamage
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit", ["_override", false]];
|
|
TRACE_2("params",_unit,_override);
|
|
|
|
//If in facility, near vehicle, or doing full repair then complete repair of hitpoint:
|
|
if ((_override || {[_unit] call FUNC(isInRepairFacility)} || {[_unit] call FUNC(isNearRepairVehicle)})) exitWith {0};
|
|
|
|
private _class = _unit getVariable ["ACE_IsEngineer", getNumber (configOf _unit >> "engineer")];
|
|
//If advanced or more qualified than min, then use engineer threshold:
|
|
if ((_class isEqualTo 2) || {[_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)}) exitWith {
|
|
(GVAR(repairDamageThreshold_Engineer) min GVAR(repairDamageThreshold))
|
|
};
|
|
|
|
//Return default threshold:
|
|
GVAR(repairDamageThreshold)
|