v2.5.0: fixed reclaim trap not triggering allied magic death badge
This commit is contained in:
committed by
Evan Debenham
parent
2b8fa4acad
commit
7d77431534
+2
-1
@@ -74,6 +74,7 @@ public class ReclaimTrap extends TargetedSpell {
|
|||||||
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
|
Sample.INSTANCE.play(Assets.Sounds.LIGHTNING);
|
||||||
ScrollOfRecharging.charge(hero);
|
ScrollOfRecharging.charge(hero);
|
||||||
storedTrap = t.getClass();
|
storedTrap = t.getClass();
|
||||||
|
Bestiary.setSeen(t.getClass());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
GLog.w(Messages.get(this, "no_trap"));
|
GLog.w(Messages.get(this, "no_trap"));
|
||||||
@@ -84,7 +85,7 @@ public class ReclaimTrap extends TargetedSpell {
|
|||||||
storedTrap = null;
|
storedTrap = null;
|
||||||
|
|
||||||
t.pos = bolt.collisionPos;
|
t.pos = bolt.collisionPos;
|
||||||
Bestiary.setSeen(t.getClass());
|
t.reclaimed = true;
|
||||||
Bestiary.countEncounter(t.getClass());
|
Bestiary.countEncounter(t.getClass());
|
||||||
t.activate();
|
t.activate();
|
||||||
|
|
||||||
|
|||||||
+1
@@ -88,6 +88,7 @@ public class DisintegrationTrap extends Trap {
|
|||||||
Badges.validateDeathFromGrimOrDisintTrap();
|
Badges.validateDeathFromGrimOrDisintTrap();
|
||||||
Dungeon.fail( this );
|
Dungeon.fail( this );
|
||||||
GLog.n( Messages.get(this, "ondeath") );
|
GLog.n( Messages.get(this, "ondeath") );
|
||||||
|
if (reclaimed) Badges.validateDeathFromFriendlyMagic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
|
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
|
||||||
|
|
||||||
public class ExplosiveTrap extends Trap {
|
public class ExplosiveTrap extends Trap {
|
||||||
@@ -33,6 +35,9 @@ public class ExplosiveTrap extends Trap {
|
|||||||
@Override
|
@Override
|
||||||
public void activate() {
|
public void activate() {
|
||||||
new Bomb().explode(pos);
|
new Bomb().explode(pos);
|
||||||
|
if (reclaimed && !Dungeon.hero.isAlive()) {
|
||||||
|
Badges.validateDeathFromFriendlyMagic();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -22,6 +22,7 @@
|
|||||||
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
@@ -90,6 +91,7 @@ public class GnollRockfallTrap extends RockfallTrap {
|
|||||||
if (!ch.isAlive() && ch == Dungeon.hero){
|
if (!ch.isAlive() && ch == Dungeon.hero){
|
||||||
Dungeon.fail( this );
|
Dungeon.fail( this );
|
||||||
GLog.n( Messages.get(this, "ondeath") );
|
GLog.n( Messages.get(this, "ondeath") );
|
||||||
|
if (reclaimed) Badges.validateDeathFromFriendlyMagic();
|
||||||
}
|
}
|
||||||
} else if (ch == null
|
} else if (ch == null
|
||||||
&& Dungeon.level instanceof MiningLevel
|
&& Dungeon.level instanceof MiningLevel
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ public class GrimTrap extends Trap {
|
|||||||
Badges.validateDeathFromGrimOrDisintTrap();
|
Badges.validateDeathFromGrimOrDisintTrap();
|
||||||
Dungeon.fail( GrimTrap.this );
|
Dungeon.fail( GrimTrap.this );
|
||||||
GLog.n( Messages.get(GrimTrap.class, "ondeath") );
|
GLog.n( Messages.get(GrimTrap.class, "ondeath") );
|
||||||
|
if (reclaimed) Badges.validateDeathFromFriendlyMagic();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Sample.INSTANCE.play(Assets.Sounds.BURNING);
|
Sample.INSTANCE.play(Assets.Sounds.BURNING);
|
||||||
|
|||||||
+2
@@ -22,6 +22,7 @@
|
|||||||
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
@@ -116,6 +117,7 @@ public class PoisonDartTrap extends Trap {
|
|||||||
if (!finalTarget.isAlive()) {
|
if (!finalTarget.isAlive()) {
|
||||||
Dungeon.fail(PoisonDartTrap.this);
|
Dungeon.fail(PoisonDartTrap.this);
|
||||||
GLog.n(Messages.get(PoisonDartTrap.class, "ondeath"));
|
GLog.n(Messages.get(PoisonDartTrap.class, "ondeath"));
|
||||||
|
if (reclaimed) Badges.validateDeathFromFriendlyMagic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Buff.affect( finalTarget, Poison.class ).set( poisonAmount() );
|
Buff.affect( finalTarget, Poison.class ).set( poisonAmount() );
|
||||||
|
|||||||
+2
@@ -22,6 +22,7 @@
|
|||||||
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
@@ -103,6 +104,7 @@ public class RockfallTrap extends Trap {
|
|||||||
if (!ch.isAlive() && ch == Dungeon.hero){
|
if (!ch.isAlive() && ch == Dungeon.hero){
|
||||||
Dungeon.fail( this );
|
Dungeon.fail( this );
|
||||||
GLog.n( Messages.get(this, "ondeath") );
|
GLog.n( Messages.get(this, "ondeath") );
|
||||||
|
if (reclaimed) Badges.validateDeathFromFriendlyMagic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public abstract class Trap implements Bundlable {
|
|||||||
public int shape;
|
public int shape;
|
||||||
|
|
||||||
public int pos;
|
public int pos;
|
||||||
|
public boolean reclaimed = false; //if this trap was spawned by reclaim trap
|
||||||
|
|
||||||
public boolean visible;
|
public boolean visible;
|
||||||
public boolean active = true;
|
public boolean active = true;
|
||||||
@@ -111,7 +112,7 @@ public abstract class Trap implements Bundlable {
|
|||||||
//If the trap is part of the level, it should use the true depth
|
//If the trap is part of the level, it should use the true depth
|
||||||
//If it's not part of the level (e.g. effect from reclaim trap), use scaling depth
|
//If it's not part of the level (e.g. effect from reclaim trap), use scaling depth
|
||||||
protected int scalingDepth(){
|
protected int scalingDepth(){
|
||||||
return Dungeon.level.traps.get(pos) == this ? Dungeon.depth : Dungeon.scalingDepth();
|
return (reclaimed || Dungeon.level.traps.get(pos) != this) ? Dungeon.scalingDepth() : Dungeon.depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String name(){
|
public String name(){
|
||||||
|
|||||||
+2
@@ -22,6 +22,7 @@
|
|||||||
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
@@ -95,6 +96,7 @@ public class WornDartTrap extends Trap {
|
|||||||
if (finalTarget == Dungeon.hero && !finalTarget.isAlive()){
|
if (finalTarget == Dungeon.hero && !finalTarget.isAlive()){
|
||||||
Dungeon.fail( WornDartTrap.this );
|
Dungeon.fail( WornDartTrap.this );
|
||||||
GLog.n(Messages.get(WornDartTrap.class, "ondeath"));
|
GLog.n(Messages.get(WornDartTrap.class, "ondeath"));
|
||||||
|
if (reclaimed) Badges.validateDeathFromFriendlyMagic();
|
||||||
}
|
}
|
||||||
Sample.INSTANCE.play(Assets.Sounds.HIT, 1, 1, Random.Float(0.8f, 1.25f));
|
Sample.INSTANCE.play(Assets.Sounds.HIT, 1, 1, Random.Float(0.8f, 1.25f));
|
||||||
finalTarget.sprite.bloodBurstA(finalTarget.sprite.center(), dmg);
|
finalTarget.sprite.bloodBurstA(finalTarget.sprite.center(), dmg);
|
||||||
|
|||||||
Reference in New Issue
Block a user