diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java index 70ecd402c..e9ce9a843 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java @@ -128,9 +128,9 @@ public class Heap implements Bundlable { } } - public Heap setHauntedIfCursed( float chance ){ + public Heap setHauntedIfCursed(){ for (Item item : items) { - if (item.cursed && Random.Float() < chance) { + if (item.cursed) { haunted = true; item.cursedKnown = true; break; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index b8689d5e2..f375a8b48 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -197,7 +197,7 @@ public class CavesBossLevel extends Level { do { pos = Random.IntRange( ROOM_LEFT, ROOM_RIGHT ) + Random.IntRange( ROOM_TOP + 1, ROOM_BOTTOM ) * width(); } while (pos == entrance); - drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, pos ).setHauntedIfCursed().type = Heap.Type.REMAINS; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index 2436cdd78..1fd6df11e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -168,7 +168,7 @@ public class CityBossLevel extends Level { Random.IntRange( LEFT + 1, LEFT + HALL_WIDTH - 2 ) + Random.IntRange( TOP + HALL_HEIGHT + 2, TOP + HALL_HEIGHT + CHAMBER_HEIGHT ) * width(); } while (pos == entrance); - drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, pos ).setHauntedIfCursed().type = Heap.Type.REMAINS; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index 75cb42a33..129cd9591 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -157,7 +157,7 @@ public class HallsBossLevel extends Level { do { pos = Random.IntRange( ROOM_LEFT, ROOM_RIGHT ) + Random.IntRange( ROOM_TOP + 1, ROOM_BOTTOM ) * width(); } while (pos == entrance); - drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, pos ).setHauntedIfCursed().type = Heap.Type.REMAINS; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java index ebbc7bca0..4fad9ff8c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastShopLevel.java @@ -121,7 +121,7 @@ public class LastShopLevel extends RegularLevel { do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance); - drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, pos ).setHauntedIfCursed().type = Heap.Type.REMAINS; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java index 4694dbba3..e67878061 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java @@ -619,7 +619,7 @@ public class NewPrisonBossLevel extends Level { protected void createItems() { Item item = Bones.get(); if (item != null) { - drop( item, randomRespawnCell() ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, randomRespawnCell() ).setHauntedIfCursed().type = Heap.Type.REMAINS; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/OldPrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/OldPrisonBossLevel.java index 9936067d3..1a0c25117 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/OldPrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/OldPrisonBossLevel.java @@ -160,7 +160,7 @@ public class OldPrisonBossLevel extends Level { protected void createItems() { Item item = Bones.get(); if (item != null) { - drop( item, randomRespawnCell() ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, randomRespawnCell() ).setHauntedIfCursed().type = Heap.Type.REMAINS; } drop(new IronKey(10), randomPrisonCell()); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index 5b48dd56d..e5ed7c965 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -315,7 +315,7 @@ public abstract class RegularLevel extends Level { Heap dropped = drop( toDrop, cell ); dropped.type = type; if (type == Heap.Type.SKELETON){ - dropped.setHauntedIfCursed(0.75f); + dropped.setHauntedIfCursed(); } } @@ -340,7 +340,7 @@ public abstract class RegularLevel extends Level { map[cell] = Terrain.GRASS; losBlocking[cell] = false; } - drop( item, cell ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, cell ).setHauntedIfCursed().type = Heap.Type.REMAINS; } DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java index 0ca56373c..92fd66707 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java @@ -114,7 +114,7 @@ public class SewerBossLevel extends SewerLevel { do { pos = pointToCell(roomEntrance.random()); } while (pos == entrance || solid[pos]); - drop( item, pos ).setHauntedIfCursed(1f).type = Heap.Type.REMAINS; + drop( item, pos ).setHauntedIfCursed().type = Heap.Type.REMAINS; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretSummoningRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretSummoningRoom.java index add5d3faa..139b0bb69 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretSummoningRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretSummoningRoom.java @@ -49,7 +49,7 @@ public class SecretSummoningRoom extends SecretRoom { Painter.fill(level, this, 1, Terrain.SECRET_TRAP); Point center = center(); - level.drop(Generator.random(), level.pointToCell(center)).setHauntedIfCursed(1f).type = Heap.Type.SKELETON; + level.drop(Generator.random(), level.pointToCell(center)).setHauntedIfCursed().type = Heap.Type.SKELETON; for (Point p : getPoints()){ int cell = level.pointToCell(p); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/MassGraveRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/MassGraveRoom.java index 8de329e09..71c65b40d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/MassGraveRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/MassGraveRoom.java @@ -90,7 +90,7 @@ public class MassGraveRoom extends SpecialRoom { pos = level.pointToCell(random()); } while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get(pos) != null); Heap h = level.drop(item, pos); - h.setHauntedIfCursed(1f); + h.setHauntedIfCursed(); h.type = Heap.Type.SKELETON; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java index 1263c3780..8d5c408f3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java @@ -81,7 +81,7 @@ public class PitRoom extends SpecialRoom { int n = Random.IntRange( 1, 2 ); for (int i=0; i < n; i++) { - level.drop( prize( level ), remains ).setHauntedIfCursed(1f); + level.drop( prize( level ), remains ).setHauntedIfCursed(); } }