Esempio n. 1
0
void handleKeyDown()
{
    if(CURRENT_ITEM_DRAGGED != -1) return;

    const Uint8* keystate = SDL_GetKeyboardState(NULL);
    const Uint32 modstate = SDL_GetModState();

    //continuous-response keys
    if (keystate[SDL_SCANCODE_UP])
    {
        button_move_up();
    }
    else if (keystate[SDL_SCANCODE_RIGHT])
    {
        button_move_right();
    }
    else if (keystate[SDL_SCANCODE_LEFT])
    {
        button_move_left();
    }
    else if (keystate[SDL_SCANCODE_DOWN])
    {
        button_move_down();
    }

    if (modstate & (KMOD_LSHIFT | KMOD_RSHIFT))
    {
        button_push();
    }

    if (keystate[SDL_SCANCODE_SPACE])
    {
        button_fire();
    }
}
Esempio n. 2
0
void button_killed (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
	self->activator = attacker;
	self->health = self->max_health;
	self->takedamage = DAMAGE_NO;
	button_fire (self);
}
Esempio n. 3
0
void button_killed()
{
    self->s.v.enemy = EDICT_TO_PROG( damage_attacker );
    self->s.v.health = self->s.v.max_health;
    self->s.v.takedamage = DAMAGE_NO;	// wil be reset upon return

    button_fire();
}
Esempio n. 4
0
void button_touch()
{
    if ( strneq( other->s.v.classname, "player" ) )
        return;

    self->s.v.enemy = EDICT_TO_PROG( other );

    button_fire();
}
Esempio n. 5
0
void button_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf) {
	if ((!other->client) && (!other->svflags & SVF_MONSTER))
		return;

	if (other->health <= 0)
		return;

	self->activator = other;
	button_fire (self);
}
Esempio n. 6
0
void button_use (edict_t *self, edict_t *other, edict_t *activator)
{
	self->activator = activator;
	button_fire (self);
}
Esempio n. 7
0
void button_use()
{
    self->s.v.enemy = EDICT_TO_PROG( activator );
    button_fire();
}