Skip to content

Commit

Permalink
Chemical - Fix chemical zeus module (#551)
Browse files Browse the repository at this point in the history
I hate this bs...

**When merged this pull request will:**
- _Describe what this pull request will do_
- _Each change in a separate line_

### IMPORTANT

- [Development Guidelines](https://ace3.acemod.org/wiki/development/)
are read, understood and applied.
- Title of this PR uses our standard template `Component -
Add|Fix|Improve|Change|Make|Remove {changes}`.

---------

Co-authored-by: MiszczuZPolski <[email protected]>
  • Loading branch information
AtrixZockt and MiszczuZPolski authored Jul 24, 2024
1 parent 4cdb6c1 commit 5901134
Show file tree
Hide file tree
Showing 35 changed files with 372 additions and 517 deletions.
2 changes: 1 addition & 1 deletion addons/chemical/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ACE_Medical_Treatment_Actions {
class Diagnose;
class putonGasMask: Diagnose {
class PutOnGasMask: Diagnose {
displayName = CSTRING(giveGasMask_action);
displayNameProgress = CSTRING(giveGasMask_progress);
allowedSelections[] = {"Head"};
Expand Down
18 changes: 9 additions & 9 deletions addons/chemical/CfgAmmo.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
class cfgAmmo
class CfgAmmo
{
class SmokeShellArty;
class KAT_SmokeShellArty: SmokeShellArty{
smokeColor[] = {0,0,0,0};
};

class Smoke_82mm_AMOS_White;
class Sh_82mm_AMOS_Type0: Smoke_82mm_AMOS_White
class Sh_82mm_AMOS_Type0: Smoke_82mm_AMOS_White
{
KAT_projectile = 1;
KAT_lifetime = 90;
Expand All @@ -30,7 +30,7 @@ class cfgAmmo
};

class SmokeShell;
class KAT_G_M7A3: SmokeShell
class KAT_G_M7A3: SmokeShell
{
KAT_csGas = 1;
model = QPATHTOF(ui\m7a3_throw.p3d);
Expand Down Expand Up @@ -58,7 +58,7 @@ class cfgAmmo
indirectHit = 0;
indirectHitRange = 0;
soundHit[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100};
explosionEffects = "KAT_GASTripEffect";
explosionEffects = "KAT_GASTripEffect";
CraterEffects = "";
soundTrigger[] = {"",1,1};
class CamShakeExplode {
Expand Down Expand Up @@ -90,7 +90,7 @@ class cfgAmmo
explosionTime = 2;
explosionForceCoef = 5;
explosive = 0.95;
ExplosionEffects = "BombExplosion";
ExplosionEffects = "BombExplosion";
flightProfiles[] = {"LoalAltitude"};
hit = 0;
indirectHit = 0;
Expand All @@ -116,14 +116,14 @@ class cfgAmmo
distance = 250;
};


};
class Mo_cluster_Bomb_01_F;
class KAT_CAS_M43_Ammo_sub: Mo_cluster_Bomb_01_F {
hit = 0;
indirectHit = 0;
indirectHitRange = 0;
explosionEffects = "KAT_GAS_ClusterExplosion";
explosionEffects = "KAT_GAS_ClusterExplosion";
};

class R_80mm_HE;
Expand All @@ -133,4 +133,4 @@ class cfgAmmo
indirectHitRange = 0;
explosionEffects = "KAT_CAS_R_HYDRA_Explosion"; //HERocketExplosion
};
};
};
12 changes: 5 additions & 7 deletions addons/chemical/CfgCloudlets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ class CfgCloudlets {
class Default;
class ACE_GasTrip: Default {
lifeTime = 0;
beforeDestroyScript = QPATHTOF(functions\fnc_GasTripEffect.sqf);
beforeDestroyScript = QPATHTOF(functions\fnc_GasTripEffect.sqf);
};



class CAS_GAS_Explosion_FX_Script: Default {
lifeTime = 0;
beforeDestroyScript = QPATHTOF(functions\fnc_CASCreateGas.sqf);
beforeDestroyScript = QPATHTOF(functions\fnc_CASCreateGas.sqf);
};

class CAS_GAS_Explosion_FX: Default {
interval = 0.03;
circleRadius = 0;
Expand Down Expand Up @@ -113,8 +111,8 @@ class CfgCloudlets {
angle = 0;
position[] = {0,0.2,0};
};
};
};

class KAT_GASTripEffect {
class spawnGAS {
simulation = "particles";
Expand Down
30 changes: 0 additions & 30 deletions addons/chemical/CfgUIGrids.hpp

This file was deleted.

5 changes: 2 additions & 3 deletions addons/chemical/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ class CfgVehicles {
class GAS_Type
{
displayName = CSTRING(UI_gasType);
typeName = "STRING";
typeName = "NUMBER";
class values {
class toxicgas {
name = CSTRING(LvL1_Gas);
value = "Toxic";
value = 0;
default = 1;
};
/* class csgas {
Expand Down Expand Up @@ -210,7 +210,6 @@ class CfgVehicles {
};

class APERSTripMine;

class KAT_Gas_TripWireMine: APERSTripMine {
author = "DiGii";
ammo = "KAT_Gas_TripWireMine_Ammo";
Expand Down
5 changes: 1 addition & 4 deletions addons/chemical/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
PREP(addLoadAction);
PREP(afterWait);
PREP(AttributeRadius);
PREP(breathing);
Expand All @@ -8,11 +7,10 @@ PREP(CASCreateGas);
PREP(changeGasMaskFilter);
PREP(checkGasMaskDur);
PREP(chemDetector);
PREP(clearChemicalInjuriesLocal);
PREP(coughing);
PREP(createSealAction);
PREP(createZone);
PREP(csGrenadeThrownFuze);
PREP(csGrenade);
PREP(displayGasMaskDur);
PREP(fullHealLocal);
PREP(gasAI);
Expand All @@ -33,7 +31,6 @@ PREP(hasGasmask);
PREP(hasGasMaskON);
PREP(init);
PREP(initModule);
PREP(spawnGasSmoke);
PREP(spawnSmoke);
PREP(throwGrenade);
PREP(treatmentAdvanced_AtropineLocal);
Expand Down
9 changes: 5 additions & 4 deletions addons/chemical/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

//Events
[QGVAR(gasCheck), LINKFUNC(gasCheck)] call CBA_fnc_addEventHandler;
[QGVAR(gasCheck_local), LINKFUNC(gasCheckLocal)] call CBA_fnc_addEventHandler;
[QGVAR(gasCheck_ai), LINKFUNC(gasAI)] call CBA_fnc_addEventHandler;
[QGVAR(gasPlayer), LINKFUNC(gasCheckLocal)] call CBA_fnc_addEventHandler;
[QGVAR(gasAI), LINKFUNC(gasAI)] call CBA_fnc_addEventHandler;
[QGVAR(afterWait), LINKFUNC(afterWait)] call CBA_fnc_addEventHandler;
[QGVAR(enteredPoisonEvent), LINKFUNC(chemDetector)] call CBA_fnc_addEventHandler;
[QGVAR(enteredZone), LINKFUNC(chemDetector)] call CBA_fnc_addEventHandler;
[QGVAR(createZoneGlobal), LINKFUNC(createZone)] call CBA_fnc_addEventHandler;
[QGVAR(createSealActionGlobal), LINKFUNC(createSealAction)] call CBA_fnc_addEventHandler;

// ACE Events
[QACEGVAR(medical_gui,updateInjuryListGeneral), LINKFUNC(gui_updateInjuryListGeneral)] call CBA_fnc_addEventHandler;
Expand All @@ -19,7 +21,6 @@
//Mortar Events
["Mortar_01_base_F", "fired", {call FUNC(handleFired)}] call CBA_fnc_addClassEventHandler;
KAT_ProjectileCache = ("([_x, 'KAT_projectile', 0] call BIS_fnc_returnConfigEntry) != 0" configClasses (configFile >> "cfgAmmo")) apply {configName _x};
[] call FUNC(addLoadAction);

//Grenade Events
["ace_firedPlayer", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler;
Expand Down
1 change: 0 additions & 1 deletion addons/chemical/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class CfgPatches {
#include "CfgAmmo.hpp"
#include "CfgCloudlets.hpp"
#include "CfgMagazines.hpp"
#include "CfgUIGrids.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "CfgSounds.hpp"
Expand Down
8 changes: 4 additions & 4 deletions addons/chemical/functions/fnc_AttributeRadius.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
params ["_control"];

private _display = ctrlParent _control;
private _logic = missionNamespace getVariable["BIS_fnc_initCuratorAttributes_target",objNull];
private _logic = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target",objNull];
_control ctrlRemoveAllEventHandlers "SetFocus";

private _sealCheckBox = _display displayCtrl 1613;
private _sealText = _display displayCtrl 1614;
private _placeText = _display displayCtrl 1616;
// Specific onLoad stuff
if!(isNull attachedTo _logic) then {
if !(isNull attachedTo _logic) then {
_sealCheckBox ctrlShow true;
_sealText ctrlShow true;

Expand Down Expand Up @@ -76,14 +76,14 @@ private _fnc_onKeyUp = {
};

private _fnc_onCheckChange = {
params["_sealCheckBox"];
params ["_sealCheckBox"];
_display = ctrlParent _sealCheckBox;
private _canBeSealed = cbChecked(_display displayCtrl 1613);
_display setVariable [QGVAR(ui_sealable),_canBeSealed];
};

private _fnc_onLBSelChange = {
params["_gasTypeCombo"];
params ["_gasTypeCombo"];
_display = ctrlParent _gasTypeCombo;
private _gastype = lbCurSel _gasTypeCombo;
_display setVariable [QGVAR(ui_gastype),_gastype];
Expand Down
3 changes: 2 additions & 1 deletion addons/chemical/functions/fnc_CASCreateGas.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/

params ["_posX", "_posY", "_posZ"];
[[_posX, _posY, _posZ], 240, 15, 0] call FUNC(createZone);

[QGVAR(createZoneGlobal), [[_posX, _posY, _posZ], 240, 15, 0]] call CBA_fnc_globalEventJIP;
1 change: 1 addition & 0 deletions addons/chemical/functions/fnc_GasTripEffect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
* Creates effects when Trip wire explodes.
* Cant be called manualy!
*/

[FUNC(spawnSmoke), _this] call CBA_fnc_directcall;
33 changes: 0 additions & 33 deletions addons/chemical/functions/fnc_addLoadAction.sqf

This file was deleted.

36 changes: 18 additions & 18 deletions addons/chemical/functions/fnc_afterWait.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,45 @@
* NONE
*
* Example:
* [player, logic, "Toxic", 50] call kat_chemical_fnc_afterWait;
* [player, logic, 0, 50] call kat_chemical_fnc_afterWait;
*
* Public: No
*/

params ["_unit", "_logic", "_gastype", "_radius_max"];

if (!isDamageAllowed _unit) exitWith {
[_unit] call FUNC(clearChemicalInjuriesLocal);
[_unit] call FUNC(fullHealLocal);
};

if ((goggles _unit) in (missionNamespace getVariable [QGVAR(availGasmaskList), []])) then {
private _isinGas = true;
[
{
params["_args", "_pfhHandler"];
params ["_args", "_pfhHandler"];
_args params["_unit", "_logic", "_gastype", "_radius_max", "_isinGas"];

if !(_isinGas) exitwith {
[_pfhHandler] call CBA_fnc_removePerFrameHandler;
};

private _timeleft = _unit getVariable[QGVAR(gasmask_durability), 10];
_pos = _logic getVariable [QGVAR(gas_pos), [0, 0, 0]];
private _timeleft = _unit getVariable [QGVAR(gasmask_durability), 10];
_pos = _logic getVariable [QGVAR(gas_position), [0, 0, 0]];
if (_unit distance _pos > _radius_max || !(_logic getVariable[QGVAR(gas_active), false]) || isNull _logic) exitwith {
_unit setVariable[QGVAR(enteredPoison), false, true];
_unit setVariable [QGVAR(enteredPoison), false, true];
_isinGas = false;
};

if !((goggles _unit) in (missionNamespace getVariable [QGVAR(availGasmaskList), []]) && _timeleft > 0) then {
_unit setVariable [QGVAR(poisonType), _gastype, true];
switch (_gastype) do {
case "Toxic": {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
case "CS": {
case 1: {
_unit setVariable [QGVAR(CS), true, true];
[_unit, _logic, _radius_max] call FUNC(handleCSGas);
};
case 0: {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
};
[_unit] call EFUNC(breathing,handleBreathing);
_isinGas = false;
Expand All @@ -61,13 +61,13 @@ if ((goggles _unit) in (missionNamespace getVariable [QGVAR(availGasmaskList), [
if (_timeleft <= 0 && _unit getVariable [QGVAR(enteredPoison), false]) then {
_unit setVariable [QGVAR(poisonType), _gastype, true];
switch (_gastype) do {
case "Toxic": {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
case "CS": {
case 1: {
_unit setVariable [QGVAR(CS), true, true];
[_unit, _logic, _radius_max] call FUNC(handleCSGas);
};
case 0: {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
};
[_unit] call EFUNC(breathing,handleBreathing);
_isinGas = false;
Expand All @@ -85,13 +85,13 @@ if ((goggles _unit) in (missionNamespace getVariable [QGVAR(availGasmaskList), [
if (_unit getVariable [QGVAR(enteredPoison), false]) then {
_unit setVariable [QGVAR(poisonType), _gastype, true];
switch (_gastype) do {
case "Toxic": {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
case "CS": {
case 1: {
_unit setVariable [QGVAR(CS), true, true];
[_unit, _logic, _radius_max] call FUNC(handleCSGas);
};
case 0: {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
};
[_unit] call EFUNC(breathing,handleBreathing);
};
Expand Down
4 changes: 2 additions & 2 deletions addons/chemical/functions/fnc_canPutGasMask.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

params ["_medic", "_patient"];

if(missionNamespace getVariable [QGVAR(availGasmaskList), []] isEqualTo []) exitWith {false};
if (missionNamespace getVariable [QGVAR(availGasmaskList), []] isEqualTo []) exitWith {false};

!(_patient call ACE_common_fnc_isAwake) && ([_medic,_patient] call FUNC(hasGasmask)) && !((goggles _patient) in (missionNamespace getVariable [QGVAR(availGasmaskList), []]))
!(_patient call ACE_common_fnc_isAwake) && ([_medic, _patient] call FUNC(hasGasmask)) && !((goggles _patient) in (missionNamespace getVariable [QGVAR(availGasmaskList), []]))
Loading

0 comments on commit 5901134

Please sign in to comment.