v0.4.0: implemented new glyphs

This commit is contained in:
Evan Debenham
2016-06-04 21:54:37 -04:00
parent 14a8fbdd63
commit 6172b46175
23 changed files with 568 additions and 177 deletions
@@ -30,14 +30,17 @@ import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Affection;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiEntropy;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Displacement;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Entanglement;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Metabolism;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Multiplicity;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Flow;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Obfuscation;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stench;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stone;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Thorns;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
@@ -204,7 +207,11 @@ public class Armor extends EquipableItem {
}
public int DR(){
return tier * (2 + level() + (glyph == null ? 0 : 1));
int effectiveTier = tier;
if (glyph != null) effectiveTier += glyph.tierDRAdjust();
effectiveTier = Math.max(0, effectiveTier);
return effectiveTier * (2 + level());
}
@Override
@@ -252,7 +259,7 @@ public class Armor extends EquipableItem {
public String toString() {
return levelKnown ? Messages.format( TXT_TO_STRING, super.toString(), STRReq() ) : super.toString();
}
@Override
public String name() {
return glyph == null ? super.name() : glyph.name( super.name() );
@@ -332,8 +339,12 @@ public class Armor extends EquipableItem {
public int STRReq(int lvl){
lvl = Math.max(0, lvl);
int effectiveTier = tier;
if (glyph != null) effectiveTier += glyph.tierSTRAdjust();
effectiveTier = Math.max(0, effectiveTier);
//strength req decreases at +1,+3,+6,+10,etc.
return (8 + tier * 2) - (int)(Math.sqrt(8 * lvl + 1) - 1)/2;
return (8 + effectiveTier * 2) - (int)(Math.sqrt(8 * lvl + 1) - 1)/2;
}
public int typicalDR() {
@@ -391,11 +402,14 @@ public class Armor extends EquipableItem {
public static abstract class Glyph implements Bundlable {
private static final Class<?>[] glyphs = new Class<?>[]{
Repulsion.class, Affection.class, AntiEntropy.class, Multiplicity.class,
Potential.class, Metabolism.class, Stench.class, Viscosity.class,
Displacement.class, Entanglement.class };
Obfuscation.class, Swiftness.class, Stone.class, Potential.class,
Brimstone.class, Viscosity.class, Entanglement.class, Repulsion.class, Camouflage.class, Flow.class,
Affection.class, AntiMagic.class, Thorns.class };
private static final float[] chances= new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
private static final float[] chances= new float[]{
10, 10, 10, 10,
5, 5, 5, 500, 5, 5,
2, 2, 2 };
public abstract int proc( Armor armor, Char attacker, Char defender, int damage );
@@ -417,6 +431,14 @@ public class Armor extends EquipableItem {
public abstract ItemSprite.Glowing glowing();
public int tierDRAdjust(){
return 0;
}
public int tierSTRAdjust(){
return 0;
}
public boolean checkOwner( Char owner ) {
if (!owner.isAlive() && owner instanceof Hero) {
@@ -26,10 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.GameMath;
import com.watabou.utils.Random;
public class Affection extends Glyph {
@@ -39,19 +37,16 @@ public class Affection extends Glyph {
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage) {
int level = (int)GameMath.gate( 0, armor.level(), 6 );
//TODO balancing
int level = Math.max(0, armor.level());
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level / 2 + 5 ) >= 4) {
if (Random.Int( level / 2 + 10 ) >= 9) {
int duration = Random.IntRange( 3, 7 );
int duration = Random.IntRange( 2, 5 );
Buff.affect( attacker, Charm.class, Charm.durationFactor( attacker ) * duration ).object = defender.id();
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
duration *= Random.Float( 0.5f, 1 );
Buff.affect( defender, Charm.class, Charm.durationFactor( defender ) * duration ).object = attacker.id();
defender.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
}
return damage;
@@ -0,0 +1,42 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 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.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
public class AntiMagic extends Armor.Glyph {
private static ItemSprite.Glowing TEAL = new ItemSprite.Glowing( 0x88EEFF );
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
//no proc effect, see Hero.damage
return damage;
}
@Override
public ItemSprite.Glowing glowing() {
return TEAL;
}
}
@@ -0,0 +1,42 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 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.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
public class Brimstone extends Armor.Glyph {
private static ItemSprite.Glowing ORANGE = new ItemSprite.Glowing( 0xFF4400 );
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
//no proc effect, see Burning.act
return damage;
}
@Override
public ItemSprite.Glowing glowing() {
return ORANGE;
}
}
@@ -0,0 +1,97 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 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.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
public class Camouflage extends Armor.Glyph {
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x448822 );
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
//no proc effect, see HighGrass.trample
return damage;
}
@Override
public ItemSprite.Glowing glowing() {
return GREEN;
}
public static class Camo extends Invisibility {
private int pos;
private int left;
@Override
public boolean act() {
left--;
if (left == 0 || target.pos != pos) {
detach();
} else {
spend(TICK);
}
return true;
}
public void set(int time){
left = time;
pos = target.pos;
Sample.INSTANCE.play( Assets.SND_MELD );
}
@Override
public String toString() {
return Messages.get(this, "name");
}
@Override
public String desc() {
return Messages.get(this, "desc", dispTurns(left));
}
private static final String POS = "pos";
private static final String LEFT = "left";
@Override
public void storeInBundle( Bundle bundle ) {
super.storeInBundle( bundle );
bundle.put( POS, pos );
bundle.put( LEFT, left );
}
@Override
public void restoreFromBundle( Bundle bundle ) {
super.restoreFromBundle( bundle );
pos = bundle.getInt( POS );
left = bundle.getInt( LEFT );
}
}
}
@@ -35,17 +35,17 @@ import com.watabou.utils.Random;
public class Entanglement extends Glyph {
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x448822 );
private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing( 0x663300 );
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage ) {
int level = Math.max( 0, armor.level() );
if (Random.Int( 4 ) == 0) {
if (Random.Int( 3 ) == 0) {
Buff.prolong( defender, Roots.class, 5 - level / 5 );
Buff.affect( defender, Earthroot.Armor.class ).level( 5 * (level + 1) );
Buff.prolong( defender, Roots.class, 5 );
Buff.affect( defender, Earthroot.Armor.class ).level( 5 + level );
CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
Camera.main.shake( 1, 0.4f );
@@ -56,7 +56,7 @@ public class Entanglement extends Glyph {
@Override
public Glowing glowing() {
return GREEN;
return BROWN;
}
}
@@ -0,0 +1,22 @@
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
public class Flow extends Armor.Glyph {
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x0000FF );
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
//no proc effect, see hero.speed for effect.
return damage;
}
@Override
public ItemSprite.Glowing glowing() {
return BLUE;
}
}
@@ -0,0 +1,47 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 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.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
public class Obfuscation extends Armor.Glyph {
private static ItemSprite.Glowing GREY = new ItemSprite.Glowing( 0x888888 );
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
//no proc effect, see hero.stealth for effect.
return damage;
}
@Override
public int tierDRAdjust() {
return -1;
}
@Override
public ItemSprite.Glowing glowing() {
return GREY;
}
}
@@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
@@ -34,22 +33,20 @@ import com.watabou.utils.Random;
public class Potential extends Glyph {
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x66CCEE );
private static ItemSprite.Glowing WHITE = new ItemSprite.Glowing( 0xFFFFFF, 0.5f );
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage) {
int level = Math.max( 0, armor.level() );
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level + 7 ) >= 6) {
int dmg = Random.IntRange( 1, damage );
attacker.damage( dmg, LightningTrap.LIGHTNING );
dmg = Random.IntRange( 1, dmg );
defender.damage( dmg, LightningTrap.LIGHTNING );
if (Random.Int( level + 10 ) >= 9) {
defender.damage( Random.IntRange( defender.HT/20, defender.HT/10 ), LightningTrap.LIGHTNING );
checkOwner( defender );
if (defender == Dungeon.hero) {
Dungeon.hero.belongings.charge(1f);
Camera.main.shake( 2, 0.3f );
}
@@ -62,6 +59,6 @@ public class Potential extends Glyph {
@Override
public Glowing glowing() {
return BLUE;
return WHITE;
}
}
@@ -20,18 +20,14 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.watabou.utils.Random;
public class Repulsion extends Glyph {
public class Repulsion extends Armor.Glyph {
private static ItemSprite.Glowing WHITE = new ItemSprite.Glowing( 0xFFFFFF );
@@ -39,32 +35,11 @@ public class Repulsion extends Glyph {
public int proc( Armor armor, Char attacker, Char defender, int damage) {
int level = Math.max( 0, armor.level() );
if (Level.adjacent( attacker.pos, defender.pos )
&& !defender.properties().contains(Char.Property.IMMOVABLE)
&& Random.Int( level + 5) >= 4) {
for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
int ofs = Level.NEIGHBOURS8[i];
if (attacker.pos - defender.pos == ofs) {
int newPos = attacker.pos + ofs;
if ((Level.passable[newPos] || Level.avoid[newPos]) && Actor.findChar( newPos ) == null) {
Actor.addDelayed( new Pushing( attacker, attacker.pos, newPos ), -1 );
attacker.pos = newPos;
// FIXME
if (attacker instanceof Mob) {
Dungeon.level.mobPress( (Mob)attacker );
} else {
Dungeon.level.press( newPos, attacker );
}
}
break;
}
}
if (Random.Int( level + 5 ) >= 4){
int oppositeHero = attacker.pos + (attacker.pos - defender.pos);
Ballistica trajectory = new Ballistica(attacker.pos, oppositeHero, Ballistica.MAGIC_BOLT);
WandOfBlastWave.throwChar(attacker, trajectory, 2);
}
return damage;
@@ -0,0 +1,52 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 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.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
public class Stone extends Armor.Glyph {
private static ItemSprite.Glowing GREY = new ItemSprite.Glowing( 0x222222 );
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
//no proc effect
return damage;
}
@Override
public int tierDRAdjust() {
return 1;
}
@Override
public int tierSTRAdjust() {
return 1;
}
@Override
public ItemSprite.Glowing glowing() {
return GREY;
}
}
@@ -0,0 +1,52 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2016 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.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
public class Swiftness extends Armor.Glyph {
private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF00 );
@Override
public int proc(Armor armor, Char attacker, Char defender, int damage) {
//no proc effect, see hero.defenseskill and hero.speed for effect.
return damage;
}
@Override
public int tierDRAdjust() {
return -2;
}
@Override
public int tierSTRAdjust() {
return -1;
}
@Override
public ItemSprite.Glowing glowing() {
return YELLOW;
}
}
@@ -20,46 +20,33 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
import com.watabou.utils.Random;
public class Displacement extends Glyph {
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x66AAFF );
public class Thorns extends Armor.Glyph {
private static ItemSprite.Glowing RED = new ItemSprite.Glowing( 0x660022 );
@Override
public int proc( Armor armor, Char attacker, Char defender, int damage ) {
public int proc(Armor armor, Char attacker, Char defender, int damage) {
if (Dungeon.bossLevel()) {
return damage;
}
int nTries = (armor.level() < 0 ? 1 : armor.level() + 1) * 5;
for (int i=0; i < nTries; i++) {
int pos = Random.Int( Level.LENGTH );
if (Dungeon.visible[pos] && Level.passable[pos] && Actor.findChar( pos ) == null) {
ScrollOfTeleportation.appear( defender, pos );
Dungeon.level.press( pos, defender );
Dungeon.observe();
int level = Math.max(0, armor.level());
if ( Random.Int( level/2 + 5) >= 4) {
Buff.affect( attacker, Bleeding.class).set( Math.max( level/2, damage));
break;
}
}
return damage;
}
@Override
public Glowing glowing() {
return BLUE;
public ItemSprite.Glowing glowing() {
return RED;
}
}
@@ -48,7 +48,7 @@ public class Viscosity extends Glyph {
int level = Math.max( 0, armor.level() );
if (Random.Int( level + 7 ) >= 6) {
if (Random.Int( level + 4 ) >= 3) {
DeferedDamage debuff = defender.buff( DeferedDamage.class );
if (debuff == null) {
@@ -117,8 +117,9 @@ public class Viscosity extends Glyph {
@Override
public boolean act() {
if (target.isAlive()) {
target.damage( 1, this );
int damageThisTick = Math.max(1, damage/10);
target.damage( damageThisTick, this );
if (target == Dungeon.hero && !target.isAlive()) {
Dungeon.fail( getClass() );
@@ -127,8 +128,9 @@ public class Viscosity extends Glyph {
Badges.validateDeathFromGlyph();
}
spend( TICK );
if (--damage <= 0) {
damage -= damageThisTick;
if (damage <= 0) {
detach();
}
@@ -39,7 +39,7 @@ public class RingOfElements extends Ring {
}
private static final HashSet<Class<?>> EMPTY = new HashSet<Class<?>>();
private static final HashSet<Class<?>> FULL;
public static final HashSet<Class<?>> FULL;
static {
FULL = new HashSet<Class<?>>();
FULL.add( Burning.class );
@@ -173,7 +173,7 @@ public abstract class Wand extends Item {
return sb.toString();
}
@Override
public String info() {
return (cursed && cursedKnown) ?
@@ -382,7 +382,7 @@ public abstract class Wand extends Item {
}
};
protected class Charger extends Buff {
public class Charger extends Buff {
private static final float BASE_CHARGE_DELAY = 10f;
private static final float SCALING_CHARGE_ADDITION = 40f;
@@ -402,7 +402,7 @@ public abstract class Wand extends Item {
@Override
public boolean act() {
if (curCharges < maxCharges)
gainCharge();
recharge();
if (partialCharge >= 1 && curCharges < maxCharges) {
partialCharge--;
@@ -415,7 +415,7 @@ public abstract class Wand extends Item {
return true;
}
private void gainCharge(){
private void recharge(){
int missingCharges = maxCharges - curCharges;
float turnsToCharge = (float) (BASE_CHARGE_DELAY
@@ -431,6 +431,16 @@ public abstract class Wand extends Item {
}
}
public void gainCharge(float charge){
partialCharge += charge;
while (partialCharge >= 1f){
curCharges++;
partialCharge--;
}
curCharges = Math.min(curCharges, maxCharges);
updateQuickslot();
}
private void setScaleFactor(float value){
this.scalingFactor = value;
}
@@ -98,7 +98,7 @@ public class WandOfBlastWave extends Wand {
}
}
private void throwChar(final Char ch, final Ballistica trajectory, int power){
public static void throwChar(final Char ch, final Ballistica trajectory, int power){
int dist = Math.min(trajectory.dist, power);
if (ch.properties().contains(Char.Property.BOSS))
@@ -135,7 +135,7 @@ public class WandOfBlastWave extends Wand {
}
@Override
//a weaker knockback, not dissimilar to the glyph of bounce, but a fair bit stronger.
//behaves just like glyph of Repulsion
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
int level = Math.max(0, staff.level());