rem: SleepTask (GetTimeCounter () + (ONE_SECOND / 2));
add: SleepThread (ONE_SECOND / 2);
context: DoSell (RESPONSE_REF R){	BYTE num_new_rainbows;	UWORD rainbow_mask;	SIZE added_credit;	rainbow_mask = MAKE_WORD (			GET_GAME_STATE (RAINBOW_WORLD0),			GET_GAME_STATE (RAINBOW_WORLD1)			);	num_new_rainbows = (BYTE)(-GET_GAME_STATE (MELNORME_RAINBOW_COUNT));	while (rainbow_mask)	{		if (rainbow_mask & 1)			++num_new_rainbows;		rainbow_mask >>= 1;	}	if (!PLAYER_SAID (R, sell))	{		if (PLAYER_SAID (R, sell_life_data))		{			DWORD TimeIn;			added_credit = GLOBAL_SIS (TotalBioMass) * BIO_CREDIT_VALUE;			NPCPhrase (SOLD_LIFE_DATA1);			NPCPhrase (-(int)GLOBAL_SIS (TotalBioMass));			NPCPhrase (SOLD_LIFE_DATA2);			NPCPhrase (-(int)added_credit);			NPCPhrase (SOLD_LIFE_DATA3);			AlienTalkSegue ((COUNT)~0);			DrawCargoStrings ((BYTE)~0, (BYTE)~0);			TimeIn = SleepTask (GetTimeCounter () + (ONE_SECOND / 2));			DrawCargoStrings (					(BYTE)NUM_ELEMENT_CATEGORIES,					(BYTE)NUM_ELEMENT_CATEGORIES					);			do			{				TimeIn = TaskSwitch ();				if (AnyButtonPress (TRUE))				{					DeltaCredit (GLOBAL_SIS (TotalBioMass) * BIO_CREDIT_VALUE);					GLOBAL_SIS (TotalBioMass) = 0;				}				else				{					--GLOBAL_SIS (TotalBioMass);					DeltaCredit (BIO_CREDIT_VALUE);				}				DrawCargoStrings (						(BYTE)NUM_ELEMENT_CATEGORIES,						(BYTE)NUM_ELEMENT_CATEGORIES						);			} while (GLOBAL_SIS (TotalBioMass));			SleepTask (GetTimeCounter () + (ONE_SECOND / 2));			SetSemaphore (&GraphicsSem);			ClearSISRect (DRAW_SIS_DISPLAY);			ClearSemaphore (&GraphicsSem);		}		else /* if (R == sell_rainbow_locations) */		{			added_credit = num_new_rainbows * (250 * BIO_CREDIT_VALUE);			NPCPhrase (SOLD_RAINBOW_LOCATIONS1);			NPCPhrase (-(int)num_new_rainbows);			NPCPhrase (SOLD_RAINBOW_LOCATIONS2);			NPCPhrase (-(int)added_credit);			NPCPhrase (SOLD_RAINBOW_LOCATIONS3);			num_new_rainbows += GET_GAME_STATE (MELNORME_RAINBOW_COUNT);			SET_GAME_STATE (MELNORME_RAINBOW_COUNT, num_new_rainbows);			num_new_rainbows = 0;			DeltaCredit (added_credit);		}				AskedToBuy = FALSE;	}	if (GLOBAL_SIS (TotalBioMass) || num_new_rainbows)	{		NPCPhrase (WHAT_TO_SELL);		if (GLOBAL_SIS (TotalBioMass))			Response (sell_life_data, DoSell);		if (num_new_rainbows)			Response (sell_rainbow_locations, DoSell);		Response (done_selling, NatureOfConversation);	}	else	{		if (PLAYER_SAID (R, sell))			NPCPhrase (NOTHING_TO_SELL);		DISABLE_PHRASE (sell);		NatureOfConversation (R);	}}