package main.model.critter;
import main.model.Vector2D;


public abstract class Critter {

	private Vector2D position;
	
	private int level;
	private int reward;
	private int hitPoints;
	private int strength;
	private int speed;
	private boolean armoured;

	public Critter(int level,int reward, int hitPoints, int strength, int speed, boolean armoured){
		this.setLevel(level);
		this.setReward(reward);
		this.setHitPoints(hitPoints);
		this.setStrength(strength);
		this.setSpeed(speed);
		this.setArmored(armoured);
	}
	
	void move(){
		//TODO: implement move
	}
	
	void takeDamage(int enemyStrength, boolean antiArmour, boolean slow) {
		if(this.getArmored()) {
			if(!antiArmour) {
				int currentHP=getHitPoints();
				this.setHitPoints(currentHP-enemyStrength/2);
			}
		} 
		else {
			int currentHP=getHitPoints();
			this.setHitPoints(currentHP-enemyStrength);
		}
		
		if(slow) {
			int currentSpeed = this.getSpeed();
			this.setSpeed(currentSpeed/2);
		}
	}
	
	public int stealCoins(){
		return this.getStrength()*10;
	}
	
	
	
	public Vector2D getPosition(){
		return this.position;
	}
	
	public void setPosition(Vector2D position){
		this.position = position;
	}
	
	public void setLevel(int level){
		this.level = level;
	}
	public int getLevel(){
		return this.level;
	}
	
	public void setReward(int reward){
		this.reward = reward;
	}
	public int getReward(){
		return this.reward;
	}
	
	public void setHitPoints(int hitPoints){
		this.hitPoints = hitPoints;
	}
	public int getHitPoints(){
		return this.hitPoints;
	}
	
	public void setStrength(int strength){
		this.strength = strength;
	}
	public int getStrength(){
		return this.strength;
	}
	
	public void setSpeed(int speed){
		this.speed = speed;
	}
	public int getSpeed(){
		return this.speed;
	}
	
	public void setArmored(boolean armoured){
		this.armoured = armoured;
	}
	public boolean getArmored(){
		return armoured;
	}
}
@@ -49,16 +49,46 @@
 ctor2D;%0A
+import main.model.Observable;%0A
 %0A%0Apublic
@@ -111,16 +111,35 @@
 Critter 
+extends Observable 
 %7B%0A%0A%09priv
@@ -1940,8 +1940,9 @@
 ed;%0A%09%7D%0A%7D
+%0A

Update Critter.java