edit Knight and Wizard and Assassin
This commit is contained in:
@@ -1,27 +1,25 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
import org.project.entity.Entity;
|
import org.project.entity.enemies.Enemy;
|
||||||
import org.project.item.armors.Armor;
|
|
||||||
import org.project.item.weapons.Weapon;
|
|
||||||
|
|
||||||
public class Assassin extends Player{
|
public class Assassin extends Player{
|
||||||
|
|
||||||
public Assassin(String name, int hp, int maxHP, int mp, int maxMP, Weapon weapon, Armor armor) {
|
private final static PlayerStats stats = new PlayerStats(9, 12,
|
||||||
super(name, hp, maxHP, mp, maxMP, weapon, armor);
|
17, 20,
|
||||||
|
12, 20, 24,
|
||||||
|
210, 75);
|
||||||
|
|
||||||
|
public Assassin(String name) {
|
||||||
|
super(name,stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attack(Entity target) {
|
public void heavyAttack(Enemy target) { target.takeDamage(stats.heavyAttackDamage);}
|
||||||
|
|
||||||
if(reduceMana(getWeapon().getManaCost())){ //checking if the player has enough Mana
|
@Override
|
||||||
|
public void specialAbility(Enemy target) {
|
||||||
setDefensing(true); //dodging the next incoming attack
|
System.out.println("You turned invisible");
|
||||||
target.takeDamage(getWeapon().getDamage() * 2); // causing more damage than normal
|
target.takeDamage(stats.specialAbilityDamage); // causing damage
|
||||||
System.out.println(getName() + " (Assassin \uD83D\uDDE1\uFE0F) turned invisible.");
|
setDefensing(true); //dodging the next incoming attack
|
||||||
}
|
|
||||||
else{
|
|
||||||
System.out.println(getName() + " (Assassin \uD83D\uDDE1\uFE0F) dose not have enough Mana\n" +
|
|
||||||
"Choose another action...");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,26 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
import org.project.entity.Entity;
|
|
||||||
import org.project.entity.enemies.Enemy;
|
import org.project.entity.enemies.Enemy;
|
||||||
import org.project.item.armors.Armor;
|
|
||||||
import org.project.item.weapons.Weapon;
|
|
||||||
|
|
||||||
|
|
||||||
public class Knight extends Player {
|
public class Knight extends Player {
|
||||||
|
|
||||||
public Knight(String name, int hp, int maxHP, int mp, int maxMP, Weapon weapon, Armor armor) {
|
private final static PlayerStats stats = new PlayerStats(10, 10,
|
||||||
super(name, hp, maxHP, mp, maxMP, weapon, armor);
|
16, 22,
|
||||||
|
18, 28, 34,
|
||||||
|
180, 70);
|
||||||
|
|
||||||
|
public Knight(String name) {
|
||||||
|
super(name, stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attack(Entity target) {//heavy attack
|
public void heavyAttack(Enemy target) { target.takeDamage(stats.heavyAttackDamage); }
|
||||||
|
|
||||||
if(reduceMana(getWeapon().getManaCost())) { //checking if the player has enough Mana
|
@Override
|
||||||
target.takeDamage(getWeapon().getDamage()); //causing damage
|
public void specialAbility(Enemy target) {
|
||||||
|
target.takeDamage(stats.specialAbilityDamage); //causing damage
|
||||||
if (target instanceof Enemy) {
|
target.setStunned(true); //stun the enemy
|
||||||
Enemy enemy = (Enemy) target;
|
System.out.println(getName() + "You performed a shield bash that stunned the enemy.");
|
||||||
enemy.setStunned(true); //stun the enemy
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println(getName() + " (Knight ⚔️) performed a shield bash that stunned the enemy.");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
System.out.println(getName() + " (Knight ⚔️) dose not have enough Mana\n" +
|
|
||||||
"Choose another action...");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,30 +1,23 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
import org.project.entity.Entity;
|
import org.project.entity.enemies.Enemy;
|
||||||
import org.project.item.armors.Armor;
|
|
||||||
import org.project.item.weapons.Weapon;
|
|
||||||
|
|
||||||
public class Wizard extends Player{
|
public class Wizard extends Player{
|
||||||
|
|
||||||
public Wizard(String name, int hp, int maxHP, int mp, int maxMP, Weapon weapon, Armor armor) {
|
private final static PlayerStats stats = new PlayerStats(11, 9,
|
||||||
super(name, hp, maxHP, mp, maxMP, weapon, armor);
|
18, 24,
|
||||||
}
|
14, 22, 30,
|
||||||
|
240, 55);
|
||||||
|
|
||||||
|
public Wizard(String name) { super(name, stats); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attack(Entity target) { //heavy attack
|
public void heavyAttack(Enemy target) { target.takeDamage(stats.heavyAttackDamage);}
|
||||||
|
|
||||||
Weapon weapon = super.getWeapon();
|
@Override
|
||||||
|
public void specialAbility(Enemy target) {
|
||||||
if(reduceMana(weapon.getManaCost())){ //checking if the player has enough Mana
|
target.takeDamage(stats.specialAbilityDamage); //causing damage
|
||||||
|
heal(20); //replenishing HP
|
||||||
target.takeDamage(weapon.getDamage()); //causing damage
|
System.out.println("You cast a devastating spell");
|
||||||
heal(20); //replenishing HP
|
|
||||||
System.out.println(getName() + " (Wizard \uD83E\uDDD9\u200D♂\uFE0F) cast a devastating spell");
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
System.out.println(getName() + " (Wizard \uD83E\uDDD9\u200D♂\uFE0F) dose not have enough Mana\n" +
|
|
||||||
"Choose another action...");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user