v0.3.0c: trap refactor pt1, moved all traps to be instance based (not properly tied into level logic yet)
This commit is contained in:
@@ -18,23 +18,31 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
||||
|
||||
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.Poison;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PoisonParticle;
|
||||
|
||||
public class PoisonTrap {
|
||||
public class PoisonTrap extends Trap{
|
||||
|
||||
// 0xBB66EE
|
||||
|
||||
public static void trigger( int pos, Char ch ) {
|
||||
|
||||
{
|
||||
name = "poison trap";
|
||||
image = 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activate() {
|
||||
|
||||
Char ch = Actor.findChar( pos );
|
||||
|
||||
if (ch != null) {
|
||||
Buff.affect( ch, Poison.class ).set( Poison.durationFactor( ch ) * (4 + Dungeon.depth / 2) );
|
||||
}
|
||||
|
||||
|
||||
CellEmitter.center( pos ).burst( PoisonParticle.SPLASH, 3 );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user