rem: * (SPACE_HEIGHT - square_root (d_squared))) / SPACE_HEIGHT) + 1;
add: * (ABANDONER_RANGE - square_root (d_squared))) / ABANDONER_RANGE) + 1;
context: spawn_crew (PELEMENT ElementPtr){	if (ElementPtr->state_flags & PLAYER_SHIP)	{		HELEMENT hCrew;		if ((hCrew = AllocElement ()) != 0)		{			ELEMENTPTR CrewPtr;			LockElement (hCrew, &CrewPtr);			CrewPtr->next.location = ElementPtr->next.location;			CrewPtr->state_flags = APPEARING | NONSOLID | FINITE_LIFE					| (ElementPtr->state_flags & (GOOD_GUY | BAD_GUY));			CrewPtr->life_span = 0;			{				CrewPtr->death_func = spawn_crew;			}			CrewPtr->pParent = ElementPtr->pParent;			CrewPtr->hTarget = 0;			UnlockElement (hCrew);			PutElement (hCrew);		}	}	else	{		HELEMENT hElement, hNextElement;		for (hElement = GetHeadElement ();				hElement != 0; hElement = hNextElement)		{			ELEMENTPTR ObjPtr;			LockElement (hElement, &ObjPtr);			hNextElement = GetSuccElement (ObjPtr);			if ((ObjPtr->state_flags & PLAYER_SHIP)					&& (ObjPtr->state_flags & (GOOD_GUY | BAD_GUY)) !=					(ElementPtr->state_flags & (GOOD_GUY | BAD_GUY))					&& ObjPtr->crew_level > 1)			{				SIZE dx, dy;				DWORD d_squared;				if ((dx = ObjPtr->next.location.x						- ElementPtr->next.location.x) < 0)					dx = -dx;				if ((dy = ObjPtr->next.location.y						- ElementPtr->next.location.y) < 0)					dy = -dy;				dx = WORLD_TO_DISPLAY (dx);				dy = WORLD_TO_DISPLAY (dy);				if (dx <= SPACE_HEIGHT && dy <= SPACE_HEIGHT						&& (d_squared = (DWORD)((UWORD)dx * (UWORD)dx)						+ (DWORD)((UWORD)dy * (UWORD)dy)) <=						(DWORD)((UWORD)SPACE_HEIGHT * (UWORD)SPACE_HEIGHT))				{#define MAX_ABANDONERS 8					COUNT crew_loss;					crew_loss = ((MAX_ABANDONERS							* (SPACE_HEIGHT - square_root (d_squared)))							/ SPACE_HEIGHT) + 1;					if (crew_loss >= ObjPtr->crew_level)						crew_loss = ObjPtr->crew_level - 1;					AbandonShip (ObjPtr, ElementPtr, crew_loss);				}			}			UnlockElement (hElement);		}	}}