Merge pull request #4411 from acemod/burn-wheels

incendiary and cookoff improvements
This commit is contained in:
commy2 2016-09-17 18:30:08 +02:00 committed by GitHub
commit d5edc5a1f5
6 changed files with 66 additions and 10 deletions

View File

@ -53,4 +53,20 @@ class CfgVehicles {
class O_MBT_02_cannon_F: O_MBT_02_base_F {
GVAR(turret)[] = {QGVAR(Turret_MBT_02),{0,-1,0}};
};
class MRAP_01_base_F: Car_F {
GVAR(engineSmokeOffset)[] = {0,-2,0};
};
class MRAP_02_base_F: Car_F {
GVAR(engineSmokeOffset)[] = {0,-2,0};
};
class MRAP_03_base_F: Car_F {
GVAR(engineSmokeOffset)[] = {0,-2,0};
};
class Quadbike_01_base_F: Car_F {
GVAR(engineSmokeOffset)[] = {0,1,0};
};
};

View File

@ -24,11 +24,17 @@ if (local _vehicle) then {
[QGVAR(engineFire), _vehicle] call CBA_fnc_remoteEvent;
};
private _offset = getArray (_vehicle call CBA_fnc_getObjectConfig >> QGVAR(engineSmokeOffset));
if (_offset isEqualTo []) then {
_offset = [0,0,0];
};
private _position = [
0,
(boundingBoxReal _vehicle select 1 select 1) - 4,
(boundingBoxReal _vehicle select 1 select 1) - 2,
(boundingBoxReal _vehicle select 0 select 2) + 2
];
] vectorAdd _offset;
private _smoke = "#particlesource" createVehicleLocal [0,0,0];
_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx";

View File

@ -70,7 +70,7 @@ if (_simulationType == "tank") exitWith {
_vehicle call FUNC(cookOff);
};
} else {
if (_hitpoint in ["hitbody", "hitturret", "#structural"] && {_newDamage > 0.6 + random 0.3}) then {
if (_hitpoint in ["hithull", "hitturret", "#structural"] && {_newDamage > 0.6 + random 0.3}) then {
_vehicle call FUNC(cookOff);
};
};

View File

@ -144,7 +144,7 @@ if (isServer) then {
//systemChat format ["burn: %1", _x];
// --- destroy nearby static weapons and ammo boxes
if (_x isKindOf "StaticWeapon" || {_x isKindOf "ReammoBox_F"}) then {
if (_x isKindOf "StaticWeapon" || {_x isKindOf "ReammoBox_F"} || {_x isKindOf "ACE_RepairItem_Base"}) then {
_x setDamage 1;
};
@ -158,11 +158,39 @@ if (isServer) then {
};
} forEach (_position nearObjects EFFECT_SIZE);
// --- burn car engine
// --- damage local vehicle
private _vehicle = _position nearestObject "Car";
if (!local _vehicle || {_vehicle isKindOf "Wheeled_APC_F"}) exitWith {};
private _engineSelection = getText (_vehicle call CBA_fnc_getObjectConfig >> "HitPoints" >> "HitEngine" >> "name");
if (!local _vehicle) exitWith {};
private _config = _vehicle call CBA_fnc_getObjectConfig;
// --- burn tyres
private _fnc_isWheelHitPoint = {
params ["_selectionName"];
// wheels must use a selection named "wheel_X_Y_steering" for PhysX to work
_selectionName select [0, 6] == "wheel_" && {
_selectionName select [count _selectionName - 9] == "_steering"
} // return
};
{
private _wheelSelection = getText (_config >> "HitPoints" >> _x >> "name");
if (_wheelSelection call _fnc_isWheelHitPoint) then {
private _wheelPosition = _vehicle modelToWorld (_vehicle selectionPosition _wheelSelection);
if (_position distance _wheelPosition < EFFECT_SIZE * 2) then {
_vehicle setHit [_wheelSelection, 1];
};
};
} forEach (getAllHitPointsDamage _vehicle param [0, []]);
// --- burn car engine
if (_vehicle isKindOf "Wheeled_APC_F") exitWith {};
private _engineSelection = getText (_config >> "HitPoints" >> "HitEngine" >> "name");
private _enginePosition = _vehicle modelToWorld (_vehicle selectionPosition _engineSelection);
if (_position distance _enginePosition < EFFECT_SIZE * 2) then {

View File

@ -15,7 +15,7 @@
}; \
};
class CBA_Extended_EventHandlers;
class CBA_Extended_EventHandlers_base;
class CfgVehicles {
class ACE_Module;
@ -311,14 +311,14 @@ class CfgVehicles {
class ThingX;
class ACE_RepairItem_Base: ThingX {
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {};
};
icon = "iconObject_circle";
mapSize = 0.7;
accuracy = 0.2;
vehicleClass = "ACE_Logistics_Items";
destrType = "DesturctNo";
destrType = "DesturctNo"; // scripted delayed destruction
};
class ACE_Track: ACE_RepairItem_Base {

View File

@ -4,4 +4,10 @@ ADDON = false;
#include "XEH_PREP.hpp"
["ACE_RepairItem_Base", "killed", {
params ["_object"];
[{deleteVehicle _this}, _object, 5] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addClassEventHandler;
ADDON = true;