当前位置: 首页>>代码示例>>C++>>正文


C++ setInfoBoxMessage函数代码示例

本文整理汇总了C++中setInfoBoxMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ setInfoBoxMessage函数的具体用法?C++ setInfoBoxMessage怎么用?C++ setInfoBoxMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setInfoBoxMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: activate

static void activate(int val)
{
	if (strlen(self->requires) != 0)
	{
		if (removeInventoryItemByObjectiveName(self->requires) == TRUE)
		{
			self->requires[0] = '\0';

			setEntityAnimation(self, "WALK");
		}

		else
		{
			setInfoBoxMessage(90, 255, 255, 255, _("%s is required"), _(self->requires));

			return;
		}
	}

	generateInputCode();

	self->mental = 0;

	self->thinkTime = 120;

	setInfoBoxMessage(300, 255, 255, 255, _("Repeat the sequence"));

	self->action = &displayInputCode;

	self->touch = NULL;

	self->activate = NULL;

	setPlayerLocked(TRUE);
}
开发者ID:LibreGames,项目名称:edgar,代码行数:35,代码来源:code_door.c

示例2: addRequiredToInventory

void addRequiredToInventory(Entity *other)
{
	Entity *item;

	if (!(self->flags & INVULNERABLE) && other->type == PLAYER)
	{
		item = getInventoryItemByObjectiveName(self->requires);

		if (item != NULL)
		{
			item->health++;

			self->inUse = FALSE;

			setInfoBoxMessage(60, 255, 255, 255, _("Picked up %s"), _(self->objectiveName));

			fireTrigger(self->objectiveName);

			fireGlobalTrigger(self->objectiveName);
		}

		else
		{
			setInfoBoxMessage(60, 255, 255, 255, _("%s is required to carry this item"), _(self->requires));
		}
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:27,代码来源:inventory.c

示例3: activate

static void activate(int val)
{
	Entity *e = getInventoryItemByObjectiveName(self->requires);

	if (e == NULL)
	{
		setInfoBoxMessage(60, 255, 255, 255, _("%s is required"), _(self->requires));
	}

	else
	{
		self->mental = 0;

		setInfoBoxMessage(300, 255, 255, 255, _("Enter the directions"));

		self->target->requires[0] = '\0';

		self->action = &readInputCode;

		self->touch = NULL;

		self->activate = NULL;

		setPlayerLocked(TRUE);
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:26,代码来源:instruction_machine.c

示例4: activate

static void activate(int val)
{
	if (self->active == FALSE)
	{
		if (removeInventoryItemByObjectiveName(self->requires) == TRUE)
		{
			self->active = TRUE;

			self->thinkTime = 60;

			fireTrigger(self->objectiveName);

			fireGlobalTrigger(self->objectiveName);

			setEntityAnimation(self, "WALK");

			self->action = &sink;

			setInfoBoxMessage(60, 255, 255, 255, _("Used %s"), _(self->requires));
		}

		else
		{
			setInfoBoxMessage(60, 255, 255, 255, _("%s is required"), _(self->requires));
		}
	}
}
开发者ID:polluks,项目名称:edgar,代码行数:27,代码来源:gazer_eye_slot.c

示例5: touch

static void touch(Entity *other)
{
	pushEntity(other);

	if (self->type == MANUAL_DOOR)
	{
		if (other->type == PLAYER && self->active == FALSE)
		{
			/* Look through the player's inventory */

			if (removeInventoryItemByObjectiveName(self->requires) == TRUE)
			{
				setInfoBoxMessage(60, 255, 255, 255, _("Used %s"), _(self->requires));

				self->action = &moveToTarget;

				self->active = TRUE;
			}

			else
			{
				setInfoBoxMessage(60, 255, 255, 255, _("%s is needed to open this door"), _(self->requires));
			}
		}
	}

	else if (other->type == PLAYER && self->active == FALSE && self->mental == 0)
	{
		setInfoBoxMessage(60, 255, 255, 255, _("This door is locked"));
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:31,代码来源:door.c

示例6: takeDamage

static void takeDamage(Entity *other, int damage)
{
	Entity *temp;

	if (!(self->flags & INVULNERABLE))
	{
		if (strcmpignorecase(other->name, "weapon/wood_axe") == 0)
		{
			playSoundToMap("sound/item/chop", -1, self->x, self->y, 0);

			self->health -= damage;

			if (self->health > 0)
			{
				setCustomAction(self, &flashWhite, 6, 0, 0);
			}

			else
			{
				if (self->mental > 0)
				{
					self->health = self->maxHealth;

					self->mental--;
				}

				else
				{
					setInfoBoxMessage(60, 255, 255, 255, _("It's out of apples..."));
				}
			}
		}

		else
		{
			playSoundToMap("sound/common/dink", -1, self->x, self->y, 0);

			if (other->reactToBlock != NULL)
			{
				temp = self;

				self = other;

				self->reactToBlock(temp);

				self = temp;
			}

			damage = 0;

			if (other->type != PROJECTILE && prand() % 10 == 0)
			{
				setInfoBoxMessage(60, 255, 255, 255, _("This weapon is not having any effect..."));
			}
		}

		setCustomAction(self, &invulnerableNoFlash, HIT_INVULNERABLE_TIME, 0, 0);
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:59,代码来源:apple_tree.c

示例7: touch

static void touch(Entity *other)
{
	if (self->active == TRUE)
	{
		if (self->target != NULL)
		{
			setInfoBoxMessage(0, 255, 255, 255, _("Press Action to retrieve %s"), self->target->objectiveName);
		}

		else
		{
			setInfoBoxMessage(0, 255, 255, 255, _("Press Action to interact"));
		}
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:15,代码来源:pedestal.c

示例8: touch

static void touch(Entity *other)
{
	Entity *temp;

	if (other->type == PLAYER && self->health > 0)
	{
		setInfoBoxMessage(0, 255, 255, 255, _("Press Action to retrieve the Purple Gem"));
	}

	else if (other->type == WEAPON && (other->flags & ATTACKING))
	{
		if (self->takeDamage != NULL && !(self->flags & INVULNERABLE))
		{
			self->takeDamage(other, other->damage);
		}
	}

	else if (other->type == PROJECTILE && other->parent != self)
	{
		if (self->takeDamage != NULL && !(self->flags & INVULNERABLE))
		{
			self->takeDamage(other, other->damage);
		}

		temp = self;

		self = other;

		self->die();

		self = temp;
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:33,代码来源:containment_unit_controls.c

示例9: touch

static void touch(Entity *other)
{
	if (self->damage == 1 && self->mental == 0 && self->thinkTime == 0)
	{
		setInfoBoxMessage(0, 255, 255, 255, _("Press Action to reprogram the Soul Merger"));
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:7,代码来源:soul_merger_control_panel.c

示例10: bucketTouch

static void bucketTouch(Entity *other)
{
	if (other->type == PLAYER)
	{
		setInfoBoxMessage(0, 255, 255, 255, _("Press Action to interact"));
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:7,代码来源:catapult.c

示例11: touch

static void touch(Entity *other)
{
	if (other->type == PLAYER && game.showHints == TRUE)
	{
		setInfoBoxMessage(0, 255, 255, 255, _("Press Action to talk to %s"), _(self->objectiveName));
	}
}
开发者ID:polluks,项目名称:edgar,代码行数:7,代码来源:npc.c

示例12: takeDamage

static void takeDamage(Entity *other, int damage)
{
	Entity *temp;

	setCustomAction(self, &invulnerableNoFlash, HIT_INVULNERABLE_TIME, 0, 0);

	playSoundToMap("sound/common/dink", -1, self->x, self->y, 0);

	if (other->reactToBlock != NULL)
	{
		temp = self;

		self = other;

		self->reactToBlock(temp);

		self = temp;
	}

	if (other->type != PROJECTILE && prand() % 10 == 0)
	{
		setInfoBoxMessage(60, 255, 255, 255, _("This weapon is not having any effect..."));
	}

	damage = 0;
}
开发者ID:LibreGames,项目名称:edgar,代码行数:26,代码来源:glass_wall.c

示例13: lookForPlayer

static void lookForPlayer()
{
	int frame;
	float timer;

	if (self->active == TRUE)
	{
		self->flags &= ~NO_DRAW;

		moveLeftToRight();

		if (self->currentFrame == 3)
		{
			if (self->health == 0)
			{
				playSoundToMap("sound/enemy/gazer/flap", -1, self->x, self->y, 0);

				self->health = 1;
			}
		}

		else
		{
			self->health = 0;
		}

		if (player.health > 0 && player.alpha == 255 && collision(self->x + self->w / 2 - 10, self->y, 20, self->endY, player.x, player.y, player.w, player.h) == 1)
		{
			playSoundToMap("sound/enemy/gazer/growl", -1, self->x, self->y, 0);

			setInfoBoxMessage(120, 255, 255, 255, _("INTRUDER!"));

			self->thinkTime = 300;

			activateEntitiesWithRequiredName(self->objectiveName, FALSE);

			if (self->mental == 1)
			{
				summonEnemies();
			}

			frame = self->currentFrame;
			timer = self->frameTimer;

			setEntityAnimation(self, "ATTACK_1");

			self->currentFrame = frame;
			self->frameTimer = timer;

			self->target = &player;

			self->action = &followPlayer;
		}
	}

	else
	{
		self->flags |= NO_DRAW;
	}
}
开发者ID:LibreGames,项目名称:edgar,代码行数:60,代码来源:scanner.c

示例14: scriptAddToInventory

void scriptAddToInventory(char *name, int quiet)
{
	int i;
	Entity *e;

	e = addPermanentItem(name, 0, 0);

	for (i=0;i<MAX_INVENTORY_ITEMS;i++)
	{
		if (inventory.item[i].inUse == FALSE)
		{
			inventory.item[i] = *e;

			inventory.item[i].face = RIGHT;

			inventory.item[i].thinkTime = 0;

			setEntityAnimationByID(&inventory.item[i], 0);

			if (quiet == FALSE)
			{
				setInfoBoxMessage(60, 255, 255, 255, _("Picked up %s"), _(inventory.item[i].objectiveName));
			}

			break;
		}
	}

	e->inUse = FALSE;
}
开发者ID:LibreGames,项目名称:edgar,代码行数:30,代码来源:inventory.c

示例15: activate

static void activate(int val)
{
	if (self->active == TRUE)
	{
		if (self->health == 0)
		{
			runScript("puzzle_pieces");
		}

		if (self->health == 1)
		{
			if (self->target->mental == 0)
			{
				self->target->mental = -2;
			}

			self->mental = 0;

			setInfoBoxMessage(300, 255, 255, 255, _("Solve the jigsaw puzzle"));

			self->target->requires[0] = '\0';

			self->action = &readInputCode;

			self->touch = NULL;

			self->activate = NULL;

			setPlayerLocked(TRUE);
		}
	}
}
开发者ID:revcozmo,项目名称:edgar,代码行数:32,代码来源:jigsaw_puzzle.c


注:本文中的setInfoBoxMessage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。