rem: melnorme_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter) PELEMENT ShipPtr; PEVALUATE_DESC ObjectsOfConcern; COUNT ConcernCounter;
add: melnorme_intelligence (PELEMENT ShipPtr, PEVALUATE_DESC ObjectsOfConcern, COUNT ConcernCounter)
context: melnorme_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter)PELEMENT ShipPtr;PEVALUATE_DESC ObjectsOfConcern;COUNT ConcernCounter;{	COUNT old_count;	STARSHIPPTR StarShipPtr;	PEVALUATE_DESC lpEvalDesc;	GetElementStarShip (ShipPtr, &StarShipPtr);	StarShipPtr->RaceDescPtr->init_weapon_func = initialize_test_pump_up;	old_count = StarShipPtr->weapon_counter;	if (StarShipPtr->weapon_counter == WEAPON_WAIT)		StarShipPtr->weapon_counter = 0;	lpEvalDesc = &ObjectsOfConcern[ENEMY_SHIP_INDEX];	if (lpEvalDesc->ObjectPtr)	{		if (StarShipPtr->RaceDescPtr->ship_info.energy_level < SPECIAL_ENERGY_COST				+ WEAPON_ENERGY_COST				&& !(StarShipPtr->old_status_flags & WEAPON))			lpEvalDesc->MoveState = ENTICE;		else		{			STARSHIPPTR EnemyStarShipPtr;			GetElementStarShip (lpEvalDesc->ObjectPtr, &EnemyStarShipPtr);			if (!(EnemyStarShipPtr->RaceDescPtr->ship_info.ship_flags					& IMMEDIATE_WEAPON))				lpEvalDesc->MoveState = PURSUE;		}	}	ship_intelligence (ShipPtr, ObjectsOfConcern, ConcernCounter);	if (StarShipPtr->weapon_counter == 0			&& (old_count != 0			|| ((StarShipPtr->special_counter			|| StarShipPtr->RaceDescPtr->ship_info.energy_level >= SPECIAL_ENERGY_COST			+ WEAPON_ENERGY_COST)			&& !(StarShipPtr->ship_input_state & WEAPON))))		StarShipPtr->ship_input_state ^= WEAPON;	StarShipPtr->ship_input_state &= ~SPECIAL;	if (StarShipPtr->special_counter == 0			&& StarShipPtr->RaceDescPtr->ship_info.energy_level >= SPECIAL_ENERGY_COST)	{		BYTE old_input_state;		old_input_state = StarShipPtr->ship_input_state;		StarShipPtr->RaceDescPtr->init_weapon_func = initialize_confusion;		++ShipPtr->turn_wait;		++ShipPtr->thrust_wait;		ship_intelligence (ShipPtr, ObjectsOfConcern, ENEMY_SHIP_INDEX + 1);		--ShipPtr->thrust_wait;		--ShipPtr->turn_wait;		if (StarShipPtr->ship_input_state & WEAPON)		{			StarShipPtr->ship_input_state &= ~WEAPON;			StarShipPtr->ship_input_state |= SPECIAL;		}		StarShipPtr->ship_input_state = (unsigned char)(old_input_state				| (StarShipPtr->ship_input_state & SPECIAL));	}	StarShipPtr->weapon_counter = old_count;	StarShipPtr->RaceDescPtr->init_weapon_func = initialize_pump_up;}