v2.5.0: energizing scrolls and potions now IDs them!
This commit is contained in:
@@ -1070,7 +1070,7 @@ items.scrolls.scrollofrage.desc=When read aloud, this scroll will unleash a grea
|
||||
|
||||
items.scrolls.scrollofrecharging.name=scroll of recharging
|
||||
items.scrolls.scrollofrecharging.surge=A surge of energy courses through your body, invigorating your wands!
|
||||
items.scrolls.scrollofrecharging.desc=The raw magical power bound up in this parchment will charge up all the users wands over time when released.
|
||||
items.scrolls.scrollofrecharging.desc=The raw magical power bound up in this parchment will charge up all the user's wands over time when released.
|
||||
|
||||
items.scrolls.scrollofremovecurse.name=scroll of remove curse
|
||||
items.scrolls.scrollofremovecurse.inv_title=Cleanse an item
|
||||
@@ -1182,7 +1182,7 @@ items.scrolls.exotic.scrollofpsionicblast.desc=This scroll contains incredible d
|
||||
###spells
|
||||
items.spells.alchemize.name=alchemize
|
||||
items.spells.alchemize.prompt=Alchemize an Item
|
||||
items.spells.alchemize.desc=This spell contains transmutative powers similar to those found in an alchemy pot. Each cast allows the user to turn an item (or stack of items) into gold or alchemical energy.\n\nA few Alchemize uses are sold from shops, but many more can be made using alchemy by combining a seed, runestone, and a little alchemical energy.
|
||||
items.spells.alchemize.desc=This spell contains transmutative powers similar to those found in an alchemy pot. Each cast allows the user to turn an item (or stack of items) into gold or alchemical energy. Turning potions of scrolls into energy will even identify them!\n\nA few Alchemize uses are sold from shops, but many more can be made using alchemy by combining a seed, runestone, and a little alchemical energy.
|
||||
items.spells.alchemize$wndalchemizeitem.sell=Turn into %dg
|
||||
items.spells.alchemize$wndalchemizeitem.sell_1=Turn 1 into %dg
|
||||
items.spells.alchemize$wndalchemizeitem.sell_all=Turn all into %dg
|
||||
|
||||
@@ -45,7 +45,7 @@ journal.document.adventurers_guide.identifying.body=You won't know all of the pr
|
||||
journal.document.adventurers_guide.food.title=Dealing with Hunger
|
||||
journal.document.adventurers_guide.food.body=Rationing food effectively is one of the best things you can do to improve your odds of survival. Try thinking of health and hunger as resources that need to be managed, not kept full at all times.\n\nWhen you aren't starving you will slowly regenerate health. So if you eat at full health, this regeneration will be wasted.\n\nIf you pace out when you eat based on how your health is doing, your food should last much longer.
|
||||
journal.document.adventurers_guide.alchemy.title=Alchemy & Trinkets
|
||||
journal.document.adventurers_guide.alchemy.body=If you don't find a certain consumable item useful, you can use it as an ingredient at an alchemy pot instead! Items can be used in specific recipes, or turned into all-purpose alchemical energy.\n\nTrinkets are the only piece of equipment that can be made using alchemy. They produce a variety of helpful effects and can be made with just a bit of alchemical energy and a magical catalyst. Trinkets can be upgraded with more energy to make their effect more powerful.\n\n(You can find the first alchemy pot on the 3rd or 4th floor of the dungeon. You can find pages of an alchemy recipe book near these pots as well.)
|
||||
journal.document.adventurers_guide.alchemy.body=If you don't find a certain consumable item useful, you can use it as an ingredient at an alchemy pot instead! Items can be used in specific recipes, or turned into all-purpose alchemical energy. Energizing potions and scrolls also identifies them!\n\nTrinkets are the only piece of equipment that can be made using alchemy. They produce a variety of helpful effects and can be made with just a bit of alchemical energy and a magical catalyst. Trinkets can be upgraded with more energy to make their effect more powerful.\n\n(You can find the first alchemy pot on the 3rd or 4th floor of the dungeon. You can find pages of an alchemy recipe book near these pots as well.)
|
||||
journal.document.adventurers_guide.dieing.title=Handling Defeat
|
||||
journal.document.adventurers_guide.dieing.body=Unfortunately, dungeoneering is a very dangerous profession and most adventurers will eventually meet their demise.\n\nWhile luck can definitely play a role, the best adventurers are the ones who use every little trick to improve their odds of success.\n\n(Don't be dissuaded if you are dying a lot, this game is hard! Focus on learning the game and steadily improving, don't focus on winning right away.)
|
||||
journal.document.adventurers_guide.searching.title=Searching
|
||||
@@ -67,9 +67,9 @@ journal.document.alchemy_guide.title=Alchemy Guide
|
||||
journal.document.alchemy_guide.potions.title=Intro and Potions
|
||||
journal.document.alchemy_guide.potions.body=Welcome to Practical Applications of Alchemy!\n\nAlchemy recipes can be used to craft a wide variety of items at an alchemy pot. You can experiment to find recipes, or continue reading this book for a full recipe reference!\n\nWe will start with the most iconic alchemy recipe: Place any three seeds into an alchemy pot to brew a random potion!\n\nEvery seed has a potion counterpart, and the potion you create may relate to one of the seeds used. Using multiple of the same seed will increase the chance for this to occur.
|
||||
journal.document.alchemy_guide.stones.title=Creating Runestones
|
||||
journal.document.alchemy_guide.stones.body=Mixing a scroll into an alchemy pot will imbue its magic into two rocks within the pot. This creates runestones!
|
||||
journal.document.alchemy_guide.stones.body=Mixing a scroll into an alchemy pot will imbue its magic into two rocks within the pot. This creates runestones and identifies the scroll!
|
||||
journal.document.alchemy_guide.energy_food.title=Energy and Food
|
||||
journal.document.alchemy_guide.energy_food.body=Many recipes require crystallized alchemical energy, which is produced by deconstructing most consumable items in an alchemy pot. As a few examples: seeds generate 2 energy, stones generate 3, scrolls and potions each generate 6.\n\nSome of these recipes are quite magical, but these ones more resemble traditional cooking.
|
||||
journal.document.alchemy_guide.energy_food.body=Many recipes require crystal alchemical energy, which is produced by deconstructing consumable items in an alchemy pot. More powerful items produce more energy, and energizing potions or scrolls also identifies them.\n\nSome recipes that require energy are magical, but these ones resemble traditional cooking.
|
||||
journal.document.alchemy_guide.exotic_potions.title=Exotic Potions
|
||||
journal.document.alchemy_guide.exotic_potions.body=Potions can be mixed with energy to create exotic potions. They have more powerful effects, but are often useful in different ways.
|
||||
journal.document.alchemy_guide.exotic_scrolls.title=Exotic Scrolls
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||
@@ -49,6 +50,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfShock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.AlchemyScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
@@ -338,7 +340,13 @@ public abstract class Scroll extends Item {
|
||||
Scroll s = (Scroll) ingredients.get(0);
|
||||
|
||||
s.quantity(s.quantity() - 1);
|
||||
s.identify();
|
||||
if (ShatteredPixelDungeon.scene() instanceof AlchemyScene){
|
||||
if (!s.isIdentified()){
|
||||
((AlchemyScene) ShatteredPixelDungeon.scene()).showIdentify(s);
|
||||
}
|
||||
} else {
|
||||
s.identify();
|
||||
}
|
||||
|
||||
return Reflection.newInstance(stones.get(s.getClass())).quantity(2);
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ public class Alchemize extends Spell {
|
||||
RedButton btnEnergize = new RedButton(Messages.get(this, "energize", item.energyVal())) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
WndEnergizeItem.energize(item);
|
||||
WndEnergizeItem.energizeAll(item);
|
||||
hide();
|
||||
consumeAlchemize();
|
||||
}
|
||||
@@ -227,7 +227,7 @@ public class Alchemize extends Spell {
|
||||
RedButton btnEnergizeAll = new RedButton(Messages.get(this, "energize_all", energyAll)) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
WndEnergizeItem.energize(item);
|
||||
WndEnergizeItem.energizeAll(item);
|
||||
hide();
|
||||
consumeAlchemize();
|
||||
}
|
||||
|
||||
@@ -839,6 +839,75 @@ public class AlchemyScene extends PixelScene {
|
||||
|
||||
updateState();
|
||||
}
|
||||
|
||||
public void showIdentify(Item item){
|
||||
if (item.isIdentified()) return;
|
||||
|
||||
NinePatch BG = Chrome.get(Chrome.Type.TOAST);
|
||||
|
||||
IconTitle oldName = new IconTitle(item){
|
||||
@Override
|
||||
public synchronized void update() {
|
||||
super.update();
|
||||
alpha(this.alpha()-Game.elapsed);
|
||||
if (this.alpha() <= 0){
|
||||
killAndErase();
|
||||
}
|
||||
}
|
||||
};
|
||||
item.identify();
|
||||
IconTitle newName = new IconTitle(item){
|
||||
|
||||
boolean fading;
|
||||
|
||||
@Override
|
||||
public synchronized void update() {
|
||||
super.update();
|
||||
if (!fading) {
|
||||
alpha(this.alpha() + Game.elapsed);
|
||||
if (this.alpha() >= 1) {
|
||||
fading = true;
|
||||
}
|
||||
} else {
|
||||
alpha(this.alpha() - Game.elapsed);
|
||||
BG.alpha(this.alpha());
|
||||
if (this.alpha() <= 0){
|
||||
killAndErase();
|
||||
BG.killAndErase();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
newName.alpha(-0.5f);
|
||||
|
||||
oldName.setSize(200, oldName.height());
|
||||
newName.setSize(200, newName.height());
|
||||
|
||||
int w = (int)Math.ceil(Math.max(oldName.reqWidth(), newName.reqWidth())+5);
|
||||
|
||||
oldName.setSize(w, oldName.height());
|
||||
oldName.setPos(
|
||||
centerW - oldName.width()/2,
|
||||
energyAdd.top()
|
||||
);
|
||||
align(oldName);
|
||||
|
||||
newName.setSize(w, oldName.height());
|
||||
newName.setPos(
|
||||
centerW - newName.width()/2,
|
||||
energyAdd.top()
|
||||
);
|
||||
align(newName);
|
||||
|
||||
BG.x = oldName.left()-2;
|
||||
BG.y = oldName.top()-2;
|
||||
BG.size(oldName.width()+4, oldName.height()+4);
|
||||
|
||||
add(BG);
|
||||
add(oldName);
|
||||
add(newName);
|
||||
|
||||
}
|
||||
|
||||
private class InputButton extends Component {
|
||||
|
||||
|
||||
@@ -133,6 +133,15 @@ public class IconTitle extends Component {
|
||||
tfLabel.hardlight( color );
|
||||
}
|
||||
|
||||
public float alpha(){
|
||||
return imIcon.alpha();
|
||||
}
|
||||
|
||||
public void alpha( float value ){
|
||||
tfLabel.alpha(value);
|
||||
imIcon.alpha(value);
|
||||
}
|
||||
|
||||
public void health( float value ) {
|
||||
health.level( healthLvl = value );
|
||||
layout();
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
||||
public class WndEnergizeItem extends WndInfoItem {
|
||||
|
||||
@@ -53,7 +54,7 @@ public class WndEnergizeItem extends WndInfoItem {
|
||||
RedButton btnEnergize = new RedButton( Messages.get(this, "energize", item.energyVal()) ) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
energize( item );
|
||||
energizeAll( item );
|
||||
hide();
|
||||
}
|
||||
};
|
||||
@@ -79,7 +80,7 @@ public class WndEnergizeItem extends WndInfoItem {
|
||||
RedButton btnEnergizeAll = new RedButton( Messages.get(this, "energize_all", energyAll ) ) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
energize( item );
|
||||
energizeAll( item );
|
||||
hide();
|
||||
}
|
||||
};
|
||||
@@ -106,52 +107,43 @@ public class WndEnergizeItem extends WndInfoItem {
|
||||
}
|
||||
}
|
||||
|
||||
public static void energize( Item item ) {
|
||||
public static void energizeAll(Item item ) {
|
||||
|
||||
Hero hero = Dungeon.hero;
|
||||
|
||||
if (item.isEquipped( hero ) && !((EquipableItem)item).doUnequip( hero, false )) {
|
||||
if (item.isEquipped( Dungeon.hero ) && !((EquipableItem)item).doUnequip( Dungeon.hero, false )) {
|
||||
return;
|
||||
}
|
||||
item.detachAll( hero.belongings.backpack );
|
||||
|
||||
if (ShatteredPixelDungeon.scene() instanceof AlchemyScene){
|
||||
|
||||
Dungeon.energy += item.energyVal();
|
||||
((AlchemyScene) ShatteredPixelDungeon.scene()).createEnergy();
|
||||
|
||||
} else {
|
||||
|
||||
//selling items in the sell interface doesn't spend time
|
||||
hero.spend(-hero.cooldown());
|
||||
|
||||
new EnergyCrystal(item.energyVal()).doPickUp(hero);
|
||||
|
||||
}
|
||||
item.detachAll( Dungeon.hero.belongings.backpack );
|
||||
energize(item);
|
||||
}
|
||||
|
||||
public static void energizeOne( Item item ) {
|
||||
|
||||
if (item.quantity() <= 1) {
|
||||
energize( item );
|
||||
energizeAll( item );
|
||||
} else {
|
||||
energize(item.detach( Dungeon.hero.belongings.backpack ));
|
||||
}
|
||||
}
|
||||
|
||||
private static void energize(Item item){
|
||||
Hero hero = Dungeon.hero;
|
||||
|
||||
if (ShatteredPixelDungeon.scene() instanceof AlchemyScene){
|
||||
|
||||
Dungeon.energy += item.energyVal();
|
||||
((AlchemyScene) ShatteredPixelDungeon.scene()).createEnergy();
|
||||
if (!item.isIdentified()){
|
||||
((AlchemyScene) ShatteredPixelDungeon.scene()).showIdentify(item);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
Hero hero = Dungeon.hero;
|
||||
//energizing items doesn't spend time
|
||||
hero.spend(-hero.cooldown());
|
||||
new EnergyCrystal(item.energyVal()).doPickUp(hero);
|
||||
item.identify();
|
||||
GLog.h("You energized: " + item.name());
|
||||
|
||||
item = item.detach( hero.belongings.backpack );
|
||||
|
||||
if (ShatteredPixelDungeon.scene() instanceof AlchemyScene){
|
||||
|
||||
Dungeon.energy += item.energyVal();
|
||||
((AlchemyScene) ShatteredPixelDungeon.scene()).createEnergy();
|
||||
|
||||
} else {
|
||||
|
||||
//selling items in the sell interface doesn't spend time
|
||||
hero.spend(-hero.cooldown());
|
||||
|
||||
new EnergyCrystal(item.energyVal()).doPickUp(hero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user