- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- - EXPECT=585cfa6d62ce59f4854bedfce7c51c20
+ - EXPECT=ed9be8d1b1a544f89bcdd7d36876fede
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
project(xonotic-data ASM)
+set(all qc-all)
+add_custom_target(${all})
+
set(checks qc-checks)
add_custom_target(${checks})
)
add_executable(csprogs qcsrc/client/progs.inc)
+add_dependencies(${all} csprogs)
add_dependencies(csprogs ${checks})
target_compile_definitions(csprogs PRIVATE -DGAMEQC -DCSQC)
add_executable(progs qcsrc/server/progs.inc)
+add_dependencies(${all} progs)
add_dependencies(progs ${checks})
target_compile_definitions(progs PRIVATE -DGAMEQC -DSVQC)
add_executable(menu qcsrc/menu/progs.inc)
+add_dependencies(${all} menu)
add_dependencies(menu ${checks})
target_compile_definitions(menu PRIVATE -DMENUQC)
set g_balance_pause_health_rot_spawn 5
set g_balance_health_regenstable 100
set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0.02
set g_balance_pause_armor_rot_spawn 5
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
set g_balance_armor_blockpercent 0.7
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_pause_fuel_rot_spawn 10
set g_balance_fuel_regenstable 50
set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
// }}}
// {{{ misc
set g_balance_pause_health_rot_spawn 5
set g_balance_health_regenstable 100
set g_balance_health_rotstable 200
-set g_balance_health_limit 999
+set g_balance_health_limit 200
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0
set g_balance_pause_armor_rot_spawn 5
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 0
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
set g_balance_armor_blockpercent 0.6
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_pause_fuel_rot_spawn 10
set g_balance_fuel_regenstable 50
set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
// }}}
// {{{ misc
set g_balance_pause_health_rot_spawn 5
set g_balance_health_regenstable 100
set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0.04
set g_balance_pause_armor_rot_spawn 5
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
set g_balance_armor_blockpercent 0.6
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_pause_fuel_rot_spawn 10
set g_balance_fuel_regenstable 50
set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
// }}}
// {{{ misc
set g_balance_pause_health_rot_spawn 5
set g_balance_health_regenstable 100
set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0.02
set g_balance_pause_armor_rot_spawn 5
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
set g_balance_armor_blockpercent 0.7
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_pause_fuel_rot_spawn 10
set g_balance_fuel_regenstable 50
set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
// }}}
// {{{ misc
set g_balance_pause_health_rot_spawn 5
set g_balance_health_regenstable 100
set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0.02
set g_balance_pause_armor_rot_spawn 5
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
set g_balance_armor_blockpercent 0.7
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_pause_fuel_rot_spawn 10
set g_balance_fuel_regenstable 50
set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
// }}}
// {{{ misc
set g_balance_pause_health_rot_spawn 5
set g_balance_health_regenstable 100
set g_balance_health_rotstable 100
-set g_balance_health_limit 999
+set g_balance_health_limit 200
set g_balance_armor_regen 0
set g_balance_armor_regenlinear 0
set g_balance_armor_rot 0.02
set g_balance_pause_armor_rot_spawn 5
set g_balance_armor_regenstable 100
set g_balance_armor_rotstable 100
-set g_balance_armor_limit 999
+set g_balance_armor_limit 200
set g_balance_armor_blockpercent 0.7
set g_balance_fuel_regen 0.1 "fuel regeneration (only applies if the player owns IT_FUEL_REGEN)"
set g_balance_fuel_regenlinear 0
set g_balance_pause_fuel_rot_spawn 10
set g_balance_fuel_regenstable 50
set g_balance_fuel_rotstable 100
-set g_balance_fuel_limit 999
+set g_balance_fuel_limit 100
// }}}
// {{{ misc
alias namemob "editmob name ${* ?}"
alias movemob "editmob movetarget ${* ?}"
alias butcher "editmob butcher ${* ?}"
+alias mobbutcher "editmob butcher ${* ?}"
// ============================================================
alias gotomap "qc_cmd_sv gotomap ${* ?}" // Simple command to switch to another map
alias lockteams "qc_cmd_sv lockteams ${* ?}" // Disable the ability for players to switch or enter teams
alias make_mapinfo "qc_cmd_sv make_mapinfo ${* ?}" // Automatically rebuild mapinfo files
-alias mobbutcher "qc_cmd_sv mobbutcher ${* ?}" // Remove all monsters on the map
alias moveplayer "qc_cmd_sv moveplayer ${* ?}" // Change the team/status of a player
alias nospectators "qc_cmd_sv nospectators ${* ?}" // Automatically remove spectators from a match
alias playerdemo "qc_cmd_sv playerdemo ${* ?}" // Control the ability to save demos of players
_cl_color "112.211" // same effect as 112, but menuqc can detect this as the default and not intentionally set
_cl_name ""
seta _cl_gender 0 "storage cvar for current player gender (0 = undisclosed, 1 = male, 2 = female)"
-_cl_playermodel models/player/erebus.iqm
_cl_playerskin 0
seta cl_reticle 1 "enable zoom reticles"
r_shadow_realtime_world_importlightentitiesfrommap 0 // Whether build process uses keepLights is nontransparent and may change, so better make keepLights not matter.
cl_decals_fadetime 5
cl_decals_time 1
-seta cl_gunalign 3 "Gun alignment; 1 = center (if allowed by g_shootfromclient) or right, 2 = center (if allowed by g_shootfromclient) or left, 3 = right only, 4 = left only"
+seta cl_gunalign 3 "Gun alignment; 1 = center, 3 = right, 4 = left; requires reconnect"
seta cl_nogibs 0 "reduce number of violence effects, or remove them totally"
seta cl_particlegibs 0 "simpler gibs"
seta cl_gibs_damageforcescale 3.5 "force to push around gibs"
// general gameplay
set g_overkill 1
+
+// hack - eventually, we should be able to choose overkill models in menu like for vanilla
+set sv_defaultcharacter 1
+set sv_defaultplayermodel "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
+set sv_defaultplayermodel_red "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm"
+set sv_defaultplayermodel_blue "models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
+set sv_defaultplayermodel_yellow "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm"
+set sv_defaultplayermodel_pink "models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
+
set g_respawn_ghosts 0
set g_nades 1
set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
+set g_pickup_respawntime_scaling_reciprocal 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*"
+set g_pickup_respawntime_scaling_offset 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening"
+set g_pickup_respawntime_scaling_linear 1 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly"
set g_weaponarena "0" "put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\""
set g_weaponarena_random "0" "if set to a number, only that weapon count is given on every spawn (randomly)"
set g_weaponarena_random_with_blaster "1" "additionally, always provide the blaster in random weapon arena games"
set ekg 0 "Throw huge amounts of gibs"
+_cl_playermodel "models/player/erebus.iqm"
+
locs_enable 0
pausable 0
set samelevel 0 "when 1, always play the same level over and over again"
set g_ctf_throw 1 "throwing allows circumventing carrierkill score, so enable this with care!"
set g_ctf_throw_angle_max 90 "maximum upwards angle you can throw the flag"
set g_ctf_throw_angle_min -90 "minimum downwards angle you can throw the flag"
-set g_ctf_throw_punish_count 2
+set g_ctf_throw_punish_count 3
set g_ctf_throw_punish_delay 30
-set g_ctf_throw_punish_time 5
+set g_ctf_throw_punish_time 10
set g_ctf_throw_strengthmultiplier 2 "multiplier for velocity when you have the strength... essentially, throw the flag REALLY hard when you have the strength :D"
set g_ctf_throw_velocity_forward 500 "how fast or far a player can throw the flag"
set g_ctf_throw_velocity_up 200 "upwards velocity added upon initial throw"
set g_invasion_spawnpoint_spawn_delay 0.5
set g_invasion_teams 0 "number of teams in invasion (note: use mapinfo to set this)"
set g_invasion_team_spawns 1 "use team spawns in teamplay invasion mode"
+set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: complete the stage (note: use mapinfo to set this)"
// =======
set g_nades 0 "enable off-hand grenades"
set g_nades_spread 0.04 "random spread offset of throw direction"
-set g_nades_throw_offset "0 0 0" "nade throwing offset"
+set g_nades_throw_offset "0 -25 0" "nade throwing offset"
set g_nades_spawn 1 "give nades right away when player spawns rather than delaying entire refire"
set g_nades_client_select 0 "allow client side selection of nade type"
set g_nades_pickup 0 "allow picking up thrown nades (not your own)"
BUILD_MOD ?=
ifndef ZIP
- ifneq ($(shell which zip),)
+ ifneq ($(shell which zip 2>/dev/null),)
ZIP := zip -9
endif
- ifneq ($(shell which 7z),)
+ ifneq ($(shell which 7z 2>/dev/null),)
ZIP := 7z a -tzip -mx=9
endif
- ifneq ($(shell which 7za),)
+ ifneq ($(shell which 7za 2>/dev/null),)
ZIP := 7za a -tzip -mx=9
endif
ifndef ZIP
- $(warning "No zip in ($(PATH))")
+ $(warning "No zip / 7z / 7za in ($(PATH))")
ZIP := : zip_not_found
endif
endif
e.bgmscriptline = e.bgmscriptline0 = i;
if(i >= bgmscriptbufsize)
{
- LOG_INFOF("ERROR: bgmscript does not define %s\n", e.bgmscript);
+ LOG_INFOF("ERROR: bgmscript does not define %s", e.bgmscript);
strunzone(e.bgmscript);
e.bgmscript = string_null;
}
blurtest_time1 = time + stof(argv(1));
blurtest_radius = stof(argv(2));
blurtest_power = stof(argv(3));
- LOG_INFO("Enabled blurtest\n");
+ LOG_INFO("Enabled blurtest");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
- LOG_INFO(" No arguments required.\n");
+ LOG_INFO("Usage:^3 cl_cmd blurtest");
+ LOG_INFO(" No arguments required.");
return;
}
}
#else
if (request)
{
- LOG_INFO("Blurtest is not enabled on this client.\n");
+ LOG_INFO("Blurtest is not enabled on this client.");
return;
}
#endif
default:
{
- LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
+ LOG_INFO("Incorrect parameters for ^2boxparticles^7");
}
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");
+ LOG_INFO(
+ "Usage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n"
+ " 'effectname' is the name of a particle effect in effectinfo.txt\n"
+ " 'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n"
+ " 'org_from' is the starting origin of the box\n"
+ " 'org_to' is the ending origin of the box\n"
+ " 'dir_from' is the minimum velocity\n"
+ " 'dir_to' is the maximum velocity\n"
+ " 'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n"
+ " 'flags' can contain:\n"
+ " 1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n"
+ " 2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n"
+ " 4 to respect globals particles_fade (set right before via prvm_globalset client)\n"
+ " 128 to draw a trail, not a box\n"
+ );
return;
}
}
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/", path, MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+ LOG_INFO("Completed screenshot entity dump in ^2data/data/", path, MapInfo_Map_bspname, "_scrshot_ent.txt^7.");
fclose(fh);
}
else
{
- LOG_INFO("^1Error: ^7Could not dump to file!\n");
+ LOG_INFO("^1Error: ^7Could not dump to file!");
}
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent [path]\n");
- LOG_INFO(" Where 'path' can be the subdirectory of data/data in which the file is saved.\n");
+ LOG_INFO("Usage:^3 cl_cmd create_scrshot_ent [path]");
+ LOG_INFO(" Where 'path' can be the subdirectory of data/data in which the file is saved.");
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");
+ LOG_INFO("Usage:^3 cl_cmd debugmodel model");
+ LOG_INFO(" Where 'model' is a string of the model name to use for the debug model.");
return;
}
}
default:
{
- LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
+ LOG_INFO("Incorrect parameters for ^2handlevote^7");
}
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");
+ LOG_INFO("Usage:^3 cl_cmd handlevote vote");
+ LOG_INFO(" Where 'vote' is the selection for either the current poll or uid2name.");
return;
}
}
{
if (argv(2) == "help")
{
- LOG_INFO(" quickmenu [[default | file | \"\"] submenu file]\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("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.\n");
- LOG_INFO("A file name can also be given to open a different quickmenu\n");
+ LOG_INFO(" quickmenu [[default | file | \"\"] submenu file]");
+ 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.");
+ LOG_INFO("A submenu name can be given to open the quickmenu directly in a submenu; it requires to specify 'default', 'file' or '\"\"' option.");
+ LOG_INFO("A file name can also be given to open a different quickmenu");
return;
}
string file = ((argv(4) == "") ? autocvar_hud_panel_quickmenu_file : argv(4));
default:
{
- LOG_INFO("Incorrect parameters for ^2hud^7\n");
+ LOG_INFO("Incorrect parameters for ^2hud^7");
}
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(" Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+ LOG_INFO("Usage:^3 cl_cmd hud action [configname | radartoggle | layout]");
+ LOG_INFO(" Where 'action' is the command to complete,");
+ LOG_INFO(" 'configname' is the name to save to for \"save\" action,");
+ LOG_INFO(" 'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,");
+ LOG_INFO(" and 'layout' is how to organize the scoreboard columns for the set action.");
+ LOG_INFO(" Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"");
return;
}
}
default:
{
- LOG_INFO("Incorrect parameters for ^2localprint^7\n");
+ LOG_INFO("Incorrect parameters for ^2localprint^7");
}
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");
+ LOG_INFO("Usage:^3 cl_cmd localprint \"message\"");
+ LOG_INFO(" 'message' is the centerprint message to send to yourself.");
return;
}
}
default:
{
- LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
+ LOG_INFO("Incorrect parameters for ^2mv_download^7");
}
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");
+ LOG_INFO("Usage:^3 cl_cmd mv_download mapid");
+ LOG_INFO(" Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.");
return;
}
}
default:
{
- LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
+ LOG_INFO("Incorrect parameters for ^2sendcvar^7");
}
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");
+ LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>");
+ LOG_INFO(" Where 'cvar' is the cvar plus arguments to send to the server.");
return;
}
}
void LocalCommand_macro_help()
{
- FOREACH(CLIENT_COMMANDS, true, LOG_INFOF(" ^2%s^7: %s\n", it.m_name, it.m_description));
+ FOREACH(CLIENT_COMMANDS, true, LOG_INFOF(" ^2%s^7: %s", it.m_name, it.m_description));
}
bool LocalCommand_macro_command(int argc, string command)
{
if (argc == 1)
{
- LOG_INFO("\nClient console commands:\n");
+ LOG_INFO("Client console commands:");
LocalCommand_macro_help();
- LOG_INFO("\nGeneric commands shared by all programs:\n");
+ LOG_INFO("\nGeneric commands shared by all programs:");
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");
+ LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.");
+ LOG_INFO("For help about a specific command, type cl_cmd help COMMAND");
return;
}
) 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");
+ LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.");
}
this.forceplayermodels_isgoodmodel = fexists(this.forceplayermodels_savemodel);
this.forceplayermodels_isgoodmodel_mdl = this.forceplayermodels_savemodel;
if(!this.forceplayermodels_isgoodmodel)
- LOG_INFOF("Warning: missing model %s has been used\n", this.forceplayermodels_savemodel);
+ LOG_INFOF("Warning: missing model %s has been used", this.forceplayermodels_savemodel);
}
}
void CSQCPlayer_ModelAppearance_Apply(entity this, bool islocalplayer)
float nb_pb_period;
// Spectating
+// -1 - observing
+// 0 - playing
+// >0 - id of spectated player
float spectatee_status;
// short mapname
HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
- LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
+ LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)"), filename);
fclose(fh);
}
else
- LOG_INFOF(_("^1Couldn't write to %s\n"), filename);
+ LOG_INFOF(_("^1Couldn't write to %s"), filename);
}
void HUD_Configure_Exit_Force()
if(mode == "file")
{
if(file == "" || file == "0")
- LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu\n");
+ LOG_INFO("No file name is set in hud_panel_quickmenu_file, loading default quickmenu");
else
{
fh = fopen(file, FILE_READ);
if(fh < 0)
- LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu\n", file);
+ LOG_INFOF("Couldn't open file \"%s\", loading default quickmenu", file);
}
if(fh < 0)
mode = "default";
//float lastpnum;
void Scoreboard_UpdatePlayerTeams()
{
- float Team;
entity pl, tmp;
//int num = 0;
for(pl = players.sort_next; pl; pl = pl.sort_next)
{
//num += 1;
- Team = entcs_GetScoreTeam(pl.sv_entnum);
+ int Team = entcs_GetScoreTeam(pl.sv_entnum);
if(SetTeam(pl, Team))
{
tmp = pl.sort_prev;
void Cmd_Scoreboard_Help()
{
- LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
- LOG_INFO(_("^3|---------------------------------------------------------------|\n"));
- LOG_INFO(_("Usage:\n"));
- LOG_INFO(_("^2scoreboard_columns_set default\n"));
- LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
- LOG_INFO(_("The following field names are recognized (case insensitive):\n"));
- LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields.\n"));
- LOG_INFO("\n");
-
- LOG_INFO(_("^3name^7 or ^3nick^7 Name of a player\n"));
- LOG_INFO(_("^3ping^7 Ping time\n"));
- LOG_INFO(_("^3pl^7 Packet loss\n"));
- LOG_INFO(_("^3elo^7 Player ELO\n"));
- LOG_INFO(_("^3kills^7 Number of kills\n"));
- LOG_INFO(_("^3deaths^7 Number of deaths\n"));
- LOG_INFO(_("^3suicides^7 Number of suicides\n"));
- LOG_INFO(_("^3frags^7 kills - suicides\n"));
- LOG_INFO(_("^3kd^7 The kill-death ratio\n"));
- LOG_INFO(_("^3dmg^7 The total damage done\n"));
- LOG_INFO(_("^3dmgtaken^7 The total damage taken\n"));
- LOG_INFO(_("^3sum^7 frags - deaths\n"));
- LOG_INFO(_("^3caps^7 How often a flag (CTF) or a key (KeyHunt) was captured\n"));
- LOG_INFO(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
- LOG_INFO(_("^3captime^7 Time of fastest cap (CTF)\n"));
- LOG_INFO(_("^3fckills^7 Number of flag carrier kills\n"));
- LOG_INFO(_("^3returns^7 Number of flag returns\n"));
- LOG_INFO(_("^3drops^7 Number of flag drops\n"));
- LOG_INFO(_("^3lives^7 Number of lives (LMS)\n"));
- LOG_INFO(_("^3rank^7 Player rank\n"));
- LOG_INFO(_("^3pushes^7 Number of players pushed into void\n"));
- LOG_INFO(_("^3destroyed^7 Number of keys destroyed by pushing them into void\n"));
- LOG_INFO(_("^3kckills^7 Number of keys carrier kills\n"));
- LOG_INFO(_("^3losses^7 Number of times a key was lost\n"));
- LOG_INFO(_("^3laps^7 Number of laps finished (race/cts)\n"));
- LOG_INFO(_("^3time^7 Total time raced (race/cts)\n"));
- LOG_INFO(_("^3fastest^7 Time of fastest lap (race/cts)\n"));
- LOG_INFO(_("^3ticks^7 Number of ticks (DOM)\n"));
- LOG_INFO(_("^3takes^7 Number of domination points taken (DOM)\n"));
- LOG_INFO(_("^3bckills^7 Number of ball carrier kills\n"));
- LOG_INFO(_("^3bctime^7 Total amount of time holding the ball in Keepaway\n"));
- LOG_INFO(_("^3score^7 Total score\n"));
- LOG_INFO("\n");
+ LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command."));
+ LOG_INFO(_("^3|---------------------------------------------------------------|"));
+ LOG_INFO(_("Usage:"));
+ LOG_INFO(_("^2scoreboard_columns_set default"));
+ LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ..."));
+ LOG_INFO(_("The following field names are recognized (case insensitive):"));
+ LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields."));
+ LOG_INFO("");
+
+ LOG_INFO(_("^3name^7 or ^3nick^7 Name of a player"));
+ LOG_INFO(_("^3ping^7 Ping time"));
+ LOG_INFO(_("^3pl^7 Packet loss"));
+ LOG_INFO(_("^3elo^7 Player ELO"));
+ LOG_INFO(_("^3kills^7 Number of kills"));
+ LOG_INFO(_("^3deaths^7 Number of deaths"));
+ LOG_INFO(_("^3suicides^7 Number of suicides"));
+ LOG_INFO(_("^3frags^7 kills - suicides"));
+ LOG_INFO(_("^3kd^7 The kill-death ratio"));
+ LOG_INFO(_("^3dmg^7 The total damage done"));
+ LOG_INFO(_("^3dmgtaken^7 The total damage taken"));
+ LOG_INFO(_("^3sum^7 frags - deaths"));
+ LOG_INFO(_("^3caps^7 How often a flag (CTF) or a key (KeyHunt) was captured"));
+ LOG_INFO(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up"));
+ LOG_INFO(_("^3captime^7 Time of fastest cap (CTF)"));
+ LOG_INFO(_("^3fckills^7 Number of flag carrier kills"));
+ LOG_INFO(_("^3returns^7 Number of flag returns"));
+ LOG_INFO(_("^3drops^7 Number of flag drops"));
+ LOG_INFO(_("^3lives^7 Number of lives (LMS)"));
+ LOG_INFO(_("^3rank^7 Player rank"));
+ LOG_INFO(_("^3pushes^7 Number of players pushed into void"));
+ LOG_INFO(_("^3destroyed^7 Number of keys destroyed by pushing them into void"));
+ LOG_INFO(_("^3kckills^7 Number of keys carrier kills"));
+ LOG_INFO(_("^3losses^7 Number of times a key was lost"));
+ LOG_INFO(_("^3laps^7 Number of laps finished (race/cts)"));
+ LOG_INFO(_("^3time^7 Total time raced (race/cts)"));
+ LOG_INFO(_("^3fastest^7 Time of fastest lap (race/cts)"));
+ LOG_INFO(_("^3ticks^7 Number of ticks (DOM)"));
+ LOG_INFO(_("^3takes^7 Number of domination points taken (DOM)"));
+ LOG_INFO(_("^3bckills^7 Number of ball carrier kills"));
+ LOG_INFO(_("^3bctime^7 Total amount of time holding the ball in Keepaway"));
+ LOG_INFO(_("^3score^7 Total score"));
+ LOG_INFO("");
LOG_INFO(_("Before a field you can put a + or - sign, then a comma separated list\n"
"of game types, then a slash, to make the field show up only in these\n"
LOG_INFO(_("The special game type names 'teams' and 'noteams' can be used to\n"
"include/exclude ALL teams/noteams game modes.\n\n"));
- LOG_INFO(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
- LOG_INFO(_("will display name, ping and pl aligned to the left, and the fields\n"
+ LOG_INFO(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4"));
+ LOG_INFO(_("will display name, ping and pl aligned to the left, and the fields"
"right of the vertical bar aligned to the right.\n"));
- LOG_INFO(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
- "other gamemodes except DM.\n"));
+ LOG_INFO(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\nother gamemodes except DM.\n"));
}
// NOTE: adding a gametype with ? to not warn for an optional field
else
{
if(!nocomplain)
- LOG_INFOF("^1Error:^7 Unknown score field: '%s'\n", str);
+ LOG_INFOF("^1Error:^7 Unknown score field: '%s'", str);
continue;
}
LABEL(found)
sbt_field_title[0] = strzone(TranslateScoresLabel("name"));
sbt_field[0] = SP_NAME;
++sbt_num_fields;
- LOG_INFO("fixed missing field 'name'\n");
+ LOG_INFO("fixed missing field 'name'");
if(!have_separator)
{
sbt_field[1] = SP_SEPARATOR;
sbt_field_size[1] = stringwidth("|", false, hud_fontsize);
++sbt_num_fields;
- LOG_INFO("fixed missing field '|'\n");
+ LOG_INFO("fixed missing field '|'");
}
}
else if(!have_separator)
sbt_field_size[sbt_num_fields] = stringwidth("|", false, hud_fontsize);
sbt_field[sbt_num_fields] = SP_SEPARATOR;
++sbt_num_fields;
- LOG_INFO("fixed missing field '|'\n");
+ LOG_INFO("fixed missing field '|'");
}
if(!have_secondary)
{
sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize);
sbt_field[sbt_num_fields] = ps_secondary;
++sbt_num_fields;
- LOG_INFOF("fixed missing field '%s'\n", scores_label(ps_secondary));
+ LOG_INFOF("fixed missing field '%s'", scores_label(ps_secondary));
}
if(!have_primary)
{
sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize);
sbt_field[sbt_num_fields] = ps_primary;
++sbt_num_fields;
- LOG_INFOF("fixed missing field '%s'\n", scores_label(ps_primary));
+ LOG_INFOF("fixed missing field '%s'", scores_label(ps_primary));
}
}
{
vote_yescount = 0;
vote_nocount = 0;
- LOG_INFO(_("^1You must answer before entering hud configure mode\n"));
+ LOG_INFO(_("^1You must answer before entering hud configure mode"));
cvar_set("_hud_configure", "0");
}
if(vote_called_vote)
#include "main.qh"
+#include "defs.qh"
+#include <common/ent_cs.qh>
#include "miscfunctions.qh"
#include <common/effects/effect.qh>
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
#include <common/effects/all.qh>
#include <common/effects/all.inc>
#include "hud/_mod.qh"
prvm_language = strzone(cvar_string("prvm_language"));
#ifdef WATERMARK
- LOG_INFOF("^4CSQC Build information: ^1%s\n", WATERMARK);
+ LOG_INFOF("^4CSQC Build information: ^1%s", WATERMARK);
#endif
{
GetTeam(NUM_SPECTATOR, true); // add specs first
+ for (int w = 0; w <= WEP_LAST - WEP_FIRST; ++w)
+ weapon_accuracy[w] = -1;
+
// precaches
if(autocvar_cl_reticle)
if(!isNew && n != this.sv_entnum)
{
//print("A CSQC entity changed its owner!\n");
- LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", etof(this), this.classname);
+ LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)", etof(this), this.classname);
isNew = true;
Ent_Remove(this);
}
int f = ReadByte();
- scoreboard_showscores_force = (f & 1);
+ scoreboard_showscores_force = (f & BIT(0));
- if(f & 2)
+ if(f & BIT(1))
{
newspectatee_status = ReadByte();
if(newspectatee_status == player_localnum + 1)
else
newspectatee_status = 0;
- spectatorbutton_zoom = (f & 4);
+ spectatorbutton_zoom = (f & BIT(2));
- if(f & 16)
+ if(f & BIT(4))
{
num_spectators = ReadByte();
{
if (t != this.enttype || isnew)
{
- LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", etof(this), this.entnum, this.enttype, t);
+ LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)", etof(this), this.entnum, this.enttype, t);
Ent_Remove(this);
clearentity(this);
isnew = true;
{
if (!isnew)
{
- LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", etof(this), this.entnum, t);
+ LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)", etof(this), this.entnum, t);
isnew = true;
}
}
FOREACH(LinkedEntities, it.m_id == t, {
if (isnew) this.classname = it.netname;
if (autocvar_developer_csqcentities)
- LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)\n", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
+ LOG_INFOF("CSQC_Ent_Update(%d) at %f with this=%i {.entnum=%d, .enttype=%d} t=%s (%d)", isnew, savetime, this, this.entnum, this.enttype, this.classname, t);
done = it.m_read(this, NULL, isnew);
MUTATOR_CALLHOOK(Ent_Update, this, isnew);
break;
// CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(this) as well.
void CSQC_Ent_Remove(entity this)
{
- if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}\n", this, this.entnum, this.enttype);
+ if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Ent_Remove() with this=%i {.entnum=%d, .enttype=%d}", this, this.entnum, this.enttype);
if (wasfreed(this))
{
LOG_WARN("CSQC_Ent_Remove called for already removed entity. Packet loss?");
// CSQC_Parse_StuffCmd : Provides the stuffcmd string in the first parameter that the server provided. To execute standard behavior, simply execute localcmd with the string.
void CSQC_Parse_StuffCmd(string strMessage)
{
- if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
+ if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")", strMessage);
localcmd(strMessage);
}
// CSQC_Parse_Print : Provides the print string in the first parameter that the server provided. To execute standard behavior, simply execute print with the string.
void CSQC_Parse_Print(string strMessage)
{
- if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_Print(\"%s\")\n", strMessage);
+ if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_Print(\"%s\")", strMessage);
print(ColorTranslateRGB(strMessage));
}
// CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided.
void CSQC_Parse_CenterPrint(string strMessage)
{
- if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
+ if (autocvar_developer_csqcentities) LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")", strMessage);
centerprint_hud(strMessage);
}
FOREACH(TempEntities, it.m_id == nTEID, {
if (autocvar_developer_csqcentities)
- LOG_INFOF("CSQC_Parse_TempEntity() nTEID=%s (%d)\n", it.netname, nTEID);
+ LOG_INFOF("CSQC_Parse_TempEntity() nTEID=%s (%d)", it.netname, nTEID);
return it.m_read(NULL, NULL, true);
});
if (autocvar_developer_csqcentities)
- LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
+ LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d", nTEID);
// No special logic for this temporary entity; return 0 so the engine can handle it
return false;
if(argc != 2 || !mv_pk3list)
{
- LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
+ LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!"));
return;
}
break;
if(!pak || pak.sv_entnum != id) {
- LOG_INFO(_("^1Error:^7 Couldn't find pak index.\n"));
+ LOG_INFO(_("^1Error:^7 Couldn't find pak index."));
return;
}
mv_preview[id] = true;
return;
} else {
- LOG_INFO(_("Requesting preview...\n"));
+ LOG_INFO(_("Requesting preview..."));
localcmd(strcat("\ncmd mv_getpicture ", ftos(id), "\n"));
}
}
}
else
{
- LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
+ LOG_INFOF("Received HTTP request data for an invalid id %d.", id);
}
}
if(acc_levels > MAX_ACCURACY_LEVELS)
acc_levels = MAX_ACCURACY_LEVELS;
if(acc_levels < 2)
- LOG_INFO("Warning: accuracy_color_levels must contain at least 2 values\n");
+ LOG_INFO("Warning: accuracy_color_levels must contain at least 2 values");
int i;
for(i = 0; i < acc_levels; ++i)
#include "player_skeleton.qh"
#include <common/physics/movetypes/movetypes.qh>
+#include <common/physics/player.qh>
#include "mutators/events.qh"
#include "../lib/csqcmodel/cl_player.qh"
#include "../lib/warpzone/anglestransform.qh"
-.vector v_angle;
.float v_angle_save_x;
class(Skeleton) .float skeleton_info_modelindex;
#include <client/_mod.inc>
#include <common/_all.inc>
-#include <common/effects/qc/all.qc>
+#include <common/effects/qc/_mod.inc>
#include <lib/csqcmodel/cl_model.qc>
#include <lib/csqcmodel/cl_player.qc>
ov_enabled = true;
#if 0
- LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
+ LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f",
vtos(ov_org),
vtos(getpropertyvec(VF_ANGLES)),
ov_distance,
#include "items/_mod.inc"
#include "weapons/_all.inc"
#include "monsters/_mod.inc"
- #include "turrets/all.qc"
- #include "vehicles/all.qc"
+ #include "turrets/_mod.inc"
+ #include "vehicles/_mod.inc"
#include "mutators/_mod.inc"
#include "gamemodes/_mod.inc"
}
default:
- LOG_INFO("Incorrect parameters for ^2addtolist^7\n");
+ LOG_INFO("Incorrect parameters for ^2addtolist^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
- LOG_INFO(" Where 'variable' is what to add 'value' to.\n");
- LOG_INFO("See also: ^2removefromlist^7\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " addtolist variable value");
+ LOG_INFO(" Where 'variable' is what to add 'value' to.");
+ LOG_INFO("See also: ^2removefromlist^7");
return;
}
}
curl_uri_get_pos = (curl_uri_get_pos + 1) % (URI_GET_CURL_END - URI_GET_CURL + 1);
}
else
- LOG_INFO(_("error creating curl handle\n"));
+ LOG_INFO(_("error creating curl handle"));
buf_del(buf);
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]");
return;
}
}
CMD_Write("\ndump of generic commands:\n");
GenericCommand_macro_write_aliases(fh);
- LOG_INFO("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
+ LOG_INFO("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.");
fclose(fh);
}
else
{
- LOG_INFO("^1Error: ^7Could not dump to file!\n");
+ LOG_INFO("^1Error: ^7Could not dump to file!");
}
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
- LOG_INFO(" No arguments required.\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpcommands");
+ LOG_INFO(" No arguments required.");
return;
}
}
{
if (!fexists(strcat("maps/", argv(2), ".bsp")))
{
- LOG_INFO("maplist: ERROR: ", argv(2), " does not exist!\n");
+ LOG_INFO("maplist: ERROR: ", argv(2), " does not exist!");
break;
}
}
default:
- LOG_INFO("Incorrect parameters for ^2maplist^7\n");
+ LOG_INFO("Incorrect parameters for ^2maplist^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
- LOG_INFO(" Where 'action' is the command to complete,\n");
- LOG_INFO(" and 'map' is what it acts upon (if required).\n");
- LOG_INFO(" Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " maplist action [map]");
+ LOG_INFO(" Where 'action' is the command to complete,");
+ LOG_INFO(" and 'map' is what it acts upon (if required).");
+ LOG_INFO(" Full list of commands here: \"add, cleanup, remove, shuffle.\"");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
- LOG_INFO(" Where command will be executed next frame of this VM\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " nextframe command...");
+ LOG_INFO(" Where command will be executed next frame of this VM");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2removefromlist^7\n");
+ LOG_INFO("Incorrect parameters for ^2removefromlist^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
- LOG_INFO(" Where 'variable' is what cvar to remove 'value' from.\n");
- LOG_INFO("See also: ^2addtolist^7\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value");
+ LOG_INFO(" Where 'variable' is what cvar to remove 'value' from.");
+ LOG_INFO("See also: ^2addtolist^7");
return;
}
}
int NOTIF_MULTI_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_MULTI, { ++NOTIF_MULTI_COUNT; });
int NOTIF_CHOICE_COUNT = 0; FOREACH(Notifications, it.nent_type == MSG_CHOICE, { ++NOTIF_CHOICE_COUNT; });
LOG_INFOF(
- strcat(
- "Restart_Notifications(): Restarting %d notifications... ",
- "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n"
- ),
+ (
+ "Restart_Notifications(): Restarting %d notifications... "
+ "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d"
+ ),
(
NOTIF_ANNCE_COUNT +
NOTIF_INFO_COUNT +
Destroy_All_Notifications();
CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
#else
- LOG_INFO(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
+ LOG_INFO(_("Notification restart command only works with cl_cmd and sv_cmd."));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
- LOG_INFO(" No arguments required.\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " restartnotifs");
+ LOG_INFO(" No arguments required.");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2settemp^7\n");
+ LOG_INFO("Incorrect parameters for ^2settemp^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
- LOG_INFO(" Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
- LOG_INFO("See also: ^2settemp_restore^7\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"");
+ LOG_INFO(" Where 'cvar' is the cvar you want to temporarily set with 'arguments'.");
+ LOG_INFO("See also: ^2settemp_restore^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2settemp^7\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " settemp_restore");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2settemp^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " [function to run]");
return;
}
}
void GenericCommand_macro_help()
{
- FOREACH(GENERIC_COMMANDS, true, LOG_INFOF(" ^2%s^7: %s\n", it.m_name, it.m_description));
+ FOREACH(GENERIC_COMMANDS, true, LOG_INFOF(" ^2%s^7: %s", it.m_name, it.m_description));
}
float GenericCommand_macro_command(float argc, string command)
--rpn_sp;
return rpn_stack[rpn_sp];
} else {
- LOG_INFO("rpn: stack underflow\n");
+ LOG_INFO("rpn: stack underflow");
rpn_error = true;
return "";
}
rpn_stack[rpn_sp] = s;
++rpn_sp;
} else {
- LOG_INFO("rpn: stack overflow\n");
+ LOG_INFO("rpn: stack overflow");
rpn_error = true;
}
}
if(rpn_sp > 0) {
return rpn_stack[rpn_sp - 1];
} else {
- LOG_INFO("rpn: empty stack\n");
+ LOG_INFO("rpn: empty stack");
rpn_error = true;
return "";
}
if(rpn_sp > 0) {
rpn_stack[rpn_sp - 1] = s;
} else {
- LOG_INFO("rpn: empty stack\n");
+ LOG_INFO("rpn: empty stack");
rpn_error = true;
}
}
}
else
{
- LOG_INFO("rpn: empty cvar name for 'def'\n");
+ LOG_INFO("rpn: empty cvar name for 'def'");
rpn_error = true;
}
} else if(rpncmd == "defs" || rpncmd == "@") {
}
else
{
- LOG_INFO("rpn: empty cvar name for 'defs'\n");
+ LOG_INFO("rpn: empty cvar name for 'defs'");
rpn_error = true;
}
} else if(rpncmd == "load") {
db_put(rpn_db, "stack.pos", ftos(i-2));
} else {
rpn_error = 1;
- LOG_INFO("rpn: database underflow\n");
+ LOG_INFO("rpn: database underflow");
}
} else if(rpncmd == "dbget") {
rpn_push(db_get(rpn_db, strcat("stack.", ftos(i-1))));
} else {
rpn_error = 1;
- LOG_INFO("rpn: database empty\n");
+ LOG_INFO("rpn: database empty");
}
} else if(rpncmd == "dblen") {
rpn_push(db_get(rpn_db, "stack.pointer"));
if(!j)
{
rpn_error = true;
- LOG_INFO("rpn: empty database\n");
+ LOG_INFO("rpn: empty database");
} else {
--j;
rpn_push(db_get(rpn_db, strcat("stack.", ftos(i))));
rpn_push(db_get(rpn_db, strcat("stack.", s)));
} else {
rpn_error = 1;
- LOG_INFO("rpn: empty database\n");
+ LOG_INFO("rpn: empty database");
}
} else if(rpncmd == "dbat") {
rpn_push(db_get(rpn_db, "stack.pos"));
{
if(i < 0 || i >= j)
{
- LOG_INFO("rpn: database cursor out of bounds\n");
+ LOG_INFO("rpn: database cursor out of bounds");
rpn_error = true;
}
if(!rpn_error)
if(!j)
{
rpn_error = true;
- LOG_INFO("rpn: empty database, cannot move cursor\n");
+ LOG_INFO("rpn: empty database, cannot move cursor");
}
if(!rpn_error)
{
j = stof(db_get(rpn_db, "stack.pointer"));
if(i < 0 || i >= j)
{
- LOG_INFO("rpn: database cursor destination out of bounds\n");
+ LOG_INFO("rpn: database cursor destination out of bounds");
rpn_error = true;
}
if(!rpn_error)
{
if (!fexists(s))
{
- LOG_INFO("rpn: ERROR: ", s, " does not exist!\n");
+ LOG_INFO("rpn: ERROR: ", s, " does not exist!");
rpn_error = true;
}
}
while(rpn_sp > 0)
{
s = rpn_pop();
- LOG_INFO("rpn: still on stack: ", s, "\n");
+ LOG_INFO("rpn: still on stack: ", s);
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
- LOG_INFO(" Operator description (x: string, s: set, f: float):\n");
- LOG_INFO(" x pop -----------------------------> : removes the top\n");
- LOG_INFO(" x dup -----------------------------> x x : duplicates the top\n");
- LOG_INFO(" x x exch --------------------------> x x : swap the top two\n");
- LOG_INFO(" /cvarname load --------------------> x : loads a cvar\n");
- LOG_INFO(" /cvarname x def -------------------> : writes to a cvar\n");
- LOG_INFO(" f f add|sub|mul|div|mod|pow -------> f : adds/... two numbers\n");
- LOG_INFO(" f f and|or|xor|bitand|bitor|bitxor > f : logical and bitwise operations\n");
- LOG_INFO(" f f eq|ne|gt|ge|lt|le|max|min -----> f : compares two numbers\n");
- LOG_INFO(" f neg|abs|sgn|rand|floor|ceil------> f : negates/... a number\n");
- LOG_INFO(" f not|bitnot ----------------------> f : logical and bitwise negation\n");
- LOG_INFO(" f exp|log|sin|cos -----------------> f : exponential function & Co.\n");
- LOG_INFO(" f f f bound -----------------------> f : bounds the middle number\n");
- LOG_INFO(" f1 f2 b when ----------------------> f : f1 if b, f2 otherwise\n");
- LOG_INFO(" s s union|intersection|difference -> s : set operations\n");
- LOG_INFO(" s shuffle -------------------------> s : randomly arrange elements\n");
- LOG_INFO(" /key /value put -------------------> : set a database key\n");
- LOG_INFO(" /key get --------------------------> s : get a database value\n");
- LOG_INFO(" x dbpush --------------------------> : pushes the top onto the database\n");
- LOG_INFO(" dbpop|dbget -----------------------> x : removes/reads DB's top\n");
- LOG_INFO(" dblen|dbat ------------------------> f : gets the DB's size/cursor pos\n");
- LOG_INFO(" dbclr -----------------------------> : clear the DB\n");
- LOG_INFO(" s dbsave|dbload--------------------> : save/load the DB to/from a file\n");
- LOG_INFO(" x dbins ---------------------------> : moves the top into the DB\n");
- LOG_INFO(" dbext|dbread ----------------------> x : extract/get from the DB's cursor\n");
- LOG_INFO(" f dbmov|dbgoto --------------------> : move or set the DB's cursor\n");
- LOG_INFO(" s localtime -----------------------> s : formats the current local time\n");
- LOG_INFO(" s gmtime --------------------------> s : formats the current UTC time\n");
- LOG_INFO(" time ------------------------------> f : seconds since VM start\n");
- LOG_INFO(" s /MD4 digest ---------------------> s : MD4 digest\n");
- LOG_INFO(" s /SHA256 digest ------------------> s : SHA256 digest\n");
- LOG_INFO(" s /formatstring sprintf1s ---------> s : sprintf with 1 string (pad, cut)\n");
- LOG_INFO(" s eval ----------------------------> : does something eval\n");
- LOG_INFO(" Set operations operate on 'such''strings'.\n");
- LOG_INFO(" Unknown tokens insert their cvar value.\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...");
+ LOG_INFO(" Operator description (x: string, s: set, f: float):");
+ LOG_INFO(" x pop -----------------------------> : removes the top");
+ LOG_INFO(" x dup -----------------------------> x x : duplicates the top");
+ LOG_INFO(" x x exch --------------------------> x x : swap the top two");
+ LOG_INFO(" /cvarname load --------------------> x : loads a cvar");
+ LOG_INFO(" /cvarname x def -------------------> : writes to a cvar");
+ LOG_INFO(" f f add|sub|mul|div|mod|pow -------> f : adds/... two numbers");
+ LOG_INFO(" f f and|or|xor|bitand|bitor|bitxor > f : logical and bitwise operations");
+ LOG_INFO(" f f eq|ne|gt|ge|lt|le|max|min -----> f : compares two numbers");
+ LOG_INFO(" f neg|abs|sgn|rand|floor|ceil------> f : negates/... a number");
+ LOG_INFO(" f not|bitnot ----------------------> f : logical and bitwise negation");
+ LOG_INFO(" f exp|log|sin|cos -----------------> f : exponential function & Co.");
+ LOG_INFO(" f f f bound -----------------------> f : bounds the middle number");
+ LOG_INFO(" f1 f2 b when ----------------------> f : f1 if b, f2 otherwise");
+ LOG_INFO(" s s union|intersection|difference -> s : set operations");
+ LOG_INFO(" s shuffle -------------------------> s : randomly arrange elements");
+ LOG_INFO(" /key /value put -------------------> : set a database key");
+ LOG_INFO(" /key get --------------------------> s : get a database value");
+ LOG_INFO(" x dbpush --------------------------> : pushes the top onto the database");
+ LOG_INFO(" dbpop|dbget -----------------------> x : removes/reads DB's top");
+ LOG_INFO(" dblen|dbat ------------------------> f : gets the DB's size/cursor pos");
+ LOG_INFO(" dbclr -----------------------------> : clear the DB");
+ LOG_INFO(" s dbsave|dbload--------------------> : save/load the DB to/from a file");
+ LOG_INFO(" x dbins ---------------------------> : moves the top into the DB");
+ LOG_INFO(" dbext|dbread ----------------------> x : extract/get from the DB's cursor");
+ LOG_INFO(" f dbmov|dbgoto --------------------> : move or set the DB's cursor");
+ LOG_INFO(" s localtime -----------------------> s : formats the current local time");
+ LOG_INFO(" s gmtime --------------------------> s : formats the current UTC time");
+ LOG_INFO(" time ------------------------------> f : seconds since VM start");
+ LOG_INFO(" s /MD4 digest ---------------------> s : MD4 digest");
+ LOG_INFO(" s /SHA256 digest ------------------> s : SHA256 digest");
+ LOG_INFO(" s /formatstring sprintf1s ---------> s : sprintf with 1 string (pad, cut)");
+ LOG_INFO(" s eval ----------------------------> : does something eval");
+ LOG_INFO(" Set operations operate on 'such''strings'.");
+ LOG_INFO(" Unknown tokens insert their cvar value.");
return;
}
}
# define TAG_VIEWLOC_TYPE entity
#endif
-// new fields
-.vector v_angle;
-
// add properties you want networked to CSQC here
#define CSQCMODEL_EXTRAPROPERTIES \
CSQCMODEL_PROPERTY(BIT(0), int, ReadShort, WriteShort, colormap) \
e.debug = true;
--rem;
}
- LOG_INFOF("%d server entities sent\n", n - rem);
+ LOG_INFOF("%d server entities sent", n - rem);
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv");
return;
}
}
int bufhandle = stof(argv(1));
int string_index = stof(argv(2));
string s = bufstr_get(bufhandle, string_index);
- LOG_INFOF("%s\n", s);
+ LOG_INFOF("%s", s);
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- LOG_INFO(WATERMARK "\n");
+ LOG_INFO(WATERMARK);
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " version"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " version");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges"));
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges");
return;
}
}
int entcnt = 0;
FOREACH_ENTITY_CLASS_ORDERED(argv(1), true,
{
- LOG_INFOF("%i (%s)\n", it, it.classname);
+ LOG_INFOF("%i (%s)", it, it.classname);
++entcnt;
});
if(entcnt)
- LOG_INFOF("Found %d entities\n", entcnt);
+ LOG_INFOF("Found %d entities", entcnt);
return;
}
default:
{
- LOG_INFO("Incorrect parameters for ^2find^7\n");
+ LOG_INFO("Incorrect parameters for ^2find^7");
}
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 " GetProgramCommandPrefix() " find classname\n");
- LOG_INFO(" Where 'classname' is the classname to search for.\n");
+ LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " find classname");
+ LOG_INFO(" Where 'classname' is the classname to search for.");
return;
}
}
case CMD_REQUEST_COMMAND:
{
vector match = stov(argv(1));
- FOREACH_ENTITY_ORDERED(it.origin == match, LOG_INFOF("%i (%s)\n", it, it.classname));
+ FOREACH_ENTITY_ORDERED(it.origin == match, LOG_INFOF("%i (%s)", it, it.classname));
return;
}
default:
- LOG_INFO("Incorrect parameters for ^2findat^7\n");
+ LOG_INFO("Incorrect parameters for ^2findat^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"\n");
+ LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"");
return;
}
}
int fh = fopen(filename, FILE_WRITE);
if (fh >= 0) {
effectinfo_dump(fh, alsoprint);
- LOG_INFOF("Dumping effectinfo... File located at ^2data/data/%s^7.\n", filename);
- LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.\n", filename);
+ LOG_INFOF("Dumping effectinfo... File located at ^2data/data/%s^7.", filename);
+ LOG_INFOF("Reload with ^2cl_particles_reloadeffects data/%s^7.", filename);
fclose(fh);
} else {
LOG_WARNF("Could not open file '%s'!", filename);
}
default:
case CMD_REQUEST_USAGE: {
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]"));
- LOG_INFO(" Where 'filename' is the file to write (default is effectinfo_dump.txt),\n");
- LOG_INFO(" if supplied with '-' output to console as well as default,\n");
- LOG_INFO(" if left blank, it will only write to default.\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpeffectinfo [filename]");
+ LOG_INFO(" Where 'filename' is the file to write (default is effectinfo_dump.txt),");
+ LOG_INFO(" if supplied with '-' output to console as well as default,");
+ LOG_INFO(" if left blank, it will only write to default.");
return;
}
}
// generated file; do not modify
-#include <common/effects/qc/all.qc>
#include <common/effects/qc/casings.qc>
#include <common/effects/qc/damageeffects.qc>
#include <common/effects/qc/gibs.qc>
// generated file; do not modify
-#include <common/effects/qc/all.qh>
#include <common/effects/qc/casings.qh>
#include <common/effects/qc/damageeffects.qh>
#include <common/effects/qc/gibs.qh>
+++ /dev/null
-#include "casings.qc"
-#include "damageeffects.qc"
-#include "gibs.qc"
-#include "globalsound.qc"
-#include "lightningarc.qc"
-#include "modeleffects.qc"
+++ /dev/null
-#include "all.qh"
-
-#define IMPLEMENTATION
-#include "all.inc"
-#undef IMPLEMENTATION
+++ /dev/null
-#pragma once
-
-#include "all.inc"
#include "casings.qh"
-#ifdef SVQC
-void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner, .entity weaponentity);
-#endif
-
-#ifdef IMPLEMENTATION
#include <common/util.qh>
}
#endif
-#endif
#pragma once
+
+#ifdef SVQC
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner, .entity weaponentity);
+#endif
#include "damageeffects.qh"
-#ifdef IMPLEMENTATION
-
REGISTER_NET_LINKED(ENT_CLIENT_DAMAGEINFO)
#ifdef SVQC
}
#endif
-
-#endif
#include "gibs.qh"
-#ifdef IMPLEMENTATION
REGISTER_NET_TEMP(net_gibsplash)
#ifdef SVQC
delete(this);
}
#endif
-
-#endif
#include <common/ent_cs.qh>
-#ifdef IMPLEMENTATION
#include <common/animdecide.qh>
#ifdef SVQC
}
#endif
-#endif
#include "lightningarc.qh"
-#ifdef IMPLEMENTATION
REGISTER_NET_TEMP(TE_CSQC_ARC)
#if defined(SVQC)
}
#endif
-
-#endif
#include "modeleffects.qh"
-#ifdef IMPLEMENTATION
-
REGISTER_NET_LINKED(ENT_CLIENT_MODELEFFECT)
#ifdef SVQC
return true;
}
#endif
-
-#endif
// generated file; do not modify
+#include <common/gamemodes/rules.qc>
+#ifdef SVQC
+ #include <common/gamemodes/sv_rules.qc>
+#endif
#include <common/gamemodes/gamemode/_mod.inc>
// generated file; do not modify
+#include <common/gamemodes/rules.qh>
+#ifdef SVQC
+ #include <common/gamemodes/sv_rules.qh>
+#endif
#include <common/gamemodes/gamemode/_mod.qh>
// generated file; do not modify
#include <common/gamemodes/gamemode/nexball/nexball.qc>
#include <common/gamemodes/gamemode/nexball/weapon.qc>
+#ifdef SVQC
+ #include <common/gamemodes/gamemode/nexball/sv_weapon.qc>
+#endif
// generated file; do not modify
#include <common/gamemodes/gamemode/nexball/nexball.qh>
#include <common/gamemodes/gamemode/nexball/weapon.qh>
+#ifdef SVQC
+ #include <common/gamemodes/gamemode/nexball/sv_weapon.qh>
+#endif
#ifdef SVQC
.float metertime = _STAT(NB_METERSTART);
+.entity ballcarried;
+
int autocvar_g_nexball_goalleadlimit;
#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
return e.team;
}
-const float ST_NEXBALL_GOALS = 1;
+const int ST_NEXBALL_GOALS = 1;
void nb_ScoreRules(int teams)
{
- ScoreRules_basics(teams, 0, 0, true);
- ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, 0, 0, {
+ field_team(ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ field(SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY);
+ field(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER);
+ });
}
void LogNB(string mode, entity actor)
tracebox(this.origin, BALL_MINS, BALL_MAXS, this.origin, true, this);
if(trace_startsolid)
{
- vector o;
- o = this.origin;
- if(!move_out_of_solid(this))
+ vector o = this.origin;
+ if (!move_out_of_solid(this)) {
objerror(this, "could not get out of solid at all!");
- LOG_INFO("^1NOTE: this map needs FIXING. ", this.classname, " at ", vtos(o - '0 0 1'));
- LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
- LOG_INFO(" ", ftos(this.origin.y - o.y));
- LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+ }
+ LOG_INFOF(
+ "^1NOTE: this map needs FIXING. %s at %s needs to be moved out of solid, e.g. by %s",
+ this.classname,
+ vtos(o - '0 0 1'),
+ vtos(this.origin - o)
+ );
this.origin = o;
}
}
{
ownr.effects &= ~autocvar_g_nexball_basketball_effects_default;
ownr.ballcarried = NULL;
+ GameRules_scoring_vip(ownr, false);
if(ownr.metertime)
{
ownr.metertime = 0;
ball.weaponentity_fld = weaponentity;
ball.team = plyr.team;
plyr.ballcarried = ball;
+ GameRules_scoring_vip(plyr, true);
ball.nb_dropper = plyr;
plyr.effects |= autocvar_g_nexball_basketball_effects_default;
WaypointSprite_Spawn(WP_NbBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER); // no health bar please
WaypointSprite_UpdateRule(ball.waypointsprite_attachedforcarrier, 0, SPRITERULE_DEFAULT);
- ball.owner.ballcarried = NULL;
- ball.owner = NULL;
+ entity e = ball.owner; ball.owner = NULL;
+ e.ballcarried = NULL;
+ GameRules_scoring_vip(e, false);
}
void InitBall(entity this)
if(isclient)
{
if(pscore > 0)
- PlayerScore_Add(ball.pusher, SP_NEXBALL_GOALS, pscore);
+ GameRules_scoring_add(ball.pusher, NEXBALL_GOALS, pscore);
else if(pscore < 0)
- PlayerScore_Add(ball.pusher, SP_NEXBALL_FAULTS, -pscore);
+ GameRules_scoring_add(ball.pusher, NEXBALL_FAULTS, -pscore);
}
if(ball.owner) // Happens on spawnflag GOAL_TOUCHPLAYER
spawnfunc_nexball_out(this);
}
-//=======================//
-// Weapon code //
-//=======================//
-
-
-void W_Nexball_Think(entity this)
-{
- //dprint("W_Nexball_Think\n");
- //vector new_dir = steerlib_arrive(this.enemy.origin, 2500);
- vector new_dir = normalize(this.enemy.origin + '0 0 50' - this.origin);
- vector old_dir = normalize(this.velocity);
- float _speed = vlen(this.velocity);
- vector new_vel = normalize(old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed;
- //vector new_vel = (new_dir * autocvar_g_nexball_safepass_turnrate
-
- this.velocity = new_vel;
-
- this.nextthink = time;
-}
-
-void W_Nexball_Touch(entity this, entity toucher)
-{
- entity ball, attacker;
- attacker = this.owner;
- //this.think = func_null;
- //this.enemy = NULL;
-
- PROJECTILE_TOUCH(this, toucher);
- if(attacker.team != toucher.team || autocvar_g_nexball_basketball_teamsteal)
- if((ball = toucher.ballcarried) && !STAT(FROZEN, toucher) && !IS_DEAD(toucher) && (IS_PLAYER(attacker)))
- {
- toucher.velocity = toucher.velocity + normalize(this.velocity) * toucher.damageforcescale * autocvar_g_balance_nexball_secondary_force;
- UNSET_ONGROUND(toucher);
- if(!attacker.ballcarried)
- {
- LogNB("stole", attacker);
- _sound(toucher, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
-
- if(SAME_TEAM(attacker, toucher) && time > CS(attacker).teamkill_complain)
- {
- CS(attacker).teamkill_complain = time + 5;
- CS(attacker).teamkill_soundtime = time + 0.4;
- CS(attacker).teamkill_soundsource = toucher;
- }
-
- GiveBall(attacker, toucher.ballcarried);
- }
- }
- delete(this);
-}
-
-void W_Nexball_Attack(entity actor, .entity weaponentity, float t)
-{
- entity ball;
- float mul, mi, ma;
- if(!(ball = actor.ballcarried))
- return;
-
- W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
- tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL);
- if(trace_startsolid)
- {
- if(actor.metertime)
- actor.metertime = 0; // Shot failed, hide the power meter
- return;
- }
-
- //Calculate multiplier
- if(t < 0)
- mul = 1;
- else
- {
- mi = autocvar_g_nexball_basketball_meter_minpower;
- ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
- //One triangle wave period with 1 as max
- mul = 2 * (t % g_nexball_meter_period) / g_nexball_meter_period;
- if(mul > 1)
- mul = 2 - mul;
- mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
- }
-
- DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(actor, actor.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, false));
-
-
- //TODO: use the speed_up cvar too ??
-}
-
-vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
-
-void W_Nexball_Attack2(entity actor, .entity weaponentity)
-{
- if(actor.ballcarried.enemy)
- {
- entity _ball = actor.ballcarried;
- W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
- DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32));
- setthink(_ball, W_Nexball_Think);
- _ball.nextthink = time;
- return;
- }
-
- if(!autocvar_g_nexball_tackling)
- return;
-
- W_SetupShot(actor, weaponentity, false, 2, SND_NB_SHOOT2, CH_WEAPON_A, 0);
- entity missile = new(ballstealer);
-
- missile.owner = actor;
-
- set_movetype(missile, MOVETYPE_FLY);
- PROJECTILE_MAKETRIGGER(missile);
-
- //setmodel(missile, "models/elaser.mdl"); // precision set below
- setsize(missile, '0 0 0', '0 0 0');
- setorigin(missile, w_shotorg);
-
- W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
- missile.angles = vectoangles(missile.velocity);
- settouch(missile, W_Nexball_Touch);
- setthink(missile, SUB_Remove);
- missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
-
- missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
- missile.flags = FL_PROJECTILE;
- IL_PUSH(g_projectiles, missile);
- IL_PUSH(g_bot_dodge, missile);
-
- CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
-}
-
bool ball_customize(entity this, entity client)
{
if(!this.owner)
return true;
}
-METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire))
-{
- TC(BallStealer, thiswep);
- if(fire & 1)
- if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire))
- if(autocvar_g_nexball_basketball_meter)
- {
- if(actor.ballcarried && !actor.metertime)
- actor.metertime = time;
- else
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
- }
- else
- {
- W_Nexball_Attack(actor, weaponentity, -1);
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
- }
- if(fire & 2)
- if(weapon_prepareattack(thiswep, actor, weaponentity, true, autocvar_g_balance_nexball_secondary_refire))
- {
- W_Nexball_Attack2(actor, weaponentity);
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
- }
-
- if(!(fire & 1) && actor.metertime && actor.ballcarried)
- {
- W_Nexball_Attack(actor, weaponentity, time - actor.metertime);
- // DropBall or stealing will set metertime back to 0
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
- }
-}
-
-METHOD(BallStealer, wr_setup, void(BallStealer this, entity actor, .entity weaponentity))
-{
- TC(BallStealer, this);
- //weapon_setup(WEP_PORTO.m_id);
-}
-
-METHOD(BallStealer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
-{
- TC(BallStealer, this);
-}
-
-METHOD(BallStealer, wr_checkammo1, bool(BallStealer this, entity actor, .entity weaponentity))
-{
- TC(BallStealer, this);
- return true;
-}
-
-METHOD(BallStealer, wr_checkammo2, bool(BallStealer this, entity actor, .entity weaponentity))
-{
- TC(BallStealer, this);
- return true;
-}
-
void nb_DropBall(entity player)
{
if(player.ballcarried && g_nexball)
REGISTER_MUTATOR(nb, g_nexball)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
g_nexball_meter_period = autocvar_g_nexball_meter_period;
InitializeEntity(NULL, nb_delayedinit, INITPRIO_GAMETYPE);
WEP_NEXBALL.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
- ActivateTeamplay();
- SetLimits(autocvar_g_nexball_goallimit, autocvar_g_nexball_goalleadlimit, autocvar_timelimit_override, -1);
- have_team_spawns = -1; // request team spawns
+ GameRules_teams(true);
+ GameRules_limit_score(autocvar_g_nexball_goallimit);
+ GameRules_limit_lead(autocvar_g_nexball_goalleadlimit);
}
MUTATOR_ONROLLBACK_OR_REMOVE
{
WEP_NEXBALL.spawnflags |= WEP_FLAG_MUTATORBLOCKED;
- // we actually cannot roll back nb_delayedinit here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
}
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
- }
-
return 0;
}
--- /dev/null
+#include "sv_weapon.qh"
+
+void W_Nexball_Attack(entity actor, .entity weaponentity, float t);
+void W_Nexball_Attack2(entity actor, .entity weaponentity);
+vector trigger_push_calculatevelocity(vector org, entity tgt, float ht);
+
+METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire))
+{
+ TC(BallStealer, thiswep);
+ if(fire & 1)
+ if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire))
+ if(autocvar_g_nexball_basketball_meter)
+ {
+ if(actor.ballcarried && !actor.metertime)
+ actor.metertime = time;
+ else
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
+ }
+ else
+ {
+ W_Nexball_Attack(actor, weaponentity, -1);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
+ }
+ if(fire & 2)
+ if(weapon_prepareattack(thiswep, actor, weaponentity, true, autocvar_g_balance_nexball_secondary_refire))
+ {
+ W_Nexball_Attack2(actor, weaponentity);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, autocvar_g_balance_nexball_secondary_animtime, w_ready);
+ }
+
+ if(!(fire & 1) && actor.metertime && actor.ballcarried)
+ {
+ W_Nexball_Attack(actor, weaponentity, time - actor.metertime);
+ // DropBall or stealing will set metertime back to 0
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready);
+ }
+}
+
+METHOD(BallStealer, wr_setup, void(BallStealer this, entity actor, .entity weaponentity))
+{
+ TC(BallStealer, this);
+ //weapon_setup(WEP_PORTO.m_id);
+}
+
+METHOD(BallStealer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
+{
+ TC(BallStealer, this);
+}
+
+METHOD(BallStealer, wr_checkammo1, bool(BallStealer this, entity actor, .entity weaponentity))
+{
+ TC(BallStealer, this);
+ return true;
+}
+
+METHOD(BallStealer, wr_checkammo2, bool(BallStealer this, entity actor, .entity weaponentity))
+{
+ TC(BallStealer, this);
+ return true;
+}
+
+void W_Nexball_Think(entity this)
+{
+ //dprint("W_Nexball_Think\n");
+ //vector new_dir = steerlib_arrive(this.enemy.origin, 2500);
+ vector new_dir = normalize(this.enemy.origin + '0 0 50' - this.origin);
+ vector old_dir = normalize(this.velocity);
+ float _speed = vlen(this.velocity);
+ vector new_vel = normalize(old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed;
+ //vector new_vel = (new_dir * autocvar_g_nexball_safepass_turnrate
+
+ this.velocity = new_vel;
+
+ this.nextthink = time;
+}
+
+void W_Nexball_Touch(entity this, entity toucher)
+{
+ entity ball, attacker;
+ attacker = this.owner;
+ //this.think = func_null;
+ //this.enemy = NULL;
+
+ PROJECTILE_TOUCH(this, toucher);
+ if(attacker.team != toucher.team || autocvar_g_nexball_basketball_teamsteal)
+ if((ball = toucher.ballcarried) && !STAT(FROZEN, toucher) && !IS_DEAD(toucher) && (IS_PLAYER(attacker)))
+ {
+ toucher.velocity = toucher.velocity + normalize(this.velocity) * toucher.damageforcescale * autocvar_g_balance_nexball_secondary_force;
+ UNSET_ONGROUND(toucher);
+ if(!attacker.ballcarried)
+ {
+ LogNB("stole", attacker);
+ _sound(toucher, CH_TRIGGER, ball.noise2, VOL_BASE, ATTEN_NORM);
+
+ if(SAME_TEAM(attacker, toucher) && time > CS(attacker).teamkill_complain)
+ {
+ CS(attacker).teamkill_complain = time + 5;
+ CS(attacker).teamkill_soundtime = time + 0.4;
+ CS(attacker).teamkill_soundsource = toucher;
+ }
+
+ GiveBall(attacker, toucher.ballcarried);
+ }
+ }
+ delete(this);
+}
+
+void W_Nexball_Attack(entity actor, .entity weaponentity, float t)
+{
+ entity ball;
+ float mul, mi, ma;
+ if(!(ball = actor.ballcarried))
+ return;
+
+ W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
+ tracebox(w_shotorg, BALL_MINS, BALL_MAXS, w_shotorg, MOVE_WORLDONLY, NULL);
+ if(trace_startsolid)
+ {
+ if(actor.metertime)
+ actor.metertime = 0; // Shot failed, hide the power meter
+ return;
+ }
+
+ //Calculate multiplier
+ if(t < 0)
+ mul = 1;
+ else
+ {
+ mi = autocvar_g_nexball_basketball_meter_minpower;
+ ma = max(mi, autocvar_g_nexball_basketball_meter_maxpower); // avoid confusion
+ //One triangle wave period with 1 as max
+ mul = 2 * (t % g_nexball_meter_period) / g_nexball_meter_period;
+ if(mul > 1)
+ mul = 2 - mul;
+ mul = mi + (ma - mi) * mul; // range from the minimal power to the maximal power
+ }
+
+ DropBall(ball, w_shotorg, W_CalculateProjectileVelocity(actor, actor.velocity, w_shotdir * autocvar_g_balance_nexball_primary_speed * mul, false));
+
+
+ //TODO: use the speed_up cvar too ??
+}
+
+void W_Nexball_Attack2(entity actor, .entity weaponentity)
+{
+ if(actor.ballcarried.enemy)
+ {
+ entity _ball = actor.ballcarried;
+ W_SetupShot(actor, weaponentity, false, 4, SND_NB_SHOOT1, CH_WEAPON_A, 0);
+ DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32));
+ setthink(_ball, W_Nexball_Think);
+ _ball.nextthink = time;
+ return;
+ }
+
+ if(!autocvar_g_nexball_tackling)
+ return;
+
+ W_SetupShot(actor, weaponentity, false, 2, SND_NB_SHOOT2, CH_WEAPON_A, 0);
+ entity missile = new(ballstealer);
+
+ missile.owner = actor;
+
+ set_movetype(missile, MOVETYPE_FLY);
+ PROJECTILE_MAKETRIGGER(missile);
+
+ //setmodel(missile, "models/elaser.mdl"); // precision set below
+ setsize(missile, '0 0 0', '0 0 0');
+ setorigin(missile, w_shotorg);
+
+ W_SetupProjVelocity_Basic(missile, autocvar_g_balance_nexball_secondary_speed, 0);
+ missile.angles = vectoangles(missile.velocity);
+ settouch(missile, W_Nexball_Touch);
+ setthink(missile, SUB_Remove);
+ missile.nextthink = time + autocvar_g_balance_nexball_secondary_lifetime; //FIXME: use a distance instead?
+
+ missile.effects = EF_BRIGHTFIELD | EF_LOWPRECISION;
+ missile.flags = FL_PROJECTILE;
+ IL_PUSH(g_projectiles, missile);
+ IL_PUSH(g_bot_dodge, missile);
+
+ CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
+}
--- /dev/null
+#pragma once
pointparticles(EFFECT_ROCKET_EXPLODE, this.origin, '0 0 0', 1);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_CPDESTROYED), this.owner.message, attacker.netname);
- PlayerScore_Add(attacker, SP_ONS_TAKES, 1);
- PlayerScore_Add(attacker, SP_SCORE, 10);
+ GameRules_scoring_add(attacker, ONS_TAKES, 1);
+ GameRules_scoring_add(attacker, SCORE, 10);
this.owner.goalentity = NULL;
this.owner.islinked = false;
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ONSLAUGHT_CAPTURE, this.owner.ons_toucher.netname, this.owner.message);
Send_Notification(NOTIF_ALL_EXCEPT, this.owner.ons_toucher, MSG_CENTER, APP_TEAM_NUM(this.owner.ons_toucher.team, CENTER_ONS_CAPTURE_TEAM), this.owner.message);
Send_Notification(NOTIF_ONE, this.owner.ons_toucher, MSG_CENTER, CENTER_ONS_CAPTURE, this.owner.message);
- PlayerScore_Add(this.owner.ons_toucher, SP_ONS_CAPS, 1);
- PlayerTeamScore_AddScore(this.owner.ons_toucher, 10);
+ GameRules_scoring_add(this.owner.ons_toucher, ONS_CAPS, 1);
+ GameRules_scoring_add_team(this.owner.ons_toucher, SCORE, 10);
}
this.owner.ons_toucher = NULL;
else
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(this.team, INFO_ONSLAUGHT_GENDESTROYED));
- PlayerScore_Add(attacker, SP_SCORE, 100);
+ GameRules_scoring_add(attacker, SCORE, 100);
}
this.iscaptured = false;
this.islinked = false;
best.cnt += 1;
this.havocbot_attack_time = 0;
- if(checkpvs(this.view_ofs,cp))
- if(checkpvs(this.view_ofs,best))
+ if(checkpvs(this.origin + this.view_ofs, cp))
+ if(checkpvs(this.origin + this.view_ofs, best))
this.havocbot_attack_time = time + 2;
}
else
bestwp.cnt += 1;
this.havocbot_attack_time = 0;
- if(checkpvs(this.view_ofs,g))
- if(checkpvs(this.view_ofs,bestwp))
+ if(checkpvs(this.origin + this.view_ofs, g))
+ if(checkpvs(this.origin + this.view_ofs, bestwp))
this.havocbot_attack_time = time + 5;
return true;
if(c2 >= 0) teams |= BIT(1);
if(c3 >= 0) teams |= BIT(2);
if(c4 >= 0) teams |= BIT(3);
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
- ScoreInfo_SetLabel_TeamScore (ST_ONS_CAPS, "destroyed", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_ONS_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
- ScoreInfo_SetLabel_PlayerScore(SP_ONS_TAKES, "takes", 0);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, {
+ field_team(ST_ONS_CAPS, "destroyed", SFL_SORT_PRIO_PRIMARY);
+ field(SP_ONS_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+ field(SP_ONS_TAKES, "takes", 0);
+ });
}
void ons_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up
REGISTER_MUTATOR(ons, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- ons_Initialize();
-
- ActivateTeamplay();
- SetLimits(autocvar_g_onslaught_point_limit, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
- have_team_spawns = -1; // request team spawns
- }
+ GameRules_teams(true);
+ GameRules_limit_score(autocvar_g_onslaught_point_limit);
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back ons_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ ons_Initialize();
}
-
return false;
}
--- /dev/null
+#include "rules.qh"
--- /dev/null
+#pragma once
+
+#ifdef SVQC
+#include <common/gamemodes/sv_rules.qh>
+#endif
--- /dev/null
+#include "sv_rules.qh"
+
+#include <server/teamplay.qh>
+
+void GameRules_teams(bool value)
+{
+ if (value) {
+ serverflags |= SERVERFLAG_TEAMPLAY;
+ teamplay = 1;
+ cvar_set("teamplay", "2"); // DP needs this for sending proper getstatus replies.
+ GameRules_spawning_teams(true);
+ } else {
+ serverflags &= ~SERVERFLAG_TEAMPLAY;
+ teamplay = 0;
+ cvar_set("teamplay", "0"); // DP needs this for sending proper getstatus replies.
+ GameRules_spawning_teams(false);
+ }
+}
+
+void GameRules_spawning_teams(bool value)
+{
+ have_team_spawns = value ? -1 : 0;
+}
+
+bool _GameRules_score_enabled = true;
+void GameRules_score_enabled(bool value)
+{
+ _GameRules_score_enabled = value;
+}
+
+bool GameRules_limit_score_initialized;
+void GameRules_limit_score(int limit)
+{
+ if (GameRules_limit_score_initialized) return;
+ if (autocvar_g_campaign) return;
+ if (limit < 0) return;
+ cvar_set("fraglimit", ftos(limit));
+ GameRules_limit_score_initialized = true;
+}
+
+bool GameRules_limit_lead_initialized;
+void GameRules_limit_lead(int limit)
+{
+ if (GameRules_limit_lead_initialized) return;
+ if (autocvar_g_campaign) return;
+ if (limit < 0) return;
+ cvar_set("leadlimit", ftos(limit));
+ GameRules_limit_lead_initialized = true;
+}
+
+bool GameRules_limit_time_initialized;
+void GameRules_limit_time(int limit)
+{
+ if (GameRules_limit_time_initialized) return;
+ if (autocvar_g_campaign) return;
+ if (limit < 0) return;
+ cvar_set("timelimit", ftos(limit));
+ GameRules_limit_time_initialized = true;
+}
+
+bool GameRules_limit_time_qualifying_initialized;
+void GameRules_limit_time_qualifying(int limit)
+{
+ if (GameRules_limit_time_qualifying_initialized) return;
+ if (autocvar_g_campaign) return;
+ if (limit < 0) return;
+ cvar_set("g_race_qualifying_timelimit", ftos(limit));
+ GameRules_limit_time_qualifying_initialized = true;
+}
+
+void GameRules_limit_fallbacks()
+{
+ GameRules_limit_score(autocvar_fraglimit_override);
+ GameRules_limit_lead(autocvar_leadlimit_override);
+ GameRules_limit_time(autocvar_timelimit_override);
+}
+
+void _GameRules_scoring_begin(int teams, float spprio, float stprio)
+{
+ ScoreRules_basics(teams, spprio, stprio, _GameRules_score_enabled);
+}
+void _GameRules_scoring_field(entity i, string label, int scoreflags)
+{
+ ScoreInfo_SetLabel_PlayerScore(i, label, scoreflags);
+}
+void _GameRules_scoring_field_team(float i, string label, int scoreflags)
+{
+ ScoreInfo_SetLabel_TeamScore(i, label, scoreflags);
+}
+void _GameRules_scoring_end()
+{
+ ScoreRules_basics_end();
+}
+
+.bool m_GameRules_scoring_vip;
+void GameRules_scoring_vip(entity player, bool value)
+{
+ player.m_GameRules_scoring_vip = value;
+}
+bool GameRules_scoring_is_vip(entity player)
+{
+ return player.m_GameRules_scoring_vip;
+}
+
+float _GameRules_scoring_add(entity client, entity sp, float value)
+{
+ return PlayerScore_Add(client, sp, value);
+}
+float _GameRules_scoring_add_team(entity client, entity sp, int st, float value)
+{
+ return PlayerTeamScore_Add(client, sp, st, value);
+}
--- /dev/null
+#pragma once
+
+// todo: accept the number of teams as a parameter
+void GameRules_teams(bool value);
+
+/**
+ * Used to disable team spawns in team modes
+ */
+void GameRules_spawning_teams(bool value);
+
+/**
+ * Disabling score disables the "score" column on the scoreboard
+ */
+void GameRules_score_enabled(bool value);
+
+void GameRules_limit_score(int limit);
+void GameRules_limit_lead(int limit);
+void GameRules_limit_time(int limit);
+void GameRules_limit_time_qualifying(int limit);
+
+/**
+ * Set any unspecified rules to their defaults
+ */
+void GameRules_limit_fallbacks();
+
+/**
+ * @param teams a bitmask of active teams
+ * @param spprio player score priority (if frags aren't enabled)
+ * @param stprio team score priority (if frags aren't enabled)
+ */
+#define GameRules_scoring(teams, spprio, stprio, fields) MACRO_BEGIN { \
+ _GameRules_scoring_begin((teams), (spprio), (stprio)); \
+ noref void(entity, string, float) field = _GameRules_scoring_field; \
+ /* todo: just have the one `field` function */ \
+ noref void(int, string, float) field_team = _GameRules_scoring_field_team; \
+ LAMBDA(fields); \
+ _GameRules_scoring_end(); \
+} MACRO_END
+
+void _GameRules_scoring_begin(int teams, float spprio, float stprio);
+void _GameRules_scoring_field(entity i, string label, int scoreflags);
+void _GameRules_scoring_field_team(float i, string label, int scoreflags);
+void _GameRules_scoring_end();
+
+/**
+ * Mark a player as being 'important' (flag carrier, ball carrier, etc)
+ * @param player the entity to mark
+ * @param value VIP status
+ */
+void GameRules_scoring_vip(entity player, bool value);
+bool GameRules_scoring_is_vip(entity player);
+
+#define GameRules_scoring_add(client, fld, value) _GameRules_scoring_add(client, SP_##fld, value)
+float _GameRules_scoring_add(entity client, entity sp, float value);
+#define GameRules_scoring_add_team(client, fld, value) _GameRules_scoring_add_team(client, SP_##fld, ST_##fld, value)
+float _GameRules_scoring_add_team(entity client, entity sp, int st, float value);
}
default:
case CMD_REQUEST_USAGE: {
- LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+ LOG_INFOF("Usage:^3 %s dumpitems", GetProgramCommandPrefix());
return;
}
}
METHOD(GameItem, show, void(GameItem this))
{
TC(GameItem, this);
- LOG_INFO("A game item\n");
+ LOG_INFO("A game item");
}
void ITEM_HANDLE(Show, GameItem this) { this.show(this); }
ENDCLASS(GameItem)
METHOD(Pickup, show, void(Pickup this))
{
TC(Pickup, this);
- LOG_INFOF("%s: %s\n", etos(this), this.m_name);
+ LOG_INFOF("%s: %s", etos(this), this.m_name);
}
ATTRIB(Pickup, m_itemid, int, 0);
#ifdef SVQC
}
if(fh < 0)
return 0;
- LOG_INFO("Analyzing ", fn, " to generate initial mapinfo\n");
+ LOG_INFO("Analyzing ", fn, " to generate initial mapinfo");
inWorldspawn = 2;
MapInfo_Map_flags = 0;
// MapInfo_SwitchGameType(MAPINFO_TYPE_DEATHMATCH.m_flags);
//}
- LOG_INFO("Switching to map ", s, "\n");
+ LOG_INFO("Switching to map ", s);
cvar_settemp_restore();
if(reinit)
CLASS(Invasion, Gametype)
INIT(Invasion)
{
- this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,"","pointlimit=50 teams=0",_("Survive against waves of monsters"));
+ this.gametype_init(this, _("Invasion"),"inv","g_invasion",false,"","pointlimit=50 teams=0 type=0",_("Survive against waves of monsters"));
}
METHOD(Invasion, m_parse_mapinfo, bool(string k, string v))
{
case "teams":
cvar_set("g_invasion_teams", v);
return true;
+ case "type":
+ cvar_set("g_invasion_type", v);
+ return true;
}
return false;
}
entity dozer = bd_find_dozer(minigame);
if(!dozer)
{
- LOG_INFO("Dozer wasn't found!\n");
+ LOG_INFO("Dozer wasn't found!");
return; // should not happen... TODO: end match?
}
if(boulder_count != target_count)
{
- LOG_INFO("Not enough targets or boulders, fix your level!\n");
+ LOG_INFO("Not enough targets or boulders, fix your level!");
return false;
}
file_get = fopen(file_name, FILE_READ);
if(file_get < 0)
{
- LOG_INFO("^3BULLDOZER: ^7could not find storage file ^3", file_name, "^7, no items were loaded\n");
+ LOG_INFO("^3BULLDOZER: ^7could not find storage file ^3", file_name, "^7, no items were loaded");
}
else
{
entity dozer = bd_find_dozer(minigame);
if(!dozer)
{
- LOG_INFO("You need to place a bulldozer on the level to save it!\n");
+ LOG_INFO("You need to place a bulldozer on the level to save it!");
return;
}
}
else
{
- LOG_INFO("You need to set the level name!\n");
+ LOG_INFO("You need to set the level name!");
return;
}
}
Monster_Attack_Melee(this, this.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((random() >= 0.5) ? this.anim_melee2 : this.anim_melee3), this.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW.m_id, true);
}
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
void M_Shambler_Attack_Lightning_Explode(entity this, entity directhitentity)
{
if(IS_PLAYER(attacker))
if(autocvar_g_monsters_score_spawned || !((this.spawnflags & MONSTERFLAG_SPAWNED) || (this.spawnflags & MONSTERFLAG_RESPAWNED)))
- PlayerScore_Add(attacker, SP_SCORE, +autocvar_g_monsters_score_kill);
+ GameRules_scoring_add(attacker, SCORE, +autocvar_g_monsters_score_kill);
if(gibbed)
{
//if(invincible) { e.spawnflags |= MONSTERFLAG_INVINCIBLE; }
setorigin(e, orig);
+ bool allow_any = boolean(monster == "anyrandom");
- if(monster == "random")
+ if(monster == "random" || allow_any)
{
RandomSelection_Init();
- FOREACH(Monsters, it != MON_Null && !(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN),
+ FOREACH(Monsters, it != MON_Null && (allow_any || (!(it.spawnflags & MONSTER_TYPE_PASSIVE) && !(it.spawnflags & MON_FLAG_HIDDEN))),
{
RandomSelection_AddEnt(it, 1, 1);
});
#define MUTATOR_ONADD if (mode == MUTATOR_ADDING)
#define MUTATOR_ONREMOVE if (mode == MUTATOR_REMOVING)
#define MUTATOR_ONROLLBACK_OR_REMOVE if (mode == MUTATOR_REMOVING || mode == MUTATOR_ROLLING_BACK)
+
+#define MUTATOR_STATIC() MACRO_BEGIN { \
+ MUTATOR_ONADD { \
+ /* game loads at time 1 */ \
+ if (time > 1) { \
+ error("This is a game type and it cannot be added at runtime."); \
+ } \
+ } \
+ MUTATOR_ONREMOVE { \
+ LOG_INFO("This is a game type and it cannot be removed at runtime."); \
+ return -1; \
+ } \
+} MACRO_END
+
#define MUTATOR_ADD(name) Mutator_Add(MUTATOR_##name)
#define MUTATOR_REMOVE(name) Mutator_Remove(MUTATOR_##name)
#define MUTATOR_RETURNVALUE CallbackChain_ReturnValue
#define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN { \
MUTATOR_ONADD { \
if (!CallbackChain_Add(HOOK_##cb, CALLBACK_##func, order)) { \
- LOG_INFO("HOOK FAILED: ", #cb, ":", #func, "\n"); \
+ LOG_INFO("HOOK FAILED: ", #cb, ":", #func); \
return true; \
} \
} \
if (this.text) strunzone(this.text);
this.text = strzone(s);
- float size_range = autocvar_cl_damagetext_size_max - autocvar_cl_damagetext_size_min;
- float damage_range = autocvar_cl_damagetext_size_max_damage - autocvar_cl_damagetext_size_min_damage;
- float scale_factor = size_range / damage_range;
- this.m_size = bound(
- autocvar_cl_damagetext_size_min,
- (potential - autocvar_cl_damagetext_size_min_damage) * scale_factor + autocvar_cl_damagetext_size_min,
- autocvar_cl_damagetext_size_max);
+ this.m_size = map_bound_ranges(potential,
+ autocvar_cl_damagetext_size_min_damage, autocvar_cl_damagetext_size_max_damage,
+ autocvar_cl_damagetext_size_min, autocvar_cl_damagetext_size_max);
}
CONSTRUCTOR(DamageText, int _group, vector _origin, bool _screen_coords, int _health, int _armor, int _potential_damage, int _deathtype, bool _friendlyfire) {
}
}
make_impure(NEW(DamageText, server_entity_index, entcs.origin, false, health, armor, potential_damage, deathtype, friendlyfire));
- } else if (autocvar_cl_damagetext_2d) {
+ } else if (autocvar_cl_damagetext_2d && spectatee_status != -1) {
+ // never show 2d damagetext when observing
+ // on some maps (hearth_v2, The_Yard), sometimes has_origin is false even though observers should know about all players
+ // it happens mostly with bots but occasionally also with players
+
// screen coords only
vector screen_pos = vec2(vid_conwidth * autocvar_cl_damagetext_2d_pos.x, vid_conheight * autocvar_cl_damagetext_2d_pos.y);
IL_EACH(g_drawables_2d, it.instanceOfDamageText && it.m_screen_coords && it.m_group == server_entity_index, {
#include "sv_damagetext.qh"
-AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: spectators, >= 2: players, >= 3: all players");
+AUTOCVAR(sv_damagetext, int, 2, "<= 0: disabled, >= 1: visible to spectators, >= 2: visible to attacker, >= 3: all players see everyone's damage");
REGISTER_MUTATOR(damagetext, true);
-#define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0 /* disabled */)
-#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1 /* spectators only */)
-#define SV_DAMAGETEXT_PLAYERS() (autocvar_sv_damagetext >= 2 /* players */)
-#define SV_DAMAGETEXT_ALL() (autocvar_sv_damagetext >= 3 /* all players */)
+#define SV_DAMAGETEXT_DISABLED() (autocvar_sv_damagetext <= 0 || autocvar_g_instagib)
+#define SV_DAMAGETEXT_SPECTATORS_ONLY() (autocvar_sv_damagetext >= 1)
+#define SV_DAMAGETEXT_PLAYERS() (autocvar_sv_damagetext >= 2)
+#define SV_DAMAGETEXT_ALL() (autocvar_sv_damagetext >= 3)
MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) {
if (SV_DAMAGETEXT_DISABLED()) return;
const entity attacker = M_ARGV(0, entity);
.int pressedkeys;
#endif
-// returns 1 if the player is close to a wall
+// returns true if the player is close to a wall
bool check_close_to_wall(entity this, float threshold)
{
if (PHYS_DODGING_WALL == 0) { return false; }
-#define X(OFFSET) \
- tracebox(this.origin, this.mins, this.maxs, this.origin + OFFSET, true, this); \
- if(trace_fraction < 1 && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY) && vdist(this.origin - trace_endpos, <, threshold)) \
+#define X(dir) \
+ tracebox(this.origin, this.mins, this.maxs, this.origin + threshold * dir, true, this); \
+ if (trace_fraction < 1 && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) \
return true;
- X(1000*v_right);
- X(-1000*v_right);
- X(1000*v_forward);
- X(-1000*v_forward);
+
+ X(v_right);
+ X(-v_right);
+ X(v_forward);
+ X(-v_forward);
#undef X
return false;
delete(e.fake_nade);
e.fake_nade = NULL;
+ Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
+
makevectors(e.v_angle);
// NOTE: always throw from first weapon entity?
W_SetupShot(e, _nade.weaponentity_fld, false, false, SND_Null, CH_WEAPON_A, 0);
- Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
-
vector offset = (v_forward * autocvar_g_nades_throw_offset.x)
- + (v_right * autocvar_g_nades_throw_offset.y)
- + (v_up * autocvar_g_nades_throw_offset.z);
- if(autocvar_g_nades_throw_offset == '0 0 0')
- offset = '0 0 0';
+ + (v_right * autocvar_g_nades_throw_offset.y)
+ + (v_up * autocvar_g_nades_throw_offset.z);
- setorigin(_nade, w_shotorg + offset + (v_right * 25) * -1);
+ setorigin(_nade, w_shotorg + offset);
//setmodel(_nade, MDL_PROJECTILE_NADE);
//setattachment(_nade, NULL, "");
PROJECTILE_MAKETRIGGER(_nade);
FOR_EACH_KH_KEY(key) if(key.owner == player) { ++key_count; }
float time_score;
- if(player.flagcarried || player.ballcarried) // this player is important
+ if(GameRules_scoring_is_vip(player))
time_score = autocvar_g_nades_bonus_score_time_flagcarrier;
else
time_score = autocvar_g_nades_bonus_score_time;
if (SAME_TEAM(frag_attacker, frag_target) || frag_attacker == frag_target)
nades_RemoveBonus(frag_attacker);
- else if(frag_target.flagcarried)
+ else if(GameRules_scoring_is_vip(frag_target))
nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_medium);
else if(autocvar_g_nades_bonus_score_spree && CS(frag_attacker).killcount > 1)
{
M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");
}
-MUTATOR_HOOKFUNCTION(nades, BuildMutatorsPrettyString)
-{
- M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Nades");
-}
-
MUTATOR_HOOKFUNCTION(nades, BuildGameplayTipsString)
{
M_ARGV(0, string) = strcat(M_ARGV(0, string), "\n\n^3nades^8 are enabled, press 'g' to use them\n");
MUTATOR_ONREMOVE
{
- LOG_INFO("This cannot be removed at runtime\n");
+ LOG_INFO("This cannot be removed at runtime");
return -1;
}
return true;
}
-void ok_SetCvars()
-{
- // hack to force overkill playermodels
- cvar_settemp("sv_defaultcharacter", "1");
- cvar_settemp("sv_defaultplayermodel", "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm");
- cvar_settemp("sv_defaultplayermodel_red", "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm");
- cvar_settemp("sv_defaultplayermodel_blue", "models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm");
-}
-
void ok_Initialize()
{
- ok_SetCvars();
-
precache_all_playermodels("models/ok_player/*.dpm");
WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
MUTATOR_ONREMOVE
{
- LOG_INFO("This cannot be removed at runtime\n");
+ LOG_INFO("This cannot be removed at runtime");
return -1;
}
if(file_get < 0)
{
if(autocvar_g_sandbox_info > 0)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded");
}
else
{
}
}
if(autocvar_g_sandbox_info > 0)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name, "\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name);
}
fclose(file_get);
}
_setmodel(e, argv(2));
if(autocvar_g_sandbox_info > 0)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " spawned an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " spawned an object at origin ^3", vtos(e.origin));
return true;
// ---------------- COMMAND: OBJECT, REMOVE ----------------
if(e != NULL)
{
if(autocvar_g_sandbox_info > 0)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " removed an object at origin ^3", vtos(e.origin));
sandbox_ObjectRemove(e);
return true;
}
print_to(player, "^2SANDBOX - INFO: ^7Object pasted successfully");
if(autocvar_g_sandbox_info > 0)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " pasted an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " pasted an object at origin ^3", vtos(e.origin));
return true;
}
return true;
player.object_attach = NULL; // object was attached, no longer keep it scheduled for attachment
print_to(player, "^2SANDBOX - INFO: ^7Object attached successfully");
if(autocvar_g_sandbox_info > 1)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " attached objects at origin ^3", vtos(e.origin));
return true;
}
print_to(player, "^1SANDBOX - WARNING: ^7Object could not be attached to the parent. Make sure you are facing an object that you have edit rights over");
sandbox_ObjectAttach_Remove(e);
print_to(player, "^2SANDBOX - INFO: ^7Child objects detached successfully");
if(autocvar_g_sandbox_info > 1)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " detached objects at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " detached objects at origin ^3", vtos(e.origin));
return true;
}
print_to(player, "^1SANDBOX - WARNING: ^7Child objects could not be detached. Make sure you are facing an object that you have edit rights over");
e.message2 = strzone(strftime(true, "%d-%m-%Y %H:%M:%S"));
if(autocvar_g_sandbox_info > 1)
- LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", player.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO("^3SANDBOX - SERVER: ^7", player.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin));
return true;
}
if(frag_target != frag_attacker)
if(!IS_DEAD(frag_target))
{
- frag_attacker.health += bound(0, damage_take, frag_target.health);
- frag_attacker.health = bound(0, frag_attacker.health, autocvar_g_balance_health_limit);
+ GivePlayerHealth(frag_attacker, bound(0, damage_take, frag_target.health));
}
}
if (rgb == '0 0 0')
{
this.teamradar_color = '1 0 1';
- LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+ LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it", spriteimage);
}
if (time - floor(time) > 0.5)
LOG_INFOF(
(
"^1TRAILING NEW LINE AT END OF NOTIFICATION: "
- "^7net_type = %s, net_name = %s, string = %s.\n"
+ "^7net_type = %s, net_name = %s, string = %s."
),
notiftype,
notifname,
LOG_INFOF(
(
"^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
- "^7net_type = %s, net_name = %s, max args = %d.\n"
+ "^7net_type = %s, net_name = %s, max args = %d."
),
notiftype,
notifname,
LOG_INFOF(
(
"^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
- "^7net_type = %s, net_name = %s, args arg = '%s'.\n"
+ "^7net_type = %s, net_name = %s, args arg = '%s'."
),
notiftype,
notifname,
LOG_INFOF(
(
"^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
- "^7net_type = %s, net_name = %s, max hudargs = %d.\n"
+ "^7net_type = %s, net_name = %s, max hudargs = %d."
),
notiftype,
notifname,
LOG_INFOF(
(
"^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
- "^7net_type = %s, net_name = %s, hudargs arg = '%s'.\n"
+ "^7net_type = %s, net_name = %s, hudargs arg = '%s'."
),
notiftype,
notifname,
LOG_INFOF(
(
"^1NOTIFICATION HAS TOO MANY ARGUMENTS: "
- "^7net_type = %s, net_name = %s, max durcnt = %d.\n"
+ "^7net_type = %s, net_name = %s, max durcnt = %d."
),
notiftype,
notifname,
LOG_INFOF(
(
"^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: "
- "^7net_type = %s, net_name = %s, durcnt arg = '%s'.\n"
+ "^7net_type = %s, net_name = %s, durcnt arg = '%s'."
),
notiftype,
notifname,
LOG_INFOF(
(
"^1NOTIFICATION WITH IMPROPER TYPE: "
- "^7net_type = %d, net_name = %s.\n"
+ "^7net_type = %d, net_name = %s."
),
typeId,
namestring
LOG_INFOF(
(
"^1NOTIFICATION WITH NO SOUND: "
- "^7net_type = %s, net_name = %s.\n"
+ "^7net_type = %s, net_name = %s."
),
typestring,
namestring
LOG_INFOF(
(
"^1NOTIFICATION HAS ARG COUNTS BUT NO ARGS OR HUDARGS OR DURCNT: "
- "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d\n"
+ "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d"
),
typestring,
namestring,
LOG_INFOF(
(
"^1NOTIFICATION HAS HUDARGS BUT NO ICON: "
- "^7net_type = %s, net_name = %s.\n"
+ "^7net_type = %s, net_name = %s."
),
typestring,
namestring
LOG_INFOF(
(
"^1EMPTY NOTIFICATION: "
- "^7net_type = %s, net_name = %s.\n"
+ "^7net_type = %s, net_name = %s."
),
typestring,
namestring
LOG_INFOF(
(
"^1NOTIFICATION WITH NO SUBCALLS: "
- "^7net_type = %s, net_name = %s.\n"
+ "^7net_type = %s, net_name = %s."
),
typestring,
namestring
LOG_INFOF(
(
"^1NOTIFICATION IS MISSING CHOICE PARAMS: "
- "^7net_type = %s, net_name = %s.\n"
+ "^7net_type = %s, net_name = %s."
),
typestring,
namestring
if (fh >= 0)
{
Dump_Notifications(fh, alsoprint);
- LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
+ LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.", filename);
fclose(fh);
}
else
{
- LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
+ LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
}
#else
- LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
+ LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd."));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
- LOG_INFO(" Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
- LOG_INFO(" if supplied with '-' output to console as well as default,\n");
- LOG_INFO(" if left blank, it will only write to default.\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]");
+ LOG_INFO(" Where 'filename' is the file to write (default is notifications_dump.cfg),");
+ LOG_INFO(" if supplied with '-' output to console as well as default,");
+ LOG_INFO(" if left blank, it will only write to default.");
return;
}
}
if(autocvar_sv_cheats || this.maycheat)
{
if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
- LOG_INFO("A hollow voice says \"Plugh\".\n");
+ LOG_INFO("A hollow voice says \"Plugh\".");
}
else
STAT(MOVEVARS_SPECIALCOMMAND, this) = true;
.int items;
.vector movement;
+
+ // angles of the player's view (as opposed to their model which uses `.vector angles;`) in degrees
+ // x is pitch: positive means down (unlike .angles)
+ // y is yaw: between -180 and 180, increases when turning left
+ // z is roll: positive means tilted clockwise, usually is 0
+ // when .fixangle is set, the player's view will change to the direction where the model is facing
+ // more info: https://gitlab.com/xonotic/xonotic-data.pk3dir/merge_requests/447#note_32816794
.vector v_angle;
.entity hook;
case URL_READY_ERROR:
default:
{
- LOG_INFO("Player stats writing failed: ", ftos(status), "\n");
+ LOG_INFO("Player stats writing failed: ", ftos(status));
PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
{
- PlayerScore_Add(joiningplayer, SP_ELO, -1);
+ GameRules_scoring_add(joiningplayer, ELO, -1);
// http://stats.xonotic.org/player/GgXRw6piDtFIbMArMuiAi8JG4tiin8VLjZgsKB60Uds=/elo.txt
if(autocvar_g_playerstats_playerbasic_uri != "")
{
string uri = autocvar_g_playerstats_playerbasic_uri;
if (joiningplayer.crypto_idfp == "") {
- PlayerScore_Add(joiningplayer, SP_ELO, -1);
+ GameRules_scoring_add(joiningplayer, ELO, -1);
} else {
// create the database if it doesn't already exist
if(PS_B_IN_DB < 0)
else
{
// server has this disabled, kill the DB and set status to idle
- PlayerScore_Add(joiningplayer, SP_ELO, -1);
+ GameRules_scoring_add(joiningplayer, ELO, -1);
if(PS_B_IN_DB >= 0)
{
db_close(PS_B_IN_DB);
if (gt == PlayerStats_GetGametype()) {
handled = true;
float e = stof(data);
- PlayerScore_Add(p, SP_ELO, +1 + e);
+ GameRules_scoring_add(p, ELO, +1 + e);
}
if (gt == "") {
// PlayerInfo_AddItem(p, value, data);
case URL_READY_CLOSED:
{
// url_fclose has finished
- LOG_INFO("Player stats synchronized with server\n");
+ LOG_INFO("Player stats synchronized with server");
return;
}
case URL_READY_ERROR:
default:
{
- LOG_INFO("Receiving player stats failed: ", ftos(status), "\n");
+ LOG_INFO("Receiving player stats failed: ", ftos(status));
break;
}
}
- PlayerScore_Add(p, SP_ELO, -1);
+ GameRules_scoring_add(p, ELO, -1);
}
#endif // SVQC
float i = 0;
for(e = PS_D_IN_EVL; (en = db_get(PS_D_IN_DB, e)) != ""; e = en)
{
- LOG_INFO(sprintf("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e))));
+ LOG_INFOF("%d:%s:%s", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e)));
++i;
}
#endif
float gamecount = cvar("cl_matchcount");
#if 0
- LOG_INFOF("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d\n",
+ LOG_INFOF("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d",
time,
PS_D_NEXTUPDATETIME,
PS_D_LASTGAMECOUNT,
"PlayerStats_PlayerDetail_Handler(): ERROR: "
"Key went unhandled? Is our version outdated?\n"
"PlayerStats_PlayerDetail_Handler(): "
- "Key '%s', Event '%s', Data '%s'\n",
+ "Key '%s', Event '%s', Data '%s'",
key,
event,
data
}
#if 0
- LOG_INFO(sprintf(
+ LOG_INFOF(
"PlayerStats_PlayerDetail_Handler(): "
- "Key '%s', Event '%s', Data '%s'\n",
+ "Key '%s', Event '%s', Data '%s'",
key,
event,
data
- ));
+ );
#endif
}
//print("PlayerStats_PlayerDetail_Handler(): End of response.\n");
case URL_READY_CLOSED:
{
// url_fclose has finished
- LOG_INFO("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.\n");
+ LOG_INFO("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.");
break;
}
case URL_READY_ERROR:
default:
{
- LOG_INFO("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status), "\n");
+ LOG_INFO("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status));
PlayerStats_PlayerDetail_Status = PS_D_STATUS_ERROR;
if(PS_D_IN_DB >= 0)
{
Inventory_delete(this);
}
-void GetCvars(entity this, int);
+void GetCvars(entity this, entity store, int);
void DecodeLevelParms(entity this);
void PlayerScore_Attach(entity this);
void ClientData_Attach(entity this);
{
this._cs = NEW(ClientState, this);
- GetCvars(this, 0); // get other cvars from player
+ GetCvars(this, CS(this), 0); // get other cvars from player
// TODO: fold all of these into ClientState
void ClientState_detach(entity this)
{
- GetCvars(this, -1); // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
+ GetCvars(this, CS(this), -1); // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
accuracy_free(this); // TODO: needs to be before CS() is deleted!
PlayerScore_Detach(this); // what ^they^ said
W_HitPlotClose(this);
}
}
+AUTOCVAR(g_pickup_respawntime_scaling_reciprocal, float, 0.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*");
+AUTOCVAR(g_pickup_respawntime_scaling_offset, float, 0.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening");
+AUTOCVAR(g_pickup_respawntime_scaling_linear, float, 1.0, "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly");
+
+float adjust_respawntime(float normal_respawntime) {
+ float r = autocvar_g_pickup_respawntime_scaling_reciprocal;
+ float o = autocvar_g_pickup_respawntime_scaling_offset;
+ float l = autocvar_g_pickup_respawntime_scaling_linear;
+
+ if (r == 0 && l == 1) {
+ return normal_respawntime;
+ }
+
+ CheckAllowedTeams(NULL);
+ GetTeamCounts(NULL);
+ int players = 0;
+ if (c1 != -1) players += c1;
+ if (c2 != -1) players += c2;
+ if (c3 != -1) players += c3;
+ if (c4 != -1) players += c4;
+
+ if (players >= 2) {
+ return normal_respawntime * (r / (players + o) + l);
+ } else {
+ return normal_respawntime;
+ }
+}
+
void Item_ScheduleRespawn(entity e)
{
if(e.respawntime > 0)
{
Item_Show(e, 0);
- Item_ScheduleRespawnIn(e, ITEM_RESPAWNTIME(e));
+
+ float adjusted_respawntime = adjust_respawntime(e.respawntime);
+ //LOG_INFOF("item %s will respawn in %f", e.classname, adjusted_respawntime);
+
+ // range: adjusted_respawntime - respawntimejitter .. adjusted_respawntime + respawntimejitter
+ float actual_time = adjusted_respawntime + crandom() * e.respawntimejitter;
+ Item_ScheduleRespawnIn(e, actual_time);
}
else // if respawntime is -1, this item does not respawn
Item_Show(e, -1);
Item_ScheduleRespawnIn(e, max(0, game_starttime - time) + ((e.respawntimestart) ? e.respawntimestart : ITEM_RESPAWNTIME_INITIAL(e)));
}
-float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
+void GivePlayerResource(entity player, .float resource_type, float amount)
+{
+ if (amount == 0)
+ {
+ return;
+ }
+ switch (resource_type)
+ {
+ case health:
+ {
+ // Ugly hack. We do not check if health goes beyond hard limit since
+ // currently it is done in player_regen. We need to bring back this
+ // check when other code is ported to this function.
+ player.health = bound(player.health, player.health + amount,
+ autocvar_g_balance_health_limit);
+ // Correct code:
+ //player.health = bound(player.health, player.health + amount,
+ // min(autocvar_g_balance_health_limit,
+ // RESOURCE_AMOUNT_HARD_LIMIT));
+ player.pauserothealth_finished = max(player.pauserothealth_finished,
+ time + autocvar_g_balance_pause_health_rot);
+ return;
+ }
+ case armorvalue:
+ {
+ // Ugly hack. We do not check if armor goes beyond hard limit since
+ // currently it is done in player_regen. We need to bring back this
+ // check when other code is ported to this function.
+ player.armorvalue = bound(player.armorvalue, player.armorvalue +
+ amount, autocvar_g_balance_armor_limit);
+ // Correct code:
+ //player.armorvalue = bound(player.armorvalue, player.armorvalue +
+ // amount, min(autocvar_g_balance_armor_limit,
+ // RESOURCE_AMOUNT_HARD_LIMIT));
+ player.pauserotarmor_finished = max(player.pauserotarmor_finished,
+ time + autocvar_g_balance_pause_armor_rot);
+ return;
+ }
+ case ammo_shells:
+ case ammo_nails:
+ case ammo_rockets:
+ case ammo_cells:
+ case ammo_plasma:
+ {
+ GivePlayerAmmo(player, resource_type, amount);
+ return;
+ }
+ case ammo_fuel:
+ {
+ player.ammo_fuel = bound(player.ammo_fuel, player.ammo_fuel +
+ amount, min(g_pickup_fuel_max, RESOURCE_AMOUNT_HARD_LIMIT));
+ player.pauserotfuel_finished = max(player.pauserotfuel_finished,
+ time + autocvar_g_balance_pause_fuel_rot);
+ return;
+ }
+ }
+}
+
+void GivePlayerHealth(entity player, float amount)
+{
+ GivePlayerResource(player, health, amount);
+}
+
+void GivePlayerArmor(entity player, float amount)
+{
+ GivePlayerResource(player, armorvalue, amount);
+}
+
+void GivePlayerAmmo(entity player, .float ammotype, float amount)
+{
+ if (amount == 0)
+ {
+ return;
+ }
+ float maxvalue = RESOURCE_AMOUNT_HARD_LIMIT;
+ switch (ammotype)
+ {
+ case ammo_shells:
+ {
+ maxvalue = g_pickup_shells_max;
+ break;
+ }
+ case ammo_cells:
+ {
+ maxvalue = g_pickup_cells_max;
+ break;
+ }
+ case ammo_rockets:
+ {
+ maxvalue = g_pickup_rockets_max;
+ break;
+ }
+ case ammo_plasma:
+ {
+ maxvalue = g_pickup_plasma_max;
+ break;
+ }
+ case ammo_nails:
+ {
+ maxvalue = g_pickup_nails_max;
+ break;
+ }
+ }
+ player.(ammotype) = min(player.(ammotype) + amount,
+ min(maxvalue, RESOURCE_AMOUNT_HARD_LIMIT));
+}
+
+void GivePlayerFuel(entity player, float amount)
+{
+ GivePlayerResource(player, ammo_fuel, amount);
+}
+
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax)
{
if (!item.(ammotype))
return false;
{
if ((player.(ammotype) < ammomax) || item.pickup_anyway > 0)
{
- player.(ammotype) = bound(player.(ammotype), ammomax, player.(ammotype) + item.(ammotype));
- goto YEAH;
+ float amount = item.(ammotype);
+ if ((player.(ammotype) + amount) > ammomax)
+ {
+ amount = ammomax - player.(ammotype);
+ }
+ GivePlayerResource(player, ammotype, amount);
+ return true;
}
}
else if(g_weapon_stay == 2)
float mi = min(item.(ammotype), ammomax);
if (player.(ammotype) < mi)
{
- player.(ammotype) = mi;
- goto YEAH;
+ GivePlayerResource(player, ammotype, mi - player.(ammotype));
}
+ return true;
}
-
return false;
-
-LABEL(YEAH)
- switch(mode)
- {
- case ITEM_MODE_FUEL:
- player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
- break;
- case ITEM_MODE_HEALTH:
- player.pauserothealth_finished = max(player.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
- break;
- case ITEM_MODE_ARMOR:
- player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + autocvar_g_balance_pause_armor_rot);
- break;
- default:
- break;
- }
- return true;
}
float Item_GiveTo(entity item, entity player)
}
}
}
-
- pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max, ITEM_MODE_FUEL);
- pickedup |= Item_GiveAmmoTo(item, player, ammo_shells, g_pickup_shells_max, ITEM_MODE_NONE);
- pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max, ITEM_MODE_NONE);
- pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max, ITEM_MODE_NONE);
- pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max, ITEM_MODE_NONE);
- pickedup |= Item_GiveAmmoTo(item, player, ammo_plasma, g_pickup_plasma_max, ITEM_MODE_NONE);
- pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health, ITEM_MODE_HEALTH);
- pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue, ITEM_MODE_ARMOR);
-
+ pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health);
+ pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue);
+ pickedup |= Item_GiveAmmoTo(item, player, ammo_shells, g_pickup_shells_max);
+ pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max);
+ pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max);
+ pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max);
+ pickedup |= Item_GiveAmmoTo(item, player, ammo_plasma, g_pickup_plasma_max);
+ pickedup |= Item_GiveAmmoTo(item, player, ammo_fuel, g_pickup_fuel_max);
if (item.itemdef.instanceOfWeaponPickup)
{
WepSet w;
#include <server/defs.qh>
#endif
+/// \brief Unconditional maximum amount of resources the player can have.
+const int RESOURCE_AMOUNT_HARD_LIMIT = 999;
+
const int AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
// item networking
const float ITEM_RESPAWN_TICKS = 10;
-#define ITEM_RESPAWNTIME(i) ((i).respawntime + crandom() * (i).respawntimejitter)
- // range: respawntime - respawntimejitter .. respawntime + respawntimejitter
#define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS))
// range: 10 .. respawntime + respawntimejitter
void Item_ScheduleRespawn(entity e);
void Item_ScheduleInitialRespawn(entity e);
-float ITEM_MODE_NONE = 0;
-float ITEM_MODE_HEALTH = 1;
-float ITEM_MODE_ARMOR = 2;
-float ITEM_MODE_FUEL = 3;
-float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode);
+
+/// \brief Gives player a resource such as health, armor or ammo.
+/// \param[in,out] player Player to give resource to.
+/// \param[in] resource_type Type of the resource.
+/// \param[in] amount Amount of resource to give.
+/// \return No return.
+void GivePlayerResource(entity player, .float resource_type, float amount);
+
+/// \brief Gives health to the player.
+/// \param[in,out] player Player to give health to.
+/// \param[in] amount Amount of health to give.
+/// \return No return.
+void GivePlayerHealth(entity player, float amount);
+
+/// \brief Gives armor to the player.
+/// \param[in,out] player Player to give armor to.
+/// \param[in] amount Amount of armor to give.
+/// \return No return.
+void GivePlayerArmor(entity player, float amount);
+
+/// \brief Gives ammo of the specified type to the player.
+/// \param[in,out] player Player to give ammo to.
+/// \param[in] type Ammo type property.
+/// \param[in] amount Amount of ammo to give.
+/// \return No return.
+void GivePlayerAmmo(entity player, .float ammotype, float amount);
+
+/// \brief Gives fuel to the player.
+/// \param[in,out] player Player to give fuel to.
+/// \param[in] amount Amount of fuel to give.
+/// \return No return.
+void GivePlayerFuel(entity player, float amount);
+
+float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax);
float Item_GiveTo(entity item, entity player);
void button_wait(entity this)
{
this.state = STATE_TOP;
- this.nextthink = this.ltime + this.wait;
- setthink(this, button_return);
+ if(this.wait >= 0)
+ {
+ this.nextthink = this.ltime + this.wait;
+ setthink(this, button_return);
+ }
SUB_UseTargets(this, this.enemy, NULL);
this.frame = 1; // use alternate textures
}
setorigin(this, this.pos1);
this.frame = 0; // use normal textures
this.state = STATE_BOTTOM;
+ this.velocity = '0 0 0';
+ setthink(this, func_null);
+ this.nextthink = 0;
if (this.health)
this.takedamage = DAMAGE_YES; // can be shot again
}
this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
this.flags |= FL_NOTARGET;
+ this.reset = button_reset;
+
button_reset(this);
}
#endif
#include "rotating.qh"
#ifdef SVQC
+const int FUNC_ROTATING_STARTOFF = BIT(4);
+
void func_rotating_setactive(entity this, int astate)
{
if (astate == ACTIVE_TOGGLE)
this.avelocity = this.pos1;
}
+void func_rotating_reset(entity this)
+{
+ // TODO: reset angles as well?
+
+ if(this.spawnflags & FUNC_ROTATING_STARTOFF)
+ {
+ this.avelocity = '0 0 0';
+ this.active = ACTIVE_NOT;
+ }
+ else
+ {
+ this.avelocity = this.pos1;
+ this.active = ACTIVE_ACTIVE;
+ }
+}
+
/*QUAKED spawnfunc_func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS
Brush model that spins in place on one axis (default Z).
speed : speed to rotate (in degrees per second)
ambientsound(this.origin, this.noise, VOL_BASE, ATTEN_IDLE);
}
- this.active = ACTIVE_ACTIVE;
this.setactive = func_rotating_setactive;
if (!this.speed)
this.speed = 100;
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
- if (this.spawnflags & 4) // X (untested)
+ if (this.spawnflags & BIT(2)) // X (untested)
this.avelocity = '0 0 1' * this.speed;
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
- else if (this.spawnflags & 8) // Y (untested)
+ else if (this.spawnflags & BIT(3)) // Y (untested)
this.avelocity = '1 0 0' * this.speed;
// FIXME: test if this turns the right way, then remove this comment (negate as needed)
else // Z
this.pos1 = this.avelocity;
+ // do this after setting pos1, so we can safely reactivate the func_rotating
+ if(this.spawnflags & FUNC_ROTATING_STARTOFF)
+ {
+ this.avelocity = '0 0 0';
+ this.active = ACTIVE_NOT;
+ }
+ else
+ this.active = ACTIVE_ACTIVE;
+
if(this.dmg && (this.message == ""))
this.message = " was squished";
if(this.dmg && (this.message2 == ""))
this.nextthink = this.ltime + 999999999;
setthink(this, SUB_NullThink); // for PushMove
- // TODO make a reset function for this one
+ this.reset = func_rotating_reset;
}
#endif
data = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", key)));
if(data.y == 0) // undefined field, i.e., invalid type
{
- LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!\n");
+ LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!");
continue;
}
}
}
else
{
- LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!\n");
+ LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!");
continue;
}
{
if(value != "")
{
- LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!\n");
+ LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!");
continue;
}
data2 = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", valuefield)));
if(data2_y == 0) // undefined field, i.e., invalid type
{
- LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!\n");
+ LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!");
continue;
}
value = getentityfieldstring(data2_x, valueent);
value = vtos(stov(value) + stov(valueoffset));
break;
default:
- LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!\n");
+ LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!");
break;
}
}
value = vtos(stov(value) + random() * data2_x * '1 0 0' + random() * data2_y * '0 1 0' + random() * data2_z * '0 0 1');
break;
default:
- LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!\n");
+ LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!");
break;
}
}
#ifdef SVQC
if(!e) { sprint(player, "Teleport destination vanished. Sorry... please complain to the mapper.\n"); }
#elif defined(CSQC)
- if(!e) { LOG_INFO("Teleport destination could not be found from CSQC.\n"); }
+ if(!e) { LOG_INFO("Teleport destination could not be found from CSQC."); }
#endif
makevectors(e.mangle);
if(e.move_movetype == MOVETYPE_NONE)
waypoint_spawnforteleporter(this, e.origin, 0);
if(e.classname != "info_teleport_destination")
- LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
+ LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.");
#endif
}
#elif defined(CSQC)
if(!(pl.flags & BIT(15))) // FL_PROJECTILE
#endif
- LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
+ LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".");
pl.owner = NULL;
}
if(IS_PLAYER(pl))
}
if((!a) == (!b))
- LOG_INFO("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!\n");
+ LOG_INFO("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!");
}
spawnfunc(trigger_disablerelay)
break;
}
- if(!this.enemy) { LOG_INFO("^1FAIL!\n"); delete(this); return; }
+ if(!this.enemy) { LOG_INFO("^1FAIL!"); delete(this); return; }
if(!this.goalentity)
this.goalentity = this.enemy; // make them match so CSQC knows what to do
spawnfunc(trigger_viewlocation)
{
// we won't check target2 here yet, as it may not even need to exist
- if(this.target == "") { LOG_INFO("^1FAIL!\n"); delete(this); return; }
+ if(this.target == "") { LOG_INFO("^1FAIL!"); delete(this); return; }
EXACTTRIGGER_INIT;
InitializeEntity(this, viewloc_init, INITPRIO_FINDTARGET);
+++ /dev/null
-#include "_all.qh"
-#include "_mod.inc"
+++ /dev/null
-#pragma once
-#include "_mod.qh"
#include <common/turrets/sv_turrets.qc>
#endif
#include <common/turrets/util.qc>
+
+#include <common/turrets/turret/_mod.inc>
#include <common/turrets/sv_turrets.qh>
#endif
#include <common/turrets/util.qh>
+
+#include <common/turrets/turret/_mod.qh>
#include "all.qh"
REGISTER_NET_LINKED(ENT_CLIENT_TURRET)
-
-#ifdef SVQC
-#include "sv_turrets.qh"
-#endif
-
-#define IMPLEMENTATION
-#include "turret/_mod.inc"
-#undef IMPLEMENTATION
-
-#ifdef CSQC
-#include "cl_turrets.qc"
-#endif
-
-#ifdef SVQC
-#include "sv_turrets.qc"
-#include "config.qc"
-#include "util.qc"
-#include "checkpoint.qc"
-#include "targettrigger.qc"
-#endif
if(tur_config_file >= 0)
{
Dump_Turret_Settings();
- LOG_INFO(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
+ LOG_INFOF("Dumping turrets... File located in ^2data/data/%s^7.", filename);
fclose(tur_config_file);
tur_config_file = -1;
tur_config_alsoprint = -1;
}
else
{
- LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+ LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
}
#else
- LOG_INFO(_("Turrets dump command only works with sv_cmd.\n"));
+ LOG_INFO(_("Turrets dump command only works with sv_cmd."));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
- LOG_INFO(" Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
- LOG_INFO(" if supplied with '-' output to console as well as default,\n");
- LOG_INFO(" if left blank, it will only write to default.\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]");
+ LOG_INFO(" Where 'filename' is the file to write (default is turrets_dump.cfg),");
+ LOG_INFO(" if supplied with '-' output to console as well as default,");
+ LOG_INFO(" if left blank, it will only write to default.");
return;
}
}
REGISTER_TURRET(Null, NEW(Turret));
-#include "turret/_mod.inc"
+#include "turret/_mod.qh"
#include "checkpoint.qh"
+
+#ifdef SVQC
+
/**
turret_checkpoint
**/
this.classname = "turret_checkpoint";
spawnfunc_turret_checkpoint(this);
}
+
+#endif
if(rgb == '0 0 0')
{
this.teamradar_color = '1 0 1';
- LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+ LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it", spriteimage);
}
txt = this.netname;
// Turret Config Generator
// ==========================
+#ifdef SVQC
+
void T_Config_Queue_Swap(float root, float child, entity pass)
{
string oldroot = config_queue[root];
TUR_CONFIG_WRITETOFILE("// }}}\n")
// step 5: debug info
- LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.turret_name, TUR_CONFIG_COUNT));
+ LOG_INFOF("#%d: %s: %d settings...", i, it.turret_name, TUR_CONFIG_COUNT);
totalsettings += TUR_CONFIG_COUNT;
});
config_queue[j] = string_null;
// extra information
- LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (Turrets_COUNT - 1), totalsettings));
+ LOG_INFOF("Totals: %d turrets, %d settings", (Turrets_COUNT - 1), totalsettings);
}
+
+#endif
#include "targettrigger.qh"
+
+#ifdef SVQC
+
spawnfunc(turret_targettrigger);
void turret_targettrigger_touch(entity this, entity toucher);
settouch(this, turret_targettrigger_touch);
}
+
+#endif
#include "ewheel.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
float autocvar_g_turrets_unit_ewheel_speed_fast;
}
#endif // CSQC
-#endif
#include "ewheel_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
void turret_initparams(entity);
}
#endif
-
-#endif
#include "flac.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_flac) { if (!turret_initialize(this, TUR_FLAC)) delete(this); }
}
#endif
-
-#endif
#include "flac_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
void turret_flac_projectile_think_explode(entity this);
}
#endif
-
-#endif
#include "fusionreactor.qh"
-#ifdef IMPLEMENTATION
#ifdef SVQC
bool turret_fusionreactor_firecheck(entity this)
{
}
#endif
-#endif
#include "hellion.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_hellion) { if (!turret_initialize(this, TUR_HELLION)) delete(this); }
}
#endif
-#endif
#include "hellion_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
float autocvar_g_turrets_unit_hellion_shot_speed_gain;
}
#endif
-
-#endif
#include "hk.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
#ifdef TURRET_DEBUG_HK
}
#endif // SVQC
-#endif
#include "hk_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
float autocvar_g_turrets_unit_hk_shot_speed;
}
#endif
-
-#endif
#include "machinegun.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_machinegun) { if (!turret_initialize(this, TUR_MACHINEGUN)) delete(this); }
}
#endif // SVQC
-#endif
#include "machinegun_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
void W_MachineGun_MuzzleFlash(entity actor, .entity weaponentity);
}
#endif
-
-#endif
#include "mlrs.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_mlrs) { if (!turret_initialize(this, TUR_MLRS)) delete(this); }
}
#endif // SVQC
-#endif
#include "mlrs_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
SOUND(MLRSTurretAttack_FIRE, W_Sound("electro_fire"));
METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
}
#endif
-
-#endif
#include "phaser.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_phaser) { if (!turret_initialize(this, TUR_PHASER)) delete(this); }
}
#endif
-#endif
#include "phaser_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
void beam_think(entity this);
}
#endif
-
-#endif
#include "plasma.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_plasma) { if (!turret_initialize(this, TUR_PLASMA)) delete(this); }
}
#endif
-#endif
#include "plasma_dual.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_plasma_dual) { if (!turret_initialize(this, TUR_PLASMA_DUAL)) delete(this); }
}
#endif
-#endif
#include "plasma_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
SOUND(PlasmaAttack_FIRE, W_Sound("electro_fire"));
METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
}
#endif
-
-#endif
#include "tesla.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
spawnfunc(turret_tesla) { if (!turret_initialize(this, TUR_TESLA)) delete(this); }
}
#endif
-#endif
#include "tesla_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
entity toast(entity actor, entity from, float range, float damage);
}
#endif
-
-#endif
#include "walker.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
float autocvar_g_turrets_unit_walker_melee_damage;
}
#endif // CSQC
-#endif
#include "walker_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
SOUND(WalkerTurretAttack_FIRE, W_Sound("electro_fire"));
}
#endif
-
-#endif
#include "util.qh"
+
+#ifdef SVQC
+
/*
* Update this.tur_shotorg by getting up2date bone info
* NOTICE this func overwrites the global v_forward, v_right and v_up vectors.
SUB_SetFade(e,time,f_time);
}
#endif
+
+#endif
#pragma once
+#ifdef SVQC
+
float turret_tag_fire_update(entity this);
void FireImoBeam(entity this, vector start, vector end, vector smin, vector smax, float bforce, float f_dmg, float f_velfactor, float deathtype);
+
+#endif
if(cvar("developer"))
{
- LOG_INFO("Verifying vector compression table...\n");
+ LOG_INFO("Verifying vector compression table...");
for(i = 0x0F00; i < 0xFFFF; ++i)
if(i != compressShortVector(decompressShortVector(i)))
{
- LOG_INFO("BROKEN vector compression: ", ftos(i));
- LOG_INFO(" -> ", vtos(decompressShortVector(i)));
- LOG_INFO(" -> ", ftos(compressShortVector(decompressShortVector(i))));
- LOG_INFO("\n");
+ LOG_INFOF(
+ "BROKEN vector compression: %s -> %s -> %s",
+ ftos(i),
+ vtos(decompressShortVector(i)),
+ ftos(compressShortVector(decompressShortVector(i)))
+ );
error("b0rk");
}
- LOG_INFO("Done.\n");
+ LOG_INFO("Done.");
}
}
if(!cvar_type(tmp_cvar))
{
- LOG_INFOF("Error: cvar %s doesn't exist!\n", tmp_cvar);
+ LOG_INFOF("Error: cvar %s doesn't exist!", tmp_cvar);
return 0;
}
++j;
}
else
- LOG_INFOF("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", it.netname);
+ LOG_INFOF("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", it.netname);
});
#else
++j;
}
else
- print(sprintf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname));
+ print(sprintf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.", e.netname));
}
#endif
{
if(shutdown_running)
{
- LOG_INFO("Recursive shutdown detected! Only restoring cvars...\n");
+ LOG_INFO("Recursive shutdown detected! Only restoring cvars...");
}
else
{
+++ /dev/null
-#include "_all.qh"
-#include "_mod.inc"
+++ /dev/null
-#pragma once
-#include "_mod.qh"
#ifdef SVQC
#include <common/vehicles/sv_vehicles.qc>
#endif
+
+#include <common/vehicles/vehicle/_mod.inc>
#ifdef SVQC
#include <common/vehicles/sv_vehicles.qh>
#endif
+
+#include <common/vehicles/vehicle/_mod.qh>
#include "all.qh"
-#ifndef VEHICLES_ALL_C
-#define VEHICLES_ALL_C
REGISTER_NET_LINKED(ENT_CLIENT_AUXILIARYXHAIR)
-
-#if defined(SVQC)
- #include "sv_vehicles.qc"
-#elif defined(CSQC)
- #include "cl_vehicles.qc"
-#endif
-
-#define IMPLEMENTATION
-#include "vehicle/_mod.inc"
-#undef IMPLEMENTATION
-
-#endif
REGISTER_VEHICLE(Null, NEW(Vehicle));
-#include "vehicle/_mod.inc"
+#include "vehicle/_mod.qh"
#include "bumblebee.qh"
-#ifdef IMPLEMENTATION
-
const float BRG_SETUP = 2;
const float BRG_START = 4;
const float BRG_END = 8;
}
#endif
-#endif
#include "bumblebee_weapons.qh"
-#ifdef IMPLEMENTATION
-
REGISTER_NET_LINKED(ENT_CLIENT_BUMBLE_RAYGUN)
#ifdef SVQC
}
#endif
-
-#endif
#include "racer.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
#include <common/triggers/trigger/impulse.qh>
AuxiliaryXhair[0].axh_image = vCROSS_LOCK; // Rocket
#endif
}
-
-#endif
#include "racer_weapon.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
}
#endif
-
-#endif
#include "raptor.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
bool autocvar_g_vehicle_raptor = true;
}
#endif
-#endif
#include "raptor_weapons.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
METHOD(RaptorCannon, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
}
#endif
-
-#endif
#include "spiderbot.qh"
-#ifdef IMPLEMENTATION
-
const int SBRM_FIRST = 1;
const int SBRM_VOLLY = 1;
const int SBRM_GUIDE = 2;
}
#endif
-#endif
#include "spiderbot_weapons.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
void spiderbot_rocket_artillery(entity this)
}
#endif
-
-#endif
// IF YOU DISREGARD THIS NOTICE, I'LL KILL YOU WITH THE @!#%'N TUBA
// core weapons
-#include "weapon/blaster.qc"
-#include "weapon/shotgun.qc"
-#include "weapon/machinegun.qc"
-#include "weapon/mortar.qc"
-#include "weapon/minelayer.qc"
-#include "weapon/electro.qc"
-#include "weapon/crylink.qc"
-#include "weapon/vortex.qc"
-#include "weapon/hagar.qc"
-#include "weapon/devastator.qc"
+#include "weapon/blaster.qh"
+#include "weapon/shotgun.qh"
+#include "weapon/machinegun.qh"
+#include "weapon/mortar.qh"
+#include "weapon/minelayer.qh"
+#include "weapon/electro.qh"
+#include "weapon/crylink.qh"
+#include "weapon/vortex.qh"
+#include "weapon/hagar.qh"
+#include "weapon/devastator.qh"
// other weapons
-#include "weapon/porto.qc"
-#include "weapon/vaporizer.qc"
-#include "weapon/hook.qc"
-#include "weapon/hlac.qc"
-#include "weapon/tuba.qc"
-#include "weapon/rifle.qc"
-#include "weapon/fireball.qc"
-#include "weapon/seeker.qc"
-#include "weapon/shockwave.qc"
-#include "weapon/arc.qc"
+#include "weapon/porto.qh"
+#include "weapon/vaporizer.qh"
+#include "weapon/hook.qh"
+#include "weapon/hlac.qh"
+#include "weapon/tuba.qh"
+#include "weapon/rifle.qh"
+#include "weapon/fireball.qh"
+#include "weapon/seeker.qh"
+#include "weapon/shockwave.qh"
+#include "weapon/arc.qh"
#ifdef SVQC
#include "config.qc"
#endif
-#define IMPLEMENTATION
-#include "all.inc"
-#undef IMPLEMENTATION
+
+#include "weapon/_mod.inc"
+
// WEAPON PLUGIN SYSTEM
}
default:
{
- LOG_INFOF("Incorrect parameters for ^2%s^7\n", "weapon_find");
+ LOG_INFOF("Incorrect parameters for ^2%s^7", "weapon_find");
}
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 cl_cmd weapon_find weapon\n");
- LOG_INFO(" Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.\n");
+ LOG_INFO("Usage:^3 cl_cmd weapon_find weapon");
+ LOG_INFO(" Where 'weapon' is the lowercase weapon name, 'all' or 'unowned'.");
return;
}
}
if(wep_config_file >= 0)
{
Dump_Weapon_Settings();
- LOG_INFO(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
+ LOG_INFOF("Dumping weapons... File located in ^2data/data/%s^7.", filename);
fclose(wep_config_file);
wep_config_file = -1;
wep_config_alsoprint = -1;
}
else
{
- LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+ LOG_INFOF("^1Error: ^7Could not open file '%s'!", filename);
}
#else
- LOG_INFO(_("Weapons dump command only works with sv_cmd.\n"));
+ LOG_INFO(_("Weapons dump command only works with sv_cmd."));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
- LOG_INFO(" Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
- LOG_INFO(" if supplied with '-' output to console as well as default,\n");
- LOG_INFO(" if left blank, it will only write to default.\n");
+ LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]");
+ LOG_INFO(" Where 'filename' is the file to write (default is weapons_dump.cfg),");
+ LOG_INFO(" if supplied with '-' output to console as well as default,");
+ LOG_INFO(" if left blank, it will only write to default.");
return;
}
}
v = explosion_calcpush(explosion_f * speedfactor, m, target_v, 1, 0);
// the factor we then get is:
// 1
- LOG_INFOF("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
+ LOG_INFOF("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f",
m,
target_v, target_v + v,
target_v * target_v, m * explosion_f * speedfactor * explosion_f * speedfactor, target_v * target_v + m * explosion_f * speedfactor * explosion_f * speedfactor,
WEP_CONFIG_WRITETOFILE("// }}}\n");
// step 5: debug info
- LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, it.m_name, WEP_CONFIG_COUNT));
+ LOG_INFOF("#%d: %s: %d settings...", i, it.m_name, WEP_CONFIG_COUNT);
totalweapons += 1;
totalsettings += WEP_CONFIG_COUNT;
});
config_queue[x] = string_null;
// extra information
- LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", totalweapons, totalsettings));
+ LOG_INFOF("Totals: %d weapons, %d settings", totalweapons, totalsettings);
}
#include <common/stats.qh>
#ifdef SVQC
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
#endif
USING(WepSet, vector);
const int WEP_TYPE_MELEE_SEC = 0x800; // secondary attack is melee swing (for animation)
const int WEP_FLAG_DUALWIELD = 0x1000; // weapon can be dual wielded
const int WEP_FLAG_NODUAL = 0x2000; // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything
+const int WEP_FLAG_PENETRATEWALLS = 0x4000; // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO)
// variables:
string weaponorder_byid;
#include "arc.qh"
-#ifndef IMPLEMENTATION
-CLASS(Arc, Weapon)
-/* ammotype */ ATTRIB(Arc, ammo_field, .int, ammo_cells);
-/* impulse */ ATTRIB(Arc, impulse, int, 3);
-/* flags */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN);
-/* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000);
-/* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
-/* modelname */ ATTRIB(Arc, mdl, string, "arc");
-#ifdef GAMEQC
-/* model */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
-#endif
-/* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
-/* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7);
-/* wepimg */ ATTRIB(Arc, model2, string, "weaponarc");
-/* refname */ ATTRIB(Arc, netname, string, "arc");
-/* wepname */ ATTRIB(Arc, m_name, string, _("Arc"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, bolt, float, NONE) \
- P(class, prefix, bolt_ammo, float, NONE) \
- P(class, prefix, bolt_damageforcescale, float, NONE) \
- P(class, prefix, bolt_damage, float, NONE) \
- P(class, prefix, bolt_edgedamage, float, NONE) \
- P(class, prefix, bolt_force, float, NONE) \
- P(class, prefix, bolt_health, float, NONE) \
- P(class, prefix, bolt_lifetime, float, NONE) \
- P(class, prefix, bolt_radius, float, NONE) \
- P(class, prefix, bolt_refire, float, NONE) \
- P(class, prefix, bolt_speed, float, NONE) \
- P(class, prefix, bolt_spread, float, NONE) \
- P(class, prefix, beam_ammo, float, NONE) \
- P(class, prefix, beam_animtime, float, NONE) \
- P(class, prefix, beam_botaimlifetime, float, NONE) \
- P(class, prefix, beam_botaimspeed, float, NONE) \
- P(class, prefix, beam_damage, float, NONE) \
- P(class, prefix, beam_degreespersegment, float, NONE) \
- P(class, prefix, beam_distancepersegment, float, NONE) \
- P(class, prefix, beam_falloff_halflifedist, float, NONE) \
- P(class, prefix, beam_falloff_maxdist, float, NONE) \
- P(class, prefix, beam_falloff_mindist, float, NONE) \
- P(class, prefix, beam_force, float, NONE) \
- P(class, prefix, beam_healing_amax, float, NONE) \
- P(class, prefix, beam_healing_aps, float, NONE) \
- P(class, prefix, beam_healing_hmax, float, NONE) \
- P(class, prefix, beam_healing_hps, float, NONE) \
- P(class, prefix, beam_heat, float, NONE) /* heat increase per second (primary) */ \
- P(class, prefix, beam_maxangle, float, NONE) \
- P(class, prefix, beam_nonplayerdamage, float, NONE) \
- P(class, prefix, beam_range, float, NONE) \
- P(class, prefix, beam_refire, float, NONE) \
- P(class, prefix, beam_returnspeed, float, NONE) \
- P(class, prefix, beam_tightness, float, NONE) \
- P(class, prefix, burst_ammo, float, NONE) \
- P(class, prefix, burst_damage, float, NONE) \
- P(class, prefix, burst_healing_aps, float, NONE) \
- P(class, prefix, burst_healing_hps, float, NONE) \
- P(class, prefix, burst_heat, float, NONE) /* heat increase per second (secondary) */ \
- P(class, prefix, cooldown, float, NONE) /* heat decrease per second when resting */ \
- P(class, prefix, cooldown_release, float, NONE) /* delay weapon re-use when releasing button */ \
- P(class, prefix, overheat_max, float, NONE) /* maximum heat before jamming */ \
- P(class, prefix, overheat_min, float, NONE) /* minimum heat to wait for cooldown */ \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Arc, arc)
-#undef X
-
-ENDCLASS(Arc)
-REGISTER_WEAPON(ARC, arc, NEW(Arc));
-
-
-#ifdef GAMEQC
-const float ARC_MAX_SEGMENTS = 20;
-vector arc_shotorigin[4];
-.vector beam_start;
-.vector beam_dir;
-.vector beam_wantdir;
-.int beam_type;
-
-const int ARC_BT_MISS = 0x00;
-const int ARC_BT_WALL = 0x01;
-const int ARC_BT_HEAL = 0x02;
-const int ARC_BT_HIT = 0x03;
-const int ARC_BT_BURST_MISS = 0x10;
-const int ARC_BT_BURST_WALL = 0x11;
-const int ARC_BT_BURST_HEAL = 0x12;
-const int ARC_BT_BURST_HIT = 0x13;
-const int ARC_BT_BURSTMASK = 0x10;
-
-const int ARC_SF_SETTINGS = BIT(0);
-const int ARC_SF_START = BIT(1);
-const int ARC_SF_WANTDIR = BIT(2);
-const int ARC_SF_BEAMDIR = BIT(3);
-const int ARC_SF_BEAMTYPE = BIT(4);
-const int ARC_SF_LOCALMASK = ARC_SF_START | ARC_SF_WANTDIR | ARC_SF_BEAMDIR;
-#endif
-#ifdef SVQC
-.entity arc_beam;
-.bool arc_BUTTON_ATCK_prev; // for better animation control
-.float beam_prev;
-.float beam_initialized;
-.float beam_bursting;
-.float beam_teleporttime;
-.float beam_heat; // (beam) amount of heat produced
-.float arc_overheat; // (dropped arc/player) time during which it's too hot
-.float arc_cooldown; // (dropped arc/player) cooling speed
-.float arc_heat_percent = _STAT(ARC_HEAT);
-.float arc_smoke_sound;
-#endif
-#ifdef CSQC
-.vector beam_color;
-.float beam_alpha;
-.float beam_thickness;
-.entity beam_traileffect;
-.entity beam_hiteffect;
-.float beam_hitlight[4]; // 0: radius, 123: rgb
-.entity beam_muzzleeffect;
-.float beam_muzzlelight[4]; // 0: radius, 123: rgb
-.string beam_image;
-
-.entity beam_muzzleentity;
-
-.float beam_degreespersegment;
-.float beam_distancepersegment;
-.float beam_usevieworigin;
-.float beam_initialized;
-.float beam_maxangle;
-.float beam_range;
-.float beam_returnspeed;
-.float beam_tightness;
-.vector beam_shotorigin;
-
-entity Draw_ArcBeam_callback_entity;
-float Draw_ArcBeam_callback_last_thickness;
-vector Draw_ArcBeam_callback_last_top; // NOTE: in same coordinate system as player.
-vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as player.
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_arc) { weapon_defaultspawnfunc(this, WEP_ARC); }
}
#endif
-#endif
#pragma once
+
+CLASS(Arc, Weapon)
+/* ammotype */ ATTRIB(Arc, ammo_field, .int, ammo_cells);
+/* impulse */ ATTRIB(Arc, impulse, int, 3);
+/* flags */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN);
+/* rating */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000);
+/* color */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
+/* modelname */ ATTRIB(Arc, mdl, string, "arc");
+#ifdef GAMEQC
+/* model */ ATTRIB(Arc, m_model, Model, MDL_ARC_ITEM);
+#endif
+/* crosshair */ ATTRIB(Arc, w_crosshair, string, "gfx/crosshairhlac");
+/* crosshair */ ATTRIB(Arc, w_crosshair_size, float, 0.7);
+/* wepimg */ ATTRIB(Arc, model2, string, "weaponarc");
+/* refname */ ATTRIB(Arc, netname, string, "arc");
+/* wepname */ ATTRIB(Arc, m_name, string, _("Arc"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, bolt, float, NONE) \
+ P(class, prefix, bolt_ammo, float, NONE) \
+ P(class, prefix, bolt_damageforcescale, float, NONE) \
+ P(class, prefix, bolt_damage, float, NONE) \
+ P(class, prefix, bolt_edgedamage, float, NONE) \
+ P(class, prefix, bolt_force, float, NONE) \
+ P(class, prefix, bolt_health, float, NONE) \
+ P(class, prefix, bolt_lifetime, float, NONE) \
+ P(class, prefix, bolt_radius, float, NONE) \
+ P(class, prefix, bolt_refire, float, NONE) \
+ P(class, prefix, bolt_speed, float, NONE) \
+ P(class, prefix, bolt_spread, float, NONE) \
+ P(class, prefix, beam_ammo, float, NONE) \
+ P(class, prefix, beam_animtime, float, NONE) \
+ P(class, prefix, beam_botaimlifetime, float, NONE) \
+ P(class, prefix, beam_botaimspeed, float, NONE) \
+ P(class, prefix, beam_damage, float, NONE) \
+ P(class, prefix, beam_degreespersegment, float, NONE) \
+ P(class, prefix, beam_distancepersegment, float, NONE) \
+ P(class, prefix, beam_falloff_halflifedist, float, NONE) \
+ P(class, prefix, beam_falloff_maxdist, float, NONE) \
+ P(class, prefix, beam_falloff_mindist, float, NONE) \
+ P(class, prefix, beam_force, float, NONE) \
+ P(class, prefix, beam_healing_amax, float, NONE) \
+ P(class, prefix, beam_healing_aps, float, NONE) \
+ P(class, prefix, beam_healing_hmax, float, NONE) \
+ P(class, prefix, beam_healing_hps, float, NONE) \
+ P(class, prefix, beam_heat, float, NONE) /* heat increase per second (primary) */ \
+ P(class, prefix, beam_maxangle, float, NONE) \
+ P(class, prefix, beam_nonplayerdamage, float, NONE) \
+ P(class, prefix, beam_range, float, NONE) \
+ P(class, prefix, beam_refire, float, NONE) \
+ P(class, prefix, beam_returnspeed, float, NONE) \
+ P(class, prefix, beam_tightness, float, NONE) \
+ P(class, prefix, burst_ammo, float, NONE) \
+ P(class, prefix, burst_damage, float, NONE) \
+ P(class, prefix, burst_healing_aps, float, NONE) \
+ P(class, prefix, burst_healing_hps, float, NONE) \
+ P(class, prefix, burst_heat, float, NONE) /* heat increase per second (secondary) */ \
+ P(class, prefix, cooldown, float, NONE) /* heat decrease per second when resting */ \
+ P(class, prefix, cooldown_release, float, NONE) /* delay weapon re-use when releasing button */ \
+ P(class, prefix, overheat_max, float, NONE) /* maximum heat before jamming */ \
+ P(class, prefix, overheat_min, float, NONE) /* minimum heat to wait for cooldown */ \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Arc, arc)
+#undef X
+
+ENDCLASS(Arc)
+REGISTER_WEAPON(ARC, arc, NEW(Arc));
+
+
+#ifdef GAMEQC
+const float ARC_MAX_SEGMENTS = 20;
+vector arc_shotorigin[4];
+.vector beam_start;
+.vector beam_dir;
+.vector beam_wantdir;
+.int beam_type;
+
+const int ARC_BT_MISS = 0x00;
+const int ARC_BT_WALL = 0x01;
+const int ARC_BT_HEAL = 0x02;
+const int ARC_BT_HIT = 0x03;
+const int ARC_BT_BURST_MISS = 0x10;
+const int ARC_BT_BURST_WALL = 0x11;
+const int ARC_BT_BURST_HEAL = 0x12;
+const int ARC_BT_BURST_HIT = 0x13;
+const int ARC_BT_BURSTMASK = 0x10;
+
+const int ARC_SF_SETTINGS = BIT(0);
+const int ARC_SF_START = BIT(1);
+const int ARC_SF_WANTDIR = BIT(2);
+const int ARC_SF_BEAMDIR = BIT(3);
+const int ARC_SF_BEAMTYPE = BIT(4);
+const int ARC_SF_LOCALMASK = ARC_SF_START | ARC_SF_WANTDIR | ARC_SF_BEAMDIR;
+#endif
+#ifdef SVQC
+.entity arc_beam;
+.bool arc_BUTTON_ATCK_prev; // for better animation control
+.float beam_prev;
+.float beam_initialized;
+.float beam_bursting;
+.float beam_teleporttime;
+.float beam_heat; // (beam) amount of heat produced
+.float arc_overheat; // (dropped arc/player) time during which it's too hot
+.float arc_cooldown; // (dropped arc/player) cooling speed
+.float arc_heat_percent = _STAT(ARC_HEAT);
+.float arc_smoke_sound;
+#endif
+#ifdef CSQC
+
+.vector beam_color;
+.float beam_alpha;
+.float beam_thickness;
+.entity beam_traileffect;
+.entity beam_hiteffect;
+.float beam_hitlight[4]; // 0: radius, 123: rgb
+.entity beam_muzzleeffect;
+.float beam_muzzlelight[4]; // 0: radius, 123: rgb
+.string beam_image;
+
+.entity beam_muzzleentity;
+
+.float beam_degreespersegment;
+.float beam_distancepersegment;
+.float beam_usevieworigin;
+.float beam_initialized;
+.float beam_maxangle;
+.float beam_range;
+.float beam_returnspeed;
+.float beam_tightness;
+.vector beam_shotorigin;
+
+entity Draw_ArcBeam_callback_entity;
+float Draw_ArcBeam_callback_last_thickness;
+vector Draw_ArcBeam_callback_last_top; // NOTE: in same coordinate system as player.
+vector Draw_ArcBeam_callback_last_bottom; // NOTE: in same coordinate system as player.
+#endif
#include "blaster.qh"
-#ifndef IMPLEMENTATION
-CLASS(Blaster, Weapon)
-/* ammotype */ //ATTRIB(Blaster, ammo_field, .int, ammo_none);
-/* impulse */ ATTRIB(Blaster, impulse, int, 1);
-/* flags */ ATTRIB(Blaster, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(Blaster, bot_pickupbasevalue, float, 0);
-/* color */ ATTRIB(Blaster, wpcolor, vector, '1 0.5 0.5');
-/* modelname */ ATTRIB(Blaster, mdl, string, "laser");
-#ifdef GAMEQC
-/* model */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM);
-#endif
-/* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser");
-/* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
-/* wepimg */ ATTRIB(Blaster, model2, string, "weaponlaser");
-/* refname */ ATTRIB(Blaster, netname, string, "blaster");
-/* wepname */ ATTRIB(Blaster, m_name, string, _("Blaster"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, delay, float, BOTH) \
- P(class, prefix, edgedamage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, force_zscale, float, BOTH) \
- P(class, prefix, lifetime, float, BOTH) \
- P(class, prefix, radius, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, shotangle, float, BOTH) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, spread, float, BOTH) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Blaster, blaster)
-#undef X
-
-ENDCLASS(Blaster)
-REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster));
-#ifdef SVQC
-.float blaster_damage;
-.float blaster_edgedamage;
-.float blaster_radius;
-.float blaster_force;
-.float blaster_lifetime;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_blaster) { weapon_defaultspawnfunc(this, WEP_BLASTER); }
spawnfunc(weapon_laser) { spawnfunc_weapon_blaster(this); }
}
#endif
-#endif
#pragma once
+
+CLASS(Blaster, Weapon)
+/* ammotype */ //ATTRIB(Blaster, ammo_field, .int, ammo_none);
+/* impulse */ ATTRIB(Blaster, impulse, int, 1);
+/* flags */ ATTRIB(Blaster, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(Blaster, bot_pickupbasevalue, float, 0);
+/* color */ ATTRIB(Blaster, wpcolor, vector, '1 0.5 0.5');
+/* modelname */ ATTRIB(Blaster, mdl, string, "laser");
+#ifdef GAMEQC
+/* model */ ATTRIB(Blaster, m_model, Model, MDL_BLASTER_ITEM);
+#endif
+/* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser");
+/* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
+/* wepimg */ ATTRIB(Blaster, model2, string, "weaponlaser");
+/* refname */ ATTRIB(Blaster, netname, string, "blaster");
+/* wepname */ ATTRIB(Blaster, m_name, string, _("Blaster"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, delay, float, BOTH) \
+ P(class, prefix, edgedamage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, force_zscale, float, BOTH) \
+ P(class, prefix, lifetime, float, BOTH) \
+ P(class, prefix, radius, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, shotangle, float, BOTH) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, spread, float, BOTH) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Blaster, blaster)
+#undef X
+
+ENDCLASS(Blaster)
+REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster));
+
+#ifdef SVQC
+.float blaster_damage;
+.float blaster_edgedamage;
+.float blaster_radius;
+.float blaster_force;
+.float blaster_lifetime;
+#endif
#include "crylink.qh"
-#ifndef IMPLEMENTATION
-CLASS(Crylink, Weapon)
-/* ammotype */ ATTRIB(Crylink, ammo_field, .int, ammo_cells);
-/* impulse */ ATTRIB(Crylink, impulse, int, 6);
-/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB | WEP_FLAG_NODUAL);
-/* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000);
-/* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1');
-/* modelname */ ATTRIB(Crylink, mdl, string, "crylink");
-#ifdef GAMEQC
-/* model */ ATTRIB(Crylink, m_model, Model, MDL_CRYLINK_ITEM);
-#endif
-/* crosshair */ ATTRIB(Crylink, w_crosshair, string, "gfx/crosshaircrylink");
-/* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5);
-/* wepimg */ ATTRIB(Crylink, model2, string, "weaponcrylink");
-/* refname */ ATTRIB(Crylink, netname, string, "crylink");
-/* wepname */ ATTRIB(Crylink, m_name, string, _("Crylink"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, BOTH) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, bouncedamagefactor, float, BOTH) \
- P(class, prefix, bounces, float, BOTH) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, edgedamage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, joindelay, float, BOTH) \
- P(class, prefix, joinexplode, float, BOTH) \
- P(class, prefix, joinexplode_damage, float, BOTH) \
- P(class, prefix, joinexplode_edgedamage, float, BOTH) \
- P(class, prefix, joinexplode_force, float, BOTH) \
- P(class, prefix, joinexplode_radius, float, BOTH) \
- P(class, prefix, joinspread, float, BOTH) \
- P(class, prefix, linkexplode, float, BOTH) \
- P(class, prefix, middle_fadetime, float, BOTH) \
- P(class, prefix, middle_lifetime, float, BOTH) \
- P(class, prefix, other_fadetime, float, BOTH) \
- P(class, prefix, other_lifetime, float, BOTH) \
- P(class, prefix, radius, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, shots, float, BOTH) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, spreadtype, float, SEC) \
- P(class, prefix, spread, float, BOTH) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Crylink, crylink)
-#undef X
-
-ENDCLASS(Crylink)
-REGISTER_WEAPON(CRYLINK, crylink, NEW(Crylink));
-#ifdef SVQC
-.float gravity;
-.float crylink_waitrelease;
-.entity crylink_lastgroup;
-
-.entity crylink_owner; // we can't use realowner, as that's subject to change
-
-.entity queuenext;
-.entity queueprev;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_crylink) { weapon_defaultspawnfunc(this, WEP_CRYLINK); }
}
}
#endif
-#endif
#pragma once
+
+CLASS(Crylink, Weapon)
+/* ammotype */ ATTRIB(Crylink, ammo_field, .int, ammo_cells);
+/* impulse */ ATTRIB(Crylink, impulse, int, 6);
+/* flags */ ATTRIB(Crylink, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH | WEP_FLAG_CANCLIMB | WEP_FLAG_NODUAL);
+/* rating */ ATTRIB(Crylink, bot_pickupbasevalue, float, 6000);
+/* color */ ATTRIB(Crylink, wpcolor, vector, '1 0.5 1');
+/* modelname */ ATTRIB(Crylink, mdl, string, "crylink");
+#ifdef GAMEQC
+/* model */ ATTRIB(Crylink, m_model, Model, MDL_CRYLINK_ITEM);
+#endif
+/* crosshair */ ATTRIB(Crylink, w_crosshair, string, "gfx/crosshaircrylink");
+/* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5);
+/* wepimg */ ATTRIB(Crylink, model2, string, "weaponcrylink");
+/* refname */ ATTRIB(Crylink, netname, string, "crylink");
+/* wepname */ ATTRIB(Crylink, m_name, string, _("Crylink"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, BOTH) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, bouncedamagefactor, float, BOTH) \
+ P(class, prefix, bounces, float, BOTH) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, edgedamage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, joindelay, float, BOTH) \
+ P(class, prefix, joinexplode, float, BOTH) \
+ P(class, prefix, joinexplode_damage, float, BOTH) \
+ P(class, prefix, joinexplode_edgedamage, float, BOTH) \
+ P(class, prefix, joinexplode_force, float, BOTH) \
+ P(class, prefix, joinexplode_radius, float, BOTH) \
+ P(class, prefix, joinspread, float, BOTH) \
+ P(class, prefix, linkexplode, float, BOTH) \
+ P(class, prefix, middle_fadetime, float, BOTH) \
+ P(class, prefix, middle_lifetime, float, BOTH) \
+ P(class, prefix, other_fadetime, float, BOTH) \
+ P(class, prefix, other_lifetime, float, BOTH) \
+ P(class, prefix, radius, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, shots, float, BOTH) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, spreadtype, float, SEC) \
+ P(class, prefix, spread, float, BOTH) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Crylink, crylink)
+#undef X
+
+ENDCLASS(Crylink)
+REGISTER_WEAPON(CRYLINK, crylink, NEW(Crylink));
+
+#ifdef SVQC
+.float gravity;
+.float crylink_waitrelease;
+.entity crylink_lastgroup;
+
+.entity crylink_owner; // we can't use realowner, as that's subject to change
+
+.entity queuenext;
+.entity queueprev;
+#endif
#include "devastator.qh"
-#ifndef IMPLEMENTATION
-CLASS(Devastator, Weapon)
-/* ammotype */ ATTRIB(Devastator, ammo_field, .int, ammo_rockets);
-/* impulse */ ATTRIB(Devastator, impulse, int, 9);
-/* flags */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
-/* rating */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000);
-/* color */ ATTRIB(Devastator, wpcolor, vector, '1 1 0');
-/* modelname */ ATTRIB(Devastator, mdl, string, "rl");
-#ifdef GAMEQC
-/* model */ ATTRIB(Devastator, m_model, Model, MDL_DEVASTATOR_ITEM);
-#endif
-/* crosshair */ ATTRIB(Devastator, w_crosshair, string, "gfx/crosshairrocketlauncher");
-/* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7);
-/* wepimg */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
-/* refname */ ATTRIB(Devastator, netname, string, "devastator");
-/* wepname */ ATTRIB(Devastator, m_name, string, _("Devastator"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, NONE) \
- P(class, prefix, animtime, float, NONE) \
- P(class, prefix, damageforcescale, float, NONE) \
- P(class, prefix, damage, float, NONE) \
- P(class, prefix, detonatedelay, float, NONE) \
- P(class, prefix, edgedamage, float, NONE) \
- P(class, prefix, force, float, NONE) \
- P(class, prefix, guidedelay, float, NONE) \
- P(class, prefix, guidegoal, float, NONE) \
- P(class, prefix, guideratedelay, float, NONE) \
- P(class, prefix, guiderate, float, NONE) \
- P(class, prefix, guidestop, float, NONE) \
- P(class, prefix, health, float, NONE) \
- P(class, prefix, lifetime, float, NONE) \
- P(class, prefix, radius, float, NONE) \
- P(class, prefix, refire, float, NONE) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, remote_damage, float, NONE) \
- P(class, prefix, remote_edgedamage, float, NONE) \
- P(class, prefix, remote_force, float, NONE) \
- P(class, prefix, remote_jump_damage, float, NONE) \
- P(class, prefix, remote_jump_force, float, NONE) \
- P(class, prefix, remote_jump_radius, float, NONE) \
- P(class, prefix, remote_jump_velocity_z_add, float, NONE) \
- P(class, prefix, remote_jump_velocity_z_max, float, NONE) \
- P(class, prefix, remote_jump_velocity_z_min, float, NONE) \
- P(class, prefix, remote_radius, float, NONE) \
- P(class, prefix, speedaccel, float, NONE) \
- P(class, prefix, speedstart, float, NONE) \
- P(class, prefix, speed, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Devastator, devastator)
-#undef X
-
-ENDCLASS(Devastator)
-REGISTER_WEAPON(DEVASTATOR, devastator, NEW(Devastator));
-#ifdef SVQC
-.float rl_release;
-.float rl_detonate_later;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_devastator) { weapon_defaultspawnfunc(this, WEP_DEVASTATOR); }
spawnfunc(weapon_rocketlauncher) { spawnfunc_weapon_devastator(this); }
#if 0
if(actor.rl_release == 0)
{
- LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE\n", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo));
+ LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo));
return true;
}
else
{
ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR(devastator, ammo);
ammo_amount += actor.(weaponentity).(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
- LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s\n", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
+ LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s", actor.rl_release, actor.(thiswep.ammo_field), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
return ammo_amount;
}
#else
}
#endif
-#endif
#pragma once
+
+CLASS(Devastator, Weapon)
+/* ammotype */ ATTRIB(Devastator, ammo_field, .int, ammo_rockets);
+/* impulse */ ATTRIB(Devastator, impulse, int, 9);
+/* flags */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* rating */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000);
+/* color */ ATTRIB(Devastator, wpcolor, vector, '1 1 0');
+/* modelname */ ATTRIB(Devastator, mdl, string, "rl");
+#ifdef GAMEQC
+/* model */ ATTRIB(Devastator, m_model, Model, MDL_DEVASTATOR_ITEM);
+#endif
+/* crosshair */ ATTRIB(Devastator, w_crosshair, string, "gfx/crosshairrocketlauncher");
+/* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7);
+/* wepimg */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
+/* refname */ ATTRIB(Devastator, netname, string, "devastator");
+/* wepname */ ATTRIB(Devastator, m_name, string, _("Devastator"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, NONE) \
+ P(class, prefix, animtime, float, NONE) \
+ P(class, prefix, damageforcescale, float, NONE) \
+ P(class, prefix, damage, float, NONE) \
+ P(class, prefix, detonatedelay, float, NONE) \
+ P(class, prefix, edgedamage, float, NONE) \
+ P(class, prefix, force, float, NONE) \
+ P(class, prefix, guidedelay, float, NONE) \
+ P(class, prefix, guidegoal, float, NONE) \
+ P(class, prefix, guideratedelay, float, NONE) \
+ P(class, prefix, guiderate, float, NONE) \
+ P(class, prefix, guidestop, float, NONE) \
+ P(class, prefix, health, float, NONE) \
+ P(class, prefix, lifetime, float, NONE) \
+ P(class, prefix, radius, float, NONE) \
+ P(class, prefix, refire, float, NONE) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, remote_damage, float, NONE) \
+ P(class, prefix, remote_edgedamage, float, NONE) \
+ P(class, prefix, remote_force, float, NONE) \
+ P(class, prefix, remote_jump_damage, float, NONE) \
+ P(class, prefix, remote_jump_force, float, NONE) \
+ P(class, prefix, remote_jump_radius, float, NONE) \
+ P(class, prefix, remote_jump_velocity_z_add, float, NONE) \
+ P(class, prefix, remote_jump_velocity_z_max, float, NONE) \
+ P(class, prefix, remote_jump_velocity_z_min, float, NONE) \
+ P(class, prefix, remote_radius, float, NONE) \
+ P(class, prefix, speedaccel, float, NONE) \
+ P(class, prefix, speedstart, float, NONE) \
+ P(class, prefix, speed, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Devastator, devastator)
+#undef X
+
+ENDCLASS(Devastator)
+REGISTER_WEAPON(DEVASTATOR, devastator, NEW(Devastator));
+
+#ifdef SVQC
+.float rl_release;
+.float rl_detonate_later;
+#endif
#include "electro.qh"
-#ifndef IMPLEMENTATION
-CLASS(Electro, Weapon)
-/* ammotype */ ATTRIB(Electro, ammo_field, .int, ammo_cells);
-/* impulse */ ATTRIB(Electro, impulse, int, 5);
-/* flags */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000);
-/* color */ ATTRIB(Electro, wpcolor, vector, '0 0.5 1');
-/* modelname */ ATTRIB(Electro, mdl, string, "electro");
-#ifdef GAMEQC
-/* model */ ATTRIB(Electro, m_model, Model, MDL_ELECTRO_ITEM);
-#endif
-/* crosshair */ ATTRIB(Electro, w_crosshair, string, "gfx/crosshairelectro");
-/* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6);
-/* wepimg */ ATTRIB(Electro, model2, string, "weaponelectro");
-/* refname */ ATTRIB(Electro, netname, string, "electro");
-/* wepname */ ATTRIB(Electro, m_name, string, _("Electro"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, BOTH) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, bouncefactor, float, SEC) \
- P(class, prefix, bouncestop, float, SEC) \
- P(class, prefix, comboradius, float, PRI) \
- P(class, prefix, combo_comboradius, float, NONE) \
- P(class, prefix, combo_comboradius_thruwall, float, NONE) \
- P(class, prefix, combo_damage, float, NONE) \
- P(class, prefix, combo_edgedamage, float, NONE) \
- P(class, prefix, combo_force, float, NONE) \
- P(class, prefix, combo_radius, float, NONE) \
- P(class, prefix, combo_safeammocheck, float, NONE) \
- P(class, prefix, combo_speed, float, NONE) \
- P(class, prefix, count, float, SEC) \
- P(class, prefix, damagedbycontents, float, SEC) \
- P(class, prefix, damageforcescale, float, SEC) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, edgedamage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, health, float, SEC) \
- P(class, prefix, lifetime, float, BOTH) \
- P(class, prefix, midaircombo_explode, float, PRI) \
- P(class, prefix, midaircombo_interval, float, PRI) \
- P(class, prefix, midaircombo_radius, float, PRI) \
- P(class, prefix, radius, float, BOTH) \
- P(class, prefix, refire2, float, SEC) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, speed_up, float, SEC) \
- P(class, prefix, speed_z, float, SEC) \
- P(class, prefix, spread, float, BOTH) \
- P(class, prefix, stick, float, SEC) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, touchexplode, float, SEC) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Electro, electro)
-#undef X
-
-ENDCLASS(Electro)
-REGISTER_WEAPON(ELECTRO, electro, NEW(Electro));
-
-#ifdef SVQC
-.float electro_count;
-.float electro_secondarytime;
-void W_Electro_ExplodeCombo(entity this);
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_electro) { weapon_defaultspawnfunc(this, WEP_ELECTRO); }
}
#endif
-#endif
#pragma once
+
+CLASS(Electro, Weapon)
+/* ammotype */ ATTRIB(Electro, ammo_field, .int, ammo_cells);
+/* impulse */ ATTRIB(Electro, impulse, int, 5);
+/* flags */ ATTRIB(Electro, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(Electro, bot_pickupbasevalue, float, 5000);
+/* color */ ATTRIB(Electro, wpcolor, vector, '0 0.5 1');
+/* modelname */ ATTRIB(Electro, mdl, string, "electro");
+#ifdef GAMEQC
+/* model */ ATTRIB(Electro, m_model, Model, MDL_ELECTRO_ITEM);
+#endif
+/* crosshair */ ATTRIB(Electro, w_crosshair, string, "gfx/crosshairelectro");
+/* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6);
+/* wepimg */ ATTRIB(Electro, model2, string, "weaponelectro");
+/* refname */ ATTRIB(Electro, netname, string, "electro");
+/* wepname */ ATTRIB(Electro, m_name, string, _("Electro"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, BOTH) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, bouncefactor, float, SEC) \
+ P(class, prefix, bouncestop, float, SEC) \
+ P(class, prefix, comboradius, float, PRI) \
+ P(class, prefix, combo_comboradius, float, NONE) \
+ P(class, prefix, combo_comboradius_thruwall, float, NONE) \
+ P(class, prefix, combo_damage, float, NONE) \
+ P(class, prefix, combo_edgedamage, float, NONE) \
+ P(class, prefix, combo_force, float, NONE) \
+ P(class, prefix, combo_radius, float, NONE) \
+ P(class, prefix, combo_safeammocheck, float, NONE) \
+ P(class, prefix, combo_speed, float, NONE) \
+ P(class, prefix, count, float, SEC) \
+ P(class, prefix, damagedbycontents, float, SEC) \
+ P(class, prefix, damageforcescale, float, SEC) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, edgedamage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, health, float, SEC) \
+ P(class, prefix, lifetime, float, BOTH) \
+ P(class, prefix, midaircombo_explode, float, PRI) \
+ P(class, prefix, midaircombo_interval, float, PRI) \
+ P(class, prefix, midaircombo_radius, float, PRI) \
+ P(class, prefix, radius, float, BOTH) \
+ P(class, prefix, refire2, float, SEC) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, speed_up, float, SEC) \
+ P(class, prefix, speed_z, float, SEC) \
+ P(class, prefix, spread, float, BOTH) \
+ P(class, prefix, stick, float, SEC) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, touchexplode, float, SEC) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Electro, electro)
+#undef X
+
+ENDCLASS(Electro)
+REGISTER_WEAPON(ELECTRO, electro, NEW(Electro));
+
+
+#ifdef SVQC
+.float electro_count;
+.float electro_secondarytime;
+void W_Electro_ExplodeCombo(entity this);
+#endif
#include "fireball.qh"
-#ifndef IMPLEMENTATION
-CLASS(Fireball, Weapon)
-/* ammotype */ //ATTRIB(Fireball, ammo_field, .int, ammo_none);
-/* impulse */ ATTRIB(Fireball, impulse, int, 9);
-/* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
-/* rating */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000);
-/* color */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0');
-/* modelname */ ATTRIB(Fireball, mdl, string, "fireball");
-#ifdef GAMEQC
-/* model */ ATTRIB(Fireball, m_model, Model, MDL_FIREBALL_ITEM);
-#endif
-/* crosshair */ ATTRIB(Fireball, w_crosshair, string, "gfx/crosshairfireball");
-/* crosshair */ //ATTRIB(Fireball, w_crosshair_size, float, 0.65);
-/* wepimg */ ATTRIB(Fireball, model2, string, "weaponfireball");
-/* refname */ ATTRIB(Fireball, netname, string, "fireball");
-/* wepname */ ATTRIB(Fireball, m_name, string, _("Fireball"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, bfgdamage, float, PRI) \
- P(class, prefix, bfgforce, float, PRI) \
- P(class, prefix, bfgradius, float, PRI) \
- P(class, prefix, damageforcescale, float, BOTH) \
- P(class, prefix, damagetime, float, SEC) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, edgedamage, float, PRI) \
- P(class, prefix, force, float, PRI) \
- P(class, prefix, health, float, PRI) \
- P(class, prefix, laserburntime, float, BOTH) \
- P(class, prefix, laserdamage, float, BOTH) \
- P(class, prefix, laseredgedamage, float, BOTH) \
- P(class, prefix, laserradius, float, BOTH) \
- P(class, prefix, lifetime, float, BOTH) \
- P(class, prefix, radius, float, PRI) \
- P(class, prefix, refire2, float, PRI) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, speed_up, float, SEC) \
- P(class, prefix, speed_z, float, SEC) \
- P(class, prefix, spread, float, BOTH) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Fireball, fireball)
-#undef X
-
-ENDCLASS(Fireball)
-REGISTER_WEAPON(FIREBALL, fireball, NEW(Fireball));
-#ifdef SVQC
-.float bot_primary_fireballmooth; // whatever a mooth is
-.vector fireball_impactvec;
-.float fireball_primarytime;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_fireball) { weapon_defaultspawnfunc(this, WEP_FIREBALL); }
}
#endif
-#endif
#pragma once
+
+CLASS(Fireball, Weapon)
+/* ammotype */ //ATTRIB(Fireball, ammo_field, .int, ammo_none);
+/* impulse */ ATTRIB(Fireball, impulse, int, 9);
+/* flags */ ATTRIB(Fireball, spawnflags, int, WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* rating */ ATTRIB(Fireball, bot_pickupbasevalue, float, 5000);
+/* color */ ATTRIB(Fireball, wpcolor, vector, '1 0.5 0');
+/* modelname */ ATTRIB(Fireball, mdl, string, "fireball");
+#ifdef GAMEQC
+/* model */ ATTRIB(Fireball, m_model, Model, MDL_FIREBALL_ITEM);
+#endif
+/* crosshair */ ATTRIB(Fireball, w_crosshair, string, "gfx/crosshairfireball");
+/* crosshair */ //ATTRIB(Fireball, w_crosshair_size, float, 0.65);
+/* wepimg */ ATTRIB(Fireball, model2, string, "weaponfireball");
+/* refname */ ATTRIB(Fireball, netname, string, "fireball");
+/* wepname */ ATTRIB(Fireball, m_name, string, _("Fireball"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, bfgdamage, float, PRI) \
+ P(class, prefix, bfgforce, float, PRI) \
+ P(class, prefix, bfgradius, float, PRI) \
+ P(class, prefix, damageforcescale, float, BOTH) \
+ P(class, prefix, damagetime, float, SEC) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, edgedamage, float, PRI) \
+ P(class, prefix, force, float, PRI) \
+ P(class, prefix, health, float, PRI) \
+ P(class, prefix, laserburntime, float, BOTH) \
+ P(class, prefix, laserdamage, float, BOTH) \
+ P(class, prefix, laseredgedamage, float, BOTH) \
+ P(class, prefix, laserradius, float, BOTH) \
+ P(class, prefix, lifetime, float, BOTH) \
+ P(class, prefix, radius, float, PRI) \
+ P(class, prefix, refire2, float, PRI) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, speed_up, float, SEC) \
+ P(class, prefix, speed_z, float, SEC) \
+ P(class, prefix, spread, float, BOTH) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Fireball, fireball)
+#undef X
+
+ENDCLASS(Fireball)
+REGISTER_WEAPON(FIREBALL, fireball, NEW(Fireball));
+
+#ifdef SVQC
+.float bot_primary_fireballmooth; // whatever a mooth is
+.vector fireball_impactvec;
+.float fireball_primarytime;
+#endif
#include "hagar.qh"
-#ifndef IMPLEMENTATION
-CLASS(Hagar, Weapon)
-/* ammotype */ ATTRIB(Hagar, ammo_field, .int, ammo_rockets);
-/* impulse */ ATTRIB(Hagar, impulse, int, 8);
-/* flags */ ATTRIB(Hagar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(Hagar, bot_pickupbasevalue, float, 6000);
-/* color */ ATTRIB(Hagar, wpcolor, vector, '1 1 0.5');
-/* modelname */ ATTRIB(Hagar, mdl, string, "hagar");
-#ifdef GAMEQC
-/* model */ ATTRIB(Hagar, m_model, Model, MDL_HAGAR_ITEM);
-#endif
-/* crosshair */ ATTRIB(Hagar, w_crosshair, string, "gfx/crosshairhagar");
-/* crosshair */ ATTRIB(Hagar, w_crosshair_size, float, 0.8);
-/* wepimg */ ATTRIB(Hagar, model2, string, "weaponhagar");
-/* refname */ ATTRIB(Hagar, netname, string, "hagar");
-/* wepname */ ATTRIB(Hagar, m_name, string, _("Hagar"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, BOTH) \
- P(class, prefix, damageforcescale, float, BOTH) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, edgedamage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, health, float, BOTH) \
- P(class, prefix, lifetime, float, PRI) \
- P(class, prefix, lifetime_min, float, SEC) \
- P(class, prefix, lifetime_rand, float, SEC) \
- P(class, prefix, load, float, SEC) \
- P(class, prefix, load_abort, float, SEC) \
- P(class, prefix, load_animtime, float, SEC) \
- P(class, prefix, load_hold, float, SEC) \
- P(class, prefix, load_linkexplode, float, SEC) \
- P(class, prefix, load_max, float, SEC) \
- P(class, prefix, load_releasedeath, float, SEC) \
- P(class, prefix, load_speed, float, SEC) \
- P(class, prefix, load_spread, float, SEC) \
- P(class, prefix, load_spread_bias, float, SEC) \
- P(class, prefix, radius, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, spread, float, BOTH) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Hagar, hagar)
-#undef X
-
-ENDCLASS(Hagar)
-REGISTER_WEAPON(HAGAR, hagar, NEW(Hagar));
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_hagar) { weapon_defaultspawnfunc(this, WEP_HAGAR); }
}
#endif
-#endif
#pragma once
+
+CLASS(Hagar, Weapon)
+/* ammotype */ ATTRIB(Hagar, ammo_field, .int, ammo_rockets);
+/* impulse */ ATTRIB(Hagar, impulse, int, 8);
+/* flags */ ATTRIB(Hagar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(Hagar, bot_pickupbasevalue, float, 6000);
+/* color */ ATTRIB(Hagar, wpcolor, vector, '1 1 0.5');
+/* modelname */ ATTRIB(Hagar, mdl, string, "hagar");
+#ifdef GAMEQC
+/* model */ ATTRIB(Hagar, m_model, Model, MDL_HAGAR_ITEM);
+#endif
+/* crosshair */ ATTRIB(Hagar, w_crosshair, string, "gfx/crosshairhagar");
+/* crosshair */ ATTRIB(Hagar, w_crosshair_size, float, 0.8);
+/* wepimg */ ATTRIB(Hagar, model2, string, "weaponhagar");
+/* refname */ ATTRIB(Hagar, netname, string, "hagar");
+/* wepname */ ATTRIB(Hagar, m_name, string, _("Hagar"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, BOTH) \
+ P(class, prefix, damageforcescale, float, BOTH) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, edgedamage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, health, float, BOTH) \
+ P(class, prefix, lifetime, float, PRI) \
+ P(class, prefix, lifetime_min, float, SEC) \
+ P(class, prefix, lifetime_rand, float, SEC) \
+ P(class, prefix, load, float, SEC) \
+ P(class, prefix, load_abort, float, SEC) \
+ P(class, prefix, load_animtime, float, SEC) \
+ P(class, prefix, load_hold, float, SEC) \
+ P(class, prefix, load_linkexplode, float, SEC) \
+ P(class, prefix, load_max, float, SEC) \
+ P(class, prefix, load_releasedeath, float, SEC) \
+ P(class, prefix, load_speed, float, SEC) \
+ P(class, prefix, load_spread, float, SEC) \
+ P(class, prefix, load_spread_bias, float, SEC) \
+ P(class, prefix, radius, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, spread, float, BOTH) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Hagar, hagar)
+#undef X
+
+ENDCLASS(Hagar)
+REGISTER_WEAPON(HAGAR, hagar, NEW(Hagar));
#include "hlac.qh"
-#ifndef IMPLEMENTATION
-CLASS(HLAC, Weapon)
-/* ammotype */ ATTRIB(HLAC, ammo_field, .int, ammo_cells);
-/* impulse */ ATTRIB(HLAC, impulse, int, 6);
-/* flags */ ATTRIB(HLAC, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(HLAC, bot_pickupbasevalue, float, 4000);
-/* color */ ATTRIB(HLAC, wpcolor, vector, '0 1 0');
-/* modelname */ ATTRIB(HLAC, mdl, string, "hlac");
-#ifdef GAMEQC
-/* model */ ATTRIB(HLAC, m_model, Model, MDL_HLAC_ITEM);
-#endif
-/* crosshair */ ATTRIB(HLAC, w_crosshair, string, "gfx/crosshairhlac");
-/* crosshair */ ATTRIB(HLAC, w_crosshair_size, float, 0.6);
-/* wepimg */ ATTRIB(HLAC, model2, string, "weaponhlac");
-/* refname */ ATTRIB(HLAC, netname, string, "hlac");
-/* wepname */ ATTRIB(HLAC, m_name, string, _("Heavy Laser Assault Cannon"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, BOTH) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, edgedamage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, lifetime, float, BOTH) \
- P(class, prefix, radius, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, shots, float, SEC) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, spread, float, SEC) \
- P(class, prefix, spread_add, float, PRI) \
- P(class, prefix, spread_crouchmod, float, BOTH) \
- P(class, prefix, spread_max, float, PRI) \
- P(class, prefix, spread_min, float, PRI) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, HLAC, hlac)
-#undef X
-
-ENDCLASS(HLAC)
-REGISTER_WEAPON(HLAC, hlac, NEW(HLAC));
-
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_hlac) { weapon_defaultspawnfunc(this, WEP_HLAC); }
}
#endif
-#endif
#pragma once
+
+CLASS(HLAC, Weapon)
+/* ammotype */ ATTRIB(HLAC, ammo_field, .int, ammo_cells);
+/* impulse */ ATTRIB(HLAC, impulse, int, 6);
+/* flags */ ATTRIB(HLAC, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(HLAC, bot_pickupbasevalue, float, 4000);
+/* color */ ATTRIB(HLAC, wpcolor, vector, '0 1 0');
+/* modelname */ ATTRIB(HLAC, mdl, string, "hlac");
+#ifdef GAMEQC
+/* model */ ATTRIB(HLAC, m_model, Model, MDL_HLAC_ITEM);
+#endif
+/* crosshair */ ATTRIB(HLAC, w_crosshair, string, "gfx/crosshairhlac");
+/* crosshair */ ATTRIB(HLAC, w_crosshair_size, float, 0.6);
+/* wepimg */ ATTRIB(HLAC, model2, string, "weaponhlac");
+/* refname */ ATTRIB(HLAC, netname, string, "hlac");
+/* wepname */ ATTRIB(HLAC, m_name, string, _("Heavy Laser Assault Cannon"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, BOTH) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, edgedamage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, lifetime, float, BOTH) \
+ P(class, prefix, radius, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, shots, float, SEC) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, spread, float, SEC) \
+ P(class, prefix, spread_add, float, PRI) \
+ P(class, prefix, spread_crouchmod, float, BOTH) \
+ P(class, prefix, spread_max, float, PRI) \
+ P(class, prefix, spread_min, float, PRI) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, HLAC, hlac)
+#undef X
+
+ENDCLASS(HLAC)
+REGISTER_WEAPON(HLAC, hlac, NEW(HLAC));
#include "hook.qh"
-#ifndef IMPLEMENTATION
-CLASS(Hook, Weapon)
-/* ammotype */ ATTRIB(Hook, ammo_field, .int, ammo_fuel);
-/* impulse */ ATTRIB(Hook, impulse, int, 0);
-/* flags */ ATTRIB(Hook, spawnflags, int, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(Hook, bot_pickupbasevalue, float, 0);
-/* color */ ATTRIB(Hook, wpcolor, vector, '0 0.5 0');
-/* modelname */ ATTRIB(Hook, mdl, string, "hookgun");
-#ifdef GAMEQC
-/* model */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM);
-#endif
-/* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook");
-/* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5);
-/* wepimg */ ATTRIB(Hook, model2, string, "weaponhook");
-/* refname */ ATTRIB(Hook, netname, string, "hook");
-/* wepname */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
- ATTRIB(Hook, ammo_factor, float, 1);
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, PRI) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, damageforcescale, float, SEC) \
- P(class, prefix, damage, float, SEC) \
- P(class, prefix, duration, float, SEC) \
- P(class, prefix, edgedamage, float, SEC) \
- P(class, prefix, force, float, SEC) \
- P(class, prefix, gravity, float, SEC) \
- P(class, prefix, health, float, SEC) \
- P(class, prefix, hooked_ammo, float, PRI) \
- P(class, prefix, hooked_time_free, float, PRI) \
- P(class, prefix, hooked_time_max, float, PRI) \
- P(class, prefix, lifetime, float, SEC) \
- P(class, prefix, power, float, SEC) \
- P(class, prefix, radius, float, SEC) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, speed, float, SEC) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Hook, hook)
-#undef X
-
-ENDCLASS(Hook)
-REGISTER_WEAPON(HOOK, hook, NEW(Hook));
-
-CLASS(OffhandHook, OffhandWeapon)
-#ifdef SVQC
- METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
- {
- Weapon wep = WEP_HOOK;
- .entity weaponentity = weaponentities[1];
- wep.wr_think(wep, actor, weaponentity, key_pressed ? 1 : 0);
- }
-#endif
-ENDCLASS(OffhandHook)
-OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
#ifdef SVQC
-.float dmg;
-.float dmg_edge;
-.float dmg_radius;
-.float dmg_force;
-.float dmg_power;
-.float dmg_duration;
-.float dmg_last;
-.float hook_refire;
-.float hook_time_hooked;
-.float hook_time_fueldecrease;
-#endif
-#endif
-#ifdef IMPLEMENTATION
-#ifdef SVQC
-
spawnfunc(weapon_hook) { weapon_defaultspawnfunc(this, WEP_HOOK); }
void W_Hook_ExplodeThink(entity this)
// TODO: hook: temporarily transform this.origin for drawing the model along warpzones!
#endif
-
-#endif
#pragma once
+
+CLASS(Hook, Weapon)
+/* ammotype */ ATTRIB(Hook, ammo_field, .int, ammo_fuel);
+/* impulse */ ATTRIB(Hook, impulse, int, 0);
+/* flags */ ATTRIB(Hook, spawnflags, int, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(Hook, bot_pickupbasevalue, float, 0);
+/* color */ ATTRIB(Hook, wpcolor, vector, '0 0.5 0');
+/* modelname */ ATTRIB(Hook, mdl, string, "hookgun");
+#ifdef GAMEQC
+/* model */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM);
+#endif
+/* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook");
+/* crosshair */ ATTRIB(Hook, w_crosshair_size, float, 0.5);
+/* wepimg */ ATTRIB(Hook, model2, string, "weaponhook");
+/* refname */ ATTRIB(Hook, netname, string, "hook");
+/* wepname */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
+ ATTRIB(Hook, ammo_factor, float, 1);
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, PRI) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, damageforcescale, float, SEC) \
+ P(class, prefix, damage, float, SEC) \
+ P(class, prefix, duration, float, SEC) \
+ P(class, prefix, edgedamage, float, SEC) \
+ P(class, prefix, force, float, SEC) \
+ P(class, prefix, gravity, float, SEC) \
+ P(class, prefix, health, float, SEC) \
+ P(class, prefix, hooked_ammo, float, PRI) \
+ P(class, prefix, hooked_time_free, float, PRI) \
+ P(class, prefix, hooked_time_max, float, PRI) \
+ P(class, prefix, lifetime, float, SEC) \
+ P(class, prefix, power, float, SEC) \
+ P(class, prefix, radius, float, SEC) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, speed, float, SEC) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Hook, hook)
+#undef X
+
+ENDCLASS(Hook)
+REGISTER_WEAPON(HOOK, hook, NEW(Hook));
+
+CLASS(OffhandHook, OffhandWeapon)
+#ifdef SVQC
+ METHOD(OffhandHook, offhand_think, void(OffhandHook this, entity actor, bool key_pressed))
+ {
+ Weapon wep = WEP_HOOK;
+ .entity weaponentity = weaponentities[1];
+ wep.wr_think(wep, actor, weaponentity, key_pressed ? 1 : 0);
+ }
+#endif
+ENDCLASS(OffhandHook)
+OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
+
+#ifdef SVQC
+
+.float dmg;
+.float dmg_edge;
+.float dmg_radius;
+.float dmg_force;
+.float dmg_power;
+.float dmg_duration;
+.float dmg_last;
+.float hook_refire;
+.float hook_time_hooked;
+.float hook_time_fueldecrease;
+#endif
#include "machinegun.qh"
-#ifndef IMPLEMENTATION
-CLASS(MachineGun, Weapon)
-/* ammotype */ ATTRIB(MachineGun, ammo_field, .int, ammo_nails);
-/* impulse */ ATTRIB(MachineGun, impulse, int, 3);
-/* flags */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN);
-/* rating */ ATTRIB(MachineGun, bot_pickupbasevalue, float, 7000);
-/* color */ ATTRIB(MachineGun, wpcolor, vector, '1 1 0');
-/* modelname */ ATTRIB(MachineGun, mdl, string, "uzi");
-#ifdef GAMEQC
-/* model */ ATTRIB(MachineGun, m_model, Model, MDL_MACHINEGUN_ITEM);
-#endif
-/* crosshair */ ATTRIB(MachineGun, w_crosshair, string, "gfx/crosshairuzi");
-/* crosshair */ ATTRIB(MachineGun, w_crosshair_size, float, 0.6);
-/* wepimg */ ATTRIB(MachineGun, model2, string, "weaponuzi");
-/* refname */ ATTRIB(MachineGun, netname, string, "machinegun");
-/* wepname */ ATTRIB(MachineGun, m_name, string, _("MachineGun"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, burst, float, NONE) \
- P(class, prefix, burst_ammo, float, NONE) \
- P(class, prefix, burst_animtime, float, NONE) \
- P(class, prefix, burst_refire2, float, NONE) \
- P(class, prefix, burst_refire, float, NONE) \
- P(class, prefix, burst_speed, float, NONE) \
- P(class, prefix, first, float, NONE) \
- P(class, prefix, first_ammo, float, NONE) \
- P(class, prefix, first_damage, float, NONE) \
- P(class, prefix, first_force, float, NONE) \
- P(class, prefix, first_refire, float, NONE) \
- P(class, prefix, first_spread, float, NONE) \
- P(class, prefix, mode, float, NONE) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, solidpenetration, float, NONE) \
- P(class, prefix, spread_add, float, NONE) \
- P(class, prefix, spread_max, float, NONE) \
- P(class, prefix, spread_min, float, NONE) \
- P(class, prefix, sustained_ammo, float, NONE) \
- P(class, prefix, sustained_damage, float, NONE) \
- P(class, prefix, sustained_force, float, NONE) \
- P(class, prefix, sustained_refire, float, NONE) \
- P(class, prefix, sustained_spread, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, MachineGun, machinegun)
-#undef X
-
-ENDCLASS(MachineGun)
-REGISTER_WEAPON(MACHINEGUN, machinegun, NEW(MachineGun));
-
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_machinegun)
}
#endif
-#endif
#pragma once
+
+CLASS(MachineGun, Weapon)
+/* ammotype */ ATTRIB(MachineGun, ammo_field, .int, ammo_nails);
+/* impulse */ ATTRIB(MachineGun, impulse, int, 3);
+/* flags */ ATTRIB(MachineGun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
+/* rating */ ATTRIB(MachineGun, bot_pickupbasevalue, float, 7000);
+/* color */ ATTRIB(MachineGun, wpcolor, vector, '1 1 0');
+/* modelname */ ATTRIB(MachineGun, mdl, string, "uzi");
+#ifdef GAMEQC
+/* model */ ATTRIB(MachineGun, m_model, Model, MDL_MACHINEGUN_ITEM);
+#endif
+/* crosshair */ ATTRIB(MachineGun, w_crosshair, string, "gfx/crosshairuzi");
+/* crosshair */ ATTRIB(MachineGun, w_crosshair_size, float, 0.6);
+/* wepimg */ ATTRIB(MachineGun, model2, string, "weaponuzi");
+/* refname */ ATTRIB(MachineGun, netname, string, "machinegun");
+/* wepname */ ATTRIB(MachineGun, m_name, string, _("MachineGun"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, burst, float, NONE) \
+ P(class, prefix, burst_ammo, float, NONE) \
+ P(class, prefix, burst_animtime, float, NONE) \
+ P(class, prefix, burst_refire2, float, NONE) \
+ P(class, prefix, burst_refire, float, NONE) \
+ P(class, prefix, burst_speed, float, NONE) \
+ P(class, prefix, first, float, NONE) \
+ P(class, prefix, first_ammo, float, NONE) \
+ P(class, prefix, first_damage, float, NONE) \
+ P(class, prefix, first_force, float, NONE) \
+ P(class, prefix, first_refire, float, NONE) \
+ P(class, prefix, first_spread, float, NONE) \
+ P(class, prefix, mode, float, NONE) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, solidpenetration, float, NONE) \
+ P(class, prefix, spread_add, float, NONE) \
+ P(class, prefix, spread_max, float, NONE) \
+ P(class, prefix, spread_min, float, NONE) \
+ P(class, prefix, sustained_ammo, float, NONE) \
+ P(class, prefix, sustained_damage, float, NONE) \
+ P(class, prefix, sustained_force, float, NONE) \
+ P(class, prefix, sustained_refire, float, NONE) \
+ P(class, prefix, sustained_spread, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, MachineGun, machinegun)
+#undef X
+
+ENDCLASS(MachineGun)
+REGISTER_WEAPON(MACHINEGUN, machinegun, NEW(MachineGun));
#include "minelayer.qh"
-#ifndef IMPLEMENTATION
-CLASS(MineLayer, Weapon)
-/* ammotype */ ATTRIB(MineLayer, ammo_field, .int, ammo_rockets);
-/* impulse */ ATTRIB(MineLayer, impulse, int, 4);
-/* flags */ ATTRIB(MineLayer, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(MineLayer, bot_pickupbasevalue, float, 7000);
-/* color */ ATTRIB(MineLayer, wpcolor, vector, '0.75 1 0');
-/* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer");
-#ifdef GAMEQC
-/* model */ ATTRIB(MineLayer, m_model, Model, MDL_MINELAYER_ITEM);
-#endif
-/* crosshair */ ATTRIB(MineLayer, w_crosshair, string, "gfx/crosshairminelayer");
-/* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9);
-/* wepimg */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
-/* refname */ ATTRIB(MineLayer, netname, string, "minelayer");
-/* wepname */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, NONE) \
- P(class, prefix, animtime, float, NONE) \
- P(class, prefix, damageforcescale, float, NONE) \
- P(class, prefix, damage, float, NONE) \
- P(class, prefix, detonatedelay, float, NONE) \
- P(class, prefix, edgedamage, float, NONE) \
- P(class, prefix, force, float, NONE) \
- P(class, prefix, health, float, NONE) \
- P(class, prefix, lifetime, float, NONE) \
- P(class, prefix, lifetime_countdown, float, NONE) \
- P(class, prefix, limit, float, NONE) \
- P(class, prefix, protection, float, NONE) \
- P(class, prefix, proximityradius, float, NONE) \
- P(class, prefix, radius, float, NONE) \
- P(class, prefix, refire, float, NONE) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, remote_damage, float, NONE) \
- P(class, prefix, remote_edgedamage, float, NONE) \
- P(class, prefix, remote_force, float, NONE) \
- P(class, prefix, remote_radius, float, NONE) \
- P(class, prefix, speed, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, time, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, MineLayer, minelayer)
-#undef X
-ENDCLASS(MineLayer)
-REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
-#ifdef SVQC
-void W_MineLayer_Think(entity this);
-.float minelayer_detonate, mine_explodeanyway;
-.float mine_time;
-.vector mine_orientation;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_minelayer) { weapon_defaultspawnfunc(this, WEP_MINE_LAYER); }
}
#endif
-#endif
#pragma once
+
+CLASS(MineLayer, Weapon)
+/* ammotype */ ATTRIB(MineLayer, ammo_field, .int, ammo_rockets);
+/* impulse */ ATTRIB(MineLayer, impulse, int, 4);
+/* flags */ ATTRIB(MineLayer, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(MineLayer, bot_pickupbasevalue, float, 7000);
+/* color */ ATTRIB(MineLayer, wpcolor, vector, '0.75 1 0');
+/* modelname */ ATTRIB(MineLayer, mdl, string, "minelayer");
+#ifdef GAMEQC
+/* model */ ATTRIB(MineLayer, m_model, Model, MDL_MINELAYER_ITEM);
+#endif
+/* crosshair */ ATTRIB(MineLayer, w_crosshair, string, "gfx/crosshairminelayer");
+/* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9);
+/* wepimg */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
+/* refname */ ATTRIB(MineLayer, netname, string, "minelayer");
+/* wepname */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, NONE) \
+ P(class, prefix, animtime, float, NONE) \
+ P(class, prefix, damageforcescale, float, NONE) \
+ P(class, prefix, damage, float, NONE) \
+ P(class, prefix, detonatedelay, float, NONE) \
+ P(class, prefix, edgedamage, float, NONE) \
+ P(class, prefix, force, float, NONE) \
+ P(class, prefix, health, float, NONE) \
+ P(class, prefix, lifetime, float, NONE) \
+ P(class, prefix, lifetime_countdown, float, NONE) \
+ P(class, prefix, limit, float, NONE) \
+ P(class, prefix, protection, float, NONE) \
+ P(class, prefix, proximityradius, float, NONE) \
+ P(class, prefix, radius, float, NONE) \
+ P(class, prefix, refire, float, NONE) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, remote_damage, float, NONE) \
+ P(class, prefix, remote_edgedamage, float, NONE) \
+ P(class, prefix, remote_force, float, NONE) \
+ P(class, prefix, remote_radius, float, NONE) \
+ P(class, prefix, speed, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, time, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, MineLayer, minelayer)
+#undef X
+ENDCLASS(MineLayer)
+REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
+
+#ifdef SVQC
+void W_MineLayer_Think(entity this);
+.float minelayer_detonate, mine_explodeanyway;
+.float mine_time;
+.vector mine_orientation;
+#endif
#include "mortar.qh"
-#ifndef IMPLEMENTATION
-CLASS(Mortar, Weapon)
-/* ammotype */ ATTRIB(Mortar, ammo_field, .int, ammo_rockets);
-/* impulse */ ATTRIB(Mortar, impulse, int, 4);
-/* flags */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(Mortar, bot_pickupbasevalue, float, 7000);
-/* color */ ATTRIB(Mortar, wpcolor, vector, '1 0 0');
-/* modelname */ ATTRIB(Mortar, mdl, string, "gl");
-#ifdef GAMEQC
-/* model */ ATTRIB(Mortar, m_model, Model, MDL_MORTAR_ITEM);
-#endif
-/* crosshair */ ATTRIB(Mortar, w_crosshair, string, "gfx/crosshairgrenadelauncher");
-/* crosshair */ ATTRIB(Mortar, w_crosshair_size, float, 0.7);
-/* wepimg */ ATTRIB(Mortar, model2, string, "weapongrenadelauncher");
-/* refname */ ATTRIB(Mortar, netname, string, "mortar");
-/* wepname */ ATTRIB(Mortar, m_name, string, _("Mortar"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, BOTH) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, bouncefactor, float, NONE) \
- P(class, prefix, bouncestop, float, NONE) \
- P(class, prefix, damageforcescale, float, BOTH) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, edgedamage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, health, float, BOTH) \
- P(class, prefix, lifetime, float, BOTH) \
- P(class, prefix, lifetime_bounce, float, SEC) \
- P(class, prefix, lifetime_stick, float, BOTH) \
- P(class, prefix, radius, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, remote_detonateprimary, float, SEC) \
- P(class, prefix, remote_minbouncecnt, float, PRI) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, speed_up, float, BOTH) \
- P(class, prefix, speed_z, float, BOTH) \
- P(class, prefix, spread, float, BOTH) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, type, float, BOTH) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Mortar, mortar)
-#undef X
-ENDCLASS(Mortar)
-REGISTER_WEAPON(MORTAR, mortar, NEW(Mortar));
-
-#ifdef SVQC
-.float gl_detonate_later;
-.float gl_bouncecnt;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_mortar) { weapon_defaultspawnfunc(this, WEP_MORTAR); }
}
#endif
-#endif
#pragma once
+
+CLASS(Mortar, Weapon)
+/* ammotype */ ATTRIB(Mortar, ammo_field, .int, ammo_rockets);
+/* impulse */ ATTRIB(Mortar, impulse, int, 4);
+/* flags */ ATTRIB(Mortar, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(Mortar, bot_pickupbasevalue, float, 7000);
+/* color */ ATTRIB(Mortar, wpcolor, vector, '1 0 0');
+/* modelname */ ATTRIB(Mortar, mdl, string, "gl");
+#ifdef GAMEQC
+/* model */ ATTRIB(Mortar, m_model, Model, MDL_MORTAR_ITEM);
+#endif
+/* crosshair */ ATTRIB(Mortar, w_crosshair, string, "gfx/crosshairgrenadelauncher");
+/* crosshair */ ATTRIB(Mortar, w_crosshair_size, float, 0.7);
+/* wepimg */ ATTRIB(Mortar, model2, string, "weapongrenadelauncher");
+/* refname */ ATTRIB(Mortar, netname, string, "mortar");
+/* wepname */ ATTRIB(Mortar, m_name, string, _("Mortar"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, BOTH) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, bouncefactor, float, NONE) \
+ P(class, prefix, bouncestop, float, NONE) \
+ P(class, prefix, damageforcescale, float, BOTH) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, edgedamage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, health, float, BOTH) \
+ P(class, prefix, lifetime, float, BOTH) \
+ P(class, prefix, lifetime_bounce, float, SEC) \
+ P(class, prefix, lifetime_stick, float, BOTH) \
+ P(class, prefix, radius, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, remote_detonateprimary, float, SEC) \
+ P(class, prefix, remote_minbouncecnt, float, PRI) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, speed_up, float, BOTH) \
+ P(class, prefix, speed_z, float, BOTH) \
+ P(class, prefix, spread, float, BOTH) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, type, float, BOTH) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Mortar, mortar)
+#undef X
+ENDCLASS(Mortar)
+REGISTER_WEAPON(MORTAR, mortar, NEW(Mortar));
+
+
+#ifdef SVQC
+.float gl_detonate_later;
+.float gl_bouncecnt;
+#endif
#include "porto.qh"
-#ifndef IMPLEMENTATION
-CLASS(PortoLaunch, Weapon)
-/* ammotype */ ATTRIB(PortoLaunch, ammo_field, .int, ammo_none);
-/* impulse */ ATTRIB(PortoLaunch, impulse, int, 0);
-/* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NODUAL);
-/* rating */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0);
-/* color */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5');
-/* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto");
-#ifdef GAMEQC
-/* model */ ATTRIB(PortoLaunch, m_model, Model, MDL_PORTO_ITEM);
-#endif
-/* crosshair */ ATTRIB(PortoLaunch, w_crosshair, string, "gfx/crosshairporto");
-/* crosshair */ ATTRIB(PortoLaunch, w_crosshair_size, float, 0.6);
-/* wepimg */ ATTRIB(PortoLaunch, model2, string, "weaponporto");
-/* refname */ ATTRIB(PortoLaunch, netname, string, "porto");
-/* wepname */ ATTRIB(PortoLaunch, m_name, string, _("Port-O-Launch"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, lifetime, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, speed, float, BOTH) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, PortoLaunch, porto)
-#undef X
-ENDCLASS(PortoLaunch)
-REGISTER_WEAPON(PORTO, porto, NEW(PortoLaunch));
-#ifdef SVQC
-.entity porto_current;
-.vector porto_v_angle; // holds "held" view angles
-.float porto_v_angle_held;
-.vector right_vector;
-.float porto_forbidden;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
#include <common/triggers/trigger/jumppads.qh>
LOG_WARN("Since when does Porto send DamageInfo?");
}
#endif
-#endif
#pragma once
+
+CLASS(PortoLaunch, Weapon)
+/* ammotype */ ATTRIB(PortoLaunch, ammo_field, .int, ammo_none);
+/* impulse */ ATTRIB(PortoLaunch, impulse, int, 0);
+/* flags */ ATTRIB(PortoLaunch, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON | WEP_FLAG_NODUAL);
+/* rating */ ATTRIB(PortoLaunch, bot_pickupbasevalue, float, 0);
+/* color */ ATTRIB(PortoLaunch, wpcolor, vector, '0.5 0.5 0.5');
+/* modelname */ ATTRIB(PortoLaunch, mdl, string, "porto");
+#ifdef GAMEQC
+/* model */ ATTRIB(PortoLaunch, m_model, Model, MDL_PORTO_ITEM);
+#endif
+/* crosshair */ ATTRIB(PortoLaunch, w_crosshair, string, "gfx/crosshairporto");
+/* crosshair */ ATTRIB(PortoLaunch, w_crosshair_size, float, 0.6);
+/* wepimg */ ATTRIB(PortoLaunch, model2, string, "weaponporto");
+/* refname */ ATTRIB(PortoLaunch, netname, string, "porto");
+/* wepname */ ATTRIB(PortoLaunch, m_name, string, _("Port-O-Launch"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, lifetime, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, speed, float, BOTH) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, PortoLaunch, porto)
+#undef X
+ENDCLASS(PortoLaunch)
+REGISTER_WEAPON(PORTO, porto, NEW(PortoLaunch));
+
+#ifdef SVQC
+.entity porto_current;
+.vector porto_v_angle; // holds "held" view angles
+.float porto_v_angle_held;
+.vector right_vector;
+.float porto_forbidden;
+#endif
#include "rifle.qh"
-#ifndef IMPLEMENTATION
-CLASS(Rifle, Weapon)
-/* ammotype */ ATTRIB(Rifle, ammo_field, .int, ammo_nails);
-/* impulse */ ATTRIB(Rifle, impulse, int, 7);
-/* flags */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN);
-/* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
-/* color */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0');
-/* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
-#ifdef GAMEQC
-/* model */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM);
-#endif
-/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
-/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
-/* reticle */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
-/* wepimg */ ATTRIB(Rifle, model2, string, "weaponrifle");
-/* refname */ ATTRIB(Rifle, netname, string, "rifle");
-/* wepname */ ATTRIB(Rifle, m_name, string, _("Rifle"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, BOTH) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, bullethail, float, BOTH) \
- P(class, prefix, burstcost, float, BOTH) \
- P(class, prefix, bursttime, float, NONE) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, reload, float, SEC) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, shots, float, BOTH) \
- P(class, prefix, solidpenetration, float, BOTH) \
- P(class, prefix, spread, float, BOTH) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, tracer, float, BOTH) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Rifle, rifle)
-#undef X
-ENDCLASS(Rifle)
-REGISTER_WEAPON(RIFLE, rifle, NEW(Rifle));
-
-#ifdef SVQC
-.float rifle_accumulator;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_rifle) { weapon_defaultspawnfunc(this, WEP_RIFLE); }
spawnfunc(weapon_campingrifle) { spawnfunc_weapon_rifle(this); }
}
#endif
-#endif
#pragma once
+
+CLASS(Rifle, Weapon)
+/* ammotype */ ATTRIB(Rifle, ammo_field, .int, ammo_nails);
+/* impulse */ ATTRIB(Rifle, impulse, int, 7);
+/* flags */ ATTRIB(Rifle, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_PENETRATEWALLS);
+/* rating */ ATTRIB(Rifle, bot_pickupbasevalue, float, 7000);
+/* color */ ATTRIB(Rifle, wpcolor, vector, '0.5 1 0');
+/* modelname */ ATTRIB(Rifle, mdl, string, "campingrifle");
+#ifdef GAMEQC
+/* model */ ATTRIB(Rifle, m_model, Model, MDL_RIFLE_ITEM);
+#endif
+/* crosshair */ ATTRIB(Rifle, w_crosshair, string, "gfx/crosshairrifle");
+/* crosshair */ ATTRIB(Rifle, w_crosshair_size, float, 0.6);
+/* reticle */ ATTRIB(Rifle, w_reticle, string, "gfx/reticle_nex");
+/* wepimg */ ATTRIB(Rifle, model2, string, "weaponrifle");
+/* refname */ ATTRIB(Rifle, netname, string, "rifle");
+/* wepname */ ATTRIB(Rifle, m_name, string, _("Rifle"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, BOTH) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, bullethail, float, BOTH) \
+ P(class, prefix, burstcost, float, BOTH) \
+ P(class, prefix, bursttime, float, NONE) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, reload, float, SEC) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, shots, float, BOTH) \
+ P(class, prefix, solidpenetration, float, BOTH) \
+ P(class, prefix, spread, float, BOTH) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, tracer, float, BOTH) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Rifle, rifle)
+#undef X
+ENDCLASS(Rifle)
+REGISTER_WEAPON(RIFLE, rifle, NEW(Rifle));
+
+
+#ifdef SVQC
+.float rifle_accumulator;
+#endif
#include "seeker.qh"
-#ifndef IMPLEMENTATION
-CLASS(Seeker, Weapon)
-/* ammotype */ ATTRIB(Seeker, ammo_field, .int, ammo_rockets);
-/* impulse */ ATTRIB(Seeker, impulse, int, 8);
-/* flags */ ATTRIB(Seeker, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
-/* rating */ ATTRIB(Seeker, bot_pickupbasevalue, float, 5000);
-/* color */ ATTRIB(Seeker, wpcolor, vector, '0.5 1 0');
-/* modelname */ ATTRIB(Seeker, mdl, string, "seeker");
-#ifdef GAMEQC
-/* model */ ATTRIB(Seeker, m_model, Model, MDL_SEEKER_ITEM);
-#endif
-/* crosshair */ ATTRIB(Seeker, w_crosshair, string, "gfx/crosshairseeker");
-/* crosshair */ ATTRIB(Seeker, w_crosshair_size, float, 0.8);
-/* wepimg */ ATTRIB(Seeker, model2, string, "weaponseeker");
-/* refname */ ATTRIB(Seeker, netname, string, "seeker");
-/* wepname */ ATTRIB(Seeker, m_name, string, _("T.A.G. Seeker"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, flac_ammo, float, NONE) \
- P(class, prefix, flac_animtime, float, NONE) \
- P(class, prefix, flac_damage, float, NONE) \
- P(class, prefix, flac_edgedamage, float, NONE) \
- P(class, prefix, flac_force, float, NONE) \
- P(class, prefix, flac_lifetime, float, NONE) \
- P(class, prefix, flac_lifetime_rand, float, NONE) \
- P(class, prefix, flac_radius, float, NONE) \
- P(class, prefix, flac_refire, float, NONE) \
- P(class, prefix, flac_speed, float, NONE) \
- P(class, prefix, flac_speed_up, float, NONE) \
- P(class, prefix, flac_speed_z, float, NONE) \
- P(class, prefix, flac_spread, float, NONE) \
- P(class, prefix, missile_accel, float, NONE) \
- P(class, prefix, missile_ammo, float, NONE) \
- P(class, prefix, missile_animtime, float, NONE) \
- P(class, prefix, missile_count, float, NONE) \
- P(class, prefix, missile_damageforcescale, float, NONE) \
- P(class, prefix, missile_damage, float, NONE) \
- P(class, prefix, missile_decel, float, NONE) \
- P(class, prefix, missile_delay, float, NONE) \
- P(class, prefix, missile_edgedamage, float, NONE) \
- P(class, prefix, missile_force, float, NONE) \
- P(class, prefix, missile_health, float, NONE) \
- P(class, prefix, missile_lifetime, float, NONE) \
- P(class, prefix, missile_proxy, float, NONE) \
- P(class, prefix, missile_proxy_delay, float, NONE) \
- P(class, prefix, missile_proxy_maxrange, float, NONE) \
- P(class, prefix, missile_radius, float, NONE) \
- P(class, prefix, missile_refire, float, NONE) \
- P(class, prefix, missile_smart, float, NONE) \
- P(class, prefix, missile_smart_mindist, float, NONE) \
- P(class, prefix, missile_smart_trace_max, float, NONE) \
- P(class, prefix, missile_smart_trace_min, float, NONE) \
- P(class, prefix, missile_speed, float, NONE) \
- P(class, prefix, missile_speed_max, float, NONE) \
- P(class, prefix, missile_speed_up, float, NONE) \
- P(class, prefix, missile_speed_z, float, NONE) \
- P(class, prefix, missile_spread, float, NONE) \
- P(class, prefix, missile_turnrate, float, NONE) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, tag_ammo, float, NONE) \
- P(class, prefix, tag_animtime, float, NONE) \
- P(class, prefix, tag_damageforcescale, float, NONE) \
- P(class, prefix, tag_health, float, NONE) \
- P(class, prefix, tag_lifetime, float, NONE) \
- P(class, prefix, tag_refire, float, NONE) \
- P(class, prefix, tag_speed, float, NONE) \
- P(class, prefix, tag_spread, float, NONE) \
- P(class, prefix, tag_tracker_lifetime, float, NONE) \
- P(class, prefix, type, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Seeker, seeker)
-#undef X
-ENDCLASS(Seeker)
-REGISTER_WEAPON(SEEKER, seeker, NEW(Seeker));
-
-#ifdef SVQC
-.entity tag_target, wps_tag_tracker;
-.float tag_time;
-#endif
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_seeker) { weapon_defaultspawnfunc(this, WEP_SEEKER); }
}
#endif
-#endif
#pragma once
+CLASS(Seeker, Weapon)
+/* ammotype */ ATTRIB(Seeker, ammo_field, .int, ammo_rockets);
+/* impulse */ ATTRIB(Seeker, impulse, int, 8);
+/* flags */ ATTRIB(Seeker, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH);
+/* rating */ ATTRIB(Seeker, bot_pickupbasevalue, float, 5000);
+/* color */ ATTRIB(Seeker, wpcolor, vector, '0.5 1 0');
+/* modelname */ ATTRIB(Seeker, mdl, string, "seeker");
+#ifdef GAMEQC
+/* model */ ATTRIB(Seeker, m_model, Model, MDL_SEEKER_ITEM);
+#endif
+/* crosshair */ ATTRIB(Seeker, w_crosshair, string, "gfx/crosshairseeker");
+/* crosshair */ ATTRIB(Seeker, w_crosshair_size, float, 0.8);
+/* wepimg */ ATTRIB(Seeker, model2, string, "weaponseeker");
+/* refname */ ATTRIB(Seeker, netname, string, "seeker");
+/* wepname */ ATTRIB(Seeker, m_name, string, _("T.A.G. Seeker"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, flac_ammo, float, NONE) \
+ P(class, prefix, flac_animtime, float, NONE) \
+ P(class, prefix, flac_damage, float, NONE) \
+ P(class, prefix, flac_edgedamage, float, NONE) \
+ P(class, prefix, flac_force, float, NONE) \
+ P(class, prefix, flac_lifetime, float, NONE) \
+ P(class, prefix, flac_lifetime_rand, float, NONE) \
+ P(class, prefix, flac_radius, float, NONE) \
+ P(class, prefix, flac_refire, float, NONE) \
+ P(class, prefix, flac_speed, float, NONE) \
+ P(class, prefix, flac_speed_up, float, NONE) \
+ P(class, prefix, flac_speed_z, float, NONE) \
+ P(class, prefix, flac_spread, float, NONE) \
+ P(class, prefix, missile_accel, float, NONE) \
+ P(class, prefix, missile_ammo, float, NONE) \
+ P(class, prefix, missile_animtime, float, NONE) \
+ P(class, prefix, missile_count, float, NONE) \
+ P(class, prefix, missile_damageforcescale, float, NONE) \
+ P(class, prefix, missile_damage, float, NONE) \
+ P(class, prefix, missile_decel, float, NONE) \
+ P(class, prefix, missile_delay, float, NONE) \
+ P(class, prefix, missile_edgedamage, float, NONE) \
+ P(class, prefix, missile_force, float, NONE) \
+ P(class, prefix, missile_health, float, NONE) \
+ P(class, prefix, missile_lifetime, float, NONE) \
+ P(class, prefix, missile_proxy, float, NONE) \
+ P(class, prefix, missile_proxy_delay, float, NONE) \
+ P(class, prefix, missile_proxy_maxrange, float, NONE) \
+ P(class, prefix, missile_radius, float, NONE) \
+ P(class, prefix, missile_refire, float, NONE) \
+ P(class, prefix, missile_smart, float, NONE) \
+ P(class, prefix, missile_smart_mindist, float, NONE) \
+ P(class, prefix, missile_smart_trace_max, float, NONE) \
+ P(class, prefix, missile_smart_trace_min, float, NONE) \
+ P(class, prefix, missile_speed, float, NONE) \
+ P(class, prefix, missile_speed_max, float, NONE) \
+ P(class, prefix, missile_speed_up, float, NONE) \
+ P(class, prefix, missile_speed_z, float, NONE) \
+ P(class, prefix, missile_spread, float, NONE) \
+ P(class, prefix, missile_turnrate, float, NONE) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, tag_ammo, float, NONE) \
+ P(class, prefix, tag_animtime, float, NONE) \
+ P(class, prefix, tag_damageforcescale, float, NONE) \
+ P(class, prefix, tag_health, float, NONE) \
+ P(class, prefix, tag_lifetime, float, NONE) \
+ P(class, prefix, tag_refire, float, NONE) \
+ P(class, prefix, tag_speed, float, NONE) \
+ P(class, prefix, tag_spread, float, NONE) \
+ P(class, prefix, tag_tracker_lifetime, float, NONE) \
+ P(class, prefix, type, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Seeker, seeker)
+#undef X
+ENDCLASS(Seeker)
+REGISTER_WEAPON(SEEKER, seeker, NEW(Seeker));
+
#ifdef SVQC
+.entity tag_target, wps_tag_tracker;
+.float tag_time;
+
IntrusiveList g_seeker_trackers;
STATIC_INIT(g_seeker_trackers) { g_seeker_trackers = IL_NEW(); }
#endif
#include "shockwave.qh"
-#ifndef IMPLEMENTATION
-CLASS(Shockwave, Weapon)
-/* ammotype */ //ATTRIB(Shockwave, ammo_field, .int, ammo_none);
-/* impulse */ ATTRIB(Shockwave, impulse, int, 2);
-/* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
-/* rating */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000);
-/* color */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0');
-/* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun");
-#ifdef GAMEQC
-/* model */ ATTRIB(Shockwave, m_model, Model, MDL_SHOCKWAVE_ITEM);
-#endif
-/* crosshair */ ATTRIB(Shockwave, w_crosshair, string, "gfx/crosshairshotgun");
-/* crosshair */ ATTRIB(Shockwave, w_crosshair_size, float, 0.7);
-/* wepimg */ ATTRIB(Shockwave, model2, string, "weaponshockwave");
-/* refname */ ATTRIB(Shockwave, netname, string, "shockwave");
-/* wepname */ ATTRIB(Shockwave, m_name, string, _("Shockwave"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, blast_animtime, float, NONE) \
- P(class, prefix, blast_damage, float, NONE) \
- P(class, prefix, blast_distance, float, NONE) \
- P(class, prefix, blast_edgedamage, float, NONE) \
- P(class, prefix, blast_force, float, NONE) \
- P(class, prefix, blast_force_forwardbias, float, NONE) \
- P(class, prefix, blast_force_zscale, float, NONE) \
- P(class, prefix, blast_jump_damage, float, NONE) \
- P(class, prefix, blast_jump_edgedamage, float, NONE) \
- P(class, prefix, blast_jump_force, float, NONE) \
- P(class, prefix, blast_jump_force_velocitybias, float, NONE) \
- P(class, prefix, blast_jump_force_zscale, float, NONE) \
- P(class, prefix, blast_jump_multiplier_accuracy, float, NONE) \
- P(class, prefix, blast_jump_multiplier_distance, float, NONE) \
- P(class, prefix, blast_jump_multiplier_min, float, NONE) \
- P(class, prefix, blast_jump_radius, float, NONE) \
- P(class, prefix, blast_multiplier_accuracy, float, NONE) \
- P(class, prefix, blast_multiplier_distance, float, NONE) \
- P(class, prefix, blast_multiplier_min, float, NONE) \
- P(class, prefix, blast_refire, float, NONE) \
- P(class, prefix, blast_splash_damage, float, NONE) \
- P(class, prefix, blast_splash_edgedamage, float, NONE) \
- P(class, prefix, blast_splash_force, float, NONE) \
- P(class, prefix, blast_splash_force_forwardbias, float, NONE) \
- P(class, prefix, blast_splash_multiplier_accuracy, float, NONE) \
- P(class, prefix, blast_splash_multiplier_distance, float, NONE) \
- P(class, prefix, blast_splash_multiplier_min, float, NONE) \
- P(class, prefix, blast_splash_radius, float, NONE) \
- P(class, prefix, blast_spread_max, float, NONE) \
- P(class, prefix, blast_spread_min, float, NONE) \
- P(class, prefix, melee_animtime, float, NONE) \
- P(class, prefix, melee_damage, float, NONE) \
- P(class, prefix, melee_delay, float, NONE) \
- P(class, prefix, melee_force, float, NONE) \
- P(class, prefix, melee_multihit, float, NONE) \
- P(class, prefix, melee_no_doubleslap, float, NONE) \
- P(class, prefix, melee_nonplayerdamage, float, NONE) \
- P(class, prefix, melee_range, float, NONE) \
- P(class, prefix, melee_refire, float, NONE) \
- P(class, prefix, melee_swing_side, float, NONE) \
- P(class, prefix, melee_swing_up, float, NONE) \
- P(class, prefix, melee_time, float, NONE) \
- P(class, prefix, melee_traces, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Shockwave, shockwave)
-#undef X
-
-ENDCLASS(Shockwave)
-REGISTER_WEAPON(SHOCKWAVE, shockwave, NEW(Shockwave));
-
-
-#ifdef CSQC
-void Net_ReadShockwaveParticle();
-.vector sw_shotorg;
-.vector sw_shotdir;
-.float sw_distance;
-.float sw_spread_max;
-.float sw_spread_min;
-.float sw_time;
-#endif
-#endif
-#ifdef IMPLEMENTATION
REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE)
{ accuracy_add(this.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
#ifdef DEBUG_SHOCKWAVE
- LOG_INFO(sprintf(
- "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
+ LOG_INFOF(
+ "MELEE: %s hitting %s with %f damage (factor: %f) at %f time.",
this.realowner.netname,
target_victim.netname,
swing_damage,
swing_factor,
time
- ));
+ );
#endif
// allow multiple hits with one swing, but not against the same player twice
);
#ifdef DEBUG_SHOCKWAVE
- LOG_INFO(sprintf(
+ LOG_INFOF(
"SELF HIT: multiplier = %f, damage = %f, force = %f... "
- "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
+ "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
multiplier,
final_damage,
vlen(final_force),
multiplier_from_accuracy,
multiplier_from_distance
- ));
+ );
#endif
}
else if(distance_to_head <= WEP_CVAR(shockwave, blast_splash_radius))
if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
#ifdef DEBUG_SHOCKWAVE
- LOG_INFO(sprintf(
+ LOG_INFOF(
"SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
- "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
+ "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
multiplier,
final_damage,
vlen(final_force),
multiplier_from_accuracy,
multiplier_from_distance
- ));
+ );
#endif
}
}
if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
#ifdef DEBUG_SHOCKWAVE
- LOG_INFO(sprintf(
+ LOG_INFOF(
"BLAST HIT: multiplier = %f, damage = %f, force = %f... "
- "multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
+ "multiplier_from_accuracy = %f, multiplier_from_distance = %f.",
multiplier,
final_damage,
vlen(final_force),
multiplier_from_accuracy,
multiplier_from_distance
- ));
+ );
#endif
}
}
accuracy_add(actor, WEP_SHOCKWAVE.m_id, 0, final_damage);
#ifdef DEBUG_SHOCKWAVE
- LOG_INFO(sprintf(
- "SHOCKWAVE by %s: damage = %f, force = %f.\n",
+ LOG_INFOF(
+ "SHOCKWAVE by %s: damage = %f, force = %f.",
actor.netname,
final_damage,
vlen(final_force)
- ));
+ );
#endif
shockwave_hit[i-1] = NULL;
}
#endif
-#endif
#pragma once
+
+CLASS(Shockwave, Weapon)
+/* ammotype */ //ATTRIB(Shockwave, ammo_field, .int, ammo_none);
+/* impulse */ ATTRIB(Shockwave, impulse, int, 2);
+/* flags */ ATTRIB(Shockwave, spawnflags, int, WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
+/* rating */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000);
+/* color */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0');
+/* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun");
+#ifdef GAMEQC
+/* model */ ATTRIB(Shockwave, m_model, Model, MDL_SHOCKWAVE_ITEM);
+#endif
+/* crosshair */ ATTRIB(Shockwave, w_crosshair, string, "gfx/crosshairshotgun");
+/* crosshair */ ATTRIB(Shockwave, w_crosshair_size, float, 0.7);
+/* wepimg */ ATTRIB(Shockwave, model2, string, "weaponshockwave");
+/* refname */ ATTRIB(Shockwave, netname, string, "shockwave");
+/* wepname */ ATTRIB(Shockwave, m_name, string, _("Shockwave"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, blast_animtime, float, NONE) \
+ P(class, prefix, blast_damage, float, NONE) \
+ P(class, prefix, blast_distance, float, NONE) \
+ P(class, prefix, blast_edgedamage, float, NONE) \
+ P(class, prefix, blast_force, float, NONE) \
+ P(class, prefix, blast_force_forwardbias, float, NONE) \
+ P(class, prefix, blast_force_zscale, float, NONE) \
+ P(class, prefix, blast_jump_damage, float, NONE) \
+ P(class, prefix, blast_jump_edgedamage, float, NONE) \
+ P(class, prefix, blast_jump_force, float, NONE) \
+ P(class, prefix, blast_jump_force_velocitybias, float, NONE) \
+ P(class, prefix, blast_jump_force_zscale, float, NONE) \
+ P(class, prefix, blast_jump_multiplier_accuracy, float, NONE) \
+ P(class, prefix, blast_jump_multiplier_distance, float, NONE) \
+ P(class, prefix, blast_jump_multiplier_min, float, NONE) \
+ P(class, prefix, blast_jump_radius, float, NONE) \
+ P(class, prefix, blast_multiplier_accuracy, float, NONE) \
+ P(class, prefix, blast_multiplier_distance, float, NONE) \
+ P(class, prefix, blast_multiplier_min, float, NONE) \
+ P(class, prefix, blast_refire, float, NONE) \
+ P(class, prefix, blast_splash_damage, float, NONE) \
+ P(class, prefix, blast_splash_edgedamage, float, NONE) \
+ P(class, prefix, blast_splash_force, float, NONE) \
+ P(class, prefix, blast_splash_force_forwardbias, float, NONE) \
+ P(class, prefix, blast_splash_multiplier_accuracy, float, NONE) \
+ P(class, prefix, blast_splash_multiplier_distance, float, NONE) \
+ P(class, prefix, blast_splash_multiplier_min, float, NONE) \
+ P(class, prefix, blast_splash_radius, float, NONE) \
+ P(class, prefix, blast_spread_max, float, NONE) \
+ P(class, prefix, blast_spread_min, float, NONE) \
+ P(class, prefix, melee_animtime, float, NONE) \
+ P(class, prefix, melee_damage, float, NONE) \
+ P(class, prefix, melee_delay, float, NONE) \
+ P(class, prefix, melee_force, float, NONE) \
+ P(class, prefix, melee_multihit, float, NONE) \
+ P(class, prefix, melee_no_doubleslap, float, NONE) \
+ P(class, prefix, melee_nonplayerdamage, float, NONE) \
+ P(class, prefix, melee_range, float, NONE) \
+ P(class, prefix, melee_refire, float, NONE) \
+ P(class, prefix, melee_swing_side, float, NONE) \
+ P(class, prefix, melee_swing_up, float, NONE) \
+ P(class, prefix, melee_time, float, NONE) \
+ P(class, prefix, melee_traces, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Shockwave, shockwave)
+#undef X
+
+ENDCLASS(Shockwave)
+REGISTER_WEAPON(SHOCKWAVE, shockwave, NEW(Shockwave));
+
+
+#ifdef CSQC
+void Net_ReadShockwaveParticle();
+.vector sw_shotorg;
+.vector sw_shotdir;
+.float sw_distance;
+.float sw_spread_max;
+.float sw_spread_min;
+.float sw_time;
+#endif
#include "shotgun.qh"
-#ifndef IMPLEMENTATION
-CLASS(Shotgun, Weapon)
-/* ammotype */ ATTRIB(Shotgun, ammo_field, .int, ammo_shells);
-/* impulse */ ATTRIB(Shotgun, impulse, int, 2);
-/* flags */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC);
-/* rating */ ATTRIB(Shotgun, bot_pickupbasevalue, float, 6000);
-/* color */ ATTRIB(Shotgun, wpcolor, vector, '0.5 0.25 0');
-/* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun");
-#ifdef GAMEQC
-/* model */ ATTRIB(Shotgun, m_model, Model, MDL_SHOTGUN_ITEM);
-#endif
-/* crosshair */ ATTRIB(Shotgun, w_crosshair, string, "gfx/crosshairshotgun");
-/* crosshair */ ATTRIB(Shotgun, w_crosshair_size, float, 0.65);
-/* wepimg */ ATTRIB(Shotgun, model2, string, "weaponshotgun");
-/* refname */ ATTRIB(Shotgun, netname, string, "shotgun");
-/* wepname */ ATTRIB(Shotgun, m_name, string, _("Shotgun"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, alt_animtime, float, SEC) \
- P(class, prefix, alt_refire, float, SEC) \
- P(class, prefix, ammo, float, PRI) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, bullets, float, PRI) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, melee_delay, float, SEC) \
- P(class, prefix, melee_multihit, float, SEC) \
- P(class, prefix, melee_nonplayerdamage, float, SEC) \
- P(class, prefix, melee_no_doubleslap, float, SEC) \
- P(class, prefix, melee_range, float, SEC) \
- P(class, prefix, melee_swing_side, float, SEC) \
- P(class, prefix, melee_swing_up, float, SEC) \
- P(class, prefix, melee_time, float, SEC) \
- P(class, prefix, melee_traces, float, SEC) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, solidpenetration, float, PRI) \
- P(class, prefix, spread, float, PRI) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, weaponreplace, string,NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Shotgun, shotgun)
-#undef X
-
-ENDCLASS(Shotgun)
-REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
-
-#endif
-#ifdef IMPLEMENTATION
#ifdef SVQC
spawnfunc(weapon_shotgun) { weapon_defaultspawnfunc(this, WEP_SHOTGUN); }
}
#endif
-#endif
#pragma once
+
+CLASS(Shotgun, Weapon)
+/* ammotype */ ATTRIB(Shotgun, ammo_field, .int, ammo_shells);
+/* impulse */ ATTRIB(Shotgun, impulse, int, 2);
+/* flags */ ATTRIB(Shotgun, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_TYPE_MELEE_SEC);
+/* rating */ ATTRIB(Shotgun, bot_pickupbasevalue, float, 6000);
+/* color */ ATTRIB(Shotgun, wpcolor, vector, '0.5 0.25 0');
+/* modelname */ ATTRIB(Shotgun, mdl, string, "shotgun");
+#ifdef GAMEQC
+/* model */ ATTRIB(Shotgun, m_model, Model, MDL_SHOTGUN_ITEM);
+#endif
+/* crosshair */ ATTRIB(Shotgun, w_crosshair, string, "gfx/crosshairshotgun");
+/* crosshair */ ATTRIB(Shotgun, w_crosshair_size, float, 0.65);
+/* wepimg */ ATTRIB(Shotgun, model2, string, "weaponshotgun");
+/* refname */ ATTRIB(Shotgun, netname, string, "shotgun");
+/* wepname */ ATTRIB(Shotgun, m_name, string, _("Shotgun"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, alt_animtime, float, SEC) \
+ P(class, prefix, alt_refire, float, SEC) \
+ P(class, prefix, ammo, float, PRI) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, bullets, float, PRI) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, melee_delay, float, SEC) \
+ P(class, prefix, melee_multihit, float, SEC) \
+ P(class, prefix, melee_nonplayerdamage, float, SEC) \
+ P(class, prefix, melee_no_doubleslap, float, SEC) \
+ P(class, prefix, melee_range, float, SEC) \
+ P(class, prefix, melee_swing_side, float, SEC) \
+ P(class, prefix, melee_swing_up, float, SEC) \
+ P(class, prefix, melee_time, float, SEC) \
+ P(class, prefix, melee_traces, float, SEC) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, solidpenetration, float, PRI) \
+ P(class, prefix, spread, float, PRI) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, weaponreplace, string,NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Shotgun, shotgun)
+#undef X
+
+ENDCLASS(Shotgun)
+REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
#include "tuba.qh"
-#ifndef IMPLEMENTATION
-CLASS(Tuba, Weapon)
-/* impulse */ ATTRIB(Tuba, impulse, int, 1);
-/* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
-/* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000);
-/* color */ ATTRIB(Tuba, wpcolor, vector, '0 1 0');
-/* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
-#ifdef GAMEQC
-/* model */ ATTRIB(Tuba, m_model, Model, MDL_TUBA_ITEM);
-#endif
-/* crosshair */ ATTRIB(Tuba, w_crosshair, string, "gfx/crosshairtuba");
-/* crosshair */ //ATTRIB(Tuba, w_crosshair_size, float, 0.65);
-/* wepimg */ ATTRIB(Tuba, model2, string, "weapontuba");
-/* refname */ ATTRIB(Tuba, netname, string, "tuba");
-/* xgettext:no-c-format */
-/* wepname */ ATTRIB(Tuba, m_name, string, _("@!#%'n Tuba"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, animtime, float, NONE) \
- P(class, prefix, attenuation, float, NONE) \
- P(class, prefix, damage, float, NONE) \
- P(class, prefix, edgedamage, float, NONE) \
- P(class, prefix, fadetime, float, NONE) \
- P(class, prefix, force, float, NONE) \
- P(class, prefix, pitchstep, float, NONE) \
- P(class, prefix, radius, float, NONE) \
- P(class, prefix, refire, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, volume, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Tuba, tuba)
-#undef X
-ENDCLASS(Tuba)
-REGISTER_WEAPON(TUBA, tuba, NEW(Tuba));
-#endif
-
-#ifdef IMPLEMENTATION
#ifdef SVQC
}
#endif
-#endif
#pragma once
+CLASS(Tuba, Weapon)
+/* impulse */ ATTRIB(Tuba, impulse, int, 1);
+/* flags */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* rating */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000);
+/* color */ ATTRIB(Tuba, wpcolor, vector, '0 1 0');
+/* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
+#ifdef GAMEQC
+/* model */ ATTRIB(Tuba, m_model, Model, MDL_TUBA_ITEM);
+#endif
+/* crosshair */ ATTRIB(Tuba, w_crosshair, string, "gfx/crosshairtuba");
+/* crosshair */ //ATTRIB(Tuba, w_crosshair_size, float, 0.65);
+/* wepimg */ ATTRIB(Tuba, model2, string, "weapontuba");
+/* refname */ ATTRIB(Tuba, netname, string, "tuba");
+/* xgettext:no-c-format */
+/* wepname */ ATTRIB(Tuba, m_name, string, _("@!#%'n Tuba"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, animtime, float, NONE) \
+ P(class, prefix, attenuation, float, NONE) \
+ P(class, prefix, damage, float, NONE) \
+ P(class, prefix, edgedamage, float, NONE) \
+ P(class, prefix, fadetime, float, NONE) \
+ P(class, prefix, force, float, NONE) \
+ P(class, prefix, pitchstep, float, NONE) \
+ P(class, prefix, radius, float, NONE) \
+ P(class, prefix, refire, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, volume, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Tuba, tuba)
+#undef X
+ENDCLASS(Tuba)
+REGISTER_WEAPON(TUBA, tuba, NEW(Tuba));
+
#ifdef CSQC
entityclass(Tuba);
class(Tuba) .int note;
#include "vaporizer.qh"
-#ifndef IMPLEMENTATION
-CLASS(Vaporizer, Weapon)
-/* ammotype */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells);
-/* impulse */ ATTRIB(Vaporizer, impulse, int, 7);
-/* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
-/* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000);
-/* color */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1');
-/* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex");
-#ifdef GAMEQC
-/* model */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM);
-#endif
-/* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex");
-/* crosshair */ ATTRIB(Vaporizer, w_crosshair_size, float, 0.6);
-/* reticle */ ATTRIB(Vaporizer, w_reticle, string, "gfx/reticle_nex");
-/* wepimg */ ATTRIB(Vaporizer, model2, string, "weaponminstanex");
-/* refname */ ATTRIB(Vaporizer, netname, string, "vaporizer");
-/* wepname */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, PRI) \
- P(class, prefix, animtime, float, PRI) \
- P(class, prefix, damage, float, PRI) \
- P(class, prefix, refire, float, PRI) \
- P(class, prefix, ammo, float, SEC) \
- P(class, prefix, animtime, float, SEC) \
- P(class, prefix, damage, float, SEC) \
- P(class, prefix, delay, float, SEC) \
- P(class, prefix, edgedamage, float, SEC) \
- P(class, prefix, force, float, SEC) \
- P(class, prefix, lifetime, float, SEC) \
- P(class, prefix, radius, float, SEC) \
- P(class, prefix, refire, float, SEC) \
- P(class, prefix, shotangle, float, SEC) \
- P(class, prefix, speed, float, SEC) \
- P(class, prefix, spread, float, SEC) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Vaporizer, vaporizer)
-#undef X
-
-ENDCLASS(Vaporizer)
-REGISTER_WEAPON(VAPORIZER, vaporizer, NEW(Vaporizer));
-
-
-#ifdef SVQC
-.float vaporizer_lasthit;
-.float jump_interval;
-.float jump_interval2;
-.bool held_down;
-.float rm_force;
-.float rm_damage;
-.float rm_edmg;
-#endif
-#endif
-#ifdef IMPLEMENTATION
REGISTER_NET_TEMP(TE_CSQC_VAPORBEAMPARTICLE)
}
#endif
-#endif
#pragma once
+
+CLASS(Vaporizer, Weapon)
+/* ammotype */ ATTRIB(Vaporizer, ammo_field, .int, ammo_cells);
+/* impulse */ ATTRIB(Vaporizer, impulse, int, 7);
+/* flags */ ATTRIB(Vaporizer, spawnflags, int, WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
+/* rating */ ATTRIB(Vaporizer, bot_pickupbasevalue, float, 10000);
+/* color */ ATTRIB(Vaporizer, wpcolor, vector, '0.5 1 1');
+/* modelname */ ATTRIB(Vaporizer, mdl, string, "minstanex");
+#ifdef GAMEQC
+/* model */ ATTRIB(Vaporizer, m_model, Model, MDL_VAPORIZER_ITEM);
+#endif
+/* crosshair */ ATTRIB(Vaporizer, w_crosshair, string, "gfx/crosshairminstanex");
+/* crosshair */ ATTRIB(Vaporizer, w_crosshair_size, float, 0.6);
+/* reticle */ ATTRIB(Vaporizer, w_reticle, string, "gfx/reticle_nex");
+/* wepimg */ ATTRIB(Vaporizer, model2, string, "weaponminstanex");
+/* refname */ ATTRIB(Vaporizer, netname, string, "vaporizer");
+/* wepname */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, PRI) \
+ P(class, prefix, animtime, float, PRI) \
+ P(class, prefix, damage, float, PRI) \
+ P(class, prefix, refire, float, PRI) \
+ P(class, prefix, ammo, float, SEC) \
+ P(class, prefix, animtime, float, SEC) \
+ P(class, prefix, damage, float, SEC) \
+ P(class, prefix, delay, float, SEC) \
+ P(class, prefix, edgedamage, float, SEC) \
+ P(class, prefix, force, float, SEC) \
+ P(class, prefix, lifetime, float, SEC) \
+ P(class, prefix, radius, float, SEC) \
+ P(class, prefix, refire, float, SEC) \
+ P(class, prefix, shotangle, float, SEC) \
+ P(class, prefix, speed, float, SEC) \
+ P(class, prefix, spread, float, SEC) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Vaporizer, vaporizer)
+#undef X
+
+ENDCLASS(Vaporizer)
+REGISTER_WEAPON(VAPORIZER, vaporizer, NEW(Vaporizer));
+
+
+#ifdef SVQC
+.float vaporizer_lasthit;
+.float jump_interval;
+.float jump_interval2;
+.bool held_down;
+.float rm_force;
+.float rm_damage;
+.float rm_edmg;
+#endif
#include "vortex.qh"
-#ifndef IMPLEMENTATION
-CLASS(Vortex, Weapon)
-/* ammotype */ ATTRIB(Vortex, ammo_field, .int, ammo_cells);
-/* impulse */ ATTRIB(Vortex, impulse, int, 7);
-/* flags */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
-/* rating */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000);
-/* color */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1');
-/* modelname */ ATTRIB(Vortex, mdl, string, "nex");
-#ifdef GAMEQC
-/* model */ ATTRIB(Vortex, m_model, Model, MDL_VORTEX_ITEM);
-#endif
-/* crosshair */ ATTRIB(Vortex, w_crosshair, string, "gfx/crosshairnex");
-/* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65);
-/* reticle */ ATTRIB(Vortex, w_reticle, string, "gfx/reticle_nex");
-/* wepimg */ ATTRIB(Vortex, model2, string, "weaponnex");
-/* refname */ ATTRIB(Vortex, netname, string, "vortex");
-/* wepname */ ATTRIB(Vortex, m_name, string, _("Vortex"));
-
-#define X(BEGIN, P, END, class, prefix) \
- BEGIN(class) \
- P(class, prefix, ammo, float, BOTH) \
- P(class, prefix, animtime, float, BOTH) \
- P(class, prefix, chargepool, float, SEC) \
- P(class, prefix, chargepool_pause_regen, float, SEC) \
- P(class, prefix, chargepool_regen, float, SEC) \
- P(class, prefix, charge, float, NONE) \
- P(class, prefix, charge_animlimit, float, NONE) \
- P(class, prefix, charge_limit, float, NONE) \
- P(class, prefix, charge_maxspeed, float, NONE) \
- P(class, prefix, charge_mindmg, float, NONE) \
- P(class, prefix, charge_minspeed, float, NONE) \
- P(class, prefix, charge_rate, float, NONE) \
- P(class, prefix, charge_rot_pause, float, NONE) \
- P(class, prefix, charge_rot_rate, float, NONE) \
- P(class, prefix, charge_shot_multiplier, float, NONE) \
- P(class, prefix, charge_start, float, NONE) \
- P(class, prefix, charge_velocity_rate, float, NONE) \
- P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
- P(class, prefix, damagefalloff_halflife, float, BOTH) \
- P(class, prefix, damagefalloff_maxdist, float, BOTH) \
- P(class, prefix, damagefalloff_mindist, float, BOTH) \
- P(class, prefix, damage, float, BOTH) \
- P(class, prefix, force, float, BOTH) \
- P(class, prefix, refire, float, BOTH) \
- P(class, prefix, secondary, float, NONE) \
- P(class, prefix, reload_ammo, float, NONE) \
- P(class, prefix, reload_time, float, NONE) \
- P(class, prefix, switchdelay_raise, float, NONE) \
- P(class, prefix, switchdelay_drop, float, NONE) \
- P(class, prefix, weaponreplace, string, NONE) \
- P(class, prefix, weaponstart, float, NONE) \
- P(class, prefix, weaponstartoverride, float, NONE) \
- P(class, prefix, weaponthrowable, float, NONE) \
- END()
- W_PROPS(X, Vortex, vortex)
-#undef X
-
-ENDCLASS(Vortex)
-REGISTER_WEAPON(VORTEX, vortex, NEW(Vortex));
-
-
-#ifdef SVQC
-
-.float vortex_lasthit;
-#endif
-#endif
-#ifdef IMPLEMENTATION
//REGISTER_STAT(WEP_CVAR_vortex_charge, bool, WEP_CVAR(vortex, charge))
//REGISTER_STAT(WEP_CVAR_vortex_charge_animlimit, float, WEP_CVAR(vortex, charge_animlimit))
}
#endif
-#endif
#pragma once
+
+CLASS(Vortex, Weapon)
+/* ammotype */ ATTRIB(Vortex, ammo_field, .int, ammo_cells);
+/* impulse */ ATTRIB(Vortex, impulse, int, 7);
+/* flags */ ATTRIB(Vortex, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN | WEP_FLAG_NODUAL);
+/* rating */ ATTRIB(Vortex, bot_pickupbasevalue, float, 8000);
+/* color */ ATTRIB(Vortex, wpcolor, vector, '0.5 1 1');
+/* modelname */ ATTRIB(Vortex, mdl, string, "nex");
+#ifdef GAMEQC
+/* model */ ATTRIB(Vortex, m_model, Model, MDL_VORTEX_ITEM);
+#endif
+/* crosshair */ ATTRIB(Vortex, w_crosshair, string, "gfx/crosshairnex");
+/* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65);
+/* reticle */ ATTRIB(Vortex, w_reticle, string, "gfx/reticle_nex");
+/* wepimg */ ATTRIB(Vortex, model2, string, "weaponnex");
+/* refname */ ATTRIB(Vortex, netname, string, "vortex");
+/* wepname */ ATTRIB(Vortex, m_name, string, _("Vortex"));
+
+#define X(BEGIN, P, END, class, prefix) \
+ BEGIN(class) \
+ P(class, prefix, ammo, float, BOTH) \
+ P(class, prefix, animtime, float, BOTH) \
+ P(class, prefix, chargepool, float, SEC) \
+ P(class, prefix, chargepool_pause_regen, float, SEC) \
+ P(class, prefix, chargepool_regen, float, SEC) \
+ P(class, prefix, charge, float, NONE) \
+ P(class, prefix, charge_animlimit, float, NONE) \
+ P(class, prefix, charge_limit, float, NONE) \
+ P(class, prefix, charge_maxspeed, float, NONE) \
+ P(class, prefix, charge_mindmg, float, NONE) \
+ P(class, prefix, charge_minspeed, float, NONE) \
+ P(class, prefix, charge_rate, float, NONE) \
+ P(class, prefix, charge_rot_pause, float, NONE) \
+ P(class, prefix, charge_rot_rate, float, NONE) \
+ P(class, prefix, charge_shot_multiplier, float, NONE) \
+ P(class, prefix, charge_start, float, NONE) \
+ P(class, prefix, charge_velocity_rate, float, NONE) \
+ P(class, prefix, damagefalloff_forcehalflife, float, BOTH) \
+ P(class, prefix, damagefalloff_halflife, float, BOTH) \
+ P(class, prefix, damagefalloff_maxdist, float, BOTH) \
+ P(class, prefix, damagefalloff_mindist, float, BOTH) \
+ P(class, prefix, damage, float, BOTH) \
+ P(class, prefix, force, float, BOTH) \
+ P(class, prefix, refire, float, BOTH) \
+ P(class, prefix, secondary, float, NONE) \
+ P(class, prefix, reload_ammo, float, NONE) \
+ P(class, prefix, reload_time, float, NONE) \
+ P(class, prefix, switchdelay_raise, float, NONE) \
+ P(class, prefix, switchdelay_drop, float, NONE) \
+ P(class, prefix, weaponreplace, string, NONE) \
+ P(class, prefix, weaponstart, float, NONE) \
+ P(class, prefix, weaponstartoverride, float, NONE) \
+ P(class, prefix, weaponthrowable, float, NONE) \
+ END()
+ W_PROPS(X, Vortex, vortex)
+#undef X
+
+ENDCLASS(Vortex)
+REGISTER_WEAPON(VORTEX, vortex, NEW(Vortex));
+
+
+#ifdef SVQC
+
+.float vortex_lasthit;
+#endif
.vector origin;
+
+// angles of the player's model (as opposed to their view which uses `.vector v_angle;`) in degrees
+// x is pitch: positive means up (unlike .v_angle), usually is 0
+// y is yaw: between -180 and 180, increases when turning left
+// z is roll: positive means tilted clockwise, usually is 0
.vector angles;
/*
{
csqcplayer_moveframe = clientcommandframe;
getinputstate(csqcplayer_moveframe-1);
- LOG_INFO("the Weird code path got hit\n");
+ LOG_INFO("the Weird code path got hit");
return;
}
#endif
// call this BEFORE drawing
void InterpolateOrigin_Do(entity this);
-
-// in case we interpolate that:
-.vector v_angle;
#define _LOG_INFO(s) \
MACRO_BEGIN { \
dprint(_LOG_HEADER("^5INFO")); \
- print("\n^7", s); \
+ string __s = s; \
+ print("\n^7", __s); \
+ /* TODO: unconditionally add a newline when possible */ \
+ if (str2chr(__s, strlen(__s) - 1) != '\n') { print("\n"); } \
} MACRO_END
#define LOG_TRACE(...) _LOG_TRACE(strcat1n(__VA_ARGS__))
}
return v;
}
+
+/// Maps values between the src and dest range: src_min to dest_min, src_max to dest_max, values between them
+/// to the curresponding values between and extrapolates for values outside the range.
+///
+/// src_min and src_max must not be the same or division by zero accurs.
+///
+/// dest_max can be smaller than dest_min if you want the resulting range to be inverted, all values can be negative.
+ERASEABLE
+float map_ranges(float value, float src_min, float src_max, float dest_min, float dest_max) {
+ float src_diff = src_max - src_min;
+ float dest_diff = dest_max - dest_min;
+ float ratio = (value - src_min) / src_diff;
+ return dest_min + dest_diff * ratio;
+}
+
+/// Same as `map_ranges` except that values outside the source range are clamped to min or max.
+ERASEABLE
+float map_bound_ranges(float value, float src_min, float src_max, float dest_min, float dest_max) {
+ if (value <= src_min) return dest_min;
+ if (value >= src_max) return dest_max;
+ return map_ranges(value, src_min, src_max, dest_min, dest_max);
+}
int f = TEST_RunAll_accumulated(0);
if (f)
{
- LOG_INFOF("%d tests failed\n", f);
+ LOG_INFOF("%d tests failed", f);
return true;
}
else
{
- LOG_INFO("All tests OK\n");
+ LOG_INFO("All tests OK");
return false;
}
}
bool TEST_Run(string s)
{
- LOG_INFOF("%s: testing...\n", s);
+ LOG_INFOF("%s: testing...", s);
TEST_failed = 0;
TEST_fatal = 0;
TEST_ok = false;
if (isfunction(fn)) callfunction(fn);
if (TEST_failed > 0)
{
- LOG_INFOF("%s: %d items failed.\n", s, TEST_failed);
+ LOG_INFOF("%s: %d items failed.", s, TEST_failed);
return false;
}
else if (!TEST_ok)
{
- LOG_INFOF("%s: did not complete.\n", s);
+ LOG_INFOF("%s: did not complete.", s);
return false;
}
return true;
if (!e) return 0;
if (e.url_rbuf >= 0 || e.url_wbuf >= 0)
{
- LOG_INFOF("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url);
+ LOG_INFOF("WARNING: handle %d (%s) has already received data?!?", id + NUM_URL_ID, e.url_url);
return 0;
}
e.url_rbuf = buf_create();
if (e.url_rbuf < 0)
{
- LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
+ LOG_INFO("url_URI_Get_Callback: out of memory in buf_create");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
strunzone(e.url_url);
delete(e);
e.url_rbufpos = 0;
if (e.url_rbuf < 0)
{
- LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
+ LOG_INFO("url_URI_Get_Callback: out of memory in buf_create");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
strunzone(e.url_url);
delete(e);
e.url_wbuf = buf_create();
if (e.url_wbuf < 0)
{
- LOG_INFO("url_single_fopen: out of memory in buf_create\n");
+ LOG_INFO("url_single_fopen: out of memory in buf_create");
rdy(e, pass, URL_READY_ERROR);
strunzone(e.url_url);
delete(e);
if (url_fromid[i] == NULL) break;
if (i >= autocvar__urllib_nextslot)
{
- LOG_INFO("url_single_fopen: too many concurrent requests\n");
+ LOG_INFO("url_single_fopen: too many concurrent requests");
rdy(NULL, pass, URL_READY_ERROR);
return;
}
// GET the data
if (!crypto_uri_postbuf(url, i + MIN_URL_ID, string_null, string_null, -1, 0))
{
- LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf\n");
+ LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf");
rdy(NULL, pass, URL_READY_ERROR);
return;
}
rdy(e, pass, URL_READY_CANWRITE);
break;
case FILE_READ:
- LOG_INFO("url_single_fopen: cannot open '-' for reading\n");
+ LOG_INFO("url_single_fopen: cannot open '-' for reading");
rdy(NULL, pass, URL_READY_ERROR);
break;
}
if (url_fromid[i] == NULL) break;
if (i >= autocvar__urllib_nextslot)
{
- LOG_INFO("url_fclose: too many concurrent requests\n");
+ LOG_INFO("url_fclose: too many concurrent requests");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
buf_del(e.url_wbuf);
strunzone(e.url_url);
// POST the data
if (!crypto_uri_postbuf(e.url_url, i + MIN_URL_ID, e.url_content_type, e.url_verb, e.url_wbuf, 0))
{
- LOG_INFO("url_fclose: failure in crypto_uri_postbuf\n");
+ LOG_INFO("url_fclose: failure in crypto_uri_postbuf");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
buf_del(e.url_wbuf);
strunzone(e.url_url);
{
if (status == -422) // Unprocessable Entity
{
- LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
+ LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing");
me.url_ready(fh, me.url_ready_pass, status);
strunzone(me.url_url);
delete(me);
n = tokenize_console(url);
if (n <= 0)
{
- LOG_INFO("url_multi_fopen: need at least one URL\n");
+ LOG_INFO("url_multi_fopen: need at least one URL");
rdy(NULL, pass, URL_READY_ERROR);
return;
}
}
else
{
- LOG_INFO("would have to put player in solid, won't do that\n");
+ LOG_INFO("would have to put player in solid, won't do that");
setorigin(player, o0 - player.view_ofs);
return 0;
}
return 0;
#ifdef WARPZONELIB_REMOVEHACK
- LOG_INFO("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now\n");
+ LOG_INFO("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now");
#else
- LOG_INFO("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
+ LOG_INFO("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again");
#endif
- LOG_INFO("Entity type: ", player.classname, "\n");
- LOG_INFO("Origin: ", vtos(player.origin), "\n");
- LOG_INFO("Velocity: ", vtos(player.velocity), "\n");
+ LOG_INFO("Entity type: ", player.classname);
+ LOG_INFO("Origin: ", vtos(player.origin));
+ LOG_INFO("Velocity: ", vtos(player.velocity));
#ifdef WARPZONELIB_REMOVEHACK
return 0;
point = point * (1 / (3 * area));
if(vdist(norm, <, 0.99))
{
- LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " is nonplanar. BEWARE.\n");
+ LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " is nonplanar. BEWARE.");
area = 0; // no autofixing in this case
}
norm = normalize(norm);
makevectors(ang);
if(norm * v_forward < 0)
{
- LOG_INFO("Position target of trigger_warpzone near ", vtos(this.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
+ LOG_INFO("Position target of trigger_warpzone near ", vtos(this.aiment.origin), " points into trigger_warpzone. BEWARE.");
norm = -1 * norm;
}
ang = vectoangles2(norm, v_up); // keep rotation, but turn exactly against plane
ang.x = -ang.x;
if(norm * v_forward < 0.99)
- LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been turned to match plane orientation (", vtos(this.aiment.angles), " -> ", vtos(ang), "\n");
+ LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been turned to match plane orientation (", vtos(this.aiment.angles), " -> ", vtos(ang));
if(vdist(org - this.aiment.origin, >, 0.5))
- LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been moved to match the plane (", vtos(this.aiment.origin), " -> ", vtos(org), ").\n");
+ LOG_INFO("trigger_warpzone near ", vtos(this.aiment.origin), " has been moved to match the plane (", vtos(this.aiment.origin), " -> ", vtos(org), ").");
}
}
else if(area > 0)
s = me.toString(me);
if (s == "") s = me.classname;
else s = strcat(me.classname, ": ", s);
- LOG_INFO(_dumptree_space, etos(me), " (", s, ")");
+ print(_dumptree_space, etos(me), " (", s, ")");
if (me.firstChild)
{
- LOG_INFO(" {\n");
+ print(" {\n");
_dumptree_space = strcat(_dumptree_space, " ");
}
else
{
- LOG_INFO("\n");
+ print("\n");
}
}
void _dumptree_close(entity pass, entity me)
if (me.firstChild)
{
_dumptree_space = substring(_dumptree_space, 0, strlen(_dumptree_space) - 2);
- LOG_INFO(_dumptree_space, "}\n");
+ print(_dumptree_space, "}\n");
}
}
if (argv(0) == "help" || argc == 0)
{
- LOG_INFO(_("Usage: menu_cmd command..., where possible commands are:\n"));
- LOG_INFO(_(" sync - reloads all cvars on the current menu page\n"));
- LOG_INFO(_(" directmenu ITEM - select a menu item as main item\n"));
+ LOG_INFO(_("Usage: menu_cmd command..., where possible commands are:"));
+ LOG_INFO(_(" sync - reloads all cvars on the current menu page"));
+ LOG_INFO(_(" directmenu ITEM - select a menu item as main item"));
- LOG_INFO("\nGeneric commands shared by all programs:\n");
+ LOG_INFO("Generic commands shared by all programs:");
GenericCommand_macro_help();
return;
if (argc == 1)
{
- LOG_INFO(_("Available options:\n"));
+ LOG_INFO(_("Available options:"));
FOREACH_ENTITY_ORDERED(it.name != "", {
if (it.classname == "vtbl") continue;
if (!startsWith(s, filter)) continue;
s = substring(s, strlen(filter), strlen(s) - strlen(filter));
}
- LOG_INFOF(" %s\n", s);
+ LOG_INFOF(" %s", s);
});
}
else if (argc == 2 && !isdemo()) // don't allow this command in demos
if(MUTATOR_CALLHOOK(Menu_ConsoleCommand, ss, argc, theCommand)) // handled by a mutator
return;
- LOG_INFO(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
+ LOG_INFO(_("Invalid command. For a list of supported commands, try menu_cmd help."));
}
cvar_set("_menu_prvm_language", prvm_language);
#ifdef WATERMARK
- LOG_INFOF("^4MQC Build information: ^1%s\n", WATERMARK);
+ LOG_INFOF("^4MQC Build information: ^1%s", WATERMARK);
#endif
// list all game dirs (TEST)
m = MapInfo_BSPName_ByID(i);
if (!m)
{
- LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
+ LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again."));
me.refilter(me);
return;
}
}
else
{
- LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
+ LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again."));
me.refilter(me);
return;
}
else \
{ \
LOG_INFOF( \
- "RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
+ "RegisterSLCategories(): Improper override '%s' for category '%s'!", \
s, \
categories[i].cat_name \
); \
fh = fopen(s, FILE_READ);
if(fh < 0)
{
- LOG_INFO("Warning: can't open skinvalues.txt file\n");
+ LOG_INFO("Warning: can't open skinvalues.txt file");
continue;
}
while((s = fgets(fh)))
float v = fromDecibelOfSquare(db, -40);
float dbv = toDecibelOfSquare(v, -40);
float d = dbv - db;
- LOG_INFOF("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
+ LOG_INFOF("%f -> %f -> %f (diff: %f)", db, v, dbv, d);
EXPECT_GT(fabs(d), 0.02);
}
SUCCEED();
}
else
{
- LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
+ LOG_INFOF("Received HTTP request data for an invalid id %d.", id);
}
}
{
// update needed
_Nex_ExtResponseSystem_UpdateTo = strzone(un_version);
- if(un_download) { LOG_INFOF(_("Update can be downloaded at:\n%s\n"), un_download); }
+ if(un_download) { LOG_INFOF(_("Update can be downloaded at:\n%s"), un_download); }
if(un_url) { _Nex_ExtResponseSystem_UpdateToURL = strzone(un_url); }
DisableServerBackwardsCompatibility();
}
cvar_set("gl_texturecompression", "1");
cvar_set("r_texture_dds_load", "1");
if(!can_dds)
- LOG_INFO(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
+ LOG_INFO(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems."));
return 0;
}
else
{
if(me.sendCvars)
{
- LOG_INFOF("Sending cvar: %s -> %s\n", cvarnamestring, cvar_string(cvarnamestring));
+ LOG_INFOF("Sending cvar: %s -> %s", cvarnamestring, cvar_string(cvarnamestring));
if(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
{
cmd(sprintf("\nsendcvar %s\n", cvarnamestring));
//dprint("e ", vtos(diffang), " < ", ftos(maxfiredeviation), "\n");
// decide whether to fire this time
- if ((normalize(v) * shotdir) >= cos(maxfiredeviation * DEG2RAD))
+ if (v * shotdir >= cos(maxfiredeviation * DEG2RAD))
if(vdist(trace_endpos-shotorg, <, 500 + 500 * bound(0, skill + this.bot_aggresskill, 10)) || random()*random()>bound(0,(skill+this.bot_aggresskill)*0.05,1))
this.bot_firetimer = time + bound(0.1, 0.5-(skill+this.bot_aggresskill)*0.05, 0.5);
//traceline(shotorg,shotorg+shotdir*1000,false,NULL);
if(file < 0)
{
- LOG_INFO(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
+ LOG_INFOF("Error: Can not open the bot configuration file '%s'", autocvar_bot_config_file);
readfile = "";
}
else
++realplayers;
});
}
+ if(currentbots == -1)
+ {
+ currentbots = 0;
+ // human players joining early may cause weird issues (bots appearing on
+ // the scoreboard as spectators) when switching map with the gotomap
+ // command, as it doesn't remove bots of the previous match, and with
+ // minplayers > 1, so ignore human players in the first bot frame
+ // TODO maybe find a cleaner solution
+ activerealplayers = 0;
+ }
int bots;
// add/remove bots if needed to make sure there are at least
// only add one bot per frame to avoid utter chaos
if(time > botframe_nextthink)
{
- //dprint(ftos(bots), " ? ", ftos(currentbots), "\n");
- while (currentbots < bots)
+ if (currentbots < bots)
{
if (bot_spawn() == NULL)
{
return;
if (time < 2)
+ {
+ currentbots = -1;
return;
+ }
bot_calculate_stepheightvec();
bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
}
e = find(NULL, targetname, s);
if(!e)
- LOG_INFO("invalid place ", s, "\n");
+ LOG_INFO("invalid place ", s);
if(i < MAX_BOT_PLACES)
{
this.(bot_placenames[i]) = strzone(placename);
{
e = find(NULL, targetname, placename);
if(!e)
- LOG_INFO("invalid place ", placename, "\n");
+ LOG_INFO("invalid place ", placename);
return e;
}
}
if(cmd_parm_type!=BOT_CMD_PARAMETER_NONE&&parm=="")
{
- LOG_INFO("ERROR: A parameter is required for this command\n");
+ LOG_INFO("ERROR: A parameter is required for this command");
return 0;
}
case BOT_CMD_PARAMETER_VECTOR:
if(substring(parm, 0, 1) != "\'")
{
- LOG_INFOF("ERROR: expected vector type \'x y z\', got %s\n", parm);
+ LOG_INFOF("ERROR: expected vector type \'x y z\', got %s", parm);
return 0;
}
bot_cmd.bot_cmd_parm_vector = stov(parm);
}
return 1;
}
- LOG_INFO("ERROR: No such command '", cmdstring, "'\n");
+ LOG_INFO("ERROR: No such command '", cmdstring, "'");
return 0;
}
break;
}
- LOG_INFO(strcat("Command: ",bot_cmd_string[i],"\nParameter: <",stype,"> \n"));
-
- LOG_INFO("Description: ");
+ string prelude = strcat(
+ "Command: ", bot_cmd_string[i], "\n",
+ "Parameter: <", stype, ">", "\n",
+ "Description: "
+ );
switch(i)
{
case BOT_CMD_PAUSE:
- LOG_INFO("Stops the bot completely. Any command other than 'continue' will be ignored.");
+ LOG_INFO(prelude, "Stops the bot completely. Any command other than 'continue' will be ignored.");
break;
case BOT_CMD_CONTINUE:
- LOG_INFO("Disable paused status");
+ LOG_INFO(prelude, "Disable paused status");
break;
case BOT_CMD_WAIT:
- LOG_INFO("Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
+ LOG_INFO(prelude, "Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
break;
case BOT_CMD_WAIT_UNTIL:
- LOG_INFO("Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
+ LOG_INFO(prelude, "Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
break;
case BOT_CMD_BARRIER:
- LOG_INFO("Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
+ LOG_INFO(prelude, "Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
break;
case BOT_CMD_TURN:
- LOG_INFO("Look to the right or left N degrees. For turning to the left use positive numbers.");
+ LOG_INFO(prelude, "Look to the right or left N degrees. For turning to the left use positive numbers.");
break;
case BOT_CMD_MOVETO:
- LOG_INFO("Walk to an specific coordinate on the map. Usage: moveto \'x y z\'");
+ LOG_INFO(prelude, "Walk to an specific coordinate on the map. Usage: moveto \'x y z\'");
break;
case BOT_CMD_MOVETOTARGET:
- LOG_INFO("Walk to the specific target on the map");
+ LOG_INFO(prelude, "Walk to the specific target on the map");
break;
case BOT_CMD_RESETGOAL:
- LOG_INFO("Resets the goal stack");
+ LOG_INFO(prelude, "Resets the goal stack");
break;
case BOT_CMD_CC:
- LOG_INFO("Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
+ LOG_INFO(prelude, "Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
break;
case BOT_CMD_IF:
- LOG_INFO("Perform simple conditional execution.\n");
- LOG_INFO("Syntax: \n");
- LOG_INFO(" sv_cmd .. if \"condition\"\n");
- LOG_INFO(" sv_cmd .. <instruction if true>\n");
- LOG_INFO(" sv_cmd .. <instruction if true>\n");
- LOG_INFO(" sv_cmd .. else\n");
- LOG_INFO(" sv_cmd .. <instruction if false>\n");
- LOG_INFO(" sv_cmd .. <instruction if false>\n");
- LOG_INFO(" sv_cmd .. fi\n");
- LOG_INFO("Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n");
- LOG_INFO(" Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n");
- LOG_INFO("Fields: health, speed, flagcarrier\n");
- LOG_INFO("Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;");
+ LOG_INFO(prelude, "Perform simple conditional execution.\n"
+ "Syntax: \n"
+ " sv_cmd .. if \"condition\"\n"
+ " sv_cmd .. <instruction if true>\n"
+ " sv_cmd .. <instruction if true>\n"
+ " sv_cmd .. else\n"
+ " sv_cmd .. <instruction if false>\n"
+ " sv_cmd .. <instruction if false>\n"
+ " sv_cmd .. fi\n"
+ "Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n"
+ " Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n"
+ "Fields: health, speed, flagcarrier\n"
+ "Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;"
+ );
break;
case BOT_CMD_RESETAIM:
- LOG_INFO("Points the aim to the coordinates x,y 0,0");
+ LOG_INFO(prelude, "Points the aim to the coordinates x,y 0,0");
break;
case BOT_CMD_AIM:
- LOG_INFO("Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n");
- LOG_INFO("There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n");
- LOG_INFO("Examples: aim \"90 0\" // Turn 90 degrees inmediately (positive numbers move to the left/up)\n");
- LOG_INFO(" aim \"0 90 2\" // Will gradually look to the sky in the next two seconds");
+ LOG_INFO(prelude, "Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n"
+ "There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n"
+ "Examples: aim \"90 0\" // Turn 90 degrees inmediately (positive numbers move to the left/up)\n"
+ " aim \"0 90 2\" // Will gradually look to the sky in the next two seconds"
+ );
break;
case BOT_CMD_AIMTARGET:
- LOG_INFO("Points the aim to given target");
+ LOG_INFO(prelude, "Points the aim to given target");
break;
case BOT_CMD_PRESSKEY:
- LOG_INFO("Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use\n");
+ LOG_INFO(prelude, "Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use");
LOG_INFO("Multiple keys can be pressed at time (with many presskey calls) and it will remain pressed until the command \"releasekey\" is called");
LOG_INFO("Note: The script will not return the control to the bot ai until all keys are released");
break;
case BOT_CMD_RELEASEKEY:
- LOG_INFO("Release previoulsy used keys. Use the parameter \"all\" to release all keys");
+ LOG_INFO(prelude, "Release previoulsy used keys. Use the parameter \"all\" to release all keys");
break;
case BOT_CMD_SOUND:
- LOG_INFO("play sound file at bot location");
+ LOG_INFO(prelude, "play sound file at bot location");
break;
case BOT_CMD_DEBUG_ASSERT_CANFIRE:
- LOG_INFO("verify the state of the weapon entity");
+ LOG_INFO(prelude, "verify the state of the weapon entity");
break;
default:
- LOG_INFO("This command has no description yet.");
+ LOG_INFO(prelude, "This command has no description yet.");
break;
}
- LOG_INFO("\n");
}
}
if(!bot_cmds_initialized)
bot_commands_init();
- LOG_INFO("List of all available commands:\n");
- LOG_INFO(" Command - Parameter Type\n");
+ LOG_INFO(
+ "List of all available commands:\n"
+ " Command - Parameter Type\n"
+ );
for(i=1;i<BOT_CMD_COUNTER;++i)
{
ptype = "none";
break;
}
- LOG_INFO(strcat(" ",bot_cmd_string[i]," - <",ptype,"> \n"));
+ LOG_INFO(" ", bot_cmd_string[i]," - <", ptype, ">");
}
}
return ((this.flagcarried!=NULL));
}
- LOG_INFO(strcat("ERROR: Unable to convert the expression '",expr,"' into a numeric value\n"));
+ LOG_INFO("ERROR: Unable to convert the expression '", expr, "' into a numeric value");
return 0;
}
if(f)
{
this.colormod = '0 8 8';
- LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by weaponentity state\n");
+ LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by weaponentity state");
}
}
else if(ATTACK_FINISHED(this, slot) > time)
if(f)
{
this.colormod = '8 0 8';
- LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by ATTACK_FINISHED (", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left)\n");
+ LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, inhibited by ATTACK_FINISHED (", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left)");
}
}
else if(this.(weaponentity).tuba_note)
if(f)
{
this.colormod = '8 0 0';
- LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, bot still has an active tuba note\n");
+ LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " wants to fire, bot still has an active tuba note");
}
}
else
if(!f)
{
this.colormod = '8 8 0';
- LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " thinks it has fired, but apparently did not; ATTACK_FINISHED says ", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left\n");
+ LOG_INFO("Bot ", this.netname, " using ", this.(weaponentity).weaponname, " thinks it has fired, but apparently did not; ATTACK_FINISHED says ", ftos(ATTACK_FINISHED(this, slot) - time), " seconds left");
}
}
if(bot_cmd.bot_cmd_type!=BOT_CMD_NULL)
{
bot_command_executed(this, true);
- LOG_INFO( "WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.\n");
+ LOG_INFO("WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.");
}
return 1;
}
status = bot_cmd_debug_assert_canfire(this);
break;
default:
- LOG_INFO(strcat("ERROR: Invalid command on queue with id '",ftos(bot_cmd.bot_cmd_type),"'\n"));
+ LOG_INFOF("ERROR: Invalid command on queue with id '%s'", ftos(bot_cmd.bot_cmd_type));
return 0;
}
if (status==CMD_STATUS_ERROR)
- LOG_INFO(strcat("ERROR: The command '",bot_cmd_string[bot_cmd.bot_cmd_type],"' returned an error status\n"));
+ LOG_INFOF("ERROR: The command '%s' returned an error status", bot_cmd_string[bot_cmd.bot_cmd_type]);
// Move execution pointer
if(status==CMD_STATUS_EXECUTING)
{
if(autocvar_developer)
{
- LOG_INFO("A generated waypoint is stuck in solid at ", vtos(w.origin), "\n");
+ LOG_INFO("A generated waypoint is stuck in solid at ", vtos(w.origin));
backtrace("Waypoint stuck");
}
}
if(!found)
{
if(!removal_mode)
- LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped\n"));
+ LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped");
continue;
}
}
if(!found)
{
if(!removal_mode)
- LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped\n"));
+ LOG_INFO("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped");
continue;
}
int file = fopen(filename, FILE_WRITE);
if (file < 0)
{
- LOG_INFOF("waypoint link save to %s failed\n", filename);
+ LOG_INFOF("waypoint link save to %s failed", filename);
return;
}
fclose(file);
botframe_cachedwaypointlinks = true;
- LOG_INFOF("saved %d waypoint links to maps/%s.waypoints.cache\n", c, mapname);
+ LOG_INFOF("saved %d waypoint links to maps/%s.waypoints.cache", c, mapname);
waypoint_load_links_hardwired();
}
waypoint_save_links(); // save anyway?
botframe_loadedforcedlinks = false;
- LOG_INFOF("waypoint links: save to %s failed\n", filename);
+ LOG_INFOF("waypoint links: save to %s failed", filename);
return;
}
waypoint_save_links();
botframe_loadedforcedlinks = false;
- LOG_INFOF("saved %d waypoints to maps/%s.waypoints\n", c, mapname);
+ LOG_INFOF("saved %d waypoints to maps/%s.waypoints", c, mapname);
}
// load waypoints from file
});
if(bestdist < maxdist)
{
- LOG_INFO("update chain to new nearest WP ", etos(p.(fld)), "\n");
+ LOG_INFO("update chain to new nearest WP ", etos(p.(fld)));
return 0;
}
tmax = t;
}
- LOG_INFO("spawning a waypoint for connecting to ", etos(wp), "\n");
+ LOG_INFO("spawning a waypoint for connecting to ", etos(wp));
botframe_autowaypoints_createwp(o, p, fld, 0);
return 1;
}
if(r != -1)
return;
- LOG_INFO("emergency: got no good nearby WP to build a link from, starting a new chain\n");
+ LOG_INFO("emergency: got no good nearby WP to build a link from, starting a new chain");
if(!botframe_autowaypoints_fixdown(p.origin))
return; // shouldn't happen, caught above
botframe_autowaypoints_createwp(trace_endpos, p, fld, WAYPOINTFLAG_PROTECTED);
IL_EACH(g_waypoints, !(it.wpflags & (WAYPOINTFLAG_USEFUL | WAYPOINTFLAG_DEAD_END)),
{
- LOG_INFOF("Removed a waypoint at %v. Try again for more!\n", it.origin);
+ LOG_INFOF("Removed a waypoint at %v. Try again for more!", it.origin);
te_explosion(it.origin);
waypoint_remove(it);
break;
cvar_string = cvar_string_normal;
cvar_set = cvar_set_normal;
cvar_set("g_campaign", "0");
- LOG_INFO("^4campaign initialization failed: ", s, "\n");
+ LOG_INFO("^4campaign initialization failed: ", s);
if(autocvar__campaign_testrun)
error("CAMPAIGN FAIL AHAHAHAHAHAHAHAHAH))");
return 1;
RadiusDamage(e2, this, 1000, 0, 128, NULL, NULL, 500, DEATH_CHEAT.m_id, e);
delete(e2);
- LOG_INFO("404 Sportsmanship not found.\n");
+ LOG_INFO("404 Sportsmanship not found.");
DID_CHEAT();
break;
}
if (IS_SPEC(e)) e = e.enemy;
sf = 0;
- if (CS(e).race_completed) sf |= 1; // forced scoreboard
- if (CS(to).spectatee_status) sf |= 2; // spectator ent number follows
- if (CS(e).zoomstate) sf |= 4; // zoomed
- if (autocvar_sv_showspectators) sf |= 16; // show spectators
+ if (CS(e).race_completed) sf |= BIT(0); // forced scoreboard
+ if (CS(to).spectatee_status) sf |= BIT(1); // spectator ent number follows
+ if (CS(e).zoomstate) sf |= BIT(2); // zoomed
+ if (autocvar_sv_showspectators) sf |= BIT(4); // show spectators
WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
WriteByte(MSG_ENTITY, sf);
- if (sf & 2)
- {
+ if (sf & BIT(1))
WriteByte(MSG_ENTITY, CS(to).spectatee_status);
- }
- if(sf & 16)
+ if(sf & BIT(4))
{
float specs = CountSpectators(e, to);
WriteByte(MSG_ENTITY, specs);
PlayerStats_GameReport_AddEvent(sprintf("kills-%d", this.playerid));
// always track bots, don't ask for cl_allow_uidtracking
- if (IS_BOT_CLIENT(this)) PlayerStats_GameReport_AddPlayer(this);
+ if (IS_BOT_CLIENT(this))
+ PlayerStats_GameReport_AddPlayer(this);
+ else
+ CS(this).allowed_timeouts = autocvar_sv_timeout_number;
if (autocvar_sv_eventlog)
GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", playername(this, false)));
}
CS(this).jointime = time;
- CS(this).allowed_timeouts = autocvar_sv_timeout_number;
if (IS_REAL_CLIENT(this))
{
regen_health_stable = M_ARGV(9, float);
regen_health_rotstable = M_ARGV(10, float);
-
if(!mutator_returnvalue)
if(!STAT(FROZEN, this))
{
this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
}
+ // Ugly hack to make sure the health and armor don't go beyond hard limit.
+ // TODO: Remove this hack when all code uses GivePlayerHealth and
+ // GivePlayerArmor.
+ if (this.health > RESOURCE_AMOUNT_HARD_LIMIT)
+ {
+ this.health = RESOURCE_AMOUNT_HARD_LIMIT;
+ }
+ if (this.armorvalue > RESOURCE_AMOUNT_HARD_LIMIT)
+ {
+ this.armorvalue = RESOURCE_AMOUNT_HARD_LIMIT;
+ }
+ // End hack.
}
bool zoomstate_set;
ATTRIB(Client, cvar_cl_multijump, bool, this.cvar_cl_multijump);
ATTRIB(Client, cvar_cl_accuracy_data_share, bool, this.cvar_cl_accuracy_data_share);
ATTRIB(Client, cvar_cl_accuracy_data_receive, bool, this.cvar_cl_accuracy_data_receive);
+ ATTRIBARRAY(Client, cvar_cl_weaponpriorities, string, 10);
+ ATTRIB(Client, cvar_cl_weaponpriority, string, this.cvar_cl_weaponpriority);
METHOD(Client, m_unwind, bool(Client this));
}
default:
- LOG_INFO("Incorrect parameters for ^2ban^7\n");
+ LOG_INFO("Incorrect parameters for ^2ban^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd ban address [bantime] [reason]\n");
- LOG_INFO(" 'address' is the IP address or range of the player to ban,\n");
- LOG_INFO(" 'bantime' is the amount of time that the ban is active (default if not provided),\n");
- LOG_INFO(" and 'reason' is the string to label the ban with as reason for banning.\n");
- LOG_INFO("See also: ^2banlist, kickban, unban^7\n");
+ LOG_INFO("Usage:^3 sv_cmd ban address [bantime] [reason]");
+ LOG_INFO(" 'address' is the IP address or range of the player to ban,");
+ LOG_INFO(" 'bantime' is the amount of time that the ban is active (default if not provided),");
+ LOG_INFO(" and 'reason' is the string to label the ban with as reason for banning.");
+ LOG_INFO("See also: ^2banlist, kickban, unban^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd banlist\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2ban, kickban, unban^7\n");
+ LOG_INFO("Usage:^3 sv_cmd banlist");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2ban, kickban, unban^7");
return;
}
}
}
else
{
- LOG_INFO("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("kickban: ", GetClientErrorString(accepted, argv(1)), ".");
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2kickban^7\n");
+ LOG_INFO("Incorrect parameters for ^2kickban^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd kickban client [bantime] [masksize] [reason]\n");
- LOG_INFO(" 'client' is the entity number or name of the player to ban,\n");
- LOG_INFO(" 'bantime' is the amount of time that the ban is active (default if not provided),\n");
- LOG_INFO(" 'masksize' is the range of the IP address (1-thru-4, default if not provided),\n");
- LOG_INFO(" and 'reason' is the string to label the ban with as reason for banning.\n");
- LOG_INFO("See also: ^2ban, banlist, unban^7\n");
+ LOG_INFO("Usage:^3 sv_cmd kickban client [bantime] [masksize] [reason]");
+ LOG_INFO(" 'client' is the entity number or name of the player to ban,");
+ LOG_INFO(" 'bantime' is the amount of time that the ban is active (default if not provided),");
+ LOG_INFO(" 'masksize' is the range of the IP address (1-thru-4, default if not provided),");
+ LOG_INFO(" and 'reason' is the string to label the ban with as reason for banning.");
+ LOG_INFO("See also: ^2ban, banlist, unban^7");
return;
}
}
}
else
{
- LOG_INFO("mute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("mute: ", GetClientErrorString(accepted, argv(1)), ".");
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2mute^7\n");
+ LOG_INFO("Incorrect parameters for ^2mute^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd mute client\n");
- LOG_INFO(" 'client' is the entity number or name of the player to mute.\n");
- LOG_INFO("See also: ^2unmute^7\n");
+ LOG_INFO("Usage:^3 sv_cmd mute client");
+ LOG_INFO(" 'client' is the entity number or name of the player to mute.");
+ LOG_INFO("See also: ^2unmute^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd unban banid\n");
- LOG_INFO(" Where 'banid' is the ID of the ban of which to remove.\n");
- LOG_INFO("See also: ^2ban, banlist, kickban^7\n");
+ LOG_INFO("Usage:^3 sv_cmd unban banid");
+ LOG_INFO(" Where 'banid' is the ID of the ban of which to remove.");
+ LOG_INFO("See also: ^2ban, banlist, kickban^7");
return;
}
}
}
else
{
- LOG_INFO("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("unmute: ", GetClientErrorString(accepted, argv(1)), ".");
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2mute^7\n");
+ LOG_INFO("Incorrect parameters for ^2mute^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd unmute client\n");
- LOG_INFO(" 'client' is the entity number or name of the player to unmute.\n");
- LOG_INFO("See also: ^2mute^7\n");
+ LOG_INFO("Usage:^3 sv_cmd unmute client");
+ LOG_INFO(" 'client' is the entity number or name of the player to unmute.");
+ LOG_INFO("See also: ^2mute^7");
return;
}
}
void BanCommand_macro_help()
{
#define BAN_COMMAND(name, function, description) \
- { if (strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description, "\n"); } }
+ { if (strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description); } }
BAN_COMMANDS(0, 0, "");
#undef BAN_COMMAND
tokenize_console(s);
}
- GetCvars(caller, 1);
+ GetCvars(caller, CS(caller), 1);
return;
}
void print_to(entity to, string input)
{
if (to) sprint(to, strcat(input, "\n"));
- else LOG_INFO(input, "\n");
+ else print(input, "\n");
}
// ==========================================
case "butcher":
{
if (caller) { print_to(caller, "This command is not available to players"); return; }
- if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(M_ARGV(0, string), "\n"); return; }
+ if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFOF("%s", M_ARGV(0, string)); return; }
int tmp_remcount = 0;
this.maxs_x = (mi_picmax.x - mi_picmin.x) / this.size.x;
this.maxs_y = (mi_picmax.y - mi_picmin.y) / this.size.y;
this.maxs_z = mi_max.z - mi_min.z;
- LOG_INFO("Picture mins/maxs: ", ftos(this.maxs.x), " and ", ftos(this.maxs.y), " should match\n");
+ LOG_INFO("Picture mins/maxs: ", ftos(this.maxs.x), " and ", ftos(this.maxs.y), " should match");
this.netname = strzone(strcat("gfx/", mi_shortname, "_radar.xpm"));
if (!(this.count & 1))
{
{
fclose(this.cnt);
- LOG_INFO(this.netname, " already exists, aborting (you may want to specify --force)\n");
+ LOG_INFO(this.netname, " already exists, aborting (you may want to specify --force)");
RadarMap_Next();
return;
}
this.cnt = fopen(this.netname, FILE_WRITE);
if (this.cnt < 0)
{
- LOG_INFO("Error writing ", this.netname, "\n");
+ LOG_INFO("Error writing ", this.netname);
delete(this);
radarmapper = NULL;
return;
}
- LOG_INFO("Writing to ", this.netname, "...\n");
+ LOG_INFO("Writing to ", this.netname, "...");
fputs(this.cnt, "/* XPM */\n");
fputs(this.cnt, "static char *RadarMap[] = {\n");
fputs(this.cnt, "/* columns rows colors chars-per-pixel */\n");
else
{
fputs(this.cnt, "\",\n");
- LOG_INFO(ftos(this.size.y - this.frame), " lines left\n");
+ LOG_INFO(ftos(this.size.y - this.frame), " lines left");
}
}
else
{
fputs(this.cnt, "\",\n");
- LOG_INFO(ftos(this.size.y - this.frame), " lines left\n");
+ LOG_INFO(ftos(this.size.y - this.frame), " lines left");
}
}
// close the file
fputs(this.cnt, "};\n");
fclose(this.cnt);
- LOG_INFO("Finished. Please edit data/", this.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
+ LOG_INFO("Finished. Please edit data/", this.netname, " with an image editing application and place it in the TGA format in the gfx folder.");
RadarMap_Next();
}
}
if (radarmapper) // after doing the arguments, see if we successfully went forward.
{
- LOG_INFO("Radarmap entity spawned.\n");
+ LOG_INFO("Radarmap entity spawned.");
return true; // if so, don't print usage.
}
}
#pragma once
#ifndef RADARMAP
-bool RadarMap_Make(float argc) { LOG_INFO("radarmap is disabled, compile with -DRADARMAP to enable it.\n"); return true; }
+bool RadarMap_Make(float argc) { LOG_INFO("radarmap is disabled, compile with -DRADARMAP to enable it."); return true; }
#else
// ===========================================
{
if (_MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, 0, 1))
{
- LOG_INFO("Done rebuiling mapinfos.\n");
+ LOG_INFO("Done rebuiling mapinfos.");
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
delete(this);
}
if (accepted <= 0)
{
- LOG_INFO("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ LOG_INFO("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : "."));
continue;
}
}
if (successful) bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
- else LOG_INFO("No players given (", original_targets, ") could receive the message.\n");
+ else LOG_INFO("No players given (", original_targets, ") could receive the message.");
return;
}
}
default:
- LOG_INFO("Incorrect parameters for ^2adminmsg^7\n");
+ LOG_INFO("Incorrect parameters for ^2adminmsg^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd adminmsg clients \"message\" [infobartime]\n");
- LOG_INFO(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
- LOG_INFO(" If infobartime is provided, the message will be sent to infobar.\n");
- LOG_INFO(" Otherwise, it will just be sent as a centerprint message.\n");
- LOG_INFO("Examples: adminmsg 2,4 \"this infomessage will last for ten seconds\" 10\n");
- LOG_INFO(" adminmsg 2,5 \"this message will be a centerprint\"\n");
+ LOG_INFO("Usage:^3 sv_cmd adminmsg clients \"message\" [infobartime]");
+ LOG_INFO(" 'clients' is a list (separated by commas) of player entity ID's or nicknames");
+ LOG_INFO(" If infobartime is provided, the message will be sent to infobar.");
+ LOG_INFO(" Otherwise, it will just be sent as a centerprint message.");
+ LOG_INFO("Examples: adminmsg 2,4 \"this infomessage will last for ten seconds\" 10");
+ LOG_INFO(" adminmsg 2,5 \"this message will be a centerprint\"");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd allready\n");
- LOG_INFO(" No arguments required.\n");
+ LOG_INFO("Usage:^3 sv_cmd allready");
+ LOG_INFO(" No arguments required.");
return;
}
}
++n;
});
if (n) bprint(strcat("Successfully forced all (", ftos(n), ") players to spectate", (reason ? strcat(" for reason: '", reason, "'") : ""), ".\n"));
- else LOG_INFO("No players found to spectate.\n");
+ else LOG_INFO("No players found to spectate.");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd allspec [reason]\n");
- LOG_INFO(" Where 'reason' is an optional argument for explanation of allspec command.\n");
- LOG_INFO("See also: ^2moveplayer, shuffleteams^7\n");
+ LOG_INFO("Usage:^3 sv_cmd allspec [reason]");
+ LOG_INFO(" Where 'reason' is an optional argument for explanation of allspec command.");
+ LOG_INFO("See also: ^2moveplayer, shuffleteams^7");
return;
}
}
}
else
{
- LOG_INFO("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("anticheat: ", GetClientErrorString(accepted, argv(1)), ".");
}
}
default:
- LOG_INFO("Incorrect parameters for ^2anticheat^7\n");
+ LOG_INFO("Incorrect parameters for ^2anticheat^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd anticheat client\n");
- LOG_INFO(" 'client' is the entity number or name of the player.\n");
+ LOG_INFO("Usage:^3 sv_cmd anticheat client");
+ LOG_INFO(" 'client' is the entity number or name of the player.");
return;
}
}
NULL);
size_max.z = (trace_startsolid) ? world.absmax.z : trace_endpos.z;
- LOG_INFOF("Original size: %v %v\n", world.absmin, world.absmax);
- LOG_INFOF("Currently set size: %v %v\n", world.mins, world.maxs);
- LOG_INFOF("Solid bounding box size: %v %v\n", size_min, size_max);
+ LOG_INFOF("Original size: %v %v", world.absmin, world.absmax);
+ LOG_INFOF("Currently set size: %v %v", world.mins, world.maxs);
+ LOG_INFOF("Solid bounding box size: %v %v", size_min, size_max);
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd bbox\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2gettaginfo, trace^7\n");
+ LOG_INFO("Usage:^3 sv_cmd bbox");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2gettaginfo, trace^7");
return;
}
}
cvar_settemp("bot_number", "0");
bot_fixcount();
cvar_settemp("bot_number", argv(2));
- if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count\n");
+ if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count");
return;
}
else if (argv(1) == "load" && argc == 3)
fh = fopen(argv(2), FILE_READ);
if (fh < 0)
{
- LOG_INFO("cannot open the file\n");
+ LOG_INFO("cannot open the file");
return;
}
cvar_settemp("bot_number", "0");
bot_fixcount();
cvar_settemp("bot_number", argv(3));
- if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count\n");
+ if (!bot_fixcount()) LOG_INFO("Sorry, could not set requested bot count");
}
else
{
++i;
}
- LOG_INFO(ftos(i), " commands read\n");
+ LOG_INFO(ftos(i), " commands read");
fclose(fh);
return;
}
bot_num++;
});
if(bot_num)
- LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to all bots (", ftos(bot_num), ")\n"));
+ LOG_INFO("Command '", substring(command, argv_start_index(2), -1), "' sent to all bots (", ftos(bot_num), ")");
return;
}
else
if (bot == NULL) bot = find_bot_by_name(argv(1));
if (bot)
{
- LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n"));
+ LOG_INFO("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname);
bot_queuecommand(bot, substring(command, argv_start_index(2), -1));
return;
}
else
{
- LOG_INFO(strcat("Error: Can't find bot with the name or id '", argv(1), "' - Did you mistype the command?\n")); // don't return so that usage is shown
+ LOG_INFO("Error: Can't find bot with the name or id '", argv(1), "' - Did you mistype the command?"); // don't return so that usage is shown
}
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2bot_cmd^7\n");
+ LOG_INFO("Incorrect parameters for ^2bot_cmd^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd bot_cmd client command [argument]\n");
- LOG_INFO(" 'client' can be either the name of the bot or a progressive number (not the entity number!)\n");
- LOG_INFO(" can also be '*' or 'all' to allow sending the command to all the bots\n");
- LOG_INFO(" For full list of commands, see bot_cmd help [command].\n");
- LOG_INFO("Examples: sv_cmd bot_cmd 1 cc \"say something\"\n");
- LOG_INFO(" sv_cmd bot_cmd 1 presskey jump\n");
- LOG_INFO(" sv_cmd bot_cmd * pause\n");
+ LOG_INFO("Usage:^3 sv_cmd bot_cmd client command [argument]");
+ LOG_INFO(" 'client' can be either the name of the bot or a progressive number (not the entity number!)");
+ LOG_INFO(" can also be '*' or 'all' to allow sending the command to all the bots");
+ LOG_INFO(" For full list of commands, see bot_cmd help [command].");
+ LOG_INFO("Examples: sv_cmd bot_cmd 1 cc \"say something\"");
+ LOG_INFO(" sv_cmd bot_cmd 1 presskey jump");
+ LOG_INFO(" sv_cmd bot_cmd * pause");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd cointoss [result1 result2]\n");
- LOG_INFO(" Where 'result1' and 'result2' are user created options.\n");
+ LOG_INFO("Usage:^3 sv_cmd cointoss [result1 result2]");
+ LOG_INFO(" Where 'result1' and 'result2' are user created options.");
return;
}
}
if (argv(1) == "save")
{
db_save(ServerProgsDB, argv(2));
- LOG_INFO(strcat("Copied serverprogs database to '", argv(2), "' in the data directory.\n"));
+ LOG_INFO("Copied serverprogs database to '", argv(2), "' in the data directory.");
return;
}
else if (argv(1) == "dump")
{
db_dump(ServerProgsDB, argv(2));
- LOG_INFO("DB dumped.\n"); // wtf does this do?
+ LOG_INFO("DB dumped."); // wtf does this do?
return;
}
else if (argv(1) == "load")
{
db_close(ServerProgsDB);
ServerProgsDB = db_load(argv(2));
- LOG_INFO(strcat("Loaded '", argv(2), "' as new serverprogs database.\n"));
+ LOG_INFO("Loaded '", argv(2), "' as new serverprogs database.");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2database^7\n");
+ LOG_INFO("Incorrect parameters for ^2database^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd database action filename\n");
- LOG_INFO(" Where 'action' is the command to complete,\n");
- LOG_INFO(" and 'filename' is what it acts upon.\n");
- LOG_INFO(" Full list of commands here: \"save, dump, load.\"\n");
+ LOG_INFO("Usage:^3 sv_cmd database action filename");
+ LOG_INFO(" Where 'action' is the command to complete,");
+ LOG_INFO(" and 'filename' is what it acts upon.");
+ LOG_INFO(" Full list of commands here: \"save, dump, load.\"");
return;
}
}
if (accepted > 0)
{
stuffcmd(client, "defer clear\n");
- LOG_INFO("defer clear stuffed to ", playername(client, false), "\n");
+ LOG_INFO("defer clear stuffed to ", playername(client, false));
}
- else { LOG_INFO("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
+ else { LOG_INFO("defer_clear: ", GetClientErrorString(accepted, argv(1)), "."); }
return;
}
}
default:
- LOG_INFO("Incorrect parameters for ^2defer_clear^7\n");
+ LOG_INFO("Incorrect parameters for ^2defer_clear^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd defer_clear client\n");
- LOG_INFO(" 'client' is the entity number or name of the player.\n");
- LOG_INFO("See also: ^2defer_clear_all^7\n");
+ LOG_INFO("Usage:^3 sv_cmd defer_clear client");
+ LOG_INFO(" 'client' is the entity number or name of the player.");
+ LOG_INFO("See also: ^2defer_clear_all^7");
return;
}
}
GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
++n;
});
- if (n) LOG_INFO(strcat("Successfully stuffed defer clear to all clients (", ftos(n), ")\n")); // should a message be added if no players were found?
+ if (n) LOG_INFO("Successfully stuffed defer clear to all clients (", ftos(n), ")"); // should a message be added if no players were found?
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd defer_clear_all\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2defer_clear^7\n");
+ LOG_INFO("Usage:^3 sv_cmd defer_clear_all");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2defer_clear^7");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2delrec^7\n");
+ LOG_INFO("Incorrect parameters for ^2delrec^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd delrec ranking [map]\n");
- LOG_INFO(" 'ranking' is which ranking level to clear up to, \n");
- LOG_INFO(" it will clear all records up to nth place.\n");
- LOG_INFO(" if 'map' is not provided it will use current map.\n");
+ LOG_INFO("Usage:^3 sv_cmd delrec ranking [map]");
+ LOG_INFO(" 'ranking' is which ranking level to clear up to, ");
+ LOG_INFO(" it will clear all records up to nth place.");
+ LOG_INFO(" if 'map' is not provided it will use current map.");
return;
}
}
string s;
d = db_create();
- LOG_INFO("begin of effects list\n");
+ LOG_INFO("begin of effects list");
db_put(d, "TE_GUNSHOT", "1");
- LOG_INFO("effect TE_GUNSHOT is ", ftos(_particleeffectnum("TE_GUNSHOT")), "\n");
+ LOG_INFO("effect TE_GUNSHOT is ", ftos(_particleeffectnum("TE_GUNSHOT")));
db_put(d, "TE_GUNSHOTQUAD", "1");
- LOG_INFO("effect TE_GUNSHOTQUAD is ", ftos(_particleeffectnum("TE_GUNSHOTQUAD")), "\n");
+ LOG_INFO("effect TE_GUNSHOTQUAD is ", ftos(_particleeffectnum("TE_GUNSHOTQUAD")));
db_put(d, "TE_SPIKE", "1");
- LOG_INFO("effect TE_SPIKE is ", ftos(_particleeffectnum("TE_SPIKE")), "\n");
+ LOG_INFO("effect TE_SPIKE is ", ftos(_particleeffectnum("TE_SPIKE")));
db_put(d, "TE_SPIKEQUAD", "1");
- LOG_INFO("effect TE_SPIKEQUAD is ", ftos(_particleeffectnum("TE_SPIKEQUAD")), "\n");
+ LOG_INFO("effect TE_SPIKEQUAD is ", ftos(_particleeffectnum("TE_SPIKEQUAD")));
db_put(d, "TE_SUPERSPIKE", "1");
- LOG_INFO("effect TE_SUPERSPIKE is ", ftos(_particleeffectnum("TE_SUPERSPIKE")), "\n");
+ LOG_INFO("effect TE_SUPERSPIKE is ", ftos(_particleeffectnum("TE_SUPERSPIKE")));
db_put(d, "TE_SUPERSPIKEQUAD", "1");
- LOG_INFO("effect TE_SUPERSPIKEQUAD is ", ftos(_particleeffectnum("TE_SUPERSPIKEQUAD")), "\n");
+ LOG_INFO("effect TE_SUPERSPIKEQUAD is ", ftos(_particleeffectnum("TE_SUPERSPIKEQUAD")));
db_put(d, "TE_WIZSPIKE", "1");
- LOG_INFO("effect TE_WIZSPIKE is ", ftos(_particleeffectnum("TE_WIZSPIKE")), "\n");
+ LOG_INFO("effect TE_WIZSPIKE is ", ftos(_particleeffectnum("TE_WIZSPIKE")));
db_put(d, "TE_KNIGHTSPIKE", "1");
- LOG_INFO("effect TE_KNIGHTSPIKE is ", ftos(_particleeffectnum("TE_KNIGHTSPIKE")), "\n");
+ LOG_INFO("effect TE_KNIGHTSPIKE is ", ftos(_particleeffectnum("TE_KNIGHTSPIKE")));
db_put(d, "TE_EXPLOSION", "1");
- LOG_INFO("effect TE_EXPLOSION is ", ftos(_particleeffectnum("TE_EXPLOSION")), "\n");
+ LOG_INFO("effect TE_EXPLOSION is ", ftos(_particleeffectnum("TE_EXPLOSION")));
db_put(d, "TE_EXPLOSIONQUAD", "1");
- LOG_INFO("effect TE_EXPLOSIONQUAD is ", ftos(_particleeffectnum("TE_EXPLOSIONQUAD")), "\n");
+ LOG_INFO("effect TE_EXPLOSIONQUAD is ", ftos(_particleeffectnum("TE_EXPLOSIONQUAD")));
db_put(d, "TE_TAREXPLOSION", "1");
- LOG_INFO("effect TE_TAREXPLOSION is ", ftos(_particleeffectnum("TE_TAREXPLOSION")), "\n");
+ LOG_INFO("effect TE_TAREXPLOSION is ", ftos(_particleeffectnum("TE_TAREXPLOSION")));
db_put(d, "TE_TELEPORT", "1");
- LOG_INFO("effect TE_TELEPORT is ", ftos(_particleeffectnum("TE_TELEPORT")), "\n");
+ LOG_INFO("effect TE_TELEPORT is ", ftos(_particleeffectnum("TE_TELEPORT")));
db_put(d, "TE_LAVASPLASH", "1");
- LOG_INFO("effect TE_LAVASPLASH is ", ftos(_particleeffectnum("TE_LAVASPLASH")), "\n");
+ LOG_INFO("effect TE_LAVASPLASH is ", ftos(_particleeffectnum("TE_LAVASPLASH")));
db_put(d, "TE_SMALLFLASH", "1");
- LOG_INFO("effect TE_SMALLFLASH is ", ftos(_particleeffectnum("TE_SMALLFLASH")), "\n");
+ LOG_INFO("effect TE_SMALLFLASH is ", ftos(_particleeffectnum("TE_SMALLFLASH")));
db_put(d, "TE_FLAMEJET", "1");
- LOG_INFO("effect TE_FLAMEJET is ", ftos(_particleeffectnum("TE_FLAMEJET")), "\n");
+ LOG_INFO("effect TE_FLAMEJET is ", ftos(_particleeffectnum("TE_FLAMEJET")));
db_put(d, "EF_FLAME", "1");
- LOG_INFO("effect EF_FLAME is ", ftos(_particleeffectnum("EF_FLAME")), "\n");
+ LOG_INFO("effect EF_FLAME is ", ftos(_particleeffectnum("EF_FLAME")));
db_put(d, "TE_BLOOD", "1");
- LOG_INFO("effect TE_BLOOD is ", ftos(_particleeffectnum("TE_BLOOD")), "\n");
+ LOG_INFO("effect TE_BLOOD is ", ftos(_particleeffectnum("TE_BLOOD")));
db_put(d, "TE_SPARK", "1");
- LOG_INFO("effect TE_SPARK is ", ftos(_particleeffectnum("TE_SPARK")), "\n");
+ LOG_INFO("effect TE_SPARK is ", ftos(_particleeffectnum("TE_SPARK")));
db_put(d, "TE_PLASMABURN", "1");
- LOG_INFO("effect TE_PLASMABURN is ", ftos(_particleeffectnum("TE_PLASMABURN")), "\n");
+ LOG_INFO("effect TE_PLASMABURN is ", ftos(_particleeffectnum("TE_PLASMABURN")));
db_put(d, "TE_TEI_G3", "1");
- LOG_INFO("effect TE_TEI_G3 is ", ftos(_particleeffectnum("TE_TEI_G3")), "\n");
+ LOG_INFO("effect TE_TEI_G3 is ", ftos(_particleeffectnum("TE_TEI_G3")));
db_put(d, "TE_TEI_SMOKE", "1");
- LOG_INFO("effect TE_TEI_SMOKE is ", ftos(_particleeffectnum("TE_TEI_SMOKE")), "\n");
+ LOG_INFO("effect TE_TEI_SMOKE is ", ftos(_particleeffectnum("TE_TEI_SMOKE")));
db_put(d, "TE_TEI_BIGEXPLOSION", "1");
- LOG_INFO("effect TE_TEI_BIGEXPLOSION is ", ftos(_particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n");
+ LOG_INFO("effect TE_TEI_BIGEXPLOSION is ", ftos(_particleeffectnum("TE_TEI_BIGEXPLOSION")));
db_put(d, "TE_TEI_PLASMAHIT", "1");
- LOG_INFO("effect TE_TEI_PLASMAHIT is ", ftos(_particleeffectnum("TE_TEI_PLASMAHIT")), "\n");
+ LOG_INFO("effect TE_TEI_PLASMAHIT is ", ftos(_particleeffectnum("TE_TEI_PLASMAHIT")));
db_put(d, "EF_STARDUST", "1");
- LOG_INFO("effect EF_STARDUST is ", ftos(_particleeffectnum("EF_STARDUST")), "\n");
+ LOG_INFO("effect EF_STARDUST is ", ftos(_particleeffectnum("EF_STARDUST")));
db_put(d, "TR_ROCKET", "1");
- LOG_INFO("effect TR_ROCKET is ", ftos(_particleeffectnum("TR_ROCKET")), "\n");
+ LOG_INFO("effect TR_ROCKET is ", ftos(_particleeffectnum("TR_ROCKET")));
db_put(d, "TR_GRENADE", "1");
- LOG_INFO("effect TR_GRENADE is ", ftos(_particleeffectnum("TR_GRENADE")), "\n");
+ LOG_INFO("effect TR_GRENADE is ", ftos(_particleeffectnum("TR_GRENADE")));
db_put(d, "TR_BLOOD", "1");
- LOG_INFO("effect TR_BLOOD is ", ftos(_particleeffectnum("TR_BLOOD")), "\n");
+ LOG_INFO("effect TR_BLOOD is ", ftos(_particleeffectnum("TR_BLOOD")));
db_put(d, "TR_WIZSPIKE", "1");
- LOG_INFO("effect TR_WIZSPIKE is ", ftos(_particleeffectnum("TR_WIZSPIKE")), "\n");
+ LOG_INFO("effect TR_WIZSPIKE is ", ftos(_particleeffectnum("TR_WIZSPIKE")));
db_put(d, "TR_SLIGHTBLOOD", "1");
- LOG_INFO("effect TR_SLIGHTBLOOD is ", ftos(_particleeffectnum("TR_SLIGHTBLOOD")), "\n");
+ LOG_INFO("effect TR_SLIGHTBLOOD is ", ftos(_particleeffectnum("TR_SLIGHTBLOOD")));
db_put(d, "TR_KNIGHTSPIKE", "1");
- LOG_INFO("effect TR_KNIGHTSPIKE is ", ftos(_particleeffectnum("TR_KNIGHTSPIKE")), "\n");
+ LOG_INFO("effect TR_KNIGHTSPIKE is ", ftos(_particleeffectnum("TR_KNIGHTSPIKE")));
db_put(d, "TR_VORESPIKE", "1");
- LOG_INFO("effect TR_VORESPIKE is ", ftos(_particleeffectnum("TR_VORESPIKE")), "\n");
+ LOG_INFO("effect TR_VORESPIKE is ", ftos(_particleeffectnum("TR_VORESPIKE")));
db_put(d, "TR_NEHAHRASMOKE", "1");
- LOG_INFO("effect TR_NEHAHRASMOKE is ", ftos(_particleeffectnum("TR_NEHAHRASMOKE")), "\n");
+ LOG_INFO("effect TR_NEHAHRASMOKE is ", ftos(_particleeffectnum("TR_NEHAHRASMOKE")));
db_put(d, "TR_NEXUIZPLASMA", "1");
- LOG_INFO("effect TR_NEXUIZPLASMA is ", ftos(_particleeffectnum("TR_NEXUIZPLASMA")), "\n");
+ LOG_INFO("effect TR_NEXUIZPLASMA is ", ftos(_particleeffectnum("TR_NEXUIZPLASMA")));
db_put(d, "TR_GLOWTRAIL", "1");
- LOG_INFO("effect TR_GLOWTRAIL is ", ftos(_particleeffectnum("TR_GLOWTRAIL")), "\n");
+ LOG_INFO("effect TR_GLOWTRAIL is ", ftos(_particleeffectnum("TR_GLOWTRAIL")));
db_put(d, "TR_SEEKER", "1");
- LOG_INFO("effect TR_SEEKER is ", ftos(_particleeffectnum("TR_SEEKER")), "\n");
+ LOG_INFO("effect TR_SEEKER is ", ftos(_particleeffectnum("TR_SEEKER")));
db_put(d, "SVC_PARTICLE", "1");
- LOG_INFO("effect SVC_PARTICLE is ", ftos(_particleeffectnum("SVC_PARTICLE")), "\n");
+ LOG_INFO("effect SVC_PARTICLE is ", ftos(_particleeffectnum("SVC_PARTICLE")));
fh = fopen("effectinfo.txt", FILE_READ);
while ((s = fgets(fh)))
if (db_get(d, argv(1)) != "1")
{
int i = _particleeffectnum(argv(1));
- if (i >= 0) LOG_INFO("effect ", argv(1), " is ", ftos(i), "\n");
+ if (i >= 0) LOG_INFO("effect ", argv(1), " is ", ftos(i));
db_put(d, argv(1), "1");
}
}
}
- LOG_INFO("end of effects list\n");
+ LOG_INFO("end of effects list");
db_close(d);
return;
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd effectindexdump\n");
- LOG_INFO(" No arguments required.\n");
+ LOG_INFO("Usage:^3 sv_cmd effectindexdump");
+ LOG_INFO(" No arguments required.");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd extendmatchtime\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2reducematchtime^7\n");
+ LOG_INFO("Usage:^3 sv_cmd extendmatchtime");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2reducematchtime^7");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2gametype^7\n");
+ LOG_INFO("Incorrect parameters for ^2gametype^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd gametype mode\n");
- LOG_INFO(" Where 'mode' is the gametype mode to switch to.\n");
- LOG_INFO("See also: ^2gotomap^7\n");
+ LOG_INFO("Usage:^3 sv_cmd gametype mode");
+ LOG_INFO(" Where 'mode' is the gametype mode to switch to.");
+ LOG_INFO("See also: ^2gotomap^7");
return;
}
}
if (i)
{
v = gettaginfo(tmp_entity, i);
- LOG_INFO("model ", tmp_entity.model, " frame ", ftos(tmp_entity.frame), " tag ", gettaginfo_name);
- LOG_INFO(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
- LOG_INFO(" vector = ", ftos(v.x), " ", ftos(v.y), " ", ftos(v.z), "\n");
- LOG_INFO(" offset = ", ftos(gettaginfo_offset.x), " ", ftos(gettaginfo_offset.y), " ", ftos(gettaginfo_offset.z), "\n");
- LOG_INFO(" forward = ", ftos(gettaginfo_forward.x), " ", ftos(gettaginfo_forward.y), " ", ftos(gettaginfo_forward.z), "\n");
- LOG_INFO(" right = ", ftos(gettaginfo_right.x), " ", ftos(gettaginfo_right.y), " ", ftos(gettaginfo_right.z), "\n");
- LOG_INFO(" up = ", ftos(gettaginfo_up.x), " ", ftos(gettaginfo_up.y), " ", ftos(gettaginfo_up.z), "\n");
+ LOG_INFOF(
+ "model %s frame %s tag %s index %s parent %s",
+ tmp_entity.model, ftos(tmp_entity.frame), gettaginfo_name, ftos(i), ftos(gettaginfo_parent)
+ );
+ LOG_INFOF(" vector = %s %s %s", ftos(v.x), ftos(v.y), ftos(v.z));
+ LOG_INFOF(" offset = %s %s %s", ftos(gettaginfo_offset.x), ftos(gettaginfo_offset.y), ftos(gettaginfo_offset.z));
+ LOG_INFOF(" forward = %s %s %s", ftos(gettaginfo_forward.x), ftos(gettaginfo_forward.y), ftos(gettaginfo_forward.z));
+ LOG_INFOF(" right = %s %s %s", ftos(gettaginfo_right.x), ftos(gettaginfo_right.y), ftos(gettaginfo_right.z));
+ LOG_INFOF(" up = %s %s %s", ftos(gettaginfo_up.x), ftos(gettaginfo_up.y), ftos(gettaginfo_up.z));
if (argc >= 6)
{
v.y = -v.y;
}
else
{
- LOG_INFO("bone not found\n");
+ LOG_INFO("bone not found");
}
delete(tmp_entity);
}
default:
- LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
+ LOG_INFO("Incorrect parameters for ^2gettaginfo^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
- LOG_INFO("See also: ^2bbox, trace^7\n");
+ LOG_INFO("Usage:^3 sv_cmd gettaginfo model frame index [command one] [command two]");
+ LOG_INFO("See also: ^2bbox, trace^7");
return;
}
}
t2 += gettime(GETTIME_HIRES) - t0;
n += 1;
}
- LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s\n");
- LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s\n");
+ LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s");
+ LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s");
delete(tmp_entity);
return;
}
default:
- LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
+ LOG_INFO("Incorrect parameters for ^2gettaginfo^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
- LOG_INFO("See also: ^2bbox, trace^7\n");
+ LOG_INFO("Usage:^3 sv_cmd gettaginfo model frame index [command one] [command two]");
+ LOG_INFO("See also: ^2bbox, trace^7");
return;
}
}
{
if (argv(1))
{
- LOG_INFO(GotoMap(argv(1)), "\n");
+ LOG_INFO(GotoMap(argv(1)));
return;
}
}
default:
- LOG_INFO("Incorrect parameters for ^2gotomap^7\n");
+ LOG_INFO("Incorrect parameters for ^2gotomap^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd gotomap map\n");
- LOG_INFO(" Where 'map' is the *.bsp file to change to.\n");
- LOG_INFO("See also: ^2gametype^7\n");
+ LOG_INFO("Usage:^3 sv_cmd gotomap map");
+ LOG_INFO(" Where 'map' is the *.bsp file to change to.");
+ LOG_INFO("See also: ^2gametype^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd lockteams\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2unlockteams^7\n");
+ LOG_INFO("Usage:^3 sv_cmd lockteams");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2unlockteams^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd make_mapinfo\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2radarmap^7\n");
+ LOG_INFO("Usage:^3 sv_cmd make_mapinfo");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2radarmap^7");
return;
}
}
if (accepted <= 0)
{
- LOG_INFO("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ LOG_INFO("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : "."));
continue;
}
}
else
{
- LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already spectating.\n");
+ LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already spectating.");
}
continue;
}
if (team_id == client.team) // already on the destination team
{
// keep the forcing undone
- LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
+ LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7."));
continue;
}
else if (team_id == 0) // auto team
// Check to see if the destination team is even available
switch (team_id)
{
- case NUM_TEAM_1: if (c1 == -1) { LOG_INFO("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
- case NUM_TEAM_2: if (c2 == -1) { LOG_INFO("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
- case NUM_TEAM_3: if (c3 == -1) { LOG_INFO("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
- case NUM_TEAM_4: if (c4 == -1) { LOG_INFO("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
+ case NUM_TEAM_1: if (c1 == -1) { LOG_INFO("Sorry, can't move player to red team if it doesn't exist."); return; } break;
+ case NUM_TEAM_2: if (c2 == -1) { LOG_INFO("Sorry, can't move player to blue team if it doesn't exist."); return; } break;
+ case NUM_TEAM_3: if (c3 == -1) { LOG_INFO("Sorry, can't move player to yellow team if it doesn't exist."); return; } break;
+ case NUM_TEAM_4: if (c4 == -1) { LOG_INFO("Sorry, can't move player to pink team if it doesn't exist."); return; } break;
- default: LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.\n");
+ default: LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.");
return;
}
client.team_forced = 0;
MoveToTeam(client, team_id, 6);
successful = strcat(successful, (successful ? ", " : ""), playername(client, false));
- LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
+ LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", playername(client, false), ") has been moved to the ", Team_ColoredFullName(team_id), "^7.");
continue;
}
else
{
- LOG_INFO("Can't change teams when currently not playing a team game.\n");
+ LOG_INFO("Can't change teams when currently not playing a team game.");
return;
}
}
else
{
- LOG_INFO("Can't change teams if the player isn't in the game.\n"); // well technically we could, but should we allow that? :P
+ LOG_INFO("Can't change teams if the player isn't in the game."); // well technically we could, but should we allow that? :P
return;
}
}
}
if (successful) bprint("Successfully moved players ", successful, " to destination ", destination, ".\n");
- else LOG_INFO("No players given (", original_targets, ") are able to move.\n");
+ else LOG_INFO("No players given (", original_targets, ") are able to move.");
return; // still correct parameters so return to avoid usage print
}
}
default:
- LOG_INFO("Incorrect parameters for ^2moveplayer^7\n");
+ LOG_INFO("Incorrect parameters for ^2moveplayer^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd moveplayer clients destination\n");
- LOG_INFO(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
- LOG_INFO(" 'destination' is what to send the player to, be it team or spectating\n");
- LOG_INFO(" Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n");
- LOG_INFO("Examples: sv_cmd moveplayer 1,3,5 red 3\n");
- LOG_INFO(" sv_cmd moveplayer 2 spec \n");
- LOG_INFO("See also: ^2allspec, shuffleteams^7\n");
+ LOG_INFO("Usage:^3 sv_cmd moveplayer clients destination");
+ LOG_INFO(" 'clients' is a list (separated by commas) of player entity ID's or nicknames");
+ LOG_INFO(" 'destination' is what to send the player to, be it team or spectating");
+ LOG_INFO(" Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"");
+ LOG_INFO("Examples: sv_cmd moveplayer 1,3,5 red 3");
+ LOG_INFO(" sv_cmd moveplayer 2 spec ");
+ LOG_INFO("See also: ^2allspec, shuffleteams^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd nospectators\n");
- LOG_INFO(" No arguments required.\n");
+ LOG_INFO("Usage:^3 sv_cmd nospectators");
+ LOG_INFO(" No arguments required.");
return;
}
}
if (accepted <= 0)
{
- LOG_INFO("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ LOG_INFO("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".");
return;
}
if (accepted <= 0)
{
- LOG_INFO("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ LOG_INFO("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".");
return;
}
}
default:
- LOG_INFO("Incorrect parameters for ^2playerdemo^7\n");
+ LOG_INFO("Incorrect parameters for ^2playerdemo^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)\n");
- LOG_INFO(" Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"\n");
+ LOG_INFO("Usage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)");
+ LOG_INFO(" Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"");
return;
}
}
case CMD_REQUEST_COMMAND:
{
DumpStats(false);
- LOG_INFO("stats dumped.\n");
+ LOG_INFO("stats dumped.");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd printstats\n");
- LOG_INFO(" No arguments required.\n");
+ LOG_INFO("Usage:^3 sv_cmd printstats");
+ LOG_INFO(" No arguments required.");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2radarmap^7\n");
+ LOG_INFO("Incorrect parameters for ^2radarmap^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]\n");
- LOG_INFO(" The quality factor Q is roughly proportional to the time taken.\n");
- LOG_INFO(" trace supports no quality factor; its result should look like --block with infinite quality factor.\n");
- LOG_INFO("See also: ^2make_mapinfo^7\n");
+ LOG_INFO("Usage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]");
+ LOG_INFO(" The quality factor Q is roughly proportional to the time taken.");
+ LOG_INFO(" trace supports no quality factor; its result should look like --block with infinite quality factor.");
+ LOG_INFO("See also: ^2make_mapinfo^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd reducematchtime\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2extendmatchtime^7\n");
+ LOG_INFO("Usage:^3 sv_cmd reducematchtime");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2extendmatchtime^7");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2setbots^7\n");
+ LOG_INFO("Incorrect parameters for ^2setbots^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd setbots botnumber\n");
- LOG_INFO(" Where 'botnumber' is the amount of bots to set bot_number cvar to.\n");
- LOG_INFO("See also: ^2bot_cmd^7\n");
+ LOG_INFO("Usage:^3 sv_cmd setbots botnumber");
+ LOG_INFO(" Where 'botnumber' is the amount of bots to set bot_number cvar to.");
+ LOG_INFO("See also: ^2bot_cmd^7");
return;
}
}
{
if (!teamplay)
{
- LOG_INFO("Can't shuffle teams when currently not playing a team game.\n");
+ LOG_INFO("Can't shuffle teams when currently not playing a team game.");
return;
}
// we could theoretically assign forced players to their teams
// and shuffle the rest to fill the empty spots but in practise
// either all players or none are gonna have forced teams
- LOG_INFO("Can't shuffle teams because at least one player has a forced team.\n");
+ LOG_INFO("Can't shuffle teams because at least one player has a forced team.");
return;
}
});
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd shuffleteams\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2moveplayer, allspec^7\n");
+ LOG_INFO("Usage:^3 sv_cmd shuffleteams");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2moveplayer, allspec^7");
return;
}
}
if (accepted > 0)
{
stuffcmd(client, strcat("\n", argv(next_token), "\n"));
- LOG_INFO(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1), ").\n"));
+ LOG_INFO("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1), ").");
}
else
{
- LOG_INFO("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("stuffto: ", GetClientErrorString(accepted, argv(1)), ".");
}
return;
}
default:
- LOG_INFO("Incorrect parameters for ^2stuffto^7\n");
+ LOG_INFO("Incorrect parameters for ^2stuffto^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd stuffto client \"command\"\n");
- LOG_INFO(" 'client' is the entity number or name of the player,\n");
- LOG_INFO(" and 'command' is the command to be sent to that player.\n");
+ LOG_INFO("Usage:^3 sv_cmd stuffto client \"command\"");
+ LOG_INFO(" 'client' is the entity number or name of the player,");
+ LOG_INFO(" and 'command' is the command to be sent to that player.");
return;
}
}
#else
if (request)
{
- LOG_INFO("stuffto command is not enabled on this server.\n");
+ LOG_INFO("stuffto command is not enabled on this server.");
return;
}
#endif
case "debug":
{
float hitcount = 0;
- LOG_INFO("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n");
+ LOG_INFO("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.");
float worst_endpos_bug = 0;
for ( ; ; )
{
}
}
- LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
- LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
+ LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu");
+ LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu");
tracebox(p, PL_MIN_CONST + '0.1 0.1 0.1', PL_MAX_CONST - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, NULL);
- if (trace_startsolid) LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
- else LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ if (trace_startsolid) LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p));
+ else LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p));
if (++hitcount >= 10) break;
}
else
if (dq > worst_endpos_bug)
{
worst_endpos_bug = dq;
- LOG_INFO("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
- LOG_INFO("could go ", ftos(dq), " units further to ", vtos(q), "\n");
+ LOG_INFO("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p));
+ LOG_INFO("could go ", ftos(dq), " units further to ", vtos(q));
if (++hitcount >= 10) break;
}
}
vv = trace_endpos;
if (trace_fraction == 1)
{
- LOG_INFO("not above ground, aborting\n");
+ LOG_INFO("not above ground, aborting");
return;
}
f = 0;
dv = randomvec();
if (dv.z > 0) dv = -1 * dv;
tracebox(vv, e.mins, e.maxs, vv + dv, MOVE_NORMAL, e);
- if (trace_startsolid) LOG_INFO("bug 1\n");
+ if (trace_startsolid) LOG_INFO("bug 1");
if (trace_fraction == 1)
{
if (dv.z < f)
{
LOG_INFO("bug 2: ", ftos(dv.x), " ", ftos(dv.y), " ", ftos(dv.z));
- LOG_INFO(" (", ftos(asin(dv.z / vlen(dv)) * 180 / M_PI), " degrees)\n");
+ LOG_INFO(" (", ftos(asin(dv.z / vlen(dv)) * 180 / M_PI), " degrees)");
f = dv.z;
}
}
}
- LOG_INFO("highest possible dist: ", ftos(f), "\n");
+ LOG_INFO("highest possible dist: ", ftos(f));
return;
}
if (argc == 4)
{
e = nextent(NULL);
- if (tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL)) LOG_INFO("can walk\n");
- else LOG_INFO("cannot walk\n");
+ if (tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL)) LOG_INFO("can walk");
+ else LOG_INFO("cannot walk");
return;
}
}
}
default:
- LOG_INFO("Incorrect parameters for ^2trace^7\n");
+ LOG_INFO("Incorrect parameters for ^2trace^7");
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd trace command (startpos endpos)\n");
- LOG_INFO(" Full list of commands here: \"debug, debug2, walk, showline.\"\n");
- LOG_INFO("See also: ^2bbox, gettaginfo^7\n");
+ LOG_INFO("Usage:^3 sv_cmd trace command (startpos endpos)");
+ LOG_INFO(" Full list of commands here: \"debug, debug2, walk, showline.\"");
+ LOG_INFO("See also: ^2bbox, gettaginfo^7");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd unlockteams\n");
- LOG_INFO(" No arguments required.\n");
- LOG_INFO("See also: ^2lockteams^7\n");
+ LOG_INFO("Usage:^3 sv_cmd unlockteams");
+ LOG_INFO(" No arguments required.");
+ LOG_INFO("See also: ^2lockteams^7");
return;
}
}
if (argc >= 2)
{
CampaignLevelWarp(stof(argv(1)));
- LOG_INFO("Successfully warped to campaign level ", argv(1), ".\n");
+ LOG_INFO("Successfully warped to campaign level ", argv(1), ".");
}
else
{
CampaignLevelWarp(-1);
- LOG_INFO("Successfully warped to next campaign level.\n");
+ LOG_INFO("Successfully warped to next campaign level.");
}
}
else
{
- LOG_INFO("Not in campaign, can't level warp\n");
+ LOG_INFO("Not in campaign, can't level warp");
}
return;
}
default:
case CMD_REQUEST_USAGE:
{
- LOG_INFO("\nUsage:^3 sv_cmd warp [level]\n");
- LOG_INFO(" 'level' is the level to change campaign mode to.\n");
- LOG_INFO(" if 'level' is not provided it will change to the next level.\n");
+ LOG_INFO("Usage:^3 sv_cmd warp [level]");
+ LOG_INFO(" 'level' is the level to change campaign mode to.");
+ LOG_INFO(" if 'level' is not provided it will change to the next level.");
return;
}
}
void GameCommand_macro_help()
{
- FOREACH(SERVER_COMMANDS, true, { LOG_INFOF(" ^2%s^7: %s\n", it.m_name, it.m_description); });
+ FOREACH(SERVER_COMMANDS, true, { LOG_INFOF(" ^2%s^7: %s", it.m_name, it.m_description); });
}
float GameCommand_macro_command(float argc, string command)
{
if (argc == 1)
{
- LOG_INFO("\nServer console commands:\n");
+ LOG_INFO("Server console commands:");
GameCommand_macro_help();
- LOG_INFO("\nBanning commands:\n");
+ LOG_INFO("\nBanning commands:");
BanCommand_macro_help();
- LOG_INFO("\nCommon networked commands:\n");
+ LOG_INFO("\nCommon networked commands:");
CommonCommand_macro_help(NULL);
- LOG_INFO("\nGeneric commands shared by all programs:\n");
+ LOG_INFO("\nGeneric commands shared by all programs:");
GenericCommand_macro_help();
- LOG_INFO("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
- LOG_INFO("For help about a specific command, type sv_cmd help COMMAND\n");
+ LOG_INFO(
+ "\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n"
+ "For help about a specific command, type sv_cmd help COMMAND"
+ );
return;
}
}
// nothing above caught the command, must be invalid
- LOG_INFO(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");
+ LOG_INFO(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.");
}
if(cvar_type(cvarname) & CVAR_TYPEFLAG_EXISTS)
cmdrestriction = cvar_string(cvarname);
else
- LOG_INFO("NOTE: ", cvarname, " does not exist, no restrictions will be applied.\n");
+ LOG_INFO("NOTE: ", cvarname, " does not exist, no restrictions will be applied.");
if (cmdrestriction == "") return true;
{
if (it.classname == "weapon_rocketlauncher" || it.classname == "weapon_devastator") {
this.ammo_rockets += it.count * WEP_CVAR(devastator, ammo);
- this.netname = "devastator";
+ this.netname = cons(this.netname, "devastator");
}
else if (it.classname == "weapon_lightning") {
this.ammo_cells += it.count * WEP_CVAR_PRI(electro, ammo); // WEAPONTODO
- if(this.netname == "")
- this.netname = "electro";
- else
- this.netname = strcat(this.netname, " electro");
+ this.netname = cons(this.netname, "electro");
}
else if (it.classname == "weapon_plasmagun") {
this.ammo_rockets += it.count * WEP_CVAR_PRI(hagar, ammo); // WEAPONTODO
- if(this.netname == "")
- this.netname = "hagar";
- else
- this.netname = strcat(this.netname, " hagar");
+ this.netname = cons(this.netname, "hagar");
}
else if (it.classname == "weapon_bfg") {
this.ammo_cells += it.count * WEP_CVAR_PRI(crylink, ammo);
- if(this.netname == "")
- this.netname = "crylink";
- else
- this.netname = strcat(this.netname, " crylink");
+ this.netname = cons(this.netname, "crylink");
}
else if (it.classname == "weapon_grenadelauncher" || it.classname == "weapon_mortar") {
this.ammo_rockets += it.count * WEP_CVAR_PRI(mortar, ammo); // WEAPONTODO
- if(this.netname == "")
- this.netname = "mortar";
- else
- this.netname = strcat(this.netname, " mortar");
+ this.netname = cons(this.netname, "mortar");
}
else if (it.classname == "item_armor_body")
this.armorvalue = 100;
.float bulletcounter;
// Nexball
-.entity ballcarried; // Also used for keepaway
float g_nexball_meter_period;
void SUB_DontUseTargets(entity this, entity actor, entity trigger);
void UpdateFrags(entity player, int f)
{
- PlayerTeamScore_AddScore(player, f);
+ GameRules_scoring_add_team(player, SCORE, f);
}
void GiveFrags (entity attacker, entity targ, float f, int deathtype)
if(targ == attacker)
{
// suicide
- PlayerScore_Add(attacker, SP_SUICIDES, 1);
+ GameRules_scoring_add(attacker, SUICIDES, 1);
}
else
{
// teamkill
- PlayerScore_Add(attacker, SP_KILLS, -1); // or maybe add a teamkills field?
+ GameRules_scoring_add(attacker, KILLS, -1); // or maybe add a teamkills field?
}
}
else
{
// regular frag
- PlayerScore_Add(attacker, SP_KILLS, 1);
+ GameRules_scoring_add(attacker, KILLS, 1);
if(targ.playerid)
PS_GR_P_ADDVAL(attacker, sprintf("kills-%d", targ.playerid), 1);
}
- PlayerScore_Add(targ, SP_DEATHS, 1);
+ GameRules_scoring_add(targ, DEATHS, 1);
.entity weaponentity = weaponentities[0]; // TODO: unhardcode
LogDeath("accident", deathtype, targ, targ);
GiveFrags(targ, targ, -1, deathtype);
- if(PlayerScore_Add(targ, SP_SCORE, 0) == -5)
+ if(GameRules_scoring_add(targ, SCORE, 0) == -5)
{
Send_Notification(NOTIF_ONE, targ, MSG_ANNCE, ANNCE_ACHIEVEMENT_BOTLIKE);
PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
force = force * a;
if(autocvar_g_throughfloor_debug)
- LOG_INFOF(" D=%f F=%f\n", finaldmg, vlen(force));
+ LOG_INFOF(" D=%f F=%f", finaldmg, vlen(force));
}
//if (targ == attacker)
else
{
this.nextthink = time + 1;
- LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...\n");
+ LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...");
}
}
BADCVAR("g_freezetag");
BADCVAR("g_freezetag_teams");
BADCVAR("g_invasion_teams");
+ BADCVAR("g_invasion_type");
BADCVAR("g_jailbreak");
BADCVAR("g_jailbreak_teams");
BADCVAR("g_keepaway");
tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, NULL);
if(trace_fraction == 1)
continue;
- LOG_INFO(ftos(i), " -> ", vtos(trace_endpos), "\n");
+ LOG_INFO(ftos(i), " -> ", vtos(trace_endpos));
}
break;
MapInfo_Shutdown();
}
-void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override)
-{
- if(!autocvar_g_campaign)
- {
- if(fraglimit_override >= 0) cvar_set("fraglimit", ftos(fraglimit_override));
- if(timelimit_override >= 0) cvar_set("timelimit", ftos(timelimit_override));
- if(leadlimit_override >= 0) cvar_set("leadlimit", ftos(leadlimit_override));
- if(qualifying_override >= 0) cvar_set("g_race_qualifying_timelimit", ftos(qualifying_override));
- }
- limits_are_set = true;
-}
-
void Map_MarkAsRecent(string m);
float world_already_spawned;
void Nagger_Init();
fclose(sentinel);
if (switchversion != "" && switchversion != WATERMARK)
{
- LOG_INFOF("Switching progs: " WATERMARK " -> %s\n", switchversion);
+ LOG_INFOF("Switching progs: " WATERMARK " -> %s", switchversion);
// if it doesn't exist, assume either:
// a) the current program was overwritten
// b) this is a client only update
}
if (wantrestart)
{
- LOG_INFOF("Restart requested\n");
+ LOG_INFOF("Restart requested");
changelevel(mapname);
// let initialization continue, shutdown depends on it
}
readlevelcvars();
GrappleHookInit();
- if(!limits_are_set)
- SetLimits(autocvar_fraglimit_override, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
+ GameRules_limit_fallbacks();
if(warmup_limit == 0)
warmup_limit = (autocvar_timelimit > 0) ? autocvar_timelimit * 60 : autocvar_timelimit;
continue;
if(argv(0) == "cd")
{
- LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
- LOG_INFO(" cdtrack ", argv(2), "\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:");
+ LOG_INFO(" cdtrack ", argv(2));
}
else if(argv(0) == "fog")
{
- LOG_INFO("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
- LOG_INFO(" \"fog\" \"", s, "\"\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:");
+ LOG_INFO(" \"fog\" \"", s, "\"");
}
else if(argv(0) == "set")
{
- LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
- LOG_INFO(" clientsettemp_for_type all ", argv(1), " ", argv(2), "\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:");
+ LOG_INFO(" clientsettemp_for_type all ", argv(1), " ", argv(2));
}
else if(argv(0) != "//")
{
- LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
- LOG_INFO(" clientsettemp_for_type all ", argv(0), " ", argv(1), "\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:");
+ LOG_INFO(" clientsettemp_for_type all ", argv(0), " ", argv(1));
}
}
fclose(fd);
s = strcat(s, GetGametype(), "_", GetMapname(), ":", ftos(rint(time)));
if(to_console)
- LOG_INFO(s, "\n");
+ LOG_INFO(s);
if(to_eventlog)
GameLogEcho(s);
s = strcat(":labels:player:", GetPlayerScoreString(NULL, 0));
if(to_console)
- LOG_INFO(s, "\n");
+ LOG_INFO(s);
if(to_eventlog)
GameLogEcho(s);
if(to_file)
s = strcat(s, "spectator:");
if(to_console)
- LOG_INFO(s, playername(it, false), "\n");
+ LOG_INFO(s, playername(it, false));
if(to_eventlog)
GameLogEcho(strcat(s, ftos(it.playerid), ":", playername(it, false)));
if(to_file)
{
s = strcat(":labels:teamscores:", GetTeamScoreString(0, 0));
if(to_console)
- LOG_INFO(s, "\n");
+ LOG_INFO(s);
if(to_eventlog)
GameLogEcho(s);
if(to_file)
s = strcat(":teamscores:see-labels:", GetTeamScoreString(i, 0));
s = strcat(s, ":", ftos(i));
if(to_console)
- LOG_INFO(s, "\n");
+ LOG_INFO(s);
if(to_eventlog)
GameLogEcho(s);
if(to_file)
}
if(to_console)
- LOG_INFO(":end\n");
+ LOG_INFO(":end");
if(to_eventlog)
GameLogEcho(":end");
if(to_file)
totalplayers = playerswithlaps = readyplayers = 0;
FOREACH_CLIENT(IS_PLAYER(it), {
++totalplayers;
- if(PlayerScore_Add(it, SP_RACE_FASTEST, 0))
+ if(GameRules_scoring_add(it, RACE_FASTEST, 0))
++playerswithlaps;
if(it.ready)
++readyplayers;
clients_found = 0;
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
// TODO add timer
- LOG_INFO("Redirecting: sending connect command to ", it.netname, "\n");
+ LOG_INFO("Redirecting: sending connect command to ", it.netname);
if(redirection_target == "self")
stuffcmd(it, "\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " reconnect\n");
else
++clients_found;
});
- LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.\n");
+ LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.");
if(time > redirection_timeout || clients_found == 0)
localcmd("\nwait; wait; wait; quit\n");
}
else if(world_initialized == 0)
{
- LOG_INFO("NOTE: crashed before even initializing the world, not saving persistent data\n");
+ LOG_INFO("NOTE: crashed before even initializing the world, not saving persistent data");
}
else
{
const int WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached
const int WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW
-bool limits_are_set = false;
-void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override);
-
float WinningCondition_Scores(float limit, float leadlimit);
void SetWinners(.float field, float value);
void IntermissionThink(entity this);
for(int wepslot = 0; wepslot < MAX_WEAPONSLOTS; ++wepslot) \
{ \
.entity weaponentity = weaponentities[wepslot]; \
- W_CycleWeapon(this, this.cvar_cl_weaponpriorities[slot], dir, weaponentity); \
+ W_CycleWeapon(this, CS(this).cvar_cl_weaponpriorities[slot], dir, weaponentity); \
if(wepslot == 0 && autocvar_g_weaponswitch_debug != 1) \
break; \
} \
if (e.wphardwired)
{
- LOG_INFO("^1Warning: ^7Removal of hardwired waypoints is not allowed in the editor. Please remove links from/to this waypoint (", vtos(e.origin), ") by hand from maps/", mapname, ".waypoints.hardwired\n");
+ LOG_INFO("^1Warning: ^7Removal of hardwired waypoints is not allowed in the editor. Please remove links from/to this waypoint (", vtos(e.origin), ") by hand from maps/", mapname, ".waypoints.hardwired");
return;
}
m = 0;
IL_EACH(g_waypoints, it.wpcost >= 10000000,
{
- LOG_INFO("unreachable: ", etos(it), " ", vtos(it.origin), "\n");
+ LOG_INFO("unreachable: ", etos(it), " ", vtos(it.origin));
it.colormod_z = 8;
it.effects |= EF_NODEPTHTEST | EF_BLUE;
++j;
++m;
});
- if (j) LOG_INFOF("%d waypoints cannot be reached from here in any way (marked with blue light)\n", j);
+ if (j) LOG_INFOF("%d waypoints cannot be reached from here in any way (marked with blue light)", j);
navigation_markroutes_inverted(e2);
j = 0;
IL_EACH(g_waypoints, it.wpcost >= 10000000,
{
- LOG_INFO("cannot reach me: ", etos(it), " ", vtos(it.origin), "\n");
+ LOG_INFO("cannot reach me: ", etos(it), " ", vtos(it.origin));
it.colormod_x = 8;
if (!(it.effects & EF_NODEPTHTEST)) // not already reported before
++m;
it.effects |= EF_NODEPTHTEST | EF_RED;
++j;
});
- if (j) LOG_INFOF("%d waypoints cannot walk to here in any way (marked with red light)\n", j);
- if (m) LOG_INFOF("%d waypoints have been marked total\n", m);
+ if (j) LOG_INFOF("%d waypoints cannot walk to here in any way (marked with red light)", j);
+ if (m) LOG_INFOF("%d waypoints have been marked total", m);
j = 0;
IL_EACH(g_spawnpoints, true,
else
{
setorigin(it, org);
- LOG_INFO("spawn without waypoint: ", etos(it), " ", vtos(it.origin), "\n");
+ LOG_INFO("spawn without waypoint: ", etos(it), " ", vtos(it.origin));
it.effects |= EF_NODEPTHTEST;
_setmodel(it, this.model);
it.frame = this.frame;
++j;
}
});
- if (j) LOG_INFOF("%d spawnpoints have no nearest waypoint (marked by player model)\n", j);
+ if (j) LOG_INFOF("%d spawnpoints have no nearest waypoint (marked by player model)", j);
j = 0;
IL_EACH(g_items, true,
IL_EACH(g_items, true,
{
if (navigation_findnearestwaypoint(it, false)) continue;
- LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin), "\n");
+ LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin));
it.effects |= EF_NODEPTHTEST | EF_RED;
it.colormod_x = 8;
++j;
});
- if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked away from (marked with red light)\n", j);
+ if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked away from (marked with red light)", j);
j = 0;
IL_EACH(g_items, true,
{
if (navigation_findnearestwaypoint(it, true)) continue;
- LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin), "\n");
+ LOG_INFO("item without waypoint: ", etos(it), " ", vtos(it.origin));
it.effects |= EF_NODEPTHTEST | EF_BLUE;
it.colormod_z = 8;
++j;
});
- if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked to (marked with blue light)\n", j);
+ if (j) LOG_INFOF("%d items have no nearest waypoint and cannot be walked to (marked with blue light)", j);
}
if(id >= MAX_IPBAN_URIS)
{
- LOG_INFO("Received ban list for invalid ID\n");
+ LOG_INFO("Received ban list for invalid ID");
return;
}
tokenize_console(autocvar_g_ban_sync_uri);
uri = argv(id);
- LOG_INFO("Received ban list from ", uri, ": ");
+ string prelude = strcat("Received ban list from ", uri, ": ");
if(OnlineBanList_RequestWaiting[id] == 0)
{
- LOG_INFO("rejected (unexpected)\n");
+ LOG_INFO(prelude, "rejected (unexpected)");
return;
}
if(time > OnlineBanList_Timeout)
{
- LOG_INFO("rejected (too late)\n");
+ LOG_INFO(prelude, "rejected (too late)");
return;
}
syncinterval = autocvar_g_ban_sync_interval;
if(syncinterval == 0)
{
- LOG_INFO("rejected (syncing disabled)\n");
+ LOG_INFO(prelude, "rejected (syncing disabled)");
return;
}
if(syncinterval > 0)
if(status != 0)
{
- LOG_INFO("error: status is ", ftos(status), "\n");
+ LOG_INFO(prelude, "error: status is ", ftos(status));
return;
}
if(substring(data, 0, 1) == "<")
{
- LOG_INFO("error: received HTML instead of a ban list\n");
+ LOG_INFO(prelude, "error: received HTML instead of a ban list");
return;
}
if(strstrofs(data, "\r", 0) != -1)
{
- LOG_INFO("error: received carriage returns\n");
+ LOG_INFO(prelude, "error: received carriage returns");
return;
}
if((n % 4) != 0)
{
- LOG_INFO("error: received invalid item count: ", ftos(n), "\n");
+ LOG_INFO(prelude, "error: received invalid item count: ", ftos(n));
return;
}
- LOG_INFO("OK, ", ftos(n / 4), " items\n");
+ LOG_INFO(prelude, "OK, ", ftos(n / 4), " items");
for(i = 0; i < n; i += 4)
{
for(j = 0; j < l; ++j)
if(strstrofs("0123456789.", substring(ip, j, 1), 0) == -1)
{
- LOG_INFO("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.\n");
+ LOG_INFO("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.");
goto skip;
}
}
// the ban will be prolonged on the next sync
// or expire 5 seconds after the next timeout
Ban_Insert(ip, timeleft, strcat("ban synced from ", serverip, " at ", uri), 0);
- LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ");
- LOG_INFO(reason, "\n");
+ LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ", reason);
LABEL(skip)
}
float i, n;
string msg;
- LOG_INFO("^2Listing all existing active bans:\n");
+ LOG_INFO("^2Listing all existing active bans:");
n = 0;
for(i = 0; i < ban_count; ++i)
msg = strcat(msg, ban_ip[i], " is still banned for ");
msg = strcat(msg, ftos(ban_expire[i] - time), " seconds");
- LOG_INFO(" ", msg, "\n");
+ LOG_INFO(" ", msg);
}
- LOG_INFO("^2Done listing all active (", ftos(n), ") bans.\n");
+ LOG_INFO("^2Done listing all active (", ftos(n), ") bans.");
}
float Ban_GetClientIP(entity client)
if(i < ban_count)
if(ban_expire[i] > time + bantime)
{
- LOG_INFO(ip, " could not get banned due to no free ban slot\n");
+ LOG_INFO(ip, " could not get banned due to no free ban slot");
return false;
}
// okay, insert our new victim as i
0: sends the request
>0: receives a cvar from name=argv(f) value=argv(f+1)
*/
-void GetCvars_handleString(entity this, string thisname, float f, .string field, string name)
+void GetCvars_handleString(entity this, entity store, string thisname, float f, .string field, string name)
{
if (f < 0)
{
- if (this.(field))
- strunzone(this.(field));
- this.(field) = string_null;
+ if (store.(field))
+ strunzone(store.(field));
+ store.(field) = string_null;
}
else if (f > 0)
{
if (thisname == name)
{
- if (this.(field))
- strunzone(this.(field));
- this.(field) = strzone(argv(f + 1));
+ if (store.(field))
+ strunzone(store.(field));
+ store.(field) = strzone(argv(f + 1));
}
}
else
stuffcmd(this, strcat("cl_cmd sendcvar ", name, "\n"));
}
-void GetCvars_handleString_Fixup(entity this, string thisname, float f, .string field, string name, string(entity, string) func)
+void GetCvars_handleString_Fixup(entity this, entity store, string thisname, float f, .string field, string name, string(entity, string) func)
{
- GetCvars_handleString(this, thisname, f, field, name);
+ GetCvars_handleString(this, store, thisname, f, field, name);
if (f >= 0) // also initialize to the fitting value for "" when sending cvars out
if (thisname == name)
{
- string s = func(this, strcat1(this.(field)));
- if (s != this.(field))
+ string s = func(this, strcat1(store.(field)));
+ if (s != store.(field))
{
- strunzone(this.(field));
- this.(field) = strzone(s);
+ strunzone(store.(field));
+ store.(field) = strzone(s);
}
}
}
else
stuffcmd(this, strcat("cl_cmd sendcvar ", name, "\n"));
}
-void GetCvars_handleFloatOnce(entity this, string thisname, float f, .float field, string name)
+void GetCvars_handleFloatOnce(entity this, entity store, string thisname, float f, .float field, string name)
{
if (f < 0)
{
{
if (thisname == name)
{
- if (!this.(field))
+ if (!store.(field))
{
- this.(field) = stof(argv(f + 1));
- if (!this.(field))
- this.(field) = -1;
+ store.(field) = stof(argv(f + 1));
+ if (!store.(field))
+ store.(field) = -1;
}
}
}
else
{
- if (!this.(field))
+ if (!store.(field))
stuffcmd(this, strcat("cl_cmd sendcvar ", name, "\n"));
}
}
/**
* @param f -1: cleanup, 0: request, 1: receive
*/
-void GetCvars(entity this, int f)
+void GetCvars(entity this, entity store, int f)
{
string s = string_null;
Notification_GetCvars(this);
- ReplicateVars(this, CS(this), s, f);
+ ReplicateVars(this, store, s, f);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[0], "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[1], "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[2], "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[3], "cl_weaponpriority3", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[4], "cl_weaponpriority4", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[5], "cl_weaponpriority5", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[6], "cl_weaponpriority6", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[7], "cl_weaponpriority7", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[8], "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleString_Fixup(this, s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[0], "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[1], "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[2], "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[3], "cl_weaponpriority3", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[4], "cl_weaponpriority4", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[5], "cl_weaponpriority5", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[6], "cl_weaponpriority6", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[7], "cl_weaponpriority7", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[8], "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete);
+ GetCvars_handleString_Fixup(this, store, s, f, cvar_cl_weaponpriorities[9], "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);
- GetCvars_handleFloat(this, CS(this), s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking");
+ GetCvars_handleFloat(this, store, s, f, cvar_cl_allow_uidtracking, "cl_allow_uidtracking");
// fixup of switchweapon (needed for LMS or when spectating is disabled, as PutClientInServer comes too early)
if (f > 0)
}
else
{
- LOG_INFO("Received HTTP request data for an invalid id ", ftos(id), ".\n");
+ LOG_INFO("Received HTTP request data for an invalid id ", ftos(id), ".");
}
}
float spamsound(entity e, float chan, Sound samp, float vol, float _atten);
-void GetCvars_handleString(entity this, string thisname, float f, .string field, string name);
+void GetCvars_handleString(entity this, entity store, string thisname, float f, .string field, string name);
void precache_all_playermodels(string pattern);
void GameLogClose();
-void GetCvars(entity this, float f);
+void GetCvars(entity this, entity store, int f);
string GetMapname();
#include <server/scores.qh>
#include <server/scores_rules.qh>
#include <server/teamplay.qh>
+#include <common/gamemodes/rules.qh>
#include "mutator.qh"
#include <server/weapons/weaponsystem.qh>
#include <common/physics/player.qh>
-#include <common/effects/qc/all.qh>
+#include <common/effects/qc/_mod.qh>
#include <common/deathtypes/all.qh>
#include <common/notifications/all.qh>
#include <common/triggers/teleporters.qh>
{
if(this.enemy.health - this.dmg > 0.5)
{
- PlayerTeamScore_Add(actor, SP_SCORE, ST_SCORE, this.dmg);
+ GameRules_scoring_add_team(actor, SCORE, this.dmg);
this.enemy.health = this.enemy.health - this.dmg;
}
else
{
- PlayerTeamScore_Add(actor, SP_SCORE, ST_SCORE, this.enemy.health);
- PlayerTeamScore_Add(actor, SP_ASSAULT_OBJECTIVES, ST_ASSAULT_OBJECTIVES, 1);
+ GameRules_scoring_add_team(actor, SCORE, this.enemy.health);
+ GameRules_scoring_add_team(actor, ASSAULT_OBJECTIVES, 1);
this.enemy.health = -1;
if(this.enemy.message)
this.havocbot_attack_time = 0;
- if(checkpvs(this.view_ofs,it))
- if(checkpvs(this.view_ofs,best))
+ if(checkpvs(this.origin + this.view_ofs, it))
+ if(checkpvs(this.origin + this.view_ofs, best))
{
// dprint("increasing attack time for this target\n");
this.havocbot_attack_time = time + 2;
// readyrestart not supported (yet)
return true;
}
-
-// scoreboard setup
-void assault_ScoreRules()
-{
- int teams = 0;
- teams |= BIT(0);
- teams |= BIT(1); // always red vs blue
-
- ScoreRules_basics(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, true);
- ScoreInfo_SetLabel_TeamScore( ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
- ScoreRules_basics_end();
-}
#include "../gamemode.qh"
-void assault_ScoreRules();
+const int ST_ASSAULT_OBJECTIVES = 1;
REGISTER_MUTATOR(as, false)
{
- ActivateTeamplay();
- have_team_spawns = -1; // request team spawns
-
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- assault_ScoreRules();
+ GameRules_teams(true);
+ int teams = BITS(2); // always red vs blue
+ GameRules_scoring(teams, SFL_SORT_PRIO_SECONDARY, SFL_SORT_PRIO_SECONDARY, {
+ field_team(ST_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+ field(SP_ASSAULT_OBJECTIVES, "objectives", SFL_SORT_PRIO_PRIMARY);
+ });
}
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back assault_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
- }
-
return 0;
}
void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items;
void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
-// scoreboard stuff
-const float ST_ASSAULT_OBJECTIVES = 1;
-
// predefined spawnfuncs
void target_objective_decrease_activate(entity this);
float excess = max(0, frag_damage - damage_take - damage_save);
if (frag_target != frag_attacker && IS_PLAYER(frag_attacker))
- PlayerTeamScore_Add(frag_attacker, SP_SCORE, ST_SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier);
+ GameRules_scoring_add_team(frag_attacker, SCORE, (frag_damage - excess) * autocvar_g_ca_damage2score_multiplier);
}
MUTATOR_HOOKFUNCTION(ca, PlayerRegen)
void CA_RoundStart();
bool ca_isEliminated(entity e);
-void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override);
-
REGISTER_MUTATOR(ca, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- // game loads at time 1
- if (time > 1) error("This is a game type and it cannot be added at runtime.");
-
- allowed_to_spawn = true;
+ GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_ca_team_spawns);
+ GameRules_limit_score(autocvar_g_ca_point_limit);
+ GameRules_limit_lead(autocvar_g_ca_point_leadlimit);
ca_teams = autocvar_g_ca_teams_override;
if (ca_teams < 2)
ca_teams = cvar("g_ca_teams"); // read the cvar directly as it gets written earlier in the same frame
- ca_teams = bound(2, ca_teams, 4);
-
- int teams = 0;
- if(ca_teams >= 1) teams |= BIT(0);
- if(ca_teams >= 2) teams |= BIT(1);
- if(ca_teams >= 3) teams |= BIT(2);
- if(ca_teams >= 4) teams |= BIT(3);
- ca_teams = teams; // now set it?
-
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
- ScoreInfo_SetLabel_TeamScore(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
- ScoreRules_basics_end();
+ ca_teams = BITS(bound(2, ca_teams, 4));
+ GameRules_scoring(ca_teams, SFL_SORT_PRIO_PRIMARY, 0, {
+ field_team(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
+ });
+ allowed_to_spawn = true;
round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, CA_RoundStart);
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
-
EliminatedPlayers_Init(ca_isEliminated);
-
- ActivateTeamplay();
- SetLimits(autocvar_g_ca_point_limit, autocvar_g_ca_point_leadlimit, autocvar_timelimit_override, -1);
-
- if (autocvar_g_ca_team_spawns)
- have_team_spawns = -1; // request team spawns
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
}
-
return 0;
}
#include "gamemode_ctf.qh"
-#ifndef CSQC
#include <common/effects/all.qh>
-void ctf_Initialize();
-
-REGISTER_MUTATOR(ctf, false)
-{
- MUTATOR_ONADD
- {
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- ctf_Initialize();
-
- ActivateTeamplay();
- SetLimits(autocvar_capturelimit_override, autocvar_captureleadlimit_override, autocvar_timelimit_override, -1);
- have_team_spawns = -1; // request team spawns
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back ctf_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
- }
-
- return 0;
-}
-#endif
-
-#ifdef SVQC
#include <common/vehicles/all.qh>
#include <server/teamplay.qh>
-#endif
#include <lib/warpzone/common.qh>
if(ctf_captureshield_max_ratio <= 0)
return false;
- s = PlayerScore_Add(p, SP_CTF_CAPS, 0);
- s2 = PlayerScore_Add(p, SP_CTF_PICKUPS, 0);
- s3 = PlayerScore_Add(p, SP_CTF_RETURNS, 0);
- s4 = PlayerScore_Add(p, SP_CTF_FCKILLS, 0);
+ s = GameRules_scoring_add(p, CTF_CAPS, 0);
+ s2 = GameRules_scoring_add(p, CTF_PICKUPS, 0);
+ s3 = GameRules_scoring_add(p, CTF_RETURNS, 0);
+ s4 = GameRules_scoring_add(p, CTF_FCKILLS, 0);
sr = ((s - s2) + (s3 + s4));
FOREACH_CLIENT(IS_PLAYER(it), {
if(DIFF_TEAM(it, p))
continue;
- se = PlayerScore_Add(it, SP_CTF_CAPS, 0);
- se2 = PlayerScore_Add(it, SP_CTF_PICKUPS, 0);
- se3 = PlayerScore_Add(it, SP_CTF_RETURNS, 0);
- se4 = PlayerScore_Add(it, SP_CTF_FCKILLS, 0);
+ se = GameRules_scoring_add(it, CTF_CAPS, 0);
+ se2 = GameRules_scoring_add(it, CTF_PICKUPS, 0);
+ se3 = GameRules_scoring_add(it, CTF_RETURNS, 0);
+ se4 = GameRules_scoring_add(it, CTF_FCKILLS, 0);
ser = ((se - se2) + (se3 + se4));
ctf_EventLog("dropped", player.team, player);
// scoring
- PlayerTeamScore_AddScore(player, -((flag.score_drop) ? flag.score_drop : autocvar_g_ctf_score_penalty_drop));
- PlayerScore_Add(player, SP_CTF_DROPS, 1);
+ GameRules_scoring_add_team(player, SCORE, -((flag.score_drop) ? flag.score_drop : autocvar_g_ctf_score_penalty_drop));
+ GameRules_scoring_add(player, CTF_DROPS, 1);
// waypoints
if(autocvar_g_ctf_flag_dropped_waypoint) {
// transfer flag to player
flag.owner = player;
flag.owner.flagcarried = flag;
+ GameRules_scoring_vip(player, true);
// reset flag
if(player.vehicle)
setattachment(flag, NULL, "");
setorigin(flag, player.origin + FLAG_DROP_OFFSET);
flag.owner.flagcarried = NULL;
+ GameRules_scoring_vip(flag.owner, false);
flag.owner = NULL;
flag.solid = SOLID_TRIGGER;
flag.ctf_dropper = player;
float pscore = 0;
if(enemy_flag.score_capture || flag.score_capture)
pscore = floor((max(1, enemy_flag.score_capture) + max(1, flag.score_capture)) * 0.5);
- PlayerTeamScore_AddScore(player, ((pscore) ? pscore : autocvar_g_ctf_score_capture));
+ GameRules_scoring_add_team(player, SCORE, ((pscore) ? pscore : autocvar_g_ctf_score_capture));
float capscore = 0;
if(enemy_flag.score_team_capture || flag.score_team_capture)
capscore = floor((max(1, enemy_flag.score_team_capture) + max(1, flag.score_team_capture)) * 0.5);
- PlayerTeamScore_Add(player, SP_CTF_CAPS, ST_CTF_CAPS, ((capscore) ? capscore : 1));
+ GameRules_scoring_add_team(player, CTF_CAPS, ((capscore) ? capscore : 1));
- old_time = PlayerScore_Add(player, SP_CTF_CAPTIME, 0);
+ old_time = GameRules_scoring_add(player, CTF_CAPTIME, 0);
new_time = TIME_ENCODE(time - enemy_flag.ctf_pickuptime);
if(!old_time || new_time < old_time)
- PlayerScore_Add(player, SP_CTF_CAPTIME, new_time - old_time);
+ GameRules_scoring_add(player, CTF_CAPTIME, new_time - old_time);
// effects
Send_Effect_(flag.capeffect, flag.origin, '0 0 0', 1);
if(flag.speedrunning) { ctf_FakeTimeLimit(player, -1); }
if((enemy_flag.ctf_dropper) && (player != enemy_flag.ctf_dropper))
- { PlayerTeamScore_AddScore(enemy_flag.ctf_dropper, ((enemy_flag.score_assist) ? enemy_flag.score_assist : autocvar_g_ctf_score_capture_assist)); }
+ { GameRules_scoring_add_team(enemy_flag.ctf_dropper, SCORE, ((enemy_flag.score_assist) ? enemy_flag.score_assist : autocvar_g_ctf_score_capture_assist)); }
}
// reset the flag
// scoring
if(IS_PLAYER(player))
{
- PlayerTeamScore_AddScore(player, ((flag.score_return) ? flag.score_return : autocvar_g_ctf_score_return)); // reward for return
- PlayerScore_Add(player, SP_CTF_RETURNS, 1); // add to count of returns
+ GameRules_scoring_add_team(player, SCORE, ((flag.score_return) ? flag.score_return : autocvar_g_ctf_score_return)); // reward for return
+ GameRules_scoring_add(player, CTF_RETURNS, 1); // add to count of returns
nades_GiveBonus(player,autocvar_g_nades_bonus_score_medium);
}
if(flag.ctf_dropper)
{
- PlayerScore_Add(flag.ctf_dropper, SP_SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the player who dropped the flag
+ GameRules_scoring_add(flag.ctf_dropper, SCORE, -autocvar_g_ctf_score_penalty_returned); // punish the player who dropped the flag
ctf_CaptureShield_Update(flag.ctf_dropper, 0); // shield player from picking up flag
flag.ctf_dropper.next_take_time = time + autocvar_g_ctf_flag_collect_delay; // set next take time
}
// attach the flag to the player
flag.owner = player;
player.flagcarried = flag;
+ GameRules_scoring_vip(player, true);
if(player.vehicle)
{
setattachment(flag, player.vehicle, "");
_sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTEN_NONE);
// scoring
- PlayerScore_Add(player, SP_CTF_PICKUPS, 1);
+ GameRules_scoring_add(player, CTF_PICKUPS, 1);
nades_GiveBonus(player, autocvar_g_nades_bonus_score_minor);
switch(pickuptype)
{
case PICKUP_BASE:
{
- PlayerTeamScore_AddScore(player, ((flag.score_pickup) ? flag.score_pickup : autocvar_g_ctf_score_pickup_base));
+ GameRules_scoring_add_team(player, SCORE, ((flag.score_pickup) ? flag.score_pickup : autocvar_g_ctf_score_pickup_base));
ctf_EventLog("steal", flag.team, player);
break;
}
pickup_dropped_score = (autocvar_g_ctf_flag_return_time ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1);
pickup_dropped_score = floor((autocvar_g_ctf_score_pickup_dropped_late * (1 - pickup_dropped_score) + autocvar_g_ctf_score_pickup_dropped_early * pickup_dropped_score) + 0.5);
LOG_TRACE("pickup_dropped_score is ", ftos(pickup_dropped_score));
- PlayerTeamScore_AddScore(player, pickup_dropped_score);
+ GameRules_scoring_add_team(player, SCORE, pickup_dropped_score);
ctf_EventLog("pickup", flag.team, player);
break;
}
WaypointSprite_Kill(flag.wps_flagcarrier);
flag.owner.flagcarried = NULL;
+ GameRules_scoring_vip(flag.owner, false);
if(flag.speedrunning)
ctf_FakeTimeLimit(flag.owner, -1);
if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)) && (frag_target.flagcarried))
{
- PlayerTeamScore_AddScore(frag_attacker, ((SAME_TEAM(frag_attacker, frag_target)) ? -autocvar_g_ctf_score_kill : autocvar_g_ctf_score_kill));
- PlayerScore_Add(frag_attacker, SP_CTF_FCKILLS, 1);
+ GameRules_scoring_add_team(frag_attacker, SCORE, ((SAME_TEAM(frag_attacker, frag_target)) ? -autocvar_g_ctf_score_kill : autocvar_g_ctf_score_kill));
+ GameRules_scoring_add(frag_attacker, CTF_FCKILLS, 1);
}
if(frag_target.flagcarried)
void ctf_ScoreRules(int teams)
{
CheckAllowedTeams(NULL);
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
- ScoreInfo_SetLabel_TeamScore (ST_CTF_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
- ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME, "captime", SFL_LOWER_IS_BETTER | SFL_TIME);
- ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS, "pickups", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS, "fckills", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS, "returns", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_CTF_DROPS, "drops", SFL_LOWER_IS_BETTER);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, {
+ field_team(ST_CTF_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
+ field(SP_CTF_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+ field(SP_CTF_CAPTIME, "captime", SFL_LOWER_IS_BETTER | SFL_TIME);
+ field(SP_CTF_PICKUPS, "pickups", 0);
+ field(SP_CTF_FCKILLS, "fckills", 0);
+ field(SP_CTF_RETURNS, "returns", 0);
+ field(SP_CTF_DROPS, "drops", SFL_LOWER_IS_BETTER);
+ });
}
// code from here on is just to support maps that don't have flag and team entities
#ifdef SVQC
#include "../gamemode.qh"
+
+void ctf_Initialize();
+
+REGISTER_MUTATOR(ctf, false)
+{
+ MUTATOR_STATIC();
+ MUTATOR_ONADD
+ {
+ GameRules_teams(true);
+ GameRules_limit_score(autocvar_capturelimit_override);
+ GameRules_limit_lead(autocvar_captureleadlimit_override);
+
+ ctf_Initialize();
+ }
+ return 0;
+}
+
// used in cheats.qc
void ctf_RespawnFlag(entity flag);
void cts_ScoreRules()
{
- ScoreRules_basics(0, 0, 0, false);
- if(g_race_qualifying)
- {
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
- }
- else
- {
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
- }
- ScoreRules_basics_end();
+ GameRules_score_enabled(false);
+ GameRules_scoring(0, 0, 0, {
+ if (g_race_qualifying) {
+ field(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+ } else {
+ field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+ field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+ field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
+ }
+ });
}
void cts_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
FOREACH_CLIENT(true, {
if(it.race_place)
{
- s = PlayerScore_Add(it, SP_RACE_FASTEST, 0);
+ s = GameRules_scoring_add(it, RACE_FASTEST, 0);
if(!s)
it.race_place = 0;
}
{
entity player = M_ARGV(0, entity);
- if(PlayerScore_Add(player, SP_RACE_FASTEST, 0))
+ if(GameRules_scoring_add(player, RACE_FASTEST, 0))
player.frags = FRAGS_LMS_LOSER;
else
player.frags = FRAGS_SPECTATOR;
REGISTER_MUTATOR(cts, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
-
g_race_qualifying = true;
independent_players = 1;
- SetLimits(0, 0, autocvar_timelimit_override, -1);
+ GameRules_limit_score(0);
+ GameRules_limit_lead(0);
cts_Initialize();
}
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back cts_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
- }
-
return 0;
}
REGISTER_MUTATOR(dm, false)
{
- MUTATOR_ONADD
- {
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back dm_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- error("This is a game type and it cannot be removed at runtime.");
- return -1;
- }
-
+ MUTATOR_STATIC();
return 0;
}
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_DOMINATION_CAPTURE_TIME, head.netname, this.message, points, wait_time);
if(this.enemy.playerid == this.enemy_playerid)
- PlayerScore_Add(this.enemy, SP_DOM_TAKES, 1);
+ GameRules_scoring_add(this.enemy, DOM_TAKES, 1);
else
this.enemy = NULL;
// give credit to the individual player, if he is still there
if (this.enemy.playerid == this.enemy_playerid)
{
- PlayerScore_Add(this.enemy, SP_SCORE, fragamt);
- PlayerScore_Add(this.enemy, SP_DOM_TICKS, fragamt);
+ GameRules_scoring_add(this.enemy, SCORE, fragamt);
+ GameRules_scoring_add(this.enemy, DOM_TICKS, fragamt);
}
else
this.enemy = NULL;
{
if(domination_roundbased)
{
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, true);
- ScoreInfo_SetLabel_TeamScore (ST_DOM_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, {
+ field_team(ST_DOM_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
+ field(SP_DOM_TAKES, "takes", 0);
+ });
}
else
{
sp_domticks = SFL_SORT_PRIO_PRIMARY;
else
sp_score = SFL_SORT_PRIO_PRIMARY;
- ScoreRules_basics(teams, sp_score, sp_score, true);
- ScoreInfo_SetLabel_TeamScore (ST_DOM_TICKS, "ticks", sp_domticks);
- ScoreInfo_SetLabel_PlayerScore(SP_DOM_TICKS, "ticks", sp_domticks);
- ScoreInfo_SetLabel_PlayerScore(SP_DOM_TAKES, "takes", 0);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, sp_score, sp_score, {
+ field_team(ST_DOM_TICKS, "ticks", sp_domticks);
+ field(SP_DOM_TICKS, "ticks", sp_domticks);
+ field(SP_DOM_TAKES, "takes", 0);
+ });
}
}
REGISTER_MUTATOR(dom, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- dom_Initialize();
-
int fraglimit_override = autocvar_g_domination_point_limit;
if (autocvar_g_domination_roundbased && autocvar_g_domination_roundbased_point_limit)
fraglimit_override = autocvar_g_domination_roundbased_point_limit;
- ActivateTeamplay();
- SetLimits(fraglimit_override, autocvar_g_domination_point_leadlimit, autocvar_timelimit_override, -1);
- have_team_spawns = -1; // request team spawns
- }
+ GameRules_teams(true);
+ GameRules_limit_score(fraglimit_override);
+ GameRules_limit_lead(autocvar_g_domination_point_leadlimit);
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ dom_Initialize();
}
-
return 0;
}
int autocvar_g_freezetag_teams_override;
float autocvar_g_freezetag_warmup;
-void freezetag_ScoreRules(int teams)
-{
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true); // SFL_SORT_PRIO_PRIMARY
- ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0);
- ScoreRules_basics_end();
-}
-
void freezetag_count_alive_players()
{
total_players = redalive = bluealive = yellowalive = pinkalive = 0;
{
// you froze your own dumb targ
// counted as "suicide" already
- PlayerScore_Add(targ, SP_SCORE, -1);
+ GameRules_scoring_add(targ, SCORE, -1);
}
else if(IS_PLAYER(attacker))
{
// got frozen by an enemy
// counted as "kill" and "death" already
- PlayerScore_Add(targ, SP_SCORE, -1);
- PlayerScore_Add(attacker, SP_SCORE, +1);
+ GameRules_scoring_add(targ, SCORE, -1);
+ GameRules_scoring_add(attacker, SCORE, +1);
}
// else nothing - got frozen by the game type rules themselves
}
// EVERY team mate nearby gets a point (even if multiple!)
FOREACH_CLIENT(IS_PLAYER(it) && it.reviving, {
- PlayerScore_Add(it, SP_FREEZETAG_REVIVALS, +1);
- PlayerScore_Add(it, SP_SCORE, +1);
+ GameRules_scoring_add(it, FREEZETAG_REVIVALS, +1);
+ GameRules_scoring_add(it, SCORE, +1);
nades_GiveBonus(it,autocvar_g_nades_bonus_score_low);
});
freezetag_teams = autocvar_g_freezetag_teams_override;
if(freezetag_teams < 2)
freezetag_teams = cvar("g_freezetag_teams"); // read the cvar directly as it gets written earlier in the same frame
- freezetag_teams = bound(2, freezetag_teams, 4);
- int teams = 0;
- if(freezetag_teams >= 1) teams |= BIT(0);
- if(freezetag_teams >= 2) teams |= BIT(1);
- if(freezetag_teams >= 3) teams |= BIT(2);
- if(freezetag_teams >= 4) teams |= BIT(3);
-
- freezetag_teams = teams; // now set it?
- freezetag_ScoreRules(freezetag_teams);
+ freezetag_teams = BITS(bound(2, freezetag_teams, 4));
+ GameRules_scoring(freezetag_teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
+ field(SP_FREEZETAG_REVIVALS, "revivals", 0);
+ });
round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, func_null);
round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
REGISTER_MUTATOR(ft, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- freezetag_Initialize();
-
- ActivateTeamplay();
- SetLimits(autocvar_g_freezetag_point_limit, autocvar_g_freezetag_point_leadlimit, autocvar_timelimit_override, -1);
-
- if (autocvar_g_freezetag_team_spawns)
- have_team_spawns = -1; // request team spawns
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back freezetag_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
+ GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_freezetag_team_spawns);
+ GameRules_limit_score(autocvar_g_freezetag_point_limit);
+ GameRules_limit_lead(autocvar_g_freezetag_point_leadlimit);
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ freezetag_Initialize();
}
-
return 0;
}
#include <server/teamplay.qh>
+IntrusiveList g_invasion_roundends;
+STATIC_INIT(g_invasion_roundends) { g_invasion_roundends = IL_NEW(); }
+
IntrusiveList g_invasion_waves;
STATIC_INIT(g_invasion_waves) { g_invasion_waves = IL_NEW(); }
bool autocvar_g_invasion_zombies_only;
float autocvar_g_invasion_spawn_delay;
+bool victent_present;
+.bool inv_endreached;
+
bool inv_warning_shown; // spammy
.string spawnmob;
+void target_invasion_roundend_use(entity this, entity actor, entity trigger)
+{
+ if(!IS_PLAYER(actor)) { return; }
+
+ actor.inv_endreached = true;
+
+ int plnum = 0;
+ int realplnum = 0;
+ // let's not count bots
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
+ ++realplnum;
+ if(it.inv_endreached)
+ ++plnum;
+ });
+ if(plnum < ceil(realplnum * min(1, this.count))) // 70% of players
+ return;
+
+ this.winning = true;
+}
+
+spawnfunc(target_invasion_roundend)
+{
+ if(!g_invasion) { delete(this); return; }
+
+ victent_present = true; // a victory entity is present, we don't need to rely on monster count TODO: merge this with the intrusive list (can check empty)
+
+ if(!this.count) { this.count = 0.7; } // require at least 70% of the players to reach the end before triggering victory
+
+ this.use = target_invasion_roundend_use;
+
+ IL_PUSH(g_invasion_roundends, this);
+}
+
spawnfunc(invasion_wave)
{
if(!g_invasion) { delete(this); return; }
IL_PUSH(g_invasion_spawns, this);
}
+void ClearWinners();
+
+// Invasion stage mode winning condition: If the attackers triggered a round end (by fulfilling all objectives)
+// they win.
+int WinningCondition_Invasion()
+{
+ WinningConditionHelper(NULL); // set worldstatus
+
+ int status = WINNING_NO;
+
+ if(autocvar_g_invasion_type == INV_TYPE_STAGE)
+ {
+ SetWinners(inv_endreached, true);
+
+ int found = 0;
+ IL_EACH(g_invasion_roundends, true,
+ {
+ ++found;
+ if(it.winning)
+ {
+ bprint("Invasion: round completed.\n");
+ // winners already set (TODO: teamplay support)
+
+ status = WINNING_YES;
+ break;
+ }
+ });
+
+ if(!found)
+ status = WINNING_YES; // just end it? TODO: should warn mapper!
+ }
+ else if(autocvar_g_invasion_type == INV_TYPE_HUNT)
+ {
+ ClearWinners();
+
+ int found = 0; // NOTE: this ends the round if no monsters are placed
+ IL_EACH(g_monsters, !(it.spawnflags & MONSTERFLAG_RESPAWNED),
+ {
+ ++found;
+ });
+
+ if(found <= 0)
+ {
+ FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
+ {
+ it.winning = true;
+ });
+ status = WINNING_YES;
+ }
+ }
+
+ return status;
+}
+
Monster invasion_PickMonster(int supermonster_count)
{
RandomSelection_Init();
else
{
FOREACH_CLIENT(IS_PLAYER(it), {
- float cs = PlayerScore_Add(it, SP_KILLS, 0);
+ float cs = GameRules_scoring_add(it, KILLS, 0);
if(cs > winning_score)
{
winning_score = cs;
if(!(frag_target.spawnflags & MONSTERFLAG_RESPAWNED))
{
- inv_numkilled += 1;
- inv_maxcurrent -= 1;
+ if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+ {
+ inv_numkilled += 1;
+ inv_maxcurrent -= 1;
+ }
if(teamplay) { inv_monsters_perteam[frag_target.team] -= 1; }
if(IS_PLAYER(frag_attacker))
if(SAME_TEAM(frag_attacker, frag_target)) // in non-teamplay modes, same team = same player, so this works
- PlayerScore_Add(frag_attacker, SP_KILLS, -1);
+ GameRules_scoring_add(frag_attacker, KILLS, -1);
else
{
- PlayerScore_Add(frag_attacker, SP_KILLS, +1);
+ GameRules_scoring_add(frag_attacker, KILLS, +1);
if(teamplay)
TeamScore_AddToTeam(frag_attacker.team, ST_INV_KILLS, +1);
}
MUTATOR_HOOKFUNCTION(inv, MonsterSpawn)
{
entity mon = M_ARGV(0, entity);
+ mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
+
+ if(autocvar_g_invasion_type == INV_TYPE_HUNT)
+ return false; // allowed
if(!(mon.spawnflags & MONSTERFLAG_SPAWNED))
return true;
if((get_monsterinfo(mon.monsterid)).spawnflags & MON_FLAG_SUPERMONSTER)
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_INVASION_SUPERMONSTER, mon.monster_name);
-
- mon.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;
-}
-
-MUTATOR_HOOKFUNCTION(inv, OnEntityPreSpawn)
-{
- entity ent = M_ARGV(0, entity);
-
- // TODO: allow these as "rogues" or something
- if(startsWith(ent.classname, "monster_"))
- if(!(ent.spawnflags & MONSTERFLAG_SPAWNED))
- return true;
}
MUTATOR_HOOKFUNCTION(inv, SV_StartFrame)
{
+ if(autocvar_g_invasion_type != INV_TYPE_ROUND)
+ return; // uses map spawned monsters
+
monsters_total = inv_maxspawned; // TODO: make sure numspawned never exceeds maxspawned
monsters_killed = inv_numkilled;
}
MUTATOR_HOOKFUNCTION(inv, PlayerRegen)
{
- // no regeneration in invasion
+ // no regeneration in invasion, regardless of the game type
return true;
}
}
}
-MUTATOR_HOOKFUNCTION(inv, SV_ParseClientCommand)
-{
- if(MUTATOR_RETURNVALUE) // command was already handled?
- return;
-
- entity player = M_ARGV(0, entity);
- string cmd_name = M_ARGV(1, string);
-
- if(cmd_name == "debuginvasion")
- {
- sprint(player, strcat("inv_maxspawned = ", ftos(inv_maxspawned), "\n"));
- sprint(player, strcat("inv_numspawned = ", ftos(inv_numspawned), "\n"));
- sprint(player, strcat("inv_numkilled = ", ftos(inv_numkilled), "\n"));
- sprint(player, strcat("inv_roundcnt = ", ftos(inv_roundcnt), "\n"));
- sprint(player, strcat("monsters_total = ", ftos(monsters_total), "\n"));
- sprint(player, strcat("monsters_killed = ", ftos(monsters_killed), "\n"));
- sprint(player, strcat("inv_monsterskill = ", ftos(inv_monsterskill), "\n"));
-
- return true;
- }
-}
-
MUTATOR_HOOKFUNCTION(inv, BotShouldAttack)
{
entity targ = M_ARGV(1, entity);
MUTATOR_HOOKFUNCTION(inv, SetStartItems)
{
- start_health = 200;
- start_armorvalue = 200;
+ if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+ {
+ start_health = 200;
+ start_armorvalue = 200;
+ }
}
MUTATOR_HOOKFUNCTION(inv, AccuracyTargetValid)
return true;
}
+MUTATOR_HOOKFUNCTION(inv, CheckRules_World)
+{
+ if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+ return false;
+
+ M_ARGV(0, float) = WinningCondition_Invasion();
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(inv, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
{
M_ARGV(0, float) = invasion_teams;
void invasion_ScoreRules(int inv_teams)
{
if(inv_teams) { CheckAllowedTeams(NULL); }
- ScoreRules_basics(inv_teams, 0, 0, false);
- if(inv_teams) ScoreInfo_SetLabel_TeamScore(ST_INV_KILLS, "frags", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_KILLS, "frags", ((inv_teams) ? SFL_SORT_PRIO_SECONDARY : SFL_SORT_PRIO_PRIMARY));
- ScoreRules_basics_end();
+ GameRules_score_enabled(false);
+ GameRules_scoring(inv_teams, 0, 0, {
+ if (inv_teams) {
+ field_team(ST_INV_KILLS, "frags", SFL_SORT_PRIO_PRIMARY);
+ }
+ field(SP_KILLS, "frags", ((inv_teams) ? SFL_SORT_PRIO_SECONDARY : SFL_SORT_PRIO_PRIMARY));
+ });
}
void invasion_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
{
+ if(autocvar_g_invasion_type == INV_TYPE_HUNT || autocvar_g_invasion_type == INV_TYPE_STAGE)
+ cvar_set("fraglimit", "0");
+
if(autocvar_g_invasion_teams)
{
- invasion_teams = bound(2, autocvar_g_invasion_teams, 4);
- int teams = 0;
- if(invasion_teams >= 1) teams |= BIT(0);
- if(invasion_teams >= 2) teams |= BIT(1);
- if(invasion_teams >= 3) teams |= BIT(2);
- if(invasion_teams >= 4) teams |= BIT(3);
-
- invasion_teams = teams; // now set it?
+ invasion_teams = BITS(bound(2, autocvar_g_invasion_teams, 4));
}
else
invasion_teams = 0;
independent_players = 0;
- round_handler_Spawn(Invasion_CheckPlayers, Invasion_CheckWinner, Invasion_RoundStart);
- round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit);
+ if(autocvar_g_invasion_type == INV_TYPE_ROUND)
+ {
+ round_handler_Spawn(Invasion_CheckPlayers, Invasion_CheckWinner, Invasion_RoundStart);
+ round_handler_Init(5, autocvar_g_invasion_warmup, autocvar_g_invasion_round_timelimit);
- inv_roundcnt = 0;
- inv_maxrounds = 15; // 15?
+ inv_roundcnt = 0;
+ inv_maxrounds = 15; // 15?
+ }
}
void invasion_Initialize()
#define autocvar_g_invasion_point_limit cvar("g_invasion_point_limit")
int autocvar_g_invasion_teams;
+int autocvar_g_invasion_type;
bool autocvar_g_invasion_team_spawns;
bool g_invasion;
void invasion_Initialize();
REGISTER_MUTATOR(inv, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- g_invasion = true;
- invasion_Initialize();
-
- cvar_settemp("g_monsters", "1");
-
- SetLimits(autocvar_g_invasion_point_limit, autocvar_leadlimit_override, autocvar_timelimit_override, -1);
- if (autocvar_g_invasion_teams >= 2)
- {
- ActivateTeamplay();
- if (autocvar_g_invasion_team_spawns)
- have_team_spawns = -1; // request team spawns
+ if (autocvar_g_invasion_teams >= 2) {
+ GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_invasion_team_spawns);
}
- }
+ GameRules_limit_score(autocvar_g_invasion_point_limit);
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back invasion_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ g_invasion = true;
+ cvar_settemp("g_monsters", "1");
+ invasion_Initialize();
}
-
return 0;
}
float inv_monsterskill;
const float ST_INV_KILLS = 1;
+
+const int INV_TYPE_ROUND = 0; // round-based waves of enemies
+const int INV_TYPE_HUNT = 1; // clear the map of placed enemies
+const int INV_TYPE_STAGE = 2; // reach the end of the level
#include <common/effects/all.qh>
+.entity ballcarried;
+
int autocvar_g_keepaway_ballcarrier_effects;
float autocvar_g_keepaway_ballcarrier_damage;
float autocvar_g_keepaway_ballcarrier_force;
if(this.owner.ballcarried)
{ // add points for holding the ball after a certain amount of time
if(autocvar_g_keepaway_score_timepoints)
- PlayerScore_Add(this.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
+ GameRules_scoring_add(this.owner, SCORE, autocvar_g_keepaway_score_timepoints);
- PlayerScore_Add(this.owner, SP_KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
+ GameRules_scoring_add(this.owner, KEEPAWAY_BCTIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
this.nextthink = time + autocvar_g_keepaway_score_timeinterval;
}
}
// attach the ball to the player
this.owner = toucher;
toucher.ballcarried = this;
+ GameRules_scoring_vip(toucher, true);
setattachment(this, toucher, "");
setorigin(this, '0 0 0');
sound(this.owner, CH_TRIGGER, SND_KA_PICKEDUP, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// scoring
- PlayerScore_Add(toucher, SP_KEEPAWAY_PICKUPS, 1);
+ GameRules_scoring_add(toucher, KEEPAWAY_PICKUPS, 1);
// waypoints
WaypointSprite_AttachCarrier(WP_KaBallCarrier, toucher, RADARICON_FLAGCARRIER);
ball.effects &= ~EF_NODRAW;
setorigin(ball, plyr.origin + '0 0 10');
ball.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
- ball.owner.ballcarried = world; // I hope nothing checks to see if the world has the ball in the rest of my code :P
- ball.owner = NULL;
+ entity e = ball.owner; ball.owner = NULL;
+ e.ballcarried = NULL;
+ GameRules_scoring_vip(e, false);
navigation_dynamicgoal_set(ball);
// reset the player effects
sound(NULL, CH_TRIGGER, SND_KA_DROPPED, VOL_BASE, ATTEN_NONE); // ATTEN_NONE (it's a sound intended to be heard anywhere)
// scoring
- // PlayerScore_Add(plyr, SP_KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
+ // GameRules_scoring_add(plyr, KEEPAWAY_DROPS, 1); Not anymore, this is 100% the same as pickups and is useless.
// waypoints
WaypointSprite_Spawn(WP_KaBall, 0, 0, ball, '0 0 64', NULL, ball.team, ball, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)))
{
if(frag_target.ballcarried) { // add to amount of times killing carrier
- PlayerScore_Add(frag_attacker, SP_KEEPAWAY_CARRIERKILLS, 1);
+ GameRules_scoring_add(frag_attacker, KEEPAWAY_CARRIERKILLS, 1);
if(autocvar_g_keepaway_score_bckill) // add bckills to the score
- PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_bckill);
+ GameRules_scoring_add(frag_attacker, SCORE, autocvar_g_keepaway_score_bckill);
}
else if(!frag_attacker.ballcarried)
if(autocvar_g_keepaway_noncarrier_warn)
Send_Notification(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN);
if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
- PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
+ GameRules_scoring_add(frag_attacker, SCORE, autocvar_g_keepaway_score_killac);
}
if(frag_target.ballcarried) { ka_DropEvent(frag_target); } // a player with the ball has died, drop it
// Initialization
// ==============
+MODEL(KA_BALL, "models/orbs/orbblue.md3");
+
void ka_SpawnBall() // loads various values for the ball, runs only once at start of match
{
entity e = new(keepawayball);
- e.model = "models/orbs/orbblue.md3";
- precache_model(e.model);
- _setmodel(e, e.model);
+ setmodel(e, MDL_KA_BALL);
setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
e.damageforcescale = autocvar_g_keepawayball_damageforcescale;
e.takedamage = DAMAGE_YES;
InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So.
}
-void ka_ScoreRules()
-{
- ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, true); // SFL_SORT_PRIO_PRIMARY
- ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_PICKUPS, "pickups", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
- ScoreRules_basics_end();
-}
-
void ka_Initialize() // run at the start of a match, initiates game mode
{
- ka_ScoreRules();
ka_SpawnBall();
}
REGISTER_MUTATOR(ka, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- ka_Initialize();
- }
-
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back ka_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
+ GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
+ field(SP_KEEPAWAY_PICKUPS, "pickups", 0);
+ field(SP_KEEPAWAY_CARRIERKILLS, "bckills", 0);
+ field(SP_KEEPAWAY_BCTIME, "bctime", SFL_SORT_PRIO_SECONDARY);
+ });
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ ka_Initialize();
}
-
return false;
}
int kh_Key_AllOwnedByWhichTeam();
-const float ST_KH_CAPS = 1;
+const int ST_KH_CAPS = 1;
void kh_ScoreRules(int teams)
{
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
- ScoreInfo_SetLabel_TeamScore( ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
- ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
- ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES, "pushes", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER);
- ScoreInfo_SetLabel_PlayerScore(SP_KH_PICKUPS, "pickups", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_KH_KCKILLS, "kckills", 0);
- ScoreInfo_SetLabel_PlayerScore(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {
+ field_team(ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+ field(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+ field(SP_KH_PUSHES, "pushes", 0);
+ field(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER);
+ field(SP_KH_PICKUPS, "pickups", 0);
+ field(SP_KH_KCKILLS, "kckills", 0);
+ field(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER);
+ });
}
bool kh_KeyCarrier_waypointsprite_visible_for_player(entity this, entity player, entity view) // runs all the time
if(key.kh_dropperteam != player.team)
{
kh_Scores_Event(player, key, "collect", autocvar_g_balance_keyhunt_score_collect, 0);
- PlayerScore_Add(player, SP_KH_PICKUPS, 1);
+ GameRules_scoring_add(player, KH_PICKUPS, 1);
}
key.kh_dropperteam = 0;
int realteam = kh_Team_ByID(key.count);
{
float f = DistributeEvenly_Get(1);
kh_Scores_Event(key.owner, key, "capture", f, 0);
- PlayerTeamScore_Add(key.owner, SP_KH_CAPS, ST_KH_CAPS, 1);
+ GameRules_scoring_add_team(key.owner, KH_CAPS, 1);
nades_GiveBonus(key.owner, autocvar_g_nades_bonus_score_high);
}
kh_Scores_Event(lostkey.kh_previous_owner, NULL, "pushed", 0, -autocvar_g_balance_keyhunt_score_push);
// don't actually GIVE him the -nn points, just log
kh_Scores_Event(attacker, NULL, "push", autocvar_g_balance_keyhunt_score_push, 0);
- PlayerScore_Add(attacker, SP_KH_PUSHES, 1);
+ GameRules_scoring_add(attacker, KH_PUSHES, 1);
//centerprint(attacker, "Your push is the best!"); // does this really need to exist?
}
else
// don't actually GIVE him the -nn points, just log
if(lostkey.kh_previous_owner.playerid == lostkey.kh_previous_owner_playerid)
- PlayerScore_Add(lostkey.kh_previous_owner, SP_KH_DESTROYS, 1);
+ GameRules_scoring_add(lostkey.kh_previous_owner, KH_DESTROYS, 1);
DistributeEvenly_Init(autocvar_g_balance_keyhunt_score_destroyed, keys * of + players);
key.enemy = player;
kh_Scores_Event(player, key, "dropkey", 0, 0);
- PlayerScore_Add(player, SP_KH_LOSSES, 1);
+ GameRules_scoring_add(player, KH_LOSSES, 1);
int realteam = kh_Team_ByID(key.count);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(realteam, INFO_KEYHUNT_DROP), player.netname);
while((key = player.kh_next))
{
kh_Scores_Event(player, key, "losekey", 0, 0);
- PlayerScore_Add(player, SP_KH_LOSSES, 1);
+ GameRules_scoring_add(player, KH_LOSSES, 1);
int realteam = kh_Team_ByID(key.count);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(realteam, INFO_KEYHUNT_LOST), player.netname);
kh_Key_AssignTo(key, NULL);
else
{
kh_Scores_Event(attacker, targ.kh_next, "carrierfrag", autocvar_g_balance_keyhunt_score_carrierfrag-1, 0);
- PlayerScore_Add(attacker, SP_KH_KCKILLS, 1);
+ GameRules_scoring_add(attacker, KH_KCKILLS, 1);
// the frag gets added later
}
}
kh_teams = autocvar_g_keyhunt_teams_override;
if(kh_teams < 2)
kh_teams = cvar("g_keyhunt_teams"); // read the cvar directly as it gets written earlier in the same frame
- kh_teams = bound(2, kh_teams, 4);
-
- int teams = 0;
- if(kh_teams >= 1) teams |= BIT(0);
- if(kh_teams >= 2) teams |= BIT(1);
- if(kh_teams >= 3) teams |= BIT(2);
- if(kh_teams >= 4) teams |= BIT(3);
-
- kh_teams = teams; // now set it?
+ kh_teams = BITS(bound(2, kh_teams, 4));
// make a KH entity for controlling the game
kh_controller = spawn();
REGISTER_MUTATOR(kh, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- kh_Initialize();
-
- ActivateTeamplay();
- SetLimits(autocvar_g_keyhunt_point_limit, autocvar_g_keyhunt_point_leadlimit, autocvar_timelimit_override, -1);
- if (autocvar_g_keyhunt_team_spawns)
- have_team_spawns = -1; // request team spawns
- }
+ GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_keyhunt_team_spawns);
+ GameRules_limit_score(autocvar_g_keyhunt_point_limit);
+ GameRules_limit_lead(autocvar_g_keyhunt_point_leadlimit);
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back kh_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ kh_Initialize();
}
-
return 0;
}
{
// a winner!
// and assign him his first place
- PlayerScore_Add(head, SP_LMS_RANK, 1);
+ GameRules_scoring_add(head, LMS_RANK, 1);
if(warmup_stage)
return WINNING_NO;
else
FOREACH_CLIENT(true, {
TRANSMUTE(Player, it);
it.frags = FRAGS_PLAYER;
- PlayerScore_Add(it, SP_LMS_LIVES, LMS_NewPlayerLives());
+ GameRules_scoring_add(it, LMS_LIVES, LMS_NewPlayerLives());
PutClientInServer(it);
});
}
TRANSMUTE(Observer, player);
else
{
- float tl = PlayerScore_Add(player, SP_LMS_LIVES, 0);
+ float tl = GameRules_scoring_add(player, LMS_LIVES, 0);
if(tl < lms_lowest_lives)
lms_lowest_lives = tl;
if(tl <= 0)
TRANSMUTE(Observer, player);
if(warmup_stage)
- PlayerScore_Add(player, SP_LMS_RANK, -PlayerScore_Add(player, SP_LMS_RANK, 0));
+ GameRules_scoring_add(player, LMS_RANK, -GameRules_scoring_add(player, LMS_RANK, 0));
}
}
return false;
if(player.frags == FRAGS_SPECTATOR)
return true;
- if(PlayerScore_Add(player, SP_LMS_LIVES, 0) <= 0)
+ if(GameRules_scoring_add(player, LMS_LIVES, 0) <= 0)
{
Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_LMS_NOLIVES);
return true;
void lms_RemovePlayer(entity player)
{
static int quitters = 0;
- float player_rank = PlayerScore_Add(player, SP_LMS_RANK, 0);
+ float player_rank = GameRules_scoring_add(player, LMS_RANK, 0);
if (!player_rank)
{
int pl_cnt = 0;
if(IS_BOT_CLIENT(player))
bot_clear(player);
player.frags = FRAGS_LMS_LOSER;
- PlayerScore_Add(player, SP_LMS_RANK, pl_cnt + 1);
+ GameRules_scoring_add(player, LMS_RANK, pl_cnt + 1);
}
else
{
FOREACH_CLIENT(true, {
if (it.frags == FRAGS_LMS_LOSER)
{
- float it_rank = PlayerScore_Add(it, SP_LMS_RANK, 0);
+ float it_rank = GameRules_scoring_add(it, LMS_RANK, 0);
if (it_rank > player_rank && it_rank <= 256)
- PlayerScore_Add(it, SP_LMS_RANK, -1);
+ GameRules_scoring_add(it, LMS_RANK, -1);
lms_lowest_lives = 0;
}
else if (it.frags != FRAGS_SPECTATOR)
{
- float tl = PlayerScore_Add(it, SP_LMS_LIVES, 0);
+ float tl = GameRules_scoring_add(it, LMS_LIVES, 0);
if(tl < lms_lowest_lives)
lms_lowest_lives = tl;
}
});
- PlayerScore_Add(player, SP_LMS_RANK, 665 - quitters); // different from 666
+ GameRules_scoring_add(player, LMS_RANK, 665 - quitters); // different from 666
if(!warmup_stage)
{
- PlayerScore_Add(player, SP_LMS_LIVES, -PlayerScore_Add(player, SP_LMS_LIVES, 0));
+ GameRules_scoring_add(player, LMS_LIVES, -GameRules_scoring_add(player, LMS_LIVES, 0));
++quitters;
}
player.frags = FRAGS_LMS_LOSER;
}
if(CS(player).killcount != FRAGS_SPECTATOR)
- if(PlayerScore_Add(player, SP_LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
+ if(GameRules_scoring_add(player, LMS_RANK, 0) > 0 && player.lms_spectate_warning != 2)
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_NOLIVES, player.netname);
else
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_LMS_FORFEIT, player.netname);
TRANSMUTE(Player, player);
campaign_bots_may_start = true;
- if(PlayerScore_Add(player, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
+ if(GameRules_scoring_add(player, LMS_LIVES, LMS_NewPlayerLives()) <= 0)
{
- PlayerScore_Add(player, SP_LMS_RANK, 666); // mark as forced spectator for the hud code
+ GameRules_scoring_add(player, LMS_RANK, 666); // mark as forced spectator for the hud code
player.frags = FRAGS_SPECTATOR;
}
}
if (!warmup_stage)
{
// remove a life
- int tl = PlayerScore_Add(frag_target, SP_LMS_LIVES, -1);
+ int tl = GameRules_scoring_add(frag_target, LMS_LIVES, -1);
if(tl < lms_lowest_lives)
lms_lowest_lives = tl;
if(tl <= 0)
if(IS_BOT_CLIENT(frag_target))
bot_clear(frag_target);
frag_target.frags = FRAGS_LMS_LOSER;
- PlayerScore_Add(frag_target, SP_LMS_RANK, pl_cnt);
+ GameRules_scoring_add(frag_target, LMS_RANK, pl_cnt);
}
}
M_ARGV(2, float) = 0; // frag score
if(item.itemdef == ITEM_ExtraLife)
{
Send_Notification(NOTIF_ONE, toucher, MSG_CENTER, CENTER_EXTRALIVES);
- PlayerScore_Add(toucher, SP_LMS_LIVES, autocvar_g_lms_extra_lives);
+ GameRules_scoring_add(toucher, LMS_LIVES, autocvar_g_lms_extra_lives);
return MUT_ITEMTOUCH_PICKUP;
}
return true; // allow writing to this field in intermission as it is needed for newly joining players
}
-// scoreboard stuff
-void lms_ScoreRules()
-{
- ScoreRules_basics(0, 0, 0, false);
- ScoreInfo_SetLabel_PlayerScore(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
- ScoreInfo_SetLabel_PlayerScore(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
- ScoreRules_basics_end();
-}
-
void lms_Initialize()
{
lms_lowest_lives = 9999;
-
- lms_ScoreRules();
}
REGISTER_MUTATOR(lms, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- lms_Initialize();
-
- SetLimits(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override), 0, autocvar_timelimit_override, -1);
- }
+ GameRules_limit_score(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override));
+ GameRules_limit_lead(0);
+ GameRules_score_enabled(false);
+ GameRules_scoring(0, 0, 0, {
+ field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
+ field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
+ });
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back lms_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ lms_Initialize();
}
-
return 0;
}
void race_ScoreRules()
{
- ScoreRules_basics(race_teams, 0, 0, false);
- if(race_teams)
- {
- ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
- }
- else if(g_race_qualifying)
- {
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
- }
- else
- {
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
- ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
- }
- ScoreRules_basics_end();
+ GameRules_score_enabled(false);
+ GameRules_scoring(race_teams, 0, 0, {
+ if (race_teams) {
+ field_team(ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+ field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+ field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+ field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
+ } else if (g_race_qualifying) {
+ field(SP_RACE_FASTEST, "fastest", SFL_SORT_PRIO_PRIMARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+ } else {
+ field(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY);
+ field(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME);
+ field(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME);
+ }
+ });
}
void race_EventLog(string mode, entity actor) // use an alias for easy changing and quick editing later
FOREACH_CLIENT(true, {
if(it.race_place)
{
- s = PlayerScore_Add(it, SP_RACE_FASTEST, 0);
+ s = GameRules_scoring_add(it, RACE_FASTEST, 0);
if(!s)
it.race_place = 0;
}
entity player = M_ARGV(0, entity);
if(g_race_qualifying)
- if(PlayerScore_Add(player, SP_RACE_FASTEST, 0))
+ if(GameRules_scoring_add(player, RACE_FASTEST, 0))
player.frags = FRAGS_LMS_LOSER;
else
player.frags = FRAGS_SPECTATOR;
if(autocvar_g_race_teams)
{
- ActivateTeamplay();
- race_teams = bound(2, autocvar_g_race_teams, 4);
- int teams = 0;
- if(race_teams >= 1) teams |= BIT(0);
- if(race_teams >= 2) teams |= BIT(1);
- if(race_teams >= 3) teams |= BIT(2);
- if(race_teams >= 4) teams |= BIT(3);
-
- race_teams = teams; // now set it?
-
- have_team_spawns = -1; // request team spawns
+ GameRules_teams(true);
+ race_teams = BITS(bound(2, autocvar_g_race_teams, 4));
}
else
race_teams = 0;
}
else
g_race_qualifying = 0;
- SetLimits(fraglimit_override, leadlimit_override, timelimit_override, qualifying_override);
+ GameRules_limit_score(fraglimit_override);
+ GameRules_limit_lead(leadlimit_override);
+ GameRules_limit_time(timelimit_override);
+ GameRules_limit_time_qualifying(qualifying_override);
}
REGISTER_MUTATOR(rc, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
-
rc_SetLimits();
- race_Initialize();
- }
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back race_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ race_Initialize();
}
-
return 0;
}
LOG_TRACE("No \"tdm_team\" entities found on this map, creating them anyway.");
int numteams = autocvar_g_tdm_teams_override;
-
if(numteams < 2) { numteams = autocvar_g_tdm_teams; }
- numteams = bound(2, numteams, 4);
-
- int teams = 0;
- if(numteams >= 1) teams |= BIT(0);
- if(numteams >= 2) teams |= BIT(1);
- if(numteams >= 3) teams |= BIT(2);
- if(numteams >= 4) teams |= BIT(3);
+ int teams = BITS(bound(2, numteams, 4));
if(teams & BIT(0))
tdm_SpawnTeam("Red", NUM_TEAM_1);
if(teams & BIT(1))
REGISTER_MUTATOR(tdm, false)
{
+ MUTATOR_STATIC();
MUTATOR_ONADD
{
- if (time > 1) // game loads at time 1
- error("This is a game type and it cannot be added at runtime.");
- InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
-
- ActivateTeamplay();
- SetLimits(autocvar_g_tdm_point_limit, autocvar_g_tdm_point_leadlimit, autocvar_timelimit_override, -1);
- if (autocvar_g_tdm_team_spawns)
- have_team_spawns = -1; // request team spawns
- }
+ GameRules_teams(true);
+ GameRules_spawning_teams(autocvar_g_tdm_team_spawns);
+ GameRules_limit_score(autocvar_g_tdm_point_limit);
+ GameRules_limit_lead(autocvar_g_tdm_point_leadlimit);
- MUTATOR_ONROLLBACK_OR_REMOVE
- {
- // we actually cannot roll back tdm_Initialize here
- // BUT: we don't need to! If this gets called, adding always
- // succeeds.
- }
-
- MUTATOR_ONREMOVE
- {
- LOG_INFO("This is a game type and it cannot be removed at runtime.");
- return -1;
+ InitializeEntity(NULL, tdm_DelayedInit, INITPRIO_GAMETYPE);
}
-
return 0;
}
#include "../common/minigames/sv_minigames.qh"
#include "../common/physics/player.qh"
-#include "../common/effects/qc/all.qh"
+#include "../common/effects/qc/_mod.qh"
#include "../common/mutators/mutator/waypoints/waypointsprites.qh"
#include "../common/triggers/include.qh"
#include "../common/wepent.qh"
if (this != attacker) {
float realdmg = damage - excess;
if (IS_PLAYER(attacker)) {
- PlayerScore_Add(attacker, SP_DMG, realdmg);
+ GameRules_scoring_add(attacker, DMG, realdmg);
}
if (IS_PLAYER(this)) {
- PlayerScore_Add(this, SP_DMGTAKEN, realdmg);
+ GameRules_scoring_add(this, DMGTAKEN, realdmg);
}
}
}
if(flood)
- LOG_INFO("NOTE: ", playername(source, true), "^7 is flooding.\n");
+ LOG_INFO("NOTE: ", playername(source, true), "^7 is flooding.");
// build sourcemsgstr by cutting off a prefix and replacing it by the other one
if(privatesay)
{
if(this.playerdemo_mode != PLAYERDEMO_MODE_OFF)
{
- LOG_INFO("playerdemo: ", this.netname, " closed\n");
+ LOG_INFO("playerdemo: ", this.netname, " closed");
fclose(this.playerdemo_fh);
}
this.playerdemo_mode = 0;
this.playerdemo_time = stof(fgets(this.playerdemo_fh));
this.playerdemo_time += this.playerdemo_starttime;
set_movetype(this, MOVETYPE_NONE);
- LOG_INFO("playerdemo: ", this.netname, " reading from ", f, "\n");
+ LOG_INFO("playerdemo: ", this.netname, " reading from ", f);
}
void playerdemo_open_write(entity this, string f)
{
this.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
this.playerdemo_fh = fopen(f, FILE_WRITE);
this.playerdemo_starttime = time - 1;
- LOG_INFO("playerdemo: ", this.netname, " writing to ", f, "\n");
- LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!\n");
+ LOG_INFO("playerdemo: ", this.netname, " writing to ", f);
+ LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!");
}
#define PLAYERDEMO_FIELD(ent,func,t,f) func##t(ent,f,#f);
#define PLAYERDEMO_FIELDS(ent,func) \
tracebox(safe, player.mins - SAFENUDGE, player.maxs + SAFENUDGE, step, MOVE_NOMONSTERS, player);
if(trace_startsolid)
{
- LOG_INFO("'safe' teleport location is not safe!\n");
+ LOG_INFO("'safe' teleport location is not safe!");
// FAIL TODO why does this happen?
return 0;
}
tracebox(safe, player.mins - SAFENUDGE, player.maxs + SAFENUDGE, to, MOVE_NOMONSTERS, player);
if(trace_startsolid)
{
- LOG_INFO("trace_endpos in solid, this can't be!\n");
+ LOG_INFO("trace_endpos in solid, this can't be!");
// FAIL TODO why does this happen? (reported by MrBougo)
return 0;
}
if(!move_out_of_solid(portal))
{
#ifdef DEBUG
- LOG_INFO("NO SAFE ORIGIN\n");
+ LOG_INFO("NO SAFE ORIGIN");
#endif
return 0;
}
#include <server/_mod.inc>
#include <common/_all.inc>
-#include <common/effects/qc/all.qc>
+#include <common/effects/qc/_mod.inc>
#include <lib/csqcmodel/sv_model.qc>
#include "../common/deathtypes/all.qh"
#include "../common/notifications/all.qh"
#include "../common/mapinfo.qh"
+#include <common/gamemodes/rules.qh>
#include <common/net_linked.qh>
#include <common/state.qh>
#include "../common/triggers/subs.qh"
float s;
if(g_race_qualifying)
{
- s = PlayerScore_Add(e, SP_RACE_FASTEST, 0);
+ s = GameRules_scoring_add(e, RACE_FASTEST, 0);
if(!s || t < s)
- PlayerScore_Add(e, SP_RACE_FASTEST, t - s);
+ GameRules_scoring_add(e, RACE_FASTEST, t - s);
}
else
{
- s = PlayerScore_Add(e, SP_RACE_FASTEST, 0);
+ s = GameRules_scoring_add(e, RACE_FASTEST, 0);
if(!s || t < s)
- PlayerScore_Add(e, SP_RACE_FASTEST, t - s);
+ GameRules_scoring_add(e, RACE_FASTEST, t - s);
- s = PlayerScore_Add(e, SP_RACE_TIME, 0);
+ s = GameRules_scoring_add(e, RACE_TIME, 0);
snew = TIME_ENCODE(time - game_starttime);
- PlayerScore_Add(e, SP_RACE_TIME, snew - s);
- l = PlayerTeamScore_Add(e, SP_RACE_LAPS, ST_RACE_LAPS, 1);
+ GameRules_scoring_add(e, RACE_TIME, snew - s);
+ l = GameRules_scoring_add_team(e, RACE_LAPS, 1);
if(autocvar_fraglimit)
if(l >= autocvar_fraglimit)
entity oth = race_checkpoint_lastplayers[cp];
if(oth)
{
- mylaps = PlayerScore_Add(e, SP_RACE_LAPS, 0);
+ mylaps = GameRules_scoring_add(e, RACE_LAPS, 0);
lother = race_checkpoint_lastlaps[cp];
othtime = race_checkpoint_lasttimes[cp];
}
// links on CP entities)
float l;
- l = PlayerScore_Add(e, SP_RACE_LAPS, 0);
+ l = GameRules_scoring_add(e, RACE_LAPS, 0);
if(CS(e).race_completed)
return l; // not fractional
*/
float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score);
-/**
- * Adds to the generic score fields for both the player and the team.
- */
-#define PlayerTeamScore_AddScore(p, s) PlayerTeamScore_Add(p, SP_SCORE, ST_SCORE, s)
-
/**
* Set the label of a team score item, as well as the scoring flags.
*/
#include <server/miscfunctions.qh>
#include "client.qh"
#include "scores.qh"
+#include <common/gamemodes/rules.qh>
int ScoreRules_teams;
}
void ScoreRules_generic()
{
- if(teamplay)
- {
+ int teams = 0;
+ if (teamplay) {
CheckAllowedTeams(NULL);
- int teams = 0;
- if(c1 >= 0) teams |= BIT(0);
- if(c2 >= 0) teams |= BIT(1);
- if(c3 >= 0) teams |= BIT(2);
- if(c4 >= 0) teams |= BIT(3);
- ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
+ if (c1 >= 0) teams |= BIT(0);
+ if (c2 >= 0) teams |= BIT(1);
+ if (c3 >= 0) teams |= BIT(2);
+ if (c4 >= 0) teams |= BIT(3);
}
- else
- ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, true);
- ScoreRules_basics_end();
+ GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, {});
}
this.maxs = PL_MAX_CONST;
if (!move_out_of_solid(this))
objerror(this, "could not get out of solid at all!");
- LOG_INFO("^1NOTE: this map needs FIXING. Spawnpoint at ", vtos(o - '0 0 1'));
- LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(this.origin.x - o.x));
- LOG_INFO(" ", ftos(this.origin.y - o.y));
- LOG_INFO(" ", ftos(this.origin.z - o.z), "'\n");
+ LOG_INFOF(
+ "^1NOTE: this map needs FIXING. Spawnpoint at %s needs to be moved out of solid, e.g. by %s",
+ vtos(o - '0 0 1'),
+ vtos(this.origin - o)
+ );
if (autocvar_g_spawnpoints_auto_move_out_of_solid)
{
if (!spawnpoint_nag)
- LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)\n");
+ LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)");
spawnpoint_nag = 1;
}
else
if(time > client_cefc_accumulatortime + 1)
{
float t = client_cefc_accumulator / (time - client_cefc_accumulatortime);
- LOG_INFO("CEFC time: ", ftos(t * 1000), "ms; ");
int c_seeing = 0;
int c_seen = 0;
FOREACH_CLIENT(true, {
if(IS_PLAYER(it))
++c_seen;
});
- LOG_INFO("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
- LOG_INFO("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");
-
+ LOG_INFO(
+ "CEFC time: ", ftos(t * 1000), "ms; ",
+ "CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ",
+ "CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0')
+ );
client_cefc_accumulatortime = time;
client_cefc_accumulator = 0;
}
ScoreRules_generic();
}
-void ActivateTeamplay()
-{
- serverflags |= SERVERFLAG_TEAMPLAY;
- teamplay = 1;
- cvar_set("teamplay", "2"); // DP needs this for sending proper getstatus replies.
-}
-
void InitGameplayMode()
{
VoteReset();
max_shot_distance = min(230000, vlen(world.maxs - world.mins));
MapInfo_LoadMapSettings(mapname);
- serverflags &= ~SERVERFLAG_TEAMPLAY;
- teamplay = 0;
- cvar_set("teamplay", "0"); // DP needs this for sending proper getstatus replies.
+ GameRules_teams(false);
if (!cvar_value_issafe(world.fog))
{
- LOG_INFO("The current map contains a potentially harmful fog setting, ignored\n");
+ LOG_INFO("The current map contains a potentially harmful fog setting, ignored");
world.fog = string_null;
}
if(MapInfo_Map_fog != "")
void default_delayedinit(entity this);
-void ActivateTeamplay();
-
void InitGameplayMode();
string GetClientVersionMessage(entity this);
this.takedamage = DAMAGE_NO;
this.event_damage = func_null;
+ MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker);
+
if(IS_CLIENT(attacker) && !autocvar_g_projectiles_keep_owner)
{
this.owner = attacker;
this.realowner = attacker;
}
- MUTATOR_CALLHOOK(PrepareExplosionByDamage, this, attacker);
-
// do not explode NOW but in the NEXT FRAME!
// because recursive calls to RadiusDamage are not allowed
this.nextthink = time;
void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity)
{
float w;
- w = W_GetCycleWeapon(this, this.cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
+ w = W_GetCycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
if(w > 0)
W_SwitchWeapon(this, Weapons_from(w), weaponentity);
}
else if(list == 1)
W_CycleWeapon(this, this.weaponorder_byimpulse, -1, weaponentity);
else if(list == 2)
- W_CycleWeapon(this, this.cvar_cl_weaponpriority, -1, weaponentity);
+ W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, -1, weaponentity);
}
// prev weapon
else if(list == 1)
W_CycleWeapon(this, this.weaponorder_byimpulse, +1, weaponentity);
else if(list == 2)
- W_CycleWeapon(this, this.cvar_cl_weaponpriority, +1, weaponentity);
+ W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, weaponentity);
}
// previously used if exists and has ammo, (second) best otherwise
.int weaponcomplainindex;
float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
-#define w_getbestweapon(ent,wepent) Weapons_from(W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true, wepent))
+#define w_getbestweapon(ent,wepent) Weapons_from(W_GetCycleWeapon(ent, CS(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
float oldsolid = ent.dphitcontentsmask;
if(!IS_CLIENT(ent))
antilag = false; // no antilag for non-clients!
- if (IS_PLAYER(ent) && ent.(weaponentity).m_weapon == WEP_RIFLE)
+ if (IS_PLAYER(ent) && (ent.(weaponentity).m_weapon.spawnflags & WEP_FLAG_PENETRATEWALLS))
ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
else
ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
if (trace_ent == CS(ent).cursor_trace_ent)
w_shotdir = normalize(CS(ent).cursor_trace_ent.origin - w_shotorg);
else
- LOG_INFO("antilag fail\n");
+ LOG_INFO("antilag fail");
}
}
}
#if 0
mspercallsum += gettime(GETTIME_HIRES);
mspercallcount += 1;
- LOG_INFO("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n");
+ LOG_INFO("avg: ", ftos(mspercallcount / mspercallsum), " per sec");
#endif
proj.velocity = W_CalculateProjectileVelocity(proj.owner, proj.owner.velocity, pSpeed * dir, forceAbsolute);
case URL_READY_CANREAD:
// url_fclose is processing, we got a response for writing the data
// this must come from HTTP
- LOG_INFO("Got response from weapon stats server:\n");
+ LOG_INFO("Got response from weapon stats server:");
while((s = url_fgets(fh)))
- LOG_INFO(" ", s, "\n");
- LOG_INFO("End of response.\n");
+ LOG_INFO(" ", s);
+ LOG_INFO("End of response.");
url_fclose(fh);
break;
case URL_READY_CLOSED:
// url_fclose has finished
- LOG_INFO("Weapon stats written\n");
+ LOG_INFO("Weapon stats written");
buf_del(weaponstats_buffer);
weaponstats_buffer = -1;
break;
case URL_READY_ERROR:
default:
- LOG_INFO("Weapon stats writing failed: ", ftos(status), "\n");
+ LOG_INFO("Weapon stats writing failed: ", ftos(status));
buf_del(weaponstats_buffer);
weaponstats_buffer = -1;
break;
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_01"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_02"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_03"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_04"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_05"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_06"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_07"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_08"
{
dpnoshadow
deformVertexes autosprite
- dppolygonoffset -6000
nopicmip
{
map "models/ok_nade_counter/ok_nade_counter_09"