Drug Wars for console. Have fun 😎<br>#!/bin/bash<br># License: GPLv3<br># A Terminal Based Strategy Game<br># Heavily based on a game by John E. Dell 1984, who was ahead of his time.<br># By A. J. S. (2019)<br><br><br>GAMEDATE () { # true to original date, format is MM / DD / YYYY<br> echo $(date --date=" 4 Dec 1983 +"$1" days" +"%m / %d / %y")<br>}<br><br>ROLLPRICES () { # this happens at the start of the game and whenever you jet<br> CPRICE=$(( $(shuf -n1 --input-range=1500-3000) * 10 ))<br> HPRICE=$(( $(shuf -n1 -i500-1400) * 10 ))<br> APRICE=$(( $(shuf -n1 -i100-450) * 10 ))<br> WPRICE=$(( $(shuf -n1 -i30-90) * 10 ))<br> SPRICE=$(( $(shuf -n1 -i7-25) * 10 ))<br> LPRICE=$(( $(shuf -n1 -i1-6) * 10 ))<br>}<br><br><br>TERMINFO () { # terminal based GUI to keep it old school; the WIDTH, WID, WI, W are just shorthand measurements to print blank spaces<br> clear -x<br> WIDTH=$(tput cols)<br> HEIGHT=$(tput lines)<br> let WID=WIDTH/2<br> let HEI=HEIGHT/2<br> let WI=WIDTH/4<br> let HE=HEIGHT/4<br> let W=WIDTH/8<br> let H=HEIGHT/8<br>}<br><br>RESETVALUES () { # initialize the game values<br> DAY=0<br><br> GEO=BRONX<br> CASH=2000<br> GUNS=0<br> BANK=0<br> DEBT=5500<br> MAXLOAN=9450<br> HOLD=100<br><br> SCOCAINE=0<br> SHEROIN=0<br> SACID=0<br> SWEED=0<br> SSPEED=0<br> SLUDES=0<br><br> TCOCAINE=0<br> THEROIN=0<br> TACID=0<br> TWEED=0<br> TSPEED=0<br> TLUDES=0<br><br> STATE=begin<br> DAMAGE=0<br> COPS=0<br>}<br><br>### ROLL INITIAL VALUES ###<br> TERMINFO<br> RESETVALUES<br> ROLLPRICES<br>###########################<br><br>US () { # print underscores<br> printf '%0.s_' $(seq 1 $1)<br>}<br><br>SP () { # print space<br> printf '%0.s ' $(seq 1 $1)<br>}<br><br>BLOCKS () { # print BLOCKS<br> printf '%0.s█' $(seq 1 $1)<br>}<br><br>DSP () { # print space for the products<br> case $1 in<br> C ) space=$((WID-W-9-${#SCOCAINE}))<br> ;;<br> H ) space=$((WID-W-10-${#SHEROIN}))<br> ;;<br> A ) space=$((WID-W-12-${#SACID}))<br> ;;<br> W ) space=$((WID-W-12-${#SWEED}))<br> ;;<br> S ) space=$((WID-W-11-${#SSPEED}))<br> ;;<br> L ) space=$((WID-W-11-${#SLUDES}))<br> ;;<br> B ) space=$((WID-W-13-${#BANK}))<br> ;;<br> D ) space=$((WID-W-13-${#DEBT}))<br> ;;<br> DAMAGE ) space=$((WID-W-13-${#DAMAGE}))<br> ;;<br> COPS ) space=$((WID-W-11-${#COPS}))<br> ;;<br> esac<br><br> printf '%0.s ' $(seq 1 $space)<br>}<br><br>STARTGAME () {<br> TERMINFO<br> STARTMSG=""$(cat << EOF<br><br><br>$(SP $((WID-5)))DRUG WARS<br><br>$(SP $((WID-8)))A GAME BASED ON<br><br>$(SP $((WID-12)))THE NEW YORK DRUG MARKET<br><br><br>$(SP $((WID-11)))BY JOHN E. DELL (1984)<br><br>EOF<br> )""<br> cat <<< $STARTMSG<br> echo<br> SP $((WID-13))<br> read -n1 -p "DO YOU WANT INSTRUCTIONS? "<br> if [[ $REPLY = [y/Y] ]]; then<br> INSTRUCTIONS<br> else<br> MAINMENU<br> fi<br>}<br><br>INSTRUCTIONS () {<br> TERMINFO<br> INSTRUCTIONS=""$(cat << EOF<br><br><br>$(SP $((WID-20)))DRUG WARS<br>$(SP $((WID-20)))This is a game of buying, selling, and<br>$(SP $((WID-20)))fighting. The object of the game is to<br>$(SP $((WID-20)))pay off your debt to the loan shark.<br>$(SP $((WID-20)))Then, make as much money as you can in a<br>$(SP $((WID-20)))1 month period. If you deal too heavily<br>$(SP $((WID-20)))in drugs, you might run into the<br>$(SP $((WID-20)))police $(echo '!!') Your main drug stash will be<br>$(SP $((WID-20)))in the Bronx. (It's a nice neighborhood)<br>$(SP $((WID-20)))The prices of drugs per unit are:<br>$(SP $((WID-20)))<br>$(SP $((WID-20))) COCAINE 15000-30000<br>$(SP $((WID-20))) HEROIN 5000-14000<br>$(SP $((WID-20))) ACID 1000-4500<br>$(SP $((WID-20))) WEED 300-900<br>$(SP $((WID-20))) SPEED 70-250<br>$(SP $((WID-20))) LUDES 10-60<br>$(SP $((WID-20)))<br>$(SP $((WID-20))) (HIT ANY KEY TO START GAME)<br><br>EOF<br> )""<br> cat <<< $INSTRUCTIONS<br> echo<br> read -n1 -p ""<br> MAINMENU<br>}<br><br><br>HUD () { # HUD (Heads Up Display) shows the stash and coat values and is also a function and a variable<br> TERMINFO<br> # insert varying space depending on terminal window size<br> SPW="$(SP $W)"<br><br> HUD=""$(cat << EOF<br><br>${SPW}DATE $(GAMEDATE $DAY)$(SP $((WID-16)))HOLD $HOLD<br><br>${SPW}STASH$(SP $((WID-W-5-$((${#GEO}/2)))))$GEO$(SP $((W-$((${#GEO}/2)))))TRENCHCOAT<br>$(US $WIDTH)<br>${SPW}COCAINE $SCOCAINE$(DSP C) |${SPW}COCAINE $TCOCAINE<br>${SPW}HEROIN $SHEROIN$(DSP H) |${SPW}HEROIN $THEROIN<br>${SPW}ACID $SACID$(DSP A) |${SPW}ACID $TACID<br>${SPW}WEED $SWEED$(DSP W) |${SPW}WEED $TWEED<br>${SPW}SPEED $SSPEED$(DSP S) |${SPW}SPEED $TSPEED<br>${SPW}LUDES $SLUDES$(DSP L) |${SPW}LUDES $TLUDES<br>$(SP $((WID-1))) |<br>${SPW}BANK $BANK$(DSP B) |${SPW}GUNS $GUNS<br>${SPW}DEBT $DEBT$(DSP D) |${SPW}CASH $CASH<br>$(US $WIDTH)<br>EOF<br> )""<br> cat <<< $HUD<br> echo<br>}<br><br><br>SHOWPRICES () { # displays the current prices, changes when ROLLPRICES () happens<br> SPWI="$(SP $WI)"<br> SHOWPRICES=""$(cat << EOF # $(SP $W)<br>HEY DUDE, THE PRICES OF DRUGS HERE ARE:<br><br>${SPWI}COCAINE $CPRICE$(SP $((WID-WI-11-${#CPRICE})))WEED $WPRICE<br>${SPWI}HEROIN $HPRICE$(SP $((WID-WI-11-${#HPRICE})))SPEED $SPRICE<br>${SPWI}ACID $APRICE$(SP $((WID-WI-11-${#APRICE})))LUDES $LPRICE<br>EOF<br> )""<br> HUD<br> cat <<< $SHOWPRICES<br> echo<br>}<br><br>LOAN () { # LOAN sequence<br> HUD<br> read -n1 -p "DO YOU WANT TO VISIT THE LOAN SHARK? "<br> if [[ $REPLY = [y/Y] ]]; then<br> REPAY<br> else<br> STASH<br> fi<br>}<br><br>REPAY () { # REPAY a loan sequence<br> HUD<br> read -p "HOW MUCH TO REPAY? "<br> if [[ $REPLY = 0 ]]; then<br> BORROW<br> elif [[ $REPLY -gt $CASH ]]; then<br> REPAY<br> elif [[ $REPLY -gt $DEBT ]]; then<br> REPAY<br> elif [[ $REPLY -le $CASH ]] && [[ $REPLY -le $DEBT ]]; then<br> let CASH=CASH-REPLY<br> let DEBT=DEBT-REPLY<br> BORROW<br> else<br> BORROW<br> fi<br>}<br><br>BORROW () { # BORROW money from the loan shark<br> HUD<br> read -p "HOW MUCH TO BORROW? "<br> if [[ $REPLY = 0 ]]; then<br> STASH<br> elif [[ $(($REPLY+DEBT)) -le $MAXLOAN ]]; then<br> let DEBT=DEBT+REPLY<br> let CASH=CASH+REPLY<br> STASH<br> elif [[ $(($REPLY+DEBT)) -gt $MAXLOAN ]]; then<br> echo 'YOU THINK HE IS CRAZY MAN !!!'<br> sleep 1<br> let CASH=CASH+REPLY<br> BORROW<br> else<br> LOAN<br> fi<br>}<br><br>STASH () { # STASH or take out drugs from your stash<br> HUD<br> read -n1 -p "DO YOU WISH TO TRANSFER DRUGS TO YOUR STASH? "<br> if [[ $REPLY = [y/Y] ]]; then<br> echo<br> echo<br> STASHING<br> elif [[ $REPLY = [n/N] ]]; then<br> BANKING<br> else<br> BANKING<br> fi<br><br>}<br><br>STASHING () { # Stash product type selector<br> read -n1 -p "WHICH DRUG DO YOU WANT TO STASH OR TAKE? "<br><br> case $REPLY in<br> [c/C] ) STASHDEPOSIT COCAINE<br> ;;<br> [h/H] ) STASHDEPOSIT HEROIN<br> ;;<br> [a/A] ) STASHDEPOSIT ACID<br> ;;<br> [w/W] ) STASHDEPOSIT WEED<br> ;;<br> [s/S] ) STASHDEPOSIT SPEED<br> ;;<br> [l/L] ) STASHDEPOSIT LUDES<br> ;;<br> * ) STASH<br> ;;<br> esac<br>}<br><br>STASHDEPOSIT () { # stashing arithmetic and logic<br> HUD<br> read -p "HOW MUCH $1 DO YOU WANT TO STASH? "<br> if [[ $REPLY = 0 ]]; then<br> echo<br> echo<br> elif [[ $REPLY -le T$1 ]] && [[ $REPLY -gt 0 ]]; then<br> let T$1=T$1-REPLY<br> let S$1=S$1+REPLY<br> let HOLD=HOLD+REPLY<br> else<br> STASH<br> fi<br> HUD<br> unset REPLY<br> read -p "HOW MUCH $1 DO YOU WANT TO TAKE? "<br> if [[ $REPLY = 0 ]]; then<br> echo<br> echo<br> elif [[ $REPLY -le S$1 ]] && [[ $REPLY -gt 0 ]] && [[ $((HOLD-REPLY)) -ge 0 ]]; then<br> let S$1=S$1-REPLY<br> let T$1=T$1+REPLY<br> let HOLD=HOLD-REPLY<br> else<br> STASH<br> fi<br> BANKING<br><br>}<br><br><br><br>BANKING () { # use the bank<br> HUD<br> read -n1 -p "DO YOU WISH TO VISIT THE BANK? " YNO<br> if [[ $YNO = [n/N] ]]; then {<br> echo<br> MAINMENU<br> }<br> elif [[ $YNO = [y/Y] ]]; then {<br> echo<br> read -p "HOW MUCH TO DEPOSIT? "<br> if [[ $REPLY = 0 ]]; then {<br> echo<br> }<br> elif [[ $REPLY -le $CASH ]] && [[ $REPLY -gt 0 ]]; then {<br> let BANK=BANK+REPLY<br> let CASH=CASH-REPLY<br> }<br> elif [[ $REPLY -gt $CASH ]]; then {<br> BANKING<br> }<br> fi<br> HUD<br> read -p "HOW MUCH TO WITHDRAW? "<br># if [[ $REPLY = 0 ]]; then {<br># MAINMENU<br># }<br> if [[ $REPLY -le $BANK ]] && [[ $REPLY -gt 0 ]]; then {<br> let BANK=BANK-REPLY<br> let CASH=CASH+REPLY<br> }<br> elif [[ $REPLY -gt $BANK ]]; then {<br> BANKING<br> }<br> else :;<br> MAINMENU<br> fi<br> MAINMENU<br> }<br> else<br> MAINMENU<br> fi<br><br>}<br><br>MAINMENU () {<br> HUD<br> SHOWPRICES<br> case $STATE in<br> begin ) STATE=normal<br> [[ $DAY = 0 ]] && LOAN<br> ;;<br> BRONXDO ) STATE=normal<br> LOAN<br> ;;<br> normal ) BUYSELLJET<br> ;;<br> esac<br><br> # if [[ $DAY = 30 ]]; then<br> # GAMEOVER<br> # fi<br>}<br><br><br>BUYSELLJET () {<br> STATE=normal<br> read -n1 -p "WILL YOU BUY, SELL OR JET? " BSJ<br> case $BSJ in<br> [b/B] ) echo && BUYING <br> ;;<br> [s/S] ) echo && SELLING<br> ;;<br> [j/J] ) echo && JET<br> ;;<br> * ) MAINMENU<br> ;;<br> esac<br>}<br><br>BUYING () {<br> read -n1 -p "WHAT WILL YOU BUY? "<br> case $REPLY in<br> [c/C] ) BUYDRUG COCAINE<br> ;;<br> [h/H] ) BUYDRUG HEROIN<br> ;;<br> [a/A] ) BUYDRUG ACID<br> ;;<br> [w/W] ) BUYDRUG WEED<br> ;;<br> [s/S] ) BUYDRUG SPEED<br> ;;<br> [l/L] ) BUYDRUG LUDES<br> ;;<br> * ) MAINMENU<br> ;;<br>esac<br>}<br><br>AFFORDABILITY () {<br> let C_AFFORD=CASH/CPRICE<br> let H_AFFORD=CASH/HPRICE<br> let A_AFFORD=CASH/APRICE<br> let W_AFFORD=CASH/WPRICE<br> let S_AFFORD=CASH/SPRICE<br> let L_AFFORD=CASH/LPRICE<br>}<br><br>BUYDRUG () {<br> HUD<br> SHOWPRICES<br> AFFORDABILITY<br> TINYNAME=$(cut -c1 <<< $1)<br> TAFFORD=${TINYNAME}_AFFORD<br> TPRICE=${TINYNAME}PRICE<br> echo "YOU CAN AFFORD ( ${!TAFFORD} )"<br> read -p "HOW MUCH $1 DO YOU WANT TO BUY? "<br> if [[ $REPLY = 0 ]]; then<br> echo<br> MAINMENU<br> elif [[ $REPLY -le ${!TAFFORD} ]] && [[ $REPLY -gt 0 ]] && [[ $((HOLD-REPLY)) -ge 0 ]]; then<br> let T$1=T$1+REPLY<br> let CASH=CASH-$((REPLY*${!TPRICE}))<br> let HOLD=HOLD-REPLY<br> #let T$1=$(bc <<< $(echo T$S1)+$(echo $REPLY))<br> #let CASH=$(bc <<< $(echo $CASH)-$(echo $REPLY)*$(echo $TPRICE))<br> #let T$1=T$1-REPLY<br> #let CASH=CASH+$((REPLY*${!TPRICE}))<br> MAINMENU<br> else<br> MAINMENU<br> fi<br>}<br><br>SELLING () {<br> read -n1 -p "WHAT WILL YOU SELL? "<br> case $REPLY in<br> [c/C] ) SELLDRUG COCAINE<br> ;;<br> [h/H] ) SELLDRUG HEROIN<br> ;;<br> [a/A] ) SELLDRUG ACID<br> ;;<br> [w/W] ) SELLDRUG WEED<br> ;;<br> [s/S] ) SELLDRUG SPEED<br> ;;<br> [l/L] ) SELLDRUG LUDES<br> ;;<br> * ) MAINMENU<br> ;;<br>esac<br>}<br><br>PROFITABILITY () {<br> let C_PROFT=$((COCAINE*CPRICE))<br> let H_PROFIT=$((HEROIN*HPRICE))<br> let A_PROFIT=$((ACID*APRICE))<br> let W_PROFIT=$((WEED*WPRICE))<br> let S_PROFIT=$((SPEED*SPRICE))<br> let L_PROFIT=$((LUDES*LPRICE))<br>}<br><br>SELLDRUG () {<br> HUD<br> SHOWPRICES<br> PROFITABILITY<br> TINYNAME=$(cut -c1 <<< $1)<br> TPRICE=${TINYNAME}PRICE<br> TMAX=T${1}<br> echo "YOU CAN SELL ( ${!TMAX} )"<br> read -p "HOW MUCH $1 DO YOU WANT TO SELL? "<br> if [[ $REPLY = 0 ]]; then<br> echo<br> MAINMENU<br> elif [[ $REPLY -le ${!TMAX} ]] && [[ $REPLY -gt 0 ]]; then<br> #let T$1=((bc <<< $((T$S1-REPLY))))<br> #let CASH=((bc <<< $((CASH+REPLY*TPRICE)))))<br> let T$1=T$1-REPLY<br> let CASH=CASH+$((REPLY*${!TPRICE}))<br> let HOLD=HOLD+REPLY<br> MAINMENU<br> else<br> MAINMENU<br> fi<br>}<br><br>JET () {<br> HUD<br> echo<br> echo "$(SP $W)1"")"" BRONX$(SP $W)2"")"" GHETTO$(SP $W) 3"")"" CENTRAL PARK"<br> echo "$(SP $W)4"")"" MANHATTAN$(SP $((W-4)))5"")"" CONEY ISLAND$(SP $((W-4)))6"")"" BROOKLYN"<br> read -n1 -p "WHERE TO DUDE: "<br> case $REPLY in<br> 1 ) GEO=BRONX<br> STATE=BRONXDO && NEWDAY<br> ;;<br> 2 ) GEO=GHETTO && NEWDAY<br> ;;<br> 3 ) GEO="CENTRAL PARK" && NEWDAY<br> ;;<br> 4 ) GEO=MANHATTAN && NEWDAY<br> ;;<br> 5 ) GEO="CONEY ISLAND" && NEWDAY<br> ;;<br> 6 ) GEO=BROOKLYN && NEWDAY<br> ;;<br> * ) MAINMENU<br> ;;<br> esac<br><br>}<br><br>NEWDAY () {<br> let DAY=DAY+1<br> ROLLPRICES<br> #DEBT=$(bc <<< "$DEBT*1.10")<br> DEBT=$((DEBT*110/100))<br> #BANK=$(bc <<< "$BANK*1.05")<br> BANK=$((BANK*105/100))<br> ROLLFIGHT<br> ROLLEVENT<br> MAINMENU<br>}<br><br>ROLLFIGHT () {<br> FIGHTCHANCE=$(($(shuf -n1 --input-range=1-100)/$((HOLD+1))))<br> if [[ $FIGHTCHANCE -ge 1 ]]; then<br> COPS=$((((FIGHTCHANCE/9))+2))<br> HUD<br> echo<br> read -n1 -p "OFFICER HARDASS AND $COPS OF HIS DEPUTIES ARE CHASING YOU "'!!!!!'<br> FIGHT<br> fi<br>}<br><br>FIGHTHUD () {<br> TERMINFO<br> FIGHTHUD=""$(cat << EOF<br><br><br><br><br><br>$(BLOCKS $WIDTH)<br><br>$(SP $W)DAMAGE $DAMAGE$(DSP DAMAGE)COPS $COPS$(DSP COPS)GUNS $GUNS<br><br>$(BLOCKS $WIDTH)<br>EOF<br> )""<br> cat <<< $FIGHTHUD<br> echo<br> echo<br>}<br><br>FIGHT () {<br> TERMINFO<br> FIGHTHUD<br> # end game if dead<br> if [[ $DAMAGE -ge 50 ]]; then {<br> read -n1 -p 'THEY WASTED YOU MAN !! WHAT A DRAG !!!'<br> exit<br> }<br> fi<br> # no guns fight<br> if [[ $GUNS = 0 ]]; then {<br> read -n1 -p "WILL YOU RUN?"<br> if [[ $REPLY = [r/R/y/Y] ]]; then { # running<br> echo<br> GETAWAY=$(shuf -n1 -i 1-2)<br> if [[ $GETAWAY = 1 ]]; then {<br> FIGHTHUD<br> echo 'YOU LOST THEM IN THE ALLEYS !!'<br> sleep 0.5<br> MAINMENU<br> }<br> else {<br> FIGHTHUD<br> FIRINGONYOU<br> }<br> fi<br> }<br> else {<br> FIGHT<br> }<br> fi<br> }<br> fi<br> # gun fight<br> if [[ $GUNS -gt 0 ]]; then {<br> read -n1 -p "WILL YOU RUN OR FIGHT? "<br> if [[ $REPLY = [r/R] ]]; then { # running<br> echo<br> GETAWAY=$(shuf -n1 -i 1-2)<br> if [[ $GETAWAY = 1 ]]; then {<br> FIGHTHUD<br> read -n1 -p 'YOU LOST THEM IN THE ALLEYS !!'<br> MAINMENU<br> }<br> else {<br> FIGHTHUD<br> FIRINGONYOU<br> }<br> fi<br> }<br> elif [[ $REPLY = [f/F] ]]; then { # fighting<br> FIGHTHUD<br> echo "YOU'RE FIRING ON THEM "'!!'<br> sleep 0.5<br> KILLTHEM=$(($(shuf -n1 -i "0-$((GUNS*2))")))<br> if [[ $KILLTHEM = 0 ]]; then {<br> FIGHTHUD<br> echo 'YOU MISSED THEM !!'<br> sleep 0.5<br> FIRINGONYOU<br> }<br> elif [[ $KILLTHEM -gt 0 ]]; then {<br> FIGHTHUD<br> COPS=$((COPS-1))<br> if [[ $COPS -le 0 ]]; then {<br> FIGHTHUD<br> echo 'YOU KILLED ALL OF THEM!!!!'<br> sleep 0.5<br> FIGHTREWARD<br> }<br> fi<br> echo 'YOU KILLED ONE!!'<br> sleep 0.5<br> FIRINGONYOU<br> FIGHT<br><br> }<br> fi<br> }<br> else {<br> FIGHT<br> }<br> fi<br> }<br> fi<br>}<br><br>FIRINGONYOU () {<br> FIGHTHUD<br> echo 'THEY ARE FIRING ON YOU MAN !!'<br> sleep 0.5<br> DAMAGEHIT=$(($(shuf -n1 -i 0-2)*COPS-$(shuf -n1 -i 2-20)))<br> if [[ $DAMAGEHIT -le 0 ]]; then {<br> FIGHTHUD<br> echo 'THEY MISSED !!'<br> sleep 0.5<br> FIGHT<br> }<br> elif [[ $DAMAGEHIT -gt 0 ]]; then {<br> DAMAGE=$((DAMAGE+DAMAGEHIT))<br> FIGHTHUD<br> echo "YOU'VE BEEN HIT "'!!'<br> sleep 0.5<br> FIGHT<br> }<br> fi<br>}<br><br>FIGHTREWARD () {<br> FIGHTHUD<br> FIGHTREWARD=$(shuf -n1 -i "200-1000")<br> CASH=$((CASH+FIGHTREWARD))<br> read -n1 -p "YOU FOUND $FIGHTREWARD DOLLARS ON OFFICER HARDASS' CARCAS "'!!!'<br> MAINMENU<br>}<br><br>DOCTOR () {<br> FIGHTHUD<br> DOCPRICEMULTIPLY=$(shuf -n1 -i "200-1000")<br> DOC=$((DAMAGE*50))<br> WILL YOU PAY%<br> DOLLARS TO HAVE A DOCTOR SEW YOU UP ?<br>}<br><br>ROLLEVENT () {<br> echo<br> EVENTCHANCE=$(shuf -n1 -i 1-14)<br> case $EVENTCHANCE in<br> [1-2] ) echo<br> ;;<br> 3 ) MUGGED<br> ;;<br> 4 ) COKEBUST<br> ;;<br> 5 ) WEEDBOTTOMOUT<br> ;;<br> 6 ) POLICEDOGS<br> ;;<br> 7 ) BROWNIES<br> ;;<br> 8 ) CHEAPHEROIN<br> ;;<br> 9 ) FINDLUDES<br> ;;<br> 10 ) PARAQUAT<br> ;;<br> 11 ) CHEAPLUDES<br> ;;<br> 12 ) CHEAPACID<br> ;;<br> 13 ) GUNSALE<br> ;;<br> 14 ) COATSALE<br> ;;<br> esac<br>}<br><br>MUGGED () {<br> let CASH=$((CASH*4/5))<br> HUD<br> read -n1 -p 'YOU WERE MUGGED IN THE SUBWAY !!'<br> MAINMENU<br>}<br><br>COKEBUST () {<br> HUD<br> CPRICE=$((CPRICE*6))<br> read -n1 -p 'COPS MADE A BIG COKE BUST !! PRICES ARE OUTRAGEOUS !!'<br> MAINMENU<br><br>}<br><br>WEEDBOTTOMOUT () {<br> HUD<br> WPRICE=$((WPRICE/5))<br> read -n1 -p 'COLOMBIAN FREIGHTER DUSTED THE COAST GUARD !! WEED PRICES HAVE BOTTOMED OUT !!'<br> MAINMENU<br>}<br><br>POLICEDOGS () {<br> if [[ $HOLD -lt 70 ]]; then<br> n=$(shuf -n1 -i 2-5)<br> DRUGSARR=(COCAINE HEROIN ACID WEED SPEED LUDES)<br> for DRUG in ${DRUGSARR[@]}; do<br> DROPPED=$((T$DRUG/$n))<br> let HOLD=$((HOLD+DROPPED))<br> let T$DRUG=$((T$DRUG-DROPPED))<br> done<br> HUD<br> echo "POLICE DOGS CHASE YOU $n BLOCKS "'!!'<br> echo<br> read -n1 -p "YOU DROPPED SOME DRUGS "'!!'" THAT'S A DRAG MAN "'!!'<br> fi<br> MAINMENU<br>}<br><br>BROWNIES () {<br> if [[ $TWEED -gt 1 ]]; then<br> n=$(shuf -n1 -i 1-5)<br> DROPPED=$((TWEED/$n))<br> let HOLD=$((HOLD+DROPPED))<br> let TWEED=$((TWEED-DROPPED))<br> HUD<br> echo 'YOUR MAMA MADE SOME BROWNIES AND USED YOUR WEED !!'<br> sleep 0.5<br> echo<br> read -n1 -p 'THEY WERE GREAT !!'<br> fi<br> MAINMENU<br>}<br><br>CHEAPHEROIN () {<br> HUD<br> HPRICE=$((HPRICE/6))<br> read -n1 -p 'PIGS ARE SELLING CHEAP HEROIN FROM LAST WEEKS RAID !!'<br> MAINMENU<br><br>}<br><br>FINDLUDES () {<br> if [[ $HOLD -gt 30 ]]; then<br> n=$(shuf -n1 -i 1-15)<br> i=$(shuf -n1 -i 1-6)<br> case $i in<br> 1 ) m=COCAINE<br> ;;<br> 2 ) m=HEROIN<br> ;;<br> 3 ) m=ACID<br> ;;<br> 4 ) m=WEED<br> ;;<br> 5 ) m=SPEED<br> ;;<br> 6 ) m=LUDES<br> ;;<br> esac<br> FOUND=$n<br> let HOLD=$(($HOLD-$FOUND))<br> let T$m=$((T$m+$FOUND))<br> HUD<br> read -n1 -p "YOU FIND $n UNITS OF $m ON A DEAD DUDE IN THE SUBWAY "'!!'<br> MAINMENU<br> else<br> MAINMENU<br> fi<br>}<br><br>PARAQUAT () {<br> HUD<br> echo 'THERE IS SOME WEED THAT SMELLS LIKE PARAQUAT HERE !! IT LOOKS GOOD !!'<br> read -n1 -p 'WILL YOU SMOKE IT ?'<br> if [[ $REPLY = [y/Y] ]]; then<br> HUD<br> echo 'YOU HALUCINATE FOR THREE DAYS ON THE WILDEST TRIP YOU EVER IMAGINED !!!'<br> sleep 0.5<br> echo 'THEN YOU DIE BECAUSE YOUR BRAIN HAS DISINTEGRATED !!!'<br> sleep 0.5<br> else<br> MAINMENU<br> fi<br><br>}<br><br>CHEAPLUDES () {<br> HUD<br> LPRICE=$((LPRICE/6))<br> read -n1 -p 'RIVAL DRUG DEALERS RADED A PHARMACY AND ARE SELLING C H E A P L U D E S !!!'<br> MAINMENU<br>}<br><br>CHEAPACID () {<br> HUD<br> APRICE=$((APRICE/10))<br> read -n1 -p 'THE MARKET HAS BEEN FLOODED WITH CHEAP HOME MADE ACID !!!'<br> MAINMENU<br>}<br><br>GUNSALE () {<br> HUD<br> GUNSTOCK=(RUGER ".38 SPECIAL" BARETTA)<br> SHUFGUNS=$(shuf -n1 -i "0-2")<br> GUNPRICE=$(shuf -n1 -i "250-500")<br> read -n1 -p "WILL YOU BUY A ${GUNSTOCK[$SHUFGUNS]} FOR $GUNPRICE""? "<br> if [[ $REPLY = [y/Y] ]]; then {<br> if [[ $CASH -ge $GUNPRICE ]]; then {<br> let CASH=$((CASH-GUNPRICE))<br> let GUNS=$((GUNS+1))<br> }<br> fi<br> }<br> else<br> <br>