v0.3.2: fully implemented elemental embers quest

This commit is contained in:
Evan Debenham 2015-10-17 22:59:31 -04:00
parent 43327a5f4e
commit f8749368a4
9 changed files with 153 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -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;
}

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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 <http://www.gnu.org/licenses/>
*/
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);
}
}

View File

@ -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;
}

View File

@ -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 );
}

View File

@ -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;

View File

@ -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 <http://www.gnu.org/licenses/>
*/
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;
}
}