develop #2
@@ -1,4 +1,27 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
public class Assassin {
|
import org.project.entity.Entity;
|
||||||
|
import org.project.item.armors.Armor;
|
||||||
|
import org.project.item.weapons.Weapon;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attack(Entity target) {
|
||||||
|
|
||||||
|
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...");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,33 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
// TODO: UPDATE IMPLEMENTATION
|
import org.project.entity.Entity;
|
||||||
public class Knight {
|
import org.project.entity.enemies.Enemy;
|
||||||
// TODO: DESIGN KNIGHT'S WEAPON AND ARMOR AND IMPLEMENT THE CONSTRUCTOR
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attack(Entity target) {//heavy attack
|
||||||
|
|
||||||
|
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...");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,30 @@
|
|||||||
package org.project.entity.players;
|
package org.project.entity.players;
|
||||||
|
|
||||||
public class Wizard {
|
import org.project.entity.Entity;
|
||||||
|
import org.project.item.armors.Armor;
|
||||||
|
import org.project.item.weapons.Weapon;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void attack(Entity target) { //heavy attack
|
||||||
|
|
||||||
|
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...");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user