set g_mh_not_dm_maps 0 "when this is set, DM maps will NOT be listed in MH"
set g_mh_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
set g_mh_point_limit -1 "MH point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
-set g_mh_warmup 1 //10 "time players get to run around before the round starts"
+set g_mh_warmup 10 //10 "time players get to run around before the round starts"
set g_mh_round_timelimit 60 //180 "round time limit in seconds"
+set g_mh_how_many_rounds_before_shuffle 1 "how many rounds are played before teams are shuffled automatically"
+set g_mh_enable_tagging_on_touch 1 "are runners killed when touching hunters?"
+set g_mh_player_waypoints 1 "0: no waypoints, 1: waypoints on runners, 2: waypoints on everyone"
set g_mh_weaponarena " " "starting weapons - takes the same options as g_weaponarena"
+set g_mh_unlimited_ammunition 0 "do players consume ammunition when firing"
.vector taggedplayervelocity;
.vector taggedplayerviewangles;
-
MUTATOR_HOOKFUNCTION(mh, TeamBalance_CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
{
M_ARGV(1, string) = "mh_team";
{
entity player = M_ARGV(0, entity);
- if(player.team == Team_IndexToTeam(1) && !game_stopped && !IS_DEAD(player) && IS_PLAYER(player) && !IS_INDEPENDENT_PLAYER(player))
+ if(autocvar_g_mh_enable_tagging_on_touch && round_handler_IsRoundStarted() && player.team == Team_IndexToTeam(1) && !game_stopped && !IS_DEAD(player) && IS_PLAYER(player) && !IS_INDEPENDENT_PLAYER(player))
{
FOREACH_CLIENT(IS_PLAYER(it) && it != player && it.team == Team_IndexToTeam(2), {
if(!IS_DEAD(it) && !IS_INDEPENDENT_PLAYER(it))
float armor = GetResource(it, RES_ARMOR);
float max_dmg;
if(autocvar_g_balance_armor_blockpercent == 1){
- max_dmg = health + armor; //skip handling (1 - autocvar_g_balance_armor_blockpercent) in case of value of 1 as it leads to divide by 0
+ max_dmg = health + armor; //skip handling (1 - autocvar_g_balance_armor_blockpercent) in case of cvar value of 1 as it leads to divide by 0
} else {
max_dmg = health + bound(0, armor, ((health / (1 - autocvar_g_balance_armor_blockpercent))- health));
}
// mh_LastPlayerForTeam y y
// mh_LastPlayerForTeam_Notify y y
-// PlayerDies add tp y
+// PlayerDies y y
// ClientDisconnect y y
// HideTeamNagger y y
-// PlayerSpawn add tp y
+// PlayerSpawn y y
// PutClientInServer y y
// MH_count_alive_players y y
// MH_GetWinnerTeam y y
game_stopped = true;
round_handler_Init(5, autocvar_g_mh_warmup, autocvar_g_mh_round_timelimit);
- //if(pymod(round_counter_for_teamchanging, 2))
- // shuffleteams_on_reset_map = !allowed_to_spawn_untagged; //only shuffle every other round
- //++round_counter_for_teamchanging;
+ if(pymod(round_counter_for_teamchanging, autocvar_g_mh_how_many_rounds_before_shuffle) || autocvar_g_mh_how_many_rounds_before_shuffle == 1)
+ shuffleteams_on_reset_map = !allowed_to_spawn_untagged;
+ ++round_counter_for_teamchanging;
//FOREACH_CLIENT(IS_PLAYER(it), { CS(it).killcount = 0; nades_Clear(it); }); //hopefully "{ CS(it).killcount = 0; nades_Clear(it); }" works and doesn't cut off nades_Clear, untested
FOREACH_CLIENT(IS_PLAYER(it), { nades_Clear(it); }); //hopefully "{ CS(it).killcount = 0; nades_Clear(it); }" works and doesn't cut off nades_Clear, untested
{
entity player = M_ARGV(0, entity);
- if (!allowed_to_spawn_untagged && IS_PLAYER(player)){ // this is true even when player is trying to join
+ if (!allowed_to_spawn_untagged && IS_PLAYER(player) && round_handler_IsRoundStarted()){ // this can be true even when player is trying to join
if (CS(player).jointime != time){ // not when connecting
Send_Notification(NOTIF_ONE_ONLY, player, MSG_INFO, INFO_MH_JOIN_LATE);
}
return true;
}
-
-
-// ===========
-// to change
-// ===========
-
-MUTATOR_HOOKFUNCTION(mh, reset_map_players)
-{
- FOREACH_CLIENT(true, {
- CS(it).killcount = 0;
- TRANSMUTE(Player, it);
- }
- );
- return true;
-}
-
-// Maybe add player teleporting to where they died if they just got tagged?
-
// Function:
// PlayerSpawn
// Purpose in CA:
MUTATOR_HOOKFUNCTION(mh, PlayerSpawn)
{
entity player = M_ARGV(0, entity);
+ player.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP;
MH_count_alive_players();
if(player.team == Team_IndexToTeam(2) && !allowed_to_spawn_untagged && Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2)) > 1 && round_handler_IsActive() && round_handler_IsRoundStarted()){
player.deadflag = 1; // avoid a crash when a spectator joins runners mid-round and gets sent to hunters
player.angles = player.taggedplayerviewangles;
}
}
+
+//reset kill streaks and respawn players on round reset
+MUTATOR_HOOKFUNCTION(mh, reset_map_players)
+{
+ FOREACH_CLIENT(true, {
+ CS(it).killcount = 0;
+ PutClientInServer(it);
+ }
+ );
+ return true;
+}
+
+// ===========
+// to change
+// ===========
+
+
+
+//idk if this function is needed
+MUTATOR_HOOKFUNCTION(mh, reset_map_global)
+{
+ return true;
+}
\ No newline at end of file