Esempio n. 1
0
//
// target_lock_code reveals the lock combination to the 
// target_lock specified in it's target field, or in global
// game data for crosslevel locks
//
void lock_code_use (edict_t *self, edict_t *other, edict_t *activator)
{
	int		i, L;
	char	message[64];
	if(self->spawnflags & 1)
	{
		if(!strlen(game.lock_code))
		{
			gi.dprintf("Lock has not been properly initialized.\n");
			return;
		}
		Com_sprintf(message, sizeof(message), "Lock combination is %s",game.lock_code);
		Do_Text_Display(activator, 0, message);
		L = strlen(game.lock_code);
		for(i=0; i<L; i++)
			game.lock_revealed |= 1<<i;
	}
	else
	{
		edict_t *lock;
		lock = G_Find(NULL,FOFS(targetname),self->target);
		if(!lock)
			gi.dprintf("Target of target_lock_code does not exist\n");
		else
		{
			Com_sprintf(message, sizeof(message), "Lock combination is %s",game.lock_code);
			Do_Text_Display(activator, 0, message);
			L = min(8,strlen(lock->key_message));
			for(i=0; i<L; i++)
				game.lock_revealed |= 1<<i;
		}
	}
}
Esempio n. 2
0
void Use_Target_Text(edict_t *self, edict_t *other, edict_t *activator)
{
	
	if(!activator || !activator->client) return;
	activator->client->showinventory = false;
	activator->client->showscores = false;
	activator->client->showhelp = false;
	
	Text_Close(activator);

	Do_Text_Display(activator, self->spawnflags, self->message);

}