GammelJAN 6 years ago
parent 689767103e
commit 250bc6c89d

@ -22,10 +22,10 @@ public class Player extends Entity {
this.maxhp = 5 * (lvl + 1); this.maxhp = 5 * (lvl + 1);
this.hp = this.maxhp; this.hp = this.maxhp;
standartMaxHp = this.maxhp; this.standartMaxHp = 5 * (lvl + 1);
this.dmg = 3*lvl; this.dmg = 3*lvl;
standartDmg = this.dmg; this.standartDmg = dmg = 3*lvl;
id = -1; id = -1;
inv = new Inventory(3,2); inv = new Inventory(3,2);
// TODO: Sinnvolle Werte finden // TODO: Sinnvolle Werte finden
@ -41,12 +41,12 @@ public class Player extends Entity {
public void updateItems(){ public void updateItems(){
if(inv.getItem(1) != null){ if(inv.getItem(1) != null){
dmg = standartDmg + inv.getItem(1).getDmg(); this.dmg = this.standartDmg + inv.getItem(1).getDmg();
maxhp = standartMaxHp + inv.getItem(1).getHeal(); //this.maxhp = this.standartMaxHp + inv.getItem(1).getHeal();
} }
else{ else{
dmg = standartDmg; this.dmg = this.standartDmg;
maxhp = standartMaxHp; //this.maxhp = this.standartMaxHp;
} }
} }

@ -15,8 +15,8 @@ public class Amulet extends Item {
public Amulet(int lvl) { public Amulet(int lvl) {
super(lvl); super(lvl);
this.dmg = lvl * 4; this.dmg = 4 * (lvl + 1);
this.heal = lvl * 4; this.heal = 4 * (lvl + 1);
this.id = 2; this.id = 2;
} }

@ -95,7 +95,7 @@ public class HudContainer {
selectedSprite.setY(invYPos[selected] - 2f); selectedSprite.setY(invYPos[selected] - 2f);
float n = p.getHp() / p.getMaxhp(); float n = p.getHp() / p.getMaxhp();
int newWidth = (int) (n * 122); int newWidth = (int) (n * playerHealthTexture.getWidth());
TextureRegion[][] playerHealthRegion = TextureRegion.split(playerHealthTexture,newWidth, playerHealthTexture.getHeight()); TextureRegion[][] playerHealthRegion = TextureRegion.split(playerHealthTexture,newWidth, playerHealthTexture.getHeight());
playerHealthSprite = new Sprite(playerHealthRegion[0][0]); playerHealthSprite = new Sprite(playerHealthRegion[0][0]);
playerHealthSprite.setPosition(playerHealthX, playerHealthY); playerHealthSprite.setPosition(playerHealthX, playerHealthY);

Loading…
Cancel
Save