From b6bc29ff63ebb22c97a835cfe3b1110f3576b923 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 1 Apr 2021 00:55:48 -0400 Subject: [PATCH] v0.9.3: improved combo buff descriptions --- .../main/assets/messages/actors/actors.properties | 6 +++--- .../shatteredpixeldungeon/actors/buffs/Combo.java | 14 +++++++++++--- .../shatteredpixeldungeon/ui/StyledButton.java | 15 ++++++++++++++- .../shatteredpixeldungeon/windows/WndCombo.java | 3 ++- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 5db4f2897..5fa619df4 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -122,11 +122,11 @@ actors.buffs.combo.name=Combo actors.buffs.combo.combo=%d hit combo! actors.buffs.combo.bad_target=You must target an enemy in attack range. actors.buffs.combo.prompt=Select a target to attack. -actors.buffs.combo.desc=The gladiator builds momentum as they land successful blows. Each attack increases the combo counter by one, but taking too long between hits will reset the combo counter to 0.\n\nBuilding combo unlocks special combo attacks that cannot miss! A different attack is unlocked at 2, 4, 6, 8, and 10 combo count. Some moves reset combo and some do not, but each move can only be used once per combo session. +actors.buffs.combo.desc=The gladiator builds momentum as they land successful blows. Each attack increases the combo counter by one, but taking too long between hits will reset the combo counter to 0.\n\nBuilding combo unlocks special combo attacks that cannot miss! A different attack is unlocked at 2, 4, 6, 8, and 10 combo count. Some moves reset combo and some do not, but each move can only be used once per combo session.\n\nCurrent combo: %1$d.\n\nTurns until Combo is lost: %2$s. actors.buffs.combo$combomove.clobber_desc=_2 Combo: Clobber_ knocks an enemy back 2 tiles, but deals no damage and cannot knock into pits. Increments combo by 1. -actors.buffs.combo$combomove.slam_desc=_4 Combo: Slam_ deals combo*20% of your armor's blocking power as bonus damage. Resets combo when used. +actors.buffs.combo$combomove.slam_desc=_4 Combo: Slam_ deals %d%% (combo*20%%) of your damage blocking power as bonus damage. Resets combo when used. actors.buffs.combo$combomove.parry_desc=_6 Combo: Parry_ blocks the next attack within 1 turn when activated, and instantly retaliates to it. Resets combo if nothing is parried. -actors.buffs.combo$combomove.crush_desc=_8 Combo: Crush_ deals combo*25% of your melee damage to the primary target, and half that damage to all other enemies in a 7x7 AOE. Resets combo when used. +actors.buffs.combo$combomove.crush_desc=_8 Combo: Crush_ deals %d%% (combo*25%%) of your melee damage to the primary target, and half that damage to all other enemies in a 7x7 AOE. Resets combo when used. actors.buffs.combo$combomove.fury_desc=_10 Combo: Fury_ hits an enemy once for each combo you have, each hit deals 60% damage and can trigger enchantments. Resets combo when used. actors.buffs.corruption.name=Corrupted diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java index 09cecf6ef..29a0037ae 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java @@ -124,7 +124,7 @@ public class Combo extends Buff implements ActionIndicator.Action { @Override public String desc() { - return Messages.get(this, "desc"); + return Messages.get(this, "desc", count, dispTurns(comboTime)); } private static final String COUNT = "count"; @@ -193,8 +193,16 @@ public class Combo extends Buff implements ActionIndicator.Action { this.tintColor = tintColor; } - public String desc(){ - return Messages.get(this, name()+"_desc"); + public String desc(int count){ + switch (this){ + default: + return Messages.get(this, name()+"_desc"); + case SLAM: + return Messages.get(this, name()+"_desc", count*20); + case CRUSH: + return Messages.get(this, name()+"_desc", count*25); + } + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java index 71c75ad2b..6b2b69eb0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StyledButton.java @@ -35,6 +35,7 @@ public class StyledButton extends Button { protected NinePatch bg; protected RenderedTextBlock text; protected Image icon; + public boolean leftJustify = false; public boolean multiline; @@ -84,7 +85,19 @@ public class StyledButton extends Button { icon.y = y + (height() - icon.height()) / 2f; PixelScene.align(icon); } - + + if (leftJustify){ + if (icon != null){ + icon.x = x + bg.marginLeft() + 1; + PixelScene.align(icon); + text.setPos( icon.x + icon.width() + 1, text.top()); + PixelScene.align(text); + } else if (text != null) { + text.setPos( x + bg.marginLeft() + 1, text.top()); + PixelScene.align(text); + } + } + } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java index ff45208e7..74837dedd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndCombo.java @@ -64,7 +64,7 @@ public class WndCombo extends Window { for (Combo.ComboMove move : Combo.ComboMove.values()) { Image ic = new Image(icon); - RedButton moveBtn = new RedButton(move.desc(), 6){ + RedButton moveBtn = new RedButton(move.desc(combo.getComboCount()), 6){ @Override protected void onClick() { super.onClick(); @@ -74,6 +74,7 @@ public class WndCombo extends Window { }; ic.tint(move.tintColor); moveBtn.icon(ic); + moveBtn.leftJustify = true; moveBtn.multiline = true; moveBtn.setSize(width, moveBtn.reqHeight()); moveBtn.setRect(0, pos, width, moveBtn.reqHeight());