EpicKnarvik97 5c19c3133c
All checks were successful
EpicKnarvik97/Rogue101/pipeline/head This commit looks good
Changes a bunch of code
Renames some badly named interfaces and classes
Changes a bunch of packages for better structure
Adds some missing comments
Improves path finding performance somewhat
Adds an NPC death sound
Makes fake walls noticeable
Makes all NPCs drop their items when they die (as the NPCs may steal items from a player)
2023-08-13 14:24:53 +02:00

90 lines
1.8 KiB
Java

package inf101.v18.rogue101.enemies;
import inf101.v18.rogue101.Main;
import inf101.v18.rogue101.game.Game;
import inf101.v18.rogue101.game.RogueGame;
import inf101.v18.rogue101.items.weapon.BasicSword;
import inf101.v18.rogue101.object.Item;
import inf101.v18.rogue101.state.AttackType;
import inf101.v18.util.NPCHelper;
/**
* A boss enemy that's harder than any other enemy
*/
public class Boss extends Enemy {
/**
* Instantiates a new boss character
*/
public Boss() {
backpack.add(new BasicSword());
}
@Override
public void doTurn(Game game) {
currentLocation = game.getLocation();
NPCHelper.tryAttack(game, 1, AttackType.MELEE);
}
@Override
public int getAttack() {
return 50;
}
@Override
public int getDamage() {
return 15;
}
@Override
public int getCurrentHealth() {
return hp;
}
@Override
public int getDefense() {
return 40;
}
@Override
public int getMaxHealth() {
return 550;
}
@Override
public String getName() {
return "Lucifer";
}
@Override
public int getSize() {
return 50;
}
@Override
public String getPrintSymbol() {
return "\u001b[91m" + "\uD83D\uDE08" + "\u001b[0m";
}
@Override
public String getSymbol() {
return "B";
}
@Override
public int getVision() {
return 3;
}
@Override
public int handleDamage(Game game, Item source, int amount) {
super.handleDamage(game, source, amount);
if (hp < 0) {
((RogueGame) game).win();
}
game.getPrinter().printAt(Main.COLUMN_RIGHT_SIDE_START, 19, "Boss HP: " + NPCHelper.hpBar(this));
return amount;
}
}