Challenge

Get at least 20 glory on your first turn using 40 different cards. Good luck. Congrats to Keyser and Monyx for beating this challenge by getting an arbitrarily large amount of glory.

void configGame()
{
	setMapSeed(12345);
	addAIPlayer("Evil Fish","Crypt Doctor",0);
	setTurnTime(181);
}

Player newt;

bool isDeckValid(Player player){
   if(player.deckSize() != 40){
      statusMsg(newt,"Your deck must have exactly 40 cards");
      return false;
   }
   int ds=player.deckSize();
	string[] cardNames(ds);
	for(int n=0; n<ds; n++)
	{
		string name=player.getDeckCard(n).getName();
		if(checkDup(cardNames,name,n))
		{
			statusMsg(newt,"You cannot have duplicate cards for this challenge.");
			string msg="{u,";
			msg += player.getID();
			msg += "} has a duplicate {C,";
			msg += name;
			msg += "}. Please select another deck.";
			statusMsg(newt,msg);

			return(false);
		}
		cardNames[n]=name;
	}

   return true;
}

bool checkDup(string[] names,string name,int len)
{
	for(int n=0; n<len; n++)
	{
		if(names[n]==name) return(true);
	}
	return(false);
}




void beforeStart()
{

   for(int x = 0; x <13; x++){
      for(int y = 0; y < 12; y++){
	setTerrain(createLocation(x,y),1,1);
      }
   }

   Player aiPlayer=getAIPlayer(0); 
   Player P1=getHumanPlayer(0); 

   while(P1.deckSize()>0){
      P1.drawCard();
   }

   infoBox("Challenge","Get at least 10 glory in one turn using whatever cards you have.  Good luck.");

}


void afterStart(){
   Player P1 = getHumanPlayer(0);
   if(P1.getGlory() != 0){

   }
   //P1.addGlory(1);



}



void onNewRound(){
   Player aiPlayer=getAIPlayer(0); 
   aiPlayer.addGlory(20 - aiPlayer.getGlory());

   if(getCampID() !=3){
      infoBox("Nice Try","But you can't cheat that way");
      endGame(aiPlayer);
   }

   Player P1 = getHumanPlayer(0);
   int64 glory = P1.getGlory();


 //  string campMsg = "campID for this script is ";
 //  int camp = getCampID();
 //  string campNo = camp;
 //  campMsg += campNo;
 //  infoBox("Camp ID", campMsg);

   if(glory > 9){
      string strglory =  glory;
      string msg = "You won with ";
      msg += strglory;
      msg += " glory.  Post your glory and code ";
      uint64 code = 1;
      for(int i = 0; i<1515; i++){
         code = (code * glory) % 999331;
      }
      string codestr = code;
      msg += codestr;
      infoBox("Congratulations", msg);
      aiPlayer.addGlory(-200);
      endGame(P1);
   }
   endGame(aiPlayer);
}

void onPlayersTurn(Player player){


   Player aiPlayer=getAIPlayer(0); 

   if(getCampID() !=3){
      infoBox("Nice Try","But you can't cheat that way");
      endGame(aiPlayer);
   }


}

void onDialogResponse(Player player,int resp){
}

bool canPass(Player player){
   return true;
}

bool canAct(Player player,Action action){
   return true;
}

void afterAction(Action action){


}