diff --git a/assets/items.png b/assets/items.png index 4e296d727..155c2edad 100644 Binary files a/assets/items.png and b/assets/items.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewbornElemental.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewbornElemental.java index fcd22a8ef..45d34f468 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewbornElemental.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewbornElemental.java @@ -23,11 +23,15 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost; +import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers; +import com.shatteredpixel.shatteredpixeldungeon.sprites.NewbornElementalSprite; public class NewbornElemental extends Elemental { { name = "newborn fire elemental"; + spriteClass = NewbornElementalSprite.class; + HT = 65; HP = HT/2; //32 @@ -35,7 +39,7 @@ public class NewbornElemental extends Elemental { EXP = 4; - loot = null; //TODO Elemental embers + loot = new Embers(); lootChance = 1f; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index d054d2c11..2471fe7e6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.quest.CeremonialCandle; +import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers; import com.watabou.noosa.audio.Sample; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; @@ -160,7 +161,7 @@ public class Wandmaker extends NPC { item = Dungeon.hero.belongings.getItem(CorpseDust.class); break; case 2: - item = Dungeon.hero.belongings.getItem(CorpseDust.class); //TODO: elemental embers + item = Dungeon.hero.belongings.getItem(Embers.class); break; case 3: item = Dungeon.hero.belongings.getItem(Rotberry.Seed.class); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java index 511be8aa6..581030fb3 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java @@ -20,14 +20,18 @@ */ package com.shatteredpixel.shatteredpixeldungeon.items.quest; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.NewbornElemental; +import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; +import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.watabou.noosa.audio.Sample; public class CeremonialCandle extends Item { @@ -40,6 +44,7 @@ public class CeremonialCandle extends Item { image = ItemSpriteSheet.CANDLE; unique = true; + stackable = true; } @Override @@ -90,8 +95,10 @@ public class CeremonialCandle extends Item { elemental.state = elemental.HUNTING; GameScene.add(elemental, 1); - //TODO visuals - + for (int i : Level.NEIGHBOURS9){ + CellEmitter.get(ritualPos+i).burst(ElmoParticle.FACTORY, 10); + } + Sample.INSTANCE.play(Assets.SND_BURNING); } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/Embers.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/Embers.java new file mode 100644 index 000000000..0b97bbcb5 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/Embers.java @@ -0,0 +1,56 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2015 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 + */ +package com.shatteredpixel.shatteredpixeldungeon.items.quest; + +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; + +public class Embers extends Item { + + { + name = "elemental embers"; + image = ItemSpriteSheet.EMBER; + + unique = true; + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public boolean isIdentified() { + return true; + } + + @Override + public String info() { + return + "ember"; //TODO + } + + @Override + public ItemSprite.Glowing glowing() { + return new ItemSprite.Glowing(0x660000, 3f); + } +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index 9e1efc2a2..dfea24585 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -171,7 +171,7 @@ public abstract class RegularLevel extends Level { protected void placeSign(){ while (true) { int pos = roomEntrance.random(); - if (pos != entrance && traps.get(pos) == null) { + if (pos != entrance && traps.get(pos) == null && findMob(pos) == null) { map[pos] = Terrain.SIGN; break; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/EntrancePainter.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/EntrancePainter.java index 68babb8b1..ea3448c6a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/EntrancePainter.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/EntrancePainter.java @@ -34,8 +34,10 @@ public class EntrancePainter extends Painter { for (Room.Door door : room.connected.values()) { door.set( Room.Door.Type.REGULAR ); } - - level.entrance = room.random( 1 ); + + do { + level.entrance = room.random(1); + } while (level.findMob(level.entrance) != null); set( level, level.entrance, Terrain.ENTRANCE ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index fe399a90a..9d4d306ac 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -225,9 +225,10 @@ public class ItemSpriteSheet { public static final int SKULL = ROW14+0; public static final int DUST = ROW14+1; public static final int CANDLE = ROW14+2; - public static final int PICKAXE = ROW14+3; - public static final int ORE = ROW14+4; - public static final int TOKEN = ROW14+5; + public static final int EMBER = ROW14+3; + public static final int PICKAXE = ROW14+4; + public static final int ORE = ROW14+5; + public static final int TOKEN = ROW14+6; //Row Fifteen: Containers/Bags public static final int VIAL = ROW15+0; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/NewbornElementalSprite.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/NewbornElementalSprite.java new file mode 100644 index 000000000..6d90217c0 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/NewbornElementalSprite.java @@ -0,0 +1,72 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2015 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 + */ +package com.shatteredpixel.shatteredpixeldungeon.sprites; + + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.watabou.noosa.MovieClip; +import com.watabou.noosa.TextureFilm; + +public class NewbornElementalSprite extends MobSprite{ + + public NewbornElementalSprite() { + super(); + + texture( Assets.ELEMENTAL ); + + int ofs = 22; + + TextureFilm frames = new TextureFilm( texture, 12, 14 ); + + idle = new MovieClip.Animation( 10, true ); + idle.frames( frames, ofs+0, ofs+1, ofs+2 ); + + run = new MovieClip.Animation( 12, true ); + run.frames( frames, ofs+0, ofs+1, ofs+3 ); + + attack = new MovieClip.Animation( 15, false ); + attack.frames( frames, ofs+4, ofs+5, ofs+6 ); + + die = new MovieClip.Animation( 15, false ); + die.frames( frames, ofs+7, ofs+8, ofs+9, ofs+10, ofs+11, ofs+12, ofs+13, ofs+12 ); + + play( idle ); + } + + @Override + public void link( Char ch ) { + super.link( ch ); + add( CharSprite.State.BURNING ); + } + + @Override + public void die() { + super.die(); + remove( CharSprite.State.BURNING ); + } + + @Override + public int blood() { + return 0xFFFF7D13; + } + +}