v0.9.2: adjusted wand imbuing text to reflect wand preservation

This commit is contained in:
Evan Debenham 2021-01-14 21:58:04 -05:00
parent 3f7dd34111
commit 9eb0b34008
2 changed files with 24 additions and 8 deletions

View File

@ -1400,7 +1400,9 @@ items.weapon.melee.magesstaff.preserved=The previous wand was preserved!
items.weapon.melee.magesstaff.conflict=The conflicting magics erase the enchantment on your staff.
items.weapon.melee.magesstaff.id_first=You'll need to identify this wand first.
items.weapon.melee.magesstaff.cursed=You can't use a cursed wand.
items.weapon.melee.magesstaff.warning=Are you sure you want to imbue your staff with this wand? The previous imbue will be lost.\n\nIf the wand being imbued is the same or higher level than the staff, the staff will inherit the level of that wand plus a single one of its own upgrades.\n\nThis imbue will result in a level %d staff.
items.weapon.melee.magesstaff.imbue_desc=Are you sure you want to imbue your staff with this wand?\n\nIf the wand being imbued is the same or higher level than the staff, the staff will inherit the level of that wand plus a single one of its own upgrades.\n\nThis imbue will result in a level %d staff.
items.weapon.melee.magesstaff.imbue_lost=The wand currently imbued in your staff will be lost.
items.weapon.melee.magesstaff.imbue_talent=The wand currently imbued in your staff has a %1$d%% chance to be returned at +0. Wand returns remaining: %2$d.
items.weapon.melee.magesstaff.yes=Yes, I'm sure.
items.weapon.melee.magesstaff.no=No, I changed my mind
items.weapon.melee.magesstaff.desc=Crafted by the Mage himself, this staff is a unique magical weapon which can be imbued with a wand.

View File

@ -360,15 +360,29 @@ public class MagesStaff extends MeleeWeapon {
if (wand == null){
applyWand((Wand)item);
} else {
final int newLevel =
item.level() >= level() ?
level() > 0 ?
item.level() + 1
: item.level()
: level();
int newLevel;
if (item.level() >= level()){
if (level() > 0) newLevel = item.level() + 1;
else newLevel = item.level();
} else {
newLevel = level();
}
String bodyText = Messages.get(MagesStaff.class, "imbue_desc", newLevel);
int preservesLeft = Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION) ? 3 : 0;
if (Dungeon.hero.buff(Talent.WandPreservationCounter.class) != null){
preservesLeft -= Dungeon.hero.buff(Talent.WandPreservationCounter.class).count();
}
if (preservesLeft > 0){
int preserveChance = Dungeon.hero.pointsInTalent(Talent.WAND_PRESERVATION) == 1 ? 67 : 100;
bodyText += "\n\n" + Messages.get(MagesStaff.class, "imbue_talent", preserveChance, preservesLeft);
} else {
bodyText += "\n\n" + Messages.get(MagesStaff.class, "imbue_lost");
}
GameScene.show(
new WndOptions("",
Messages.get(MagesStaff.class, "warning", newLevel),
bodyText,
Messages.get(MagesStaff.class, "yes"),
Messages.get(MagesStaff.class, "no")) {
@Override