From a9a5bc0189d316de863bbdc8c3a425706b6ade84 Mon Sep 17 00:00:00 2001 From: mafaldo Date: Sun, 11 Feb 2018 12:21:15 +0100 Subject: add pan, add zoom, add weapon --- src/main/java/Actor.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/Actor.java') diff --git a/src/main/java/Actor.java b/src/main/java/Actor.java index 1e0ba80..55fcc3a 100644 --- a/src/main/java/Actor.java +++ b/src/main/java/Actor.java @@ -14,6 +14,7 @@ public class Actor { private int hp; private int x, y; private Dimension gridSize; + private Weapon weapon; public Actor(String name, int MAXHP, Type type, Dimension gridSize) { this.name = name; @@ -21,6 +22,7 @@ public class Actor { this.MAXHP = MAXHP; this.hp = this.MAXHP; this.alive = true; + this.gridSize = gridSize; } public void damage(int dmg) { @@ -62,4 +64,18 @@ public class Actor { public int getY() { return this.y; } + + public void equipWeapon(Weapon weapon) { + this.weapon = weapon; + } + + public Weapon dropWeapon() { + Weapon tmp = this.weapon; + this.weapon = null; + return tmp; + } + + public boolean shoot(Actor actor, double probability) { + return this.weapon.shoot(actor, probability); + } } -- cgit v1.2.1