v0.7.4: major balance pass on bomb recipes, mostly buffs.

This commit is contained in:
Evan Debenham 2019-06-29 18:10:47 -04:00
parent 0f77d26986
commit 164966b156
11 changed files with 218 additions and 101 deletions

View File

@ -79,9 +79,10 @@ public class ArcaneBomb extends Bomb {
}
for (Char ch : affected){
//regular bomb damage, but pierces armor
// 100%/83%/67% bomb damage based on distance, but pierces armor.
int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 ));
ch.damage(damage, this);
float multiplier = 1f - (.16667f*Dungeon.level.distance(cell, ch.pos));
ch.damage(Math.round(damage*multiplier), this);
if (ch == Dungeon.hero && !ch.isAlive()){
Dungeon.fail(Bomb.class);
}

View File

@ -172,11 +172,15 @@ public class Bomb extends Item {
}
for (Char ch : affected){
//those not at the center of the blast take damage less consistently.
int minDamage = ch.pos == cell ? Dungeon.depth + 5 : 1;
int maxDamage = 10 + Dungeon.depth * 2;
int dmg = Random.NormalIntRange(5 + Dungeon.depth, 10 + Dungeon.depth*2);
//those not at the center of the blast take less damage
if (ch.pos != cell){
dmg = Math.round(dmg*0.67f);
}
dmg -= ch.drRoll();
int dmg = Random.NormalIntRange(minDamage, maxDamage) - ch.drRoll();
if (dmg > 0) {
ch.damage(dmg, this);
}
@ -271,13 +275,24 @@ public class Bomb extends Item {
//look for our bomb, remove it from its heap, and blow it up.
for (Heap heap : Dungeon.level.heaps.values()) {
if (heap.items.contains(bomb)) {
heap.items.remove(bomb);
if (heap.items.isEmpty()){
heap.destroy();
//FIXME this is a bit hacky, might want to generalize the functionality
//of bombs that don't explode instantly when their fuse ends
if (bomb instanceof Noisemaker){
((Noisemaker) bomb).setTrigger(heap.pos);
} else {
heap.items.remove(bomb);
if (heap.items.isEmpty()) {
heap.destroy();
}
bomb.explode(heap.pos);
}
bomb.explode(heap.pos);
diactivate();
Actor.remove(this);
return true;
}
@ -334,17 +349,17 @@ public class Bomb extends Item {
private static final HashMap<Class<?extends Bomb>, Integer> bombCosts = new HashMap<>();
static {
bombCosts.put(FrostBomb.class, 3);
bombCosts.put(WoollyBomb.class, 3);
bombCosts.put(FrostBomb.class, 2);
bombCosts.put(WoollyBomb.class, 2);
bombCosts.put(Firebomb.class, 4);
bombCosts.put(Noisemaker.class, 4);
bombCosts.put(Flashbang.class, 5);
bombCosts.put(ShockBomb.class, 5);
bombCosts.put(Flashbang.class, 6);
bombCosts.put(ShockBomb.class, 6);
bombCosts.put(RegrowthBomb.class, 6);
bombCosts.put(HolyBomb.class, 6);
bombCosts.put(RegrowthBomb.class, 8);
bombCosts.put(HolyBomb.class, 8);
bombCosts.put(ArcaneBomb.class, 10);
bombCosts.put(ShrapnelBomb.class, 10);

View File

@ -37,20 +37,14 @@ public class Flashbang extends Bomb {
image = ItemSpriteSheet.FLASHBANG;
}
@Override
public boolean explodesDestructively() {
return false;
}
@Override
public void explode(int cell) {
super.explode(cell);
//FIXME currently has somewhat odd behaviour, as FOV is updated at the start of a turn.
Level l = Dungeon.level;
for (Char ch : Actor.chars()){
if (ch.fieldOfView != null && ch.fieldOfView[cell]){
int power = 15 - 2*l.distance(ch.pos, cell);
int power = 16 - 4*l.distance(ch.pos, cell);
if (power > 0){
Buff.prolong(ch, Blindness.class, power);
Buff.prolong(ch, Cripple.class, power);
@ -61,7 +55,6 @@ public class Flashbang extends Bomb {
}
}
}
@Override

View File

@ -22,8 +22,12 @@
package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
@ -42,6 +46,10 @@ public class FrostBomb extends Bomb {
for (int i = 0; i < PathFinder.distance.length; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
GameScene.add(Blob.seed(i, 10, Freezing.class));
Char ch = Actor.findChar(i);
if (ch != null){
Buff.affect(ch, Frost.class, 2f);
}
}
}
}

View File

@ -66,7 +66,6 @@ public class HolyBomb extends Bomb {
}
for (Char ch : affected){
Buff.prolong(ch, Blindness.class, 1f);
if (ch.properties().contains(Char.Property.UNDEAD) || ch.properties().contains(Char.Property.DEMONIC)){
ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 );

View File

@ -23,10 +23,15 @@ package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
@ -37,69 +42,112 @@ public class Noisemaker extends Bomb {
image = ItemSpriteSheet.NOISEMAKER;
}
public void setTrigger(int cell){
Buff.affect(Dungeon.hero, Trigger.class).set(cell);
CellEmitter.center( cell ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
Sample.INSTANCE.play( Assets.SND_ALERT );
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
mob.beckon( cell );
}
for (Heap heap : Dungeon.level.heaps.values()) {
if (heap.type == Heap.Type.MIMIC) {
Mimic m = Mimic.spawnAt( heap.pos, heap.items );
if (m != null) {
m.beckon( cell );
heap.destroy();
}
}
}
@Override
public boolean explodesDestructively() {
return false;
}
@Override
public void explode(int cell) {
super.explode(cell);
public static class Trigger extends Buff {
Buff.affect(Dungeon.hero, Noise.class).set(cell);
}
public static class Noise extends Buff {
int floor;
int cell;
int floor;
int left;
public void set(int cell){
floor = Dungeon.depth;
this.cell = cell;
left = 8;
left = 6;
}
@Override
public boolean act() {
if (Dungeon.depth == floor){
if (Dungeon.level.heroFOV[cell]) {
CellEmitter.center( cell ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
Sample.INSTANCE.play( Assets.SND_ALERT );
} else {
CellEmitter.center( cell ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
Sample.INSTANCE.play( Assets.SND_ALERT, 0.25f );
}
if (Dungeon.depth != floor){
spend(TICK);
return true;
}
for (Mob m : Dungeon.level.mobs){
if (m.state != m.HUNTING) {
m.beckon(cell);
Noisemaker bomb = null;
Heap heap = Dungeon.level.heaps.get(cell);
if (heap != null){
for (Item i : heap.items){
if (i instanceof Noisemaker){
bomb = (Noisemaker) i;
break;
}
}
}
if (left > 0) {
spend(TICK * 15f);
left--;
} else {
if (bomb == null) {
detach();
} else if (Actor.findChar(cell) != null) {
heap.items.remove(bomb);
if (heap.items.isEmpty()) {
heap.destroy();
}
detach();
bomb.explode(cell);
} else {
spend(TICK);
left--;
if (left <= 0){
CellEmitter.center( cell ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 );
Sample.INSTANCE.play( Assets.SND_ALERT );
for (Mob mob : Dungeon.level.mobs.toArray( new Mob[0] )) {
mob.beckon( cell );
}
left = 6;
}
}
return true;
}
private static final String CELL = "cell";
private static final String FLOOR = "floor";
private static final String LEFT = "left";
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
bundle.put(CELL, cell);
bundle.put(FLOOR, floor);
bundle.put(LEFT, left);
}
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
cell = bundle.getInt(CELL);
floor = bundle.getInt(FLOOR);
left = bundle.getInt(LEFT);
}
}

View File

@ -34,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import com.shatteredpixel.shatteredpixeldungeon.plants.Starflower;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
@ -70,8 +71,8 @@ public class RegrowthBomb extends Bomb {
Char ch = Actor.findChar(i);
if (ch != null){
if (ch.alignment == Dungeon.hero.alignment) {
//same as a healing dart
Buff.affect(ch, Healing.class).setHeal((int) (0.5f * ch.HT + 30), 0.25f, 0);
//same as a healing potion
Buff.affect( ch, Healing.class ).setHeal((int)(0.8f*ch.HT + 14), 0.25f, 0);
PotionOfHealing.cure(ch);
}
} else if ( Dungeon.level.map[i] == Terrain.EMPTY ||
@ -87,20 +88,31 @@ public class RegrowthBomb extends Bomb {
}
}
Integer plantPos = Random.element(plantCandidates);
if (plantPos != null){
Dungeon.level.plant((Plant.Seed) Generator.random(Generator.Category.SEED), plantPos);
plantCandidates.remove(plantPos);
int plants = Random.chances(new float[]{0, 6, 3, 1});
for (int i = 0; i < plants; i++) {
Integer plantPos = Random.element(plantCandidates);
if (plantPos != null) {
Dungeon.level.plant((Plant.Seed) Generator.random(Generator.Category.SEED), plantPos);
plantCandidates.remove(plantPos);
}
}
plantPos = Random.element(plantCandidates);
Integer plantPos = Random.element(plantCandidates);
if (plantPos != null){
if (Random.Int(2) == 0){
Dungeon.level.plant( new WandOfRegrowth.Dewcatcher.Seed(), plantPos);
} else {
Dungeon.level.plant((Plant.Seed) Generator.random(Generator.Category.SEED), plantPos);
Plant.Seed plant;
switch (Random.chances(new float[]{0, 6, 3, 1})){
case 1: default:
plant = new WandOfRegrowth.Dewcatcher.Seed();
break;
case 2:
plant = new WandOfRegrowth.Seedpod.Seed();
break;
case 3:
plant = new Starflower.Seed();
break;
}
plantCandidates.remove(plantPos);
Dungeon.level.plant( plant, plantPos);
}
}

View File

@ -21,15 +21,36 @@
package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
import android.graphics.Shader;
import android.media.TimedMetaData;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTerrainTilemap;
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.watabou.noosa.Tilemap;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PathFinder;
import com.watabou.utils.Random;
import java.util.ArrayList;
public class ShockBomb extends Bomb {
@ -41,13 +62,36 @@ public class ShockBomb extends Bomb {
public void explode(int cell) {
super.explode(cell);
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
ArrayList<Char> affected = new ArrayList<>();
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 3 );
for (int i = 0; i < PathFinder.distance.length; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
GameScene.add(Blob.seed(i, 20, Electricity.class));
if (PathFinder.distance[i] < Integer.MAX_VALUE
&& Actor.findChar(i) != null) {
affected.add(Actor.findChar(i));
}
}
Sample.INSTANCE.play(Assets.SND_LIGHTNING);
for (Char ch : affected.toArray(new Char[0])){
Ballistica LOS = new Ballistica(cell, ch.pos, Ballistica.PROJECTILE);
if (LOS.collisionPos != ch.pos){
affected.remove(ch);
}
}
ArrayList<Lightning.Arc> arcs = new ArrayList<>();
for (Char ch : affected){
int power = 16 - 4*Dungeon.level.distance(ch.pos, cell);
if (power > 0){
//32% to 8% regular bomb damage
int damage = Math.round(Random.NormalIntRange(5 + Dungeon.depth, 10 + 2*Dungeon.depth) * (power/50f));
ch.damage(damage, this);
if (ch.isAlive()) Buff.prolong(ch, Paralysis.class, power);
arcs.add(new Lightning.Arc(DungeonTilemap.tileCenterToWorld(cell), ch.sprite.center()));
}
}
CellEmitter.center(cell).burst(SparkParticle.FACTORY, 20);
Dungeon.hero.sprite.parent.addToFront(new Lightning(arcs, null));
}
@Override

View File

@ -68,8 +68,9 @@ public class ShrapnelBomb extends Bomb {
}
for (Char ch : affected){
//regular bomb damage
//regular bomb damage, which falls off at a rate of 5% per tile of distance
int damage = Math.round(Random.NormalIntRange( Dungeon.depth+5, 10 + Dungeon.depth * 2 ));
damage = Math.round(damage * (1f - .05f*Dungeon.level.distance(cell, ch.pos)));
damage -= ch.drRoll();
ch.damage(damage, this);
if (ch == Dungeon.hero && !ch.isAlive()) {

View File

@ -40,11 +40,6 @@ public class WoollyBomb extends Bomb {
image = ItemSpriteSheet.WOOLY_BOMB;
}
@Override
public boolean explodesDestructively() {
return false;
}
@Override
public void explode(int cell) {
super.explode(cell);

View File

@ -438,7 +438,7 @@ items.bags.magicalholster.desc=This slim holster is made from some exotic animal
###bombs
items.bombs.arcanebomb.name=arcane bomb
items.bombs.arcanebomb.desc=This bomb has been imbued with arcane properties, and will explode into a powerful blast similar to Goo's pumped up attack.
items.bombs.arcanebomb.desc=This bomb has been imbued with arcane properties. It will explode into a powerful blast similar to Goo's pumped up attack. This blast penetrates armor and reaches further than a regular bomb's explosion.
items.bombs.bomb.name=bomb
items.bombs.bomb.ac_lightthrow=LIGHT & THROW
@ -452,31 +452,32 @@ items.bombs.bomb$doublebomb.name=two bombs
items.bombs.bomb$doublebomb.desc=A stack of two hefty black powder bombs, looks like you get one free!
items.bombs.firebomb.name=firebomb
items.bombs.firebomb.desc=This bomb has been modified to burst into a sustained firestorm when it explodes.
items.bombs.firebomb.desc=This bomb has been modified to burst into a sustained flame in a larger area when it explodes.
items.bombs.flashbang.name=flashbang
items.bombs.flashbang.desc=This customized bomb will erupt into a burst of blinding light instead of exploding. Anything that can see the burst will be disoriented for some time.
items.bombs.flashbang.desc=This customized bomb will erupt into a burst of blinding light when it explodes. Anything nearby will be disoriented based on how close it was to the bomb.
items.bombs.frostbomb.name=frost bomb
items.bombs.frostbomb.desc=This bomb has been modified to burst into a sustained gust of freezing air when it explodes.
items.bombs.frostbomb.desc=This bomb has been modified to burst into a sustained gust of freezing air in a larger area when it explodes.
items.bombs.holybomb.name=holy bomb
items.bombs.holybomb.desc=This bomb has been modified to flash holy light when it explodes, dealing bonus damage to undead and demonic enemies.
items.bombs.holybomb.desc=This bomb has been modified to flash holy light in a larger area when it explodes, dealing bonus damage to undead and demonic enemies.
items.bombs.noisemaker.name=noisemaker
items.bombs.noisemaker.desc=This customized bomb will repeatedly make noise instead of exploding. Enemies who aren't otherwise engaged will be repeatedly drawn to the blast location.
items.bombs.noisemaker.desc=This customized bomb will repeatedly make noise when its fuse runs out. When something touches the bomb, it will explode!
items.bombs.noisemaker.desc_burning=The noisemaker is ticking away, it'll explode when something gets near!
items.bombs.shockbomb.name=shock bomb
items.bombs.shockbomb.desc=This bomb has been modified to unleash a storm of electricity around it when it explodes.
items.bombs.shockbomb.desc=This bomb has been modified to unleash bolts of electricity when it explodes. Anything nearby will be damaged and stunned based on how close it was to the bomb.
items.bombs.regrowthbomb.name=regrowth bomb
items.bombs.regrowthbomb.desc=This customized bomb will splash life-giving liquid all around it instead of exploding. The area caught in the blast will rapidly sprout grass and plants, and any allies caught in the blast will be healed.
items.bombs.regrowthbomb.desc=This customized bomb will splash life-giving liquid all around it instead of exploding. The area caught in the blast will rapidly sprout grass and plants. Yourself and any allies caught in the blast will be healed.
items.bombs.shrapnelbomb.name=shrapnel bomb
items.bombs.shrapnelbomb.desc=This bomb has been modified with scraps of DM-300's metal, which will fragment and fly everywhere when it explodes. You had better hide behind something when using it...
items.bombs.shrapnelbomb.desc=This bomb has been modified with scraps of DM-300's metal, which will fragment and fly everywhere when it explodes, damaging anything in a huge range around the bomb. You had better hide behind something when using it...
items.bombs.woollybomb.name=woolly bomb
items.bombs.woollybomb.desc=This customized bomb will create a field of magical sheep instead of exploding. These sheep will block movement and persist for some time.
items.bombs.woollybomb.desc=This customized bomb will create a field of magical sheep after exploding. These sheep will block movement and persist for some time.
###food
items.food.blandfruit.name=blandfruit