Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/mob/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Player(Game game, Vector position) {
game.scene.addEventFilter(KeyEvent.KEY_PRESSED, keyPressedEventHandler);
game.scene.addEventFilter(KeyEvent.KEY_RELEASED, keyReleasedEventHandler);

weapon = new Spear();
weapon = new Spear(20);
bag = new Bag(game);
}

Expand Down Expand Up @@ -53,7 +53,8 @@ public void openShop() {
Shop shop = new Shop(10);
Scene shopScene = new Scene(shop);
shop.setGame(game);
shop.addGoodies(((Dealer) obj).getStore());
shop.printStore(new Dealer(game,new Vector(0,0)), this.bag);
//shop.addGoodies(((Dealer) obj).getStore());
game.stage.setScene(shopScene);
}
}
Expand All @@ -64,5 +65,15 @@ public void openShop() {
public Vector move() {
return new Vector((controls[2] - controls[0]) * speed, (controls[3] - controls[1]) * speed);
}

public Weapon getWeapon() {
return(this.weapon);
}
public Bag getBag() {
return(this.bag);
}
public void checkDurability(Weapon weapon) {
if(weapon.getDurability() == 0) { //Penser à enlever -1 en durabilité à chaque appel de la fonction attaquer() dans player
this.weapon = new Hand();
}
}
}