v0.6.2: buffed potion of purity, potion of frost, and potion of liquid flame

This commit is contained in:
Evan Debenham 2017-10-12 18:50:58 -04:00
parent 65a2cd05a1
commit 038d500c98
12 changed files with 78 additions and 97 deletions

View File

@ -80,7 +80,6 @@ public class ShatteredPixelDungeon extends Game {
"com.shatteredpixel.shatteredpixeldungeon.items.food.OverpricedRation" );
//v0.6.2
//rooms
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret.RatKingRoom.class,
"com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.RatKingRoom" );
@ -91,7 +90,6 @@ public class ShatteredPixelDungeon extends Game {
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.GardenRoom.class,
"com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.FoliageRoom" );
//traps
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.levels.traps.WornDartTrap.class,
"com.shatteredpixel.shatteredpixeldungeon.levels.traps.WornTrap" );
@ -111,6 +109,10 @@ public class ShatteredPixelDungeon extends Game {
com.shatteredpixel.shatteredpixeldungeon.levels.traps.BurningTrap.class,
"com.shatteredpixel.shatteredpixeldungeon.levels.traps.FireTrap" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.actors.buffs.BlobImmunity.class,
"com.shatteredpixel.shatteredpixeldungeon.actors.buffs.GasesImmunity" );
com.watabou.utils.Bundle.exceptionReporter =
new com.watabou.utils.Bundle.BundleExceptionCallback() {
@Override

View File

@ -63,7 +63,7 @@ public class Electricity extends Blob {
cell = i + j*Dungeon.level.width();
if (cur[cell] > 0) {
Char ch = Actor.findChar( cell );
if (ch != null) {
if (ch != null && !ch.immunities().contains(this.getClass())) {
Buff.prolong( ch, Paralysis.class, 1f);
if (cur[cell] % 2 == 1) {
ch.damage(Math.round(Random.Float(2 + Dungeon.depth / 5f)), this);

View File

@ -98,7 +98,7 @@ public class Fire extends Blob {
private void burn( int pos ) {
Char ch = Actor.findChar( pos );
if (ch != null) {
if (ch != null && !ch.immunities().contains(this.getClass())) {
Buff.affect( ch, Burning.class ).reignite( ch );
}

View File

@ -56,7 +56,7 @@ public class Freezing extends Blob {
}
Char ch = Actor.findChar( cell );
if (ch != null) {
if (ch != null && !ch.immunities().contains(this.getClass())) {
if (ch.buff(Frost.class) != null){
Buff.affect(ch, Frost.class, 2f);
} else {

View File

@ -59,7 +59,9 @@ public class Regrowth extends Blob {
}
Char ch = Actor.findChar( cell );
if (ch != null && off[cell] > 1) {
if (ch != null
&& !ch.immunities().contains(this.getClass())
&& off[cell] > 1) {
Buff.prolong( ch, Roots.class, TICK );
}
}

View File

@ -47,7 +47,7 @@ public class Web extends Blob {
volume += off[cell];
Char ch = Actor.findChar( cell );
if (ch != null) {
if (ch != null && !ch.immunities().contains(this.getClass())) {
Buff.prolong( ch, Roots.class, TICK );
}
}

View File

@ -22,15 +22,20 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Regrowth;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Web;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
public class GasesImmunity extends FlavourBuff {
public class BlobImmunity extends FlavourBuff {
public static final float DURATION = 20f;
@ -55,6 +60,11 @@ public class GasesImmunity extends FlavourBuff {
immunities.add( ConfusionGas.class );
immunities.add( StenchGas.class );
immunities.add( VenomGas.class );
immunities.add( Fire.class );
immunities.add( Freezing.class );
immunities.add( Electricity.class );
immunities.add( Regrowth.class );
immunities.add( Web.class );
}
@Override

View File

@ -23,16 +23,14 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PathFinder;
public class PotionOfFrost extends Potion {
private static final int DISTANCE = 2;
{
initials = 1;
}
@ -40,23 +38,21 @@ public class PotionOfFrost extends Potion {
@Override
public void shatter( int cell ) {
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.losBlocking, null ), DISTANCE );
if (Dungeon.level.heroFOV[cell]) {
setKnown();
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
boolean visible = false;
for (int i=0; i < Dungeon.level.length(); i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
visible = Freezing.affect( i, fire ) || visible;
}
}
if (visible) {
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
setKnown();
}
for (int offset : PathFinder.NEIGHBOURS9){
if (!Dungeon.level.solid[cell+offset]) {
GameScene.add(Blob.seed(cell + offset, 10, Freezing.class));
}
}
}
@Override

View File

@ -23,11 +23,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
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.scenes.GameScene;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PathFinder;
@ -49,16 +46,10 @@ public class PotionOfLiquidFlame extends Potion {
}
for (int offset : PathFinder.NEIGHBOURS9){
if (Dungeon.level.flamable[cell+offset]
|| Actor.findChar(cell+offset) != null
|| Dungeon.level.heaps.get(cell+offset) != null) {
if (!Dungeon.level.solid[cell+offset]) {
GameScene.add(Blob.seed(cell + offset, 2, Fire.class));
} else {
CellEmitter.get(cell+offset).burst(FlameParticle.FACTORY, 2);
}
}
}

View File

@ -24,13 +24,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.BlobImmunity;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.GasesImmunity;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
@ -40,86 +35,71 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PathFinder;
import java.util.ArrayList;
public class PotionOfPurity extends Potion {
private static final int DISTANCE = 5;
private static final int DISTANCE = 3;
private static ArrayList<Class> affectedBlobs;
{
initials = 9;
affectedBlobs = new ArrayList<>(new BlobImmunity().immunities());
}
@Override
public void shatter( int cell ) {
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.losBlocking, null ), DISTANCE );
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), DISTANCE );
boolean procd = false;
Blob[] blobs = {
Dungeon.level.blobs.get( ToxicGas.class ),
Dungeon.level.blobs.get( ParalyticGas.class ),
Dungeon.level.blobs.get( ConfusionGas.class ),
Dungeon.level.blobs.get( StenchGas.class ),
Dungeon.level.blobs.get( VenomGas.class )
};
for (int j=0; j < blobs.length; j++) {
Blob blob = blobs[j];
if (blob == null || blob.volume == 0) {
continue;
ArrayList<Blob> blobs = new ArrayList<>();
for (Class c : affectedBlobs){
Blob b = Dungeon.level.blobs.get(c);
if (b != null && b.volume > 0){
blobs.add(b);
}
}
for (int i=0; i < Dungeon.level.length(); i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
for (Blob blob : blobs) {
int value = blob.cur[i];
if (value > 0) {
blob.clear(i);
blob.cur[i] = 0;
blob.volume -= value;
procd = true;
}
}
if (Dungeon.level.heroFOV[i]) {
CellEmitter.get( i ).burst( Speck.factory( Speck.DISCOVER ), 1 );
}
CellEmitter.get( i ).burst( Speck.factory( Speck.DISCOVER ), 2 );
}
}
}
}
boolean heroAffected = PathFinder.distance[Dungeon.hero.pos] < Integer.MAX_VALUE;
if (procd) {
if (Dungeon.level.heroFOV[cell]) {
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
splash(cell);
Sample.INSTANCE.play(Assets.SND_SHATTER);
setKnown();
if (heroAffected) {
GLog.p( Messages.get(this, "freshness") );
GLog.i(Messages.get(this, "freshness"));
}
} else {
super.shatter( cell );
if (heroAffected) {
GLog.i( Messages.get(this, "freshness") );
setKnown();
}
}
}
@Override
public void apply( Hero hero ) {
GLog.w( Messages.get(this, "no_smell") );
Buff.prolong( hero, GasesImmunity.class, GasesImmunity.DURATION );
GLog.w( Messages.get(this, "protected") );
Buff.prolong( hero, BlobImmunity.class, BlobImmunity.DURATION );
setKnown();
}

View File

@ -121,8 +121,8 @@ actors.buffs.fury.name=Furious
actors.buffs.fury.heromsg=You become furious!
actors.buffs.fury.desc=You are angry, enemies won't like you when you're angry.\n\nA great rage burns within you, increasing the damage you deal with physical attacks by 50%%.\n\nThis rage will last as long as you are injured below 50%% health.
actors.buffs.gasesimmunity.name=Immune to gases
actors.buffs.gasesimmunity.desc=Some strange force is filtering out the air around you, it's not causing you any harm, but it blocks out everything but air so effectively you can't even smell anything!\n\nYou are immune to the effects of all gasses while this buff lasts.\n\nTurns of gas immunity remaining: %s.
actors.buffs.blobimmunity.name=Purification Barrier
actors.buffs.blobimmunity.desc=Some strange force is encasing you in a thin protective barrier, blocking out all harmful airborne effects.\n\nYou are immune to all area-bound effects while this barrier lasts.\n\nTurns of immunity remaining: %s.
actors.buffs.healing.value=%+dHP

View File

@ -438,7 +438,7 @@ items.potions.potionofexperience.name=potion of experience
items.potions.potionofexperience.desc=The storied experiences of multitudes of battles reduced to liquid form, this draught will instantly raise your experience level.
items.potions.potionoffrost.name=potion of frost
items.potions.potionoffrost.desc=Upon exposure to open air this chemical will evaporate into a freezing cloud, causing any creature that contacts it to be frozen in place unable to act and move. The freezing effect is much stronger if the environment is wet.
items.potions.potionoffrost.desc=The chemical contained in this potion will evaporate into a freezing cloud upon exposure to open air.
items.potions.potionofhealing.name=potion of healing
items.potions.potionofhealing.heal=Your wounds begin to close.
@ -470,8 +470,8 @@ items.potions.potionofparalyticgas.desc=Upon exposure to open air, the liquid in
items.potions.potionofpurity.name=potion of purification
items.potions.potionofpurity.freshness=You feel uncommon freshness in the air.
items.potions.potionofpurity.no_smell=You've stopped sensing any smells!
items.potions.potionofpurity.desc=This reagent will quickly neutralize all harmful gases in the area of effect. Drinking it will give you a temporary immunity to such gases.
items.potions.potionofpurity.protected=A protective film envelops you!
items.potions.potionofpurity.desc=This magical reagent will quickly neutralize all harmful effects in a large area. Drinking it will give you temporary immunity to such effects.
items.potions.potionofstrength.name=potion of strength
items.potions.potionofstrength.msg_1=+1 str