本文整理汇总了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);
}
示例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));
}
}
}
示例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);
}
}
示例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));
}
}
}
示例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"));
}
}
示例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);
}
}
示例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"));
}
}
}
示例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;
}
}
示例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"));
}
}
示例10: bucketTouch
static void bucketTouch(Entity *other)
{
if (other->type == PLAYER)
{
setInfoBoxMessage(0, 255, 255, 255, _("Press Action to interact"));
}
}
示例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));
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
}
}