Set up starting new game
This commit is contained in:
@@ -2,7 +2,7 @@ package org.project.entity;
|
||||
|
||||
public interface Entity {
|
||||
|
||||
public void specialAbility(Entity target);
|
||||
void specialAbility(Entity target);
|
||||
|
||||
void defend();
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.project.entity.enemies;
|
||||
|
||||
import org.project.entity.Entity;
|
||||
import org.project.item.weapons.Dagger;
|
||||
import org.project.item.weapons.Flame;
|
||||
import org.project.item.weapons.Weapon;
|
||||
|
||||
@@ -21,7 +20,7 @@ public class Dragon extends Enemy{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SpecialAbility(Entity target) {
|
||||
public void specialAbility(Entity target) {
|
||||
target.takeDamage(weapon.getDamage());
|
||||
}
|
||||
|
||||
@@ -37,6 +36,7 @@ public class Dragon extends Enemy{
|
||||
return maxHP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return "Dragon";
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ public abstract class Enemy implements Entity {
|
||||
private boolean defending = false;
|
||||
protected boolean lifeStealing = false;
|
||||
private boolean stunned = false;
|
||||
private boolean dodged = false;
|
||||
|
||||
public Enemy(int hp, Weapon weapon) {
|
||||
this.hp = hp;
|
||||
@@ -24,13 +25,20 @@ public abstract class Enemy implements Entity {
|
||||
target.takeDamage(weapon.getDamage());
|
||||
}
|
||||
|
||||
public abstract void SpecialAbility(Entity target);
|
||||
|
||||
@Override
|
||||
public void defend() {
|
||||
defending = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stun(boolean value) {
|
||||
stunned = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dodge(boolean value) {
|
||||
dodged = value;
|
||||
}
|
||||
|
||||
public int getHp() {
|
||||
return hp;
|
||||
@@ -51,4 +59,7 @@ public abstract class Enemy implements Entity {
|
||||
public boolean isStunned() {
|
||||
return stunned;
|
||||
}
|
||||
|
||||
public abstract String getName();
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Goblin extends Enemy{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SpecialAbility(Entity target) {
|
||||
public void specialAbility(Entity target) {
|
||||
target.takeDamage(criticalHit_damage);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public class Goblin extends Enemy{
|
||||
return maxHP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return "Goblin";
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Skeleton extends Enemy{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SpecialAbility(Entity target) {
|
||||
public void specialAbility(Entity target) {
|
||||
hp = maxHP/2; // revive
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ public class Skeleton extends Enemy{
|
||||
return maxHP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return "Skeleton";
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class Vampire extends Enemy{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void SpecialAbility(Entity target) {
|
||||
public void specialAbility(Entity target) {
|
||||
lifeStealing = true;
|
||||
target.takeDamage((8/10)*(weapon.getDamage()));
|
||||
hp += (int)((2/10)*(weapon.getDamage()));
|
||||
@@ -33,6 +33,7 @@ public class Vampire extends Enemy{
|
||||
return maxHP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(){
|
||||
return "Vampire";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user