edit Knight and Wizard and Assassin

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