v3.0.0: filled out ascended form functionality

This commit is contained in:
Evan Debenham
2024-12-13 15:55:07 -05:00
parent eb9c42f419
commit 5e0f45b579
8 changed files with 68 additions and 5 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

@@ -66,6 +66,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SnipersMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.TimeStasis;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.Challenge;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.ElementalStrike;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.NaturesPower;
@@ -169,6 +170,7 @@ import com.shatteredpixel.shatteredpixeldungeon.windows.WndTradeItem;
import com.watabou.noosa.Game;
import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.tweeners.Delayer;
import com.watabou.utils.BArray;
import com.watabou.utils.Bundle;
import com.watabou.utils.Callback;
import com.watabou.utils.GameMath;
@@ -736,6 +738,15 @@ public class Hero extends Char {
if (wep != null){
return wep.canReach(this, enemy.pos);
} else if (buff(AscendedForm.AscendBuff.class) != null) {
boolean[] passable = BArray.not(Dungeon.level.solid, null);
for (Char ch : Actor.chars()) {
if (ch != this) passable[ch.pos] = false;
}
PathFinder.buildDistanceMap(enemy.pos, passable, 3);
return PathFinder.distance[pos] <= 3;
} else {
return false;
}
@@ -24,14 +24,15 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ShieldBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.effects.Flare;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.watabou.noosa.audio.Sample;
@@ -44,7 +45,7 @@ public class AscendedForm extends ArmorAbility {
@Override
protected void activate(ClassArmor armor, Hero hero, Integer target) {
Buff.prolong(hero, AscendBuff.class, AscendBuff.DURATION);
Buff.affect(hero, AscendBuff.class).reset();
hero.sprite.operate(hero.pos);
Sample.INSTANCE.play(Assets.Sounds.CHARGEUP);
new Flare(6, 48).color(0xFFFF00, true).show(hero.sprite, 2f);
@@ -66,12 +67,28 @@ public class AscendedForm extends ArmorAbility {
return new Talent[]{Talent.DIVINE_INTERVENTION, Talent.JUDGEMENT, Talent.FLASH, Talent.HEROIC_ENERGY};
}
//TODO become shielding buff
public static class AscendBuff extends FlavourBuff {
public static class AscendBuff extends ShieldBuff {
{
type = buffType.POSITIVE;
}
public static float DURATION = 10f;
public int flashUses = 0;
@Override
public int icon() {
return BuffIndicator.ASCEND;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - left) / DURATION);
}
@Override
public String iconTextDisplay() {
return Integer.toString((int)left);
}
@Override
public void fx(boolean on) {
@@ -79,6 +96,26 @@ public class AscendedForm extends ArmorAbility {
else target.sprite.remove(CharSprite.State.GLOWING);
}
public int flashUses = 0;
public int left = 10;
public void reset(){
setShield(30);
left = (int)DURATION;
}
@Override
public boolean act() {
left--;
if (left <= 0){
detach();
//TODO also remove divine intervention shield from allies
return true;
}
spend(TICK);
return true;
}
}
}
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
@@ -69,6 +70,9 @@ public abstract class ClericSpell {
hero.buff(Talent.SatiatedSpellsTracker.class).detach();
}
tome.spendCharge(chargeUse(hero));
if (hero.buff(AscendedForm.AscendBuff.class) != null){
hero.buff(AscendedForm.AscendBuff.class).incShield((int)(10*chargeUse(hero)));
}
}
public static ArrayList<ClericSpell> getSpellList(Hero cleric, int tier){
@@ -45,6 +45,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ToxicImbue;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WellFed;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome;
@@ -93,6 +94,11 @@ public class MnemonicPrayer extends TargetedClericSpell {
continue;
}
//no it does not boost ascended form lmao
if (b instanceof AscendedForm.AscendBuff){
continue;
}
//should consider some buffs that may be OP here, e.g. invuln
if (b instanceof FlavourBuff) Buff.affect(ch, (Class<?extends FlavourBuff>)b.getClass(), extension);
else if (b instanceof AdrenalineSurge) ((AdrenalineSurge) b).delay(extension);
@@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.ElementalStrike;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@@ -271,6 +272,9 @@ abstract public class Weapon extends KindOfWeapon {
return reach;
}
}
if (owner instanceof Hero && owner.buff(AscendedForm.AscendBuff.class) != null){
reach += 2;
}
if (hasEnchant(Projecting.class, owner)){
return reach + Math.round(enchantment.procChanceMultiplier(owner));
} else {
@@ -128,6 +128,7 @@ public class BuffIndicator extends Component {
public static final int LIGHT_SHIELD= 76;
public static final int HOLY_SIGHT = 77;
public static final int GLYPH_RECALL= 78;
public static final int ASCEND = 79;
public static final int SIZE_SMALL = 7;
public static final int SIZE_LARGE = 16;