rem: thraddash_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter) PELEMENT ShipPtr; PEVALUATE_DESC ObjectsOfConcern; COUNT ConcernCounter;
add: thraddash_intelligence (PELEMENT ShipPtr, PEVALUATE_DESC ObjectsOfConcern, COUNT ConcernCounter)
context: thraddash_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter)PELEMENT ShipPtr;PEVALUATE_DESC ObjectsOfConcern;COUNT ConcernCounter;{	STARSHIPPTR StarShipPtr;	PEVALUATE_DESC lpEvalDesc;		lpEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];	if (lpEvalDesc->ObjectPtr)	{#define STATIONARY_SPEED WORLD_TO_VELOCITY (DISPLAY_TO_WORLD (4))		SIZE dx, dy;		GetCurrentVelocityComponents (				&lpEvalDesc->ObjectPtr->velocity, &dx, &dy				);		if (lpEvalDesc->which_turn > 8				|| (long)dx * dx + (long)dy * dy <=				(long)STATIONARY_SPEED * STATIONARY_SPEED)			lpEvalDesc->MoveState = PURSUE;		else			lpEvalDesc->MoveState = ENTICE;	}	ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);	GetElementStarShip (ShipPtr, &StarShipPtr);	if (StarShipPtr->special_counter == 0)	{		StarShipPtr->ship_input_state &= ~SPECIAL;		if (ObjectsOfConcern[ENEMY_WEAPON_INDEX].ObjectPtr				&& ObjectsOfConcern[ENEMY_WEAPON_INDEX].MoveState == ENTICE)		{			if ((StarShipPtr->ship_input_state & THRUST)					|| (ShipPtr->turn_wait == 0					&& !(StarShipPtr->ship_input_state & (LEFT | RIGHT)))					|| NORMALIZE_FACING (ANGLE_TO_FACING (					GetVelocityTravelAngle (					&ObjectsOfConcern[ENEMY_WEAPON_INDEX].ObjectPtr->velocity					) + HALF_CIRCLE + OCTANT)					- StarShipPtr->ShipFacing) > ANGLE_TO_FACING (QUADRANT))				StarShipPtr->ship_input_state |= SPECIAL;		}		else if (lpEvalDesc->ObjectPtr)		{			if (lpEvalDesc->MoveState == PURSUE)			{				if (StarShipPtr->RaceDescPtr->ship_info.energy_level >= WEAPON_ENERGY_COST						+ SPECIAL_ENERGY_COST						&& ShipPtr->turn_wait == 0						&& !(StarShipPtr->ship_input_state & (LEFT | RIGHT))						&& (!(StarShipPtr->cur_status_flags & SPECIAL)						|| !(StarShipPtr->cur_status_flags						& (SHIP_AT_MAX_SPEED | SHIP_BEYOND_MAX_SPEED))))					StarShipPtr->ship_input_state |= SPECIAL;			}			else if (lpEvalDesc->MoveState == ENTICE)			{				COUNT direction_angle;				SIZE delta_x, delta_y;				delta_x = lpEvalDesc->ObjectPtr->next.location.x						- ShipPtr->next.location.x;				delta_y = lpEvalDesc->ObjectPtr->next.location.y						- ShipPtr->next.location.y;				direction_angle = ARCTAN (delta_x, delta_y);				if ((lpEvalDesc->which_turn > 24						&& !(StarShipPtr->ship_input_state & (LEFT | RIGHT)))						|| (lpEvalDesc->which_turn <= 16						&& NORMALIZE_ANGLE (direction_angle						- (FACING_TO_ANGLE (StarShipPtr->ShipFacing) + HALF_CIRCLE)						+ QUADRANT) <= HALF_CIRCLE						&& (lpEvalDesc->which_turn < 12						|| NORMALIZE_ANGLE (direction_angle						- (GetVelocityTravelAngle (								&lpEvalDesc->ObjectPtr->velocity								) + HALF_CIRCLE)						+ (OCTANT + 2)) <= ((OCTANT + 2) << 1))))					StarShipPtr->ship_input_state |= SPECIAL;			}		}		if ((StarShipPtr->ship_input_state & SPECIAL)				&& StarShipPtr->RaceDescPtr->ship_info.energy_level >=				SPECIAL_ENERGY_COST)			StarShipPtr->ship_input_state &= ~THRUST;	}}