mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
73a7dbdc1e
- Add stackable wound handler system for easy 3rd party extensibility and overriding of default wound handler. - Change mapping from wound type -> damage types, to damage type -> wound types. Improves the semantics and makes configuration easier to reason about. - Allow damage types to influence wound properties (bleed, size, etc.) with configurable variance parameters. - Allow configuration of wound type variance per damage type. Enabling more logically driven variance for sensible but still varied end results. - Improve handling of non-selection-specific damage events. The wound handler now receives all incoming damages and may apply damage to multiple selections (previously only ever one) if the damage type is not configured to be selection specific (with new config property `selectionSpecific`). - Add debug script for testing explosion damage events at varied ranges. - Add custom fire wound handler.
34 lines
930 B
Plaintext
34 lines
930 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Pterolatypus
|
|
* Read a list of wound handler entries from config, accounting for inheritance
|
|
*
|
|
* Arguments:
|
|
* 0: The config class containing the entries <CONFIG>
|
|
*
|
|
* ReturnValue:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [configFile >> "ace_medical_injuries" >> "damageTypes"] call ace_medical_damage_fnc_parseWoundHandlersCfg
|
|
*
|
|
* Public: No
|
|
*/
|
|
params ["_config"];
|
|
|
|
// read all valid entries from config and store
|
|
private _entries = [];
|
|
{
|
|
private _entryResult = call compile getText _x;
|
|
if !(isNil "_entryResult") then {
|
|
_entries pushBack _entryResult;
|
|
}
|
|
} forEach configProperties [_config, "isText _x", false];
|
|
|
|
private _parent = inheritsFrom _config;
|
|
if (isNull _parent) exitWith {_entries};
|
|
|
|
// recursive call for parent
|
|
// can't use configProperties for inheritance since it returns entries in the wrong order
|
|
([_parent] call FUNC(parseWoundHandlersCfg)) + _entries;
|