v3.0.0: substantially improved code for non-proc glyph fx
This commit is contained in:
@@ -96,8 +96,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.PrismaticImage;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Bulk;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Flow;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Obfuscation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||||
@@ -681,6 +687,12 @@ public abstract class Char extends Actor {
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns the level a glyph is at for a char, or -1 if they are not benefitting from that glyph
|
||||||
|
//This function is needed as (unlike enchantments) many glyphs trigger in a variety of cases
|
||||||
|
public int glyphLevel(Class<? extends Armor.Glyph> cls){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
public float speed() {
|
public float speed() {
|
||||||
float speed = baseSpeed;
|
float speed = baseSpeed;
|
||||||
if ( buff( Cripple.class ) != null ) speed /= 2f;
|
if ( buff( Cripple.class ) != null ) speed /= 2f;
|
||||||
@@ -688,6 +700,11 @@ public abstract class Char extends Actor {
|
|||||||
if ( buff( Adrenaline.class ) != null) speed *= 2f;
|
if ( buff( Adrenaline.class ) != null) speed *= 2f;
|
||||||
if ( buff( Haste.class ) != null) speed *= 3f;
|
if ( buff( Haste.class ) != null) speed *= 3f;
|
||||||
if ( buff( Dread.class ) != null) speed *= 2f;
|
if ( buff( Dread.class ) != null) speed *= 2f;
|
||||||
|
|
||||||
|
speed *= Swiftness.speedBoost(this, glyphLevel(Swiftness.class));
|
||||||
|
speed *= Flow.speedBoost(this, glyphLevel(Flow.class));
|
||||||
|
speed *= Bulk.speedBoost(this, glyphLevel(Bulk.class));
|
||||||
|
|
||||||
return speed;
|
return speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,8 +823,11 @@ public abstract class Char extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO improve this when I have proper damage source logic
|
//TODO improve this when I have proper damage source logic
|
||||||
if (AntiMagic.RESISTS.contains(src.getClass()) && buff(ArcaneArmor.class) != null){
|
if (AntiMagic.RESISTS.contains(src.getClass())){
|
||||||
dmg -= Random.NormalIntRange(0, buff(ArcaneArmor.class).level());
|
dmg -= AntiMagic.drRoll(this, glyphLevel(AntiMagic.class));
|
||||||
|
if (buff(ArcaneArmor.class) != null) {
|
||||||
|
dmg -= Random.NormalIntRange(0, buff(ArcaneArmor.class).level());
|
||||||
|
}
|
||||||
if (dmg < 0) dmg = 0;
|
if (dmg < 0) dmg = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1112,7 +1132,11 @@ public abstract class Char extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float stealth() {
|
public float stealth() {
|
||||||
return 0;
|
float stealth = 0;
|
||||||
|
|
||||||
|
stealth += Obfuscation.stealthBoost(this, glyphLevel(Obfuscation.class));
|
||||||
|
|
||||||
|
return stealth;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void move( int step ) {
|
public final void move( int step ) {
|
||||||
@@ -1203,6 +1227,9 @@ public abstract class Char extends Actor {
|
|||||||
for (Buff b : buffs()){
|
for (Buff b : buffs()){
|
||||||
immunes.addAll(b.immunities());
|
immunes.addAll(b.immunities());
|
||||||
}
|
}
|
||||||
|
if (glyphLevel(Brimstone.class) >= 0){
|
||||||
|
immunes.add(Burning.class);
|
||||||
|
}
|
||||||
|
|
||||||
for (Class c : immunes){
|
for (Class c : immunes){
|
||||||
if (c.isAssignableFrom(effect)){
|
if (c.isAssignableFrom(effect)){
|
||||||
|
|||||||
+1
-5
@@ -180,11 +180,7 @@ public class Burning extends Buff implements Hero.Doom {
|
|||||||
|
|
||||||
public void reignite( Char ch, float duration ) {
|
public void reignite( Char ch, float duration ) {
|
||||||
if (ch.isImmune(Burning.class)){
|
if (ch.isImmune(Burning.class)){
|
||||||
//TODO this only works for the hero, not others who can have brimstone+arcana effect
|
if (ch.glyphLevel(Brimstone.class) >= 0){
|
||||||
// e.g. prismatic image, shadow clone
|
|
||||||
if (ch instanceof Hero
|
|
||||||
&& ((Hero) ch).belongings.armor() != null
|
|
||||||
&& ((Hero) ch).belongings.armor().hasGlyph(Brimstone.class, ch)){
|
|
||||||
//generate avg of 1 shield per turn per 50% boost, to a max of 4x boost
|
//generate avg of 1 shield per turn per 50% boost, to a max of 4x boost
|
||||||
float shieldChance = 2*(Armor.Glyph.genericProcChanceMultiplier(ch) - 1f);
|
float shieldChance = 2*(Armor.Glyph.genericProcChanceMultiplier(ch) - 1f);
|
||||||
int shieldCap = Math.round(shieldChance*4f);
|
int shieldCap = Math.round(shieldChance*4f);
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bless;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Combo;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Combo;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Drowsy;
|
||||||
@@ -94,8 +93,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.AlchemistsToolkit;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.AlchemistsToolkit;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
|
||||||
@@ -1516,6 +1513,15 @@ public class Hero extends Char {
|
|||||||
return super.defenseProc( enemy, damage );
|
return super.defenseProc( enemy, damage );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int glyphLevel(Class<? extends Armor.Glyph> cls) {
|
||||||
|
if (belongings.armor() != null && belongings.armor().hasGlyph(cls, this)){
|
||||||
|
return Math.max(super.glyphLevel(cls), belongings.armor.buffedLvl());
|
||||||
|
} else {
|
||||||
|
return super.glyphLevel(cls); //TODO going to have recursion?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void damage( int dmg, Object src ) {
|
public void damage( int dmg, Object src ) {
|
||||||
if (buff(TimekeepersHourglass.timeStasis.class) != null
|
if (buff(TimekeepersHourglass.timeStasis.class) != null
|
||||||
@@ -1557,13 +1563,6 @@ public class Hero extends Char {
|
|||||||
|
|
||||||
dmg = (int)Math.ceil(dmg * RingOfTenacity.damageMultiplier( this ));
|
dmg = (int)Math.ceil(dmg * RingOfTenacity.damageMultiplier( this ));
|
||||||
|
|
||||||
//TODO improve this when I have proper damage source logic
|
|
||||||
if (belongings.armor() != null && belongings.armor().hasGlyph(AntiMagic.class, this)
|
|
||||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
|
||||||
dmg -= AntiMagic.drRoll(this, belongings.armor().buffedLvl());
|
|
||||||
dmg = Math.max(dmg, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buff(Talent.WarriorFoodImmunity.class) != null){
|
if (buff(Talent.WarriorFoodImmunity.class) != null){
|
||||||
if (pointsInTalent(Talent.IRON_STOMACH) == 1) dmg = Math.round(dmg*0.25f);
|
if (pointsInTalent(Talent.IRON_STOMACH) == 1) dmg = Math.round(dmg*0.25f);
|
||||||
else if (pointsInTalent(Talent.IRON_STOMACH) == 2) dmg = Math.round(dmg*0.00f);
|
else if (pointsInTalent(Talent.IRON_STOMACH) == 2) dmg = Math.round(dmg*0.00f);
|
||||||
@@ -2049,17 +2048,6 @@ public class Hero extends Char {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public float stealth() {
|
|
||||||
float stealth = super.stealth();
|
|
||||||
|
|
||||||
if (belongings.armor() != null){
|
|
||||||
stealth = belongings.armor().stealthFactor(this, stealth);
|
|
||||||
}
|
|
||||||
|
|
||||||
return stealth;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void die( Object cause ) {
|
public void die( Object cause ) {
|
||||||
|
|
||||||
@@ -2340,16 +2328,6 @@ public class Hero extends Char {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isImmune(Class effect) {
|
|
||||||
if (effect == Burning.class
|
|
||||||
&& belongings.armor() != null
|
|
||||||
&& belongings.armor().hasGlyph(Brimstone.class, this)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.isImmune(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean search( boolean intentional ) {
|
public boolean search( boolean intentional ) {
|
||||||
|
|
||||||
if (!isAlive()) return false;
|
if (!isAlive()) return false;
|
||||||
|
|||||||
+6
-25
@@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||||
@@ -35,9 +34,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbili
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpiritHawk;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpiritHawk;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.DirectableAlly;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.DirectableAlly;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
@@ -239,14 +237,12 @@ public class ShadowClone extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isImmune(Class effect) {
|
public int glyphLevel(Class<? extends Armor.Glyph> cls) {
|
||||||
if (effect == Burning.class
|
if (Random.Int(4) < Dungeon.hero.pointsInTalent(Talent.CLONED_ARMOR)){
|
||||||
&& Random.Int(4) < Dungeon.hero.pointsInTalent(Talent.CLONED_ARMOR)
|
return Math.max(super.glyphLevel(cls), Dungeon.hero.glyphLevel(cls));
|
||||||
&& Dungeon.hero.belongings.armor() != null
|
} else {
|
||||||
&& Dungeon.hero.belongings.armor().hasGlyph(Brimstone.class, this)){
|
return super.glyphLevel(cls);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return super.isImmune(effect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -260,21 +256,6 @@ public class ShadowClone extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void damage(int dmg, Object src) {
|
|
||||||
|
|
||||||
//TODO improve this when I have proper damage source logic
|
|
||||||
if (Random.Int(4) < Dungeon.hero.pointsInTalent(Talent.CLONED_ARMOR)
|
|
||||||
&& Dungeon.hero.belongings.armor() != null
|
|
||||||
&& Dungeon.hero.belongings.armor().hasGlyph(AntiMagic.class, this)
|
|
||||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
|
||||||
dmg -= AntiMagic.drRoll(Dungeon.hero, Dungeon.hero.belongings.armor().buffedLvl());
|
|
||||||
dmg = Math.max(dmg, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.damage(dmg, src);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float speed() {
|
public float speed() {
|
||||||
float speed = super.speed();
|
float speed = super.speed();
|
||||||
|
|||||||
+5
-35
@@ -23,12 +23,8 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
|||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite;
|
||||||
@@ -83,16 +79,6 @@ public class ArmoredStatue extends Statue {
|
|||||||
return armor;
|
return armor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isImmune(Class effect) {
|
|
||||||
if (effect == Burning.class
|
|
||||||
&& armor != null
|
|
||||||
&& armor.hasGlyph(Brimstone.class, this)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.isImmune(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseProc(Char enemy, int damage) {
|
public int defenseProc(Char enemy, int damage) {
|
||||||
damage = armor.proc(enemy, this, damage);
|
damage = armor.proc(enemy, this, damage);
|
||||||
@@ -100,18 +86,12 @@ public class ArmoredStatue extends Statue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void damage(int dmg, Object src) {
|
public int glyphLevel(Class<? extends Armor.Glyph> cls) {
|
||||||
//TODO improve this when I have proper damage source logic
|
if (armor != null && armor.hasGlyph(cls, this)){
|
||||||
if (armor != null && armor.hasGlyph(AntiMagic.class, this)
|
return Math.max(super.glyphLevel(cls), armor.buffedLvl());
|
||||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
} else {
|
||||||
dmg -= AntiMagic.drRoll(this, armor.buffedLvl());
|
return super.glyphLevel(cls);
|
||||||
dmg = Math.max(dmg, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.damage( dmg, src );
|
|
||||||
|
|
||||||
//for the rose status indicator
|
|
||||||
Item.updateQuickslot();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -125,16 +105,6 @@ public class ArmoredStatue extends Statue {
|
|||||||
return sprite;
|
return sprite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public float speed() {
|
|
||||||
return armor.speedFactor(this, super.speed());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float stealth() {
|
|
||||||
return armor.stealthFactor(this, super.stealth());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseSkill(Char enemy) {
|
public int defenseSkill(Char enemy) {
|
||||||
return Math.round(armor.evasionFactor(this, super.defenseSkill(enemy)));
|
return Math.round(armor.evasionFactor(this, super.defenseSkill(enemy)));
|
||||||
|
|||||||
+6
-30
@@ -34,8 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
||||||
@@ -204,24 +203,12 @@ public class PrismaticImage extends NPC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void damage(int dmg, Object src) {
|
public int glyphLevel(Class<? extends Armor.Glyph> cls) {
|
||||||
|
if (hero != null){
|
||||||
//TODO improve this when I have proper damage source logic
|
return Math.max(super.glyphLevel(cls), hero.glyphLevel(cls));
|
||||||
if (hero != null && hero.belongings.armor() != null && hero.belongings.armor().hasGlyph(AntiMagic.class, this)
|
} else {
|
||||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
return super.glyphLevel(cls);
|
||||||
dmg -= AntiMagic.drRoll(hero, hero.belongings.armor().buffedLvl());
|
|
||||||
dmg = Math.max(dmg, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
super.damage(dmg, src);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float speed() {
|
|
||||||
if (hero != null && hero.belongings.armor() != null){
|
|
||||||
return hero.belongings.armor().speedFactor(this, super.speed());
|
|
||||||
}
|
|
||||||
return super.speed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -248,17 +235,6 @@ public class PrismaticImage extends NPC {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isImmune(Class effect) {
|
|
||||||
if (effect == Burning.class
|
|
||||||
&& hero != null
|
|
||||||
&& hero.belongings.armor() != null
|
|
||||||
&& hero.belongings.armor().hasGlyph(Brimstone.class, this)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.isImmune(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( ToxicGas.class );
|
immunities.add( ToxicGas.class );
|
||||||
immunities.add( CorrosiveGas.class );
|
immunities.add( CorrosiveGas.class );
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||||
@@ -65,7 +64,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ParchmentScrap;
|
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ParchmentScrap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ShardOfOblivion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ShardOfOblivion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
|
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
@@ -74,7 +72,6 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
|||||||
import com.watabou.noosa.particles.Emitter;
|
import com.watabou.noosa.particles.Emitter;
|
||||||
import com.watabou.utils.Bundlable;
|
import com.watabou.utils.Bundlable;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
import com.watabou.utils.PathFinder;
|
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
import com.watabou.utils.Reflection;
|
import com.watabou.utils.Reflection;
|
||||||
|
|
||||||
@@ -373,48 +370,10 @@ public class Armor extends EquipableItem {
|
|||||||
if (aEnc > 0) speed /= Math.pow(1.2, aEnc);
|
if (aEnc > 0) speed /= Math.pow(1.2, aEnc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasGlyph(Swiftness.class, owner)) {
|
|
||||||
boolean enemyNear = false;
|
|
||||||
//for each enemy, check if they are adjacent, or within 2 tiles and an adjacent cell is open
|
|
||||||
for (Char ch : Actor.chars()){
|
|
||||||
if ( Dungeon.level.distance(ch.pos, owner.pos) <= 2 && owner.alignment != ch.alignment && ch.alignment != Char.Alignment.NEUTRAL){
|
|
||||||
if (Dungeon.level.adjacent(ch.pos, owner.pos)){
|
|
||||||
enemyNear = true;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
for (int i : PathFinder.NEIGHBOURS8){
|
|
||||||
if (Dungeon.level.adjacent(owner.pos+i, ch.pos) && !Dungeon.level.solid[owner.pos+i]){
|
|
||||||
enemyNear = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!enemyNear) speed *= (1.2f + 0.04f * buffedLvl()) * glyph.procChanceMultiplier(owner);
|
|
||||||
} else if (hasGlyph(Flow.class, owner) && Dungeon.level.water[owner.pos]){
|
|
||||||
speed *= (2f + 0.5f*buffedLvl()) * glyph.procChanceMultiplier(owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasGlyph(Bulk.class, owner) &&
|
|
||||||
(Dungeon.level.map[owner.pos] == Terrain.DOOR
|
|
||||||
|| Dungeon.level.map[owner.pos] == Terrain.OPEN_DOOR )) {
|
|
||||||
speed /= 3f * RingOfArcana.enchantPowerMultiplier(owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
return speed;
|
return speed;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float stealthFactor( Char owner, float stealth ){
|
|
||||||
|
|
||||||
if (hasGlyph(Obfuscation.class, owner)){
|
|
||||||
stealth += (1 + buffedLvl()/3f) * glyph.procChanceMultiplier(owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
return stealth;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int level() {
|
public int level() {
|
||||||
int level = super.level();
|
int level = super.level();
|
||||||
|
|||||||
+13
-2
@@ -21,8 +21,10 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.armor.curses;
|
package com.shatteredpixel.shatteredpixeldungeon.items.armor.curses;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
|
||||||
public class Bulk extends Armor.Glyph {
|
public class Bulk extends Armor.Glyph {
|
||||||
@@ -31,11 +33,20 @@ public class Bulk extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect, triggers in Char.speed()
|
||||||
//no proc effect, see armor.speedfactor
|
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//more of a reduction really
|
||||||
|
public static float speedBoost( Char owner, int level ){
|
||||||
|
if (level == -1 ||
|
||||||
|
(Dungeon.level.map[owner.pos] != Terrain.DOOR && Dungeon.level.map[owner.pos] != Terrain.OPEN_DOOR )) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 1/3f * genericProcChanceMultiplier(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemSprite.Glowing glowing() {
|
public ItemSprite.Glowing glowing() {
|
||||||
return BLACK;
|
return BLACK;
|
||||||
|
|||||||
+9
-10
@@ -134,19 +134,18 @@ public class AntiMagic extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
//no proc effect, see:
|
//no proc effect, triggers in Char.damage
|
||||||
// Hero.damage
|
|
||||||
// GhostHero.damage
|
|
||||||
// Shadowclone.damage
|
|
||||||
// ArmoredStatue.damage
|
|
||||||
// PrismaticImage.damage
|
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int drRoll( Char ch, int level ){
|
public static int drRoll( Char owner, int level ){
|
||||||
return Random.NormalIntRange(
|
if (level == -1){
|
||||||
Math.round(level * genericProcChanceMultiplier(ch)),
|
return 0;
|
||||||
Math.round((3 + (level*1.5f)) * genericProcChanceMultiplier(ch)));
|
} else {
|
||||||
|
return Random.NormalIntRange(
|
||||||
|
Math.round(level * genericProcChanceMultiplier(owner)),
|
||||||
|
Math.round((3 + (level * 1.5f)) * genericProcChanceMultiplier(owner)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-6
@@ -31,12 +31,7 @@ public class Brimstone extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
//no proc effect, see:
|
//no proc effect, triggers in Char.isImmune
|
||||||
// Hero.isImmune
|
|
||||||
// GhostHero.isImmune
|
|
||||||
// Shadowclone.isImmune
|
|
||||||
// ArmoredStatue.isImmune
|
|
||||||
// PrismaticImage.isImmune
|
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -36,11 +36,12 @@ public class Camouflage extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
//no proc effect, see HighGrass.trample
|
//no proc effect, triggers in HighGrass.trample
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void activate(Char ch, int level){
|
public static void activate(Char ch, int level){
|
||||||
|
if (level == -1) return;
|
||||||
Buff.prolong(ch, Invisibility.class, Math.round((3 + level/2f)* genericProcChanceMultiplier(ch)));
|
Buff.prolong(ch, Invisibility.class, Math.round((3 + level/2f)* genericProcChanceMultiplier(ch)));
|
||||||
if ( Dungeon.level.heroFOV[ch.pos] ) {
|
if ( Dungeon.level.heroFOV[ch.pos] ) {
|
||||||
Sample.INSTANCE.play( Assets.Sounds.MELD );
|
Sample.INSTANCE.play( Assets.Sounds.MELD );
|
||||||
|
|||||||
+10
-1
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
@@ -31,10 +32,18 @@ public class Flow extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
//no proc effect, see armor.speedfactor for effect.
|
//no proc effect, triggers in Char.speed()
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float speedBoost( Char owner, int level ){
|
||||||
|
if (level == -1 || !Dungeon.level.water[owner.pos]){
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return (2f + 0.5f*level) * genericProcChanceMultiplier(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemSprite.Glowing glowing() {
|
public ItemSprite.Glowing glowing() {
|
||||||
return BLUE;
|
return BLUE;
|
||||||
|
|||||||
+9
-1
@@ -31,10 +31,18 @@ public class Obfuscation extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
//no proc effect, see armor.stealthfactor for effect.
|
//no proc effect, triggered in Char.stealth()
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float stealthBoost( Char owner, int level ){
|
||||||
|
if (level == -1) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return (1 + level / 3f) * genericProcChanceMultiplier(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemSprite.Glowing glowing() {
|
public ItemSprite.Glowing glowing() {
|
||||||
return GREY;
|
return GREY;
|
||||||
|
|||||||
+33
-1
@@ -21,9 +21,12 @@
|
|||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
import com.watabou.utils.PathFinder;
|
||||||
|
|
||||||
public class Swiftness extends Armor.Glyph {
|
public class Swiftness extends Armor.Glyph {
|
||||||
|
|
||||||
@@ -31,10 +34,39 @@ public class Swiftness extends Armor.Glyph {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
//no proc effect, see armor.speedfactor for effect.
|
//no proc effect, triggers in Char.speed()
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float speedBoost( Char owner, int level ){
|
||||||
|
if (level == -1){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean enemyNear = false;
|
||||||
|
//for each enemy, check if they are adjacent, or within 2 tiles and an adjacent cell is open
|
||||||
|
for (Char ch : Actor.chars()){
|
||||||
|
if ( Dungeon.level.distance(ch.pos, owner.pos) <= 2 && owner.alignment != ch.alignment && ch.alignment != Char.Alignment.NEUTRAL){
|
||||||
|
if (Dungeon.level.adjacent(ch.pos, owner.pos)){
|
||||||
|
enemyNear = true;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
for (int i : PathFinder.NEIGHBOURS8){
|
||||||
|
if (Dungeon.level.adjacent(owner.pos+i, ch.pos) && !Dungeon.level.solid[owner.pos+i]){
|
||||||
|
enemyNear = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enemyNear){
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return (1.2f + 0.04f * level) * genericProcChanceMultiplier(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemSprite.Glowing glowing() {
|
public ItemSprite.Glowing glowing() {
|
||||||
return YELLOW;
|
return YELLOW;
|
||||||
|
|||||||
+5
-40
@@ -45,8 +45,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution;
|
||||||
@@ -667,13 +665,6 @@ public class DriedRose extends Artifact {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void damage(int dmg, Object src) {
|
public void damage(int dmg, Object src) {
|
||||||
//TODO improve this when I have proper damage source logic
|
|
||||||
if (rose != null && rose.armor != null && rose.armor.hasGlyph(AntiMagic.class, this)
|
|
||||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
|
||||||
dmg -= AntiMagic.drRoll(this, rose.armor.buffedLvl());
|
|
||||||
dmg = Math.max(dmg, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
super.damage( dmg, src );
|
super.damage( dmg, src );
|
||||||
|
|
||||||
//for the rose status indicator
|
//for the rose status indicator
|
||||||
@@ -684,10 +675,6 @@ public class DriedRose extends Artifact {
|
|||||||
public float speed() {
|
public float speed() {
|
||||||
float speed = super.speed();
|
float speed = super.speed();
|
||||||
|
|
||||||
if (rose != null && rose.armor != null){
|
|
||||||
speed = rose.armor.speedFactor(this, speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
//moves 2 tiles at a time when returning to the hero
|
//moves 2 tiles at a time when returning to the hero
|
||||||
if (state == WANDERING
|
if (state == WANDERING
|
||||||
&& defendingPos == -1
|
&& defendingPos == -1
|
||||||
@@ -709,17 +696,6 @@ public class DriedRose extends Artifact {
|
|||||||
return defense;
|
return defense;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public float stealth() {
|
|
||||||
float stealth = super.stealth();
|
|
||||||
|
|
||||||
if (rose != null && rose.armor != null){
|
|
||||||
stealth = rose.armor.stealthFactor(this, stealth);
|
|
||||||
}
|
|
||||||
|
|
||||||
return stealth;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int drRoll() {
|
public int drRoll() {
|
||||||
int dr = super.drRoll();
|
int dr = super.drRoll();
|
||||||
@@ -732,24 +708,13 @@ public class DriedRose extends Artifact {
|
|||||||
return dr;
|
return dr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//used in some glyph calculations
|
|
||||||
public Armor armor(){
|
|
||||||
if (rose != null){
|
|
||||||
return rose.armor;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isImmune(Class effect) {
|
public int glyphLevel(Class<? extends Armor.Glyph> cls) {
|
||||||
if (effect == Burning.class
|
if (rose != null && rose.armor != null && rose.armor.hasGlyph(cls, this)){
|
||||||
&& rose != null
|
return Math.max(super.glyphLevel(cls), rose.armor.buffedLvl());
|
||||||
&& rose.armor != null
|
} else {
|
||||||
&& rose.armor.hasGlyph(Brimstone.class, this)){
|
return super.glyphLevel(cls);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return super.isImmune(effect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
-18
@@ -29,14 +29,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.ArmoredStatue;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Berry;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.Berry;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.PetrifiedSeed;
|
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.PetrifiedSeed;
|
||||||
@@ -149,22 +147,8 @@ public class HighGrass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Camouflage
|
if (ch != null) {
|
||||||
if (ch instanceof Hero) {
|
Camouflage.activate(ch, ch.glyphLevel(Camouflage.class));
|
||||||
Hero hero = (Hero) ch;
|
|
||||||
if (hero.belongings.armor() != null && hero.belongings.armor().hasGlyph(Camouflage.class, hero)) {
|
|
||||||
Camouflage.activate(hero, hero.belongings.armor.buffedLvl());
|
|
||||||
}
|
|
||||||
} else if (ch instanceof DriedRose.GhostHero){
|
|
||||||
DriedRose.GhostHero ghost = (DriedRose.GhostHero) ch;
|
|
||||||
if (ghost.armor() != null && ghost.armor().hasGlyph(Camouflage.class, ghost)){
|
|
||||||
Camouflage.activate(ghost, ghost.armor().buffedLvl());
|
|
||||||
}
|
|
||||||
} else if (ch instanceof ArmoredStatue){
|
|
||||||
ArmoredStatue statue = (ArmoredStatue) ch;
|
|
||||||
if (statue.armor() != null && statue.armor().hasGlyph(Camouflage.class, statue)){
|
|
||||||
Camouflage.activate(statue, statue.armor().buffedLvl());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user