v2.0.0: added an ability for shield weapons

This commit is contained in:
Evan Debenham
2022-11-29 22:58:26 -05:00
parent d47dae9723
commit 3b68e92837
8 changed files with 59 additions and 5 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

@@ -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.
@@ -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
@@ -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);
}
}
@@ -136,7 +136,7 @@ public class MeleeWeapon extends Weapon {
}
public int abilityChargeUse(){
return 1; //TODO
return 1;
}
public int tier;
@@ -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;
}
}
}
@@ -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;