enhance Leveling process

This commit is contained in:
2026-07-11 15:25:13 +03:30
parent 5f1ffd2520
commit 380e5fbca0
6 changed files with 28 additions and 23 deletions
@@ -15,15 +15,15 @@ import java.util.ArrayList;
public class Dragon extends Enemy {
public Dragon (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 healAmount, int stamina, int maxStamina, int levelProgressAmount) {
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina);
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina, levelProgressAmount);
this.Key = new KeyItem("Dragon Key", this);
}
public Dragon() {
this("Dragon", 5000, 5000, 0, 100, EntityState.ALIVE, null, null, null, new ArrayList<>(){}, 50, false, 50, 500, 500);
this("Dragon", 5000, 5000, 0, 100, EntityState.ALIVE, null, null, null, new ArrayList<>(){}, 50, false, 50, 500, 500, 1000);
}
@Override
@@ -20,14 +20,16 @@ import java.util.Random;
public abstract class Enemy extends Entity {
protected KeyItem Key;
public int LevelProgressAmount;
public Enemy (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 healAmount, int stamina, int maxStamina, int levelProgressAmount) {
super(name, maxHealth, health, stamina, maxStamina, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount);
Key = new KeyItem(null, this);
LevelProgressAmount = levelProgressAmount;
}
protected Enemy() {
@@ -14,15 +14,15 @@ import java.util.ArrayList;
public class Goblin extends Enemy {
public Goblin (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 healAmount, int stamina, int maxStamina, int levelProgressAmount) {
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina);
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina, levelProgressAmount);
this.Key = new KeyItem("Goblin Key", this);
}
public Goblin() {
this("Goblin", 75, 75, 100, 10, EntityState.ALIVE, null, null, null, new ArrayList<>(), 5, false, 15, 100, 100);
this("Goblin", 75, 75, 100, 10, EntityState.ALIVE, null, null, null, new ArrayList<>(), 5, false, 15, 100, 100, 50);
}
@Override
@@ -18,15 +18,15 @@ public class Skeleton extends Enemy {
public Skeleton (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 healAmount, int stamina, int maxStamina, int levelProgressAmount) {
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina);
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina, levelProgressAmount);
this.Key = new KeyItem("Skeleton Key", this);
}
public Skeleton() {
this("Skeleton", 125, 125, 200, 15, EntityState.ALIVE, null, null, null, new ArrayList<>(), 5, false, 20, 100, 100);
this("Skeleton", 125, 125, 200, 15, EntityState.ALIVE, null, null, null, new ArrayList<>(), 5, false, 20, 100, 100, 100);
}
@Override
@@ -76,6 +76,7 @@ public class Skeleton extends Enemy {
SetState(EntityState.ALIVE);
Health = MaxHealth / 2;
HasRevived = true;
entity.SetState(EntityState.FROZEN);
}
@Override
@@ -14,15 +14,15 @@ import java.util.ArrayList;
public class Vampire extends Enemy {
public Vampire (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 healAmount, int stamina, int maxStamina, int levelProgressAmount) {
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina);
super(name, maxHealth, health, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount, stamina, maxStamina, levelProgressAmount);
this.Key = new KeyItem("Vampire Key", this);
}
public Vampire() {
this("Vampire", 150, 150, 300, 20, EntityState.ALIVE, null, null, null, new ArrayList<>(), 8, false, 30, 100, 100);
this("Vampire", 150, 150, 300, 20, EntityState.ALIVE, null, null, null, new ArrayList<>(), 8, false, 30, 100, 100, 150);
}
@Override
@@ -44,6 +44,7 @@ public abstract class Player extends Entity {
}
public void LevelUp() {
while (LevelProgress >= 100) {
Level++;
double upgradeRatio = (1.1 + ((double) Level * 0.02));
int gift = Level * 10;
@@ -56,6 +57,7 @@ public abstract class Player extends Entity {
HealAmount = (int) (HealAmount * upgradeRatio);
ModifyMoney(gift, true);
}
}
@Override
public void LightAttack(IDamageable target) {