]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
classic weapon exists now
authordrjaska <drjaska83@gmail.com>
Wed, 30 Nov 2022 09:46:15 +0000 (11:46 +0200)
committerdrjaska <drjaska83@gmail.com>
Wed, 30 Nov 2022 09:56:29 +0000 (11:56 +0200)
qcsrc/common/weapons/all.inc
qcsrc/common/weapons/weapon/classic.qh [new file with mode: 0644]

index 15e61025b7f03da9ede755c321a619d2865ccf3b..613f94f6c5253225a4527e1a91a2006e49a914b9 100644 (file)
@@ -25,7 +25,8 @@
 #include "weapon/seeker.qh"
 #include "weapon/shockwave.qh"
 #include "weapon/arc.qh"
+#include "weapon/classic.qh"
 
 // Weapon registry is sorted to allocate the weapons included above first, update the value below to the number of listed weapons
 // TODO: remove eventually in a way that does not cause https://gitlab.com/xonotic/xonotic-data.pk3dir/-/issues/2714
-#define WEP_HARDCODED_IMPULSES 20
+#define WEP_HARDCODED_IMPULSES 21
diff --git a/qcsrc/common/weapons/weapon/classic.qh b/qcsrc/common/weapons/weapon/classic.qh
new file mode 100644 (file)
index 0000000..8157526
--- /dev/null
@@ -0,0 +1,59 @@
+#pragma once
+
+CLASS(Classic, Weapon)
+/* spawnfunc */ ATTRIB(Classic, m_canonical_spawnfunc, string, "weapon_classic");
+/* ammotype  */ ATTRIB(Classic, ammo_type, Resource, RES_ROCKETS);
+/* impulse   */ ATTRIB(Classic, impulse, int, 4);
+/* flags     */ ATTRIB(Classic, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NOTRUEAIM);
+/* rating    */ ATTRIB(Classic, bot_pickupbasevalue, float, 7000);
+/* color     */ ATTRIB(Classic, wpcolor, vector, '1 0 0');
+/* modelname */ ATTRIB(Classic, mdl, string, "gl");
+#ifdef GAMEQC
+/* model     */ ATTRIB(Classic, m_model, Model, MDL_MORTAR_ITEM); //TODO
+/* flash mdl */ ATTRIB(Classic, m_muzzlemodel, Model, MDL_Null);
+/* flash eff */ ATTRIB(Classic, m_muzzleeffect, entity, EFFECT_GRENADE_MUZZLEFLASH); //TODO
+#endif
+/* crosshair */ ATTRIB(Classic, w_crosshair, string, "gfx/crosshairgrenadelauncher"); //TODO
+/* crosshair */ ATTRIB(Classic, w_crosshair_size, float, 0.7);
+/* wepimg    */ ATTRIB(Classic, model2, string, "weapongrenadelauncher"); //TODO
+/* refname   */ ATTRIB(Classic, netname, string, "classic");
+/* wepname   */ ATTRIB(Classic, m_name, string, _("Classic"));
+
+#define X(BEGIN, P, END, class, prefix) \
+       BEGIN(class) \
+               P(class, prefix, ammo, float, BOTH) \
+               P(class, prefix, animtime, float, BOTH) \
+               P(class, prefix, bouncefactor, float, NONE) \
+               P(class, prefix, bouncestop, float, NONE) \
+               P(class, prefix, damageforcescale, float, BOTH) \
+               P(class, prefix, damage, float, BOTH) \
+               P(class, prefix, edgedamage, float, BOTH) \
+               P(class, prefix, force, float, BOTH) \
+               P(class, prefix, health, float, BOTH) \
+               P(class, prefix, lifetime, float, BOTH) \
+               P(class, prefix, radius, float, BOTH) \
+               P(class, prefix, refire, float, BOTH) \
+               P(class, prefix, reload_ammo, float, NONE) \
+               P(class, prefix, reload_time, float, NONE) \
+               P(class, prefix, speed, float, BOTH) \
+               P(class, prefix, speed_up, float, BOTH) \
+               P(class, prefix, speed_z, float, BOTH) \
+               P(class, prefix, spread, float, BOTH) \
+               P(class, prefix, switchdelay_drop, float, NONE) \
+               P(class, prefix, switchdelay_raise, float, NONE) \
+               P(class, prefix, weaponreplace, string, NONE) \
+               P(class, prefix, weaponstartoverride, float, NONE) \
+               P(class, prefix, weaponstart, float, NONE) \
+               P(class, prefix, weaponthrowable, float, NONE) \
+       END()
+    W_PROPS(X, Classic, classic)
+#undef X
+ENDCLASS(Classic)
+REGISTER_WEAPON(CLASSIC, classic, NEW(Classic));
+
+SPAWNFUNC_WEAPON(weapon_classic, WEP_CLASSIC)
+
+#ifdef SVQC
+.float gl_detonate_later;
+.float gl_bouncecnt;
+#endif