public void gameEventHandler(Trainer t)
	{
		if(!justBeatRival&&t.type==Trainer.TrainerType.RIVAL)
		{
			if(!t.hostile)
				timesBeatRival++;
			justBeatRival=true;

		}
		if(t.type==Trainer.TrainerType.BABB)
		{
			if(badges<1)
			{
				objectiveComplete[0]=true;
			}
			else if(objectiveComplete[10])
			{
				objectiveComplete[11]=true;
				bgm.stop();
				save();
				title.creditMusic.loop();
				showCredits=true;
			}
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("Jenny"))
		{
			badges=1;
			objectiveComplete[1]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("Jimmy"))
		{
			badges=2;
			objectiveComplete[2]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("Jace"))
		{
			badges=3;
			objectiveComplete[3]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("Jin"))
		{
			badges=4;
			objectiveComplete[4]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("Jordan"))
		{
			badges=5;
			objectiveComplete[5]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("Joy"))
		{
			badges=6;
			objectiveComplete[6]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("James"))
		{
			badges=7;
			objectiveComplete[7]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.GYM_LEADER&&t.name.equals("Jessica"))
		{
			badges=8;
			objectiveComplete[8]=true;
			receiveItem(t.name);
		}

		if(!objectiveComplete[10]&&t.type==Trainer.TrainerType.PROFESSOR&&(t.name.equals("Cutter")||t.name.equals("Flyer")||t.name.equals("Surfer")||t.name.equals("Roderick Jr.")||t.name.equals("Roderick III")||t.name.equals("Brutus")))
		{
			receiveItem(t.name);
		}

		if(t.name.equals("Bike Enthusiast"))
		{
			receiveItem(t.name);
		}

		if(t.name.equalsIgnoreCase("Mr. Flashy"))
		{
			receiveItem(t.name);
		}
		
		if(t.name.equalsIgnoreCase("Name Rater"))
		{
			System.out.println("Attempting to rename Pokemon");
			if(partyPokemon[0].idNumber==trainerIdNumber||partyPokemon[0].originalTrainer.equals(name))
			{
				System.out.println("Beginning rename");
				
				do
				{
					partyPokemon[0].nickname=(JOptionPane.showInputDialog(null, "Rename "+partyPokemon[0].nickname+"? (<10 Chars)", partyPokemon[0].nickname));
				}
				while(partyPokemon[0].nickname==null);
		
				partyPokemon[0].setNickname(partyPokemon[0].nickname);
			}
		}

		if(!objectiveComplete[10]&&t.name.equalsIgnoreCase("BOSS"))
		{
			objectiveComplete[9]=true;
			receiveItem(t.name);
		}
		if(!objectiveComplete[10]&&t.name.equalsIgnoreCase("Joe"))
		{
			objectiveComplete[10]=true;
		}
	}