diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index 0c37331ce..60d2d19b7 100644 Binary files a/core/src/main/assets/interfaces/buffs.png and b/core/src/main/assets/interfaces/buffs.png differ diff --git a/core/src/main/assets/interfaces/large_buffs.png b/core/src/main/assets/interfaces/large_buffs.png index b76a569a3..3accafd1e 100644 Binary files a/core/src/main/assets/interfaces/large_buffs.png and b/core/src/main/assets/interfaces/large_buffs.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index d87c64bde..2ce863b80 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -66,6 +66,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SnipersMark; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.TimeStasis; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.Challenge; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.ElementalStrike; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.NaturesPower; @@ -169,6 +170,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndTradeItem; import com.watabou.noosa.Game; import com.watabou.noosa.audio.Sample; import com.watabou.noosa.tweeners.Delayer; +import com.watabou.utils.BArray; import com.watabou.utils.Bundle; import com.watabou.utils.Callback; import com.watabou.utils.GameMath; @@ -736,6 +738,15 @@ public class Hero extends Char { if (wep != null){ return wep.canReach(this, enemy.pos); + } else if (buff(AscendedForm.AscendBuff.class) != null) { + boolean[] passable = BArray.not(Dungeon.level.solid, null); + for (Char ch : Actor.chars()) { + if (ch != this) passable[ch.pos] = false; + } + + PathFinder.buildDistanceMap(enemy.pos, passable, 3); + + return PathFinder.distance[pos] <= 3; } else { return false; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/cleric/AscendedForm.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/cleric/AscendedForm.java index fcb5d931f..30b4369f8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/cleric/AscendedForm.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/abilities/cleric/AscendedForm.java @@ -24,14 +24,15 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ShieldBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility; import com.shatteredpixel.shatteredpixeldungeon.effects.Flare; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; import com.watabou.noosa.audio.Sample; @@ -44,7 +45,7 @@ public class AscendedForm extends ArmorAbility { @Override protected void activate(ClassArmor armor, Hero hero, Integer target) { - Buff.prolong(hero, AscendBuff.class, AscendBuff.DURATION); + Buff.affect(hero, AscendBuff.class).reset(); hero.sprite.operate(hero.pos); Sample.INSTANCE.play(Assets.Sounds.CHARGEUP); new Flare(6, 48).color(0xFFFF00, true).show(hero.sprite, 2f); @@ -66,12 +67,28 @@ public class AscendedForm extends ArmorAbility { return new Talent[]{Talent.DIVINE_INTERVENTION, Talent.JUDGEMENT, Talent.FLASH, Talent.HEROIC_ENERGY}; } - //TODO become shielding buff - public static class AscendBuff extends FlavourBuff { + public static class AscendBuff extends ShieldBuff { + + { + type = buffType.POSITIVE; + } public static float DURATION = 10f; - public int flashUses = 0; + @Override + public int icon() { + return BuffIndicator.ASCEND; + } + + @Override + public float iconFadePercent() { + return Math.max(0, (DURATION - left) / DURATION); + } + + @Override + public String iconTextDisplay() { + return Integer.toString((int)left); + } @Override public void fx(boolean on) { @@ -79,6 +96,26 @@ public class AscendedForm extends ArmorAbility { else target.sprite.remove(CharSprite.State.GLOWING); } + public int flashUses = 0; + public int left = 10; + + public void reset(){ + setShield(30); + left = (int)DURATION; + } + + @Override + public boolean act() { + left--; + if (left <= 0){ + detach(); + //TODO also remove divine intervention shield from allies + return true; + } + + spend(TICK); + return true; + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java index 8c37eee9d..408d385b8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/ClericSpell.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon; @@ -69,6 +70,9 @@ public abstract class ClericSpell { hero.buff(Talent.SatiatedSpellsTracker.class).detach(); } tome.spendCharge(chargeUse(hero)); + if (hero.buff(AscendedForm.AscendBuff.class) != null){ + hero.buff(AscendedForm.AscendBuff.class).incShield((int)(10*chargeUse(hero))); + } } public static ArrayList getSpellList(Hero cleric, int tier){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java index fa9b71219..304d6b1aa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/MnemonicPrayer.java @@ -45,6 +45,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ToxicImbue; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WellFed; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; @@ -93,6 +94,11 @@ public class MnemonicPrayer extends TargetedClericSpell { continue; } + //no it does not boost ascended form lmao + if (b instanceof AscendedForm.AscendBuff){ + continue; + } + //should consider some buffs that may be OP here, e.g. invuln if (b instanceof FlavourBuff) Buff.affect(ch, (Class)b.getClass(), extension); else if (b instanceof AdrenalineSurge) ((AdrenalineSurge) b).delay(extension); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index 7f4e4df41..210ff7434 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.ElementalStrike; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -271,6 +272,9 @@ abstract public class Weapon extends KindOfWeapon { return reach; } } + if (owner instanceof Hero && owner.buff(AscendedForm.AscendBuff.class) != null){ + reach += 2; + } if (hasEnchant(Projecting.class, owner)){ return reach + Math.round(enchantment.procChanceMultiplier(owner)); } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index 5cd06f32c..f481f6a1a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -128,6 +128,7 @@ public class BuffIndicator extends Component { public static final int LIGHT_SHIELD= 76; public static final int HOLY_SIGHT = 77; public static final int GLYPH_RECALL= 78; + public static final int ASCEND = 79; public static final int SIZE_SMALL = 7; public static final int SIZE_LARGE = 16;