From d1beb23cd47d531fb24198296b4067e75cfdcb0e Mon Sep 17 00:00:00 2001 From: Jan Ehehalt Date: Thu, 2 Jul 2020 11:24:07 +0200 Subject: [PATCH] funktioniert eigentlich noch gar net lol --- core/src/com/dungeoncrawler/control/Controller.java | 2 ++ core/src/com/dungeoncrawler/model/Entity.java | 12 ++++++++++++ .../com/dungeoncrawler/model/entities/Archer.java | 1 + .../dungeoncrawler/model/entities/Darkarcher.java | 1 + .../dungeoncrawler/model/entities/Darkswordsman.java | 1 + .../dungeoncrawler/model/entities/Darkwizard.java | 1 + .../dungeoncrawler/model/entities/Earthwizard.java | 1 + .../dungeoncrawler/model/entities/Firearcher.java | 1 + .../dungeoncrawler/model/entities/Fireswordsman.java | 1 + .../dungeoncrawler/model/entities/Firewizard.java | 1 + .../dungeoncrawler/model/entities/Healwizard.java | 1 + .../com/dungeoncrawler/model/entities/Icearcher.java | 1 + .../dungeoncrawler/model/entities/Iceswordsman.java | 1 + .../com/dungeoncrawler/model/entities/Icewizard.java | 1 + .../dungeoncrawler/model/entities/Naturewizard.java | 1 + .../com/dungeoncrawler/model/entities/Player.java | 11 +++++++---- .../com/dungeoncrawler/model/entities/Swordsman.java | 1 + .../dungeoncrawler/model/entities/Waterwizard.java | 1 + .../com/dungeoncrawler/model/entities/Wizard.java | 1 + 19 files changed, 37 insertions(+), 4 deletions(-) diff --git a/core/src/com/dungeoncrawler/control/Controller.java b/core/src/com/dungeoncrawler/control/Controller.java index 6fbfaac..7f07f46 100644 --- a/core/src/com/dungeoncrawler/control/Controller.java +++ b/core/src/com/dungeoncrawler/control/Controller.java @@ -394,6 +394,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ if(gs != null){; d.getPlayer().updateItems(); hc.updateHud(batch, d.getPlayer()); + d.getPlayer().updateStats(level + 1); gs.render(batch, d.getPlayer(), d.getCurrentEntities(), tileX, tileY, level, roomPosX, roomPosY, camera, d.getVisited()); } @@ -644,6 +645,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ e[i].setHp(0); gs.createDmgFont((int) p.getDmg(),(int)e[i].getxPos() + 10,(int) e[i].getyPos() + 20); e[i].setToDelete(true); + p.addExp(e[i].getExp()); kills++; } else{ diff --git a/core/src/com/dungeoncrawler/model/Entity.java b/core/src/com/dungeoncrawler/model/Entity.java index 3d395f7..ee96a8e 100644 --- a/core/src/com/dungeoncrawler/model/Entity.java +++ b/core/src/com/dungeoncrawler/model/Entity.java @@ -19,6 +19,7 @@ public abstract class Entity { protected boolean targetsPlayer; protected int standartDef; protected int def; + protected int exp; @@ -33,6 +34,7 @@ public abstract class Entity { this.targetsPlayer = true; this.standartDef = 0; this.def = 0; + this.exp = 0; } public boolean attack(Entity e){ @@ -223,4 +225,14 @@ public abstract class Entity { public int getDef(){ return def; } + + public int getExp(){ + return exp; + } + public void setExp(int exp){ + this.exp = exp; + } + public void addExp(int exp){ + this.exp = this.exp + exp; + } } \ No newline at end of file diff --git a/core/src/com/dungeoncrawler/model/entities/Archer.java b/core/src/com/dungeoncrawler/model/entities/Archer.java index 000acfe..fb22883 100644 --- a/core/src/com/dungeoncrawler/model/entities/Archer.java +++ b/core/src/com/dungeoncrawler/model/entities/Archer.java @@ -19,6 +19,7 @@ public class Archer extends Entity{ this.dmg = 5*lvl; this.id = 0; this.type = 1; + this.exp = lvl * 5; minRange = 70; maxRange = 210; attackSpeed = 70; diff --git a/core/src/com/dungeoncrawler/model/entities/Darkarcher.java b/core/src/com/dungeoncrawler/model/entities/Darkarcher.java index d003b37..3436d7a 100644 --- a/core/src/com/dungeoncrawler/model/entities/Darkarcher.java +++ b/core/src/com/dungeoncrawler/model/entities/Darkarcher.java @@ -19,6 +19,7 @@ public class Darkarcher extends Entity{ this.dmg = 7*lvl; this.id = 27; this.type = 1; + this.exp = lvl * 5; minRange = 80; maxRange = 240; attackSpeed = 100; diff --git a/core/src/com/dungeoncrawler/model/entities/Darkswordsman.java b/core/src/com/dungeoncrawler/model/entities/Darkswordsman.java index 9784a5b..dc5a924 100644 --- a/core/src/com/dungeoncrawler/model/entities/Darkswordsman.java +++ b/core/src/com/dungeoncrawler/model/entities/Darkswordsman.java @@ -13,6 +13,7 @@ public class Darkswordsman extends Entity { this.direction = 1; this.dmg = 12*lvl; this.id = 26; + this.exp = lvl * 5; this.type = 0; // TODO: Sinnvolle Werte finden diff --git a/core/src/com/dungeoncrawler/model/entities/Darkwizard.java b/core/src/com/dungeoncrawler/model/entities/Darkwizard.java index 6ec51e4..be26dc5 100644 --- a/core/src/com/dungeoncrawler/model/entities/Darkwizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Darkwizard.java @@ -28,6 +28,7 @@ public class Darkwizard extends Entity{ this.dmg = 10*lvl; this.id = 24; this.type = 1; + this.exp = lvl * 5; minRange = 140; maxRange = 170; attackSpeed = 70; // higher = slower diff --git a/core/src/com/dungeoncrawler/model/entities/Earthwizard.java b/core/src/com/dungeoncrawler/model/entities/Earthwizard.java index 8a04216..06e95d1 100644 --- a/core/src/com/dungeoncrawler/model/entities/Earthwizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Earthwizard.java @@ -28,6 +28,7 @@ public class Earthwizard extends Entity{ this.dmg = 8*lvl; this.id = 8; this.type = 1; + this.exp = lvl * 5; minRange = 60; maxRange = 150; attackSpeed = 80; diff --git a/core/src/com/dungeoncrawler/model/entities/Firearcher.java b/core/src/com/dungeoncrawler/model/entities/Firearcher.java index bef2554..1c073e4 100644 --- a/core/src/com/dungeoncrawler/model/entities/Firearcher.java +++ b/core/src/com/dungeoncrawler/model/entities/Firearcher.java @@ -19,6 +19,7 @@ public class Firearcher extends Entity{ this.dmg = 8*lvl; this.id = 13; this.type = 1; + this.exp = lvl * 5; minRange = 60; maxRange = 200; attackSpeed = 55; diff --git a/core/src/com/dungeoncrawler/model/entities/Fireswordsman.java b/core/src/com/dungeoncrawler/model/entities/Fireswordsman.java index 3025fe1..26c1be3 100644 --- a/core/src/com/dungeoncrawler/model/entities/Fireswordsman.java +++ b/core/src/com/dungeoncrawler/model/entities/Fireswordsman.java @@ -14,6 +14,7 @@ public class Fireswordsman extends Entity { this.dmg = 15*lvl; this.id = 10; this.type = 0; + this.exp = lvl * 5; // TODO: Sinnvolle Werte finden direction = 2; diff --git a/core/src/com/dungeoncrawler/model/entities/Firewizard.java b/core/src/com/dungeoncrawler/model/entities/Firewizard.java index d6e15d2..d563f92 100644 --- a/core/src/com/dungeoncrawler/model/entities/Firewizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Firewizard.java @@ -28,6 +28,7 @@ public class Firewizard extends Entity{ this.dmg = 9*lvl; this.id = 6; this.type = 1; + this.exp = lvl * 5; minRange = 50; maxRange = 130; attackSpeed = 60; diff --git a/core/src/com/dungeoncrawler/model/entities/Healwizard.java b/core/src/com/dungeoncrawler/model/entities/Healwizard.java index c3354a4..2f5590e 100644 --- a/core/src/com/dungeoncrawler/model/entities/Healwizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Healwizard.java @@ -28,6 +28,7 @@ public class Healwizard extends Entity{ this.dmg = 12*lvl; this.id = 20; this.type = 1; + this.exp = lvl * 5; minRange = 64; maxRange = 124; attackSpeed = 60; diff --git a/core/src/com/dungeoncrawler/model/entities/Icearcher.java b/core/src/com/dungeoncrawler/model/entities/Icearcher.java index facbb9c..74e04b8 100644 --- a/core/src/com/dungeoncrawler/model/entities/Icearcher.java +++ b/core/src/com/dungeoncrawler/model/entities/Icearcher.java @@ -19,6 +19,7 @@ public class Icearcher extends Entity{ this.dmg = 7*lvl; this.id = 11; this.type = 1; + this.exp = lvl * 5; minRange = 80; maxRange = 240; attackSpeed = 100; diff --git a/core/src/com/dungeoncrawler/model/entities/Iceswordsman.java b/core/src/com/dungeoncrawler/model/entities/Iceswordsman.java index 9a7df54..5e24f27 100644 --- a/core/src/com/dungeoncrawler/model/entities/Iceswordsman.java +++ b/core/src/com/dungeoncrawler/model/entities/Iceswordsman.java @@ -14,6 +14,7 @@ public class Iceswordsman extends Entity { this.dmg = 14*lvl; this.id = 15; this.type = 0; + this.exp = lvl * 5; // TODO: Sinnvolle Werte finden direction = 2; diff --git a/core/src/com/dungeoncrawler/model/entities/Icewizard.java b/core/src/com/dungeoncrawler/model/entities/Icewizard.java index ec49a02..d7da874 100644 --- a/core/src/com/dungeoncrawler/model/entities/Icewizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Icewizard.java @@ -28,6 +28,7 @@ public class Icewizard extends Entity{ this.dmg = 10*lvl; this.id = 16; this.type = 1; + this.exp = lvl * 5; minRange = 70; maxRange = 190; attackSpeed = 80; diff --git a/core/src/com/dungeoncrawler/model/entities/Naturewizard.java b/core/src/com/dungeoncrawler/model/entities/Naturewizard.java index 31c2344..4a9acb5 100644 --- a/core/src/com/dungeoncrawler/model/entities/Naturewizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Naturewizard.java @@ -28,6 +28,7 @@ public class Naturewizard extends Entity{ this.dmg = 8*lvl; this.id = 22; this.type = 1; + this.exp = lvl * 5; minRange = 60; maxRange = 150; attackSpeed = 80; diff --git a/core/src/com/dungeoncrawler/model/entities/Player.java b/core/src/com/dungeoncrawler/model/entities/Player.java index 7ddb37a..b1e78b9 100644 --- a/core/src/com/dungeoncrawler/model/entities/Player.java +++ b/core/src/com/dungeoncrawler/model/entities/Player.java @@ -22,6 +22,8 @@ public class Player extends Entity { String gender; float standartMovementSpeed; float movementSpeed; + + int level; public Player() { super(200, 200, 1); @@ -49,11 +51,12 @@ public class Player extends Entity { public void updateStats(int ey){ this.lvl = ey+1; - this.maxhp = 50 * this.lvl; - this.standartMaxHp = 50 * this.lvl; - this.standartDmg = 20 * this.lvl; + this.level = (exp / 10) + 1; + this.maxhp = 50 * this.level; + this.standartMaxHp = 50 * this.level; + this.standartDmg = 20 * this.level; this.dmg = this.standartDmg; - this.standartDef = 4 * lvl; + this.standartDef = 4 * level; this.def = this.standartDef; updateItems(); } diff --git a/core/src/com/dungeoncrawler/model/entities/Swordsman.java b/core/src/com/dungeoncrawler/model/entities/Swordsman.java index b92d74b..bf19e43 100644 --- a/core/src/com/dungeoncrawler/model/entities/Swordsman.java +++ b/core/src/com/dungeoncrawler/model/entities/Swordsman.java @@ -14,6 +14,7 @@ public class Swordsman extends Entity { this.dmg = 12*lvl; this.id = 1; this.type = 0; + this.exp = lvl * 5; // TODO: Sinnvolle Werte finden direction = 2; diff --git a/core/src/com/dungeoncrawler/model/entities/Waterwizard.java b/core/src/com/dungeoncrawler/model/entities/Waterwizard.java index 9326876..eac4d58 100644 --- a/core/src/com/dungeoncrawler/model/entities/Waterwizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Waterwizard.java @@ -28,6 +28,7 @@ public class Waterwizard extends Entity{ this.dmg = 12*lvl; this.id = 18; this.type = 1; + this.exp = lvl * 5; minRange = 65; maxRange = 130; attackSpeed = 50; diff --git a/core/src/com/dungeoncrawler/model/entities/Wizard.java b/core/src/com/dungeoncrawler/model/entities/Wizard.java index 08135fd..58769f4 100644 --- a/core/src/com/dungeoncrawler/model/entities/Wizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Wizard.java @@ -28,6 +28,7 @@ public class Wizard extends Entity{ this.dmg = 10*lvl; this.id = 3; this.type = 1; + this.exp = lvl * 5; minRange = 140; maxRange = 170; attackSpeed = 70; // higher = slower