package project;

public class PoisonApple extends food {
  
  private boolean print;
  
  public PoisonApple (Player1 p, int x, int y) { 
    super(p, x, y, PoisonAppleValue); 
	text = player.text;
    print = false;
  } //constructor PoisonApple
  
  public void update() {
    if (SameLocation(player) && Active) {
	  Encounter();
	  player.get(this);
	} //if
	else if (player.snack instanceof PoisonApple) player.snack = null;
	else print = false;
  } //method update
  
  public void beEaten(Player1 p) {
    p.health = p.health + PoisonAppleValue;
	text.println ("Ooops...Ate a poisonous apple...Health down..");
	Disable();
  } //method beEaten
  
  public int getfoodValue() { return NutritiousV; }
  
  public void Encounter() { 
    if (!print) {
	  text.println ("You've found something on the floor...");
	  text.println ("Smells like food...");
      print = true;
	} //if
  } //method Encounter
  
} //class PoisonApple
  
	  