#!/bin/bash

#display to user game starting story
echo "Welcome to Tricky, Terrifying and Tremendous Text Based Adventure Game!"
echo "You stand on the edge of a cliff with a group of gorillas surrounding you."
echo "Will you jump into the unkown or stand and fight the gorillas?"

#prompt user to choose either to jump or fight
read -p "Type 'jump' or 'fight' to continue: " choice

#case structure to handle the users choice
case "$choice" in
	#if user selects jump. Run block of code
	jump)
	echo "You fall at 100 miles an hour into a pit of darkness. Luckly you fall into a pool of water and survive. You see two tunnels to take."
	echo "Do you turn left, or do you turn right?"

	#prompt user to chooese either left or right
	read -p "Type 'left' or 'right' to continue: " direction

	#case structure to handle users choice
	case "$direction" in
	#if user selects left. Run block of code
	left)
	echo "You take one step and set off a booby trap"
	echo "You are sent down to a chamber where monsters use you as their Sunday dinner. Game Over"
	;;
	#if user selects right. Run block of code
	right)
	echo "You make your way through the tunnel passing by cobwebs, sleeping bats and a dragon somehow."
	echo "Eventually you breath in fresh air and can return home to play Fortnite at long last. You Win!"
	;;
	esac
;;

	#if user selects fight. Run block of code
	fight)
	echo "You think somehow I can beat all these gorillas in a fight. I like your optimism."
	echo "Do you charge head on at the gorillas and hope for the best or do you pull out your sniper and try to hit a crazy trick shot?"
	read -p "Type 'charge' or 'trick' to continue: " attack

	#case structure to handle the users choice
	case "$attack" in
	#if user selects charge. Run block of code
	charge)
	echo "I don't know what you were thinking charging at a group of gorillas who one alone will kill you."
	echo "You obviously die. Game Over!"
	;;
	#if users selects trick. Run block of code
	trick)
	echo "You bull out barret 50 cal out of your pocket, crank 90's on the gorillas and 360 no scope each gorilla with one shot."
	echo "Nice shot. You Win!"
	;;
	esac
;;
esac
