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/* spawnfunc */ ATTRIB(Hook, m_canonical_spawnfunc, string, "weapon_hook");
17/* ammotype */ ATTRIB(Hook, ammo_type, Resource, RES_FUEL);
18/* impulse */ ATTRIB(Hook, impulse, int, 0);
20/* rating */ ATTRIB(Hook, bot_pickupbasevalue, float, 0);
21/* color */ ATTRIB(Hook, m_color, vector, '0.471 0.817 0.392');
22/* modelname */ ATTRIB(Hook, mdl, string, "hookgun");
23#ifdef GAMEQC
24/* model */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM);
25/* flash mdl */ ATTRIB(Hook, m_muzzlemodel, Model, MDL_Null);
26/* flash eff */ ATTRIB(Hook, m_muzzleeffect, entity, EFFECT_HOOK_MUZZLEFLASH);
27#endif
28/* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook");
29/* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5);
30/* wepimg */ ATTRIB(Hook, model2, string, "weaponhook");
31/* refname */ ATTRIB(Hook, netname, string, "hook");
32/* wepname */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
33 ATTRIB(Hook, ammo_factor, float, 1);
34
35#define X(BEGIN, P, END, class, prefix) \
36 BEGIN(class) \
37 P(class, prefix, ammo, float, PRI) \
38 P(class, prefix, animtime, float, BOTH) \
39 P(class, prefix, damageforcescale, float, SEC) \
40 P(class, prefix, damage, float, SEC) \
41 P(class, prefix, duration, float, SEC) \
42 P(class, prefix, edgedamage, float, SEC) \
43 P(class, prefix, force, float, SEC) \
44 P(class, prefix, gravity, float, SEC) \
45 P(class, prefix, health, float, SEC) \
46 P(class, prefix, hooked_ammo, float, PRI) \
47 P(class, prefix, hooked_time_free, float, PRI) \
48 P(class, prefix, hooked_time_max, float, PRI) \
49 P(class, prefix, lifetime, float, SEC) \
50 P(class, prefix, pickup_ammo, float, NONE) \
51 P(class, prefix, power, float, SEC) \
52 P(class, prefix, radius, float, SEC) \
53 P(class, prefix, refire, float, BOTH) \
54 P(class, prefix, speed, float, SEC) \
55 P(class, prefix, switchdelay_drop, float, NONE) \
56 P(class, prefix, switchdelay_raise, float, NONE) \
57 P(class, prefix, weaponreplace, string, NONE) \
58 P(class, prefix, weaponstartoverride, float, NONE) \
59 P(class, prefix, weaponstart, float, NONE) \
60 P(class, prefix, weaponthrowable, float, NONE) \
61 END()
63#undef X
64
67
68SPAWNFUNC_WEAPON(weapon_hook, WEP_HOOK)
69
71#ifdef SVQC
72 METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
73 {
74 Weapon wep = WEP_HOOK;
75 .entity weaponentity = weaponentities[1];
76 wep.wr_think(wep, actor, weaponentity, key_pressed ? 1 : 0);
77 }
78#endif
82
83#ifdef SVQC
84
85.float dmg;
86.float dmg_edge;
88.float dmg_force;
89.float dmg_power;
91.float dmg_last;
95#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:21
string w_crosshair
Definition hook.qh:28
Model m_model
Definition hook.qh:24
entity m_muzzleeffect
Definition hook.qh:26
float bot_pickupbasevalue
Definition hook.qh:20
float w_crosshair_size
Definition hook.qh:29
string netname
Definition hook.qh:31
int spawnflags
Definition hook.qh:19
Model m_muzzlemodel
Definition hook.qh:25
string m_name
Definition hook.qh:32
string model2
Definition hook.qh:30
string m_canonical_spawnfunc
Definition hook.qh:16
int impulse
Definition hook.qh:18
string mdl
Definition hook.qh:22
float ammo_factor
Definition hook.qh:33
Resource ammo_type
Definition hook.qh:17
Definition model.qh:3
virtual void offhand_think()
Definition hook.qh:72
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
Definition weapon.qh:44
virtual void wr_think()
(SERVER) logic to run every frame
Definition weapon.qh:90
ATTRIB(Weapon, m_canonical_spawnfunc, string)
the canonical spawnfunc name
entity hook
Definition player.qh:239
float dmg_power
Definition hook.qh:89
OffhandHook OFFHAND_HOOK
Definition hook.qh:80
float dmg_last
Definition hook.qh:91
float hook_refire
Definition hook.qh:92
float hook_time_fueldecrease
Definition hook.qh:94
float dmg_duration
Definition hook.qh:90
float hook_time_hooked
Definition hook.qh:93
#define X()
string W_Model(string w_mdl)
Definition all.qc:232
#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
string W_Sound(string w_snd)
Definition all.qc:225
#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:179
#define REGISTER_WEAPON(id, inst)
Definition all.qh:136
const int WEP_FLAG_CANCLIMB
Definition weapon.qh:214
const int WEP_FLAG_NOTRUEAIM
Definition weapon.qh:226
const int WEP_TYPE_SPLASH
Definition weapon.qh:212
entity weaponentities[MAX_WEAPONSLOTS]
Definition weapon.qh:17
#define SPAWNFUNC_WEAPON(name, weapon)
Definition weapon.qh:150