v1.1.0: implemented the telekinetic grab spell
This commit is contained in:
parent
195b3a34ca
commit
d81141bd8b
|
@ -1092,6 +1092,11 @@ items.spells.recycle.desc=This spell contains a lesser form of transmutation mag
|
|||
items.spells.targetedspell.prompt=Choose a target
|
||||
items.spells.targetedspell.inv_title=Infuse an item
|
||||
|
||||
items.spells.telekineticgrab.name=telekinetic grab
|
||||
items.spells.telekineticgrab.cant_grab=You can't grab that.
|
||||
items.spells.telekineticgrab.no_target=There's nothing to grab there.
|
||||
items.spells.telekineticgrab.desc=This spell allows the caster to remotely grab any item from the ground, or any thrown weapon that's stuck to an enemy!\n\nIt can't be used to grab items that someone else owns, or to grab containers like chests.
|
||||
|
||||
items.spells.wildenergy.name=wild energy
|
||||
items.spells.wildenergy.desc=This spell contains some of the cursed energy which powered DM-300. When cast, it will recharge your wands and worn artifacts, while also triggering a random cursed wand effect. You are able to choose a direction for this cursed magic to shoot in, however.
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
@ -45,6 +45,14 @@ public class PinCushion extends Buff {
|
|||
items.add(projectile);
|
||||
}
|
||||
|
||||
public Item grabOne(){
|
||||
Item item = items.remove(0);
|
||||
if (items.isEmpty()){
|
||||
detach();
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
public ArrayList<MissileWeapon> getStuckItems(){
|
||||
return new ArrayList<>(items);
|
||||
}
|
||||
|
|
|
@ -683,7 +683,7 @@ public class Tengu extends Mob {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
GLog.w( Messages.get(this, "cant_pickup") );
|
||||
return false;
|
||||
}
|
||||
|
@ -1058,7 +1058,7 @@ public class Tengu extends Mob {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
GLog.w( Messages.get(this, "cant_pickup") );
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -63,8 +63,8 @@ public class Amulet extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
if (super.doPickUp( hero )) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if (super.doPickUp( hero, pos )) {
|
||||
|
||||
if (!Statistics.amuletObtained) {
|
||||
Statistics.amuletObtained = true;
|
||||
|
|
|
@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
@ -47,18 +46,18 @@ public class Dewdrop extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
|
||||
Waterskin flask = hero.belongings.getItem( Waterskin.class );
|
||||
|
||||
if (flask != null && !flask.isFull()){
|
||||
|
||||
flask.collectDew( this );
|
||||
GameScene.pickUp( this, hero.pos );
|
||||
GameScene.pickUp( this, pos );
|
||||
|
||||
} else {
|
||||
|
||||
int terr = Dungeon.level.map[hero.pos];
|
||||
int terr = Dungeon.level.map[pos];
|
||||
if (!consumeDew(1, hero, terr == Terrain.ENTRANCE|| terr == Terrain.EXIT || terr == Terrain.UNLOCKED_EXIT)){
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -33,13 +33,13 @@ public class EnergyCrystal extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
|
||||
Dungeon.energy += quantity;
|
||||
//TODO Statistics.goldCollected += quantity;
|
||||
//Badges.validateGoldCollected();
|
||||
|
||||
GameScene.pickUp( this, hero.pos );
|
||||
GameScene.pickUp( this, pos );
|
||||
hero.sprite.showStatus( 0x44CCFF, TXT_VALUE, quantity );
|
||||
hero.spendAndNext( TIME_TO_PICK_UP );
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@ public abstract class EquipableItem extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
if (super.doPickUp(hero)){
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if (super.doPickUp(hero, pos)){
|
||||
if (!isIdentified() && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_IDING)){
|
||||
GLog.p(Messages.get(Guidebook.class, "hint"));
|
||||
GameScene.flashForDocument(Document.GUIDE_IDING);
|
||||
|
|
|
@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -59,7 +58,7 @@ public class Gold extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
|
||||
Dungeon.gold += quantity;
|
||||
Statistics.goldCollected += quantity;
|
||||
|
@ -69,7 +68,7 @@ public class Gold extends Item {
|
|||
if (thievery != null)
|
||||
thievery.collect(quantity);
|
||||
|
||||
GameScene.pickUp( this, hero.pos );
|
||||
GameScene.pickUp( this, pos );
|
||||
hero.sprite.showStatus( CharSprite.NEUTRAL, TXT_VALUE, quantity );
|
||||
hero.spendAndNext( TIME_TO_PICK_UP );
|
||||
|
||||
|
|
|
@ -156,8 +156,8 @@ public class Honeypot extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
if ( super.doPickUp(hero) ){
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if ( super.doPickUp(hero, pos) ){
|
||||
pickupPot( hero );
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -29,7 +29,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Degrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
|
@ -43,7 +42,6 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.MissileSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.noosa.particles.Emitter;
|
||||
import com.watabou.utils.Bundlable;
|
||||
|
@ -111,11 +109,15 @@ public class Item implements Bundlable {
|
|||
public String actionName(String action, Hero hero){
|
||||
return Messages.get(this, "ac_" + action);
|
||||
}
|
||||
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
|
||||
public final boolean doPickUp( Hero hero ) {
|
||||
return doPickUp( hero, hero.pos );
|
||||
}
|
||||
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if (collect( hero.belongings.backpack )) {
|
||||
|
||||
GameScene.pickUp( this, hero.pos );
|
||||
GameScene.pickUp( this, pos );
|
||||
Sample.INSTANCE.play( Assets.Sounds.ITEM );
|
||||
hero.spendAndNext( TIME_TO_PICK_UP );
|
||||
return true;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
|
@ -24,7 +22,7 @@ public class LostBackpack extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if (hero.buff(LostInventory.class) != null){
|
||||
hero.buff(LostInventory.class).detach();
|
||||
}
|
||||
|
@ -53,7 +51,7 @@ public class LostBackpack extends Item {
|
|||
Item.updateQuickslot();
|
||||
Sample.INSTANCE.play( Assets.Sounds.DEWDROP );
|
||||
hero.spendAndNext(TIME_TO_PICK_UP);
|
||||
GameScene.pickUp( this, hero.pos );
|
||||
GameScene.pickUp( this, pos );
|
||||
((HeroSprite)hero.sprite).updateArmor();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.spells.MagicalPorter;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.PhaseShift;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.ReclaimTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Recycle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.SummonElemental;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.TelekineticGrab;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.WildEnergy;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||
|
@ -174,6 +176,7 @@ public abstract class Recipe {
|
|||
new ExoticPotion.PotionToExotic(),
|
||||
new ExoticScroll.ScrollToExotic(),
|
||||
new ArcaneResin.Recipe(),
|
||||
new Alchemize.Recipe(),
|
||||
new StewedMeat.oneMeat()
|
||||
};
|
||||
|
||||
|
@ -193,7 +196,6 @@ public abstract class Recipe {
|
|||
new InfernalBrew.Recipe(),
|
||||
new ShockingBrew.Recipe(),
|
||||
new CausticBrew.Recipe(),
|
||||
new Alchemize.Recipe(),
|
||||
new AquaBlast.Recipe(),
|
||||
new BeaconOfReturning.Recipe(),
|
||||
new CurseInfusion.Recipe(),
|
||||
|
@ -204,13 +206,13 @@ public abstract class Recipe {
|
|||
new ReclaimTrap.Recipe(),
|
||||
new Recycle.Recipe(),
|
||||
new WildEnergy.Recipe(),
|
||||
new TelekineticGrab.Recipe(),
|
||||
new SummonElemental.Recipe(),
|
||||
new StewedMeat.twoMeat()
|
||||
};
|
||||
|
||||
private static Recipe[] threeIngredientRecipes = new Recipe[]{
|
||||
new Potion.SeedToPotion(),
|
||||
//new ExoticPotion.PotionToExotic(),
|
||||
//new ExoticScroll.ScrollToExotic(),
|
||||
new StewedMeat.threeMeat(),
|
||||
new MeatPie.Recipe()
|
||||
};
|
||||
|
|
|
@ -73,9 +73,9 @@ public class TengusMask extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
Badges.validateMastery();
|
||||
return super.doPickUp( hero );
|
||||
return super.doPickUp( hero, pos );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
|
@ -457,7 +456,7 @@ public class DriedRose extends Artifact {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
DriedRose rose = hero.belongings.getItem( DriedRose.class );
|
||||
|
||||
if (rose == null){
|
||||
|
@ -476,6 +475,7 @@ public class DriedRose extends Artifact {
|
|||
GLog.i( Messages.get(this, "levelup") );
|
||||
|
||||
Sample.INSTANCE.play( Assets.Sounds.DEWDROP );
|
||||
GameScene.pickUp(this, pos);
|
||||
hero.spendAndNext(TIME_TO_PICK_UP);
|
||||
return true;
|
||||
|
||||
|
|
|
@ -414,7 +414,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp( Hero hero ) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
TimekeepersHourglass hourglass = hero.belongings.getItem( TimekeepersHourglass.class );
|
||||
if (hourglass != null && !hourglass.cursed) {
|
||||
hourglass.upgrade();
|
||||
|
@ -423,6 +423,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
GLog.p( Messages.get(this, "maxlevel") );
|
||||
else
|
||||
GLog.i( Messages.get(this, "levelup") );
|
||||
GameScene.pickUp(this, pos);
|
||||
hero.spendAndNext(TIME_TO_PICK_UP);
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -123,12 +123,12 @@ public class Bomb extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if (fuse != null) {
|
||||
GLog.w( Messages.get(this, "snuff_fuse") );
|
||||
fuse = null;
|
||||
}
|
||||
return super.doPickUp(hero);
|
||||
return super.doPickUp(hero, pos);
|
||||
}
|
||||
|
||||
public void explode(int cell){
|
||||
|
@ -317,10 +317,10 @@ public class Bomb extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
Bomb bomb = new Bomb();
|
||||
bomb.quantity(2);
|
||||
if (bomb.doPickUp(hero)) {
|
||||
if (bomb.doPickUp(hero, pos)) {
|
||||
//isaaaaac.... (don't bother doing this when not in english)
|
||||
if (SPDSettings.language() == Languages.ENGLISH)
|
||||
hero.sprite.showStatus(CharSprite.NEUTRAL, "1+1 free!");
|
||||
|
|
|
@ -50,8 +50,8 @@ public abstract class DocumentPage extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final boolean doPickUp(Hero hero) {
|
||||
GameScene.pickUpJournal(this, hero.pos);
|
||||
public final boolean doPickUp(Hero hero, int pos) {
|
||||
GameScene.pickUpJournal(this, pos);
|
||||
GameScene.flashForDocument(page());
|
||||
if (document() == Document.ALCHEMY_GUIDE){
|
||||
WndJournal.last_index = 1;
|
||||
|
|
|
@ -19,8 +19,8 @@ public class Guidebook extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final boolean doPickUp(Hero hero) {
|
||||
GameScene.pickUpJournal(this, hero.pos);
|
||||
public final boolean doPickUp(Hero hero, int pos) {
|
||||
GameScene.pickUpJournal(this, pos);
|
||||
String page = Document.GUIDE_INTRO;
|
||||
Game.runOnRenderThread(new Callback() {
|
||||
@Override
|
||||
|
|
|
@ -47,8 +47,8 @@ public abstract class Key extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
GameScene.pickUpJournal(this, hero.pos);
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
GameScene.pickUpJournal(this, pos);
|
||||
WndJournal.last_index = 2;
|
||||
Notes.add(this);
|
||||
Sample.INSTANCE.play( Assets.Sounds.ITEM );
|
||||
|
|
|
@ -48,7 +48,7 @@ public class SkeletonKey extends Key {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if(!SPDSettings.supportNagged()){
|
||||
try {
|
||||
Dungeon.saveAll();
|
||||
|
@ -64,7 +64,7 @@ public class SkeletonKey extends Key {
|
|||
|
||||
}
|
||||
|
||||
return super.doPickUp(hero);
|
||||
return super.doPickUp(hero, pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,8 +65,8 @@ public class CorpseDust extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
if (super.doPickUp(hero)){
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
if (super.doPickUp(hero, pos)){
|
||||
GLog.n( Messages.get( this, "chill") );
|
||||
Buff.affect(hero, DustGhostSpawner.class);
|
||||
return true;
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.spells;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.LiquidMetal;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
public class SummonElemental extends Spell {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.SUMMON_ELE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCast(Hero hero) {
|
||||
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
{
|
||||
inputs = new Class[]{Embers.class, ArcaneCatalyst.class};
|
||||
inQuantity = new int[]{1, 1};
|
||||
|
||||
cost = 8;
|
||||
|
||||
output = SummonElemental.class;
|
||||
outQuantity = 3;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.items.spells;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.LiquidMetal;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
public class TelekineticGrab extends TargetedSpell {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.TELE_GRAB;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fx(Ballistica bolt, Callback callback) {
|
||||
MagicMissile.boltFromChar( curUser.sprite.parent,
|
||||
MagicMissile.BEACON,
|
||||
curUser.sprite,
|
||||
bolt.collisionPos,
|
||||
callback);
|
||||
Sample.INSTANCE.play( Assets.Sounds.ZAP );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void affectTarget(Ballistica bolt, Hero hero) {
|
||||
Char ch = Actor.findChar(bolt.collisionPos);
|
||||
|
||||
if (ch != null && ch.buff(PinCushion.class) != null){
|
||||
|
||||
Item item = ch.buff(PinCushion.class).grabOne();
|
||||
|
||||
if (item.doPickUp(hero, ch.pos)){
|
||||
hero.spend(-Item.TIME_TO_PICK_UP); //casting the spell already takes a turn
|
||||
|
||||
} else {
|
||||
GLog.w(Messages.get(this, "cant_grab"));
|
||||
Dungeon.level.drop(item, ch.pos).sprite.drop();
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (Dungeon.level.heaps.get(bolt.collisionPos) != null){
|
||||
|
||||
Heap h = Dungeon.level.heaps.get(bolt.collisionPos);
|
||||
|
||||
if (h.type != Heap.Type.HEAP){
|
||||
GLog.w(Messages.get(this, "cant_grab"));
|
||||
h.sprite.drop();
|
||||
return;
|
||||
}
|
||||
|
||||
Item item = h.peek();
|
||||
|
||||
if (item.doPickUp(hero, h.pos)){
|
||||
h.pickUp();
|
||||
hero.spend(-Item.TIME_TO_PICK_UP); //casting the spell already takes a turn
|
||||
|
||||
} else {
|
||||
GLog.w(Messages.get(this, "cant_grab"));
|
||||
h.sprite.drop();
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
GLog.w(Messages.get(this, "no_target"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity (rounded up slightly)
|
||||
return Math.round(quantity * ((48) / 6f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
{
|
||||
inputs = new Class[]{LiquidMetal.class, ArcaneCatalyst.class};
|
||||
inQuantity = new int[]{15, 1};
|
||||
|
||||
cost = 4;
|
||||
|
||||
output = TelekineticGrab.class;
|
||||
outQuantity = 6;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.PinCushion;
|
||||
|
@ -369,9 +368,9 @@ abstract public class MissileWeapon extends Weapon {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean doPickUp(Hero hero) {
|
||||
public boolean doPickUp(Hero hero, int pos) {
|
||||
parent = null;
|
||||
return super.doPickUp(hero);
|
||||
return super.doPickUp(hero, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.LiquidMetal;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.AlchemistsToolkit;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart;
|
||||
|
@ -308,7 +309,11 @@ public class AlchemyScene extends PixelScene {
|
|||
if (item != null && inputs[0] != null) {
|
||||
for (int i = 0; i < inputs.length; i++) {
|
||||
if (inputs[i].item() == null) {
|
||||
inputs[i].item(item.detach(Dungeon.hero.belongings.backpack));
|
||||
if (item instanceof LiquidMetal){
|
||||
inputs[i].item(item.detachAll(Dungeon.hero.belongings.backpack));
|
||||
} else {
|
||||
inputs[i].item(item.detach(Dungeon.hero.belongings.backpack));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -424,6 +429,7 @@ public class AlchemyScene extends PixelScene {
|
|||
smokeEmitter.burst(Speck.factory( Speck.WOOL ), 10 );
|
||||
Sample.INSTANCE.play( Assets.Sounds.PUFF );
|
||||
|
||||
int resultQuantity = result.quantity();
|
||||
if (!result.collect()){
|
||||
Dungeon.level.drop(result, Dungeon.hero.pos);
|
||||
}
|
||||
|
@ -451,6 +457,8 @@ public class AlchemyScene extends PixelScene {
|
|||
}
|
||||
|
||||
updateState();
|
||||
//we reset the quantity in case the result was merged into another stack in the backpack
|
||||
result.quantity(resultQuantity);
|
||||
outputs[0].item(result);
|
||||
}
|
||||
|
||||
|
@ -465,7 +473,7 @@ public class AlchemyScene extends PixelScene {
|
|||
ArrayList<Item> found = inventory.getAllSimilar(finding);
|
||||
while (!found.isEmpty() && needed > 0){
|
||||
Item detached;
|
||||
if (finding instanceof Dart) {
|
||||
if (finding instanceof LiquidMetal) {
|
||||
detached = found.get(0).detachAll(inventory.backpack);
|
||||
} else {
|
||||
detached = found.get(0).detach(inventory.backpack);
|
||||
|
|
|
@ -596,22 +596,26 @@ public class ItemSpriteSheet {
|
|||
private static final int SPELLS = xy(1, 27); //16 slots
|
||||
public static final int MAGIC_PORTER = SPELLS+0;
|
||||
public static final int PHASE_SHIFT = SPELLS+1;
|
||||
public static final int WILD_ENERGY = SPELLS+2;
|
||||
public static final int RETURN_BEACON = SPELLS+3;
|
||||
public static final int TELE_GRAB = SPELLS+2;
|
||||
public static final int WILD_ENERGY = SPELLS+3;
|
||||
public static final int RETURN_BEACON = SPELLS+4;
|
||||
public static final int SUMMON_ELE = SPELLS+5;
|
||||
|
||||
public static final int AQUA_BLAST = SPELLS+5;
|
||||
public static final int FEATHER_FALL = SPELLS+6;
|
||||
public static final int RECLAIM_TRAP = SPELLS+7;
|
||||
public static final int AQUA_BLAST = SPELLS+7;
|
||||
public static final int FEATHER_FALL = SPELLS+8;
|
||||
public static final int RECLAIM_TRAP = SPELLS+9;
|
||||
|
||||
public static final int CURSE_INFUSE = SPELLS+9;
|
||||
public static final int MAGIC_INFUSE = SPELLS+10;
|
||||
public static final int ALCHEMIZE = SPELLS+11;
|
||||
public static final int RECYCLE = SPELLS+12;
|
||||
public static final int CURSE_INFUSE = SPELLS+11;
|
||||
public static final int MAGIC_INFUSE = SPELLS+12;
|
||||
public static final int ALCHEMIZE = SPELLS+13;
|
||||
public static final int RECYCLE = SPELLS+14;
|
||||
static{
|
||||
assignItemRect(MAGIC_PORTER, 12, 11);
|
||||
assignItemRect(PHASE_SHIFT, 12, 11);
|
||||
assignItemRect(TELE_GRAB, 12, 11);
|
||||
assignItemRect(WILD_ENERGY, 8, 16);
|
||||
assignItemRect(RETURN_BEACON, 8, 16);
|
||||
assignItemRect(SUMMON_ELE, 8, 16);
|
||||
|
||||
assignItemRect(AQUA_BLAST, 11, 11);
|
||||
assignItemRect(FEATHER_FALL, 11, 11);
|
||||
|
|
|
@ -62,6 +62,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.spells.MagicalPorter;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.PhaseShift;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.ReclaimTrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Recycle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.SummonElemental;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.TelekineticGrab;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.WildEnergy;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
|
@ -372,16 +374,16 @@ public class QuickRecipe extends Component {
|
|||
result.add(new QuickRecipe(new ElixirOfArcaneArmor.Recipe()));
|
||||
return result;
|
||||
case 9:
|
||||
result.add(new QuickRecipe(new TelekineticGrab.Recipe()));
|
||||
result.add(new QuickRecipe(new PhaseShift.Recipe()));
|
||||
result.add(new QuickRecipe(new WildEnergy.Recipe()));
|
||||
result.add(new QuickRecipe(new BeaconOfReturning.Recipe()));
|
||||
result.add(null);
|
||||
result.add(new QuickRecipe(new SummonElemental.Recipe()));
|
||||
result.add(null);
|
||||
result.add(new QuickRecipe(new AquaBlast.Recipe()));
|
||||
result.add(new QuickRecipe(new ReclaimTrap.Recipe()));
|
||||
result.add(new QuickRecipe(new FeatherFall.Recipe()));
|
||||
result.add(null);
|
||||
result.add(null);
|
||||
result.add(new QuickRecipe(new Alchemize.Recipe()));
|
||||
result.add(new QuickRecipe(new MagicalInfusion.Recipe()));
|
||||
result.add(new QuickRecipe(new CurseInfusion.Recipe()));
|
||||
|
|
Loading…
Reference in New Issue
Block a user