From 3701a2aac7dd5d8c5911af87f20d1757aee10f8d Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 19 Jan 2018 21:40:35 -0500 Subject: [PATCH] v0.6.3: reduced the spawn rate of missile weapons by ~50% --- .../actors/mobs/GnollTrickster.java | 13 ++++++++++++- .../shatteredpixeldungeon/actors/mobs/Skeleton.java | 4 ++-- .../shatteredpixeldungeon/items/Generator.java | 2 +- .../items/weapon/missiles/MissileWeapon.java | 8 ++++---- .../levels/rooms/secret/SecretArtilleryRoom.java | 9 +++++++-- .../levels/rooms/special/ArmoryRoom.java | 2 +- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java index 77ad4d938..e7c357b73 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/GnollTrickster.java @@ -30,6 +30,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite; @@ -48,6 +50,7 @@ public class GnollTrickster extends Gnoll { state = WANDERING; + //at half quantity, see createLoot() loot = Generator.Category.MISSILE; lootChance = 1f; @@ -98,7 +101,15 @@ public class GnollTrickster extends Gnoll { return super.getCloser( target ); } } - + + @Override + protected Item createLoot() { + MissileWeapon drop = (MissileWeapon)super.createLoot(); + //half quantity, rounded up + drop.quantity((drop.quantity()+1)/2); + return drop; + } + @Override public void die( Object cause ) { super.die( cause ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index 0142d2dc9..78a21fb86 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -89,9 +89,9 @@ public class Skeleton extends Mob { protected Item createLoot() { Item loot; do { - loot = Random.Int(4) == 0 ? Generator.randomMissile() : Generator.randomWeapon(); + loot = Generator.randomWeapon(); //50% chance of re-rolling tier 4 or 5 melee weapons - } while (loot instanceof MeleeWeapon && ((MeleeWeapon) loot).tier >= 4 && Random.Int(2) == 0); + } while (((MeleeWeapon) loot).tier >= 4 && Random.Int(2) == 0); loot.level(0); return loot; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 673f6752a..97f19ae89 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -168,7 +168,7 @@ public class Generator { ARMOR ( 4, Armor.class ), - MISSILE ( 5, MissileWeapon.class ), + MISSILE ( 3, MissileWeapon.class ), MIS_T1 ( 0, MissileWeapon.class ), MIS_T2 ( 0, MissileWeapon.class ), MIS_T3 ( 0, MissileWeapon.class ), diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 5c9247f64..10cd81fea 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -98,11 +98,11 @@ abstract public class MissileWeapon extends Weapon { public Item random() { if (!stackable) return this; - //+0: 50% (1/2) - //+1: 40% (4/10) - //+2: 10% (1/10) + //2: 66.67% (2/3) + //3: 26.67% (4/15) + //4: 6.67% (1/15) quantity = 2; - if (Random.Int(2) == 0) { + if (Random.Int(3) == 0) { quantity++; if (Random.Int(5) == 0) { quantity++; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java index a86095f8c..f014b6863 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretArtilleryRoom.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret; +import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; @@ -37,14 +38,18 @@ public class SecretArtilleryRoom extends SecretRoom { Painter.set(level, center(), Terrain.STATUE_SP); - for (int i = 0; i < 4; i++){ + for (int i = 0; i < 3; i++){ int itemPos; do{ itemPos = level.pointToCell(random()); } while ( level.map[itemPos] != Terrain.EMPTY_SP || level.heaps.get(itemPos) != null); - level.drop(Generator.randomMissile(), itemPos); + if( i == 0 ){ + level.drop(new Bomb.DoubleBomb(), itemPos); + } else { + level.drop(Generator.randomMissile(), itemPos); + } } entrance().set(Door.Type.HIDDEN); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java index ce65a0988..3c436e721 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ArmoryRoom.java @@ -68,7 +68,7 @@ public class ArmoryRoom extends SpecialRoom { } private static Item prize( Level level ) { - switch (Random.Int( 5 )){ + switch (Random.Int( 4 )){ case 0: return new Bomb().random(); case 1: