Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
all.qh File Reference
#include <common/command/_mod.qh>
#include "config.qh"
#include "turret.qh"
#include "turret/_mod.qh"
Include dependency graph for all.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  NullTurret

Macros

#define _TR_CONFIG(class, fld, T, turname)
#define DEFAULT_FILENAME   "turrets_dump.cfg"
#define get_turretinfo(i)
#define REGISTER_TURRET(id, inst)
#define TR_CONFIG(class, turname, fld, T)
#define TR_CONFIG_BEGIN(class)
#define TR_CONFIG_END()
#define TR_PROPS(L, class, prefix)
#define TR_PROPS_COMMON(P, class, prefix)
#define TUR_LAST   (REGISTRY_COUNT(Turrets) - 1)

Functions

 GENERIC_COMMAND (dumpturrets, "Dump all turrets into " DEFAULT_FILENAME, false)
 REGISTER_TURRET (Null, NEW(NullTurret))

Variables

const int TUR_FIRST = 1

Macro Definition Documentation

◆ _TR_CONFIG

#define _TR_CONFIG ( class,
fld,
T,
turname )
Value:
if (#turname == this.netname) TUR_CONFIG_WRITE_CVARS(turname, fld, T);
string netname
Definition powerups.qc:20
#define TUR_CONFIG_WRITE_CVARS(turname, name, T)
Definition config.qh:15

Definition at line 51 of file all.qh.

◆ DEFAULT_FILENAME

#define DEFAULT_FILENAME   "turrets_dump.cfg"

Definition at line 59 of file all.qh.

◆ get_turretinfo

#define get_turretinfo ( i)
Value:
REGISTRY_GET(Turrets, i)
#define REGISTRY_GET(id, i)
Definition registry.qh:43

Definition at line 9 of file all.qh.

Referenced by load_unit_settings(), turret_construct(), turret_die(), turret_draw2d(), turret_fire(), turret_respawn(), turret_think(), and turrets_manager_think().

◆ REGISTER_TURRET

#define REGISTER_TURRET ( id,
inst )
Value:
REGISTER(Turrets, TUR, id, m_id, inst)
int m_id
Definition effect.qh:19
#define REGISTER(...)
Register a new entity with a registry.
Definition registry.qh:87

Definition at line 119 of file all.qh.

Referenced by REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), REGISTER_TURRET(), and REGISTER_TURRET().

◆ TR_CONFIG

#define TR_CONFIG ( class,
turname,
fld,
T )
Value:
_TR_CONFIG(class, fld, T, turname)
#define _TR_CONFIG(class, fld, T, turname)
Definition all.qh:51

Definition at line 48 of file all.qh.

◆ TR_CONFIG_BEGIN

#define TR_CONFIG_BEGIN ( class)
Value:
METHOD(class, tr_config, void(class this)) {
#define METHOD(cname, name, prototype)
Definition oo.qh:269

Definition at line 50 of file all.qh.

◆ TR_CONFIG_END

#define TR_CONFIG_END ( )
Value:
}

Definition at line 52 of file all.qh.

◆ TR_PROPS

#define TR_PROPS ( L,
class,
prefix )
Value:
L(TR_CONFIG_BEGIN, TR_CONFIG, TR_CONFIG_END, class, prefix) \
#define TR_CONFIG_END()
Definition all.qh:52
#define TR_CONFIG(class, turname, fld, T)
Definition all.qh:48
#define TR_CONFIG_BEGIN(class)
Definition all.qh:50

Definition at line 44 of file all.qh.

44#define TR_PROPS(L, class, prefix) \
45 L(TR_CONFIG_BEGIN, TR_CONFIG, TR_CONFIG_END, class, prefix) \
46 /**/

◆ TR_PROPS_COMMON

#define TR_PROPS_COMMON ( P,
class,
prefix )
Value:
P(class, prefix, aim_firetolerance_dist, float) \
P(class, prefix, aim_maxpitch, float) \
P(class, prefix, aim_maxrot, float) \
P(class, prefix, aim_speed, float) \
P(class, prefix, ammo_max, float) \
P(class, prefix, ammo_recharge, float) \
P(class, prefix, health, float) \
P(class, prefix, respawntime, float) \
P(class, prefix, shot_dmg, float) \
P(class, prefix, shot_force, float) \
P(class, prefix, shot_radius, float) \
P(class, prefix, shot_refire, float) \
P(class, prefix, shot_speed, float) \
P(class, prefix, shot_spread, float) \
P(class, prefix, shot_volly, float) \
P(class, prefix, shot_volly_refire, float) \
P(class, prefix, target_range, float) \
P(class, prefix, target_range_min, float) \
P(class, prefix, target_range_optimal, float) \
P(class, prefix, target_select_anglebias, float) \
P(class, prefix, target_select_missilebias, float) \
P(class, prefix, target_select_playerbias, float) \
P(class, prefix, target_select_rangebias, float) \
P(class, prefix, target_select_samebias, float) \
P(class, prefix, track_accel_pitch, float) \
P(class, prefix, track_accel_rot, float) \
P(class, prefix, track_blendrate, float) \
P(class, prefix, track_type, float) \
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
float respawntime
Definition items.qh:30

Definition at line 13 of file all.qh.

13#define TR_PROPS_COMMON(P, class, prefix) \
14 P(class, prefix, aim_firetolerance_dist, float) \
15 P(class, prefix, aim_maxpitch, float) \
16 P(class, prefix, aim_maxrot, float) \
17 P(class, prefix, aim_speed, float) \
18 P(class, prefix, ammo_max, float) \
19 P(class, prefix, ammo_recharge, float) \
20 P(class, prefix, health, float) \
21 P(class, prefix, respawntime, float) \
22 P(class, prefix, shot_dmg, float) \
23 P(class, prefix, shot_force, float) \
24 P(class, prefix, shot_radius, float) \
25 P(class, prefix, shot_refire, float) \
26 P(class, prefix, shot_speed, float) \
27 P(class, prefix, shot_spread, float) \
28 P(class, prefix, shot_volly, float) \
29 P(class, prefix, shot_volly_refire, float) \
30 P(class, prefix, target_range, float) \
31 P(class, prefix, target_range_min, float) \
32 P(class, prefix, target_range_optimal, float) \
33 P(class, prefix, target_select_anglebias, float) \
34 P(class, prefix, target_select_missilebias, float) \
35 P(class, prefix, target_select_playerbias, float) \
36 P(class, prefix, target_select_rangebias, float) \
37 P(class, prefix, target_select_samebias, float) \
38 P(class, prefix, track_accel_pitch, float) \
39 P(class, prefix, track_accel_rot, float) \
40 P(class, prefix, track_blendrate, float) \
41 P(class, prefix, track_type, float) \
42 /**/

Referenced by load_unit_settings().

◆ TUR_LAST

#define TUR_LAST   (REGISTRY_COUNT(Turrets) - 1)

Definition at line 117 of file all.qh.

Function Documentation

◆ GENERIC_COMMAND()

GENERIC_COMMAND ( dumpturrets ,
"Dump all turrets into " DEFAULT_FILENAME,
false  )

Definition at line 61 of file all.qh.

62{
63 switch(request)
64 {
66 {
67 #ifdef SVQC
68 tur_config_file = -1;
70 string filename = argv(1);
71
72 if(filename == "")
73 {
74 filename = DEFAULT_FILENAME;
76 }
77 else if(filename == "-")
78 {
79 filename = DEFAULT_FILENAME;
81 }
82 tur_config_file = fopen(filename, FILE_WRITE);
83
84 if(tur_config_file >= 0)
85 {
87 LOG_INFOF("Dumping turrets... File located in ^2data/data/%s^7.", filename);
89 tur_config_file = -1;
91 }
92 else
93 {
94 LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
95 }
96 #else
97 LOG_INFO("Turrets dump command only works with sv_cmd.");
98 #endif
99 return;
100 }
101
102 default:
104 {
105 LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [<filename>]");
106 LOG_HELPF(" Where <filename> is the file to write (default is %s),", DEFAULT_FILENAME);
107 LOG_HELP(" if supplied with '-' output to console as well as default,");
108 LOG_HELP(" if left blank, it will only write to default.");
109 return;
110 }
111 }
112}
const int CMD_REQUEST_COMMAND
Definition command.qh:3
const int CMD_REQUEST_USAGE
Definition command.qh:4
const float FILE_WRITE
#define GetProgramCommandPrefix()
Definition generic.qh:25
#define LOG_HELP(...)
Definition log.qh:85
#define LOG_INFO(...)
Definition log.qh:65
#define LOG_HELPF(...)
Definition log.qh:86
#define LOG_INFOF(...)
Definition log.qh:66
void fclose(float fhandle)
float fopen(string filename, float mode)
string argv(float n)
#define DEFAULT_FILENAME
Definition all.qh:164
void Dump_Turret_Settings()
Definition config.qc:45
float tur_config_alsoprint
Definition config.qh:10
float tur_config_file
Definition config.qh:9

References argv(), CMD_REQUEST_COMMAND, CMD_REQUEST_USAGE, DEFAULT_FILENAME, Dump_Turret_Settings(), fclose(), FILE_WRITE, fopen(), GetProgramCommandPrefix, LOG_HELP, LOG_HELPF, LOG_INFO, LOG_INFOF, tur_config_alsoprint, and tur_config_file.

◆ REGISTER_TURRET()

REGISTER_TURRET ( Null ,
NEW(NullTurret)  )

Variable Documentation

◆ TUR_FIRST

const int TUR_FIRST = 1

Definition at line 116 of file all.qh.