rem: chenjesu_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter) PELEMENT ShipPtr; PEVALUATE_DESC ObjectsOfConcern; COUNT ConcernCounter;
add: chenjesu_intelligence (PELEMENT ShipPtr, PEVALUATE_DESC ObjectsOfConcern, COUNT ConcernCounter)
context: chenjesu_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter)PELEMENT ShipPtr;PEVALUATE_DESC ObjectsOfConcern;COUNT ConcernCounter;{	PEVALUATE_DESC lpEvalDesc;	STARSHIPPTR StarShipPtr;	GetElementStarShip (ShipPtr, &StarShipPtr);	StarShipPtr->ship_input_state &= ~SPECIAL;	lpEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];	if (lpEvalDesc->ObjectPtr)	{		STARSHIPPTR EnemyStarShipPtr;		GetElementStarShip (lpEvalDesc->ObjectPtr, &EnemyStarShipPtr);		if ((lpEvalDesc->which_turn <= 16				&& MANEUVERABILITY (				&EnemyStarShipPtr->RaceDescPtr->cyborg_control				) >= MEDIUM_SHIP)				|| (MANEUVERABILITY (				&EnemyStarShipPtr->RaceDescPtr->cyborg_control				) <= SLOW_SHIP				&& WEAPON_RANGE (				&EnemyStarShipPtr->RaceDescPtr->cyborg_control				) >= LONG_RANGE_WEAPON * 3 / 4				&& (EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags & SEEKING_WEAPON)))			lpEvalDesc->MoveState = PURSUE;	}	if (StarShipPtr->special_counter == 1			&& ObjectsOfConcern[ENEMY_WEAPON_INDEX].ObjectPtr			&& ObjectsOfConcern[ENEMY_WEAPON_INDEX].MoveState == ENTICE			&& ObjectsOfConcern[ENEMY_WEAPON_INDEX].which_turn <= 8)	{		lpEvalDesc = &ObjectsOfConcern[ENEMY_WEAPON_INDEX];	}	ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);	if (lpEvalDesc->ObjectPtr)	{		HELEMENT h, hNext;		ELEMENTPTR CrystalPtr;		h = (StarShipPtr->old_status_flags & WEAPON) ?				GetTailElement () : (HELEMENT)0;		for (; h; h = hNext)		{			LockElement (h, &CrystalPtr);			hNext = GetPredElement (CrystalPtr);			if (!(CrystalPtr->state_flags & NONSOLID)					&& CrystalPtr->next.image.farray == StarShipPtr->RaceDescPtr->ship_data.weapon					&& CrystalPtr->preprocess_func					&& CrystalPtr->life_span > 0					&& (CrystalPtr->state_flags & (GOOD_GUY | BAD_GUY)) ==					(ShipPtr->state_flags & (GOOD_GUY | BAD_GUY)))			{				if (ObjectsOfConcern[ENEMY_SHIP_INDEX].ObjectPtr)				{					COUNT which_turn;					if ((which_turn = PlotIntercept (CrystalPtr,							ObjectsOfConcern[ENEMY_SHIP_INDEX].ObjectPtr,							CrystalPtr->life_span,							FRAGMENT_RANGE / 2)) == 0							|| (which_turn == 1							&& PlotIntercept (CrystalPtr,							ObjectsOfConcern[ENEMY_SHIP_INDEX].ObjectPtr,							CrystalPtr->life_span, 0) == 0))						StarShipPtr->ship_input_state &= ~WEAPON;					else if (StarShipPtr->weapon_counter == 0)					{						StarShipPtr->ship_input_state |= WEAPON;						lpEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];					}					UnlockElement (h);					break;				}				hNext = 0;			}			UnlockElement (h);		}		if (h == 0)		{			if (StarShipPtr->old_status_flags & WEAPON)			{				StarShipPtr->ship_input_state &= ~WEAPON;				if (lpEvalDesc == &ObjectsOfConcern[ENEMY_WEAPON_INDEX])					StarShipPtr->weapon_counter = 3;			}			else if (StarShipPtr->weapon_counter == 0					&& ship_weapons (ShipPtr, lpEvalDesc->ObjectPtr, FRAGMENT_RANGE / 2))				StarShipPtr->ship_input_state |= WEAPON;		}	}	if (StarShipPtr->special_counter < MAX_DOGGIES)	{		if (lpEvalDesc->ObjectPtr				&& StarShipPtr->RaceDescPtr->ship_info.energy_level <= SPECIAL_ENERGY_COST				&& !(StarShipPtr->ship_input_state & WEAPON))			StarShipPtr->ship_input_state |= SPECIAL;	}}