From c28d53e803250ed07376ceb7a406c60f6c765de4 Mon Sep 17 00:00:00 2001 From: mason369 Date: Sun, 18 Sep 2022 23:24:56 +0800 Subject: [PATCH] update new Function --- .../assets/messages/items/items.properties | 22 ++++++- .../items/food/FrozenCarpaccio.java | 22 +++++++ .../items/food/MeatPie.java | 19 ++++++ .../items/food/SmallRation.java | 36 ++++++++++- .../items/food/StewedMeat.java | 25 +++++++- .../items/potions/PotionOfExperience.java | 22 ++++++- .../items/potions/PotionOfHaste.java | 21 ++++++- .../items/potions/PotionOfInvisibility.java | 30 ++++++++- .../items/potions/PotionOfMindVision.java | 62 +++++++++++++------ .../items/potions/PotionOfStrength.java | 27 ++++++-- .../windows/WndChallenges.java | 2 +- 11 files changed, 249 insertions(+), 39 deletions(-) diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index e2261ac4d..864c58610 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -841,10 +841,15 @@ items.food.frozencarpaccio.hard=你感到皮肤变硬了! items.food.frozencarpaccio.refresh=神清气爽! items.food.frozencarpaccio.better=你感觉好多了! items.food.frozencarpaccio.desc=这是份速冻生肉,只能切成薄片取食,而且意外的好吃。 +items.food.frozencarpaccio.descx=这是份速冻生肉,蕴含着神奇力量,而且意外的好吃。 + items.food.meatpie.name=全肉大饼 items.food.meatpie.eat_msg=这食物味道真棒! +items.food.meatpie.eat_msg_1=+1力量 +items.food.meatpie.eat_msg_2=新生的力量在你的体内喷薄而出。 items.food.meatpie.desc=一份填满了美味肉馅的诱人大饼。吃下它后你会获得远高于其他食物的饱足感。 +items.food.meatpie.descx=一份填满了美味肉馅的诱人大饼。貌似蕴含着强大的力量,吃下它后你会获得远高于其他食物的饱足感。 items.food.mysterymeat.name=神秘的肉 items.food.mysterymeat.eat_msg=这玩意儿吃起来很……奇怪。 @@ -865,10 +870,12 @@ items.food.pasty.cane_desc=甜度爆表的巨型拐杖糖!大到够你一次 items.food.smallration.name=小包口粮 items.food.smallration.eat_msg=吃起来还行。 items.food.smallration.desc=它看起来和普通口粮一样,就是小了点。 +items.food.smallration.descx=它看起来和普通口粮不一样,就是大了点。 items.food.stewedmeat.name=炖肉 items.food.stewedmeat.eat_msg=吃起来还行。 items.food.stewedmeat.desc=烹煮的过程中杀死了肉上面可能携带的任何病菌或是寄生虫。现在应该可以安全的食用它了。 +items.food.stewedmeat.descx=烹煮的过程中杀死了肉上面可能携带的任何病菌或是寄生虫,营养丰富,使你信心倍增。现在应该可以安全的食用它了。 @@ -935,20 +942,24 @@ items.potions.alchemicalcatalyst.desc=这个细长的小瓶中盛有由提取的 items.potions.potionofexperience.name=经验药剂 items.potions.potionofexperience.desc=众多战斗积累而来的经验被浓缩为液态,这种药剂能够瞬间提升你的等级。 +items.potions.potionofexperience.descx=众多战斗积累而来的戾气被浓缩为液态,这种药剂会短时间吸取你的精力。 items.potions.potionoffrost.name=冰霜药剂 items.potions.potionoffrost.desc=一旦暴露在空气里,这种化学药剂会挥发成为一片冰冷的气雾。 items.potions.potionofhaste.name=极速药剂 items.potions.potionofhaste.energetic=你感觉充满了活力! +items.potions.potionofhaste.energeticx=你感觉活力都被吸走了! items.potions.potionofhaste.desc=喝下这甜到掉牙的奇怪液体后,体内会爆发一股巨大的能量,让你可以短时间内飞速奔跑。 - +items.potions.potionofhaste.descx=喝下这苦到掉牙的奇怪液体后,体内会爆发一股巨大的能量,让你在短时间内残废。 items.potions.potionofhealing.name=治疗药剂 items.potions.potionofhealing.heal=你的伤口开始愈合。 items.potions.potionofhealing.desc=一支让你快速回满生命值并清除毒素的万能药剂。 items.potions.potionofinvisibility.name=隐形药剂 items.potions.potionofinvisibility.invisible=你看到你的手隐形了! +items.potions.potionofinvisibility.notinvisible=你无法隐形了! +items.potions.potionofinvisibility.descx=饮用这种药剂会使你无法隐形。饮用后立刻怒吼,敌人将被怒吼吸引。 items.potions.potionofinvisibility.desc=饮用这种药剂会使你暂时隐形。隐身期间,敌人将无法看见你。攻击敌人,或在敌人面前使用法杖和卷轴,会让药剂效果立即消失。 items.potions.potionoflevitation.name=浮空药剂 @@ -962,6 +973,9 @@ items.potions.potionofmindvision.name=灵视药剂 items.potions.potionofmindvision.see_mobs=你可以感受到其他生物的存在! items.potions.potionofmindvision.see_none=你能判定现在本层内就只有你一个人。 items.potions.potionofmindvision.desc=喝下这个,你的心智将与大范围内的生物精神同调,让你能感受到围墙背后的生体所在。该药剂还能够让你的视野无视身边门墙的阻挡。 +items.potions.potionofmindvision.can't_see_mobs=你感受不到其他生物的存在! +items.potions.potionofmindvision.can't_see_none=你无法判定现在本层内有谁。 +items.potions.potionofmindvision.descx=喝下这个,你的心智将与大范围内的生物精神相悖,让你能无法感受到围墙背后的生体所在。 items.potions.potionofparalyticgas.name=麻痹药剂 items.potions.potionofparalyticgas.desc=暴露于空气时,烧瓶里的液体会气化成一片令人失去知觉的黄色云雾。任何吸入气雾的生物都可能立即麻痹,直到云雾消散后一段时间才能行动。可以把该物件扔到远处的敌群中,让气体覆盖影响它们。 @@ -974,8 +988,12 @@ items.potions.potionofpurity.desc=这种魔法试剂能迅速中和掉大范围 items.potions.potionofstrength.name=力量药剂 items.potions.potionofstrength.msg_1=+1力量 items.potions.potionofstrength.msg_2=新生的力量在你的体内喷薄而出。 -items.potions.potionofstrength.desc=这种强力的液体会洗刷你的肌肉,永久性增加1点力量值。 +items.potions.potionofstrength.esg_1=-1力量 +items.potions.potionofstrength.esg_2=因为药水癔症的影响,你反而更加虚弱了…… + +items.potions.potionofstrength.desc=这种强力的液体会洗刷你的肌肉,永久性增加1点力量值。 +items.potions.potionofstrength.descx=这种强力的液体会洗刷你的肌肉,永久性减少1点力量值。 items.potions.potionoftoxicgas.name=毒气药剂 items.potions.potionoftoxicgas.desc=打开或摔碎这个密封的药瓶将导致内容物爆发成一团剧毒的绿色烟雾。你应该选择从远处将这瓶药剂扔向敌人,而不是手动开封。 diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/FrozenCarpaccio.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/FrozenCarpaccio.java index 894ae6df5..26b5eddb6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/FrozenCarpaccio.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/FrozenCarpaccio.java @@ -21,11 +21,18 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barkskin; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -42,7 +49,17 @@ public class FrozenCarpaccio extends Food { @Override protected void satisfy(Hero hero) { + if (Dungeon.isChallenged(Challenges.EXSG)) { + if (Dungeon.isChallenged(Challenges.NO_HEALING)){ + PotionOfHealing.pharmacophobiaProc(hero); + } else { + //~75% of a potion of healing + Buff.affect(hero, Barrier.class).setShield((int) (0.6f * hero.HT + 10)); + Talent.onHealingPotionUsed( hero ); + } + } super.satisfy(hero); + effect(hero); } @@ -79,4 +96,9 @@ public class FrozenCarpaccio extends Food { result.quantity = ingredient.quantity(); return result; } + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MeatPie.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MeatPie.java index 7bee86197..178ba1ed2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MeatPie.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/MeatPie.java @@ -21,12 +21,20 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WellFed; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import java.util.ArrayList; @@ -39,6 +47,12 @@ public class MeatPie extends Food { @Override protected void satisfy(Hero hero) { + if (Dungeon.isChallenged(Challenges.EXSG)){ + Buff.prolong( hero, Haste.class, 8f); + hero.STR++; + hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "eat_msg_1")); + GLog.p(Messages.get(this, "eat_msg_2")); + } super.satisfy( hero ); Buff.affect(hero, WellFed.class).reset(); } @@ -95,4 +109,9 @@ public class MeatPie extends Food { return new MeatPie(); } } + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/SmallRation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/SmallRation.java index b68a0f91d..4d35f6a6e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/SmallRation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/SmallRation.java @@ -21,18 +21,52 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Badges; +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.Statistics; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; +import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.watabou.noosa.audio.Sample; public class SmallRation extends Food { + + @Override + protected void satisfy( Hero hero ){ + if (Dungeon.isChallenged(Challenges.EXSG)){ + Buff.prolong( hero, Haste.class, 8f); + } + + if (Dungeon.isChallenged(Challenges.NO_FOOD)){ + Buff.affect(hero, Hunger.class).satisfy(energy/3f); + } else { + Buff.affect(hero, Hunger.class).satisfy(energy); + } + } + { image = ItemSpriteSheet.OVERPRICED; energy = Hunger.HUNGRY/2f; } - + @Override public int value() { return 10 * quantity; } + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/StewedMeat.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/StewedMeat.java index 1fb757b57..e455c9b98 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/StewedMeat.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/StewedMeat.java @@ -21,17 +21,32 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Recipe; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class StewedMeat extends Food { - + + + @Override + protected void satisfy( Hero hero ) { + if (Dungeon.isChallenged(Challenges.EXSG)) { + hero.earnExp( hero.maxExp(), getClass() ); + } + } { image = ItemSpriteSheet.STEWED; energy = Hunger.HUNGRY/2f; } - + @Override public int value() { return 8 * quantity; @@ -75,5 +90,9 @@ public class StewedMeat extends Food { outQuantity = 3; } } - + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java index e74b539a6..7356ba80d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java @@ -21,8 +21,17 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfExperience extends Potion { @@ -35,7 +44,12 @@ public class PotionOfExperience extends Potion { @Override public void apply( Hero hero ) { identify(); - hero.earnExp( hero.maxExp(), getClass() ); + if (Dungeon.isChallenged(EXSG)) { + Buff.affect(hero, Bleeding.class).set(6f); + }else{ + hero.earnExp( hero.maxExp(), getClass() ); + } + } @Override @@ -47,4 +61,10 @@ public class PotionOfExperience extends Potion { public int energyVal() { return isKnown() ? 8 * quantity : super.energyVal(); } + + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(Challenges.EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java index c71b4d132..6a7ee319a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHaste.java @@ -21,7 +21,12 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -37,13 +42,23 @@ public class PotionOfHaste extends Potion { @Override public void apply(Hero hero) { identify(); - - GLog.w( Messages.get(this, "energetic") ); - Buff.prolong( hero, Haste.class, Haste.DURATION); + if(Dungeon.isChallenged(EXSG)){ + GLog.w( Messages.get(this, "energeticx") ); + Cripple.prolong(hero, Cripple.class, 8f); + } + else{ + GLog.w( Messages.get(this, "energetic") ); + Buff.prolong( hero, Haste.class, Haste.DURATION); + } } @Override public int value() { return isKnown() ? 40 * quantity : super.value(); } + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(Challenges.EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java index b8cf4ba26..aa1e8ec39 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java @@ -21,10 +21,17 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; +import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -39,14 +46,31 @@ public class PotionOfInvisibility extends Potion { @Override public void apply( Hero hero ) { identify(); - Buff.affect( hero, Invisibility.class, Invisibility.DURATION ); - GLog.i( Messages.get(this, "invisible") ); - Sample.INSTANCE.play( Assets.Sounds.MELD ); + if(Dungeon.isChallenged(EXSG)){ + for (Mob mob : Dungeon.level.mobs) { + mob.beckon( Dungeon.hero.pos ); + } + GLog.i( Messages.get(this, "notinvisible") ); + Sample.INSTANCE.play( Assets.Sounds.ALERT ); + CellEmitter.center( Dungeon.hero.pos ).start( Speck.factory( Speck.SCREAM ), 0.3f, 3 ); + } + else{ + Buff.affect( hero, Invisibility.class, Invisibility.DURATION ); + GLog.i( Messages.get(this, "invisible") ); + Sample.INSTANCE.play( Assets.Sounds.MELD ); + } + + } @Override public int value() { return isKnown() ? 40 * quantity : super.value(); } + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(Challenges.EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java index 85875f861..2dbfad7f9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java @@ -21,7 +21,11 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + +import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MindVision; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; @@ -31,25 +35,43 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; public class PotionOfMindVision extends Potion { - { - icon = ItemSpriteSheet.Icons.POTION_MINDVIS; - } + { + icon = ItemSpriteSheet.Icons.POTION_MINDVIS; + } + + @Override + public void apply(Hero hero) { + identify(); + + if (Dungeon.isChallenged(EXSG)) { + if (Dungeon.level.mobs.size() > 0) { + GLog.i(Messages.get(this, "can't_see_mobs")); + + } else { + GLog.i(Messages.get(this, "cant'see_none")); + } + Buff.affect(hero, Blindness.class, 5f); + } else { + Buff.affect(hero, MindVision.class, MindVision.DURATION); + Dungeon.observe(); + if (Dungeon.level.mobs.size() > 0) { + GLog.i(Messages.get(this, "see_mobs")); + } else { + GLog.i(Messages.get(this, "see_none")); + } + } + } + + + @Override + public int value() { + return isKnown() ? 30 * quantity : super.value(); + } + + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(Challenges.EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } - @Override - public void apply( Hero hero ) { - identify(); - Buff.affect( hero, MindVision.class, MindVision.DURATION ); - Dungeon.observe(); - - if (Dungeon.level.mobs.size() > 0) { - GLog.i( Messages.get(this, "see_mobs") ); - } else { - GLog.i( Messages.get(this, "see_none") ); - } - } - - @Override - public int value() { - return isKnown() ? 30 * quantity : super.value(); - } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java index 2eed2705e..92f2121cf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java @@ -21,7 +21,13 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions; +import static com.shatteredpixel.shatteredpixeldungeon.Challenges.EXSG; + import com.shatteredpixel.shatteredpixeldungeon.Badges; +import com.shatteredpixel.shatteredpixeldungeon.Challenges; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -39,11 +45,17 @@ public class PotionOfStrength extends Potion { @Override public void apply( Hero hero ) { identify(); - - hero.STR++; - hero.sprite.showStatus( CharSprite.POSITIVE, Messages.get(this, "msg_1") ); - GLog.p( Messages.get(this, "msg_2") ); - + if(Dungeon.isChallenged(EXSG)) { + hero.STR--; + hero.sprite.showStatus(CharSprite.NEGATIVE, Messages.get(this, "esg_1")); + GLog.n(Messages.get(this, "esg_2")); + Buff.affect(hero, Frost.class, 10f); + } else { + hero.STR++; + hero.sprite.showStatus(CharSprite.POSITIVE, Messages.get(this, "msg_1")); + GLog.p(Messages.get(this, "msg_2")); + } + Badges.validateStrengthAttained(); } @@ -56,4 +68,9 @@ public class PotionOfStrength extends Potion { public int energyVal() { return isKnown() ? 8 * quantity : super.energyVal(); } + @Override + public String desc() { + //三元一次逻辑运算 + return Dungeon.isChallenged(Challenges.EXSG) ? Messages.get(this, "descx") : Messages.get(this, "desc"); + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndChallenges.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndChallenges.java index c00397d7d..056080e82 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndChallenges.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndChallenges.java @@ -133,7 +133,7 @@ public class WndChallenges extends Window { cb.active = editable; //Disable - if(Challenges.NAME_IDS[i].equals("light&black")||Challenges.NAME_IDS[i].equals("exsg")||Challenges.NAME_IDS[i].equals("boss")){ + if(Challenges.NAME_IDS[i].equals("light&black")||Challenges.NAME_IDS[i].equals("boss")){ cb.active = false; cb.checked(false); cb.alpha(0.5f);