//create flash for player appearance void create_player_appearance_effect(object *player_obj) { vms_vector pos; object *effect_obj; #ifndef NDEBUG { int objnum = player_obj-Objects; if ( (objnum < 0) || (objnum > Highest_object_index) ) Int3(); // See Rob, trying to track down weird network bug } #endif if (player_obj == Viewer) vm_vec_scale_add(&pos, &player_obj->pos, &player_obj->orient.fvec, fixmul(player_obj->size,flash_dist)); else pos = player_obj->pos; effect_obj = object_create_explosion(player_obj->segnum, &pos, player_obj->size, VCLIP_PLAYER_APPEARANCE ); if (effect_obj) { effect_obj->orient = player_obj->orient; if ( Vclip[VCLIP_PLAYER_APPEARANCE].sound_num > -1 ) digi_link_sound_to_object( Vclip[VCLIP_PLAYER_APPEARANCE].sound_num, effect_obj-Objects, 0, F1_0); } }
//blows up the player with a badass explosion //return the explosion object object *explode_badass_player(object *objp) { object *rval; rval = object_create_badass_explosion(objp, objp->segnum, &objp->pos, objp->size, get_explosion_vclip(objp, 0), F1_0*50, F1_0*40, F1_0*150, objp-Objects); if (rval) digi_link_sound_to_object(SOUND_BADASS_EXPLOSION, rval-Objects, 0, F1_0); return (rval); }
//blows up a badass weapon, creating the badass explosion //return the explosion object object *explode_badass_weapon(object *obj) { weapon_info *wi = &Weapon_info[obj->id]; Assert(wi->damage_radius); digi_link_sound_to_object(SOUND_BADASS_EXPLOSION, obj-Objects, 0, F1_0); return object_create_badass_explosion( obj, obj->segnum, &obj->pos, wi->impact_size, wi->robot_hit_vclip, wi->strength[Difficulty_level], wi->damage_radius,wi->strength[Difficulty_level], obj->ctype.laser_info.parent_num ); }
//process this powerup for this frame void do_powerup_frame(dxxobject *obj) { fix fudge; vclip_info *vci = &obj->rtype.vclip_info; vclip_t *vc = &Vclip[vci->vclip_num]; objnum_t objnum = obj-Objects; fudge = (FrameTime * (objnum&3)) >> 4; vci->frametime -= FrameTime+fudge; while (vci->frametime < 0 ) { vci->frametime += vc->frame_time; if (vci->framenum >= vc->num_frames) vci->framenum=0; if (vci->framenum < 0) vci->framenum = vc->num_frames-1; if (objnum&1) { if (vci->framenum) vci->framenum--; else vci->framenum = vc->num_frames-1; } else { if (vci->framenum >= vc->num_frames-1) vci->framenum=0; else vci->framenum++; } } if (obj->lifeleft <= 0) { object_create_explosion(obj->segnum, &obj->pos, F1_0*7/2, VCLIP_POWERUP_DISAPPEARANCE ); if ( Vclip[VCLIP_POWERUP_DISAPPEARANCE].sound_num > -1 ) digi_link_sound_to_object( Vclip[VCLIP_POWERUP_DISAPPEARANCE].sound_num, obj-Objects, 0, F1_0); } }
//process this powerup for this frame void do_powerup_frame(object *obj) { vclip_info *vci = &obj->rtype.vclip_info; vclip *vc = &Vclip[vci->vclip_num]; vci->frametime -= FrameTime; while (vci->frametime < 0 ) { vci->frametime += vc->frame_time; vci->framenum++; if (vci->framenum >= vc->num_frames) vci->framenum=0; } if (obj->lifeleft <= 0) { object_create_explosion(obj->segnum, &obj->pos, fl2f(3.5), VCLIP_POWERUP_DISAPPEARANCE ); if ( Vclip[VCLIP_POWERUP_DISAPPEARANCE].sound_num > -1 ) digi_link_sound_to_object( Vclip[VCLIP_POWERUP_DISAPPEARANCE].sound_num, obj-Objects, 0, F1_0); } }