Ejemplo n.º 1
0
void ComputeAdventure() {
	
	uint16_t rand = 0;
	if(entriesSize != 1) {
		rand = Random(entriesSize);
	}	
	DEBUG_VERBOSE_LOG("Random: %d", rand);
	Card* card;
	do {
		 card = &entries[rand];
		 rand = (rand + 1) % NB_TYPE_CARDS;
	} while(card->empty);
	
	DEBUG_VERBOSE_LOG("Random Modified: %d", rand);	
	
	card->windowFunction();	
	card->taken += 1;	
	
	DEBUG_LOG("Card Taken: %d/%d", card->taken, card->total);	
	DEBUG_VERBOSE_LOG("Card Type Left: %d", entriesSize);
	
	if(card->taken == card->total) {
		entriesSize--;
		card->empty = true;
		if(entriesSize == 0) {
			ResetCurrentTaken();
		}
	}	
}
Ejemplo n.º 2
0
void ResetGame(void)
{
#if ALLOW_STAT_SHOP
	ResetStatPointsPurchased();
#endif
	InitializeCharacter();
	ResetFloor();
	ClearInventory();
	ResetCurrentTaken();
}