v0.7.0: fixes:

- teleportation working on floor 5
- glitches in tranfusion shield calculation
- incorrect boolean logic on magic immune
- dragon's breath and enchantment being lost when they shouldn't be
- typo in potion of shielding
This commit is contained in:
Evan Debenham 2018-07-25 23:04:09 -04:00
parent 0aadab116b
commit f11a2727bc
9 changed files with 20 additions and 17 deletions

View File

@ -354,7 +354,7 @@ public class Armor extends EquipableItem {
public int proc( Char attacker, Char defender, int damage ) {
if (glyph != null && defender.buff(MagicImmune.class) != null) {
if (glyph != null && defender.buff(MagicImmune.class) == null) {
damage = glyph.proc( this, attacker, defender, damage );
}
@ -504,7 +504,7 @@ public class Armor extends EquipableItem {
}
public boolean hasGlyph(Class<?extends Glyph> type, Char owner) {
return glyph != null && glyph.getClass() == type && owner.buff(MagicImmune.class) == null;
return glyph != null && glyph.getClass() == type && owner.buff(MagicImmune.class) == null;
}
//these are not used to process specific glyph effects, so magic immune doesn't affect them

View File

@ -59,7 +59,7 @@ public class PotionOfDragonsBreath extends ExoticPotion {
@Override
//need to override drink so that time isn't spent right away
protected void drink(final Hero hero) {
detach( hero.belongings.backpack );
curItem = detach( hero.belongings.backpack );
setKnown();
GameScene.selectCell(targeter);
@ -70,7 +70,8 @@ public class PotionOfDragonsBreath extends ExoticPotion {
public void onSelect(final Integer cell) {
if (cell == null){
return;
//TODO if this can ever be found un-IDed, need logic for that
curItem.collect();
} else {
Sample.INSTANCE.play( Assets.SND_DRINK );
curUser.sprite.operate(curUser.pos, new Callback() {

View File

@ -135,7 +135,7 @@ public class ScrollOfTeleportation extends Scroll {
public static void teleportPreferringUnseen( Hero hero ){
if (!(Dungeon.level instanceof RegularLevel)){
if (Dungeon.bossLevel() || !(Dungeon.level instanceof RegularLevel)){
teleportHero( hero );
return;
}

View File

@ -84,10 +84,10 @@ public abstract class ExoticScroll extends Scroll {
//TODO
regToExo.put(ScrollOfMirrorImage.class, ScrollOfDivination.class);
exoToReg.put(ScrollOfDivination.class, ScrollOfMirrorImage.class);
//exoToReg.put(ScrollOfDivination.class, ScrollOfMirrorImage.class);
regToExo.put(ScrollOfTransmutation.class, ScrollOfDivination.class);
exoToReg.put(ScrollOfDivination.class, ScrollOfTransmutation.class);
//exoToReg.put(ScrollOfDivination.class, ScrollOfTransmutation.class);
}
@Override

View File

@ -43,8 +43,6 @@ public class ScrollOfEnchantment extends ExoticScroll {
public void doRead() {
setKnown();
curItem = this;
GameScene.selectItem( itemSelector, WndBag.Mode.ENCHANTABLE, Messages.get(this, "inv_title"));
}
@ -82,7 +80,7 @@ public class ScrollOfEnchantment extends ExoticScroll {
}
});
} else {
} else if (item instanceof Armor) {
final Armor.Glyph glyphs[] = new Armor.Glyph[3];
@ -111,6 +109,9 @@ public class ScrollOfEnchantment extends ExoticScroll {
}
}
});
} else {
//TODO if this can ever be found un-IDed, need logic for that
curItem.collect();
}
}
};

View File

@ -80,15 +80,16 @@ public class WandOfTransfusion extends Wand {
if (ch.alignment == Char.Alignment.ALLY || ch.buff(Charm.class) != null){
int healing = selfDmg + 3*level();
int shielding = -(ch.HT - ch.HP - healing);
int shielding = (ch.HP + healing) - ch.HT;
if (shielding > 0){
healing -= shielding;
Buff.affect(ch, Barrier.class).set(shielding);
} else {
shielding = 0;
}
ch.HP += healing;
Buff.affect(ch, Barrier.class).set(shielding);
ch.sprite.emitter().burst(Speck.factory(Speck.HEALING), 2 + level() / 2);
ch.sprite.showStatus(CharSprite.POSITIVE, "+%dHP", healing + shielding);

View File

@ -100,7 +100,7 @@ abstract public class Weapon extends KindOfWeapon {
@Override
public int proc( Char attacker, Char defender, int damage ) {
if (enchantment != null && attacker.buff(MagicImmune.class) != null) {
if (enchantment != null && attacker.buff(MagicImmune.class) == null) {
damage = enchantment.proc( this, attacker, defender, damage );
}
@ -251,7 +251,7 @@ abstract public class Weapon extends KindOfWeapon {
}
public boolean hasEnchant(Class<?extends Enchantment> type, Char owner) {
return enchantment != null && enchantment.getClass() == type && owner.buff(MagicImmune.class) != null;
return enchantment != null && enchantment.getClass() == type && owner.buff(MagicImmune.class) == null;
}
//these are not used to process specific enchant effects, so magic immune doesn't affect them

View File

@ -78,7 +78,7 @@ public class Dart extends MissileWeapon {
@Override
public int proc(Char attacker, Char defender, int damage) {
if (bow != null && bow.enchantment != null && attacker.buff(MagicImmune.class) != null){
if (bow != null && bow.enchantment != null && attacker.buff(MagicImmune.class) == null){
damage = bow.enchantment.proc(bow, attacker, defender, damage);
}
return super.proc(attacker, defender, damage);

View File

@ -581,7 +581,7 @@ items.potions.exotic.potionofmagicalsight.name=potion of magical sight
items.potions.exotic.potionofmagicalsight.desc=After drinking this, your senses will be breifly heightened to incredible levels, allowing you to see through walls!
items.potions.exotic.potionofshielding.name=potion of shielding
items.potions.exotic.potionofshielding.desc=Rather than heal, this potion will instead project a durable shield around the users body, blocking a considerable amount of damage.
items.potions.exotic.potionofshielding.desc=Rather than heal, this potion will instead project a durable shield around the user's body, blocking a considerable amount of damage.
items.potions.exotic.potionofshroudingfog.name=potion of shrouding fog
items.potions.exotic.potionofshroudingfog.desc=When exposed to air, the liquid in this flask will produce a thick smoky fog which completely blocks vision.