v0.9.1: implemented a T2 on-eat talent for each hero

This commit is contained in:
Evan Debenham 2020-11-20 22:33:55 -05:00
parent 494a586b5c
commit e2595b1730
9 changed files with 60 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -324,6 +324,8 @@ actors.hero.talent.test_subject.title=test subject
actors.hero.talent.test_subject.desc=_+1:_ Whenever the Warrior identifies an item, he heals for _2 HP_.\n\n_+2:_ Whenever the Warrior identifies an item, he heals for _3 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.iron_stomach.title=iron stomach
actors.hero.talent.iron_stomach.desc=_+1:_ Eating food takes the Warrior 1 turn and grants him _75% damage resistance_ while eating.\n\n_+1:_ Eating food takes the Warrior 1 turn and grants him _100% damage resistance_ while eating.
actors.hero.talent.empowering_meal.title=empowering meal
actors.hero.talent.empowering_meal.desc=_+1:_ Eating food grants the Mage _2 bonus damage_ on his next 3 wand zaps.\n\n_+1:_ Eating food grants the Mage _3 bonus damage_ on his next 3 wand zaps.
@ -334,7 +336,7 @@ actors.hero.talent.tested_hypothesis.desc=_+1:_ Whenever the Mage identifies an
actors.hero.talent.backup_barrier.title=backup barrier
actors.hero.talent.backup_barrier.desc=_+1:_ The Mage gains _3 shielding_ whenever he spends the last charge in his staff.\n\n_+2:_ The Mage gains _5 shielding_ whenever he spends the last charge in his staff.
actors.hero.talent.energizing_meal.title=energizing meal
actors.hero.talent.energizing_meal.desc=_+1:_ Eating food grants the Mage _5 turns of wand recharging_.\n\n_+2:_ Eating food grants the Mage _8 turns of wand recharging_.
actors.hero.talent.energizing_meal.desc=_+1:_ Eating food takes the Mage 1 turn and grants him _5 turns of wand recharging_.\n\n_+1:_ Eating food takes the Mage 1 turn and grants him _8 turns of wand recharging_.
actors.hero.talent.energizing_upgrade.title=energizing upgrade
actors.hero.talent.energizing_upgrade.desc=_+1:_ The Mage's staff recharges for _1 extra charge_ whenever the Mage upgrades it.\n\n_+2:_ The Mage's staff recharges for _2 extra charges_ whenever the Mage upgrades it.
@ -346,6 +348,8 @@ actors.hero.talent.sucker_punch.title=sucker punch
actors.hero.talent.sucker_punch.desc=_+1:_ The Rogue deals _1-2 bonus damage_ the first time he surprise attacks an enemy.\n\n_+2:_ The Rogue deals _2 bonus damage_ the first time he surprise attacks an enemy.
actors.hero.talent.protective_shadows.title=protective shadows
actors.hero.talent.protective_shadows.desc=_+1:_ The Rogue gains one shielding _every other turn_ his cloak is activated, _to a max of 3_.\n\n_+2:_ The Rogue gains one shielding _every turn_ his cloak is activated, _to a max of 5_.
actors.hero.talent.mystical_meal.title=mystical meal
actors.hero.talent.mystical_meal.desc=_+1:_ Eating food takes the Rogue 1 turn and grants him _3 turns of artifact recharging_.\n\n_+2:_ Eating food takes the rogue 1 turn and grants him _5 turns of artifact recharging_.\n\nThis talent cannot be used to let the horn of plenty recharge itself.
actors.hero.talent.natures_bounty.title=nature's bounty
actors.hero.talent.natures_bounty.desc=_+1:_ The Huntress can find _4 berries_ hidden in tall grass as she explores the earlier stages of the dungeon.\n\n_+2:_ The Huntress can find _6 berries_ hidden in tall grass as she explores the earlier stages of the dungeon.
@ -356,7 +360,7 @@ actors.hero.talent.followup_strike.desc=_+1:_ When the Huntress hits an enemy wi
actors.hero.talent.natures_aid.title=nature's aid
actors.hero.talent.natures_aid.desc=_+1:_ The Huntress gains 2 armor of barkskin for _4 turns_ when a plant is trampled in her vision.\n\n_+2:_ The Huntress gains 2 armor of barkskin for _6 turns_ when a plant is trampled in her vision.
actors.hero.talent.invigorating_meal.title=invigorating meal
actors.hero.talent.invigorating_meal.desc=_+1:_ Eating food takes 1 turn and grants the Huntress _1 turn of haste_.\n\n_+2:_ Eating food takes 1 turn and grants the Huntress _2 turns of haste_.
actors.hero.talent.invigorating_meal.desc=_+1:_ Eating food takes the Huntress 1 turn (berries are eaten instantly) and grants her _2 turns of haste_.\n\n_+1:_ Eating food takes the Huntress 1 turn (berries are eaten instantly) and grants her _3 turns of haste_.
actors.hero.hero.name=you
actors.hero.hero.leave=You can't leave yet, the rest of the dungeon awaits below!

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.watabou.noosa.Image;
@ -38,6 +39,7 @@ public class ArtifactRecharge extends Buff {
}
private int left;
public boolean ignoreHornOfPlenty;
@Override
public boolean act() {
@ -46,10 +48,14 @@ public class ArtifactRecharge extends Buff {
Belongings b = ((Hero) target).belongings;
if (b.artifact instanceof Artifact){
((Artifact)b.artifact).charge((Hero)target);
if (!(b.artifact instanceof HornOfPlenty) || !ignoreHornOfPlenty) {
((Artifact) b.artifact).charge((Hero) target);
}
}
if (b.misc instanceof Artifact){
((Artifact)b.misc).charge((Hero)target);
if (!(b.misc instanceof HornOfPlenty) || !ignoreHornOfPlenty) {
((Artifact) b.misc).charge((Hero) target);
}
}
}
@ -63,12 +69,14 @@ public class ArtifactRecharge extends Buff {
return true;
}
public void set( int amount ){
public ArtifactRecharge set( int amount ){
left = amount;
return this;
}
public void prolong( int amount ){
public ArtifactRecharge prolong( int amount ){
left += amount;
return this;
}
@Override
@ -97,16 +105,19 @@ public class ArtifactRecharge extends Buff {
}
private static final String LEFT = "left";
private static final String IGNORE_HORN = "ignore_horn";
@Override
public void storeInBundle(Bundle bundle) {
super.storeInBundle(bundle);
bundle.put( LEFT, left );
bundle.put( IGNORE_HORN, ignoreHornOfPlenty );
}
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
left = bundle.getInt(LEFT);
ignoreHornOfPlenty = bundle.getBoolean(IGNORE_HORN);
}
}

View File

@ -1137,6 +1137,11 @@ public class Hero extends Char {
dmg -= AntiMagic.drRoll(belongings.armor.buffedLvl());
}
if (buff(Talent.WarriorFoodImmunity.class) != null){
if (pointsInTalent(Talent.IRON_STOMACH) == 1) dmg = Math.round(dmg*0.25f);
else if (pointsInTalent(Talent.IRON_STOMACH) == 2) dmg = Math.round(dmg*0.00f);
}
int preHP = HP + shielding();
super.damage( dmg, src );
int postHP = HP + shielding();

View File

@ -24,8 +24,10 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.hero;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ArtifactRecharge;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.CounterBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WandEmpower;
@ -33,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
@ -55,7 +58,7 @@ public enum Talent {
ARMSMASTERS_INTUITION(1),
TEST_SUBJECT(2),
IRON_WILL(3),
TEST_WARRIOR_T2_1(4),
IRON_STOMACH(4),
TEST_WARRIOR_T2_2(5),
TEST_WARRIOR_T2_3(6),
TEST_WARRIOR_T2_4(7),
@ -75,7 +78,7 @@ public enum Talent {
THIEFS_INTUITION(33),
SUCKER_PUNCH(34),
PROTECTIVE_SHADOWS(35),
TEST_ROGUE_T2_1(36),
MYSTICAL_MEAL(36),
TEST_ROGUE_T2_2(37),
TEST_ROGUE_T2_3(38),
TEST_ROGUE_T2_4(39),
@ -144,7 +147,7 @@ public enum Talent {
public static class CachedRationsDropped extends CounterBuff{};
public static class NatureBerriesAvailable extends CounterBuff{};
public static void onFoodEaten( Hero hero, float foodVal ){
public static void onFoodEaten( Hero hero, float foodVal, Item foodSource ){
if (hero.hasTalent(HEARTY_MEAL)){
//3/5 HP healed, when hero is below 25% health
if (hero.HP <= hero.HT/4) {
@ -156,6 +159,9 @@ public enum Talent {
hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1+hero.pointsInTalent(HEARTY_MEAL));
}
}
if (hero.hasTalent(IRON_STOMACH)){
Buff.affect(hero, WarriorFoodImmunity.class, 1f);
}
if (hero.hasTalent(EMPOWERING_MEAL)){
//2/3 bonus wand damage for next 3 zaps
Buff.affect( hero, WandEmpower.class).set(1 + hero.pointsInTalent(EMPOWERING_MEAL), 3);
@ -166,12 +172,19 @@ public enum Talent {
Buff.affect( hero, Recharging.class, 2 + 3*(hero.pointsInTalent(ENERGIZING_MEAL)) );
ScrollOfRecharging.charge( hero );
}
if (hero.hasTalent(MYSTICAL_MEAL)){
//3/5 turns of recharging
Buff.affect( hero, ArtifactRecharge.class).set(1 + 2*(hero.pointsInTalent(MYSTICAL_MEAL))).ignoreHornOfPlenty = foodSource instanceof HornOfPlenty;
ScrollOfRecharging.charge( hero );
}
if (hero.hasTalent(INVIGORATING_MEAL)){
//effectively 1/2 turns of haste
Buff.affect( hero, Haste.class, 0.67f+hero.pointsInTalent(INVIGORATING_MEAL));
}
}
public static class WarriorFoodImmunity extends FlavourBuff{};
public static float itemIDSpeedFactor( Hero hero, Item item ){
// 1.75x/2.5x speed with huntress talent
float factor = 1f + hero.pointsInTalent(SURVIVALISTS_INTUITION)*0.75f;
@ -287,13 +300,13 @@ public enum Talent {
//tier 2+
switch (cls){
case WARRIOR: default:
Collections.addAll(tierTalents, TEST_WARRIOR_T2_1, TEST_WARRIOR_T2_2, TEST_WARRIOR_T2_3, TEST_WARRIOR_T2_4, TEST_WARRIOR_T2_5);
Collections.addAll(tierTalents, IRON_STOMACH, TEST_WARRIOR_T2_2, TEST_WARRIOR_T2_3, TEST_WARRIOR_T2_4, TEST_WARRIOR_T2_5);
break;
case MAGE:
Collections.addAll(tierTalents, ENERGIZING_MEAL, ENERGIZING_UPGRADE, TEST_MAGE_T2_3, TEST_MAGE_T2_4, TEST_MAGE_T2_5);
break;
case ROGUE:
Collections.addAll(tierTalents, TEST_ROGUE_T2_1, TEST_ROGUE_T2_2, TEST_ROGUE_T2_3, TEST_ROGUE_T2_4, TEST_ROGUE_T2_5);
Collections.addAll(tierTalents, MYSTICAL_MEAL, TEST_ROGUE_T2_2, TEST_ROGUE_T2_3, TEST_ROGUE_T2_4, TEST_ROGUE_T2_5);
break;
case HUNTRESS:
Collections.addAll(tierTalents, INVIGORATING_MEAL, TEST_HUNTRESS_T2_2, TEST_HUNTRESS_T2_3, TEST_HUNTRESS_T2_4, TEST_HUNTRESS_T2_5);

View File

@ -98,7 +98,7 @@ public class HornOfPlenty extends Artifact {
if (chargesToUse > charge) chargesToUse = charge;
hunger.satisfy(satietyPerCharge * chargesToUse);
Talent.onFoodEaten(hero, satietyPerCharge * chargesToUse);
Talent.onFoodEaten(hero, satietyPerCharge * chargesToUse, this);
Statistics.foodEaten++;
@ -110,7 +110,14 @@ public class HornOfPlenty extends Artifact {
Sample.INSTANCE.play(Assets.Sounds.EAT);
GLog.i( Messages.get(this, "eat") );
hero.spend(Food.TIME_TO_EAT);
if (Dungeon.hero.hasTalent(Talent.IRON_STOMACH)
|| Dungeon.hero.hasTalent(Talent.ENERGIZING_MEAL)
|| Dungeon.hero.hasTalent(Talent.MYSTICAL_MEAL)
|| Dungeon.hero.hasTalent(Talent.INVIGORATING_MEAL)){
hero.spend(Food.TIME_TO_EAT - 2);
} else {
hero.spend(Food.TIME_TO_EAT);
}
Badges.validateFoodEaten();

View File

@ -74,7 +74,7 @@ public class Food extends Item {
satisfy(hero);
GLog.i( message );
Talent.onFoodEaten(hero, energy);
Talent.onFoodEaten(hero, energy, this);
hero.sprite.operate( hero.pos );
hero.busy();
@ -90,7 +90,10 @@ public class Food extends Item {
}
protected float eatingTime(){
if (Dungeon.hero.hasTalent(Talent.INVIGORATING_MEAL)){
if (Dungeon.hero.hasTalent(Talent.IRON_STOMACH)
|| Dungeon.hero.hasTalent(Talent.ENERGIZING_MEAL)
|| Dungeon.hero.hasTalent(Talent.MYSTICAL_MEAL)
|| Dungeon.hero.hasTalent(Talent.INVIGORATING_MEAL)){
return TIME_TO_EAT - 2;
} else {
return TIME_TO_EAT;

View File

@ -39,7 +39,7 @@ public class ScrollOfMysticalEnergy extends ExoticScroll {
public void doRead() {
//append buff
Buff.affect(curUser, ArtifactRecharge.class).set( 30 );
Buff.affect(curUser, ArtifactRecharge.class).set( 30 ).ignoreHornOfPlenty = false;
Sample.INSTANCE.play( Assets.Sounds.READ );
Sample.INSTANCE.play( Assets.Sounds.CHARGEUP );

View File

@ -64,7 +64,7 @@ public class WildEnergy extends TargetedSpell {
}
Buff.affect(hero, Recharging.class, 8f);
Buff.affect(hero, ArtifactRecharge.class).prolong( 8 );
Buff.affect(hero, ArtifactRecharge.class).prolong( 8 ).ignoreHornOfPlenty = false;
detach( curUser.belongings.backpack );
updateQuickslot();