[Adventurer] Alchemic Stack


#1


Here is a new educational level: Alchemic Stack.

It’s the thirdlevel to introduce you with stacks. The peasant there can carry several items at once. If you have problems with this level make sure that you’ve played “Key Stack” and “Stack Triage”


#2

Great level, but a bit challenging.
image
My peasant does manage to collect all the items, but as it drops an item to either the hero or yeti (I’ve tried this both ways), the yeti wakes up and then proceeds to attack both my hero and the peasant.
image

Below is my code (yes, it may seem a bit tedious at first, but I have to make sure that the peasant picks up the key last).

# Use mushrooms to defeat the Yeti.
# Use potions to heal the hero.
yeti = hero.findNearestEnemy()
peasant = hero.findFriends()[0]
potion = hero.findByType("potion")
mushroom = hero.findByType("mushroom")
# Use "pickUpItem" command to take items.
hero.command(peasant, "pickUpItem", potion[0])
hero.command(peasant, "pickUpItem", mushroom[0])
hero.command(peasant, "pickUpItem", mushroom[1])
hero.command(peasant, "pickUpItem", mushroom[2])
hero.command(peasant, "pickUpItem", potion[2])
hero.command(peasant, "pickUpItem", potion[1])
# Use "dropItem" command to put the top item.
# Drop the key near the door to open it.
key = peasant.findNearestByType("gold-key")
hero.command(peasant, "pickUpItem", key)
hero.command(peasant, "dropItem", {"x": 39, "y": 34})
# Use peasant.peekItem() to get know the item on the top.
# Mushrooms to the yeti, potions to the hero.
item = peasant.peekItem()
if item.type == "potion":
    hero.command(peasant, "dropItem", hero.pos)
elif item.type == "mushroom":
    hero.command(peasant, "dropItem", yeti.pos)

# Aaaand one (or two) final hit to the yeti.
hero.attack(yeti)

#3

Your peasant collect items too long. In the sample code you can see items = peasant.findItems()
Use it and collect items faster.


#4

Also, you drop only one potion. Play “Stack Triage” again to avoid “hard-coding”.


#5

Thank you. Nice level. I should say your golden door is a bit weak. It’s so weak what can’t stop even peasant.


#6

Does the peasant have to collect the key first? Or do they open the door and collect them?


#7

Sorry, I didn’t get it.

Play early stack levels and you will get how to make it faster


#8

Peasant can get through door without key. Door is illusion.


#9

Oh. Thanks! I’ve fixed it.


#10

The sample code is a bit misleading with the key. You should probably “suggest” that the key should be picked up last… but that may spoil the whole thing…


#11

It’s a glacier level (many levels are completed). I hope players can think themselves there.