Exemple #1
0
static void trap(Entity *other)
{
	int x;

	if (other->type == PLAYER)
	{
		x = self->x;

		x += other->face == RIGHT ? -other->w : self->w;

		setCheckpoint(x, other->y);

		other->flags |= NO_DRAW;

		other->fallout();

		if (other->health == 1 && getInventoryItemByObjectiveName("Amulet of Resurrection") == NULL)
		{
			self->health = 5;

			other->flags |= FLY;
		}

		game.timesEaten++;

		if (game.timesEaten == 5)
		{
			addMedal("eaten_5");
		}
	}
}
Exemple #2
0
static void trapEntity(Entity *other)
{
	if (other->type == PLAYER)
	{
		other->flags |= NO_DRAW;

		other->fallout();

		playSoundToMap("sound/enemy/floating_snapper/chomp", -1, self->x, self->y, 0);

		setEntityAnimation(self, "STAND");

		self->thinkTime = 180;

		self->action = &biteFinish;

		self->touch = &touch;

		game.timesEaten++;

		if (game.timesEaten == 5)
		{
			addMedal("eaten_5");
		}
	}
}
Exemple #3
0
static void validate()
{
	int allStatues, orderCorrect;
	EntityList *list = getEntitiesByName(self->name);
	EntityList *l;
	Entity *e;

	allStatues = TRUE;

	orderCorrect = TRUE;

	for (l=list->next;l!=NULL;l=l->next)
	{
		e = l->entity;

		if (e->target == NULL)
		{
			allStatues = FALSE;

			break;
		}

		else if (strcmpignorecase(e->requires, e->target->objectiveName) != 0)
		{
			orderCorrect = FALSE;
		}
	}

	if (allStatues == TRUE)
	{
		if (orderCorrect == TRUE)
		{
			for (l=list->next;l!=NULL;l=l->next)
			{
				e = l->entity;

				e->active = FALSE;

				e->activate = NULL;
			}

			fireTrigger(self->name);

			fireGlobalTrigger(self->name);

			addMedal("occult");
		}

		else
		{
			runScript("wrong_order");
		}
	}

	freeEntityList(list);
}
Exemple #4
0
static void creeperTouch(Entity *other)
{
	if (other->type == PLAYER)
	{
		other->health = 0;

		other->flags |= NO_DRAW;

		other->fallout();

		self->mental = 2;

		self->thinkTime = 180;

		self->touch = &entityTouch;

		playSoundToMap("sound/enemy/whirlwind/suck", -1, self->x, self->y, 0);

		game.timesEaten++;

		if (game.timesEaten == 5)
		{
			addMedal("eaten_5");
		}

		self->mental = 1;
	}

	else if (other->head == NULL || (other->head != NULL && other->head != self))
	{
		playSoundToMap("sound/enemy/whirlwind/suck", -1, self->x, self->y, 0);

		fireTrigger(self->objectiveName);

		fireGlobalTrigger(self->objectiveName);

		other->inUse = FALSE;

		self->mental = 1;
	}
}
static void die()
{
	Entity *e;

	playSoundToMap("sound/enemy/tortoise/tortoise_die", -1, self->x, self->y, 0);

	if (getInventoryItemByObjectiveName("Tortoise Shell") == NULL)
	{
		e = dropCollectableItem("item/tortoise_shell", self->x + self->w / 2, self->y, self->face);

		e->x -= e->w / 2;
	}

	addMedal("kill_rampaging");

	if (self->startX == -1)
	{
		fadeBossMusic();
	}

	entityDie();
}
Exemple #6
0
static void trap(Entity *other)
{
	if (other->type == PLAYER)
	{
		other->flags |= NO_DRAW;

		other->fallout();

		if (other->health == 1 && getInventoryItemByObjectiveName("Amulet of Resurrection") == NULL)
		{
			self->health = 5;

			other->flags |= FLY;
		}

		game.timesEaten++;

		if (game.timesEaten == 5)
		{
			addMedal("eaten_5");
		}
	}
}