v1.1.0: refactor to corruption to make it easier to add similar buffs
One notable mechanics change as well: All allies now remove stuck projectiles, not just corruption targets
This commit is contained in:
parent
f8b11e814d
commit
bf22a3c328
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArcaneArmor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArcaneArmor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
|
||||||
|
@ -884,9 +885,9 @@ public abstract class Char extends Actor {
|
||||||
|
|
||||||
public enum Property{
|
public enum Property{
|
||||||
BOSS ( new HashSet<Class>( Arrays.asList(Grim.class, GrimTrap.class, ScrollOfRetribution.class, ScrollOfPsionicBlast.class)),
|
BOSS ( new HashSet<Class>( Arrays.asList(Grim.class, GrimTrap.class, ScrollOfRetribution.class, ScrollOfPsionicBlast.class)),
|
||||||
new HashSet<Class>( Arrays.asList(Corruption.class, Dread.class) )),
|
new HashSet<Class>( Arrays.asList(AllyBuff.class, Dread.class) )),
|
||||||
MINIBOSS ( new HashSet<Class>(),
|
MINIBOSS ( new HashSet<Class>(),
|
||||||
new HashSet<Class>( Arrays.asList(Corruption.class, Dread.class) )),
|
new HashSet<Class>( Arrays.asList(AllyBuff.class, Dread.class) )),
|
||||||
UNDEAD,
|
UNDEAD,
|
||||||
DEMONIC,
|
DEMONIC,
|
||||||
INORGANIC ( new HashSet<Class>(),
|
INORGANIC ( new HashSet<Class>(),
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
|
|
||||||
|
//generic class for buffs which convert an enemy into an ally
|
||||||
|
// There is a decent amount of logic that ties into this, which is why it has its own abstract class
|
||||||
|
public abstract class AllyBuff extends Buff{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean attachTo(Char target) {
|
||||||
|
if (super.attachTo(target)){
|
||||||
|
target.alignment = Char.Alignment.ALLY;
|
||||||
|
if (target.buff(PinCushion.class) != null){
|
||||||
|
target.buff(PinCushion.class).detach();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//for when applying an ally buff should also cause that enemy to give exp/loot as if they had died
|
||||||
|
//consider that chars with the ally alignment do not drop items or award exp on death
|
||||||
|
public static void affectAndLoot(Mob enemy, Hero hero, Class<?extends AllyBuff> buffCls){
|
||||||
|
boolean droppingLoot = enemy.alignment != Char.Alignment.ALLY;
|
||||||
|
Buff.affect(enemy, buffCls);
|
||||||
|
|
||||||
|
if (enemy.buff(buffCls) != null){
|
||||||
|
if (droppingLoot) enemy.rollToDropLoot();
|
||||||
|
Statistics.enemiesSlain++;
|
||||||
|
Badges.validateMonstersSlain();
|
||||||
|
Statistics.qualifiedForNoKilling = false;
|
||||||
|
if (enemy.EXP > 0 && hero.lvl <= enemy.maxLvl) {
|
||||||
|
hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP));
|
||||||
|
hero.earnExp(enemy.EXP, enemy.getClass());
|
||||||
|
} else {
|
||||||
|
hero.earnExp(0, enemy.getClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -91,7 +91,7 @@ public abstract class ChampionEnemy extends Buff {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add(Corruption.class);
|
immunities.add(AllyBuff.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void rollForChampion(Mob m){
|
public static void rollForChampion(Mob m){
|
||||||
|
|
|
@ -26,7 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
|
||||||
public class Corruption extends Buff {
|
public class Corruption extends AllyBuff {
|
||||||
|
|
||||||
{
|
{
|
||||||
type = buffType.NEGATIVE;
|
type = buffType.NEGATIVE;
|
||||||
|
@ -35,13 +35,14 @@ public class Corruption extends Buff {
|
||||||
|
|
||||||
private float buildToDamage = 0f;
|
private float buildToDamage = 0f;
|
||||||
|
|
||||||
@Override
|
//corrupted enemies are usually fully healed and cleansed of most debuffs
|
||||||
public boolean attachTo(Char target) {
|
public static void corruptionHeal(Char target){
|
||||||
if (super.attachTo(target)){
|
target.HP = target.HT;
|
||||||
target.alignment = Char.Alignment.ALLY;
|
for (Buff buff : target.buffs()) {
|
||||||
return true;
|
if (buff.type == Buff.buffType.NEGATIVE
|
||||||
} else {
|
&& !(buff instanceof SoulMark)) {
|
||||||
return false;
|
buff.detach();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Freezing;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.BlobImmunity;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.BlobImmunity;
|
||||||
|
@ -158,7 +159,7 @@ public class SpiritHawk extends ArmorAbility {
|
||||||
attacksAutomatically = false;
|
attacksAutomatically = false;
|
||||||
|
|
||||||
immunities.addAll(new BlobImmunity().immunities());
|
immunities.addAll(new BlobImmunity().immunities());
|
||||||
immunities.add(Corruption.class);
|
immunities.add(AllyBuff.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Corruption;
|
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;
|
||||||
|
@ -150,7 +151,7 @@ public class ShadowClone extends ArmorAbility {
|
||||||
|
|
||||||
HP = HT = 100;
|
HP = HT = 100;
|
||||||
|
|
||||||
immunities.add(Corruption.class);
|
immunities.add(AllyBuff.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShadowAlly(){
|
public ShadowAlly(){
|
||||||
|
|
|
@ -24,9 +24,9 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.BeeSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.BeeSprite;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
@ -126,7 +126,8 @@ public class Bee extends Mob {
|
||||||
@Override
|
@Override
|
||||||
public void add(Buff buff) {
|
public void add(Buff buff) {
|
||||||
super.add(buff);
|
super.add(buff);
|
||||||
if (buff instanceof Corruption){
|
//TODO maybe handle honeyed bees with their own ally buff?
|
||||||
|
if (buff instanceof AllyBuff){
|
||||||
intelligentAlly = false;
|
intelligentAlly = false;
|
||||||
setPotInfo(-1, null);
|
setPotInfo(-1, null);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +184,7 @@ public class Bee extends Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean getCloser(int target) {
|
protected boolean getCloser(int target) {
|
||||||
if (alignment == Alignment.ALLY && enemy == null && buff(Corruption.class) == null){
|
if (alignment == Alignment.ALLY && enemy == null && buffs(AllyBuff.class).isEmpty()){
|
||||||
target = Dungeon.hero.pos;
|
target = Dungeon.hero.pos;
|
||||||
} else if (enemy != null && Actor.findById(potHolder) == enemy) {
|
} else if (enemy != null && Actor.findById(potHolder) == enemy) {
|
||||||
target = enemy.pos;
|
target = enemy.pos;
|
||||||
|
@ -194,7 +195,7 @@ public class Bee extends Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String description() {
|
public String description() {
|
||||||
if (alignment == Alignment.ALLY && buff(Corruption.class) == null){
|
if (alignment == Alignment.ALLY && buffs(AllyBuff.class).isEmpty()){
|
||||||
return Messages.get(this, "desc_honey");
|
return Messages.get(this, "desc_honey");
|
||||||
} else {
|
} else {
|
||||||
return super.description();
|
return super.description();
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread;
|
||||||
|
@ -186,7 +187,7 @@ public class CrystalMimic extends Mimic {
|
||||||
@Override
|
@Override
|
||||||
protected void nowhereToRun() {
|
protected void nowhereToRun() {
|
||||||
if (buff( Terror.class ) == null
|
if (buff( Terror.class ) == null
|
||||||
&& buff( Corruption.class ) == null
|
&& buffs( AllyBuff.class ).isEmpty()
|
||||||
&& buff( Dread.class ) == null) {
|
&& buff( Dread.class ) == null) {
|
||||||
if (enemySeen) {
|
if (enemySeen) {
|
||||||
sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage"));
|
sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage"));
|
||||||
|
|
|
@ -24,9 +24,9 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
||||||
|
@ -165,8 +165,8 @@ public class Ghoul extends Mob {
|
||||||
protected synchronized void onRemove() {
|
protected synchronized void onRemove() {
|
||||||
if (beingLifeLinked) {
|
if (beingLifeLinked) {
|
||||||
for (Buff buff : buffs()) {
|
for (Buff buff : buffs()) {
|
||||||
//corruption, champion, and king damager are preserved when removed via life link
|
//ally buffs, champion, and king damager are preserved when removed via life link
|
||||||
if (!(buff instanceof Corruption)
|
if (!(buff instanceof AllyBuff)
|
||||||
&& (!(buff instanceof ChampionEnemy))
|
&& (!(buff instanceof ChampionEnemy))
|
||||||
&& !(buff instanceof DwarfKing.KingDamager)) {
|
&& !(buff instanceof DwarfKing.KingDamager)) {
|
||||||
buff.detach();
|
buff.detach();
|
||||||
|
|
|
@ -29,6 +29,7 @@ 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.Adrenaline;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
||||||
|
@ -347,7 +348,7 @@ public abstract class Mob extends Char {
|
||||||
@Override
|
@Override
|
||||||
public void add( Buff buff ) {
|
public void add( Buff buff ) {
|
||||||
super.add( buff );
|
super.add( buff );
|
||||||
if (buff instanceof Amok || buff instanceof Corruption) {
|
if (buff instanceof Amok || buff instanceof AllyBuff) {
|
||||||
state = HUNTING;
|
state = HUNTING;
|
||||||
} else if (buff instanceof Terror || buff instanceof Dread) {
|
} else if (buff instanceof Terror || buff instanceof Dread) {
|
||||||
state = FLEEING;
|
state = FLEEING;
|
||||||
|
|
|
@ -25,6 +25,7 @@ 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.Adrenaline;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
|
@ -217,8 +218,8 @@ public class Necromancer extends Mob {
|
||||||
Dungeon.level.occupyCell( mySkeleton );
|
Dungeon.level.occupyCell( mySkeleton );
|
||||||
((NecromancerSprite)sprite).finishSummoning();
|
((NecromancerSprite)sprite).finishSummoning();
|
||||||
|
|
||||||
if (buff(Corruption.class) != null){
|
for (Buff b : buffs(AllyBuff.class)){
|
||||||
Buff.affect(mySkeleton, Corruption.class);
|
Buff.affect(mySkeleton, b.getClass());
|
||||||
}
|
}
|
||||||
for (Buff b : buffs(ChampionEnemy.class)){
|
for (Buff b : buffs(ChampionEnemy.class)){
|
||||||
Buff.affect( mySkeleton, b.getClass());
|
Buff.affect( mySkeleton, b.getClass());
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
|
@ -118,8 +119,8 @@ public class SpectralNecromancer extends Necromancer {
|
||||||
Dungeon.level.occupyCell( wraith );
|
Dungeon.level.occupyCell( wraith );
|
||||||
((SpectralNecromancerSprite)sprite).finishSummoning();
|
((SpectralNecromancerSprite)sprite).finishSummoning();
|
||||||
|
|
||||||
if (buff(Corruption.class) != null){
|
for (Buff b : buffs(AllyBuff.class)){
|
||||||
Buff.affect(wraith, Corruption.class);
|
Buff.affect( wraith, b.getClass());
|
||||||
}
|
}
|
||||||
for (Buff b : buffs(ChampionEnemy.class)){
|
for (Buff b : buffs(ChampionEnemy.class)){
|
||||||
Buff.affect( wraith, b.getClass());
|
Buff.affect( wraith, b.getClass());
|
||||||
|
|
|
@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.mobs;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ChampionEnemy;
|
||||||
|
@ -128,8 +129,8 @@ public class Swarm extends Mob {
|
||||||
if (buff( Poison.class ) != null) {
|
if (buff( Poison.class ) != null) {
|
||||||
Buff.affect( clone, Poison.class ).set(2);
|
Buff.affect( clone, Poison.class ).set(2);
|
||||||
}
|
}
|
||||||
if (buff(Corruption.class ) != null) {
|
for (Buff b : buffs(AllyBuff.class)){
|
||||||
Buff.affect( clone, Corruption.class);
|
Buff.affect( clone, b.getClass());
|
||||||
}
|
}
|
||||||
for (Buff b : buffs(ChampionEnemy.class)){
|
for (Buff b : buffs(ChampionEnemy.class)){
|
||||||
Buff.affect( clone, b.getClass());
|
Buff.affect( clone, b.getClass());
|
||||||
|
|
|
@ -23,6 +23,7 @@ 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.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
||||||
|
@ -199,7 +200,7 @@ public class Thief extends Mob {
|
||||||
protected void nowhereToRun() {
|
protected void nowhereToRun() {
|
||||||
if (buff( Terror.class ) == null
|
if (buff( Terror.class ) == null
|
||||||
&& buff( Dread.class ) == null
|
&& buff( Dread.class ) == null
|
||||||
&& buff( Corruption.class ) == null) {
|
&& buffs( AllyBuff.class ).isEmpty() ) {
|
||||||
if (enemySeen) {
|
if (enemySeen) {
|
||||||
sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage"));
|
sprite.showStatus(CharSprite.NEGATIVE, Messages.get(Mob.class, "rage"));
|
||||||
state = HUNTING;
|
state = HUNTING;
|
||||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
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.Burning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
|
@ -187,7 +188,7 @@ public class MirrorImage extends NPC {
|
||||||
immunities.add( ToxicGas.class );
|
immunities.add( ToxicGas.class );
|
||||||
immunities.add( CorrosiveGas.class );
|
immunities.add( CorrosiveGas.class );
|
||||||
immunities.add( Burning.class );
|
immunities.add( Burning.class );
|
||||||
immunities.add( Corruption.class );
|
immunities.add( AllyBuff.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MirrorInvis extends Invisibility {
|
public static class MirrorInvis extends Invisibility {
|
||||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
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.Burning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
|
@ -249,7 +250,7 @@ public class PrismaticImage extends NPC {
|
||||||
immunities.add( ToxicGas.class );
|
immunities.add( ToxicGas.class );
|
||||||
immunities.add( CorrosiveGas.class );
|
immunities.add( CorrosiveGas.class );
|
||||||
immunities.add( Burning.class );
|
immunities.add( Burning.class );
|
||||||
immunities.add( Corruption.class );
|
immunities.add( AllyBuff.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Wandering extends Mob.Wandering{
|
private class Wandering extends Mob.Wandering{
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
||||||
|
@ -809,7 +810,7 @@ public class DriedRose extends Artifact {
|
||||||
immunities.add( Burning.class );
|
immunities.add( Burning.class );
|
||||||
immunities.add( ScrollOfRetribution.class );
|
immunities.add( ScrollOfRetribution.class );
|
||||||
immunities.add( ScrollOfPsionicBlast.class );
|
immunities.add( ScrollOfPsionicBlast.class );
|
||||||
immunities.add( Corruption.class );
|
immunities.add( AllyBuff.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
@ -66,7 +66,7 @@ public class PotionOfCleansing extends ExoticPotion {
|
||||||
public static void cleanse(Char ch){
|
public static void cleanse(Char ch){
|
||||||
for (Buff b : ch.buffs()){
|
for (Buff b : ch.buffs()){
|
||||||
if (b.type == Buff.buffType.NEGATIVE
|
if (b.type == Buff.buffType.NEGATIVE
|
||||||
&& !(b instanceof Corruption)
|
&& !(b instanceof AllyBuff)
|
||||||
&& !(b instanceof LostInventory)){
|
&& !(b instanceof LostInventory)){
|
||||||
b.detach();
|
b.detach();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,11 +22,10 @@
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
package com.shatteredpixel.shatteredpixeldungeon.items.wands;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|
||||||
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.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||||
|
@ -46,7 +45,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hex;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSleep;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicalSleep;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Poison;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Slow;
|
||||||
|
@ -66,7 +64,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
@ -218,31 +215,9 @@ public class WandOfCorruption extends Wand {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!enemy.isImmune(Corruption.class)){
|
if (!enemy.isImmune(Corruption.class)){
|
||||||
enemy.HP = enemy.HT;
|
Corruption.corruptionHeal(enemy);
|
||||||
for (Buff buff : enemy.buffs()) {
|
|
||||||
if (buff.type == Buff.buffType.NEGATIVE
|
|
||||||
&& !(buff instanceof SoulMark)) {
|
|
||||||
buff.detach();
|
|
||||||
} else if (buff instanceof PinCushion){
|
|
||||||
buff.detach();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean droppingLoot = enemy.alignment != Char.Alignment.ALLY;
|
AllyBuff.affectAndLoot(enemy, curUser, Corruption.class);
|
||||||
Buff.affect(enemy, Corruption.class);
|
|
||||||
|
|
||||||
if (enemy.buff(Corruption.class) != null){
|
|
||||||
if (droppingLoot) enemy.rollToDropLoot();
|
|
||||||
Statistics.enemiesSlain++;
|
|
||||||
Badges.validateMonstersSlain();
|
|
||||||
Statistics.qualifiedForNoKilling = false;
|
|
||||||
if (enemy.EXP > 0 && curUser.lvl <= enemy.maxLvl) {
|
|
||||||
curUser.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP));
|
|
||||||
curUser.earnExp(enemy.EXP, enemy.getClass());
|
|
||||||
} else {
|
|
||||||
curUser.earnExp(0, enemy.getClass());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Buff.affect(enemy, Doom.class);
|
Buff.affect(enemy, Doom.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ 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.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.Amok;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
|
@ -350,7 +351,7 @@ public class WandOfLivingEarth extends DamageWand {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( Corruption.class );
|
immunities.add( AllyBuff.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String DEFENSE = "defense";
|
private static final String DEFENSE = "defense";
|
||||||
|
|
|
@ -25,10 +25,17 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Amok;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
||||||
|
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.npcs.NPC;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.NPC;
|
||||||
|
@ -451,8 +458,14 @@ public class WandOfRegrowth extends Wand {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add(Corruption.class);
|
immunities.add( Paralysis.class );
|
||||||
immunities.add(Doom.class);
|
immunities.add( Amok.class );
|
||||||
|
immunities.add( Sleep.class );
|
||||||
|
immunities.add( Terror.class );
|
||||||
|
immunities.add( Dread.class );
|
||||||
|
immunities.add( Vertigo.class );
|
||||||
|
immunities.add( AllyBuff.class );
|
||||||
|
immunities.add( Doom.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
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.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
|
@ -400,7 +401,7 @@ public class WandOfWarding extends Wand {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
immunities.add( Corruption.class );
|
immunities.add( AllyBuff.class );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String TIER = "tier";
|
private static final String TIER = "tier";
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||||
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.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
|
||||||
|
@ -59,30 +60,9 @@ public class Corrupting extends Weapon.Enchantment {
|
||||||
Mob enemy = (Mob) defender;
|
Mob enemy = (Mob) defender;
|
||||||
Hero hero = (attacker instanceof Hero) ? (Hero) attacker : Dungeon.hero;
|
Hero hero = (attacker instanceof Hero) ? (Hero) attacker : Dungeon.hero;
|
||||||
|
|
||||||
enemy.HP = enemy.HT;
|
Corruption.corruptionHeal(enemy);
|
||||||
for (Buff buff : enemy.buffs()) {
|
|
||||||
if (buff.type == Buff.buffType.NEGATIVE
|
|
||||||
&& !(buff instanceof SoulMark)) {
|
|
||||||
buff.detach();
|
|
||||||
} else if (buff instanceof PinCushion){
|
|
||||||
buff.detach();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (enemy.alignment == Char.Alignment.ENEMY){
|
|
||||||
enemy.rollToDropLoot();
|
|
||||||
}
|
|
||||||
|
|
||||||
Buff.affect(enemy, Corruption.class);
|
AllyBuff.affectAndLoot(enemy, hero, Corruption.class);
|
||||||
|
|
||||||
Statistics.enemiesSlain++;
|
|
||||||
Badges.validateMonstersSlain();
|
|
||||||
Statistics.qualifiedForNoKilling = false;
|
|
||||||
if (enemy.EXP > 0 && hero.lvl <= enemy.maxLvl) {
|
|
||||||
hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP));
|
|
||||||
hero.earnExp(enemy.EXP, enemy.getClass());
|
|
||||||
} else {
|
|
||||||
hero.earnExp(0, enemy.getClass());
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,7 @@ abstract public class MissileWeapon extends Weapon {
|
||||||
decrementDurability();
|
decrementDurability();
|
||||||
if (durability > 0){
|
if (durability > 0){
|
||||||
//attempt to stick the missile weapon to the enemy, just drop it if we can't.
|
//attempt to stick the missile weapon to the enemy, just drop it if we can't.
|
||||||
if (sticky && enemy != null && enemy.isAlive() && enemy.buff(Corruption.class) == null){
|
if (sticky && enemy != null && enemy.isAlive() && enemy.alignment != Char.Alignment.ALLY){
|
||||||
PinCushion p = Buff.affect(enemy, PinCushion.class);
|
PinCushion p = Buff.affect(enemy, PinCushion.class);
|
||||||
if (p.target == enemy){
|
if (p.target == enemy){
|
||||||
p.stick(this);
|
p.stick(this);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user