From 9d3cdf0406bbc68637285641d65665df1502b275 Mon Sep 17 00:00:00 2001 From: GammelJan Date: Mon, 11 May 2020 21:01:43 +0200 Subject: [PATCH] asdf --- .../dungeoncrawler/control/Controller.java | 1 + .../dungeoncrawler/model/entities/Archer.java | 2 +- .../dungeoncrawler/model/entities/Player.java | 21 +++++++++++++++---- .../model/entities/Swordsman.java | 2 +- .../dungeoncrawler/model/entities/Wizard.java | 2 +- .../dungeoncrawler/model/items/Amulet.java | 4 ++-- .../dungeoncrawler/model/items/Potion.java | 2 +- .../com/dungeoncrawler/view/GameScreen.java | 3 +-- 8 files changed, 25 insertions(+), 12 deletions(-) diff --git a/core/src/com/dungeoncrawler/control/Controller.java b/core/src/com/dungeoncrawler/control/Controller.java index cf449e8..9734da8 100644 --- a/core/src/com/dungeoncrawler/control/Controller.java +++ b/core/src/com/dungeoncrawler/control/Controller.java @@ -387,6 +387,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{ roomPosY += 1; d.getPlayer().setxPos((roomX / 2)* 48); d.getPlayer().setyPos(48); + d.getPlayer().updateStats(level); gs.startLoadingScreen(); } diff --git a/core/src/com/dungeoncrawler/model/entities/Archer.java b/core/src/com/dungeoncrawler/model/entities/Archer.java index 00ba7cb..8df965e 100644 --- a/core/src/com/dungeoncrawler/model/entities/Archer.java +++ b/core/src/com/dungeoncrawler/model/entities/Archer.java @@ -13,7 +13,7 @@ public class Archer extends Entity{ this.maxhp = 75*lvl; this.hp = this.maxhp; this.direction = 1; - this.dmg = 25*lvl; + this.dmg = 10*lvl; this.id = 0; this.type = 1; counter = 0; diff --git a/core/src/com/dungeoncrawler/model/entities/Player.java b/core/src/com/dungeoncrawler/model/entities/Player.java index 9861cdb..1711019 100644 --- a/core/src/com/dungeoncrawler/model/entities/Player.java +++ b/core/src/com/dungeoncrawler/model/entities/Player.java @@ -23,9 +23,9 @@ public class Player extends Entity { this.maxhp = 100 * lvl; this.hp = this.maxhp; - this.standartMaxHp = 5 * lvl; + this.standartMaxHp = 100 * lvl; - this.dmg = 50*lvl; + this.dmg = 60*lvl; this.standartDmg = dmg; id = -1; type = -1; @@ -35,6 +35,13 @@ public class Player extends Entity { } + public void updateStats(int lvl){ + this.lvl = lvl; + this.standartMaxHp = 100 * lvl; + this.standartDmg = 100 * lvl; + updateItems(); + } + public void pickUp(Item item){ inv.addItem(item); } @@ -60,13 +67,19 @@ public class Player extends Entity { // nix lol weil key break; case 1: - this.hp = hp + inv.getItem(x).getHeal(); + if(hp + inv.getItem(x).getHeal() >= maxhp){ + hp = maxhp; + } + else{ + this.hp = hp + inv.getItem(x).getHeal(); + } + inv.setItem(x, null); break; case 2: // nix lol weil amulet break; } - inv.setItem(x, null); + } } diff --git a/core/src/com/dungeoncrawler/model/entities/Swordsman.java b/core/src/com/dungeoncrawler/model/entities/Swordsman.java index 4cca264..7b202ea 100644 --- a/core/src/com/dungeoncrawler/model/entities/Swordsman.java +++ b/core/src/com/dungeoncrawler/model/entities/Swordsman.java @@ -11,7 +11,7 @@ public class Swordsman extends Entity { this.maxhp = 100*lvl; this.hp = this.maxhp; this.direction = 1; - this.dmg = 35*lvl; + this.dmg = 20*lvl; this.id = 1; this.type = 0; diff --git a/core/src/com/dungeoncrawler/model/entities/Wizard.java b/core/src/com/dungeoncrawler/model/entities/Wizard.java index e427999..5e4340a 100644 --- a/core/src/com/dungeoncrawler/model/entities/Wizard.java +++ b/core/src/com/dungeoncrawler/model/entities/Wizard.java @@ -22,7 +22,7 @@ public class Wizard extends Entity{ this.maxhp = 80*lvl; this.hp = this.maxhp; this.direction = 1; - this.dmg = 30*lvl; + this.dmg = 15*lvl; this.id = 3; this.type = 1; counter = 0; diff --git a/core/src/com/dungeoncrawler/model/items/Amulet.java b/core/src/com/dungeoncrawler/model/items/Amulet.java index 17b7316..39f0c4c 100644 --- a/core/src/com/dungeoncrawler/model/items/Amulet.java +++ b/core/src/com/dungeoncrawler/model/items/Amulet.java @@ -15,8 +15,8 @@ public class Amulet extends Item { public Amulet(int lvl) { super(lvl); - this.dmg = 4 * (lvl + 1); - this.heal = 4 * (lvl + 1); + this.dmg = 25 * (lvl + 1); + this.heal = 0 * (lvl + 1); this.id = 2; } diff --git a/core/src/com/dungeoncrawler/model/items/Potion.java b/core/src/com/dungeoncrawler/model/items/Potion.java index 7a8ae69..8567011 100644 --- a/core/src/com/dungeoncrawler/model/items/Potion.java +++ b/core/src/com/dungeoncrawler/model/items/Potion.java @@ -15,7 +15,7 @@ public class Potion extends Item { public Potion(int lvl) { super(lvl); - this.heal = lvl * 3; + this.heal = lvl * 40; this.dmg = 0; this.id = 1; } diff --git a/core/src/com/dungeoncrawler/view/GameScreen.java b/core/src/com/dungeoncrawler/view/GameScreen.java index 2df2ced..7246038 100644 --- a/core/src/com/dungeoncrawler/view/GameScreen.java +++ b/core/src/com/dungeoncrawler/view/GameScreen.java @@ -197,7 +197,6 @@ public class GameScreen { tmr.render(); camera.zoom = 700f; // Standart 700f - camera.update(); batch.setProjectionMatrix(camera.combined); @@ -345,7 +344,7 @@ public class GameScreen { public void stop(){ animations.stop(); animatePlayer.stop(); - + camera.normalizeUp(); } public void resume(){ animations.start();