v2.0.0: implemented feint abilities
This commit is contained in:
@@ -281,6 +281,7 @@ public enum Talent {
|
|||||||
public int energySpent = -1;
|
public int energySpent = -1;
|
||||||
public boolean wepAbilUsed = false;
|
public boolean wepAbilUsed = false;
|
||||||
}
|
}
|
||||||
|
public static class CounterAbilityTacker extends FlavourBuff{};
|
||||||
|
|
||||||
int icon;
|
int icon;
|
||||||
int maxPoints;
|
int maxPoints;
|
||||||
|
|||||||
+12
-11
@@ -28,6 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.BlobImmunity;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.BlobImmunity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||||
@@ -180,17 +182,16 @@ public class Feint extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
Buff.affect(enemy, FeintConfusion.class, 1);
|
Buff.affect(enemy, FeintConfusion.class, 1);
|
||||||
if (enemy.sprite != null) enemy.sprite.showLost();
|
if (enemy.sprite != null) enemy.sprite.showLost();
|
||||||
return 0;
|
if (Dungeon.hero.hasTalent(Talent.FEIGNED_RETREAT)){
|
||||||
}
|
Buff.prolong(Dungeon.hero, Haste.class, 2f*Dungeon.hero.pointsInTalent(Talent.FEIGNED_RETREAT));
|
||||||
|
|
||||||
@Override
|
|
||||||
public int defenseProc(Char enemy, int damage) {
|
|
||||||
if (enemy instanceof Mob){
|
|
||||||
((Mob) enemy).clearEnemy();
|
|
||||||
}
|
}
|
||||||
Buff.affect(enemy, FeintConfusion.class, 1f);
|
if (Dungeon.hero.hasTalent(Talent.EXPOSE_WEAKNESS)){
|
||||||
if (enemy.sprite != null) enemy.sprite.showLost();
|
Buff.prolong(enemy, Vulnerable.class, Dungeon.hero.pointsInTalent(Talent.EXPOSE_WEAKNESS));
|
||||||
return super.defenseProc(enemy, damage);
|
}
|
||||||
|
if (Dungeon.hero.hasTalent(Talent.COUNTER_ABILITY)){
|
||||||
|
Buff.prolong(Dungeon.hero, Talent.CounterAbilityTacker.class, 3f);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -228,7 +229,7 @@ public class Feint extends ArmorAbility {
|
|||||||
@Override
|
@Override
|
||||||
public void die() {
|
public void die() {
|
||||||
//don't interrupt current animation to start fading
|
//don't interrupt current animation to start fading
|
||||||
//this ensures the face attack animation plays
|
//this ensures the fake attack animation plays
|
||||||
if (parent != null) {
|
if (parent != null) {
|
||||||
parent.add( new AlphaTweener( this, 0, 3f ) {
|
parent.add( new AlphaTweener( this, 0, 3f ) {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+6
@@ -217,6 +217,9 @@ public class MeleeWeapon extends Weapon {
|
|||||||
Buff.affect(hero, MonkEnergy.class).processCombinedEnergy(tracker);
|
Buff.affect(hero, MonkEnergy.class).processCombinedEnergy(tracker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (hero.buff(Talent.CounterAbilityTacker.class) != null){
|
||||||
|
hero.buff(Talent.CounterAbilityTacker.class).detach();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAbilityKill( Hero hero ){
|
public void onAbilityKill( Hero hero ){
|
||||||
@@ -228,6 +231,9 @@ public class MeleeWeapon extends Weapon {
|
|||||||
|
|
||||||
public float abilityChargeUse( Hero hero ){
|
public float abilityChargeUse( Hero hero ){
|
||||||
float chargeUse = 1f;
|
float chargeUse = 1f;
|
||||||
|
if (hero.buff(Talent.CounterAbilityTacker.class) != null){
|
||||||
|
chargeUse = Math.max(0, chargeUse-0.5f*hero.pointsInTalent(Talent.COUNTER_ABILITY));
|
||||||
|
}
|
||||||
if (hero.hasTalent(Talent.LIGHTWEIGHT_CHARGE) && tier <= 3){
|
if (hero.hasTalent(Talent.LIGHTWEIGHT_CHARGE) && tier <= 3){
|
||||||
// T1/2/3 get 25/20/15% charge use reduction at +3
|
// T1/2/3 get 25/20/15% charge use reduction at +3
|
||||||
float chargeUseReduction = (0.30f-.05f*tier) * (hero.pointsInTalent(Talent.LIGHTWEIGHT_CHARGE)/3f);
|
float chargeUseReduction = (0.30f-.05f*tier) * (hero.pointsInTalent(Talent.LIGHTWEIGHT_CHARGE)/3f);
|
||||||
|
|||||||
Reference in New Issue
Block a user