v0.7.0: implemented scroll of foresight

This commit is contained in:
Evan Debenham 2018-07-24 18:19:43 -04:00
parent baed120f4d
commit 8f756375e7
6 changed files with 118 additions and 7 deletions

View File

@ -0,0 +1,48 @@
/*
* 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.buffs;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
public class Foresight extends FlavourBuff {
{
type = buffType.POSITIVE;
announced = true;
}
@Override
public int icon() {
return BuffIndicator.FORESIGHT;
}
@Override
public String toString() {
return Messages.get(this, "name");
}
@Override
public String desc() {
return Messages.get(this, "desc", dispTurns());
}
}

View File

@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Combo; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Combo;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Foresight;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Fury; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Fury;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
@ -1520,8 +1521,10 @@ public class Hero extends Char {
by = Dungeon.level.height() - 1; by = Dungeon.level.height() - 1;
} }
TalismanOfForesight.Foresight foresight = buff( TalismanOfForesight.Foresight.class ); TalismanOfForesight.Foresight talisman = buff( TalismanOfForesight.Foresight.class );
boolean cursed = foresight != null && foresight.isCursed(); boolean cursed = talisman != null && talisman.isCursed();
boolean foresight = buff(Foresight.class) != null;
for (int y = ay; y <= by; y++) { for (int y = ay; y <= by; y++) {
for (int x = ax, p = ax + y * Dungeon.level.width(); x <= bx; x++, p++) { for (int x = ax, p = ax + y * Dungeon.level.width(); x <= bx; x++, p++) {
@ -1543,6 +1546,10 @@ public class Hero extends Char {
} else if (cursed) { } else if (cursed) {
chance = 0f; chance = 0f;
//..and always succeed when affected by foresight buff
} else if (foresight){
chance = 1f;
//unintentional trap detection scales from 40% at floor 0 to 30% at floor 25 //unintentional trap detection scales from 40% at floor 0 to 30% at floor 25
} else if (Dungeon.level.map[p] == Terrain.SECRET_TRAP) { } else if (Dungeon.level.map[p] == Terrain.SECRET_TRAP) {
chance = 0.4f - (Dungeon.depth / 250f); chance = 0.4f - (Dungeon.depth / 250f);
@ -1564,8 +1571,8 @@ public class Hero extends Char {
smthFound = true; smthFound = true;
if (foresight != null && !foresight.isCursed()) if (talisman != null && !talisman.isCursed())
foresight.charge(); talisman.charge();
} }
} }
} }

View File

@ -75,14 +75,14 @@ public abstract class ExoticScroll extends Scroll {
regToExo.put(ScrollOfRecharging.class, ScrollOfMysticalEnergy.class); regToExo.put(ScrollOfRecharging.class, ScrollOfMysticalEnergy.class);
exoToReg.put(ScrollOfMysticalEnergy.class, ScrollOfRecharging.class); exoToReg.put(ScrollOfMysticalEnergy.class, ScrollOfRecharging.class);
regToExo.put(ScrollOfMagicMapping.class, ScrollOfForesight.class);
exoToReg.put(ScrollOfForesight.class, ScrollOfMagicMapping.class);
//TODO //TODO
regToExo.put(ScrollOfTeleportation.class, ScrollOfPetrification.class); regToExo.put(ScrollOfTeleportation.class, ScrollOfPetrification.class);
exoToReg.put(ScrollOfPetrification.class, ScrollOfTeleportation.class); exoToReg.put(ScrollOfPetrification.class, ScrollOfTeleportation.class);
regToExo.put(ScrollOfMagicMapping.class, ScrollOfPetrification.class);
exoToReg.put(ScrollOfPetrification.class, ScrollOfMagicMapping.class);
regToExo.put(ScrollOfRetribution.class, ScrollOfPsionicBlast.class); regToExo.put(ScrollOfRetribution.class, ScrollOfPsionicBlast.class);
exoToReg.put(ScrollOfPsionicBlast.class, ScrollOfRetribution.class); exoToReg.put(ScrollOfPsionicBlast.class, ScrollOfRetribution.class);

View File

@ -0,0 +1,50 @@
/*
* 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.scrolls.exotic;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Foresight;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
import com.watabou.noosa.audio.Sample;
public class ScrollOfForesight extends ExoticScroll {
{
initials = 2;
}
@Override
public void doRead() {
SpellSprite.show( curUser, SpellSprite.MAP );
Sample.INSTANCE.play( Assets.SND_READ );
Invisibility.dispel();
Buff.affect(curUser, Foresight.class, 500f);
setKnown();
readAnimation();
}
}

View File

@ -127,6 +127,9 @@ actors.buffs.earthimbue.desc=You are imbued with the power of earth!\n\nAll phys
actors.buffs.fireimbue.name=Imbued with Fire actors.buffs.fireimbue.name=Imbued with Fire
actors.buffs.fireimbue.desc=You are imbued with the power of fire!\n\nAll physical attacks will have a chance to light enemies ablaze. Additionally, you are completely immune to the effects of fire.\n\nTurns of fire imbue remaining: %s. actors.buffs.fireimbue.desc=You are imbued with the power of fire!\n\nAll physical attacks will have a chance to light enemies ablaze. Additionally, you are completely immune to the effects of fire.\n\nTurns of fire imbue remaining: %s.
actors.buffs.foresight.name=Foresight
actors.buffs.foresight.desc=Your senses are heightened, allowing you to immediately notice anything out of place.\n\nWhile under the effect of foresight, anything that enters your search radius is immediately discovered.\n\nTurns of foresight remaining: %s.
actors.buffs.frost.name=Frozen actors.buffs.frost.name=Frozen
actors.buffs.frost.freezes=%s freezes! actors.buffs.frost.freezes=%s freezes!
actors.buffs.frost.desc=Not to be confused with freezing solid, this more benign freezing simply encases the target in ice.\n\nFreezing acts similarly to paralysis, making it impossible for the target to act. Unlike paralysis, freezing is immediately cancelled if the target takes damage, as the ice will shatter.\n\nTurns of freeze remaining: %s. actors.buffs.frost.desc=Not to be confused with freezing solid, this more benign freezing simply encases the target in ice.\n\nFreezing acts similarly to paralysis, making it impossible for the target to act. Unlike paralysis, freezing is immediately cancelled if the target takes damage, as the ice will shatter.\n\nTurns of freeze remaining: %s.

View File

@ -805,6 +805,9 @@ items.scrolls.exotic.scrollofenchantment.name=scroll of enchantment
items.scrolls.exotic.scrollofenchantment.inv_title=enchant an item items.scrolls.exotic.scrollofenchantment.inv_title=enchant an item
items.scrolls.exotic.scrollofenchantment.desc= items.scrolls.exotic.scrollofenchantment.desc=
items.scrolls.exotic.scrollofforesight.name=scroll of foresight
items.scrolls.exotic.scrollofforesight.desc=When this scroll is read, detail of nearby terrain will be constantly fed to the reader's mind in crystal clarity. For the duration of this effect, searching will not be necessary, as the reader will automatically detect everything within their search radius.
items.scrolls.exotic.scrollofmysticalenergy.name=scroll of mystical energy items.scrolls.exotic.scrollofmysticalenergy.name=scroll of mystical energy
items.scrolls.exotic.scrollofmysticalenergy.desc= items.scrolls.exotic.scrollofmysticalenergy.desc=