<commit_before>package txtrpg;
import java.io.IOException;
import java.util.Random;

public class Event {

	private Random e_calc;
	private int choice;
	private AttackEngine encounter;
	private int event; // Type of event
	private Character player;
	private String playerName;
	private Location location;
	private int x;
	private int y;
	private boolean leave;
	private boolean alive;

	public Event(String charName) throws NumberFormatException, IOException {
		encounter = new AttackEngine(charName);
		player = new Character(charName);
		leave = false;
		alive = true;
		playerName = charName;
		x = player.getLocationX();
		y = player.getLocationY();
		location = new Location(player.getMapSize(), charName, x, y);
	}

	public void eventCalc() throws IOException {
		player.update();
		switch(location.getCell()){
		
		case 1:
			H.pln("You are stuck in quicksand!");
			H.pln("You lost 30 health!");
			player.setCHealth(player.getHealth() - 30);
			player.saveAll();
			if(player.getCHealth() <= 0) 
				died();
			break;
		case 2:
			H.pln("You are in a Forest!");
			e_calc = new Random();
			event = e_calc.nextInt(99)+1;
			if(event>0 && event<60){ //Finding an enemy (60% chance)
				if(!encounter.Battle()) 
				died();
				player.update();
			}
			if(event>=61 && event<=90){ //30% chance of nothing
				H.pln("Nothing here seems out of the ordinary.");
			}
			if(event>=91 && event<=95){ //5% chance of finding extra XP
				H.pln("You found a book");
				H.pln("It looks old and is hard to read.");
				H.pln("However after figuring out the symbols");
				H.pln("You have learned valuable skills");
				H.pln("You gained 500 XP!");
				player.addXP(500);
			}
			if(event>=96 && event<=100){
				H.pln("You found a map!");
				player.findMap();
				player.saveAll();<commit_msg>Made minor bug fixes<commit_after>package txtrpg;
import java.io.IOException;
import java.util.Random;

public class Event {

	private Random e_calc;
	private int choice;
	private AttackEngine encounter;
	private int event; // Type of event
	private Character player;
	private String playerName;
	private Location location;
	private int x;
	private int y;
	private boolean leave;
	private boolean alive;

	public Event(String charName) throws NumberFormatException, IOException {
		encounter = new AttackEngine(charName);
		player = new Character(charName);
		leave = false;
		alive = true;
		playerName = charName;
		x = player.getLocationX();
		y = player.getLocationY();
		location = new Location(player.getMapSize(), charName, x, y);
	}

	public void eventCalc() throws IOException {
		player.update();
		switch(location.getCell()){
		
		case 1:
			H.pln("You are stuck in quicksand!");
			H.pln("You lost 30 health!");
			player.setCHealth(player.getCHealth() - 30);
			player.saveAll();
			if(player.getCHealth() <= 0) 
				died();
			break;
		case 2:
			H.pln("You are in a Forest!");
			e_calc = new Random();
			event = e_calc.nextInt(99)+1;
			if(event>0 && event<60){ //Finding an enemy (60% chance)
				if(!encounter.Battle()) 
				died();
				player.update();
			}
			if(event>=61 && event<=90){ //30% chance of nothing
				H.pln("Nothing here seems out of the ordinary.");
			}
			if(event>=91 && event<=95){ //5% chance of finding extra XP
				H.pln("You found a book");
				H.pln("It looks old and is hard to read.");
				H.pln("However after figuring out the symbols");
				H.pln("You have learned valuable skills");
				H.pln("You gained 500 XP!");
				player.addXP(500);
			}
			if(event>=96 && event<=100){
				H.pln("You found a map!");
				player.findMap();
				player.saveAll();
{'fraction_non_alphanumeric': 0.13967723984418476, 'fraction_numerical': 0.020589872008903727, 'mean_word_length': 3.573791348600509, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3253436', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1154, 'n_words': 356}