package avs.models;

import avs.utils.Animator;
import avs.utils.Textures;

import java.util.ArrayList;
import java.awt.image.*;
import java.awt.*;

import javax.swing.*;

public class Tc7 extends Plant {
	Animator anim;
	BufferedImage notEaten;
	BufferedImage halfEaten;
	BufferedImage badlyEaten;

    public Tc7(Textures texx){
		super(100, 114, 50, texx);
		this.hp = 200;
		//this.animation = texx.getTc7Array();
		//anim = new Animator(5,animation);

		this.notEaten = texx.getTc7Frame(0);
		this.halfEaten = texx.getTc7Frame(1);
		this.badlyEaten = texx.getTc7Frame(2);
	}

	public Tc7(double x, double y, Textures texx){
		super(x,y,100,114,50,texx);
		this.animation = texx.getTc7Array();
		anim = new Animator(5,animation);
	}

	public void tick(){

	}

	public void render(Graphics g){
		//g.drawImage(busImage, (int)this.getX(), (int)this.getY(), null);
		//anim.drawAnimation(g,getX(),getY(),width,height,0);
		if(this.hp >= 100){
			g.drawImage(notEaten, (int)this.getX(), (int)this.getY(),width,height, null);
		}
		else if(this.hp < 100 && this.hp >= 50){
			g.drawImage(halfEaten, (int)this.getX(), (int)this.getY(),width,height, null);	
		}
		else if(this.hp < 50 && this.hp > 0){
			g.drawImage(badlyEaten, (int)this.getX(), (int)this.getY(),width,height, null);	
		}
	}
}

@@ -384,17 +384,17 @@
 is.hp = 
-2
+6
 00;%0D%0A%09%09/
@@ -972,17 +972,17 @@
 s.hp %3E= 
-1
+4
 00)%7B%0D%0A%09%09
@@ -1086,17 +1086,17 @@
 is.hp %3C 
-1
+4
 00 && th
@@ -1104,17 +1104,18 @@
 s.hp %3E= 
-5
+20
 0)%7B%0D%0A%09%09%09
@@ -1184,33 +1184,32 @@
 h,height, null);
-%09
 %0D%0A%09%09%7D%0D%0A%09%09else if
@@ -1219,17 +1219,18 @@
 is.hp %3C 
-5
+20
 0 && thi
@@ -1323,17 +1323,16 @@
 , null);
-%09
 %0D%0A%09%09%7D%0D%0A%09

Update hp