v3.0.0: added a debuff to guiding light, which removes evasion

This commit is contained in:
Evan Debenham
2024-10-17 17:32:33 -04:00
parent 16ddf3a6d5
commit dcbf989eba
3 changed files with 20 additions and 2 deletions

View File

@@ -24,12 +24,14 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
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.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile; import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
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.ui.HeroIcon; import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample; import com.watabou.noosa.audio.Sample;
@@ -74,8 +76,10 @@ public class GuidingLight extends ClericSpell {
if (ch != null) { if (ch != null) {
ch.damage(Random.NormalIntRange(2, 6), GuidingLight.this); ch.damage(Random.NormalIntRange(2, 6), GuidingLight.this);
Sample.INSTANCE.play(Assets.Sounds.HIT_MAGIC, 1, Random.Float(0.87f, 1.15f)); Sample.INSTANCE.play(Assets.Sounds.HIT_MAGIC, 1, Random.Float(0.87f, 1.15f));
if (ch.isAlive()){
Buff.affect(ch, GuidingLightDebuff.class);
}
} }
//TODO needs an on-hit effect as well
tome.spendCharge( 1f ); tome.spendCharge( 1f );
hero.spend( 1f ); hero.spend( 1f );
@@ -83,4 +87,13 @@ public class GuidingLight extends ClericSpell {
} }
}); });
} }
public static class GuidingLightDebuff extends Buff {
@Override
public void fx(boolean on) {
if (on) target.sprite.add(CharSprite.State.ILLUMINATED);
else target.sprite.remove(CharSprite.State.ILLUMINATED);
}
}
} }

View File

@@ -52,6 +52,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.Feint; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.Feint;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.ShadowClone; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.ShadowClone;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.GuidingLight;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.DirectableAlly; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.DirectableAlly;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText; import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
@@ -664,6 +665,10 @@ public abstract class Mob extends Char {
if ( !surprisedBy(enemy) if ( !surprisedBy(enemy)
&& paralysed == 0 && paralysed == 0
&& !(alignment == Alignment.ALLY && enemy == Dungeon.hero)) { && !(alignment == Alignment.ALLY && enemy == Dungeon.hero)) {
if (buff(GuidingLight.GuidingLightDebuff.class) != null){
buff(GuidingLight.GuidingLightDebuff.class).detach();
return 0;
}
return this.defenseSkill; return this.defenseSkill;
} else { } else {
return 0; return 0;

View File

@@ -50,7 +50,7 @@ public class TorchHalo extends Halo {
am = -phase * brightness; am = -phase * brightness;
} }
} else if (phase < 1) { } else if (phase < 1) {
if ((phase += Game.elapsed) >= 1) { if ((phase += 2*Game.elapsed) >= 1) {
phase = 1; phase = 1;
} }
scale.set( phase * radius / RADIUS ); scale.set( phase * radius / RADIUS );