v1.3.0: fixed DK challenge badge not counting all wands
This commit is contained in:
+8
-2
@@ -47,6 +47,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.KingsCrown;
|
|||||||
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.LloydsBeacon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfForce;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLightning;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfLightning;
|
||||||
@@ -438,8 +439,13 @@ public class DwarfKing extends Mob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void damage(int dmg, Object src) {
|
public void damage(int dmg, Object src) {
|
||||||
//lightning and corrosion have their own custom logic
|
//hero only counts as unarmed if they have no weapon and aren't benefiting from force
|
||||||
if (src == Dungeon.hero || (src instanceof Wand && !(src instanceof WandOfLightning))){
|
if (src == Dungeon.hero && (Dungeon.hero.belongings.weapon() != null || Dungeon.hero.buff(RingOfForce.Force.class) != null)){
|
||||||
|
Statistics.qualifiedForBossChallengeBadge = false;
|
||||||
|
//Corrosion, corruption, and regrowth do no direct damage and so have their own custom logic
|
||||||
|
//Transfusion damages DK and so doesn't need custom logic
|
||||||
|
//Lightning has custom logic so that chaining it doesn't DQ for the badge
|
||||||
|
} else if (src instanceof Wand && !(src instanceof WandOfLightning)){
|
||||||
Statistics.qualifiedForBossChallengeBadge = false;
|
Statistics.qualifiedForBossChallengeBadge = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
|||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
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;
|
||||||
@@ -55,6 +56,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vulnerable;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DwarfKing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Piranha;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Piranha;
|
||||||
@@ -131,6 +133,10 @@ public class WandOfCorruption extends Wand {
|
|||||||
|
|
||||||
Mob enemy = (Mob) ch;
|
Mob enemy = (Mob) ch;
|
||||||
|
|
||||||
|
if (enemy instanceof DwarfKing){
|
||||||
|
Statistics.qualifiedForBossChallengeBadge = false;
|
||||||
|
}
|
||||||
|
|
||||||
float corruptingPower = 3 + buffedLvl()/2f;
|
float corruptingPower = 3 + buffedLvl()/2f;
|
||||||
|
|
||||||
//base enemy resistance is usually based on their exp, but in special cases it is based on other criteria
|
//base enemy resistance is usually based on their exp, but in special cases it is based on other criteria
|
||||||
|
|||||||
+5
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
|||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
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;
|
||||||
@@ -38,6 +39,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WildMagic;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WildMagic;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DwarfKing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
||||||
@@ -120,6 +122,9 @@ public class WandOfRegrowth extends Wand {
|
|||||||
}
|
}
|
||||||
Char ch = Actor.findChar(cell);
|
Char ch = Actor.findChar(cell);
|
||||||
if (ch != null){
|
if (ch != null){
|
||||||
|
if (ch instanceof DwarfKing){
|
||||||
|
Statistics.qualifiedForBossChallengeBadge = false;
|
||||||
|
}
|
||||||
wandProc(ch, chargesPerCast());
|
wandProc(ch, chargesPerCast());
|
||||||
Buff.prolong( ch, Roots.class, 4f * chrgUsed );
|
Buff.prolong( ch, Roots.class, 4f * chrgUsed );
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -106,7 +106,7 @@ public class WandOfTransfusion extends Wand {
|
|||||||
//grant a self-shield, and...
|
//grant a self-shield, and...
|
||||||
Buff.affect(curUser, Barrier.class).setShield((5 + buffedLvl()));
|
Buff.affect(curUser, Barrier.class).setShield((5 + buffedLvl()));
|
||||||
|
|
||||||
//chars living enemies
|
//charms living enemies
|
||||||
if (!ch.properties().contains(Char.Property.UNDEAD)) {
|
if (!ch.properties().contains(Char.Property.UNDEAD)) {
|
||||||
Charm charm = Buff.affect(ch, Charm.class, Charm.DURATION/2f);
|
Charm charm = Buff.affect(ch, Charm.class, Charm.DURATION/2f);
|
||||||
charm.object = curUser.id();
|
charm.object = curUser.id();
|
||||||
|
|||||||
Reference in New Issue
Block a user