v2.0.0: fixed images benefiting from more acc/eva boosts than intended
This commit is contained in:
@@ -33,6 +33,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
|||||||
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.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion;
|
||||||
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.MirrorSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite;
|
||||||
@@ -113,16 +115,23 @@ public class MirrorImage extends NPC {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int attackSkill( Char target ) {
|
public int attackSkill( Char target ) {
|
||||||
return hero.attackSkill(target);
|
//same base attack skill as hero, benefits from accuracy ring and weapon
|
||||||
|
int attackSkill = 9 + hero.lvl;
|
||||||
|
attackSkill *= RingOfAccuracy.accuracyMultiplier(hero);
|
||||||
|
if (hero.belongings.attackingWeapon() != null){
|
||||||
|
attackSkill *= hero.belongings.attackingWeapon().accuracyFactor(this, target);
|
||||||
|
}
|
||||||
|
return attackSkill;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseSkill(Char enemy) {
|
public int defenseSkill(Char enemy) {
|
||||||
if (hero != null) {
|
if (hero != null) {
|
||||||
int baseEvasion = 4 + hero.lvl;
|
int baseEvasion = 4 + hero.lvl;
|
||||||
int heroEvasion = hero.defenseSkill(enemy);
|
int heroEvasion = (int)((4 + hero.lvl) * RingOfEvasion.evasionMultiplier( hero ));
|
||||||
|
|
||||||
//if the hero has more/less evasion, 50% of it is applied
|
//if the hero has more/less evasion, 50% of it is applied
|
||||||
|
//includes ring of evasion boost
|
||||||
return super.defenseSkill(enemy) * (baseEvasion + heroEvasion) / 2;
|
return super.defenseSkill(enemy) * (baseEvasion + heroEvasion) / 2;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ 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.glyphs.AntiMagic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.PrismaticSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.PrismaticSprite;
|
||||||
@@ -155,7 +157,8 @@ public class PrismaticImage extends NPC {
|
|||||||
@Override
|
@Override
|
||||||
public int attackSkill( Char target ) {
|
public int attackSkill( Char target ) {
|
||||||
if (hero != null) {
|
if (hero != null) {
|
||||||
return hero.attackSkill(target);
|
//same base attack skill as hero, benefits from accuracy ring
|
||||||
|
return (int)((9 + hero.lvl) * RingOfAccuracy.accuracyMultiplier(hero));
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -165,9 +168,13 @@ public class PrismaticImage extends NPC {
|
|||||||
public int defenseSkill(Char enemy) {
|
public int defenseSkill(Char enemy) {
|
||||||
if (hero != null) {
|
if (hero != null) {
|
||||||
int baseEvasion = 4 + hero.lvl;
|
int baseEvasion = 4 + hero.lvl;
|
||||||
int heroEvasion = hero.defenseSkill(enemy);
|
int heroEvasion = (int)((4 + hero.lvl) * RingOfEvasion.evasionMultiplier( hero ));
|
||||||
|
if (hero.belongings.armor() != null){
|
||||||
|
heroEvasion = (int)hero.belongings.armor().evasionFactor(this, heroEvasion);
|
||||||
|
}
|
||||||
|
|
||||||
//if the hero has more/less evasion, 50% of it is applied
|
//if the hero has more/less evasion, 50% of it is applied
|
||||||
|
//includes ring of evasion and armor boosts
|
||||||
return super.defenseSkill(enemy) * (baseEvasion + heroEvasion) / 2;
|
return super.defenseSkill(enemy) * (baseEvasion + heroEvasion) / 2;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user