Skip to content

Commit

Permalink
Fixing issue where the restore potion could make a player permenantly…
Browse files Browse the repository at this point in the history
… invisible
  • Loading branch information
joshuaskelly committed Sep 12, 2020
1 parent 0415e4e commit 53afbbb
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions Dungeoneer/src/com/interrupt/dungeoneer/entities/items/Potion.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
package com.interrupt.dungeoneer.entities.items;

import java.text.MessageFormat;
import java.util.Random;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector3;
import com.interrupt.dungeoneer.Audio;
import com.interrupt.dungeoneer.annotations.EditorProperty;
import com.interrupt.dungeoneer.entities.Actor;
import com.interrupt.dungeoneer.entities.Bomb;
import com.interrupt.dungeoneer.entities.Entity;
import com.interrupt.dungeoneer.entities.Item;
import com.interrupt.dungeoneer.entities.Player;
import com.interrupt.dungeoneer.entities.*;
import com.interrupt.dungeoneer.entities.items.Weapon.DamageType;
import com.interrupt.dungeoneer.game.Colors;
import com.interrupt.dungeoneer.game.Game;
import com.interrupt.dungeoneer.game.Level;
import com.interrupt.dungeoneer.statuseffects.*;
import com.interrupt.managers.StringManager;

import java.text.MessageFormat;
import java.util.Random;

public class Potion extends Item {

public enum PotionType { health, magic, maxhealth, poison, restore, shield, paralyze }
Expand Down Expand Up @@ -52,9 +48,7 @@ else if(potionType == PotionType.poison) {
else if(potionType == PotionType.maxhealth) {
displayText = StringManager.get("items.Potion.maxHealDisplayText");
player.hp = player.getMaxHp();

if(player.statusEffects != null && player.statusEffects.size > 0)
player.statusEffects.clear();
player.clearStatusEffects();
}
else if(potionType == PotionType.restore) {
player.hp += 1;
Expand Down

0 comments on commit 53afbbb

Please sign in to comment.