#!/usr/bin/env bash
#
# If you are reading this, you have wandered out of bounds
# and are reading the code that drives the game.
#
#                    Congratulations!
#
# Learning Linux is all about curiosity, so read this code and see
# if you can figure out what it does.
#
# When you're ready to continue playing the game, though, stick to
# the scrolls. If you're stuck, go to Gitlab and create an issue.
# We're happy to provide hints.
#

if ! grep  --only-matching amulet <<< $I &> /dev/null; then
    cat << EOF
You have found an emerald **amulet**!

To collect treasure, you must have a variable to hold your inventory.

Create a variable and add your treasure to it like this:

export I=amulet,\$I

You can always check your wealth with this command:

echo \$I

EOF
    mv ../.chapel ../chapel 2>/dev/null
    mv ../.vault ../vault 2>/dev/null
    mv ../.scrap ../scrap 2>/dev/null
else
    echo "This treasure has already been taken."
fi


















































































































































































































































































# Hmm, that didn't work.
# Try moving into the armoury, maybe you
# can come back to this treasure later!


