diff --git a/assets/elemental.png b/assets/elemental.png index 5e7564ded..c93b4d7ed 100644 Binary files a/assets/elemental.png and b/assets/elemental.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewbornElemental.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewbornElemental.java new file mode 100644 index 000000000..fcd22a8ef --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewbornElemental.java @@ -0,0 +1,60 @@ +/* + * 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.actors.mobs; + +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost; + +public class NewbornElemental extends Elemental { + + { + name = "newborn fire elemental"; + HT = 65; + HP = HT/2; //32 + + defenseSkill = 12; + + EXP = 4; + + loot = null; //TODO Elemental embers + lootChance = 1f; + } + + @Override + public int damageRoll() { + return super.damageRoll()/2; + } + + @Override + public void add(Buff buff) { + if (buff instanceof Frost || buff instanceof Chill) { + die(buff); + } else { + super.add(buff); + } + } + + @Override + public String description() { + return "young fire elemental"; //TODO + } +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java new file mode 100644 index 000000000..94a14d333 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/quest/CeremonialCandle.java @@ -0,0 +1,101 @@ +/* + * 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.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.NewbornElemental; +import com.shatteredpixel.shatteredpixeldungeon.items.Heap; +import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.levels.Level; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; + + +public class CeremonialCandle extends Item { + + //generated with the wandmaker quest + public static int ritualPos; + + { + name = "ceremonial candle"; + image = ItemSpriteSheet.CANDLE; + + unique = true; + } + + @Override + public boolean isUpgradable() { + return false; + } + + @Override + public boolean isIdentified() { + return true; + } + + @Override + public void doDrop(Hero hero) { + super.doDrop(hero); + checkCandles(); + } + + @Override + protected void onThrow(int cell) { + super.onThrow(cell); + checkCandles(); + } + + private static void checkCandles(){ + Heap heapTop = Dungeon.level.heaps.get(ritualPos - Level.WIDTH); + Heap heapRight = Dungeon.level.heaps.get(ritualPos + 1); + Heap heapBottom = Dungeon.level.heaps.get(ritualPos + Level.WIDTH); + Heap heapLeft = Dungeon.level.heaps.get(ritualPos - 1); + + if (heapTop != null && + heapRight != null && + heapBottom != null && + heapLeft != null){ + + if (heapTop.peek() instanceof CeremonialCandle && + heapRight.peek() instanceof CeremonialCandle && + heapBottom.peek() instanceof CeremonialCandle && + heapLeft.peek() instanceof CeremonialCandle){ + + heapTop.pickUp(); + heapRight.pickUp(); + heapBottom.pickUp(); + heapLeft.pickUp(); + + NewbornElemental elemental = new NewbornElemental(); + elemental.pos = ritualPos; + Dungeon.level.mobs.add( elemental ); + + } + } + + } + + @Override + public String info() { + return + "candle"; //TODO + } +}