From 667caafb82902e5b2f3ff35f0e6176fdbd1aa96b Mon Sep 17 00:00:00 2001 From: diwako Date: Mon, 5 Oct 2020 12:38:42 +0200 Subject: [PATCH 1/4] Tabs to spaces Zen modules Reduction of proxy objects --- mod/diwako_anomalies/cfgAmmo.hpp | 26 +- mod/diwako_anomalies/cfgFactionClasses.hpp | 10 +- mod/diwako_anomalies/cfgFunctions.hpp | 126 ++-- mod/diwako_anomalies/cfgMagazines.hpp | 52 +- mod/diwako_anomalies/cfgSounds.hpp | 266 ++++----- mod/diwako_anomalies/cfgVehicles.hpp | 18 +- mod/diwako_anomalies/cfgWeapons.hpp | 88 +-- mod/diwako_anomalies/config.cpp | 32 +- .../functions/added/fn_autoInit.sqf | 16 +- .../functions/added/fn_grenadeBolt.sqf | 8 +- .../functions/added/fn_registerSettings.sqf | 96 ++-- .../functions/added/fn_throwEVH.sqf | 36 +- .../functions/anomalies/fn_activateBurner.sqf | 168 +++--- .../anomalies/fn_activateElectra.sqf | 257 +++++---- .../functions/anomalies/fn_activateFog.sqf | 112 ++-- .../anomalies/fn_activateFruitPunch.sqf | 70 ++- .../anomalies/fn_activateMeatgrinder.sqf | 102 ++-- .../anomalies/fn_activateSpringboard.sqf | 133 +++-- .../anomalies/fn_activateTeleport.sqf | 80 +-- .../anomalies/fn_createAnomalyField.sqf | 50 +- .../functions/anomalies/fn_createBurner.sqf | 46 +- .../functions/anomalies/fn_createElectra.sqf | 46 +- .../functions/anomalies/fn_createFog.sqf | 54 +- .../anomalies/fn_createFruitPunch.sqf | 42 +- .../anomalies/fn_createMeatgrinder.sqf | 34 +- .../anomalies/fn_createSpringboard.sqf | 34 +- .../functions/anomalies/fn_createTeleport.sqf | 59 +- .../anomalies/fn_deleteAnomalies.sqf | 86 +-- .../anomalies/fn_deleteParticleSource.sqf | 2 +- .../anomalies/fn_getLocationFromModule.sqf | 4 +- .../functions/anomalies/fn_hasItem.sqf | 10 +- .../functions/anomalies/fn_init.sqf | 539 ++++++++++-------- .../functions/anomalies/fn_minceCorpse.sqf | 41 +- .../functions/anomalies/fn_setLight.sqf | 10 +- .../functions/anomalies/fn_setTrigger.sqf | 10 +- .../functions/anomalies/fn_suckToLocation.sqf | 22 +- .../functions/anomalies/fn_teleportFlash.sqf | 36 +- .../functions/anomalies/fn_throwBolt.sqf | 136 ++--- .../functions/detector/fn_detector.sqf | 92 +-- .../functions/effects/anomalies/fn_burner.sqf | 60 +- .../effects/anomalies/fn_electra.sqf | 18 +- .../functions/effects/anomalies/fn_fog.sqf | 103 ++-- .../effects/anomalies/fn_fruitPunch.sqf | 30 +- .../effects/anomalies/fn_meatgrinder.sqf | 30 +- .../effects/anomalies/fn_springboard.sqf | 30 +- .../effects/anomalies/fn_teleport.sqf | 12 +- 46 files changed, 1690 insertions(+), 1642 deletions(-) diff --git a/mod/diwako_anomalies/cfgAmmo.hpp b/mod/diwako_anomalies/cfgAmmo.hpp index 343f1c6..bf2ec73 100644 --- a/mod/diwako_anomalies/cfgAmmo.hpp +++ b/mod/diwako_anomalies/cfgAmmo.hpp @@ -1,16 +1,16 @@ class cfgAmmo { - class GrenadeHand_stone; + class GrenadeHand_stone; - class bolt_ammo: GrenadeHand_stone - { - model = "\diwako_anomalies\data\models\bolt.p3d"; - SoundSetExplosion[] = {""}; - explosive = 0; - explosionEffectsRadius = 0; - explosionSoundEffect = ""; - CraterWaterEffects = ""; - explosionType = ""; - timeToLive = 20; - explosionTime = 25; - }; + class bolt_ammo: GrenadeHand_stone + { + model = "\diwako_anomalies\data\models\bolt.p3d"; + SoundSetExplosion[] = {""}; + explosive = 0; + explosionEffectsRadius = 0; + explosionSoundEffect = ""; + CraterWaterEffects = ""; + explosionType = ""; + timeToLive = 20; + explosionTime = 25; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/cfgFactionClasses.hpp b/mod/diwako_anomalies/cfgFactionClasses.hpp index 434587f..96ef8d0 100644 --- a/mod/diwako_anomalies/cfgFactionClasses.hpp +++ b/mod/diwako_anomalies/cfgFactionClasses.hpp @@ -1,7 +1,7 @@ class CfgFactionClasses { - class NO_CATEGORY; - class DIW_ANOMALY: NO_CATEGORY - { - displayName = "$STR_anomaly_category"; - }; + class NO_CATEGORY; + class DIW_ANOMALY: NO_CATEGORY + { + displayName = "$STR_anomaly_category"; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/cfgFunctions.hpp b/mod/diwako_anomalies/cfgFunctions.hpp index 5205c7e..a563d65 100644 --- a/mod/diwako_anomalies/cfgFunctions.hpp +++ b/mod/diwako_anomalies/cfgFunctions.hpp @@ -1,65 +1,65 @@ class cfgFunctions { - class anomaly { - tag="anomaly"; - class functions { - file = "diwako_anomalies\functions\anomalies"; - class createSpringboard; - class activateSpringboard; - class createMeatgrinder; - class activateMeatgrinder; - class createElectra; - class activateElectra; - class createBurner; - class activateBurner; - class createTeleport; - class activateTeleport; - class teleportFlash; - class minceCorpse; - class suckToLocation; - class init; - class hasItem; - class deleteParticleSource; - class deleteAnomalies; - class throwBolt; - class createAnomalyField; - class getLocationFromModule; - class createFog; - class activateFog; - class createFruitPunch; - class activateFruitPunch; - class setTrigger; - class setLight; - }; - }; - class anomalyEffect { - tag="anomalyEffect"; - class functions { - file = "diwako_anomalies\functions\effects\anomalies"; - class springboard; - class meatgrinder; - class electra; - class burner; - class teleport; - class fog; - class fruitPunch; - }; - }; - class anomalyDetector { - tag="anomalyDetector"; - class functions{ - file = "diwako_anomalies\functions\detector"; - class detector; - }; - }; - //functions added by Belbo: - class added { - tag="anomaly"; - class functions{ - file = "diwako_anomalies\functions\added"; - class autoInit {postInit = 1;}; - class throwEVH {postInit = 1;}; - class grenadeBolt; - class registerSettings; - }; - }; + class anomaly { + tag="anomaly"; + class functions { + file = "diwako_anomalies\functions\anomalies"; + class createSpringboard; + class activateSpringboard; + class createMeatgrinder; + class activateMeatgrinder; + class createElectra; + class activateElectra; + class createBurner; + class activateBurner; + class createTeleport; + class activateTeleport; + class teleportFlash; + class minceCorpse; + class suckToLocation; + class init; + class hasItem; + class deleteParticleSource; + class deleteAnomalies; + class throwBolt; + class createAnomalyField; + class getLocationFromModule; + class createFog; + class activateFog; + class createFruitPunch; + class activateFruitPunch; + class setTrigger; + class setLight; + }; + }; + class anomalyEffect { + tag="anomalyEffect"; + class functions { + file = "diwako_anomalies\functions\effects\anomalies"; + class springboard; + class meatgrinder; + class electra; + class burner; + class teleport; + class fog; + class fruitPunch; + }; + }; + class anomalyDetector { + tag="anomalyDetector"; + class functions{ + file = "diwako_anomalies\functions\detector"; + class detector; + }; + }; + //functions added by Belbo: + class added { + tag="anomaly"; + class functions{ + file = "diwako_anomalies\functions\added"; + class autoInit {postInit = 1;}; + class throwEVH {postInit = 1;}; + class grenadeBolt; + class registerSettings; + }; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/cfgMagazines.hpp b/mod/diwako_anomalies/cfgMagazines.hpp index 6ad82af..b46846c 100644 --- a/mod/diwako_anomalies/cfgMagazines.hpp +++ b/mod/diwako_anomalies/cfgMagazines.hpp @@ -1,30 +1,30 @@ class cfgMagazines { - class HandGrenade_Stone; + class HandGrenade_Stone; - class bolts_infinite_mag : HandGrenade_Stone { - ammo = "bolt_ammo"; - scope = 2; - count = 9999; - mass = 20; - descriptionShort = "$STR_anomaly_bolt_bag_desc"; - displayName = "$STR_anomaly_bolt_bag"; - displayNameShort = "$STR_anomaly_bolt_bag"; - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - /*picture = "\diwako_anomalies\data\ui\bolts.paa";*/ - picture = "\A3\Weapons_f\data\UI\gear_satchel_CA.paa"; - author = "diwako"; - }; + class bolts_infinite_mag : HandGrenade_Stone { + ammo = "bolt_ammo"; + scope = 2; + count = 9999; + mass = 20; + descriptionShort = "$STR_anomaly_bolt_bag_desc"; + displayName = "$STR_anomaly_bolt_bag"; + displayNameShort = "$STR_anomaly_bolt_bag"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + /*picture = "\diwako_anomalies\data\ui\bolts.paa";*/ + picture = "\A3\Weapons_f\data\UI\gear_satchel_CA.paa"; + author = "diwako"; + }; - class bolts_one_mag : bolts_infinite_mag { - scope = 2; - mass = 1; - displayName = "$STR_anomaly_bolt"; - displayNameShort = "$STR_anomaly_bolt"; - descriptionShort = "$STR_anomaly_bolt_desc"; - picture = "\diwako_anomalies\data\ui\bolts.paa"; - model = "\diwako_anomalies\data\models\bolt.p3d"; - count = 1; - ammo = "bolt_ammo"; - author = "diwako"; - }; + class bolts_one_mag : bolts_infinite_mag { + scope = 2; + mass = 1; + displayName = "$STR_anomaly_bolt"; + displayNameShort = "$STR_anomaly_bolt"; + descriptionShort = "$STR_anomaly_bolt_desc"; + picture = "\diwako_anomalies\data\ui\bolts.paa"; + model = "\diwako_anomalies\data\models\bolt.p3d"; + count = 1; + ammo = "bolt_ammo"; + author = "diwako"; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/cfgSounds.hpp b/mod/diwako_anomalies/cfgSounds.hpp index 9493a9e..4fa4e65 100644 --- a/mod/diwako_anomalies/cfgSounds.hpp +++ b/mod/diwako_anomalies/cfgSounds.hpp @@ -1,136 +1,136 @@ class cfgSounds { - sounds[] = {}; + sounds[] = {}; - class gravi_blowout1 - { - name = "gravi_blowout1"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout1.ogg", 1, 1, 180}; - titles[] = {}; - }; - class gravi_blowout2 - { - name = "gravi_blowout2"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout2.ogg", 1, 1, 180}; - titles[] = {}; - }; - class gravi_blowout3 - { - name = "gravi_blowout3"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout3.ogg", 1, 1, 180}; - titles[] = {}; - }; - class gravi_blowout4 - { - name = "gravi_blowout4"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout4.ogg", 1, 1, 180}; - titles[] = {}; - }; - class gravi_blowout5 - { - name = "gravi_blowout5"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout5.ogg", 1, 1, 180}; - titles[] = {}; - }; - class gravi_blowout6 - { - name = "gravi_blowout6"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout6.ogg", 1, 1, 180}; - titles[] = {}; - }; - class anomaly_body_tear_1 - { - name = "anomaly_body_tear_1"; - sound[] = {"diwako_anomalies\sounds\anomalies\anomaly_body_tear_1.ogg", 1, 1, 200}; - titles[] = {}; - }; - class anomaly_mincer_blowout - { - name = "anomaly_mincer_blowout"; - sound[] = {"diwako_anomalies\sounds\anomalies\anomaly_mincer_blowout.ogg", 1, 1, 180}; - titles[] = {}; - }; - class da_2_beep1 - { - name = "da_2_beep1"; - sound[] = {"diwako_anomalies\sounds\detector\da-2_beep1.ogg", 1, 1, 20}; - titles[] = {}; - }; - class electra_idle1 - { - name = "electra_idle1"; - sound[] = {"diwako_anomalies\sounds\anomalies\electra_idle1.ogg", 1, 1, 100}; - titles[] = {}; - }; - class electra_blast1 - { - name = "electra_blast1"; - sound[] = {"diwako_anomalies\sounds\anomalies\electra_blast1.ogg", 1, 1, 200}; - titles[] = {}; - }; - class electra_blast2 - { - name = "electra_blast2"; - sound[] = {"diwako_anomalies\sounds\anomalies\electra_blast2.ogg", 1, 1, 200}; - titles[] = {}; - }; - class gravi_idle00 - { - name = "gravi_idle00"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_idle00.ogg", 1, 1, 50}; - titles[] = {}; - }; - class gravi_idle01 - { - name = "gravi_idle01"; - sound[] = {"diwako_anomalies\sounds\anomalies\gravi_idle01.ogg", 1, 1, 50}; - titles[] = {}; - }; - class fire_idle - { - name = "fire_idle"; - sound[] = {"diwako_anomalies\sounds\anomalies\fire_idle.ogg", 1, 1, 50}; - titles[] = {}; - }; - class fire2 - { - name = "fire2"; - sound[] = {"diwako_anomalies\sounds\anomalies\fire2.ogg", 2, 1, 200}; - titles[] = {}; - }; - class teleport_idle - { - name = "teleport_idle"; - sound[] = {"diwako_anomalies\sounds\anomalies\teleport_idle.ogg", 1, 1, 25}; - titles[] = {}; - }; - class teleport_work_1 - { - name = "teleport_work_1"; - sound[] = {"diwako_anomalies\sounds\anomalies\teleport_work_1.ogg", 2, 1, 50}; - titles[] = {}; - }; - class teleport_work_2 - { - name = "teleport_work_2"; - sound[] = {"diwako_anomalies\sounds\anomalies\teleport_work_2.ogg", 2, 1, 50}; - titles[] = {}; - }; - class bfuzz_hit - { - name = "bfuzz_hit"; - sound[] = {"diwako_anomalies\sounds\anomalies\bfuzz_hit.ogg", 2, 1, 50}; - titles[] = {}; - }; - class buzz_hit - { - name = "buzz_hit"; - sound[] = {"diwako_anomalies\sounds\anomalies\buzz_hit.ogg", 2, 1, 50}; - titles[] = {}; - }; - class buzz_idle - { - name = "buzz_idle"; - sound[] = {"diwako_anomalies\sounds\anomalies\buzz_idle.ogg", 1, 1, 25}; - titles[] = {}; - }; + class gravi_blowout1 + { + name = "gravi_blowout1"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout1.ogg", 1, 1, 180}; + titles[] = {}; + }; + class gravi_blowout2 + { + name = "gravi_blowout2"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout2.ogg", 1, 1, 180}; + titles[] = {}; + }; + class gravi_blowout3 + { + name = "gravi_blowout3"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout3.ogg", 1, 1, 180}; + titles[] = {}; + }; + class gravi_blowout4 + { + name = "gravi_blowout4"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout4.ogg", 1, 1, 180}; + titles[] = {}; + }; + class gravi_blowout5 + { + name = "gravi_blowout5"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout5.ogg", 1, 1, 180}; + titles[] = {}; + }; + class gravi_blowout6 + { + name = "gravi_blowout6"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_blowout6.ogg", 1, 1, 180}; + titles[] = {}; + }; + class anomaly_body_tear_1 + { + name = "anomaly_body_tear_1"; + sound[] = {"diwako_anomalies\sounds\anomalies\anomaly_body_tear_1.ogg", 1, 1, 200}; + titles[] = {}; + }; + class anomaly_mincer_blowout + { + name = "anomaly_mincer_blowout"; + sound[] = {"diwako_anomalies\sounds\anomalies\anomaly_mincer_blowout.ogg", 1, 1, 180}; + titles[] = {}; + }; + class da_2_beep1 + { + name = "da_2_beep1"; + sound[] = {"diwako_anomalies\sounds\detector\da-2_beep1.ogg", 1, 1, 20}; + titles[] = {}; + }; + class electra_idle1 + { + name = "electra_idle1"; + sound[] = {"diwako_anomalies\sounds\anomalies\electra_idle1.ogg", 1, 1, 100}; + titles[] = {}; + }; + class electra_blast1 + { + name = "electra_blast1"; + sound[] = {"diwako_anomalies\sounds\anomalies\electra_blast1.ogg", 1, 1, 200}; + titles[] = {}; + }; + class electra_blast2 + { + name = "electra_blast2"; + sound[] = {"diwako_anomalies\sounds\anomalies\electra_blast2.ogg", 1, 1, 200}; + titles[] = {}; + }; + class gravi_idle00 + { + name = "gravi_idle00"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_idle00.ogg", 1, 1, 50}; + titles[] = {}; + }; + class gravi_idle01 + { + name = "gravi_idle01"; + sound[] = {"diwako_anomalies\sounds\anomalies\gravi_idle01.ogg", 1, 1, 50}; + titles[] = {}; + }; + class fire_idle + { + name = "fire_idle"; + sound[] = {"diwako_anomalies\sounds\anomalies\fire_idle.ogg", 1, 1, 50}; + titles[] = {}; + }; + class fire2 + { + name = "fire2"; + sound[] = {"diwako_anomalies\sounds\anomalies\fire2.ogg", 2, 1, 200}; + titles[] = {}; + }; + class teleport_idle + { + name = "teleport_idle"; + sound[] = {"diwako_anomalies\sounds\anomalies\teleport_idle.ogg", 1, 1, 25}; + titles[] = {}; + }; + class teleport_work_1 + { + name = "teleport_work_1"; + sound[] = {"diwako_anomalies\sounds\anomalies\teleport_work_1.ogg", 2, 1, 50}; + titles[] = {}; + }; + class teleport_work_2 + { + name = "teleport_work_2"; + sound[] = {"diwako_anomalies\sounds\anomalies\teleport_work_2.ogg", 2, 1, 50}; + titles[] = {}; + }; + class bfuzz_hit + { + name = "bfuzz_hit"; + sound[] = {"diwako_anomalies\sounds\anomalies\bfuzz_hit.ogg", 2, 1, 50}; + titles[] = {}; + }; + class buzz_hit + { + name = "buzz_hit"; + sound[] = {"diwako_anomalies\sounds\anomalies\buzz_hit.ogg", 2, 1, 50}; + titles[] = {}; + }; + class buzz_idle + { + name = "buzz_idle"; + sound[] = {"diwako_anomalies\sounds\anomalies\buzz_idle.ogg", 1, 1, 25}; + titles[] = {}; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/cfgVehicles.hpp b/mod/diwako_anomalies/cfgVehicles.hpp index 987b30b..7d4949e 100644 --- a/mod/diwako_anomalies/cfgVehicles.hpp +++ b/mod/diwako_anomalies/cfgVehicles.hpp @@ -1,28 +1,28 @@ class cfgVehicles { - class Item_Base_F; + class Item_Base_F; - class AnomalyDetector_Item: Item_Base_F { + class AnomalyDetector_Item: Item_Base_F { scope = 2; scopeCurator = 2; displayName = "$STR_anomaly_detector"; author = "[SeL] Belbo"; vehicleClass = "Items"; - editorPreview = "\diwako_anomalies\data\ui\AnomalyDetector.jpg"; + editorPreview = "\diwako_anomalies\data\ui\AnomalyDetector.jpg"; class TransportItems { MACRO_ADDITEM(AnomalyDetector,1); }; - }; - class BagOfBolts_Item: Item_Base_F { + }; + class BagOfBolts_Item: Item_Base_F { scope = 1; scopeCurator = 1; displayName = "Bag of Bolts (THIS ITEM IS DEPRECATED, DO NOT USE IT ANYMORE!)"; author = "[SeL] Belbo"; vehicleClass = "Items"; - editorPreview = "\A3\EditorPreviews_F\Data\CfgVehicles\SatchelCharge_F.jpg"; + editorPreview = "\A3\EditorPreviews_F\Data\CfgVehicles\SatchelCharge_F.jpg"; class TransportItems { MACRO_ADDITEM(BagOfBolts,1); }; - }; + }; class Land_Balloon_01_air_F; class bolt_throw_dummy: Land_Balloon_01_air_F { @@ -202,8 +202,8 @@ class cfgVehicles { }; }; }; - - class anoamly_moduleFruitPunch: Module_F { + + class anoamly_moduleFruitPunch: Module_F { author = "diwako"; category = "DIW_ANOMALY"; displayName = "$STR_anomaly_fruitpunch"; diff --git a/mod/diwako_anomalies/cfgWeapons.hpp b/mod/diwako_anomalies/cfgWeapons.hpp index 5518bd4..64e763d 100644 --- a/mod/diwako_anomalies/cfgWeapons.hpp +++ b/mod/diwako_anomalies/cfgWeapons.hpp @@ -1,50 +1,50 @@ class cfgWeapons { - class CBA_MiscItem; + class CBA_MiscItem; class CBA_MiscItem_ItemInfo; - class AnomalyDetector: CBA_MiscItem { - class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 10; - }; - scope = 2; - displayName = "$STR_anomaly_detector"; - descriptionShort = "$STR_anomaly_detector_desc"; - author = "[SeL] Belbo"; - picture = "\diwako_anomalies\data\ui\AnomalyDetector.paa"; - model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d"; - }; - class BagOfBolts: CBA_MiscItem { - class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 30; - }; - scope = 1; - displayName = "Bag of Bolts (THIS ITEM IS DEPRECATED, DO NOT USE IT ANYMORE!)"; - descriptionShort = "Throw a bolt to check for anomalies"; - author = "[SeL] Belbo"; - picture = "\A3\Weapons_f\data\UI\gear_satchel_CA.paa"; - }; + class AnomalyDetector: CBA_MiscItem { + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 10; + }; + scope = 2; + displayName = "$STR_anomaly_detector"; + descriptionShort = "$STR_anomaly_detector_desc"; + author = "[SeL] Belbo"; + picture = "\diwako_anomalies\data\ui\AnomalyDetector.paa"; + model = "\A3\Structures_F\Items\Tools\MultiMeter_F.p3d"; + }; + class BagOfBolts: CBA_MiscItem { + class ItemInfo: CBA_MiscItem_ItemInfo { + mass = 30; + }; + scope = 1; + displayName = "Bag of Bolts (THIS ITEM IS DEPRECATED, DO NOT USE IT ANYMORE!)"; + descriptionShort = "Throw a bolt to check for anomalies"; + author = "[SeL] Belbo"; + picture = "\A3\Weapons_f\data\UI\gear_satchel_CA.paa"; + }; - class GrenadeLauncher; + class GrenadeLauncher; - class Throw: GrenadeLauncher { - class ThrowMuzzle; - muzzles[] += { - "Throw_Bolt" - ,"Throw_Bolt_lim" - }; - class Throw_Bolt : ThrowMuzzle - { - magazinereloadtime = 0; - magazines[] = { - "bolts_infinite_mag" - }; - }; - class Throw_Bolt_lim : ThrowMuzzle - { - magazinereloadtime = 0; - magazines[] = { - "bolts_one_mag" - }; - }; - }; + class Throw: GrenadeLauncher { + class ThrowMuzzle; + muzzles[] += { + "Throw_Bolt" + ,"Throw_Bolt_lim" + }; + class Throw_Bolt : ThrowMuzzle + { + magazinereloadtime = 0; + magazines[] = { + "bolts_infinite_mag" + }; + }; + class Throw_Bolt_lim : ThrowMuzzle + { + magazinereloadtime = 0; + magazines[] = { + "bolts_one_mag" + }; + }; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/config.cpp b/mod/diwako_anomalies/config.cpp index a3d260b..581664f 100644 --- a/mod/diwako_anomalies/config.cpp +++ b/mod/diwako_anomalies/config.cpp @@ -3,22 +3,22 @@ class diwako_anomalies { units[] = { - "AnomalyDetector_Item" - ,"BagOfBolts_Item" - }; + "AnomalyDetector_Item", + "BagOfBolts_Item" + }; weapons[] = { - "AnomalyDetector" - ,"BagOfBolts" - }; + "AnomalyDetector", + "BagOfBolts" + }; requiredVersion = 1.82; requiredAddons[] = { - "cba_xeh" - ,"cba_common" - }; - version = "1.15"; - versionStr = "1.15"; - author = "diwako"; - authorUrl = "https://github.com/diwako/stalker_anomalies"; + "cba_xeh", + "cba_common" + }; + version = "1.16"; + versionStr = "1.16"; + author = "diwako"; + authorUrl = "https://github.com/diwako/stalker_anomalies"; }; }; @@ -27,9 +27,9 @@ count = COUNT; \ } class Extended_PreInit_EventHandlers { - class anomaly_settings { - init = "call anomaly_fnc_registerSettings"; - }; + class anomaly_settings { + init = "call anomaly_fnc_registerSettings"; + }; }; #include "cfgFactionClasses.hpp" diff --git a/mod/diwako_anomalies/functions/added/fn_autoInit.sqf b/mod/diwako_anomalies/functions/added/fn_autoInit.sqf index ff574e3..bfd24ff 100644 --- a/mod/diwako_anomalies/functions/added/fn_autoInit.sqf +++ b/mod/diwako_anomalies/functions/added/fn_autoInit.sqf @@ -5,12 +5,12 @@ Diwako Stalker Like Anomalies - added functions by Belbo private _enable = missionNamespace getVariable ["diwako_anomalies_enable",false]; if ( _enable && !(missionNamespace getVariable ["anomaly_var_init",false]) ) then { - if(isDedicated) then { - [] call anomaly_fnc_init; - } else { - [] spawn { - waitUntil {player == player}; - [] call anomaly_fnc_init; - }; - }; + if(isDedicated) then { + [] call anomaly_fnc_init; + } else { + [] spawn { + waitUntil {player == player}; + [] call anomaly_fnc_init; + }; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/added/fn_grenadeBolt.sqf b/mod/diwako_anomalies/functions/added/fn_grenadeBolt.sqf index b0f42cb..d4a569f 100644 --- a/mod/diwako_anomalies/functions/added/fn_grenadeBolt.sqf +++ b/mod/diwako_anomalies/functions/added/fn_grenadeBolt.sqf @@ -9,10 +9,10 @@ private _obj = createVehicle ["bolt_throw_dummy", getPos _projectile, [], 0, "CA _obj attachTo [_projectile]; [_obj] spawn { - params ["_obj"]; - sleep 10; - detach _obj; - deleteVehicle _obj; + params ["_obj"]; + sleep 10; + detach _obj; + deleteVehicle _obj; }; nil \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/added/fn_registerSettings.sqf b/mod/diwako_anomalies/functions/added/fn_registerSettings.sqf index 273e402..6c43925 100644 --- a/mod/diwako_anomalies/functions/added/fn_registerSettings.sqf +++ b/mod/diwako_anomalies/functions/added/fn_registerSettings.sqf @@ -6,84 +6,84 @@ Diwako Stalker Like Anomalies - added functions by Belbo //Enable Diwako Anomalies: [ - "diwako_anomalies_enable" - ,"CHECKBOX" - ,[(localize "STR_anomaly_settings_enable"),localize "STR_anomaly_settings_enable_desc"] - ,CBA_SETTINGS_CAT - ,false - ,true + "diwako_anomalies_enable" + ,"CHECKBOX" + ,[(localize "STR_anomaly_settings_enable"),localize "STR_anomaly_settings_enable_desc"] + ,CBA_SETTINGS_CAT + ,false + ,true ] call CBA_Settings_fnc_init; //Detection Range: [ - "ANOMALY_DETECTION_RANGE" - ,"SLIDER" - ,[localize "STR_anomaly_settings_detectionRange", localize "STR_anomaly_settings_detectionRange_desc"] - ,CBA_SETTINGS_CAT - ,[10, 50, 20, 0] - ,true + "ANOMALY_DETECTION_RANGE" + ,"SLIDER" + ,[localize "STR_anomaly_settings_detectionRange", localize "STR_anomaly_settings_detectionRange_desc"] + ,CBA_SETTINGS_CAT + ,[10, 50, 20, 0] + ,true ] call CBA_Settings_fnc_init; //Idle distance: [ - "ANOMALY_IDLE_DISTANCE" - ,"SLIDER" - ,[localize "STR_anomaly_settings_particleDistance",localize "STR_anomaly_settings_particleDistance_desc"] - ,CBA_SETTINGS_CAT - ,[350, 700, 350, 0] - ,true + "ANOMALY_IDLE_DISTANCE" + ,"SLIDER" + ,[localize "STR_anomaly_settings_particleDistance",localize "STR_anomaly_settings_particleDistance_desc"] + ,CBA_SETTINGS_CAT + ,[350, 700, 350, 0] + ,true ] call CBA_Settings_fnc_init; //Trigger activation distance: [ - "ANOMALY_TRIGGER_DISTANCE" - ,"SLIDER" - ,[localize "STR_anomaly_settings_triggerDistance",localize "STR_anomaly_settings_triggerDistance_desc"] - ,CBA_SETTINGS_CAT - ,[200, 500, 300, 0] - ,true + "ANOMALY_TRIGGER_DISTANCE" + ,"SLIDER" + ,[localize "STR_anomaly_settings_triggerDistance",localize "STR_anomaly_settings_triggerDistance_desc"] + ,CBA_SETTINGS_CAT + ,[200, 500, 300, 0] + ,true ] call CBA_Settings_fnc_init; //Detector Item: [ - "ANOMALY_DETECTOR_ITEM" - ,"EDITBOX" - ,[localize "STR_anomaly_settings_detectorItem", localize "STR_anomaly_settings_detectorItem_desc"] - ,CBA_SETTINGS_CAT - ,"AnomalyDetector" - ,true + "ANOMALY_DETECTOR_ITEM" + ,"EDITBOX" + ,[localize "STR_anomaly_settings_detectorItem", localize "STR_anomaly_settings_detectorItem_desc"] + ,CBA_SETTINGS_CAT + ,"AnomalyDetector" + ,true ] call CBA_Settings_fnc_init; /* //Bolt Item: [ - "ANOMALY_BOLT_ITEM" - ,"EDITBOX" - ,["Bolt Item", "Add classname of bolt item - required item to throw bolts, leave empty for no item - example: BagOfBolts"] - ,CBA_SETTINGS_CAT - ,"BagOfBolts" - ,true + "ANOMALY_BOLT_ITEM" + ,"EDITBOX" + ,["Bolt Item", "Add classname of bolt item - required item to throw bolts, leave empty for no item - example: BagOfBolts"] + ,CBA_SETTINGS_CAT + ,"BagOfBolts" + ,true ] call CBA_Settings_fnc_init; */ //Enable Debugging: [ - "ANOMALY_DEBUG" - ,"CHECKBOX" - ,[localize "STR_anomaly_settings_debug",localize "STR_anomaly_settings_debug_desc"] - ,CBA_SETTINGS_CAT - ,false - ,true + "ANOMALY_DEBUG" + ,"CHECKBOX" + ,[localize "STR_anomaly_settings_debug",localize "STR_anomaly_settings_debug_desc"] + ,CBA_SETTINGS_CAT + ,false + ,true ] call CBA_Settings_fnc_init; //Set gasmask items: [ - "ANOMALY_GAS_MASKS" - ,"EDITBOX" - ,[localize "STR_anomaly_settings_gasmasks",localize "STR_anomaly_settings_gasmasks_desc"] - ,CBA_SETTINGS_CAT - ,"GP5_RaspiratorPS,GP5Filter_RaspiratorPS,GP7_RaspiratorPS,GP21_GasmaskPS,SE_S10,G_Respirator_white_F,MASK_M40_OD,MASK_M40,MASK_M50" - ,true + "ANOMALY_GAS_MASKS" + ,"EDITBOX" + ,[localize "STR_anomaly_settings_gasmasks",localize "STR_anomaly_settings_gasmasks_desc"] + ,CBA_SETTINGS_CAT + ,"GP5_RaspiratorPS,GP5Filter_RaspiratorPS,GP7_RaspiratorPS,GP21_GasmaskPS,SE_S10,G_Respirator_white_F,MASK_M40_OD,MASK_M40,MASK_M50" + ,true ] call CBA_Settings_fnc_init; nil \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/added/fn_throwEVH.sqf b/mod/diwako_anomalies/functions/added/fn_throwEVH.sqf index 8e14d00..f5b6f32 100644 --- a/mod/diwako_anomalies/functions/added/fn_throwEVH.sqf +++ b/mod/diwako_anomalies/functions/added/fn_throwEVH.sqf @@ -8,27 +8,27 @@ private _unit = player; if (isClass(configFile >> "CfgPatches" >> "ace_advanced_throwing")) then { - ["ace_firedPlayer", { - params ["_unit","_weapon","_muzzle","_mode","_ammo","_mag","_projectile"]; - if ( _ammo == "bolt_ammo" ) then { - if ( _mag == "bolts_infinite_mag" ) then { - _unit addMagazine _mag; - while { !( (currentThrowable player) select 0 == _mag ) } do { - [_unit] call ace_weaponselect_fnc_selectNextGrenade; - }; - }; - [_projectile] call anomaly_fnc_grenadeBolt; - }; - }] call CBA_fnc_addEventHandler; + ["ace_firedPlayer", { + params ["_unit","_weapon","_muzzle","_mode","_ammo","_mag","_projectile"]; + if ( _ammo == "bolt_ammo" ) then { + if ( _mag == "bolts_infinite_mag" ) then { + _unit addMagazine _mag; + while { !( (currentThrowable player) select 0 == _mag ) } do { + [_unit] call ace_weaponselect_fnc_selectNextGrenade; + }; + }; + [_projectile] call anomaly_fnc_grenadeBolt; + }; + }] call CBA_fnc_addEventHandler; } else { - player addEventhandler ["fired",{ - params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_mag", "_projectile"]; - if ( _ammo == "bolt_ammo" ) then { - [_projectile] call anomaly_fnc_grenadeBolt; - }; - }]; + player addEventhandler ["fired",{ + params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_mag", "_projectile"]; + if ( _ammo == "bolt_ammo" ) then { + [_projectile] call anomaly_fnc_grenadeBolt; + }; + }]; }; nil \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf index e4f9184..2d43f08 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_activateBurner + Function: anomaly_fnc_activateBurner - Description: + Description: Activates anomaly when something enters its activation range Parameters: _trg - the anomaly trigger that is being activated (default: objNull) - _list - thisList given by the trigger (default: []) + _list - thisList given by the trigger (default: []) Returns: nothing - Author: - diwako 2017-12-13 + Author: + diwako 2017-12-13 */ params[["_trg",objNull],["_list",[]]]; @@ -22,105 +22,95 @@ if(_trg getVariable ["anomaly_type",""] != "burner") exitWith {}; private _proxy = _trg getVariable "anomaly_sound"; _proxy say3d "fire2"; -_pos = position _trg; -_source = "#particlesource" createVehicleLocal getPos _trg; -private _proxy2 = "Land_HelipadEmpty_F" createVehicle [((_pos select 0) - 2 + (random 2)), ((_pos select 1) - 2 + (random 2)), _pos select 2]; -_proxy2 enableSimulationGlobal false; -_source2 = "#particlesource" createVehicleLocal [((_pos select 0) - 2 + (random 2)), ((_pos select 1) - 2 + (random 2)), _pos select 2]; -private _proxy3 = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy3 enableSimulationGlobal false; +private _pos = position _trg; +private _source = "#particlesource" createVehicleLocal getPos _trg; +private _source2 = "#particlesource" createVehicleLocal [((_pos select 0) - 2 + (random 2)), ((_pos select 1) - 2 + (random 2)), _pos select 2]; -_light = objNull; +private _light = objNull; if(hasInterface) then { - [_proxy2, _source, "active"] call anomalyEffect_fnc_burner; - [_proxy3, _source2, "active"] call anomalyEffect_fnc_burner; + [_source, "active"] call anomalyEffect_fnc_burner; + [_source2, "active"] call anomalyEffect_fnc_burner; - _light = "#lightpoint" createVehicleLocal (getpos _proxy); - _light setLightBrightness 1; - _light setLightAmbient [1, 0.6, 0.6]; - _light setLightColor [1, 0.6, 0.6]; - _light setLightUseFlare false; - _light setLightFlareSize 100; - _light setLightFlareMaxDistance 100; - _light setLightDayLight true; + private _light = "#lightpoint" createVehicleLocal (getpos _proxy); + _light setLightBrightness 2; + _light setLightAmbient [1, 0.6, 0.6]; + _light setLightColor [1, 0.6, 0.6]; + _light setLightUseFlare false; + _light setLightFlareSize 100; + _light setLightFlareMaxDistance 100; + _light setLightDayLight true; }; if(isServer) then { - _trg setVariable ["anomaly_cooldown", true, true]; - _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; - { - if(!(_x isKindOf "Man" || _x isKindOf "landvehicle"|| _x isKindOf "air")) then { - deleteVehicle _x; - }; - } forEach _list; - { - if(alive _x) then { - if(_x isKindOf "Man") then { - if(!(isPlayer _x)) then { - _x spawn { - sleep 0.5; - _this setDamage 1; - }; - } else { - if(!isNil "ace_medical_fnc_addDamageToUnit") then { - // Ace medical is enabled - _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) / 1.1; - [_x, _dam, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], "stab"] remoteExec ["ace_medical_fnc_addDamageToUnit", _x]; - } else { - // Ace medical is not enabled - _dam = damage _x; - _x setDamage (_dam + 0.5); - }; - }; - } else { - _curDam = _x getHit "motor"; - if(isNil "_curDam") then { - _curDam = 0; - }; - if(_curDam >= 1) then { - _x setDamage 1; - } else { - [_x, ["motor", (_curDam + 0.15)]] remoteExec ["setHit", _x]; - if(!(_x isKindOf "tank"))then { - [_x, ["wheel_1_1_steering", 1]] remoteExec ["setHit", _x]; - [_x, ["wheel_1_2_steering", 1]] remoteExec ["setHit", _x]; - [_x, ["wheel_1_3_steering", 1]] remoteExec ["setHit", _x]; - [_x, ["wheel_1_4_steering", 1]] remoteExec ["setHit", _x]; - [_x, ["wheel_2_1_steering", 1]] remoteExec ["setHit", _x]; - [_x, ["wheel_2_2_steering", 1]] remoteExec ["setHit", _x]; - [_x, ["wheel_2_3_steering", 1]] remoteExec ["setHit", _x]; - [_x, ["wheel_2_4_steering", 1]] remoteExec ["setHit", _x]; - }; - }; - }; - } else { - if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { - [_x] remoteExec ["anomaly_fnc_minceCorpse"]; - }; - }; - } forEach _men; + _trg setVariable ["anomaly_cooldown", true, true]; + private _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; + { + if(!(_x isKindOf "Man" || _x isKindOf "landvehicle"|| _x isKindOf "air")) then { + deleteVehicle _x; + }; + } forEach _list; + { + if(alive _x) then { + if(_x isKindOf "Man") then { + if(!(isPlayer _x)) then { + _x spawn { + sleep 0.5; + _this setDamage 1; + }; + } else { + if(!isNil "ace_medical_fnc_addDamageToUnit") then { + // Ace medical is enabled + _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) / 1.1; + [_x, _dam, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], "stab", _x] remoteExec ["ace_medical_fnc_addDamageToUnit", _x]; + } else { + // Ace medical is not enabled + _dam = damage _x; + _x setDamage (_dam + 0.5); + }; + }; + } else { + _curDam = _x getHit "motor"; + if(isNil "_curDam") then { + _curDam = 0; + }; + if(_curDam >= 1) then { + _x setDamage 1; + } else { + [_x, ["motor", (_curDam + 0.15)]] remoteExec ["setHit", _x]; + if(!(_x isKindOf "tank"))then { + [_x, ["wheel_1_1_steering", 1]] remoteExec ["setHit", _x]; + [_x, ["wheel_1_2_steering", 1]] remoteExec ["setHit", _x]; + [_x, ["wheel_1_3_steering", 1]] remoteExec ["setHit", _x]; + [_x, ["wheel_1_4_steering", 1]] remoteExec ["setHit", _x]; + [_x, ["wheel_2_1_steering", 1]] remoteExec ["setHit", _x]; + [_x, ["wheel_2_2_steering", 1]] remoteExec ["setHit", _x]; + [_x, ["wheel_2_3_steering", 1]] remoteExec ["setHit", _x]; + [_x, ["wheel_2_4_steering", 1]] remoteExec ["setHit", _x]; + }; + }; + }; + } else { + if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { + [_x] remoteExec ["anomaly_fnc_minceCorpse"]; + }; + }; + } forEach _men; }; sleep 5; if(!(isNull _source)) then { - deleteVehicle _source; -}; -if(!(isNull _proxy2)) then { - deleteVehicle _proxy2; + deleteVehicle _source; }; if(!(isNull _source2)) then { - deleteVehicle _source2; -}; -if(!(isNull _proxy3)) then { - deleteVehicle _proxy3; + deleteVehicle _source2; }; if(!(isNull _light)) then { - deleteVehicle _light; + deleteVehicle _light; }; if(isServer) then { - _trg spawn { - sleep (5 + random 10); - _this setVariable ["anomaly_cooldown", false, true]; - }; + _trg spawn { + sleep (5 + random 10); + _this setVariable ["anomaly_cooldown", false, true]; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateElectra.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateElectra.sqf index bf550e0..962d414 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateElectra.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateElectra.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_activateElectra + Function: anomaly_fnc_activateElectra - Description: + Description: Activates anomaly when something enters its activation range Parameters: _trg - the anomaly trigger that is being activated (default: objNull) - _list - thisList given by the trigger (default: []) + _list - thisList given by the trigger (default: []) Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_trg",objNull],["_list",[]]]; @@ -20,135 +20,132 @@ if(isNull _trg) exitWith {}; if(_trg getVariable ["anomaly_type",""] != "electra") exitWith {}; if(isServer) then { - private _proxy = _trg getVariable "anomaly_sound"; - _sound = ("electra_blast" + str ( (floor random 2) + 1 )); - [_proxy, _sound] remoteExec ["say3d"]; + private _proxy = _trg getVariable "anomaly_sound"; + _sound = ("electra_blast" + str ( (floor random 2) + 1 )); + [_proxy, _sound] remoteExec ["say3d"]; - _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; - test = _men; - { - if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { - deleteVehicle _x; - }; - } forEach _list; - { - if(alive _x) then { - if(!(isPlayer _x)) then { - if(_x isKindOf "landvehicle" || _x isKindOf "air") then { - [_x] spawn { - params["_x"]; - // switch of the engine - _curDam = 0; - if(_x isKindOf "landvehicle" ) then { - _curDam = _x getHit "engine"; - [_x, ["engine", 1]] remoteExec ["setHit", _x]; - } else { - _curDam = _x getHitPointDamage "HitEngine"; - [_x, ["HitEngine", 1]] remoteExec ["setHitPointDamage", _x]; - }; - _curDam2 = _x getHitPointDamage "hitHull"; - [_x, ["hitHull", (_curDam2 + 0.1)]] remoteExec ["setHitPointDamage", _x]; - sleep 5; - if(_x isKindOf "landvehicle" ) then { - [_x, ["engine", (_curDam + 0.25)]] remoteExec ["setHit", _x]; - } else { - [_x, ["HitEngine", (_curDam + 0.25)]] remoteExec ["setHitPointDamage", _x]; - }; - }; - } else { - [_trg, _x] spawn { - params["_trg","_x"]; - [_x, getpos _trg, 2, 2] remoteExec ["anomaly_fnc_suckToLocation",_x]; - sleep 2; - _x setDamage 1; - }; - }; - }; + _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; + test = _men; + { + if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { + deleteVehicle _x; + }; + } forEach _list; + { + if(alive _x) then { + if(!(isPlayer _x)) then { + if(_x isKindOf "landvehicle" || _x isKindOf "air") then { + [_x] spawn { + params["_x"]; + // switch of the engine + _curDam = 0; + if(_x isKindOf "landvehicle" ) then { + _curDam = _x getHit "engine"; + [_x, ["engine", 1]] remoteExec ["setHit", _x]; + } else { + _curDam = _x getHitPointDamage "HitEngine"; + [_x, ["HitEngine", 1]] remoteExec ["setHitPointDamage", _x]; + }; + _curDam2 = _x getHitPointDamage "hitHull"; + [_x, ["hitHull", (_curDam2 + 0.1)]] remoteExec ["setHitPointDamage", _x]; + sleep 5; + if(_x isKindOf "landvehicle" ) then { + [_x, ["engine", (_curDam + 0.25)]] remoteExec ["setHit", _x]; + } else { + [_x, ["HitEngine", (_curDam + 0.25)]] remoteExec ["setHitPointDamage", _x]; + }; + }; + } else { + [_trg, _x] spawn { + params["_trg","_x"]; + [_x, getpos _trg, 2, 2] remoteExec ["anomaly_fnc_suckToLocation",_x]; + sleep 2; + _x setDamage 1; + }; + }; + }; - } else { - if(!(_x isKindOf "landvehicle" || _x isKindOf "air") ) then { - [_x] remoteExec ["anomaly_fnc_minceCorpse"]; - }; - }; - } forEach _men; - [_trg] spawn { - params["_trg"]; - _trg setVariable ["anomaly_cooldown", true, true]; - sleep (5 + random 30); - _trg setVariable ["anomaly_cooldown", false, true]; - }; + } else { + if(!(_x isKindOf "landvehicle" || _x isKindOf "air") ) then { + [_x] remoteExec ["anomaly_fnc_minceCorpse"]; + }; + }; + } forEach _men; + [_trg] spawn { + params["_trg"]; + _trg setVariable ["anomaly_cooldown", true, true]; + sleep (5 + random 30); + _trg setVariable ["anomaly_cooldown", false, true]; + }; }; if(hasInterface) then { - [_trg] spawn { - params["_trg"]; - _proxy = _trg getVariable "anomaly_sound"; - _light = "#lightpoint" createVehicleLocal (getpos _proxy); - _light setLightBrightness 10; - _light setLightAmbient [0.6, 0.6, 1]; - _light setLightColor [0.6, 0.6, 1]; - _light setLightUseFlare true; - _light setLightFlareSize 100; - _light setLightFlareMaxDistance 100; - _light setLightDayLight true; - sleep 0.1; - _light setLightBrightness 0; - sleep 0.1; - _light setLightBrightness 10; - sleep 0.2; - _light setLightBrightness 0; - sleep 1.2; - _light setLightBrightness 10; - sleep 0.1; - _light setLightBrightness 0; - sleep 0.1; - _light setLightBrightness 10; - sleep 0.2; - deleteVehicle _light; - }; - _plr = ([] call CBA_fnc_currentUnit); - _in = (_plr in _list ); - if( _in ) then { - [_plr, getpos _trg, 2, 2] spawn anomaly_fnc_suckToLocation; - addCamShake [15, 3, 25]; - }; - // if( vehicle _plr in _list && { (vehicle _plr) isKindOf "landvehicle" && {(driver vehicle _plr) == _plr}}) then { - // [(vehicle _plr)] spawn { - // params["_veh"]; - // switch of the engine - // _curDam = _veh getHit "engine"; - // [_veh, ["engine", 1]] remoteExec ["setHit", _veh]; - // _curDam2 = _veh getHitPointDamage "hitHull"; - // [_veh, ["hitHull", (_curDam2 + 0.1)]] remoteExec ["setHitPointDamage", _veh]; - // sleep 5; - // [_veh, ["engine", (_curDam + 0.25)]] remoteExec ["setHit", _veh]; - // }; - // }; - sleep 2; - if( _in ) then { - if(!isNil "ace_medical_fnc_addDamageToUnit") then { - // Ace medical is enabled - sleep 0.05; - _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]); - [_plr, _dam, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], "stab"] call ace_medical_fnc_addDamageToUnit; - } else { - // Ace medical is not enabled - _dam = damage _plr; - _plr setDamage (_dam + 0.5); - }; - }; - _proxy = _trg getVariable ["anomaly_particle_source", objNull]; + [_trg] spawn { + params["_trg"]; + private _proxy = _trg getVariable "anomaly_sound"; + private _light = "#lightpoint" createVehicleLocal (getpos _proxy); + _light setLightBrightness 10; + _light setLightAmbient [0.6, 0.6, 1]; + _light setLightColor [0.6, 0.6, 1]; + _light setLightUseFlare true; + _light setLightFlareSize 100; + _light setLightFlareMaxDistance 100; + _light setLightDayLight true; + sleep 0.1; + _light setLightBrightness 0; + sleep 0.1; + _light setLightBrightness 10; + sleep 0.2; + _light setLightBrightness 0; + sleep 1.2; + _light setLightBrightness 10; + sleep 0.1; + _light setLightBrightness 0; + sleep 0.1; + _light setLightBrightness 10; + sleep 0.2; + deleteVehicle _light; + }; + _plr = ([] call CBA_fnc_currentUnit); + _in = (_plr in _list ); + if( _in ) then { + [_plr, getpos _trg, 2, 2] spawn anomaly_fnc_suckToLocation; + addCamShake [15, 3, 25]; + }; + // if( vehicle _plr in _list && { (vehicle _plr) isKindOf "landvehicle" && {(driver vehicle _plr) == _plr}}) then { + // [(vehicle _plr)] spawn { + // params["_veh"]; + // switch of the engine + // _curDam = _veh getHit "engine"; + // [_veh, ["engine", 1]] remoteExec ["setHit", _veh]; + // _curDam2 = _veh getHitPointDamage "hitHull"; + // [_veh, ["hitHull", (_curDam2 + 0.1)]] remoteExec ["setHitPointDamage", _veh]; + // sleep 5; + // [_veh, ["engine", (_curDam + 0.25)]] remoteExec ["setHit", _veh]; + // }; + // }; + sleep 2; + if( _in ) then { + if(!isNil "ace_medical_fnc_addDamageToUnit") then { + // Ace medical is enabled + sleep 0.05; + _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]); + [_plr, _dam, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], "stab", _plr] call ace_medical_fnc_addDamageToUnit; + } else { + // Ace medical is not enabled + _dam = damage _plr; + _plr setDamage (_dam + 0.5); + }; + }; + private _source = _trg getVariable ["anomaly_particle_source", objNull]; - if(!isNull _proxy) then { - deleteVehicle _proxy; - waitUntil { sleep 0.2; !(_trg getVariable ["anomaly_cooldown", false])}; - if(_plr distance _trg < ANOMALY_IDLE_DISTANCE) then { - _proxy = "Land_HelipadEmpty_F" createVehicleLocal position _trg; - _proxy enableSimulation false; - _proxy setPos (_trg modelToWorld [0,0,0]); - _source = "#particlesource" createVehicleLocal getPos _trg; - [_proxy, _source, "idle"] call anomalyEffect_fnc_electra; - _trg setVariable ["anomaly_particle_source", _proxy]; - }; - }; + if(!isNull _source) then { + deleteVehicle _source; + waitUntil { sleep 0.2; !(_trg getVariable ["anomaly_cooldown", false])}; + if(_plr distance _trg < ANOMALY_IDLE_DISTANCE) then { + _source = "#particlesource" createVehicleLocal getPos _trg; + [_source, "idle"] call anomalyEffect_fnc_electra; + _trg setVariable ["anomaly_particle_source", _source]; + }; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateFog.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateFog.sqf index 0661bc2..ebdf2ca 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateFog.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateFog.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_activateElectra + Function: anomaly_fnc_activateElectra - Description: + Description: Activates anomaly when something enters its activation range Parameters: _trg - the anomaly trigger that is being activated (default: objNull) - _list - thisList given by the trigger (default: []) + _list - thisList given by the trigger (default: []) Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_trg",objNull],["_list",[]]]; @@ -20,55 +20,55 @@ if(isNull _trg) exitWith {}; if(_trg getVariable ["anomaly_type",""] != "fog") exitWith {}; { - if((_x isKindOf "Man") && {local _x}) then { - if(!(toUpper(goggles _x) in ANOMALY_GAS_MASKS)) then { - if(isPlayer _x) then { - [] spawn { - private _effect = [4]; - if(isNil "ANOMALY_BLUR_HANDLE") then { - private _name = "DynamicBlur"; - private _priority = 400; - ANOMALY_BLUR_HANDLE = ppEffectCreate [_name, _priority]; - while { - ANOMALY_BLUR_HANDLE < 0 - } do { - _priority = _priority + 1; - ANOMALY_BLUR_HANDLE = ppEffectCreate [_name, _priority]; - }; - ANOMALY_BLUR_HANDLE ppEffectEnable true; - }; - ANOMALY_BLUR_HANDLE ppEffectAdjust _effect; - ANOMALY_BLUR_HANDLE ppEffectCommit 1; - sleep 1; - ANOMALY_BLUR_HANDLE ppEffectAdjust [0]; - ANOMALY_BLUR_HANDLE ppEffectCommit 10; - }; - }; - if((cba_missiontime - 2.5) > (_x getVariable["anomaly_cough",-1])) then { - // cough cough - [{ - params["_unit"]; - private _coughers = ["WoundedGuyA_02","WoundedGuyA_04","WoundedGuyA_05","WoundedGuyA_07","WoundedGuyA_08"]; - [_unit, selectRandom _coughers] remoteExecCall ["say3d"]; - }, [_x], (random 2)] call CBA_fnc_waitAndExecute; - _x setVariable["anomaly_cough",cba_missiontime]; - }; - if(!isNil "ace_medical_fnc_addDamageToUnit") then { - // Ace medical is enabled - private _dam = 1; - if(isPlayer _x) then { - _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) / 20; - } else { - _res = _x getVariable ["ace_medical_unitDamageThreshold", [1, 1, 1]]; - _dam = ((_res#0 + _res#1 + _res#2) / 3) / 6; - }; - [_x, _dam, "body", "punch"] call ace_medical_fnc_addDamageToUnit; - } else { - // Ace medical is not enabled - _dam = damage _x; - _x setDamage (_dam + 0.05); - }; - }; - }; - false + if((_x isKindOf "Man") && {local _x}) then { + if(!(toUpper(goggles _x) in ANOMALY_GAS_MASKS)) then { + if(isPlayer _x) then { + [] spawn { + private _effect = [4]; + if(isNil "ANOMALY_BLUR_HANDLE") then { + private _name = "DynamicBlur"; + private _priority = 400; + ANOMALY_BLUR_HANDLE = ppEffectCreate [_name, _priority]; + while { + ANOMALY_BLUR_HANDLE < 0 + } do { + _priority = _priority + 1; + ANOMALY_BLUR_HANDLE = ppEffectCreate [_name, _priority]; + }; + ANOMALY_BLUR_HANDLE ppEffectEnable true; + }; + ANOMALY_BLUR_HANDLE ppEffectAdjust _effect; + ANOMALY_BLUR_HANDLE ppEffectCommit 1; + sleep 1; + ANOMALY_BLUR_HANDLE ppEffectAdjust [0]; + ANOMALY_BLUR_HANDLE ppEffectCommit 10; + }; + }; + if((cba_missiontime - 2.5) > (_x getVariable["anomaly_cough",-1])) then { + // cough cough + [{ + params["_unit"]; + private _coughers = ["WoundedGuyA_02","WoundedGuyA_04","WoundedGuyA_05","WoundedGuyA_07","WoundedGuyA_08"]; + [_unit, selectRandom _coughers] remoteExecCall ["say3d"]; + }, [_x], (random 2)] call CBA_fnc_waitAndExecute; + _x setVariable["anomaly_cough",cba_missiontime]; + }; + if(!isNil "ace_medical_fnc_addDamageToUnit") then { + // Ace medical is enabled + private _dam = 1; + if(isPlayer _x) then { + _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) / 20; + } else { + _res = _x getVariable ["ace_medical_unitDamageThreshold", [1, 1, 1]]; + _dam = ((_res#0 + _res#1 + _res#2) / 3) / 6; + }; + [_x, _dam, "body", "punch", _x] call ace_medical_fnc_addDamageToUnit; + } else { + // Ace medical is not enabled + _dam = damage _x; + _x setDamage (_dam + 0.05); + }; + }; + }; + false } count _list; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateFruitPunch.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateFruitPunch.sqf index 0ee8728..f09eadd 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateFruitPunch.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateFruitPunch.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_activateElectra + Function: anomaly_fnc_activateElectra - Description: + Description: Activates anomaly when something enters its activation range Parameters: _trg - the anomaly trigger that is being activated (default: objNull) - _list - thisList given by the trigger (default: []) + _list - thisList given by the trigger (default: []) Returns: nothing - Author: - diwako 2018-06-10 + Author: + diwako 2018-06-10 */ if(!isServer) exitWith {}; params[["_trg",objNull],["_list",[]]]; @@ -24,42 +24,38 @@ private _proxy = _trg getVariable "anomaly_sound"; [_proxy, selectRandom["bfuzz_hit","buzz_hit"]] remoteExec ["say3d"]; _trg setVariable ["anomaly_cooldown", true]; -private _proxy = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy enableSimulationGlobal false; -_proxy setPos (_trg modelToWorld [0,0,0]); private _source = "#particlesource" createVehicle getPos _trg; _source setPosATL (getPosATL _trg); // _source enableSimulation false; -[_proxy, _source, "active"] remoteExec ["anomalyEffect_fnc_fruitPunch"]; +[_source, "active"] remoteExec ["anomalyEffect_fnc_fruitPunch"]; { - if(_x isKindOf "Man") then { - // if(alive _x) then { - if(!isNil "ace_medical_fnc_addDamageToUnit") then { - // Ace medical is enabled - private _dam = 1; - if(isPlayer _x) then { - _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) / 5; - } else { - _res = _x getVariable ["ace_medical_unitDamageThreshold", [1, 1, 1]]; - _dam = ((_res#0 + _res#1 + _res#2) / 3) / 3; - }; - [_x, _dam, selectRandom ["leg_l", "leg_r"], "stab"] remoteExec ["ace_medical_fnc_addDamageToUnit", _x]; - } else { - // Ace medical is not enabled - _dam = damage _x; - _x setDamage (_dam + 0.2); - }; - } else { - if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { - deleteVehicle _x; - }; - }; - false + if(_x isKindOf "Man") then { + // if(alive _x) then { + if(!isNil "ace_medical_fnc_addDamageToUnit") then { + // Ace medical is enabled + private _dam = 1; + if(isPlayer _x) then { + _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) / 5; + } else { + _res = _x getVariable ["ace_medical_unitDamageThreshold", [1, 1, 1]]; + _dam = ((_res#0 + _res#1 + _res#2) / 3) / 3; + }; + [_x, _dam, selectRandom ["leg_l", "leg_r"], "stab", _x] remoteExec ["ace_medical_fnc_addDamageToUnit", _x]; + } else { + // Ace medical is not enabled + _dam = damage _x; + _x setDamage (_dam + 0.2); + }; + } else { + if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { + deleteVehicle _x; + }; + }; + false } count _list; [{ - params["_trg", "_proxy", "_source"]; - deleteVehicle _proxy; - deleteVehicle _source; - _trg setVariable ["anomaly_cooldown", false]; -}, [_trg, _proxy, _source], 0.5] call CBA_fnc_waitAndExecute; \ No newline at end of file + params["_trg", "_source"]; + deleteVehicle _source; + _trg setVariable ["anomaly_cooldown", false]; +}, [_trg, _source], 0.5] call CBA_fnc_waitAndExecute; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateMeatgrinder.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateMeatgrinder.sqf index 0ca6a7b..6d30786 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateMeatgrinder.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateMeatgrinder.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_activateMeatgrinder + Function: anomaly_fnc_activateMeatgrinder - Description: + Description: Activates anomaly when something enters its activation range Parameters: _trg - the anomaly trigger that is being activated (default: objNull) - _list - thisList given by the trigger (default: []) + _list - thisList given by the trigger (default: []) Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_trg",objNull],["_list",[]]]; @@ -21,61 +21,57 @@ if(_trg getVariable ["anomaly_type",""] != "meatgrinder") exitWith {}; _sucked = []; if(isServer) then { - _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; - private _proxy = _trg getVariable "anomaly_sound"; - [_proxy, "anomaly_mincer_blowout"] remoteExec ["say3d"]; - { - if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { - deleteVehicle _x; - }; - } forEach _list; - _trg setVariable ["anomaly_cooldown", true, true]; - { - if(alive _x) then { - if(_x isKindOf "landvehicle" || _x isKindOf "air") then { - if(getMass _x <= 10000) then { - - [_x, getpos _trg,1,5.8] remoteExec ["anomaly_fnc_suckToLocation",_x]; - _sucked pushBackUnique _x; - }; - } else { - _sucked pushBackUnique _x; - [_x, getpos _trg,2] remoteExec ["anomaly_fnc_suckToLocation",_x]; - }; - } else { - if(!(_x isKindOf "landvehicle") || _x isKindOf "air") then { - [_x] remoteExec ["anomaly_fnc_minceCorpse"]; - }; - }; - } forEach _men; + _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; + private _proxy = _trg getVariable "anomaly_sound"; + [_proxy, "anomaly_mincer_blowout"] remoteExec ["say3d"]; + { + if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { + deleteVehicle _x; + }; + } forEach _list; + _trg setVariable ["anomaly_cooldown", true, true]; + { + if(alive _x) then { + if(_x isKindOf "landvehicle" || _x isKindOf "air") then { + if(getMass _x <= 10000) then { + + [_x, getpos _trg,1,5.8] remoteExec ["anomaly_fnc_suckToLocation",_x]; + _sucked pushBackUnique _x; + }; + } else { + _sucked pushBackUnique _x; + [_x, getpos _trg,2] remoteExec ["anomaly_fnc_suckToLocation",_x]; + }; + } else { + if(!(_x isKindOf "landvehicle") || _x isKindOf "air") then { + [_x] remoteExec ["anomaly_fnc_minceCorpse"]; + }; + }; + } forEach _men; }; sleep 5.8; { - if(_x isKindOf "Man") then { - // ace medical not needed, people trapped in this trap are dead - _x setDamage 1; - [_x] remoteExec ["anomaly_fnc_minceCorpse"]; - } else { - _curDam = _x getHitPointDamage "hitHull"; - [_x, ["hitHull", (_curDam + 0.45)]] remoteExec ["setHitPointDamage", _x]; - }; + if(_x isKindOf "Man") then { + // ace medical not needed, people trapped in this trap are dead + _x setDamage 1; + [_x] remoteExec ["anomaly_fnc_minceCorpse"]; + } else { + _curDam = _x getHitPointDamage "hitHull"; + [_x, ["hitHull", (_curDam + 0.45)]] remoteExec ["setHitPointDamage", _x]; + }; } forEach _sucked; if(hasInterface) then { - _source = "#particlesource" createVehicleLocal getPos _trg; - private _proxy2 = "Land_HelipadEmpty_F" createVehicle position _trg; - _proxy2 enableSimulationGlobal false; - _proxy2 setPos (_trg modelToWorld [0,0,0.5]); - [_trg, _proxy2, "active"] call anomalyEffect_fnc_springboard; - sleep 1; - deleteVehicle _proxy2; - deleteVehicle _source; + private _source = "#particlesource" createVehicleLocal getPos _trg; + _source setPosWorld (getPosWorld _trg); + [_source, "active"] call anomalyEffect_fnc_springboard; + sleep 1; + deleteVehicle _source; }; - if(isServer) then { - _trg spawn { - sleep (10 + random 20); - _this setVariable ["anomaly_cooldown", false, true]; - }; + _trg spawn { + sleep (10 + random 20); + _this setVariable ["anomaly_cooldown", false, true]; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateSpringboard.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateSpringboard.sqf index d06c5dd..b6376f9 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateSpringboard.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateSpringboard.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_activateSpringboard + Function: anomaly_fnc_activateSpringboard - Description: + Description: Activates anomaly when something enters its activation range Parameters: _trg - the anomaly trigger that is being activated (default: objNull) - _list - thisList given by the trigger (default: []) + _list - thisList given by the trigger (default: []) Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_trg",objNull],["_list",[]]]; @@ -20,83 +20,78 @@ if(isNull _trg) exitWith {}; if(_trg getVariable ["anomaly_type",""] != "springboard") exitWith {}; if(isServer) then { - private _proxy = _trg getVariable "anomaly_sound"; - _sound = ("gravi_blowout" + str ( (floor random 6) + 1 )); - [_proxy, _sound] remoteExec ["say3d"]; + private _proxy = _trg getVariable "anomaly_sound"; + _sound = ("gravi_blowout" + str ( (floor random 6) + 1 )); + [_proxy, _sound] remoteExec ["say3d"]; }; sleep 0.25; -_source = "#particlesource" createVehicleLocal getPos _trg; -private _proxy2 = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy2 enableSimulationGlobal false; -_proxy2 setPos (_trg modelToWorld [0,0,0.5]); +private _source = "#particlesource" createVehicleLocal getPos _trg; +_source setPosWorld (getPosWorld _trg); if(hasInterface) then { - [_proxy2, _source, "active"] call anomalyEffect_fnc_springboard; + [_source, "active"] call anomalyEffect_fnc_springboard; }; if(isServer) then { - _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; - { - if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { - deleteVehicle _x; - }; - } forEach _list; - _trg setVariable ["anomaly_cooldown", true, true]; - { - if(alive _x) then { - _pos1 = getpos _x; - _pos2 = getpos _trg; - _a = ((_pos1 select 0) - (_pos2 select 0)); - _b = ((_pos1 select 1) - (_pos2 select 1)); - if(!(isPlayer _x)) then { - if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { - _x spawn { - sleep 0.5; - _this setDamage 1; - }; - }; - } else { - if(!isNil "ace_medical_fnc_addDamageToUnit") then { - // Ace medical is enabled - _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) / 1.1; - [_x, _dam, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], "stab"] remoteExec ["ace_medical_fnc_addDamageToUnit", _x]; - } else { - // Ace medical is not enabled - _dam = damage _x; - _x setDamage (_dam + 0.5); - }; - }; - _mult = 4; - if(_x isKindOf "landvehicle" || _x isKindOf "air") then { - if(getMass _x <= 10000) then { - _mult = _mult * 2; - _curDam = _x getHitPointDamage "hitHull"; - [_x, ["hitHull", (_curDam + 0.45)]] remoteExec ["setHitPointDamage", _x]; - } else { - _mult = 1; - }; - }; - [_x, [_a*_mult, _b*_mult, _mult + (5 / (1 + (abs _a) + (abs _b)))]] remoteExec ["setVelocity", _x]; - } else { - if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { - [_x] remoteExec ["anomaly_fnc_minceCorpse"]; - }; - }; - } forEach _men; + _men = nearestObjects [getPos _trg, ["Man","landvehicle","air"], 5]; + { + if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { + deleteVehicle _x; + }; + } forEach _list; + _trg setVariable ["anomaly_cooldown", true, true]; + { + if(alive _x) then { + _pos1 = getpos _x; + _pos2 = getpos _trg; + _a = ((_pos1 select 0) - (_pos2 select 0)); + _b = ((_pos1 select 1) - (_pos2 select 1)); + if(!(isPlayer _x)) then { + if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { + _x spawn { + sleep 0.5; + _this setDamage 1; + }; + }; + } else { + if(!isNil "ace_medical_fnc_addDamageToUnit") then { + // Ace medical is enabled + _dam = (missionNamespace getVariable ["ace_medical_playerDamageThreshold", 1]) * 1.5; + [_x, _dam, selectRandom ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"], "stab", _x] remoteExec ["ace_medical_fnc_addDamageToUnit", _x]; + } else { + // Ace medical is not enabled + _dam = damage _x; + _x setDamage (_dam + 0.5); + }; + }; + _mult = 4; + if(_x isKindOf "landvehicle" || _x isKindOf "air") then { + if(getMass _x <= 10000) then { + _mult = _mult * 2; + _curDam = _x getHitPointDamage "hitHull"; + [_x, ["hitHull", (_curDam + 0.45)]] remoteExec ["setHitPointDamage", _x]; + } else { + _mult = 1; + }; + }; + [_x, [_a*_mult, _b*_mult, _mult + (5 / (1 + (abs _a) + (abs _b)))]] remoteExec ["setVelocity", _x]; + } else { + if(!(_x isKindOf "landvehicle" || _x isKindOf "air")) then { + [_x] remoteExec ["anomaly_fnc_minceCorpse"]; + }; + }; + } forEach _men; }; sleep 1; if(!(isNull _source)) then { - deleteVehicle _source; -}; -if(!(isNull _proxy2)) then { - deleteVehicle _proxy2; + deleteVehicle _source; }; if(isServer) then { - _trg spawn { - sleep (3 + random 7); - _this setVariable ["anomaly_cooldown", false, true]; - }; + _trg spawn { + sleep (3 + random 7); + _this setVariable ["anomaly_cooldown", false, true]; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateTeleport.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateTeleport.sqf index 1d50368..efb1883 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateTeleport.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateTeleport.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_activateTeleport + Function: anomaly_fnc_activateTeleport - Description: + Description: Activates anomaly when something enters its activation range Parameters: _trg - the anomaly trigger that is being activated (default: objNull) - _list - thisList given by the trigger (default: []) + _list - thisList given by the trigger (default: []) Returns: nothing - Author: - diwako 2017-12-14 + Author: + diwako 2017-12-14 */ params[["_trg",objNull],["_list",[]]]; @@ -25,62 +25,62 @@ _id = _trg getVariable "anomaly_teleport_id"; _teleporters = [ANOMALY_TELEPORT_IDS, _id] call CBA_fnc_hashGet; if(count _teleporters < 2) exitWith { - hintC ("Teleport anomaly at " + str(getpos _trg) + " with id " + str(_id) + " does not have an exit anomaly!") + hintC ("Teleport anomaly at " + str(getpos _trg) + " with id " + str(_id) + " does not have an exit anomaly!") }; _exit = objNull; { - if(_trg != _x) then { - _exit = _x; - }; + if(_trg != _x) then { + _exit = _x; + }; } forEach _teleporters; if(isNull _exit) exitWith { - hintC ("It was not possible to find an exit for teleport anomaly at " + str(getpos _trg) + " with id " + str(_id) + "!") + hintC ("It was not possible to find an exit for teleport anomaly at " + str(getpos _trg) + " with id " + str(_id) + "!") }; _trg setVariable ["anomaly_cooldown", true, true]; _exit setVariable ["anomaly_cooldown", true, true]; private _proxy = _trg getVariable "anomaly_sound"; -[_proxy, ("teleport_work_" + str((floor random 2) + 1))] remoteExec ["say3d"]; +[_proxy, ("teleport_work_" + str((floor random 2) + 1))] remoteExec ["say3d"]; _proxy = _exit getVariable "anomaly_sound"; -[_proxy, ("teleport_work_" + str((floor random 2) + 1))] remoteExec ["say3d"]; +[_proxy, ("teleport_work_" + str((floor random 2) + 1))] remoteExec ["say3d"]; sleep 0.15; { - if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { - deleteVehicle _x; - }; + if(!(_x isKindOf "Man" || _x isKindOf "landvehicle" || _x isKindOf "air")) then { + deleteVehicle _x; + }; } forEach _list; _exitPos = getpos _exit; _trg setVariable ["anomaly_cooldown", true, true]; { - _obj = _x; - if(alive _obj) then { - _doTeleport = false; - if(_x isKindOf "Man") then { - _doTeleport = true; - if(isPlayer _obj) then { - [] remoteExec ["anomaly_fnc_teleportFlash",_obj]; - }; - }; - if((_obj isKindOf "landvehicle" || _x isKindOf "air") && {getMass _obj < 10000}) then { - _doTeleport = true; - { - if(isPlayer _x) then { - [] remoteExec ["anomaly_fnc_teleportFlash",_x]; - }; - } forEach crew _obj; - }; + _obj = _x; + if(alive _obj) then { + _doTeleport = false; + if(_x isKindOf "Man") then { + _doTeleport = true; + if(isPlayer _obj) then { + [] remoteExec ["anomaly_fnc_teleportFlash",_obj]; + }; + }; + if((_obj isKindOf "landvehicle" || _x isKindOf "air") && {getMass _obj < 10000}) then { + _doTeleport = true; + { + if(isPlayer _x) then { + [] remoteExec ["anomaly_fnc_teleportFlash",_x]; + }; + } forEach crew _obj; + }; - if(_doTeleport) then { - [_obj, [((_exitPos select 0) + (random 4) - 2), ((_exitPos select 1) + (random 4) - 2), (_exitPos select 2) ]] remoteExec ["setPos",_obj]; - }; - } else { - if(!(_obj isKindOf "landvehicle" || _x isKindOf "air")) then { - [_obj] remoteExec ["anomaly_fnc_minceCorpse"]; - }; - }; + if(_doTeleport) then { + [_obj, [((_exitPos select 0) + (random 4) - 2), ((_exitPos select 1) + (random 4) - 2), (_exitPos select 2) ]] remoteExec ["setPos",_obj]; + }; + } else { + if(!(_obj isKindOf "landvehicle" || _x isKindOf "air")) then { + [_obj] remoteExec ["anomaly_fnc_minceCorpse"]; + }; + }; } forEach _men; sleep (2 + (random 5) ); diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createAnomalyField.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createAnomalyField.sqf index 2310be4..6c5d4e6 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createAnomalyField.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createAnomalyField.sqf @@ -1,56 +1,56 @@ /* - Function: anomaly_fnc_createAnomalyField + Function: anomaly_fnc_createAnomalyField - Description: + Description: Creates and anomaly field with specific amount of each anomaly type Parameter: _posParams - array containing parameters for the function CBA_fnc_randPosArea, See dokumentation here:http://cbateam.github.io/CBA_A3/docs/files/common/fnc_randPosArea-sqf.html (default: []) - _springboard - how many anomalies of the type springboard should be created (default: 0) - _burner - how many anomalies of the type burner should be created (default: 0) - _electra - how many anomalies of the type electra should be created (default: 0) - _meatgrinder - how many anomalies of the type meatgrinder should be created (default: 0) + _springboard - how many anomalies of the type springboard should be created (default: 0) + _burner - how many anomalies of the type burner should be created (default: 0) + _electra - how many anomalies of the type electra should be created (default: 0) + _meatgrinder - how many anomalies of the type meatgrinder should be created (default: 0) Returns: array of all crated anomalies - Author: - diwako 2018-03-21 + Author: + diwako 2018-03-21 */ params["_posParams",["_springboard",0],["_burner",0],["_electra",0],["_meatgrinder",0]]; if(typeName _posParams != typeName []) then { - //created via module - private _pos = _posParams getVariable "objectarea"; - _springboard = _posParams getVariable ["springboards",0]; - _burner = _posParams getVariable ["burners",0]; - _electra = _posParams getVariable ["electras",0]; - _meatgrinder = _posParams getVariable ["meatgrinders",0]; - private _module = _posParams; - _posParams = [[(getpos _posParams), _pos#0, _pos#1, _pos#2, _pos#3]]; - deleteVehicle _module; + //created via module + private _pos = _posParams getVariable "objectarea"; + _springboard = _posParams getVariable ["springboards",0]; + _burner = _posParams getVariable ["burners",0]; + _electra = _posParams getVariable ["electras",0]; + _meatgrinder = _posParams getVariable ["meatgrinders",0]; + private _module = _posParams; + _posParams = [[(getpos _posParams), _pos#0, _pos#1, _pos#2, _pos#3]]; + deleteVehicle _module; }; _anomalies = []; for "_i" from 1 to _springboard do { - _pos = _posParams call CBA_fnc_randPosArea; - _anomalies pushBack ([_pos] call anomaly_fnc_createSpringboard); + _pos = _posParams call CBA_fnc_randPosArea; + _anomalies pushBack ([_pos] call anomaly_fnc_createSpringboard); }; for "_i" from 1 to _burner do { - _pos = _posParams call CBA_fnc_randPosArea; - _anomalies pushBack ([_pos] call anomaly_fnc_createBurner); + _pos = _posParams call CBA_fnc_randPosArea; + _anomalies pushBack ([_pos] call anomaly_fnc_createBurner); }; for "_i" from 1 to _electra do { - _pos = _posParams call CBA_fnc_randPosArea; - _anomalies pushBack ([_pos] call anomaly_fnc_createElectra); + _pos = _posParams call CBA_fnc_randPosArea; + _anomalies pushBack ([_pos] call anomaly_fnc_createElectra); }; for "_i" from 1 to _meatgrinder do { - _pos = _posParams call CBA_fnc_randPosArea; - _anomalies pushBack ([_pos] call anomaly_fnc_createMeatgrinder); + _pos = _posParams call CBA_fnc_randPosArea; + _anomalies pushBack ([_pos] call anomaly_fnc_createMeatgrinder); }; _anomalies \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createBurner.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createBurner.sqf index 14fed54..1c745a0 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createBurner.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createBurner.sqf @@ -1,7 +1,7 @@ /* - Function: anomaly_fnc_createBurner + Function: anomaly_fnc_createBurner - Description: + Description: Creates an anomaly of the type "Burner" Parameter: @@ -10,8 +10,8 @@ Returns: Anomaly Trigger - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_pos",[0,0,0]]]; @@ -20,25 +20,25 @@ if(!isServer) exitWith {}; _pos = [_pos] call anomaly_fnc_getLocationFromModule; if(count _pos < 3) then { - _pos set [2,0]; + _pos set [2,0]; }; _trg = createTrigger ["EmptyDetector", _pos]; _trg setPosATL _pos; _trg setVariable ["anomaly_cooldown", false, true]; _trg setVariable ["anomaly_type", "burner", true]; -private _proxy = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy enableSimulationGlobal false; +private _proxy = "building" createVehicle position _trg; _proxy setPos (_trg modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg setVariable ["anomaly_sound", _proxy, true]; [ - _trg, //trigger - [4, 4, 0, false,4], // area - ["ANY", "PRESENT", true], // activation - ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateBurner", ""] // statements + _trg, //trigger + [4, 4, 0, false,4], // area + ["ANY", "PRESENT", true], // activation + ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateBurner", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg]; if(isNil "ANOMALIES_HOLDER") then { - ANOMALIES_HOLDER = []; + ANOMALIES_HOLDER = []; }; ANOMALIES_HOLDER pushBackUnique _trg; @@ -48,23 +48,23 @@ ANOMALIES_HOLDER pushBackUnique _trg; _trg2 = createTrigger ["EmptyDetector", _pos]; _trg2 setPosATL _pos; _trg setVariable ["anomaly_idle_sound", _trg2, true]; -_proxy = "Land_HelipadEmpty_F" createVehicle position _trg2; -_proxy enableSimulationGlobal false; +_proxy = "building" createVehicle position _trg2; _proxy setPos (_trg2 modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg2 setVariable ["anomaly_idle_sound", _proxy, true]; [ - _trg2, //trigger - [25, 25, 0, false, 2], // area - ["ANY", "PRESENT", true], // activation - ["this && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; sleep random 5; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {(_thisTrigger getVariable 'anomaly_idle_sound') say3D 'fire_idle'; sleep 8.272060}}", ""] // statement + _trg2, //trigger + [25, 25, 0, false, 2], // area + ["ANY", "PRESENT", true], // activation + ["this && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; sleep random 5; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {(_thisTrigger getVariable 'anomaly_idle_sound') say3D 'fire_idle'; sleep 8.272060}}", ""] // statement ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg2]; if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - _marker = createMarkerLocal [str(_pos),_pos]; - _marker setMarkerShapeLocal "ICON"; - _marker setMarkerTypeLocal "hd_dot"; - _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); - _trg setVariable ["debug_marker",_marker]; + _marker = createMarkerLocal [str(_pos),_pos]; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; + _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); + _trg setVariable ["debug_marker",_marker]; }; // disable trigger until player is near diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createElectra.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createElectra.sqf index 38a4a08..3395de4 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createElectra.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createElectra.sqf @@ -1,7 +1,7 @@ /* - Function: anomaly_fnc_createElectra + Function: anomaly_fnc_createElectra - Description: + Description: Creates an anomaly of the type "Electra" Parameter: @@ -10,8 +10,8 @@ Returns: Anomaly Trigger - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_pos",[0,0,0]]]; @@ -20,25 +20,25 @@ if(!isServer) exitWith {}; _pos = [_pos] call anomaly_fnc_getLocationFromModule; if(count _pos < 3) then { - _pos set [2,0]; + _pos set [2,0]; }; _trg = createTrigger ["EmptyDetector", _pos]; _trg setPosATL _pos; _trg setVariable ["anomaly_cooldown", false, true]; _trg setVariable ["anomaly_type", "electra", true]; -private _proxy = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy enableSimulationGlobal false; +private _proxy = "building" createVehicle position _trg; _proxy setPos (_trg modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg setVariable ["anomaly_sound", _proxy, true]; [ - _trg, //trigger - [4, 4, 0, false,4], // area - ["ANY", "PRESENT", true], // activation - ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateElectra", ""] // statements + _trg, //trigger + [4, 4, 0, false,4], // area + ["ANY", "PRESENT", true], // activation + ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateElectra", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg]; if(isNil "ANOMALIES_HOLDER") then { - ANOMALIES_HOLDER = []; + ANOMALIES_HOLDER = []; }; ANOMALIES_HOLDER pushBackUnique _trg; @@ -48,23 +48,23 @@ ANOMALIES_HOLDER pushBackUnique _trg; _trg2 = createTrigger ["EmptyDetector", _pos]; _trg2 setPosATL _pos; _trg setVariable ["anomaly_idle_sound", _trg2, true]; -_proxy = "Land_HelipadEmpty_F" createVehicle position _trg2; -_proxy enableSimulationGlobal false; +_proxy = "building" createVehicle position _trg2; _proxy setPos (_trg2 modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg2 setVariable ["anomaly_idle_sound", _proxy, true]; [ - _trg2, //trigger - [50, 50, 0, false, 2], // area - ["ANY", "PRESENT", true], // activation - ["this && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; sleep random 5; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {(_thisTrigger getVariable 'anomaly_idle_sound') say3D 'electra_idle1'; sleep 5.455}}", ""] // statements + _trg2, //trigger + [50, 50, 0, false, 2], // area + ["ANY", "PRESENT", true], // activation + ["this && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; sleep random 5; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {(_thisTrigger getVariable 'anomaly_idle_sound') say3D 'electra_idle1'; sleep 5.455}}", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg2]; if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - _marker = createMarkerLocal [str(_pos),_pos]; - _marker setMarkerShapeLocal "ICON"; - _marker setMarkerTypeLocal "hd_dot"; - _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); - _trg setVariable ["debug_marker",_marker]; + _marker = createMarkerLocal [str(_pos),_pos]; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; + _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); + _trg setVariable ["debug_marker",_marker]; }; // disable trigger until player is near diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createFog.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createFog.sqf index ee403fe..4f5b400 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createFog.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createFog.sqf @@ -1,40 +1,40 @@ /* - Function: anomaly_fnc_createFog + Function: anomaly_fnc_createFog - Description: + Description: Creates an anomaly of the type "Fog" Parameter: _pos - Position where the anomaly should be (default: [0,0,0]]) - _radius - Radius parameter of area anomaly (default: 10) - _isRectangle - is this anomaly rectangular shaped (default: true) - - Currently under construction and does not work on effect right now - _angle - Angle the anomaly should have (default: 0) + _radius - Radius parameter of area anomaly (default: 10) + _isRectangle - is this anomaly rectangular shaped (default: true) + + Currently under construction and does not work on effect right now + _angle - Angle the anomaly should have (default: 0) Returns: Anomaly Trigger - Author: - diwako 2018-05-22 + Author: + diwako 2018-05-22 */ params[["_pos",[0,0,0]],["_radius",10],["_isRectangle",true],["_angle",0]]; if(!isServer) exitWith {}; if(typeName _pos != typeName []) then { - //created via module - private _area = _pos getVariable "objectarea"; - _radius = _area#0; - _isRectangle = _area#3; - _angle = _area#2; - private _module = _pos; - _pos = getPosATL _pos; - deleteVehicle _module; + //created via module + private _area = _pos getVariable "objectarea"; + _radius = _area#0; + _isRectangle = _area#3; + _angle = _area#2; + private _module = _pos; + _pos = getPosATL _pos; + deleteVehicle _module; }; _angle = 0; if(count _pos < 3) then { - _pos set [2,0]; + _pos set [2,0]; }; _pos set [2,(_pos#2) - 2]; @@ -46,10 +46,10 @@ _trg setVariable ["anomaly_type", "fog", true]; _trg setVariable ["radius", _radius, true]; _trg setVariable ["angle", _angle, true]; [ - _trg, //trigger - [_radius, _radius, _angle, _isRectangle, 4], // area - ["ANY", "PRESENT", true], // activation - ["this && {round (cba_missiontime mod 2) == 1}", "[thisTrigger,thisList] spawn anomaly_fnc_activateFog", ""] // statements + _trg, //trigger + [_radius, _radius, _angle, _isRectangle, 4], // area + ["ANY", "PRESENT", true], // activation + ["this && {round (cba_missiontime mod 2) == 1}", "[thisTrigger,thisList] spawn anomaly_fnc_activateFog", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg]; if(isNil "ANOMALIES_HOLDER") then { @@ -60,11 +60,11 @@ ANOMALIES_HOLDER pushBackUnique _trg; // publicVariable "ANOMALIES_HOLDER"; if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - _marker = createMarkerLocal [str(_pos),_pos]; - _marker setMarkerShapeLocal "ICON"; - _marker setMarkerTypeLocal "hd_dot"; - _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); - _trg setVariable ["debug_marker",_marker]; + _marker = createMarkerLocal [str(_pos),_pos]; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; + _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); + _trg setVariable ["debug_marker",_marker]; }; // disable trigger until player is near diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createFruitPunch.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createFruitPunch.sqf index 6b8e424..b7bd418 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createFruitPunch.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createFruitPunch.sqf @@ -1,17 +1,17 @@ /* - Function: anomaly_fnc_createFruitPunch + Function: anomaly_fnc_createFruitPunch - Description: + Description: Creates an anomaly of the type "Fruit Punch" Parameter: _pos - Position where the anomaly should be (default: [0,0,0]]) - + Returns: Anomaly Trigger - Author: - diwako 2018-06-10 + Author: + diwako 2018-06-10 */ params[["_pos",[0,0,0]]]; if(!isServer) exitWith {}; @@ -19,7 +19,7 @@ if(!isServer) exitWith {}; _pos = [_pos] call anomaly_fnc_getLocationFromModule; if(count _pos < 3) then { - _pos set [2,0]; + _pos set [2,0]; }; _trg = createTrigger ["EmptyDetector", _pos]; @@ -31,14 +31,14 @@ _trg setTriggerArea [_radius, _radius, 0, false, 2]; _trg setTriggerActivation ["ANY", "PRESENT", true]; _trg setTriggerStatements ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateFruitPunch", ""]; -private _proxy = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy enableSimulationGlobal false; +private _proxy = "building" createVehicle position _trg; _proxy setPos (_trg modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg setVariable ["anomaly_sound", _proxy, true]; private _field = createSimpleObject ["BloodPool_01_Large_New_F", _pos]; -_field enableSimulationGlobal false; _field setPosATL _pos; +_field enableSimulationGlobal false; _field setDir (random 360); _field setObjectMaterialglobal [0, "a3\characters_f_bootcamp\common\data\vrarmoremmisive.rvmat"]; _field setObjectTextureGlobal [0,"diwako_anomalies\data\textures\fruitpunch" + str (floor random 2) + ".paa"]; @@ -53,16 +53,16 @@ _trg setVariable ["light",_light]; _trg2 = createTrigger ["EmptyDetector", _pos]; _trg2 setPosATL _pos; _trg setVariable ["anomaly_idle_sound", _trg2, true]; -_proxy = "Land_HelipadEmpty_F" createVehicle position _trg2; -_proxy enableSimulationGlobal false; +_proxy = "building" createVehicle position _trg2; _proxy setPos (_trg2 modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg2 setVariable ["anomaly_idle_sound", _proxy, true]; [ - _trg2, //trigger - [25, 25, 0, false, 2], // area - ["ANY", "PRESENT", true], // activation - // the random interval is there to no have two sounds play at the very same time - ["this && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; sleep random 5; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {(_thisTrigger getVariable 'anomaly_idle_sound') say3D 'buzz_idle'; sleep 5.325}}", ""] // statements + _trg2, //trigger + [25, 25, 0, false, 2], // area + ["ANY", "PRESENT", true], // activation + // the random interval is there to no have two sounds play at the very same time + ["this && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; sleep random 5; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {(_thisTrigger getVariable 'anomaly_idle_sound') say3D 'buzz_idle'; sleep 5.325}}", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg2]; if(isNil "ANOMALIES_HOLDER") then { @@ -72,11 +72,11 @@ if(isNil "ANOMALIES_HOLDER") then { ANOMALIES_HOLDER pushBackUnique _trg; if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - _marker = createMarkerLocal [str(_pos),_pos]; - _marker setMarkerShapeLocal "ICON"; - _marker setMarkerTypeLocal "hd_dot"; - _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); - _trg setVariable ["debug_marker",_marker]; + _marker = createMarkerLocal [str(_pos),_pos]; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; + _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); + _trg setVariable ["debug_marker",_marker]; }; // disable trigger until player is near diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createMeatgrinder.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createMeatgrinder.sqf index cde9bca..90d59e2 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createMeatgrinder.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createMeatgrinder.sqf @@ -1,7 +1,7 @@ /* - Function: anomaly_fnc_createMeatgrinder + Function: anomaly_fnc_createMeatgrinder - Description: + Description: Creates an anomaly of the type "Meatgrinder" Parameter: @@ -10,8 +10,8 @@ Returns: Anomaly Trigger - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_pos",[0,0,0]]]; @@ -20,37 +20,37 @@ if(!isServer) exitWith {}; _pos = [_pos] call anomaly_fnc_getLocationFromModule; if(count _pos < 3) then { - _pos set [2,0]; + _pos set [2,0]; }; _trg = createTrigger ["EmptyDetector", _pos]; _trg setPosATL _pos; _trg setVariable ["anomaly_cooldown", false, true]; _trg setVariable ["anomaly_type", "meatgrinder", true]; -private _proxy = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy enableSimulationGlobal false; +private _proxy = "building" createVehicle position _trg; _proxy setPos (_trg modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg setVariable ["anomaly_sound", _proxy, true]; [ - _trg, //trigger - [4, 4, 0, false,4], // area - ["ANY", "PRESENT", true], // activation - ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateMeatgrinder", ""] // statements + _trg, //trigger + [4, 4, 0, false,4], // area + ["ANY", "PRESENT", true], // activation + ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateMeatgrinder", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg]; if(isNil "ANOMALIES_HOLDER") then { - ANOMALIES_HOLDER = []; + ANOMALIES_HOLDER = []; }; ANOMALIES_HOLDER pushBackUnique _trg; // publicVariable "ANOMALIES_HOLDER"; if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - _marker = createMarkerLocal [str(_pos),_pos]; - _marker setMarkerShapeLocal "ICON"; - _marker setMarkerTypeLocal "hd_dot"; - _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); - _trg setVariable ["debug_marker",_marker]; + _marker = createMarkerLocal [str(_pos),_pos]; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; + _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); + _trg setVariable ["debug_marker",_marker]; }; // disable trigger until player is near diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createSpringboard.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createSpringboard.sqf index 57dedc1..8cfba66 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createSpringboard.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createSpringboard.sqf @@ -20,21 +20,21 @@ if(!isServer) exitWith {}; _pos = [_pos] call anomaly_fnc_getLocationFromModule; if(count _pos < 3) then { - _pos set [2,0]; + _pos set [2,0]; }; _trg = createTrigger ["EmptyDetector", _pos]; _trg setPosATL _pos; _trg setVariable ["anomaly_cooldown", false, true]; _trg setVariable ["anomaly_type", "springboard", true]; -private _proxy = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy enableSimulationGlobal false; +private _proxy = "building" createVehicle position _trg; _proxy setPos (_trg modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg setVariable ["anomaly_sound", _proxy, true]; [ - _trg, //trigger - [4, 4, 0, false,4], // area - ["ANY", "PRESENT", true], // activation - ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateSpringboard", ""] // statements + _trg, //trigger + [4, 4, 0, false,4], // area + ["ANY", "PRESENT", true], // activation + ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateSpringboard", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg]; if(isNil "ANOMALIES_HOLDER") then { @@ -48,22 +48,22 @@ ANOMALIES_HOLDER pushBackUnique _trg; _trg2 = createTrigger ["EmptyDetector", _pos]; _trg2 setPosATL _pos; _trg setVariable ["anomaly_idle_sound", _trg2, true]; -_proxy = "Land_HelipadEmpty_F" createVehicle position _trg2; -_proxy enableSimulationGlobal false; +_proxy = "building" createVehicle position _trg2; _proxy setPos (_trg2 modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg2 setVariable ["anomaly_idle_sound", _proxy, true]; [ - _trg2, //trigger - [25, 25, 0, false, 2], // area - ["ANY", "PRESENT", true], // activation - ["this && !(thisTrigger getVariable ['anomaly_cooldown',false]) && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; _proxy = _thisTrigger getVariable 'anomaly_idle_sound'; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {_proxy say3D ('gravi_idle0' + str(floor random 2) ); sleep (5 + (random 20) )}}", ""] // statements + _trg2, //trigger + [25, 25, 0, false, 2], // area + ["ANY", "PRESENT", true], // activation + ["this && !(thisTrigger getVariable ['anomaly_cooldown',false]) && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; _proxy = _thisTrigger getVariable 'anomaly_idle_sound'; while{!isNull _thisTrigger && {triggerActivated _thisTrigger}} do {_proxy say3D ('gravi_idle0' + str(floor random 2) ); sleep (5 + (random 20) )}}", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg2]; if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - _marker = createMarkerLocal [str(_pos),_pos]; - _marker setMarkerShapeLocal "ICON"; - _marker setMarkerTypeLocal "hd_dot"; - _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); + _marker = createMarkerLocal [str(_pos),_pos]; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; + _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); _trg setVariable ["debug_marker",_marker]; }; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf index d671c0a..136711f 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf @@ -1,44 +1,45 @@ /* - Function: anomaly_fnc_createTeleport + Function: anomaly_fnc_createTeleport - Description: + Description: Creates an anomaly of the type "teleport" Parameter: _pos - Position where the anomaly should be (default: [0,0,0]]) - _id - ID which connects teleporters + _id - ID which connects teleporters Returns: Anomaly Trigger - Author: - diwako 2017-12-14 + Author: + diwako 2017-12-14 */ params[["_pos",[0,0,0]],["_id",-1]]; if(!isServer) exitWith {}; if(typeName _pos != typeName []) then { - //created via module - _id = _pos getVariable ["anomalyid",-1]; - _pos = [_pos] call anomaly_fnc_getLocationFromModule; + //created via module + _id = _pos getVariable ["anomalyid",-1]; + _pos = [_pos] call anomaly_fnc_getLocationFromModule; }; +systemChat format ["Teleporter ID: %1 | %2", _id, typeName _id]; if(count _pos < 3) then { - _pos set [2,0]; + _pos set [2,0]; }; if(_id < 0) exitWith { - hintC ("Teleport Anomaly ID cannot be below 0. Affected anomaly at " + str(_pos)); + hintC ("Teleport Anomaly ID cannot be below 0. Affected anomaly at " + str(_pos)); }; if (isNil "ANOMALY_TELEPORT_IDS") then { ANOMALY_TELEPORT_IDS = [[], []] call CBA_fnc_hashCreate; }; -_teleporters = [ANOMALY_TELEPORT_IDS, _id] call CBA_fnc_hashGet; +private _teleporters = [ANOMALY_TELEPORT_IDS, _id] call CBA_fnc_hashGet; if( (count _teleporters) >= 2) exitWith { - hintC ("Teleport Anomaly with ID " + str(_id) + " cannot be created as there are already 2 anomalies with that id. Affected anomaly at " + str(_pos)); + hintC ("Teleport Anomaly with ID " + str(_id) + " cannot be created as there are already 2 anomalies with that id. Affected anomaly at " + str(_pos)); }; _trg = createTrigger ["EmptyDetector", _pos]; @@ -48,19 +49,19 @@ _teleporters pushBack _trg; _trg setVariable ["anomaly_cooldown", false, true]; _trg setVariable ["anomaly_teleport_id", _id, true]; _trg setVariable ["anomaly_type", "teleport", true]; -private _proxy = "Land_HelipadEmpty_F" createVehicle position _trg; -_proxy enableSimulationGlobal false; +private _proxy = "building" createVehicle position _trg; _proxy setPos (_trg modelToWorld [0,0,0.5]); +_proxy enableSimulationGlobal false; _trg setVariable ["anomaly_sound", _proxy, true]; [ - _trg, //trigger - [2, 2, 0, false,4], // area - ["ANY", "PRESENT", true], // activation - ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateTeleport", ""] // statements + _trg, //trigger + [2, 2, 0, false,4], // area + ["ANY", "PRESENT", true], // activation + ["this and !(thisTrigger getVariable ['anomaly_cooldown',false])", "[thisTrigger,thisList] spawn anomaly_fnc_activateTeleport", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg]; if(isNil "ANOMALIES_HOLDER") then { - ANOMALIES_HOLDER = []; + ANOMALIES_HOLDER = []; }; ANOMALIES_HOLDER pushBackUnique _trg; @@ -72,23 +73,23 @@ publicVariable "ANOMALY_TELEPORT_IDS"; // set up idle sound speaker; _trg2 = createTrigger ["EmptyDetector", _pos]; _trg2 setPosATL _pos; -_proxy = "Land_HelipadEmpty_F" createVehicle position _trg2; +_proxy = "building" createVehicle position _trg2; _proxy enableSimulationGlobal false; _proxy setPos (_trg2 modelToWorld [0,0,0.5]); _trg2 setVariable ["anomaly_idle_sound", _proxy, true]; [ - _trg2, //trigger - [25, 25, 0, false, 2], // area - ["ANY", "PRESENT", true], // activation - ["this && !(thisTrigger getVariable ['anomaly_cooldown',false]) && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; _proxy = _thisTrigger getVariable 'anomaly_idle_sound'; while{!isNull _thisTrigger && {triggerActivated _thisTrigger} do {_proxy say3D 'teleport_idle'; sleep 3.67075}}", ""] // statements + _trg2, //trigger + [25, 25, 0, false, 2], // area + ["ANY", "PRESENT", true], // activation + ["this && !(thisTrigger getVariable ['anomaly_cooldown',false]) && {([] call CBA_fnc_currentUnit) in thisList}", "[thisTrigger] spawn {params['_thisTrigger']; _proxy = _thisTrigger getVariable 'anomaly_idle_sound'; while{!isNull _thisTrigger && {triggerActivated _thisTrigger} do {_proxy say3D 'teleport_idle'; sleep 3.67075}}", ""] // statements ] remoteExec ["anomaly_fnc_setTrigger", 0, _trg]; if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - _marker = createMarkerLocal [str(_pos),_pos]; - _marker setMarkerShapeLocal "ICON"; - _marker setMarkerTypeLocal "hd_dot"; - _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); - _trg setVariable ["debug_marker",_marker]; + _marker = createMarkerLocal [str(_pos),_pos]; + _marker setMarkerShapeLocal "ICON"; + _marker setMarkerTypeLocal "hd_dot"; + _marker setMarkerTextLocal (_trg getVariable "anomaly_type"); + _trg setVariable ["debug_marker",_marker]; }; // disable trigger until player is near diff --git a/mod/diwako_anomalies/functions/anomalies/fn_deleteAnomalies.sqf b/mod/diwako_anomalies/functions/anomalies/fn_deleteAnomalies.sqf index 137dfb5..b73a522 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_deleteAnomalies.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_deleteAnomalies.sqf @@ -1,7 +1,7 @@ /* - Function: anomaly_fnc_deleteAnomalies + Function: anomaly_fnc_deleteAnomalies - Description: + Description: Deletes given anomalies. Can be called on server only!! Parameter: @@ -10,54 +10,54 @@ Returns: nothing - Author: - diwako 2018-01-14 + Author: + diwako 2018-01-14 */ if(!isServer) exitWith {}; params [["_anomalies",[]]]; _anomalies = if (typeName _anomalies != typeName []) then {[_anomalies]} else {_anomalies}; { - if(!isNull _x) then { - _type = _x getVariable ["anomaly_type", ""]; - if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { - deleteMarker (_x getVariable ["debug_marker",""]); - }; - if(_type != "") then { - [_x] remoteExec ["anomaly_fnc_deleteParticleSource"]; - deleteVehicle (_x getVariable ["anomaly_sound", objNull]); - _trg2 = _x getVariable ["anomaly_idle_sound", objNull]; - if(!(isNull _trg2)) then { - deleteVehicle (_trg2 getVariable ["anomaly_idle_sound", objNull]); - deleteVehicle _trg2; - }; - ANOMALIES_HOLDER = ANOMALIES_HOLDER - [_x]; - if(_type == "teleport") then { - // handle teleport anomalies - _id = _x getVariable "anomaly_teleport_id"; - _teleporters = [ANOMALY_TELEPORT_IDS, _id] call CBA_fnc_hashGet; - for "_i" from 0 to ((count _teleporters) -1 ) do { - if( (_teleporters select _i) == _x ) then { - _teleporters = _teleporters - [_x]; - }; - }; - [ANOMALY_TELEPORT_IDS, _id, _teleporters] call CBA_fnc_hashSet; - }; + if(!isNull _x) then { + _type = _x getVariable ["anomaly_type", ""]; + if(!isNil "ANOMALY_DEBUG" && {ANOMALY_DEBUG}) then { + deleteMarker (_x getVariable ["debug_marker",""]); + }; + if(_type != "") then { + [_x] remoteExec ["anomaly_fnc_deleteParticleSource"]; + deleteVehicle (_x getVariable ["anomaly_sound", objNull]); + _trg2 = _x getVariable ["anomaly_idle_sound", objNull]; + if(!(isNull _trg2)) then { + deleteVehicle (_trg2 getVariable ["anomaly_idle_sound", objNull]); + deleteVehicle _trg2; + }; + ANOMALIES_HOLDER = ANOMALIES_HOLDER - [_x]; + if(_type == "teleport") then { + // handle teleport anomalies + _id = _x getVariable "anomaly_teleport_id"; + _teleporters = [ANOMALY_TELEPORT_IDS, _id] call CBA_fnc_hashGet; + for "_i" from 0 to ((count _teleporters) -1 ) do { + if( (_teleporters select _i) == _x ) then { + _teleporters = _teleporters - [_x]; + }; + }; + [ANOMALY_TELEPORT_IDS, _id, _teleporters] call CBA_fnc_hashSet; + }; - if(_type == "fruitpunch") then { - private _trg = _x; - deleteVehicle (_trg getVariable ["light",objNull]); - deleteVehicle (_trg getVariable ["field",objNull]); - _x = _trg; - }; - [_x] spawn { - // wait for clients to delete particle source - params ["_x"]; - sleep 0.5; - deleteVehicle _x; - }; - }; - }; + if(_type == "fruitpunch") then { + private _trg = _x; + deleteVehicle (_trg getVariable ["light",objNull]); + deleteVehicle (_trg getVariable ["field",objNull]); + _x = _trg; + }; + [_x] spawn { + // wait for clients to delete particle source + params ["_x"]; + sleep 0.5; + deleteVehicle _x; + }; + }; + }; } forEach _anomalies; // publish updated arrays // publicVariable "ANOMALIES_HOLDER"; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_deleteParticleSource.sqf b/mod/diwako_anomalies/functions/anomalies/fn_deleteParticleSource.sqf index 457b53b..7a9a03d 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_deleteParticleSource.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_deleteParticleSource.sqf @@ -2,5 +2,5 @@ params["_trig"]; if(!hasInterface) exitWith {}; _source = _trig getVariable ["anomaly_particle_source", objNull]; if(!(isNull _source)) then { - deleteVehicle _source; + deleteVehicle _source; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_getLocationFromModule.sqf b/mod/diwako_anomalies/functions/anomalies/fn_getLocationFromModule.sqf index 3045d69..8b17574 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_getLocationFromModule.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_getLocationFromModule.sqf @@ -1,8 +1,8 @@ params["_locOrModule"]; if(typeName _locOrModule == typeName []) exitWith { - // this is a location - _locOrModule + // this is a location + _locOrModule }; private _pos = getPosATL _locOrModule; // get rid of the now useless module! diff --git a/mod/diwako_anomalies/functions/anomalies/fn_hasItem.sqf b/mod/diwako_anomalies/functions/anomalies/fn_hasItem.sqf index a409c0d..543886c 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_hasItem.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_hasItem.sqf @@ -1,18 +1,18 @@ /* - Function: anomaly_fnc_hasItem + Function: anomaly_fnc_hasItem - Description: + Description: Function to check if a specific item is in players inventory Parameters: _unit - Unit to check. will be player if variable is objNull and is called on a client machine (default: objNull) - _itemClass - Itemclass to search for (default: "") + _itemClass - Itemclass to search for (default: "") Returns: true or false, if item is in inventory or empty string is given - Author: - diwako 2017-12-29 + Author: + diwako 2017-12-29 */ if (!params [["_unit", objNull], ["_itemClass", ""]]) exitWith {false}; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_init.sqf b/mod/diwako_anomalies/functions/anomalies/fn_init.sqf index 8fb8188..4c80fde 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_init.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_init.sqf @@ -1,7 +1,7 @@ /* - Function: anomaly_fnc_init + Function: anomaly_fnc_init - Description: + Description: Initialises the use of anomalies in the mission, called form init.sqf! Parameter: @@ -9,53 +9,53 @@ Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ if(missionNamespace getVariable ["anomaly_var_init",false]) exitWith {}; missionNamespace setVariable ["anomaly_var_init",true]; if(isServer && isMultiplayer) then { - // global var used for checking if an anomaly should stay activatable - ANOMALY_ACTIVATABLE_HOLDER = []; - - // cba event handler for activating anomalies - ["anomaly_enable_anomaly", { - params [["_added",[]]]; - { - private _index = ANOMALY_ACTIVATABLE_HOLDER pushBackUnique _x; - if(_index > -1) then { - // systemChat format["Enabled a '%1' anomaly",_x getVariable "anomaly_type"]; - _x enableSimulationGlobal true; - }; - false - } count _added; - }] call CBA_fnc_addEventHandler; - - // publish PFH which publishes all anomalies each 5 seconds - [{ - params ["_args", "_pfhHandle"]; - _args params ["_transmitted"]; - private _count = count ANOMALIES_HOLDER; - if(_count != _transmitted) then { - publicVariable "ANOMALIES_HOLDER"; - _args set [0, _count]; - }; - - private _players = [] call CBA_fnc_players; - for "_i" from ((count ANOMALY_ACTIVATABLE_HOLDER) - 1) to 0 step -1 do - { - private _anomaly = ANOMALY_ACTIVATABLE_HOLDER#_i; - private _index = _players findIf { (_anomaly distance2D _x) < ANOMALY_TRIGGER_DISTANCE }; - // systemChat format["index is %1",_index]; - if(_index == -1) then { - // systemChat format["Disabled a '%1' anomaly",_anomaly getVariable "anomaly_type"]; - _anomaly enableSimulationGlobal false; - ANOMALY_ACTIVATABLE_HOLDER deleteAt _i; - }; - } - }, 5, [0] ] call CBA_fnc_addPerFrameHandler; + // global var used for checking if an anomaly should stay activatable + ANOMALY_ACTIVATABLE_HOLDER = []; + + // cba event handler for activating anomalies + ["anomaly_enable_anomaly", { + params [["_added",[]]]; + { + private _index = ANOMALY_ACTIVATABLE_HOLDER pushBackUnique _x; + if(_index > -1) then { + // systemChat format["Enabled a '%1' anomaly",_x getVariable "anomaly_type"]; + _x enableSimulationGlobal true; + }; + false + } count _added; + }] call CBA_fnc_addEventHandler; + + // publish PFH which publishes all anomalies each 5 seconds + [{ + params ["_args", "_pfhHandle"]; + _args params ["_transmitted"]; + private _count = count ANOMALIES_HOLDER; + if(_count != _transmitted) then { + publicVariable "ANOMALIES_HOLDER"; + _args set [0, _count]; + }; + + private _players = [] call CBA_fnc_players; + for "_i" from ((count ANOMALY_ACTIVATABLE_HOLDER) - 1) to 0 step -1 do + { + private _anomaly = ANOMALY_ACTIVATABLE_HOLDER#_i; + private _index = _players findIf { (_anomaly distance2D _x) < ANOMALY_TRIGGER_DISTANCE }; + // systemChat format["index is %1",_index]; + if(_index == -1) then { + // systemChat format["Disabled a '%1' anomaly",_anomaly getVariable "anomaly_type"]; + _anomaly enableSimulationGlobal false; + ANOMALY_ACTIVATABLE_HOLDER deleteAt _i; + }; + } + }, 5, [0] ] call CBA_fnc_addPerFrameHandler; }; if(!hasInterface) exitWith {}; @@ -84,217 +84,290 @@ ANOMALY_BOLT_THROW_TIME = (time - 1); enableCamShake true; if(isNil "ANOMALIES_HOLDER") then { - ANOMALIES_HOLDER = []; + ANOMALIES_HOLDER = []; }; [{ - // params ["_args", "_pfhHandle"]; //maybe needed for later - FOUND_ANOMALIES = []; - private _anomaliesToActivate = []; - private _curPlayer = [] call CBA_fnc_currentUnit; - private _pos = (positionCameraToWorld [0,0,0]); - - // find trigger - { - _type = _x getVariable ["anomaly_type", nil]; - // only accept triggers that are anomalies - if!(isNil "_type") then { - if((_pos distance _x) <= ANOMALY_IDLE_DISTANCE) then { - FOUND_ANOMALIES pushBackUnique _x; - private _source = _x getVariable ["anomaly_particle_source", objNull]; - if(isNull _source) then { - // create idle effect - private _proxy = "Land_HelipadEmpty_F" createVehicleLocal position _x; - _proxy enableSimulation false; - _proxy setPos (_x modelToWorld [0,0,0]); - _proxy setVariable ["anomaly_trigger", _x]; - _source = "#particlesource" createVehicleLocal getPos _x; - _source setPosATL (getPosATL _x); - // _source enableSimulation false; - _arr = [_proxy, _source, "idle"]; - switch (_type) do { - case "meatgrinder": {_arr call anomalyEffect_fnc_meatgrinder;}; - case "springboard": {_arr call anomalyEffect_fnc_springboard;}; - case "burner": {_arr call anomalyEffect_fnc_burner;}; - case "teleport": {_arr call anomalyEffect_fnc_teleport;}; - case "fog": {_arr call anomalyEffect_fnc_fog;}; - case "electra": { - if(!(_x getVariable ["anomaly_cooldown", false])) then { - _arr call anomalyEffect_fnc_electra; - } else { - deleteVehicle _proxy; - }; - }; - case "fruitpunch": {_arr call anomalyEffect_fnc_fruitPunch;}; - default { }; - }; - _x setVariable ["anomaly_particle_source", _proxy]; - }; - }; - - if((_curPlayer distance _x) <= ANOMALY_TRIGGER_DISTANCE) then { - // if the anomaly is not enabled, do not wait for the server to active it for you, enable it locally and tell the server to activate it for everyone - if!(simulationEnabled _x) then { - _x enableSimulation true; - _anomaliesToActivate pushBack _x; - }; - - - // if the anomaly has a sound trigger attached to it, activate it for the player - private _soundTrigger = _x getVariable ["anomaly_idle_sound", objNull]; - if(!(isNull _soundTrigger) && {!(simulationEnabled _soundTrigger)}) then { - _soundTrigger enableSimulation true; - }; - }; - }; - - false - } count ANOMALIES_HOLDER; - - // tell the server to activate it for everyone - if((count _anomaliesToActivate) > 0) then { - ["anomaly_enable_anomaly", [_anomaliesToActivate]] call CBA_fnc_serverEvent; - }; - - _diff = ACTIVE_ANOMALIES - FOUND_ANOMALIES; - { - deleteVehicle (_x getVariable "anomaly_particle_source"); - // if the anomaly has a sound trigger attached to it, deactivate it - private _soundTrigger = _x getVariable ["anomaly_idle_sound", objNull]; - if!(isNull _soundTrigger) then { - _soundTrigger enableSimulation false; - }; - // if player is not playing in multiplayer disable it here. - // in mp the server will disable the trigger - if(!isMultiplayer) then { - _x enableSimulation false; - }; - false - } count _diff; - ACTIVE_ANOMALIES = FOUND_ANOMALIES; + // params ["_args", "_pfhHandle"]; //maybe needed for later + FOUND_ANOMALIES = []; + private _anomaliesToActivate = []; + private _curPlayer = [] call CBA_fnc_currentUnit; + private _pos = (positionCameraToWorld [0,0,0]); + + // find trigger + { + _type = _x getVariable ["anomaly_type", nil]; + // only accept triggers that are anomalies + if!(isNil "_type") then { + if((_pos distance _x) <= ANOMALY_IDLE_DISTANCE) then { + FOUND_ANOMALIES pushBackUnique _x; + private _source = _x getVariable ["anomaly_particle_source", objNull]; + if(isNull _source) then { + // create idle effect + // private _proxy = "building" createVehicleLocal position _x; + // _proxy setPos (_x modelToWorld [0,0,0]); + // _proxy enableSimulation false; + // _proxy setVariable ["anomaly_trigger", _x]; + _source = "#particlesource" createVehicleLocal getPos _x; + _source setPosWorld (getPosWorld _x); + _source setVariable ["anomaly_trigger", _x]; + // _source enableSimulation false; + private _arr = [_source, "idle"]; + switch (_type) do { + case "meatgrinder": {_arr call anomalyEffect_fnc_meatgrinder;}; + case "springboard": {_arr call anomalyEffect_fnc_springboard;}; + case "burner": {_arr call anomalyEffect_fnc_burner;}; + case "teleport": {_arr call anomalyEffect_fnc_teleport;}; + case "fog": {[_source, "idle", _x] call anomalyEffect_fnc_fog;}; + case "electra": { + if(!(_x getVariable ["anomaly_cooldown", false])) then { + _arr call anomalyEffect_fnc_electra; + } else { + deleteVehicle _source; + }; + }; + case "fruitpunch": {_arr call anomalyEffect_fnc_fruitPunch;}; + default { }; + }; + _x setVariable ["anomaly_particle_source", _source]; + }; + }; + + if((_curPlayer distance _x) <= ANOMALY_TRIGGER_DISTANCE) then { + // if the anomaly is not enabled, do not wait for the server to active it for you, enable it locally and tell the server to activate it for everyone + if!(simulationEnabled _x) then { + _x enableSimulation true; + _anomaliesToActivate pushBack _x; + }; + + + // if the anomaly has a sound trigger attached to it, activate it for the player + private _soundTrigger = _x getVariable ["anomaly_idle_sound", objNull]; + if(!(isNull _soundTrigger) && {!(simulationEnabled _soundTrigger)}) then { + _soundTrigger enableSimulation true; + }; + }; + }; + + false + } count ANOMALIES_HOLDER; + + // tell the server to activate it for everyone + if((count _anomaliesToActivate) > 0) then { + ["anomaly_enable_anomaly", [_anomaliesToActivate]] call CBA_fnc_serverEvent; + }; + + _diff = ACTIVE_ANOMALIES - FOUND_ANOMALIES; + { + deleteVehicle (_x getVariable "anomaly_particle_source"); + // if the anomaly has a sound trigger attached to it, deactivate it + private _soundTrigger = _x getVariable ["anomaly_idle_sound", objNull]; + if!(isNull _soundTrigger) then { + _soundTrigger enableSimulation false; + }; + // if player is not playing in multiplayer disable it here. + // in mp the server will disable the trigger + if(!isMultiplayer) then { + _x enableSimulation false; + }; + false + } count _diff; + ACTIVE_ANOMALIES = FOUND_ANOMALIES; }, 5, [] ] call CBA_fnc_addPerFrameHandler; if(!isNil "ace_interact_menu_fnc_createAction") then { - _action = ["anomaly_detector",(localize "STR_anomaly_enable_detector"),"",{ - ANOMALY_DETECTOR_ACTIVE = true; - [] call anomalyDetector_fnc_detector; - },{!ANOMALY_DETECTOR_ACTIVE && [player, ANOMALY_DETECTOR_ITEM] call anomaly_fnc_hasItem},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; + _action = ["anomaly_detector",(localize "STR_anomaly_enable_detector"),"",{ + ANOMALY_DETECTOR_ACTIVE = true; + [] call anomalyDetector_fnc_detector; + },{!ANOMALY_DETECTOR_ACTIVE && [player, ANOMALY_DETECTOR_ITEM] call anomaly_fnc_hasItem},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; - [typeOf player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; + [typeOf player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; - _action = ["anomaly_detector",(localize "STR_anomaly_disable_detector"),"",{ - ANOMALY_DETECTOR_ACTIVE = false; - },{ANOMALY_DETECTOR_ACTIVE},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; + _action = ["anomaly_detector",(localize "STR_anomaly_disable_detector"),"",{ + ANOMALY_DETECTOR_ACTIVE = false; + },{ANOMALY_DETECTOR_ACTIVE},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; - [typeOf player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; + [typeOf player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; - if ! (isClass(configFile >> "CfgPatches" >> "diwako_anomalies")) then { - _action = ["throw_bolt","Throw a bolt","",{ - [player] call anomaly_fnc_throwBolt; - },{ANOMALY_BOLT_THROW_TIME < time && [player, ANOMALY_BOLT_ITEM] call anomaly_fnc_hasItem},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; + if ! (isClass(configFile >> "CfgPatches" >> "diwako_anomalies")) then { + _action = ["throw_bolt","Throw a bolt","",{ + [player] call anomaly_fnc_throwBolt; + },{ANOMALY_BOLT_THROW_TIME < time && [player, ANOMALY_BOLT_ITEM] call anomaly_fnc_hasItem},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; - [typeOf player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; - }; + [typeOf player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; + }; } else { - [[(localize "STR_anomaly_enable_detector"), { - ANOMALY_DETECTOR_ACTIVE = true; - [] call anomalyDetector_fnc_detector; - },nil,0,false,true,"","!ANOMALY_DETECTOR_ACTIVE && [_target, ANOMALY_DETECTOR_ITEM] call anomaly_fnc_hasItem && alive _target"]] call CBA_fnc_addPlayerAction; - [[(localize "STR_anomaly_disable_detector"), { - ANOMALY_DETECTOR_ACTIVE = false; - },nil,0,false,true,"","ANOMALY_DETECTOR_ACTIVE"]] call CBA_fnc_addPlayerAction; - if !(isClass(configFile >> "CfgPatches" >> "diwako_anomalies")) then { - [["Throw a bolt", { - [player] call anomaly_fnc_throwBolt; - },nil,0,false,true,"","ANOMALY_BOLT_THROW_TIME < time && [_target, ANOMALY_BOLT_ITEM] call anomaly_fnc_hasItem && alive _target"]] call CBA_fnc_addPlayerAction; - }; + [[(localize "STR_anomaly_enable_detector"), { + ANOMALY_DETECTOR_ACTIVE = true; + [] call anomalyDetector_fnc_detector; + },nil,0,false,true,"","!ANOMALY_DETECTOR_ACTIVE && [_target, ANOMALY_DETECTOR_ITEM] call anomaly_fnc_hasItem && alive _target"]] call CBA_fnc_addPlayerAction; + [[(localize "STR_anomaly_disable_detector"), { + ANOMALY_DETECTOR_ACTIVE = false; + },nil,0,false,true,"","ANOMALY_DETECTOR_ACTIVE"]] call CBA_fnc_addPlayerAction; + if !(isClass(configFile >> "CfgPatches" >> "diwako_anomalies")) then { + [["Throw a bolt", { + [player] call anomaly_fnc_throwBolt; + },nil,0,false,true,"","ANOMALY_BOLT_THROW_TIME < time && [_target, ANOMALY_BOLT_ITEM] call anomaly_fnc_hasItem && alive _target"]] call CBA_fnc_addPlayerAction; + }; }; // add Ares modules for zeus if(!isNil "Ares_fnc_RegisterCustomModule") then { - ["Stalker Anomalies", "Spawn Anomaly", - { - _pos = _this select 0; - private _anomalies = ["Burner","Electra","Meatgrinder","Springboard","Teleport","Fog","Fruit Punch"]; - - private _dialogResult = - [ - "Spawn anomaly", - [ - ["Anomaly", _anomalies] - ] - ] call Ares_fnc_ShowChooseDialog; - - if (count _dialogResult == 0) exitWith {}; - - _dialogResult params ["_type"]; - - switch (_type) do { - case 0: { [_pos] remoteExec ["anomaly_fnc_createBurner",2] }; - case 1: { [_pos] remoteExec ["anomaly_fnc_createElectra",2] }; - case 2: { [_pos] remoteExec ["anomaly_fnc_createMeatgrinder",2] }; - case 3: { [_pos] remoteExec ["anomaly_fnc_createSpringboard",2] }; - case 4: { - private _dialogResult = - [ - "Teleport ID (Number)", - [ - ["ID", "NUMBER"] - ] - ] call Ares_fnc_ShowChooseDialog; - if (count _dialogResult == 0) exitWith {}; - _dialogResult params ["_id"]; - _id = parseNumber _id; - [_pos,_id] remoteExec ["anomaly_fnc_createTeleport",2] - }; - case 5: { - private _dialogResult = - [ - "Create fog anomaly", - [ - ["Radius", "NUMBER"], - ["Rectangle", ["Yes","no"]] - ] - ] call Ares_fnc_ShowChooseDialog; - if (count _dialogResult == 0) exitWith {}; - _dialogResult params ["_radius","_rectangle"]; - _radius = parseNumber _radius; - [_pos,_radius,(_rectangle == 0)] remoteExec ["anomaly_fnc_createFog",2] - }; - case 6: { [_pos] remoteExec ["anomaly_fnc_createFruitPunch",2] }; - default { }; - }; - } - ] call Ares_fnc_RegisterCustomModule; - - ["Stalker Anomalies", "Delete Anomalies", - { - _pos = _this select 0; - private _radius = ["1","5","10","100","250"]; - - private _dialogResult = - [ - "Delete anomalies", - [ - ["Radius", _radius] - ] - ] call Ares_fnc_ShowChooseDialog; - if (count _dialogResult == 0) exitWith {}; - _dialogResult params ["_selected"]; - - _radius = parseNumber (_radius select _selected); - _trigs = _pos nearObjects ["EmptyDetector", _radius]; - [_trigs] remoteExec ["anomaly_fnc_deleteAnomalies",2]; - } - ] call Ares_fnc_RegisterCustomModule; + ["Stalker Anomalies", "Spawn Anomaly", + { + _pos = _this select 0; + private _anomalies = ["Burner","Electra","Meatgrinder","Springboard","Teleport","Fog","Fruit Punch"]; + + private _dialogResult = + [ + "Spawn anomaly", + [ + ["Anomaly", _anomalies] + ] + ] call Ares_fnc_ShowChooseDialog; + + if (count _dialogResult == 0) exitWith {}; + + _dialogResult params ["_type"]; + + switch (_type) do { + case 0: { [_pos] remoteExec ["anomaly_fnc_createBurner",2] }; + case 1: { [_pos] remoteExec ["anomaly_fnc_createElectra",2] }; + case 2: { [_pos] remoteExec ["anomaly_fnc_createMeatgrinder",2] }; + case 3: { [_pos] remoteExec ["anomaly_fnc_createSpringboard",2] }; + case 4: { + private _dialogResult = + [ + "Teleport ID (Number)", + [ + ["ID", "NUMBER"] + ] + ] call Ares_fnc_ShowChooseDialog; + if (count _dialogResult == 0) exitWith {}; + _dialogResult params ["_id"]; + _id = parseNumber _id; + [_pos,_id] remoteExec ["anomaly_fnc_createTeleport",2] + }; + case 5: { + private _dialogResult = + [ + "Create fog anomaly", + [ + ["Radius", "NUMBER"], + ["Rectangle", ["Yes","no"]] + ] + ] call Ares_fnc_ShowChooseDialog; + if (count _dialogResult == 0) exitWith {}; + _dialogResult params ["_radius","_rectangle"]; + _radius = parseNumber _radius; + [_pos,_radius,(_rectangle == 0)] remoteExec ["anomaly_fnc_createFog",2] + }; + case 6: { [_pos] remoteExec ["anomaly_fnc_createFruitPunch",2] }; + default { }; + }; + } + ] call Ares_fnc_RegisterCustomModule; + + ["Stalker Anomalies", "Delete Anomalies", + { + _pos = _this select 0; + private _radius = ["1","5","10","100","250"]; + + private _dialogResult = + [ + "Delete anomalies", + [ + ["Radius", _radius] + ] + ] call Ares_fnc_ShowChooseDialog; + if (count _dialogResult == 0) exitWith {}; + _dialogResult params ["_selected"]; + + _radius = parseNumber (_radius select _selected); + _trigs = _pos nearObjects ["EmptyDetector", _radius]; + [_trigs] remoteExec ["anomaly_fnc_deleteAnomalies",2]; + } + ] call Ares_fnc_RegisterCustomModule; +}; + +// add Zen modules for zeus +if(!isNil "zen_custom_modules_fnc_register") then { + + ["Stalker Anomalies", "Spawn Anomaly", + { + private _pos = (ASLToAGL (_this select 0)); + private _anomalies = ["Burner","Electra","Meatgrinder","Springboard","Teleport","Fog","Fruit Punch"]; + + ["Spawn anomaly", [ + ["COMBO", "Anomaly", [_anomalies, _anomalies apply {[_x]}, 0]] + ], + { + params ["_dialog", "_args"]; + _dialog params ["_type"]; + _args params ["_pos", "_anomalies"]; + switch (_anomalies findIf {_x isEqualTo _type}) do { + case 0: { [_pos] remoteExec ["anomaly_fnc_createBurner",2] }; + case 1: { [_pos] remoteExec ["anomaly_fnc_createElectra",2] }; + case 2: { [_pos] remoteExec ["anomaly_fnc_createMeatgrinder",2] }; + case 3: { [_pos] remoteExec ["anomaly_fnc_createSpringboard",2] }; + case 4: { + ["Teleport ID (Number)", [ + ["SLIDER", "ID", [1, 50, 1, 0]] + ], + { + params ["_dialog", "_args"]; + _dialog params ["_id"]; + _args params ["_pos"]; + [_pos,_id] remoteExec ["anomaly_fnc_createTeleport",2] + }, {}, [_pos] + ] call zen_dialog_fnc_create; + }; + case 5: { + ["Create fog anomaly", [ + ["SLIDER", "Radius", [1, 250, 1]], + ["CHECKBOX", "Rectangle", [false]] + ], + { + params ["_dialog", "_args"]; + _dialog params ["_radius", "_rectangle"]; + _args params ["_pos"]; + [_pos,_radius,_rectangle] remoteExec ["anomaly_fnc_createFog",2] + }, {}, [_pos] + ] call zen_dialog_fnc_create; + }; + case 6: { [_pos] remoteExec ["anomaly_fnc_createFruitPunch",2] }; + default { }; + }; + }, {}, [_pos, _anomalies] + ] call zen_dialog_fnc_create; + } + ] call zen_custom_modules_fnc_register; + + ["Stalker Anomalies", "Delete Anomalies", + { + private _pos = (ASLToAGL (_this select 0)); + + ["Delete Anomalies", [ + ["SLIDER", "Radius", [1, 250, 5]] + ], + { + params ["_dialog", "_args"]; + _dialog params ["_radius"]; + _args params ["_pos"]; + private _trigs = _pos nearObjects ["EmptyDetector", _radius]; + [_trigs] remoteExec ["anomaly_fnc_deleteAnomalies",2]; + }, {}, [_pos] + ] call zen_dialog_fnc_create; + } + ] call zen_custom_modules_fnc_register; }; if(typeName ANOMALY_GAS_MASKS == typeName "") then { - ANOMALY_GAS_MASKS = ANOMALY_GAS_MASKS splitString ","; + ANOMALY_GAS_MASKS = ANOMALY_GAS_MASKS splitString ","; }; { - // set them upper case so we can use the "in" operator without any problems - ANOMALY_GAS_MASKS set[_forEachIndex,toUpper(ANOMALY_GAS_MASKS#_forEachIndex)]; + // set them upper case so we can use the "in" operator without any problems + ANOMALY_GAS_MASKS set[_forEachIndex,toUpper(ANOMALY_GAS_MASKS#_forEachIndex)]; } forEach ANOMALY_GAS_MASKS; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_minceCorpse.sqf b/mod/diwako_anomalies/functions/anomalies/fn_minceCorpse.sqf index 745afe7..c1d42ce 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_minceCorpse.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_minceCorpse.sqf @@ -1,7 +1,7 @@ /* - Function: anomaly_fnc_minceCorpse + Function: anomaly_fnc_minceCorpse - Description: + Description: Turns a given object into (coarsely) minced meat Parameter: @@ -10,31 +10,32 @@ Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params[["_body",objNull]]; if(isNull _body) exitWith {}; if(isServer) then { - _body hideObjectGlobal true; - _body spawn { - private _proxy = "Land_HelipadEmpty_F" createVehicle position _this; - _proxy enableSimulationGlobal false; - _proxy setPos (_this modelToWorld [0,0,0]); - [_proxy, "anomaly_body_tear_1"] remoteExec ["say3D"]; - sleep 15; - deleteVehicle _this; - deleteVehicle _proxy; - }; + _body hideObjectGlobal true; + _body spawn { + private _proxy = "building" createVehicle position _this; + _proxy setPos (_this modelToWorld [0,0,0]); + _proxy enableSimulationGlobal false; + [_proxy, "anomaly_body_tear_1"] remoteExec ["say3D"]; + sleep 15; + deleteVehicle _this; + deleteVehicle _proxy; + }; }; if(hasInterface) then { - _source = "#particlesource" createVehicleLocal getPos _body; - [_body, _source, "meat"] call anomalyEffect_fnc_meatgrinder; - _source spawn { - sleep 0.75; - deleteVehicle _this; - }; + private _source = "#particlesource" createVehicleLocal getPos _body; + _source setPosWorld (getPosWorld _body); + [_source, "meat"] call anomalyEffect_fnc_meatgrinder; + _source spawn { + sleep 0.75; + deleteVehicle _this; + }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_setLight.sqf b/mod/diwako_anomalies/functions/anomalies/fn_setLight.sqf index 29a0fc0..4b27edb 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_setLight.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_setLight.sqf @@ -1,9 +1,9 @@ /* - Function: anomaly_fnc_setLight + Function: anomaly_fnc_setLight - Description: + Description: Function which will be remoteExeced to set up lights - Made, because when battle eye is enabled it does not allow remoteExec of light commands without cfgremoteexec entry + Made, because when battle eye is enabled it does not allow remoteExec of light commands without cfgremoteexec entry Parameter: _light - Light @@ -17,8 +17,8 @@ Returns: nil - Author: - diwako 2018-08-08 + Author: + diwako 2018-08-08 */ params["_light",["_brightness",1],["_color",[1,1,1]],["_attenuation",[1,1,1,1,1,1]],["_ambient",[1,1,1]],["_daylight",false],["_flare",false]]; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_setTrigger.sqf b/mod/diwako_anomalies/functions/anomalies/fn_setTrigger.sqf index 9c9046b..e38d777 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_setTrigger.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_setTrigger.sqf @@ -1,9 +1,9 @@ /* - Function: anomaly_fnc_setTrigger + Function: anomaly_fnc_setTrigger - Description: + Description: Function which will be remoteExeced to set up the trigger settings - Made, because when battle eye is enabled it does not allow remoteExec of settrigger commands without cfgremoteexec entry + Made, because when battle eye is enabled it does not allow remoteExec of settrigger commands without cfgremoteexec entry Parameter: _trg - Trigger @@ -14,8 +14,8 @@ Returns: nil - Author: - diwako 2018-08-07 + Author: + diwako 2018-08-07 */ params["_trg","_area","_activation","_statements"]; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_suckToLocation.sqf b/mod/diwako_anomalies/functions/anomalies/fn_suckToLocation.sqf index 5411937..e7eff9b 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_suckToLocation.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_suckToLocation.sqf @@ -1,28 +1,28 @@ /* - Function: anomaly_fnc_suckToLocation + Function: anomaly_fnc_suckToLocation - Description: + Description: sucks a given object slightly above a given position Parameter: _obj - Object that is about to be sucked in - _pos - given position - _intensity - Force Multiplier (default: 1) - _duration - duration of the effect (default: 10) + _pos - given position + _intensity - Force Multiplier (default: 1) + _duration - duration of the effect (default: 10) Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ params["_obj","_pos",["_intensity",1], ["_duration", 10]]; _time = time + _duration; while {(alive _obj) && (time <= _time)} do { - _pos2 = getpos _obj; - _a = ((_pos select 0) - (_pos2 select 0)); - _b = ((_pos select 1) - (_pos2 select 1)); - _obj setVelocity [_a * _intensity, _b * _intensity, 0.2]; + _pos2 = getpos _obj; + _a = ((_pos select 0) - (_pos2 select 0)); + _b = ((_pos select 1) - (_pos2 select 1)); + _obj setVelocity [_a * _intensity, _b * _intensity, 0.2]; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_teleportFlash.sqf b/mod/diwako_anomalies/functions/anomalies/fn_teleportFlash.sqf index 3535427..fafe719 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_teleportFlash.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_teleportFlash.sqf @@ -1,7 +1,7 @@ /* - Function: anomaly_fnc_teleportFlash + Function: anomaly_fnc_teleportFlash - Description: + Description: flashes the screen when using a teleporter Parameter: @@ -9,32 +9,32 @@ Returns: nothing - Author: - diwako 2017-12-14 + Author: + diwako 2017-12-14 */ if(!hasInterface) exitWith {}; // if(isNil "ANOMALY_TELEPORT_FLASH") then { -// ANOMALY_TELEPORT_FLASH = ppEffectCreate ["colorCorrections", 1501]; +// ANOMALY_TELEPORT_FLASH = ppEffectCreate ["colorCorrections", 1501]; // }; // ANOMALY_TELEPORT_FLASH ppEffectAdjust [ -// 1.0, 1.0, 0.0, -// [1.0, 1.0, 1.0, 1.0], -// [0.0, 1.0, 1.0, 1.0], -// [0.199, 0.587, 0.114, 0.0] -// ]; +// 1.0, 1.0, 0.0, +// [1.0, 1.0, 1.0, 1.0], +// [0.0, 1.0, 1.0, 1.0], +// [0.199, 0.587, 0.114, 0.0] +// ]; // ANOMALY_TELEPORT_FLASH ppEffectCommit 0; // ANOMALY_TELEPORT_FLASH ppEffectEnable true; // ANOMALY_TELEPORT_FLASH ppEffectCommit 2; // ANOMALY_TELEPORT_FLASH ppEffectAdjust [ -// 1.0, 1.0, 0.0, -// [1.0, 1.0, 1.0, 0.0], -// [0.0, 1.0, 1.0, 1.0], -// [0.199, 0.587, 0.114, 0.0] -// ]; +// 1.0, 1.0, 0.0, +// [1.0, 1.0, 1.0, 0.0], +// [0.0, 1.0, 1.0, 1.0], +// [0.199, 0.587, 0.114, 0.0] +// ]; [] spawn { - setApertureNew [1,1,1,1]; - sleep 0.5; - setApertureNew [-1]; + setApertureNew [1,1,1,1]; + sleep 0.5; + setApertureNew [-1]; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/anomalies/fn_throwBolt.sqf b/mod/diwako_anomalies/functions/anomalies/fn_throwBolt.sqf index 48e57b8..19f2acf 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_throwBolt.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_throwBolt.sqf @@ -1,16 +1,16 @@ /* - Function: anomaly_fnc_throwBolt + Function: anomaly_fnc_throwBolt - Description: + Description: Makes given player perform a bolt throw. Parameter: - _unit - Player that should perform the action + _unit - Player that should perform the action Returns: nothing - Author: - diwako 2018-01-14 + Author: + diwako 2018-01-14 */ params [["_unit",objNull]]; @@ -21,74 +21,74 @@ if(!isPlayer _unit) exitWith {}; if( (vehicle _unit) != _unit) exitWith {}; [_unit] spawn { - params ["_unit"]; - _pos = getPosATL _unit; + params ["_unit"]; + _pos = getPosATL _unit; - _direction = [0, 70, 500]; - _velocity = 18; + _direction = [0, 70, 500]; + _velocity = 18; - _anims = []; - _offset = 0; - _curWeapon = currentWeapon _unit; - _curWeaponType = 0; - if(primaryWeapon _unit != "" && {primaryWeapon _unit == _curWeapon}) then { - _curWeaponType = 1; - }; - if(handgunWeapon _unit != "" && {handgunWeapon _unit == _curWeapon}) then { - _curWeaponType = 2; - }; - if(secondaryWeapon _unit != "" && {secondaryWeapon _unit == _curWeapon}) exitWith { - hint "Cannot throw a bolt with a heavy weapon equipped"; - }; - - switch (stance _unit) do { - case "STAND": { - _anims = [ - ["AwopPercMstpSgthWnonDnon_start", 0.833], - ["AwopPercMstpSgthWrflDnon_Start1", 1.575], - ["AwopPercMstpSgthWpstDnon_Part1", (0.533 + 1.709 + 0.505)] - ] select _curWeaponType; - _offset = 1.8; - }; - case "CROUCH": { - _anims = [ - ["AwopPknlMstpSgthWpstDnon_Part1", (0.533 + 1.709 + 0.505)], - ["AwopPknlMstpSgthWrflDnon_Start", 1.333], - ["AwopPknlMstpSgthWpstDnon_Part1", (0.533 + 1.709 + 0.505)] - ] select _curWeaponType; - _offset = 1; - }; - case "PRONE": { - _anims = [ - ["AwopPpneMstpSgthWnonDnon_start", 0.995], - ["AwopPpneMstpSgthWrflDnon_Start", 1.212], - ["AwopPpneMstpSgthWpstDnon_Part1", (0.784 + 1.5150 + 0.249)] - ] select _curWeaponType; - _offset = 0.2; - }; - default {}; - }; - if(count _anims == 0) exitWith {}; - _pos = [_pos select 0, _pos select 1, (_pos select 2) + _offset]; + _anims = []; + _offset = 0; + _curWeapon = currentWeapon _unit; + _curWeaponType = 0; + if(primaryWeapon _unit != "" && {primaryWeapon _unit == _curWeapon}) then { + _curWeaponType = 1; + }; + if(handgunWeapon _unit != "" && {handgunWeapon _unit == _curWeapon}) then { + _curWeaponType = 2; + }; + if(secondaryWeapon _unit != "" && {secondaryWeapon _unit == _curWeapon}) exitWith { + hint "Cannot throw a bolt with a heavy weapon equipped"; + }; + + switch (stance _unit) do { + case "STAND": { + _anims = [ + ["AwopPercMstpSgthWnonDnon_start", 0.833], + ["AwopPercMstpSgthWrflDnon_Start1", 1.575], + ["AwopPercMstpSgthWpstDnon_Part1", (0.533 + 1.709 + 0.505)] + ] select _curWeaponType; + _offset = 1.8; + }; + case "CROUCH": { + _anims = [ + ["AwopPknlMstpSgthWpstDnon_Part1", (0.533 + 1.709 + 0.505)], + ["AwopPknlMstpSgthWrflDnon_Start", 1.333], + ["AwopPknlMstpSgthWpstDnon_Part1", (0.533 + 1.709 + 0.505)] + ] select _curWeaponType; + _offset = 1; + }; + case "PRONE": { + _anims = [ + ["AwopPpneMstpSgthWnonDnon_start", 0.995], + ["AwopPpneMstpSgthWrflDnon_Start", 1.212], + ["AwopPpneMstpSgthWpstDnon_Part1", (0.784 + 1.5150 + 0.249)] + ] select _curWeaponType; + _offset = 0.2; + }; + default {}; + }; + if(count _anims == 0) exitWith {}; + _pos = [_pos select 0, _pos select 1, (_pos select 2) + _offset]; - _anims params ["_anim","_sleep"]; - [_unit,_anim] remoteExec ["playMove"]; - sleep _sleep; + _anims params ["_anim","_sleep"]; + [_unit,_anim] remoteExec ["playMove"]; + sleep _sleep; - _obj = createVehicle ["WeaponHolderSimulated", _pos, [], 0, "CAN_COLLIDE"]; - _obj addMagazineAmmoCargo ["HandGrenade_Stone", 1, 30]; + _obj = createVehicle ["WeaponHolderSimulated", _pos, [], 0, "CAN_COLLIDE"]; + _obj addMagazineAmmoCargo ["HandGrenade_Stone", 1, 30]; - // thanks ACE! - private _p2 = (eyePos _unit) vectorAdd (AGLToASL (positionCameraToWorld _direction)) vectorDiff (AGLToASL (positionCameraToWorld [0, 0, 0])); - private _p1 = AGLtoASL (_obj modelToWorldVisual [0, 0, 0]); + // thanks ACE! + private _p2 = (eyePos _unit) vectorAdd (AGLToASL (positionCameraToWorld _direction)) vectorDiff (AGLToASL (positionCameraToWorld [0, 0, 0])); + private _p1 = AGLtoASL (_obj modelToWorldVisual [0, 0, 0]); - private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity; - _obj setVelocity _newVelocity; - _obj addTorque [500 - random 1000, 500 - random 1000, 500 - random 1000]; + private _newVelocity = (_p1 vectorFromTo _p2) vectorMultiply _velocity; + _obj setVelocity _newVelocity; + _obj addTorque [500 - random 1000, 500 - random 1000, 500 - random 1000]; - ANOMALY_BOLT_THROW_TIME = (time + 10); - - sleep 0.25; - waitUntil {sleep 0.1; ( (velocity _obj select 0) == 0.0 && (velocity _obj select 1) == 0.0 ) }; - deleteVehicle _obj; + ANOMALY_BOLT_THROW_TIME = (time + 10); + + sleep 0.25; + waitUntil {sleep 0.1; ( (velocity _obj select 0) == 0.0 && (velocity _obj select 1) == 0.0 ) }; + deleteVehicle _obj; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/detector/fn_detector.sqf b/mod/diwako_anomalies/functions/detector/fn_detector.sqf index 3b4bbc8..c6f38bc 100644 --- a/mod/diwako_anomalies/functions/detector/fn_detector.sqf +++ b/mod/diwako_anomalies/functions/detector/fn_detector.sqf @@ -1,59 +1,59 @@ /* - Function: detector_fnc_detector + Function: detector_fnc_detector - Description: + Description: Spawns an infinite loop to detect anomalies and produce beeping sounds - Will stop if player is dead or player deactivates detector + Will stop if player is dead or player deactivates detector Parameter: Returns: nothing - Author: - diwako 2017-12-11 + Author: + diwako 2017-12-11 */ [] spawn { - _sleep = 2; - _m = 0.9 / 5; - _b = 0.1 - (_m * 5); - sleep 1: - // small wait so ace interaction window does not gobble up the title text prompt - titleText [localize "STR_Detector_turned_on", "PLAIN DOWN"]; - _lastBeep = CBA_missionTime - 10; - while {alive player && ANOMALY_DETECTOR_ACTIVE && ([player, ANOMALY_DETECTOR_ITEM] call anomaly_fnc_hasItem)} do { - _found = false; - _min = ANOMALY_DETECTION_RANGE + 4; - // add support for remote controlled units - _plr = [] call CBA_fnc_currentUnit; - { - _type = _x getVariable ["anomaly_type", nil]; - // only accept triggers that are anomalies - if(!(isNil "_type") && {!(_x getVariable "anomaly_cooldown")}) then { - _found = true; - _tmp = _x distance _plr; - if(_tmp < _min) then { - _min = _tmp; - }; - }; - } forEach (getpos _plr nearObjects ["EmptyDetector", ANOMALY_DETECTION_RANGE + 4]); - if(_found) then { - _sleep = _m * _min + _b; - if(_sleep < 0.1) then { - _sleep = 0.1; - } else { - if( _sleep > 1) then { - _sleep = 1; - }; - }; - if( (CBA_missionTime - _lastBeep) >= _sleep) then { - playSound "da_2_beep1"; - _lastBeep = CBA_missionTime; - }; - }; - sleep 0.05; - }; - ANOMALY_DETECTOR_ACTIVE = false; - titleText [localize "STR_Detector_turned_off", "PLAIN DOWN"]; + private _sleep = 2; + private _m = 0.9 / 5; + private _b = 0.1 - (_m * 5); + sleep 1: + // small wait so ace interaction window does not gobble up the title text prompt + titleText [localize "STR_Detector_turned_on", "PLAIN DOWN"]; + private _lastBeep = CBA_missionTime - 10; + while {alive player && ANOMALY_DETECTOR_ACTIVE && ([player, ANOMALY_DETECTOR_ITEM] call anomaly_fnc_hasItem)} do { + private _found = false; + private _min = ANOMALY_DETECTION_RANGE + 4; + // add support for remote controlled units + private _plr = [] call CBA_fnc_currentUnit; + { + _type = _x getVariable ["anomaly_type", nil]; + // only accept triggers that are anomalies + if(!(isNil "_type") && {!(_x getVariable "anomaly_cooldown")}) then { + _found = true; + _tmp = _x distance _plr; + if(_tmp < _min) then { + _min = _tmp; + }; + }; + } forEach (getpos _plr nearObjects ["EmptyDetector", ANOMALY_DETECTION_RANGE + 4]); + if(_found) then { + _sleep = _m * _min + _b; + if(_sleep < 0.1) then { + _sleep = 0.1; + } else { + if( _sleep > 1) then { + _sleep = 1; + }; + }; + if( (CBA_missionTime - _lastBeep) >= _sleep) then { + playSound "da_2_beep1"; + _lastBeep = CBA_missionTime; + }; + }; + sleep 0.05; + }; + ANOMALY_DETECTOR_ACTIVE = false; + titleText [localize "STR_Detector_turned_off", "PLAIN DOWN"]; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/effects/anomalies/fn_burner.sqf b/mod/diwako_anomalies/functions/effects/anomalies/fn_burner.sqf index 6c5fc3a..3f47cbf 100644 --- a/mod/diwako_anomalies/functions/effects/anomalies/fn_burner.sqf +++ b/mod/diwako_anomalies/functions/effects/anomalies/fn_burner.sqf @@ -1,33 +1,33 @@ -params[["_obj",objNull],["_source",objNull],["_state","idle"]]; +params[["_source",objNull],["_state","idle"]]; -if(isNull _obj || isNull _source) exitWith {}; +if(isNull _source) exitWith {}; switch (_state) do { - case "idle": { - _source setParticleCircle [3, [0, 0, 0]]; - _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 1, 10, [0, 0, 0], [0, 0, 0.25], 0, 10, 7.9, 0, [2, 2, 0.01], [[0.1, 0.1, 0.1, 0.5]], [0.08], 1, 0, "", "", _obj]; - _source setDropInterval 0.1; - }; - case "active": { - if(isClass (configfile >> "CfgCloudlets" >> "ace_cookoff_CookOff")) then { - _source setParticleClass "ace_cookoff_CookOff"; - } else { - _source setParticleCircle [0, [2,2,2]]; - _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal",16,0,32,0],"","billboard",1,1, - [0,0,0], //position - [0,0,4], //move velocity - 1, //rotationVelocity - 0.4, //weight - 0.45, //volume - 0, // rubbing - [0.01,0.5,1,1,1.5,0.01,0.001], //size - [[1,1,1,-4],[1,1,1,-3],[1,1,1,-2],[1,1,1,-1],[1,1,1,0]], //color - [1], 0.01, 0.02, "", "", "",0,true,0.6,[[3,3,3,0]]]; - _source setParticleRandom [0, [0,0,0], [0,0,0], 0, 0, [0,0,0,0], 5, 1, 0.2]; - // _source setParticleFire [0.6*2, 0.25*2, 0.1]; - _source setDropInterval 0.004; - }; - }; - default { }; -}; + case "idle": { + _source setParticleCircle [3, [0, 0, 0]]; + _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 1, 10, [0, 0, 0], [0, 0, 0.25], 0, 10, 7.9, 0, [2, 2, 0.01], [[0.1, 0.1, 0.1, 0.5]], [0.08], 1, 0, "", "", _source]; + _source setDropInterval 0.1; + }; + case "active": { + if(isClass (configfile >> "CfgCloudlets" >> "ace_cookoff_CookOff")) then { + _source setParticleClass "ace_cookoff_CookOff"; + } else { + _source setParticleCircle [0, [2,2,2]]; + _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal",16,0,32,0],"","billboard",1,1, + [0,0,0], //position + [0,0,4], //move velocity + 1, //rotationVelocity + 0.4, //weight + 0.45, //volume + 0, // rubbing + [0.01,0.5,1,1,1.5,0.01,0.001], //size + [[1,1,1,-4],[1,1,1,-3],[1,1,1,-2],[1,1,1,-1],[1,1,1,0]], //color + [1], 0.01, 0.02, "", "", "",0,true,0.6,[[3,3,3,0]]]; + _source setParticleRandom [0, [0,0,0], [0,0,0], 0, 0, [0,0,0,0], 5, 1, 0.2]; + // _source setParticleFire [0.6*2, 0.25*2, 0.1]; + _source setDropInterval 0.004; + }; + }; + default { }; +}; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/effects/anomalies/fn_electra.sqf b/mod/diwako_anomalies/functions/effects/anomalies/fn_electra.sqf index c0803dd..395a7d7 100644 --- a/mod/diwako_anomalies/functions/effects/anomalies/fn_electra.sqf +++ b/mod/diwako_anomalies/functions/effects/anomalies/fn_electra.sqf @@ -1,13 +1,13 @@ -params[["_obj",objNull],["_source",objNull],["_state","idle"]]; +params[["_source",objNull],["_state","idle"]]; -if(isNull _obj || isNull _source) exitWith {}; +if(isNull _source) exitWith {}; switch (_state) do { - case "idle": { - _source setParticleCircle [2, [0, 0, 0]]; - _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\blesk1", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0, 0], [0, 0, 0], 0, 10, 7.9, 0.005, [0.05, 0.05, 0.05], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _obj]; - _source setDropInterval 0.2; - }; - default {}; + case "idle": { + _source setParticleCircle [2, [0, 0, 0]]; + _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\blesk1", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0, 0], [0, 0, 0], 0, 10, 7.9, 0.005, [0.05, 0.05, 0.05], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _source]; + _source setDropInterval 0.2; + }; + default {}; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/effects/anomalies/fn_fog.sqf b/mod/diwako_anomalies/functions/effects/anomalies/fn_fog.sqf index 7c29e98..4e9643c 100644 --- a/mod/diwako_anomalies/functions/effects/anomalies/fn_fog.sqf +++ b/mod/diwako_anomalies/functions/effects/anomalies/fn_fog.sqf @@ -1,55 +1,54 @@ -params[["_obj",objNull],["_source",objNull],["_state","idle"]]; +params[["_source",objNull],["_state","idle"],["_trg", objNull]]; -if(isNull _obj || isNull _source) exitWith {}; +if(isNull _source || isNull _trg) exitWith {}; switch (_state) do { - case "idle": { - private _trg = _obj getVariable "anomaly_trigger"; - private _area = triggerArea _trg; - private _radius = (_area#0) - 1; - private _angle = _area#2; - private _rectangle = _area#3; - if(_rectangle) then { - _source setParticleCircle [0, [0, 0, 0]]; - _source setParticleRandom [0, [_radius, _radius, 0], [0.01, 0.01, 0], 0, 0, [0, 0, 0, 0], 0, 0]; - } else { - _source setParticleCircle [_radius/2, [0, 0, 0]]; - _source setParticleRandom [0, [_radius/2, _radius/2, 0], [0.01, 0.01, 0], 0, 0, [0, 0, 0, 0], 0, 0]; - }; - _source setParticleParams [ - [ - "\A3\data_f\cl_basic", //particleShape - 1, //particleFSNtieth - 0, //particleFSIndex - 1 //particleFSFrameCount - //true //particleFSLoop - ], - "", //animationName - "Billboard", //particleType, /*String - Enum: Billboard, SpaceObject*/ - 1, //timerPeriod - 50, //lifeTime - [0, 0, 2], //position, /*3D Array of numbers as relative position to particleSource or (if object at index 18 is set) object. Or (if object at index 18 is set) String as memoryPoint of object.*/ - [0, 0, 0], //moveVelocity, /*3D Array of numbers.*/ - 0, //rotationVelocity - 10.075125, //weight - // 10.078125, //weight - 7.9, //volume - 0, //rubbing - [0.01, 5, 5, 0.01], //size array of numbers - [[(249/255), (248/255), (242/255), ((1/_radius) max 0.1)]], //color rgba array of rgba - // [[1, 1, 1, ((1/_radius) max 0.1)]], //color rgba array of rgba - [1], //animation speed array of numbers - 1, //randomDirectionPeriod - 0, //randomDirectionIntensity - "", //onTimerScript - "", //beforeDestroyScript - _obj, //object to attach to - _angle //angle, /*Optional Number - Default: 0*/ - //false, //onSurface - //0 //bounceOnSurface number - //[] // emmision colors array or rgba - ]; - private _dropSpeed = (1/_radius) max 0.01; - _source setDropInterval _dropSpeed; - }; - default { }; + case "idle": { + private _area = triggerArea _trg; + private _radius = (_area#0) - 1; + private _angle = _area#2; + private _rectangle = _area#3; + if(_rectangle) then { + _source setParticleCircle [0, [0, 0, 0]]; + _source setParticleRandom [0, [_radius, _radius, 0], [0.01, 0.01, 0], 0, 0, [0, 0, 0, 0], 0, 0]; + } else { + _source setParticleCircle [_radius/2, [0, 0, 0]]; + _source setParticleRandom [0, [_radius/2, _radius/2, 0], [0.01, 0.01, 0], 0, 0, [0, 0, 0, 0], 0, 0]; + }; + _source setParticleParams [ + [ + "\A3\data_f\cl_basic", //particleShape + 1, //particleFSNtieth + 0, //particleFSIndex + 1 //particleFSFrameCount + //true //particleFSLoop + ], + "", //animationName + "Billboard", //particleType, /*String - Enum: Billboard, SpaceObject*/ + 1, //timerPeriod + 50, //lifeTime + [0, 0, 2], //position, /*3D Array of numbers as relative position to particleSource or (if object at index 18 is set) object. Or (if object at index 18 is set) String as memoryPoint of object.*/ + [0, 0, 0], //moveVelocity, /*3D Array of numbers.*/ + 0, //rotationVelocity + 10.075125, //weight + // 10.078125, //weight + 7.9, //volume + 0, //rubbing + [0.01, 5, 5, 0.01], //size array of numbers + [[(249/255), (248/255), (242/255), ((1/_radius) max 0.1)]], //color rgba array of rgba + // [[1, 1, 1, ((1/_radius) max 0.1)]], //color rgba array of rgba + [1], //animation speed array of numbers + 1, //randomDirectionPeriod + 0, //randomDirectionIntensity + "", //onTimerScript + "", //beforeDestroyScript + _source, //object to attach to + _angle //angle, /*Optional Number - Default: 0*/ + //false, //onSurface + //0 //bounceOnSurface number + //[] // emmision colors array or rgba + ]; + private _dropSpeed = (1/_radius) max 0.01; + _source setDropInterval _dropSpeed; + }; + default { }; }; diff --git a/mod/diwako_anomalies/functions/effects/anomalies/fn_fruitPunch.sqf b/mod/diwako_anomalies/functions/effects/anomalies/fn_fruitPunch.sqf index 266f93d..6b8f619 100644 --- a/mod/diwako_anomalies/functions/effects/anomalies/fn_fruitPunch.sqf +++ b/mod/diwako_anomalies/functions/effects/anomalies/fn_fruitPunch.sqf @@ -1,19 +1,19 @@ -params[["_obj",objNull],["_source",objNull],["_state","idle"]]; +params[["_source",objNull],["_state","idle"]]; -if(isNull _obj || isNull _source) exitWith {}; +if(isNull _source) exitWith {}; switch (_state) do { - case "idle": { - _source setParticleCircle [0, [0, 0, 0]]; - _source setParticleRandom [0, [0.5, 0.5, 0], [0.175, 0.175, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 1, 1, [0, 0, 0], [0, 0, 0.25], 0, 10, 7.9, 0, [0.125,0.125, 0.01], [[0.1, 1, 0.1, 1]], [0.08], 1, 0, "", "", _obj,0,false,0,[[0.1, 1, 0.1, 1]]]; - _source setDropInterval 0.75; - }; - case "active": { - _source setParticleCircle [0, [0, 0, 0]]; - _source setParticleRandom [0, [0.5, 0.5, 0], [1, 1, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 1, 1, [0, 0, 0], [0, 0, 2], 0, 10, 7.9, 0, [0.125,0.125, 0.01], [[0.1, 1, 0.1, 1]], [0.08], 1, 0, "", "", _obj,0,false,0,[[0.1, 1, 0.1, 1]]]; - _source setDropInterval 0.1; - }; - default { }; + case "idle": { + _source setParticleCircle [0, [0, 0, 0]]; + _source setParticleRandom [0, [0.5, 0.5, 0], [0.175, 0.175, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 1, 1, [0, 0, 0], [0, 0, 0.25], 0, 10, 7.9, 0, [0.125,0.125, 0.01], [[0.1, 1, 0.1, 1]], [0.08], 1, 0, "", "", _source,0,false,0,[[0.1, 1, 0.1, 1]]]; + _source setDropInterval 0.75; + }; + case "active": { + _source setParticleCircle [0, [0, 0, 0]]; + _source setParticleRandom [0, [0.5, 0.5, 0], [1, 1, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 1, 1, [0, 0, 0], [0, 0, 2], 0, 10, 7.9, 0, [0.125,0.125, 0.01], [[0.1, 1, 0.1, 1]], [0.08], 1, 0, "", "", _source,0,false,0,[[0.1, 1, 0.1, 1]]]; + _source setDropInterval 0.1; + }; + default { }; }; diff --git a/mod/diwako_anomalies/functions/effects/anomalies/fn_meatgrinder.sqf b/mod/diwako_anomalies/functions/effects/anomalies/fn_meatgrinder.sqf index d91132a..7286dab 100644 --- a/mod/diwako_anomalies/functions/effects/anomalies/fn_meatgrinder.sqf +++ b/mod/diwako_anomalies/functions/effects/anomalies/fn_meatgrinder.sqf @@ -1,19 +1,19 @@ -params[["_obj",objNull],["_source",objNull],["_state","idle"]]; +params[["_source",objNull],["_state","idle"]]; -if(isNull _obj || isNull _source) exitWith {}; +if(isNull _source) exitWith {}; switch (_state) do { - case "idle": { - _source setParticleCircle [2, [0, 0, 0]]; - _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.5, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\cl_leaf", 1, 0, 1], "", "SpaceObject", 1, 7, [0, 0, 0], [0, 0, 0.5], 0, 10, 7.9, 0.075, [2, 2, 0.01], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [6, 5, 5], 1, 0, "", "", _obj]; - _source setDropInterval 0.2; - }; - case "meat": { - _source setParticleCircle [0, [0, 0, 0]]; - _source setParticleRandom [0, [0.25, 0.25, 0], [3, 3, 5], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Meat_ca.p3d", 1, 0, 1], "", "SpaceObject", 0.5, 5, [0, 0, 0.5], [0, 0, 10], 0.5, 50, 7.9, 0.075, [10, 10, 10], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _obj,0,true,0.1]; - _source setDropInterval 0.1; - }; - default { }; + case "idle": { + _source setParticleCircle [2, [0, 0, 0]]; + _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.5, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\cl_leaf", 1, 0, 1], "", "SpaceObject", 1, 7, [0, 0, 0], [0, 0, 0.5], 0, 10, 7.9, 0.075, [2, 2, 0.01], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [6, 5, 5], 1, 0, "", "", _source]; + _source setDropInterval 0.2; + }; + case "meat": { + _source setParticleCircle [0, [0, 0, 0]]; + _source setParticleRandom [0, [0.25, 0.25, 0], [3, 3, 5], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Meat_ca.p3d", 1, 0, 1], "", "SpaceObject", 0.5, 5, [0, 0, 0.5], [0, 0, 10], 0.5, 50, 7.9, 0.075, [10, 10, 10], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _source,0,true,0.1]; + _source setDropInterval 0.1; + }; + default { }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/effects/anomalies/fn_springboard.sqf b/mod/diwako_anomalies/functions/effects/anomalies/fn_springboard.sqf index 0d8a79f..2609a1e 100644 --- a/mod/diwako_anomalies/functions/effects/anomalies/fn_springboard.sqf +++ b/mod/diwako_anomalies/functions/effects/anomalies/fn_springboard.sqf @@ -1,19 +1,19 @@ -params[["_obj",objNull],["_source",objNull],["_state","idle"]]; +params[["_source",objNull],["_state","idle"]]; -if(isNull _obj || isNull _source) exitWith {}; +if(isNull _source) exitWith {}; switch (_state) do { - case "idle": { - _source setParticleCircle [2, [0, 0, 0]]; - _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.5, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\cl_leaf", 1, 0, 1], "", "SpaceObject", 1, 7, [0, 0, 0], [0, 0, 0.5], 0, 10, 7.9, 0.075, [2, 2, 0.01], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [6, 5, 5], 1, 0, "", "", _obj]; - _source setDropInterval 0.2; - }; - case "active": { - _source setParticleCircle [0, [0, 0, 0]]; - _source setParticleRandom [0, [0.25, 0.25, 0], [0, 0, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; - _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 2, 1, [0, 0, 1], [0, 0, 0], 0, 10, 7.9, 0.075, [0, 10, 5], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _obj]; - _source setDropInterval 0.05; - }; - default { }; + case "idle": { + _source setParticleCircle [2, [0, 0, 0]]; + _source setParticleRandom [0, [0.25, 0.25, 0], [0.175, 0.175, 0], 0, 0.5, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\cl_leaf", 1, 0, 1], "", "SpaceObject", 1, 7, [0, 0, 0], [0, 0, 0.5], 0, 10, 7.9, 0.075, [2, 2, 0.01], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [6, 5, 5], 1, 0, "", "", _source]; + _source setDropInterval 0.2; + }; + case "active": { + _source setParticleCircle [0, [0, 0, 0]]; + _source setParticleRandom [0, [0.25, 0.25, 0], [0, 0, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0]; + _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d", 1, 0, 1], "", "Billboard", 2, 1, [0, 0, 1], [0, 0, 0], 0, 10, 7.9, 0.075, [0, 10, 5], [[0.1, 0.1, 0.1, 1], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.08], 1, 0, "", "", _source]; + _source setDropInterval 0.05; + }; + default { }; }; \ No newline at end of file diff --git a/mod/diwako_anomalies/functions/effects/anomalies/fn_teleport.sqf b/mod/diwako_anomalies/functions/effects/anomalies/fn_teleport.sqf index b08f75d..c6b22fc 100644 --- a/mod/diwako_anomalies/functions/effects/anomalies/fn_teleport.sqf +++ b/mod/diwako_anomalies/functions/effects/anomalies/fn_teleport.sqf @@ -1,11 +1,11 @@ -params[["_obj",objNull],["_source",objNull],["_state","idle"]]; +params[["_source",objNull],["_state","idle"]]; -if(isNull _obj || isNull _source) exitWith {}; +if(isNull _source) exitWith {}; switch (_state) do { - case "idle": { - _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d",1,0,1,0],"","Billboard",1, 1, [0,0,.4],[0,0,1],0,1,1,0,[.25,3,.25,0],[[1,1,1,1],[1,1,1,1]],[1.5,0.5],0,0,"","",_obj]; + case "idle": { + _source setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract.p3d",1,0,1,0],"","Billboard",1, 1, [0,0,.4],[0,0,1],0,1,1,0,[.25,3,.25,0],[[1,1,1,1],[1,1,1,1]],[1.5,0.5],0,0,"","",_source]; _source setDropInterval .1; - }; - default { }; + }; + default { }; }; \ No newline at end of file From 11ccb9151a9fb3826dc342e60ce63db36c25d200 Mon Sep 17 00:00:00 2001 From: diwako Date: Mon, 5 Oct 2020 13:56:59 +0200 Subject: [PATCH 2/4] Detector beeping volume Some small fixes --- mod/diwako_anomalies/cfgSounds.hpp | 24 +++++++++++++++ .../functions/anomalies/fn_activateBurner.sqf | 2 +- .../functions/anomalies/fn_createTeleport.sqf | 3 +- .../functions/anomalies/fn_init.sqf | 30 +++++++++++++++++-- .../functions/detector/fn_detector.sqf | 8 ++++- mod/diwako_anomalies/stringtable.xml | 10 +++++++ 6 files changed, 71 insertions(+), 6 deletions(-) diff --git a/mod/diwako_anomalies/cfgSounds.hpp b/mod/diwako_anomalies/cfgSounds.hpp index 4fa4e65..e50fee1 100644 --- a/mod/diwako_anomalies/cfgSounds.hpp +++ b/mod/diwako_anomalies/cfgSounds.hpp @@ -55,6 +55,30 @@ class cfgSounds { sound[] = {"diwako_anomalies\sounds\detector\da-2_beep1.ogg", 1, 1, 20}; titles[] = {}; }; + class da_2_beep1_low_1 + { + name = "da_2_beep1_low_1"; + sound[] = {"diwako_anomalies\sounds\detector\da-2_beep1.ogg", 0.75, 1, 20}; + titles[] = {}; + }; + class da_2_beep1_low_2 + { + name = "da_2_beep1_low_2"; + sound[] = {"diwako_anomalies\sounds\detector\da-2_beep1.ogg", 0.5, 1, 20}; + titles[] = {}; + }; + class da_2_beep1_high_1 + { + name = "da_2_beep1_high_1"; + sound[] = {"diwako_anomalies\sounds\detector\da-2_beep1.ogg", 2, 1, 20}; + titles[] = {}; + }; + class da_2_beep1_high_2 + { + name = "da_2_beep1_high_2"; + sound[] = {"diwako_anomalies\sounds\detector\da-2_beep1.ogg", 3, 1, 20}; + titles[] = {}; + }; class electra_idle1 { name = "electra_idle1"; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf b/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf index 2d43f08..6ae6271 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_activateBurner.sqf @@ -31,7 +31,7 @@ if(hasInterface) then { [_source, "active"] call anomalyEffect_fnc_burner; [_source2, "active"] call anomalyEffect_fnc_burner; - private _light = "#lightpoint" createVehicleLocal (getpos _proxy); + _light = "#lightpoint" createVehicleLocal (getpos _proxy); _light setLightBrightness 2; _light setLightAmbient [1, 0.6, 0.6]; _light setLightColor [1, 0.6, 0.6]; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf b/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf index 136711f..85cb41a 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_createTeleport.sqf @@ -22,7 +22,6 @@ if(typeName _pos != typeName []) then { _id = _pos getVariable ["anomalyid",-1]; _pos = [_pos] call anomaly_fnc_getLocationFromModule; }; -systemChat format ["Teleporter ID: %1 | %2", _id, typeName _id]; if(count _pos < 3) then { _pos set [2,0]; @@ -42,7 +41,7 @@ if( (count _teleporters) >= 2) exitWith { hintC ("Teleport Anomaly with ID " + str(_id) + " cannot be created as there are already 2 anomalies with that id. Affected anomaly at " + str(_pos)); }; -_trg = createTrigger ["EmptyDetector", _pos]; +private _trg = createTrigger ["EmptyDetector", _pos]; _trg setPosATL _pos; _teleporters pushBack _trg; [ANOMALY_TELEPORT_IDS, _id, _teleporters] call CBA_fnc_hashSet; diff --git a/mod/diwako_anomalies/functions/anomalies/fn_init.sqf b/mod/diwako_anomalies/functions/anomalies/fn_init.sqf index 4c80fde..a931943 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_init.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_init.sqf @@ -80,6 +80,7 @@ ANOMALY_BOLT_ITEM = ""; /*== DO NOT EDIT Below unless you know what you are doing! ==*/ ACTIVE_ANOMALIES = []; ANOMALY_DETECTOR_ACTIVE = false; +ANOMALY_DETECTOR_VOLUME = 0; ANOMALY_BOLT_THROW_TIME = (time - 1); enableCamShake true; @@ -176,14 +177,14 @@ if(isNil "ANOMALIES_HOLDER") then { }, 5, [] ] call CBA_fnc_addPerFrameHandler; if(!isNil "ace_interact_menu_fnc_createAction") then { - _action = ["anomaly_detector",(localize "STR_anomaly_enable_detector"),"",{ + _action = ["anomaly_detector_on",(localize "STR_anomaly_enable_detector"),"",{ ANOMALY_DETECTOR_ACTIVE = true; [] call anomalyDetector_fnc_detector; },{!ANOMALY_DETECTOR_ACTIVE && [player, ANOMALY_DETECTOR_ITEM] call anomaly_fnc_hasItem},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; [typeOf player, 1, ["ACE_SelfActions", "ACE_Equipment"], _action] call ace_interact_menu_fnc_addActionToClass; - _action = ["anomaly_detector",(localize "STR_anomaly_disable_detector"),"",{ + _action = ["anomaly_detector_off",(localize "STR_anomaly_disable_detector"),"",{ ANOMALY_DETECTOR_ACTIVE = false; },{ANOMALY_DETECTOR_ACTIVE},{},[], [0,0,0], 100] call ace_interact_menu_fnc_createAction; @@ -212,6 +213,31 @@ if(!isNil "ace_interact_menu_fnc_createAction") then { }; }; +[ANOMALY_DETECTOR_ITEM, "CONTAINER", localize "STR_anomaly_enable_detector", nil, nil, + [{!ANOMALY_DETECTOR_ACTIVE}, {!ANOMALY_DETECTOR_ACTIVE}], { + ANOMALY_DETECTOR_ACTIVE = true; + [] call anomalyDetector_fnc_detector; + false +}, false] call CBA_fnc_addItemContextMenuOption; + +[ANOMALY_DETECTOR_ITEM, "CONTAINER", localize "STR_anomaly_disable_detector", nil, nil, + [{ANOMALY_DETECTOR_ACTIVE}, {ANOMALY_DETECTOR_ACTIVE}], { + ANOMALY_DETECTOR_ACTIVE = false; + false +}, false] call CBA_fnc_addItemContextMenuOption; + +[ANOMALY_DETECTOR_ITEM, "CONTAINER", localize "STR_anomaly_detector_increase_volume", nil, nil, + [{ANOMALY_DETECTOR_VOLUME < 2}, {ANOMALY_DETECTOR_ACTIVE}], { + ANOMALY_DETECTOR_VOLUME = ANOMALY_DETECTOR_VOLUME + 1; + false +}, false] call CBA_fnc_addItemContextMenuOption; + +[ANOMALY_DETECTOR_ITEM, "CONTAINER", localize "STR_anomaly_detector_decrease_volume", nil, nil, + [{ANOMALY_DETECTOR_VOLUME > -2}, {ANOMALY_DETECTOR_ACTIVE}], { + ANOMALY_DETECTOR_VOLUME = ANOMALY_DETECTOR_VOLUME - 1; + false +}, false] call CBA_fnc_addItemContextMenuOption; + // add Ares modules for zeus if(!isNil "Ares_fnc_RegisterCustomModule") then { ["Stalker Anomalies", "Spawn Anomaly", diff --git a/mod/diwako_anomalies/functions/detector/fn_detector.sqf b/mod/diwako_anomalies/functions/detector/fn_detector.sqf index c6f38bc..4f6c40d 100644 --- a/mod/diwako_anomalies/functions/detector/fn_detector.sqf +++ b/mod/diwako_anomalies/functions/detector/fn_detector.sqf @@ -48,7 +48,13 @@ }; }; if( (CBA_missionTime - _lastBeep) >= _sleep) then { - playSound "da_2_beep1"; + switch (ANOMALY_DETECTOR_VOLUME) do { + case 1: { playSound "da_2_beep1_high_1"; }; + case 2: { playSound "da_2_beep1_high_2"; }; + case -1: { playSound "da_2_beep1_low_1"; }; + case -2: { playSound "da_2_beep1_low_2"; }; + default { playSound "da_2_beep1"; }; + }; _lastBeep = CBA_missionTime; }; }; diff --git a/mod/diwako_anomalies/stringtable.xml b/mod/diwako_anomalies/stringtable.xml index a69e87d..b458f4b 100644 --- a/mod/diwako_anomalies/stringtable.xml +++ b/mod/diwako_anomalies/stringtable.xml @@ -209,6 +209,16 @@ Anomalien Detektor ausschalten Выкл. Детектор Аномалий + + Increase volume + Increase volume + Lautstärke erhöhen + + + Decrease volume + Decrease volume + Lautstärke verringern + Bag of bolts Bag of bolts From 7371cabb0ecd640d87b78923493a15b1bfbb8282 Mon Sep 17 00:00:00 2001 From: diwako Date: Mon, 5 Oct 2020 14:18:33 +0200 Subject: [PATCH 3/4] Tabs removal --- mod/diwako_anomalies/functions/anomalies/fn_init.sqf | 10 +++++----- mod/diwako_anomalies/stringtable.xml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mod/diwako_anomalies/functions/anomalies/fn_init.sqf b/mod/diwako_anomalies/functions/anomalies/fn_init.sqf index a931943..c6d5ff0 100644 --- a/mod/diwako_anomalies/functions/anomalies/fn_init.sqf +++ b/mod/diwako_anomalies/functions/anomalies/fn_init.sqf @@ -117,17 +117,17 @@ if(isNil "ANOMALIES_HOLDER") then { switch (_type) do { case "meatgrinder": {_arr call anomalyEffect_fnc_meatgrinder;}; case "springboard": {_arr call anomalyEffect_fnc_springboard;}; - case "burner": {_arr call anomalyEffect_fnc_burner;}; - case "teleport": {_arr call anomalyEffect_fnc_teleport;}; - case "fog": {[_source, "idle", _x] call anomalyEffect_fnc_fog;}; - case "electra": { + case "burner": {_arr call anomalyEffect_fnc_burner;}; + case "teleport": {_arr call anomalyEffect_fnc_teleport;}; + case "fog": {[_source, "idle", _x] call anomalyEffect_fnc_fog;}; + case "electra": { if(!(_x getVariable ["anomaly_cooldown", false])) then { _arr call anomalyEffect_fnc_electra; } else { deleteVehicle _source; }; }; - case "fruitpunch": {_arr call anomalyEffect_fnc_fruitPunch;}; + case "fruitpunch": {_arr call anomalyEffect_fnc_fruitPunch;}; default { }; }; _x setVariable ["anomaly_particle_source", _source]; diff --git a/mod/diwako_anomalies/stringtable.xml b/mod/diwako_anomalies/stringtable.xml index b458f4b..5268bf5 100644 --- a/mod/diwako_anomalies/stringtable.xml +++ b/mod/diwako_anomalies/stringtable.xml @@ -1,6 +1,6 @@ - + @@ -345,5 +345,5 @@ Ab welcher Entfernung sollen die Anomalien aktivierbar sein? Eine hohe Zahl kann bei Spielern zu Performance Problemen führen, während eine zu niedrige Zahl dazu führen kann, dass Anomalien nicht rechtzeitig aktiviert werden. Dies kann vorallem mit schnell fahrenden Fahrzeugen passieren! - + From 838dbe8e60c39ef46d58127345b5a14a6a40e857 Mon Sep 17 00:00:00 2001 From: diwako Date: Wed, 7 Oct 2020 20:18:28 +0200 Subject: [PATCH 4/4] use latest arma version --- mod/diwako_anomalies/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/diwako_anomalies/config.cpp b/mod/diwako_anomalies/config.cpp index 581664f..0aad465 100644 --- a/mod/diwako_anomalies/config.cpp +++ b/mod/diwako_anomalies/config.cpp @@ -10,7 +10,7 @@ "AnomalyDetector", "BagOfBolts" }; - requiredVersion = 1.82; + requiredVersion = 1.98; requiredAddons[] = { "cba_xeh", "cba_common"