float WATERLEVEL_SWIMMING = 2;
float WATERLEVEL_SUBMERGED = 3;
-float MAX_SHOT_DISTANCE = 32768;
-
-// weapon requests
-float WR_SETUP = 1; // (SVQC) setup weapon data
-float WR_THINK = 2; // (SVQC) logic to run every frame
-float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
-float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
-float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
-float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
-float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
-float WR_KILLMESSAGE = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
-float WR_RELOAD = 9; // (SVQC) does not need to do anything
-float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
-float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
-float WR_SWITCHABLE = 12; // (CSQC) impact effect
-float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
-float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
-
#define SERVERFLAG_ALLOW_FULLBRIGHT 1
#define SERVERFLAG_TEAMPLAY 2
#define SERVERFLAG_PLAYERSTATS 4
WEP_ACTION(i, WR_CONFIG)
}
-
+ /*
#define WEP_BAL_WRITE(a) { \
fputs(fh, a); \
if(alsoprint) { print(a); } }
return;
#undef NOTIF_WRITE_HARDCODED
#undef NOTIF_WRITE_ENTITY
- #undef NOTIF_WRITE
+ #undef NOTIF_WRITE*/
}
// Balance Config Generator
// ==========================
-void Dump_Weapon_Settings(float fh, float alsoprint)
-{
- float i;
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- WEP_ACTION(i, WR_CONFIG)
- }
-
-
- #define WEP_BAL_WRITE(a) { \
- fputs(fh, a); \
- if(alsoprint) { print(a); } }
- #define WEP_BAL_WRITE_ENTITY(description) { \
- notif_msg = \
- sprintf( \
- "seta notification_%s \"%d\" \"%s\"\n", \
- e.nent_name, e.nent_default, description \
- ); \
- WEP_BAL_WRITE(notif_msg) }
- #define WEP_BAL_WRITE_HARDCODED(cvar,default,description) { \
- notif_msg = \
- sprintf( \
- "seta notification_%s \"%s\" \"%s\"\n", \
- cvar, default, description \
- ); \
- WEP_BAL_WRITE(notif_msg) }
-
- string notif_msg;
- float i;
- entity e;
-
- NOTIF_WRITE(sprintf("\n// MSG_ANNCE notifications (count = %d):\n", NOTIF_ANNCE_COUNT));
- for(i = 1; i <= NOTIF_ANNCE_COUNT; ++i)
- {
- e = Get_Notif_Ent(MSG_ANNCE, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
- NOTIF_WRITE_ENTITY(
- "Notification control cvar: 0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled)"
- );
- }
-
- NOTIF_WRITE(sprintf("\n// MSG_INFO notifications (count = %d):\n", NOTIF_INFO_COUNT));
- for(i = 1; i <= NOTIF_INFO_COUNT; ++i)
- {
- e = Get_Notif_Ent(MSG_INFO, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
- NOTIF_WRITE_ENTITY(
- "Notification control cvar: 0 = off, 1 = print to console, "
- "2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
- );
- }
-
- NOTIF_WRITE(sprintf("\n// MSG_CENTER notifications (count = %d):\n", NOTIF_CENTER_COUNT));
- for(i = 1; i <= NOTIF_CENTER_COUNT; ++i)
- {
- e = Get_Notif_Ent(MSG_CENTER, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
- NOTIF_WRITE_ENTITY(
- "Notification control cvar: 0 = off, 1 = centerprint"
- );
- }
-
- NOTIF_WRITE(sprintf("\n// MSG_MULTI notifications (count = %d):\n", NOTIF_MULTI_COUNT));
- for(i = 1; i <= NOTIF_MULTI_COUNT; ++i)
- {
- e = Get_Notif_Ent(MSG_MULTI, i);
- if not(e) { backtrace("Dump_Notifications(): Missing notification entity!\n"); return; }
-
- NOTIF_WRITE_ENTITY(
- "Notification control cvar: 0 = off, 1 = trigger subcalls"
- );
- }
-
- // edit these to match whichever cvars are used for specific notification options
- NOTIF_WRITE("\n// HARD CODED notification variables:\n");
-
- NOTIF_WRITE_HARDCODED(
- "allow_chatboxprint", "1",
- "Allow notifications to be printed to chat box by setting notification cvar to 2 "
- "(You can also set this cvar to 2 to force ALL notifications to be printed to the chatbox)"
- );
-
- NOTIF_WRITE(sprintf(
- strcat(
- "\n// Notification counts (total = %d): ",
- "MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d\n"
- ),
- (
- NOTIF_ANNCE_COUNT +
- NOTIF_INFO_COUNT +
- NOTIF_CENTER_COUNT +
- NOTIF_MULTI_COUNT
- ),
- NOTIF_ANNCE_COUNT,
- NOTIF_INFO_COUNT,
- NOTIF_CENTER_COUNT,
- NOTIF_MULTI_COUNT
- ));
+void Dump_Weapon_Settings(float fh, float alsoprint);
+float wep_config_file;
+float wep_config_alsoprint;
+
+#define WEP_CONFIG_WRITE(a) { \
+ fputs(wep_config_file, a); \
+ if(wep_config_alsoprint) { print(a); } }
+
+#define WEP_CONFIG_WRITE_CVARS(weapon,mode,name) \
+ #if mode == MO_PRI \
+ WEP_CONFIG_WRITE(sprintf("set g_balance_%s_primary_%s", #weapon, #name)) \
+ #endif \
+ #if mode == MO_SEC \
+ WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s", #weapon, #name)) \
+ #endif \
+ #if mode == MO_BOTH \
+ WEP_CONFIG_WRITE(sprintf("set g_balance_%s_primary_%s", #weapon, #name)) \
+ WEP_CONFIG_WRITE(sprintf("set g_balance_%s_secondary_%s", #weapon, #name)) \
+ #endif \
+ #if mode == MO_NONE \
+ WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s", #weapon, #name)) \
+ #endif
- return;
- #undef NOTIF_WRITE_HARDCODED
- #undef NOTIF_WRITE_ENTITY
- #undef NOTIF_WRITE
-}
+#define WEP_CONFIG_WRITE_PROPS(weapon,prop,name) \
+ { WEP_CONFIG_WRITE(sprintf("set g_balance_%s_%s", #weapon, #name)) }
{
if(autocvar_sv_precacheweapons)
{
- precache_model ("models/flash.md3");
- precache_model ("models/weapons/g_rl.md3");
- precache_model ("models/weapons/v_rl.md3");
- precache_model ("models/weapons/h_rl.iqm");
- precache_sound ("weapons/rocket_det.wav");
- precache_sound ("weapons/rocket_fire.wav");
- precache_sound ("weapons/rocket_mode.wav");
+ precache_model("models/flash.md3");
+ precache_model("models/weapons/g_rl.md3");
+ precache_model("models/weapons/v_rl.md3");
+ precache_model("models/weapons/h_rl.iqm");
+ precache_sound("weapons/rocket_det.wav");
+ precache_sound("weapons/rocket_fire.wav");
+ precache_sound("weapons/rocket_mode.wav");
}
#define WEP_ADD_CVAR(weapon,mode,name) /*nothing*/
#undef WEP_ADD_PROP
return TRUE;
- }/*
+ }
case WR_CONFIG:
{
-
- #define WEP_CONFIG_WRITE(a) { \
- fputs(wep_config_file, a); \
- if(wep_config_alsoprint) { print(a); } }
-
- #define WEP_CONFIG_WRITE_CVAR(cvarstring) \
- { WEP_CONFIG_WRITE(sprintf(cvarstring, weapon, #name)); }
-
- #define WEP_ADD_CVAR(weapon,mode,name) \
- #if mode == MO_PRI \
- WEP_CONFIG_WRITE_CVAR("set g_balance_%s_primary_%s") \
- #endif \
- #if mode == MO_SEC \
- WEP_CONFIG_WRITE_CVAR("set g_balance_%s_secondary_%s") \
- #endif \
- #if mode == MO_BOTH \
- WEP_CONFIG_WRITE_CVAR("set g_balance_%s_primary_%s") \
- WEP_CONFIG_WRITE_CVAR("set g_balance_%s_secondary_%s") \
- #endif \
- #if mode == MO_NONE \
- WEP_CONFIG_WRITE_CVAR("set g_balance_%s_%s") \
- #endif
-
- #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_CVAR("set g_balance_%s_%s")
+ #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name)
+ #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,mode,name)
ARC_SETTINGS(devastator)
#undef WEP_ADD_CVAR
#undef WEP_ADD_PROP
return TRUE;
- }*/
+ }
case WR_SETUP:
{
weapon_setup(WEP_DEVASTATOR);
float WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer
float WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag)
+float MAX_SHOT_DISTANCE = 32768;
+
+// weapon requests // WEAPONTODO
+float WR_SETUP = 1; // (SVQC) setup weapon data
+float WR_THINK = 2; // (SVQC) logic to run every frame
+float WR_CHECKAMMO1 = 3; // (SVQC) checks ammo for weapon
+float WR_CHECKAMMO2 = 4; // (SVQC) checks ammo for weapon
+float WR_AIM = 5; // (SVQC) runs bot aiming code for this weapon
+float WR_PRECACHE = 6; // (CSQC and SVQC) precaches models/sounds used by this weapon
+float WR_SUICIDEMESSAGE = 7; // (SVQC) notification number for suicide message (may inspect w_deathtype for details)
+float WR_KILLMESSAGE = 8; // (SVQC) notification number for kill message (may inspect w_deathtype for details)
+float WR_RELOAD = 9; // (SVQC) does not need to do anything
+float WR_RESETPLAYER = 10; // (SVQC) does not need to do anything
+float WR_IMPACTEFFECT = 11; // (CSQC) impact effect
+float WR_SWITCHABLE = 12; // (CSQC) impact effect
+float WR_PLAYERDEATH = 13; // (SVQC) does not need to do anything
+float WR_GONETHINK = 14; // (SVQC) logic to run every frame, also if no longer having the weapon as long as the switch away has not been performed
+float WR_CONFIG = 15;
+
+// WEAPONTODO
float IT_UNLIMITED_WEAPON_AMMO = 1;
// when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
float IT_UNLIMITED_SUPERWEAPONS = 2;
../common/test.qh
../common/counting.qh
weapons/cl_weapons.qh
+../common/weapons/config.qh
../common/weapons/weapons.qh // WEAPONTODO
../common/urllib.qh
../common/command/markup.qh