예제 #1
0
void fire_bfg(edict_t *self, vec3_t start, vec3_t dir, int damage, int speed, float damage_radius)
{
    edict_t *bfg;

    bfg = G_Spawn();
    VectorCopy(start, bfg->s.origin);
    VectorCopy(start, bfg->old_origin);
    VectorCopy(dir, bfg->movedir);
    vectoangles(dir, bfg->s.angles);
    VectorScale(dir, speed, bfg->velocity);
    bfg->movetype = MOVETYPE_FLYMISSILE;
    bfg->clipmask = MASK_SHOT;
    bfg->solid = SOLID_BBOX;
    bfg->s.effects |= EF_BFG | EF_ANIM_ALLFAST;
    VectorClear(bfg->mins);
    VectorClear(bfg->maxs);
    bfg->s.modelindex = gi.modelindex("sprites/s_bfg1.sp2");
    bfg->owner = self;
    bfg->touch = bfg_touch;
    NEXT_KEYFRAME(bfg, bfg_think);
    bfg->radius_dmg = damage;
    bfg->dmg_radius = damage_radius;
    bfg->classname = "bfg blast";
    bfg->s.sound = gi.soundindex("weapons/bfg__l1a.wav");

    bfg->teammaster = bfg;
    bfg->teamchain = NULL;

    gi.linkentity(bfg);
}
예제 #2
0
void bfg_touch(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
    if (other == self->owner)
        return;

    if (surf && (surf->flags & SURF_SKY)) {
        G_FreeEdict(self);
        return;
    }

    // core explosion - prevents firing it into the wall/floor
    if (other->takedamage)
        T_Damage(other, self, self->owner, self->velocity, self->s.origin, plane->normal, 200, 0, 0, MOD_BFG_BLAST);
    T_RadiusDamage(self, self->owner, 200, other, 100, MOD_BFG_BLAST);

    gi.sound(self, CHAN_VOICE, gi.soundindex("weapons/bfg__x1b.wav"), 1, ATTN_NORM, 0);
    self->solid = SOLID_NOT;
    self->touch = NULL;
    VectorMA(self->s.origin, -1 * FRAMETIME, self->velocity, self->s.origin);
    VectorClear(self->velocity);
    self->s.modelindex = gi.modelindex("sprites/s_bfg3.sp2");
    self->s.frame = 0;
    self->s.sound = 0;
    self->s.effects &= ~EF_ANIM_ALLFAST;
    NEXT_KEYFRAME(self, bfg_explode);
    self->enemy = other;

    gi.WriteByte(svc_temp_entity);
    gi.WriteByte(TE_BFG_BIGEXPLOSION);
    gi.WritePosition(self->s.origin);
    gi.multicast(self->s.origin, MULTICAST_PVS);
}
예제 #3
0
파일: a_dom.c 프로젝트: Raptor007/aq2-tng
void DomMakeFlag( edict_t *flag )
{
	vec3_t dest = {0};
	trace_t tr = {0};

	VectorSet( flag->mins, -15, -15, -15 );
	VectorSet( flag->maxs,  15,  15,  15 );

	// Put the flag on the ground.
	VectorCopy( flag->s.origin, dest );
	dest[2] -= 128;
	tr = gi.trace( flag->s.origin, flag->mins, flag->maxs, dest, flag, MASK_SOLID );
	if( ! tr.startsolid )
		VectorCopy( tr.endpos, flag->s.origin );

	VectorCopy( flag->s.origin, flag->old_origin );

	flag->solid = SOLID_TRIGGER;
	flag->movetype = MOVETYPE_NONE;
	flag->s.modelindex = dom_blue_flag;
	flag->s.skinnum = 0;
	flag->s.effects = dom_team_effect[ NOTEAM ];
	flag->s.renderfx = dom_team_fx[ NOTEAM ];
	flag->owner = NULL;
	flag->touch = DomTouchFlag;
	NEXT_KEYFRAME( flag, DomFlagThink );
	flag->classname = "item_flag";
	flag->svflags &= ~SVF_NOCLIENT;
	gi.linkentity( flag );

	dom_flag_count ++;
}
예제 #4
0
파일: g_misc.c 프로젝트: AQ2Chile/aq2-tng
void
gib_touch (edict_t * self, edict_t * other, cplane_t * plane,
	   csurface_t * surf)
{
  vec3_t normal_angles, right;

  if (!self->groundentity)
    return;

  self->touch = NULL;

  if (plane)
    {
      gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/fhit3.wav"), 1,
		ATTN_NORM, 0);

      vectoangles (plane->normal, normal_angles);
      AngleVectors (normal_angles, NULL, right, NULL);
      vectoangles (right, self->s.angles);

      if (self->s.modelindex == sm_meat_index)
	{
	  self->s.frame++;
	  NEXT_KEYFRAME(self, gib_think);
	}
    }
}
예제 #5
0
파일: g_misc.c 프로젝트: AQ2Chile/aq2-tng
void
SP_misc_banner (edict_t * ent)
{
  ent->movetype = MOVETYPE_NONE;
  ent->solid = SOLID_NOT;
  ent->s.modelindex = gi.modelindex ("models/objects/banner/tris.md2");
  ent->s.frame = rand () % 16;
  gi.linkentity (ent);

  NEXT_KEYFRAME(ent, misc_banner_think);
}
예제 #6
0
파일: g_misc.c 프로젝트: AQ2Chile/aq2-tng
void
misc_satellite_dish_use (edict_t * self, edict_t * other, edict_t * activator)
{
  self->s.frame = 0;
  NEXT_KEYFRAME(self, misc_satellite_dish_think);
}