Jump to content
M1ke_SK

ace3 handleDamage vs vanilla handleDamage

Recommended Posts

I have addEventHandler ["HandleDamage"] like this

private ["_return", "_unit", "_source", "_oldDamage", "_bodyMultiplayer", "_headMultiplier", "_selection", "_passedDamage", "_projectile", "_hitPartIndex"];

params [
    "_unit",  //unit: Object - Object the event handler is assigned to.
    "_selection",  //selectionName: String - Name of the selection where the unit was damaged. "" for over-all structural damage, "?" for unknown selections.
    "_passedDamage",  //damage: Number - Resulting level of damage for the selection.
    "_source",  //source: Object - The source unit that caused the damage.
    "_projectile", //projectile: String - Classname of the projectile that caused inflicted the damage. ("" for unknown, such as falling damage.)
    "_hitPartIndex" //hitPartIndex: Number - Hit part index of the hit point, -1 otherwise.
];

_bodyMultiplayer = 0.5; // 50% of damage body
_headMultiplier = 2; // 200% of damage to head

_oldDamage = 0; 

switch (_selection) do
{ 
    case("head"):
    {
        _oldDamage = _unit getHitPointDamage "HitHead";
        _return = _oldDamage + ((_passedDamage - _oldDamage) * _headMultiplier); 
    };
    default {
        _return = _oldDamage + ((_passedDamage - _oldDamage) * _bodyMultiplayer);
    }; 
}; 

if (isClass(configFile >> "CfgPatches" >> "ace_main")) then 
{ 
    //[this, "body", 0, objNull, "stab", 0, 0.30] call ace_medical_fnc_handleDamage_advanced;  
    //[_unit, _return, _selection, _projectile] call ace_medical_fnc_addDamageToUnit;
    [_unit, _selection, _return, _source, _projectile, -1] call ace_medical_fnc_handleDamage;
}; 

_return

How to register modified damage with ace3 handleDamage ?

 

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×