package project;

public class Shotgun extends Weapon {
  
  private boolean print;
  
  public Shotgun (Player1 p, int x, int y) {
    super(p, x, y, ShotgunAttackPower, ShotgunShots);
	player = p;
    print = false;
  } //constructor Shotgun
  
  public void Fire() throws NoShotException {
    if (Shots>0) Shots--;
	else throw new NoShotException();
  } //method Fire
  
  public void getPickedUp(ItemEncounter i) {
    text.println ("You've picked up a shotgun!");
    Disable();
  } //method getPickedUp
  
  public void update() {
    if (SameLocation(player) && Active) {
	  Encounter();
	  player.get(this);
	} //if
	else if (player.weapon instanceof Shotgun) player.weapon = null;
	else print = false;
  } //method update
  
  public void Encounter() {
    if (!print) {
	 text.println ("You've found something on the floor..");
	 text.println ("looks like an item...");
     print = true;
	} //if
  } //method Encounter

} //class Shotgun
	  
  
  
    