]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/config.qh
#include this
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / config.qh
1 #ifndef WEAPONS_CONFIG_H
2 #define WEAPONS_CONFIG_H
3
4 #if defined(CSQC)
5 #elif defined(MENUQC)
6 #elif defined(SVQC)
7         #include "../util-pre.qh"
8     #include "../../server/sys-pre.qh"
9     #include "../../dpdefs/progsdefs.qc"
10     #include "../../dpdefs/dpextensions.qc"
11     #include "../../server/sys-post.qh"
12     #include "../../warpzonelib/anglestransform.qh"
13     #include "../../warpzonelib/mathlib.qh"
14     #include "../../warpzonelib/common.qh"
15     #include "../../warpzonelib/util_server.qh"
16     #include "../../warpzonelib/server.qh"
17     #include "../constants.qh"
18     #include "../stats.qh"
19     #include "../teams.qh"
20     #include "../util.qh"
21     #include "../nades.qh"
22     #include "../buffs.qh"
23     #include "../test.qh"
24     #include "../counting.qh"
25     #include "../urllib.qh"
26     #include "../command/markup.qh"
27     #include "../command/rpn.qh"
28     #include "../command/generic.qh"
29     #include "../command/shared_defs.qh"
30     #include "../net_notice.qh"
31     #include "../animdecide.qh"
32     #include "../monsters/monsters.qh"
33     #include "../monsters/sv_monsters.qh"
34     #include "../monsters/spawn.qh"
35 #endif
36
37 // ==========================
38 //  Balance Config Generator
39 // ==========================
40
41 void Dump_Weapon_Settings(void);
42 int wep_config_file;
43 bool wep_config_alsoprint;
44
45 const int MAX_WEP_CONFIG = 256;
46 int WEP_CONFIG_COUNT;
47 string wep_config_queue[MAX_WEP_CONFIG];
48
49 #define WEP_CONFIG_QUEUE(a) { \
50         wep_config_queue[WEP_CONFIG_COUNT] = a; \
51         ++WEP_CONFIG_COUNT; }
52
53 #define WEP_CONFIG_WRITETOFILE(a) do { \
54         fputs(wep_config_file, a); \
55         if(wep_config_alsoprint) { print(a); } \
56 } while(0)
57
58 #define WEP_CONFIG_WRITE_CVARS_NONE(wepname,name) \
59         { WEP_CONFIG_QUEUE( \
60                 sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \
61                 cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) }
62
63 #define WEP_CONFIG_WRITE_CVARS_PRI(wepname,name) WEP_CONFIG_WRITE_CVARS_NONE(wepname, primary_##name)
64 #define WEP_CONFIG_WRITE_CVARS_SEC(wepname,name) WEP_CONFIG_WRITE_CVARS_NONE(wepname, secondary_##name)
65 #define WEP_CONFIG_WRITE_CVARS_BOTH(wepname,name) \
66         WEP_CONFIG_WRITE_CVARS_PRI(wepname, name) \
67         WEP_CONFIG_WRITE_CVARS_SEC(wepname, name)
68         
69 #define WEP_CONFIG_WRITE_CVARS(wepid,wepname,mode,name) WEP_CONFIG_WRITE_CVARS_##mode(wepname, name)
70
71 #define WEP_CONFIG_WRITE_PROPS_string(wepname,name) \
72         { WEP_CONFIG_QUEUE( \
73                 sprintf("set g_balance_%s_%s \"%s\"\n", #wepname, #name, \
74                 cvar_string(sprintf("g_balance_%s_%s", #wepname, #name)))) }
75
76 #define WEP_CONFIG_WRITE_PROPS_float(wepname,name) \
77         { WEP_CONFIG_QUEUE( \
78                 sprintf("set g_balance_%s_%s %g\n", #wepname, #name, \
79                 cvar(sprintf("g_balance_%s_%s", #wepname, #name)))) }
80
81 #define WEP_CONFIG_WRITE_PROPS(wepid,wepname,type,prop,name) WEP_CONFIG_WRITE_PROPS_##type(wepname,name)
82 #endif