Minor changes for the game. New README.md implemented

This commit is contained in:
2026-05-11 14:23:10 +03:30
parent 6958fc396f
commit 84675dda65
16 changed files with 76 additions and 255 deletions
@@ -19,9 +19,7 @@ public interface Entity {
int getHealManaCost();
int getDefendManaCost();
void skipNextTurn();
void skipTurn();
/*
TODO: ADD OTHER REQUIRED AND BONUS METHODS
*/
// void skipNextTurn(); /disabled
// void skipTurn(); /disabled
}
@@ -3,16 +3,14 @@ package org.project.entity.enemies;
import org.project.entity.Entity;
import org.project.item.weapons.Weapon;
// TODO: UPDATE IMPLEMENTATION
public abstract class Enemy implements Entity {
Weapon weapon;
private int hp;
private int maxHP;
private int mp;
private int maxMP;
private boolean canPlayThisTurn = true;
// private boolean canPlayThisTurn = true;
private boolean isDefendingThisTurn = false;
private boolean isAlive;
private int healManaCost;
private int defendManaCost;
public Enemy(int hp, int mp, Weapon weapon,
@@ -65,14 +63,14 @@ public abstract class Enemy implements Entity {
mp = 0;
}
}
@Override
public void skipNextTurn() {
this.canPlayThisTurn = false;
}
@Override
public void skipTurn() {
this.canPlayThisTurn = true;
}
// @Override //disabled
// public void skipNextTurn() {
// this.canPlayThisTurn = false;
// }
// @Override //disabled
// public void skipTurn() {
// this.canPlayThisTurn = true;
// }
@Override
public String getType() {
return "Enemy";
@@ -5,7 +5,6 @@ import org.project.item.weapons.Weapon;
import java.util.Random;
// TODO: UPDATE IMPLEMENTATION
public class Skeleton extends Enemy implements Key {
private static int DEFAULT_HP = 100;
private static int DEFAULT_MP = 100;
@@ -61,5 +60,4 @@ public class Skeleton extends Enemy implements Key {
keysRemaining = 1;
}
// TODO: DESIGN ENEMY AND IMPLEMENT THE CONSTRUCTOR
}
@@ -3,7 +3,6 @@ package org.project.entity.players;
import org.project.item.weapons.Sword;
import org.project.item.weapons.Weapon;
// TODO: UPDATE IMPLEMENTATION
public class Knight extends Player {
private static int DEFAULT_HP = 100;
private static int DEFAULT_MP = 80;
@@ -35,5 +34,4 @@ public class Knight extends Player {
// TODO: DESIGN KNIGHT'S WEAPON AND ARMOR AND IMPLEMENT THE CONSTRUCTOR
}
@@ -6,7 +6,6 @@ import org.project.item.weapons.Weapon;
import java.util.ArrayList;
// TODO: UPDATE IMPLEMENTATION
public abstract class Player implements Entity{
protected String name;
Weapon weapon;
@@ -86,14 +85,14 @@ public abstract class Player implements Entity{
}
}
@Override
public void skipNextTurn() {
this.canPlayThisTurn = false;
}
@Override
public void skipTurn() {
this.canPlayThisTurn = true;
}
// @Override
// public void skipNextTurn() {
// this.canPlayThisTurn = false;
// }
// @Override
// public void skipTurn() {
// this.canPlayThisTurn = true;
// }
public String getName() {
return name;
}
@@ -1,42 +0,0 @@
package org.project.item.armors;
// TODO: UPDATE IMPLEMENTATION
public abstract class Armor {
private int defense;
private int maxDefense;
private int durability;
private int maxDurability;
private boolean isBroke;
public Armor(int defense, int durability) {
this.defense = defense;
this.durability = durability;
}
public void checkBreak() {
if (durability <= 0) {
isBroke = true;
defense = 0;
}
}
// TODO: (BONUS) UPDATE THE REPAIR METHOD
public void repair() {
isBroke = false;
defense = maxDefense;
durability = maxDurability;
}
public int getDefense() {
return defense;
}
public int getDurability() {
return durability;
}
public boolean isBroke() {
return isBroke;
}
}
@@ -1,6 +0,0 @@
package org.project.item.armors;
// TODO: UPDATE IMPLEMENTATION
public class KnightArmor {
// TODO: DESIGN ARMOR'S ATTRIBUTES IMPLEMENT THE CONSTRUCTOR
}
@@ -23,7 +23,6 @@ public class BoneHarpoon extends Weapon{
@Override
public String getExplanation() {
return "Melee slashing tool for skeletons.\n"+
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost() +
"\nSpecial ability: When used by the skeleton, it resurrects with 50% hp.";
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost();
}
}
@@ -24,7 +24,6 @@ public class Dagger extends Weapon{
@Override
public String getExplanation() {
return "Melee piercing for Assassins.\n"+
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost() +
"\nSpecial ability: Inflicts 40 damage";
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost();
}
}
@@ -23,7 +23,6 @@ public class Fireball extends Weapon{
@Override
public String getExplanation() {
return "Magical balls of fire for Wizards.\n"+
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost() +
"\nSpecial ability: Throws 3 fireballs at once inflicting 3 times the normal damage.\n";
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost();
}
}
@@ -24,8 +24,7 @@ public class GoblinSickle extends Weapon {
@Override
public String getExplanation() {
return "Melee slashing tool for goblins. Causes bleeding over time.\n" +
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost() +
"Special ability: The target takes twice the normal damage.";
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost();
}
}
@@ -25,7 +25,6 @@ public class MirrorClaws extends Weapon{
@Override
public String getExplanation() {
return "Melee slashing weapon for vampires. Inflicts \"reflection\" debuff.\n" +
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost() +
"\nSpecial ability: reduces target's mana by 30 on top of normal damage.";
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost();
}
}
@@ -26,6 +26,6 @@ public class Sword extends Weapon {
}
@Override
public String getExplanation() {
return "Melee piercing/bludgeoning for knights. Ignores armor on critical hits.";
return "Melee piercing/bludgeoning for knights.";
}
}
@@ -16,7 +16,7 @@ public class TailScythe extends Weapon{
public void useSpecialAbility(Entity attacker, Entity target) {
target.takeDamage(this.getDamage() + 20);
attacker.reduceMana(this.getManaCost() + 5);
target.skipNextTurn();
// target.skipNextTurn(); disabled
}
@Override
public String getType() {
@@ -25,7 +25,6 @@ public class TailScythe extends Weapon{
@Override
public String getExplanation() {
return "Melee sweeping attack for Dragons. Hitting targets with its tail.\n" +
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost() +
"Special ability:The target takes +20 damage than normal attack. Also loses their next turn.";
"Damage: "+ this.getDamage() +" Mana cost: " + this.getManaCost();
}
}
@@ -3,16 +3,11 @@ package org.project.item.weapons;
import org.project.entity.Entity;
import org.project.item.Item;
// TODO: UPDATE IMPLEMENTATION
public abstract class Weapon implements Item {
private int damage;
private int manaCost;
private int specialMana;
/*
TODO: ADD OTHER REQUIRED AND BONUS ATTRIBUTES
*/
public Weapon(int damage, int manaCost, int specialMana) {
this.damage = damage;
this.manaCost = manaCost;
@@ -51,7 +46,5 @@ public abstract class Weapon implements Item {
attacker.reduceMana(this.getManaCost());
}
public abstract void useSpecialAbility(Entity attacker, Entity target);
/*
TODO: ADD OTHER REQUIRED AND BONUS METHODS
*/
}