From 2dafe3038070847048ad460952ddf2b0a694ed25 Mon Sep 17 00:00:00 2001
From: OnlyRealNubs <91900600+OnlyRealNubs@users.noreply.github.com>
Date: Tue, 24 May 2022 14:11:42 -0400
Subject: [PATCH] Added "Imaginary Weapons" effect
All weapons are invisible
---
ChaosMod/ChaosMod.vcxproj | 1 +
.../Effects/db/Peds/PedsInvisibleWeps.cpp | 31 +++++++++++++++++++
ConfigApp/Effects.cs | 1 +
3 files changed, 33 insertions(+)
create mode 100644 ChaosMod/Effects/db/Peds/PedsInvisibleWeps.cpp
diff --git a/ChaosMod/ChaosMod.vcxproj b/ChaosMod/ChaosMod.vcxproj
index 73ddd8b49..88f65e5a2 100644
--- a/ChaosMod/ChaosMod.vcxproj
+++ b/ChaosMod/ChaosMod.vcxproj
@@ -127,6 +127,7 @@
+
diff --git a/ChaosMod/Effects/db/Peds/PedsInvisibleWeps.cpp b/ChaosMod/Effects/db/Peds/PedsInvisibleWeps.cpp
new file mode 100644
index 000000000..84d0986a7
--- /dev/null
+++ b/ChaosMod/Effects/db/Peds/PedsInvisibleWeps.cpp
@@ -0,0 +1,31 @@
+/*
+ Effect By OnlyRealNubs
+*/
+
+#include "stdafx.h"
+
+static void OnStop()
+{
+ for (Ped ped : GetAllPeds())
+ {
+ SET_ENTITY_ALPHA(GET_CURRENT_PED_WEAPON_ENTITY_INDEX(ped, 0), 255, false);
+ }
+}
+
+static void OnTick()
+{
+ for (Ped ped : GetAllPeds())
+ {
+ SET_ENTITY_ALPHA(GET_CURRENT_PED_WEAPON_ENTITY_INDEX(ped, 0), 0, false);
+ }
+}
+
+// clang-format off
+REGISTER_EFFECT(nullptr, OnStop, OnTick, EffectInfo
+ {
+ .Name = "Imaginary Weapons",
+ .Id = "peds_invisible_weps",
+ .IsTimed = true,
+ .IncompatibleWith = { "misc_ghost_world" }
+ }
+);
\ No newline at end of file
diff --git a/ConfigApp/Effects.cs b/ConfigApp/Effects.cs
index c17873bb5..1f2bccc30 100644
--- a/ConfigApp/Effects.cs
+++ b/ConfigApp/Effects.cs
@@ -373,6 +373,7 @@ public enum EffectTimedType
{ "screen_colorfulworld", new EffectInfo("Colorful World", EffectCategory.Screen, true) },
{ "screen_arc", new EffectInfo("Arced Screen", EffectCategory.Screen, true, true) },
{ "world_blackhole", new EffectInfo("Black Hole", EffectCategory.Misc, true, true) },
+ { "peds_invisible_weps", new EffectInfo("Imaginary Weapons", EffectCategory.Peds, true) },
};
}
}