Develop #1
@@ -1,7 +1,9 @@
|
|||||||
package org.project.Interface;
|
package org.project.Interface;
|
||||||
|
|
||||||
|
import org.project.constants.gameConstant.AttackPowerUp;
|
||||||
|
|
||||||
public interface IDamager {
|
public interface IDamager {
|
||||||
public void Damage(IDamageable target);
|
public void Damage(IDamageable target, int amount, AttackPowerUp[] powerUps);
|
||||||
public IDamager[] GetUtils();
|
public IDamageUtil[] GetUtils();
|
||||||
public int GetDamage();
|
public int GetDamage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package org.project.Interface;
|
||||||
|
|
||||||
|
import org.project.constants.gameConstant.FightMoves;
|
||||||
|
import org.project.entity.Entity;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public interface IFighter {
|
||||||
|
public void LightAttack(IDamageable target);
|
||||||
|
public void HeavyAttack(IDamageable target);
|
||||||
|
public void defend();
|
||||||
|
public void HealMove();
|
||||||
|
public void SpecialAbility(Entity entity);
|
||||||
|
public ArrayList<FightMoves> GetAvailableMoves();
|
||||||
|
|
||||||
|
public String GetSpecialAbilityDescription(Entity entity);
|
||||||
|
|
||||||
|
public String GetSpecialAbilityResultDescription(Entity entity);
|
||||||
|
}
|
||||||
@@ -2,5 +2,7 @@ package org.project.constants.gameConstant;
|
|||||||
|
|
||||||
public enum AttackPowerUp {
|
public enum AttackPowerUp {
|
||||||
ANTI_SHIELD,
|
ANTI_SHIELD,
|
||||||
ANTI_CUSTOM
|
ANTI_CUSTOM,
|
||||||
|
NO_DEFENSE,
|
||||||
|
INEVITABLE,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package org.project.constants.gameConstant;
|
||||||
|
|
||||||
|
public enum DefencePowerUp {
|
||||||
|
INVISIBLE,
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package org.project.constants.gameConstant;
|
||||||
|
|
||||||
|
public enum FightMoves {
|
||||||
|
LIGHT_ATTACK,
|
||||||
|
HEAVY_ATTACK,
|
||||||
|
HEAL,
|
||||||
|
DEFEND,
|
||||||
|
SPECIAL
|
||||||
|
}
|
||||||
@@ -1,13 +1,7 @@
|
|||||||
package org.project.entity;
|
package org.project.entity;
|
||||||
|
|
||||||
import org.project.Interface.IDamageable;
|
import org.project.Interface.*;
|
||||||
import org.project.Interface.IDefendable;
|
import org.project.constants.gameConstant.*;
|
||||||
import org.project.Interface.IDefender;
|
|
||||||
import org.project.Interface.IHealable;
|
|
||||||
import org.project.constants.gameConstant.AttackPowerUp;
|
|
||||||
import org.project.constants.gameConstant.EntityState;
|
|
||||||
import org.project.constants.gameConstant.ItemClass;
|
|
||||||
import org.project.constants.gameConstant.ItemClassExt;
|
|
||||||
import org.project.item.Accessory.Costume;
|
import org.project.item.Accessory.Costume;
|
||||||
import org.project.item.Accessory.Shield;
|
import org.project.item.Accessory.Shield;
|
||||||
import org.project.item.Accessory.Weapon;
|
import org.project.item.Accessory.Weapon;
|
||||||
@@ -15,22 +9,76 @@ import org.project.item.Item;
|
|||||||
import org.project.item.SellableItem;
|
import org.project.item.SellableItem;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public abstract class Entity implements IDamageable, IHealable, IDefendable {
|
public abstract class Entity implements IDamageable, IHealable, IDefendable, IFighter, IDamager {
|
||||||
|
|
||||||
|
public String Name;
|
||||||
public int MaxHealth;
|
public int MaxHealth;
|
||||||
public int Health;
|
public int Health;
|
||||||
|
private int Stamina;
|
||||||
|
protected int MaxStamina;
|
||||||
private long Money;
|
private long Money;
|
||||||
private int BaseDamage;
|
protected int BaseDamage;
|
||||||
private EntityState State;
|
private EntityState State;
|
||||||
public Weapon Weapon;
|
public Weapon Weapon;
|
||||||
public Shield Shield;
|
public Shield Shield;
|
||||||
public Costume Costume;
|
public Costume Costume;
|
||||||
public ArrayList<Item> Inventory;
|
public ArrayList<Item> Inventory;
|
||||||
|
protected int DefenseBonus;
|
||||||
|
public boolean IsDefending;
|
||||||
|
public ArrayList<DefencePowerUp> defencePowerUps;
|
||||||
|
protected int HealAmount;
|
||||||
|
protected int HeavyAttackStamina;
|
||||||
|
protected int SpecialAbilityStamina;
|
||||||
|
|
||||||
|
public Entity(String name, int maxHealth, int health, int stamina, int maxStamina, long money, int baseDamage, EntityState state, Weapon weapon,
|
||||||
|
Shield shield, Costume costume, ArrayList<Item> inventory, int defenseBonus, boolean isDefending, int healAmount) {
|
||||||
|
|
||||||
|
Name = name;
|
||||||
|
MaxHealth = maxHealth;
|
||||||
|
Health = health;
|
||||||
|
Stamina = stamina;
|
||||||
|
MaxStamina = maxStamina;
|
||||||
|
Money = money;
|
||||||
|
BaseDamage = baseDamage;
|
||||||
|
State = state;
|
||||||
|
Weapon = weapon;
|
||||||
|
Shield = shield;
|
||||||
|
Costume = costume;
|
||||||
|
Inventory = inventory;
|
||||||
|
DefenseBonus = defenseBonus;
|
||||||
|
IsDefending = isDefending;
|
||||||
|
HealAmount = healAmount;
|
||||||
|
HeavyAttackStamina = 50;
|
||||||
|
SpecialAbilityStamina = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Entity() {}
|
||||||
|
|
||||||
|
public int getStamina() { return Stamina; }
|
||||||
|
|
||||||
|
public void ResetStamina() { Stamina = MaxStamina; }
|
||||||
|
|
||||||
|
public void ModifyStamina(int amount, boolean dir) {
|
||||||
|
if (dir) {
|
||||||
|
Stamina += amount;
|
||||||
|
|
||||||
|
if (Stamina > MaxStamina) {
|
||||||
|
Stamina = MaxStamina;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Stamina -= amount;
|
||||||
|
if (Stamina < 0) {
|
||||||
|
Stamina = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public EntityState GetState() { return State; }
|
public EntityState GetState() { return State; }
|
||||||
|
|
||||||
public int GetBaseDamage() { return BaseDamage; }
|
@Override
|
||||||
|
public int GetDamage() { return BaseDamage; }
|
||||||
|
|
||||||
public long GetMoney() { return Money; }
|
public long GetMoney() { return Money; }
|
||||||
|
|
||||||
@@ -48,6 +96,10 @@ public abstract class Entity implements IDamageable, IHealable, IDefendable {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetState(EntityState state) {
|
||||||
|
State = state;
|
||||||
|
}
|
||||||
|
|
||||||
public void ModifyMoney(long amount, boolean dir) {
|
public void ModifyMoney(long amount, boolean dir) {
|
||||||
if (dir) {
|
if (dir) {
|
||||||
Money += amount;
|
Money += amount;
|
||||||
@@ -73,15 +125,28 @@ public abstract class Entity implements IDamageable, IHealable, IDefendable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void TakeDamage(int amount, AttackPowerUp[] powerUps) {
|
public void TakeDamage(int amount, AttackPowerUp[] powerUps) {
|
||||||
|
if (!defencePowerUps.contains(DefencePowerUp.INVISIBLE)) return;
|
||||||
|
|
||||||
IDefender[] defenders = GetDefenders();
|
IDefender[] defenders = GetDefenders();
|
||||||
|
|
||||||
|
if (Arrays.binarySearch(powerUps, AttackPowerUp.INEVITABLE) < 0) {
|
||||||
for (IDefender defender : defenders) {
|
for (IDefender defender : defenders) {
|
||||||
if (defender != null) {
|
if (defender != null) {
|
||||||
amount = defender.Apply(amount, powerUps);
|
amount = defender.Apply(amount, powerUps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsDefending) {
|
||||||
|
if (Arrays.binarySearch(powerUps, AttackPowerUp.INEVITABLE) < 0) {
|
||||||
|
amount -= DefenseBonus;
|
||||||
|
}
|
||||||
|
IsDefending = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (amount > 0) {
|
||||||
Health -= amount;
|
Health -= amount;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsDestroyed()) {
|
if (IsDestroyed()) {
|
||||||
HandleZeroHealth();
|
HandleZeroHealth();
|
||||||
@@ -120,4 +185,40 @@ public abstract class Entity implements IDamageable, IHealable, IDefendable {
|
|||||||
public void RemoveFromInventory(Item item) {
|
public void RemoveFromInventory(Item item) {
|
||||||
Inventory.remove(item);
|
Inventory.remove(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public abstract void LightAttack(IDamageable target);
|
||||||
|
@Override
|
||||||
|
public abstract void HeavyAttack(IDamageable target);
|
||||||
|
@Override
|
||||||
|
public void defend() {
|
||||||
|
IsDefending = true;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void HealMove() {
|
||||||
|
Heal(HealAmount);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public abstract void SpecialAbility(Entity entity);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FightMoves[] getAvailableMoves() {
|
||||||
|
ArrayList<FightMoves> result = new ArrayList<>();
|
||||||
|
result.add(FightMoves.DEFEND);
|
||||||
|
result.add(FightMoves.LIGHT_ATTACK);
|
||||||
|
|
||||||
|
if (Health < MaxHealth) {
|
||||||
|
result.add(FightMoves.HEAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Stamina > MaxStamina / 2) {
|
||||||
|
result.add(FightMoves.SPECIAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Stamina > MaxStamina / 4) {
|
||||||
|
result.add(FightMoves.HEAVY_ATTACK);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.toArray(new FightMoves[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package org.project.entity.players;
|
||||||
|
|
||||||
|
import org.project.constants.gameConstant.AttackPowerUp;
|
||||||
|
import org.project.constants.gameConstant.EntityState;
|
||||||
|
import org.project.entity.Entity;
|
||||||
|
import org.project.item.Accessory.Costume;
|
||||||
|
import org.project.item.Accessory.Shield;
|
||||||
|
import org.project.item.Accessory.Weapon;
|
||||||
|
import org.project.item.Item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Assassin extends Player {
|
||||||
|
public Assassin(String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon,
|
||||||
|
Shield shield, Costume costume, ArrayList<Item> inventory, int defenseBonus, boolean isDefending,
|
||||||
|
int healAmount, int stamina, int maxStamina, int level, int levelProgress) {
|
||||||
|
|
||||||
|
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina, level, levelProgress);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Assassin(String name, int level) {
|
||||||
|
this(name);
|
||||||
|
LevelUpTo(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Assassin(String name) {
|
||||||
|
this(name, 125, 125, 100, 15, EntityState.ALIVE, null, null, null, new ArrayList<>(), 5, false, 35, 100, 100, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void SpecialAbility(Entity entity) {
|
||||||
|
ModifyStamina(SpecialAbilityStamina, false);
|
||||||
|
entity.SetState(EntityState.FROZEN);
|
||||||
|
Damage(entity, GetDamage() * 3, new AttackPowerUp[]{AttackPowerUp.NO_DEFENSE});
|
||||||
|
Heal(MaxHealth/4);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String GetSpecialAbilityDescription(Entity entity) {
|
||||||
|
return "Turn invisible and cause a critical damage to " + entity.Name + ". Your enemy cannot defend your attack \n";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String GetSpecialAbilityResultDescription(Entity entity) {
|
||||||
|
if (entity.IsDefending) {
|
||||||
|
return entity.Name + " Holds their guard up, but you strike them from another direction";
|
||||||
|
}
|
||||||
|
return "\"Show Yourself coward\" Says " + entity.Name + " As they helplessly try to hit you. But their eyes cannot find you no matter how hard they try";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,50 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
// TODO: UPDATE IMPLEMENTATION
|
import org.project.constants.gameConstant.AttackPowerUp;
|
||||||
public class Knight {
|
import org.project.constants.gameConstant.EntityState;
|
||||||
// TODO: DESIGN KNIGHT'S WEAPON AND ARMOR AND IMPLEMENT THE CONSTRUCTOR
|
import org.project.entity.Entity;
|
||||||
|
import org.project.item.Accessory.Costume;
|
||||||
|
import org.project.item.Accessory.Shield;
|
||||||
|
import org.project.item.Accessory.Weapon;
|
||||||
|
import org.project.item.Item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Knight extends Player {
|
||||||
|
public Knight(String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon,
|
||||||
|
Shield shield, Costume costume, ArrayList<Item> inventory, int defenseBonus, boolean isDefending,
|
||||||
|
int healAmount, int stamina, int maxStamina, int level, int levelProgress) {
|
||||||
|
|
||||||
|
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina, level, levelProgress);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Knight(String name, int level) {
|
||||||
|
this(name);
|
||||||
|
LevelUpTo(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Knight(String name) {
|
||||||
|
this(name, 150, 150, 100, 20, EntityState.ALIVE, null, null, null, new ArrayList<>(), 8, false, 30, 100, 100, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void SpecialAbility(Entity entity) {
|
||||||
|
ModifyStamina(SpecialAbilityStamina, false);
|
||||||
|
Damage(entity, GetDamage(), new AttackPowerUp[]{});
|
||||||
|
entity.SetState(EntityState.FROZEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String GetSpecialAbilityDescription(Entity entity) {
|
||||||
|
return "Slam " + entity.Name + "with your unstoppable strength and stun them for the next turn";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String GetSpecialAbilityResultDescription(Entity entity) {
|
||||||
|
if (entity.IsDefending) {
|
||||||
|
return "You slammed " + entity.Name + ", they try to defend, but they were thrown to the ground";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "You slammed " + entity.Name + ", your enemy seems deezy";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,89 +1,113 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
|
import org.project.Interface.IDamageUtil;
|
||||||
|
import org.project.Interface.IDamageable;
|
||||||
|
import org.project.constants.gameConstant.AttackPowerUp;
|
||||||
|
import org.project.constants.gameConstant.EntityState;
|
||||||
import org.project.entity.Entity;
|
import org.project.entity.Entity;
|
||||||
import org.project.item.armors.Armor;
|
import org.project.item.Accessory.Costume;
|
||||||
import org.project.item.weapons.Weapon;
|
import org.project.item.Accessory.Shield;
|
||||||
|
import org.project.item.Accessory.Weapon;
|
||||||
|
import org.project.item.Item;
|
||||||
|
|
||||||
// TODO: UPDATE IMPLEMENTATION
|
import java.util.ArrayList;
|
||||||
public abstract class Player {
|
|
||||||
protected String name;
|
|
||||||
Weapon weapon;
|
|
||||||
Armor armor;
|
|
||||||
private int hp;
|
|
||||||
private int maxHP;
|
|
||||||
private int mp;
|
|
||||||
private int maxMP;
|
|
||||||
|
|
||||||
public Player(String name, int hp, int mp, Weapon weapon, Armor armor) {
|
public abstract class Player extends Entity {
|
||||||
this.name = name;
|
public int Level;
|
||||||
this.hp = hp;
|
private int LevelProgress;
|
||||||
this.mp = mp;
|
|
||||||
|
|
||||||
this.weapon = weapon;
|
public Player (String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon,
|
||||||
this.armor = armor;
|
Shield shield, Costume costume, ArrayList<Item> inventory, int defenseBonus, boolean isDefending,
|
||||||
|
int healAmount, int stamina, int maxStamina, int level, int levelProgress) {
|
||||||
|
|
||||||
|
super(name, maxHealth, health, stamina, maxStamina, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount);
|
||||||
|
|
||||||
|
Level = level;
|
||||||
|
LevelProgress = levelProgress;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Player() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LevelUpTo(int level) {
|
||||||
|
while (Level < level) {
|
||||||
|
LevelUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddLevelProgress(int amount) {
|
||||||
|
LevelProgress += amount;
|
||||||
|
|
||||||
|
if (LevelProgress >= 100) {
|
||||||
|
LevelUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LevelUp() {
|
||||||
|
Level++;
|
||||||
|
double upgradeRatio = (1.1 + ((double) Level * 0.02));
|
||||||
|
int gift = Level * 10;
|
||||||
|
|
||||||
|
LevelProgress -= 100;
|
||||||
|
MaxStamina = (int) (MaxStamina * upgradeRatio);
|
||||||
|
MaxHealth = (int) (MaxHealth * upgradeRatio);
|
||||||
|
BaseDamage = (int) (BaseDamage * upgradeRatio);
|
||||||
|
DefenseBonus = (int) (DefenseBonus * upgradeRatio);
|
||||||
|
HealAmount = (int) (HealAmount * upgradeRatio);
|
||||||
|
ModifyMoney(gift, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attack(Entity target) {
|
public int GetDamage() {
|
||||||
target.takeDamage(weapon.getDamage());
|
int damage = BaseDamage;
|
||||||
|
IDamageUtil[] utils = GetUtils();
|
||||||
|
|
||||||
|
for (IDamageUtil util : utils) {
|
||||||
|
if (util != null) {
|
||||||
|
damage += util.GetDamage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void defend() {
|
public IDamageUtil[] GetUtils() {
|
||||||
// TODO
|
return new IDamageUtil[] {Weapon};
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void takeDamage(int damage) {
|
|
||||||
hp -= damage - armor.GetDefense();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void heal(int health) {
|
public void Damage(IDamageable target, int amount, AttackPowerUp[] powerUps) {
|
||||||
hp += health;
|
target.TakeDamage(amount, powerUps);
|
||||||
if (hp > maxHP) {
|
|
||||||
hp = maxHP;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fillMana(int mana) {
|
public void LightAttack(IDamageable target) {
|
||||||
mp += mana;
|
int damage = GetDamage();
|
||||||
if (mp > maxMP) {
|
|
||||||
mp = maxMP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Damage(target, (int)(damage * 0.5), new AttackPowerUp[]{});
|
||||||
public String getName() {
|
ModifyStamina(MaxStamina/8, true);
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHp() {
|
|
||||||
return hp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxHP() {
|
public void HeavyAttack(IDamageable target) {
|
||||||
return maxHP;
|
int damage = GetDamage();
|
||||||
}
|
ModifyStamina(HeavyAttackStamina, false);
|
||||||
|
|
||||||
public int getMp() {
|
Damage(target, damage, new AttackPowerUp[]{});
|
||||||
return mp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxMP() {
|
public void HealMove() {
|
||||||
return maxMP;
|
super.HealMove();
|
||||||
|
ModifyStamina(MaxStamina/4, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Weapon getWeapon() {
|
@Override
|
||||||
return weapon;
|
public abstract void SpecialAbility(Entity entity);
|
||||||
}
|
|
||||||
|
|
||||||
public Armor getArmor() {
|
public abstract String GetSpecialAbilityDescription(Entity entity);
|
||||||
return armor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public abstract String GetSpecialAbilityResultDescription(Entity entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package org.project.entity.players;
|
||||||
|
|
||||||
|
import org.project.constants.gameConstant.AttackPowerUp;
|
||||||
|
import org.project.constants.gameConstant.EntityState;
|
||||||
|
import org.project.entity.Entity;
|
||||||
|
import org.project.item.Accessory.Costume;
|
||||||
|
import org.project.item.Accessory.Shield;
|
||||||
|
import org.project.item.Accessory.Weapon;
|
||||||
|
import org.project.item.Item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Wizard extends Player {
|
||||||
|
public Wizard(String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon,
|
||||||
|
Shield shield, Costume costume, ArrayList<Item> inventory, int defenseBonus, boolean isDefending,
|
||||||
|
int healAmount, int stamina, int maxStamina, int level, int levelProgress) {
|
||||||
|
|
||||||
|
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina, level, levelProgress);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Wizard(String name, int level) {
|
||||||
|
this(name);
|
||||||
|
LevelUpTo(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Wizard(String name) {
|
||||||
|
this(name, 100, 100, 100, 15, EntityState.ALIVE, null, null, null, new ArrayList<>(), 5, false, 40, 100, 100, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void SpecialAbility(Entity entity) {
|
||||||
|
ModifyStamina(SpecialAbilityStamina, false);
|
||||||
|
Damage(entity, GetDamage() * 3, new AttackPowerUp[]{AttackPowerUp.INEVITABLE});
|
||||||
|
Heal(MaxHealth/4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String GetSpecialAbilityDescription(Entity entity) {
|
||||||
|
return "Cast a spell to damage " + entity.Name + "and heal yourself. Your spell will pass enemy's defences";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String GetSpecialAbilityResultDescription(Entity entity) {
|
||||||
|
return "You cased the spell, enemy cannot do anything but to look at you with fear";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user