v0.7.0: WIP implementation of 8 new bombs
This commit is contained in:
parent
c7df1d6a3d
commit
a69cc7a12e
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 30 KiB |
|
@ -109,7 +109,7 @@ public abstract class Char extends Actor {
|
|||
|
||||
public int viewDistance = 8;
|
||||
|
||||
protected boolean[] fieldOfView = null;
|
||||
public boolean[] fieldOfView = null;
|
||||
|
||||
private HashSet<Buff> buffs = new HashSet<>();
|
||||
|
||||
|
|
|
@ -33,7 +33,14 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMirrorImage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
|
@ -158,7 +165,7 @@ public class Bomb extends Item {
|
|||
}
|
||||
|
||||
if (ch == Dungeon.hero && !ch.isAlive())
|
||||
Dungeon.fail( getClass() );
|
||||
Dungeon.fail( Bomb.class );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -249,6 +256,9 @@ public class Bomb extends Item {
|
|||
for (Heap heap : Dungeon.level.heaps.values()) {
|
||||
if (heap.items.contains(bomb)) {
|
||||
heap.items.remove(bomb);
|
||||
if (heap.items.isEmpty()){
|
||||
heap.destroy();
|
||||
}
|
||||
|
||||
bomb.explode(heap.pos);
|
||||
|
||||
|
@ -290,7 +300,14 @@ public class Bomb extends Item {
|
|||
|
||||
private static final HashMap<Class<?extends Item>, Class<?extends Bomb>> validIngredients = new HashMap<>();
|
||||
static {
|
||||
validIngredients.put(PotionOfLiquidFlame.class, Firebomb.class);
|
||||
validIngredients.put(PotionOfFrost.class, FrostBomb.class);
|
||||
validIngredients.put(PotionOfHealing.class, HealingBomb.class);
|
||||
validIngredients.put(PotionOfInvisibility.class, Flashbang.class);
|
||||
validIngredients.put(ScrollOfRecharging.class, ShockBomb.class);
|
||||
validIngredients.put(ScrollOfRemoveCurse.class, HolyBomb.class);
|
||||
validIngredients.put(ScrollOfMirrorImage.class, WoollyBomb.class);
|
||||
validIngredients.put(ScrollOfRage.class, Noisemaker.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.PathFinder;
|
||||
|
||||
public class Firebomb extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.FIRE_BOMB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
super.explode(cell);
|
||||
|
||||
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
|
||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||
if (Dungeon.level.pit[i])
|
||||
GameScene.add(Blob.seed(i, 2, Fire.class));
|
||||
else
|
||||
GameScene.add(Blob.seed(i, 10, Fire.class));
|
||||
CellEmitter.get(i).burst(FlameParticle.FACTORY, 5);
|
||||
}
|
||||
}
|
||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
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.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
public class Flashbang extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.FLASHBANG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
//We're blowing up, so no need for a fuse anymore.
|
||||
this.fuse = null;
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_BLAST );
|
||||
|
||||
if (Dungeon.level.heroFOV[cell]) {
|
||||
CellEmitter.center( cell ).burst( BlastParticle.FACTORY, 30 );
|
||||
}
|
||||
|
||||
//no regular explosion damage
|
||||
|
||||
//FIXME currently has odd behaviour for the hero
|
||||
//TODO final balancing for effect here, based on distance? perhaps also cripple/weaken?
|
||||
for (Char ch : Actor.chars()){
|
||||
if (ch == Dungeon.hero){
|
||||
if (Dungeon.level.heroFOV[cell]){
|
||||
Buff.prolong(ch, Blindness.class, 5f);
|
||||
GameScene.flash(0xFFFFFF);
|
||||
}
|
||||
} else if (ch.fieldOfView[cell]){
|
||||
Buff.prolong(ch, Blindness.class, 5f);
|
||||
if (ch == Dungeon.hero){
|
||||
GameScene.flash(0xFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.watabou.utils.PathFinder;
|
||||
|
||||
public class FrostBomb extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.FROST_BOMB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
super.explode(cell);
|
||||
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
|
||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||
GameScene.add(Blob.seed(i, 10, Freezing.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,12 +21,49 @@
|
|||
|
||||
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.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Healing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.PathFinder;
|
||||
|
||||
public class HealingBomb extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.HEAL_BOMB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
//We're blowing up, so no need for a fuse anymore.
|
||||
this.fuse = null;
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_BLAST );
|
||||
|
||||
if (Dungeon.level.heroFOV[cell]) {
|
||||
CellEmitter.center( cell ).burst( BlastParticle.FACTORY, 30 );
|
||||
}
|
||||
|
||||
//no regular explosion damage
|
||||
|
||||
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
|
||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||
Char ch = Actor.findChar(i);
|
||||
if (ch != null){
|
||||
Buff.affect( ch, Healing.class ).setHeal((int)(0.5f*ch.HT + 30), 0.333f, 0);
|
||||
PotionOfHealing.cure( ch );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
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.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.PathFinder;
|
||||
|
||||
public class HolyBomb extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.HOLY_BOMB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
super.explode(cell);
|
||||
|
||||
if (Dungeon.level.heroFOV[cell]) {
|
||||
new Flare(10, 64).show(Dungeon.hero.sprite.parent, DungeonTilemap.tileCenterToWorld(cell), 2f);
|
||||
}
|
||||
|
||||
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
|
||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||
Char n = Actor.findChar(i);
|
||||
if (n != null) {
|
||||
Buff.prolong(n, Blindness.class, 1f);
|
||||
if (n.properties().contains(Char.Property.UNDEAD) || n.properties().contains(Char.Property.DEMONIC)){
|
||||
//TODO decide on damage numbers and other effects here
|
||||
n.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
public class Noisemaker extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.NOISEMAKER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
//We're blowing up, so no need for a fuse anymore.
|
||||
this.fuse = null;
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_BLAST );
|
||||
|
||||
if (Dungeon.level.heroFOV[cell]) {
|
||||
CellEmitter.center( cell ).burst( BlastParticle.FACTORY, 30 );
|
||||
}
|
||||
|
||||
//no regular explosion damage
|
||||
|
||||
Buff.affect(Dungeon.hero, Noise.class).set(cell);
|
||||
}
|
||||
|
||||
public static class Noise extends Buff {
|
||||
|
||||
int floor;
|
||||
int cell;
|
||||
|
||||
int left;
|
||||
|
||||
public void set(int cell){
|
||||
floor = Dungeon.depth;
|
||||
this.cell = cell;
|
||||
left = 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean act() {
|
||||
|
||||
if (Dungeon.depth == floor){
|
||||
//VFX
|
||||
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.5f );
|
||||
}
|
||||
|
||||
for (Mob m : Dungeon.level.mobs){
|
||||
if (m.state != m.HUNTING) {
|
||||
m.beckon(cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (left > 0) {
|
||||
spend(TICK * 10f);
|
||||
left--;
|
||||
} else {
|
||||
detach();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.PathFinder;
|
||||
|
||||
public class ShockBomb extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.SHOCK_BOMB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
super.explode(cell);
|
||||
|
||||
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
|
||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||
GameScene.add(Blob.seed(i, 10, Electricity.class));
|
||||
}
|
||||
}
|
||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2018 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
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.mobs.npcs.Sheep;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class WoollyBomb extends Bomb {
|
||||
|
||||
{
|
||||
//TODO visuals
|
||||
image = ItemSpriteSheet.WOOLY_BOMB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode(int cell) {
|
||||
//We're blowing up, so no need for a fuse anymore.
|
||||
this.fuse = null;
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_BLAST );
|
||||
|
||||
if (Dungeon.level.heroFOV[cell]) {
|
||||
CellEmitter.center( cell ).burst( BlastParticle.FACTORY, 30 );
|
||||
}
|
||||
|
||||
//no regular explosion damage
|
||||
|
||||
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
|
||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||
if (Dungeon.level.insideMap(i)
|
||||
&& Actor.findChar(i) == null
|
||||
&& !(Dungeon.level.pit[i])) {
|
||||
Sheep sheep = new Sheep();
|
||||
sheep.lifespan = Random.NormalIntRange( 8, 16 );
|
||||
sheep.pos = i;
|
||||
Dungeon.level.press(sheep.pos, sheep);
|
||||
GameScene.add(sheep);
|
||||
CellEmitter.get(i).burst(Speck.factory(Speck.WOOL), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Sample.INSTANCE.play(Assets.SND_PUFF);
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -132,12 +132,26 @@ public class ItemSpriteSheet {
|
|||
private static final int BOMBS = xy(1, 5); //16 slots
|
||||
public static final int BOMB = BOMBS+0;
|
||||
public static final int DBL_BOMB = BOMBS+1;
|
||||
public static final int HEAL_BOMB = BOMBS+2;
|
||||
public static final int FIRE_BOMB = BOMBS+2;
|
||||
public static final int FROST_BOMB = BOMBS+3;
|
||||
public static final int HEAL_BOMB = BOMBS+4;
|
||||
public static final int FLASHBANG = BOMBS+5;
|
||||
public static final int SHOCK_BOMB = BOMBS+6;
|
||||
public static final int HOLY_BOMB = BOMBS+7;
|
||||
public static final int WOOLY_BOMB = BOMBS+8;
|
||||
public static final int NOISEMAKER = BOMBS+9;
|
||||
|
||||
static{
|
||||
assignItemRect(BOMB, 10, 13);
|
||||
assignItemRect(DBL_BOMB, 14, 13);
|
||||
assignItemRect(FIRE_BOMB, 10, 13);
|
||||
assignItemRect(FROST_BOMB, 10, 13);
|
||||
assignItemRect(HEAL_BOMB, 10, 13);
|
||||
assignItemRect(FLASHBANG, 10, 13);
|
||||
assignItemRect(SHOCK_BOMB, 10, 13);
|
||||
assignItemRect(HOLY_BOMB, 10, 13);
|
||||
assignItemRect(WOOLY_BOMB, 10, 13);
|
||||
assignItemRect(NOISEMAKER, 10, 13);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -354,7 +354,29 @@ items.bombs.bomb.desc_burning=A fairly hefty black powder bomb. An explosion fro
|
|||
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=TODO
|
||||
|
||||
items.bombs.flashbang.name=flashbang
|
||||
items.bombs.flashbang.desc=TODO
|
||||
|
||||
items.bombs.frostbomb.name=frost bomb
|
||||
items.bombs.frostbomb.desc=TODO
|
||||
|
||||
items.bombs.healingbomb.name=healing bomb
|
||||
items.bombs.healingbomb.desc=TODO
|
||||
|
||||
items.bombs.holybomb.name=holy bomb
|
||||
items.bombs.holybomb.desc=TODO
|
||||
|
||||
items.bombs.noisemaker.name=noisemaker
|
||||
items.bombs.noisemaker.desc=TODO
|
||||
|
||||
items.bombs.shockbomb.name=shock bomb
|
||||
items.bombs.shockbomb.desc=TODO
|
||||
|
||||
items.bombs.woollybomb.name=woolly bomb
|
||||
items.bombs.woollybomb.desc=TODO
|
||||
|
||||
###food
|
||||
items.food.blandfruit.name=blandfruit
|
||||
|
|
Loading…
Reference in New Issue
Block a user