Пример #1
0
void aftermove_fuzz(Object *o)
{
    if (o->state == 0 && o->linkedobject)
    {
        vector_from_angle(o->angle, (20 << CSF), &o->x, NULL);
        vector_from_angle(o->angle, (32 << CSF), NULL, &o->y);

        o->x += o->linkedobject->CenterX() - (o->Width() / 2);
        o->y += o->linkedobject->CenterY() - (o->Height() / 2);
    }
}
Пример #2
0
static void missilehitsmoke(Object *o)
{
        int smokex = o->CenterX() - (8 << CSF);
        int smokey = o->CenterY() - (8 << CSF);
        Object *smoke;

        for(int i=0; i<2; i++) {
                smoke = CreateObject(smokex, smokey, OBJ_SMOKE_CLOUD);
                smoke->sprite = SPR_MISSILEHITSMOKE;
                vector_from_angle(random(0,255), random(0x100,0x3ff), &smoke->xinertia, &smoke->yinertia);
        }
}
Пример #3
0
static void missilehitsmoke(int x, int y, int range)
{
  int smokex = x + (random(-range, range) * CSFI);
  int smokey = y + (random(-range, range) * CSFI);
  Object *smoke;

  for (int i = 0; i < 2; i++)
  {
    smoke         = CreateObject(smokex, smokey, OBJ_SMOKE_CLOUD);
    smoke->sprite = SPR_MISSILEHITSMOKE;
    vector_from_angle(random(0, 255), random(0x100, 0x3ff), &smoke->xinertia, &smoke->yinertia);
  }
}
Пример #4
0
void ai_x_fishy_missile(Object *o)
{
	if (o->state == 0)
	{
		static const int angle_for_dirs[] = { 160, 224, 96, 32 };
		
		o->angle = angle_for_dirs[o->dir];
		o->dir = RIGHT;
		
		o->state = 1;
	}
	
	vector_from_angle(o->angle, 0x400, &o->xinertia, &o->yinertia);
	int desired_angle = GetAngle(o->x, o->y, player->x, player->y);
	
	if (o->angle >= desired_angle)
	{
		if ((o->angle - desired_angle) < 128)
		{
			o->angle--;
		}
		else
		{
			o->angle++;
		}
	}
	else
	{
		if ((o->angle - desired_angle) < 128)
		{
			o->angle++;
		}
		else
		{
			o->angle--;
		}
	}
	
	// smoke trails
	if (++o->timer2 > 2)
	{
		o->timer2 = 0;
		Caret *c = effect(o->ActionPointX(), o->ActionPointY(), EFFECT_SMOKETRAIL_SLOW);
		c->xinertia = -o->xinertia >> 2;
		c->yinertia = -o->yinertia >> 2;
	}
Пример #5
0
// spawn a single smoke puff at x,y and heading off in a random direction
Object *SmokePuff(int x, int y)
{
	Object *o = CreateObject(x, y, OBJ_SMOKE_CLOUD);
	vector_from_angle(random(0,255), random(0x200,0x5ff), &o->xinertia, &o->yinertia);
	return o;
}