v0.3.1: new traps batch 1
(11 new traps, changes to 2 existing traps)
This commit is contained in:
parent
958c8a22fa
commit
20a6f91758
|
@ -150,8 +150,7 @@ public class Bomb extends Item {
|
|||
}
|
||||
|
||||
if (ch == Dungeon.hero && !ch.isAlive())
|
||||
//constant is used here in the rare instance a player is killed by a double bomb.
|
||||
Dungeon.fail(Utils.format(ResultDescriptions.ITEM, "bomb"));
|
||||
Dungeon.fail("Killed by an explosion");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
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.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
//TODO: test fire in water/pits
|
||||
public class BlazingTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Blazing trap";
|
||||
color = TrapSprite.ORANGE;
|
||||
shape = TrapSprite.STARS;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
for (int i : Level.NEIGHBOURS9DIST2){
|
||||
if (!Level.solid[pos+i]) {
|
||||
if (Level.pit[pos+i] || Level.water[pos+i])
|
||||
GameScene.add(Blob.seed(pos + i, 1, Fire.class));
|
||||
else
|
||||
GameScene.add(Blob.seed(pos + i, 5, Fire.class));
|
||||
CellEmitter.get(pos + i).burst(FlameParticle.FACTORY, 5);
|
||||
}
|
||||
}
|
||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "stepping on this trap will ignite a powerful chemical mixture, setting a wide area ablaze.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Chill;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class ChillingTrap extends Trap{
|
||||
|
||||
{
|
||||
name = "Chilling trap";
|
||||
color = TrapSprite.WHITE;
|
||||
shape = TrapSprite.DOTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
Heap heap = Dungeon.level.heaps.get( pos );
|
||||
if (heap != null) heap.freeze();
|
||||
|
||||
Char ch = Actor.findChar( pos );
|
||||
if (ch != null){
|
||||
if (visible){
|
||||
Splash.at( sprite.center(), 0xFFB2D6FF, 5);
|
||||
Sample.INSTANCE.play( Assets.SND_SHATTER );
|
||||
}
|
||||
Chill.prolong(ch, Chill.class, 5f + Random.Int(Dungeon.depth));
|
||||
ch.damage(Random.NormalIntRange(1 , Dungeon.depth), this);
|
||||
if (!ch.isAlive() && ch == Dungeon.hero){
|
||||
Dungeon.fail( Utils.format(ResultDescriptions.TRAP, name) );
|
||||
GLog.n("You succumb to the chilling trap...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "when activated, chemicals in this trap will trigger a snap-frost at its location.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
|
||||
public class ConfusionTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Confusion gas trap";
|
||||
color = TrapSprite.TEAL;
|
||||
shape = TrapSprite.GRILL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
|
||||
GameScene.add(Blob.seed(pos, 300 + 20 * Dungeon.depth, ConfusionGas.class));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Triggering this trap will set a cloud of confusion gas loose within the immediate area.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
|
||||
public class ExplosiveTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Explosive trap";
|
||||
color = TrapSprite.GREY;
|
||||
shape = TrapSprite.WAVES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
new Bomb().explode(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "This trap contains some powdered explosive and a trigger mechanism. " +
|
||||
"Activating it will cause an explosion in the immediate area.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
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.actors.buffs.Cripple;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class FlashingTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Flashing trap";
|
||||
color = TrapSprite.YELLOW;
|
||||
shape = TrapSprite.STARS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
Char ch = Actor.findChar(pos);
|
||||
|
||||
if (ch != null) {
|
||||
int len = Random.Int(5, 10)+Dungeon.depth;
|
||||
Buff.prolong( ch, Blindness.class, len );
|
||||
Buff.prolong( ch, Cripple.class, len );
|
||||
if (ch instanceof Mob) {
|
||||
if (((Mob)ch).state == ((Mob)ch).HUNTING) ((Mob)ch).state = ((Mob)ch).WANDERING;
|
||||
((Mob)ch).beckon( Dungeon.level.randomDestination() );
|
||||
}
|
||||
if (ch == Dungeon.hero){
|
||||
Sample.INSTANCE.play( Assets.SND_BLAST );
|
||||
}
|
||||
}
|
||||
|
||||
if (Dungeon.visible[pos]) {
|
||||
GameScene.flash(0xFFFFFF);
|
||||
CellEmitter.get(pos).burst( Speck.factory(Speck.LIGHT), 4 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "On activation, this trap with ignite a potent flashing powder stored within, " +
|
||||
"temporarily blinding and crippling its victim.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
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.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class FlockTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Flock trap";
|
||||
color = TrapSprite.WHITE;
|
||||
shape = TrapSprite.WAVES;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
//use an actor as we want to put this on a slight delay so all chars get a chance to act this turn first.
|
||||
Actor.add(new Actor() {
|
||||
|
||||
{ actPriority = 3; }
|
||||
|
||||
protected boolean act() {
|
||||
int cell;
|
||||
for (int i : Level.NEIGHBOURS9DIST2) {
|
||||
cell = pos + i;
|
||||
if (Level.insideMap(cell) && Actor.findChar(cell) == null && !(Level.solid[cell] || Level.pit[cell])) {
|
||||
Sheep sheep = new Sheep();
|
||||
sheep.lifespan = 2 + Random.Int(Dungeon.depth + 10);
|
||||
sheep.pos = cell;
|
||||
GameScene.add(sheep);
|
||||
}
|
||||
CellEmitter.get(cell).burst(Speck.factory(Speck.WOOL), 4);
|
||||
}
|
||||
Sample.INSTANCE.play(Assets.SND_PUFF);
|
||||
Actor.remove(this);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Perhaps a joke from some amateur mage, triggering this trap will create a flock of magical sheep.";
|
||||
}
|
||||
}
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Wound;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.watabou.utils.Random;
|
||||
|
@ -44,9 +45,10 @@ public class GrippingTrap extends Trap {
|
|||
Char c = Actor.findChar( pos );
|
||||
|
||||
if (c != null) {
|
||||
int damage = Math.max( 0, (Dungeon.depth + 3) - Random.IntRange( 0, c.dr() / 2 ) );
|
||||
int damage = Math.max( 0, (Dungeon.depth) - Random.IntRange( 0, c.dr() / 2 ) );
|
||||
Buff.affect( c, Bleeding.class ).set( damage );
|
||||
Buff.prolong( c, Cripple.class, Cripple.DURATION );
|
||||
Buff.prolong( c, Cripple.class, 15f);
|
||||
Buff.prolong( c, Roots.class, 5f);
|
||||
Wound.hit( c );
|
||||
} else {
|
||||
Wound.hit( pos );
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.watabou.noosa.Camera;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
|
@ -68,6 +73,16 @@ public class LightningTrap extends Trap {
|
|||
ch.sprite.parent.add( new Lightning( arcs, null ) );
|
||||
}
|
||||
|
||||
Heap heap = Dungeon.level.heaps.get(pos);
|
||||
if (heap != null){
|
||||
//TODO: this should probably charge staffs too
|
||||
Item item = heap.items.peek();
|
||||
if (item instanceof Wand){
|
||||
Wand wand = (Wand)item;
|
||||
((Wand)item).curCharges += (int)Math.ceil((wand.curCharges - wand.maxCharges)/2f);
|
||||
}
|
||||
}
|
||||
|
||||
CellEmitter.center( pos ).burst( SparkParticle.FACTORY, Random.IntRange( 3, 4 ) );
|
||||
}
|
||||
|
||||
|
@ -79,6 +94,6 @@ public class LightningTrap extends Trap {
|
|||
@Override
|
||||
public String desc() {
|
||||
return "A mechanism with a large amount of energy stored into it. " +
|
||||
"Triggering the trap will discharge that energy into whever is nearby.";
|
||||
"Triggering the trap will discharge that energy into whatever activates it.";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
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.Ooze;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
|
||||
public class OozeTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Ooze trap";
|
||||
color = TrapSprite.GREEN;
|
||||
shape = TrapSprite.DOTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
Char ch = Actor.findChar( pos );
|
||||
|
||||
if (ch != null){
|
||||
Buff.affect(ch, Ooze.class);
|
||||
Splash.at(sprite.center(), 0x000000, 5);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "This trap with splash out caustic ooze when activated, which will burn until it is washed away.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
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.hero.Hero;
|
||||
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.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class TeleportationTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Teleportation trap";
|
||||
color = TrapSprite.TEAL;
|
||||
shape = TrapSprite.DOTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
|
||||
CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
|
||||
Sample.INSTANCE.play( Assets.SND_TELEPORT );
|
||||
|
||||
Char ch = Actor.findChar( pos);
|
||||
if (ch instanceof Hero){
|
||||
ScrollOfTeleportation.teleportHero( (Hero)ch);
|
||||
} else if (ch != null){
|
||||
int count = 10;
|
||||
int pos;
|
||||
do {
|
||||
pos = Dungeon.level.randomRespawnCell();
|
||||
if (count-- <= 0) {
|
||||
break;
|
||||
}
|
||||
} while (pos == -1);
|
||||
|
||||
if (pos == -1) {
|
||||
|
||||
GLog.w(ScrollOfTeleportation.TXT_NO_TELEPORT);
|
||||
|
||||
} else {
|
||||
|
||||
ch.pos = pos;
|
||||
ch.sprite.place(ch.pos);
|
||||
ch.sprite.visible = Dungeon.visible[pos];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Heap heap = Dungeon.level.heaps.get(pos);
|
||||
|
||||
if (heap != null){
|
||||
int cell = Dungeon.level.randomRespawnCell();
|
||||
|
||||
Item item = heap.pickUp();
|
||||
|
||||
if (cell != -1) {
|
||||
Dungeon.level.drop( item, cell );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Whatever triggers this trap will be warped to some other location on this floor.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
public class TrapGenerator {
|
||||
|
||||
|
||||
public Trap trapforDepth(int depth){
|
||||
Class Trapclass;
|
||||
switch(depth){
|
||||
case 1:
|
||||
return new FireTrap();
|
||||
|
||||
default:
|
||||
return new FireTrap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Class<? extends Trap> trapforTrapRoom(int depth){
|
||||
return FireTrap.class;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
|
||||
public class VenomTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Venom gas trap";
|
||||
color = TrapSprite.VIOLET;
|
||||
shape = TrapSprite.GRILL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
|
||||
VenomGas venomGas = Blob.seed(pos, 80 + 5 * Dungeon.depth, VenomGas.class);
|
||||
|
||||
venomGas.setStrength(1+Dungeon.depth/4);
|
||||
|
||||
GameScene.add(venomGas);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Triggering this trap will set a cloud of deadly venom gas loose within the immediate area.";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* 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.levels.traps;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
||||
public class WornTrap extends Trap {
|
||||
|
||||
{
|
||||
name = "Worn out trap";
|
||||
color = TrapSprite.BLACK;
|
||||
shape = TrapSprite.DOTS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
GLog.i("nothing happens..");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return "Due to age and possibly poor workmanship, " +
|
||||
"it looks like this trap has worn to the point where it won't do anything when triggered.";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user