[solved] if statement producing unusual results

I have a very newbish problem that I am sure will give you all a nice chuckle. :slight_smile: This is the first time I have posted on a Dev forum, kinda nervous. haha

The issue I am running into is with the if statement within the Intro Class. With the current setup this if statement will always return “winner” 100% of the time but if I use the == operator it will provide different results dependent on the Player.player.traitOneID and the argument value. I need the > operator to work correctly to produce the desired results but it is not.

The traitOneID is setup almost like the players level, this is so I can run a random number against the traitOneID and it will give a conclusion dependent on how high the level is. I was originally using this particular if statement to see if the variable player in the Player Class was actually being updated, which it is, and then ran across this issue which left me puzzled. Side note, I am reaching this if statement by only pressing the 1 key on the keyboard

Player Class

public class Player {
	
	public static Player player;

	public String name;
	public String position;
	public String history;
	public String traitOne;
	public String traitTwo;
	public int traitOneID;
	public int traitTwoID;	

	
	public static Player playerOne(){
		Player playerOne = new Player();
		playerOne.name = "1. Player One";
		playerOne.position = "Science Officer";
		playerOne.history = "A brief background of Player One";
		playerOne.traitOne = "Intelligence";
		playerOne.traitOneID = 75;
		playerOne.traitTwo = "Courage";
		playerOne.traitTwoID = 25;
		return playerOne;
	}
	
	public static Player playerTwo(){
		Player playerTwo = new Player();
		playerTwo.name = "2. Player Two";
		playerTwo.position = "Pilot";
		playerTwo.history = "A brief background of Player Two";
		playerTwo.traitOne = "Intelligence";
		playerTwo.traitOneID = 50;
		playerTwo.traitTwo = "Courage";
		playerTwo.traitTwoID = 50;
		return playerTwo;
	}
	
	public static Player playerThree(){
		Player playerThree = new Player();
		playerThree.name = "3. Player Three";
		playerThree.position = "Combat Officer";
		playerThree.history = "A brief background of Player Three";
		playerThree.traitOne = "Intelligence";
		playerThree.traitOneID = 25;
		playerThree.traitTwo = "Courage";
		playerThree.traitTwoID = 75;
		return playerThree;
	}
}

PlayerSelect Class

public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException{
		Input userInput = gc.getInput();
		if(userInput.isKeyPressed(Input.KEY_1)){
			Player.player = Player.playerOne();
			sbg.enterState(2);
		}
		if(userInput.isKeyPressed(Input.KEY_2)){
			Player.player = Player.playerTwo();
			sbg.enterState(2);
		}
		if(userInput.isKeyPressed(Input.KEY_3)){
			Player.player = Player.playerThree();
			sbg.enterState(2);
		}
	}

Intro Class (here is the if statement in question)

public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{
		Random randomGenerator = new Random();
		int randomInt = randomGenerator.nextInt(100);
	    for (int i = 1; i <= 10; ++i)
		if(Player.player.traitOneID > randomInt){
			System.out.println("winner");
		}else{
			System.out.println("loser");
		}
		
	}

I hope I have included all the code needed and explained thoroughly so you can understand my issue, any help in furthering my knowledge would be greatly appreciated.