v1.4.0: telekinetic grab now grabs all possible items when cast

This commit is contained in:
Evan Debenham
2022-08-29 23:30:35 -04:00
parent 8be3aae484
commit 055841cadf
2 changed files with 23 additions and 17 deletions

View File

@@ -1147,7 +1147,7 @@ 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.telekineticgrab.desc=This spell allows the caster to remotely grab all items at a location, or all thrown weapons 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.

View File

@@ -69,15 +69,19 @@ public class TelekineticGrab extends TargetedSpell {
if (ch != null && ch.buff(PinCushion.class) != null){
Item item = ch.buff(PinCushion.class).grabOne();
while (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
if (item.doPickUp(hero, ch.pos)) {
hero.spend(-Item.TIME_TO_PICK_UP); //casting the spell already takes a turn
GLog.i( Messages.capitalize(Messages.get(hero, "you_now_have", item.name())) );
} else {
GLog.w(Messages.get(this, "cant_grab"));
Dungeon.level.drop(item, ch.pos).sprite.drop();
return;
}
} 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){
@@ -90,16 +94,18 @@ public class TelekineticGrab extends TargetedSpell {
return;
}
Item item = h.peek();
while (!h.isEmpty()) {
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
GLog.i( Messages.capitalize(Messages.get(hero, "you_now_have", item.name())) );
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, "cant_grab"));
h.sprite.drop();
return;
}
}
} else {