示例#1
0
static
void
start_rabbit_game(CORE_DATA *cd, PLAYER *p, int bty, int special)
{
	/* store rabbit's pid in user data */
	ud(cd)->rabbit_pid = p->pid;

	/* announce the game to the arena */
	ArenaMessageFmt("%s is now the rabbit!", p->name);
	ArenaMessageFmt("%s is now the rabbit!", p->name);
	ArenaMessageFmt("%s is now the rabbit!", p->name);

	/* announce the game to the player */
	PrivMessageFmt(p, "You are now the rabbit! The game will end if you enter safe!");

	/* prize the bounty/special */
	PrivMessageFmt(p, "*prize %d", bty);
	if (special)
		PrivMessageFmt(p, "*prize #%d", special);

	/*
	 * send *where to get rabbits location and set the bot to parse messages looking
	 * for the response
	 */
	PrivMessage(p, "*where");
	ud(cd)->expecting_where = 1;

	/* set the timer for the next *where to be sent */
	ud(cd)->where_timer = SetTimer(SPAM_INTERVAL_MS, 0, 0);

	/* set the timer that signifies the game's end */
	ud(cd)->gameover_timer = SetTimer(GAME_LENGTH_MS, 0, 0);
}
示例#2
0
void
SendPlayer(PLAYER *p, const char *arena)
{
	THREAD_DATA *td = get_thread_data();
	
	if (p->here) PrivMessageFmt(p, "*sendto %s,%s,%.15s", td->net->serverip, td->net->serverport, td->arena ? arena : "");
}
示例#3
0
文件: chess.cpp 项目: cycad/opencore
static
void
LvzActivate(USER_DATA *ud, PLAYER *p, COLOR c, TYPE t, int x, int y, bool show)
{
	uint32_t objid = LvzGetObjId(c, t, x, y);

	if (show) {
		if (p) {
			PrivMessageFmt(p, "*objon %u", objid);
		} else {
			PubMessageFmt("*objon %u", objid);
		}
	} else {
		if (p) {
			PrivMessageFmt(p, "*objoff %u", objid);
		} else {
			PubMessageFmt("*objoff %u", objid);
		}
	}
}
示例#4
0
文件: chess.cpp 项目: cycad/opencore
/*
 * Display the LVZ that shows whos turn it is.
 */
static
void
LvzToMove(COLOR c, PLAYER *p)
{
	if (c == COLOR_WHITE) {
		if (p) {
			PrivMessageFmt(p, "*objon 7");
			PrivMessageFmt(p, "*objoff 8");
		} else {
			PubMessageFmt("*objon 7");
			PubMessageFmt("*objoff 8");
		}
	} else if (c == COLOR_BLACK) {
		if (p) {
			PrivMessageFmt(p, "*objon 8");
			PrivMessageFmt(p, "*objoof 7");

		} else {
			PubMessageFmt("*objon 8");
			PubMessageFmt("*objoff 7");
		}

	} else {
		if (p) {
			PrivMessageFmt(p, "*objoff 7");
			PrivMessageFmt(p, "*objoff 8");

		} else {
			PubMessageFmt("*objoff 7");
			PubMessageFmt("*objoff 8");

		}
	}
}