From 81092df1d438557b0765d818f61f465fd548332c Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Tue, 21 Jan 2025 23:20:43 +0000 Subject: [PATCH] ChaosMod: Implement EffectCategory & major cleanup --- ChaosMod/Components/DebugMenu.cpp | 17 +- ChaosMod/Components/DebugMenu.h | 6 +- ChaosMod/Components/DebugSocket.cpp | 27 ++-- ChaosMod/Components/EffectDispatcher.cpp | 123 +++++++------- ChaosMod/Components/EffectDispatcher.h | 12 +- ChaosMod/Components/EffectShortcuts.cpp | 5 +- ChaosMod/Components/EffectShortcuts.h | 1 - ChaosMod/Components/LuaScripts.cpp | 9 +- ChaosMod/Components/Voting.cpp | 96 ++++++----- ChaosMod/Components/Voting.h | 16 +- .../Condition/ConditionVotingEnabled.cpp | 11 ++ ChaosMod/Effects/Condition/EffectCondition.h | 64 ++++++++ ChaosMod/Effects/Effect.h | 151 ------------------ ChaosMod/Effects/EffectAttributes.h | 2 - ChaosMod/Effects/EffectConfig.h | 35 ++-- ChaosMod/Effects/EffectData.h | 28 ++-- ChaosMod/Effects/EffectIdentifier.h | 16 +- ChaosMod/Effects/EffectThreads.h | 2 +- ChaosMod/Effects/EnabledEffects.h | 41 +++++ ChaosMod/Effects/EnabledEffectsMap.h | 22 --- ChaosMod/Effects/Register/RegisterEffect.h | 41 +++++ ChaosMod/Effects/Register/RegisteredEffects.h | 105 ++++++++++++ .../RegisteredEffectsMetadata.h} | 10 +- .../Effects/db/Meta/MetaAdditionalEffects.cpp | 3 +- .../Effects/db/Meta/MetaEffectDuration.cpp | 5 +- ChaosMod/Effects/db/Meta/MetaHideChaosUI.cpp | 3 +- ChaosMod/Effects/db/Meta/MetaNoChaos.cpp | 3 +- ChaosMod/Effects/db/Meta/MetaReInvoke.cpp | 7 +- ChaosMod/Effects/db/Meta/MetaTimerSpeed.cpp | 7 +- ChaosMod/Effects/db/Misc/MiscAirstrike.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscBlackHole.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscBlackout.cpp | 4 +- .../Effects/db/Misc/MiscBoostVelocity.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscCloneOnDeath.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscCocktail.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscEarthquake.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscEsp.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscFakeCrash.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscFireworks.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscFlamethrower.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscFpsLimit.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscGetTowed.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscGhostWorld.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscGoToJail.cpp | 3 +- .../Effects/db/Misc/MiscGravityController.cpp | 13 +- ChaosMod/Effects/db/Misc/MiscHighPitch.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscIntenseMusic.cpp | 4 +- .../Effects/db/Misc/MiscInvertVelocity.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscJumpyProps.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscLag.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscLowPitch.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscLowPoly.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscMeteorRain.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscMidasTouch.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscMoneyRain.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscMuffledAudio.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscNewsTeam.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscNoPhone.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscNoSky.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscNoWater.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscNoWaypoint.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscNothing.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscOilLeaks.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscOneShot.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscPause.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscPayRespects.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscPortraitMode.cpp | 4 +- .../Effects/db/Misc/MiscQuickSprunkStop.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscRainbowWeps.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscRampJam.cpp | 3 +- .../Effects/db/Misc/MiscRandomWaypoint.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscRollCredits.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscSolidProps.cpp | 4 +- .../Effects/db/Misc/MiscSpawnController.cpp | 6 +- .../Effects/db/Misc/MiscSpawnOrangeBall.cpp | 4 +- .../Effects/db/Misc/MiscSpinningProps.cpp | 4 +- ChaosMod/Effects/db/Misc/MiscStuffGuns.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscSuperStunt.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscTotalChaos.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscUTurn.cpp | 6 +- ChaosMod/Effects/db/Misc/MiscVehicleRain.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscWeirdPitch.cpp | 3 +- ChaosMod/Effects/db/Misc/MiscWhaleRain.cpp | 3 +- .../Effects/db/Misc/MiscWitnessProtection.cpp | 3 +- .../Effects/db/Peds/Peds2xAnimationSpeed.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsAimbot.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsAttackPlayer.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsBlind.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsBloody.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsBusBois.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsCatGuns.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsCops.cpp | 4 +- .../Effects/db/Peds/PedsDriveBackwards.cpp | 4 +- .../Effects/db/Peds/PedsDrivebyPlayer.cpp | 4 +- .../Effects/db/Peds/PedsEternalScreams.cpp | 4 +- .../db/Peds/PedsEveryoneWepController.cpp | 15 +- ChaosMod/Effects/db/Peds/PedsExitVeh.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsExplosive.cpp | 4 +- .../Effects/db/Peds/PedsExplosiveCombat.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsFlipAll.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsFollowPlayer.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsFrozen.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsGiveProps.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsGrappleGuns.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsGunsmoke.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsHandsUp.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsHeadless.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsHotCougars.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsIgniteNearby.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsInTheHood.cpp | 4 +- .../Effects/db/Peds/PedsIntoRandomVehs.cpp | 4 +- .../Effects/db/Peds/PedsInvinciblePeds.cpp | 4 +- .../Effects/db/Peds/PedsInvisiblePeds.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsJamesBond.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsJumpy.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsKillerClowns.cpp | 4 +- .../Effects/db/Peds/PedsLaunchNearbyPeds.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsLooseTrigger.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsMercenaries.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsMinDamage.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsMinions.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsMowerMates.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsNailguns.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsNearbyFlee.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsNoRagdoll.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsNotMenendez.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsOHKO.cpp | 4 +- .../Effects/db/Peds/PedsObliterateNearby.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsPhones.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsPropHunt.cpp | 4 +- .../Effects/db/Peds/PedsQuarrelingCouple.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsRagdoll.cpp | 4 +- .../Effects/db/Peds/PedsRagdollOnTouch.cpp | 4 +- .../Effects/db/Peds/PedsReflectiveDamage.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsReviveNearby.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsRiot.cpp | 3 +- .../Effects/db/Peds/PedsScooterBrothers.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsSlipperyPeds.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsSmokeTrails.cpp | 4 +- .../Effects/db/Peds/PedsSpawnAngryAlien.cpp | 4 +- .../Effects/db/Peds/PedsSpawnAngryChimp.cpp | 3 +- .../Effects/db/Peds/PedsSpawnAngryJesus.cpp | 4 +- .../Effects/db/Peds/PedsSpawnAngryJesus2.cpp | 4 +- .../Effects/db/Peds/PedsSpawnAngryJimmy.cpp | 4 +- .../Effects/db/Peds/PedsSpawnBallaSquad.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp | 3 +- .../db/Peds/PedsSpawnCompanionBrad.cpp | 4 +- .../db/Peds/PedsSpawnCompanionChimp.cpp | 4 +- .../db/Peds/PedsSpawnCompanionChop.cpp | 4 +- .../db/Peds/PedsSpawnCompanionRandom.cpp | 4 +- .../Effects/db/Peds/PedsSpawnDancingApes.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsSpawnFanCats.cpp | 4 +- .../db/Peds/PedsSpawnHostileRandom.cpp | 4 +- .../Effects/db/Peds/PedsSpawnImpotentRage.cpp | 4 +- .../Effects/db/Peds/PedsSpawnJuggernaut.cpp | 3 +- .../db/Peds/PedsSpawnRoastingLamar.cpp | 4 +- .../Effects/db/Peds/PedsSpawnSpaceRanger.cpp | 3 +- .../Effects/db/Peds/PedsSpeechController.cpp | 8 +- ChaosMod/Effects/db/Peds/PedsStopAndStare.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsStripWeapons.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsTPGuns.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsTankBois.cpp | 3 +- ChaosMod/Effects/db/Peds/PedsToast.cpp | 4 +- .../db/Peds/PedsTpRandomPedsPlayerVeh.cpp | 4 +- ChaosMod/Effects/db/Peds/PedsZombies.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerAFK.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerAimbot.cpp | 4 +- .../Effects/db/Player/PlayerAutopilot.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerBees.cpp | 4 +- .../Effects/db/Player/PlayerBlimpStrats.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerClone.cpp | 4 +- .../Effects/db/Player/PlayerCopyForce.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerDeadEye.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerDrunk.cpp | 4 +- .../Effects/db/Player/PlayerFakeDeath.cpp | 3 +- .../Effects/db/Player/PlayerFlingPlayer.cpp | 3 +- .../Effects/db/Player/PlayerForcefield.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerGTA2.cpp | 4 +- .../Effects/db/Player/PlayerGravitySphere.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerHacking.cpp | 3 +- .../Effects/db/Player/PlayerHasGravity.cpp | 3 +- .../Effects/db/Player/PlayerHeavyRecoil.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerHesoyam.cpp | 4 +- .../Effects/db/Player/PlayerIgnitePlayer.cpp | 4 +- .../db/Player/PlayerIllegalInnocence.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerImTired.cpp | 4 +- .../Effects/db/Player/PlayerInvincibility.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerJumpJump.cpp | 3 +- .../Effects/db/Player/PlayerKeepRunning.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerKickflip.cpp | 3 +- .../Effects/db/Player/PlayerLagCamera.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerLaunchUp.cpp | 4 +- .../Effects/db/Player/PlayerLockCamera.cpp | 4 +- .../Effects/db/Player/PlayerMovementSpeed.cpp | 8 +- .../Effects/db/Player/PlayerNoMovRandom.cpp | 4 +- .../Effects/db/Player/PlayerNoSpecial.cpp | 4 +- .../Effects/db/Player/PlayerNoSprintJump.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerPacifist.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerPoof.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerPoor.cpp | 4 +- ChaosMod/Effects/db/Player/PlayerRagdoll.cpp | 4 +- .../Effects/db/Player/PlayerRagdollOnShot.cpp | 3 +- .../Effects/db/Player/PlayerRandomClothes.cpp | 4 +- .../db/Player/PlayerRandomStuntJump.cpp | 3 +- .../Effects/db/Player/PlayerRandomVehSeat.cpp | 4 +- .../Effects/db/Player/PlayerRapidFire.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerRocket.cpp | 4 +- .../db/Player/PlayerSetIntoClosestVeh.cpp | 4 +- .../db/Player/PlayerSetIntoRandomVeh.cpp | 4 +- .../Effects/db/Player/PlayerSimeonSays.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerSuicide.cpp | 4 +- .../Effects/db/Player/PlayerSuperRunJump.cpp | 4 +- .../Effects/db/Player/PlayerTpController.cpp | 34 ++-- .../Effects/db/Player/PlayerTpEverything.cpp | 4 +- .../db/Player/PlayerTpToEverything.cpp | 3 +- .../db/Player/PlayerTpToRandomStore.cpp | 3 +- ChaosMod/Effects/db/Player/PlayerVR.cpp | 3 +- .../Effects/db/Player/PlayerWalkOnWater.cpp | 4 +- .../db/Player/PlayerWantedController.cpp | 13 +- .../Effects/db/Player/PlayerWeaponGiver.cpp | 3 +- .../Effects/db/Player/PlayerZoomZoomCam.cpp | 4 +- .../Effects/db/Screen/ScreenBinoculars.cpp | 4 +- .../Effects/db/Screen/ScreenBouncyRadar.cpp | 3 +- .../db/Screen/ScreenDVDScreensaver.cpp | 4 +- .../Effects/db/Screen/ScreenFlipCamera.cpp | 4 +- ChaosMod/Effects/db/Screen/ScreenFlipUI.cpp | 3 +- .../Effects/db/Screen/ScreenHeatVision.cpp | 4 +- ChaosMod/Effects/db/Screen/ScreenMaximap.cpp | 3 +- .../Effects/db/Screen/ScreenNightVision.cpp | 4 +- ChaosMod/Effects/db/Screen/ScreenNoHUD.cpp | 4 +- ChaosMod/Effects/db/Screen/ScreenNoRadar.cpp | 4 +- .../db/Screen/ScreenOnDemandCartoon.cpp | 4 +- ChaosMod/Effects/db/Screen/ScreenQuakeFOV.cpp | 4 +- .../db/Screen/ScreenRealFirstPerson.cpp | 4 +- ChaosMod/Effects/db/Screen/ScreenSickCam.cpp | 4 +- ChaosMod/Effects/db/Screen/ScreenSpinCam.cpp | 4 +- .../ScreenTimecycModifierController.cpp | 24 +-- .../db/Screen/Shaders/ScreenShaderArc.cpp | 3 +- .../Shaders/ScreenShaderColorfulWorld.cpp | 3 +- .../db/Screen/Shaders/ScreenShaderDimWarp.cpp | 3 +- .../Shaders/ScreenShaderFckAutorotate.cpp | 3 +- .../Shaders/ScreenShaderFoldedScreen.cpp | 3 +- .../Shaders/ScreenShaderFourthDimension.cpp | 3 +- .../Screen/Shaders/ScreenShaderHueShift.cpp | 3 +- .../Shaders/ScreenShaderInvertedColors.cpp | 3 +- .../Screen/Shaders/ScreenShaderLocalCoop.cpp | 3 +- .../Screen/Shaders/ScreenShaderMirrored.cpp | 3 +- .../db/Screen/Shaders/ScreenShaderRgbLand.cpp | 3 +- .../Shaders/ScreenShaderScreenFreakout.cpp | 3 +- .../Shaders/ScreenShaderScreenPotato.cpp | 3 +- .../Shaders/ScreenShaderShatteredScreen.cpp | 3 +- .../Shaders/ScreenShaderSwappedColors.cpp | 3 +- .../Shaders/ScreenShaderTextureless.cpp | 3 +- .../db/Screen/Shaders/ScreenShaderTnPanel.cpp | 3 +- .../Screen/Shaders/ScreenShaderWarpedCam.cpp | 3 +- ChaosMod/Effects/db/Time/TimeController.cpp | 14 +- .../db/Time/TimeGameSpeedController.cpp | 5 +- ChaosMod/Effects/db/Time/TimeSuperhot.cpp | 4 +- ChaosMod/Effects/db/Vehs/Vehs30mphLimit.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsAllHorn.cpp | 4 +- .../Effects/db/Vehs/VehsAllVehsLaunchUp.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsBeyblade.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsBoostBraking.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsBouncy.cpp | 3 +- .../Effects/db/Vehs/VehsBrakeBoosting.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsBreakDoors.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsCinematicCam.cpp | 4 +- .../Effects/db/Vehs/VehsColorController.cpp | 13 +- .../Effects/db/Vehs/VehsCruiseControl.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsCrumble.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsDetachWheel.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsDisassemble.cpp | 3 +- .../Vehs/VehsEngineMultiplierController.cpp | 8 +- .../Effects/db/Vehs/VehsExplodeNearby.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsFlyingCar.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsFullAccel.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsGTAOTraffic.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsHonkBoosting.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsInvincible.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsInvisible.cpp | 4 +- .../Effects/db/Vehs/VehsJesusTakeTheWheel.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsJumpy.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsKillEngine.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsLockAll.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsNoGrav.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsNoTraffic.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsOneHitKO.cpp | 3 +- .../Effects/db/Vehs/VehsPlayerVehDespawn.cpp | 4 +- .../Effects/db/Vehs/VehsPlayerVehExplode.cpp | 4 +- .../Effects/db/Vehs/VehsPlayerVehLock.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsPopTires.cpp | 4 +- .../Effects/db/Vehs/VehsPopTiresRandom.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsPropModels.cpp | 4 +- .../Effects/db/Vehs/VehsRandomTraffic.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsRepairAll.cpp | 4 +- .../Effects/db/Vehs/VehsReplaceVehicle.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsRepossession.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsRotAll.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsSlipperyVehs.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsSpamDoors.cpp | 4 +- .../Effects/db/Vehs/VehsSpawnIESultan.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsSpawner.cpp | 33 ++-- ChaosMod/Effects/db/Vehs/VehsSpeedMin.cpp | 7 +- ChaosMod/Effects/db/Vehs/VehsTiny.cpp | 3 +- ChaosMod/Effects/db/Vehs/VehsTirePoppin.cpp | 4 +- ChaosMod/Effects/db/Vehs/VehsTriggerAlarm.cpp | 4 +- .../Effects/db/Vehs/VehsUpgradeController.cpp | 6 +- ChaosMod/Effects/db/Vehs/VehsWeapons.cpp | 3 +- .../Effects/db/Weather/WeatherController.cpp | 14 +- ChaosMod/Effects/db/Weather/WeatherSnow.cpp | 3 +- ChaosMod/Main.cpp | 10 +- ChaosMod/Memory/Handle.h | 9 +- ChaosMod/Memory/Physics.h | 3 +- ChaosMod/Util/EntityIterator.h | 8 +- ChaosMod/Util/MacroConcat.h | 4 + ChaosMod/Util/Player.h | 2 +- ChaosMod/stdafx.h | 2 - 317 files changed, 1324 insertions(+), 773 deletions(-) create mode 100644 ChaosMod/Effects/Condition/ConditionVotingEnabled.cpp create mode 100644 ChaosMod/Effects/Condition/EffectCondition.h delete mode 100644 ChaosMod/Effects/Effect.h create mode 100644 ChaosMod/Effects/EnabledEffects.h delete mode 100644 ChaosMod/Effects/EnabledEffectsMap.h create mode 100644 ChaosMod/Effects/Register/RegisterEffect.h create mode 100644 ChaosMod/Effects/Register/RegisteredEffects.h rename ChaosMod/Effects/{EffectsInfo.h => Register/RegisteredEffectsMetadata.h} (67%) create mode 100644 ChaosMod/Util/MacroConcat.h diff --git a/ChaosMod/Components/DebugMenu.cpp b/ChaosMod/Components/DebugMenu.cpp index 4e84fb3bf..9525b64d7 100644 --- a/ChaosMod/Components/DebugMenu.cpp +++ b/ChaosMod/Components/DebugMenu.cpp @@ -3,7 +3,7 @@ #include "DebugMenu.h" #include "Components/EffectDispatcher.h" - +#include "Effects/EnabledEffects.h" #include "Util/OptionsManager.h" #define MAX_VIS_ITEMS 15 @@ -16,13 +16,10 @@ DebugMenu::DebugMenu() : Component() for (const auto &pair : g_EnabledEffects) { - const auto &[effectIdentifier, effectData] = pair; + const auto &[effectId, effectData] = pair; if (!effectData.IsHidden()) - { - m_Effects.emplace_back(effectIdentifier, - effectData.HasCustomName() ? effectData.CustomName : effectData.Name); - } + m_Effects.emplace_back(effectId, effectData.HasCustomName() ? effectData.CustomName : effectData.Name); } if (m_Effects.empty()) @@ -41,8 +38,8 @@ DebugMenu::DebugMenu() : Component() return false; else if (idx >= b.EffectName.size()) return true; - - auto ai = std::toupper(a.EffectName[idx]); + + auto ai = std::toupper(a.EffectName[idx]); auto bi = std::toupper(b.EffectName[idx]); if (ai != bi) return ai < bi; @@ -83,7 +80,7 @@ void DebugMenu::OnRun() m_DispatchEffect = false; if (ComponentExists()) - GetComponent()->DispatchEffect(m_Effects[m_SelectedIdx].Identifier); + GetComponent()->DispatchEffect(m_Effects[m_SelectedIdx].Id); } float y = .1f; @@ -211,7 +208,7 @@ void DebugMenu::OnKeyInput(DWORD key, bool repeated, bool isUpNow, bool isCtrlPr break; } case VK_RETURN: - if (!m_Effects[m_SelectedIdx].Identifier.GetEffectId().empty()) + if (!m_Effects[m_SelectedIdx].Id.Id().empty()) m_DispatchEffect = true; break; diff --git a/ChaosMod/Components/DebugMenu.h b/ChaosMod/Components/DebugMenu.h index e955bdee1..84dea7458 100644 --- a/ChaosMod/Components/DebugMenu.h +++ b/ChaosMod/Components/DebugMenu.h @@ -12,11 +12,11 @@ class DebugMenu : public Component { struct DebugEffect { - EffectIdentifier Identifier; + EffectIdentifier Id; std::string EffectName; - DebugEffect(const EffectIdentifier &effectIdentifier, const std::string &effectName) - : Identifier(effectIdentifier), EffectName(effectName) + DebugEffect(const EffectIdentifier &effectId, const std::string &effectName) + : Id(effectId), EffectName(effectName) { } }; diff --git a/ChaosMod/Components/DebugSocket.cpp b/ChaosMod/Components/DebugSocket.cpp index 9c74ed488..c5b355a6e 100644 --- a/ChaosMod/Components/DebugSocket.cpp +++ b/ChaosMod/Components/DebugSocket.cpp @@ -5,8 +5,7 @@ #include "DebugSocket.h" #include "Components/EffectDispatcher.h" -#include "Effects/EnabledEffectsMap.h" -#include "Util/OptionsFile.h" +#include "Effects/EnabledEffects.h" #include @@ -35,7 +34,7 @@ static void OnFetchEffects(DebugSocket *debugSocket, std::shared_ptrm_EffectTraceStats.erase(identifier.GetEffectId()); + debugSocket->m_EffectTraceStats.erase(ide); return true; } -static void EventOnPreRunEffect(DebugSocket *debugSocket, const EffectIdentifier &identifier) +static void EventOnPreRunEffect(DebugSocket *debugSocket, const EffectIdentifier &id) { if (debugSocket->m_IsProfiling) { LARGE_INTEGER ticks; QueryPerformanceCounter(&ticks); - debugSocket->m_EffectTraceStats[identifier.GetEffectId()].EntryTimestamp = ticks.QuadPart; + debugSocket->m_EffectTraceStats[id].EntryTimestamp = ticks.QuadPart; } } -static void EventOnPostRunEffect(DebugSocket *debugSocket, const EffectIdentifier &identifier) +static void EventOnPostRunEffect(DebugSocket *debugSocket, const EffectIdentifier &id) { if (!debugSocket->m_IsProfiling) return; - const auto &effectId = identifier.GetEffectId(); + const auto &effectId = id; if (!debugSocket->m_EffectTraceStats.contains(effectId)) return; @@ -259,16 +258,14 @@ DebugSocket::DebugSocket() if (ComponentExists()) { m_OnPreDispatchEffectListener.Register(GetComponent()->OnPreDispatchEffect, - [&](const EffectIdentifier &identifier) - { return EventOnPreDispatchEffect(this, identifier); }); + [&](const EffectIdentifier &id) + { return EventOnPreDispatchEffect(this, id); }); m_OnPreRunEffectListener.Register(GetComponent()->OnPreRunEffect, - [&](const EffectIdentifier &identifier) - { EventOnPreRunEffect(this, identifier); }); + [&](const EffectIdentifier &id) { EventOnPreRunEffect(this, id); }); m_OnPostRunEffectListener.Register(GetComponent()->OnPostRunEffect, - [&](const EffectIdentifier &identifier) - { EventOnPostRunEffect(this, identifier); }); + [&](const EffectIdentifier &id) { EventOnPostRunEffect(this, id); }); } } diff --git a/ChaosMod/Components/EffectDispatcher.cpp b/ChaosMod/Components/EffectDispatcher.cpp index 8e1c60efd..59e0f23c1 100644 --- a/ChaosMod/Components/EffectDispatcher.cpp +++ b/ChaosMod/Components/EffectDispatcher.cpp @@ -4,9 +4,10 @@ #include "Components/EffectDispatcher.h" #include "Components/EffectSound/EffectSoundManager.h" #include "Components/MetaModifiers.h" - #include "Effects/EffectCategory.h" - +#include "Effects/EffectTimedType.h" +#include "Effects/EnabledEffects.h" +#include "Effects/Register/RegisteredEffectsMetadata.h" #include "Util/OptionsManager.h" #include "Util/Random.h" #include "Util/ScriptText.h" @@ -19,24 +20,26 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDispatcher::EffectDispatchEntry &entry) { - auto &effectData = g_EnabledEffects.at(entry.Identifier); + auto &effectData = g_EnabledEffects.at(entry.Id); if (effectData.TimedType == EffectTimedType::Permanent) return; - if (!effectDispatcher->OnPreDispatchEffect.Fire(entry.Identifier)) + if (!effectDispatcher->OnPreDispatchEffect.Fire(entry.Id)) return; #ifdef CHAOSDEBUG - DEBUG_LOG("Dispatching effect \"" << effectData.Name << "\"" << " (" << effectData.Id << ")"); + DEBUG_LOG("Dispatching effect \"" << effectData.Name << "\"" << " (" << effectData.Id.Id() << ")"); #else LOG("Dispatching effect \"" << effectData.Name << "\""); #endif + const auto &filteredEffects = GetFilteredEnabledEffects(); + // Increase weight for all effects first - for (auto &[effectId, effectData] : g_EnabledEffects) - if (!effectData.IsMeta()) - effectData.Weight += effectData.WeightMult; + for (auto &effectData : filteredEffects) + if (!effectData->IsMeta()) + effectData->Weight += effectData->WeightMult; // Reset weight of this effect (or every effect in group) to reduce chance of same effect (group) happening multiple // times in a row @@ -46,9 +49,9 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp } else { - for (auto &[effectId, effectData] : g_EnabledEffects) - if (effectData.GroupType == effectData.GroupType) - effectData.Weight = effectData.WeightMult; + for (auto &effectData : filteredEffects) + if (effectData->GroupType == effectData->GroupType) + effectData->Weight = effectData->WeightMult; } auto playEffectDispatchSound = [&](EffectDispatcher::ActiveEffect &activeEffect) @@ -58,7 +61,7 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp { // Play global sound (if one exists) // HACK: Force no global sound for "Fake Crash" - if (entry.Identifier.GetEffectId() != "misc_fakecrash") + if (entry.Id != "misc_fakecrash") GetComponent()->PlaySoundFile("global_effectdispatch"); // Play a sound if corresponding .mp3 file exists @@ -72,7 +75,7 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp for (auto &activeEffect : effectDispatcher->SharedState.ActiveEffects) { - if (activeEffect.Identifier == entry.Identifier) + if (activeEffect.Id == entry.Id) { if (effectData.TimedType != EffectTimedType::NotTimed) { @@ -91,7 +94,7 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp break; } - const auto &activeEffectData = g_EnabledEffects.at(activeEffect.Identifier); + const auto &activeEffectData = g_EnabledEffects.at(activeEffect.Id); bool isIncompatible = false; if (effectData.IncompatibleIds.contains(activeEffectData.Id)) @@ -101,8 +104,7 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp if (!isIncompatible) { const auto &activeIncompatibleIds = activeEffectData.IncompatibleIds; - if ((effectData.EffectCategory != EffectCategory::None - && effectData.EffectCategory == activeEffectData.EffectCategory) + if ((effectData.Category != EffectCategory::None && effectData.Category == activeEffectData.Category) || activeIncompatibleIds.contains(effectData.Id)) { isIncompatible = true; @@ -119,7 +121,7 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp if (!alreadyExists) { - auto *registeredEffect = GetRegisteredEffect(entry.Identifier); + auto *registeredEffect = GetRegisteredEffect(entry.Id); if (registeredEffect) { @@ -149,16 +151,16 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp effectDuration = effectData.CustomTime; break; default: - LOG("WARNING: No effectDuration set for effect " - << entry.Identifier.GetEffectId() << " with EffectTimedType " - << static_cast(effectData.TimedType) << ", reverting to default!"); + LOG("WARNING: No effectDuration set for effect " << entry.Id.Id() << " with EffectTimedType " + << static_cast(effectData.TimedType) + << ", reverting to default!"); effectDuration = effectData.IsMeta() ? effectDispatcher->SharedState.MetaEffectTimedDur : effectDispatcher->SharedState.EffectTimedDur; break; } effectDispatcher->SharedState.ActiveEffects.push_back({ - .Identifier = entry.Identifier, + .Id = entry.Id, .Name = effectName.str(), .ThreadId = EffectThreads::CreateThread(registeredEffect), .Timer = static_cast(effectDuration), @@ -186,7 +188,7 @@ static void _DispatchEffect(EffectDispatcher *effectDispatcher, const EffectDisp } } - effectDispatcher->OnPostDispatchEffect.Fire(entry.Identifier); + effectDispatcher->OnPostDispatchEffect.Fire(entry.Id); } static void _OnRunEffects(LPVOID data) @@ -248,7 +250,7 @@ EffectDispatcher::EffectDispatcher(const std::array &textColor, const s Reset(); - for (const auto &[effectIdentifier, effectData] : g_EnabledEffects) + for (const auto &[effectId, effectData] : g_EnabledEffects) { if (!effectData.IsMeta() && !effectData.IsUtility()) { @@ -314,16 +316,16 @@ void EffectDispatcher::UpdateEffects(int deltaTime) { if (activeEffect.IsTimed || activeEffect.Timer <= 0.f) { - DEBUG_LOG("Discarding ActiveEffect " << activeEffect.Identifier.GetEffectId()); + DEBUG_LOG("Discarding ActiveEffect " << activeEffect.Id.Id()); it = static_cast(SharedState.ActiveEffects.erase(std::next(it).base())); continue; } } else if (!isEffectPaused) { - OnPreRunEffect.Fire(activeEffect.Identifier); + OnPreRunEffect.Fire(activeEffect.Id); EffectThreads::RunThread(activeEffect.ThreadId); - OnPostRunEffect.Fire(activeEffect.Identifier); + OnPostRunEffect.Fire(activeEffect.Id); if (!activeEffect.IsMeta) activeEffects++; @@ -357,8 +359,8 @@ void EffectDispatcher::UpdateEffects(int deltaTime) } else { - auto result = g_EffectsMap.find(effectSharedData->OverrideEffectId); - if (result != g_EffectsMap.end()) + auto result = g_RegisteredEffectsMetadata.find(effectSharedData->OverrideEffectId); + if (result != g_RegisteredEffectsMetadata.end()) activeEffect.FakeName = result->second.Name; } @@ -378,12 +380,12 @@ void EffectDispatcher::UpdateEffects(int deltaTime) if (activeEffect.Timer < -60.f) { // Effect took over 60 seconds to stop, forcibly stop it in a blocking manner - DEBUG_LOG("Tiemout reached, forcefully stopping effect " << activeEffect.Identifier.GetEffectId()); + DEBUG_LOG("Tiemout reached, forcefully stopping effect " << activeEffect.Id.Id()); EffectThreads::StopThreadImmediately(activeEffect.ThreadId); } else if (!activeEffect.IsStopping) { - DEBUG_LOG("Stopping effect " << activeEffect.Identifier.GetEffectId()); + DEBUG_LOG("Stopping effect " << activeEffect.Id.Id()); EffectThreads::StopThread(activeEffect.ThreadId); activeEffect.IsStopping = true; } @@ -420,26 +422,25 @@ void EffectDispatcher::UpdateMetaEffects(int deltaTime) if (!availableMetaEffects.empty()) { // TODO: Stop duplicating effect weight logic everywhere - float chosen = g_Random.GetRandomFloat(0.f, totalWeight); + float chosen = g_Random.GetRandomFloat(0.f, totalWeight); - totalWeight = 0.f; + totalWeight = 0.f; - const EffectIdentifier *targetEffectIdentifier = nullptr; - for (const auto &[effectIdentifier, effectData] : availableMetaEffects) + const EffectIdentifier *targetEffectId = nullptr; + for (const auto &[effectId, effectData] : availableMetaEffects) { totalWeight += effectData->GetEffectWeight(); effectData->Weight += effectData->WeightMult; - if (!targetEffectIdentifier && chosen <= totalWeight) - targetEffectIdentifier = &effectIdentifier; + if (!targetEffectId && chosen <= totalWeight) + targetEffectId = &effectId; } - if (targetEffectIdentifier) + if (targetEffectId) { - _DispatchEffect(this, { .Identifier = *targetEffectIdentifier, - .Suffix = "(Meta)", - .Flags = DispatchEffectFlag_NoAddToLog }); + _DispatchEffect(this, + { .Id = *targetEffectId, .Suffix = "(Meta)", .Flags = DispatchEffectFlag_NoAddToLog }); } } else @@ -473,9 +474,9 @@ void EffectDispatcher::DrawEffectTexts() const bool hasFake = !effect.FakeName.empty(); // Temporary non-timed effects will have their entries removed already since their OnStop is called immediately - if (g_EnabledEffects.contains(effect.Identifier)) + if (g_EnabledEffects.contains(effect.Id)) { - auto &effectData = g_EnabledEffects.at(effect.Identifier); + auto &effectData = g_EnabledEffects.at(effect.Id); if ((effect.HideEffectName && !hasFake) || ((ComponentExists() && (GetComponent()->HideChaosUI || GetComponent()->DisableChaos)) @@ -520,10 +521,10 @@ void EffectDispatcher::DrawEffectTexts() } } -void EffectDispatcher::DispatchEffect(const EffectIdentifier &effectIdentifier, DispatchEffectFlags dispatchEffectFlags, +void EffectDispatcher::DispatchEffect(const EffectIdentifier &effectId, DispatchEffectFlags dispatchEffectFlags, const std::string &suffix) { - EffectDispatchQueue.push({ .Identifier = effectIdentifier, .Suffix = suffix, .Flags = dispatchEffectFlags }); + EffectDispatchQueue.push({ .Id = effectId, .Suffix = suffix, .Flags = dispatchEffectFlags }); } void EffectDispatcher::DispatchRandomEffect(DispatchEffectFlags dispatchEffectFlags, const std::string &suffix) @@ -532,39 +533,39 @@ void EffectDispatcher::DispatchRandomEffect(DispatchEffectFlags dispatchEffectFl return; std::unordered_map choosableEffects; - for (const auto &[effectIdentifier, effectData] : g_EnabledEffects) + for (const auto &[effectId, effectData] : g_EnabledEffects) if (!effectData.IsMeta() && !effectData.IsUtility() && !effectData.IsHidden()) - choosableEffects.emplace(effectIdentifier, effectData); + choosableEffects.emplace(effectId, effectData); float totalWeight = 0.f; - for (const auto &[effectIdentifier, effectData] : choosableEffects) + for (const auto &[effectId, effectData] : choosableEffects) totalWeight += effectData.GetEffectWeight(); - float chosen = g_Random.GetRandomFloat(0.f, totalWeight); + float chosen = g_Random.GetRandomFloat(0.f, totalWeight); - totalWeight = 0.f; + totalWeight = 0.f; - const EffectIdentifier *targetEffectIdentifier = nullptr; - for (const auto &[effectIdentifier, effectData] : choosableEffects) + const EffectIdentifier *targetEffectId = nullptr; + for (const auto &[effectId, effectData] : choosableEffects) { totalWeight += effectData.GetEffectWeight(); if (chosen <= totalWeight) { - targetEffectIdentifier = &effectIdentifier; + targetEffectId = &effectId; break; } } - if (targetEffectIdentifier) - DispatchEffect(*targetEffectIdentifier, dispatchEffectFlags, suffix); + if (targetEffectId) + DispatchEffect(*targetEffectId, dispatchEffectFlags, suffix); } void EffectDispatcher::ClearEffect(const EffectIdentifier &effectId) { auto result = std::find_if(SharedState.ActiveEffects.begin(), SharedState.ActiveEffects.end(), - [effectId](auto &activeEffect) { return activeEffect.Identifier == effectId; }); + [effectId](auto &activeEffect) { return activeEffect.Id == effectId; }); if (result == SharedState.ActiveEffects.end()) return; @@ -609,14 +610,14 @@ void EffectDispatcher::ClearMostRecentEffect() } } -std::vector EffectDispatcher::GetRecentEffects(int distance, std::string_view ignoreEffect) const +std::vector EffectDispatcher::GetRecentEffects(int distance, const std::string &ignoreEffect) const { std::vector effects; for (int i = SharedState.DispatchedEffectsLog.size() - 1; distance > 0 && i >= 0; i--) { auto effect = *std::next(SharedState.DispatchedEffectsLog.begin(), i); - if ((!ignoreEffect.empty() && effect->GetIndentifier().GetEffectId() == ignoreEffect) + if ((!ignoreEffect.empty() && effect->GetId() == ignoreEffect) || std::find(effects.begin(), effects.end(), effect) != effects.end()) { continue; @@ -644,9 +645,9 @@ float EffectDispatcher::GetEffectTopSpace() void EffectDispatcher::RegisterPermanentEffects() { - auto registerEffect = [&](EffectIdentifier effectIdentifier) + auto registerEffect = [&](EffectIdentifier effectId) { - auto *registeredEffect = GetRegisteredEffect(effectIdentifier); + auto *registeredEffect = GetRegisteredEffect(effectId); if (registeredEffect) { auto threadId = EffectThreads::CreateThread(registeredEffect); @@ -657,12 +658,12 @@ void EffectDispatcher::RegisterPermanentEffects() if (g_OptionsManager.GetConfigValue({ "Australia" }, false)) registerEffect({ "player_flip_camera" }); - for (const auto &[effectIdentifier, effectData] : g_EnabledEffects) + for (const auto &[effectId, effectData] : g_EnabledEffects) { if (effectData.TimedType == EffectTimedType::Permanent) { // Always run permanent timed effects in background - registerEffect(effectIdentifier); + registerEffect(effectId); } } } diff --git a/ChaosMod/Components/EffectDispatcher.h b/ChaosMod/Components/EffectDispatcher.h index e50115133..ae0e1d046 100644 --- a/ChaosMod/Components/EffectDispatcher.h +++ b/ChaosMod/Components/EffectDispatcher.h @@ -2,11 +2,9 @@ #include "Components/Component.h" -#include "Effects/Effect.h" -#include "Effects/EffectData.h" #include "Effects/EffectIdentifier.h" #include "Effects/EffectThreads.h" -#include "Effects/EnabledEffectsMap.h" +#include "Effects/Register/RegisteredEffects.h" #include "Util/Events.h" @@ -29,7 +27,7 @@ class EffectDispatcher : public Component }; struct EffectDispatchEntry { - EffectIdentifier Identifier; + EffectIdentifier Id; std::string Suffix; DispatchEffectFlags Flags; }; @@ -37,7 +35,7 @@ class EffectDispatcher : public Component struct ActiveEffect { - EffectIdentifier Identifier; + EffectIdentifier Id; std::string Name; std::string FakeName; @@ -112,7 +110,7 @@ class EffectDispatcher : public Component void DrawEffectTexts(); - void DispatchEffect(const EffectIdentifier &effectIdentifier, + void DispatchEffect(const EffectIdentifier &effectId, DispatchEffectFlags dispatchEffectFlags = DispatchEffectFlag_None, const std::string &suffix = {}); void DispatchRandomEffect(DispatchEffectFlags dispatchEffectFlags = DispatchEffectFlag_None, @@ -132,7 +130,7 @@ class EffectDispatcher : public Component void ClearActiveEffects(); void ClearMostRecentEffect(); - std::vector GetRecentEffects(int distance, std::string_view ignoreEffect = {}) const; + std::vector GetRecentEffects(int distance, const std::string &ignoreEffect = {}) const; void Reset(ClearEffectsFlags clearEffectFlags = ClearEffectsFlag_None); diff --git a/ChaosMod/Components/EffectShortcuts.cpp b/ChaosMod/Components/EffectShortcuts.cpp index 30ad15871..5e912c1c0 100644 --- a/ChaosMod/Components/EffectShortcuts.cpp +++ b/ChaosMod/Components/EffectShortcuts.cpp @@ -3,6 +3,7 @@ #include "EffectShortcuts.h" #include "Components/EffectDispatcher.h" +#include "Effects/EnabledEffects.h" EffectShortcuts::EffectShortcuts() : Component() { @@ -18,10 +19,10 @@ void EffectShortcuts::OnRun() std::lock_guard lock(m_EffectQueueMtx); while (!m_EffectQueue.empty()) { - auto &identifier = m_EffectQueue.front(); + auto &id = m_EffectQueue.front(); if (ComponentExists()) - GetComponent()->DispatchEffect(identifier); + GetComponent()->DispatchEffect(id); m_EffectQueue.pop(); } diff --git a/ChaosMod/Components/EffectShortcuts.h b/ChaosMod/Components/EffectShortcuts.h index 5b3532597..8ea5a8c2a 100644 --- a/ChaosMod/Components/EffectShortcuts.h +++ b/ChaosMod/Components/EffectShortcuts.h @@ -1,7 +1,6 @@ #pragma once #include "Components/Component.h" - #include "Effects/EffectIdentifier.h" #include diff --git a/ChaosMod/Components/LuaScripts.cpp b/ChaosMod/Components/LuaScripts.cpp index 5945afefd..e435b9b1a 100644 --- a/ChaosMod/Components/LuaScripts.cpp +++ b/ChaosMod/Components/LuaScripts.cpp @@ -7,9 +7,10 @@ #include "Components/KeyStates.h" #include "Components/MetaModifiers.h" #include "Components/Workshop.h" -#include "Effects/Effect.h" #include "Effects/EffectData.h" -#include "Effects/EnabledEffectsMap.h" +#include "Effects/EnabledEffects.h" +#include "Effects/Register/RegisteredEffects.h" +#include "Effects/Register/RegisteredEffectsMetadata.h" #include "Info.h" #include "Memory/Hooks/AudioClearnessHook.h" #include "Memory/Hooks/AudioPitchHook.h" @@ -724,7 +725,7 @@ LuaScripts::ParseScript(std::string scriptName, const std::string &script, Parse } else { - for (const auto &effect : g_EffectsMap) + for (const auto &effect : g_RegisteredEffectsMetadata) { if (effect.second.Id == effectId) { @@ -865,7 +866,7 @@ LuaScripts::ParseScript(std::string scriptName, const std::string &script, Parse const auto &effectCategoryStr = *effectCategoryOpt; auto effectCategoryIt = g_NameToEffectCategory.find(effectCategoryStr); if (effectCategoryIt != g_NameToEffectCategory.end()) - effectData.EffectCategory = effectCategoryIt->second; + effectData.Category = effectCategoryIt->second; } const sol::optional &effectGroupOpt = effectInfo["EffectGroup"]; diff --git a/ChaosMod/Components/Voting.cpp b/ChaosMod/Components/Voting.cpp index 0050ed6f0..2a2366675 100644 --- a/ChaosMod/Components/Voting.cpp +++ b/ChaosMod/Components/Voting.cpp @@ -6,7 +6,8 @@ #include "Components/EffectDispatcher.h" #include "Components/MetaModifiers.h" #include "Components/SplashTexts.h" - +#include "Effects/EffectData.h" +#include "Effects/EnabledEffects.h" #include "Util/OptionsManager.h" #include "Util/ScriptText.h" @@ -63,7 +64,7 @@ bool Voting::Init() auto str = _wcsdup(VOTING_PROXY_START_ARGS); #ifdef CHAOSDEBUG - DWORD attributes = NULL; + DWORD attributes = 0; if (DoesFeatureFlagExist("forcenovotingconsole")) attributes = CREATE_NO_WINDOW; @@ -121,13 +122,13 @@ void Voting::HandleMsg(std::string_view message) std::string identifier = receivedJSON["Identifier"]; if (identifier == "voteresult") { - int result = receivedJSON["SelectedOption"]; + int result = receivedJSON["SelectedOption"]; - m_HasReceivedResult = true; + m_HasReceivedResult = true; // If random effect voteable (result == 3) won, dispatch random effect later - m_ChosenEffectIdentifier = std::make_unique( - result == 3 ? EffectIdentifier() : m_EffectChoices[result]->m_EffectIdentifier); + m_ChosenEffectId = + std::make_unique(result == 3 ? EffectIdentifier() : m_EffectChoices[result]->Id); } else if (identifier == "currentvotes") { @@ -136,8 +137,8 @@ void Voting::HandleMsg(std::string_view message) { for (int idx = 0; idx < options.size(); idx++) { - int votes = options[idx]; - m_EffectChoices[idx]->m_ChanceVotes = votes; + int votes = options[idx]; + m_EffectChoices[idx]->ChanceVotes = votes; } } } @@ -290,13 +291,13 @@ void Voting::OnRun() } else if (GetComponent()->ShouldDispatchEffectNow()) { - // End of voting round; dispatch resulted effect + // End of voting round; dispatch resulting effect // Should be random effect voteable, so just dispatch random effect - if (m_ChosenEffectIdentifier->GetEffectId().empty()) + if (m_ChosenEffectId->Id().empty()) GetComponent()->DispatchRandomEffect(); else - GetComponent()->DispatchEffect(*m_ChosenEffectIdentifier); + GetComponent()->DispatchEffect(*m_ChosenEffectId); GetComponent()->ResetTimer(); if (ComponentExists()) @@ -312,22 +313,23 @@ void Voting::OnRun() { // New voting round - m_IsVotingRunning = true; - m_HasReceivedResult = false; - m_IsVotingRoundDone = false; + m_IsVotingRunning = true; + m_HasReceivedResult = false; + m_IsVotingRoundDone = false; - m_ChosenEffectIdentifier = std::make_unique(); + m_ChosenEffectId = std::make_unique(); m_EffectChoices.clear(); - std::unordered_map choosableEffects; - for (auto &pair : g_EnabledEffects) - { - auto &[effectIdentifier, effectData] = pair; - if (!effectData.IsMeta() && !effectData.IsExcludedFromVoting() && !effectData.IsUtility() - && !effectData.IsHidden()) + const auto &filteredEffects = GetFilteredEnabledEffects(); + std::vector choosableEffects; + choosableEffects.reserve(filteredEffects.size()); + for (auto &effectData : filteredEffects) + { + if (!effectData->IsMeta() && !effectData->IsExcludedFromVoting() && !effectData->IsUtility() + && !effectData->IsHidden()) { - choosableEffects.emplace(effectIdentifier, effectData); + choosableEffects.push_back(effectData); } } @@ -347,51 +349,43 @@ void Voting::OnRun() } float totalWeight = 0.f; - for (const auto &pair : choosableEffects) - { - const EffectData &effectData = pair.second; - - totalWeight += effectData.GetEffectWeight(); - } + for (const auto &effectData : choosableEffects) + totalWeight += effectData->GetEffectWeight(); float chosen = g_RandomNoDeterm.GetRandomFloat(0.f, totalWeight); totalWeight = 0.f; - - std::unique_ptr pTargetChoice; - - for (auto &pair : choosableEffects) + for (auto it = choosableEffects.begin(); it != choosableEffects.end();) { - auto &[effectIdentifier, effectData] = pair; - - totalWeight += effectData.GetEffectWeight(); + const auto &effectData = *it; + totalWeight += effectData->GetEffectWeight(); if (chosen <= totalWeight) { // Set weight of this effect 0, EffectDispatcher::DispatchEffect will increment it immediately by // EffectWeightMult - effectData.Weight = 0; + effectData->Weight = 0; - auto match = (std::ostringstream() << m_VoteablePrefix + auto match = (std::ostringstream() << m_VoteablePrefix << (!m_AlternatedVotingRound ? idx + 1 - : m_EnableRandomEffectVoteable ? idx + 5 - : idx + 4)) + : m_EnableRandomEffectVoteable ? idx + 5 + : idx + 4)) .str(); - pTargetChoice = std::make_unique( - effectIdentifier, effectData.HasCustomName() ? effectData.CustomName : effectData.Name, match); + + m_EffectChoices.push_back(std::make_unique( + effectData->Id, effectData->HasCustomName() ? effectData->CustomName : effectData->Name, + match)); + it = choosableEffects.erase(it); break; } - } - - EffectIdentifier effectIdentifier = pTargetChoice->m_EffectIdentifier; - m_EffectChoices.push_back(std::move(pTargetChoice)); - choosableEffects.erase(effectIdentifier); + it++; + } } std::vector effectNames; for (const auto &pChoosableEffect : m_EffectChoices) - effectNames.push_back(pChoosableEffect->m_EffectName); + effectNames.push_back(pChoosableEffect->Name); SendToPipe("vote", effectNames); @@ -406,10 +400,10 @@ void Voting::OnRun() int totalVotes = 0; if (m_EnableChanceSystem) { - for (const auto &pChoosableEffect : m_EffectChoices) + for (const auto &choosableEffect : m_EffectChoices) { int chanceVotes = - pChoosableEffect->m_ChanceVotes + (m_EnableVotingChanceSystemRetainInitialChance ? 1 : 0); + choosableEffect->ChanceVotes + (m_EnableVotingChanceSystemRetainInitialChance ? 1 : 0); totalVotes += chanceVotes; } @@ -419,7 +413,7 @@ void Voting::OnRun() for (const auto &choosableEffect : m_EffectChoices) { std::ostringstream oss; - oss << choosableEffect->m_Match << ": " << choosableEffect->m_EffectName; + oss << choosableEffect->Match << ": " << choosableEffect->Name; // Also show chance percentages if chance system is enabled if (m_EnableChanceSystem) @@ -432,7 +426,7 @@ void Voting::OnRun() else { int chanceVotes = - choosableEffect->m_ChanceVotes + (m_EnableVotingChanceSystemRetainInitialChance ? 1 : 0); + choosableEffect->ChanceVotes + (m_EnableVotingChanceSystemRetainInitialChance ? 1 : 0); percentage = !chanceVotes diff --git a/ChaosMod/Components/Voting.h b/ChaosMod/Components/Voting.h index 6082ba74e..32cee84bd 100644 --- a/ChaosMod/Components/Voting.h +++ b/ChaosMod/Components/Voting.h @@ -12,15 +12,15 @@ class Voting : public Component struct ChoosableEffect { - ChoosableEffect(const EffectIdentifier &effectIdentifier, const std::string &name, const std::string &match) - : m_EffectIdentifier(effectIdentifier), m_EffectName(name), m_Match(match) + EffectIdentifier Id; + std::string Name; + std::string Match; + int ChanceVotes = 0; + + ChoosableEffect(const EffectIdentifier &effectId, const std::string &name, const std::string &match) + : Id(effectId), Name(name), Match(match) { } - - EffectIdentifier m_EffectIdentifier; - std::string m_EffectName; - std::string m_Match; - int m_ChanceVotes = 0; }; std::vector> m_EffectChoices; @@ -29,7 +29,7 @@ class Voting : public Component void *m_PipeHandle = INVALID_HANDLE_VALUE; - std::unique_ptr m_ChosenEffectIdentifier; + std::unique_ptr m_ChosenEffectId; int m_SecsBeforeVoting = 0; diff --git a/ChaosMod/Effects/Condition/ConditionVotingEnabled.cpp b/ChaosMod/Effects/Condition/ConditionVotingEnabled.cpp new file mode 100644 index 000000000..369f9d84c --- /dev/null +++ b/ChaosMod/Effects/Condition/ConditionVotingEnabled.cpp @@ -0,0 +1,11 @@ +#include + +#include "Components/Voting.h" +#include "Effects/Condition/EffectCondition.h" + +static bool OnCondition() +{ + return !ComponentExists() || GetComponent()->IsEnabled(); +} + +REGISTER_EFFECT_CONDITION(EffectConditionType::VotingEnabled, OnCondition); \ No newline at end of file diff --git a/ChaosMod/Effects/Condition/EffectCondition.h b/ChaosMod/Effects/Condition/EffectCondition.h new file mode 100644 index 000000000..b7cd5527c --- /dev/null +++ b/ChaosMod/Effects/Condition/EffectCondition.h @@ -0,0 +1,64 @@ +#pragma once + +#include "Util/Logging.h" +#include "Util/MacroConcat.h" + +enum class EffectConditionType +{ + None, + VotingEnabled, // Voting is enabled +}; + +#define REGISTER_EFFECT_CONDITION(conditionType, condition) \ + namespace \ + { \ + EffectCondition CONCAT(_effectCondition, __LINE__)(conditionType, condition); \ + } + +class EffectCondition; + +inline std::unordered_map g_EffectConditions; + +class EffectCondition +{ + const EffectConditionType ConditionType = EffectConditionType::None; + const std::function Condition; + + public: + EffectCondition(EffectConditionType conditionType, std::function condition) + : ConditionType(conditionType), Condition(condition) + { + if (conditionType == EffectConditionType::None) + { + LOG("ERROR: conditionType == None"); + return; + } + + if (g_EffectConditions.contains(conditionType)) + { + LOG("ERROR: Duplicate conditionType " << static_cast(ConditionType)); + return; + } + + if (!condition) + { + LOG("ERROR: ConditionType " << static_cast(ConditionType) << " has empty condition"); + return; + } + + g_EffectConditions[ConditionType] = this; + } + + ~EffectCondition() + { + g_EffectConditions.erase(ConditionType); + } + + EffectCondition(const EffectCondition &) = delete; + EffectCondition &operator=(const EffectCondition &) = delete; + + bool CheckCondition() + { + return Condition(); + } +}; \ No newline at end of file diff --git a/ChaosMod/Effects/Effect.h b/ChaosMod/Effects/Effect.h deleted file mode 100644 index dc9e4fce8..000000000 --- a/ChaosMod/Effects/Effect.h +++ /dev/null @@ -1,151 +0,0 @@ -#pragma once - -#include "Components/LuaScripts.h" - -#include "Effects/EffectIdentifier.h" -#include "Effects/EffectsInfo.h" - -#include "Util/File.h" - -#include -#include - -#define CHAOS_VAR static thread_local - -#define _EFFECT_CONCAT(a, b) a##b -#define EFFECT_CONCAT(a, b) _EFFECT_CONCAT(a, b) -#define REGISTER_EFFECT(OnStart, OnStop, OnTick, ...) \ - namespace \ - { \ - RegisterEffect EFFECT_CONCAT(effect, __LINE__)(OnStart, OnStop, OnTick, __VA_ARGS__); \ - } - -struct RegisteredEffect -{ - private: - EffectIdentifier m_EffectIdentifier; - - void (*m_OnStart)() = nullptr; - void (*m_OnStop)() = nullptr; - void (*m_OnTick)() = nullptr; - - bool m_IsRunning = false; - - public: - RegisteredEffect() - { - } - - RegisteredEffect(const std::string &scriptId, void (*onStart)(), void (*onStop)(), void (*onTick)()) - : m_EffectIdentifier(scriptId), m_OnStart(onStart), m_OnStop(onStop), m_OnTick(onTick) - { - } - - RegisteredEffect(const std::string &scriptId) : m_EffectIdentifier(scriptId, true) - { - } - - bool operator==(const EffectIdentifier &effectIdentifier) - { - return m_EffectIdentifier == effectIdentifier; - } - - const EffectIdentifier &GetIndentifier() const - { - return m_EffectIdentifier; - } - - void Start() - { - if (!m_IsRunning) - { - m_IsRunning = true; - - if (m_EffectIdentifier.IsScript()) - { - if (ComponentExists()) - GetComponent()->Execute(m_EffectIdentifier.GetEffectId(), - LuaScripts::ExecuteFuncType::Start); - } - else if (m_OnStart) - m_OnStart(); - } - } - - void Stop() - { - if (m_IsRunning) - { - m_IsRunning = false; - - if (m_EffectIdentifier.IsScript()) - { - if (ComponentExists()) - GetComponent()->Execute(m_EffectIdentifier.GetEffectId(), - LuaScripts::ExecuteFuncType::Stop); - } - else if (m_OnStop) - m_OnStop(); - } - } - - void Tick() - { - if (m_IsRunning) - { - if (m_EffectIdentifier.IsScript()) - { - if (ComponentExists()) - GetComponent()->Execute(m_EffectIdentifier.GetEffectId(), - LuaScripts::ExecuteFuncType::Tick); - } - else if (m_OnTick) - m_OnTick(); - } - } - - inline bool IsRunning() const - { - return m_IsRunning; - } - - inline bool IsScript() const - { - return m_EffectIdentifier.IsScript(); - } -}; - -inline std::vector g_RegisteredEffects; - -inline RegisteredEffect *GetRegisteredEffect(const EffectIdentifier &effectIdentifier) -{ - const auto &result = std::find(g_RegisteredEffects.begin(), g_RegisteredEffects.end(), effectIdentifier); - - return result != g_RegisteredEffects.end() ? &*result : nullptr; -} - -class RegisterEffect -{ - RegisteredEffect m_RegisteredEffect; - - public: - RegisterEffect(void (*onStart)(), void (*onStop)(), void (*onTick)(), EffectInfo &&effectInfo) - { - static bool disableEffectRegistration = []() - { - return DoesFeatureFlagExist("disablebuiltineffects"); - }(); - - if (disableEffectRegistration) - return; - - m_RegisteredEffect = { effectInfo.Id, onStart, onStop, onTick }; - - g_RegisteredEffects.push_back(m_RegisteredEffect); - g_EffectsMap[effectInfo.Id] = std::move(effectInfo); - } - - RegisterEffect(const RegisterEffect &) = delete; - - RegisterEffect &operator=(const RegisterEffect &) = delete; -}; diff --git a/ChaosMod/Effects/EffectAttributes.h b/ChaosMod/Effects/EffectAttributes.h index fb97ecd43..430a5f271 100644 --- a/ChaosMod/Effects/EffectAttributes.h +++ b/ChaosMod/Effects/EffectAttributes.h @@ -1,7 +1,5 @@ #pragma once -#include - enum class EffectAttributes { ExcludedFromVoting = (1 << 0), diff --git a/ChaosMod/Effects/EffectConfig.h b/ChaosMod/Effects/EffectConfig.h index 21b9e5efb..f640b78cc 100644 --- a/ChaosMod/Effects/EffectConfig.h +++ b/ChaosMod/Effects/EffectConfig.h @@ -1,12 +1,10 @@ #pragma once -#include "Effects/EffectCategory.h" #include "Effects/EffectData.h" #include "Effects/EffectGroups.h" #include "Effects/EffectIdentifier.h" #include "Effects/EffectTimedType.h" -#include "Effects/EffectsInfo.h" - +#include "Effects/Register/RegisteredEffectsMetadata.h" #include "Util/OptionsFile.h" #include @@ -35,7 +33,7 @@ namespace EffectConfig { OptionsFile effectsFile(configPath, compatConfigPaths); - for (auto &[effectId, effectInfo] : g_EffectsMap) + for (auto &[effectId, effectMetadata] : g_RegisteredEffectsMetadata) { struct ConfigValues { @@ -97,7 +95,7 @@ namespace EffectConfig continue; EffectData effectData; - if (!effectInfo.IsTimed) + if (!effectMetadata.IsTimed) { effectData.TimedType = EffectTimedType::NotTimed; } @@ -114,7 +112,7 @@ namespace EffectConfig { effectData.TimedType = configValues.Values.TimedType == EffectTimedType::NotTimed - ? (effectInfo.IsShortDuration ? EffectTimedType::Short : EffectTimedType::Normal) + ? (effectMetadata.IsShortDuration ? EffectTimedType::Short : EffectTimedType::Normal) : configValues.Values.TimedType; } @@ -122,26 +120,29 @@ namespace EffectConfig effectData.WeightMult = configValues.Values.WeightMult; effectData.Weight = effectData.WeightMult; // Set initial effect weight to WeightMult effectData.SetAttribute(EffectAttributes::ExcludedFromVoting, configValues.Values.ExcludedFromVoting); - effectData.SetAttribute(EffectAttributes::IsMeta, effectInfo.ExecutionType == EffectExecutionType::Meta); - effectData.Name = effectInfo.Name; - effectData.SetAttribute(EffectAttributes::HideRealNameOnStart, effectInfo.HideRealNameOnStart); + effectData.SetAttribute(EffectAttributes::IsMeta, + effectMetadata.ExecutionType == EffectExecutionType::Meta); + effectData.Name = effectMetadata.Name; + effectData.SetAttribute(EffectAttributes::HideRealNameOnStart, effectMetadata.HideRealNameOnStart); #ifdef CHAOSDEBUG - effectData.ShortcutKeycode = - effectInfo.DebugShortcutKeycode ? effectInfo.DebugShortcutKeycode : configValues.Values.ShortcutKeycode; + effectData.ShortcutKeycode = effectMetadata.DebugShortcutKeycode ? effectMetadata.DebugShortcutKeycode + : configValues.Values.ShortcutKeycode; #else effectData.ShortcutKeycode = configValues.Values.ShortcutKeycode; #endif if (!valueEffectName.empty()) effectData.CustomName = valueEffectName; - effectData.Id = effectInfo.Id; - effectData.EffectCategory = effectInfo.EffectCategory; + effectData.Id = { std::string(effectMetadata.Id) }; + effectData.Category = effectMetadata.EffectCategory; + effectData.ConditionType = effectMetadata.ConditionType; - for (auto effectType : effectInfo.IncompatibleWith) - effectData.IncompatibleIds.insert(g_EffectsMap.at(effectType).Id); + for (auto effectType : effectMetadata.IncompatibleWith) + effectData.IncompatibleIds.insert(std::string(g_RegisteredEffectsMetadata.at(effectType).Id)); - if (effectInfo.EffectGroupType != EffectGroupType::None) + if (effectMetadata.EffectGroupType != EffectGroupType::None) { - effectData.GroupType = g_EffectGroups.find(g_EffectTypeToGroup.at(effectInfo.EffectGroupType))->first; + effectData.GroupType = + g_EffectGroups.find(g_EffectTypeToGroup.at(effectMetadata.EffectGroupType))->first; g_EffectGroups[effectData.GroupType].MemberCount++; } diff --git a/ChaosMod/Effects/EffectData.h b/ChaosMod/Effects/EffectData.h index 33a35fa44..2408da4d6 100644 --- a/ChaosMod/Effects/EffectData.h +++ b/ChaosMod/Effects/EffectData.h @@ -1,29 +1,33 @@ #pragma once -#include "EffectAttributes.h" -#include "EffectCategory.h" -#include "EffectGroups.h" -#include "EffectTimedType.h" +#include "Effects/Condition/EffectCondition.h" +#include "Effects/EffectAttributes.h" +#include "Effects/EffectCategory.h" +#include "Effects/EffectGroups.h" +#include "Effects/EffectIdentifier.h" +#include "Effects/EffectTimedType.h" #include #include inline bool g_EnableGroupWeighting = true; -struct EffectData +class EffectData { + public: std::string Name; std::string FakeName; std::string CustomName; - std::string Id; + EffectIdentifier Id; std::string GroupType; std::set IncompatibleIds; - float Weight = 5.f; - int CustomTime = -1; - int WeightMult = 5; - int ShortcutKeycode = 0; - EffectTimedType TimedType = EffectTimedType::NotTimed; - EffectCategory EffectCategory = EffectCategory::None; + float Weight = 5.f; + int CustomTime = -1; + int WeightMult = 5; + int ShortcutKeycode = 0; + EffectTimedType TimedType = EffectTimedType::NotTimed; + EffectCategory Category = EffectCategory::None; + EffectConditionType ConditionType = EffectConditionType::None; private: EffectAttributes Attributes {}; diff --git a/ChaosMod/Effects/EffectIdentifier.h b/ChaosMod/Effects/EffectIdentifier.h index 2992f60e2..8b9b89b69 100644 --- a/ChaosMod/Effects/EffectIdentifier.h +++ b/ChaosMod/Effects/EffectIdentifier.h @@ -1,7 +1,5 @@ #pragma once -#include "EffectsInfo.h" - #include class EffectIdentifier @@ -19,7 +17,12 @@ class EffectIdentifier inline bool operator==(const EffectIdentifier &other) const { - return m_EffectId == other.GetEffectId(); + return m_EffectId == other; + } + + inline bool operator==(const std::string &other) const + { + return m_EffectId == other; } inline bool IsScript() const @@ -27,7 +30,12 @@ class EffectIdentifier return m_IsScript; } - inline const std::string &GetEffectId() const + inline const std::string &Id() const + { + return m_EffectId; + } + + inline operator const std::string &() const { return m_EffectId; } diff --git a/ChaosMod/Effects/EffectThreads.h b/ChaosMod/Effects/EffectThreads.h index 9d6e1270e..c3d76d2f4 100644 --- a/ChaosMod/Effects/EffectThreads.h +++ b/ChaosMod/Effects/EffectThreads.h @@ -1,7 +1,7 @@ #pragma once -#include "Effects/Effect.h" #include "Effects/EffectSoundPlayOptions.h" +#include "Effects/Register/RegisteredEffects.h" #include "Util/CrashHandler.h" #include diff --git a/ChaosMod/Effects/EnabledEffects.h b/ChaosMod/Effects/EnabledEffects.h new file mode 100644 index 000000000..061a4274a --- /dev/null +++ b/ChaosMod/Effects/EnabledEffects.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Effects/Condition/EffectCondition.h" +#include "Effects/EffectData.h" +#include "Effects/EffectIdentifier.h" + +#include +#include +#include + +using size_t = unsigned long long; + +struct EffectData; + +class EffectsIdentifierHasher +{ + public: + size_t operator()(const EffectIdentifier &effectId) const + { + return std::hash()(effectId.Id()); + } +}; + +inline std::unordered_map g_EnabledEffects; + +inline std::vector GetFilteredEnabledEffects() +{ + std::vector filteredEffects; + + std::set ensuredConditions; + for (auto &[conditionType, condition] : g_EffectConditions) + if (condition->CheckCondition()) + ensuredConditions.insert(conditionType); + + for (auto &[effectId, effectData] : g_EnabledEffects) + if (effectData.ConditionType == EffectConditionType::None + || ensuredConditions.contains(effectData.ConditionType)) + filteredEffects.push_back(&effectData); + + return filteredEffects; +} \ No newline at end of file diff --git a/ChaosMod/Effects/EnabledEffectsMap.h b/ChaosMod/Effects/EnabledEffectsMap.h deleted file mode 100644 index 40680bb8a..000000000 --- a/ChaosMod/Effects/EnabledEffectsMap.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "Effects/EffectData.h" -#include "Effects/EffectIdentifier.h" - -#include -#include - -using size_t = unsigned long long; - -struct EffectData; - -class EffectsIdentifierHasher -{ - public: - size_t operator()(const EffectIdentifier &effectIdentifier) const - { - return std::hash()(effectIdentifier.GetEffectId()); - } -}; - -inline std::unordered_map g_EnabledEffects; \ No newline at end of file diff --git a/ChaosMod/Effects/Register/RegisterEffect.h b/ChaosMod/Effects/Register/RegisterEffect.h new file mode 100644 index 000000000..edb4098b0 --- /dev/null +++ b/ChaosMod/Effects/Register/RegisterEffect.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Effects/Register/RegisteredEffects.h" +#include "Effects/Register/RegisteredEffectsMetadata.h" +#include "Util/File.h" +#include "Util/MacroConcat.h" + +#include + +#define CHAOS_VAR static thread_local + +#define REGISTER_EFFECT(start, stop, tick, ...) \ + namespace \ + { \ + RegisterEffect CONCAT(_effect, __LINE__)(start, stop, tick, __VA_ARGS__); \ + } + +class RegisterEffect +{ + RegisteredEffect m_RegisteredEffect; + + public: + RegisterEffect(std::function start, std::function stop, std::function tick, + RegisteredEffectMetadata &&effectMetadata) + : m_RegisteredEffect(std::string(effectMetadata.Id), start, stop, tick) + { + static bool disableEffectRegistration = []() + { + return DoesFeatureFlagExist("disablebuiltineffects"); + }(); + + if (disableEffectRegistration) + return; + + g_RegisteredEffects.push_back(m_RegisteredEffect); + g_RegisteredEffectsMetadata[effectMetadata.Id] = effectMetadata; + } + + RegisterEffect(const RegisterEffect &) = delete; + RegisterEffect &operator=(const RegisterEffect &) = delete; +}; diff --git a/ChaosMod/Effects/Register/RegisteredEffects.h b/ChaosMod/Effects/Register/RegisteredEffects.h new file mode 100644 index 000000000..1911d6a11 --- /dev/null +++ b/ChaosMod/Effects/Register/RegisteredEffects.h @@ -0,0 +1,105 @@ +#pragma once + +#include "Components/LuaScripts.h" +#include "Effects/EffectIdentifier.h" + +#include +#include +#include + +class RegisteredEffect +{ + EffectIdentifier m_EffectId; + + std::function m_Start; + std::function m_Stop; + std::function m_Tick; + + bool m_IsRunning = false; + + public: + RegisteredEffect(const std::string &scriptId, std::function start, std::function stop, + std::function tick) + : m_EffectId(scriptId), m_Start(start), m_Stop(stop), m_Tick(tick) + { + } + + RegisteredEffect(const std::string &scriptId) : m_EffectId(scriptId, true) + { + } + + bool operator==(const EffectIdentifier &effectId) const + { + return m_EffectId == effectId; + } + + const EffectIdentifier &GetId() const + { + return m_EffectId; + } + + void Start() + { + if (!m_IsRunning) + { + m_IsRunning = true; + + if (m_EffectId.IsScript()) + { + if (ComponentExists()) + GetComponent()->Execute(m_EffectId, LuaScripts::ExecuteFuncType::Start); + } + else if (m_Start) + m_Start(); + } + } + + void Stop() + { + if (m_IsRunning) + { + m_IsRunning = false; + + if (m_EffectId.IsScript()) + { + if (ComponentExists()) + GetComponent()->Execute(m_EffectId, LuaScripts::ExecuteFuncType::Stop); + } + else if (m_Stop) + m_Stop(); + } + } + + void Tick() + { + if (m_IsRunning) + { + if (m_EffectId.IsScript()) + { + if (ComponentExists()) + GetComponent()->Execute(m_EffectId, LuaScripts::ExecuteFuncType::Tick); + } + else if (m_Tick) + m_Tick(); + } + } + + inline bool IsRunning() const + { + return m_IsRunning; + } + + inline bool IsScript() const + { + return m_EffectId.IsScript(); + } +}; + +inline std::vector g_RegisteredEffects; + +inline RegisteredEffect *GetRegisteredEffect(const EffectIdentifier &effectId) +{ + const auto &result = std::find(g_RegisteredEffects.begin(), g_RegisteredEffects.end(), effectId); + + return result != g_RegisteredEffects.end() ? &*result : nullptr; +} \ No newline at end of file diff --git a/ChaosMod/Effects/EffectsInfo.h b/ChaosMod/Effects/Register/RegisteredEffectsMetadata.h similarity index 67% rename from ChaosMod/Effects/EffectsInfo.h rename to ChaosMod/Effects/Register/RegisteredEffectsMetadata.h index fc1ef2744..9ac5ec330 100644 --- a/ChaosMod/Effects/EffectsInfo.h +++ b/ChaosMod/Effects/Register/RegisteredEffectsMetadata.h @@ -1,5 +1,6 @@ #pragma once +#include "Effects/Condition/EffectCondition.h" #include "Effects/EffectCategory.h" #include "Effects/EffectExecutionType.h" #include "Effects/EffectGroups.h" @@ -8,10 +9,10 @@ #include #include -struct EffectInfo +struct RegisteredEffectMetadata { - const char *Name; - const char *Id; + std::string_view Name; + std::string_view Id; bool IsTimed = false; bool IsShortDuration = false; bool HideRealNameOnStart = false; @@ -22,6 +23,7 @@ struct EffectInfo EffectCategory EffectCategory = EffectCategory::None; EffectGroupType EffectGroupType = EffectGroupType::None; EffectExecutionType ExecutionType = EffectExecutionType::Default; + EffectConditionType ConditionType = EffectConditionType::None; }; -inline std::unordered_map g_EffectsMap; \ No newline at end of file +inline std::unordered_map g_RegisteredEffectsMetadata; \ No newline at end of file diff --git a/ChaosMod/Effects/db/Meta/MetaAdditionalEffects.cpp b/ChaosMod/Effects/db/Meta/MetaAdditionalEffects.cpp index fb78bb08c..f239d53a6 100644 --- a/ChaosMod/Effects/db/Meta/MetaAdditionalEffects.cpp +++ b/ChaosMod/Effects/db/Meta/MetaAdditionalEffects.cpp @@ -5,6 +5,7 @@ #include #include "Components/MetaModifiers.h" +#include "Effects/Register/RegisterEffect.h" static void OnStop() { @@ -19,7 +20,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Combo Time", .Id = "meta_spawn_multiple_effects", diff --git a/ChaosMod/Effects/db/Meta/MetaEffectDuration.cpp b/ChaosMod/Effects/db/Meta/MetaEffectDuration.cpp index b4da959a0..ef69deb83 100644 --- a/ChaosMod/Effects/db/Meta/MetaEffectDuration.cpp +++ b/ChaosMod/Effects/db/Meta/MetaEffectDuration.cpp @@ -5,6 +5,7 @@ #include #include "Components/MetaModifiers.h" +#include "Effects/Register/RegisterEffect.h" static void OnStop() { @@ -19,7 +20,7 @@ static void OnTick_0_5x() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick_0_5x, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick_0_5x, { .Name = "0.5x Effect Duration", .Id = "meta_effect_duration_0_5x", @@ -37,7 +38,7 @@ static void OnTick_2x() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick_2x, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick_2x, { .Name = "2x Effect Duration", .Id = "meta_effect_duration_2x", diff --git a/ChaosMod/Effects/db/Meta/MetaHideChaosUI.cpp b/ChaosMod/Effects/db/Meta/MetaHideChaosUI.cpp index 821645a64..59be53a46 100644 --- a/ChaosMod/Effects/db/Meta/MetaHideChaosUI.cpp +++ b/ChaosMod/Effects/db/Meta/MetaHideChaosUI.cpp @@ -5,6 +5,7 @@ #include #include "Components/MetaModifiers.h" +#include "Effects/Register/RegisterEffect.h" static void OnStop() { @@ -19,7 +20,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "What's Happening??", .Id = "meta_hide_chaos_ui", diff --git a/ChaosMod/Effects/db/Meta/MetaNoChaos.cpp b/ChaosMod/Effects/db/Meta/MetaNoChaos.cpp index 6176ae9eb..1c2e57838 100644 --- a/ChaosMod/Effects/db/Meta/MetaNoChaos.cpp +++ b/ChaosMod/Effects/db/Meta/MetaNoChaos.cpp @@ -2,6 +2,7 @@ #include "Components/EffectDispatcher.h" #include "Components/MetaModifiers.h" +#include "Effects/Register/RegisterEffect.h" static void OnStart() { @@ -24,7 +25,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "No Chaos", .Id = "meta_nochaos", diff --git a/ChaosMod/Effects/db/Meta/MetaReInvoke.cpp b/ChaosMod/Effects/db/Meta/MetaReInvoke.cpp index f92b65d11..013fd0f58 100644 --- a/ChaosMod/Effects/db/Meta/MetaReInvoke.cpp +++ b/ChaosMod/Effects/db/Meta/MetaReInvoke.cpp @@ -5,6 +5,7 @@ #include #include "Components/EffectDispatcher.h" +#include "Effects/Register/RegisterEffect.h" static void OnStart() { @@ -13,12 +14,12 @@ static void OnStart() auto disp = GetComponent(); const auto &eff = disp->GetRecentEffects(5, "meta_re_invoke"); - for (RegisteredEffect *effect : eff) - disp->DispatchEffect(effect->GetIndentifier(), EffectDispatcher::DispatchEffectFlag_NoAddToLog); + for (auto *effect : eff) + disp->DispatchEffect(effect->GetId(), EffectDispatcher::DispatchEffectFlag_NoAddToLog); } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Re-Invoke Previous Effects", .Id = "meta_re_invoke", diff --git a/ChaosMod/Effects/db/Meta/MetaTimerSpeed.cpp b/ChaosMod/Effects/db/Meta/MetaTimerSpeed.cpp index bdf018b7e..3dca21a70 100644 --- a/ChaosMod/Effects/db/Meta/MetaTimerSpeed.cpp +++ b/ChaosMod/Effects/db/Meta/MetaTimerSpeed.cpp @@ -5,6 +5,7 @@ #include #include "Components/MetaModifiers.h" +#include "Effects/Register/RegisterEffect.h" static void OnStop() { @@ -19,7 +20,7 @@ static void OnTick_0_5x() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick_0_5x, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick_0_5x, { .Name = "0.5x Timer Speed", .Id = "meta_timerspeed_0_5x", @@ -37,7 +38,7 @@ static void OnTick_2x() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick_2x, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick_2x, { .Name = "2x Timer Speed", .Id = "meta_timerspeed_2x", @@ -55,7 +56,7 @@ static void OnTick_5x() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick_5x, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick_5x, { .Name = "5x Timer Speed", .Id = "meta_timerspeed_5x", diff --git a/ChaosMod/Effects/db/Misc/MiscAirstrike.cpp b/ChaosMod/Effects/db/Misc/MiscAirstrike.cpp index 7d24615f6..5bc42e254 100644 --- a/ChaosMod/Effects/db/Misc/MiscAirstrike.cpp +++ b/ChaosMod/Effects/db/Misc/MiscAirstrike.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR int lastAirStrike = 0; CHAOS_VAR Hash airstrikeHash; @@ -48,7 +50,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Airstrike Inbound", .Id = "misc_airstrike", diff --git a/ChaosMod/Effects/db/Misc/MiscBlackHole.cpp b/ChaosMod/Effects/db/Misc/MiscBlackHole.cpp index 41f636b57..c5584bdd2 100644 --- a/ChaosMod/Effects/db/Misc/MiscBlackHole.cpp +++ b/ChaosMod/Effects/db/Misc/MiscBlackHole.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/XInput.h" CHAOS_VAR Vector3 ms_BlackHolePos; @@ -72,7 +73,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Black Hole", .Id = "world_blackhole", diff --git a/ChaosMod/Effects/db/Misc/MiscBlackout.cpp b/ChaosMod/Effects/db/Misc/MiscBlackout.cpp index 5d26b3c8c..efec3747c 100644 --- a/ChaosMod/Effects/db/Misc/MiscBlackout.cpp +++ b/ChaosMod/Effects/db/Misc/MiscBlackout.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { SET_CLOCK_TIME(0, 0, 0); @@ -16,7 +18,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Blackout", .Id = "world_blackout", diff --git a/ChaosMod/Effects/db/Misc/MiscBoostVelocity.cpp b/ChaosMod/Effects/db/Misc/MiscBoostVelocity.cpp index 5127a7d61..db10ba781 100644 --- a/ChaosMod/Effects/db/Misc/MiscBoostVelocity.cpp +++ b/ChaosMod/Effects/db/Misc/MiscBoostVelocity.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { std::vector entities; @@ -27,7 +29,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Speed Boost", .Id = "misc_boost_velocity" diff --git a/ChaosMod/Effects/db/Misc/MiscCloneOnDeath.cpp b/ChaosMod/Effects/db/Misc/MiscCloneOnDeath.cpp index 1ad4506bc..11b1e571d 100644 --- a/ChaosMod/Effects/db/Misc/MiscCloneOnDeath.cpp +++ b/ChaosMod/Effects/db/Misc/MiscCloneOnDeath.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + struct TemporarilyInvincibleEntity { Entity entity; @@ -120,7 +122,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Resurrection Day", .Id = "misc_clone_on_death", diff --git a/ChaosMod/Effects/db/Misc/MiscCocktail.cpp b/ChaosMod/Effects/db/Misc/MiscCocktail.cpp index 1595fe712..6c5ed1cde 100644 --- a/ChaosMod/Effects/db/Misc/MiscCocktail.cpp +++ b/ChaosMod/Effects/db/Misc/MiscCocktail.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + #define PI 3.14159265 CHAOS_VAR float x, y; @@ -36,7 +38,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Cocktail Shaker", .Id = "cocktail_shaker", diff --git a/ChaosMod/Effects/db/Misc/MiscEarthquake.cpp b/ChaosMod/Effects/db/Misc/MiscEarthquake.cpp index 833924b1e..240b7fbd0 100644 --- a/ChaosMod/Effects/db/Misc/MiscEarthquake.cpp +++ b/ChaosMod/Effects/db/Misc/MiscEarthquake.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" #include "Util/XInput.h" @@ -42,7 +43,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Earthquake", .Id = "misc_earthquake", diff --git a/ChaosMod/Effects/db/Misc/MiscEsp.cpp b/ChaosMod/Effects/db/Misc/MiscEsp.cpp index dea11a722..0f84663e6 100644 --- a/ChaosMod/Effects/db/Misc/MiscEsp.cpp +++ b/ChaosMod/Effects/db/Misc/MiscEsp.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Color.h" #include "Util/Types.h" @@ -93,7 +94,7 @@ static void OnTick() } } -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "ESP", .Id = "misc_esp", diff --git a/ChaosMod/Effects/db/Misc/MiscFakeCrash.cpp b/ChaosMod/Effects/db/Misc/MiscFakeCrash.cpp index 9dbfb48aa..bac8941bf 100644 --- a/ChaosMod/Effects/db/Misc/MiscFakeCrash.cpp +++ b/ChaosMod/Effects/db/Misc/MiscFakeCrash.cpp @@ -1,6 +1,7 @@ #include #include "Components/EffectDispatchTimer.h" +#include "Effects/Register/RegisterEffect.h" static void SleepAllThreads(DWORD ms) { @@ -75,7 +76,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Fake Crash", .Id = "misc_fakecrash", diff --git a/ChaosMod/Effects/db/Misc/MiscFireworks.cpp b/ChaosMod/Effects/db/Misc/MiscFireworks.cpp index 4050588ef..318749ede 100644 --- a/ChaosMod/Effects/db/Misc/MiscFireworks.cpp +++ b/ChaosMod/Effects/db/Misc/MiscFireworks.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR int last_firework = 0; static void OnStart() @@ -43,7 +45,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Fireworks!", .Id = "misc_fireworks", diff --git a/ChaosMod/Effects/db/Misc/MiscFlamethrower.cpp b/ChaosMod/Effects/db/Misc/MiscFlamethrower.cpp index ad039a730..2d2a9a958 100644 --- a/ChaosMod/Effects/db/Misc/MiscFlamethrower.cpp +++ b/ChaosMod/Effects/db/Misc/MiscFlamethrower.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + struct ShooterInfo { float FullDuration = 0; @@ -91,7 +93,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Flamethrowers", .Id = "misc_flamethrower", diff --git a/ChaosMod/Effects/db/Misc/MiscFpsLimit.cpp b/ChaosMod/Effects/db/Misc/MiscFpsLimit.cpp index 9a481c4a1..fb6787413 100644 --- a/ChaosMod/Effects/db/Misc/MiscFpsLimit.cpp +++ b/ChaosMod/Effects/db/Misc/MiscFpsLimit.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + /* Effect by Last0xygen */ @@ -15,7 +17,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Console Experience", .Id = "misc_fps_limit", diff --git a/ChaosMod/Effects/db/Misc/MiscGetTowed.cpp b/ChaosMod/Effects/db/Misc/MiscGetTowed.cpp index 457ef60f8..ec32288a5 100644 --- a/ChaosMod/Effects/db/Misc/MiscGetTowed.cpp +++ b/ChaosMod/Effects/db/Misc/MiscGetTowed.cpp @@ -4,6 +4,8 @@ Effect by Last0xygen #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const Hash tonyaHash = "ig_tonya"_hash; @@ -53,7 +55,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Get Towed", .Id = "misc_get_towed", diff --git a/ChaosMod/Effects/db/Misc/MiscGhostWorld.cpp b/ChaosMod/Effects/db/Misc/MiscGhostWorld.cpp index a61084b6e..4fd9bbe8b 100644 --- a/ChaosMod/Effects/db/Misc/MiscGhostWorld.cpp +++ b/ChaosMod/Effects/db/Misc/MiscGhostWorld.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static int GetAlphaForEntity(Entity entity) { return ((sin((entity * 20) + (GET_GAME_TIMER() / 125)) + 1) / 2) * 255; @@ -34,7 +36,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Ghost Town", .Id = "misc_ghost_world", diff --git a/ChaosMod/Effects/db/Misc/MiscGoToJail.cpp b/ChaosMod/Effects/db/Misc/MiscGoToJail.cpp index d1a8c3258..70cf1c37b 100644 --- a/ChaosMod/Effects/db/Misc/MiscGoToJail.cpp +++ b/ChaosMod/Effects/db/Misc/MiscGoToJail.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" CHAOS_VAR const Vector3 destination = Vector3::Init(473.1f, -1023.5f, 28.1f); static void OnStart() @@ -25,7 +26,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Bad Boys", .Id = "misc_go_to_jail", diff --git a/ChaosMod/Effects/db/Misc/MiscGravityController.cpp b/ChaosMod/Effects/db/Misc/MiscGravityController.cpp index 231d6ad00..b8d1dbd72 100644 --- a/ChaosMod/Effects/db/Misc/MiscGravityController.cpp +++ b/ChaosMod/Effects/db/Misc/MiscGravityController.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Gravity.h" #include "Memory/Physics.h" @@ -20,7 +21,7 @@ static void OnTickLow() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickLow, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickLow, { .Name = "Low Gravity", .Id = "lowgravity", @@ -37,7 +38,7 @@ static void OnTickVeryLow() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickVeryLow, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickVeryLow, { .Name = "Very Low Gravity", .Id = "verylowgravity", @@ -67,7 +68,7 @@ static void OnTickInsane() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickInsane, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickInsane, { .Name = "Insane Gravity", .Id = "insanegravity", @@ -102,7 +103,7 @@ static void OnTickInvert() } // clang-format off -REGISTER_EFFECT(OnStartInvert, OnStop, OnTickInvert, EffectInfo +REGISTER_EFFECT(OnStartInvert, OnStop, OnTickInvert, { .Name = "Invert Gravity", .Id = "invertgravity", @@ -155,7 +156,7 @@ static void OnTickSideways() } // clang-format off -REGISTER_EFFECT(OnStartSideways, OnStop, OnTickSideways, EffectInfo +REGISTER_EFFECT(OnStartSideways, OnStop, OnTickSideways, { .Name = "Sideways Gravity", .Id = "misc_sideways_gravity", @@ -213,7 +214,7 @@ static void OnTickRandom() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickRandom, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickRandom, { .Name = "Random Gravity", .Id = "misc_randomgravity", diff --git a/ChaosMod/Effects/db/Misc/MiscHighPitch.cpp b/ChaosMod/Effects/db/Misc/MiscHighPitch.cpp index 19e605daa..25964d82f 100644 --- a/ChaosMod/Effects/db/Misc/MiscHighPitch.cpp +++ b/ChaosMod/Effects/db/Misc/MiscHighPitch.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/AudioPitchHook.h" CHAOS_VAR int ms_TargetPitch; @@ -20,7 +21,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "High Pitch", .Id = "misc_highpitch", diff --git a/ChaosMod/Effects/db/Misc/MiscIntenseMusic.cpp b/ChaosMod/Effects/db/Misc/MiscIntenseMusic.cpp index e3de82546..74feef590 100644 --- a/ChaosMod/Effects/db/Misc/MiscIntenseMusic.cpp +++ b/ChaosMod/Effects/db/Misc/MiscIntenseMusic.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { TRIGGER_MUSIC_EVENT("AW_LOBBY_MUSIC_START"); @@ -11,7 +13,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Play Arena Wars Theme", .Id = "player_arenawarstheme", diff --git a/ChaosMod/Effects/db/Misc/MiscInvertVelocity.cpp b/ChaosMod/Effects/db/Misc/MiscInvertVelocity.cpp index 83c9f4555..c89651f16 100644 --- a/ChaosMod/Effects/db/Misc/MiscInvertVelocity.cpp +++ b/ChaosMod/Effects/db/Misc/MiscInvertVelocity.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { std::vector entities; @@ -22,7 +24,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Invert Current Velocity", .Id = "invertvelocity" diff --git a/ChaosMod/Effects/db/Misc/MiscJumpyProps.cpp b/ChaosMod/Effects/db/Misc/MiscJumpyProps.cpp index 5cba399d1..3ba54f870 100644 --- a/ChaosMod/Effects/db/Misc/MiscJumpyProps.cpp +++ b/ChaosMod/Effects/db/Misc/MiscJumpyProps.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + struct PropData { float originalZ; @@ -47,7 +49,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Jumpy Props", .Id = "misc_jumpy_props", diff --git a/ChaosMod/Effects/db/Misc/MiscLag.cpp b/ChaosMod/Effects/db/Misc/MiscLag.cpp index bd41db862..1ede8057e 100644 --- a/ChaosMod/Effects/db/Misc/MiscLag.cpp +++ b/ChaosMod/Effects/db/Misc/MiscLag.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR int ms_State; CHAOS_VAR std::map ms_ToTpPeds; CHAOS_VAR std::map ms_ToTpVehs; @@ -77,7 +79,7 @@ static void OnTickLag() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTickLag, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTickLag, { .Name = "Lag", .Id = "time_lag", diff --git a/ChaosMod/Effects/db/Misc/MiscLowPitch.cpp b/ChaosMod/Effects/db/Misc/MiscLowPitch.cpp index 5b5623252..f092f2cf0 100644 --- a/ChaosMod/Effects/db/Misc/MiscLowPitch.cpp +++ b/ChaosMod/Effects/db/Misc/MiscLowPitch.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/AudioPitchHook.h" // Effect by ProfessorBiddle, but the code is pretty much copied and pasted @@ -22,7 +23,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Low Pitch", .Id = "misc_lowpitch", diff --git a/ChaosMod/Effects/db/Misc/MiscLowPoly.cpp b/ChaosMod/Effects/db/Misc/MiscLowPoly.cpp index cb40b7608..b786c9688 100644 --- a/ChaosMod/Effects/db/Misc/MiscLowPoly.cpp +++ b/ChaosMod/Effects/db/Misc/MiscLowPoly.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { OVERRIDE_LODSCALE_THIS_FRAME(1.f); @@ -16,7 +18,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Low Render Distance", .Id = "world_lowpoly", diff --git a/ChaosMod/Effects/db/Misc/MiscMeteorRain.cpp b/ChaosMod/Effects/db/Misc/MiscMeteorRain.cpp index f438c737b..aff2915bc 100644 --- a/ChaosMod/Effects/db/Misc/MiscMeteorRain.cpp +++ b/ChaosMod/Effects/db/Misc/MiscMeteorRain.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnTick() @@ -84,7 +85,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Meteor Shower", .Id = "meteorrain", diff --git a/ChaosMod/Effects/db/Misc/MiscMidasTouch.cpp b/ChaosMod/Effects/db/Misc/MiscMidasTouch.cpp index c3c17e720..0fed90b82 100644 --- a/ChaosMod/Effects/db/Misc/MiscMidasTouch.cpp +++ b/ChaosMod/Effects/db/Misc/MiscMidasTouch.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { Ped playerPed = PLAYER_PED_ID(); @@ -94,7 +96,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Midas Touch", .Id = "misc_midas", diff --git a/ChaosMod/Effects/db/Misc/MiscMoneyRain.cpp b/ChaosMod/Effects/db/Misc/MiscMoneyRain.cpp index c141744a3..ecf8b57e4 100644 --- a/ChaosMod/Effects/db/Misc/MiscMoneyRain.cpp +++ b/ChaosMod/Effects/db/Misc/MiscMoneyRain.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_MODEL_AS_NO_LONGER_NEEDED("prop_money_bag_01"_hash); @@ -17,7 +19,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Money Rain", .Id = "player_moneydrops", diff --git a/ChaosMod/Effects/db/Misc/MiscMuffledAudio.cpp b/ChaosMod/Effects/db/Misc/MiscMuffledAudio.cpp index a2c31340a..40f4f1865 100644 --- a/ChaosMod/Effects/db/Misc/MiscMuffledAudio.cpp +++ b/ChaosMod/Effects/db/Misc/MiscMuffledAudio.cpp @@ -3,6 +3,7 @@ */ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/AudioClearnessHook.h" static void OnStart() @@ -16,7 +17,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Muffled Audio", .Id = "misc_muffled_audio", diff --git a/ChaosMod/Effects/db/Misc/MiscNewsTeam.cpp b/ChaosMod/Effects/db/Misc/MiscNewsTeam.cpp index 68a593cd9..fe8928bc0 100644 --- a/ChaosMod/Effects/db/Misc/MiscNewsTeam.cpp +++ b/ChaosMod/Effects/db/Misc/MiscNewsTeam.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static Vector3 GetCoordsAround(Vector3 pos, float radius) { int randOffset = g_Random.GetRandomInt(0, 360); @@ -160,7 +162,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "News Team", .Id = "misc_news_team", diff --git a/ChaosMod/Effects/db/Misc/MiscNoPhone.cpp b/ChaosMod/Effects/db/Misc/MiscNoPhone.cpp index 090d2f410..18da2a784 100644 --- a/ChaosMod/Effects/db/Misc/MiscNoPhone.cpp +++ b/ChaosMod/Effects/db/Misc/MiscNoPhone.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { REQUEST_SCRIPT("cellphone_controller"); @@ -18,7 +20,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "No Phone", .Id = "player_nophone", diff --git a/ChaosMod/Effects/db/Misc/MiscNoSky.cpp b/ChaosMod/Effects/db/Misc/MiscNoSky.cpp index b18ddbbee..f83804f97 100644 --- a/ChaosMod/Effects/db/Misc/MiscNoSky.cpp +++ b/ChaosMod/Effects/db/Misc/MiscNoSky.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Misc.h" static void OnTick() @@ -13,7 +14,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "No Sky", .Id = "misc_nosky", diff --git a/ChaosMod/Effects/db/Misc/MiscNoWater.cpp b/ChaosMod/Effects/db/Misc/MiscNoWater.cpp index a9960e326..daf1faa5c 100644 --- a/ChaosMod/Effects/db/Misc/MiscNoWater.cpp +++ b/ChaosMod/Effects/db/Misc/MiscNoWater.cpp @@ -5,6 +5,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + struct CWaterQuad { short MinX; // 0x0 @@ -54,7 +56,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Drought", .Id = "misc_remove_water", diff --git a/ChaosMod/Effects/db/Misc/MiscNoWaypoint.cpp b/ChaosMod/Effects/db/Misc/MiscNoWaypoint.cpp index ad9385d8e..fc726a903 100644 --- a/ChaosMod/Effects/db/Misc/MiscNoWaypoint.cpp +++ b/ChaosMod/Effects/db/Misc/MiscNoWaypoint.cpp @@ -4,13 +4,15 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { _DELETE_WAYPOINT(); } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Remove Waypoint", .Id = "misc_nowaypoint" diff --git a/ChaosMod/Effects/db/Misc/MiscNothing.cpp b/ChaosMod/Effects/db/Misc/MiscNothing.cpp index 7def51a5a..a9439a310 100644 --- a/ChaosMod/Effects/db/Misc/MiscNothing.cpp +++ b/ChaosMod/Effects/db/Misc/MiscNothing.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR const std::array options = { "Nothing", "All Peds Are Peds", "Teleport To Current Location", @@ -32,7 +34,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Nothing", .Id = "nothing", diff --git a/ChaosMod/Effects/db/Misc/MiscOilLeaks.cpp b/ChaosMod/Effects/db/Misc/MiscOilLeaks.cpp index b5b187eea..80d18aee3 100644 --- a/ChaosMod/Effects/db/Misc/MiscOilLeaks.cpp +++ b/ChaosMod/Effects/db/Misc/MiscOilLeaks.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { std::vector entities; @@ -47,7 +49,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Oil Trails", .Id = "misc_oilleaks", diff --git a/ChaosMod/Effects/db/Misc/MiscOneShot.cpp b/ChaosMod/Effects/db/Misc/MiscOneShot.cpp index f5b177b62..9ecef924d 100644 --- a/ChaosMod/Effects/db/Misc/MiscOneShot.cpp +++ b/ChaosMod/Effects/db/Misc/MiscOneShot.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped ped : GetAllPeds()) @@ -25,7 +27,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "One Bullet Mags", .Id = "misc_onebullet", diff --git a/ChaosMod/Effects/db/Misc/MiscPause.cpp b/ChaosMod/Effects/db/Misc/MiscPause.cpp index ddcd899a3..948c8e9d3 100644 --- a/ChaosMod/Effects/db/Misc/MiscPause.cpp +++ b/ChaosMod/Effects/db/Misc/MiscPause.cpp @@ -1,12 +1,14 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { _SET_CONTROL_NORMAL(0, 199, 1.f); } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Pause", .Id = "misc_pause" diff --git a/ChaosMod/Effects/db/Misc/MiscPayRespects.cpp b/ChaosMod/Effects/db/Misc/MiscPayRespects.cpp index b21552218..475de4283 100644 --- a/ChaosMod/Effects/db/Misc/MiscPayRespects.cpp +++ b/ChaosMod/Effects/db/Misc/MiscPayRespects.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include #include @@ -86,7 +87,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Pay Respects", .Id = "misc_pay_respects", diff --git a/ChaosMod/Effects/db/Misc/MiscPortraitMode.cpp b/ChaosMod/Effects/db/Misc/MiscPortraitMode.cpp index 5ae45a769..a330c3183 100644 --- a/ChaosMod/Effects/db/Misc/MiscPortraitMode.cpp +++ b/ChaosMod/Effects/db/Misc/MiscPortraitMode.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR const double maxBoxWidth = 0.35; CHAOS_VAR double currentBoxWidth = 0; @@ -21,7 +23,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Portrait Mode", .Id = "misc_portrait", diff --git a/ChaosMod/Effects/db/Misc/MiscQuickSprunkStop.cpp b/ChaosMod/Effects/db/Misc/MiscQuickSprunkStop.cpp index 709c1538f..b52e4af0d 100644 --- a/ChaosMod/Effects/db/Misc/MiscQuickSprunkStop.cpp +++ b/ChaosMod/Effects/db/Misc/MiscQuickSprunkStop.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR const char *scriptName = "ob_vend1"; static void OnStart() @@ -22,7 +24,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Quick Sprunk Stop", .Id = "misc_quick_sprunk_stop", diff --git a/ChaosMod/Effects/db/Misc/MiscRainbowWeps.cpp b/ChaosMod/Effects/db/Misc/MiscRainbowWeps.cpp index 8036c4cc5..53c2d807b 100644 --- a/ChaosMod/Effects/db/Misc/MiscRainbowWeps.cpp +++ b/ChaosMod/Effects/db/Misc/MiscRainbowWeps.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { static auto lastTick = GET_GAME_TIMER(); @@ -23,7 +25,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Rainbow Weapons", .Id = "peds_rainbowweps", diff --git a/ChaosMod/Effects/db/Misc/MiscRampJam.cpp b/ChaosMod/Effects/db/Misc/MiscRampJam.cpp index 1bb10e9b8..a57a5f0e2 100644 --- a/ChaosMod/Effects/db/Misc/MiscRampJam.cpp +++ b/ChaosMod/Effects/db/Misc/MiscRampJam.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" #include "Util/HelpText.h" @@ -35,7 +36,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Ramp Jam", .Id = "misc_rampjam", diff --git a/ChaosMod/Effects/db/Misc/MiscRandomWaypoint.cpp b/ChaosMod/Effects/db/Misc/MiscRandomWaypoint.cpp index d55d82a8e..1c49f908e 100644 --- a/ChaosMod/Effects/db/Misc/MiscRandomWaypoint.cpp +++ b/ChaosMod/Effects/db/Misc/MiscRandomWaypoint.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + // Effect by Netux static void OnStart() @@ -17,7 +19,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Set Random Waypoint", .Id = "misc_random_waypoint" diff --git a/ChaosMod/Effects/db/Misc/MiscRollCredits.cpp b/ChaosMod/Effects/db/Misc/MiscRollCredits.cpp index 1a083c709..748e69c9f 100644 --- a/ChaosMod/Effects/db/Misc/MiscRollCredits.cpp +++ b/ChaosMod/Effects/db/Misc/MiscRollCredits.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { REQUEST_ADDITIONAL_TEXT("CREDIT", 0); @@ -47,7 +49,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Roll Credits", .Id = "misc_credits", diff --git a/ChaosMod/Effects/db/Misc/MiscSolidProps.cpp b/ChaosMod/Effects/db/Misc/MiscSolidProps.cpp index e2f916464..07247aac4 100644 --- a/ChaosMod/Effects/db/Misc/MiscSolidProps.cpp +++ b/ChaosMod/Effects/db/Misc/MiscSolidProps.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Entity prop : GetAllProps()) @@ -17,7 +19,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Solid Props", .Id = "misc_solid_props", diff --git a/ChaosMod/Effects/db/Misc/MiscSpawnController.cpp b/ChaosMod/Effects/db/Misc/MiscSpawnController.cpp index 537a7a161..8ddef87a1 100644 --- a/ChaosMod/Effects/db/Misc/MiscSpawnController.cpp +++ b/ChaosMod/Effects/db/Misc/MiscSpawnController.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void SpawnProp(Hash propHash) { Vector3 playerPos = GET_ENTITY_COORDS(PLAYER_PED_ID(), false); @@ -16,7 +18,7 @@ static void OnStartUFO() } // clang-format off -REGISTER_EFFECT(OnStartUFO, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartUFO, nullptr, nullptr, { .Name = "Spawn UFO", .Id = "misc_spawnufo", @@ -31,7 +33,7 @@ static void OnStartFerrisWheel() } // clang-format off -REGISTER_EFFECT(OnStartFerrisWheel, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFerrisWheel, nullptr, nullptr, { .Name = "Spawn Ferris Wheel", .Id = "misc_spawnferriswheel", diff --git a/ChaosMod/Effects/db/Misc/MiscSpawnOrangeBall.cpp b/ChaosMod/Effects/db/Misc/MiscSpawnOrangeBall.cpp index 7d41ccbd3..63deef483 100644 --- a/ChaosMod/Effects/db/Misc/MiscSpawnOrangeBall.cpp +++ b/ChaosMod/Effects/db/Misc/MiscSpawnOrangeBall.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const Hash ballHash = "prop_juicestand"_hash; @@ -29,7 +31,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Orange Ball", .Id = "misc_spawn_orange_ball", diff --git a/ChaosMod/Effects/db/Misc/MiscSpinningProps.cpp b/ChaosMod/Effects/db/Misc/MiscSpinningProps.cpp index e3eb9a768..5cc317e8f 100644 --- a/ChaosMod/Effects/db/Misc/MiscSpinningProps.cpp +++ b/ChaosMod/Effects/db/Misc/MiscSpinningProps.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + // Degrees per millisecond, current value means 1.3 full rotations per second CHAOS_VAR constexpr float ROTATION_SPEED = (1.3f * 360.f) / 1000.f; @@ -28,7 +30,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Spinning Props", .Id = "misc_spinning_props", diff --git a/ChaosMod/Effects/db/Misc/MiscStuffGuns.cpp b/ChaosMod/Effects/db/Misc/MiscStuffGuns.cpp index a3fb45b30..1bd95127b 100644 --- a/ChaosMod/Effects/db/Misc/MiscStuffGuns.cpp +++ b/ChaosMod/Effects/db/Misc/MiscStuffGuns.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" #include "Util/Camera.h" @@ -105,7 +106,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Improvised Weaponry", .Id = "misc_stuffguns", diff --git a/ChaosMod/Effects/db/Misc/MiscSuperStunt.cpp b/ChaosMod/Effects/db/Misc/MiscSuperStunt.cpp index ef0d2f327..48d393add 100644 --- a/ChaosMod/Effects/db/Misc/MiscSuperStunt.cpp +++ b/ChaosMod/Effects/db/Misc/MiscSuperStunt.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Vehicle.h" static void OnStart() @@ -38,7 +39,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Super Stunt", .Id = "misc_superstunt" diff --git a/ChaosMod/Effects/db/Misc/MiscTotalChaos.cpp b/ChaosMod/Effects/db/Misc/MiscTotalChaos.cpp index 5a85543c1..4c7a82a97 100644 --- a/ChaosMod/Effects/db/Misc/MiscTotalChaos.cpp +++ b/ChaosMod/Effects/db/Misc/MiscTotalChaos.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" #include "Util/XInput.h" @@ -90,7 +91,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Doomsday", .Id = "chaosmode", diff --git a/ChaosMod/Effects/db/Misc/MiscUTurn.cpp b/ChaosMod/Effects/db/Misc/MiscUTurn.cpp index 8597cac25..1110d603c 100644 --- a/ChaosMod/Effects/db/Misc/MiscUTurn.cpp +++ b/ChaosMod/Effects/db/Misc/MiscUTurn.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + /* * Effect by juhana */ @@ -44,7 +46,7 @@ static void OnStartFake() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "U-Turn", .Id = "misc_uturn" @@ -53,7 +55,7 @@ REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo // clang-format on // clang-format off -REGISTER_EFFECT(OnStartFake, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFake, nullptr, nullptr, { .Name = "Fake U-Turn", .Id = "misc_fakeuturn", diff --git a/ChaosMod/Effects/db/Misc/MiscVehicleRain.cpp b/ChaosMod/Effects/db/Misc/MiscVehicleRain.cpp index 6e01dd7c6..420bfbdde 100644 --- a/ChaosMod/Effects/db/Misc/MiscVehicleRain.cpp +++ b/ChaosMod/Effects/db/Misc/MiscVehicleRain.cpp @@ -2,6 +2,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Vehicle.h" #include "Util/Vehicle.h" @@ -49,7 +50,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Vehicle Rain", .Id = "misc_vehicle_rain", diff --git a/ChaosMod/Effects/db/Misc/MiscWeirdPitch.cpp b/ChaosMod/Effects/db/Misc/MiscWeirdPitch.cpp index a292cc783..a09e00d26 100644 --- a/ChaosMod/Effects/db/Misc/MiscWeirdPitch.cpp +++ b/ChaosMod/Effects/db/Misc/MiscWeirdPitch.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/AudioPitchHook.h" static void OnStop() @@ -13,7 +14,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Weird Pitch", .Id = "misc_weirdpitch", diff --git a/ChaosMod/Effects/db/Misc/MiscWhaleRain.cpp b/ChaosMod/Effects/db/Misc/MiscWhaleRain.cpp index 57dd2fcdf..60c368927 100644 --- a/ChaosMod/Effects/db/Misc/MiscWhaleRain.cpp +++ b/ChaosMod/Effects/db/Misc/MiscWhaleRain.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnTick() @@ -83,7 +84,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Whale Rain", .Id = "world_whalerain", diff --git a/ChaosMod/Effects/db/Misc/MiscWitnessProtection.cpp b/ChaosMod/Effects/db/Misc/MiscWitnessProtection.cpp index 40b086276..c52960902 100644 --- a/ChaosMod/Effects/db/Misc/MiscWitnessProtection.cpp +++ b/ChaosMod/Effects/db/Misc/MiscWitnessProtection.cpp @@ -4,6 +4,7 @@ Effect by Last0xygen #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Types.h" struct OrbitPed @@ -105,7 +106,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Witness Protection", .Id = "misc_witness_protection", diff --git a/ChaosMod/Effects/db/Peds/Peds2xAnimationSpeed.cpp b/ChaosMod/Effects/db/Peds/Peds2xAnimationSpeed.cpp index 0abd2a1d9..f2aeaa232 100644 --- a/ChaosMod/Effects/db/Peds/Peds2xAnimationSpeed.cpp +++ b/ChaosMod/Effects/db/Peds/Peds2xAnimationSpeed.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped ped : GetAllPeds()) @@ -11,7 +13,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "2x Animation Speed", .Id = "peds_2x_animation_speed", diff --git a/ChaosMod/Effects/db/Peds/PedsAimbot.cpp b/ChaosMod/Effects/db/Peds/PedsAimbot.cpp index c19a9b879..cd5d0809e 100644 --- a/ChaosMod/Effects/db/Peds/PedsAimbot.cpp +++ b/ChaosMod/Effects/db/Peds/PedsAimbot.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (auto ped : GetAllPeds()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Aimbot Peds", .Id = "peds_aimbot", diff --git a/ChaosMod/Effects/db/Peds/PedsAttackPlayer.cpp b/ChaosMod/Effects/db/Peds/PedsAttackPlayer.cpp index 1f1afba1a..36b2180c2 100644 --- a/ChaosMod/Effects/db/Peds/PedsAttackPlayer.cpp +++ b/ChaosMod/Effects/db/Peds/PedsAttackPlayer.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Hash groupHash; @@ -38,7 +40,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "All Peds Attack Player", .Id = "peds_attackplayer", diff --git a/ChaosMod/Effects/db/Peds/PedsBlind.cpp b/ChaosMod/Effects/db/Peds/PedsBlind.cpp index ec12ed77b..87c693afa 100644 --- a/ChaosMod/Effects/db/Peds/PedsBlind.cpp +++ b/ChaosMod/Effects/db/Peds/PedsBlind.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Ped ped : GetAllPeds()) @@ -50,7 +52,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Blind Peds", .Id = "peds_blind", diff --git a/ChaosMod/Effects/db/Peds/PedsBloody.cpp b/ChaosMod/Effects/db/Peds/PedsBloody.cpp index 37c498705..037d56d4d 100644 --- a/ChaosMod/Effects/db/Peds/PedsBloody.cpp +++ b/ChaosMod/Effects/db/Peds/PedsBloody.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" static void OnStart() { for (Ped ped : GetAllPeds()) @@ -27,7 +28,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Everyone Is Bloody", .Id = "peds_bloody" diff --git a/ChaosMod/Effects/db/Peds/PedsBusBois.cpp b/ChaosMod/Effects/db/Peds/PedsBusBois.cpp index 64efbc7d9..9e624adeb 100644 --- a/ChaosMod/Effects/db/Peds/PedsBusBois.cpp +++ b/ChaosMod/Effects/db/Peds/PedsBusBois.cpp @@ -2,6 +2,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Vehicle.h" static void OnStart() @@ -14,7 +15,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Bus Bois", .Id = "peds_busbois", diff --git a/ChaosMod/Effects/db/Peds/PedsCatGuns.cpp b/ChaosMod/Effects/db/Peds/PedsCatGuns.cpp index cc3c4461e..622067a7b 100644 --- a/ChaosMod/Effects/db/Peds/PedsCatGuns.cpp +++ b/ChaosMod/Effects/db/Peds/PedsCatGuns.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" #include "Util/Camera.h" @@ -61,7 +62,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Catto Guns", .Id = "peds_catguns", diff --git a/ChaosMod/Effects/db/Peds/PedsCops.cpp b/ChaosMod/Effects/db/Peds/PedsCops.cpp index 129fd67df..519eff85e 100644 --- a/ChaosMod/Effects/db/Peds/PedsCops.cpp +++ b/ChaosMod/Effects/db/Peds/PedsCops.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped ped : GetAllPeds()) @@ -12,7 +14,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "All Peds Are Cops", .Id = "peds_cops", diff --git a/ChaosMod/Effects/db/Peds/PedsDriveBackwards.cpp b/ChaosMod/Effects/db/Peds/PedsDriveBackwards.cpp index 6b8cadb1d..dc5bca9fe 100644 --- a/ChaosMod/Effects/db/Peds/PedsDriveBackwards.cpp +++ b/ChaosMod/Effects/db/Peds/PedsDriveBackwards.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { static unsigned int constexpr DRIVING_STYLE = 1024; // "Drive in reverse gear" bit @@ -14,7 +16,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Peds Drive Backwards", .Id = "peds_drive_backwards", diff --git a/ChaosMod/Effects/db/Peds/PedsDrivebyPlayer.cpp b/ChaosMod/Effects/db/Peds/PedsDrivebyPlayer.cpp index 60f19edf0..435f2411a 100644 --- a/ChaosMod/Effects/db/Peds/PedsDrivebyPlayer.cpp +++ b/ChaosMod/Effects/db/Peds/PedsDrivebyPlayer.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { Ped playerPed = PLAYER_PED_ID(); @@ -18,7 +20,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Peds Drive-By Player", .Id = "peds_driveby", diff --git a/ChaosMod/Effects/db/Peds/PedsEternalScreams.cpp b/ChaosMod/Effects/db/Peds/PedsEternalScreams.cpp index 0e61b3de2..d770b6b7d 100644 --- a/ChaosMod/Effects/db/Peds/PedsEternalScreams.cpp +++ b/ChaosMod/Effects/db/Peds/PedsEternalScreams.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped ped : GetAllPeds()) @@ -11,7 +13,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Eternal Screams", .Id = "peds_eternal_screams", diff --git a/ChaosMod/Effects/db/Peds/PedsEveryoneWepController.cpp b/ChaosMod/Effects/db/Peds/PedsEveryoneWepController.cpp index 1b77dd7c8..f19f01e0e 100644 --- a/ChaosMod/Effects/db/Peds/PedsEveryoneWepController.cpp +++ b/ChaosMod/Effects/db/Peds/PedsEveryoneWepController.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/WeaponPool.h" static void OnStartRPG() @@ -12,7 +13,7 @@ static void OnStartRPG() } // clang-format off -REGISTER_EFFECT(OnStartRPG, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRPG, nullptr, nullptr, { .Name = "Give Everyone An RPG", .Id = "peds_giverpg", @@ -31,7 +32,7 @@ static void OnStartTazer() } // clang-format off -REGISTER_EFFECT(OnStartTazer, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartTazer, nullptr, nullptr, { .Name = "Give Everyone A Stun Gun", .Id = "peds_stungun", @@ -50,7 +51,7 @@ static void OnStartMinigun() } // clang-format off -REGISTER_EFFECT(OnStartMinigun, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMinigun, nullptr, nullptr, { .Name = "Give Everyone A Minigun", .Id = "peds_minigun", @@ -69,7 +70,7 @@ static void OnStartUpNAtomizer() } // clang-format off -REGISTER_EFFECT(OnStartUpNAtomizer, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartUpNAtomizer, nullptr, nullptr, { .Name = "Give Everyone An Up-N-Atomizer", .Id = "peds_upnatomizer", @@ -91,7 +92,7 @@ static void OnStartRandom() } // clang-format off -REGISTER_EFFECT(OnStartRandom, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRandom, nullptr, nullptr, { .Name = "Give Everyone A Random Weapon", .Id = "peds_randomwep", @@ -112,7 +113,7 @@ static void OnStartRailgun() } // clang-format off -REGISTER_EFFECT(OnStartRailgun, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRailgun, nullptr, nullptr, { .Name = "Give Everyone A Railgun", .Id = "peds_railgun", @@ -133,7 +134,7 @@ static void OnStartBattleAxe() } // clang-format off -REGISTER_EFFECT(OnStartBattleAxe, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartBattleAxe, nullptr, nullptr, { .Name = "Give Everyone A Battle Axe", .Id = "peds_battleaxe", diff --git a/ChaosMod/Effects/db/Peds/PedsExitVeh.cpp b/ChaosMod/Effects/db/Peds/PedsExitVeh.cpp index ae7fb6c4d..4a3867622 100644 --- a/ChaosMod/Effects/db/Peds/PedsExitVeh.cpp +++ b/ChaosMod/Effects/db/Peds/PedsExitVeh.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Ped ped : GetAllPeds()) @@ -14,7 +16,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Everyone Exits Their Vehicles", .Id = "playerveh_exit" diff --git a/ChaosMod/Effects/db/Peds/PedsExplosive.cpp b/ChaosMod/Effects/db/Peds/PedsExplosive.cpp index 3f1fcf263..e35b308c2 100644 --- a/ChaosMod/Effects/db/Peds/PedsExplosive.cpp +++ b/ChaosMod/Effects/db/Peds/PedsExplosive.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped ped : GetAllPeds()) @@ -22,7 +24,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Explosive Peds", .Id = "peds_explosive", diff --git a/ChaosMod/Effects/db/Peds/PedsExplosiveCombat.cpp b/ChaosMod/Effects/db/Peds/PedsExplosiveCombat.cpp index d17dbc9bb..8d3969b95 100644 --- a/ChaosMod/Effects/db/Peds/PedsExplosiveCombat.cpp +++ b/ChaosMod/Effects/db/Peds/PedsExplosiveCombat.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { Player player = PLAYER_ID(); @@ -15,7 +17,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Explosive Combat", .Id = "player_explosivecombat", diff --git a/ChaosMod/Effects/db/Peds/PedsFlipAll.cpp b/ChaosMod/Effects/db/Peds/PedsFlipAll.cpp index f15c47932..6d17f7a7b 100644 --- a/ChaosMod/Effects/db/Peds/PedsFlipAll.cpp +++ b/ChaosMod/Effects/db/Peds/PedsFlipAll.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + /* Effect by ProfessorBiddle */ @@ -19,7 +21,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Spinning Peds", .Id = "peds_flip", diff --git a/ChaosMod/Effects/db/Peds/PedsFollowPlayer.cpp b/ChaosMod/Effects/db/Peds/PedsFollowPlayer.cpp index c3dfaa22b..088305434 100644 --- a/ChaosMod/Effects/db/Peds/PedsFollowPlayer.cpp +++ b/ChaosMod/Effects/db/Peds/PedsFollowPlayer.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR Vehicle ms_SavedPlayerVeh; static void OnStart() @@ -71,7 +73,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "You Are Famous", .Id = "player_famous", diff --git a/ChaosMod/Effects/db/Peds/PedsFrozen.cpp b/ChaosMod/Effects/db/Peds/PedsFrozen.cpp index 447414aa9..a08c1e088 100644 --- a/ChaosMod/Effects/db/Peds/PedsFrozen.cpp +++ b/ChaosMod/Effects/db/Peds/PedsFrozen.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (Ped ped : GetAllPeds()) @@ -67,7 +69,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Peds Are Brainless", .Id = "peds_frozen", diff --git a/ChaosMod/Effects/db/Peds/PedsGiveProps.cpp b/ChaosMod/Effects/db/Peds/PedsGiveProps.cpp index 1e0800aa5..4cad4fd98 100644 --- a/ChaosMod/Effects/db/Peds/PedsGiveProps.cpp +++ b/ChaosMod/Effects/db/Peds/PedsGiveProps.cpp @@ -3,6 +3,8 @@ */ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::vector models; static void OnStart() @@ -34,7 +36,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Give Everyone A Random Prop", .Id = "peds_give_props" diff --git a/ChaosMod/Effects/db/Peds/PedsGrappleGuns.cpp b/ChaosMod/Effects/db/Peds/PedsGrappleGuns.cpp index c690e8d5c..0558189d2 100644 --- a/ChaosMod/Effects/db/Peds/PedsGrappleGuns.cpp +++ b/ChaosMod/Effects/db/Peds/PedsGrappleGuns.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Ped ped : GetAllPeds()) @@ -95,7 +97,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Gravity Guns", .Id = "peds_grapple_guns", diff --git a/ChaosMod/Effects/db/Peds/PedsGunsmoke.cpp b/ChaosMod/Effects/db/Peds/PedsGunsmoke.cpp index d9f478618..b4e27a453 100644 --- a/ChaosMod/Effects/db/Peds/PedsGunsmoke.cpp +++ b/ChaosMod/Effects/db/Peds/PedsGunsmoke.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { REQUEST_NAMED_PTFX_ASSET("scr_sr_tr"); @@ -23,7 +25,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Gunsmoke", .Id = "peds_gunsmoke", diff --git a/ChaosMod/Effects/db/Peds/PedsHandsUp.cpp b/ChaosMod/Effects/db/Peds/PedsHandsUp.cpp index 80a49acc9..84a90ea02 100644 --- a/ChaosMod/Effects/db/Peds/PedsHandsUp.cpp +++ b/ChaosMod/Effects/db/Peds/PedsHandsUp.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + /* * Effect by Juhana */ @@ -19,7 +21,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Hands Up!", .Id = "peds_hands_up" diff --git a/ChaosMod/Effects/db/Peds/PedsHeadless.cpp b/ChaosMod/Effects/db/Peds/PedsHeadless.cpp index 1740fb6a2..3638bd6d8 100644 --- a/ChaosMod/Effects/db/Peds/PedsHeadless.cpp +++ b/ChaosMod/Effects/db/Peds/PedsHeadless.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped ped : GetAllPeds()) @@ -11,7 +13,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Mannequins", .Id = "peds_headless", diff --git a/ChaosMod/Effects/db/Peds/PedsHotCougars.cpp b/ChaosMod/Effects/db/Peds/PedsHotCougars.cpp index 869d29e2d..8d35dc283 100644 --- a/ChaosMod/Effects/db/Peds/PedsHotCougars.cpp +++ b/ChaosMod/Effects/db/Peds/PedsHotCougars.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include #include @@ -90,7 +91,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Hot Cougars In Your Area", .Id = "peds_hotcougars", diff --git a/ChaosMod/Effects/db/Peds/PedsIgniteNearby.cpp b/ChaosMod/Effects/db/Peds/PedsIgniteNearby.cpp index 49302bc5f..b8c34d2b8 100644 --- a/ChaosMod/Effects/db/Peds/PedsIgniteNearby.cpp +++ b/ChaosMod/Effects/db/Peds/PedsIgniteNearby.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Ped ped : GetAllPeds()) @@ -8,7 +10,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Ignite All Nearby Peds", .Id = "peds_ignite", diff --git a/ChaosMod/Effects/db/Peds/PedsInTheHood.cpp b/ChaosMod/Effects/db/Peds/PedsInTheHood.cpp index 096086293..511a91cfc 100644 --- a/ChaosMod/Effects/db/Peds/PedsInTheHood.cpp +++ b/ChaosMod/Effects/db/Peds/PedsInTheHood.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { REMOVE_ANIM_DICT("missfbi3_sniping"); @@ -34,7 +36,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "In The Hood", .Id = "peds_dance", diff --git a/ChaosMod/Effects/db/Peds/PedsIntoRandomVehs.cpp b/ChaosMod/Effects/db/Peds/PedsIntoRandomVehs.cpp index 563c9eeb8..8f37e6e1b 100644 --- a/ChaosMod/Effects/db/Peds/PedsIntoRandomVehs.cpp +++ b/ChaosMod/Effects/db/Peds/PedsIntoRandomVehs.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Ped ped : GetAllPeds()) @@ -53,7 +55,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Set Everyone Into Random Vehicles", .Id = "peds_intorandomvehs" diff --git a/ChaosMod/Effects/db/Peds/PedsInvinciblePeds.cpp b/ChaosMod/Effects/db/Peds/PedsInvinciblePeds.cpp index 3b9070bfc..7971bacf0 100644 --- a/ChaosMod/Effects/db/Peds/PedsInvinciblePeds.cpp +++ b/ChaosMod/Effects/db/Peds/PedsInvinciblePeds.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto ped : GetAllPeds()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Everyone Is Invincible", .Id = "peds_invincible", diff --git a/ChaosMod/Effects/db/Peds/PedsInvisiblePeds.cpp b/ChaosMod/Effects/db/Peds/PedsInvisiblePeds.cpp index a9d1b1189..59a610b38 100644 --- a/ChaosMod/Effects/db/Peds/PedsInvisiblePeds.cpp +++ b/ChaosMod/Effects/db/Peds/PedsInvisiblePeds.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto ped : GetAllPeds()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Everyone Is A Ghost", .Id = "peds_ghost", diff --git a/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp b/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp index 5bdbcfeb8..b979bf1a5 100644 --- a/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp +++ b/ChaosMod/Effects/db/Peds/PedsJamesBond.cpp @@ -5,6 +5,7 @@ #include #include +#include "Effects/Register/RegisterEffect.h" #define PI 3.14159265 static void OnStart() @@ -55,7 +56,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Deadly Agent", .Id = "peds_jamesbond", diff --git a/ChaosMod/Effects/db/Peds/PedsJumpy.cpp b/ChaosMod/Effects/db/Peds/PedsJumpy.cpp index 5b6ca17b7..1e635f532 100644 --- a/ChaosMod/Effects/db/Peds/PedsJumpy.cpp +++ b/ChaosMod/Effects/db/Peds/PedsJumpy.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped ped : GetAllPeds()) @@ -8,7 +10,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Slidy Peds", .Id = "peds_slidy", diff --git a/ChaosMod/Effects/db/Peds/PedsKillerClowns.cpp b/ChaosMod/Effects/db/Peds/PedsKillerClowns.cpp index a376c4f6d..6466b3c4d 100644 --- a/ChaosMod/Effects/db/Peds/PedsKillerClowns.cpp +++ b/ChaosMod/Effects/db/Peds/PedsKillerClowns.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::list clownEnemies; CHAOS_VAR int spawnTimer = -1; CHAOS_VAR Hash relationshipGroup; @@ -112,7 +114,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Killer Clowns", .Id = "peds_killerclowns", diff --git a/ChaosMod/Effects/db/Peds/PedsLaunchNearbyPeds.cpp b/ChaosMod/Effects/db/Peds/PedsLaunchNearbyPeds.cpp index 97e3ff5cd..893db0454 100644 --- a/ChaosMod/Effects/db/Peds/PedsLaunchNearbyPeds.cpp +++ b/ChaosMod/Effects/db/Peds/PedsLaunchNearbyPeds.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + struct SpacePed { SpacePed(Ped ped, Vector3 vel) : Ped(ped), Vel(vel) @@ -42,7 +44,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Launch All Nearby Peds Up", .Id = "peds_launchnearby" diff --git a/ChaosMod/Effects/db/Peds/PedsLooseTrigger.cpp b/ChaosMod/Effects/db/Peds/PedsLooseTrigger.cpp index 999634547..f48e91172 100644 --- a/ChaosMod/Effects/db/Peds/PedsLooseTrigger.cpp +++ b/ChaosMod/Effects/db/Peds/PedsLooseTrigger.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (Ped ped : GetAllPeds()) @@ -49,7 +51,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Loose Triggers", .Id = "peds_loosetrigger", diff --git a/ChaosMod/Effects/db/Peds/PedsMercenaries.cpp b/ChaosMod/Effects/db/Peds/PedsMercenaries.cpp index 4d3984c72..55b7c6d8e 100644 --- a/ChaosMod/Effects/db/Peds/PedsMercenaries.cpp +++ b/ChaosMod/Effects/db/Peds/PedsMercenaries.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + struct EnemyGroup { Vehicle vehicle; @@ -190,7 +192,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Mercenaries", .Id = "peds_mercenaries", diff --git a/ChaosMod/Effects/db/Peds/PedsMinDamage.cpp b/ChaosMod/Effects/db/Peds/PedsMinDamage.cpp index e20036a03..37f798e38 100644 --- a/ChaosMod/Effects/db/Peds/PedsMinDamage.cpp +++ b/ChaosMod/Effects/db/Peds/PedsMinDamage.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { RESET_AI_MELEE_WEAPON_DAMAGE_MODIFIER(); @@ -37,7 +39,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Minimal Damage", .Id = "peds_mindmg", diff --git a/ChaosMod/Effects/db/Peds/PedsMinions.cpp b/ChaosMod/Effects/db/Peds/PedsMinions.cpp index c2a639edd..ed12dc884 100644 --- a/ChaosMod/Effects/db/Peds/PedsMinions.cpp +++ b/ChaosMod/Effects/db/Peds/PedsMinions.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/AudioPitchHook.h" static void OnStop() @@ -25,7 +26,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Minions", .Id = "peds_minions", diff --git a/ChaosMod/Effects/db/Peds/PedsMowerMates.cpp b/ChaosMod/Effects/db/Peds/PedsMowerMates.cpp index 1eec70592..632b11a44 100644 --- a/ChaosMod/Effects/db/Peds/PedsMowerMates.cpp +++ b/ChaosMod/Effects/db/Peds/PedsMowerMates.cpp @@ -2,6 +2,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Vehicle.h" static void OnStart() @@ -11,7 +12,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Mower Mates", .Id = "peds_mowermates" diff --git a/ChaosMod/Effects/db/Peds/PedsNailguns.cpp b/ChaosMod/Effects/db/Peds/PedsNailguns.cpp index 3b9d872cb..d982d82c9 100644 --- a/ChaosMod/Effects/db/Peds/PedsNailguns.cpp +++ b/ChaosMod/Effects/db/Peds/PedsNailguns.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::vector frozenPeds; CHAOS_VAR std::map pedGuns; CHAOS_VAR std::map heldWeapons; @@ -94,7 +96,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Nailguns", .Id = "peds_nailguns", diff --git a/ChaosMod/Effects/db/Peds/PedsNearbyFlee.cpp b/ChaosMod/Effects/db/Peds/PedsNearbyFlee.cpp index 13242f4fc..517421734 100644 --- a/ChaosMod/Effects/db/Peds/PedsNearbyFlee.cpp +++ b/ChaosMod/Effects/db/Peds/PedsNearbyFlee.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { auto playerPed = PLAYER_PED_ID(); @@ -16,7 +18,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "All Nearby Peds Are Fleeing", .Id = "peds_flee" diff --git a/ChaosMod/Effects/db/Peds/PedsNoRagdoll.cpp b/ChaosMod/Effects/db/Peds/PedsNoRagdoll.cpp index 4c513b4dd..43d570251 100644 --- a/ChaosMod/Effects/db/Peds/PedsNoRagdoll.cpp +++ b/ChaosMod/Effects/db/Peds/PedsNoRagdoll.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto ped : GetAllPeds()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "No Ragdoll", .Id = "player_noragdoll", diff --git a/ChaosMod/Effects/db/Peds/PedsNotMenendez.cpp b/ChaosMod/Effects/db/Peds/PedsNotMenendez.cpp index d2ed1157c..dddbff589 100644 --- a/ChaosMod/Effects/db/Peds/PedsNotMenendez.cpp +++ b/ChaosMod/Effects/db/Peds/PedsNotMenendez.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Audio.h" #include @@ -44,7 +45,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Not Menendez!", .Id = "peds_not_menendez", diff --git a/ChaosMod/Effects/db/Peds/PedsOHKO.cpp b/ChaosMod/Effects/db/Peds/PedsOHKO.cpp index 8dd11dbed..efdc884a5 100644 --- a/ChaosMod/Effects/db/Peds/PedsOHKO.cpp +++ b/ChaosMod/Effects/db/Peds/PedsOHKO.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_PLAYER_HEALTH_RECHARGE_MULTIPLIER(PLAYER_ID(), 1.f); @@ -29,7 +31,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "One Hit KO", .Id = "player_ohko", diff --git a/ChaosMod/Effects/db/Peds/PedsObliterateNearby.cpp b/ChaosMod/Effects/db/Peds/PedsObliterateNearby.cpp index c8e3e7483..d95efb3d4 100644 --- a/ChaosMod/Effects/db/Peds/PedsObliterateNearby.cpp +++ b/ChaosMod/Effects/db/Peds/PedsObliterateNearby.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { REQUEST_NAMED_PTFX_ASSET("scr_xm_orbital"); @@ -41,7 +43,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Obliterate All Nearby Peds", .Id = "peds_obliterate" diff --git a/ChaosMod/Effects/db/Peds/PedsPhones.cpp b/ChaosMod/Effects/db/Peds/PedsPhones.cpp index 8a0ec79e2..d9d07ccfd 100644 --- a/ChaosMod/Effects/db/Peds/PedsPhones.cpp +++ b/ChaosMod/Effects/db/Peds/PedsPhones.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (auto ped : GetAllPeds()) @@ -18,7 +20,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Whose Phone Is Ringing?", .Id = "peds_phones", diff --git a/ChaosMod/Effects/db/Peds/PedsPropHunt.cpp b/ChaosMod/Effects/db/Peds/PedsPropHunt.cpp index 9ea73a536..0f81bd847 100644 --- a/ChaosMod/Effects/db/Peds/PedsPropHunt.cpp +++ b/ChaosMod/Effects/db/Peds/PedsPropHunt.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::map pedPropsMap; CHAOS_VAR std::vector availablePropModels; @@ -151,7 +153,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Prop Hunt", .Id = "peds_prop_hunt", diff --git a/ChaosMod/Effects/db/Peds/PedsQuarrelingCouple.cpp b/ChaosMod/Effects/db/Peds/PedsQuarrelingCouple.cpp index 5e9190b31..73f402296 100644 --- a/ChaosMod/Effects/db/Peds/PedsQuarrelingCouple.cpp +++ b/ChaosMod/Effects/db/Peds/PedsQuarrelingCouple.cpp @@ -3,6 +3,7 @@ */ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Peds.h" static void OnStart() @@ -12,7 +13,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Quarreling Couple", .Id = "peds_spawn_quarreling_couple", diff --git a/ChaosMod/Effects/db/Peds/PedsRagdoll.cpp b/ChaosMod/Effects/db/Peds/PedsRagdoll.cpp index 95eab8e68..d52fff986 100644 --- a/ChaosMod/Effects/db/Peds/PedsRagdoll.cpp +++ b/ChaosMod/Effects/db/Peds/PedsRagdoll.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Ped ped : GetAllPeds()) @@ -15,7 +17,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Ragdoll Everyone", .Id = "peds_ragdoll", diff --git a/ChaosMod/Effects/db/Peds/PedsRagdollOnTouch.cpp b/ChaosMod/Effects/db/Peds/PedsRagdollOnTouch.cpp index 4df32acfc..cc1d332aa 100644 --- a/ChaosMod/Effects/db/Peds/PedsRagdollOnTouch.cpp +++ b/ChaosMod/Effects/db/Peds/PedsRagdollOnTouch.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto ped : GetAllPeds()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Sensitive Touch", .Id = "peds_sensitivetouch", diff --git a/ChaosMod/Effects/db/Peds/PedsReflectiveDamage.cpp b/ChaosMod/Effects/db/Peds/PedsReflectiveDamage.cpp index 564eeae94..9e7274f02 100644 --- a/ChaosMod/Effects/db/Peds/PedsReflectiveDamage.cpp +++ b/ChaosMod/Effects/db/Peds/PedsReflectiveDamage.cpp @@ -3,6 +3,8 @@ */ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::unordered_map mappedPeds; static void OnStop() @@ -91,7 +93,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Friendly Fire", .Id = "peds_reflectivedamage", diff --git a/ChaosMod/Effects/db/Peds/PedsReviveNearby.cpp b/ChaosMod/Effects/db/Peds/PedsReviveNearby.cpp index 105db95ab..462ce08dd 100644 --- a/ChaosMod/Effects/db/Peds/PedsReviveNearby.cpp +++ b/ChaosMod/Effects/db/Peds/PedsReviveNearby.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/WeaponPool.h" static void OnStart() @@ -90,7 +91,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Revive Dead Peds", .Id = "peds_revive" diff --git a/ChaosMod/Effects/db/Peds/PedsRiot.cpp b/ChaosMod/Effects/db/Peds/PedsRiot.cpp index d3692b0b7..84b901404 100644 --- a/ChaosMod/Effects/db/Peds/PedsRiot.cpp +++ b/ChaosMod/Effects/db/Peds/PedsRiot.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/WeaponPool.h" static void OnStart() @@ -56,7 +57,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Peds Riot", .Id = "peds_riot", diff --git a/ChaosMod/Effects/db/Peds/PedsScooterBrothers.cpp b/ChaosMod/Effects/db/Peds/PedsScooterBrothers.cpp index cd43dcd5f..7eb2027bd 100644 --- a/ChaosMod/Effects/db/Peds/PedsScooterBrothers.cpp +++ b/ChaosMod/Effects/db/Peds/PedsScooterBrothers.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Vehicle.h" static void OnStart() @@ -9,7 +10,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Scooter Brothers", .Id = "peds_scooterbrothers", diff --git a/ChaosMod/Effects/db/Peds/PedsSlipperyPeds.cpp b/ChaosMod/Effects/db/Peds/PedsSlipperyPeds.cpp index 81e63d730..8005997c0 100644 --- a/ChaosMod/Effects/db/Peds/PedsSlipperyPeds.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSlipperyPeds.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Ped pd : GetAllPeds()) @@ -12,7 +14,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Can't Tie My Shoes", .Id = "peds_slippery_peds", diff --git a/ChaosMod/Effects/db/Peds/PedsSmokeTrails.cpp b/ChaosMod/Effects/db/Peds/PedsSmokeTrails.cpp index 90e20ddcd..c1ef7f9f0 100644 --- a/ChaosMod/Effects/db/Peds/PedsSmokeTrails.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSmokeTrails.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR const char *ptfxDict = "scr_ar_planes"; CHAOS_VAR const char *ptfxName = "scr_ar_trail_smoke"; @@ -45,7 +47,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Smoke Trails", .Id = "peds_smoketrails", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp index be5b3dd96..fd6f3dfad 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryAlien.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + // based on PedsSpawnAngryJesus.cpp static void OnStart() { @@ -54,7 +56,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Angry Alien", .Id = "peds_angryalien", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp index c26f444a8..6afb8b60c 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryChimp.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Peds.h" static void OnStart() @@ -16,7 +17,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Angry Chimp", .Id = "spawn_angry_chimp", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus.cpp index 398bbfb0d..03623c026 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static constexpr Hash modelHash = -835930287; @@ -43,7 +45,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Griefer Jesus", .Id = "spawn_grieferjesus", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp index 2086ed1a6..b994aad8c 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJesus2.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static constexpr Hash modelHash = -835930287; @@ -61,7 +63,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Extreme Griefer Jesus", .Id = "spawn_grieferjesus2", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp index 52f319e41..671a49485 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnAngryJimmy.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static constexpr Hash modelHash = 1459905209; @@ -46,7 +48,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Jealous Jimmy", .Id = "peds_angryjimmy", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnBallaSquad.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnBallaSquad.cpp index 22d627778..9211fb501 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnBallaSquad.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnBallaSquad.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const std::vector ballaNames = { @@ -47,7 +49,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Balla Squad", .Id = "peds_spawnballasquad", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp index e8c6613b2..8b27bb3ce 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnBiker.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Peds.h" #define PI 3.14159265 @@ -37,7 +38,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Biker", .Id = "peds_spawn_biker", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp index 9d147f778..ca9b6069f 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionBrad.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const Hash model = "ig_brad"_hash; @@ -33,7 +35,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Companion Brad", .Id = "spawn_compbrad", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp index 6267f718e..b83b44a50 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChimp.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const Hash modelHash = "a_c_chimp"_hash; @@ -35,7 +37,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Companion Chimp", .Id = "spawn_chimp", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp index b310b1162..b8b21e772 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionChop.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const Hash modelHash = "a_c_chop"_hash; @@ -22,7 +24,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Companion Doggo", .Id = "spawn_chop", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp index 418f8fcbe..efde11ab0 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnCompanionRandom.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Hash relationshipGroup; @@ -29,7 +31,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Random Companion", .Id = "spawn_comprnd", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnDancingApes.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnDancingApes.cpp index 78d2847e3..22587317b 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnDancingApes.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnDancingApes.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + #define DANCING_APES_AMOUNT 3 static void OnStart() @@ -37,7 +39,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Dance Troupe", .Id = "peds_spawndancingapes", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnFanCats.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnFanCats.cpp index 3128093fb..a53135cab 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnFanCats.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnFanCats.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + #define FAN_CATS_AMOUNT 3 static void OnStart() @@ -23,7 +25,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Fan Cats", .Id = "peds_spawnfancats", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp index 766087d48..ed860bbea 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnHostileRandom.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const Hash playerGroup = "PLAYER"_hash; @@ -38,7 +40,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Random Enemy", .Id = "peds_spawnrandomhostile", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp index cd3c21cea..81eb403db 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnImpotentRage.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { static const Hash playerGroup = "PLAYER"_hash; @@ -57,7 +59,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Impotent Rage", .Id = "peds_spawnimrage", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp index de6f8e505..f38fa1207 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnJuggernaut.cpp @@ -4,6 +4,7 @@ Effect by Last0xygen #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Peds.h" static void OnStart() @@ -15,7 +16,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Juggernaut", .Id = "peds_spawn_juggernaut", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp index 383bafc7a..c5bb6c245 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnRoastingLamar.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + /* Effect by Juhana */ @@ -84,7 +86,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Get Roasted", .Id = "peds_roasting", diff --git a/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp b/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp index 25b0f7f69..634c622ca 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpawnSpaceRanger.cpp @@ -4,6 +4,7 @@ Effect by Last0xygen #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Peds.h" static void OnStart() @@ -13,7 +14,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Space Ranger", .Id = "peds_spawn_space_ranger", diff --git a/ChaosMod/Effects/db/Peds/PedsSpeechController.cpp b/ChaosMod/Effects/db/Peds/PedsSpeechController.cpp index 0f87d0092..ecd5e46eb 100644 --- a/ChaosMod/Effects/db/Peds/PedsSpeechController.cpp +++ b/ChaosMod/Effects/db/Peds/PedsSpeechController.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTickFriendly() { static DWORD64 lastTick = 0; @@ -23,7 +25,7 @@ static void OnTickFriendly() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickFriendly, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickFriendly, { .Name = "Friendly Neighborhood", .Id = "peds_sayhi", @@ -56,7 +58,7 @@ static void OnTickUnfriendly() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickUnfriendly, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickUnfriendly, { .Name = "Unfriendly Neighborhood", .Id = "peds_insult", @@ -81,7 +83,7 @@ static void OnTickKifflom() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickKifflom, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickKifflom, { .Name = "Kifflom!", .Id = "peds_kifflom", diff --git a/ChaosMod/Effects/db/Peds/PedsStopAndStare.cpp b/ChaosMod/Effects/db/Peds/PedsStopAndStare.cpp index 86f65a9b0..e77fa28f3 100644 --- a/ChaosMod/Effects/db/Peds/PedsStopAndStare.cpp +++ b/ChaosMod/Effects/db/Peds/PedsStopAndStare.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + /* Effect by ProfessorBiddle */ @@ -25,7 +27,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Stop and Stare", .Id = "peds_stop_stare" diff --git a/ChaosMod/Effects/db/Peds/PedsStripWeapons.cpp b/ChaosMod/Effects/db/Peds/PedsStripWeapons.cpp index 18db579f3..7c5af9aa6 100644 --- a/ChaosMod/Effects/db/Peds/PedsStripWeapons.cpp +++ b/ChaosMod/Effects/db/Peds/PedsStripWeapons.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Ped ped : GetAllPeds()) @@ -7,7 +9,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Remove Weapons From Everyone", .Id = "peds_remweps", diff --git a/ChaosMod/Effects/db/Peds/PedsTPGuns.cpp b/ChaosMod/Effects/db/Peds/PedsTPGuns.cpp index 125bbfdb8..5e1c4a87f 100644 --- a/ChaosMod/Effects/db/Peds/PedsTPGuns.cpp +++ b/ChaosMod/Effects/db/Peds/PedsTPGuns.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Vehicle veh : GetAllVehs()) @@ -77,7 +79,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Portal Guns", .Id = "peds_portal_gun", diff --git a/ChaosMod/Effects/db/Peds/PedsTankBois.cpp b/ChaosMod/Effects/db/Peds/PedsTankBois.cpp index d9e676a43..7ed24ae6a 100644 --- a/ChaosMod/Effects/db/Peds/PedsTankBois.cpp +++ b/ChaosMod/Effects/db/Peds/PedsTankBois.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Vehicle.h" static void OnStart() @@ -13,7 +14,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Tanks A Lot", .Id = "peds_tank_bois", diff --git a/ChaosMod/Effects/db/Peds/PedsToast.cpp b/ChaosMod/Effects/db/Peds/PedsToast.cpp index 94f5da406..8d7ee20d1 100644 --- a/ChaosMod/Effects/db/Peds/PedsToast.cpp +++ b/ChaosMod/Effects/db/Peds/PedsToast.cpp @@ -5,6 +5,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::map pedPropsMap; CHAOS_VAR const int TOAST_MODEL_COUNT = 6; CHAOS_VAR Hash availablePropModels[TOAST_MODEL_COUNT]; @@ -120,7 +122,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "You're Toast", .Id = "peds_toast", diff --git a/ChaosMod/Effects/db/Peds/PedsTpRandomPedsPlayerVeh.cpp b/ChaosMod/Effects/db/Peds/PedsTpRandomPedsPlayerVeh.cpp index 7b23bd268..c3c016191 100644 --- a/ChaosMod/Effects/db/Peds/PedsTpRandomPedsPlayerVeh.cpp +++ b/ChaosMod/Effects/db/Peds/PedsTpRandomPedsPlayerVeh.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -31,7 +33,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Teleport Random Peds Into Current Vehicle", .Id = "playerveh_tprandompeds" diff --git a/ChaosMod/Effects/db/Peds/PedsZombies.cpp b/ChaosMod/Effects/db/Peds/PedsZombies.cpp index e7fa383c0..d7a91a5e2 100644 --- a/ChaosMod/Effects/db/Peds/PedsZombies.cpp +++ b/ChaosMod/Effects/db/Peds/PedsZombies.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::list ms_Zombies; static void OnStart() @@ -101,7 +103,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Explosive Zombies", .Id = "zombies", diff --git a/ChaosMod/Effects/db/Player/PlayerAFK.cpp b/ChaosMod/Effects/db/Player/PlayerAFK.cpp index 45190627f..dc608b037 100644 --- a/ChaosMod/Effects/db/Player/PlayerAFK.cpp +++ b/ChaosMod/Effects/db/Player/PlayerAFK.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { _SET_CONTROL_NORMAL(0, 1, 1.f); @@ -15,7 +17,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "AFK", .Id = "player_afk", diff --git a/ChaosMod/Effects/db/Player/PlayerAimbot.cpp b/ChaosMod/Effects/db/Player/PlayerAimbot.cpp index 173ebbb4d..32b27b160 100644 --- a/ChaosMod/Effects/db/Player/PlayerAimbot.cpp +++ b/ChaosMod/Effects/db/Player/PlayerAimbot.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_PED_INFINITE_AMMO_CLIP(PLAYER_PED_ID(), false); @@ -41,7 +43,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Aimbot", .Id = "player_aimbot", diff --git a/ChaosMod/Effects/db/Player/PlayerAutopilot.cpp b/ChaosMod/Effects/db/Player/PlayerAutopilot.cpp index 7121f9820..89a5911de 100644 --- a/ChaosMod/Effects/db/Player/PlayerAutopilot.cpp +++ b/ChaosMod/Effects/db/Player/PlayerAutopilot.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static enum { STATE_NONE, @@ -340,7 +342,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Autopilot", .Id = "player_break", diff --git a/ChaosMod/Effects/db/Player/PlayerBees.cpp b/ChaosMod/Effects/db/Player/PlayerBees.cpp index 15ea17c80..f29781c53 100644 --- a/ChaosMod/Effects/db/Player/PlayerBees.cpp +++ b/ChaosMod/Effects/db/Player/PlayerBees.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + // Effect by kolyaventuri #define CHANCE 100 // Higher is less chance @@ -59,7 +61,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Bees", .Id = "player_bees", diff --git a/ChaosMod/Effects/db/Player/PlayerBlimpStrats.cpp b/ChaosMod/Effects/db/Player/PlayerBlimpStrats.cpp index b191897d3..28f868b84 100644 --- a/ChaosMod/Effects/db/Player/PlayerBlimpStrats.cpp +++ b/ChaosMod/Effects/db/Player/PlayerBlimpStrats.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ScriptThreadRunHook.h" #include "PlayerBlimpStrats.h" @@ -77,7 +78,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Blimp Strats", .Id = "player_blimp_strats", diff --git a/ChaosMod/Effects/db/Player/PlayerClone.cpp b/ChaosMod/Effects/db/Player/PlayerClone.cpp index 8933b01b2..739f439c8 100644 --- a/ChaosMod/Effects/db/Player/PlayerClone.cpp +++ b/ChaosMod/Effects/db/Player/PlayerClone.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { bool friendly = g_Random.GetRandomInt(0, 1); @@ -47,7 +49,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Clone Player", .Id = "player_clone" diff --git a/ChaosMod/Effects/db/Player/PlayerCopyForce.cpp b/ChaosMod/Effects/db/Player/PlayerCopyForce.cpp index 48a0b8511..5c13b886a 100644 --- a/ChaosMod/Effects/db/Player/PlayerCopyForce.cpp +++ b/ChaosMod/Effects/db/Player/PlayerCopyForce.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR Vector3 playerVelocity; static void OnStart() @@ -55,7 +57,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Use The Force", .Id = "player_copyforce", diff --git a/ChaosMod/Effects/db/Player/PlayerDeadEye.cpp b/ChaosMod/Effects/db/Player/PlayerDeadEye.cpp index 56b10aa05..5e71dffb2 100644 --- a/ChaosMod/Effects/db/Player/PlayerDeadEye.cpp +++ b/ChaosMod/Effects/db/Player/PlayerDeadEye.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Camera.h" struct PedHitInfo @@ -159,7 +160,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Dead Eye", .Id = "player_dead_eye", diff --git a/ChaosMod/Effects/db/Player/PlayerDrunk.cpp b/ChaosMod/Effects/db/Player/PlayerDrunk.cpp index 6b74e3370..0cfa91ff2 100644 --- a/ChaosMod/Effects/db/Player/PlayerDrunk.cpp +++ b/ChaosMod/Effects/db/Player/PlayerDrunk.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { Ped playerPed = PLAYER_PED_ID(); @@ -75,7 +77,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Drunk", .Id = "player_drunk", diff --git a/ChaosMod/Effects/db/Player/PlayerFakeDeath.cpp b/ChaosMod/Effects/db/Player/PlayerFakeDeath.cpp index 1f6345832..9a48963f0 100644 --- a/ChaosMod/Effects/db/Player/PlayerFakeDeath.cpp +++ b/ChaosMod/Effects/db/Player/PlayerFakeDeath.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ScriptThreadRunHook.h" CHAOS_VAR const char *ms_TextPairs[] = { "Just kidding, keep playing", @@ -246,7 +247,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Fake Death", .Id = "player_fakedeath", diff --git a/ChaosMod/Effects/db/Player/PlayerFlingPlayer.cpp b/ChaosMod/Effects/db/Player/PlayerFlingPlayer.cpp index 8c74a9f1f..7a0572753 100644 --- a/ChaosMod/Effects/db/Player/PlayerFlingPlayer.cpp +++ b/ChaosMod/Effects/db/Player/PlayerFlingPlayer.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static float GetRandomForce(bool negativeAllowed) @@ -29,7 +30,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Fling Player", .Id = "player_fling_player" diff --git a/ChaosMod/Effects/db/Player/PlayerForcefield.cpp b/ChaosMod/Effects/db/Player/PlayerForcefield.cpp index 1aed64291..c57d4a8f8 100644 --- a/ChaosMod/Effects/db/Player/PlayerForcefield.cpp +++ b/ChaosMod/Effects/db/Player/PlayerForcefield.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnTick() @@ -44,7 +45,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Forcefield", .Id = "player_forcefield", diff --git a/ChaosMod/Effects/db/Player/PlayerGTA2.cpp b/ChaosMod/Effects/db/Player/PlayerGTA2.cpp index 40f2b16d5..01e567de6 100644 --- a/ChaosMod/Effects/db/Player/PlayerGTA2.cpp +++ b/ChaosMod/Effects/db/Player/PlayerGTA2.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + /* * Effect by kolyaventuri, modified */ @@ -54,7 +56,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "GTA 2", .Id = "player_gta_2", diff --git a/ChaosMod/Effects/db/Player/PlayerGravitySphere.cpp b/ChaosMod/Effects/db/Player/PlayerGravitySphere.cpp index 8edd0b240..ca2e17160 100644 --- a/ChaosMod/Effects/db/Player/PlayerGravitySphere.cpp +++ b/ChaosMod/Effects/db/Player/PlayerGravitySphere.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" CHAOS_VAR float sphereRadius = 10.f; @@ -75,7 +76,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Gravity Sphere", .Id = "player_grav_sphere", diff --git a/ChaosMod/Effects/db/Player/PlayerHacking.cpp b/ChaosMod/Effects/db/Player/PlayerHacking.cpp index 445578806..2aa9f2f4b 100644 --- a/ChaosMod/Effects/db/Player/PlayerHacking.cpp +++ b/ChaosMod/Effects/db/Player/PlayerHacking.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include // These should be 8 characters all uppercase. @@ -270,7 +271,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Realistic Hacking", .Id = "player_hacking" diff --git a/ChaosMod/Effects/db/Player/PlayerHasGravity.cpp b/ChaosMod/Effects/db/Player/PlayerHasGravity.cpp index b8bce04e6..9bbd5ecee 100644 --- a/ChaosMod/Effects/db/Player/PlayerHasGravity.cpp +++ b/ChaosMod/Effects/db/Player/PlayerHasGravity.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnTick() @@ -74,7 +75,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Gravity Field", .Id = "player_gravity", diff --git a/ChaosMod/Effects/db/Player/PlayerHeavyRecoil.cpp b/ChaosMod/Effects/db/Player/PlayerHeavyRecoil.cpp index 97a1ff57a..b62c58909 100644 --- a/ChaosMod/Effects/db/Player/PlayerHeavyRecoil.cpp +++ b/ChaosMod/Effects/db/Player/PlayerHeavyRecoil.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { static float verticalRecoil = 1; @@ -26,7 +28,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Heavy Recoil", .Id = "player_heavyrecoil", diff --git a/ChaosMod/Effects/db/Player/PlayerHesoyam.cpp b/ChaosMod/Effects/db/Player/PlayerHesoyam.cpp index 0f44121cb..8cbdfc627 100644 --- a/ChaosMod/Effects/db/Player/PlayerHesoyam.cpp +++ b/ChaosMod/Effects/db/Player/PlayerHesoyam.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -30,7 +32,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "HESOYAM", .Id = "player_heal" diff --git a/ChaosMod/Effects/db/Player/PlayerIgnitePlayer.cpp b/ChaosMod/Effects/db/Player/PlayerIgnitePlayer.cpp index 7b78a409d..5e6279744 100644 --- a/ChaosMod/Effects/db/Player/PlayerIgnitePlayer.cpp +++ b/ChaosMod/Effects/db/Player/PlayerIgnitePlayer.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -22,7 +24,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Ignite Player", .Id = "player_ignite", diff --git a/ChaosMod/Effects/db/Player/PlayerIllegalInnocence.cpp b/ChaosMod/Effects/db/Player/PlayerIllegalInnocence.cpp index 41270ce80..ea2a0143d 100644 --- a/ChaosMod/Effects/db/Player/PlayerIllegalInnocence.cpp +++ b/ChaosMod/Effects/db/Player/PlayerIllegalInnocence.cpp @@ -6,6 +6,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + #define WAIT_TIME 5000 // ms. before police are angry at your innocence CHAOS_VAR DWORD64 ms_TimeReserve; @@ -96,7 +98,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Innocence Is Illegal", .Id = "player_illegalinnocence", diff --git a/ChaosMod/Effects/db/Player/PlayerImTired.cpp b/ChaosMod/Effects/db/Player/PlayerImTired.cpp index da1ea5482..858daecd4 100644 --- a/ChaosMod/Effects/db/Player/PlayerImTired.cpp +++ b/ChaosMod/Effects/db/Player/PlayerImTired.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + enum TiredMode { closingEyes, @@ -107,7 +109,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "I'm So Tired", .Id = "player_tired", diff --git a/ChaosMod/Effects/db/Player/PlayerInvincibility.cpp b/ChaosMod/Effects/db/Player/PlayerInvincibility.cpp index cf4b9d851..03a0a25cc 100644 --- a/ChaosMod/Effects/db/Player/PlayerInvincibility.cpp +++ b/ChaosMod/Effects/db/Player/PlayerInvincibility.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_PLAYER_INVINCIBLE(PLAYER_ID(), false); @@ -11,7 +13,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Invincibility", .Id = "player_invincible", diff --git a/ChaosMod/Effects/db/Player/PlayerJumpJump.cpp b/ChaosMod/Effects/db/Player/PlayerJumpJump.cpp index b7a9ef394..4e5a7c1f6 100644 --- a/ChaosMod/Effects/db/Player/PlayerJumpJump.cpp +++ b/ChaosMod/Effects/db/Player/PlayerJumpJump.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" CHAOS_VAR int lastCheck = 0; @@ -31,7 +32,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Jump! Jump!", .Id = "player_jump_jump", diff --git a/ChaosMod/Effects/db/Player/PlayerKeepRunning.cpp b/ChaosMod/Effects/db/Player/PlayerKeepRunning.cpp index 7ced49ac0..e6689c0b8 100644 --- a/ChaosMod/Effects/db/Player/PlayerKeepRunning.cpp +++ b/ChaosMod/Effects/db/Player/PlayerKeepRunning.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { SIMULATE_PLAYER_INPUT_GAIT(PLAYER_ID(), 5.f, 100, 1.f, true, false); @@ -35,7 +37,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Help My W Key Is Stuck", .Id = "player_keeprunning", diff --git a/ChaosMod/Effects/db/Player/PlayerKickflip.cpp b/ChaosMod/Effects/db/Player/PlayerKickflip.cpp index 435ab7728..a5605dda8 100644 --- a/ChaosMod/Effects/db/Player/PlayerKickflip.cpp +++ b/ChaosMod/Effects/db/Player/PlayerKickflip.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnStart() @@ -23,7 +24,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Kickflip", .Id = "player_kickflip" diff --git a/ChaosMod/Effects/db/Player/PlayerLagCamera.cpp b/ChaosMod/Effects/db/Player/PlayerLagCamera.cpp index 91a5558bf..fb0e6a17b 100644 --- a/ChaosMod/Effects/db/Player/PlayerLagCamera.cpp +++ b/ChaosMod/Effects/db/Player/PlayerLagCamera.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR int constexpr CAM_DELAY_NORMAL = 250; CHAOS_VAR int constexpr CAM_DELAY_VEHICLE = 1000; @@ -95,7 +97,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Delayed Camera", .Id = "player_laggy_camera", diff --git a/ChaosMod/Effects/db/Player/PlayerLaunchUp.cpp b/ChaosMod/Effects/db/Player/PlayerLaunchUp.cpp index 9f599cead..6dddbdec9 100644 --- a/ChaosMod/Effects/db/Player/PlayerLaunchUp.cpp +++ b/ChaosMod/Effects/db/Player/PlayerLaunchUp.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -23,7 +25,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Launch Player Up", .Id = "player_upupaway" diff --git a/ChaosMod/Effects/db/Player/PlayerLockCamera.cpp b/ChaosMod/Effects/db/Player/PlayerLockCamera.cpp index 1d25cdb8f..fb40c829e 100644 --- a/ChaosMod/Effects/db/Player/PlayerLockCamera.cpp +++ b/ChaosMod/Effects/db/Player/PlayerLockCamera.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { _SET_GAMEPLAY_CAM_RELATIVE_ROTATION(0, 0, 0); @@ -16,7 +18,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Lock Camera", .Id = "player_lockcamera", diff --git a/ChaosMod/Effects/db/Player/PlayerMovementSpeed.cpp b/ChaosMod/Effects/db/Player/PlayerMovementSpeed.cpp index cbfc2c5d5..b7e90e52b 100644 --- a/ChaosMod/Effects/db/Player/PlayerMovementSpeed.cpp +++ b/ChaosMod/Effects/db/Player/PlayerMovementSpeed.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void Override(float value) { SET_PED_MOVE_RATE_OVERRIDE(PLAYER_PED_ID(), value); @@ -11,7 +13,7 @@ static void OnTickx5() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickx5, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickx5, { .Name = "5x Movement Speed", .Id = "player_movementx5", @@ -27,7 +29,7 @@ static void OnTickx10() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickx10, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickx10, { .Name = "10x Movement Speed", .Id = "player_movementx10", @@ -43,7 +45,7 @@ static void OnTickx05() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickx05, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickx05, { .Name = "0.5x Movement Speed", .Id = "player_movementx05", diff --git a/ChaosMod/Effects/db/Player/PlayerNoMovRandom.cpp b/ChaosMod/Effects/db/Player/PlayerNoMovRandom.cpp index a42300796..71dbef8f9 100644 --- a/ChaosMod/Effects/db/Player/PlayerNoMovRandom.cpp +++ b/ChaosMod/Effects/db/Player/PlayerNoMovRandom.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR int rand_key; static void OnStart() @@ -82,7 +84,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Disable Random Direction", .Id = "player_no_random_movement", diff --git a/ChaosMod/Effects/db/Player/PlayerNoSpecial.cpp b/ChaosMod/Effects/db/Player/PlayerNoSpecial.cpp index 77f6021ee..177cd050d 100644 --- a/ChaosMod/Effects/db/Player/PlayerNoSpecial.cpp +++ b/ChaosMod/Effects/db/Player/PlayerNoSpecial.cpp @@ -1,12 +1,14 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { SPECIAL_ABILITY_DEPLETE_METER(PLAYER_ID(), true, 0); } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "No Special Ability", .Id = "player_nospecial", diff --git a/ChaosMod/Effects/db/Player/PlayerNoSprintJump.cpp b/ChaosMod/Effects/db/Player/PlayerNoSprintJump.cpp index af8e7e210..dae2b08e5 100644 --- a/ChaosMod/Effects/db/Player/PlayerNoSprintJump.cpp +++ b/ChaosMod/Effects/db/Player/PlayerNoSprintJump.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { DISABLE_CONTROL_ACTION(0, 21, true); @@ -7,7 +9,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "No Sprint & No Jump", .Id = "player_nosprint", diff --git a/ChaosMod/Effects/db/Player/PlayerPacifist.cpp b/ChaosMod/Effects/db/Player/PlayerPacifist.cpp index b10c5bb45..5c92545cf 100644 --- a/ChaosMod/Effects/db/Player/PlayerPacifist.cpp +++ b/ChaosMod/Effects/db/Player/PlayerPacifist.cpp @@ -1,4 +1,6 @@ #include + +#include "Effects/Register/RegisterEffect.h" // Effect by ProfessorBiddle, requested thousands of times on discord CHAOS_VAR int lastPlayerKills; @@ -32,7 +34,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Pacifist", .Id = "player_pacifist", diff --git a/ChaosMod/Effects/db/Player/PlayerPoof.cpp b/ChaosMod/Effects/db/Player/PlayerPoof.cpp index 0f58c4da3..2177d4ec2 100644 --- a/ChaosMod/Effects/db/Player/PlayerPoof.cpp +++ b/ChaosMod/Effects/db/Player/PlayerPoof.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" static void OnTick() { Player player = PLAYER_ID(); @@ -25,7 +26,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Deadly Aim", .Id = "player_poof", diff --git a/ChaosMod/Effects/db/Player/PlayerPoor.cpp b/ChaosMod/Effects/db/Player/PlayerPoor.cpp index bc585b91a..75d492351 100644 --- a/ChaosMod/Effects/db/Player/PlayerPoor.cpp +++ b/ChaosMod/Effects/db/Player/PlayerPoor.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (int i = 0; i < 3; i++) @@ -14,7 +16,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Poor Boy", .Id = "poorboi" diff --git a/ChaosMod/Effects/db/Player/PlayerRagdoll.cpp b/ChaosMod/Effects/db/Player/PlayerRagdoll.cpp index c003cda68..620bec1f4 100644 --- a/ChaosMod/Effects/db/Player/PlayerRagdoll.cpp +++ b/ChaosMod/Effects/db/Player/PlayerRagdoll.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -10,7 +12,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Ragdoll", .Id = "player_ragdoll", diff --git a/ChaosMod/Effects/db/Player/PlayerRagdollOnShot.cpp b/ChaosMod/Effects/db/Player/PlayerRagdollOnShot.cpp index ee86db8e2..82a9e6430 100644 --- a/ChaosMod/Effects/db/Player/PlayerRagdollOnShot.cpp +++ b/ChaosMod/Effects/db/Player/PlayerRagdollOnShot.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/WeaponPool.h" static void OnTick() @@ -27,7 +28,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Player Ragdolls When Shot", .Id = "player_ragdollondmg", diff --git a/ChaosMod/Effects/db/Player/PlayerRandomClothes.cpp b/ChaosMod/Effects/db/Player/PlayerRandomClothes.cpp index 8438df6d2..3ac5bbbec 100644 --- a/ChaosMod/Effects/db/Player/PlayerRandomClothes.cpp +++ b/ChaosMod/Effects/db/Player/PlayerRandomClothes.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -28,7 +30,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Randomize Player Clothes", .Id = "player_randclothes" diff --git a/ChaosMod/Effects/db/Player/PlayerRandomStuntJump.cpp b/ChaosMod/Effects/db/Player/PlayerRandomStuntJump.cpp index 60708841e..080ea787b 100644 --- a/ChaosMod/Effects/db/Player/PlayerRandomStuntJump.cpp +++ b/ChaosMod/Effects/db/Player/PlayerRandomStuntJump.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Player.h" #include "Util/Vehicle.h" @@ -78,7 +79,7 @@ void OnStartMakeRandomStuntJump() } // clang-format off -REGISTER_EFFECT(OnStartMakeRandomStuntJump, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMakeRandomStuntJump, nullptr, nullptr, { .Name = "Make Random Stunt Jump", .Id = "player_tp_stunt", diff --git a/ChaosMod/Effects/db/Player/PlayerRandomVehSeat.cpp b/ChaosMod/Effects/db/Player/PlayerRandomVehSeat.cpp index 1b3222c81..66b75aaa2 100644 --- a/ChaosMod/Effects/db/Player/PlayerRandomVehSeat.cpp +++ b/ChaosMod/Effects/db/Player/PlayerRandomVehSeat.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -79,7 +81,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Set Player Into Random Vehicle Seat", .Id = "veh_randomseat" diff --git a/ChaosMod/Effects/db/Player/PlayerRapidFire.cpp b/ChaosMod/Effects/db/Player/PlayerRapidFire.cpp index 12bf160df..760a3b24c 100644 --- a/ChaosMod/Effects/db/Player/PlayerRapidFire.cpp +++ b/ChaosMod/Effects/db/Player/PlayerRapidFire.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Camera.h" static void OnTick() @@ -36,7 +37,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Rapid Fire", .Id = "player_rapid_fire", diff --git a/ChaosMod/Effects/db/Player/PlayerRocket.cpp b/ChaosMod/Effects/db/Player/PlayerRocket.cpp index c0dfe16a5..53ad1b480 100644 --- a/ChaosMod/Effects/db/Player/PlayerRocket.cpp +++ b/ChaosMod/Effects/db/Player/PlayerRocket.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + #define LAUNCH_TIMER 5000 static void OnStart() @@ -60,7 +62,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Rocket Man", .Id = "player_rocket" diff --git a/ChaosMod/Effects/db/Player/PlayerSetIntoClosestVeh.cpp b/ChaosMod/Effects/db/Player/PlayerSetIntoClosestVeh.cpp index a485bb9ff..8081e9241 100644 --- a/ChaosMod/Effects/db/Player/PlayerSetIntoClosestVeh.cpp +++ b/ChaosMod/Effects/db/Player/PlayerSetIntoClosestVeh.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -73,7 +75,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Set Player Into Closest Vehicle", .Id = "player_tpclosestveh" diff --git a/ChaosMod/Effects/db/Player/PlayerSetIntoRandomVeh.cpp b/ChaosMod/Effects/db/Player/PlayerSetIntoRandomVeh.cpp index 88bfbae0d..5f17aaf44 100644 --- a/ChaosMod/Effects/db/Player/PlayerSetIntoRandomVeh.cpp +++ b/ChaosMod/Effects/db/Player/PlayerSetIntoRandomVeh.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -70,7 +72,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Set Player Into Random Vehicle", .Id = "player_setintorandveh" diff --git a/ChaosMod/Effects/db/Player/PlayerSimeonSays.cpp b/ChaosMod/Effects/db/Player/PlayerSimeonSays.cpp index e6b17536f..e0e9a7109 100644 --- a/ChaosMod/Effects/db/Player/PlayerSimeonSays.cpp +++ b/ChaosMod/Effects/db/Player/PlayerSimeonSays.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" // clang-format off CHAOS_VAR std::vector actions = { "hold forwards", @@ -131,7 +132,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Simeon Says", .Id = "player_simeonsays", diff --git a/ChaosMod/Effects/db/Player/PlayerSuicide.cpp b/ChaosMod/Effects/db/Player/PlayerSuicide.cpp index ae8567590..909a9d1c6 100644 --- a/ChaosMod/Effects/db/Player/PlayerSuicide.cpp +++ b/ChaosMod/Effects/db/Player/PlayerSuicide.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -20,7 +22,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Suicide", .Id = "player_suicide", diff --git a/ChaosMod/Effects/db/Player/PlayerSuperRunJump.cpp b/ChaosMod/Effects/db/Player/PlayerSuperRunJump.cpp index 31124b858..f76951394 100644 --- a/ChaosMod/Effects/db/Player/PlayerSuperRunJump.cpp +++ b/ChaosMod/Effects/db/Player/PlayerSuperRunJump.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(PLAYER_ID(), 1.f); @@ -15,7 +17,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Super Run & Super Jump", .Id = "player_superrun", diff --git a/ChaosMod/Effects/db/Player/PlayerTpController.cpp b/ChaosMod/Effects/db/Player/PlayerTpController.cpp index 73aa0427e..c083486de 100644 --- a/ChaosMod/Effects/db/Player/PlayerTpController.cpp +++ b/ChaosMod/Effects/db/Player/PlayerTpController.cpp @@ -1,14 +1,12 @@ #include -#include "Components/EffectDispatcher.h" - -#include "Memory/Hooks/ScriptThreadRunHook.h" - -#include "Util/Player.h" - +#include "Effects/EnabledEffects.h" +#include "Effects/Register/RegisterEffect.h" #include "Effects/db/Player/PlayerBlimpStrats.h" #include "Effects/db/Player/PlayerRandomStuntJump.h" #include "Effects/db/Player/PlayerTpToRandomStore.h" +#include "Memory/Hooks/ScriptThreadRunHook.h" +#include "Util/Player.h" static void OnStartLSIA() { @@ -16,7 +14,7 @@ static void OnStartLSIA() } // clang-format off -REGISTER_EFFECT(OnStartLSIA, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartLSIA, nullptr, nullptr, { .Name = "Teleport To LS Airport", .Id = "tp_lsairport", @@ -31,7 +29,7 @@ static void OnStartMazeTower() } // clang-format off -REGISTER_EFFECT(OnStartMazeTower, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMazeTower, nullptr, nullptr, { .Name = "Teleport To Top Of Maze Bank Tower", .Id = "tp_mazebanktower", @@ -49,7 +47,7 @@ static void OnStartFortZancudo() } // clang-format off -REGISTER_EFFECT(OnStartFortZancudo, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFortZancudo, nullptr, nullptr, { .Name = "Teleport To Fort Zancudo", .Id = "tp_fortzancudo", @@ -67,7 +65,7 @@ static void OnStartMountChilliad() } // clang-format off -REGISTER_EFFECT(OnStartMountChilliad, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMountChilliad, nullptr, nullptr, { .Name = "Teleport To Mount Chiliad", .Id = "tp_mountchilliad", @@ -82,7 +80,7 @@ static void OnStartSkyFall() } // clang-format off -REGISTER_EFFECT(OnStartSkyFall, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartSkyFall, nullptr, nullptr, { .Name = "Teleport To Heaven", .Id = "tp_skyfall", @@ -144,7 +142,7 @@ static void OnStartWaypoint() } // clang-format off -REGISTER_EFFECT(OnStartWaypoint, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartWaypoint, nullptr, nullptr, { .Name = "Teleport To Waypoint", .Id = "player_tptowaypoint" @@ -190,7 +188,7 @@ static void OnStartWaypointOpposite() } // clang-format off -REGISTER_EFFECT(OnStartWaypointOpposite, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartWaypointOpposite, nullptr, nullptr, { .Name = "Teleport To The Opposite Side Of Waypoint", .Id = "player_tptowaypointopposite" @@ -209,7 +207,7 @@ static void OnStartFront() } // clang-format off -REGISTER_EFFECT(OnStartFront, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFront, nullptr, nullptr, { .Name = "Teleport Player A Few Meters", .Id = "player_tpfront" @@ -234,7 +232,7 @@ static void OnStartRandom() } // clang-format off -REGISTER_EFFECT(OnStartRandom, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRandom, nullptr, nullptr, { .Name = "Teleport To Random Location", .Id = "tp_random", @@ -293,7 +291,7 @@ static void OnStartMission() } // clang-format off -REGISTER_EFFECT(OnStartMission, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMission, nullptr, nullptr, { .Name = "Teleport To Random Mission", .Id = "tp_mission" @@ -431,7 +429,7 @@ static void OnStartFakeTp() } // clang-format off -REGISTER_EFFECT(OnStartFakeTp, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFakeTp, nullptr, nullptr, { .Name = "Fake Teleport", .Id = "tp_fake", @@ -456,7 +454,7 @@ static void OnStartFakeFakeTp() } // clang-format off -REGISTER_EFFECT(OnStartFakeFakeTp, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFakeFakeTp, nullptr, nullptr, { .Name = "Fake Fake Teleport", .Id = "tp_fakex2", diff --git a/ChaosMod/Effects/db/Player/PlayerTpEverything.cpp b/ChaosMod/Effects/db/Player/PlayerTpEverything.cpp index 16b1bf412..d496cf81b 100644 --- a/ChaosMod/Effects/db/Player/PlayerTpEverything.cpp +++ b/ChaosMod/Effects/db/Player/PlayerTpEverything.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { std::vector entities; @@ -51,7 +53,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Teleport Everything To Player", .Id = "player_tpeverything" diff --git a/ChaosMod/Effects/db/Player/PlayerTpToEverything.cpp b/ChaosMod/Effects/db/Player/PlayerTpToEverything.cpp index 58caf0676..ada62f2a9 100644 --- a/ChaosMod/Effects/db/Player/PlayerTpToEverything.cpp +++ b/ChaosMod/Effects/db/Player/PlayerTpToEverything.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Player.h" CHAOS_VAR int lastTpTime; @@ -47,7 +48,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Teleporter Malfunction", .Id = "player_tp_to_everything", diff --git a/ChaosMod/Effects/db/Player/PlayerTpToRandomStore.cpp b/ChaosMod/Effects/db/Player/PlayerTpToRandomStore.cpp index fa7391127..17700723d 100644 --- a/ChaosMod/Effects/db/Player/PlayerTpToRandomStore.cpp +++ b/ChaosMod/Effects/db/Player/PlayerTpToRandomStore.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Player.h" #include "PlayerTpToRandomStore.h" @@ -66,7 +67,7 @@ void OnStartTpRandomStore() } // clang-format off -REGISTER_EFFECT(OnStartTpRandomStore, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartTpRandomStore, nullptr, nullptr, { .Name = "Teleport to Random Store", .Id = "player_tp_store", diff --git a/ChaosMod/Effects/db/Player/PlayerVR.cpp b/ChaosMod/Effects/db/Player/PlayerVR.cpp index ee5181edf..3f5b476fa 100644 --- a/ChaosMod/Effects/db/Player/PlayerVR.cpp +++ b/ChaosMod/Effects/db/Player/PlayerVR.cpp @@ -3,6 +3,7 @@ */ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Player.h" CHAOS_VAR Ped clone; @@ -120,7 +121,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Virtual Reality", .Id = "player_vr", diff --git a/ChaosMod/Effects/db/Player/PlayerWalkOnWater.cpp b/ChaosMod/Effects/db/Player/PlayerWalkOnWater.cpp index 8d7feab66..afbc386dd 100644 --- a/ChaosMod/Effects/db/Player/PlayerWalkOnWater.cpp +++ b/ChaosMod/Effects/db/Player/PlayerWalkOnWater.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR Object waterObj = 0; CHAOS_VAR Hash displayHash = 0; @@ -54,7 +56,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Walk On Water", .Id = "player_walkonwater", diff --git a/ChaosMod/Effects/db/Player/PlayerWantedController.cpp b/ChaosMod/Effects/db/Player/PlayerWantedController.cpp index 090751660..929b91372 100644 --- a/ChaosMod/Effects/db/Player/PlayerWantedController.cpp +++ b/ChaosMod/Effects/db/Player/PlayerWantedController.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ScriptThreadRunHook.h" static void OnStartFive() @@ -11,7 +12,7 @@ static void OnStartFive() } // clang-format off -REGISTER_EFFECT(OnStartFive, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFive, nullptr, nullptr, { .Name = "5 Wanted Stars", .Id = "player_5stars", @@ -30,7 +31,7 @@ static void OnStartPlusTwo() } // clang-format off -REGISTER_EFFECT(OnStartPlusTwo, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartPlusTwo, nullptr, nullptr, { .Name = "+2 Wanted Stars", .Id = "player_plus2stars", @@ -47,7 +48,7 @@ static void OnTickNeverWanted() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickNeverWanted, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickNeverWanted, { .Name = "Never Wanted", .Id = "player_neverwanted", @@ -66,7 +67,7 @@ static void OnStartThree() } // clang-format off -REGISTER_EFFECT(OnStartThree, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartThree, nullptr, nullptr, { .Name = "3 Wanted Stars", .Id = "player_3stars", @@ -85,7 +86,7 @@ static void OnStartOne() } // clang-format off -REGISTER_EFFECT(OnStartOne, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartOne, nullptr, nullptr, { .Name = "1 Wanted Star", .Id = "player_1star", @@ -156,7 +157,7 @@ static void OnStartFake() } // clang-format off -REGISTER_EFFECT(OnStartFake, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFake, nullptr, nullptr, { .Name = "Fake Wanted Level", .Id = "player_fakestars", diff --git a/ChaosMod/Effects/db/Player/PlayerWeaponGiver.cpp b/ChaosMod/Effects/db/Player/PlayerWeaponGiver.cpp index b25e2ef0b..9c443eddc 100644 --- a/ChaosMod/Effects/db/Player/PlayerWeaponGiver.cpp +++ b/ChaosMod/Effects/db/Player/PlayerWeaponGiver.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/WeaponPool.h" static void OnStartAll() @@ -11,7 +12,7 @@ static void OnStartAll() } // clang-format off -REGISTER_EFFECT(OnStartAll, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartAll, nullptr, nullptr, { .Name = "Give All Weapons", .Id = "player_allweps", diff --git a/ChaosMod/Effects/db/Player/PlayerZoomZoomCam.cpp b/ChaosMod/Effects/db/Player/PlayerZoomZoomCam.cpp index 6167a3efa..9711c5e58 100644 --- a/ChaosMod/Effects/db/Player/PlayerZoomZoomCam.cpp +++ b/ChaosMod/Effects/db/Player/PlayerZoomZoomCam.cpp @@ -3,6 +3,8 @@ */ #include + +#include "Effects/Register/RegisterEffect.h" CHAOS_VAR Camera zoomCamera = 0; CHAOS_VAR float camZoom = 80.f; CHAOS_VAR const float camZoomRate = 0.15f; @@ -43,7 +45,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Zoom Zoom Cam", .Id = "player_zoomzoom_cam", diff --git a/ChaosMod/Effects/db/Screen/ScreenBinoculars.cpp b/ChaosMod/Effects/db/Screen/ScreenBinoculars.cpp index 2a3dc3782..a00e6408a 100644 --- a/ChaosMod/Effects/db/Screen/ScreenBinoculars.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenBinoculars.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR Camera fovCamera = 0; static void UpdateCamera() @@ -34,7 +36,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Binoculars", .Id = "player_binoculars", diff --git a/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp b/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp index 71be7ab85..c9c9ea4aa 100644 --- a/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/UI.h" #define BOUNCE_SPEED_MULT 100.f @@ -51,7 +52,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Bouncy Radar", .Id = "screen_bouncyradar", diff --git a/ChaosMod/Effects/db/Screen/ScreenDVDScreensaver.cpp b/ChaosMod/Effects/db/Screen/ScreenDVDScreensaver.cpp index 8ae50ecfd..e1c975bfc 100644 --- a/ChaosMod/Effects/db/Screen/ScreenDVDScreensaver.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenDVDScreensaver.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR const double SPEED = 0.003; CHAOS_VAR const double BOX_HEIGHT_RATIO = 0.45; CHAOS_VAR double boxWidth, boxHeight, offsetX, offsetY; @@ -57,7 +59,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "DVD Screensaver", .Id = "misc_dvdscreensaver", diff --git a/ChaosMod/Effects/db/Screen/ScreenFlipCamera.cpp b/ChaosMod/Effects/db/Screen/ScreenFlipCamera.cpp index 4b0ff424d..9c9eb291c 100644 --- a/ChaosMod/Effects/db/Screen/ScreenFlipCamera.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenFlipCamera.cpp @@ -3,6 +3,8 @@ */ #include + +#include "Effects/Register/RegisterEffect.h" // TODO: SHVDN has a memory pattern for the gameplay camera, so it might be wise at some point // to use it to directly modify the rotation of the camera, but that's for a later date :^) @@ -37,7 +39,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Turn Turtle", .Id = "player_flip_camera", diff --git a/ChaosMod/Effects/db/Screen/ScreenFlipUI.cpp b/ChaosMod/Effects/db/Screen/ScreenFlipUI.cpp index 125dff76c..642efedb2 100644 --- a/ChaosMod/Effects/db/Screen/ScreenFlipUI.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenFlipUI.cpp @@ -5,6 +5,7 @@ #include #include "Components/MetaModifiers.h" +#include "Effects/Register/RegisterEffect.h" #include "Memory/UI.h" @@ -81,7 +82,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Flipped HUD", .Id = "misc_flip_ui", diff --git a/ChaosMod/Effects/db/Screen/ScreenHeatVision.cpp b/ChaosMod/Effects/db/Screen/ScreenHeatVision.cpp index a0944cf1f..42f4254ee 100644 --- a/ChaosMod/Effects/db/Screen/ScreenHeatVision.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenHeatVision.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_SEETHROUGH(false); @@ -11,7 +13,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Heat Vision", .Id = "player_heatvision", diff --git a/ChaosMod/Effects/db/Screen/ScreenMaximap.cpp b/ChaosMod/Effects/db/Screen/ScreenMaximap.cpp index 2d7c3daf7..473823b75 100644 --- a/ChaosMod/Effects/db/Screen/ScreenMaximap.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenMaximap.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/UI.h" static void OnTick() @@ -17,7 +18,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Maximap", .Id = "screen_maximap", diff --git a/ChaosMod/Effects/db/Screen/ScreenNightVision.cpp b/ChaosMod/Effects/db/Screen/ScreenNightVision.cpp index 74a099a3e..eea8da48f 100644 --- a/ChaosMod/Effects/db/Screen/ScreenNightVision.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenNightVision.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_NIGHTVISION(false); @@ -11,7 +13,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Night Vision", .Id = "player_nightvision", diff --git a/ChaosMod/Effects/db/Screen/ScreenNoHUD.cpp b/ChaosMod/Effects/db/Screen/ScreenNoHUD.cpp index 041e19fe5..6ea4eeacb 100644 --- a/ChaosMod/Effects/db/Screen/ScreenNoHUD.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenNoHUD.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { HIDE_HUD_AND_RADAR_THIS_FRAME(); @@ -10,7 +12,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "No HUD", .Id = "no_hud", diff --git a/ChaosMod/Effects/db/Screen/ScreenNoRadar.cpp b/ChaosMod/Effects/db/Screen/ScreenNoRadar.cpp index 7aa54dd42..077915740 100644 --- a/ChaosMod/Effects/db/Screen/ScreenNoRadar.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenNoRadar.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { DISPLAY_RADAR(true); @@ -15,7 +17,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "No Radar", .Id = "no_radar", diff --git a/ChaosMod/Effects/db/Screen/ScreenOnDemandCartoon.cpp b/ChaosMod/Effects/db/Screen/ScreenOnDemandCartoon.cpp index 05741caca..e4bfd26e5 100644 --- a/ChaosMod/Effects/db/Screen/ScreenOnDemandCartoon.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenOnDemandCartoon.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR const char *TV_PLAYLISTS[] = { "PL_WEB_KFLF", // Kung Fu Rainbow Lazerforce "PL_WEB_RANGERS", // Republican Space Rangers @@ -69,7 +71,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "On-Demand TV", .Id = "player_on_demand_cartoon", diff --git a/ChaosMod/Effects/db/Screen/ScreenQuakeFOV.cpp b/ChaosMod/Effects/db/Screen/ScreenQuakeFOV.cpp index a8b9394fb..10959094b 100644 --- a/ChaosMod/Effects/db/Screen/ScreenQuakeFOV.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenQuakeFOV.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR Camera fovCamera = 0; static void UpdateCamera() @@ -34,7 +36,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Quake FOV", .Id = "player_quake_fov", diff --git a/ChaosMod/Effects/db/Screen/ScreenRealFirstPerson.cpp b/ChaosMod/Effects/db/Screen/ScreenRealFirstPerson.cpp index 082619b3c..62f7d7e8e 100644 --- a/ChaosMod/Effects/db/Screen/ScreenRealFirstPerson.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenRealFirstPerson.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR Cam eCamera; CHAOS_VAR int state = 0; @@ -102,7 +104,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Real First Person", .Id = "screen_realfp", diff --git a/ChaosMod/Effects/db/Screen/ScreenSickCam.cpp b/ChaosMod/Effects/db/Screen/ScreenSickCam.cpp index 2e13cc1e1..1136aef48 100644 --- a/ChaosMod/Effects/db/Screen/ScreenSickCam.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenSickCam.cpp @@ -3,6 +3,8 @@ */ #include + +#include "Effects/Register/RegisterEffect.h" CHAOS_VAR Camera sickCamera = 0; CHAOS_VAR float camZoom = 80.f; CHAOS_VAR float camZoomRate = 0.4f; @@ -67,7 +69,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "I Feel Sick", .Id = "player_sick_cam", diff --git a/ChaosMod/Effects/db/Screen/ScreenSpinCam.cpp b/ChaosMod/Effects/db/Screen/ScreenSpinCam.cpp index 6164ea878..12ae02d39 100644 --- a/ChaosMod/Effects/db/Screen/ScreenSpinCam.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenSpinCam.cpp @@ -3,6 +3,8 @@ */ #include + +#include "Effects/Register/RegisterEffect.h" CHAOS_VAR Camera spinningCamera = 0; CHAOS_VAR float camRot = 0.f; CHAOS_VAR float camRotRate = 1.2f; @@ -37,7 +39,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Spinning Camera", .Id = "player_spin_camera", diff --git a/ChaosMod/Effects/db/Screen/ScreenTimecycModifierController.cpp b/ChaosMod/Effects/db/Screen/ScreenTimecycModifierController.cpp index aa6deec7d..aa428e69c 100644 --- a/ChaosMod/Effects/db/Screen/ScreenTimecycModifierController.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenTimecycModifierController.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void StartTransitionTimecycle(std::string modifier, float strength = 1.f) { if (GET_TIMECYCLE_TRANSITION_MODIFIER_INDEX() == -1 && GET_TIMECYCLE_MODIFIER_INDEX() == -1) @@ -20,7 +22,7 @@ static void OnTickMexico() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickMexico, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickMexico, { .Name = "Is This What Mexico Looks Like?", .Id = "screen_mexico", @@ -57,7 +59,7 @@ static void OnTickBright() } // clang-format off -REGISTER_EFFECT(nullptr, OnStopBright, OnTickBright, EffectInfo +REGISTER_EFFECT(nullptr, OnStopBright, OnTickBright, { .Name = "Deep Fried", .Id = "screen_bright", @@ -74,7 +76,7 @@ static void OnTickFog() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickFog, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickFog, { .Name = "Extreme Fog", .Id = "screen_fog", @@ -91,7 +93,7 @@ static void OnTickRenderdist() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickRenderdist, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickRenderdist, { .Name = "Where Did Everything Go?", .Id = "screen_lowrenderdist", @@ -174,7 +176,7 @@ static void OnTickLSD() } // clang-format off -REGISTER_EFFECT(nullptr, OnStopLSD, OnTickLSD, EffectInfo +REGISTER_EFFECT(nullptr, OnStopLSD, OnTickLSD, { .Name = "LSD", .Id = "screen_lsd", @@ -195,7 +197,7 @@ static void OnTickFullbright() } // clang-format off -REGISTER_EFFECT(OnStartFullbright, OnStop, OnTickFullbright, EffectInfo +REGISTER_EFFECT(OnStartFullbright, OnStop, OnTickFullbright, { .Name = "Fullbright", .Id = "screen_fullbright", @@ -213,7 +215,7 @@ static void OnTickBubbleVision() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickBubbleVision, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickBubbleVision, { .Name = "Bubble Vision", .Id = "screen_bubblevision", @@ -282,7 +284,7 @@ static void OnTickLSNoire() } // clang-format off -REGISTER_EFFECT(OnStartLSNoire, OnStop, OnTickLSNoire, EffectInfo +REGISTER_EFFECT(OnStartLSNoire, OnStop, OnTickLSNoire, { .Name = "LS Noire", .Id = "screen_lsnoire", @@ -298,7 +300,7 @@ static void OnTickNeedGlasses() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickNeedGlasses, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickNeedGlasses, { .Name = "I Need Glasses", .Id = "screen_needglasses", @@ -315,7 +317,7 @@ static void OnTickFuzzy() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickFuzzy, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickFuzzy, { .Name = "Static", .Id = "timecycle_fuzzy", @@ -339,7 +341,7 @@ static void OnStopDarkWorld() } // clang-format off -REGISTER_EFFECT(nullptr, OnStopDarkWorld, OnTickDarkWorld, EffectInfo +REGISTER_EFFECT(nullptr, OnStopDarkWorld, OnTickDarkWorld, { .Name = "A Dark World", .Id = "timecycle_darkworld", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderArc.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderArc.cpp index 6bbb23d4d..fcead24ac 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderArc.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderArc.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -29,7 +30,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Arced Screen", .Id = "screen_arc", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderColorfulWorld.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderColorfulWorld.cpp index c373f1c61..b6aaee148 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderColorfulWorld.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderColorfulWorld.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" #include "Memory/Snow.h" @@ -29,7 +30,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Colorful World", .Id = "screen_colorfulworld", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderDimWarp.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderDimWarp.cpp index 583657723..92b9cb9ef 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderDimWarp.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderDimWarp.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -31,7 +32,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Dimension Warp", .Id = "screen_dimwarp", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFckAutorotate.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFckAutorotate.cpp index d8f48de66..6243e1f9f 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFckAutorotate.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFckAutorotate.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -32,7 +33,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Goddamn Auto-Rotate", .Id = "screen_fckautorotate", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFoldedScreen.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFoldedScreen.cpp index 2aef8413f..000511154 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFoldedScreen.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFoldedScreen.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrcPrefix = R"SRC( @@ -51,7 +52,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Folded Screen", .Id = "screen_foldedscreen", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFourthDimension.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFourthDimension.cpp index 2541a8713..9c20d0d39 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFourthDimension.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderFourthDimension.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -32,7 +33,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Fourth Dimension", .Id = "screen_fourthdimension", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderHueShift.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderHueShift.cpp index 2cfa82341..d3f01d14b 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderHueShift.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderHueShift.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_szShaderSrcPrefix = R"SRC( @@ -46,7 +47,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Hue Shift", .Id = "screen_hueshift", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderInvertedColors.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderInvertedColors.cpp index 3ff48ee12..8cc7bd7aa 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderInvertedColors.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderInvertedColors.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -31,7 +32,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Inverted Colors", .Id = "screen_invertedcolors", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderLocalCoop.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderLocalCoop.cpp index a45cedbf6..f073a1d63 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderLocalCoop.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderLocalCoop.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -30,7 +31,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Split Screen Co-op", .Id = "screen_localcoop", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderMirrored.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderMirrored.cpp index 62bdff8a1..4ec44bb36 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderMirrored.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderMirrored.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -28,7 +29,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Mirrored Screen", .Id = "screen_mirrored", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderRgbLand.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderRgbLand.cpp index 86c490547..c67bc7892 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderRgbLand.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderRgbLand.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" #include "Memory/Snow.h" @@ -59,7 +60,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "RGB Land", .Id = "screen_rgbland", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenFreakout.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenFreakout.cpp index 7f791f324..f4774f517 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenFreakout.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenFreakout.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -57,7 +58,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Screen Freakout", .Id = "screen_screenfreakout", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenPotato.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenPotato.cpp index c686facf6..a5245ecb4 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenPotato.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderScreenPotato.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -28,7 +29,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Potato", .Id = "screen_screenpotato", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderShatteredScreen.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderShatteredScreen.cpp index d8ff7d98f..9d7cab688 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderShatteredScreen.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderShatteredScreen.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -31,7 +32,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Shattered Screen", .Id = "screen_shatteredscreen", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderSwappedColors.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderSwappedColors.cpp index 2f943254a..9b1216152 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderSwappedColors.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderSwappedColors.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrcPrefix = R"SRC( @@ -49,7 +50,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Swapped Colors", .Id = "screen_swappedcolors", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTextureless.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTextureless.cpp index ea7fa9b42..76cf1727d 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTextureless.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTextureless.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" #include "Memory/Snow.h" @@ -27,7 +28,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, OnTick, { .Name = "Textureless", .Id = "screen_textureless", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTnPanel.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTnPanel.cpp index f1d3a8950..95efac0e6 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTnPanel.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderTnPanel.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -33,7 +34,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "TN Panel", .Id = "screen_tnpanel", diff --git a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderWarpedCam.cpp b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderWarpedCam.cpp index f1fec3b3e..0fc637d79 100644 --- a/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderWarpedCam.cpp +++ b/ChaosMod/Effects/db/Screen/Shaders/ScreenShaderWarpedCam.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/ShaderHook.h" CHAOS_VAR const char *ms_ShaderSrc = R"SRC( @@ -31,7 +32,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, OnStop, nullptr, { .Name = "Warped Camera", .Id = "screen_warpedcam", diff --git a/ChaosMod/Effects/db/Time/TimeController.cpp b/ChaosMod/Effects/db/Time/TimeController.cpp index 9018ad5f1..e101cfaf3 100644 --- a/ChaosMod/Effects/db/Time/TimeController.cpp +++ b/ChaosMod/Effects/db/Time/TimeController.cpp @@ -1,12 +1,14 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStartMorning() { SET_CLOCK_TIME(8, 0, 0); } // clang-format off -REGISTER_EFFECT(OnStartMorning, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMorning, nullptr, nullptr, { .Name = "Set Time To Morning", .Id = "time_morning", @@ -21,7 +23,7 @@ static void OnStartDay() } // clang-format off -REGISTER_EFFECT(OnStartDay, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartDay, nullptr, nullptr, { .Name = "Set Time To Daytime", .Id = "time_day", @@ -36,7 +38,7 @@ static void OnStartEvening() } // clang-format off -REGISTER_EFFECT(OnStartEvening, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartEvening, nullptr, nullptr, { .Name = "Set Time To Evening", .Id = "time_evening", @@ -51,7 +53,7 @@ static void OnStartNight() } // clang-format off -REGISTER_EFFECT(OnStartNight, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartNight, nullptr, nullptr, { .Name = "Set Time To Night", .Id = "time_night", @@ -66,7 +68,7 @@ static void OnTickTimelapse() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickTimelapse, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickTimelapse, { .Name = "Timelapse", .Id = "time_quickday", @@ -86,7 +88,7 @@ static void OnStartSystem() } // clang-format off -REGISTER_EFFECT(OnStartSystem, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartSystem, nullptr, nullptr, { .Name = "Set Time To System Time", .Id = "time_local_time", diff --git a/ChaosMod/Effects/db/Time/TimeGameSpeedController.cpp b/ChaosMod/Effects/db/Time/TimeGameSpeedController.cpp index 7014b8113..ab5d3247d 100644 --- a/ChaosMod/Effects/db/Time/TimeGameSpeedController.cpp +++ b/ChaosMod/Effects/db/Time/TimeGameSpeedController.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Hooks/AudioPitchHook.h" static void OnStop() @@ -23,7 +24,7 @@ static void OnTickX02() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickX02, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickX02, { .Name = "x0.2 Gamespeed", .Id = "time_x02", @@ -46,7 +47,7 @@ static void OnTickX05() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickX05, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickX05, { .Name = "x0.5 Gamespeed", .Id = "time_x05", diff --git a/ChaosMod/Effects/db/Time/TimeSuperhot.cpp b/ChaosMod/Effects/db/Time/TimeSuperhot.cpp index c28a90858..8b5a1825b 100644 --- a/ChaosMod/Effects/db/Time/TimeSuperhot.cpp +++ b/ChaosMod/Effects/db/Time/TimeSuperhot.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR int lastCheck = 0; static void OnStop() @@ -30,7 +32,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Superhot", .Id = "time_superhot", diff --git a/ChaosMod/Effects/db/Vehs/Vehs30mphLimit.cpp b/ChaosMod/Effects/db/Vehs/Vehs30mphLimit.cpp index 0e3eededb..7d61f46ed 100644 --- a/ChaosMod/Effects/db/Vehs/Vehs30mphLimit.cpp +++ b/ChaosMod/Effects/db/Vehs/Vehs30mphLimit.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (Vehicle veh : GetAllVehs()) @@ -17,7 +19,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "30MPH Speed Limit", .Id = "veh_30mphlimit", diff --git a/ChaosMod/Effects/db/Vehs/VehsAllHorn.cpp b/ChaosMod/Effects/db/Vehs/VehsAllHorn.cpp index c0e732a12..409198943 100644 --- a/ChaosMod/Effects/db/Vehs/VehsAllHorn.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsAllHorn.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { for (auto veh : GetAllVehs()) @@ -7,7 +9,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "All Vehicles Honk", .Id = "vehs_honkconstant", diff --git a/ChaosMod/Effects/db/Vehs/VehsAllVehsLaunchUp.cpp b/ChaosMod/Effects/db/Vehs/VehsAllVehsLaunchUp.cpp index 4e87282dc..85f872236 100644 --- a/ChaosMod/Effects/db/Vehs/VehsAllVehsLaunchUp.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsAllVehsLaunchUp.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Vehicle veh : GetAllVehs()) @@ -11,7 +13,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Launch All Vehicles Up", .Id = "vehs_upupaway" diff --git a/ChaosMod/Effects/db/Vehs/VehsBeyblade.cpp b/ChaosMod/Effects/db/Vehs/VehsBeyblade.cpp index b592cd764..68c0bf391 100644 --- a/ChaosMod/Effects/db/Vehs/VehsBeyblade.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsBeyblade.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnStop() @@ -55,7 +56,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Beyblades", .Id = "vehs_beyblade", diff --git a/ChaosMod/Effects/db/Vehs/VehsBoostBraking.cpp b/ChaosMod/Effects/db/Vehs/VehsBoostBraking.cpp index 2cb47c2f4..85b580700 100644 --- a/ChaosMod/Effects/db/Vehs/VehsBoostBraking.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsBoostBraking.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" #include "Memory/Vehicle.h" @@ -21,7 +22,7 @@ static void BoostOnTick() } } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, BoostOnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, BoostOnTick, { .Name = "Boost Braking", .Id = "veh_boostbrake", diff --git a/ChaosMod/Effects/db/Vehs/VehsBouncy.cpp b/ChaosMod/Effects/db/Vehs/VehsBouncy.cpp index e347e35e5..e6a7151b0 100644 --- a/ChaosMod/Effects/db/Vehs/VehsBouncy.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsBouncy.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnTick() @@ -33,7 +34,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Bouncy Vehicles", .Id = "veh_bouncy", diff --git a/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp b/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp index 33116bf74..9f6cd6477 100644 --- a/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsBrakeBoosting.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" #include "Memory/Vehicle.h" @@ -20,7 +21,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Brake Boosting", .Id = "veh_brakeboost", diff --git a/ChaosMod/Effects/db/Vehs/VehsBreakDoors.cpp b/ChaosMod/Effects/db/Vehs/VehsBreakDoors.cpp index 25c4e9e00..e154ae82c 100644 --- a/ChaosMod/Effects/db/Vehs/VehsBreakDoors.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsBreakDoors.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { int count = 10; @@ -21,7 +23,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Break Doors Of Every Vehicle", .Id = "playerveh_breakdoors" diff --git a/ChaosMod/Effects/db/Vehs/VehsCinematicCam.cpp b/ChaosMod/Effects/db/Vehs/VehsCinematicCam.cpp index d1f8c3bbd..9809bd3ba 100644 --- a/ChaosMod/Effects/db/Vehs/VehsCinematicCam.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsCinematicCam.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { SET_CINEMATIC_MODE_ACTIVE(false); @@ -22,7 +24,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Cinematic Vehicle Cam", .Id = "player_forcedcinematiccam", diff --git a/ChaosMod/Effects/db/Vehs/VehsColorController.cpp b/ChaosMod/Effects/db/Vehs/VehsColorController.cpp index ea2bf1691..28ff81e74 100644 --- a/ChaosMod/Effects/db/Vehs/VehsColorController.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsColorController.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Vehicle.h" static void OnTickRed() @@ -17,7 +18,7 @@ static void OnTickRed() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickRed, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickRed, { .Name = "Red Traffic", .Id = "vehs_red", @@ -43,7 +44,7 @@ static void OnTickBlue() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickBlue, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickBlue, { .Name = "Blue Traffic", .Id = "vehs_blue", @@ -69,7 +70,7 @@ static void OnTickGreen() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickGreen, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickGreen, { .Name = "Green Traffic", .Id = "vehs_green", @@ -98,7 +99,7 @@ static void OnTickChrome() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickChrome, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickChrome, { .Name = "Chrome Traffic", .Id = "vehs_chrome", @@ -164,7 +165,7 @@ static void OnTickPink() } // clang-format off -REGISTER_EFFECT(nullptr, OnStopPink, OnTickPink, EffectInfo +REGISTER_EFFECT(nullptr, OnStopPink, OnTickPink, { .Name = "Hot Traffic", .Id = "vehs_pink", @@ -229,7 +230,7 @@ static void OnTickRainbow() } // clang-format off -REGISTER_EFFECT(nullptr, OnStopRainbow, OnTickRainbow, EffectInfo +REGISTER_EFFECT(nullptr, OnStopRainbow, OnTickRainbow, { .Name = "Rainbow Traffic", .Id = "vehs_rainbow", diff --git a/ChaosMod/Effects/db/Vehs/VehsCruiseControl.cpp b/ChaosMod/Effects/db/Vehs/VehsCruiseControl.cpp index cb829d807..e601add67 100644 --- a/ChaosMod/Effects/db/Vehs/VehsCruiseControl.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsCruiseControl.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR float currentVel = -1; static void OnStop() @@ -39,7 +41,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Cruise Control", .Id = "vehs_cruise_control", diff --git a/ChaosMod/Effects/db/Vehs/VehsCrumble.cpp b/ChaosMod/Effects/db/Vehs/VehsCrumble.cpp index 1f922cd53..153eda8a4 100644 --- a/ChaosMod/Effects/db/Vehs/VehsCrumble.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsCrumble.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { std::vector vehs = GetAllVehsArray(); @@ -20,7 +22,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Crumbling Vehicles", .Id = "vehs_crumble", diff --git a/ChaosMod/Effects/db/Vehs/VehsDetachWheel.cpp b/ChaosMod/Effects/db/Vehs/VehsDetachWheel.cpp index 5ffb3717f..8045066a8 100644 --- a/ChaosMod/Effects/db/Vehs/VehsDetachWheel.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsDetachWheel.cpp @@ -4,6 +4,7 @@ Effect by Reguas #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/EntityFragments.h" CHAOS_VAR const char *wheels[12] { "wheel_lf", "wheel_rf", "wheel_lm1", "wheel_rm1", "wheel_lm2", "wheel_rm2", @@ -30,7 +31,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Detach Random Wheel", .Id = "vehs_detach_wheel" diff --git a/ChaosMod/Effects/db/Vehs/VehsDisassemble.cpp b/ChaosMod/Effects/db/Vehs/VehsDisassemble.cpp index 8135459cb..084191223 100644 --- a/ChaosMod/Effects/db/Vehs/VehsDisassemble.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsDisassemble.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/EntityFragments.h" static void OnStart() @@ -29,7 +30,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Disassemble Current Vehicle", .Id = "vehs_disassemble" diff --git a/ChaosMod/Effects/db/Vehs/VehsEngineMultiplierController.cpp b/ChaosMod/Effects/db/Vehs/VehsEngineMultiplierController.cpp index f628dd526..44530a36e 100644 --- a/ChaosMod/Effects/db/Vehs/VehsEngineMultiplierController.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsEngineMultiplierController.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto veh : GetAllVehs()) @@ -19,7 +21,7 @@ static void OnTickX2() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickX2, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickX2, { .Name = "2x Vehicle Engine Speed", .Id = "vehs_x2engine", @@ -39,7 +41,7 @@ static void OnTickX10() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickX10, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickX10, { .Name = "10x Vehicle Engine Speed", .Id = "vehs_x10engine", @@ -59,7 +61,7 @@ static void OnTickX05() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTickX05, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTickX05, { .Name = "0.5x Vehicle Engine Speed", .Id = "vehs_x05engine", diff --git a/ChaosMod/Effects/db/Vehs/VehsExplodeNearby.cpp b/ChaosMod/Effects/db/Vehs/VehsExplodeNearby.cpp index fc4bc2241..a8a9d0265 100644 --- a/ChaosMod/Effects/db/Vehs/VehsExplodeNearby.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsExplodeNearby.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Vehicle playerVeh = GET_VEHICLE_PED_IS_IN(PLAYER_PED_ID(), false); @@ -23,7 +25,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Explode All Nearby Vehicles", .Id = "vehs_explode", diff --git a/ChaosMod/Effects/db/Vehs/VehsFlyingCar.cpp b/ChaosMod/Effects/db/Vehs/VehsFlyingCar.cpp index 4334d8ec6..dee3eb282 100644 --- a/ChaosMod/Effects/db/Vehs/VehsFlyingCar.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsFlyingCar.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { Ped player = PLAYER_PED_ID(); @@ -68,7 +70,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Flying Cars", .Id = "vehs_flyingcars", diff --git a/ChaosMod/Effects/db/Vehs/VehsFullAccel.cpp b/ChaosMod/Effects/db/Vehs/VehsFullAccel.cpp index 0d8950039..42f48d662 100644 --- a/ChaosMod/Effects/db/Vehs/VehsFullAccel.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsFullAccel.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Vehicle.h" static void OnTick() @@ -17,7 +18,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Full Acceleration", .Id = "traffic_fullaccel", diff --git a/ChaosMod/Effects/db/Vehs/VehsGTAOTraffic.cpp b/ChaosMod/Effects/db/Vehs/VehsGTAOTraffic.cpp index 7ad381915..ef4f95415 100644 --- a/ChaosMod/Effects/db/Vehs/VehsGTAOTraffic.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsGTAOTraffic.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { static std::vector goneThrough; @@ -32,7 +34,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Traffic Magnet", .Id = "traffic_gtao", diff --git a/ChaosMod/Effects/db/Vehs/VehsHonkBoosting.cpp b/ChaosMod/Effects/db/Vehs/VehsHonkBoosting.cpp index a6ca372a6..11489ca92 100644 --- a/ChaosMod/Effects/db/Vehs/VehsHonkBoosting.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsHonkBoosting.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnTick() @@ -10,7 +11,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Honk Boosting", .Id = "vehs_honkboost", diff --git a/ChaosMod/Effects/db/Vehs/VehsInvincible.cpp b/ChaosMod/Effects/db/Vehs/VehsInvincible.cpp index f89b229d8..f5c9e4bec 100644 --- a/ChaosMod/Effects/db/Vehs/VehsInvincible.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsInvincible.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto veh : GetAllVehs()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "All Vehicles Are Invulnerable", .Id = "vehs_invincible", diff --git a/ChaosMod/Effects/db/Vehs/VehsInvisible.cpp b/ChaosMod/Effects/db/Vehs/VehsInvisible.cpp index 9e5ee5de3..580cab647 100644 --- a/ChaosMod/Effects/db/Vehs/VehsInvisible.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsInvisible.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto veh : GetAllVehs()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Invisible Vehicles", .Id = "vehs_ghost", diff --git a/ChaosMod/Effects/db/Vehs/VehsJesusTakeTheWheel.cpp b/ChaosMod/Effects/db/Vehs/VehsJesusTakeTheWheel.cpp index 6f4137bd4..a649e412b 100644 --- a/ChaosMod/Effects/db/Vehs/VehsJesusTakeTheWheel.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsJesusTakeTheWheel.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -67,7 +69,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Jesus Take The Wheel", .Id = "veh_jesustakethewheel" diff --git a/ChaosMod/Effects/db/Vehs/VehsJumpy.cpp b/ChaosMod/Effects/db/Vehs/VehsJumpy.cpp index 80bbd010d..e4ba321a2 100644 --- a/ChaosMod/Effects/db/Vehs/VehsJumpy.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsJumpy.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Physics.h" static void OnTick() @@ -19,7 +20,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Jumpy Vehicles", .Id = "vehs_jumpy", diff --git a/ChaosMod/Effects/db/Vehs/VehsKillEngine.cpp b/ChaosMod/Effects/db/Vehs/VehsKillEngine.cpp index 09f877d58..90e02b138 100644 --- a/ChaosMod/Effects/db/Vehs/VehsKillEngine.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsKillEngine.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Vehicle veh : GetAllVehs()) @@ -7,7 +9,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Kill Engine Of Every Vehicle", .Id = "playerveh_killengine" diff --git a/ChaosMod/Effects/db/Vehs/VehsLockAll.cpp b/ChaosMod/Effects/db/Vehs/VehsLockAll.cpp index e904c6186..1807c913c 100644 --- a/ChaosMod/Effects/db/Vehs/VehsLockAll.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsLockAll.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Vehicle veh : GetAllVehs()) @@ -7,7 +9,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Lock All Vehicles", .Id = "vehs_lockdoors" diff --git a/ChaosMod/Effects/db/Vehs/VehsNoGrav.cpp b/ChaosMod/Effects/db/Vehs/VehsNoGrav.cpp index 6dc647e1e..93c1d9942 100644 --- a/ChaosMod/Effects/db/Vehs/VehsNoGrav.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsNoGrav.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto veh : GetAllVehs()) @@ -13,7 +15,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Vehicles Have No Gravity", .Id = "vehs_nogravity", diff --git a/ChaosMod/Effects/db/Vehs/VehsNoTraffic.cpp b/ChaosMod/Effects/db/Vehs/VehsNoTraffic.cpp index 907576689..3b03b142a 100644 --- a/ChaosMod/Effects/db/Vehs/VehsNoTraffic.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsNoTraffic.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { SET_AMBIENT_VEHICLE_RANGE_MULTIPLIER_THIS_FRAME(.0f); @@ -9,7 +11,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "No Traffic", .Id = "notraffic", diff --git a/ChaosMod/Effects/db/Vehs/VehsOneHitKO.cpp b/ChaosMod/Effects/db/Vehs/VehsOneHitKO.cpp index 756298477..469969fe0 100644 --- a/ChaosMod/Effects/db/Vehs/VehsOneHitKO.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsOneHitKO.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Vehicle.h" static void OnStop() @@ -27,7 +28,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Vehicles Explode On Impact", .Id = "vehs_ohko", diff --git a/ChaosMod/Effects/db/Vehs/VehsPlayerVehDespawn.cpp b/ChaosMod/Effects/db/Vehs/VehsPlayerVehDespawn.cpp index 977cb65ec..ad91c7396 100644 --- a/ChaosMod/Effects/db/Vehs/VehsPlayerVehDespawn.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsPlayerVehDespawn.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -39,7 +41,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Remove Current Vehicle", .Id = "playerveh_despawn" diff --git a/ChaosMod/Effects/db/Vehs/VehsPlayerVehExplode.cpp b/ChaosMod/Effects/db/Vehs/VehsPlayerVehExplode.cpp index 2abacdec5..4e4108bed 100644 --- a/ChaosMod/Effects/db/Vehs/VehsPlayerVehExplode.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsPlayerVehExplode.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + #define DETONATE_TIMER 5000 static void OnStart() @@ -55,7 +57,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Detonate Current Vehicle", .Id = "playerveh_explode", diff --git a/ChaosMod/Effects/db/Vehs/VehsPlayerVehLock.cpp b/ChaosMod/Effects/db/Vehs/VehsPlayerVehLock.cpp index b73b777b5..fd1efa06a 100644 --- a/ChaosMod/Effects/db/Vehs/VehsPlayerVehLock.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsPlayerVehLock.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (Vehicle veh : GetAllVehs()) @@ -19,7 +21,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Lock Player Inside Vehicle", .Id = "playerveh_lock", diff --git a/ChaosMod/Effects/db/Vehs/VehsPopTires.cpp b/ChaosMod/Effects/db/Vehs/VehsPopTires.cpp index f5c58eb31..784475e7c 100644 --- a/ChaosMod/Effects/db/Vehs/VehsPopTires.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsPopTires.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Vehicle veh : GetAllVehs()) @@ -13,7 +15,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Pop Tires Of Every Vehicle", .Id = "playerveh_poptires" diff --git a/ChaosMod/Effects/db/Vehs/VehsPopTiresRandom.cpp b/ChaosMod/Effects/db/Vehs/VehsPopTiresRandom.cpp index 6970633ea..920387b4a 100644 --- a/ChaosMod/Effects/db/Vehs/VehsPopTiresRandom.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsPopTiresRandom.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { static DWORD64 lastTick = GET_GAME_TIMER(); @@ -32,7 +34,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Random Tire Popping", .Id = "veh_poptire", diff --git a/ChaosMod/Effects/db/Vehs/VehsPropModels.cpp b/ChaosMod/Effects/db/Vehs/VehsPropModels.cpp index 1916d0f47..ee2138ec2 100644 --- a/ChaosMod/Effects/db/Vehs/VehsPropModels.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsPropModels.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + CHAOS_VAR std::map vehPropsMap; CHAOS_VAR std::vector availablePropModels; @@ -134,7 +136,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Prop Cars", .Id = "vehs_prop_models", diff --git a/ChaosMod/Effects/db/Vehs/VehsRandomTraffic.cpp b/ChaosMod/Effects/db/Vehs/VehsRandomTraffic.cpp index 7146541b5..bafd2c1cb 100644 --- a/ChaosMod/Effects/db/Vehs/VehsRandomTraffic.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsRandomTraffic.cpp @@ -2,6 +2,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Vehicle.h" static void OnTick() @@ -28,7 +29,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTick, { .Name = "Random Traffic", .Id = "veh_randtraffic", diff --git a/ChaosMod/Effects/db/Vehs/VehsRepairAll.cpp b/ChaosMod/Effects/db/Vehs/VehsRepairAll.cpp index 5b7cba65c..2563c81a6 100644 --- a/ChaosMod/Effects/db/Vehs/VehsRepairAll.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsRepairAll.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { int count = 5; @@ -24,7 +26,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Repair All Vehicles", .Id = "playerveh_repair" diff --git a/ChaosMod/Effects/db/Vehs/VehsReplaceVehicle.cpp b/ChaosMod/Effects/db/Vehs/VehsReplaceVehicle.cpp index 2f16816da..f488a0430 100644 --- a/ChaosMod/Effects/db/Vehs/VehsReplaceVehicle.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsReplaceVehicle.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/Vehicle.h" static void OnStart() @@ -26,7 +27,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Replace Current Vehicle", .Id = "misc_replacevehicle" diff --git a/ChaosMod/Effects/db/Vehs/VehsRepossession.cpp b/ChaosMod/Effects/db/Vehs/VehsRepossession.cpp index d15f7fb48..212d3f58d 100644 --- a/ChaosMod/Effects/db/Vehs/VehsRepossession.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsRepossession.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -70,7 +71,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Repossession", .Id = "veh_repossession", diff --git a/ChaosMod/Effects/db/Vehs/VehsRotAll.cpp b/ChaosMod/Effects/db/Vehs/VehsRotAll.cpp index 79e4d58d9..2f35cd526 100644 --- a/ChaosMod/Effects/db/Vehs/VehsRotAll.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsRotAll.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { for (Vehicle veh : GetAllVehs()) @@ -31,7 +33,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Flip All Vehicles", .Id = "vehs_rotall" diff --git a/ChaosMod/Effects/db/Vehs/VehsSlipperyVehs.cpp b/ChaosMod/Effects/db/Vehs/VehsSlipperyVehs.cpp index d0113add4..446209079 100644 --- a/ChaosMod/Effects/db/Vehs/VehsSlipperyVehs.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsSlipperyVehs.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (auto veh : GetAllVehs()) @@ -19,7 +21,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Slippery Vehicles", .Id = "vehs_slippery", diff --git a/ChaosMod/Effects/db/Vehs/VehsSpamDoors.cpp b/ChaosMod/Effects/db/Vehs/VehsSpamDoors.cpp index 07416d0eb..7291c2e7e 100644 --- a/ChaosMod/Effects/db/Vehs/VehsSpamDoors.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsSpamDoors.cpp @@ -4,6 +4,8 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { static DWORD64 lastTick = GET_GAME_TIMER(); @@ -37,7 +39,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Spammy Vehicle Doors", .Id = "vehs_spamdoors", diff --git a/ChaosMod/Effects/db/Vehs/VehsSpawnIESultan.cpp b/ChaosMod/Effects/db/Vehs/VehsSpawnIESultan.cpp index 43e1e00c3..aec4d81d5 100644 --- a/ChaosMod/Effects/db/Vehs/VehsSpawnIESultan.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsSpawnIESultan.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStart() { Ped playerPed = PLAYER_PED_ID(); @@ -58,7 +60,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, nullptr, { .Name = "Spawn Blue Sultan", .Id = "spawn_bluesultan", diff --git a/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp b/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp index 69161661a..d50a38800 100644 --- a/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsSpawner.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Vehicle.h" static Vector3 GetPlayerPos() @@ -17,7 +18,7 @@ static void OnStartRhino() } // clang-format off -REGISTER_EFFECT(OnStartRhino, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRhino, nullptr, nullptr, { .Name = "Spawn Rhino", .Id = "spawn_rhino", @@ -34,7 +35,7 @@ static void OnStartAdder() } // clang-format off -REGISTER_EFFECT(OnStartAdder, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartAdder, nullptr, nullptr, { .Name = "Spawn Adder", .Id = "spawn_adder", @@ -51,7 +52,7 @@ static void OnStartDump() } // clang-format off -REGISTER_EFFECT(OnStartDump, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartDump, nullptr, nullptr, { .Name = "Spawn Dump", .Id = "spawn_dump", @@ -68,7 +69,7 @@ static void OnStartMonster() } // clang-format off -REGISTER_EFFECT(OnStartMonster, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMonster, nullptr, nullptr, { .Name = "Spawn Monster", .Id = "spawn_monster", @@ -85,7 +86,7 @@ static void OnStartBMX() } // clang-format off -REGISTER_EFFECT(OnStartBMX, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartBMX, nullptr, nullptr, { .Name = "Spawn BMX", .Id = "spawn_bmx", @@ -102,7 +103,7 @@ static void OnStartTug() } // clang-format off -REGISTER_EFFECT(OnStartTug, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartTug, nullptr, nullptr, { .Name = "Spawn Tug", .Id = "spawn_tug", @@ -119,7 +120,7 @@ static void OnStartCargoplane() } // clang-format off -REGISTER_EFFECT(OnStartCargoplane, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartCargoplane, nullptr, nullptr, { .Name = "Spawn Cargo Plane", .Id = "spawn_cargo", @@ -136,7 +137,7 @@ static void OnStartBus() } // clang-format off -REGISTER_EFFECT(OnStartBus, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartBus, nullptr, nullptr, { .Name = "Spawn Bus", .Id = "spawn_bus", @@ -153,7 +154,7 @@ static void OnStartBlimp() } // clang-format off -REGISTER_EFFECT(OnStartBlimp, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartBlimp, nullptr, nullptr, { .Name = "Spawn Blimp", .Id = "spawn_blimp", @@ -170,7 +171,7 @@ static void OnStartBuzzard() } // clang-format off -REGISTER_EFFECT(OnStartBuzzard, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartBuzzard, nullptr, nullptr, { .Name = "Spawn Buzzard", .Id = "spawn_buzzard", @@ -187,7 +188,7 @@ static void OnStartFaggio() } // clang-format off -REGISTER_EFFECT(OnStartFaggio, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFaggio, nullptr, nullptr, { .Name = "Spawn Faggio", .Id = "spawn_faggio", @@ -204,7 +205,7 @@ static void OnStartRuiner3() } // clang-format off -REGISTER_EFFECT(OnStartRuiner3, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRuiner3, nullptr, nullptr, { .Name = "Spawn Ruined Ruiner", .Id = "spawn_ruiner3", @@ -256,7 +257,7 @@ static void OnStartRandom() } // clang-format off -REGISTER_EFFECT(OnStartRandom, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRandom, nullptr, nullptr, { .Name = "Spawn Random Vehicle", .Id = "spawn_random", @@ -273,7 +274,7 @@ static void OnStartBaletrailer() } // clang-format off -REGISTER_EFFECT(OnStartBaletrailer, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartBaletrailer, nullptr, nullptr, { .Name = "Spawn Bale Trailer", .Id = "spawn_baletrailer", @@ -290,7 +291,7 @@ static void OnStartRomero() } // clang-format off -REGISTER_EFFECT(OnStartRomero, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRomero, nullptr, nullptr, { .Name = "Where's The Funeral?", .Id = "spawn_romero", @@ -325,7 +326,7 @@ static void OnStartWizardBroom() } // clang-format off -REGISTER_EFFECT(OnStartWizardBroom, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartWizardBroom, nullptr, nullptr, { .Name = "You're A Wizard, Franklin", .Id = "vehs_spawn_wizard_broom", diff --git a/ChaosMod/Effects/db/Vehs/VehsSpeedMin.cpp b/ChaosMod/Effects/db/Vehs/VehsSpeedMin.cpp index ec7a286d3..f401d607c 100644 --- a/ChaosMod/Effects/db/Vehs/VehsSpeedMin.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsSpeedMin.cpp @@ -2,10 +2,9 @@ Effect by Lucas7yoshi, modified */ -#include "scripthookv/inc/natives.h" -#include #include -#include + +#include "Effects/Register/RegisterEffect.h" #define WAIT_TIME 10000 // ms #define SPEED_THRESHOLD 0.5f // % of max speed must be reached @@ -140,7 +139,7 @@ static void OnStart() } // clang-format off -REGISTER_EFFECT(OnStart, nullptr, OnTick, EffectInfo +REGISTER_EFFECT(OnStart, nullptr, OnTick, { .Name = "Need For Speed", .Id = "veh_speed_goal", diff --git a/ChaosMod/Effects/db/Vehs/VehsTiny.cpp b/ChaosMod/Effects/db/Vehs/VehsTiny.cpp index 4eb26c81e..6ed3eee0f 100644 --- a/ChaosMod/Effects/db/Vehs/VehsTiny.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsTiny.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Vehicle.h" CHAOS_VAR std::map vehicleDefaultSizes; @@ -42,7 +43,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Tiny Vehicles", .Id = "vehs_tiny", diff --git a/ChaosMod/Effects/db/Vehs/VehsTirePoppin.cpp b/ChaosMod/Effects/db/Vehs/VehsTirePoppin.cpp index f7b9920c6..be05f3087 100644 --- a/ChaosMod/Effects/db/Vehs/VehsTirePoppin.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsTirePoppin.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStop() { for (Vehicle veh : GetAllVehs()) @@ -22,7 +24,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Now This Is Some Tire Poppin'", .Id = "vehs_poptiresconstant", diff --git a/ChaosMod/Effects/db/Vehs/VehsTriggerAlarm.cpp b/ChaosMod/Effects/db/Vehs/VehsTriggerAlarm.cpp index 4b1453fac..9d81bfabc 100644 --- a/ChaosMod/Effects/db/Vehs/VehsTriggerAlarm.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsTriggerAlarm.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnTick() { static auto lastTick = GET_GAME_TIMER(); @@ -24,7 +26,7 @@ static void OnStop() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Alarmy Vehicles", .Id = "vehs_alarmloop", diff --git a/ChaosMod/Effects/db/Vehs/VehsUpgradeController.cpp b/ChaosMod/Effects/db/Vehs/VehsUpgradeController.cpp index bcd00675c..f824e741a 100644 --- a/ChaosMod/Effects/db/Vehs/VehsUpgradeController.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsUpgradeController.cpp @@ -1,5 +1,7 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStartMaxUpgrades() { for (Vehicle veh : GetAllVehs()) @@ -34,7 +36,7 @@ static void OnStartMaxUpgrades() } // clang-format off -REGISTER_EFFECT(OnStartMaxUpgrades, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartMaxUpgrades, nullptr, nullptr, { .Name = "Add Max Upgrades To Every Vehicle", .Id = "playerveh_maxupgrades" @@ -79,7 +81,7 @@ static void OnStartRandomUpgrades() } // clang-format off -REGISTER_EFFECT(OnStartRandomUpgrades, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartRandomUpgrades, nullptr, nullptr, { .Name = "Add Random Upgrades To Every Vehicle", .Id = "playerveh_randupgrades" diff --git a/ChaosMod/Effects/db/Vehs/VehsWeapons.cpp b/ChaosMod/Effects/db/Vehs/VehsWeapons.cpp index abd56bd44..da2ac0ef1 100644 --- a/ChaosMod/Effects/db/Vehs/VehsWeapons.cpp +++ b/ChaosMod/Effects/db/Vehs/VehsWeapons.cpp @@ -4,6 +4,7 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Util/HelpText.h" CHAOS_VAR int last_shot = 0; @@ -54,7 +55,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Vehicles Shoot Rockets", .Id = "veh_weapons", diff --git a/ChaosMod/Effects/db/Weather/WeatherController.cpp b/ChaosMod/Effects/db/Weather/WeatherController.cpp index afeff91cb..ca16682bd 100644 --- a/ChaosMod/Effects/db/Weather/WeatherController.cpp +++ b/ChaosMod/Effects/db/Weather/WeatherController.cpp @@ -1,12 +1,14 @@ #include +#include "Effects/Register/RegisterEffect.h" + static void OnStartExtraSunny() { SET_WEATHER_TYPE_NOW("EXTRASUNNY"); } // clang-format off -REGISTER_EFFECT(OnStartExtraSunny, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartExtraSunny, nullptr, nullptr, { .Name = "Extra Sunny Weather", .Id = "weather_extrasunny", @@ -21,7 +23,7 @@ static void OnStartThunder() } // clang-format off -REGISTER_EFFECT(OnStartThunder, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartThunder, nullptr, nullptr, { .Name = "Stormy Weather", .Id = "weather_stormy", @@ -36,7 +38,7 @@ static void OnStartFoggy() } // clang-format off -REGISTER_EFFECT(OnStartFoggy, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartFoggy, nullptr, nullptr, { .Name = "Foggy Weather", .Id = "weather_foggy", @@ -51,7 +53,7 @@ static void OnStartNeutral() } // clang-format off -REGISTER_EFFECT(OnStartNeutral, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartNeutral, nullptr, nullptr, { .Name = "Neutral Weather", .Id = "weather_neutral", @@ -66,7 +68,7 @@ static void OnStartXmas() } // clang-format off -REGISTER_EFFECT(OnStartXmas, nullptr, nullptr, EffectInfo +REGISTER_EFFECT(OnStartXmas, nullptr, nullptr, { .Name = "Snowy Weather", .Id = "weather_snowy", @@ -98,7 +100,7 @@ static void OnTickRandom() } // clang-format off -REGISTER_EFFECT(nullptr, nullptr, OnTickRandom, EffectInfo +REGISTER_EFFECT(nullptr, nullptr, OnTickRandom, { .Name = "Disco Weather", .Id = "weather_randomizer", diff --git a/ChaosMod/Effects/db/Weather/WeatherSnow.cpp b/ChaosMod/Effects/db/Weather/WeatherSnow.cpp index a0276a3f5..3d1b9ee81 100644 --- a/ChaosMod/Effects/db/Weather/WeatherSnow.cpp +++ b/ChaosMod/Effects/db/Weather/WeatherSnow.cpp @@ -1,5 +1,6 @@ #include +#include "Effects/Register/RegisterEffect.h" #include "Memory/Snow.h" static void OnStop() @@ -17,7 +18,7 @@ static void OnTick() } // clang-format off -REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo +REGISTER_EFFECT(nullptr, OnStop, OnTick, { .Name = "Snow", .Id = "world_snow", diff --git a/ChaosMod/Main.cpp b/ChaosMod/Main.cpp index 456a360ec..037176813 100644 --- a/ChaosMod/Main.cpp +++ b/ChaosMod/Main.cpp @@ -2,11 +2,6 @@ #include "Main.h" -#include "Effects/EffectConfig.h" - -#include "Memory/Hooks/ScriptThreadRunHook.h" -#include "Memory/Misc.h" - #include "Components/DebugMenu.h" #include "Components/DebugSocket.h" #include "Components/EffectDispatchTimer.h" @@ -21,7 +16,10 @@ #include "Components/SplashTexts.h" #include "Components/Voting.h" #include "Components/Workshop.h" - +#include "Effects/EffectConfig.h" +#include "Effects/EnabledEffects.h" +#include "Memory/Hooks/ScriptThreadRunHook.h" +#include "Memory/Misc.h" #include "Util/File.h" #include "Util/OptionsManager.h" #include "Util/PoolSpawner.h" diff --git a/ChaosMod/Memory/Handle.h b/ChaosMod/Memory/Handle.h index 86706662d..39b064f4d 100644 --- a/ChaosMod/Memory/Handle.h +++ b/ChaosMod/Memory/Handle.h @@ -1,12 +1,11 @@ #pragma once -using DWORD64 = unsigned long long; -using DWORD = unsigned long; +#include class Handle { private: - uintptr_t m_Addr = 0; + std::uintptr_t m_Addr = 0; public: Handle() = default; @@ -34,7 +33,7 @@ class Handle return IsValid() ? *Get() : 0; } - inline DWORD64 Addr() const + inline uintptr_t Addr() const { return m_Addr; } @@ -44,7 +43,7 @@ class Handle if (IsValid()) { auto handle = At(1); - return handle.At(handle.Value()).At(4); + return handle.At(handle.Value()).At(4); } return 0; diff --git a/ChaosMod/Memory/Physics.h b/ChaosMod/Memory/Physics.h index 4934fa01c..bb9b18d39 100644 --- a/ChaosMod/Memory/Physics.h +++ b/ChaosMod/Memory/Physics.h @@ -56,8 +56,7 @@ namespace Memory if (!phSimulator_sm_Instance) return 100; - Handle handle(phSimulator_sm_Instance); - handle = handle.Value(); + Handle handle = Handle(phSimulator_sm_Instance).Value(); if (handle.Addr() == 0) return 0; diff --git a/ChaosMod/Util/EntityIterator.h b/ChaosMod/Util/EntityIterator.h index be02e2881..c8e8898b9 100644 --- a/ChaosMod/Util/EntityIterator.h +++ b/ChaosMod/Util/EntityIterator.h @@ -1,9 +1,9 @@ #pragma once -#include "Natives.h" - #include "Memory/Memory.h" +#include + #include // Thanks to menyoo for most of these!! @@ -13,8 +13,8 @@ template class PoolIterator { public: - T *Pool = nullptr; - int32_t Index = 0; + T *Pool = nullptr; + std::int32_t Index = 0; explicit PoolIterator(T *pool, int32_t index = 0) { diff --git a/ChaosMod/Util/MacroConcat.h b/ChaosMod/Util/MacroConcat.h new file mode 100644 index 000000000..ef2b93f4e --- /dev/null +++ b/ChaosMod/Util/MacroConcat.h @@ -0,0 +1,4 @@ +#pragma once + +#define _CONCAT(a, b) a##b +#define CONCAT(a, b) _CONCAT(a, b) \ No newline at end of file diff --git a/ChaosMod/Util/Player.h b/ChaosMod/Util/Player.h index 3d2ac8e95..9976578dd 100644 --- a/ChaosMod/Util/Player.h +++ b/ChaosMod/Util/Player.h @@ -1,7 +1,7 @@ #pragma once -#include "Natives.h" #include "Components/EffectDispatchTimer.h" +#include "Natives.h" inline void TeleportPlayer(float x, float y, float z, bool noOffset = false) { diff --git a/ChaosMod/stdafx.h b/ChaosMod/stdafx.h index 99c82fa30..ce3fc88e2 100644 --- a/ChaosMod/stdafx.h +++ b/ChaosMod/stdafx.h @@ -1,7 +1,5 @@ #pragma once -#include "Effects/Effect.h" - #include "Util/EntityIterator.h" #include "Util/Hash.h" #include "Util/Logging.h"