v0.7.0: rough implementation of remaining exotic potions

This commit is contained in:
Evan Debenham 2018-07-17 15:54:55 -04:00
parent 04fe09cdc6
commit 9d28dfac53
16 changed files with 471 additions and 6 deletions

View File

@ -0,0 +1,72 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.actors.blobs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
public class SmokeScreen extends Blob {
@Override
protected void evolve() {
super.evolve();
int cell;
Level l = Dungeon.level;
for (int i = area.left; i < area.right; i++){
for (int j = area.top; j < area.bottom; j++){
cell = i + j*l.width();
l.losBlocking[cell] = off[cell] > 0 || (Terrain.flags[l.map[cell]] & Terrain.LOS_BLOCKING) != 0;
}
}
}
@Override
public void use( BlobEmitter emitter ) {
super.use( emitter );
//TODO finalize VFX
emitter.pour( Speck.factory( Speck.SMOKE ), 0.1f );
}
@Override
public void clear(int cell) {
super.clear(cell);
//TODO
}
@Override
public void fullyClear() {
super.fullyClear();
//TODO
}
@Override
public String tileDesc() {
return Messages.get(this, "desc");
}
}

View File

@ -0,0 +1,72 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.actors.blobs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
public class StormCloud extends Blob {
@Override
protected void evolve() {
super.evolve();
int cell;
for (int i = area.left; i < area.right; i++){
for (int j = area.top; j < area.bottom; j++){
cell = i + j*Dungeon.level.width();
if (off[cell] > 0) {
int terr = Dungeon.level.map[cell];
if (terr == Terrain.EMPTY || terr == Terrain.GRASS ||
terr == Terrain.EMBERS || terr == Terrain.EMPTY_SP ||
terr == Terrain.HIGH_GRASS || terr == Terrain.EMPTY_DECO) {
Level.set(cell, Terrain.WATER);
GameScene.updateMap(cell);
} else if (terr == Terrain.SECRET_TRAP || terr == Terrain.TRAP || terr == Terrain.INACTIVE_TRAP) {
Level.set(cell, Terrain.WATER);
Dungeon.level.traps.remove(cell);
GameScene.updateMap(cell);
}
}
}
}
}
@Override
public void use( BlobEmitter emitter ) {
super.use( emitter );
//TODO finalize VFX
emitter.pour( Speck.factory( Speck.CONFUSION ), 0.4f );
}
@Override
public String tileDesc() {
return Messages.get(this, "desc");
}
}

View File

@ -23,16 +23,18 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.utils.Bundle;
public class Barkskin extends Buff { public class Barkskin extends Buff {
private int level = 0; private int level = 0;
private int interval = 1;
@Override @Override
public boolean act() { public boolean act() {
if (target.isAlive()) { if (target.isAlive()) {
spend( TICK ); spend( interval );
if (--level <= 0) { if (--level <= 0) {
detach(); detach();
} }
@ -50,9 +52,12 @@ public class Barkskin extends Buff {
return level; return level;
} }
public void level( int value ) { public void set( int value, int time ) {
if (level < value) { //decide whether to override, preferring high value + low interval
if (Math.sqrt(interval)*level < Math.sqrt(time)*value) {
level = value; level = value;
interval = time;
spend(cooldown() - time);
} }
} }
@ -67,7 +72,25 @@ public class Barkskin extends Buff {
} }
@Override @Override
//TODO
public String desc() { public String desc() {
return Messages.get(this, "desc", level); return Messages.get(this, "desc", level);
} }
private static final String LEVEL = "level";
private static final String INTERVAL = "interval";
@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( INTERVAL, interval );
bundle.put( LEVEL, level );
}
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
interval = bundle.getInt( INTERVAL );
level = bundle.getInt( LEVEL );
}
} }

View File

@ -66,6 +66,7 @@ public class Speck extends Image {
public static final int CONFUSION = 113; public static final int CONFUSION = 113;
public static final int RED_LIGHT = 114; public static final int RED_LIGHT = 114;
public static final int CALM = 115; public static final int CALM = 115;
public static final int SMOKE = 116;
private static final int SIZE = 7; private static final int SIZE = 7;
@ -113,6 +114,7 @@ public class Speck extends Image {
case STENCH: case STENCH:
case CONFUSION: case CONFUSION:
case DUST: case DUST:
case SMOKE:
frame( film.get( STEAM ) ); frame( film.get( STEAM ) );
break; break;
case CALM: case CALM:
@ -313,6 +315,13 @@ public class Speck extends Image {
angle = Random.Float( 360 ); angle = Random.Float( 360 );
lifespan = Random.Float( 1f, 3f ); lifespan = Random.Float( 1f, 3f );
break; break;
case SMOKE:
hardlight( 0x000000 );
angularSpeed = 30;
angle = Random.Float( 360 );
lifespan = Random.Float( 1f, 1.5f );
break;
case DUST: case DUST:
hardlight( 0xFFFF66 ); hardlight( 0xFFFF66 );
@ -432,6 +441,7 @@ public class Speck extends Image {
case CORROSION: case CORROSION:
hardlight( ColorMath.interpolate( 0xAAAAAA, 0xFF8800 , p )); hardlight( ColorMath.interpolate( 0xAAAAAA, 0xFF8800 , p ));
case STENCH: case STENCH:
case SMOKE:
am = (float)Math.sqrt( (p < 0.5f ? p : 1 - p) ); am = (float)Math.sqrt( (p < 0.5f ? p : 1 - p) );
scale.set( 1 + p ); scale.set( 1 + p );
break; break;

View File

@ -68,7 +68,7 @@ public class FrozenCarpaccio extends Food {
break; break;
case 1: case 1:
GLog.i( Messages.get(FrozenCarpaccio.class, "hard") ); GLog.i( Messages.get(FrozenCarpaccio.class, "hard") );
Buff.affect( hero, Barkskin.class ).level( hero.HT / 4 ); Buff.affect( hero, Barkskin.class ).set( hero.HT / 4, 1 );
break; break;
case 2: case 2:
GLog.i( Messages.get(FrozenCarpaccio.class, "refresh") ); GLog.i( Messages.get(FrozenCarpaccio.class, "refresh") );

View File

@ -42,7 +42,9 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfCorrosiveGas; import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfCorrosiveGas;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfShroudingFog;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfSnapFreeze; import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfSnapFreeze;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfStormClouds;
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
@ -127,6 +129,8 @@ public class Potion extends Item {
//exotic //exotic
mustThrowPots.add(PotionOfCorrosiveGas.class); mustThrowPots.add(PotionOfCorrosiveGas.class);
mustThrowPots.add(PotionOfSnapFreeze.class); mustThrowPots.add(PotionOfSnapFreeze.class);
mustThrowPots.add(PotionOfShroudingFog.class);
mustThrowPots.add(PotionOfStormClouds.class);
} }
private static final HashSet<Class<?extends Potion>> canThrowPots = new HashSet<>(); private static final HashSet<Class<?extends Potion>> canThrowPots = new HashSet<>();

View File

@ -26,10 +26,16 @@ import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfExperience;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfFrost;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHaste; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHaste;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfInvisibility;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLevitation;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfLiquidFlame;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
@ -63,6 +69,24 @@ public class ExoticPotion extends Potion {
regToExo.put(PotionOfLiquidFlame.class, PotionOfDragonsBreath.class); regToExo.put(PotionOfLiquidFlame.class, PotionOfDragonsBreath.class);
exoToReg.put(PotionOfDragonsBreath.class, PotionOfLiquidFlame.class); exoToReg.put(PotionOfDragonsBreath.class, PotionOfLiquidFlame.class);
regToExo.put(PotionOfInvisibility.class, PotionOfShroudingFog.class);
exoToReg.put(PotionOfShroudingFog.class, PotionOfInvisibility.class);
regToExo.put(PotionOfMindVision.class, PotionOfMagicalSight.class);
exoToReg.put(PotionOfMagicalSight.class, PotionOfMindVision.class);
regToExo.put(PotionOfLevitation.class, PotionOfStormClouds.class);
exoToReg.put(PotionOfStormClouds.class, PotionOfLevitation.class);
regToExo.put(PotionOfExperience.class, PotionOfHolyFuror.class);
exoToReg.put(PotionOfHolyFuror.class, PotionOfExperience.class);
regToExo.put(PotionOfPurity.class, PotionOfCleansing.class);
exoToReg.put(PotionOfCleansing.class, PotionOfPurity.class);
regToExo.put(PotionOfParalyticGas.class, PotionOfEarthenArmor.class);
exoToReg.put(PotionOfEarthenArmor.class, PotionOfParalyticGas.class);
} }
@Override @Override

View File

@ -0,0 +1,35 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.items.potions.exotic;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
public class PotionOfCleansing extends ExoticPotion {
@Override
public void apply( Hero hero ) {
setKnown();
//TODO detach all debuffs, and satifsy hunger
//perhaps heal a little too?
}
}

View File

@ -0,0 +1,37 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.items.potions.exotic;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
public class PotionOfEarthenArmor extends ExoticPotion {
@Override
public void apply( Hero hero ) {
setKnown();
Buff.affect(hero, Barkskin.class).set( 2 + hero.lvl/3, 50 );
}
}

View File

@ -0,0 +1,36 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.items.potions.exotic;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
public class PotionOfHolyFuror extends ExoticPotion {
@Override
public void apply( Hero hero ) {
setKnown();
Buff.prolong(hero, Bless.class, 100f);
}
}

View File

@ -0,0 +1,43 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.items.potions.exotic;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
public class PotionOfMagicalSight extends ExoticPotion {
@Override
public void apply(Hero hero) {
setKnown();
Buff.affect(hero, MagicalSight.class, 30f);
Dungeon.observe();
}
public static class MagicalSight extends FlavourBuff {
}
}

View File

@ -0,0 +1,46 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.items.potions.exotic;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.SmokeScreen;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.noosa.audio.Sample;
public class PotionOfShroudingFog extends ExoticPotion {
@Override
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
GameScene.add( Blob.seed( cell, 1000, SmokeScreen.class ) );
}
}

View File

@ -0,0 +1,45 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.items.potions.exotic;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StormCloud;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.watabou.noosa.audio.Sample;
public class PotionOfStormClouds extends ExoticPotion {
@Override
public void shatter(int cell) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
GameScene.add( Blob.seed( cell, 1000, StormCloud.class ) );
}
}

View File

@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.SmokeScreen;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.WellWater; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.WellWater;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Awareness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
@ -50,6 +51,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation; import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfMagicalSight;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment; import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition; import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
@ -578,6 +580,13 @@ public abstract class Level implements Bundlable {
pit[i] = (flags & Terrain.PIT) != 0; pit[i] = (flags & Terrain.PIT) != 0;
} }
SmokeScreen s = (SmokeScreen)blobs.get(SmokeScreen.class);
if (s != null && s.volume > 0){
for (int i=0; i < length(); i++) {
losBlocking[i] = losBlocking[i] || s.cur[i] > 0;
}
}
int lastRow = length() - width(); int lastRow = length() - width();
for (int i=0; i < width(); i++) { for (int i=0; i < width(); i++) {
passable[i] = avoid[i] = false; passable[i] = avoid[i] = false;
@ -636,6 +645,11 @@ public abstract class Level implements Bundlable {
level.avoid[cell] = (flags & Terrain.AVOID) != 0; level.avoid[cell] = (flags & Terrain.AVOID) != 0;
level.pit[cell] = (flags & Terrain.PIT) != 0; level.pit[cell] = (flags & Terrain.PIT) != 0;
level.water[cell] = terrain == Terrain.WATER; level.water[cell] = terrain == Terrain.WATER;
SmokeScreen s = (SmokeScreen)level.blobs.get(SmokeScreen.class);
if (s != null && s.volume > 0){
level.losBlocking[cell] = level.losBlocking[cell] || s.cur[cell] > 0;
}
} }
public Heap drop( Item item, int cell ) { public Heap drop( Item item, int cell ) {
@ -847,8 +861,12 @@ public abstract class Level implements Bundlable {
for (Buff b : c.buffs( MindVision.class )) { for (Buff b : c.buffs( MindVision.class )) {
sense = Math.max( ((MindVision)b).distance, sense ); sense = Math.max( ((MindVision)b).distance, sense );
} }
if (c.buff(PotionOfMagicalSight.MagicalSight.class) != null){
sense = 8;
}
} }
//TODO rounding
if ((sighted && sense > 1) || !sighted) { if ((sighted && sense > 1) || !sighted) {
int ax = Math.max( 0, cx - sense ); int ax = Math.max( 0, cx - sense );

View File

@ -89,7 +89,7 @@ public class HighGrass {
// Barkskin // Barkskin
if (hero.subClass == HeroSubClass.WARDEN) { if (hero.subClass == HeroSubClass.WARDEN) {
Buff.affect(ch, Barkskin.class).level(ch.HT / 3); Buff.affect(ch, Barkskin.class).set(ch.HT / 3, 1);
leaves += 4; leaves += 4;
} }

View File

@ -61,7 +61,7 @@ public abstract class Plant implements Bundlable {
if (ch instanceof Hero){ if (ch instanceof Hero){
((Hero) ch).interrupt(); ((Hero) ch).interrupt();
if (((Hero)ch).subClass == HeroSubClass.WARDEN) { if (((Hero)ch).subClass == HeroSubClass.WARDEN) {
Buff.affect(ch, Barkskin.class).level(ch.HT / 3); Buff.affect(ch, Barkskin.class).set(ch.HT / 3, 1);
} }
} }