#ifndef CLIENT_ALL_H
#define CLIENT_ALL_H
+#include "../common/util.qh"
+
+#include "../common/effects/all.qh"
+#include "../common/models/all.qh"
+#include "../common/sounds/all.qh"
+
#include "autocvars.qh"
#include "defs.qh"
#include "main.qh"
#include "miscfunctions.qh"
-#include "../common/models/all.qh"
-#include "../common/sounds/all.qh"
-
#endif
#include "announcer.qh"
-#include "_all.qh"
#include "../common/notifications.qh"
#include "../common/stats.qh"
-#include "../common/util.qh"
bool announcer_1min;
bool announcer_5min;
-#ifndef ANNOUNCER_H
-#define ANNOUNCER_H
+#ifndef CLIENT_ANNOUNCER_H
+#define CLIENT_ANNOUNCER_H
void Announcer();
#include "bgmscript.qh"
-#include "_all.qh"
-
-#include "../common/util.qh"
#define CONSTANT_SPEED_DECAY
-#ifndef BGMSCRIPT_H
-#define BGMSCRIPT_H
+#ifndef CLIENT_BGMSCRIPT_H
+#define CLIENT_BGMSCRIPT_H
entityclass(BGMScript);
class(BGMScript) .string bgmscript;
+++ /dev/null
-#include "../_all.qh"
-
-#include "../../common/command/all.qc"
-
-#include "cl_cmd.qc"
+++ /dev/null
-#ifndef CLIENT_COMMANDS_ALL_H
-#define CLIENT_COMMANDS_ALL_H
-
-#include "../../common/command/all.qh"
-
-#include "cl_cmd.qh"
-
-#endif
+++ /dev/null
-// ==============================================
-// CSQC client commands code, written by Samual
-// Last updated: December 28th, 2011
-// ==============================================
-
-#include "../../common/command/command.qh"
-#include "cl_cmd.qh"
-
-#include "../autocvars.qh"
-#include "../defs.qh"
-#include "../hud.qh"
-#include "../hud_config.qh"
-#include "../main.qh"
-#include "../mapvoting.qh"
-#include "../miscfunctions.qh"
-
-#include "../mutators/events.qh"
-
-#include "../../common/mapinfo.qh"
-
-#include "../../common/command/generic.qh"
-
-void DrawDebugModel(entity this)
-{
- if(time - floor(time) > 0.5)
- {
- PolyDrawModel(self);
- self.drawmask = 0;
- }
- else
- {
- self.renderflags = 0;
- self.drawmask = MASK_NORMAL;
- }
-}
-
-
-// =======================
-// Command Sub-Functions
-// =======================
-
-void LocalCommand_blurtest(int request)
-{
- // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
- // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
-
- #ifdef BLURTEST
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- blurtest_time0 = time;
- blurtest_time1 = time + stof(argv(1));
- blurtest_radius = stof(argv(2));
- blurtest_power = stof(argv(3));
- LOG_INFO("Enabled blurtest\n");
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
- LOG_INFO(" No arguments required.\n");
- return;
- }
- }
- #else
- if(request)
- {
- LOG_INFO("Blurtest is not enabled on this client.\n");
- return;
- }
- #endif
-}
-
-void LocalCommand_boxparticles(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- if (argc == 9)
- {
- int effect = _particleeffectnum(argv(1));
- if (effect >= 0)
- {
- int index = stoi(argv(2));
- entity own;
- if(index <= 0)
- own = entitybyindex(-index);
- else
- own = findfloat(world, entnum, index);
- vector org_from = stov(argv(3));
- vector org_to = stov(argv(4));
- vector dir_from = stov(argv(5));
- vector dir_to = stov(argv(6));
- int countmultiplier = stoi(argv(7));
- int flags = stoi(argv(8));
- boxparticles(effect, own, org_from, org_to, dir_from, dir_to, countmultiplier, flags);
- return;
- }
- }
- }
-
- default:
- LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
- LOG_INFO(" 'effectname' is the name of a particle effect in effectinfo.txt\n");
- LOG_INFO(" 'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
- LOG_INFO(" 'org_from' is the starting origin of the box\n");
- LOG_INFO(" 'org_to' is the ending origin of the box\n");
- LOG_INFO(" 'dir_from' is the minimum velocity\n");
- LOG_INFO(" 'dir_to' is the maximum velocity\n");
- LOG_INFO(" 'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
- LOG_INFO(" 'flags' can contain:\n");
- LOG_INFO(" 1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
- LOG_INFO(" 2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
- LOG_INFO(" 4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
- LOG_INFO(" 128 to draw a trail, not a box\n");
- return;
- }
- }
-}
-
-void LocalCommand_create_scrshot_ent(int request)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
- int fh = fopen(filename, FILE_WRITE);
-
- if(fh >= 0)
- {
- fputs(fh, "{\n");
- fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
- fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin.x), " ", ftos(view_origin.y), " ", ftos(view_origin.z)), "\"\n"));
- fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
- fputs(fh, "}\n");
-
- LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
-
- fclose(fh);
- }
- else
- {
- LOG_INFO("^1Error: ^7Could not dump to file!\n");
- }
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
- LOG_INFO(" No arguments required.\n");
- return;
- }
- }
-}
-
-void LocalCommand_debugmodel(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- string modelname = argv(1);
- entity debugmodel_entity;
-
- debugmodel_entity = spawn();
- precache_model(modelname);
- _setmodel(debugmodel_entity, modelname);
- setorigin(debugmodel_entity, view_origin);
- debugmodel_entity.angles = view_angles;
- debugmodel_entity.draw = DrawDebugModel;
- debugmodel_entity.classname = "debugmodel";
-
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
- LOG_INFO(" Where 'model' is a string of the model name to use for the debug model.\n");
- return;
- }
- }
-}
-
-void LocalCommand_handlevote(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- int vote_selection;
- string vote_string;
-
- if(InterpretBoolean(argv(1)))
- {
- vote_selection = 2;
- vote_string = "yes";
- }
- else
- {
- vote_selection = 1;
- vote_string = "no";
- }
-
- if(vote_selection)
- {
- if(uid2name_dialog) // handled by "uid2name" option
- {
- vote_active = 0;
- vote_prev = 0;
- vote_change = -9999;
- localcmd(strcat("setreport cl_allow_uid2name ", ftos(vote_selection - 1), "\n"));
- uid2name_dialog = 0;
- }
- else { localcmd(strcat("cmd vote ", vote_string, "\n")); }
-
- return;
- }
- }
-
- default:
- LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
- LOG_INFO(" Where 'vote' is the selection for either the current poll or uid2name.\n");
- return;
- }
- }
-}
-
-void LocalCommand_hud(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- switch(argv(1))
- {
- case "configure":
- {
- cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
- return;
- }
-
- case "quickmenu":
- {
- if(QuickMenu_IsOpened())
- QuickMenu_Close();
- else
- QuickMenu_Open(argv(2), argv(3)); // mode, submenu
- return;
- }
-
- case "minigame":
- {
- if(HUD_MinigameMenu_IsOpened())
- HUD_MinigameMenu_Close();
- else
- HUD_MinigameMenu_Open();
- return;
- }
-
- case "save":
- {
- if(argv(2))
- {
- HUD_Panel_ExportCfg(argv(2));
- return;
- }
- else
- {
- break; // go to usage, we're missing the paramater needed here.
- }
- }
-
- case "scoreboard_columns_set":
- {
- Cmd_HUD_SetFields(argc);
- return;
- }
-
- case "scoreboard_columns_help":
- {
- Cmd_HUD_Help();
- return;
- }
-
- case "radar":
- {
- if(argv(2))
- HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)),0);
- else
- HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0);
- return;
- }
-
- case "clickradar":
- {
- HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1);
- return;
- }
- }
- }
-
- default:
- LOG_INFO("Incorrect parameters for ^2hud^7\n");
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
- LOG_INFO(" Where 'action' is the command to complete,\n");
- LOG_INFO(" 'configname' is the name to save to for \"save\" action,\n");
- LOG_INFO(" 'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
- LOG_INFO(" and 'layout' is how to organize the scoreboard columns for the set action.\n");
- LOG_INFO(" quickmenu [[default | file | \"\"] submenu]\n");
- LOG_INFO(" Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
- LOG_INFO(" Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
- LOG_INFO(" Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
- return;
- }
- }
-}
-
-void LocalCommand_localprint(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- if(argv(1))
- {
- centerprint_hud(argv(1));
- return;
- }
- }
-
- default:
- LOG_INFO("Incorrect parameters for ^2localprint^7\n");
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
- LOG_INFO(" 'message' is the centerprint message to send to yourself.\n");
- return;
- }
- }
-}
-
-void LocalCommand_mv_download(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- if(argv(1))
- {
- Cmd_MapVote_MapDownload(argc);
- return;
- }
- }
-
- default:
- LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
- LOG_INFO(" Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
- return;
- }
- }
-}
-
-void LocalCommand_find(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- entity client;
-
- for(client = world; (client = find(client, classname, argv(1))); )
- LOG_INFO(etos(client), "\n");
-
- return;
- }
-
- default:
- LOG_INFO("Incorrect parameters for ^2find^7\n");
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
- LOG_INFO(" Where 'classname' is the classname to search for.\n");
- return;
- }
- }
-}
-
-void LocalCommand_sendcvar(int request, int argc)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
- if(argv(1))
- {
- // W_FixWeaponOrder will trash argv, so save what we need.
- string thiscvar = strzone(argv(1));
- string s = cvar_string(thiscvar);
-
- if(thiscvar == "cl_weaponpriority")
- s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
- else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
- s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
-
- localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
- strunzone(thiscvar);
- return;
- }
- }
-
- default:
- LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
- case CMD_REQUEST_USAGE:
- {
- LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
- LOG_INFO(" Where 'cvar' is the cvar plus arguments to send to the server.\n");
- return;
- }
- }
-}
-
-/* use this when creating a new command, making sure to place it in alphabetical order... also,
-** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
-void LocalCommand_(int request)
-{
- switch(request)
- {
- case CMD_REQUEST_COMMAND:
- {
-
- return;
- }
-
- default:
- case CMD_REQUEST_USAGE:
- {
- print("\nUsage:^3 cl_cmd \n");
- print(" No arguments required.\n");
- return;
- }
- }
-}
-*/
-
-
-// ==================================
-// Macro system for client commands
-// ==================================
-
-// Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-#define CLIENT_COMMANDS(request,arguments) \
- CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
- CLIENT_COMMAND("boxparticles", LocalCommand_boxparticles(request, arguments), "Spawn particles manually") \
- CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
- CLIENT_COMMAND("debugmodel", LocalCommand_debugmodel(request, arguments), "Spawn a debug model manually") \
- CLIENT_COMMAND("handlevote", LocalCommand_handlevote(request, arguments), "System to handle selecting a vote or option") \
- CLIENT_COMMAND("hud", LocalCommand_hud(request, arguments), "Commands regarding/controlling the HUD system") \
- CLIENT_COMMAND("localprint", LocalCommand_localprint(request, arguments), "Create your own centerprint sent to yourself") \
- CLIENT_COMMAND("find", LocalCommand_find(request, arguments), "Search through entities for matching classname") \
- CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
- CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
- /* nothing */
-
-void LocalCommand_macro_help()
-{
- #define CLIENT_COMMAND(name,function,description) \
- { if(strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description, "\n"); } }
-
- CLIENT_COMMANDS(0, 0);
- #undef CLIENT_COMMAND
-
- return;
-}
-
-bool LocalCommand_macro_command(int argc)
-{
- #define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(0))) { function; return true; } }
-
- CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc);
- #undef CLIENT_COMMAND
-
- return false;
-}
-
-bool LocalCommand_macro_usage(int argc)
-{
- #define CLIENT_COMMAND(name,function,description) \
- { if(name == strtolower(argv(1))) { function; return true; } }
-
- CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc);
- #undef CLIENT_COMMAND
-
- return false;
-}
-
-void LocalCommand_macro_write_aliases(int fh)
-{
- #define CLIENT_COMMAND(name,function,description) \
- { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
-
- CLIENT_COMMANDS(0, 0);
- #undef CLIENT_COMMAND
-
- return;
-}
-
-
-// =========================================
-// Main Function Called By Engine (cl_cmd)
-// =========================================
-// If this function exists, client code handles gamecommand instead of the engine code.
-
-void GameCommand(string command)
-{
- int argc = tokenize_console(command);
-
- // Guide for working with argc arguments by example:
- // argc: 1 - 2 - 3 - 4
- // argv: 0 - 1 - 2 - 3
- // cmd vote - master - login - password
- string s = strtolower(argv(0));
- if (s == "help")
- {
- if(argc == 1)
- {
- LOG_INFO("\nClient console commands:\n");
- LocalCommand_macro_help();
-
- LOG_INFO("\nGeneric commands shared by all programs:\n");
- GenericCommand_macro_help();
-
- LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
- LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
-
- return;
- }
- else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
- {
- return;
- }
- else if(LocalCommand_macro_usage(argc)) // now try for normal commands too
- {
- return;
- }
- }
- // continue as usual and scan for normal commands
- if (GenericCommand(command)// handled by common/command/generic.qc
- || LocalCommand_macro_command(argc) // handled by one of the above LocalCommand_* functions
- || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
- ) return;
-
- // nothing above caught the command, must be invalid
- LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
-
- return;
-}
-
-
-// ===================================
-// Macro system for console commands
-// ===================================
-
-// These functions are here specifically to add special + - commands to the game, and are not really normal commands.
-// Please add client commands to the function above this, as this is only for special reasons.
-#define CONSOLE_COMMANDS_NORMAL() \
- CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
- CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
- CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = true; }) \
- CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = false; }) \
- /* nothing */
-
-#define CONSOLE_COMMANDS_MOVEMENT() \
- CONSOLE_COMMAND("+forward", { ++camera_direction.x; }) \
- CONSOLE_COMMAND("-forward", { --camera_direction.x; }) \
- CONSOLE_COMMAND("+back", { --camera_direction.x; }) \
- CONSOLE_COMMAND("-back", { ++camera_direction.x; }) \
- CONSOLE_COMMAND("+moveup", { ++camera_direction.z; }) \
- CONSOLE_COMMAND("-moveup", { --camera_direction.z; }) \
- CONSOLE_COMMAND("+movedown", { --camera_direction.z; }) \
- CONSOLE_COMMAND("-movedown", { ++camera_direction.z; }) \
- CONSOLE_COMMAND("+moveright", { --camera_direction.y; }) \
- CONSOLE_COMMAND("-moveright", { ++camera_direction.y; }) \
- CONSOLE_COMMAND("+moveleft", { ++camera_direction.y; }) \
- CONSOLE_COMMAND("-moveleft", { --camera_direction.y; }) \
- CONSOLE_COMMAND("+roll_right", { ++camera_roll; }) \
- CONSOLE_COMMAND("-roll_right", { --camera_roll; }) \
- CONSOLE_COMMAND("+roll_left", { --camera_roll; }) \
- CONSOLE_COMMAND("-roll_left", { ++camera_roll; }) \
- /* nothing */
-
-void ConsoleCommand_macro_init()
-{
- // first init normal commands
- #define CONSOLE_COMMAND(name,execution) \
- { registercommand(name); }
-
- CONSOLE_COMMANDS_NORMAL();
- #undef CONSOLE_COMMAND
-
- // then init movement commands
- #ifndef CAMERATEST
- if(isdemo())
- {
- #endif
- #define CONSOLE_COMMAND(name,execution) \
- { registercommand(name); }
-
- CONSOLE_COMMANDS_MOVEMENT();
- #undef CONSOLE_COMMAND
- #ifndef CAMERATEST
- }
- #endif
-}
-
-bool ConsoleCommand_macro_normal(string s, int argc)
-{
- #define CONSOLE_COMMAND(name,execution) \
- { if (name == s) { { execution } return true; } }
-
- CONSOLE_COMMANDS_NORMAL();
- #undef CONSOLE_COMMAND
-
- return false;
-}
-
-bool ConsoleCommand_macro_movement(string s, int argc)
-{
- if(camera_active)
- {
- #define CONSOLE_COMMAND(name,execution) \
- { if (name == s) { { execution } return true; } }
-
- CONSOLE_COMMANDS_MOVEMENT();
- #undef CONSOLE_COMMAND
- }
-
- return false;
-}
-
-
-// ======================================================
-// Main Function Called By Engine (registered commands)
-// ======================================================
-// Used to parse commands in the console that have been registered with the "registercommand" function
-
-bool CSQC_ConsoleCommand(string command)
-{
- int argc = tokenize_console(command);
- string s = strtolower(argv(0));
- // Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
- return (ConsoleCommand_macro_normal(s, argc)
- || ConsoleCommand_macro_movement(s, argc)
- );
-}
+++ /dev/null
-#ifndef CL_CMD_H
-#define CL_CMD_H
-// ==============================================
-// CSQC client commands code, written by Samual
-// Last updated: December 17th, 2011
-// ==============================================
-
-void Cmd_HUD_SetFields(int);
-void Cmd_HUD_Help();
-
-// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
-void LocalCommand_macro_write_aliases(int fh);
-#endif
--- /dev/null
+#include "../_all.qh"
+
+#include "../../common/command/all.qc"
+
+#include "cl_cmd.qc"
--- /dev/null
+#ifndef CLIENT_COMMANDS_ALL_H
+#define CLIENT_COMMANDS_ALL_H
+
+#include "../../common/commands/all.qh"
+
+#include "cl_cmd.qh"
+
+#endif
--- /dev/null
+// ==============================================
+// CSQC client commands code, written by Samual
+// Last updated: December 28th, 2011
+// ==============================================
+
+#include "../../common/command/command.qh"
+#include "cl_cmd.qh"
+
+#include "../autocvars.qh"
+#include "../defs.qh"
+#include "../hud.qh"
+#include "../hud_config.qh"
+#include "../main.qh"
+#include "../mapvoting.qh"
+#include "../miscfunctions.qh"
+
+#include "../mutators/events.qh"
+
+#include "../../common/mapinfo.qh"
+
+#include "../../common/command/generic.qh"
+
+void DrawDebugModel(entity this)
+{
+ if(time - floor(time) > 0.5)
+ {
+ PolyDrawModel(self);
+ self.drawmask = 0;
+ }
+ else
+ {
+ self.renderflags = 0;
+ self.drawmask = MASK_NORMAL;
+ }
+}
+
+
+// =======================
+// Command Sub-Functions
+// =======================
+
+void LocalCommand_blurtest(int request)
+{
+ // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
+ // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
+
+ #ifdef BLURTEST
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ blurtest_time0 = time;
+ blurtest_time1 = time + stof(argv(1));
+ blurtest_radius = stof(argv(2));
+ blurtest_power = stof(argv(3));
+ LOG_INFO("Enabled blurtest\n");
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
+ LOG_INFO(" No arguments required.\n");
+ return;
+ }
+ }
+ #else
+ if(request)
+ {
+ LOG_INFO("Blurtest is not enabled on this client.\n");
+ return;
+ }
+ #endif
+}
+
+void LocalCommand_boxparticles(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if (argc == 9)
+ {
+ int effect = _particleeffectnum(argv(1));
+ if (effect >= 0)
+ {
+ int index = stoi(argv(2));
+ entity own;
+ if(index <= 0)
+ own = entitybyindex(-index);
+ else
+ own = findfloat(world, entnum, index);
+ vector org_from = stov(argv(3));
+ vector org_to = stov(argv(4));
+ vector dir_from = stov(argv(5));
+ vector dir_to = stov(argv(6));
+ int countmultiplier = stoi(argv(7));
+ int flags = stoi(argv(8));
+ boxparticles(effect, own, org_from, org_to, dir_from, dir_to, countmultiplier, flags);
+ return;
+ }
+ }
+ }
+
+ default:
+ LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
+ LOG_INFO(" 'effectname' is the name of a particle effect in effectinfo.txt\n");
+ LOG_INFO(" 'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
+ LOG_INFO(" 'org_from' is the starting origin of the box\n");
+ LOG_INFO(" 'org_to' is the ending origin of the box\n");
+ LOG_INFO(" 'dir_from' is the minimum velocity\n");
+ LOG_INFO(" 'dir_to' is the maximum velocity\n");
+ LOG_INFO(" 'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
+ LOG_INFO(" 'flags' can contain:\n");
+ LOG_INFO(" 1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
+ LOG_INFO(" 2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
+ LOG_INFO(" 4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
+ LOG_INFO(" 128 to draw a trail, not a box\n");
+ return;
+ }
+ }
+}
+
+void LocalCommand_create_scrshot_ent(int request)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ string filename = strcat(MapInfo_Map_bspname, "_scrshot_ent.txt");
+ int fh = fopen(filename, FILE_WRITE);
+
+ if(fh >= 0)
+ {
+ fputs(fh, "{\n");
+ fputs(fh, strcat("\"classname\" \"info_autoscreenshot\"\n"));
+ fputs(fh, strcat("\"origin\" \"", strcat(ftos(view_origin.x), " ", ftos(view_origin.y), " ", ftos(view_origin.z)), "\"\n"));
+ fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
+ fputs(fh, "}\n");
+
+ LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+
+ fclose(fh);
+ }
+ else
+ {
+ LOG_INFO("^1Error: ^7Could not dump to file!\n");
+ }
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
+ LOG_INFO(" No arguments required.\n");
+ return;
+ }
+ }
+}
+
+void LocalCommand_debugmodel(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ string modelname = argv(1);
+ entity debugmodel_entity;
+
+ debugmodel_entity = spawn();
+ precache_model(modelname);
+ _setmodel(debugmodel_entity, modelname);
+ setorigin(debugmodel_entity, view_origin);
+ debugmodel_entity.angles = view_angles;
+ debugmodel_entity.draw = DrawDebugModel;
+ debugmodel_entity.classname = "debugmodel";
+
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
+ LOG_INFO(" Where 'model' is a string of the model name to use for the debug model.\n");
+ return;
+ }
+ }
+}
+
+void LocalCommand_handlevote(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ int vote_selection;
+ string vote_string;
+
+ if(InterpretBoolean(argv(1)))
+ {
+ vote_selection = 2;
+ vote_string = "yes";
+ }
+ else
+ {
+ vote_selection = 1;
+ vote_string = "no";
+ }
+
+ if(vote_selection)
+ {
+ if(uid2name_dialog) // handled by "uid2name" option
+ {
+ vote_active = 0;
+ vote_prev = 0;
+ vote_change = -9999;
+ localcmd(strcat("setreport cl_allow_uid2name ", ftos(vote_selection - 1), "\n"));
+ uid2name_dialog = 0;
+ }
+ else { localcmd(strcat("cmd vote ", vote_string, "\n")); }
+
+ return;
+ }
+ }
+
+ default:
+ LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
+ LOG_INFO(" Where 'vote' is the selection for either the current poll or uid2name.\n");
+ return;
+ }
+ }
+}
+
+bool QuickMenu_IsOpened();
+void QuickMenu_Close();
+bool QuickMenu_Open(string mode, string submenu);
+
+bool HUD_MinigameMenu_IsOpened();
+void HUD_MinigameMenu_Close();
+void HUD_MinigameMenu_Open();
+
+void HUD_Radar_Show_Maximized(bool doshow, bool clickable);
+
+void LocalCommand_hud(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ switch(argv(1))
+ {
+ case "configure":
+ {
+ cvar_set("_hud_configure", ftos(!autocvar__hud_configure));
+ return;
+ }
+
+ case "quickmenu":
+ {
+ if(QuickMenu_IsOpened())
+ QuickMenu_Close();
+ else
+ QuickMenu_Open(argv(2), argv(3)); // mode, submenu
+ return;
+ }
+
+ case "minigame":
+ {
+ if(HUD_MinigameMenu_IsOpened())
+ HUD_MinigameMenu_Close();
+ else
+ HUD_MinigameMenu_Open();
+ return;
+ }
+
+ case "save":
+ {
+ if(argv(2))
+ {
+ HUD_Panel_ExportCfg(argv(2));
+ return;
+ }
+ else
+ {
+ break; // go to usage, we're missing the paramater needed here.
+ }
+ }
+
+ case "scoreboard_columns_set":
+ {
+ Cmd_HUD_SetFields(argc);
+ return;
+ }
+
+ case "scoreboard_columns_help":
+ {
+ Cmd_HUD_Help();
+ return;
+ }
+
+ case "radar":
+ {
+ if(argv(2))
+ HUD_Radar_Show_Maximized(InterpretBoolean(argv(2)),0);
+ else
+ HUD_Radar_Show_Maximized(!hud_panel_radar_maximized,0);
+ return;
+ }
+
+ case "clickradar":
+ {
+ HUD_Radar_Show_Maximized(!hud_panel_radar_mouse,1);
+ return;
+ }
+ }
+ }
+
+ default:
+ LOG_INFO("Incorrect parameters for ^2hud^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
+ LOG_INFO(" Where 'action' is the command to complete,\n");
+ LOG_INFO(" 'configname' is the name to save to for \"save\" action,\n");
+ LOG_INFO(" 'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
+ LOG_INFO(" and 'layout' is how to organize the scoreboard columns for the set action.\n");
+ LOG_INFO(" quickmenu [[default | file | \"\"] submenu]\n");
+ LOG_INFO(" Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
+ LOG_INFO(" Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
+ LOG_INFO(" Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+ return;
+ }
+ }
+}
+
+void LocalCommand_localprint(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if(argv(1))
+ {
+ centerprint_hud(argv(1));
+ return;
+ }
+ }
+
+ default:
+ LOG_INFO("Incorrect parameters for ^2localprint^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
+ LOG_INFO(" 'message' is the centerprint message to send to yourself.\n");
+ return;
+ }
+ }
+}
+
+void LocalCommand_mv_download(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if(argv(1))
+ {
+ Cmd_MapVote_MapDownload(argc);
+ return;
+ }
+ }
+
+ default:
+ LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
+ LOG_INFO(" Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
+ return;
+ }
+ }
+}
+
+void LocalCommand_find(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ entity client;
+
+ for(client = world; (client = find(client, classname, argv(1))); )
+ LOG_INFO(etos(client), "\n");
+
+ return;
+ }
+
+ default:
+ LOG_INFO("Incorrect parameters for ^2find^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
+ LOG_INFO(" Where 'classname' is the classname to search for.\n");
+ return;
+ }
+ }
+}
+
+void LocalCommand_sendcvar(int request, int argc)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ if(argv(1))
+ {
+ // W_FixWeaponOrder will trash argv, so save what we need.
+ string thiscvar = strzone(argv(1));
+ string s = cvar_string(thiscvar);
+
+ if(thiscvar == "cl_weaponpriority")
+ s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 1);
+ else if(substring(thiscvar, 0, 17) == "cl_weaponpriority" && strlen(thiscvar) == 18)
+ s = W_FixWeaponOrder(W_NumberWeaponOrder(s), 0);
+
+ localcmd("cmd sentcvar ", thiscvar, " \"", s, "\"\n");
+ strunzone(thiscvar);
+ return;
+ }
+ }
+
+ default:
+ LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
+ case CMD_REQUEST_USAGE:
+ {
+ LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
+ LOG_INFO(" Where 'cvar' is the cvar plus arguments to send to the server.\n");
+ return;
+ }
+ }
+}
+
+/* use this when creating a new command, making sure to place it in alphabetical order... also,
+** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION!
+void LocalCommand_(int request)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print("\nUsage:^3 cl_cmd \n");
+ print(" No arguments required.\n");
+ return;
+ }
+ }
+}
+*/
+
+
+// ==================================
+// Macro system for client commands
+// ==================================
+
+// Normally do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
+#define CLIENT_COMMANDS(request,arguments) \
+ CLIENT_COMMAND("blurtest", LocalCommand_blurtest(request), "Feature for testing blur postprocessing") \
+ CLIENT_COMMAND("boxparticles", LocalCommand_boxparticles(request, arguments), "Spawn particles manually") \
+ CLIENT_COMMAND("create_scrshot_ent", LocalCommand_create_scrshot_ent(request), "Create an entity at this location for automatic screenshots") \
+ CLIENT_COMMAND("debugmodel", LocalCommand_debugmodel(request, arguments), "Spawn a debug model manually") \
+ CLIENT_COMMAND("handlevote", LocalCommand_handlevote(request, arguments), "System to handle selecting a vote or option") \
+ CLIENT_COMMAND("hud", LocalCommand_hud(request, arguments), "Commands regarding/controlling the HUD system") \
+ CLIENT_COMMAND("localprint", LocalCommand_localprint(request, arguments), "Create your own centerprint sent to yourself") \
+ CLIENT_COMMAND("find", LocalCommand_find(request, arguments), "Search through entities for matching classname") \
+ CLIENT_COMMAND("mv_download", LocalCommand_mv_download(request, arguments), "Retrieve mapshot picture from the server") \
+ CLIENT_COMMAND("sendcvar", LocalCommand_sendcvar(request, arguments), "Send a cvar to the server (like weaponpriority)") \
+ /* nothing */
+
+void LocalCommand_macro_help()
+{
+ #define CLIENT_COMMAND(name,function,description) \
+ { if(strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description, "\n"); } }
+
+ CLIENT_COMMANDS(0, 0);
+ #undef CLIENT_COMMAND
+
+ return;
+}
+
+bool LocalCommand_macro_command(int argc)
+{
+ #define CLIENT_COMMAND(name,function,description) \
+ { if(name == strtolower(argv(0))) { function; return true; } }
+
+ CLIENT_COMMANDS(CMD_REQUEST_COMMAND, argc);
+ #undef CLIENT_COMMAND
+
+ return false;
+}
+
+bool LocalCommand_macro_usage(int argc)
+{
+ #define CLIENT_COMMAND(name,function,description) \
+ { if(name == strtolower(argv(1))) { function; return true; } }
+
+ CLIENT_COMMANDS(CMD_REQUEST_USAGE, argc);
+ #undef CLIENT_COMMAND
+
+ return false;
+}
+
+void LocalCommand_macro_write_aliases(int fh)
+{
+ #define CLIENT_COMMAND(name,function,description) \
+ { if(strtolower(description) != "") { CMD_Write_Alias("qc_cmd_cl", name, description); } }
+
+ CLIENT_COMMANDS(0, 0);
+ #undef CLIENT_COMMAND
+
+ return;
+}
+
+
+// =========================================
+// Main Function Called By Engine (cl_cmd)
+// =========================================
+// If this function exists, client code handles gamecommand instead of the engine code.
+
+void GameCommand(string command)
+{
+ int argc = tokenize_console(command);
+
+ // Guide for working with argc arguments by example:
+ // argc: 1 - 2 - 3 - 4
+ // argv: 0 - 1 - 2 - 3
+ // cmd vote - master - login - password
+ string s = strtolower(argv(0));
+ if (s == "help")
+ {
+ if(argc == 1)
+ {
+ LOG_INFO("\nClient console commands:\n");
+ LocalCommand_macro_help();
+
+ LOG_INFO("\nGeneric commands shared by all programs:\n");
+ GenericCommand_macro_help();
+
+ LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
+ LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
+
+ return;
+ }
+ else if(GenericCommand_macro_usage(argc)) // Instead of trying to call a command, we're going to see detailed information about it
+ {
+ return;
+ }
+ else if(LocalCommand_macro_usage(argc)) // now try for normal commands too
+ {
+ return;
+ }
+ }
+ // continue as usual and scan for normal commands
+ if (GenericCommand(command)// handled by common/command/generic.qc
+ || LocalCommand_macro_command(argc) // handled by one of the above LocalCommand_* functions
+ || MUTATOR_CALLHOOK(CSQC_ConsoleCommand, s, argc, command) // handled by a mutator
+ ) return;
+
+ // nothing above caught the command, must be invalid
+ LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
+
+ return;
+}
+
+
+// ===================================
+// Macro system for console commands
+// ===================================
+
+// These functions are here specifically to add special + - commands to the game, and are not really normal commands.
+// Please add client commands to the function above this, as this is only for special reasons.
+#define CONSOLE_COMMANDS_NORMAL() \
+ CONSOLE_COMMAND("+showscores", { scoreboard_showscores = true; }) \
+ CONSOLE_COMMAND("-showscores", { scoreboard_showscores = false; }) \
+ CONSOLE_COMMAND("+showaccuracy", { scoreboard_showaccuracy = true; }) \
+ CONSOLE_COMMAND("-showaccuracy", { scoreboard_showaccuracy = false; }) \
+ /* nothing */
+
+#define CONSOLE_COMMANDS_MOVEMENT() \
+ CONSOLE_COMMAND("+forward", { ++camera_direction.x; }) \
+ CONSOLE_COMMAND("-forward", { --camera_direction.x; }) \
+ CONSOLE_COMMAND("+back", { --camera_direction.x; }) \
+ CONSOLE_COMMAND("-back", { ++camera_direction.x; }) \
+ CONSOLE_COMMAND("+moveup", { ++camera_direction.z; }) \
+ CONSOLE_COMMAND("-moveup", { --camera_direction.z; }) \
+ CONSOLE_COMMAND("+movedown", { --camera_direction.z; }) \
+ CONSOLE_COMMAND("-movedown", { ++camera_direction.z; }) \
+ CONSOLE_COMMAND("+moveright", { --camera_direction.y; }) \
+ CONSOLE_COMMAND("-moveright", { ++camera_direction.y; }) \
+ CONSOLE_COMMAND("+moveleft", { ++camera_direction.y; }) \
+ CONSOLE_COMMAND("-moveleft", { --camera_direction.y; }) \
+ CONSOLE_COMMAND("+roll_right", { ++camera_roll; }) \
+ CONSOLE_COMMAND("-roll_right", { --camera_roll; }) \
+ CONSOLE_COMMAND("+roll_left", { --camera_roll; }) \
+ CONSOLE_COMMAND("-roll_left", { ++camera_roll; }) \
+ /* nothing */
+
+void ConsoleCommand_macro_init()
+{
+ // first init normal commands
+ #define CONSOLE_COMMAND(name,execution) \
+ { registercommand(name); }
+
+ CONSOLE_COMMANDS_NORMAL();
+ #undef CONSOLE_COMMAND
+
+ // then init movement commands
+ #ifndef CAMERATEST
+ if(isdemo())
+ {
+ #endif
+ #define CONSOLE_COMMAND(name,execution) \
+ { registercommand(name); }
+
+ CONSOLE_COMMANDS_MOVEMENT();
+ #undef CONSOLE_COMMAND
+ #ifndef CAMERATEST
+ }
+ #endif
+}
+
+bool ConsoleCommand_macro_normal(string s, int argc)
+{
+ #define CONSOLE_COMMAND(name,execution) \
+ { if (name == s) { { execution } return true; } }
+
+ CONSOLE_COMMANDS_NORMAL();
+ #undef CONSOLE_COMMAND
+
+ return false;
+}
+
+bool ConsoleCommand_macro_movement(string s, int argc)
+{
+ if(camera_active)
+ {
+ #define CONSOLE_COMMAND(name,execution) \
+ { if (name == s) { { execution } return true; } }
+
+ CONSOLE_COMMANDS_MOVEMENT();
+ #undef CONSOLE_COMMAND
+ }
+
+ return false;
+}
+
+
+// ======================================================
+// Main Function Called By Engine (registered commands)
+// ======================================================
+// Used to parse commands in the console that have been registered with the "registercommand" function
+
+bool CSQC_ConsoleCommand(string command)
+{
+ int argc = tokenize_console(command);
+ string s = strtolower(argv(0));
+ // Return value should be true if CSQC handled the command, otherwise return false to have the engine handle it.
+ return (ConsoleCommand_macro_normal(s, argc)
+ || ConsoleCommand_macro_movement(s, argc)
+ );
+}
--- /dev/null
+#ifndef CLIENT_COMMANDS_CL_CMD_H
+#define CLIENT_COMMANDS_CL_CMD_H
+// ==============================================
+// CSQC client commands code, written by Samual
+// Last updated: December 17th, 2011
+// ==============================================
+
+void Cmd_HUD_SetFields(int);
+void Cmd_HUD_Help();
+
+// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
+void LocalCommand_macro_write_aliases(int fh);
+#endif
#include "controlpoint.qh"
-#include "gibs.qh"
+
#include "teamradar.qh"
#include "../common/movetypes/movetypes.qh"
+.vector colormod;
.float alpha;
.int count;
.float pain_finished;
-#ifndef CONTROLPOINT_H
-#define CONTROLPOINT_H
+#ifndef CLIENT_CONTROLPOINT_H
+#define CLIENT_CONTROLPOINT_H
const vector CPICON_MIN = '-32 -32 -9';
const vector CPICON_MAX = '32 32 25';
-#ifndef CSQC_CONSTANTS
-#define CSQC_CONSTANTS
+#ifndef CLIENT_CSQC_CONSTANTS
+#define CLIENT_CSQC_CONSTANTS
// MenuQC redefines world, change define it here to be safe
#define world world
-#include "_all.qh"
-
-#include "gibs.qh"
+#include "mutators/events.qh"
#include "player_skeleton.qh"
-
#include "weapons/projectile.qh"
-
#include "../common/animdecide.qh"
-#include "../common/csqcmodel_settings.qh"
-#include "../common/effects/effects.qh"
-#include "../common/teams.qh"
-#include "../common/triggers/trigger/viewloc.qh"
+#include "../common/movetypes/movetypes.qh"
#include "../common/viewloc.qh"
-
-#include "mutators/events.qh"
-
#include "../csqcmodellib/cl_model.qh"
#include "../csqcmodellib/cl_player.qh"
#include "../csqcmodellib/interpolate.qh"
-
.float death_time;
.int modelflags;
#include "damage.qh"
-#include "_all.qh"
#include "gibs.qh"
-
-#include "../common/vehicles/all.qh"
-
-#include "../common/constants.qh"
#include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
#include "../common/movetypes/movetypes.qh"
-#include "../common/util.qh"
-
+#include "../common/vehicles/all.qh"
#include "../common/weapons/all.qh"
.entity tag_entity;
-#ifndef DAMAGE_H
-#define DAMAGE_H
+#ifndef CLIENT_DAMAGE_H
+#define CLIENT_DAMAGE_H
.float total_damages; // number of effects which currently are attached to a player
#include "effects.qh"
-#include "_all.qh"
/*
.vector fx_start;
-#ifndef EFFECTS_H
-#define EFFECTS_H
+#ifndef CLIENT_EFFECTS_H
+#define CLIENT_EFFECTS_H
void Net_ReadArc();
#include "generator.qh"
+#include "teamradar.qh"
+#include "../common/movetypes/movetypes.qh"
+
+.float alpha;
+.float scale;
.int count;
.float max_health;
-#ifndef GENERATOR_H
-#define GENERATOR_H
+#ifndef CLIENT_GENERATOR_H
+#define CLIENT_GENERATOR_H
const vector GENERATOR_MIN = '-52 -52 -14';
const vector GENERATOR_MAX = '52 52 75';
#include "gibs.qh"
-#include "_all.qh"
#include "rubble.qh"
-
-#include "../common/constants.qh"
#include "../common/movetypes/movetypes.qh"
-#include "../common/util.qh"
.float scale;
.float alpha;
-#ifndef GIBS_H
-#define GIBS_H
+#ifndef CLIENT_GIBS_H
+#define CLIENT_GIBS_H
.vector colormod;
#include "hook.qh"
-#include "_all.qh"
-
-#include "hud.qh"
-
-#include "../common/teams.qh"
#include "../csqcmodellib/interpolate.qh"
-
#include "../warpzonelib/common.qh"
entityclass(Hook);
-#ifndef HOOK_H
-#define HOOK_H
+#ifndef CLIENT_HOOK_H
+#define CLIENT_HOOK_H
void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
#include "hud.qh"
-#include "_all.qh"
#include "hud_config.qh"
#include "mapvoting.qh"
#include "scoreboard.qh"
#include "teamradar.qh"
#include "t_items.qh"
-
#include "../common/buffs/all.qh"
-#include "../common/constants.qh"
#include "../common/deathtypes.qh"
#include "../common/items/all.qc"
#include "../common/mapinfo.qh"
-#include "../common/nades/all.qh"
-
#include "../common/mutators/mutator/waypoints/all.qh"
-#include "../server/mutators/gamemode_ctf.qh"
-
+#include "../common/nades/all.qh"
#include "../common/stats.qh"
-
#include "../csqcmodellib/cl_player.qh"
+#include "../server/mutators/gamemode_ctf.qh"
/*
==================
*/
-// draw the background/borders
-#define HUD_Panel_DrawBg(theAlpha) do { \
- if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
- draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel.current_panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
-} while(0)
-
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
{
-#ifndef HUD_H
-#define HUD_H
+#ifndef CLIENT_HUD_H
+#define CLIENT_HUD_H
#include "../common/weapons/all.qh"
+bool HUD_Radar_Clickable();
+void HUD_Radar_Mouse();
+
REGISTRY(hud_panels, 24)
REGISTER_REGISTRY(Registerhud_panels)
#define HUD_PANEL(NAME) HUD_PANEL_##NAME
+// draw the background/borders
+#define HUD_Panel_DrawBg(theAlpha) do { \
+ if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
+ draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel.current_panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * theAlpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
+} while(0)
+
int panel_order[hud_panels_MAX];
string hud_panelorder_prev;
bool chat_panel_modified;
bool radar_panel_modified;
+float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary);
void HUD_Radar_Hide_Maximized();
void HUD_Reset (void);
#include "hud_config.qh"
-#include "_all.qh"
#include "hud.qh"
-#include "../common/constants.qh"
-
-
#define HUD_Write(s) fputs(fh, s)
// q: quoted, n: not quoted
#define HUD_Write_Cvar_n(cvar) HUD_Write(strcat("seta ", cvar, " ", cvar_string(cvar), "\n"))
-#ifndef HUD_CONFIG_H
-#define HUD_CONFIG_H
+#ifndef CLIENT_HUD_CONFIG_H
+#define CLIENT_HUD_CONFIG_H
const int S_MOUSE1 = 1;
const int S_MOUSE2 = 2;
#include "laser.qh"
-#include "_all.qh"
-#include "hook.qh"
-
-#include "../common/buffs/all.qh"
-
-#include "../csqcmodellib/cl_model.qh"
#include "../csqcmodellib/interpolate.qh"
// a laser goes from origin in direction angles
-#ifndef LASER_H
-#define LASER_H
+#ifndef CLIENT_LASER_H
+#define CLIENT_LASER_H
void Ent_Laser();
#include "main.qh"
-#include "_all.qh"
#include "controlpoint.qh"
#include "damage.qh"
#include "laser.qh"
#include "mapvoting.qh"
#include "modeleffects.qh"
+#include "mutators/events.qh"
#include "particles.qh"
+#include "quickmenu.qh"
#include "scoreboard.qh"
#include "shownames.qh"
#include "tuba.qh"
#include "t_items.qh"
#include "wall.qh"
-
-#include "../common/vehicles/all.qh"
-
-#include "mutators/events.qh"
-
#include "weapons/projectile.qh"
-
-#include "../common/buffs/all.qh"
#include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
+#include "../common/items/all.qh"
#include "../common/mapinfo.qh"
-#include "../common/monsters/all.qh"
-#include "../common/nades/all.qh"
+#include "../common/minigames/cl_minigames.qh"
+#include "../common/minigames/cl_minigames_hud.qh"
#include "../common/net_notice.qh"
-#include "../common/notifications.qh"
-#include "../common/stats.qh"
-#include "../common/teams.qh"
-
-#include "../common/items/all.qh"
-
-#include "../common/mutators/base.qh"
-
-#include "../common/weapons/all.qh"
-
-#include "../csqcmodellib/cl_model.qh"
-#include "../csqcmodellib/interpolate.qh"
-
#include "../common/triggers/include.qh"
-
#include "../common/turrets/cl_turrets.qh"
-
+#include "../common/vehicles/all.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
#include "../warpzonelib/client.qh"
// --------------------------------------------------------------------------
// needs to be done so early because of the constants they create
static_init();
- CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
// precaches
-#ifndef MAIN_H
-#define MAIN_H
+#ifndef CLIENT_MAIN_H
+#define CLIENT_MAIN_H
#include "../common/constants.qh"
#include "mapvoting.qh"
-#include "_all.qh"
#include "hud.qh"
#include "scoreboard.qh"
#include "../common/mapinfo.qh"
-#include "../common/util.qh"
int mv_num_maps;
-#ifndef MAPVOTING_H
-#define MAPVOTING_H
+#ifndef CLIENT_MAPVOTING_H
+#define CLIENT_MAPVOTING_H
#include "../common/constants.qh"
void MapVote_Draw();
#include "miscfunctions.qh"
-#include "_all.qh"
#include "hud.qh"
#include "../common/command/generic.qh"
#include "../common/teams.qh"
-#include "../common/util.qh"
#include "../csqcmodellib/cl_model.qh"
-#ifndef MISCFUNCTIONS_H
-#define MISCFUNCTIONS_H
+#ifndef CLIENT_MISCFUNCTIONS_H
+#define CLIENT_MISCFUNCTIONS_H
entity players;
entity teams;
#include "modeleffects.qh"
-#include "_all.qh"
.float cnt;
.float scale;
-#ifndef MODELEFFECTS_H
-#define MODELEFFECTS_H
+#ifndef CLIENT_MODELEFFECTS_H
+#define CLIENT_MODELEFFECTS_H
entityclass(ModelEffect);
class(ModelEffect) .float frame1time;
#include "particles.qh"
-#include "_all.qh"
#include "../common/stats.qh"
-#include "../common/util.qh"
#include "../warpzonelib/common.qh"
-#ifndef PARTICLES_H
-#define PARTICLES_H
+#ifndef CLIENT_PARTICLES_H
+#define CLIENT_PARTICLES_H
.int dphitcontentsmask;
entityclass(PointParticles);
#include "player_skeleton.qh"
-#include "../common/csqcmodel_settings.qh"
-
+#include "mutators/events.qh"
+#include "../csqcmodellib/cl_player.qh"
#include "../warpzonelib/anglestransform.qh"
+.vector v_angle;
+
class(Skeleton) .float skeleton_info_modelindex;
class(Skeleton) .float skeleton_info_skin;
const int BONETYPE_LOWER = 0;
-#ifndef PLAYER_SKELETON
-#define PLAYER_SKELETON
-
-#include "../common/util.qh"
+#ifndef CLIENT_PLAYER_SKELETON
+#define CLIENT_PLAYER_SKELETON
void free_skeleton_from_frames(entity e);
void skeleton_from_frames(entity e, float is_dead);
#include "../lib/_all.inc"
+#include "_all.qh"
#include "announcer.qc"
#include "bgmscript.qc"
#include "view.qc"
#include "wall.qc"
-#include "command/all.qc"
+#include "commands/all.qc"
#include "weapons/projectile.qc" // TODO
#include "../common/animdecide.qc"
-#include "../common/effects/effects.qc"
#include "../common/effects/effectinfo.qc"
#include "../common/mapinfo.qc"
#include "../common/movetypes/include.qc"
#include "../common/minigames/cl_minigames.qc"
#include "../common/buffs/all.qc"
+#include "../common/effects/all.qc"
#include "../common/items/all.qc"
#include "../common/monsters/all.qc"
#include "../common/mutators/all.qc"
-#include "_all.qh"
+#include "quickmenu.qh"
+#include "hud.qh"
#include "hud_config.qh"
+#include "mapvoting.qh"
// QUICKMENU_MAXLINES must be <= 10
const int QUICKMENU_MAXLINES = 10;
--- /dev/null
+#ifndef CLIENT_QUICKMENU_H
+#define CLIENT_QUICKMENU_H
+
+bool QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary);
+bool QuickMenu_IsOpened();
+void QuickMenu_Mouse();
+
+#endif
-#ifndef RUBBLE_H
-#define RUBBLE_H
+#ifndef CLIENT_RUBBLE_H
+#define CLIENT_RUBBLE_H
entityclass(Rubble);
class(Rubble) .float creationtime;
void RubbleLimit(string cname, float limit, void() deleteproc);
#include "scoreboard.qh"
-#include "_all.qh"
+#include "quickmenu.qh"
#include "hud.qh"
#include "../common/constants.qh"
#include "../common/minigames/cl_minigames.qh"
#include "../common/stats.qh"
#include "../common/teams.qh"
-#include "../common/util.qh"
float scoreboard_alpha_bg;
float scoreboard_alpha_fg;
-#ifndef SCOREBOARD_H
-#define SCOREBOARD_H
+#ifndef CLIENT_SCOREBOARD_H
+#define CLIENT_SCOREBOARD_H
float xmin, xmax, ymin, ymax, sbwidth;
#include "shownames.qh"
-#include "_all.qh"
#include "hud.qh"
#include "../common/constants.qh"
#include "../common/mapinfo.qh"
#include "../common/teams.qh"
-#include "../common/util.qh"
#include "../csqcmodellib/cl_model.qh"
-#ifndef SHOWNAMES_H
-#define SHOWNAMES_H
+#ifndef CLIENT_SHOWNAMES_H
+#define CLIENT_SHOWNAMES_H
entityclass(ShowNames);
class(ShowNames) .float healthvalue;
-#include "_all.qh"
#include "../common/buffs/all.qh"
#include "../common/movetypes/movetypes.qh"
-#include "../common/util.qh"
#include "../common/weapons/all.qh"
#include "../csqcmodellib/cl_model.qh"
#include "../csqcmodellib/common.qh"
#include "teamradar.qh"
-#include "_all.qh"
#include "hud.qh"
-#include "../common/util.qh"
+#include "../common/mutators/mutator/waypoints/all.qh"
#include "../csqcmodellib/interpolate.qh"
-#ifndef TEAMRADAR_H
-#define TEAMRADAR_H
+#ifndef CLIENT_TEAMRADAR_H
+#define CLIENT_TEAMRADAR_H
const int MAX_TEAMRADAR_TIMES = 32;
#include "tuba.qh"
-#include "_all.qh"
#include "../common/constants.qh"
-#include "../common/util.qh"
#define TUBA_STARTNOTE(i, n) W_Sound(strcat("tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n)))
-#ifndef TUBA_H
-#define TUBA_H
+#ifndef CLIENT_TUBA_H
+#define CLIENT_TUBA_H
void Ent_TubaNote(bool isNew);
void Tuba_Precache();
-#include "_all.qh"
#include "announcer.qh"
#include "hook.qh"
#include "mapvoting.qh"
#include "scoreboard.qh"
#include "shownames.qh"
+#include "quickmenu.qh"
#include "mutators/events.qh"
#include "../common/stats.qh"
#include "../common/triggers/target/music.qh"
#include "../common/teams.qh"
-#include "../common/util.qh"
+#include "../common/vehicles/all.qh"
#include "../common/weapons/all.qh"
+#include "../common/viewloc.qh"
+#include "../common/minigames/cl_minigames.qh"
+#include "../common/minigames/cl_minigames_hud.qh"
#include "../csqcmodellib/cl_player.qh"
#include "wall.qh"
-#include "_all.qh"
#include "bgmscript.qh"
-#include "../common/util.qh"
#include "../csqcmodellib/interpolate.qh"
-#ifndef WALL_H
-#define WALL_H
+#ifndef CLIENT_WALL_H
+#define CLIENT_WALL_H
entityclass(Wall);
class(Wall) .float lip;
#include "../autocvars.qh"
#include "../defs.qh"
#include "../main.qh"
+#include "../mutators/events.qh"
#include "../../common/constants.qh"
#include "../../common/nades/all.qh"
#include "../../common/movetypes/movetypes.qh"
-#include "../../common/util.qh"
#include "../../csqcmodellib/interpolate.qh"
-#ifndef PROJECTILE_H
-#define PROJECTILE_H
+#ifndef CLIENT_WEAPONS_PROJECTILE_H
+#define CLIENT_WEAPONS_PROJECTILE_H
entityclass(Projectile);
class(Projectile) .int traileffect;
#include "animdecide.qh"
+
+#include "monsters/all.qh"
+
#if defined(SVQC)
#include "util.qh"
#include "../server/defs.qh"
#endif
#ifdef CSQC
- #include "../../client/command/cl_cmd.qh"
+ #include "../../client/commands/cl_cmd.qh"
#endif
#ifdef SVQC
--- /dev/null
+// Global list of effects, networked to CSQC by ID to save bandwidth and to use client particle numbers (allows mismatching effectinfos to some degree)
+// Not too concerned about the order of this list, just keep the weapon effects together!
+
+#include "../teams.qh"
+
+// EFFECT(istrail, EFFECT_NAME, "effectinfo_string")
+EFFECT(0, EXPLOSION_SMALL, "explosion_small")
+EFFECT(0, EXPLOSION_MEDIUM, "explosion_medium")
+EFFECT(0, EXPLOSION_BIG, "explosion_big")
+
+EFFECT(0, SMOKE_SMALL, "smoke_small")
+EFFECT(0, SMOKE_LARGE, "smoke_large")
+
+
+
+EFFECT(0, BLASTER_IMPACT, "laser_impact")
+EFFECT(0, BLASTER_MUZZLEFLASH, "laser_muzzleflash")
+
+EFFECT(0, SHOTGUN_IMPACT, "shotgun_impact")
+EFFECT(0, SHOTGUN_MUZZLEFLASH, "shotgun_muzzleflash")
+
+EFFECT(0, ARC_BEAM, "arc_beam")
+EFFECT(0, ARC_BEAM_HEAL, "arc_beam_heal")
+EFFECT(0, ARC_BEAM_HEAL_IMPACT, "arc_beam_healimpact")
+EFFECT(0, ARC_BEAM_HEAL_IMPACT2, "healray_impact")
+EFFECT(0, ARC_LIGHTNING, "arc_lightning")
+EFFECT(0, ARC_LIGHTNING2, "electro_lightning")
+
+EFFECT(0, MACHINEGUN_IMPACT, "machinegun_impact")
+EFFECT(0, MACHINEGUN_MUZZLEFLASH, "uzi_muzzleflash")
+
+EFFECT(0, GRENADE_EXPLODE, "grenade_explode")
+EFFECT(0, GRENADE_MUZZLEFLASH, "grenadelauncher_muzzleflash")
+
+EFFECT(0, ELECTRO_BALLEXPLODE, "electro_ballexplode")
+EFFECT(0, ELECTRO_COMBO, "electro_combo")
+EFFECT(0, ELECTRO_IMPACT, "electro_impact")
+EFFECT(0, ELECTRO_MUZZLEFLASH, "electro_muzzleflash")
+
+EFFECT(0, CRYLINK_IMPACT, "crylink_impactbig")
+EFFECT(0, CRYLINK_IMPACT2, "crylink_impact")
+EFFECT(0, CRYLINK_JOINEXPLODE, "crylink_joinexplode")
+EFFECT(0, CRYLINK_MUZZLEFLASH, "crylink_muzzleflash")
+
+EFFECT(0, VORTEX_BEAM, "nex_beam")
+EFFECT(0, VORTEX_BEAM_OLD, "TE_TEI_G3")
+EFFECT(0, VORTEX_IMPACT, "nex_impact")
+EFFECT(0, VORTEX_MUZZLEFLASH, "nex_muzzleflash")
+
+EFFECT(1, VAPORIZER_RED, "TE_TEI_G3RED")
+EFFECT(1, VAPORIZER_HIT_RED, "TE_TEI_G3RED_HIT")
+EFFECT(1, VAPORIZER_BLUE, "TE_TEI_G3BLUE")
+EFFECT(1, VAPORIZER_HIT_BLUE, "TE_TEI_G3BLUE_HIT")
+EFFECT(1, VAPORIZER_YELLOW, "TE_TEI_G3YELLOW")
+EFFECT(1, VAPORIZER_HIT_YELLOW, "TE_TEI_G3YELLOW_HIT")
+EFFECT(1, VAPORIZER_PINK, "TE_TEI_G3PINK")
+EFFECT(1, VAPORIZER_HIT_PINK, "TE_TEI_G3PINK_HIT")
+EFFECT(1, VAPORIZER_NEUTRAL, "TE_TEI_G3")
+EFFECT(1, VAPORIZER_HIT_NEUTRAL, "TE_TEI_G3_HIT")
+entity EFFECT_VAPORIZER(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_VAPORIZER_RED;
+ case NUM_TEAM_2: return EFFECT_VAPORIZER_BLUE;
+ case NUM_TEAM_3: return EFFECT_VAPORIZER_YELLOW;
+ case NUM_TEAM_4: return EFFECT_VAPORIZER_PINK;
+ default: return EFFECT_VAPORIZER_NEUTRAL;
+ }
+}
+entity EFFECT_VAPORIZER_HIT(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_VAPORIZER_HIT_RED;
+ case NUM_TEAM_2: return EFFECT_VAPORIZER_HIT_BLUE;
+ case NUM_TEAM_3: return EFFECT_VAPORIZER_HIT_YELLOW;
+ case NUM_TEAM_4: return EFFECT_VAPORIZER_HIT_PINK;
+ default: return EFFECT_VAPORIZER_HIT_NEUTRAL;
+ }
+}
+
+EFFECT(0, RIFLE_IMPACT, "machinegun_impact")
+EFFECT(0, RIFLE_MUZZLEFLASH, "rifle_muzzleflash")
+EFFECT(1, RIFLE, "tr_rifle")
+EFFECT(1, RIFLE_WEAK, "tr_rifle_weak")
+
+EFFECT(0, HAGAR_BOUNCE, "hagar_bounce")
+EFFECT(0, HAGAR_EXPLODE, "hagar_explode")
+EFFECT(0, HAGAR_MUZZLEFLASH, "hagar_muzzleflash")
+EFFECT(1, HAGAR_ROCKET, "tr_hagar")
+
+EFFECT(0, ROCKET_EXPLODE, "rocket_explode")
+EFFECT(0, ROCKET_GUIDE, "rocket_guide")
+EFFECT(0, ROCKET_MUZZLEFLASH, "rocketlauncher_muzzleflash")
+
+EFFECT(0, HOOK_EXPLODE, "hookbomb_explode")
+EFFECT(0, HOOK_IMPACT, "grapple_impact")
+EFFECT(0, HOOK_MUZZLEFLASH, "grapple_muzzleflash")
+
+EFFECT(0, SEEKER_MUZZLEFLASH, "seeker_muzzleflash")
+
+EFFECT(0, FLAK_BOUNCE, "flak_bounce")
+
+EFFECT(1, FIREBALL, "fireball")
+EFFECT(0, FIREBALL_BFGDAMAGE, "fireball_bfgdamage")
+EFFECT(0, FIREBALL_EXPLODE, "fireball_explode")
+EFFECT(0, FIREBALL_LASER, "fireball_laser")
+EFFECT(0, FIREBALL_MUZZLEFLASH, "fireball_muzzleflash")
+EFFECT(0, FIREBALL_PRE_MUZZLEFLASH, "fireball_preattack_muzzleflash")
+
+
+
+EFFECT(0, RAPTOR_CANNON_IMPACT, "raptor_cannon_impact")
+EFFECT(0, RAPTOR_BOMB_IMPACT, "raptor_bomb_impact")
+EFFECT(0, RAPTOR_BOMB_SPREAD, "raptor_bomb_spread")
+EFFECT(0, RAPTOR_MUZZLEFLASH, "raptor_cannon_muzzleflash")
+
+EFFECT(0, RACER_BOOSTER, "wakizashi_booster_smoke")
+EFFECT(0, RACER_IMPACT, "wakizashi_gun_impact")
+EFFECT(0, RACER_MUZZLEFLASH, "wakizashi_gun_muzzleflash")
+EFFECT(0, RACER_ROCKETLAUNCH, "wakizashi_rocket_launch")
+EFFECT(0, RACER_ROCKET_EXPLODE, "wakizashi_rocket_launch")
+EFFECT(1, RACER_ROCKET_TRAIL, "wakizashi_rocket_thrust")
+
+EFFECT(0, SPIDERBOT_ROCKETLAUNCH, "spiderbot_rocket_launch")
+EFFECT(1, SPIDERBOT_ROCKET_TRAIL, "spiderbot_rocket_thrust")
+EFFECT(0, SPIDERBOT_ROCKET_EXPLODE, "spiderbot_rocket_explode")
+EFFECT(0, SPIDERBOT_MINIGUN_IMPACT, "spiderbot_minigun_impact")
+EFFECT(0, SPIDERBOT_MINIGUN_MUZZLEFLASH, "spiderbot_minigun_muzzleflash")
+
+EFFECT(0, BUMBLEBEE_HEAL_MUZZLEFLASH, "healray_muzzleflash")
+EFFECT(0, BUMBLEBEE_HEAL_IMPACT, "healray_impact")
+
+EFFECT(0, BIGPLASMA_IMPACT, "bigplasma_impact")
+EFFECT(0, BIGPLASMA_MUZZLEFLASH, "bigplasma_muzzleflash")
+
+EFFECT(0, TELEPORT, "teleport")
+
+EFFECT(0, SPAWNPOINT_RED, "spawn_point_red")
+EFFECT(0, SPAWN_RED, "spawn_event_red")
+EFFECT(0, SPAWNPOINT_BLUE, "spawn_point_blue")
+EFFECT(0, SPAWN_BLUE, "spawn_event_blue")
+EFFECT(0, SPAWNPOINT_YELLOW, "spawn_point_yellow")
+EFFECT(0, SPAWN_YELLOW, "spawn_event_yellow")
+EFFECT(0, SPAWNPOINT_PINK, "spawn_point_pink")
+EFFECT(0, SPAWN_PINK, "spawn_event_pink")
+EFFECT(0, SPAWNPOINT_NEUTRAL, "spawn_point_neutral")
+EFFECT(0, SPAWN_NEUTRAL, "spawn_event_neutral")
+
+EFFECT(0, NADE_EXPLODE_RED, "nade_red_explode")
+EFFECT(0, NADE_EXPLODE_BLUE, "nade_blue_explode")
+EFFECT(0, NADE_EXPLODE_YELLOW, "nade_yellow_explode")
+EFFECT(0, NADE_EXPLODE_PINK, "nade_pink_explode")
+EFFECT(0, NADE_EXPLODE_NEUTRAL, "nade_neutral_explode")
+entity EFFECT_NADE_EXPLODE(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_NADE_EXPLODE_RED;
+ case NUM_TEAM_2: return EFFECT_NADE_EXPLODE_BLUE;
+ case NUM_TEAM_3: return EFFECT_NADE_EXPLODE_YELLOW;
+ case NUM_TEAM_4: return EFFECT_NADE_EXPLODE_PINK;
+ default: return EFFECT_NADE_EXPLODE_NEUTRAL;
+ }
+}
+
+EFFECT(1, NADE_TRAIL_RED, "nade_red")
+EFFECT(1, NADE_TRAIL_BLUE, "nade_blue")
+EFFECT(1, NADE_TRAIL_YELLOW, "nade_yellow")
+EFFECT(1, NADE_TRAIL_PINK, "nade_pink")
+EFFECT(1, NADE_TRAIL_NEUTRAL, "nade_neutral")
+entity EFFECT_NADE_TRAIL(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_NADE_TRAIL_RED;
+ case NUM_TEAM_2: return EFFECT_NADE_TRAIL_BLUE;
+ case NUM_TEAM_3: return EFFECT_NADE_TRAIL_YELLOW;
+ case NUM_TEAM_4: return EFFECT_NADE_TRAIL_PINK;
+ default: return EFFECT_NADE_TRAIL_NEUTRAL;
+ }
+}
+
+EFFECT(1, NADE_TRAIL_BURN_RED, "nade_red_burn")
+EFFECT(1, NADE_TRAIL_BURN_BLUE, "nade_blue_burn")
+EFFECT(1, NADE_TRAIL_BURN_YELLOW, "nade_yellow_burn")
+EFFECT(1, NADE_TRAIL_BURN_PINK, "nade_pink_burn")
+EFFECT(1, NADE_TRAIL_BURN_NEUTRAL, "nade_neutral_burn")
+entity EFFECT_NADE_TRAIL_BURN(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_NADE_TRAIL_BURN_RED;
+ case NUM_TEAM_2: return EFFECT_NADE_TRAIL_BURN_BLUE;
+ case NUM_TEAM_3: return EFFECT_NADE_TRAIL_BURN_YELLOW;
+ case NUM_TEAM_4: return EFFECT_NADE_TRAIL_BURN_PINK;
+ default: return EFFECT_NADE_TRAIL_BURN_NEUTRAL;
+ }
+}
+
+EFFECT(0, ICEORGLASS, "iceorglass")
+EFFECT(0, ICEFIELD, "icefield")
+EFFECT(0, FIREFIELD, "firefield")
+EFFECT(0, HEALING, "healing_fx")
+EFFECT(1, LASER_BEAM_FAST, "nex242_misc_laser_beam_fast")
+EFFECT(0, RESPAWN_GHOST, "respawn_ghost")
+
+EFFECT(0, FLAG_TOUCH_RED, "redflag_touch")
+EFFECT(0, FLAG_TOUCH_BLUE, "blueflag_touch")
+EFFECT(0, FLAG_TOUCH_YELLOW, "yellowflag_touch")
+EFFECT(0, FLAG_TOUCH_PINK, "pinkflag_touch")
+EFFECT(0, FLAG_TOUCH_NEUTRAL, "neutralflag_touch")
+entity EFFECT_FLAG_TOUCH(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_FLAG_TOUCH_RED;
+ case NUM_TEAM_2: return EFFECT_FLAG_TOUCH_BLUE;
+ case NUM_TEAM_3: return EFFECT_FLAG_TOUCH_YELLOW;
+ case NUM_TEAM_4: return EFFECT_FLAG_TOUCH_PINK;
+ default: return EFFECT_FLAG_TOUCH_NEUTRAL;
+ }
+}
+
+EFFECT(1, PASS_RED, "red_pass")
+EFFECT(1, PASS_BLUE, "blue_pass")
+EFFECT(1, PASS_YELLOW, "yellow_pass")
+EFFECT(1, PASS_PINK, "pink_pass")
+EFFECT(1, PASS_NEUTRAL, "neutral_pass")
+
+EFFECT(0, CAP_RED, "red_cap")
+EFFECT(0, CAP_BLUE, "blue_cap")
+EFFECT(0, CAP_YELLOW, "yellow_cap")
+EFFECT(0, CAP_PINK, "pink_cap")
+EFFECT(0, CAP_NEUTRAL, "neutral_cap")
+entity EFFECT_CAP(int teamid)
+{
+ switch (teamid) {
+ case NUM_TEAM_1: return EFFECT_CAP_RED;
+ case NUM_TEAM_2: return EFFECT_CAP_BLUE;
+ case NUM_TEAM_3: return EFFECT_CAP_YELLOW;
+ case NUM_TEAM_4: return EFFECT_CAP_PINK;
+ default: return EFFECT_CAP_NEUTRAL;
+ }
+}
+
+EFFECT(0, ITEM_PICKUP, "item_pickup")
+EFFECT(0, ITEM_RESPAWN, "item_respawn")
+
+EFFECT(0, ONS_GENERATOR_DAMAGED, "torch_small")
+EFFECT(0, ONS_GENERATOR_GIB, "onslaught_generator_gib_explode")
+EFFECT(0, ONS_GENERATOR_EXPLODE, "onslaught_generator_smallexplosion")
+EFFECT(0, ONS_GENERATOR_EXPLODE2, "onslaught_generator_finalexplosion")
+
+
+
+EFFECT(0, LASER_DEADLY, "laser_deadly")
+EFFECT(1, FLAC_TRAIL, "TR_SEEKER")
+EFFECT(1, SEEKER_TRAIL, "TR_SEEKER")
+EFFECT(1, FIREMINE, "firemine")
+EFFECT(0, BALL_SPARKS, "kaball_sparks")
+EFFECT(0, ELECTRIC_SPARKS, "electricity_sparks")
+EFFECT(0, SPARKS, "sparks")
+EFFECT(0, RAGE, "rage")
+EFFECT(0, SMOKING, "smoking")
+EFFECT(0, SMOKE_RING, "smoke_ring")
+EFFECT(0, JUMPPAD, "jumppad_activate")
+EFFECT(1, BULLET, "tr_bullet")
+EFFECT(0, EF_FLAME, "EF_FLAME")
+EFFECT(0, EF_STARDUST, "EF_STARDUST")
+EFFECT(0, TE_EXPLOSION, "TE_EXPLOSION")
+EFFECT(1, TR_NEXUIZPLASMA, "TR_NEXUIZPLASMA")
+EFFECT(1, TR_CRYLINKPLASMA, "TR_CRYLINKPLASMA")
+EFFECT(1, TR_ROCKET, "TR_ROCKET")
+EFFECT(1, TR_GRENADE, "TR_GRENADE")
+EFFECT(1, TR_BLOOD, "TR_BLOOD")
+EFFECT(1, TR_WIZSPIKE, "TR_WIZSPIKE")
+EFFECT(1, TR_SLIGHTBLOOD, "TR_SLIGHTBLOOD")
+EFFECT(1, TR_KNIGHTSPIKE, "TR_KNIGHTSPIKE")
+EFFECT(1, TR_VORESPIKE, "TR_VORESPIKE")
+EFFECT(0, TE_SPARK, "TE_SPARK")
+
+EFFECT(1, ROCKETMINSTA_LASER_RED, "rocketminsta_laser_red")
+EFFECT(1, ROCKETMINSTA_LASER_BLUE, "rocketminsta_laser_blue")
+EFFECT(1, ROCKETMINSTA_LASER_YELLOW, "rocketminsta_laser_yellow")
+EFFECT(1, ROCKETMINSTA_LASER_PINK, "rocketminsta_laser_pink")
+EFFECT(1, ROCKETMINSTA_LASER_NEUTRAL, "rocketminsta_laser_neutral")
+entity EFFECT_ROCKETMINSTA_LASER(int teamid)
+{
+ entity e;
+ switch (teamid) {
+ case NUM_TEAM_1: e = EFFECT_ROCKETMINSTA_LASER_RED; break;
+ case NUM_TEAM_2: e = EFFECT_ROCKETMINSTA_LASER_BLUE; break;
+ case NUM_TEAM_3: e = EFFECT_ROCKETMINSTA_LASER_YELLOW; break;
+ case NUM_TEAM_4: e = EFFECT_ROCKETMINSTA_LASER_PINK; break;
+ default: e = EFFECT_ROCKETMINSTA_LASER_NEUTRAL; break;
+ }
+ if (particleeffectnum(e) < 0 || Team_TeamToNumber(teamid) == -1) { e = EFFECT_TR_NEXUIZPLASMA; }
+ return e;
+}
--- /dev/null
+#include "all.qh"
+
+#ifdef CSQC
+void Read_Effect(bool is_new)
+{
+ int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte();
+
+ entity eff = Effects[net_name];
+
+ vector v, vel = '0 0 0';
+ int eff_cnt = 1;
+ bool eff_trail = eff.eent_eff_trail;
+ v_x = ReadCoord();
+ v_y = ReadCoord();
+ v_z = ReadCoord();
+
+ bool use_vel = ReadByte();
+ if(use_vel)
+ {
+ vel_x = ReadCoord();
+ vel_y = ReadCoord();
+ vel_z = ReadCoord();
+ }
+
+ if(!eff_trail)
+ eff_cnt = ReadByte();
+
+ if(is_new)
+ {
+ if(eff_trail)
+ WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
+ else
+ pointparticles(particleeffectnum(eff), v, vel, eff_cnt);
+ }
+}
+#endif
+
+#ifdef SVQC
+bool Net_Write_Effect(entity this, entity client, int sf)
+{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_EFFECT);
+ (Effects_COUNT >= 255)
+ ? WriteShort(MSG_ENTITY, self.m_id)
+ : WriteByte(MSG_ENTITY, self.m_id);
+ WriteCoord(MSG_ENTITY, self.eent_net_location_x);
+ WriteCoord(MSG_ENTITY, self.eent_net_location_y);
+ WriteCoord(MSG_ENTITY, self.eent_net_location_z);
+
+ // attempt to save a tiny bit more bandwidth by not sending velocity if it isn't set
+ if(self.eent_net_velocity)
+ {
+ WriteByte(MSG_ENTITY, true);
+ WriteCoord(MSG_ENTITY, self.eent_net_velocity_x);
+ WriteCoord(MSG_ENTITY, self.eent_net_velocity_y);
+ WriteCoord(MSG_ENTITY, self.eent_net_velocity_z);
+ }
+ else { WriteByte(MSG_ENTITY, false); }
+
+ if(!self.eent_eff_trail) { WriteByte(MSG_ENTITY, self.eent_net_count); }
+ return true;
+}
+
+void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
+{
+ if(!eff) { return; }
+ if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count!
+ entity net_eff = spawn();
+ net_eff.owner = eff;
+ net_eff.classname = "net_effect";
+ //net_eff.eent_broadcast = broadcast;
+ net_eff.m_id = eff.m_id;
+ net_eff.eent_net_velocity = eff_vel;
+ net_eff.eent_net_location = eff_loc;
+ net_eff.eent_net_count = eff_cnt;
+ net_eff.eent_eff_trail = eff.eent_eff_trail;
+
+ net_eff.think = SUB_Remove;
+ net_eff.nextthink = time + 0.2; // don't need to keep this long
+
+ Net_LinkEntity(net_eff, false, 0, Net_Write_Effect);
+}
+
+void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
+{
+ // problem with this is, we might not have all the available effects for it
+ FOREACH(Effects, it.eent_eff_name == eff_name, LAMBDA(
+ Send_Effect(it, eff_loc, eff_vel, eff_cnt);
+ return;
+ ));
+ // revert to engine handling
+ pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
+}
+#endif
--- /dev/null
+#ifndef EFFECTS_ALL_H
+#define EFFECTS_ALL_H
+
+#include "effect.qh"
+
+#ifdef CSQC
+void Read_Effect(bool is_new);
+#elif defined(SVQC)
+void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt);
+void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt);
+#endif
+
+REGISTRY(Effects, BIT(8))
+REGISTER_REGISTRY(RegisterEffects)
+#define EFFECT(istrail, name, realname) \
+ REGISTER(RegisterEffects, EFFECT, Effects, name, m_id, Create_Effect_Entity(realname, istrail));
+
+void RegisterEffects_First()
+{
+ #ifdef SVQC
+ #define dedi (server_is_dedicated ? "a dedicated " : "")
+ #else
+ #define dedi ""
+ #endif
+
+ LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
+ #undef dedi
+}
+
+void RegisterEffects_Done()
+{
+ LOG_TRACE("Effects initialization successful!\n");
+}
+
+// NOW we actually activate the declarations
+ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First)
+EFFECT(0, Null, string_null)
+#include "all.inc"
+ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done)
+
+#endif
--- /dev/null
+#ifndef EFFECT_H
+#define EFFECT_H
+
+#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name)
+
+.int m_id;
+.string eent_eff_name;
+.int eent_eff_trail;
+
+.vector eent_net_location;
+.vector eent_net_velocity;
+.int eent_net_count;
+
+entity Create_Effect_Entity(string eff_name, bool eff_trail)
+{
+ entity this = new(effect_entity);
+ this.eent_eff_name = eff_name;
+ this.eent_eff_trail = eff_trail;
+ return this;
+}
+
+#endif
+++ /dev/null
-// Global list of effects, networked to CSQC by ID to save bandwidth and to use client particle numbers (allows mismatching effectinfos to some degree)
-// Not too concerned about the order of this list, just keep the weapon effects together!
-
-// EFFECT(istrail, EFFECT_NAME, "effectinfo_string")
-EFFECT(0, EXPLOSION_SMALL, "explosion_small")
-EFFECT(0, EXPLOSION_MEDIUM, "explosion_medium")
-EFFECT(0, EXPLOSION_BIG, "explosion_big")
-
-EFFECT(0, SMOKE_SMALL, "smoke_small")
-EFFECT(0, SMOKE_LARGE, "smoke_large")
-
-
-
-EFFECT(0, BLASTER_IMPACT, "laser_impact")
-EFFECT(0, BLASTER_MUZZLEFLASH, "laser_muzzleflash")
-
-EFFECT(0, SHOTGUN_IMPACT, "shotgun_impact")
-EFFECT(0, SHOTGUN_MUZZLEFLASH, "shotgun_muzzleflash")
-
-EFFECT(0, ARC_BEAM, "arc_beam")
-EFFECT(0, ARC_BEAM_HEAL, "arc_beam_heal")
-EFFECT(0, ARC_BEAM_HEAL_IMPACT, "arc_beam_healimpact")
-EFFECT(0, ARC_BEAM_HEAL_IMPACT2, "healray_impact")
-EFFECT(0, ARC_LIGHTNING, "arc_lightning")
-EFFECT(0, ARC_LIGHTNING2, "electro_lightning")
-
-EFFECT(0, MACHINEGUN_IMPACT, "machinegun_impact")
-EFFECT(0, MACHINEGUN_MUZZLEFLASH, "uzi_muzzleflash")
-
-EFFECT(0, GRENADE_EXPLODE, "grenade_explode")
-EFFECT(0, GRENADE_MUZZLEFLASH, "grenadelauncher_muzzleflash")
-
-EFFECT(0, ELECTRO_BALLEXPLODE, "electro_ballexplode")
-EFFECT(0, ELECTRO_COMBO, "electro_combo")
-EFFECT(0, ELECTRO_IMPACT, "electro_impact")
-EFFECT(0, ELECTRO_MUZZLEFLASH, "electro_muzzleflash")
-
-EFFECT(0, CRYLINK_IMPACT, "crylink_impactbig")
-EFFECT(0, CRYLINK_IMPACT2, "crylink_impact")
-EFFECT(0, CRYLINK_JOINEXPLODE, "crylink_joinexplode")
-EFFECT(0, CRYLINK_MUZZLEFLASH, "crylink_muzzleflash")
-
-EFFECT(0, VORTEX_BEAM, "nex_beam")
-EFFECT(0, VORTEX_BEAM_OLD, "TE_TEI_G3")
-EFFECT(0, VORTEX_IMPACT, "nex_impact")
-EFFECT(0, VORTEX_MUZZLEFLASH, "nex_muzzleflash")
-
-EFFECT(1, VAPORIZER_RED, "TE_TEI_G3RED")
-EFFECT(1, VAPORIZER_HIT_RED, "TE_TEI_G3RED_HIT")
-EFFECT(1, VAPORIZER_BLUE, "TE_TEI_G3BLUE")
-EFFECT(1, VAPORIZER_HIT_BLUE, "TE_TEI_G3BLUE_HIT")
-EFFECT(1, VAPORIZER_YELLOW, "TE_TEI_G3YELLOW")
-EFFECT(1, VAPORIZER_HIT_YELLOW, "TE_TEI_G3YELLOW_HIT")
-EFFECT(1, VAPORIZER_PINK, "TE_TEI_G3PINK")
-EFFECT(1, VAPORIZER_HIT_PINK, "TE_TEI_G3PINK_HIT")
-EFFECT(1, VAPORIZER_NEUTRAL, "TE_TEI_G3")
-EFFECT(1, VAPORIZER_HIT_NEUTRAL, "TE_TEI_G3_HIT")
-entity EFFECT_VAPORIZER(int teamid)
-{
- switch (teamid) {
- case NUM_TEAM_1: return EFFECT_VAPORIZER_RED;
- case NUM_TEAM_2: return EFFECT_VAPORIZER_BLUE;
- case NUM_TEAM_3: return EFFECT_VAPORIZER_YELLOW;
- case NUM_TEAM_4: return EFFECT_VAPORIZER_PINK;
- default: return EFFECT_VAPORIZER_NEUTRAL;
- }
-}
-entity EFFECT_VAPORIZER_HIT(int teamid)
-{
- switch (teamid) {
- case NUM_TEAM_1: return EFFECT_VAPORIZER_HIT_RED;
- case NUM_TEAM_2: return EFFECT_VAPORIZER_HIT_BLUE;
- case NUM_TEAM_3: return EFFECT_VAPORIZER_HIT_YELLOW;
- case NUM_TEAM_4: return EFFECT_VAPORIZER_HIT_PINK;
- default: return EFFECT_VAPORIZER_HIT_NEUTRAL;
- }
-}
-
-EFFECT(0, RIFLE_IMPACT, "machinegun_impact")
-EFFECT(0, RIFLE_MUZZLEFLASH, "rifle_muzzleflash")
-EFFECT(1, RIFLE, "tr_rifle")
-EFFECT(1, RIFLE_WEAK, "tr_rifle_weak")
-
-EFFECT(0, HAGAR_BOUNCE, "hagar_bounce")
-EFFECT(0, HAGAR_EXPLODE, "hagar_explode")
-EFFECT(0, HAGAR_MUZZLEFLASH, "hagar_muzzleflash")
-EFFECT(1, HAGAR_ROCKET, "tr_hagar")
-
-EFFECT(0, ROCKET_EXPLODE, "rocket_explode")
-EFFECT(0, ROCKET_GUIDE, "rocket_guide")
-EFFECT(0, ROCKET_MUZZLEFLASH, "rocketlauncher_muzzleflash")
-
-EFFECT(0, HOOK_EXPLODE, "hookbomb_explode")
-EFFECT(0, HOOK_IMPACT, "grapple_impact")
-EFFECT(0, HOOK_MUZZLEFLASH, "grapple_muzzleflash")
-
-EFFECT(0, SEEKER_MUZZLEFLASH, "seeker_muzzleflash")
-
-EFFECT(0, FLAK_BOUNCE, "flak_bounce")
-
-EFFECT(1, FIREBALL, "fireball")
-EFFECT(0, FIREBALL_BFGDAMAGE, "fireball_bfgdamage")
-EFFECT(0, FIREBALL_EXPLODE, "fireball_explode")
-EFFECT(0, FIREBALL_LASER, "fireball_laser")
-EFFECT(0, FIREBALL_MUZZLEFLASH, "fireball_muzzleflash")
-EFFECT(0, FIREBALL_PRE_MUZZLEFLASH, "fireball_preattack_muzzleflash")
-
-
-
-EFFECT(0, RAPTOR_CANNON_IMPACT, "raptor_cannon_impact")
-EFFECT(0, RAPTOR_BOMB_IMPACT, "raptor_bomb_impact")
-EFFECT(0, RAPTOR_BOMB_SPREAD, "raptor_bomb_spread")
-EFFECT(0, RAPTOR_MUZZLEFLASH, "raptor_cannon_muzzleflash")
-
-EFFECT(0, RACER_BOOSTER, "wakizashi_booster_smoke")
-EFFECT(0, RACER_IMPACT, "wakizashi_gun_impact")
-EFFECT(0, RACER_MUZZLEFLASH, "wakizashi_gun_muzzleflash")
-EFFECT(0, RACER_ROCKETLAUNCH, "wakizashi_rocket_launch")
-EFFECT(0, RACER_ROCKET_EXPLODE, "wakizashi_rocket_launch")
-EFFECT(1, RACER_ROCKET_TRAIL, "wakizashi_rocket_thrust")
-
-EFFECT(0, SPIDERBOT_ROCKETLAUNCH, "spiderbot_rocket_launch")
-EFFECT(1, SPIDERBOT_ROCKET_TRAIL, "spiderbot_rocket_thrust")
-EFFECT(0, SPIDERBOT_ROCKET_EXPLODE, "spiderbot_rocket_explode")
-EFFECT(0, SPIDERBOT_MINIGUN_IMPACT, "spiderbot_minigun_impact")
-EFFECT(0, SPIDERBOT_MINIGUN_MUZZLEFLASH, "spiderbot_minigun_muzzleflash")
-
-EFFECT(0, BUMBLEBEE_HEAL_MUZZLEFLASH, "healray_muzzleflash")
-EFFECT(0, BUMBLEBEE_HEAL_IMPACT, "healray_impact")
-
-EFFECT(0, BIGPLASMA_IMPACT, "bigplasma_impact")
-EFFECT(0, BIGPLASMA_MUZZLEFLASH, "bigplasma_muzzleflash")
-
-EFFECT(0, TELEPORT, "teleport")
-
-EFFECT(0, SPAWNPOINT_RED, "spawn_point_red")
-EFFECT(0, SPAWN_RED, "spawn_event_red")
-EFFECT(0, SPAWNPOINT_BLUE, "spawn_point_blue")
-EFFECT(0, SPAWN_BLUE, "spawn_event_blue")
-EFFECT(0, SPAWNPOINT_YELLOW, "spawn_point_yellow")
-EFFECT(0, SPAWN_YELLOW, "spawn_event_yellow")
-EFFECT(0, SPAWNPOINT_PINK, "spawn_point_pink")
-EFFECT(0, SPAWN_PINK, "spawn_event_pink")
-EFFECT(0, SPAWNPOINT_NEUTRAL, "spawn_point_neutral")
-EFFECT(0, SPAWN_NEUTRAL, "spawn_event_neutral")
-
-EFFECT(0, NADE_EXPLODE_RED, "nade_red_explode")
-EFFECT(0, NADE_EXPLODE_BLUE, "nade_blue_explode")
-EFFECT(0, NADE_EXPLODE_YELLOW, "nade_yellow_explode")
-EFFECT(0, NADE_EXPLODE_PINK, "nade_pink_explode")
-EFFECT(0, NADE_EXPLODE_NEUTRAL, "nade_neutral_explode")
-entity EFFECT_NADE_EXPLODE(int teamid)
-{
- switch (teamid) {
- case NUM_TEAM_1: return EFFECT_NADE_EXPLODE_RED;
- case NUM_TEAM_2: return EFFECT_NADE_EXPLODE_BLUE;
- case NUM_TEAM_3: return EFFECT_NADE_EXPLODE_YELLOW;
- case NUM_TEAM_4: return EFFECT_NADE_EXPLODE_PINK;
- default: return EFFECT_NADE_EXPLODE_NEUTRAL;
- }
-}
-
-EFFECT(1, NADE_TRAIL_RED, "nade_red")
-EFFECT(1, NADE_TRAIL_BLUE, "nade_blue")
-EFFECT(1, NADE_TRAIL_YELLOW, "nade_yellow")
-EFFECT(1, NADE_TRAIL_PINK, "nade_pink")
-EFFECT(1, NADE_TRAIL_NEUTRAL, "nade_neutral")
-entity EFFECT_NADE_TRAIL(int teamid)
-{
- switch (teamid) {
- case NUM_TEAM_1: return EFFECT_NADE_TRAIL_RED;
- case NUM_TEAM_2: return EFFECT_NADE_TRAIL_BLUE;
- case NUM_TEAM_3: return EFFECT_NADE_TRAIL_YELLOW;
- case NUM_TEAM_4: return EFFECT_NADE_TRAIL_PINK;
- default: return EFFECT_NADE_TRAIL_NEUTRAL;
- }
-}
-
-EFFECT(1, NADE_TRAIL_BURN_RED, "nade_red_burn")
-EFFECT(1, NADE_TRAIL_BURN_BLUE, "nade_blue_burn")
-EFFECT(1, NADE_TRAIL_BURN_YELLOW, "nade_yellow_burn")
-EFFECT(1, NADE_TRAIL_BURN_PINK, "nade_pink_burn")
-EFFECT(1, NADE_TRAIL_BURN_NEUTRAL, "nade_neutral_burn")
-entity EFFECT_NADE_TRAIL_BURN(int teamid)
-{
- switch (teamid) {
- case NUM_TEAM_1: return EFFECT_NADE_TRAIL_BURN_RED;
- case NUM_TEAM_2: return EFFECT_NADE_TRAIL_BURN_BLUE;
- case NUM_TEAM_3: return EFFECT_NADE_TRAIL_BURN_YELLOW;
- case NUM_TEAM_4: return EFFECT_NADE_TRAIL_BURN_PINK;
- default: return EFFECT_NADE_TRAIL_BURN_NEUTRAL;
- }
-}
-
-EFFECT(0, ICEORGLASS, "iceorglass")
-EFFECT(0, ICEFIELD, "icefield")
-EFFECT(0, FIREFIELD, "firefield")
-EFFECT(0, HEALING, "healing_fx")
-EFFECT(1, LASER_BEAM_FAST, "nex242_misc_laser_beam_fast")
-EFFECT(0, RESPAWN_GHOST, "respawn_ghost")
-
-EFFECT(0, FLAG_TOUCH_RED, "redflag_touch")
-EFFECT(0, FLAG_TOUCH_BLUE, "blueflag_touch")
-EFFECT(0, FLAG_TOUCH_YELLOW, "yellowflag_touch")
-EFFECT(0, FLAG_TOUCH_PINK, "pinkflag_touch")
-EFFECT(0, FLAG_TOUCH_NEUTRAL, "neutralflag_touch")
-entity EFFECT_FLAG_TOUCH(int teamid)
-{
- switch (teamid) {
- case NUM_TEAM_1: return EFFECT_FLAG_TOUCH_RED;
- case NUM_TEAM_2: return EFFECT_FLAG_TOUCH_BLUE;
- case NUM_TEAM_3: return EFFECT_FLAG_TOUCH_YELLOW;
- case NUM_TEAM_4: return EFFECT_FLAG_TOUCH_PINK;
- default: return EFFECT_FLAG_TOUCH_NEUTRAL;
- }
-}
-
-EFFECT(1, PASS_RED, "red_pass")
-EFFECT(1, PASS_BLUE, "blue_pass")
-EFFECT(1, PASS_YELLOW, "yellow_pass")
-EFFECT(1, PASS_PINK, "pink_pass")
-EFFECT(1, PASS_NEUTRAL, "neutral_pass")
-
-EFFECT(0, CAP_RED, "red_cap")
-EFFECT(0, CAP_BLUE, "blue_cap")
-EFFECT(0, CAP_YELLOW, "yellow_cap")
-EFFECT(0, CAP_PINK, "pink_cap")
-EFFECT(0, CAP_NEUTRAL, "neutral_cap")
-entity EFFECT_CAP(int teamid)
-{
- switch (teamid) {
- case NUM_TEAM_1: return EFFECT_CAP_RED;
- case NUM_TEAM_2: return EFFECT_CAP_BLUE;
- case NUM_TEAM_3: return EFFECT_CAP_YELLOW;
- case NUM_TEAM_4: return EFFECT_CAP_PINK;
- default: return EFFECT_CAP_NEUTRAL;
- }
-}
-
-EFFECT(0, ITEM_PICKUP, "item_pickup")
-EFFECT(0, ITEM_RESPAWN, "item_respawn")
-
-EFFECT(0, ONS_GENERATOR_DAMAGED, "torch_small")
-EFFECT(0, ONS_GENERATOR_GIB, "onslaught_generator_gib_explode")
-EFFECT(0, ONS_GENERATOR_EXPLODE, "onslaught_generator_smallexplosion")
-EFFECT(0, ONS_GENERATOR_EXPLODE2, "onslaught_generator_finalexplosion")
-
-
-
-EFFECT(0, LASER_DEADLY, "laser_deadly")
-EFFECT(1, FLAC_TRAIL, "TR_SEEKER")
-EFFECT(1, SEEKER_TRAIL, "TR_SEEKER")
-EFFECT(1, FIREMINE, "firemine")
-EFFECT(0, BALL_SPARKS, "kaball_sparks")
-EFFECT(0, ELECTRIC_SPARKS, "electricity_sparks")
-EFFECT(0, SPARKS, "sparks")
-EFFECT(0, RAGE, "rage")
-EFFECT(0, SMOKING, "smoking")
-EFFECT(0, SMOKE_RING, "smoke_ring")
-EFFECT(0, JUMPPAD, "jumppad_activate")
-EFFECT(1, BULLET, "tr_bullet")
-EFFECT(0, EF_FLAME, "EF_FLAME")
-EFFECT(0, EF_STARDUST, "EF_STARDUST")
-EFFECT(0, TE_EXPLOSION, "TE_EXPLOSION")
-EFFECT(1, TR_NEXUIZPLASMA, "TR_NEXUIZPLASMA")
-EFFECT(1, TR_CRYLINKPLASMA, "TR_CRYLINKPLASMA")
-EFFECT(1, TR_ROCKET, "TR_ROCKET")
-EFFECT(1, TR_GRENADE, "TR_GRENADE")
-EFFECT(1, TR_BLOOD, "TR_BLOOD")
-EFFECT(1, TR_WIZSPIKE, "TR_WIZSPIKE")
-EFFECT(1, TR_SLIGHTBLOOD, "TR_SLIGHTBLOOD")
-EFFECT(1, TR_KNIGHTSPIKE, "TR_KNIGHTSPIKE")
-EFFECT(1, TR_VORESPIKE, "TR_VORESPIKE")
-EFFECT(0, TE_SPARK, "TE_SPARK")
-
-EFFECT(1, ROCKETMINSTA_LASER_RED, "rocketminsta_laser_red")
-EFFECT(1, ROCKETMINSTA_LASER_BLUE, "rocketminsta_laser_blue")
-EFFECT(1, ROCKETMINSTA_LASER_YELLOW, "rocketminsta_laser_yellow")
-EFFECT(1, ROCKETMINSTA_LASER_PINK, "rocketminsta_laser_pink")
-EFFECT(1, ROCKETMINSTA_LASER_NEUTRAL, "rocketminsta_laser_neutral")
-entity EFFECT_ROCKETMINSTA_LASER(int teamid)
-{
- entity e;
- switch (teamid) {
- case NUM_TEAM_1: e = EFFECT_ROCKETMINSTA_LASER_RED; break;
- case NUM_TEAM_2: e = EFFECT_ROCKETMINSTA_LASER_BLUE; break;
- case NUM_TEAM_3: e = EFFECT_ROCKETMINSTA_LASER_YELLOW; break;
- case NUM_TEAM_4: e = EFFECT_ROCKETMINSTA_LASER_PINK; break;
- default: e = EFFECT_ROCKETMINSTA_LASER_NEUTRAL; break;
- }
- if (particleeffectnum(e) < 0 || Team_TeamToNumber(teamid) == -1) { e = EFFECT_TR_NEXUIZPLASMA; }
- return e;
-}
+++ /dev/null
-#ifdef CSQC
-void Read_Effect(bool is_new)
-{
- int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte();
-
- entity eff = Effects[net_name];
-
- vector v, vel = '0 0 0';
- int eff_cnt = 1;
- bool eff_trail = eff.eent_eff_trail;
- v_x = ReadCoord();
- v_y = ReadCoord();
- v_z = ReadCoord();
-
- bool use_vel = ReadByte();
- if(use_vel)
- {
- vel_x = ReadCoord();
- vel_y = ReadCoord();
- vel_z = ReadCoord();
- }
-
- if(!eff_trail)
- eff_cnt = ReadByte();
-
- if(is_new)
- {
- if(eff_trail)
- WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
- else
- pointparticles(particleeffectnum(eff), v, vel, eff_cnt);
- }
-}
-#endif
-
-#ifdef SVQC
-bool Net_Write_Effect(entity this, entity client, int sf)
-{
- WriteByte(MSG_ENTITY, ENT_CLIENT_EFFECT);
- (Effects_COUNT >= 255)
- ? WriteShort(MSG_ENTITY, self.m_id)
- : WriteByte(MSG_ENTITY, self.m_id);
- WriteCoord(MSG_ENTITY, self.eent_net_location_x);
- WriteCoord(MSG_ENTITY, self.eent_net_location_y);
- WriteCoord(MSG_ENTITY, self.eent_net_location_z);
-
- // attempt to save a tiny bit more bandwidth by not sending velocity if it isn't set
- if(self.eent_net_velocity)
- {
- WriteByte(MSG_ENTITY, true);
- WriteCoord(MSG_ENTITY, self.eent_net_velocity_x);
- WriteCoord(MSG_ENTITY, self.eent_net_velocity_y);
- WriteCoord(MSG_ENTITY, self.eent_net_velocity_z);
- }
- else { WriteByte(MSG_ENTITY, false); }
-
- if(!self.eent_eff_trail) { WriteByte(MSG_ENTITY, self.eent_net_count); }
- return true;
-}
-
-void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
-{
- if(!eff) { return; }
- if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count!
- entity net_eff = spawn();
- net_eff.owner = eff;
- net_eff.classname = "net_effect";
- //net_eff.eent_broadcast = broadcast;
- net_eff.m_id = eff.m_id;
- net_eff.eent_net_velocity = eff_vel;
- net_eff.eent_net_location = eff_loc;
- net_eff.eent_net_count = eff_cnt;
- net_eff.eent_eff_trail = eff.eent_eff_trail;
-
- net_eff.think = SUB_Remove;
- net_eff.nextthink = time + 0.2; // don't need to keep this long
-
- Net_LinkEntity(net_eff, false, 0, Net_Write_Effect);
-}
-
-void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
-{
- // problem with this is, we might not have all the available effects for it
- FOREACH(Effects, it.eent_eff_name == eff_name, LAMBDA(
- Send_Effect(it, eff_loc, eff_vel, eff_cnt);
- return;
- ));
- // revert to engine handling
- pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
-}
-#endif
+++ /dev/null
-#ifndef P_EFFECTS_H
-#define P_EFFECTS_H
-
-#ifdef CSQC
-void Read_Effect(bool is_new);
-#elif defined(SVQC)
-void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt);
-void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt);
-#endif
-
-#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name)
-
-REGISTRY(Effects, BIT(8))
-REGISTER_REGISTRY(RegisterEffects)
-#define EFFECT(istrail, name, realname) \
- REGISTER(RegisterEffects, EFFECT, Effects, name, m_id, Create_Effect_Entity(realname, istrail));
-
-.int m_id;
-.string eent_eff_name;
-.int eent_eff_trail;
-
-.vector eent_net_location;
-.vector eent_net_velocity;
-.int eent_net_count;
-
-entity Create_Effect_Entity(string eff_name, bool eff_trail)
-{
- entity this = new(effect_entity);
- this.eent_eff_name = eff_name;
- this.eent_eff_trail = eff_trail;
- return this;
-}
-
-void RegisterEffects_First()
-{
- #ifdef SVQC
- #define dedi (server_is_dedicated ? "a dedicated " : "")
- #else
- #define dedi ""
- #endif
-
- LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
- #undef dedi
-}
-
-void RegisterEffects_Done()
-{
- LOG_TRACE("Effects initialization successful!\n");
-}
-
-// NOW we actually activate the declarations
-ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First)
-EFFECT(0, Null, string_null)
-#include "effects.inc"
-ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done)
-
-#endif
+#include "cl_minigames_hud.qh"
#include "minigames.qh"
-#include "../../client/mapvoting.qh"
// whether the mouse is over the given panel
bool HUD_mouse_over(entity somepanel)
--- /dev/null
+#ifndef CL_MINIGAMES_HUD_H
+#define CL_MINIGAMES_HUD_H
+
+float HUD_Minigame_InputEvent(float bInputType, float nPrimary, float nSecondary);
+void HUD_Minigame_Mouse();
+
+#endif
const int PP_TILE_SIZE = 7;
+.int cnt;
+
.int pp_team1_score;
.int pp_team2_score;
#ifndef MODELS_ALL_H
#define MODELS_ALL_H
-#define setmodel(e, m) _setmodel((e), (m).model_str())
+#include "model.qh"
REGISTRY(Models, BIT(9))
REGISTER_REGISTRY(RegisterModels)
-CLASS(Model, Object)
- ATTRIB(Model, m_id, int, 0)
- ATTRIB(Model, model_str, string(), func_null)
- CONSTRUCTOR(Model, string() path)
- {
- CONSTRUCT(Model);
- this.model_str = path;
- }
- METHOD(Model, model_precache, void(entity this)) {
- string s = this.model_str();
- if (s != "" && s != "null" && !fexists(s)) {
- LOG_WARNINGF("Missing model: \"%s\"\n", s);
- return;
- }
- LOG_TRACEF("precache_model(\"%s\")\n", s);
- precache_model(s);
- }
-ENDCLASS(Model)
-
#define MODEL(name, path) \
string MDL_##name##_get() { return path; } \
REGISTER(RegisterModels, MDL, Models, name, m_id, NEW(Model, MDL_##name##_get))
--- /dev/null
+#ifndef MODEL_H
+#define MODEL_H
+
+#define setmodel(e, m) _setmodel((e), (m).model_str())
+
+CLASS(Model, Object)
+ ATTRIB(Model, m_id, int, 0)
+ ATTRIB(Model, model_str, string(), func_null)
+ CONSTRUCTOR(Model, string() path)
+ {
+ CONSTRUCT(Model);
+ this.model_str = path;
+ }
+ METHOD(Model, model_precache, void(entity this)) {
+ string s = this.model_str();
+ if (s != "" && s != "null" && !fexists(s)) {
+ LOG_WARNINGF("Missing model: \"%s\"\n", s);
+ return;
+ }
+ LOG_TRACEF("precache_model(\"%s\")\n", s);
+ precache_model(s);
+ }
+ENDCLASS(Model)
+
+#endif
#include "notifications.inc"
ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotifications_Done)
+STATIC_INIT(RegisterNotifications) { CALL_ACCUMULATED_FUNCTION(RegisterNotifications); }
+
#endif
// Global list of sounds
// TODO: remove uses of _sound
+#include "../teams.qh"
string W_Sound(string w_snd);
SOUND(ARC_FIRE, W_Sound("arc_fire"));
#ifndef SOUNDS_ALL_H
#define SOUNDS_ALL_H
-#include "../teams.qh"
+#include "sound.qh"
-// Play all sounds via sound7, for access to the extra channels.
-// Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
-#ifdef SVQC
- #define _sound(e, c, s, v, a) do { \
- entity __e = e; \
- if (!sound_allowed(MSG_BROADCAST, __e)) break; \
- sound7(__e, c, s, v, a, 0, 0); \
- } while (0)
-#else
- #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
-#endif
-#define sound(e, c, s, v, a) _sound(e, c, s.sound_str(), v, a)
-// Used in places where a string is required
-#define SND(id) (SND_##id.sound_str())
-
-REGISTRY(Sounds, BIT(8))
+REGISTRY(Sounds, BITS(8))
REGISTER_REGISTRY(RegisterSounds)
-CLASS(Sound, Object)
- ATTRIB(Sound, m_id, int, 0)
- ATTRIB(Sound, sound_str, string(), func_null)
- CONSTRUCTOR(Sound, string() path)
- {
- CONSTRUCT(Sound);
- this.sound_str = path;
- }
- METHOD(Sound, sound_precache, void(entity this)) {
- string s = this.sound_str();
- if (s && s != "" && !fexists(strcat("sound/", s))) {
- LOG_WARNINGF("Missing sound: \"%s\"\n", s);
- return;
- }
- LOG_TRACEF("precache_sound(\"%s\")\n", s);
- precache_sound(s);
- }
-ENDCLASS(Sound)
-
#define SOUND(name, path) \
string SND_##name##_get() { return path; } \
REGISTER(RegisterSounds, SND, Sounds, name, m_id, NEW(Sound, SND_##name##_get))
+// Used in places where a string is required
+#define SND(id) (SND_##id.sound_str())
+
STATIC_INIT(RegisterSounds_precache) {
FOREACH(Sounds, true, LAMBDA({
it.sound_precache(it);
--- /dev/null
+#ifndef SOUND_H
+#define SOUND_H
+
+// Play all sounds via sound7, for access to the extra channels.
+// Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
+#ifdef SVQC
+ #define _sound(e, c, s, v, a) do { \
+ entity __e = e; \
+ if (!sound_allowed(MSG_BROADCAST, __e)) break; \
+ sound7(__e, c, s, v, a, 0, 0); \
+ } while (0)
+#else
+ #define _sound(e, c, s, v, a) sound7(e, c, s, v, a, 0, 0)
+#endif
+#define sound(e, c, s, v, a) _sound(e, c, s.sound_str(), v, a)
+
+CLASS(Sound, Object)
+ ATTRIB(Sound, m_id, int, 0)
+ ATTRIB(Sound, sound_str, string(), func_null)
+ CONSTRUCTOR(Sound, string() path)
+ {
+ CONSTRUCT(Sound);
+ this.sound_str = path;
+ }
+ METHOD(Sound, sound_precache, void(entity this)) {
+ string s = this.sound_str();
+ if (s && s != "" && !fexists(strcat("sound/", s))) {
+ LOG_WARNINGF("Missing sound: \"%s\"\n", s);
+ return;
+ }
+ LOG_TRACEF("precache_sound(\"%s\")\n", s);
+ precache_sound(s);
+ }
+ENDCLASS(Sound)
+
+#endif
#define SUB_LTIME move_ltime
#define SUB_FLAGS move_flags
+.vector move_origin;
+
void SUB_SETORIGIN(entity s, vector v)
{SELFPARAM();
s.move_origin = v;
return sprintf("%.*f", decimals, number);
}
-vector colormapPaletteColor(float c, bool isPants)
-{
- switch (c)
- {
- case 0: return '1.000000 1.000000 1.000000';
- case 1: return '1.000000 0.333333 0.000000';
- case 2: return '0.000000 1.000000 0.501961';
- case 3: return '0.000000 1.000000 0.000000';
- case 4: return '1.000000 0.000000 0.000000';
- case 5: return '0.000000 0.666667 1.000000';
- case 6: return '0.000000 1.000000 1.000000';
- case 7: return '0.501961 1.000000 0.000000';
- case 8: return '0.501961 0.000000 1.000000';
- case 9: return '1.000000 0.000000 1.000000';
- case 10: return '1.000000 0.000000 0.501961';
- case 11: return '0.000000 0.000000 1.000000';
- case 12: return '1.000000 1.000000 0.000000';
- case 13: return '0.000000 0.333333 1.000000';
- case 14: return '1.000000 0.666667 0.000000';
- case 15:
- if (isPants)
- return
- '1 0 0' * (0.502 + 0.498 * sin(time / 2.7182818285 + 0.0000000000))
- + '0 1 0' * (0.502 + 0.498 * sin(time / 2.7182818285 + 2.0943951024))
- + '0 0 1' * (0.502 + 0.498 * sin(time / 2.7182818285 + 4.1887902048));
- else
- return
- '1 0 0' * (0.502 + 0.498 * sin(time / 3.1415926536 + 5.2359877560))
- + '0 1 0' * (0.502 + 0.498 * sin(time / 3.1415926536 + 3.1415926536))
- + '0 0 1' * (0.502 + 0.498 * sin(time / 3.1415926536 + 1.0471975512));
- default: return '0.000 0.000 0.000';
- }
-}
-
// Databases (hash tables)
const float DB_BUCKETS = 8192;
void db_save(float db, string pFilename)
bool fexists(string f);
-vector colormapPaletteColor(float c, float isPants);
-
// unzone the string, and return it as tempstring. Safe to be called on string_null
string fstrunzone(string s);
#include "sv_vehicles.qh"
-#include "../effects/effects.qh"
#if 0
bool vehicle_send(entity to, int sf)
#include "racer_weapon.qc"
#ifdef SVQC
-#include "../../effects/effects.qh"
#include "../../triggers/trigger/impulse.qh"
bool autocvar_g_vehicle_racer;
#include "accumulate.qh"
#include "bits.qh"
#include "bool.qh"
+#include "color.qh"
#include "counting.qh"
#include "cvar.qh"
#include "defer.qh"
--- /dev/null
+#ifndef COLOR_H
+#define COLOR_H
+
+#define colormapPaletteColor(c, isPants) colormapPaletteColor_(c, isPants, time)
+vector colormapPaletteColor_(int c, bool isPants, float t)
+{
+ switch (c) {
+ case 0: return '1.000000 1.000000 1.000000';
+ case 1: return '1.000000 0.333333 0.000000';
+ case 2: return '0.000000 1.000000 0.501961';
+ case 3: return '0.000000 1.000000 0.000000';
+ case 4: return '1.000000 0.000000 0.000000';
+ case 5: return '0.000000 0.666667 1.000000';
+ case 6: return '0.000000 1.000000 1.000000';
+ case 7: return '0.501961 1.000000 0.000000';
+ case 8: return '0.501961 0.000000 1.000000';
+ case 9: return '1.000000 0.000000 1.000000';
+ case 10: return '1.000000 0.000000 0.501961';
+ case 11: return '0.000000 0.000000 1.000000';
+ case 12: return '1.000000 1.000000 0.000000';
+ case 13: return '0.000000 0.333333 1.000000';
+ case 14: return '1.000000 0.666667 0.000000';
+ case 15:
+ if (isPants)
+ return
+ '1 0 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 0.0000000000))
+ + '0 1 0' * (0.502 + 0.498 * sin(t / 2.7182818285 + 2.0943951024))
+ + '0 0 1' * (0.502 + 0.498 * sin(t / 2.7182818285 + 4.1887902048));
+ else
+ return
+ '1 0 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 5.2359877560))
+ + '0 1 0' * (0.502 + 0.498 * sin(t / 3.1415926536 + 3.1415926536))
+ + '0 0 1' * (0.502 + 0.498 * sin(t / 3.1415926536 + 1.0471975512));
+ default: return '0.000 0.000 0.000';
+ }
+}
+
+#endif
#include "miscfunctions.qh"
+#include "../common/effects/all.qh"
#include "../common/models/all.qh"
#include "../common/sounds/all.qh"
#include "../common/constants.qh"
#include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
#include "../common/util.qh"
#include "../common/monsters/all.qh"
#include "../common/buffs/all.qh"
#include "../common/constants.qh"
#include "../common/deathtypes.qh"
-#include "../common/effects/effects.qh"
#include "../common/mapinfo.qh"
#include "../common/monsters/all.qh"
#include "../common/monsters/sv_monsters.qh"
// needs to be done so early because of the constants they create
static_init();
- CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
MapInfo_Enumerate();
// needs to be done so early because of the constants they create
static_init();
- CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
#include "../lib/_all.inc"
+#include "_all.qh"
#include "anticheat.qc"
#include "antilag.qc"
#include "../common/animdecide.qc"
#include "../common/campaign_file.qc"
#include "../common/campaign_setup.qc"
-#include "../common/effects/effects.qc"
#include "../common/effects/effectinfo.qc"
#include "../common/mapinfo.qc"
#include "../common/monsters/spawn.qc"
#include "../common/util.qc"
#include "../common/buffs/all.qc"
+#include "../common/effects/all.qc"
#include "../common/items/all.qc"
#include "../common/monsters/all.qc"
#include "../common/mutators/all.qc"
function check() {
declare -l base="${1}"
- declare -la predefs=("-D${2}" "lib/_all.inc")
+ declare -la predefs=("-D${2}" "lib/_all.inc" "${base}/_all.qh")
find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
echo "$file"
${QCC} "${QCC_FLAGS[@]}" "${NOWARN[@]}" "${FEATURES[@]}" "${predefs[@]}" "$file" >/dev/null