Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
hook.qh
Go to the documentation of this file.
1#pragma once
2
3#ifdef GAMEQC
4MODEL(HOOK, "models/hook.md3");
5MODEL(HOOK_VIEW, W_Model("h_hookgun.iqm"));
6MODEL(HOOK_WORLD, W_Model("v_hookgun.md3"));
7MODEL(HOOK_ITEM, W_Model("g_hookgun.md3"));
8
9SOUND(HOOKBOMB_FIRE, W_Sound("hookbomb_fire"));
10SOUND(HOOKBOMB_IMPACT, W_Sound("hookbomb_impact"));
11SOUND(HOOK_FIRE, W_Sound("hook_fire"));
12SOUND(HOOK_IMPACT, W_Sound("hook_impact"));
13#endif
14
16#ifdef SVQC
17/* spawnfunc */ ATTRIB(Hook, m_canonical_spawnfunc, string, "weapon_hook");
18/* rating */ ATTRIB(Hook, bot_pickupbasevalue, float, 0);
19#endif
20/* ammotype */ ATTRIB(Hook, ammo_type, Resource, RES_FUEL);
21/* impulse */ ATTRIB(Hook, impulse, int, 0);
23/* color */ ATTRIB(Hook, m_color, vector, '0.471 0.817 0.392');
24#ifdef GAMEQC
25/* modelname */ ATTRIB(Hook, mdl, string, "hookgun");
26/* model */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM);
27/* flash mdl */ ATTRIB(Hook, m_muzzlemodel, Model, MDL_Null);
28/* flash eff */ ATTRIB(Hook, m_muzzleeffect, entity, EFFECT_HOOK_MUZZLEFLASH);
29#endif
30#ifdef CSQC
31/* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook");
32/* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5);
33#endif
34/* wepimg */ ATTRIB(Hook, model2, string, "weaponhook");
35/* refname */ ATTRIB(Hook, netname, string, "hook");
36/* wepname */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
37 ATTRIB(Hook, ammo_factor, float, 1);
38
39#define X(BEGIN, P, END, class, prefix) \
40 BEGIN(class) \
41 P(class, prefix, ammo, float, PRI) \
42 P(class, prefix, animtime, float, BOTH) \
43 P(class, prefix, damageforcescale, float, SEC) \
44 P(class, prefix, damage, float, SEC) \
45 P(class, prefix, duration, float, SEC) \
46 P(class, prefix, edgedamage, float, SEC) \
47 P(class, prefix, force, float, SEC) \
48 P(class, prefix, gravity, float, SEC) \
49 P(class, prefix, health, float, SEC) \
50 P(class, prefix, hooked_ammo, float, PRI) \
51 P(class, prefix, hooked_time_free, float, PRI) \
52 P(class, prefix, hooked_time_max, float, PRI) \
53 P(class, prefix, lifetime, float, SEC) \
54 P(class, prefix, pickup_ammo, float, NONE) \
55 P(class, prefix, power, float, SEC) \
56 P(class, prefix, radius, float, SEC) \
57 P(class, prefix, refire, float, BOTH) \
58 P(class, prefix, speed, float, SEC) \
59 P(class, prefix, switchdelay_drop, float, NONE) \
60 P(class, prefix, switchdelay_raise, float, NONE) \
61 P(class, prefix, weaponreplace, string, NONE) \
62 P(class, prefix, weaponstartoverride, float, NONE) \
63 P(class, prefix, weaponstart, float, NONE) \
64 P(class, prefix, weaponthrowable, float, NONE) \
65 END()
67#undef X
68
71
72SPAWNFUNC_WEAPON(weapon_hook, WEP_HOOK)
73
74#ifdef SVQC
76 METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
77 {
78 Weapon wep = WEP_HOOK;
79 .entity weaponentity = weaponentities[1];
80 wep.wr_think(wep, actor, weaponentity, key_pressed ? 1 : 0);
81 }
88
89.float dmg;
90.float dmg_edge;
92.float dmg_force;
93.float dmg_last;
97#endif
float dmg_force
Definition breakable.qc:15
float dmg
Definition breakable.qc:12
float dmg_edge
Definition breakable.qc:13
float dmg_radius
Definition breakable.qc:14
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
Definition hook.qh:15
vector m_color
Definition hook.qh:23
string w_crosshair
Definition hook.qh:31
Model m_model
Definition hook.qh:26
entity m_muzzleeffect
Definition hook.qh:28
float bot_pickupbasevalue
Definition hook.qh:18
float w_crosshair_size
Definition hook.qh:32
string netname
Definition hook.qh:35
int spawnflags
Definition hook.qh:22
Model m_muzzlemodel
Definition hook.qh:27
string m_name
Definition hook.qh:36
string model2
Definition hook.qh:34
string m_canonical_spawnfunc
Definition hook.qh:17
int impulse
Definition hook.qh:21
string mdl
Definition hook.qh:25
float ammo_factor
Definition hook.qh:37
Resource ammo_type
Definition hook.qh:20
Definition model.qh:3
virtual void offhand_think()
Definition hook.qh:76
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:42
virtual void wr_think()
(SERVER) logic to run every frame
Definition weapon.qh:98
entity hook
Definition player.qh:238
OffhandHook OFFHAND_HOOK
Definition hook.qh:83
float dmg_last
Definition hook.qh:93
float hook_refire
Definition hook.qh:94
float hook_time_fueldecrease
Definition hook.qh:96
float hook_time_hooked
Definition hook.qh:95
#define X()
string W_Model(string w_mdl)
Definition all.qc:233
#define MODEL(name, path)
Definition all.qh:8
#define NEW(cname,...)
Definition oo.qh:117
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define ATTRIB(...)
Definition oo.qh:148
vector
Definition self.qh:92
entity this
Definition self.qh:72
string W_Sound(string w_snd)
Definition all.qc:226
#define SOUND(name, path)
Definition all.qh:30
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32
#define W_PROPS(L, class, prefix)
Definition all.qh:188
#define REGISTER_WEAPON(id, inst)
Definition all.qh:136
const int WEP_FLAG_CANCLIMB
Definition weapon.qh:256
const int WEP_FLAG_NOTRUEAIM
Definition weapon.qh:268
const int WEP_TYPE_SPLASH
Definition weapon.qh:254
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17
#define SPAWNFUNC_WEAPON(name, weapon)
Definition weapon.qh:191