alias sv_hook_gamestart_ka
alias sv_hook_gamestart_ft
alias sv_hook_gamestart_inv
+alias sv_hook_gamestart_gg
alias sv_hook_gamerestart
alias sv_hook_gameend
alias sv_vote_gametype_hook_dm
alias sv_vote_gametype_hook_dom
alias sv_vote_gametype_hook_ft
+alias sv_vote_gametype_hook_gg
alias sv_vote_gametype_hook_inv
alias sv_vote_gametype_hook_ka
alias sv_vote_gametype_hook_kh
set g_inv_respawn_delay_max 0
set g_inv_respawn_waves 0
set g_inv_weapon_stay 0
-
+set g_gg_respawn_delay_small 0
+set g_gg_respawn_delay_small_count 0
+set g_gg_respawn_delay_large 0
+set g_gg_respawn_delay_large_count 0
+set g_gg_respawn_delay_max 0
+set g_gg_respawn_waves 0
+set g_gg_weapon_stay 0
// =========
// assault
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)"
+// =========
+// gungame
+// =========
+set g_gg 0 "GunGame: Kill players with all weapons"
+set g_gg_weapons "vortex mortar machinegun hagar arc electro devastator crylink shotgun blaster"
+set g_gg_kills_per_weapon 3 "Number of kills needed to advance to the next weapon"
+
exec survival.cfg // Lyberta: surv
// =========================
+// ========
+// sprint
+// ========
+set g_sprint 0 "whether to enable sprint"
+set g_sprint_speed_multiplier 1.5 "speed multiplier of sprinting"
+set g_sprint_in_air 1 "whether to increase air acceleration too"
+set g_sprint_cost 10 "amount of fuel that sprinting costs per second"
+
// =========
// dodging
// =========
}
}
+// GunGame
+
+/// \brief Duration of transition between the weapons pictures.
+const float gg_weapon_transition_duration = 0.5;
+
+int gg_current_weapon; ///< Current weapon.
+string gg_current_weapon_picture; ///< Current weapon picture.
+int gg_previous_weapon; ///< Previous weapon.
+string gg_previous_weapon_picture; ///< Previous weapon picture.
+float gg_weapon_change_time; ///< Time when the weapon changed.
+
+string GG_GetWeaponPicture(int weapon)
+{
+ FOREACH(Weapons, it != WEP_Null,
+ {
+ if (it.m_id == weapon)
+ {
+ return it.model2;
+ }
+ });
+ return "";
+}
+
+void HUD_Mod_GG(vector pos, vector mySize)
+{
+ // Required in each mod function that always shows something.
+ mod_active = 1;
+ int stat_weapon = STAT(GUNGAME_LEADING_WEAPON);
+ if (stat_weapon != gg_current_weapon)
+ {
+ // New leading weapon.
+ gg_previous_weapon = gg_current_weapon;
+ gg_previous_weapon_picture = gg_current_weapon_picture;
+ gg_current_weapon = stat_weapon;
+ gg_current_weapon_picture = GG_GetWeaponPicture(gg_current_weapon);
+ gg_weapon_change_time = time;
+ }
+ vector pic_pos, pic_size;
+ if (mySize.x > mySize.y)
+ {
+ pic_pos = pos + eX * 0.25 * mySize.x;
+ pic_size = vec2(0.5 * mySize.x, mySize.y);
+ }
+ else
+ {
+ pic_pos = pos + eY * 0.25 * mySize.y;
+ pic_size = vec2(mySize.x, 0.5 * mySize.y);
+ }
+ float weapon_change_elapsed_time = time - gg_weapon_change_time;
+ // Weapon transition phase. 0 at the start of transition. 1 at the end.
+ float phase = bound(0, weapon_change_elapsed_time /
+ gg_weapon_transition_duration, 1);
+
+ // Draw current weapon picture. Fading in if phase is less than 1.
+ if (gg_current_weapon_picture)
+ {
+ drawpic_aspect_skin(pic_pos, gg_current_weapon_picture, pic_size,
+ '1 1 1', phase, DRAWFLAG_NORMAL);
+ }
+ // Draw previous weapon picture on top of current one so it gives a nice
+ // fade out effect.
+ if ((phase < 1) && gg_previous_weapon_picture)
+ {
+ drawpic_aspect_skin_expanding(pic_pos, gg_previous_weapon_picture,
+ pic_size, '1 1 1', 1 - phase, DRAWFLAG_NORMAL, phase);
+ }
+}
+
// Lyberta: surv
void HUD_Mod_SURV(vector mypos, vector mysize)
{
#include <common/gamemodes/gamemode/deathmatch/_mod.inc>
#include <common/gamemodes/gamemode/domination/_mod.inc>
#include <common/gamemodes/gamemode/freezetag/_mod.inc>
+#include <common/gamemodes/gamemode/gungame/_mod.inc>
#include <common/gamemodes/gamemode/invasion/_mod.inc>
#include <common/gamemodes/gamemode/keepaway/_mod.inc>
#include <common/gamemodes/gamemode/keyhunt/_mod.inc>
#include <common/gamemodes/gamemode/deathmatch/_mod.qh>
#include <common/gamemodes/gamemode/domination/_mod.qh>
#include <common/gamemodes/gamemode/freezetag/_mod.qh>
+#include <common/gamemodes/gamemode/gungame/_mod.qh>
#include <common/gamemodes/gamemode/invasion/_mod.qh>
#include <common/gamemodes/gamemode/keepaway/_mod.qh>
#include <common/gamemodes/gamemode/keyhunt/_mod.qh>
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/gamemodes/gamemode/gungame/sv_gungame.qc>
+#endif
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/gamemodes/gamemode/gungame/sv_gungame.qh>
+#endif
--- /dev/null
+/// \file
+/// \brief Source file that contains implementation of the GunGame gamemode.
+/// \author Lyberta
+/// \copyright GNU GPLv2 or any later version.
+
+#include "sv_gungame.qh"
+
+//============================ Constants ======================================
+
+const string GUNGAME_WEAPONS_CVAR = "g_gg_weapons";
+
+//======================= Global variables ====================================
+
+/// \brief Number of kills needed to advance to the next weapon.
+int autocvar_g_gg_kills_per_weapon;
+
+int gungame_max_level; ///< Player who reaches this level wins.
+string gungame_weapons; ///< Holds weapons corresponding to levels.
+
+entity gungame_leading_player; ///< Holds the leading player.
+int gungame_leading_level; ///< Holds the leading level.
+entity gungame_leading_weapon; ///< Holds the leading weapon.
+
+//====================== Forward declarations =================================
+
+/// \brief Resets the state to initial one.
+void GunGame_Reset();
+
+/// \brief Returns the weapon that corresponds to the given level.
+/// \param[in] level Level of the weapon.
+/// \return Weapon corresponding to the given level.
+entity GunGame_GetWeapon(int level);
+
+/// \brief Updates stats of all players.
+void GunGame_UpdateStats();
+
+//========================= Free functions ====================================
+
+void GunGame_Initialize()
+{
+ GunGame_Reset();
+}
+
+void GunGame_Reset()
+{
+ strcpy(gungame_weapons, cvar_string(GUNGAME_WEAPONS_CVAR));
+ gungame_max_level = tokenize_console(gungame_weapons) *
+ autocvar_g_gg_kills_per_weapon;
+ if (gungame_max_level == 0)
+ {
+ LOG_FATAL("GunGame: Invalid weapon configuration.");
+ }
+ GameRules_limit_score(gungame_max_level);
+ gungame_leading_player = NULL;
+ gungame_leading_level = 0;
+ gungame_leading_weapon = GunGame_GetWeapon(0);
+ GunGame_UpdateStats();
+}
+
+entity GunGame_GetWeapon(int level)
+{
+ if (level >= gungame_max_level)
+ {
+ return NULL;
+ }
+ tokenize_console(gungame_weapons);
+ string weapon = argv(floor(level / autocvar_g_gg_kills_per_weapon));
+ FOREACH(Weapons, it != WEP_Null,
+ {
+ if (it.netname == weapon)
+ {
+ return it;
+ }
+ });
+ LOG_FATAL("GunGame_GetWeapon: Invalid level or weapon name");
+ return NULL;
+}
+
+/// \brief Returns the player level.
+/// \param[in] player Player to check.
+/// \return Level of the player.
+int GunGame_GetPlayerLevel(entity player)
+{
+ return PlayerScore_Get(player, SP_SCORE);
+}
+
+/// \brief Updates the information about the leading player.
+void GunGame_UpdateLeadingPlayer()
+{
+ entity previous_leader = gungame_leading_player;
+ FOREACH_CLIENT(true,
+ {
+ if (gungame_leading_player == NULL)
+ {
+ gungame_leading_player = it;
+ continue;
+ }
+ if (GunGame_GetPlayerLevel(it) > GunGame_GetPlayerLevel(
+ gungame_leading_player))
+ {
+ gungame_leading_player = it;
+ }
+ });
+ if (gungame_leading_player == NULL)
+ {
+ return;
+ }
+ if ((gungame_leading_player == previous_leader) &&
+ (GunGame_GetPlayerLevel(gungame_leading_player) ==
+ gungame_leading_level))
+ {
+ return;
+ }
+ gungame_leading_level = GunGame_GetPlayerLevel(gungame_leading_player);
+ gungame_leading_weapon = GunGame_GetWeapon(gungame_leading_level);
+ GunGame_UpdateStats();
+ //PrintToChatAll(strcat(gungame_leading_player.netname,
+ // " is leading with level ", ftos(gungame_leading_level)));
+}
+
+void GunGame_UpdateStats()
+{
+ FOREACH_CLIENT(IS_REAL_CLIENT(it),
+ {
+ STAT(GUNGAME_LEADING_WEAPON, it) = gungame_leading_weapon.m_id;
+ });
+}
+
+/// \brief Gives the player a weapon that corresponds to their level.
+/// \param[in,out] player Player to give weapon to.
+void GunGame_GivePlayerWeapon(entity player)
+{
+ int level = GunGame_GetPlayerLevel(player);
+ if (level >= gungame_max_level)
+ {
+ return;
+ }
+ entity weapon = GunGame_GetWeapon(level);
+ STAT(WEAPONS, player) |= weapon.m_wepset;
+ centerprint(player, strcat("^3Level ", ftos(level + 1), ": ^2",
+ weapon.m_name));
+}
+
+//============================= Hooks ========================================
+
+/// \brief Hook that is called to determine if there is a weapon arena.
+MUTATOR_HOOKFUNCTION(gg, SetWeaponArena)
+{
+ //PrintToChatAll("SetWeaponArena");
+ M_ARGV(0, string) = "off";
+}
+
+/// \brief Hook that is called to determine start items of all players.
+MUTATOR_HOOKFUNCTION(gg, SetStartItems)
+{
+ //PrintToChatAll("SetStartItems");
+ start_weapons = WEPSET(Null);
+ warmup_start_weapons = WEPSET(Null);
+}
+
+/// \brief Hook that is called when an item is about to spawn.
+MUTATOR_HOOKFUNCTION(gg, FilterItemDefinition)
+{
+ //PrintToChatAll("FilterItemDefinition");
+ entity item = M_ARGV(0, entity);
+ if (item.instanceOfAmmo)
+ {
+ // Block ammo from spawning.
+ return true;
+ }
+ if (item.instanceOfWeaponPickup)
+ {
+ // Block weapons from spawning.
+ return true;
+ }
+}
+
+/// \brief Hook that is called when player connects to the server.
+MUTATOR_HOOKFUNCTION(gg, ClientConnect)
+{
+ entity player = M_ARGV(0, entity);
+ if (!IS_REAL_CLIENT(player))
+ {
+ return true;
+ }
+ STAT(GUNGAME_LEADING_WEAPON, player) = gungame_leading_weapon.m_id;
+ return true;
+}
+
+MUTATOR_HOOKFUNCTION(gg, reset_map_global)
+{
+ GunGame_Reset();
+}
+
+/// \brief Hook that is called when player spawns.
+MUTATOR_HOOKFUNCTION(gg, PlayerSpawn, CBC_ORDER_LAST)
+{
+ entity player = M_ARGV(0, entity);
+ STAT(WEAPONS, player) = WEPSET(Null);
+ GunGame_GivePlayerWeapon(player);
+ player.items |= IT_UNLIMITED_AMMO;
+}
+
+/// \brief Hook which is called when the player tries to throw their weapon.
+MUTATOR_HOOKFUNCTION(gg, ForbidThrowCurrentWeapon)
+{
+ return true;
+}
+
+/// \brief Hook that is called when player dies.
+MUTATOR_HOOKFUNCTION(gg, PlayerDies)
+{
+ GunGame_UpdateLeadingPlayer();
+ entity attacker = M_ARGV(1, entity);
+ if (!IS_PLAYER(attacker) || IS_DEAD(attacker) || (GunGame_GetPlayerLevel(
+ attacker) >= gungame_max_level))
+ {
+ return;
+ }
+ STAT(WEAPONS, attacker) = WEPSET(Null);
+ GunGame_GivePlayerWeapon(attacker);
+}
+
+/// \brief Hook that determines whether remaining frags are announced.
+MUTATOR_HOOKFUNCTION(gg, Scores_CountFragsRemaining)
+{
+ // announce remaining frags
+ return true;
+}
--- /dev/null
+/// \file
+/// \brief Header file that describes the GunGame gamemode.
+/// \author Lyberta
+/// \copyright GNU GPLv2 or any later version.
+
+#pragma once
+
+/// \brief Initializes global data for the gametype.
+/// \return No return.
+void GunGame_Initialize();
+
+REGISTER_MUTATOR(gg, false)
+{
+ MUTATOR_STATIC();
+ MUTATOR_ONADD
+ {
+ GunGame_Initialize();
+ }
+ return 0;
+}
ATTRIB(GameItem, m_name, string);
ATTRIB(GameItem, m_icon, string);
ATTRIB(GameItem, m_color, vector, '1 1 1');
- ATTRIB(GameItem, m_waypoint, string);
+ ATTRIB(GameItem, m_waypoint_text, string);
+ ATTRIB(GameItem, m_waypoint_icon, string);
ATTRIB(GameItem, m_waypointblink, int, 1);
#ifdef GAMEQC
ATTRIB(GameItem, m_glow, bool, false);
this.netname = "armor_small";
this.m_name = "5 Armor";
this.m_icon = "armor";
+ this.m_waypoint_icon = "waypoint_armor";
#ifdef SVQC
this.m_itemid = IT_ARMOR_SHARD;
this.m_respawntime = GET(g_pickup_respawntime_short);
this.netname = "armor_medium";
this.m_name = "25 Armor";
this.m_icon = "armor";
+ this.m_waypoint_icon = "waypoint_armor";
#ifdef SVQC
this.m_itemid = IT_ARMOR;
this.m_respawntime = GET(g_pickup_respawntime_medium);
this.m_name = "50 Armor";
this.m_icon = "armor";
this.m_color = '0 1 0';
- this.m_waypoint = _("Big armor");
+ this.m_waypoint_text = _("Big armor");
+ this.m_waypoint_icon = "waypoint_armor";
#ifdef SVQC
this.m_itemid = IT_ARMOR;
this.m_respawntime = GET(g_pickup_respawntime_long);
this.m_name = "100 Armor";
this.m_icon = "item_large_armor";
this.m_color = '0 1 0';
- this.m_waypoint = _("Mega armor");
+ this.m_waypoint_text = _("Mega armor");
+ this.m_waypoint_icon = "waypoint_armor_mega";
this.m_waypointblink = 2;
#ifdef SVQC
this.m_maxs = '16 16 70';
this.netname = "health_small";
this.m_name = "5 Health";
this.m_icon = "health";
+ this.m_waypoint_icon = "waypoint_health";
#ifdef SVQC
this.m_itemid = IT_5HP;
this.m_respawntime = GET(g_pickup_respawntime_short);
this.netname = "health_medium";
this.m_name = "25 Health";
this.m_icon = "health";
+ this.m_waypoint_icon = "waypoint_health";
#ifdef SVQC
this.m_itemid = IT_25HP;
this.m_respawntime = GET(g_pickup_respawntime_short);
this.m_name = "50 Health";
this.m_icon = "health";
this.m_color = '1 0 0';
- this.m_waypoint = _("Big health");
+ this.m_waypoint_text = _("Big health");
+ this.m_waypoint_icon = "waypoint_health";
#ifdef SVQC
this.m_itemid = IT_25HP;
this.m_respawntime = GET(g_pickup_respawntime_medium);
this.m_name = "100 Health";
this.m_icon = "item_mega_health";
this.m_color = '1 0 0';
- this.m_waypoint = _("Mega health");
+ this.m_waypoint_text = _("Mega health");
+ this.m_waypoint_icon = "waypoint_health_mega";
this.m_waypointblink = 2;
#ifdef SVQC
this.m_maxs = '16 16 70';
this.m_name = "Jetpack";
this.m_icon = "jetpack";
this.m_color = '0.5 0.5 0.5';
- this.m_waypoint = _("Jetpack");
+ this.m_waypoint_text = _("Jetpack");
+ this.m_waypoint_icon = "waypoint_jetpack";
this.m_waypointblink = 2;
#ifdef SVQC
this.m_botvalue = 3000;
this.m_name = "Fuel regenerator";
this.m_icon = "fuelregen";
this.m_color = '1 0.5 0';
- this.m_waypoint = _("Fuel regen");
+ this.m_waypoint_text = _("Fuel regen");
+ this.m_waypoint_icon = "waypoint_fuel_regen";
this.m_waypointblink = 2;
#ifdef SVQC
this.m_botvalue = 3000;
this.m_name = "Strength Powerup";
this.m_icon = "strength";
this.m_color = '0 0 1';
- this.m_waypoint = _("Strength");
+ this.m_waypoint_text = _("Strength");
+ this.m_waypoint_icon = "waypoint_strength";
this.m_waypointblink = 2;
this.m_itemid = IT_STRENGTH;
#ifdef SVQC
this.m_name = "Shield";
this.m_icon = "shield";
this.m_color = '1 0 1';
- this.m_waypoint = _("Shield");
+ this.m_waypoint_text = _("Shield");
+ this.m_waypoint_icon = "waypoint_shield";
this.m_waypointblink = 2;
this.m_itemid = IT_INVINCIBLE;
#ifdef SVQC
//=============================================================================
+#ifdef CSQC
+void HUD_Mod_GG(vector pos, vector mySize);
+#endif
+CLASS(GunGame, Gametype)
+ INIT(GunGame)
+ {
+ this.gametype_init(this, _("GunGame"), "gg", "g_gg", false, "", "timelimit=20", _("Kill players with all weapons"));
+ }
+ METHOD(GunGame, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ return true;
+ }
+#ifdef CSQC
+ ATTRIB(GunGame, m_modicons, void(vector pos, vector mySize), HUD_Mod_GG);
+#endif
+ENDCLASS(GunGame)
+REGISTER_GAMETYPE(GUNGAME, NEW(GunGame));
+#define g_gg IS_GAMETYPE(GUNGAME)
+
+//=============================================================================
+
// Lyberta: adding survival gametype
#ifdef CSQC
this.gametype_init(this, _("Survival"), "surv", "g_surv", true, "", "timelimit=20 pointlimit=5 teams=2 leadlimit=0", _("Survive as long as you can"));
}
METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
- {
- return true;
- }
+ {
+ return true;
+ }
#ifdef CSQC
ATTRIB(Survival, m_modicons, void(vector pos, vector mySize), HUD_Mod_SURV);
#endif
#include <common/mutators/mutator/running_guns/_mod.inc>
#include <common/mutators/mutator/sandbox/_mod.inc>
#include <common/mutators/mutator/spawn_near_teammate/_mod.inc>
+#include <common/mutators/mutator/sprint/_mod.inc>
#include <common/mutators/mutator/stale_move_negation/_mod.inc>
#include <common/mutators/mutator/superspec/_mod.inc>
#include <common/mutators/mutator/touchexplode/_mod.inc>
#include <common/mutators/mutator/running_guns/_mod.qh>
#include <common/mutators/mutator/sandbox/_mod.qh>
#include <common/mutators/mutator/spawn_near_teammate/_mod.qh>
+#include <common/mutators/mutator/sprint/_mod.qh>
#include <common/mutators/mutator/stale_move_negation/_mod.qh>
#include <common/mutators/mutator/superspec/_mod.qh>
#include <common/mutators/mutator/touchexplode/_mod.qh>
this.m_name = "Extra life";
this.m_icon = "item_mega_health";
this.m_color = '1 0 0';
- this.m_waypoint = _("Extra life");
+ this.m_waypoint_text = _("Extra life");
+ this.m_waypoint_icon = "waypoint_health_mega";
this.m_waypointblink = 2;
this.m_itemid = IT_NAILS;
}
this.m_name = "Invisibility";
this.m_icon = "strength";
this.m_color = '0 0 1';
- this.m_waypoint = _("Invisibility");
+ this.m_waypoint_text = _("Invisibility");
+ this.m_waypoint_icon = "waypoint_invisibility";
this.m_waypointblink = 2;
this.m_itemid = IT_STRENGTH;
#ifdef SVQC
this.m_name = "Speed";
this.m_icon = "shield";
this.m_color = '1 0 1';
- this.m_waypoint = _("Speed");
+ this.m_waypoint_text = _("Speed");
+ this.m_waypoint_icon = "waypoint_speed";
this.m_waypointblink = 2;
this.m_itemid = IT_INVINCIBLE;
#ifdef SVQC
--- /dev/null
+// generated file; do not modify
+#ifdef SVQC
+ #include <common/mutators/mutator/sprint/sv_sprint.qc>
+#endif
--- /dev/null
+// generated file; do not modify
--- /dev/null
+/// \file
+/// \brief Source file that contains implementation of Sprint mutator.
+/// \copyright GNU GPLv2 or any later version.
+
+string autocvar_g_sprint = "0"; ///< Whether to enable sprint.
+float autocvar_g_sprint_speed_multiplier; ///< Speed multiplier of sprinting.
+bool autocvar_g_sprint_in_air; ///< Whether to increase air acceleration too.
+/// \brief Amount of fuel that sprinting costs per second.
+float autocvar_g_sprint_cost;
+
+.bool m_is_sprinting; ///< Whether player is sprinting.
+
+REGISTER_MUTATOR(sprint, expr_evaluate(autocvar_g_sprint));
+
+MUTATOR_HOOKFUNCTION(sprint, BuildMutatorsString)
+{
+ M_ARGV(0, string) = strcat(M_ARGV(0, string), ":sprint");
+}
+
+MUTATOR_HOOKFUNCTION(sprint, BuildMutatorsPrettyString)
+{
+ M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Sprint");
+}
+
+MUTATOR_HOOKFUNCTION(sprint, BuildGameplayTipsString)
+{
+ M_ARGV(0, string) = strcat(M_ARGV(0, string), "\n\n^3Sprint^8 is enabled, press the sprint button to sprint\n");
+}
+
+MUTATOR_HOOKFUNCTION(sprint, SetStartItems)
+{
+ if (autocvar_g_sprint_cost > 0)
+ {
+ start_items |= ITEM_JetpackRegen.m_itemid;
+ start_ammo_fuel = max(start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
+ warmup_start_ammo_fuel = start_ammo_fuel;
+ }
+}
+
+MUTATOR_HOOKFUNCTION(sprint, GetPressedKeys)
+{
+ entity player = M_ARGV(0, entity);
+ if (PHYS_INPUT_BUTTON_SPRINT(player))
+ {
+ player.m_is_sprinting = true;
+ }
+ else
+ {
+ player.m_is_sprinting = false;
+ }
+}
+
+MUTATOR_HOOKFUNCTION(sprint, PlayerPhysics_UpdateStats)
+{
+ entity player = M_ARGV(0, entity);
+ if (!player.m_is_sprinting)
+ {
+ return;
+ }
+ float cost = 0;
+ float fuel = 0;
+ if (autocvar_g_sprint_cost > 0)
+ {
+ cost = autocvar_g_sprint_cost * frametime;
+ fuel = GetResourceAmount(player, RESOURCE_FUEL);
+ if (fuel < cost)
+ {
+ player.m_is_sprinting = false;
+ return;
+ }
+ }
+ if (!IS_ONGROUND(player) && !autocvar_g_sprint_in_air)
+ {
+ return;
+ }
+ STAT(MOVEVARS_HIGHSPEED, player) *= autocvar_g_sprint_speed_multiplier;
+ if (autocvar_g_sprint_cost <= 0)
+ {
+ return;
+ }
+ if ((PHYS_INPUT_MOVEVALUES(player).x == 0) &&
+ (PHYS_INPUT_MOVEVALUES(player).y == 0))
+ {
+ return;
+ }
+ SetResourceAmount(player, RESOURCE_FUEL, fuel - cost);
+}
REGISTER_WAYPOINT(AssaultPush, _("Push"), "", '1 0.5 0', 1);
REGISTER_WAYPOINT(FlagCarrier, _("Flag carrier"), "", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagCarrierEnemy, _("Enemy carrier"), "flag_neutral_carrying", '1 1 1', 1);
-REGISTER_WAYPOINT(FlagDropped, _("Dropped flag"), "flag_neutral_lost", '1 1 1', 1);
-REGISTER_WAYPOINT(FlagBaseNeutral, _("White base"), "flag_neutral_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBaseRed, _("Red base"), "flag_red_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBaseBlue, _("Blue base"), "flag_blue_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBaseYellow, _("Yellow base"), "flag_yellow_taken", '0.8 0.8 0', 1);
-REGISTER_WAYPOINT(FlagBasePink, _("Pink base"), "flag_pink_taken", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagCarrierEnemy, _("Enemy carrier"), "waypoint_flag_carrying", '1 1 1', 1);
+REGISTER_WAYPOINT(FlagDropped, _("Dropped flag"), "waypoint_flag_lost", '1 1 1', 1);
+REGISTER_WAYPOINT(FlagBaseNeutral, _("White base"), "waypoint_flag", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBaseRed, _("Red base"), "waypoint_flag", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBaseBlue, _("Blue base"), "waypoint_flag", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBaseYellow, _("Yellow base"), "waypoint_flag", '0.8 0.8 0', 1);
+REGISTER_WAYPOINT(FlagBasePink, _("Pink base"), "waypoint_flag", '0.8 0.8 0', 1);
REGISTER_WAYPOINT(FlagReturn, _("Return flag here"), "", '0 0.8 0.8', 1);
-REGISTER_WAYPOINT(DomNeut, _("Control point"), "dom_icon_blue-highlighted", '0 1 1', 1);
-REGISTER_WAYPOINT(DomRed, _("Control point"), "dom_icon_red-highlighted", '0 1 1', 1);
-REGISTER_WAYPOINT(DomBlue, _("Control point"), "dom_icon_blue-highlighted", '0 1 1', 1);
-REGISTER_WAYPOINT(DomYellow, _("Control point"), "dom_icon_yellow-highlighted", '0 1 1', 1);
-REGISTER_WAYPOINT(DomPink, _("Control point"), "dom_icon_pink-highlighted", '0 1 1', 1);
+REGISTER_WAYPOINT(DomNeut, _("Control point"), "waypoint_dom_team2", '0 1 1', 1);
+REGISTER_WAYPOINT(DomRed, _("Control point"), "waypoint_dom_team1", '0 1 1', 1);
+REGISTER_WAYPOINT(DomBlue, _("Control point"), "waypoint_dom_team2", '0 1 1', 1);
+REGISTER_WAYPOINT(DomYellow, _("Control point"), "waypoint_dom_team3", '0 1 1', 1);
+REGISTER_WAYPOINT(DomPink, _("Control point"), "waypoint_dom_team4", '0 1 1', 1);
-REGISTER_WAYPOINT(KeyDropped, _("Dropped key"), "kh_dropped", '0 1 1', 1);
+REGISTER_WAYPOINT(KeyDropped, _("Dropped key"), "waypoint_key_dropped", '0 1 1', 1);
REGISTER_WAYPOINT(KeyCarrierFriend, _("Key carrier"), "", '0 1 0', 1);
REGISTER_WAYPOINT(KeyCarrierFinish, _("Run here"), "", '0 1 1', 1);
-REGISTER_WAYPOINT(KeyCarrierRed, _("Key carrier"), "kh_red_carrying", '0 1 1', 1);
-REGISTER_WAYPOINT(KeyCarrierBlue, _("Key carrier"), "kh_blue_carrying", '0 1 1', 1);
-REGISTER_WAYPOINT(KeyCarrierYellow, _("Key carrier"), "kh_yellow_carrying", '0 1 1', 1);
-REGISTER_WAYPOINT(KeyCarrierPink, _("Key carrier"), "kh_pink_carrying", '0 1 1', 1);
+REGISTER_WAYPOINT(KeyCarrierRed, _("Key carrier"), "waypoint_key_carrying", '0 1 1', 1);
+REGISTER_WAYPOINT(KeyCarrierBlue, _("Key carrier"), "waypoint_key_carrying", '0 1 1', 1);
+REGISTER_WAYPOINT(KeyCarrierYellow, _("Key carrier"), "waypoint_key_carrying", '0 1 1', 1);
+REGISTER_WAYPOINT(KeyCarrierPink, _("Key carrier"), "waypoint_key_carrying", '0 1 1', 1);
-REGISTER_WAYPOINT(KaBall, _("Ball"), "notify_ballpickedup", '0 1 1', 1);
-REGISTER_WAYPOINT(KaBallCarrier, _("Ball carrier"), "keepawayball_carrying", '1 0 0', 1);
+REGISTER_WAYPOINT(KaBall, _("Ball"), "waypoint_ka_ball", '0 1 1', 1);
+REGISTER_WAYPOINT(KaBallCarrier, _("Ball carrier"), "waypoint_ka_ball_carrying", '1 0 0', 1);
REGISTER_WAYPOINT(NbBall, _("Ball"), "", '0.91 0.85 0.62', 1);
REGISTER_WAYPOINT(NbGoal, _("Goal"), "", '1 0.5 0', 1);
return "Spam"; // no need to translate this debug string
if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start");
if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).m_name;
- if (s == WP_Item.netname) return Items_from(this.wp_extra).m_waypoint;
+ if (s == WP_Item.netname) return Items_from(this.wp_extra).m_waypoint_text;
if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).monster_name;
if (MUTATOR_CALLHOOK(WP_Format, this, s))
{
string spritelookupicon(entity this, string s)
{
// TODO: needs icons! //if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start");
- if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).model2;
- if (s == WP_Item.netname) return Items_from(this.wp_extra).m_icon;
+ //if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).model2;
+ if (s == WP_Weapon.netname) return Weapons_from(this.wp_extra).m_waypoint_icon;
+ if (s == WP_Item.netname) return Items_from(this.wp_extra).m_waypoint_icon;
if (s == WP_Vehicle.netname) return Vehicles_from(this.wp_extra).m_icon;
//if (s == WP_Monster.netname) return get_monsterinfo(this.wp_extra).m_icon;
if (MUTATOR_CALLHOOK(WP_Format, this, s))
o.x += 0.5 * (w - sw);
- if (is_text)
- drawstring(o, str, sz, rgb, a, DRAWFLAG_NORMAL);
- else
- drawpic(o, str, sz, rgb, a, DRAWFLAG_NORMAL);
+ if (is_text)
+ {
+ drawstring(o, str, sz, rgb, a, DRAWFLAG_NORMAL);
+ }
+ else
+ {
+ drawpic(o, str, sz, rgb, a, DRAWFLAG_NORMAL);
+ // https://docs.gimp.org/en/gimp-tool-desaturate.html
+ //float gray = rgb.x * 0.21 + rgb.y * 0.72 + rgb.z * 0.07;
+ //drawpic(o, str, sz, '1 1 1', gray * a, DRAWFLAG_ADDITIVE);
+ }
o.x += 0.5 * sw;
o.y += 0.5 * h;
#define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s) PHYS_INPUT_BUTTON_BUTTON9(s)
#define PHYS_INPUT_BUTTON_JETPACK(s) PHYS_INPUT_BUTTON_BUTTON10(s)
#define PHYS_INPUT_BUTTON_DODGE(s) PHYS_INPUT_BUTTON_BUTTON11(s)
+#define PHYS_INPUT_BUTTON_SPRINT(s) PHYS_INPUT_BUTTON_BUTTON12(s)
#ifdef CSQC
STATIC_INIT(PHYS_INPUT_BUTTON)
{
+ localcmd("alias +sprint +button12\n");
+ localcmd("alias -sprint -button12\n");
+
localcmd("alias +hook +button6\n");
localcmd("alias -hook -button6\n");
REGISTER_STAT(DOM_PPS_YELLOW, float)
REGISTER_STAT(DOM_PPS_PINK, float)
+// gungame
+REGISTER_STAT(GUNGAME_LEADING_WEAPON, int)
+
// Lyberta: survival
REGISTER_STAT(SURV_ROUND_TIME, float)
REGISTER_STAT(SURV_DEFENDER_TEAM, int)
ATTRIB(Weapon, w_reticle, string, string_null);
/** M: wepimg : "weaponfoobar" side view image file of weapon. WEAPONTODO: Move out of skin files, move to common files */
ATTRIB(Weapon, model2, string, "");
+ /** M: waypoint icon name : "waypoint_weapon_foobar" Name of the weapon waypoint icon */
+ ATTRIB(Weapon, m_waypoint_icon, string, "");
/** M: refname : reference name name */
ATTRIB(Weapon, netname, string, "");
/** M: wepname : human readable name */
/* crosshair */ ATTRIB(Blaster, w_crosshair, string, "gfx/crosshairlaser");
/* crosshair */ ATTRIB(Blaster, w_crosshair_size, float, 0.5);
/* wepimg */ ATTRIB(Blaster, model2, string, "weaponlaser");
+/* wp_icon */ ATTRIB(Blaster, m_waypoint_icon, string, "waypoint_weapon_blaster");
/* refname */ ATTRIB(Blaster, netname, string, "blaster");
/* wepname */ ATTRIB(Blaster, m_name, string, _("Blaster"));
/* crosshair */ ATTRIB(Crylink, w_crosshair, string, "gfx/crosshaircrylink");
/* crosshair */ ATTRIB(Crylink, w_crosshair_size, float, 0.5);
/* wepimg */ ATTRIB(Crylink, model2, string, "weaponcrylink");
+/* wp_icon */ ATTRIB(Crylink, m_waypoint_icon, string, "waypoint_weapon_crylink");
/* refname */ ATTRIB(Crylink, netname, string, "crylink");
/* wepname */ ATTRIB(Crylink, m_name, string, _("Crylink"));
/* crosshair */ ATTRIB(Devastator, w_crosshair, string, "gfx/crosshairrocketlauncher");
/* crosshair */ ATTRIB(Devastator, w_crosshair_size, float, 0.7);
/* wepimg */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
+/* wp_icon */ ATTRIB(Devastator, m_waypoint_icon, string, "waypoint_weapon_devastator");
/* refname */ ATTRIB(Devastator, netname, string, "devastator");
/* wepname */ ATTRIB(Devastator, m_name, string, _("Devastator"));
/* crosshair */ ATTRIB(Electro, w_crosshair, string, "gfx/crosshairelectro");
/* crosshair */ ATTRIB(Electro, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(Electro, model2, string, "weaponelectro");
+/* wp_icon */ ATTRIB(Electro, m_waypoint_icon, string, "waypoint_weapon_electro");
/* refname */ ATTRIB(Electro, netname, string, "electro");
/* wepname */ ATTRIB(Electro, m_name, string, _("Electro"));
/* crosshair */ ATTRIB(Hagar, w_crosshair, string, "gfx/crosshairhagar");
/* crosshair */ ATTRIB(Hagar, w_crosshair_size, float, 0.8);
/* wepimg */ ATTRIB(Hagar, model2, string, "weaponhagar");
+/* wp_icon */ ATTRIB(Hagar, m_waypoint_icon, string, "waypoint_weapon_hagar");
/* refname */ ATTRIB(Hagar, netname, string, "hagar");
/* wepname */ ATTRIB(Hagar, m_name, string, _("Hagar"));
/* crosshair */ ATTRIB(MachineGun, w_crosshair, string, "gfx/crosshairuzi");
/* crosshair */ ATTRIB(MachineGun, w_crosshair_size, float, 0.6);
/* wepimg */ ATTRIB(MachineGun, model2, string, "weaponuzi");
+/* wp_icon */ ATTRIB(MachineGun, m_waypoint_icon, string, "waypoint_weapon_machinegun");
/* refname */ ATTRIB(MachineGun, netname, string, "machinegun");
/* wepname */ ATTRIB(MachineGun, m_name, string, _("MachineGun"));
/* crosshair */ ATTRIB(MineLayer, w_crosshair, string, "gfx/crosshairminelayer");
/* crosshair */ ATTRIB(MineLayer, w_crosshair_size, float, 0.9);
/* wepimg */ ATTRIB(MineLayer, model2, string, "weaponminelayer");
+/* wp_icon */ ATTRIB(MineLayer, m_waypoint_icon, string, "waypoint_weapon_minelayer");
/* refname */ ATTRIB(MineLayer, netname, string, "minelayer");
/* wepname */ ATTRIB(MineLayer, m_name, string, _("Mine Layer"));
/* crosshair */ ATTRIB(Mortar, w_crosshair, string, "gfx/crosshairgrenadelauncher");
/* crosshair */ ATTRIB(Mortar, w_crosshair_size, float, 0.7);
/* wepimg */ ATTRIB(Mortar, model2, string, "weapongrenadelauncher");
+/* wp_icon */ ATTRIB(Mortar, m_waypoint_icon, string, "waypoint_weapon_mortar");
/* refname */ ATTRIB(Mortar, netname, string, "mortar");
/* wepname */ ATTRIB(Mortar, m_name, string, _("Mortar"));
/* crosshair */ ATTRIB(Shotgun, w_crosshair, string, "gfx/crosshairshotgun");
/* crosshair */ ATTRIB(Shotgun, w_crosshair_size, float, 0.65);
/* wepimg */ ATTRIB(Shotgun, model2, string, "weaponshotgun");
+/* wp_icon */ ATTRIB(Shotgun, m_waypoint_icon, string, "waypoint_weapon_shotgun");
/* refname */ ATTRIB(Shotgun, netname, string, "shotgun");
/* wepname */ ATTRIB(Shotgun, m_name, string, _("Shotgun"));
/* crosshair */ ATTRIB(Vortex, w_crosshair_size, float, 0.65);
/* reticle */ ATTRIB(Vortex, w_reticle, string, "gfx/reticle_nex");
/* wepimg */ ATTRIB(Vortex, model2, string, "weaponnex");
+/* wp_icon */ ATTRIB(Vortex, m_waypoint_icon, string, "waypoint_weapon_vortex");
/* refname */ ATTRIB(Vortex, netname, string, "vortex");
/* wepname */ ATTRIB(Vortex, m_name, string, _("Vortex"));
KEYBIND_DEF("+moveright" , _("strafe right"));
KEYBIND_DEF("+jump" , _("jump / swim"));
KEYBIND_DEF("+crouch" , _("crouch / sink"));
+ KEYBIND_DEF("+sprint" , _("sprint"));
KEYBIND_DEF("+hook" , _("off-hand hook"));
KEYBIND_DEF("+jetpack" , _("jetpack"));
KEYBIND_DEF("" , "");
GAMETYPE(MAPINFO_TYPE_NEXBALL) \
GAMETYPE(MAPINFO_TYPE_ONSLAUGHT) \
GAMETYPE(MAPINFO_TYPE_ASSAULT) \
+ GAMETYPE(MAPINFO_TYPE_GUNGAME) \
GAMETYPE(MAPINFO_TYPE_SURVIVAL) \
/* GAMETYPE(MAPINFO_TYPE_INVASION) */ \
/**/
BADCVAR("g_domination_default_teams");
BADCVAR("g_freezetag");
BADCVAR("g_freezetag_teams");
+ BADCVAR("g_gg");
BADCVAR("g_invasion_teams");
BADCVAR("g_invasion_type");
BADCVAR("g_jailbreak");
--- /dev/null
+// Random items mutator config for GunGame gamemode
+
+// Map items
+
+set g_random_items_health_probability 10 "Probability of random health items spawning in the map."
+set g_random_items_armor_probability 10 "Probability of random armor items spawning in the map."
+set g_random_items_resource_probability 0 "Probability of random resource items spawning in the map."
+set g_random_items_weapon_probability 0 "Probability of random weapons spawning in the map."
+set g_random_items_powerup_probability 1 "Probability of random powerups spawning in the map."
+set g_random_items_item_health_small_probability 10 "Probability of random small health spawning in the map."
+set g_random_items_item_health_medium_probability 4 "Probability of random medium health spawning in the map."
+set g_random_items_item_health_big_probability 2 "Probability of random big health spawning in the map."
+set g_random_items_item_health_mega_probability 1 "Probability of random mega health spawning in the map."
+set g_random_items_item_armor_small_probability 10 "Probability of random small armor spawning in the map."
+set g_random_items_item_armor_medium_probability 4 "Probability of random medium armor spawning in the map."
+set g_random_items_item_armor_big_probability 2 "Probability of random big armor spawning in the map."
+set g_random_items_item_armor_mega_probability 1 "Probability of random mega armor spawning in the map."
+set g_random_items_item_strength_probability 1 "Probability of random strength spawning in the map."
+set g_random_items_item_shield_probability 1 "Probability of random shield spawning in the map."
+set g_random_items_item_fuel_regen_probability 0 "Probability of random fuel regeneration spawning in the map."
+set g_random_items_item_jetpack_probability 0 "Probability of random jetpack spawning in the map."
+
+// Loot
+
+set g_random_loot_min 0 "Minimum amount of loot items."
+set g_random_loot_max 4 "Maximum amount of loot items."
+set g_random_loot_time 10 "Amount of time the loot will stay in seconds."
+set g_random_loot_spread 200 "How far can loot be thrown."
+set g_random_loot_health_probability 8 "Probability of random health items spawning as loot."
+set g_random_loot_armor_probability 8 "Probability of random armor items spawning as loot."
+set g_random_loot_resource_probability 0 "Probability of random ammo items spawning as loot."
+set g_random_loot_weapon_probability 0 "Probability of random weapons spawning as loot."
+set g_random_loot_powerup_probability 1 "Probability of random powerups spawning as loot."
+set g_random_loot_item_health_small_probability 4 "Probability of random small health spawning as loot."
+set g_random_loot_item_health_medium_probability 3 "Probability of random medium health spawning as loot."
+set g_random_loot_item_health_big_probability 2 "Probability of random big health spawning as loot."
+set g_random_loot_item_health_mega_probability 1 "Probability of random mega health spawning as loot."
+set g_random_loot_item_armor_small_probability 4 "Probability of random small armor spawning as loot."
+set g_random_loot_item_armor_medium_probability 3 "Probability of random medium armor spawning as loot."
+set g_random_loot_item_armor_big_probability 2 "Probability of random big armor spawning as loot."
+set g_random_loot_item_armor_mega_probability 1 "Probability of random mega armor spawning as loot."
+set g_random_loot_item_strength_probability 1 "Probability of random strength spawning as loot."
+set g_random_loot_item_shield_probability 1 "Probability of random shield spawning as loot."
+set g_random_loot_item_fuel_regen_probability 0 "Probability of random fuel regeneration spawning as loot."
+set g_random_loot_item_jetpack_probability 0 "Probability of random jetpack spawning as loot."