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 //Rogue T2
MYSTICAL_MEAL(68), MYSTICAL_UPGRADE(69), WIDE_SEARCH(70), SILENT_STEPS(71), ROGUES_FORESIGHT(72), MYSTICAL_MEAL(68), MYSTICAL_UPGRADE(69), WIDE_SEARCH(70), SILENT_STEPS(71), ROGUES_FORESIGHT(72),
//Rogue T3 //Rogue T3
ROGUE_T3_1(73, 3), LIGHT_CLOAK(74, 3), ENHANCED_RINGS(73, 3), LIGHT_CLOAK(74, 3),
//Assassin T3 //Assassin T3
ENHANCED_LETHALITY(75, 3), ASSASSINS_REACH(76, 3), BOUNTY_HUNTER(77, 3), ENHANCED_LETHALITY(75, 3), ASSASSINS_REACH(76, 3), BOUNTY_HUNTER(77, 3),
//Freerunner T3 //Freerunner T3
@ -134,6 +134,7 @@ public enum Talent {
} }
}; };
public static class EmpoweredStrikeTracker extends FlavourBuff{}; public static class EmpoweredStrikeTracker extends FlavourBuff{};
public static class EnhancedRingsTracker extends FlavourBuff{};
public static class BountyHunterTracker extends FlavourBuff{}; public static class BountyHunterTracker extends FlavourBuff{};
public static class RejuvenatingStepsCooldown 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 ){ public static void onItemEquipped( Hero hero, Item item ){
if (hero.pointsInTalent(ARMSMASTERS_INTUITION) == 2 && (item instanceof Weapon || item instanceof Armor)){ if (hero.pointsInTalent(ARMSMASTERS_INTUITION) == 2 && (item instanceof Weapon || item instanceof Armor)){
item.identify(); item.identify();
@ -447,7 +454,7 @@ public enum Talent {
Collections.addAll(tierTalents, EMPOWERING_SCROLLS, MAGE_T3_2); Collections.addAll(tierTalents, EMPOWERING_SCROLLS, MAGE_T3_2);
break; break;
case ROGUE: case ROGUE:
Collections.addAll(tierTalents, ROGUE_T3_1, LIGHT_CLOAK); Collections.addAll(tierTalents, ENHANCED_RINGS, LIGHT_CLOAK);
break; break;
case HUNTRESS: case HUNTRESS:
Collections.addAll(tierTalents, POINT_BLANK, HUNTRESS_T3_2); 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.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -208,6 +209,7 @@ public class AlchemistsToolkit extends Artifact {
@Override @Override
public void spendEnergy(int reduction) { public void spendEnergy(int reduction) {
charge = Math.max(0, charge - reduction); charge = Math.max(0, charge - reduction);
Talent.onArtifactUsed(Dungeon.hero);
} }
} }

View File

@ -100,6 +100,7 @@ public class CloakOfShadows extends Artifact {
} else { } else {
hero.sprite.alpha(0.4f); hero.sprite.alpha(0.4f);
} }
Talent.onArtifactUsed(Dungeon.hero);
hero.sprite.operate(hero.pos); hero.sprite.operate(hero.pos);
} }
} else { } 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.Corruption;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Wraith;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
@ -170,6 +171,7 @@ public class DriedRose extends Artifact {
} }
} }
Talent.onArtifactUsed(hero);
charge = 0; charge = 0;
partialCharge = 0; partialCharge = 0;
updateQuickslot(); 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.Cripple;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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.Chains;
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -169,6 +170,7 @@ public class EtherealChains extends Artifact {
return; return;
} else { } else {
charge -= chargeUse; charge -= chargeUse;
Talent.onArtifactUsed(hero);
updateQuickslot(); updateQuickslot();
} }
@ -225,6 +227,7 @@ public class EtherealChains extends Artifact {
return; return;
} else { } else {
charge -= chargeUse; charge -= chargeUse;
Talent.onArtifactUsed(hero);
updateQuickslot(); updateQuickslot();
} }

View File

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

View File

@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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.items.rings.RingOfEnergy;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
@ -114,6 +115,7 @@ public class MasterThievesArmband extends Artifact {
exp += value; exp += value;
} }
} }
Talent.onArtifactUsed(Dungeon.hero);
while(exp >= (250 + 50*level()) && level() < levelCap) { while(exp >= (250 + 50*level()) && level() < levelCap) {
exp -= (250 + 50*level()); exp -= (250 + 50*level());
upgrade(); 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.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.EarthParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; 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); CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8);
Camera.main.shake(1, 0.4f); Camera.main.shake(1, 0.4f);
charge = 0; charge = 0;
Talent.onArtifactUsed(Dungeon.hero);
updateQuickslot(); 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.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.CheckedCell; import com.shatteredpixel.shatteredpixeldungeon.effects.CheckedCell;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -205,6 +206,7 @@ public class TalismanOfForesight extends Artifact {
partialCharge ++; partialCharge ++;
charge --; charge --;
} }
Talent.onArtifactUsed(Dungeon.hero);
updateQuickslot(); updateQuickslot();
Dungeon.observe(); Dungeon.observe();
Dungeon.hero.checkVisibleMobs(); 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.Hunger;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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.Mob;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
@ -100,6 +101,7 @@ public class TimekeepersHourglass extends Artifact {
Sample.INSTANCE.play(Assets.Sounds.TELEPORT); Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
activeBuff = new timeStasis(); activeBuff = new timeStasis();
Talent.onArtifactUsed(Dungeon.hero);
activeBuff.attachTo(Dungeon.hero); activeBuff.attachTo(Dungeon.hero);
} else if (index == 1) { } else if (index == 1) {
GLog.i( Messages.get(TimekeepersHourglass.class, "onfreeze") ); GLog.i( Messages.get(TimekeepersHourglass.class, "onfreeze") );
@ -107,6 +109,7 @@ public class TimekeepersHourglass extends Artifact {
Sample.INSTANCE.play(Assets.Sounds.TELEPORT); Sample.INSTANCE.play(Assets.Sounds.TELEPORT);
activeBuff = new timeFreeze(); activeBuff = new timeFreeze();
Talent.onArtifactUsed(Dungeon.hero);
activeBuff.attachTo(Dungeon.hero); activeBuff.attachTo(Dungeon.hero);
((timeFreeze)activeBuff).processTime(0f); ((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.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -151,8 +152,10 @@ public class UnstableSpellbook extends Artifact {
Scroll scroll = Reflection.newInstance(ExoticScroll.regToExo.get(fScroll.getClass())); Scroll scroll = Reflection.newInstance(ExoticScroll.regToExo.get(fScroll.getClass()));
charge--; charge--;
scroll.doRead(); scroll.doRead();
Talent.onArtifactUsed(Dungeon.hero);
} else { } else {
fScroll.doRead(); fScroll.doRead();
Talent.onArtifactUsed(Dungeon.hero);
} }
} }
@ -163,6 +166,7 @@ public class UnstableSpellbook extends Artifact {
}); });
} else { } else {
scroll.doRead(); scroll.doRead();
Talent.onArtifactUsed(Dungeon.hero);
} }
updateQuickslot(); 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){ public static int getBonus(Char target, Class<?extends RingBuff> type){
int bonus = 0; int bonus = 0;
for (RingBuff buff : target.buffs(type)) { for (RingBuff buff : target.buffs(type)) {