rem: spawn_doggy (ElementPtr) PELEMENT ElementPtr;
add: spawn_doggy (PELEMENT ElementPtr)
context: spawn_doggy (ElementPtr)PELEMENT ElementPtr;{	HELEMENT hDoggyElement;	if ((hDoggyElement = AllocElement ()) != 0)	{		COUNT angle;		ELEMENTPTR DoggyElementPtr;		STARSHIPPTR StarShipPtr;		ElementPtr->state_flags |= DEFY_PHYSICS;		PutElement (hDoggyElement);		LockElement (hDoggyElement, &DoggyElementPtr);		DoggyElementPtr->hit_points = 3;		DoggyElementPtr->mass_points = 4;		DoggyElementPtr->thrust_wait = 0;		DoggyElementPtr->state_flags = APPEARING				| (ElementPtr->state_flags & (GOOD_GUY | BAD_GUY));		DoggyElementPtr->life_span = NORMAL_LIFE;		SetPrimType (&(GLOBAL (DisplayArray))[DoggyElementPtr->PrimIndex],				STAMP_PRIM);		{			DoggyElementPtr->preprocess_func = doggy_preprocess;			DoggyElementPtr->postprocess_func = NULL_PTR;			DoggyElementPtr->collision_func = doggy_collision;			DoggyElementPtr->death_func = doggy_death;		}		GetElementStarShip (ElementPtr, &StarShipPtr);		angle = FACING_TO_ANGLE (StarShipPtr->ShipFacing) + HALF_CIRCLE;		DoggyElementPtr->current.location.x = ElementPtr->next.location.x				+ COSINE (angle, DISPLAY_TO_WORLD (CHENJESU_OFFSET + DOGGY_OFFSET));		DoggyElementPtr->current.location.y = ElementPtr->next.location.y				+ SINE (angle, DISPLAY_TO_WORLD (CHENJESU_OFFSET + DOGGY_OFFSET));		DoggyElementPtr->current.image.farray = StarShipPtr->RaceDescPtr->ship_data.special;		DoggyElementPtr->current.image.frame = StarShipPtr->RaceDescPtr->ship_data.special[0];		SetVelocityVector (&DoggyElementPtr->velocity,				DOGGY_SPEED, NORMALIZE_FACING (ANGLE_TO_FACING (angle)));		SetElementStarShip (DoggyElementPtr, StarShipPtr);		UnlockElement (hDoggyElement);	}}