]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/weapon/arc.qh
187e5840257149e270f929961f13a7ed2412a7ea
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / arc.qh
1 #pragma once
2
3 CLASS(Arc, Weapon)
4 /* spawnfunc */ ATTRIB(Arc, m_canonical_spawnfunc, string, "weapon_arc");
5 /* ammotype  */ ATTRIB(Arc, ammo_type, int, RESOURCE_CELLS);
6 /* impulse   */ ATTRIB(Arc, impulse, int, 3);
7 /* flags     */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN);
8 /* rating    */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000);
9 /* color     */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
10 /* modelname */ ATTRIB(Arc, mdl, string, "arc");
11 #ifdef GAMEQC
12 /* model     */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
13 #endif
14 /* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
15 /* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7);
16 /* wepimg    */ ATTRIB(Arc, model2, string, "weaponarc");
17 /* refname   */ ATTRIB(Arc, netname, string, "arc");
18 /* wepname   */ ATTRIB(Arc, m_name, string, _("Arc"));
19
20 #define X(BEGIN, P, END, class, prefix) \
21         BEGIN(class) \
22                 P(class, prefix, bolt, float, NONE) \
23                 P(class, prefix, bolt_ammo, float, NONE) \
24         P(class, prefix, bolt_damageforcescale, float, NONE) \
25         P(class, prefix, bolt_damage, float, NONE) \
26         P(class, prefix, bolt_edgedamage, float, NONE) \
27         P(class, prefix, bolt_force, float, NONE) \
28         P(class, prefix, bolt_health, float, NONE) \
29         P(class, prefix, bolt_lifetime, float, NONE) \
30         P(class, prefix, bolt_radius, float, NONE) \
31         P(class, prefix, bolt_refire, float, NONE) \
32         P(class, prefix, bolt_speed, float, NONE) \
33         P(class, prefix, bolt_spread, float, NONE) \
34                 P(class, prefix, beam_ammo, float, NONE) \
35         P(class, prefix, beam_animtime, float, NONE) \
36         P(class, prefix, beam_botaimlifetime, float, NONE) \
37         P(class, prefix, beam_botaimspeed, float, NONE) \
38         P(class, prefix, beam_damage, float, NONE) \
39         P(class, prefix, beam_degreespersegment, float, NONE) \
40         P(class, prefix, beam_distancepersegment, float, NONE) \
41         P(class, prefix, beam_falloff_halflifedist, float, NONE) \
42         P(class, prefix, beam_falloff_maxdist, float, NONE) \
43         P(class, prefix, beam_falloff_mindist, float, NONE) \
44         P(class, prefix, beam_force, float, NONE) \
45         P(class, prefix, beam_healing_amax, float, NONE) \
46         P(class, prefix, beam_healing_aps, float, NONE) \
47         P(class, prefix, beam_healing_hmax, float, NONE) \
48         P(class, prefix, beam_healing_hps, float, NONE) \
49         P(class, prefix, beam_heat, float, NONE) /* heat increase per second (primary) */ \
50         P(class, prefix, beam_maxangle, float, NONE) \
51         P(class, prefix, beam_nonplayerdamage, float, NONE) \
52         P(class, prefix, beam_range, float, NONE) \
53         P(class, prefix, beam_refire, float, NONE) \
54         P(class, prefix, beam_returnspeed, float, NONE) \
55         P(class, prefix, beam_tightness, float, NONE) \
56         P(class, prefix, burst_ammo, float, NONE) \
57         P(class, prefix, burst_damage, float, NONE) \
58         P(class, prefix, burst_healing_aps, float, NONE) \
59         P(class, prefix, burst_healing_hps, float, NONE) \
60         P(class, prefix, burst_heat, float, NONE) /* heat increase per second (secondary) */ \
61         P(class, prefix, cooldown, float, NONE) /* heat decrease per second when resting */ \
62         P(class, prefix, cooldown_release, float, NONE) /* delay weapon re-use when releasing button */ \
63         P(class, prefix, overheat_max, float, NONE) /* maximum heat before jamming */ \
64         P(class, prefix, overheat_min, float, NONE) /* minimum heat to wait for cooldown */ \
65         P(class, prefix, switchdelay_drop, float, NONE) \
66         P(class, prefix, switchdelay_raise, float, NONE) \
67         P(class, prefix, weaponreplace, string, NONE) \
68         P(class, prefix, weaponstartoverride, float, NONE) \
69         P(class, prefix, weaponstart, float, NONE) \
70         P(class, prefix, weaponthrowable, float, NONE) \
71     END()
72     W_PROPS(X, Arc, arc)
73 #undef X
74
75 ENDCLASS(Arc)
76 REGISTER_WEAPON(ARC, arc, NEW(Arc));
77
78 SPAWNFUNC_WEAPON(weapon_arc, WEP_ARC)
79
80 #ifdef GAMEQC
81 const float ARC_MAX_SEGMENTS = 20;
82 vector arc_shotorigin[4];
83 .vector beam_start;
84 .vector beam_dir;
85 .vector beam_wantdir;
86 .int beam_type;
87
88 const int ARC_BT_MISS =        0x00;
89 const int ARC_BT_WALL =        0x01;
90 const int ARC_BT_HEAL =        0x02;
91 const int ARC_BT_HIT =         0x03;
92 const int ARC_BT_BURST_MISS =  0x10;
93 const int ARC_BT_BURST_WALL =  0x11;
94 const int ARC_BT_BURST_HEAL =  0x12;
95 const int ARC_BT_BURST_HIT =   0x13;
96 const int ARC_BT_BURSTMASK =   0x10;
97
98 const int ARC_SF_SETTINGS =    BIT(0);
99 const int ARC_SF_START =       BIT(1);
100 const int ARC_SF_WANTDIR =     BIT(2);
101 const int ARC_SF_BEAMDIR =     BIT(3);
102 const int ARC_SF_BEAMTYPE =    BIT(4);
103 const int ARC_SF_LOCALMASK =   ARC_SF_START | ARC_SF_WANTDIR | ARC_SF_BEAMDIR;
104 #endif
105 #ifdef SVQC
106 .entity arc_beam;
107 .bool arc_BUTTON_ATCK_prev; // for better animation control
108 .float beam_prev;
109 .float beam_initialized;
110 .float beam_bursting;
111 .float beam_teleporttime;
112 .float beam_heat; // (beam) amount of heat produced
113 .float arc_overheat; // (dropped arc/player) time during which it's too hot
114 .float arc_cooldown; // (dropped arc/player) cooling speed
115 .float arc_heat_percent;
116 .float arc_smoke_sound;
117 #endif
118 #ifdef CSQC
119
120 .vector beam_color;
121 .float beam_alpha;
122 .float beam_thickness;
123 .entity beam_traileffect;
124 .entity beam_hiteffect;
125 .float beam_hitlight[4]; // 0: radius, 123: rgb
126 .entity beam_muzzleeffect;
127 .float beam_muzzlelight[4]; // 0: radius, 123: rgb
128 .string beam_image;
129
130 .entity beam_muzzleentity;
131
132 .float beam_degreespersegment;
133 .float beam_distancepersegment;
134 .float beam_usevieworigin;
135 .float beam_initialized;
136 .float beam_maxangle;
137 .float beam_range;
138 .float beam_returnspeed;
139 .float beam_tightness;
140 .vector beam_shotorigin;
141
142 entity Draw_ArcBeam_callback_entity;
143 float Draw_ArcBeam_callback_last_thickness;
144 vector Draw_ArcBeam_callback_last_top; // NOTE: in same coordinate system as player.
145 vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as player.
146 #endif