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 class Dragon extends Enemy {
public Dragon (String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon, 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, 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); this.Key = new KeyItem("Dragon Key", this);
} }
public Dragon() { 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 @Override
@@ -20,14 +20,16 @@ import java.util.Random;
public abstract class Enemy extends Entity { public abstract class Enemy extends Entity {
protected KeyItem Key; protected KeyItem Key;
public int LevelProgressAmount;
public Enemy (String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon, 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, 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); super(name, maxHealth, health, stamina, maxStamina, money, baseDamage, state, weapon, shield, costume, inventory, defenseBonus, isDefending, healAmount);
Key = new KeyItem(null, this); Key = new KeyItem(null, this);
LevelProgressAmount = levelProgressAmount;
} }
protected Enemy() { protected Enemy() {
@@ -14,15 +14,15 @@ import java.util.ArrayList;
public class Goblin extends Enemy { public class Goblin extends Enemy {
public Goblin (String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon, 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, 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); this.Key = new KeyItem("Goblin Key", this);
} }
public Goblin() { 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 @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, 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, 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); this.Key = new KeyItem("Skeleton Key", this);
} }
public Skeleton() { 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 @Override
@@ -76,6 +76,7 @@ public class Skeleton extends Enemy {
SetState(EntityState.ALIVE); SetState(EntityState.ALIVE);
Health = MaxHealth / 2; Health = MaxHealth / 2;
HasRevived = true; HasRevived = true;
entity.SetState(EntityState.FROZEN);
} }
@Override @Override
@@ -14,15 +14,15 @@ import java.util.ArrayList;
public class Vampire extends Enemy { public class Vampire extends Enemy {
public Vampire (String name, int maxHealth, int health, long money, int baseDamage, EntityState state, Weapon weapon, 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, 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); this.Key = new KeyItem("Vampire Key", this);
} }
public Vampire() { 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 @Override
@@ -44,17 +44,19 @@ public abstract class Player extends Entity {
} }
public void LevelUp() { public void LevelUp() {
Level++; while (LevelProgress >= 100) {
double upgradeRatio = (1.1 + ((double) Level * 0.02)); Level++;
int gift = Level * 10; double upgradeRatio = (1.1 + ((double) Level * 0.02));
int gift = Level * 10;
LevelProgress -= 100; LevelProgress -= 100;
MaxStamina = (int) (MaxStamina * upgradeRatio); MaxStamina = (int) (MaxStamina * upgradeRatio);
MaxHealth = (int) (MaxHealth * upgradeRatio); MaxHealth = (int) (MaxHealth * upgradeRatio);
BaseDamage = (int) (BaseDamage * upgradeRatio); BaseDamage = (int) (BaseDamage * upgradeRatio);
DefenseBonus = (int) (DefenseBonus * upgradeRatio); DefenseBonus = (int) (DefenseBonus * upgradeRatio);
HealAmount = (int) (HealAmount * upgradeRatio); HealAmount = (int) (HealAmount * upgradeRatio);
ModifyMoney(gift, true); ModifyMoney(gift, true);
}
} }
@Override @Override