v0.7.3: rebalanced corrosive brew and curse infusion

This commit is contained in:
Evan Debenham 2019-05-03 19:26:48 -04:00
parent 302bf62037
commit 39ffe663f4
12 changed files with 114 additions and 56 deletions

View File

@ -106,6 +106,7 @@ public class WaterOfTransmutation extends WellWater {
n = (Wand)Generator.random(Category.WAND);
} while (Challenges.isItemBlocked(n) || n.getClass() == wandClass);
n.level(0);
n.identify();
staff.imbueWand(n, null);
}
@ -127,6 +128,7 @@ public class WaterOfTransmutation extends WellWater {
} while (Challenges.isItemBlocked(n) || n.getClass() == w.getClass());
int level = w.level();
if (w.curseInfusionBonus) level--;
if (level > 0) {
n.upgrade( level );
} else if (level < 0) {
@ -134,6 +136,7 @@ public class WaterOfTransmutation extends WellWater {
}
n.enchantment = w.enchantment;
n.curseInfusionBonus = w.curseInfusionBonus;
n.levelKnown = w.levelKnown;
n.cursedKnown = w.cursedKnown;
n.cursed = w.cursed;
@ -187,11 +190,14 @@ public class WaterOfTransmutation extends WellWater {
} while ( Challenges.isItemBlocked(n) || n.getClass() == w.getClass());
n.level( 0 );
n.upgrade( w.level() );
int level = w.level();
if (w.curseInfusionBonus) level--;
n.upgrade( level );
n.levelKnown = w.levelKnown;
n.cursedKnown = w.cursedKnown;
n.cursed = w.cursed;
n.curseInfusionBonus = w.curseInfusionBonus;
return n;
}

View File

@ -336,7 +336,7 @@ public class Item implements Bundlable {
}
public int visiblyUpgraded() {
return levelKnown ? level : 0;
return levelKnown ? level() : 0;
}
public boolean visiblyCursed() {

View File

@ -96,7 +96,10 @@ public class Armor extends EquipableItem {
}
public Augment augment = Augment.NONE;
public Glyph glyph;
public boolean curseInfusionBonus = false;
private BrokenSeal seal;
public int tier;
@ -112,6 +115,7 @@ public class Armor extends EquipableItem {
private static final String USES_LEFT_TO_ID = "uses_left_to_id";
private static final String AVAILABLE_USES = "available_uses";
private static final String GLYPH = "glyph";
private static final String CURSE_INFUSION_BONUS = "curse_infusion_bonus";
private static final String SEAL = "seal";
private static final String AUGMENT = "augment";
@ -121,6 +125,7 @@ public class Armor extends EquipableItem {
bundle.put( USES_LEFT_TO_ID, usesLeftToID );
bundle.put( AVAILABLE_USES, availableUsesToID );
bundle.put( GLYPH, glyph );
bundle.put( CURSE_INFUSION_BONUS, curseInfusionBonus );
bundle.put( SEAL, seal);
bundle.put( AUGMENT, augment);
}
@ -131,6 +136,7 @@ public class Armor extends EquipableItem {
usesLeftToID = bundle.getInt( USES_LEFT_TO_ID );
availableUsesToID = bundle.getInt( AVAILABLE_USES );
inscribe((Glyph) bundle.get(GLYPH));
curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS );
seal = (BrokenSeal)bundle.get(SEAL);
//pre-0.7.2 saves
@ -343,6 +349,11 @@ public class Armor extends EquipableItem {
return stealth;
}
@Override
public int level() {
return super.level() + (curseInfusionBonus ? 1 : 0);
}
@Override
public Item upgrade() {
return upgrade( false );
@ -511,6 +522,7 @@ public class Armor extends EquipableItem {
}
public Armor inscribe( Glyph glyph ) {
if (glyph == null || !glyph.curse()) curseInfusionBonus = false;
this.glyph = glyph;
updateQuickslot();
return this;

View File

@ -50,7 +50,7 @@ public class CausticBrew extends Brew {
Sample.INSTANCE.play( Assets.SND_SHATTER );
}
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 2 );
PathFinder.buildDistanceMap( cell, BArray.not( Dungeon.level.solid, null ), 3 );
for (int i = 0; i < PathFinder.distance.length; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
Splash.at( i, 0x000000, 5);
@ -75,7 +75,7 @@ public class CausticBrew extends Brew {
inputs = new Class[]{PotionOfToxicGas.class, GooBlob.class};
inQuantity = new int[]{1, 1};
cost = 8;
cost = 4;
output = CausticBrew.class;
outQuantity = 1;

View File

@ -96,11 +96,15 @@ public class ScrollOfRemoveCurse extends InventoryScroll {
procced = true;
}
}
if (item instanceof Wand){
((Wand) item).updateLevel();
}
}
if (procced) {
hero.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10 );
hero.updateHT( false ); //for ring of might
updateQuickslot();
}
return procced;

View File

@ -129,6 +129,7 @@ public class ScrollOfTransmutation extends InventoryScroll {
n = (Wand) Generator.random(Generator.Category.WAND);
} while (Challenges.isItemBlocked(n) || n.getClass() == wandClass);
n.level(0);
n.identify();
staff.imbueWand(n, null);
}
@ -150,6 +151,7 @@ public class ScrollOfTransmutation extends InventoryScroll {
} while (Challenges.isItemBlocked(n) || n.getClass() == w.getClass());
int level = w.level();
if (w.curseInfusionBonus) level--;
if (level > 0) {
n.upgrade( level );
} else if (level < 0) {
@ -157,6 +159,7 @@ public class ScrollOfTransmutation extends InventoryScroll {
}
n.enchantment = w.enchantment;
n.curseInfusionBonus = w.curseInfusionBonus;
n.levelKnown = w.levelKnown;
n.cursedKnown = w.cursedKnown;
n.cursed = w.cursed;
@ -210,11 +213,14 @@ public class ScrollOfTransmutation extends InventoryScroll {
} while ( Challenges.isItemBlocked(n) || n.getClass() == w.getClass());
n.level( 0 );
n.upgrade( w.level() );
int level = w.level();
if (w.curseInfusionBonus) level--;
n.upgrade( level );
n.levelKnown = w.levelKnown;
n.cursedKnown = w.cursedKnown;
n.cursed = w.cursed;
n.curseInfusionBonus = w.curseInfusionBonus;
return n;
}

View File

@ -28,8 +28,10 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.quest.MetalShard;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
@ -51,11 +53,14 @@ public class CurseInfusion extends InventorySpell {
item.cursed = true;
if (item instanceof MeleeWeapon || item instanceof SpiritBow) {
Weapon w = (Weapon) item;
Class<? extends Weapon.Enchantment> curr = null;
if (w.enchantment != null) {
w.enchant(Weapon.Enchantment.randomCurse(w.enchantment.getClass()));
} else {
w.enchant(Weapon.Enchantment.randomCurse(curr));
w.enchant(Weapon.Enchantment.randomCurse());
}
w.curseInfusionBonus = true;
if (w instanceof MagesStaff){
((MagesStaff) w).updateWand(true);
}
} else if (item instanceof Armor){
Armor a = (Armor) item;
@ -64,7 +69,12 @@ public class CurseInfusion extends InventorySpell {
} else {
a.inscribe(Armor.Glyph.randomCurse());
}
a.curseInfusionBonus = true;
} else if (item instanceof Wand){
((Wand) item).curseInfusionBonus = true;
((Wand) item).updateLevel();
}
updateQuickslot();
}
@Override
@ -79,10 +89,10 @@ public class CurseInfusion extends InventorySpell {
inputs = new Class[]{ScrollOfRemoveCurse.class, MetalShard.class};
inQuantity = new int[]{1, 1};
cost = 1;
cost = 4;
output = CurseInfusion.class;
outQuantity = 4;
outQuantity = 3;
}
}

View File

@ -69,6 +69,8 @@ public abstract class Wand extends Item {
private boolean curChargeKnown = false;
public boolean curseInfusionBonus = false;
private static final int USES_TO_ID = 10;
private int usesLeftToID = USES_TO_ID;
private float availableUsesToID = USES_TO_ID/2f;
@ -220,6 +222,15 @@ public abstract class Wand extends Item {
}
}
@Override
public int level() {
if (!cursed && curseInfusionBonus){
curseInfusionBonus = false;
updateLevel();
}
return super.level() + (curseInfusionBonus ? 1 : 0);
}
@Override
public Item upgrade() {
@ -341,6 +352,7 @@ public abstract class Wand extends Item {
private static final String CUR_CHARGES = "curCharges";
private static final String CUR_CHARGE_KNOWN = "curChargeKnown";
private static final String PARTIALCHARGE = "partialCharge";
private static final String CURSE_INFUSION_BONUS = "curse_infusion_bonus";
@Override
public void storeInBundle( Bundle bundle ) {
@ -350,6 +362,7 @@ public abstract class Wand extends Item {
bundle.put( CUR_CHARGES, curCharges );
bundle.put( CUR_CHARGE_KNOWN, curChargeKnown );
bundle.put( PARTIALCHARGE , partialCharge );
bundle.put(CURSE_INFUSION_BONUS, curseInfusionBonus );
}
@Override
@ -366,6 +379,7 @@ public abstract class Wand extends Item {
curCharges = bundle.getInt( CUR_CHARGES );
curChargeKnown = bundle.getBoolean( CUR_CHARGE_KNOWN );
partialCharge = bundle.getFloat( PARTIALCHARGE );
curseInfusionBonus = bundle.getBoolean(CURSE_INFUSION_BONUS);
}
@Override

View File

@ -132,12 +132,16 @@ public class SpiritBow extends Weapon {
@Override
public int min(int lvl) {
return 1 + Dungeon.hero.lvl/5 + RingOfSharpshooting.levelDamageBonus(Dungeon.hero);
return 1 + Dungeon.hero.lvl/5
+ RingOfSharpshooting.levelDamageBonus(Dungeon.hero)
+ (curseInfusionBonus ? 1 : 0);
}
@Override
public int max(int lvl) {
return 6 + (int)(Dungeon.hero.lvl/2.5f) + 2*RingOfSharpshooting.levelDamageBonus(Dungeon.hero);
return 6 + (int)(Dungeon.hero.lvl/2.5f)
+ 2*RingOfSharpshooting.levelDamageBonus(Dungeon.hero)
+ (curseInfusionBonus ? 2 : 0);
}
private int targetPos;
@ -190,12 +194,8 @@ public class SpiritBow extends Weapon {
@Override
public int level() {
//need to check if hero is null for loading an upgraded bow from pre-0.7.0
return Dungeon.hero == null ? 0 : Dungeon.hero.lvl/5;
}
@Override
public int visiblyUpgraded() {
return level();
return (Dungeon.hero == null ? 0 : Dungeon.hero.lvl/5)
+ (curseInfusionBonus ? 1 : 0);
}
//for fetching upgrades from a boomerang from pre-0.7.0

View File

@ -96,6 +96,7 @@ abstract public class Weapon extends KindOfWeapon {
private float availableUsesToID = USES_TO_ID/2f;
public Enchantment enchantment;
public boolean curseInfusionBonus = false;
@Override
public int proc( Char attacker, Char defender, int damage ) {
@ -127,6 +128,7 @@ abstract public class Weapon extends KindOfWeapon {
private static final String USES_LEFT_TO_ID = "uses_left_to_id";
private static final String AVAILABLE_USES = "available_uses";
private static final String ENCHANTMENT = "enchantment";
private static final String CURSE_INFUSION_BONUS = "curse_infusion_bonus";
private static final String AUGMENT = "augment";
@Override
@ -135,6 +137,7 @@ abstract public class Weapon extends KindOfWeapon {
bundle.put( USES_LEFT_TO_ID, usesLeftToID );
bundle.put( AVAILABLE_USES, availableUsesToID );
bundle.put( ENCHANTMENT, enchantment );
bundle.put( CURSE_INFUSION_BONUS, curseInfusionBonus );
bundle.put( AUGMENT, augment );
}
@ -144,6 +147,7 @@ abstract public class Weapon extends KindOfWeapon {
usesLeftToID = bundle.getInt( USES_LEFT_TO_ID );
availableUsesToID = bundle.getInt( AVAILABLE_USES );
enchantment = (Enchantment)bundle.get( ENCHANTMENT );
curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS );
//pre-0.7.2 saves
if (bundle.contains( "unfamiliarity" )){
@ -212,6 +216,11 @@ abstract public class Weapon extends KindOfWeapon {
public abstract int STRReq(int lvl);
@Override
public int level() {
return super.level() + (curseInfusionBonus ? 1 : 0);
}
@Override
public Item upgrade() {
return upgrade(false);
@ -269,6 +278,7 @@ abstract public class Weapon extends KindOfWeapon {
}
public Weapon enchant( Enchantment ench ) {
if (ench == null || !ench.curse()) curseInfusionBonus = false;
enchantment = ench;
updateQuickslot();
return this;

View File

@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfCorrosion;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfCorruption;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfDisintegration;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -87,7 +88,7 @@ public class MagesStaff extends MeleeWeapon {
wand.identify();
wand.cursed = false;
this.wand = wand;
wand.maxCharges = Math.min(wand.maxCharges + 1, 10);
updateWand(false);
wand.curCharges = wand.maxCharges;
name = Messages.get(wand, "staff_name");
}
@ -124,6 +125,8 @@ public class MagesStaff extends MeleeWeapon {
return;
}
if (cursed || hasCurseEnchant()) wand.cursed = true;
else wand.cursed = false;
wand.execute(hero, AC_ZAP);
}
}
@ -169,31 +172,18 @@ public class MagesStaff extends MeleeWeapon {
public Item imbueWand(Wand wand, Char owner){
wand.cursed = false;
this.wand = null;
//syncs the level of the two items.
int targetLevel = Math.max(this.level(), wand.level());
int targetLevel = Math.max(this.level() - (curseInfusionBonus ? 1 : 0), wand.level());
//if the staff's level is being overridden by the wand, preserve 1 upgrade
if (wand.level() >= this.level() && this.level() > 0) targetLevel++;
int staffLevelDiff = targetLevel - this.level();
if (staffLevelDiff > 0)
this.upgrade(staffLevelDiff);
else if (staffLevelDiff < 0)
this.degrade(Math.abs(staffLevelDiff));
int wandLevelDiff = targetLevel - wand.level();
if (wandLevelDiff > 0)
wand.upgrade(wandLevelDiff);
else if (wandLevelDiff < 0)
wand.degrade(Math.abs(wandLevelDiff));
if (wand.level() >= this.level() && this.level() > (curseInfusionBonus ? 1 : 0)) targetLevel++;
level(targetLevel);
this.wand = wand;
wand.maxCharges = Math.min(wand.maxCharges + 1, 10);
updateWand(false);
wand.curCharges = wand.maxCharges;
wand.identify();
if (owner != null) wand.charge(owner);
name = Messages.get(wand, "staff_name");
@ -227,14 +217,7 @@ public class MagesStaff extends MeleeWeapon {
public Item upgrade(boolean enchant) {
super.upgrade( enchant );
if (wand != null) {
int curCharges = wand.curCharges;
wand.upgrade();
//gives the wand one additional charge
wand.maxCharges = Math.min(wand.maxCharges + 1, 10);
wand.curCharges = Math.min(wand.curCharges + 1, 10);
updateQuickslot();
}
updateWand(true);
return this;
}
@ -243,18 +226,22 @@ public class MagesStaff extends MeleeWeapon {
public Item degrade() {
super.degrade();
if (wand != null) {
int curCharges = wand.curCharges;
wand.degrade();
//gives the wand one additional charge
wand.maxCharges = Math.min(wand.maxCharges + 1, 10);
wand.curCharges = curCharges-1;
updateQuickslot();
}
updateWand(false);
return this;
}
public void updateWand(boolean levelled){
if (wand != null) {
int curCharges = wand.curCharges;
wand.level(level());
//gives the wand one additional max charge
wand.maxCharges = Math.min(wand.maxCharges + 1, 10);
wand.curCharges = Math.min(curCharges + (levelled ? 1 : 0), wand.maxCharges);
updateQuickslot();
}
}
@Override
public String status() {
if (wand == null) return super.status();
@ -309,6 +296,15 @@ public class MagesStaff extends MeleeWeapon {
return 0;
}
@Override
public Weapon enchant(Enchantment ench) {
if (curseInfusionBonus && (ench == null || !ench.curse())){
curseInfusionBonus = false;
updateWand(false);
}
return super.enchant(ench);
}
private final WndBag.Listener itemSelector = new WndBag.Listener() {
@Override
public void onSelect( final Item item ) {

View File

@ -567,7 +567,7 @@ items.potions.potionoftoxicgas.desc=Uncorking or shattering this pressurized gla
###brews
items.potions.brews.causticbrew.name=caustic brew
items.potions.brews.causticbrew.desc=This brew will spread corrosive ooze around the location it shatters in. Anything caught by the ooze will slowly melt if it can't wash it off in water.
items.potions.brews.causticbrew.desc=This brew will spread corrosive ooze in a wide area around the location it shatters in. Anything caught by the ooze will slowly melt if it can't wash it off in water.
items.potions.brews.blizzardbrew.name=blizzard brew
items.potions.brews.blizzardbrew.desc=When shattered, this brew will unleash a swirling blizzard which spreads like a gas.
@ -955,7 +955,7 @@ items.spells.beaconofreturning.desc=This intricate spell grants the user the abi
items.spells.curseinfusion.name=curse infusion
items.spells.curseinfusion.inv_title=Curse an item
items.spells.curseinfusion.desc=This spell infuses a piece of equipment with the same malignant magic present within DM-300. The item it is used on will immediately be cursed, and any enchantment or glyph it may have had will be overridden.
items.spells.curseinfusion.desc=This spell infuses a piece of equipment with the same powerful malignant magic present within DM-300. The item it is used on will immediately be cursed, and any enchantment or glyph it may have had will be overridden.\n\n In the case of weapons, armor, and wands, the item will be upgraded in addition to being cursed. Curse infusion upgrades do not stack, and the upgrade is lost of the item becomes uncursed.
items.spells.featherfall.name=feather fall
items.spells.featherfall.light=You feel light as a feather!