diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index 6075db952..27b5b5414 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 c5a4091fc..e1755e116 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/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 8306b484f..bd8fbf76c 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1533,6 +1533,8 @@ items.weapon.melee.greataxe.desc=Meant to be wielded over the shoulder, this tit items.weapon.melee.greatshield.name=greatshield items.weapon.melee.greatshield.typical_stats_desc=Typically this weapon blocks 0-%d damage. This blocking scales with upgrades. items.weapon.melee.greatshield.stats_desc=This weapon blocks 0-%d damage. This blocking scales with upgrades. +items.weapon.melee.greatshield.ability_name=guard +items.weapon.melee.greatshield.ability_desc=The duelist can _guard_ herself with a greatshield, completely negating the next physical or magical attack made against her within 4 turns. items.weapon.melee.greatshield.desc=More like a mobile wall than a shield, this gigantic mass of metal aids defense, but doesn't leave much room for attacking. items.weapon.melee.greatsword.name=greatsword @@ -1610,7 +1612,12 @@ items.weapon.melee.rapier.desc=A slim straight sword that offers some protection items.weapon.melee.roundshield.name=round shield items.weapon.melee.roundshield.typical_stats_desc=Typically this weapon blocks 0-%d damage. This blocking scales with upgrades. items.weapon.melee.roundshield.stats_desc=This weapon blocks 0-%d damage. This blocking scales with upgrades. +items.weapon.melee.roundshield.ability_name=guard +items.weapon.melee.roundshield.ability_desc=The duelist can _guard_ herself with a round shield, completely negating the next physical or magical attack made against her within 5 turns. items.weapon.melee.roundshield.desc=This large shield effectively blocks attacks and makes a decent weapon in a pinch. +items.weapon.melee.roundshield$guardtracker.name=guarding +items.weapon.melee.roundshield$guardtracker.guarded=guarded +items.weapon.melee.roundshield$guardtracker.desc=The duelist has readied her shield in anticipation of an incoming attack. The next physical or magical attack made against her will be completely negated.\n\nTurns remaining: %s. items.weapon.melee.runicblade.name=runic blade items.weapon.melee.runicblade.stats_desc=This weapon benefits more from upgrades. 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 4f34bff37..8ffec099f 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 @@ -115,6 +115,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Flail; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.RoundShield; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon; import com.shatteredpixel.shatteredpixeldungeon.journal.Document; import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; @@ -125,7 +126,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap; import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; -import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot; import com.shatteredpixel.shatteredpixeldungeon.plants.Swiftthistle; import com.shatteredpixel.shatteredpixeldungeon.scenes.AlchemyScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; @@ -478,6 +478,10 @@ public class Hero extends Char { } return INFINITE_EVASION; } + + if (buff(RoundShield.GuardTracker.class) != null){ + return INFINITE_EVASION; + } float evasion = defenseSkill; @@ -497,15 +501,21 @@ public class Hero extends Char { @Override public String defenseVerb() { Combo.ParryTracker parry = buff(Combo.ParryTracker.class); - if (parry == null){ - return super.defenseVerb(); - } else { + if (parry != null){ parry.parried = true; if (buff(Combo.class).getComboCount() < 9 || pointsInTalent(Talent.ENHANCED_COMBO) < 2){ parry.detach(); } return Messages.get(Monk.class, "parried"); } + + if (buff(RoundShield.GuardTracker.class) != null){ + buff(RoundShield.GuardTracker.class).detach(); + Sample.INSTANCE.play(Assets.Sounds.HIT_PARRY, 1, Random.Float(0.96f, 1.05f)); + return Messages.get(RoundShield.GuardTracker.class, "guarded"); + } + + return super.defenseVerb(); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatshield.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatshield.java index 529443062..cf3a1953c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatshield.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatshield.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -51,4 +52,9 @@ public class Greatshield extends MeleeWeapon { return Messages.get(this, "typical_stats_desc", 6); } } + + @Override + protected void duelistAbility(Hero hero, Integer target) { + RoundShield.guardAbility(hero, 4, this); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java index 45cb04f64..23b6060c9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/MeleeWeapon.java @@ -136,7 +136,7 @@ public class MeleeWeapon extends Weapon { } public int abilityChargeUse(){ - return 1; //TODO + return 1; } public int tier; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java index 74eba3623..0d5759b49 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/RoundShield.java @@ -22,9 +22,14 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; public class RoundShield extends MeleeWeapon { @@ -55,4 +60,29 @@ public class RoundShield extends MeleeWeapon { return Messages.get(this, "typical_stats_desc", 4); } } + + @Override + protected void duelistAbility(Hero hero, Integer target) { + RoundShield.guardAbility(hero, 5, this); + } + + public static void guardAbility(Hero hero, int duration, MeleeWeapon wep){ + Buff.affect(hero, GuardTracker.class, duration); + hero.sprite.operate(hero.pos); + wep.onAbilityUsed(hero); + hero.spendAndNext(Actor.TICK); + } + + public static class GuardTracker extends FlavourBuff { + + { + announced = true; + type = buffType.POSITIVE; + } + + @Override + public int icon() { + return BuffIndicator.DUEL_GUARD; + } + } } \ No newline at end of file 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 61eeae573..94024b449 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -112,6 +112,7 @@ public class BuffIndicator extends Component { public static final int NATURE_POWER= 58; public static final int AMULET = 59; public static final int DUEL_CLEAVE = 60; + public static final int DUEL_GUARD = 61; public static final int SIZE_SMALL = 7; public static final int SIZE_LARGE = 16;