v0.9.2: implemented the enhanced rings talent

This commit is contained in:
Evan Debenham 2021-02-13 19:33:43 -05:00
parent 448c170123
commit 82aec9cc86
12 changed files with 41 additions and 3 deletions

View File

@ -93,7 +93,7 @@ public enum Talent {
//Rogue T2
MYSTICAL_MEAL(68), MYSTICAL_UPGRADE(69), WIDE_SEARCH(70), SILENT_STEPS(71), ROGUES_FORESIGHT(72),
//Rogue T3
ROGUE_T3_1(73, 3), LIGHT_CLOAK(74, 3),
ENHANCED_RINGS(73, 3), LIGHT_CLOAK(74, 3),
//Assassin T3
ENHANCED_LETHALITY(75, 3), ASSASSINS_REACH(76, 3), BOUNTY_HUNTER(77, 3),
//Freerunner T3
@ -134,6 +134,7 @@ public enum Talent {
}
};
public static class EmpoweredStrikeTracker extends FlavourBuff{};
public static class EnhancedRingsTracker extends FlavourBuff{};
public static class BountyHunterTracker extends FlavourBuff{};
public static class RejuvenatingStepsCooldown extends FlavourBuff{};
@ -325,6 +326,12 @@ public enum Talent {
}
}
public static void onArtifactUsed( Hero hero ){
if (hero.hasTalent(ENHANCED_RINGS)){
Buff.affect(hero, EnhancedRingsTracker.class, 5f*hero.pointsInTalent(ENHANCED_RINGS));
}
}
public static void onItemEquipped( Hero hero, Item item ){
if (hero.pointsInTalent(ARMSMASTERS_INTUITION) == 2 && (item instanceof Weapon || item instanceof Armor)){
item.identify();
@ -447,7 +454,7 @@ public enum Talent {
Collections.addAll(tierTalents, EMPOWERING_SCROLLS, MAGE_T3_2);
break;
case ROGUE:
Collections.addAll(tierTalents, ROGUE_T3_1, LIGHT_CLOAK);
Collections.addAll(tierTalents, ENHANCED_RINGS, LIGHT_CLOAK);
break;
case HUNTRESS:
Collections.addAll(tierTalents, POINT_BLANK, HUNTRESS_T3_2);

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -208,6 +209,7 @@ public class AlchemistsToolkit extends Artifact {
@Override
public void spendEnergy(int reduction) {
charge = Math.max(0, charge - reduction);
Talent.onArtifactUsed(Dungeon.hero);
}
}

View File

@ -100,6 +100,7 @@ public class CloakOfShadows extends Artifact {
} else {
hero.sprite.alpha(0.4f);
}
Talent.onArtifactUsed(Dungeon.hero);
hero.sprite.operate(hero.pos);
}
} else {

View File

@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
@ -169,7 +170,8 @@ public class DriedRose extends Artifact {
ghost.sayAppeared();
}
}
Talent.onArtifactUsed(hero);
charge = 0;
partialCharge = 0;
updateQuickslot();

View File

@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.Chains;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -169,6 +170,7 @@ public class EtherealChains extends Artifact {
return;
} else {
charge -= chargeUse;
Talent.onArtifactUsed(hero);
updateQuickslot();
}
@ -225,6 +227,7 @@ public class EtherealChains extends Artifact {
return;
} else {
charge -= chargeUse;
Talent.onArtifactUsed(hero);
updateQuickslot();
}

View File

@ -101,6 +101,7 @@ public class HornOfPlenty extends Artifact {
Statistics.foodEaten++;
charge -= chargesToUse;
Talent.onArtifactUsed(hero);
hero.sprite.operate(hero.pos);
hero.busy();

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -114,6 +115,7 @@ public class MasterThievesArmband extends Artifact {
exp += value;
}
}
Talent.onArtifactUsed(Dungeon.hero);
while(exp >= (250 + 50*level()) && level() < levelCap) {
exp -= (250 + 50*level());
upgrade();

View File

@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -91,6 +92,7 @@ public class SandalsOfNature extends Artifact {
CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8);
Camera.main.shake(1, 0.4f);
charge = 0;
Talent.onArtifactUsed(Dungeon.hero);
updateQuickslot();
}
}

View File

@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.CheckedCell;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -205,6 +206,7 @@ public class TalismanOfForesight extends Artifact {
partialCharge ++;
charge --;
}
Talent.onArtifactUsed(Dungeon.hero);
updateQuickslot();
Dungeon.observe();
Dungeon.hero.checkVisibleMobs();

View File

@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -100,6 +101,7 @@ public class TimekeepersHourglass extends Artifact {
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
activeBuff = new timeStasis();
Talent.onArtifactUsed(Dungeon.hero);
activeBuff.attachTo(Dungeon.hero);
} else if (index == 1) {
GLog.i( Messages.get(TimekeepersHourglass.class, "onfreeze") );
@ -107,6 +109,7 @@ public class TimekeepersHourglass extends Artifact {
Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
activeBuff = new timeFreeze();
Talent.onArtifactUsed(Dungeon.hero);
activeBuff.attachTo(Dungeon.hero);
((timeFreeze)activeBuff).processTime(0f);
}

View File

@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -151,8 +152,10 @@ public class UnstableSpellbook extends Artifact {
Scroll scroll = Reflection.newInstance(ExoticScroll.regToExo.get(fScroll.getClass()));
charge--;
scroll.doRead();
Talent.onArtifactUsed(Dungeon.hero);
} else {
fScroll.doRead();
Talent.onArtifactUsed(Dungeon.hero);
}
}
@ -163,6 +166,7 @@ public class UnstableSpellbook extends Artifact {
});
} else {
scroll.doRead();
Talent.onArtifactUsed(Dungeon.hero);
}
updateQuickslot();
}

View File

@ -286,6 +286,15 @@ public class Ring extends KindofMisc {
}
}
@Override
public int buffedLvl() {
int lvl = super.buffedLvl();
if (Dungeon.hero.buff(Talent.EnhancedRingsTracker.class) != null){
lvl++;
}
return lvl;
}
public static int getBonus(Char target, Class<?extends RingBuff> type){
int bonus = 0;
for (RingBuff buff : target.buffs(type)) {