v3.1.0: experimenting with adding an icon for sources of dodge

This commit is contained in:
Evan Debenham
2025-05-06 13:26:11 -04:00
parent 9e6c74c519
commit 5ad6f6e40d
3 changed files with 20 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 514 B

View File

@@ -590,8 +590,13 @@ public abstract class Char extends Actor {
} else {
if (enemy.sprite != null){
enemy.sprite.showStatus( CharSprite.NEUTRAL, enemy.defenseVerb() );
if (tuftDodged){
enemy.sprite.showStatusWithIcon(CharSprite.NEUTRAL, enemy.defenseVerb(), FloatingText.TUFT);
} else {
enemy.sprite.showStatus(CharSprite.NEUTRAL, enemy.defenseVerb());
}
}
tuftDodged = false;
if (visibleFight) {
//TODO enemy.defenseSound? currently miss plays for monks/crab even when they parry
Sample.INSTANCE.play(Assets.Sounds.MISS);
@@ -648,7 +653,8 @@ public abstract class Char extends Actor {
// + 3%/5%
acuRoll *= 1.01f + 0.02f*Dungeon.hero.pointsInTalent(Talent.BLESS);
}
acuRoll *= accMulti;
float defRoll = Random.Float( defStat );
if (defender.buff(Bless.class) != null) defRoll *= 1.25f;
if (defender.buff( Hex.class) != null) defRoll *= 0.8f;
@@ -663,11 +669,18 @@ public abstract class Char extends Actor {
// + 3%/5%
defRoll *= 1.01f + 0.02f*Dungeon.hero.pointsInTalent(Talent.BLESS);
}
if (defRoll < acuRoll && (defRoll*FerretTuft.evasionMultiplier()) >= acuRoll){
tuftDodged = true;
}
defRoll *= FerretTuft.evasionMultiplier();
return (acuRoll * accMulti) >= defRoll;
return acuRoll >= defRoll;
}
//TODO this is messy and hacky atm, should consider standardizing this so we can have many 'dodge reasons'
private static boolean tuftDodged = false;
public int attackSkill( Char target ) {
return 0;
}

View File

@@ -77,6 +77,9 @@ public class FloatingText extends RenderedTextBlock {
public static int GOLD = 23;
public static int ENERGY = 24;
//dodge icons
public static int TUFT = 26;
private Image icon;
private boolean iconLeft;