From 6172b46175da307a286e03eff9b9e5f122d76081 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 4 Jun 2016 21:54:37 -0400 Subject: [PATCH] v0.4.0: implemented new glyphs --- .../ShatteredPixelDungeon.java | 4 +- .../actors/buffs/Burning.java | 68 ++++++++----- .../actors/hero/Belongings.java | 33 +------ .../actors/hero/Hero.java | 43 ++++++-- .../items/armor/Armor.java | 46 ++++++--- .../items/armor/glyphs/Affection.java | 13 +-- .../items/armor/glyphs/AntiMagic.java | 42 ++++++++ .../items/armor/glyphs/Brimstone.java | 42 ++++++++ .../items/armor/glyphs/Camouflage.java | 97 +++++++++++++++++++ .../items/armor/glyphs/Entanglement.java | 10 +- .../items/armor/glyphs/Flow.java | 22 +++++ .../items/armor/glyphs/Obfuscation.java | 47 +++++++++ .../items/armor/glyphs/Potential.java | 17 ++-- .../items/armor/glyphs/Repulsion.java | 39 ++------ .../items/armor/glyphs/Stone.java | 52 ++++++++++ .../items/armor/glyphs/Swiftness.java | 52 ++++++++++ .../glyphs/{Displacement.java => Thorns.java} | 43 +++----- .../items/armor/glyphs/Viscosity.java | 12 ++- .../items/rings/RingOfElements.java | 2 +- .../items/wands/Wand.java | 18 +++- .../items/wands/WandOfBlastWave.java | 4 +- .../levels/features/HighGrass.java | 21 +++- .../messages/items/items.properties | 18 +++- 23 files changed, 568 insertions(+), 177 deletions(-) create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Flow.java create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Obfuscation.java create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Swiftness.java rename src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/{Displacement.java => Thorns.java} (51%) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index d8e72f433..40adaaece 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -145,7 +145,9 @@ public class ShatteredPixelDungeon extends Game { com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion.class, "com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Bounce" ); - + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion.class, + "com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Displacement" ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index aaa69043a..c921200a2 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -27,9 +27,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Thief; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone; import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance; @@ -44,8 +46,6 @@ import com.watabou.utils.Bundle; import com.watabou.utils.Random; public class Burning extends Buff implements Hero.Doom { - - private static final String TXT_BURNS_UP = "%s burns up!"; private static final float DURATION = 8f; @@ -76,37 +76,55 @@ public class Burning extends Buff implements Hero.Doom { //maximum damage scales from 6 to 2 depending on remaining hp. int maxDmg = 3 + Math.round( 4 * target.HP / (float)target.HT ); - target.damage( Random.Int( 1, maxDmg ), this ); + int damage = Random.Int( 1, maxDmg ); Buff.detach( target, Chill.class); if (target instanceof Hero) { Hero hero = (Hero)target; - Item item = hero.belongings.randomUnequipped(); - if (item instanceof Scroll) { - - item = item.detach( hero.belongings.backpack ); - GLog.w( Messages.get(this, "burnsup", Messages.capitalize(item.toString())) ); - - Heap.burnFX( hero.pos ); - - } else if (item instanceof MysteryMeat) { - - item = item.detach( hero.belongings.backpack ); - ChargrilledMeat steak = new ChargrilledMeat(); - if (!steak.collect( hero.belongings.backpack )) { - Dungeon.level.drop( steak, hero.pos ).sprite.drop(); + + if (hero.belongings.armor != null && hero.belongings.armor.glyph != null + && hero.belongings.armor.glyph instanceof Brimstone){ + + int heal = hero.belongings.armor.level()/2; + if (heal > 0 && hero.HP < hero.HT) { + hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1); + hero.HP = Math.min(hero.HT, hero.HP + heal); } - GLog.w( Messages.get(this, "burnsup", item.toString()) ); - - Heap.burnFX( hero.pos ); - + + } else { + + hero.damage( damage, this ); + Item item = hero.belongings.randomUnequipped(); + if (item instanceof Scroll) { + + item = item.detach( hero.belongings.backpack ); + GLog.w( Messages.get(this, "burnsup", Messages.capitalize(item.toString())) ); + + Heap.burnFX( hero.pos ); + + } else if (item instanceof MysteryMeat) { + + item = item.detach( hero.belongings.backpack ); + ChargrilledMeat steak = new ChargrilledMeat(); + if (!steak.collect( hero.belongings.backpack )) { + Dungeon.level.drop( steak, hero.pos ).sprite.drop(); + } + GLog.w( Messages.get(this, "burnsup", item.toString()) ); + + Heap.burnFX( hero.pos ); + + } + } - } else if (target instanceof Thief && ((Thief)target).item instanceof Scroll) { - - ((Thief)target).item = null; - target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 ); + } else { + target.damage( damage, this ); + } + + if (target instanceof Thief && ((Thief)target).item instanceof Scroll) { + ((Thief)target).item = null; + target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 ); } } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java index 6e734f1c4..931dc39d4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Belongings.java @@ -221,39 +221,12 @@ public class Belongings implements Iterable { } } - public int charge( boolean full) { + public int charge( float charge ) { int count = 0; - for (Item item : this) { - if (item instanceof Wand) { - Wand wand = (Wand)item; - if (wand.curCharges < wand.maxCharges) { - wand.curCharges = full ? wand.maxCharges : wand.curCharges + 1; - count++; - - wand.updateQuickslot(); - } - } - } - - return count; - } - - public int discharge() { - - int count = 0; - - for (Item item : this) { - if (item instanceof Wand) { - Wand wand = (Wand)item; - if (wand.curCharges > 0) { - wand.curCharges--; - count++; - - wand.updateQuickslot(); - } - } + for (Wand.Charger charger : owner.buffs(Wand.Charger.class)){ + charger.gainCharge(charge); } return count; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 55bd04538..0f24f8db6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -54,6 +54,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Flow; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Obfuscation; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; @@ -286,12 +291,15 @@ public class Hero extends Char { if (aEnc > 0) { return (int)(defenseSkill * evasion / Math.pow( 1.5, aEnc )); } else { - - if (heroClass == HeroClass.ROGUE) { - return (int)((defenseSkill - aEnc) * evasion); - } else { - return (int)(defenseSkill * evasion); - } + + bonus = 0; + if (heroClass == HeroClass.ROGUE) bonus += -aEnc; + + if (belongings.armor != null && belongings.armor.glyph != null + && belongings.armor.glyph instanceof Swiftness) + bonus += belongings.armor.level()*2; + + return Math.round((defenseSkill + bonus) * evasion); } } @@ -344,8 +352,19 @@ public class Hero extends Char { if (hasteLevel != 0) speed *= Math.pow(1.2, hasteLevel); + + Armor armor = belongings.armor; + + if (armor != null && armor.glyph != null){ + + if (armor.glyph instanceof Swiftness) { + speed *= (1.1f + 0.01f * belongings.armor.level()); + } else if (armor.glyph instanceof Flow && Level.water[pos]){ + speed *= (1.5f + 0.05f * belongings.armor.level()); + } + } - int aEnc = belongings.armor != null ? belongings.armor.STRReq() - STR() : 0; + int aEnc = armor != null ? armor.STRReq() - STR() : 0; if (aEnc > 0) { return (float)(speed / Math.pow( 1.2, aEnc )); @@ -938,6 +957,12 @@ public class Hero extends Char { if (tenacity != 0) //(HT - HP)/HT = heroes current % missing health. dmg = (int)Math.ceil((float)dmg * Math.pow(0.9, tenacity*((float)(HT - HP)/HT))); + //TODO improve this when I have proper damage source logic + if (belongings.armor != null && belongings.armor.glyph != null + && belongings.armor.glyph instanceof AntiMagic && RingOfElements.FULL.contains(src.getClass())){ + dmg -= Random.IntRange(0, belongings.armor.DR()/2); + } + super.damage( dmg, src ); } @@ -1210,6 +1235,10 @@ public class Hero extends Char { for (Buff buff : buffs( RingOfEvasion.Evasion.class )) { stealth += ((RingOfEvasion.Evasion)buff).effectiveLevel; } + if (belongings.armor != null && belongings.armor.glyph != null + && belongings.armor.glyph instanceof Obfuscation){ + stealth += belongings.armor.level(); + } return stealth; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index d2124f4b5..a4d67a472 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -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) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java index 540ea3bdc..23dab2d53 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Affection.java @@ -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; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java new file mode 100644 index 000000000..7f8e10451 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java @@ -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 + */ +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; + } + +} \ No newline at end of file diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java new file mode 100644 index 000000000..cf16da1f6 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Brimstone.java @@ -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 + */ +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; + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java new file mode 100644 index 000000000..6e0f706d1 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Camouflage.java @@ -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 + */ +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 ); + } + } + +} + diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java index c49b9c70a..6fd0de6de 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Entanglement.java @@ -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; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Flow.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Flow.java new file mode 100644 index 000000000..332d89fa5 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Flow.java @@ -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; + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Obfuscation.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Obfuscation.java new file mode 100644 index 000000000..f7f0d7225 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Obfuscation.java @@ -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 + */ +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; + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java index 22cd51224..3ba5bf69b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Potential.java @@ -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; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java index b72f8377c..4747880e4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Repulsion.java @@ -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; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java new file mode 100644 index 000000000..58b87a515 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Stone.java @@ -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 + */ +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; + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Swiftness.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Swiftness.java new file mode 100644 index 000000000..2bc00a376 --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Swiftness.java @@ -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 + */ +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; + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Displacement.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java similarity index 51% rename from src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Displacement.java rename to src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java index 2a65cfb52..651cb3c73 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Displacement.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Thorns.java @@ -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; } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java index 1b4fc2ce9..0d743120f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/Viscosity.java @@ -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(); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java index 909b55398..88ecc614f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java @@ -39,7 +39,7 @@ public class RingOfElements extends Ring { } private static final HashSet> EMPTY = new HashSet>(); - private static final HashSet> FULL; + public static final HashSet> FULL; static { FULL = new HashSet>(); FULL.add( Burning.class ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 398e9b0f5..d4c94aa2d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -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; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java index d1a71ce16..90c8914ac 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfBlastWave.java @@ -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()); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index 5ddc106fe..fa9dc3ef8 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; @@ -84,10 +85,22 @@ public class HighGrass { int leaves = 4; - // Barkskin - if (ch instanceof Hero && ((Hero)ch).subClass == HeroSubClass.WARDEN) { - Buff.affect( ch, Barkskin.class ).level( ch.HT / 3 ); - leaves = 8; + + if (ch instanceof Hero) { + Hero hero = (Hero)ch; + + // Barkskin + if (hero.subClass == HeroSubClass.WARDEN) { + Buff.affect(ch, Barkskin.class).level(ch.HT / 3); + leaves += 4; + } + + //Camouflage + if (hero.belongings.armor != null && hero.belongings.armor.glyph != null + && hero.belongings.armor.glyph instanceof Camouflage){ + Buff.affect(hero, Camouflage.Camo.class).set(3 + hero.belongings.armor.level()); + leaves += 4; + } } CellEmitter.get( pos ).burst( LeafParticle.LEVEL_SPECIFIC, leaves ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index e0a33ec92..ec3f6552a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -3,15 +3,23 @@ items.armor.glyphs.affection.name=%s of affection items.armor.glyphs.antientropy.name=%s of anti-entropy -items.armor.glyphs.displacement.name=%s of displacement +items.armor.glyphs.antimagic.name=%s of anti-magic + +items.armor.glyphs.brimstone.name=%s of brimstone + +items.armor.glyphs.camouflage.name=%s of camouflage items.armor.glyphs.entanglement.name=%s of entanglement +items.armor.glyphs.flow.name=%s of flow + items.armor.glyphs.metabolism.name=%s of metabolism items.armor.glyphs.multiplicity.name=%s of multiplicity items.armor.glyphs.multiplicity.rankings_desc=Killed by: glyph of multiplicity +items.armor.glyphs.obfuscation.name=%s of obfuscation + items.armor.glyphs.potential.name=%s of potential items.armor.glyphs.potential.rankings_desc=Killed by: glyph of potential @@ -19,12 +27,18 @@ items.armor.glyphs.repulsion.name=%s of repulsion items.armor.glyphs.stench.name=%s of stench +items.armor.glyphs.stone.name=%s of stone + +items.armor.glyphs.swiftness.name=%s of swiftness + +items.armor.glyphs.thorns.name=%s of thorns + items.armor.glyphs.viscosity.name=%s of viscosity items.armor.glyphs.viscosity.deferred=deferred %d items.armor.glyphs.viscosity$defereddamage.name=Deferred damage items.armor.glyphs.viscosity$defereddamage.ondeath=The deferred damage killed you... items.armor.glyphs.viscosity$defereddamage.rankings_desc=Killed by deferred damage -items.armor.glyphs.viscosity$defereddamage.desc=While your armor's glyph has protected you from damage, it seems to be slowly paying you back for it.\n\nDamage is being dealt to you over time instead of immediately. You will take one damage per turn until there is no damage left.\n\nDeferred damage remaining: %d. +items.armor.glyphs.viscosity$defereddamage.desc=While your armor's glyph has protected you from damage, it seems to be slowly paying you back for it.\n\nDamage is being dealt to you over time instead of immediately.\n\nDeferred damage remaining: %d.