v0.9.0: implemented two more talents for the warrior

This commit is contained in:
Evan Debenham 2020-09-15 18:21:32 -04:00
parent 8aeeacb10e
commit 7e1101635b
30 changed files with 51 additions and 42 deletions

View File

@ -300,10 +300,10 @@ actors.hero.talent.hearty_meal.title=hearty meal
actors.hero.talent.hearty_meal.desc=_+1:_ Eating at below 50% health heals the Warrior for _4 HP_.\n\n_+2:_ Eating at below 50% health heals the Warrior for _6 HP_.
actors.hero.talent.armsmasters_intuition.title=armsmaster's intuition
actors.hero.talent.armsmasters_intuition.desc=_+1:_ The Warrior identifies weapons and armor _2x faster_.\n\n_+2:_ The Warrior identifies weapons and armor _when he equips them_.
actors.hero.talent.test_warrior_3.title=test talent
actors.hero.talent.test_warrior_3.desc=_+1:_ Whenever he identifies a potion, the warrior heals for _3 HP_.\n\n_+2:_ Whenever he identifies a potion, the warrior heals for _5 HP_.
actors.hero.talent.test_warrior_4.title=iron will
actors.hero.talent.test_warrior_4.desc=_+1:_ The max shield provided by the warrior's seal is _increased by 1_.\n\n_+2:_ The max shield provided by the warrior's seal is _increased by 2_.
actors.hero.talent.test_subject.title=test subject
actors.hero.talent.test_subject.desc=_+1:_ Whenever he identifies a potion by using it, the warrior heals for _3 HP_.\n\n_+2:_ Whenever he identifies a potion by using it, the warrior heals for _5 HP_.
actors.hero.talent.iron_will.title=iron will
actors.hero.talent.iron_will.desc=_+1:_ The max shield provided by the warrior's seal is _increased by 1_.\n\n_+2:_ The max shield provided by the warrior's seal is _increased by 2_.
actors.hero.talent.energizing_meal.title=energizing meal
actors.hero.talent.energizing_meal.desc=_+1:_ Eating at below 50% health grants the Mage _4 turns of wand recharging_.\n\n_+2:_ Eating at below 50% health grants the Mage _6 turns of wand recharging_.
actors.hero.talent.scholars_intuition.title=scholar's intuition

View File

@ -45,8 +45,8 @@ public enum Talent {
HEARTY_MEAL(0),
ARMSMASTERS_INTUITION(1),
TEST_WARRIOR_3(2),
TEST_WARRIOR_4(3),
TEST_SUBJECT(2),
IRON_WILL(3),
ENERGIZING_MEAL(16),
SCHOLARS_INTUITION(17),
@ -179,7 +179,7 @@ public enum Talent {
//tier 1
switch (hero.heroClass){
case WARRIOR: default:
Collections.addAll(tierTalents, HEARTY_MEAL, ARMSMASTERS_INTUITION, TEST_WARRIOR_3, TEST_WARRIOR_4);
Collections.addAll(tierTalents, HEARTY_MEAL, ARMSMASTERS_INTUITION, TEST_SUBJECT, IRON_WILL);
break;
case MAGE:
Collections.addAll(tierTalents, ENERGIZING_MEAL, SCHOLARS_INTUITION, TEST_MAGE_3, TEST_MAGE_4);

View File

@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
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.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
@ -135,7 +136,7 @@ public class BrokenSeal extends Item {
public synchronized int maxShield() {
if (armor != null && armor.isEquipped((Hero)target)) {
return 1 + armor.tier + armor.level();
return armor.tier + armor.level() + ((Hero) target).pointsInTalent(Talent.IRON_WILL);
} else {
return 0;
}

View File

@ -33,6 +33,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Ooze;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
@ -67,8 +69,8 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
@ -367,7 +369,15 @@ public class Potion extends Item {
@Override
public Item identify() {
setKnown();
if (!isKnown()) {
setKnown();
//3/5 HP healed
Hero hero = Dungeon.hero;
if (hero.hasTalent(Talent.TEST_SUBJECT)) {
hero.HP = Math.min(hero.HP + 1 + (2 * hero.pointsInTalent(Talent.TEST_SUBJECT)), hero.HT);
hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), hero.pointsInTalent(Talent.TEST_SUBJECT));
}
}
return super.identify();
}

View File

@ -34,7 +34,7 @@ public class PotionOfExperience extends Potion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
hero.earnExp( hero.maxExp(), getClass() );
}

View File

@ -40,7 +40,7 @@ public class PotionOfFrost extends Potion {
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );

View File

@ -36,7 +36,7 @@ public class PotionOfHaste extends Potion {
@Override
public void apply(Hero hero) {
setKnown();
identify();
GLog.w( Messages.get(this, "energetic") );
Buff.prolong( hero, Haste.class, Haste.DURATION);

View File

@ -50,7 +50,7 @@ public class PotionOfHealing extends Potion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
cure( hero );
heal( hero );
}

View File

@ -38,7 +38,7 @@ public class PotionOfInvisibility extends Potion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
Buff.affect( hero, Invisibility.class, Invisibility.DURATION );
GLog.i( Messages.get(this, "invisible") );
Sample.INSTANCE.play( Assets.Sounds.MELD );

View File

@ -44,7 +44,7 @@ public class PotionOfLevitation extends Potion {
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
@ -56,7 +56,7 @@ public class PotionOfLevitation extends Potion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
Buff.affect( hero, Levitation.class, Levitation.DURATION );
GLog.i( Messages.get(this, "float") );
}

View File

@ -40,7 +40,7 @@ public class PotionOfLiquidFlame extends Potion {
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );

View File

@ -37,7 +37,7 @@ public class PotionOfMindVision extends Potion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
Buff.affect( hero, MindVision.class, MindVision.DURATION );
Dungeon.observe();

View File

@ -39,7 +39,7 @@ public class PotionOfParalyticGas extends Potion {
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );

View File

@ -91,7 +91,7 @@ public class PotionOfPurity extends Potion {
splash(cell);
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
setKnown();
identify();
GLog.i(Messages.get(this, "freshness"));
}
@ -101,7 +101,7 @@ public class PotionOfPurity extends Potion {
public void apply( Hero hero ) {
GLog.w( Messages.get(this, "protected") );
Buff.prolong( hero, BlobImmunity.class, BlobImmunity.DURATION );
setKnown();
identify();
}
@Override

View File

@ -38,7 +38,7 @@ public class PotionOfStrength extends Potion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
hero.STR++;
hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "msg_1") );

View File

@ -39,7 +39,7 @@ public class PotionOfToxicGas extends Potion {
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );

View File

@ -41,8 +41,6 @@ public class InfernalBrew extends Brew {
public void shatter(int cell) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
Sample.INSTANCE.play( Assets.Sounds.GAS );

View File

@ -45,7 +45,7 @@ public class ElixirOfMight extends Elixir {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
hero.STR++;

View File

@ -36,7 +36,7 @@ public class PotionOfAdrenalineSurge extends ExoticPotion {
@Override
public void apply(Hero hero) {
setKnown();
identify();
Buff.affect(hero, AdrenalineSurge.class).reset(2, 800f);
}

View File

@ -40,7 +40,7 @@ public class PotionOfCleansing extends ExoticPotion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
cleanse( hero );
}
@ -53,7 +53,7 @@ public class PotionOfCleansing extends ExoticPotion {
if (Dungeon.level.heroFOV[cell]) {
Sample.INSTANCE.play(Assets.Sounds.SHATTER);
splash(cell);
setKnown();
identify();
}
if (Actor.findChar(cell) != null){

View File

@ -39,7 +39,7 @@ public class PotionOfCorrosiveGas extends ExoticPotion {
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );

View File

@ -66,10 +66,10 @@ public class PotionOfDragonsBreath extends ExoticPotion {
public void onSelect(final Integer cell) {
if (cell == null && !isKnown()){
setKnown();
identify();
detach(curUser.belongings.backpack);
} else if (cell != null) {
setKnown();
identify();
Sample.INSTANCE.play( Assets.Sounds.DRINK );
curUser.sprite.operate(curUser.pos, new Callback() {
@Override

View File

@ -34,7 +34,7 @@ public class PotionOfEarthenArmor extends ExoticPotion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
Buff.affect(hero, Barkskin.class).set( 2 + hero.lvl/3, 50 );
}

View File

@ -34,7 +34,7 @@ public class PotionOfHolyFuror extends ExoticPotion {
@Override
public void apply( Hero hero ) {
setKnown();
identify();
Buff.prolong(hero, Bless.class, Bless.DURATION*4f);
}

View File

@ -35,7 +35,7 @@ public class PotionOfMagicalSight extends ExoticPotion {
@Override
public void apply(Hero hero) {
setKnown();
identify();
Buff.affect(hero, MagicalSight.class, MagicalSight.DURATION);
Dungeon.observe();

View File

@ -37,7 +37,7 @@ public class PotionOfShielding extends ExoticPotion {
@Override
public void apply(Hero hero) {
setKnown();
identify();
if (Dungeon.isChallenged(Challenges.NO_HEALING)){
PotionOfHealing.pharmacophobiaProc(hero);

View File

@ -39,7 +39,7 @@ public class PotionOfShroudingFog extends ExoticPotion {
public void shatter( int cell ) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );

View File

@ -43,7 +43,7 @@ public class PotionOfSnapFreeze extends ExoticPotion {
public void shatter(int cell) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );

View File

@ -34,7 +34,7 @@ public class PotionOfStamina extends ExoticPotion {
@Override
public void apply(Hero hero) {
setKnown();
identify();
Buff.affect(hero, Stamina.class, Stamina.DURATION);
}

View File

@ -39,7 +39,7 @@ public class PotionOfStormClouds extends ExoticPotion {
public void shatter(int cell) {
if (Dungeon.level.heroFOV[cell]) {
setKnown();
identify();
splash( cell );
Sample.INSTANCE.play( Assets.Sounds.SHATTER );