Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Vehicle Damage (ACE2 port) & Enhance Cook-Off #7565

Merged
merged 60 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a690d6a
Initital port of ACE2 Vehicle Damage
TheCandianVendingMachine Feb 20, 2020
145824b
Add fire damage and burning people
TheCandianVendingMachine Feb 22, 2020
7f6c166
Migrate vehicle damge stuff from cookoff. Change cookoff function to …
TheCandianVendingMachine Feb 29, 2020
133cdd0
Minor tweaks
TheCandianVendingMachine Feb 29, 2020
a436ecf
Add incendiary values to all applicable ammunition. Add engine fire/s…
TheCandianVendingMachine Mar 1, 2020
9e2bebb
Handle car damage more elegantly.
TheCandianVendingMachine Mar 1, 2020
b9e0ceb
Added ability to create fire sources arbitrarily
TheCandianVendingMachine Mar 1, 2020
8f04572
tweaks
TheCandianVendingMachine Mar 1, 2020
42099d7
Add chance to detonate after cookoff
TheCandianVendingMachine Mar 1, 2020
9441f30
disable compile cache
TheCandianVendingMachine Mar 3, 2020
6cfe07d
Move blown-off turret config to vehicle damage. Add settings initital…
TheCandianVendingMachine Mar 3, 2020
b685334
tabs->spaces
TheCandianVendingMachine Mar 3, 2020
62db7cd
Various code improvements
TheCandianVendingMachine Mar 3, 2020
f22f0c0
Change to count loop for deleting effects
TheCandianVendingMachine Mar 3, 2020
3f032a5
update addon requirements
TheCandianVendingMachine Mar 3, 2020
c2c63e5
remove vanilla config requirements
TheCandianVendingMachine Mar 4, 2020
310932b
Add RHS compatability
TheCandianVendingMachine Mar 5, 2020
67cc592
RHS compat. Various QOL fixes/changes
TheCandianVendingMachine Mar 6, 2020
b665217
Various tweaks to compats and code.
TheCandianVendingMachine Mar 6, 2020
b0548e9
High-Explosive damage tweak
TheCandianVendingMachine Mar 6, 2020
132a4ca
Change how penetration is calculated for parts
TheCandianVendingMachine Mar 6, 2020
89dffc7
Fix RHS compat
TheCandianVendingMachine Mar 6, 2020
083a0f8
Create setting for flare effect
TheCandianVendingMachine Mar 6, 2020
8788697
increase burning scream sounds
TheCandianVendingMachine Mar 11, 2020
2aba117
swap out file name for snake_case
TheCandianVendingMachine Mar 12, 2020
ec8d512
move incendiary values out of vehicle damage. remove medical dependency
TheCandianVendingMachine Mar 12, 2020
1f3053f
Merge branch 'master' into pr/7565
PabstMirror May 7, 2020
aa0ef14
vehicle_dammage - update all refs to snake
PabstMirror May 7, 2020
66a23fc
sqf fixes
PabstMirror May 7, 2020
aef1d81
fix fire string package caps
PabstMirror May 7, 2020
18870d7
fix pboprefix
PabstMirror May 7, 2020
ea446c3
Default setting to on
TheCandianVendingMachine May 14, 2020
628f84c
Add variables to enable/disable ring fire to avoid goofy looking vehi…
TheCandianVendingMachine May 14, 2020
fee9d04
Fix bug where event handler wasn't giving the damage last.
TheCandianVendingMachine May 14, 2020
e89d488
change to snake
TheCandianVendingMachine May 14, 2020
635f272
fix build errors
TheCandianVendingMachine May 14, 2020
1cd4291
Fix UBC
PabstMirror May 15, 2020
887527e
Fix Order of Operations
TheCandianVendingMachine May 15, 2020
c64624d
Merge branch 'VehicleDamage' of https://github.com/TheCandianVendingM…
TheCandianVendingMachine May 15, 2020
c820de4
avoid O^2 events
TheCandianVendingMachine May 15, 2020
7f43efb
Make sure that no damage processing happens on dead units
TheCandianVendingMachine Jul 6, 2020
0a8916d
Change some if statements
TheCandianVendingMachine Jul 6, 2020
9ae7709
Keep track of player's death to stop various things
TheCandianVendingMachine Sep 10, 2020
743f117
add quotes to right middle wheen
TheCandianVendingMachine Dec 5, 2020
93f7543
Add VD documentation
TheCandianVendingMachine Dec 13, 2020
afd137a
fire docs
TheCandianVendingMachine Dec 13, 2020
d45219a
Code quality fixes
TheCandianVendingMachine Dec 13, 2020
af7f641
Clarify documentation
TheCandianVendingMachine Dec 13, 2020
22a39ad
define IDD
TheCandianVendingMachine Dec 13, 2020
e9a6180
switch global -> server
TheCandianVendingMachine Dec 13, 2020
78cec40
Add newline between header and first code statement
TheCandianVendingMachine Dec 13, 2020
382a08a
stop the dead from suffering
TheCandianVendingMachine Mar 4, 2021
49a31a0
Add settings to disable cook-off effects
TheCandianVendingMachine Apr 7, 2021
8eaaf28
Delete effects if vehicle is deleted before cookoff occurs. Don't coo…
TheCandianVendingMachine Apr 20, 2021
611e6cd
Move fire into own PR
TheCandianVendingMachine May 6, 2021
d33448c
Merge branch 'VehicleDamage' of https://github.com/TheCandianVendingM…
PabstMirror Jul 2, 2021
28ebdc0
fix tabs and macro
PabstMirror Jul 2, 2021
7451836
Shuffle crew indices so that a random person is first on the list to …
TheCandianVendingMachine Jul 12, 2021
d77cb5f
Merge branch 'VehicleDamage' of https://github.com/TheCandianVendingM…
TheCandianVendingMachine Jul 12, 2021
13444cf
fix effects not clearing
TheCandianVendingMachine Aug 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addons/aircraft/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CfgAmmo {
explosive = 0;
CraterEffects = "";
explosionEffects = "";
EGVAR(vehicle_damage,incendiary) = 0.5;
};

// adjust minigun caliber and deflection to other ammo
Expand Down Expand Up @@ -58,6 +59,7 @@ class CfgAmmo {
indirectHit = 2.5; // default: 4
indirectHitRange = 1; // default: 3
fuseDistance = 0.2; // default: 10
EGVAR(vehicle_damage,incendiary) = 1.0;
};

// adds submunition logic, enabling multiple rounds per frame
Expand All @@ -69,6 +71,7 @@ class CfgAmmo {
model = "\A3\Weapons_f\Data\bullettracer\tracer_red.p3d";
triggerTime = 0.005;
ACE_caliber = 1.4;
EGVAR(vehicle_damage,incendiary) = 1.0;
};

class ACE_Gatling_30mm_Sub_AP: ACE_Gatling_30mm_Sub_HEI {
Expand Down
2 changes: 2 additions & 0 deletions addons/ballistics/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ class CfgAmmo {
ACE_dragModel=7;
ACE_muzzleVelocities[]={880, 895, 900};
ACE_barrelLengths[]={508.0, 685.8, 711.2};
EGVAR(vehicle_damage,incendiary) = 1.0;
};
class B_127x33_Ball: BulletBase {
tracerScale = 1.3; //1.2;
Expand Down Expand Up @@ -665,6 +666,7 @@ class CfgAmmo {
ACE_dragModel=1;
ACE_muzzleVelocities[]={900};
ACE_barrelLengths[]={736.6};
EGVAR(vehicle_damage,incendiary) = 1.0;
};
class ACE_127x99_Ball_AMAX : B_127x99_Ball {
timeToLive=10;
Expand Down
27 changes: 0 additions & 27 deletions addons/cookoff/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,6 @@ class CfgVehicles {
sound = QGVAR(CookOff_high);
};

class ThingX;
class GVAR(Turret_MBT_01): ThingX {
author = ECSTRING(common,ACETeam);
_generalMacro = QGVAR(Turret_MBT_01);
scope = 1;
displayName = CSTRING(generic_turret_wreck);
model = "\A3\Structures_F\Wrecks\Wreck_Slammer_turret_F.p3d";
icon = "\A3\armor_f_gamma\MBT_01\Data\ui\map_slammer_mk4_ca.paa";
};
class GVAR(Turret_MBT_02): ThingX {
author = ECSTRING(common,ACETeam);
_generalMacro = QGVAR(Turret_MBT_02);
scope = 1;
displayName = CSTRING(generic_turret_wreck);
model = "\A3\Structures_F\Wrecks\Wreck_T72_turret_F.p3d";
icon = "\A3\armor_f_gamma\MBT_02\Data\UI\map_MBT_02_ca.paa";
};

class Tank;
class Tank_F: Tank {
GVAR(ammoLocation) = "HitHull";
Expand Down Expand Up @@ -60,15 +42,6 @@ class CfgVehicles {
GVAR(ignoreTurret) = 1;
};

class B_MBT_01_base_F;
class B_MBT_01_cannon_F: B_MBT_01_base_F {
GVAR(turret)[] = {QGVAR(Turret_MBT_01),{0,-1,0.5}};
TheCandianVendingMachine marked this conversation as resolved.
Show resolved Hide resolved
};

class O_MBT_02_base_F;
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};
Expand Down
5 changes: 3 additions & 2 deletions addons/cookoff/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
PREP(handleDamage);
PREP(engineFire);
PREP(cookOff);
PREP(smoke);
PREP(cookOffEffect);
PREP(cookOffBox);
PREP(blowOffTurret);
PREP(detonateAmmunition);
PREP(getVehicleAmmo);
PREP(handleDamageEjectIfDestroyed);

109 changes: 16 additions & 93 deletions addons/cookoff/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,72 +1,31 @@
#include "script_component.hpp"

[QGVAR(engineFire), FUNC(engineFire)] call CBA_fnc_addEventHandler;
[QGVAR(cookOff), FUNC(cookOff)] call CBA_fnc_addEventHandler;
[QGVAR(cookOffBox), FUNC(cookOffBox)] call CBA_fnc_addEventHandler;

GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;

// cookoff and burning engine
["Tank", "init", {
[QGVAR(cookOff), {
params ["_vehicle"];

private _typeOf = typeOf _vehicle;

if (isNil {GVAR(cacheTankDuplicates) getVariable _typeOf}) then {
private _hitpoints = (getAllHitPointsDamage _vehicle param [0, []]) apply {toLower _x};
private _duplicateHitpoints = [];

{
if ((_x != "") && {_x in (_hitpoints select [0,_forEachIndex])}) then {
_duplicateHitpoints pushBack _forEachIndex;
};
} forEach _hitpoints;

TRACE_2("dupes",_typeOf,_duplicateHitpoints);
GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints];
if (local _vehicle) then {
_this call FUNC(cookOff);
jonpas marked this conversation as resolved.
Show resolved Hide resolved
};
}] call CBA_fnc_addEventHandler;
[QGVAR(cookOffEffect), FUNC(cookOffEffect)] call CBA_fnc_addEventHandler;
[QGVAR(smoke), FUNC(smoke)] call CBA_fnc_addEventHandler;
[QGVAR(cookOffBox), FUNC(cookOffBox)] call CBA_fnc_addEventHandler;

_vehicle addEventHandler ["HandleDamage", {
["tank", _this] call FUNC(handleDamage);
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;

["Wheeled_APC_F", "init", {
params ["_vehicle"];

private _typeOf = typeOf _vehicle;

if (isNil {GVAR(cacheTankDuplicates) getVariable _typeOf}) then {
private _hitpoints = (getAllHitPointsDamage _vehicle param [0, []]) apply {toLower _x};
private _duplicateHitpoints = [];

{
if ((_x != "") && {_x in (_hitpoints select [0,_forEachIndex])}) then {
_duplicateHitpoints pushBack _forEachIndex;
};
} forEach _hitpoints;

TRACE_2("dupes",_typeOf,_duplicateHitpoints);
GVAR(cacheTankDuplicates) setVariable [_typeOf, _duplicateHitpoints];
[QGVAR(cleanupEffects), {
params ["_vehicle", ["_effects", []]];

_effects = _effects + _vehicle getVariable [QGVAR(effects), []];
if !(_effects isEqualTo []) then {
{ deleteVehicle _x } count _effects;
};
}] call CBA_fnc_addEventHandler;

_vehicle addEventHandler ["HandleDamage", {
["tank", _this] call FUNC(handleDamage);
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;

["Car", "init", {
params ["_vehicle"];

_vehicle addEventHandler ["HandleDamage", {
["car", _this] call FUNC(handleDamage);
}];
}, nil, ["Wheeled_APC_F"], true] call CBA_fnc_addClassEventHandler;
GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;

["ReammoBox_F", "init", {
(_this select 0) addEventHandler ["HandleDamage", {
if ((_this select 0) getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmobox)]) then {
["box", _this] call FUNC(handleDamage);
_this call FUNC(handleDamage);
};
}];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;
Expand All @@ -83,39 +42,3 @@ GVAR(cacheTankDuplicates) = call CBA_fnc_createNamespace;
[_vehicle, _mags, _total] call FUNC(detonateAmmunition);
};
}, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler;

// blow off turret effect
["Tank", "killed", {
params ["_vehicle", "", "", "_useEffects"];
if (
_useEffects &&
_vehicle getVariable [QGVAR(enable), GVAR(enable)] in [1, 2, true]
) then {
if (random 1 < 0.15) then {
_vehicle call FUNC(blowOffTurret);
};
};
}] call CBA_fnc_addClassEventHandler;

// event to add a turret to a curator if the vehicle already belonged to that curator
if (isServer) then {
[QGVAR(addTurretToEditable), {
params ["_vehicle", "_turret"];

{
if (_vehicle in curatorEditableObjects _x) then {
_x addCuratorEditableObjects [[_turret], false];
};
} forEach allCurators;
}] call CBA_fnc_addEventHandler;
};

// init eject from destroyed vehicle
{
[_x, "init", {
params ["_vehicle"];
if (!alive _vehicle) exitWith {};
TRACE_2("ejectIfDestroyed init",_vehicle,typeOf _vehicle);
_vehicle addEventHandler ["HandleDamage", {call FUNC(handleDamageEjectIfDestroyed)}];
}, true, [], true] call CBA_fnc_addClassEventHandler;
} forEach EJECT_IF_DESTROYED_VEHICLES;
Loading