v3.0.0: implemented the divine sense talent

This commit is contained in:
Evan Debenham
2024-10-30 16:00:49 -04:00
parent 90c9fb2515
commit d88a21a33f
12 changed files with 115 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -543,6 +543,12 @@ actors.hero.spells.detectcurse.uncursed=This item is free of malevolent magic.
actors.hero.spells.detectcurse.short_desc=identifies whether an item is cursed or not.
actors.hero.spells.detectcurse.desc=The Cleric focuses their senses on an item and determines whether it is cursed or not without having to equip it.
actors.hero.spells.divinesense.name=divine sense
actors.hero.spells.divinesense.short_desc=Gain temporary mind vision in a wide range.
actors.hero.spells.divinesense.desc=The Cleric focuses their senses on their surroundings, gaining mind vision with a %d tile range for 50 turns.
actors.hero.spells.divinesense$divinesensetracker.name=divine sense
actors.hero.spells.divinesense$divinesensetracker.desc=The Cleric is temporarily able to see other nearby creatures with their mind!\n\nTurns remaining: %s.
actors.hero.spells.guidinglight.name=guiding light
actors.hero.spells.guidinglight.prompt=Choose a target
actors.hero.spells.guidinglight.short_desc=Deals ranged magic damage and guarantees a hit.
@@ -554,7 +560,7 @@ actors.hero.spells.holyward.glyph_desc=This glyph slightly increases the amount
actors.hero.spells.holyward.short_desc=Temporarily overrides glyphs to boost armor blocking.
actors.hero.spells.holyward.desc=The Cleric imbues their worn armor with glyphs of holy light, increasing the armor's damage blocking by 1.\n\nThis glyph lasts for 50 turns, and will override any beneficial glyph the armor has for the duration.
actors.hero.spells.holyward$holyarmbuff.name=holy ward
actors.hero.spells.holyward$holyarmbuff.desc=The Cleric has imbued their worn armor with holy energy, temporarily overriding any existing glyph and causing the armor to block an extra 1 point of damage.\n\nTurn renaming: %s.
actors.hero.spells.holyward$holyarmbuff.desc=The Cleric has imbued their worn armor with holy energy, temporarily overriding any existing glyph and causing the armor to block an extra 1 point of damage.\n\nTurns renaming: %s.
actors.hero.spells.holyweapon.name=holy weapon
actors.hero.spells.holyweapon.ench_name=holy %s
@@ -562,7 +568,7 @@ actors.hero.spells.holyweapon.ench_desc=Enemies struck by a holy weapon will tak
actors.hero.spells.holyweapon.short_desc=Temporarily overrides enchantments to boost damage.
actors.hero.spells.holyweapon.desc=The Cleric enchants their worn weapon with holy energy, causing the weapon to deal an additional 2 magical damage any time they strike an enemy with it.\n\nThis enchantment lasts for 50 turns, and will override any beneficial enchantment the weapon has for the duration.
actors.hero.spells.holyweapon$holywepbuff.name=holy weapon
actors.hero.spells.holyweapon$holywepbuff.desc=The Cleric has imbued their worn weapon with holy energy, temporarily overriding any existing enchantment and causing the weapon to deal an extra 2 magical damage on each attack.\n\nTurn renaming: %s.
actors.hero.spells.holyweapon$holywepbuff.desc=The Cleric has imbued their worn weapon with holy energy, temporarily overriding any existing enchantment and causing the weapon to deal an extra 2 magical damage on each attack.\n\nTurns renaming: %s.
actors.hero.spells.shieldoflight.name=shield of light
actors.hero.spells.shieldoflight.prompt=Choose a target
@@ -1017,8 +1023,8 @@ actors.hero.talent.clerict2b.title=TODO
actors.hero.talent.clerict2b.desc=TODO
actors.hero.talent.clerict2c.title=TODO
actors.hero.talent.clerict2c.desc=TODO
actors.hero.talent.clerict2d.title=TODO
actors.hero.talent.clerict2d.desc=TODO
actors.hero.talent.divine_sense.title=Divine Sense
actors.hero.talent.divine_sense.desc=_+1:_ The Cleric can cast _Divine Sense,_ a spell that grants them _8 tiles_ of Mind Vision for 50 turns, at the cost of 2 charges.\n\n_+2:_ The Cleric can cast _Divine Sense,_ a spell that grants them _12 tiles_ of Mind Vision for 50 turns, at the cost of 2 charges.
actors.hero.talent.clerict2e.title=TODO
actors.hero.talent.clerict2e.desc=TODO

View File

@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpiritHawk;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.DivineSense;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
@@ -946,7 +947,7 @@ public class Dungeon {
GameScene.updateFog(l, t, width, height);
if (hero.buff(MindVision.class) != null){
if (hero.buff(MindVision.class) != null || hero.buff(DivineSense.DivineSenseTracker.class) != null){
for (Mob m : level.mobs.toArray(new Mob[0])){
if (m instanceof Mimic && m.alignment == Char.Alignment.NEUTRAL && ((Mimic) m).stealthy()){
continue;

View File

@@ -175,7 +175,7 @@ public enum Talent {
//Cleric T1
SATIATED_SPELLS(160), DETECT_CURSE(161), SEARING_LIGHT(162), SHIELD_OF_LIGHT(163),
//Cleric T2
ENLIGHTENING_MEAL(164), CLERICT2B(165), CLERICT2C(166), CLERICT2D(167), CLERICT2E(168),
ENLIGHTENING_MEAL(164), CLERICT2B(165), CLERICT2C(166), DIVINE_SENSE(167), CLERICT2E(168),
//Cleric T3
CLERICT3A(169, 3), CLERICT3B(170, 3),
@@ -510,7 +510,7 @@ public enum Talent {
}
}
if (talent == HEIGHTENED_SENSES || talent == FARSIGHT){
if (talent == HEIGHTENED_SENSES || talent == FARSIGHT || talent == DIVINE_SENSE){
Dungeon.observe();
}
@@ -915,7 +915,7 @@ public enum Talent {
Collections.addAll(tierTalents, FOCUSED_MEAL, LIQUID_AGILITY, WEAPON_RECHARGING, LETHAL_HASTE, SWIFT_EQUIP);
break;
case CLERIC:
Collections.addAll(tierTalents, ENLIGHTENING_MEAL, CLERICT2B, CLERICT2C, CLERICT2D, CLERICT2E);
Collections.addAll(tierTalents, ENLIGHTENING_MEAL, CLERICT2B, CLERICT2C, DIVINE_SENSE, CLERICT2E);
break;
}
for (Talent talent : tierTalents){

View File

@@ -66,6 +66,7 @@ public abstract class ClericSpell {
tome.spendCharge(chargeUse(hero));
}
//TODO separate based on tiers?
public static ArrayList<ClericSpell> getSpellList(Hero cleric){
ArrayList<ClericSpell> spells = new ArrayList<>();
@@ -81,6 +82,10 @@ public abstract class ClericSpell {
spells.add(DetectCurse.INSTANCE);
}
if (cleric.hasTalent(Talent.DIVINE_SENSE)){
spells.add(DivineSense.INSTANCE);
}
return spells;
};

View File

@@ -0,0 +1,89 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2024 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.watabou.noosa.audio.Sample;
public class DivineSense extends ClericSpell {
public static final DivineSense INSTANCE = new DivineSense();
@Override
public int icon() {
return HeroIcon.DIVINE_SENSE;
}
@Override
public void onCast(HolyTome tome, Hero hero) {
FlavourBuff.affect(hero, DivineSenseTracker.class, 50f);
Dungeon.observe();
Sample.INSTANCE.play(Assets.Sounds.READ);
hero.spend( 1f );
hero.busy();
hero.sprite.operate(hero.pos);
onSpellCast(tome, hero);
}
public String desc(){
return Messages.get(this, "desc", 4+4*Dungeon.hero.pointsInTalent(Talent.DIVINE_SENSE)) + "\n\n" + Messages.get(this, "charge_cost", (int)chargeUse(Dungeon.hero));
}
public static class DivineSenseTracker extends FlavourBuff {
public static final float DURATION = 50f;
{
type = buffType.POSITIVE;
}
@Override
public int icon() {
return BuffIndicator.HOLY_SIGHT;
}
@Override
public float iconFadePercent() {
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
}
@Override
public void detach() {
super.detach();
Dungeon.observe();
GameScene.updateFog();
}
}
}

View File

@@ -49,6 +49,7 @@ 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.huntress.SpiritHawk;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.DivineSense;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollGeomancer;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mimic;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
@@ -1370,6 +1371,9 @@ public abstract class Level implements Bundlable {
if (((Hero) c).hasTalent(Talent.HEIGHTENED_SENSES)){
mindVisRange = 1+((Hero) c).pointsInTalent(Talent.HEIGHTENED_SENSES);
}
if (c.buff(DivineSense.DivineSenseTracker.class) != null){
mindVisRange = 4+4*((Hero) c).pointsInTalent(Talent.DIVINE_SENSE);
}
mindVisRange = Math.max(mindVisRange, EyeOfNewt.mindVisionRange());
if (mindVisRange >= 1) {

View File

@@ -126,6 +126,7 @@ public class BuffIndicator extends Component {
public static final int HOLY_ARMOR = 74;
public static final int SPELL_FOOD = 75;
public static final int LIGHT_SHIELD= 76;
public static final int HOLY_SIGHT = 77;
public static final int SIZE_SMALL = 7;
public static final int SIZE_LARGE = 16;

View File

@@ -73,6 +73,7 @@ public class HeroIcon extends Image {
public static final int HOLY_WARD = 42;
public static final int SHIELD_OF_LIGHT = 43;
public static final int DETECT_CURSE = 44;
public static final int DIVINE_SENSE = 45;
//action indicator visuals
public static final int BERSERK = 80;