Пример #1
0
/*
=================
CheckDMRules
=================
*/
void CheckDMRules(void)
{
	if (level.intermissiontime || !deathmatch->value)
		return;

	if (timelimit->value && level.time >= timelimit->value * 60)
	{
		safe_bprintf(PRINT_HIGH, "Timelimit hit.\n");
		EndDMLevel();
		return;
	}

	if (fraglimit->value)
	{
		for (int i = 0; i < maxclients->value; i++)
		{
			gclient_t *cl = game.clients + i;
			if (!g_edicts[i + 1].inuse)
				continue;

			if (cl->resp.score >= fraglimit->value)
			{
				safe_bprintf(PRINT_HIGH, "Fraglimit hit.\n");
				EndDMLevel();
				return;
			}
		}
	}
}
Пример #2
0
Файл: g_main.c Проект: ZwS/qudos
/*
=================
CheckDMRules
=================
*/
void CheckDMRules (void)
{
	int			i;
	gclient_t	*cl;

	if (level.intermissiontime)
		return;

	if (!deathmatch->value)
		return;

//=======
//ROGUE
	if (gamerules && gamerules->value && DMGame.CheckDMRules)
	{
		if(DMGame.CheckDMRules())
			return;
	}
//ROGUE
//=======

	if (timelimit->value)
	{
		if (level.time >= timelimit->value*60)
		{
#ifdef WITH_ACEBOT
		safe_bprintf 
#else
		gi.bprintf
#endif
			 (PRINT_HIGH, "Timelimit hit.\n");
			EndDMLevel ();
			return;
		}
	}

	if (fraglimit->value)
	{
		for (i=0 ; i<maxclients->value ; i++)
		{
			cl = game.clients + i;
			if (!g_edicts[i+1].inuse)
				continue;

			if (cl->resp.score >= fraglimit->value)
			{
#ifdef WITH_ACEBOT
		safe_bprintf 
#else
		gi.bprintf
#endif
				 (PRINT_HIGH, "Fraglimit hit.\n");
				EndDMLevel ();
				return;
			}
		}
	}
}
Пример #3
0
/*
=================
CheckDMRules
=================
*/
void CheckDMRules (void)
{
	int			i;
	gclient_t	*cl;

	if (level.intermissiontime)
		return;

	if (!deathmatch->value)
		return;

//ZOID
	if (ctf->value && CTFCheckRules()) {
		EndDMLevel ();
		return;
	}
	if (CTFInMatch())
		return; // no checking in match mode
//ZOID

	if (timelimit->value)
	{
		if (level.time >= timelimit->value*60)
		{
			gi.bprintf (PRINT_HIGH, "Timelimit hit.\n");
			EndDMLevel ();
			return;
		}
	}

	if (fraglimit->value)
		for (i=0 ; i<maxclients->value ; i++)
		{
			cl = game.clients + i;
			if (!g_edicts[i+1].inuse)
				continue;

			if (cl->resp.score >= fraglimit->value)
			{
				gi.bprintf (PRINT_HIGH, "Fraglimit hit.\n");
				EndDMLevel ();
				return;
			}
		}
}
Пример #4
0
/*
=================
CheckDMRules
=================
*/
void CheckDMRules ()
{
	if (Level.Intermission.Time)
		return;

	if (!(Game.GameMode & GAME_DEATHMATCH))
		return;

#if CLEANCTF_ENABLED
//ZOID
	if ((Game.GameMode & GAME_CTF) && CTFCheckRules())
	{
		EndDMLevel ();
		return;
	}
//ZOID
#endif

	if (CvarList[CV_TIME_LIMIT].Float())
	{
		if (Level.Frame >= ((CvarList[CV_TIME_LIMIT].Float()*60)*10))
		{
			BroadcastPrint (PRINT_HIGH, "Timelimit hit.\n");
			EndDMLevel ();
			return;
		}
	}

	if (CvarList[CV_FRAG_LIMIT].Integer())
	{
		for (uint8 i = 0; i < Game.MaxClients; i++)
		{
			CPlayerEntity *cl = entity_cast<CPlayerEntity>(Game.Entities[i+1].Entity);
			if (!cl->GetInUse())
				continue;

			if (cl->Client.Respawn.Score >= CvarList[CV_FRAG_LIMIT].Integer())
			{
				BroadcastPrint (PRINT_HIGH, "Fraglimit hit.\n");
				EndDMLevel ();
				return;
			}
		}
	}
}
Пример #5
0
void CheckDMRules(void)
{
  int i;
  gclient_t *cl;

  if (level.intermissiontime) {
    return;
  }

  if (!deathmatch->value) {
    return;
  }

  if (timelimit->value) {
    if (level.time >= timelimit->value * 60) {
      SV_BroadcastPrintf(PRINT_HIGH, "Timelimit hit.\n");
      EndDMLevel();
      return;
    }
  }

  if (fraglimit->value) {
    for (i = 0; i < maxclients->value; i++) {
      cl = game.clients + i;

      if (!g_edicts[i + 1].inuse) {
        continue;
      }

      if (cl->resp.score >= fraglimit->value) {
        SV_BroadcastPrintf(PRINT_HIGH, "Fraglimit hit.\n");
        EndDMLevel();
        return;
      }
    }
  }
}
Пример #6
0
int DBall_CheckDMRules (void)
{
	if(goallimit && goallimit->value)
	{
		if(dball_team1_goalscore >= goallimit->value)
			gi.bprintf (PRINT_HIGH, "Team 1 Wins.\n");
		else if(dball_team2_goalscore >= goallimit->value)
			gi.bprintf (PRINT_HIGH, "Team 2 Wins.\n");
		else
			return 0;

		EndDMLevel ();
		return 1;
	}

	return 0;
}
Пример #7
0
void INV_RemoveFromSpawnlist(edict_t *self)
{
	int i;
	for (i = 0; i < 32; i++)
		if (INV_PlayerSpawns[i] == self)
		{
			INV_PlayerSpawns[i] = NULL;
			invasion_spawncount--;

			if (invasion_spawncount == 0)
			{
				gi.bprintf(PRINT_HIGH, "Humans were unable to stop the invasion. Game over.\n");
				EndDMLevel();
				return;
			}
		}
}
Пример #8
0
void RunVotes ()
{
	if (voteTimeLeft == -1)
		return;

	if (voteTimeLeft == level.time+60.0f)
		gi.bprintf (PRINT_CHAT, "One minute left to place your vote.\n");
	else if (voteTimeLeft == level.time+30.0f)
		gi.bprintf (PRINT_CHAT, "Thirty seconds left to place your vote.\n");
	else if (voteTimeLeft == level.time+10)
		gi.bprintf (PRINT_CHAT, "Ten seconds left to place your vote.\n");
	else if (voteTimeLeft == level.time)
	{
		// Finish vote
		// Did we reach a majority?
		if (V_VoteDone())
		{
			// Tell everyone
			gi.bprintf (PRINT_CHAT, "A majority was reached!\nVote passed!\n");
			voteTimeLeft = -1;
			//Change the map
			EndDMLevel();
		}
		else
		{
			edict_t *e;
			int i;

			gi.bprintf (PRINT_CHAT, "Vote failed.\n");
			numVotes = 0;
			voteTimeLeft = 0;
			memset (&currentVote, 0, sizeof(currentVote));
			
			for_each_player(e, i)
			{
				e->client->resp.HasVoted = false;
			}

			voter->client->resp.VoteTimeout = level.time + 20;
			voter = NULL;
		}
	}
	else
	{	
		if (V_VoteDone() == CHANGE_NOW)
Пример #9
0
void	ServerCommand (void)
{
	char	*cmd;

	cmd = gi.argv(1);
	if (Q_stricmp (cmd, "test") == 0)
		Svcmd_Test_f ();
	else if (Q_stricmp(cmd, "addbots") == 0)
		Svcmd_addbots_f();
	else if (Q_stricmp(cmd, "killbot") == 0)
		Svcmd_killbot_f(gi.argv(2));
	else if (Q_stricmp(cmd, "nextmap") == 0)
		Svcmd_nextmap_f();
	else if (Q_stricmp(cmd, "ml") == 0)
	{
		if (Q_stricmp(gi.argv(2), "0") == 0)	//maprotation off
		{
			ClearMaplist();
			maplist.mlflag = 0; //off
			gi.cprintf (NULL, PRINT_HIGH, "Map rotation OFF!\n\n");
		}
		else if (Q_stricmp(gi.argv(2), "1") == 0)	//start sequential rotation
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				maplist.mlflag = 1; //sequential
				maplist.currentmap = -1;
				gi.cprintf (NULL, PRINT_HIGH, "Sequential map rotation ON!\n\n");
                EndDMLevel();
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "You have to load a maplist first!\n\n");
			
		}
		else if (Q_stricmp(gi.argv(2), "2") == 0)	//start random rotation
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				maplist.mlflag = 2; //random
				maplist.currentmap = -1;
				gi.cprintf (NULL, PRINT_HIGH, "Random map rotation ON!\n\n");
                EndDMLevel();
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "You have to load a maplist first!\n\n");
		}
		/*else if (Q_stricmp(gi.argv(2), "goto") == 0)	//jump to map X in list
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				if (maplist.mlflag > 0)
				{
					int num = atoi(gi.argv(3));

					if (num < maplist.nummaps)
					{
						maplist.currentmap = num;
						gi.cprintf (NULL, PRINT_HIGH, "Current map is %d!\n\n", num);
						EndDMLevel();
					}
					else
						gi.cprintf (NULL, PRINT_HIGH, "Map number %d not found!\n\n", num);
				}
				else
					gi.cprintf (NULL, PRINT_HIGH, "You have to start the maprotation with <sv ml 1 or 2> first!\n\n");
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "You have to load a maplist first!\n\n");
			
		}*/
		else if (Q_stricmp(gi.argv(2), "") == 0)	//print maplist
		{
			if (maplist.nummaps > 0)  // does a maplist exist? 
			{
				int i;

				gi.cprintf(NULL, PRINT_HIGH, "Current maplist:\n");
				
				for (i = 0;i < maplist.nummaps;i++)
				{ 
					gi.cprintf(NULL, PRINT_HIGH, "...%s,ctf=%c,lightsoff=%c\n", maplist.mapnames[i], maplist.ctf[i], maplist.lightsoff[i]);
				}
				gi.cprintf(NULL, PRINT_HIGH, "\n");
			}
            else 
                 gi.cprintf (NULL, PRINT_HIGH, "Load a maplist with <sv ml maplistname>!\n\n");
			
		}
		else	//load maplist
		{
			ClearMaplist();
			LoadMaplist(gi.argv(2));
		}
	}
	else
		gi.cprintf (NULL, PRINT_HIGH, "Unknown server command \"%s\"\n", cmd);
}
Пример #10
0
void Svcmd_nextmap_f()

{
  bprintf2 (PRINT_HIGH, "Advancing to next level.\n");  
  EndDMLevel();
 }