rem: mmrnmhrm_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter) PELEMENT ShipPtr; PEVALUATE_DESC ObjectsOfConcern; COUNT ConcernCounter;
add: mmrnmhrm_intelligence (PELEMENT ShipPtr, PEVALUATE_DESC ObjectsOfConcern, COUNT ConcernCounter)
context: mmrnmhrm_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter)PELEMENT ShipPtr;PEVALUATE_DESC ObjectsOfConcern;COUNT ConcernCounter;{	BOOLEAN CanTransform;	PEVALUATE_DESC lpEvalDesc;	STARSHIPPTR StarShipPtr, EnemyStarShipPtr;	GetElementStarShip (ShipPtr, &StarShipPtr);	CanTransform = (BOOLEAN)(StarShipPtr->special_counter == 0			&& StarShipPtr->RaceDescPtr->ship_info.energy_level >=			StarShipPtr->RaceDescPtr->characteristics.special_energy_cost);	lpEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];	if (lpEvalDesc->ObjectPtr)	{		GetElementStarShip (lpEvalDesc->ObjectPtr, &EnemyStarShipPtr);	}	ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);	StarShipPtr->ship_input_state &= ~SPECIAL;	if (CanTransform			&& lpEvalDesc->ObjectPtr			&& !(StarShipPtr->ship_input_state & WEAPON))	{		SIZE delta_x, delta_y;		COUNT travel_angle, direction_angle;		GetCurrentVelocityComponents (&lpEvalDesc->ObjectPtr->velocity,				&delta_x, &delta_y);		if (delta_x == 0 && delta_y == 0)			direction_angle = travel_angle = 0;		else		{			delta_x = lpEvalDesc->ObjectPtr->current.location.x					- ShipPtr->current.location.x;			delta_y = lpEvalDesc->ObjectPtr->current.location.y					- ShipPtr->current.location.y;			direction_angle = ARCTAN (-delta_x, -delta_y);			travel_angle = GetVelocityTravelAngle (					&lpEvalDesc->ObjectPtr->velocity					);		}		if (ShipPtr->next.image.farray == StarShipPtr->RaceDescPtr->ship_data.ship)		{			if (lpEvalDesc->which_turn > 8)			{				if (MANEUVERABILITY (&EnemyStarShipPtr->RaceDescPtr->cyborg_control) <= SLOW_SHIP						|| NORMALIZE_ANGLE (								direction_angle - travel_angle + QUADRANT								) > HALF_CIRCLE)					StarShipPtr->ship_input_state |= SPECIAL;			}		}		else		{			SIZE ship_delta_x, ship_delta_y;			GetCurrentVelocityComponents (&ShipPtr->velocity,					&ship_delta_x, &ship_delta_y);			delta_x -= ship_delta_x;			delta_y -= ship_delta_y;			travel_angle = ARCTAN (delta_x, delta_y);			if (lpEvalDesc->which_turn < 16)			{				if (lpEvalDesc->which_turn <= 8						|| NORMALIZE_ANGLE (								direction_angle - travel_angle + OCTANT								) <= QUADRANT)					StarShipPtr->ship_input_state |= SPECIAL;			}			else if (lpEvalDesc->which_turn > 32					&& NORMALIZE_ANGLE (							direction_angle - travel_angle + QUADRANT							) > HALF_CIRCLE)				StarShipPtr->ship_input_state |= SPECIAL;		}	}	if (ShipPtr->current.image.farray == StarShipPtr->RaceDescPtr->ship_data.special)	{		if (!(StarShipPtr->ship_input_state & SPECIAL)				&& lpEvalDesc->ObjectPtr)			StarShipPtr->ship_input_state |= WEAPON;		else			StarShipPtr->ship_input_state &= ~WEAPON;	}}