From: drjaska Date: Wed, 30 Nov 2022 09:46:15 +0000 (+0200) Subject: classic weapon exists now X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f76078958e11b74a6c0073356a8123b956babe6c;p=xonotic%2Fxonotic-data.pk3dir.git classic weapon exists now --- diff --git a/qcsrc/common/weapons/all.inc b/qcsrc/common/weapons/all.inc index 15e61025b..613f94f6c 100644 --- a/qcsrc/common/weapons/all.inc +++ b/qcsrc/common/weapons/all.inc @@ -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 index 000000000..81575263d --- /dev/null +++ b/qcsrc/common/weapons/weapon/classic.qh @@ -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