Skip to content

Instantly share code, notes, and snippets.

@ferdnyc
Created October 25, 2018 04:08
Show Gist options
  • Save ferdnyc/5f3ff18d87778ec514f79f445cec10d3 to your computer and use it in GitHub Desktop.
Save ferdnyc/5f3ff18d87778ec514f79f445cec10d3 to your computer and use it in GitHub Desktop.
Mirror of "Spode's Bash Godville" code from the GodWiki (wiki.godvillegame.com)
#!/bin/bash
# Spode's version of Godville. Free and open-sourced but give credit where used.
#
# Originally posted to the Godville Wiki
# https://wiki.godvillegame.com/Spode%27s_Bash_Godville
#
# Version: 1.1.2
# Last update: 22:09, 3 June 2012 (UTC)
#MAIN MENU-----------------------
new_game() {
clear;echo "
Welcome to Spode's Bash edition of Godville
Ready to start your new life as a god? Looking
for a stupid mortal to do equally stupid things
in your holy name? You've come to the right place!
"
echo -n "Type in your divine name:";read god;echo $god > /home/Godville/hero_data.txt;
echo -n "Now just type the desired name of your hero:";read hero;echo $hero >> /home/Godville/hero_data.txt;
read -p "Brilliant! Then let's begin - to the home screen!"
echo -e "To Godville!\n0\n0\n100\n100\n0\n0\n0\n16\n0\n0\n100\nPersuade a god to create you (Completed)\n100\n0\n5" >> /home/Godville/hero_data.txt;
echo -e "make something out of nothing\n tell the plumber that his princess is in another castle\nsell some sand to desert nomads\nfind someone who knows the muffin man\nset up a chain mail account\nfind out what the birds and bees actually get up to\nlive today as if there were no tomorrow\nprove that the world is flat\nget aquainted with Charon the ferryman\nbuild an igloo in the desert\noutrun own shadow\nfind the best thing before sliced bread\nfind the Answer to Life, the Universe, and Everything\ngive up drinking\ntake candy from a baby\nfind out for whom the bell tolls\nboldly go where no one has gone before\ndeliver this cookie\nfind a word that rhymes with purple\nfind the point of no return and go past it\nleave no stone unturned\nroll a rock up a hill\nflog a dead horse" > /home/Godville/quests.txt
echo -e "Traveling to the Overworld...\nSearching for the right path by spinning a bottle...\nSearching for the path of least resistance...\nFinding the way by following a snail's trail...\nAround the corner and over the bend...\nClimbing down a bottomless pit...\nSearching for the right path via the goblin positioning system...\nSearching for cheat codes...\nObserving a double rainbow...\nWalking back and forth trying to find his last savepoint...\nThrough dangers untold and hardships unnumbered...\nCruisin' for a bruisin'...\nJust saw a pig fly...\nThrough the wind, rain, snow, fire and brimstone...\nIn desperate need of a monster to kill...\nUpdating his Herobook status...\nTo infinity and beyond...\nOver the hills and through the woods...\nThrough the days and nights...\nOver the hills and far away...\nFollowing the yellow brick road...\nTiptoeing through the tulips...\nSearching for the right path via echolocation...\nSearching for the right path via a search engine...\nSearching for the right path by taking the only path available...\nSearching for the right path using a dowsing rod...\nSearching for the right path using a demagnetized compass...\nFollowing the white rabbit...\nThrough the mires and swamps...\nMaking slow progress in the wrong direction...\nThrough the fog and smog...\nThrough the fire and flames...\nSearching for the right path by the sound of foreboding music...\nSearching for the right path by using a cheat sheet...\nTaking the scenic route...\nSeeking the right path by searching the yellow pages..." > /home/Godville/navigation.txt
echo -e "The hero is crouching in an aesthetic stance, getting ready to pounce on the incoming monster...\nA \${monster} and the hero are comparing their skill levels to see if they can fight a fair duel...\nThe hero marches into battle wih his armour on back-to-front...\nThere's a \${monster} in the way of the hero, look's like a fight is about to break out...\nThe hero suddenly noticed the charging \${monster}...\n\${monster}, incoming!\nThe hero is preparing for battle...\nThe scent of death is in the air! A \${monster} lurks nearby...\nThe \${monster} is engaging the hero...\n\${monster} ahead! The hero marches into battle!" > /home/Godville/battle_begin.txt
echo -e "The hero blows the \${monster} away with his bad breath...\nThe hero is twirling his weapon around in an attempt to impress the \${monster}...\nThe hero managed to counter the attack with his face-to-fist technique...\nThe hero is plotting petty and overly intricate revenge schemes...\nThe hero is torturing the \${monster} with his awful singing...\nThe hero is slapping the \${monster}...\nThe hero is pointing wildly behind the \${monster} and gasping, trying to distract it...\nThe hero is desperately looking for the A button to attack...\nThe hero is sipping tea while waiting for his turn to attack...\nThe \${monster} was rammed for \${m_damage} hp...\nThe hero is trying to transmit his murderous thoughts to the \${monster} telepathically...\nLooking up the \${monster} in the strategy guidebook...\nThe hero is executing a barrel roll to evade the \${monster}...\nThe hero wants to give the \${monster} the old one-two, but has forgotten how to count...\nThe hero is smiting the \${monster}...\nThe \${monster} was facepalmed for \${m_damage} hp...\nThe \${monster} was struck by the hero and lost \${m_damage} hp...\nThe hero landed a \${m_damage} hp martial arts combo on the enemy...\nThe hero and the \${monster} are frozen in a glitch...\nThe hero shouted compliments at the \${monster} for \${m_damage} hp...\nWondering how many kicks it takes to get to the center of this monster...\nThe hero tickled the \${monster} for \${m_damage} hp...\nThe \${monster} was bored for \${m_damage} hp...\nThe \${monster} was annoyed for \${m_damage} hp...\nThe hero high-fived the face of the \${monster} for \${m_damage} hp...\nThe hero huffed and puffed and blew \${m_damage} hp away from the enemy..." > /home/Godville/monster_damaged.txt
echo -e "The \${monster} is holding a focus group on how the hero should be cooked...\nThe \${monster} waits impatiently while the hero checks his email...\nThe \${monster} slaps the hero around a bit with a large trout...\nThe \${monster} is complaining that the hero's weapon is overpowered and should be banned from the game...\nThe \${monster} is complaining to the hero that its health insurance premiums are ridiculous...\nThe \${monster} is chasing the hero all over the place...\n'Ouch, I hope I didn't brain my damage!'\nThe hero got punched in the chops for \${h_damage} hp...\nThe hero is sucking his thumb and whimpering plaintively...\nThe \${monster} is brushing the dust off his clothes and telling the hero a few dirty jokes...\nThe \${monster} unnerves the hero by humming the theme to Jaws...\nThe \${monster} is filing a restraining order against the hero...\nThe \${monster} is trying to assess the amount of damage taken...\nThe hero was poked in the head and lost \${h_damage} hp...\nThe \${monster} challenged the hero to a dance-off...\nThe \${monster} loves the smell of napalm in the morning...\nThe \${monster} is fighting the hero...\nThe hero was poked in the ear and lost \${h_damage} hp...\nThe hero got punched from the left for \${h_damage} hp...\nThe hero got clipped on the back of his head for \${h_damage} hp...\nThe hero was angrily stared at for \${h_damage} hp...\nThe hero takes a beating and loses \${h_damage} hp...\nThe hero got slapped for \${h_damage} hp...\nThe hero's feelings were hurt for \${h_damage} hp...\nThe hero got right-punched by the enemy and lost \${h_damage} hp..." > /home/Godville/hero_damaged.txt
echo -e "Garlic Elemental\nHiggs Bison\nLord of the Keyring\nPrankenstein\nScentipede\nLesser of Two Weevils\nLightsaber-Toothed Tiger\nBeardless Dwarf\nVegetarian Vulture\nPenultimate Samurai\nGeneric Enemy\nPanzer Dragon\nArctic Monkey\nUndead Pixel\nMinitaur\nGrandfather Croc\nBulletproof Monk\nStarfish Trooper\nVamplifier\nReverse Psychologist\nSurreal Killer\nHamburglar\nIrrelephant\nCrash Test Mummy\nKarma Chameleon\nMortal Tomcat\nGold Flinger\nUnhappy Camper\nSchrodinger's Cat\nChocolate Moose\nLoch Ness Lobster\nTweedle Doom\nDream Weaver\nSolar Bear\nTripodal Spider\nMisfortune Teller\nBrainstorm Trooper\nShoop Da Whoop\nEscape Goat\nMathlete\nScared Crow\nTerminator T-34\nTenacious Bee\nIron Chef\nThing From Under the Bed\nUncivil Servant\nSchizophrenic Hydra\nHeffalump\nYellow Bear\nFirefox\nDandy lion\nApocalypse Cow\nGorgon Zola\nEvil Resident\nGlowing Grue\nLost Viking\nSilent Knight\nSpambot\nVogon Poet\nSpice Worm\nThesaurus Rex\nPhilosoraptor\nCard-carrying Villain\nAntihero\nManBearPig\nGrayscaled Dragon\nAdamantine Golem\nTorrent Leech\nBasement Dweller\nGovernator\nGummy Wyrm\nSinging Shark\nRavenous Bugblatter Beast" > /home/Godville/monsters.txt
echo -e "A hero suddenly popped into existence..." > /home/Godville/news.txt;echo -e "Just realised that I'm alive. Now what? I guess I should head to the nearest town..." > /home/Godville/diary.txt;touch /home/Godville/inventory.txt
echo -e "Asking a blind man to point the way to town...\nHopping to town to see if it's faster than walking...\nSaving progress before getting to town...\nCrawling on one arm towards civilization...\nGoing back to town...\nFree-running back to town...\nGoing home...\nSleepwalking back to civilization...\nRunning back to town for food and shelter...\nHiking to a hotel...\nThe hero is feeling homesick...\nMeandering to a hotel...\nLooking forward to a warm bath and a nice tankard of beer...\nHitching a ride to town...\nTaking a wagon into town...\nGoing back to town to replenish beer supplies...\nRolling back to town..." > /home/Godville/town_return.txt
echo -e "Trying to reattach a few lost teeth with super glue...\nApplying healing herbs...\nFound a bunch of medicinal herbs...\nThe hero is using a first aid kit...\nPatching up wounds with duct tape...\nReluctantly debriding wounds with some five-star brandy...\nIntensely looking at his cuts until they heal...\nStitching wounds with a needle and thread...\nTrying to find some strong alcohol to cure a headache...\nStaring at his wounds until they heal...\nSlowly regaining unconsciousness...\nUsing yarrow leaves to stop the bleeding...\nStitching up wounds...\nWaiting for his blood to coagulate...\nTaking a short nap...\nResting under a tree...\nLicking a wound after remembering about saliva's healing effects...\nLicking my wounds and finding them strangely tasty...\nTaking a mud bath...\nArtistically painting some scratches with iodine solution..." > /home/Godville/healing.txt
echo -e "Godville\nBeerburgh\nTrollbridge\nLos Adminos\nLos Demonos\nSan Satanos\nTradeburg\nGodvillewood\nHerolympus\nAnville\nDogville\nDeville" > /home/Godville/towns.txt
echo -e "Threw \${lost_money} coins in a wishing well and wished for more gold. Nice investment, I think.\nHad some fun at the 'Space Bar.' Spent \${lost_money} gold coins.\nHad some fun at 'Molotov's Cocktail Bar'. Spent \${lost_money} coins.\nHad a good time at a crummy joint called 'Khaki-colored Dragon'. Lost \${lost_money} coins.\nHad a hot date last night, or at least I think I did. I can't remember a thing, but \${lost_money} coins are missing from my wallet, so it must have been pretty awesome!\nI remember tons of booze, and then more booze, and then... yeah. Now I'm missing \${lost_money} coins from my pouch. God, I should give up drinking.\nCame out of the hospital and found \${lost_money} gold coins missing. I take it I've had a really good time.\nThe food at 'The Rusty Goblin' was good, but a little overpriced. I paid \${lost_money} coins.\nLost \${lost_money} gold coins gambling in the local tavern. At least this time I kept my pants!\nAttended a concert by the dwarf band 'Burning Beards'. Man, it was awesome, though the ticket was quite pricey. I paid \${lost_money} gold coins for it." > /home/Godville/money_waste.txt
echo -e "Saw a cat run by me with someone else's tongue in its mouth. I wonder what that means...\nI just saw the violence inherent in the system.\nSaw a shady trader by the road. Sat down by him to get out of the sun.\nIt's raining cats and dogs. I hope I don't catch fleas.\nHeard a bloodcurdling scream. Good thing I don't have much blood left to be curdled.\nSat under a palm tree and drew a mysterious pentagram. Unfortunately, nothing happened. Darn it.\nArgued with myself about the existence of pumpkins, cakes, and other anomalies.\nThe lady in the lake kept beckoning me towards her. What a weirdo...\nCan you hear me, Great One? I'm never gonna give you up, never gonna let you down.\nSaw a platypus scuttle by. Omnipotent One, I like your sense of humor.\nWondering how many pages of my diary I've wasted writing down useless sentences like this one.\nOK, so now I know exactly where I am, but have absolutely no idea where I'm going.\nCombed the desert. Didn't find a thing, but it has nice patterns now!\nThat quicksand wasn't very quick.\nPerformed a crash test. Judging by my bruises, I didn't pass.\nMade a mental note but forgot where I put it.\nKnelt beside a dying hero. His last words still ring in my ears: \"See you later!\".\nFound a sword stuck in a rock. Odd! I really can't understand Modern Art.\nFound the meaning of Life, but traded it for a couple of beers.\nJust realised my weapon works much better if I take it out of its scabbard.\nFelt lucky. Threw a coin in the well. Got fined for littering.\nWas abducted by aliens looking for intelligent life forms. Promptly sent back.\nIs it a bird? Is it a plane? No... It's a dragon. I'll just run away now.\nMust. Resist. Urge. To. Cry.\nFound a crashed whale in an open field. Got lost in thought.\nFound sections of a map of Godville oddly printed in the Cyrillic alphabet. It gives me an eerie feeling, as if there were a parallel universe...\nTook time out from my busy schedule of death and destruction for a spot of knitting.\nNote to self: never take apples from wandering archers.\nA traveling wizard showed me a game that plays itself. My Lord, I'm glad you don't waste time like that." > /home/Godville/diary_fun.txt
echo -e "I feel like I'd be a better hero if I had a personal soundtrack.\nStanding at the rim of a deep well, I felt an insidious urge to throw a stone into it. Madness.\nTried to catch and eat some healthy bacteria.\nRested at Vector Field. Now I sense the right direction.\nHeard a strange 'om-nom-nom' sound coming from a nearby pit. Was too afraid to investigate any further.\nFelt itchy. Scratched.\nFell off a cliff and discovered gravity. Again.\nRescued a rabbit. Had a nice dinner.\nWanted to see time fly, so I threw a clock. It wasn't as much fun as I've been told.\nNudge nudge, wink wink. Know what I mean?\nGot stuck in a wall. Hmm... must be a glitch.\nFelt like I was being followed. Started walking backwards.\nWhat is wrong with all these monsters? Why does my pain give them such delight?!\nWaiting for a moment while the scenery loads before me... Ok, moving on.\nA wandering monk said that the gods like to see an atheist around, it gives them something to aim at.\nReal heroes don't cry. They merely perspire through their eyes.\nEntered the forgotten woods. I remember this place from my last visit.\nFelt butterflies in my stomach. I guess eating those caterpillars the other day was a bad idea.\nSaw a blue hedgehog run at an alarmingly fast speed past me. Must be mating season again...\nA priestess told me that my god wants me to 'go forth and multiply'. It's a shame I was never good at maths...\nTried jumping into toxic waste hoping to gain superpowers but all I got was a nasty rash.\nLooked into a mirror. My reflection cowered in fear.\nLost track of time, but carefully checking for footprints.\nStarted counting my limbs, but decided not to get too attached.\nWhilst walking through the forest, I heard a strange noise and saw a large blue box. I decided to ignore it and move on.\nI almost got killed by a shooting star. Thankfully, it ran out of ammo.\nI managed to survive that battle relatively unscathed, exCept fOr thE brAIn daMAg3...\nNoticed a small inscription on my weapon: 'Warranty void if used against monsters'. Darn it!" >> /home/Godville/diary_fun.txt
echo -e "Wow! I feel as if a new me has awakened!\nA ray of healing light shone on me from the sky. It's nice to have a personal god...\nMy wounds are healing way too fast, the sunlight hurts my eyes... Am I becoming a vampire?\nSuddenly, everything around me was filled with vibrant colors... Great One, are you an artist?\nAn incredibly beautiful, full-on double rainbow crossed the sky above me. Thanks Almighty One, I'm glad to know you're still taking care of me.\nJust like that, a warm, fuzzy feeling filled my body. I don't feel like complaining about my health anymore.\nMy life was saved again! I knew you wouldn't leave me in trouble, Great One!\nA flower suddenly shot up and blossomed next to me. Neat.\nA thousand and one yellow daffodils began to dance in front of me. Was that you, Great One? ...or just the mushrooms I ate recently?\nMy head feels like it's bursting with knowledge and wisdom. I wanted to hit it several times to relieve the pressure, but suddenly changed my mind. Was that you, Most Righteous One?" > /home/Godville/encouragement.txt
echo -e "Almost had a thunderbolt hit me in the chest, but I jumped aside at the last moment. What for, my god?! I beg you for mercy...\nA thunderbolt suddenly struck the side of my head. Heard a cheerful cry from the sky: 'Headshot!'\nMay lightning strike me if... Ouch!\nOkay, okay! I get it... No need to be so vindictive, Great One!\nBoils on my skin? Great One, I don't need another reminder of your love for me.\nI was backstabbed with a lightning bolt. My god, was it for the bad thoughts I've been having about you?\nOuch! My Lord, what about the great responsibility that's supposed to come with great power?\nSuddenly I got a splitting headache. Great One, if you don't like what I'm doing, just tell me!" > /home/Godville/punishment.txt
echo -e "Livin' on a prayer...\nPraying to you and praising you, my Lord...\nPraying so hard that I'm bruising my forehead...\nBoosting your ego, m'lord...\nSinging songs of praise to the Almighty...\nWorshipping like a fanatic...\nPraying and praying and praying...\nPraying like a mantis..." > /home/Godville/praying.txt
echo -e "Sent the \${monster} to hell via express post.\nThe dead \${monster} had \${gold} coins in its little coin purse. I looted it, bringing me one step closer to becoming a millionaire.\nThe dead \${monster} had \${gold} coins in its little coin purse. I looted it, bringing me one step closer to world supremacy.\nSadly, the \${monster} didn't carry anything special. At least it had \${gold} coins in its wallet.\nThe \${monster} was defeated. All of your belongings are now mine, you nasty creature! I enriched myself with \${gold} coins.\nRoasted marshmallows over the smouldering corpse of the slaughtered \${monster}.\nThe \${monster} was killed as it tried to escape. It's time to examine the body thoroughly.\nSquashed the \${monster} like a bug. Must remember to clean my shoes the next time I'm in town.\nThe \${monster} fled from the fight. I followed it and found \${gold} gold coins.\nStabbed the \${monster}'s corpse many, many times to make sure it was dead. Yup, it's dead...and it doesn't need these \${gold} gold coins anymore.\nMy final blow struck the \${monster} so hard that it exploded into a shower of \${gold} coins.\nThis \${monster} was really rich. There were \${gold} coins in its pocket.\nThe \${monster} fell before my might. I received \${gold} coins.\nThe \${monster} was successfully converted into \${exp} experience points and \${gold} coins.\nThe \${monster} was shredded into tiny strips. I picked up \${gold} gold coins.\nFinished off the \${monster} with a fatal kick to its head and picked up \${gold} coins.\nSlaughtered the \${monster}. Found \${gold} coins." > /home/Godville/victory_gold.txt
echo -e "Found a new quest written on the billboard near the town hall: \${quest}.\nA suspicious stranger told me that if I \${quest}, I'll probably get a nice reward. I have a bad feeling about this...\nThe mayor of the town asked me to \${quest}. I sense profit!\nThe captain of the city guard ordered me to \${quest}. Sir, yes sir!\nAn old mage asked me to \${quest}. Well, that shouldn't be too hard.\nI met a suspicious stranger in the tavern. He mumbled something about a secret religious organization that needed a brave hero who could \${quest}. Here I am!\nCrazy scientists have given me another quest to undertake: \${quest}.\nI was bored to tears, so I decided to \${quest}. This should be interesting.\nThe local sheriff asked me to \${quest}. I don't want to go to jail, so I'd better do it.\nA strange man with a floating exclamation mark above his head told me to \${quest}.\nA cute little girl wearing a nekomimi asked me to \${quest}. It's a bit weird, but why not embark upon this quest?" > /home/Godville/new_quest.txt
echo -e "The \${monster} refused to take any more blows without consulting its lawyer first.\nI spread my fingers wide, stared like a crazy person, and did an unflattering impression of the \${monster}. The \${monster} stood aside and patiently waited until I finished showing off.\nI tore off the monster’s leg, but \${monster} whined so lamentably that I decided to reattach it.\nMy arm just fell off. Oh well, it's only a flesh wound.\nDid a quadruple kickflip to evade a blow to my knees and bumped my head instead.\nSuddenly got hit on the knee. That really hurt, you know.\nSevered a piece of the monster to check out what was inside it.\nThe \${monster} aimed at gashes in my armor. This is the last time I fall for a merchant selling 'holey' armor.\nI suddenly remembered that I carried a weapon, and struck the \${monster} with it as hard as I could.\nToo busy to write right now. I'm in the middle of a fight.\nI tried to outsmart that \${monster}, but my stupidity got in the way.\nDisarmed the \${monster}. I wonder, what should I do with this arm?\nI accidentally stabbed myself with my weapon. Is this what I've been doing to others?\nTore off a piece of the monster as a keepsake.\nI felt a pang of envy when I looked at the \${monster}. Seems to me that its skin provides much better defense than my armor.\nThe \${monster} aimed at the gaping holes in my armor. Perhaps buying my equipment from the bargain bin wasn't such a good idea after all.\nDeftly evaded a blow to my knees and bumped my head instead.\nNote to self: 'How am I writing in my diary while fighting?'\nAccidentally blocked a kick to the knee, with my face.\nTried to do a full roundhouse kick, but ended up twisting myself knee-deep into the ground. I'm so dexterous!\nBought off the monster with a gold piece.\nArgh! Maybe I shouldn't stop in the middle of a fight to write in my diary.\nDarn! My bulky gear prevented me from dodging a strike. Mental note: replace it with something less cumbersome if I want to stay alive.\nHit my funny bone. Ended up crying. A lot." > /home/Godville/diary_monster.txt
echo -e "Dear Diary, I must confess a secret that's been buried deep within my troubled heart... Darn it! It's a \${monster}!\nOh man, this place is plagued by the \${monster} and its relatives! The toughest one has spotted me and is ready to fight. Well, so am I.\nThey say that a \${monster} is a formidable opponent. Alas, battle is imminent.\nOh Lord, is that a \${monster} on the horizon? I can smell my own fear...\nDarn, I've killed this \${monster} a thousand times, yet it's back again!\nIt's obvious that this \${monster} didn't stop by for a friendly chat. Let's fight!\nThat \${monster} looked at me funny. I guess it's time to kill it.\nA powerful \${monster} appeared on the horizon. I'm crouching carefully.\nHeard a loud growl. Please let that be my stomach... Nope, it's a \${monster}!\nA \${monster} has snuck up on me. I have to take its dare!\nA \${monster} suddenly appeared in front of me. The devil must have brought it here... To arms!\nA vile and filthy \${monster} is robbing the golden brick caravan! I'd better catch him...\nAha, a \${monster}! I shall kill it until it's dead!\nThe vile \${monster} made an insulting remark about my god. It must pay!" > /home/Godville/battle_begin_diary.txt
echo -e "The \${monster} fell right on top of my weapon. Its stomach contents spilled out onto the ground and revealed this \${artifact}.\nThe \${monster} was eliminated. Found this \${artifact}\nFinished off the \${monster} with a fatal kick to its head and picked up this \${artifact}.\nThe \${monster} was killed. Obtained this \${artifact}.\nTried to strike an epic, badass pose to instill fear in my enemy. The \${monster} laughed so hard that it choked and died. Oh well, at least I found this \${artifact} under its corpse!\nThe \${monster} was gloriously torn to pieces! While rifling through its remains, I found this \${artifact}. It needs a good washing before I can sell it though.\nThe \${monster} sang its swan song and vanished. I looted its bag and found this \${artifact}.\nThe last thing the \${monster} saw was me putting its \${artifact} into my bag.\nThe \${monster} suddenly self-destructed, leaving behind its \${artifact}.\nThe \${monster} bled thick, gooey slime. The smell was more pungent than a pile of rotting guts! I held my breath, picked up its \${artifact}, and hustled away.\nThe \${monster} turned to dust. I blew away its ashes and found its \${artifact}.\nThe \${monster} handed me its \${artifact} and threw itself into a nearby volcano." > /home/Godville/victory_artifact.txt
echo -e "dead parrot\ntwo-legged stool\nunbendable spoon\ngodpowder\nheptahedral nut\nlead balloon\nfuzzy dice\neye opener\nunscrewdriver\nvicious circle\nspork\nspeech bubble\nfigment of imagination\nno-leaf clover\ninsufficient fund\ndark side's cookie\nsuggestively shaped object\npiece of kryptonite\nrecycled bin\n'Yes We' can\nlogarithmic abacus\npagan bible\nticket to the eternal void\nsun-protection monocle\nbattery-powered battery charger\ninfinite loop\ninflatable paperweight\nquantum heap\nrules of the internet\nmisfortune cookie\nslapstick\nsalmon of doubt\nSQL injection syringe\nbehemoth-flavored tea\ncontradictionary\nclockwork orange\none-eyed skull\nopened can of worms\ncollection of multi-coloured photons\nteddy bear pelt\ncan of whoopass\nepileptic tree's seed\ndiary page 404\nscheme of b-quark decay\nwriter's block\nbi-polar compass\nassemblage point\ngeneric object\nblack and white pen\nnut on a string\nbriquette of dry wine\nspeeding ticket\nsingle-sided coin\ntooth of a fairy\nsurvival guide\nwirt's other leg\nbottle of beer from a wall\nstandard of idiocy\nRubik's hypercube\nsolar-powered pencil\ntorrent seed\neaster egg\nrolling stone\nnegative feed bag\nbottle of unidentified flying sauce\nshortest suicide note\nred pill of happiness\npair of spherical dice\ncan of dehydrated water\ntoken ring\nperiodic table cloth\nbundle of DNA-chains\nGordian knot\nDevil's avocado" > /home/Godville/artifacts.txt
echo -e "small hadron collider\nrecipe for success\nambience fluxator\nbabel fish\nbioenergy amplifier\nphilosopher's stone\nbucket of antimatter\ncenter of gravity\nchain reactor\nchrono trigger\ncontinuum transfunctioner\ncrumb of wisdom\ndiamond in the rough\ndose of reality\ndragon egg incubator\nheart of gold\neye of the storm\nfinal countdown clock\nflux incapacitor\nfree fall accelerator\ngolden snitch\ngolden ticket\nimprobability drive\nindifference engine\nkey to success\npointy WIZZARD hat\npraystation\nroot of all goodness\nstereotypewriter\nzombie survival kit\nsupersonic screwdriver\nfifth element\nunobtainium" > /home/Godville/bold_artifacts.txt
echo -e "Dropped off the \${artifact} for just \${gold} gold coins...\nSold the \${artifact} for \${gold} gold coins after quite a bit of haggling with the trader...\nHaggled over the price of the \${artifact} and got \${gold} gold coins...\nPersuaded the trader to buy the \${artifact} for a high price - \${gold} gold coins...\nSold the \${artifact} for \${gold} coins...\nFoisted the \${artifact} on the trader for \${gold} coins after one heck of a dispute..." > /home/Godville/artifact_sell.txt
echo -e "The trader swindled the hero and got his \${artifact} for free...\nThe trader conned the hero and got his \${artifact} for a song...\nThe trader fooled the hero and got his \${artifact} for nothing...\nThe trader bamboozled the hero and got his \${artifact} for a song...\nThe trader fleeced the hero and got his \${artifact} for nothing..." > /home/Godville/artifact_free.txt
echo -e "When the trader saw my \${artifact}, the look on his face was almost worth the \${gold} gold coins he gave me for it.\nTried to hypnotize the trader with a swinging pendulum.\nKnocked out a merchant's tooth and sold it to another trader.\nTried using a Jedi mind trick on the trader. Got slapped in the face.\nI purchased 38 gold coins for 38 gold coins. I think it was a fair deal.\nMade the trader an offer he couldn't refuse and earned \${gold} gold coins for the \${artifact}.\nThe price for my \${artifact} in this town is ridiculous - only \${gold} coins. But I'm a ridiculous person.\nI'm so broke, I can't even afford to pay attention.\nBought a fortune cookie. It tasted good, but that piece of paper inside is always difficult to swallow.\nAdded an obscene hieroglyph to the merchant’s signboard.\nHmm... I didn't know that my \${artifact} would be worth \${gold} gold coins. A decent price, I'd say.\nWhen the trader saw my \${artifact}, he grinned slyly and paid me \${gold} coins for it.\nThe trader was so surprised to see my \${artifact}, he immediately shelled out \${gold} coins for the worthless thing. To the tavern!" > /home/Godville/trader_diary.txt
echo -e "Making his way to the local junkyard...\nTelling stories about his heroic deeds...\nLiving La Vida Loca...\nTrying to get the monkey off his back...\nWashing dirty dishes...\nThinking up new ways to waste money...\nTrying to arrange a date, but being blatantly ignored...\nEating a forbidden fruit....\nProcrastinating...\nTried to get a date, but was sadly rejected with a slap and a piercing glare...\nGetting thrown in jail for opening a community chest...\nTaking some time off...\nThe hero is making copies of his diary to be sold as a new superhero comic book...\nThe hero is making copies of his diary to be sold as the next bestselling romance novel...\nThe hero is making copies of his diary to be sold as a new epic tales book...\nThe hero is playing twister with himself...\nHugging a tree...\nLooking around for a place to rest...\nFlirting a little with a town dweller...\nThe hero thinks he is indecisive but can't make up his mind...\nLooking for love in all the wrong places...\nTaking a quick coffee break...\nThe hero has no idea what is going on..." > /home/Godville/town_time.txt
echo -e "Quickly buried my head in the sand, hoping the \${monster} wouldn't notice me.\nI fell over and pretended to have a heart attack. Luckily, it seems to have fooled the \${monster}.\nWhile the \${monster} was trying to recover from my masterful attack, I heroically retreated into the forest.\nHah! My mighty skills are clearly too powerful for the \${monster}. I'll even prove it the next time we meet... after I've healed my wounds, of course.\nI followed my nose and fled from the monster's bloodshot eyes. We'll meet again, \${monster}!\nLuckily, that \${monster} can't move as fast as I can run.\nTold the \${monster} that its shoelaces were untied and made a hasty retreat while it was looking down to check.\nA man can be destroyed, but not defeated, and I’m still intact. We’ll meet again some day, you blasted \${monster}!\nI fled into the forest from the terrible \${monster}. I hope it doesn’t chase after me.\nI curled up in the fetal position and cried. The \${monster} thought I was too pathetic to kill and left me alone.\nI offered to help the \${monster} dig my own grave. When it handed me the shovel, I swung it at its face and ran away.\nI am courageous! I am brave! I shall continue to write about how great I am as soon as I've run away from this \${monster}.\nConvinced the \${monster} to play hide-and-seek with me. While it was counting, I quietly crept away.\nThe \${monster} was too strong. I had to step aside...\nSticks and stones may break my bones, but this \${monster} will definitely kill me. It's time to run away.\nDecided to take another look at the \${monster} from a distance... a very long distance." > /home/Godville/flee.txt
town
}
home_screen() {
index=0;while read line;do h_data[$index]="$line";let index++;done < /home/Godville/hero_data.txt
#level up?
needexp=$(((${h_data[3]} + 1)*100));
if ((${h_data[4]} >= $needexp));then
new_health=$((${h_data[5]} + 4));new_level=$((${h_data[3]} + 1));new_inv=$((${h_data[17]}+1))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "4s/.*/$new_level/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "5s/.*/0/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "6s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "16s/.*/100/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
let "remainder = ${h_data[3]} % 2";if [ "$remainder" = "0" ];then cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "18s/.*/$new_inv/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp;fi
reverse;echo "Hooray! I've reached level $new_level!" >> /home/Godville/diary.txt;reverse;needexp=$((($new_level + 1)*100));
fi
stats;
#menu
if ((${h_data[15]} < 25));then possible="-you don't have enough";else possible="";fi
echo -e "\nRemote control:";echo -e "\n 1. Encouragement (costs 25% godpower) $possible \n 2. Punishment (costs 25% godpower) $possible \n 3. Do nothing \n 4. Change Motto";echo -ne "\nType selection here -->";read menu_choice;
case $menu_choice in
1) if ((${h_data[15]} < 25));then clear;read -p "not enough godpower...";home_screen;else encouragement;fi;;
2) if ((${h_data[15]} < 25));then clear;read -p "not enough godpower...";home_screen;else punishment;fi;;
3) quest;;
4) motto;;
*) echo -e "\nPlease enter a valid selection i.e. a number from the list above.";read -p "";home_screen;;
esac
}
# ACTIVITIES-----------------------------
quest() {
index=0;while read line;do h_data[$index]="$line";let index++;done < /home/Godville/hero_data.txt
quest_decider=$[ $RANDOM % 3 ];
if [[($quest_decider -eq 1) || ($quest_decider -eq 2)]];then #finding the right path by...
nav=`random_line_from /home/Godville/navigation.txt`;echo $nav > /home/Godville/news.txt;diary_fun
progress=$((${h_data[13]} + 4));cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "14s/.*/$progress/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
else #monster appears!
diary_fun
monster=`random_line_from /home/Godville/monsters.txt`;news=`random_line_from /home/Godville/battle_begin.txt`;echo $news | sed -e s/"\${monster}"/"$monster"/g > /home/Godville/news.txt
if (( ( $RANDOM % 5 ) == 1 ));then diary=`random_line_from /home/Godville/battle_begin_diary.txt`;reverse;echo $diary | sed -e s/"\${monster}"/"$monster"/g >> /home/Godville/diary.txt;reverse;fi
stats;sleep 5;hero_health=${h_data[6]};monster_health=$[ ( $RANDOM % 21 ) + 40 ];
until (( ($monster_health <= 0) || ($hero_health <= 0) ));
do
m_damage=$[ $RANDOM % 21 ];
monster_health=$(( $monster_health - $m_damage ));
diary_monster;news=`random_line_from /home/Godville/monster_damaged.txt`;echo $news | sed -e s/"\${monster}"/"$monster"/g -e s/"\${m_damage}"/"$m_damage"/g > /home/Godville/news.txt;stats;
sleep 5;h_damage=$[ $RANDOM % 21 ];
hero_health=$(( $hero_health - $h_damage ));
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/$hero_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
diary_monster;news=`random_line_from /home/Godville/hero_damaged.txt`;echo $news | sed -e s/"\${monster}"/"$monster"/g -e s/"\${h_damage}"/"$h_damage"/g > /home/Godville/news.txt;stats;
if (( $hero_health <= 15 ));then flee;fi
sleep 5;
done
#end of battle - who won? rewards?
if (($hero_health <= 0)); then resurrection;
else
index=0;while read line;do h_data[$index]="$line";let index++;done < /home/Godville/hero_data.txt
echo "Returning to quest..." > /home/Godville/news.txt;new_exp=$[ $RANDOM % 101 ];m_count=$((${h_data[12]} + 1));progress=$((${h_data[13]} + 4));exp=$((${h_data[4]} + $new_exp));
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "5s/.*/$exp/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "14s/.*/$progress/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "13s/.*/$m_count/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
if (( ${h_data[16]} < ${h_data[17]} ));then
if [ $[$RANDOM % 2] == 0 ];then
new_gold=$[ $RANDOM % 41 ];gold=$((${h_data[7]} + $new_gold));
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "8s/.*/$gold/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
victory=`random_line_from /home/Godville/victory_gold.txt`;reverse;echo $victory | sed -e s/"\${monster}"/"$monster"/g -e s/"\${gold}"/"$new_gold"/g | sed -e s/"\${exp}"/"$new_exp"/g >> /home/Godville/diary.txt;reverse;
else
artifact=`artifact_select`;echo $artifact >> /home/Godville/inventory.txt;victory_artifact=`random_line_from /home/Godville/victory_artifact.txt`;arti_count=$((${h_data[16]}+1))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "17s/.*/$arti_count/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
reverse;echo $victory_artifact | sed -e s/"\${monster}"/"$monster"/g -e s/"\${artifact}"/"$artifact"/g -e s/"\${exp}"/"$new_exp"/g >> /home/Godville/diary.txt;reverse
fi
else
new_gold=$[ $RANDOM % 41 ];gold=$((${h_data[7]} + $new_gold));
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "8s/.*/$gold/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
victory=`random_line_from /home/Godville/victory_gold.txt`;reverse;echo $victory | sed -e s/"\${monster}"/"$monster"/g -e s/"\${gold}"/"$new_gold"/g | sed -e s/"\${exp}"/"$new_exp"/g >> /home/Godville/diary.txt;reverse;
town
fi
stats;sleep 1
fi
fi
if (($progress >= 100));then #quest complete?
sleep 5;reverse; echo "Quest to '${h_data[14]}' was completed with excellence! Got a shiny golden brick and felt great about it." >> /home/Godville/diary.txt;reverse;stats
comp_quest="${h_data[14]} (Completed)";temple=$((${h_data[11]} + 1)); echo "Taking time to gather thoughts..." > /home/Godville/news.txt;
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "15s/.*/$comp_quest/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "12s/.*/$temple/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
town
fi
sleep 1; #need to go back to town?
threshold=$(((${h_data[5]}/10)*3))
if ((${h_data[6]} <= $threshold));then echo "Seriously wounded, returning to the city..." > /home/Godville/news.txt;stats;sleep 5;town;fi
home_screen;
}
flee () {
echo "Thinking about fleeing..." > /home/Godville/news.txt;stats;sleep 5
flee=`random_line_from /home/Godville/flee.txt`;reverse;echo $flee | sed -e s/"\${monster}"/"$monster"/g >> /home/Godville/diary.txt;reverse;echo "Running away..." > /home/Godville/news.txt;stats;sleep 5
threshold=$(((${h_data[5]}/10)*5));for (( i=0; i < 3; i++ ));
do
healing=`random_line_from /home/Godville/healing.txt`;echo $healing > /home/Godville/news.txt;new_health=$[ ($RANDOM % $threshold) + ${h_data[6]} ]
if (( $new_health >= ${h_data[5]} )); then new_health=${h_data[5]};fi
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
stats;sleep 5
done;
quest
}
town() {
index=0;while read line;do h_data[$index]="$line";let index++;done < /home/Godville/hero_data.txt
#level up?
needexp=$(((${h_data[3]} + 1)*100));
if ((${h_data[4]} >= $needexp));then
new_health=$((${h_data[5]} + 4));new_level=$((${h_data[3]} + 1));new_inv=$((${h_data[17]}+1))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "4s/.*/$new_level/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "5s/.*/0/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "6s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
let "remainder = ${h_data[3]} % 2";if [ "$remainder" = "0" ];then cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "18s/.*/$new_inv/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp;fi
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "16s/.*/100/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
reverse;echo "Attained level $new_level! I'm honestly too good at this." >> /home/Godville/diary.txt;reverse;needexp=$((($new_level + 1)*100));
fi
for (( i=0; i < 5; i++ ));
do
return_news=`random_line_from /home/Godville/town_return.txt`;echo $return_news > /home/Godville/news.txt;stats;sleep 5;diary_fun
done
town=`random_line_from /home/Godville/towns.txt`;echo "Arrived in $town..." > /home/Godville/news.txt;reverse;
case $[ $RANDOM % 4 ] in
1) echo "Finally arrived at $town. Might want to buy myself a souvenir here." >> /home/Godville/diary.txt ;;
2) echo "Decided to pay a visit to $town." >> /home/Godville/diary.txt ;;
3) echo "Hmm, $town... I think I'll drop by for a drink or two." >> /home/Godville/diary.txt ;;
esac
reverse;stats;sleep 5
threshold=$(((${h_data[5]}/10)*4)) #healing
if (( ${h_data[6]} < ${h_data[5]} ));then
reverse;echo "Healed my wounds and relaxed." >> /home/Godville/diary.txt;reverse
for (( i=0; i < 3; i++ ));
do
healing=`random_line_from /home/Godville/healing.txt`;echo $healing > /home/Godville/news.txt;new_health=$[ ($RANDOM % $threshold) + ${h_data[6]} ]
if (( $new_health >= ${h_data[5]} )); then new_health=${h_data[5]};fi
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
stats;sleep 5
done;
reverse;echo "Rested. Now it's time to get back to business." >> /home/Godville/diary.txt;reverse;
fi;
if (( ${h_data[16]} >= 1 ));then #any artifacts to sell?
index=0;while read line;do artifact[$index]="$line";let index++;done < /home/Godville/inventory.txt
echo "Being dragged into the store by an insolent trader..." > /home/Godville/news.txt;stats;sleep 5;echo "Hero is staring at the counter..." > /home/Godville/news.txt;stats;sleep 5
for artifact in "${artifact[@]}";
do
if (( $[$RANDOM % 5] == 1));then
arti_count=$((${h_data[16]}-1));cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "17s/.*/$arti_count/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
artifact_news=`random_line_from /home/Godville/artifact_free.txt`;echo $artifact_news | sed -e s/"\${artifact}"/"$artifact"/g > /home/Godville/news.txt;
sed -i "/$artifact/ d" /home/Godville/inventory.txt
else
if grep -Fxq "$artifact" /home/Godville/bold_artifacts.txt;then
new_gold=$[ ($RANDOM % 201) + 300];
else
new_gold=$[ ($RANDOM % 200) + 1];
fi;
gold=$((${h_data[7]} + $new_gold));
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "8s/.*/$gold/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
artifact_sell=`random_line_from /home/Godville/artifact_sell.txt`;echo $artifact_sell | sed -e s/"\${artifact}"/"$artifact"/g -e s/"\${gold}"/"$new_gold"/g > /home/Godville/news.txt;
if (( $[ $RANDOM % 6 ] == 1 ));then artifact_diary=`random_line_from /home/Godville/trader_diary.txt`;reverse;echo $artifact_diary | sed -e s/"\${artifact}"/"$artifact"/g -e s/"\${gold}"/"$new_gold"/g >> /home/Godville/diary.txt;reverse;fi
arti_count=$((${h_data[16]}-1));cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "17s/.*/$arti_count/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
sed -i "/$artifact/ d" /home/Godville/inventory.txt
fi
stats;sleep 5
done
echo "Hero is staring at the counter..." > /home/Godville/news.txt;stats;sleep 5
case $[$RANDOM % 4] in
0)reverse;echo "The weight from all this gold would do better as beer in my belly. I'm off to lighten my load..." >> /home/Godville/diary.txt;reverse;;
1)reverse;echo "Uh-oh! Spotted one of my biggest stalkers and had to quickly leave the store." >> /home/Godville/diary.txt;reverse;;
2)reverse;echo "Shouted 'Clean up in aisle 4!' and quickly left before anyone could figure out who let the elephant into the shop." >> /home/Godville/diary.txt;reverse;;
3)reverse;echo "Left the shop hastily. Didn't buy anything or bother about the mess in the back room for that matter." >> /home/Godville/diary.txt;reverse;;
esac
fi
#forge a gold brick?
if (( ${h_data[7]} >= 3000 ));then
chance=$( $RAND % 2 );
if ( $chance == 1 );then
reverse;echo "Had a new gold brick forged from 3000 gold coins!" >> /home/Godville/diary.txt;reverse;temple=$((${h_data[11]} + 1));gold=$((${h_data[7]} - 3000))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "8s/.*/$gold/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "12s/.*/$temple/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
echo "Bidding farewell to the blacksmith..." > /home/Godville/news.txt;stats;sleep 2
fi
fi
#new quest needed?
if [[ ${h_data[14]} =~ "Completed" ]];then
new_quest=`random_line_from /home/Godville/quests.txt`;q_numb=$((${h_data[8]} + 1))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "9s/.*/$q_numb/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "15s/.*/$new_quest/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "14s/.*/0/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
quest_entry=`random_line_from /home/Godville/new_quest.txt`;reverse;echo $quest_entry | sed -e s/"\${quest}"/"$new_quest"/g >> /home/Godville/diary.txt;reverse;
fi
#money-wasting
lost_money=$[ $RANDOM % 101 ];gold=$((${h_data[7]}-$lost_money));echo "Wandering through town..." > /home/Godville/news.txt;
if (( $gold > 0 ));then
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "8s/.*/$gold/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
good_time=`random_line_from /home/Godville/money_waste.txt`;reverse;echo $good_time | sed -e s/"\${lost_money}"/"$lost_money"/g >> /home/Godville/diary.txt;reverse;
fi
stats;sleep 5
for (( i=0; i < 5; i++ )); #time-wasting
do
town=`random_line_from /home/Godville/town_time.txt`;echo $town > /home/Godville/news.txt;diary_fun
stats;sleep 5
done
if (( ${h_data[15]} < 100 ));then #praying
for (( i=0; i < 3; i++ ));
do
praying=`random_line_from /home/Godville/praying.txt`;echo $praying > /home/Godville/news.txt;new_godpower=$[($RANDOM % 26)+${h_data[15]}];if (( $new_godpower >= 100 ));then new_godpower=100;fi
diary_fun;cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "16s/.*/$new_godpower/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
stats;sleep 5
done
fi
echo "Returning to the quest..." > /home/Godville/news.txt;reverse;echo "Back on the warpath." >> /home/Godville/diary.txt;reverse;stats;sleep 2;home_screen
}
#REMOTE CONTROL---------------------
resurrection() {
index=0;while read line;do h_data[$index]="$line";let index++;done < /home/Godville/hero_data.txt
d_count=$((${h_data[9]} + 1));
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "10s/.*/$d_count/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/${h_data[5]}/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
clear;read -p "Your hero has died. Press enter to resurrect...";echo "Got resurrected in the nearest temple..." > /home/Godville/news.txt
home_screen;
}
encouragement() {
echo "Streams of benevolent consciousness are pouring down from the heavens..." > /home/Godville/news.txt;encourage=`random_line_from /home/Godville/encouragement.txt`;personality=$((${h_data[10]}+1))
threshold=$(((${h_data[5]}/10)*3));new_health=$[ ($RANDOM % $threshold) + ${h_data[6]} ];if (( $new_health > ${h_data[5]} ));then new_health=${h_data[5]};fi;new_godpower=$((${h_data[15]}-25))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "16s/.*/$new_godpower/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "11s/.*/$personality/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
if (( ${h_data[7]} >= 3000 ));then #forge a gold brick?
chance=$( $RAND % 1 );
if ( $chance == 1 );then
reverse;echo "Mysterious forces created a golden brick in my wallet. Almighty One, was that your doing?" >> /home/Godville/diary.txt;reverse;temple=$((${h_data[11]} + 1));gold=$((${h_data[7]} - 3000))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "8s/.*/$gold/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "12s/.*/$temple/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
echo "Gathering my thoughts..." > /home/Godville/news.txt;stats;sleep 2
fi;
else reverse;echo $encourage >> /home/Godville/diary.txt;reverse;
fi
stats;sleep 5;quest
}
punishment() {
echo "Streams of malicious consciousness are pouring down from the heavens..." > /home/Godville/news.txt;punish=`random_line_from /home/Godville/punishment.txt`;personality=$((${h_data[10]}-1))
threshold=$(((${h_data[5]}/10)*3));new_health=$[ ${h_data[6]}-($RANDOM % $threshold) ];if (( $new_health <= 0 ));then new_health=1;fi;new_godpower=$((${h_data[15]}-25))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "7s/.*/$new_health/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "16s/.*/$new_godpower/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "11s/.*/$personality/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
if (( ${h_data[7]} >= 3000 ));then #forge a gold brick?
chance=$( $RAND % 1 );
if ( $chance == 1 );then
reverse;echo "Mysterious forces created a golden brick in my wallet. Almighty One, was that your doing?" >> /home/Godville/diary.txt;reverse;temple=$((${h_data[11]} + 1));gold=$((${h_data[7]} - 3000))
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "8s/.*/$gold/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "12s/.*/$temple/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
echo "Gathering my thoughts..." > /home/Godville/news.txt;stats;sleep 2
fi
else reverse;echo $punish >> /home/Godville/diary.txt;reverse;
fi
stats;sleep 5;quest
}
motto () {
clear;echo -n "Type your hero's new motto here:";read motto
cp /home/Godville/hero_data.txt /home/Godville/hero_data.txt.temp;sed "3s/.*/$motto/" /home/Godville/hero_data.txt.temp > /home/Godville/hero_data.txt;rm /home/Godville/hero_data.txt.temp
home_screen
}
#UTILITIES-----------------------
random_line_from()
{
LINES=`cat "$1" | wc -l`
LINE=`expr $RANDOM % $LINES + 1`
head -$LINE $1 | tail -1
}
diary_fun() {
chance=$[ $RANDOM % 5 ];
if [ $chance == 1 ];then
reverse
diary=`random_line_from /home/Godville/diary_fun.txt`;echo $diary >> /home/Godville/diary.txt
reverse
fi
}
diary_monster() {
chance=$[ $RANDOM % 10 ];
if [ $chance == 1 ];then
reverse
diary=`random_line_from /home/Godville/diary_monster.txt`;echo $diary | sed -e s/"\${monster}"/"$monster"/g >> /home/Godville/diary.txt
reverse
fi
}
reverse () {
cp /home/Godville/diary.txt /home/Godville/temp.txt;cat -n /home/Godville/temp.txt | sort -r | cut -f2-20 > /home/Godville/diary.txt; rm /home/Godville/temp.txt
}
artifact_select () {
if [ $[$RANDOM % 5] == 1 ];then
random_line_from /home/Godville/bold_artifacts.txt
else
random_line_from /home/Godville/artifacts.txt
fi
}
stats() {
index=0;while read line;do h_data[$index]="$line";let index++;done < /home/Godville/hero_data.txt;
cp /home/Godville/diary.txt /home/Godville/diary.txt.temp;head -10 /home/Godville/diary.txt.temp > /home/Godville/diary.txt;rm /home/Godville/diary.txt.temp
earthly_news=`cat /home/Godville/news.txt`;hero_diary=`cat /home/Godville/diary.txt`;inventory=`cat /home/Godville/inventory.txt`
personalities=("Pure evil!" "Pure evil" "Pure evil" "Pure evil" "Pure evil" "Pure evil" "Vicious" "Vicious" "Vicious" "Vicious" "Cruel" "Cruel" "Cruel" "Wicked" "Wicked" "Spiteful" "Neutral" "Gentle" "Kind" "Kind" "Righteous" "Righteous" "Righteous" "Virtuous" "Virtuous" "Virtuous" "Virtuous" "Pure good" "Pure good" "Pure good" "Pure good" "Pure good" "Pure good!");
personality=${personalities[${h_data[10]}]};
clear;time=`date`;echo "
Greetings ${h_data[0]},
You currently have ${h_data[15]}% godpower.
Data taken from: $time
--Hero--
Name: ${h_data[1]}
Motto: ${h_data[2]}
Personality: $personality
Level: ${h_data[3]} (${h_data[4]}/${needexp} exp)
Health: ${h_data[6]}/${h_data[5]}
Quest: No.${h_data[8]} ${h_data[14]} (${h_data[13]}%)
Gold: ${h_data[7]} coins
Monsters killed: ${h_data[12]}
Death count: ${h_data[9]}
Bricks for temple: ${h_data[11]}/1000
--Inventory-(${h_data[16]}/${h_data[17]})--
$inventory
--------------------------------------------------------------------------------
Earthly News
$earthly_news
--------------------------------------------------------------------------------
Hero's Diary
$hero_diary
--------------------------------------------------------------------------------
"
}
# START-UP----------------
if [ ! -d /home/Godville ];then
mkdir /home/Godville;
new_game;
else
home_screen;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment