Skip to content

Commit

Permalink
new monsters for the range 70-100 and 120-150 which were pretty boring
Browse files Browse the repository at this point in the history
  • Loading branch information
msx80 committed Sep 10, 2024
1 parent 89300fd commit f859d58
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public enum Item {
Slime("Slime", 340, new String[] {"Smelly", "and sticky.", "A bit like glue."}, 0, null, null, null, null),
Fur("Fur", 346, new String[] {"From the hide", "of some wild beast."}, 0, null, null, null, null),
Duranium("Duranium", 347, new String[] {"A magical material", "incredibly strong."}, 0, null, null, null, null),

MagicLamp("Magic Lamp", 352, new String[] {"No wishing for","more wishes"}, 0, null, null, Usable.of("Rub", magicLamp()), null),
;

public final String name;
Expand All @@ -113,6 +115,19 @@ public enum Item {
this.combat = combat;
}

private static UsableFunc magicLamp() {

return (i, g) -> {
g.getRun().pg.inventoryAdd(i, -1); // remove lamp
g.getLog().add(15, "You rub ", 14, i.name, 15, " and express your wishes!");
g.getRun().pg.addEffect(Effect.BARRIER, 20);
g.getRun().pg.addEffect(Effect.MAGNETIC, 20);
g.getRun().pg.addEffect(Effect.MUSCLES, 20);
g.getRun().pg.addEffect(Effect.REGENERATION, 20);
g.getRun().pg.addEffect(Effect.LUCKY, 20);
};
}

private static UsableFunc bagOfGold() {
return (i, g) -> {
int num = DoorsOfDoom.r.nextInt(21) + 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,17 @@ public enum MonsterDef {
Loot.of(1, Item.BagOfGold, range(2, 3)),
Loot.of(1, Item.Blood, range(4, 6))
),
TROLL(
"TROLL", -41,
range(50, 80),
range(25, 50),
range(80, 100),
range(10, 15),
Loot.of(2, Item.Armour, range(1, 1)),
Loot.of(1, Item.Clover, range(2, 3)),
Loot.of(1, Item.Spinach, range(2, 3)),
Loot.of(1, Item.Slime, range(3, 5))
),
DEVIL(
"DEVIL", -24,
range(100, 200), // hp
Expand Down Expand Up @@ -360,6 +371,18 @@ public enum MonsterDef {
Loot.of(1, Item.Venom, range(5, 8)),
Loot.of(1, Item.BigPotion, range(2, 3))
),
GENIE(
"GENIE", -42,
range(80, 100),
range(60, 80),
range(130, 1000),
range(10, 20),
Loot.of(10, Item.Phlogiston, range(3, 5)),
Loot.of(10, Item.BigPotion, range(2, 2)),
Loot.of(10, Item.BagOfGold, range(1, 1)),
Loot.of(1, Item.MagicLamp, range(1, 1))
),

DUNGEON_BOSS(
"DUNGEON BOSS", -37,
range(400, 400),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void ricalcola() {
Item e = this.equip.get(p);
if (e != null) arm += e.armour;
}
if(arm>=100) arm = 99; // do not exceed 99%
this.armour = arm;

// maxHp
Expand Down Expand Up @@ -125,7 +126,12 @@ public boolean isEquipped(Item item) {


public void addEffect(Effect e) {
effects.put(e, effects.getOrDefault(e, 0) + e.turns);
addEffect(e, e.turns);
}


public void addEffect(Effect e, int turns) {
effects.put(e, effects.getOrDefault(e, 0) + turns);
ricalcola();
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f859d58

Please sign in to comment.