grim/gigamole

1903f369cb4a
Parents
Children ed69802d944c
Finally import this into version control...
  • +1475 -0
    gigamole.bas
  • --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/gigamole.bas Sun Feb 12 21:10:19 2017 -0600
    @@ -0,0 +1,1475 @@
    +'****************************Declare Functions*******************************
    +DECLARE FUNCTION RandInt! (num1!, num2!)
    +DECLARE FUNCTION SaveClose! ()
    +'*******************************Declare Subs*********************************
    +DECLARE SUB McMole (snd!)
    +DECLARE SUB CenterT (Text$, y!, clr!)
    +DECLARE SUB Dead (xists!)
    +DECLARE SUB CheckBounds (Variable!)
    +DECLARE SUB RestorePalette ()
    +DECLARE SUB knife ()
    +DECLARE SUB debug (Happy!, Awake!, bo!, Hungry!, Mad!, Ill!, broom!, Od!, Drunk!)
    +DECLARE SUB IncrementVariable (ticks!, Variable!, value!, increment!, index!)
    +DECLARE SUB DecrementVariable (ticks!, Variable!, value!, decrement!, index!)
    +DECLARE SUB CheckProblems (Variable!, value!, problem!, probstr$)
    +DECLARE SUB Speak (times!, delay!)
    +DECLARE SUB KillDataFile (xists!)
    +DECLARE SUB Refresh (x!, y!, sl!)
    +DECLARE SUB Save (new!, snd!, Happy!, Awake!, bo!, Hungry!, Mad!, sick!, broom!, Od!, Drunk!, months!, weeks!, days!, autosave!, AnimateMenu!)
    +DECLARE SUB MainMenu (sel!, sl$)
    +DECLARE SUB grimstext (line$, clr1!, clr2!, clr3!, x!, y!)
    +DECLARE SUB center (line$, y!, clr!)
    +DECLARE SUB Slow (delay!)
    +DECLARE SUB anti ()
    +DECLARE SUB grim ()
    +DECLARE SUB WIN (snd!)
    +DECLARE SUB seizure ()
    +DECLARE SUB help ()
    +DECLARE SUB juggle (sl!)
    +DECLARE SUB beer (snd!)
    +DECLARE SUB OverDose (snd!, sl!)
    +DECLARE SUB heartattack (snd!)
    +DECLARE SUB weed (snd!)
    +DECLARE SUB bathroom (snd!)
    +DECLARE SUB doctor (snd!)
    +DECLARE SUB z1 ()
    +DECLARE SUB z2 ()
    +DECLARE SUB food (snd!)
    +DECLARE SUB pun (snd!)
    +DECLARE SUB Face (x!, y!)
    +DECLARE SUB shower ()
    +DECLARE SUB omouth ()
    +DECLARE SUB cmouth ()
    +DECLARE SUB eopen (ex!, ey!)
    +DECLARE SUB eclose (ex!, ey!)
    +DECLARE SUB UpdateMenu ()
    +
    +COMMON SHARED AnimateMenu, MenuTimer, MenuColor
    +
    +CONST sclr = 11, oclr = 1
    +CONST True = 1, False = 0
    +CONST PI = 3.141593
    +
    +CLS
    +CenterT "Despite the long wait this is not the final version.", 1, 7
    +CenterT "Yes, I know, I've been working on this forever, but I want", 2, 7
    +CenterT "it to be perfect! And by that I mean no bugs and no glitches.", 3, 7
    +CenterT "So by playing this early version you agree that if you find", 5, 7
    +CenterT "anything that seems wrong, or something does not work, that", 6, 7
    +CenterT "you'll let me know! Call me if you know my number or else", 7, 7
    +CenterT "E-Mail Me : " + CHR$(34) + "GRiMofMS@AOL.COM" + CHR$(34), 9, 7
    +CenterT "Trust me, this game is well worth the wait! And the sequel,", 11, 7
    +CenterT "Opps, I shouldn't have said that... But anyways, it's going", 12, 7
    +CenterT "to be much better and if all goes according to plan, the user", 13, 7
    +CenterT "will be able to create their own animation sequences for the", 14, 7
    +CenterT "game! Not to mention everything else I have planned.", 15, 7
    +CenterT "But I bet No one will ever read to this far, so I'm gunna make", 17, 7
    +CenterT "you wait at 10 seconds before this screen will dispear!", 18, 7
    +CenterT "Aren't I a little shit!?!", 20, 7
    +COLOR 31, 7
    +LOCATE 22, 38: PRINT "Wait"
    +t = TIMER
    +Keys$ = ""
    +DO WHILE TIMER - t < 10
    + Key$ = INKEY$
    + IF LEN(Key$) THEN Keys$ = Keys$ + UCASE$(Key$)
    + IF Keys$ = "OK" THEN EXIT DO
    +LOOP
    +COLOR 0, 0
    +CenterT " Ok ", 22, 7
    +WHILE INKEY$ = ""
    +WEND
    +
    +AnimateMenu = False
    +MenuColor = 4
    +
    +TYPE Save
    + new AS INTEGER: snd AS INTEGER: Awake AS INTEGER: happ AS INTEGER: body AS INTEGER
    + hung AS INTEGER: madd AS INTEGER: sikk AS INTEGER: room AS INTEGER: Od AS INTEGER
    + Drunk AS INTEGER: months AS INTEGER: weeks AS INTEGER: days AS INTEGER: autosave AS INTEGER
    + AnimateMenu AS INTEGER
    +END TYPE
    +
    +DIM SHARED Game AS Save
    +DIM SHARED problem$(6)
    +DIM SHARED oprob(6)
    +DIM SHARED cprob(6)
    +DIM SHARED DebugMenu$(11)
    +DIM SHARED Variable(10)
    +
    +FOR i = 0 TO 6
    + oprob(i) = TIMER
    +NEXT
    +
    +OPEN "GIGAMOLE.DAT" FOR BINARY AS #1
    +GET #1, , Game
    + new = Game.new: snd = Game.snd: Happy = Game.happ: Awake = Game.Awake
    + bo = Game.body: Hungry = Game.hung: Mad = Game.madd: sick = Game.sikk
    + broom = Game.room: Od = Game.Od: Drunk = Game.Drunk: months = Game.months
    + weeks = Game.weeks: days = Game.days: autosave = Game.autosave: AnimateMenu = Game.AnimateMenu
    +CLOSE #1
    +
    +IF new = 0 THEN
    + new = 1: snd = 1: Happy = 90: Awake = 100: bo = 0: Hungry = 10: Mad = 5
    + sick = 0: broom = 0: Od = 0: Drunk = 0: months = 0
    + weeks = 0: days = 0: autosave = 1: AnimateMenu = False
    +END IF
    +
    +'**************************Start of title screen*****************************
    +RestorePalette
    +CLS 0
    +SCREEN 7
    +PALETTE sclr, MenuColor
    +grim
    +anti
    +CLS
    +
    +'***************************Start of actual game*****************************
    +Game:
    +RANDOMIZE TIMER
    +CLS
    +st = 0: ss = 0: sel = 1: eye = 0: Mole = 0: xists = 0: sl = 0: eye = 1
    +ed = TIMER: md = TIMER: dm = TIMER: d = TIMER: problem = 0: cheat$ = ""
    +MenuTimer = TIMER
    +MoleColor = 6
    +IF autosave = 0 THEN
    + AutoSaveDelay = TIMER
    +END IF
    +
    +Refresh 0, 0, sl
    +DO
    + IF Mad = 100 THEN
    + seizure
    + Dead xists
    + END IF
    + IF Drunk >= 85 THEN
    + heartattack snd!
    + Dead xists
    + END IF
    + IF Od >= 85 THEN
    + OverDose snd!, sl
    + Dead xists
    + END IF
    + IF Happy <= 10 THEN
    + knife
    + Dead xists
    + END IF
    + '*************************Check for Problems*****************************
    + CheckProblems broom, 60, problem, "Bathroom"
    + CheckProblems Ill, 35, problem, "Ill"
    + CheckProblems bo, 55, problem, "Stinks"
    + CheckProblems Mad, 55, problem, "Mad"
    + CheckProblems Hungry, 45, problem, "Hungry"
    + CheckProblems (-1 * Awake), (-1 * 40), problem, "Tired"
    + CheckProblems (-1 * Happy), (-1 * 30), problem, "Sad"
    + IF problem = 0 THEN
    + problem$(0) = "None"
    + END IF
    + '*************************increment variables****************************
    + IncrementVariable ticks, broom, 45, 10, 0
    + IncrementVariable ticks, sick, 45, 5, 1
    + DecrementVariable ticks, Awake, 30, 5, 2
    + IncrementVariable ticks, Hungry, 30, 30, 3
    + DecrementVariable ticks, Mad, 30, 5, 4
    + IncrementVariable ticks, bo, 20, 10, 5
    + SELECT CASE INT(2 * RND(1))
    + CASE 0: DecrementVariable ticks, Happy, 10, 3, 6
    + CASE 1: IncrementVariable ticks, Happy, 10, 3, 6
    + END SELECT
    + IF bo > 90 AND s / 10 = INT(s / 10) THEN
    + Happy = Happy - 1: CheckBounds Happy
    + END IF
    + FOR fp = 0 TO 5
    + cprob(fp) = TIMER
    + NEXT
    + '%%%%%%%%%%%%%%%%%%%%End of Incrementing Variables%%%%%%%%%%%%%%%%%%%%%%%
    + IF AnimateMenu = False AND MenuColor <> 4 THEN
    + PALETTE sclr, 4
    + END IF
    + UpdateMenu
    + IF autosave = 0 AND TIMER - AutoSaveDelay > 60 THEN
    + Save new, snd, Happy, Awake, bo, Hungry, Mad, sick, broom, Od, Drunk, months, weeks, days, autosave, AnimateMenu
    + center "Auto save in progress", 2, 7
    + Slow .5
    + center "", 2, 0
    + AutoSaveDelay = TIMER
    + END IF
    + IF Awake = 0 THEN sl = 1
    + IF sl = 0 AND ss = 0 THEN
    + eclose 0, 0
    + st = TIMER
    + ss = 1
    + END IF
    + IF TIMER - d > 10 THEN
    + ticks = ticks + 1
    + days = days + 1
    + IF days = 7 THEN
    + days = 0
    + weeks = weeks + 1
    + END IF
    + IF weeks = 4 THEN
    + weeks = 0
    + months = months + 1
    + END IF
    + d = TIMER
    + END IF
    + '**************************Manip time and date***************************
    + nosec$ = LEFT$(TIME$, 5)
    + IF VAL(LEFT$(nosec$, 2)) > 12 THEN
    + nosec$ = STR$(VAL((LEFT$(nosec$, 2))) - 12) + RIGHT$(nosec$, 3) + " PM"
    + ELSE
    + nosec$ = nosec$ + " AM"
    + END IF
    + IF VAL(LEFT$(nosec$, 2)) = 0 THEN
    + nosec$ = "12" + RIGHT$(nosec$, LEN(nosec$) - 2)
    + END IF
    + noyear$ = DATE$
    + noyear$ = LEFT$(noyear$, 2) + "/" + LEFT$(RIGHT$(noyear$, 7), 2) + "/"
    + noyear$ = noyear$ + RIGHT$(DATE$, 2)
    + '**************************Visual Problems****************************
    + SELECT CASE Mad
    + CASE IS >= 90: PALETTE 14, 12
    + CASE IS < 90: PALETTE 14, 14
    + END SELECT
    + SELECT CASE snd
    + CASE 0: snd$ = "Off"
    + CASE 1: snd$ = "On "
    + END SELECT
    + SELECT CASE autosave
    + CASE 0: autosave$ = "On "
    + CASE 1: autosave$ = "Off"
    + END SELECT
    + center ": " + snd$ + " Auto-Save: " + autosave$, 19, 3
    + IF months = 12 THEN
    + WIN snd!
    + KillDataFile xists
    + END
    + END IF
    + '*****************************Main Screen*******************************
    + grimstext "giga mole!", 1, 4, 2, 15, 1
    + SELECT CASE sl
    + CASE 0: sl$ = "Sleep"
    + CASE 1: sl$ = "Wake "
    + END SELECT
    + MainMenu sel, sl$
    + '*****************************animate mole*******************************
    + SELECT CASE Mole
    + CASE 1:
    + IF TIMER - dm > 1 THEN
    + CIRCLE (111, 68), 3, 14: CIRCLE (111, 68), 2, MoleColor: PAINT (111, 68), MoleColor, MoleColor
    + Mole = 0: dm = TIMER
    + END IF
    + CASE 0:
    + IF TIMER - dm > 1 THEN
    + CIRCLE (111, 68), 3, MoleColor: Mole = 1: dm = TIMER
    + END IF
    + END SELECT
    + '****************************Eye Animation*******************************
    + SELECT CASE eye
    + CASE 0:
    + IF TIMER - ed > .5 AND sl = 0 THEN
    + eopen 0, 0: eye = 1: ed = TIMER
    + ELSEIF TIMER - ed > .5 AND sl = 1 THEN
    + CALL z1: eye = 1: ed = TIMER: eclose 0, 0
    + END IF
    + CASE 1:
    + IF TIMER - ed > 2 AND sl = 0 THEN
    + eclose 0, 0: eye = 0: ed = TIMER
    + ELSEIF TIMER - ed > .5 AND sl = 1 THEN
    + CALL z2: eye = 0: ed = TIMER: eclose 0, 0
    + END IF
    + END SELECT
    +
    + Key$ = INKEY$
    + SELECT CASE Key$
    + CASE CHR$(0) + "D"
    + IF sel = 7 THEN debug Happy, Awake, bo, Hungry, Mad, Ill, broom, Od, Drunk
    + CASE CHR$(0) + ";" 'F1
    + help
    + Refresh 0, 0, sl
    + CASE CHR$(0) + "<" 'F2
    + SELECT CASE snd
    + CASE 0: snd = 1: SOUND 200, .5
    + CASE 1: snd = 0
    + END SELECT
    + CASE CHR$(0) + "=" 'F3
    + center "Saving game...", 2, 7
    + Save new, snd, Happy, Awake, bo, Hungry, Mad, sick, broom, Od, Drunk, months, weeks, days, autosave, AnimateMenu
    + center "", 2, 0
    + CASE CHR$(0) + ">" 'F4
    + SELECT CASE autosave
    + CASE 0: autosave = 1
    + CASE 1: autosave = 0: AutoSaveDelay = TIMER
    + END SELECT
    + CASE CHR$(0) + "?"'F5
    + IF AnimateMenu = True THEN
    + AnimateMenu = False
    + ELSEIF AnimateMenu = False THEN
    + AnimateMenu = True
    + END IF
    + CASE CHR$(0) + "K":
    + SELECT CASE sel
    + CASE 1, 4, 7: sel = sel + 2
    + CASE ELSE: sel = sel - 1
    + END SELECT
    + CASE CHR$(0) + "M":
    + SELECT CASE sel
    + CASE 3, 6, 9: sel = sel - 2
    + CASE ELSE: sel = sel + 1
    + END SELECT
    + CASE CHR$(0) + "P":
    + SELECT CASE sel
    + CASE 7, 8, 9: sel = sel - 6
    + CASE ELSE: sel = sel + 3
    + END SELECT
    + CASE CHR$(0) + "H":
    + SELECT CASE sel
    + CASE 1, 2, 3: sel = sel + 6
    + CASE ELSE: sel = sel - 3
    + END SELECT
    + CASE CHR$(13), CHR$(32):
    + IF sel = 1 THEN
    + IF sl = 0 THEN
    + juggle sl
    + eopen 0, 0
    + Happy = Happy + 25: CheckBounds Happy
    + Mad = Mad - 10: CheckBounds Mad
    + Awake = Awake + 5: CheckBounds Awake
    + END IF
    + END IF
    + IF sel = 2 THEN
    + IF Hungry > 20 AND sl = 0 THEN
    + McMole snd!
    + Refresh 0, 0, sl
    + Hungry = Hungry - 30: CheckBounds Hungry
    + ELSEIF Hungry <= 20 THEN
    + LOCATE 2, 14: PRINT "I'm not hungry"
    + Speak 2, .5
    + Slow 1
    + LOCATE 2, 14: PRINT " "
    + END IF
    + END IF
    + IF sel = 3 THEN
    + IF sl = 0 THEN
    + sl = 1
    + eclose 0, 0
    + ELSEIF sl = 1 THEN
    + sl = 0
    + Awake = Awake + INT(TIMER - ss)
    + CheckBounds Awake
    + eopen 0, 0
    + END IF
    + END IF
    + IF sel = 4 THEN
    + IF sl = 0 THEN
    + IF broom < 60 THEN
    + LOCATE 2, 11: PRINT "I don't have to go"
    + Slow 1
    + LOCATE 2, 11: PRINT " "
    + ELSEIF broom >= 60 THEN
    + broom = broom - 25
    + bathroom snd!
    + Face 0, 0
    + END IF
    + END IF
    + END IF
    + IF sel = 5 THEN
    + IF bo >= 50 AND sl = 0 THEN
    + shower
    + bo = bo - 50
    + IF bo < 0 THEN bo = 0
    + Face 0, 0
    + center "All clean!", 2, 3
    + Slow 1
    + center "", 2, 0
    + ELSEIF bo < 50 AND sl = 0 THEN
    + eopen 0, 0
    + LOCATE 2, 9: PRINT "I don't want to shower"
    + Speak 3, .25
    + Slow 1
    + LOCATE 2, 9: PRINT " "
    + END IF
    + END IF
    + IF sel = 6 THEN
    + IF sl = 0 THEN
    + IF Ill > 35 THEN
    + doctor snd!
    + Face 0, 0
    + Ill = Ill - 50
    + CheckBounds Ill
    + ELSEIF Ill <= 35 THEN
    + LOCATE 2, 4: PRINT "I don't want to go to the doctor"
    + Speak 3, .25
    + LOCATE 2, 4: PRINT " "
    + END IF
    + END IF
    + END IF
    + IF sel = 7 THEN
    + CLS 0
    + COLOR 7
    + LOCATE 25, 14: PRINT "Press [ESC] to continue..."
    + grimstext "Giga mole status", 1, 4, 2, 12, 1
    + COLOR 1
    + LOCATE 3, 14: PRINT "Age: "
    + COLOR 4
    + SELECT CASE months
    + CASE 1: months$ = "month"
    + CASE ELSE: months$ = "months"
    + END SELECT
    + LOCATE 4, 15: PRINT months; months$
    + SELECT CASE weeks
    + CASE 1: weeks$ = "week"
    + CASE ELSE: weeks$ = "weeks"
    + END SELECT
    + LOCATE 5, 15: PRINT weeks; weeks$
    + SELECT CASE days
    + CASE 1: days$ = "day"
    + CASE ELSE: days$ = "days"
    + END SELECT
    + LOCATE 6, 15: PRINT days; days$
    + COLOR 1
    + LOCATE 8, 14: PRINT "Current Problems:"
    + COLOR 4
    + FOR p = 0 TO problem
    + LOCATE p + 9, 15: PRINT problem$(p)
    + NEXT
    + statsdelay = TIMER: sttsdly = 0
    + DO WHILE INKEY$ <> CHR$(27)
    + SELECT CASE sttsdly
    + CASE 0:
    + IF TIMER - statsdelay > 1 THEN
    + grimstext "Giga mole status", 4, 2, 1, 12, 1
    + statsdelay = TIMER: sttsdly = 1
    + END IF
    + CASE 1:
    + IF TIMER - statsdelay > 1 THEN
    + grimstext "Giga mole status", 2, 1, 4, 12, 1
    + statsdelay = TIMER: sttsdly = 2
    + END IF
    + CASE 2:
    + IF TIMER - statsdelay > 1 THEN
    + grimstext "Giga mole status", 1, 4, 2, 12, 1
    + statsdelay = TIMER: sttsdly = 0
    + END IF
    + END SELECT
    + LOOP
    + CLS 0
    + Refresh 0, 0, sl
    + END IF
    + IF sel = 8 THEN
    + help
    + Refresh 0, 0, sl
    + END IF
    + IF sel = 9 THEN
    + eopen 0, 0
    + SELECT CASE SaveClose
    + CASE 0:
    + center "", 2, 0
    + grimstext "Goodbye!", 1, 4, 2, 16, 2
    + CLS 0: RestorePalette
    + END
    + CASE 1:
    + center "", 2, 0
    + Save new, snd, Happy, Awake, bo, Hungry, Mad, sick, broom, Od, Drunk, months, weeks, days, autosave, AnimateMenu
    + grimstext "Goodbye!", 1, 4, 2, 16, 2
    + CLS 0: RestorePalette
    + END
    + CASE -1:
    + center "", 2, 0
    + END SELECT
    + END IF
    + CASE "!" TO "~":
    + cheat$ = cheat$ + UCASE$(Key$)
    + END SELECT
    + IF RIGHT$(cheat$, 4) = "WEED" THEN
    + weed snd!
    + CLS
    + PAINT (1, 1), 2, 2
    + Face 0, 0
    + Od = Od + 10: CheckBounds Od
    + Happy = Happy + 50: CheckBounds Happy
    + Hungry = Hungry + 25: CheckBounds Hungry
    + cheat$ = ""
    + END IF
    + IF RIGHT$(cheat$, 4) = "BEER" THEN
    + beer snd!
    + Drunk = Drunk + 15: CheckBounds Drunk
    + Face 0, 0
    + cheat$ = ""
    + END IF
    + IF RIGHT$(cheat$, 7) = "REFRESH" THEN
    + CLS 0
    + Refresh 0, 0, sl
    + cheat$ = ""
    + END IF
    + IF RIGHT$(cheat$, 4) = "TIME" THEN
    + center "It is" + nosec$, 2, 3
    + Speak 2, .5
    + Slow .25
    + center "", 2, 0
    + cheat$ = ""
    + END IF
    + IF RIGHT$(cheat$, 4) = "DATE" THEN
    + center "It is " + noyear$, 2, 3
    + Speak 2, .5
    + Slow .25
    + center "", 2, 0
    + cheat$ = ""
    + END IF
    + IF RIGHT$(cheat$, 3) = "VER" OR RIGHT$(cheat$, 7) = "VERSION" THEN
    + center "Your playing ver 0.9B", 2, 11
    + Speak 2, .5
    + Slow .25
    + center "", 2, 0
    + cheat$ = ""
    + END IF
    + IF RIGHT$(cheat$, 6) = "PUNISH" THEN
    + IF sl = 0 THEN
    + pun snd
    + Refresh 0, 0, sl
    + Mad = Mad + 25: CheckBounds Mad
    + Happy = Happy - 10: CheckBounds Happy
    + center "Why did you hit me?!?", 2, 3
    + Speak 3, .25
    + center "", 2, 0
    + cheat$ = ""
    + END IF
    + END IF
    +LOOP
    +
    +'********************************Music Subs**********************************
    +inagoddadavida:
    +IF snd = 1 THEN PLAY "mbt60o2d8d8f16e16o1c16o2d8o3msa8g#8g8mno2f16"
    +RETURN
    +creditsmusic:
    +IF snd = 1 THEN PLAY "mb t80 l8 o4 bdc o5 gad o4 ebg o3 acb"
    +RETURN
    +'********************************Menu Data***********************************
    +menus:
    +DATA 20,8,Play,20,18,Feed,20,28,
    +DATA 21,8,Bathroom,21,18,Shower,21,28,Doctor
    +DATA 22,8,Stats,22,18,Help,22,28,Exit
    +DebugMenuCommands:
    +DATA Happiness,Awake,Body Odor,Hungry,Mad,Ill,Bathroom,Overdose,Drunk
    +DATA Exit
    +
    +SUB anti
    + DIM RemoveY(66)
    + FOR i = 1 TO 66
    + RemoveY(i) = i
    + NEXT
    + FOR t = 0 TO INT(10 * RND(1)) + 1
    + FOR i = 1 TO 66
    + switch = INT(66 * RND(1)) + 1
    + temp = RemoveY(i)
    + RemoveY(i) = RemoveY(switch)
    + RemoveY(switch) = temp
    + NEXT
    + NEXT
    + CLS 0
    + COLOR 7: center "ANDERS", 13, 15
    + COLOR 15: center "Anti Anders Inc.", 19, 15
    + CIRCLE (160, 100), 30, 4: CIRCLE (160, 100), 38, 4: PAINT (125, 100), 4, 4
    + LINE (180, 80)-(130, 118), 4: LINE (190, 82)-(140, 120), 4: PAINT (160, 100), 4, 4
    + Slow 2
    + i = 1
    + WHILE i < 67
    + LINE (122, RemoveY(i) + 67)-(198, RemoveY(i) + 67), 0
    + RemoveY(i) = 0
    + SOUND INT(200 * RND(1)) + 40 + RemoveY(i), .5
    + IF INKEY$ <> INKEY$ THEN EXIT SUB
    + i = i + 1
    + WEND
    + Slow .1
    +END SUB
    +
    +SUB bathroom (snd)
    + FOR i = 0 TO 15
    + CIRCLE (100, 60 + i), 50 - i, 7, , , 1 / 8
    + NEXT
    + LINE (60, 15)-(140, 60), 7, BF
    + CIRCLE (100, 60), 50, 8, , , 1 / 8
    + PAINT (100, 60), 7, 8
    + CIRCLE (100, 60), 30, 8, , , 1 / 12
    + PAINT (100, 60), 0, 8
    + LINE (69, 75)-(131, 110), 7, B
    + PAINT (100, 80), 7, 7
    + CIRCLE (100, 75), 36, 8, 180 * (3.14 / 180), , 1 / 8
    + CIRCLE (75, 21), 4, 8
    + PAINT (75, 21), 8, 8
    + LINE (77, 18)-(62, 20), 8, BF
    + CIRCLE (62, 25), 15, 8, 10 * (3.14 / 180), 90 * (3.14 / 180), 1 / 4
    + LINE (69, 21)-(70, 21), 8
    + FOR ha = 0 TO 2
    + Slow 1
    + IF snd = 1 THEN SOUND 40, 5 * ((ha + 1) / 2)
    + NEXT
    + LINE (50, 10)-(150, 110), 2, BF
    +END SUB
    +
    +SUB beer (snd)
    + LINE (65, 30)-(135, 110), 2, BF
    + FOR B = 49 TO 71
    + CIRCLE (100, B), 12, 8, , , 1 / 4
    + NEXT
    + FOR B = 50 TO 70
    + CIRCLE (100, B), 10, 7, , , 1 / 4
    + NEXT
    + FOR B = 49 TO 50
    + CIRCLE (100, B), 12, 8, , , 1 / 4
    + NEXT
    + CIRCLE (112, 62), 4, 8, 270 * (3.14 / 180), 90 * (3.14 / 180)
    + CIRCLE (112, 62), 5, 8, 270 * (3.14 / 180), 90 * (3.14 / 180)
    + CIRCLE (112, 62), 10, 8, 270 * (3.14 / 180), 90 * (3.14 / 180)
    + CIRCLE (112, 62), 11, 8, 270 * (3.14 / 180), 90 * (3.14 / 180)
    + PAINT (120, 62), 7, 8
    + PAINT (100, 50), 7, 8
    + PAINT (100, 60), 6, 8
    + LINE (90, 55)-(110, 55), 8
    + PAINT (90, 53), 7, 8
    + FOR y = 55 TO 70
    + FOR x = 90 TO 110
    + PSET (x, y), 7
    + NEXT
    + IF snd = 1 THEN SOUND 100, .5
    + Slow .5
    + NEXT
    +END SUB
    +
    +SUB center (line$, y, clr)
    + IF clr = 0 THEN
    + LOCATE y, 1: PRINT " "
    + END IF
    + COLOR clr
    + LOCATE y, (21 - INT(LEN(line$) / 2)): PRINT line$
    +END SUB
    +
    +SUB CenterT (Text$, y!, clr!)
    + IF clr = 0 THEN
    + LOCATE y, 1: PRINT " "
    + END IF
    + x = 40 - INT(LEN(Text$) / 2)
    + COLOR clr
    + LOCATE y, x: PRINT Text$
    +END SUB
    +
    +SUB CheckBounds (Variable)
    + IF Variable > 100 THEN Variable = 100
    + IF Variable < 0 THEN Variable = 0
    +END SUB
    +
    +SUB CheckProblems (Variable, value, problem, probstr$)
    + IF Variable >= value THEN
    + q = 0
    + DO
    + IF problem$(q) = probstr$ THEN
    + EXIT DO
    + ELSEIF q = problem THEN
    + IF problem$(q) = "None" THEN
    + problem$(q) = ""
    + END IF
    + problem = problem + 1
    + problem$(q) = probstr$
    + EXIT DO
    + END IF
    + q = q + 1
    + IF q = 7 THEN EXIT DO
    + LOOP
    + ELSEIF Variable < value THEN
    + q = 0
    + DO
    + IF problem$(q) = probstr$ THEN
    + FOR L = q TO problem
    + problem$(L) = problem$(L + 1)
    + NEXT
    + problem = problem - 1
    + EXIT DO
    + END IF
    + IF q = problem THEN EXIT DO
    + q = q + 1
    + IF q = 7 THEN EXIT DO
    + LOOP
    + END IF
    +END SUB
    +
    +SUB cmouth
    + CIRCLE (100, 75), 10, 4, , , 1 / 4
    + PAINT (100, 75), 12, 4
    + LINE (90, 75)-(110, 75), 4
    +END SUB
    +
    +SUB Dead (xists)
    + IF xists = 0 THEN
    + KILL "GiGaMole.dat"
    + END IF
    + Slow 2
    + END
    +END SUB
    +
    +SUB debug (Happy, Awake, bo, Hungry, Mad, Ill, broom, Od, Drunk)
    + RESTORE DebugMenuCommands
    + FOR i = 1 TO 10
    + READ DebugMenu$(i)
    + NEXT
    + CLS 0
    + dbug = 1
    + Variable(1) = Happy: Variable(2) = Awake: Variable(3) = bo
    + Variable(4) = Hungry: Variable(5) = Mad: Variable(6) = Ill
    + Variable(7) = broom: Variable(8) = Od: Variable(9) = Drunk
    + DO
    + FOR i = 1 TO 10
    + IF dbug = i THEN COLOR 4 ELSE COLOR 1
    + IF i < 10 THEN
    + LOCATE i, 1: PRINT DebugMenu$(i)
    + LOCATE i, 10: PRINT RTRIM$(STR$(Variable(i))); "% "
    + ELSEIF i = 10 THEN
    + LOCATE i + 1, 1: PRINT DebugMenu$(i)
    + END IF
    + NEXT
    + SELECT CASE INKEY$
    + CASE CHR$(0) + "Q"
    + IF dbug < 10 THEN
    + Variable(dbug) = Variable(dbug) - 10
    + IF Variable(dbug) < 0 THEN Variable(dbug) = 100
    + END IF
    + CASE CHR$(0) + "I"
    + IF dbug < 10 THEN
    + Variable(dbug) = Variable(dbug) + 10
    + IF Variable(dbug) > 100 THEN Variable(dbug) = 0
    + END IF
    + CASE CHR$(0) + "K"
    + IF dbug < 10 THEN
    + Variable(dbug) = Variable(dbug) - 1
    + IF Variable(dbug) < 0 THEN Variable(dbug) = 100
    + ELSEIF dbug = 10 THEN
    + EXIT DO
    + END IF
    + CASE CHR$(0) + "M", CHR$(13), CHR$(32)
    + IF dbug < 10 THEN
    + Variable(dbug) = Variable(dbug) + 1
    + IF Variable(dbug) > 100 THEN Variable(dbug) = 0
    + ELSEIF dbug = 10 THEN
    + EXIT DO
    + END IF
    + CASE CHR$(0) + "P"
    + dbug = dbug + 1
    + IF dbug = 11 THEN dbug = 1
    + CASE CHR$(0) + "H"
    + dbug = dbug - 1
    + IF dbug = 0 THEN dbug = 10
    + END SELECT
    + LOOP
    + CLS 0
    + cheat$ = ""
    + Refresh 0, 0, sl
    + Happy = Variable(1): Awake = Variable(2): bo = Variable(3)
    + Hungry = Variable(4): Mad = Variable(5): Ill = Variable(6)
    + broom = Variable(7): Od = Variable(8): Drunk = Variable(9)
    +END SUB
    +
    +SUB DecrementVariable (ticks, Variable, value, decrement, index)
    + IF ticks / value = INT(ticks / value) THEN
    + IF ticks <> 0 THEN
    + IF cprob(index) - value > oprob(index) THEN
    + Variable = Variable - decrement
    + IF Variable < 0 THEN Variable = 0
    + oprob(index) = TIMER
    + END IF
    + END IF
    + END IF
    +END SUB
    +
    +SUB doctor (snd)
    + LINE (50, 20)-(150, 100), 2, BF
    + LINE (85, 70)-(90, 67), 8
    + LINE (85, 70)-(90, 73), 8
    + LINE (81, 70)-(85, 70), 8
    + LINE (90, 67)-(90, 73), 8
    + PAINT (87, 70), 8, 8
    + LINE (91, 67)-(110, 73), 7, B
    + LINE (111, 69)-(118, 71), 7, BF
    + LINE (119, 67)-(122, 73), 7, BF
    + LINE (109, 67)-(110, 73), 7, BF
    + PAINT (100, 70), 14, 7
    + Slow .5
    + LINE (111, 67)-(122, 73), 2, BF
    + LINE (100, 68)-(110, 72), 2, BF
    + LINE (100, 68)-(103, 72), 7, BF
    + LINE (104, 69)-(115, 71), 7, BF
    + LINE (110, 67)-(110, 73), 7
    + LINE (116, 67)-(119, 73), 7, BF
    + IF snd = 1 THEN SOUND 80, .5
    + Slow .5
    + LINE (92, 68)-(109, 72), 2, BF
    + LINE (95, 69)-(110, 71), 7, BF
    + LINE (112, 67)-(119, 73), 2, BF
    + LINE (112, 67)-(115, 73), 7, BF
    + LINE (93, 68)-(95, 72), 7, BF
    + LINE (92, 68)-(92, 72), 14
    + IF snd = 1 THEN SOUND 80, .5
    + Slow 1
    +END SUB
    +
    +SUB eclose (ex, ey)
    + PAINT (90 + ex, 50 + ey), 14, 6
    + PAINT (110 + ex, 50 + ey), 14, 6
    + LINE (85 + ex, 50 + ey)-(95 + ex, 50 + ey), 6
    + LINE (105 + ex, 50 + ey)-(115 + ex, 50 + ey), 6
    +END SUB
    +
    +SUB eopen (ex, ey)
    + PAINT (90 + ex, 50 + ey), 14, 14
    + PAINT (110 + ex, 50 + ey), 14, 14
    + CIRCLE (90 + ex, 50 + ey), 5, 6, , , 1 / 2
    + CIRCLE (110 + ex, 50 + ey), 5, 6, , , 1 / 2
    + PAINT (110 + ex, 50 + ey), 15, 6
    + PAINT (90 + ex, 50 + ey), 15, 6
    + CIRCLE (90 + ex, 50 + ey), 2, 0
    + CIRCLE (110 + ex, 50 + ey), 2, 0
    + PAINT (90 + ex, 50 + ey), 0, 0
    + PAINT (110 + ex, 50 + ey), 0, 0
    +END SUB
    +
    +SUB Face (x, y)
    + CIRCLE (100 + x, 60 + y), 27, 8, 0 * (3.14 / 180), 180 * (3.14 / 180), 1
    + LINE (73 + x, 60 + y)-(80 + x, 76 + y), 8
    + LINE (120 + x, 76 + y)-(127 + x, 60 + y), 8
    + LINE (80 + x, 76 + y)-(120 + x, 76 + y), 8
    + PAINT (100 + x, 55 + y), 8, 8
    + CIRCLE (115 + x, 85 + y), 7, 8, , , 2
    + PAINT (115 + x, 85 + y), 8, 8
    + CIRCLE (100 + x, 60 + y), 25, 14, , , 1
    + PAINT (100 + x, 60 + y), 14, 14
    + CIRCLE (90 + x, 50 + y), 5, 6, , , 1 / 2
    + CIRCLE (110 + x, 50 + y), 5, 6, , , 1 / 2
    + CIRCLE (100 + x, 65 + y), 3, 6, 180 * (3.14 / 180), 360 * (3.14 / 180)
    + CIRCLE (96 + x, 64 + y), 1, 6, 90 * (3.14 / 180), 270 * (3.14 / 180)
    + CIRCLE (104 + x, 64 + y), 1, 6, 270 * (3.14 / 180), 90 * (3.14 / 180)
    + LINE (102 + x, 54 + y)-(103 + x, 61 + y), 6
    + LINE (98 + x, 57 + y)-(97 + x, 60 + y), 6
    + CIRCLE (100 + x, 75 + y), 10, 4, , , 1 / 4
    + PAINT (100 + x, 75 + y), 12, 4
    + LINE (90 + x, 75 + y)-(110 + x, 75 + y), 4
    + CIRCLE (111 + x, 68 + y), 2, 6
    + PAINT (111 + x, 68 + y), 6, 6
    + CIRCLE (123 + x, 60 + y), 4, 6, 210 * (3.14 / 180), 150 * (3.14 / 180), 5
    + CIRCLE (77 + x, 60 + y), 4, 6, 30 * (3.14 / 180), 330 * (3.14 / 180), 5
    + IF sl = 1 THEN
    + eclose x, y
    + ELSEIF sl = 0 THEN
    + eopen x, y
    + END IF
    +END SUB
    +
    +SUB food (snd)
    + FOR i = 1 TO 4
    + omouth
    + IF snd = 1 THEN SOUND 60, .5
    + Slow .5
    + cmouth
    + IF snd = 1 THEN SOUND 65, .5
    + Slow .5
    + NEXT
    +END SUB
    +
    +SUB grim
    + x = 85
    + DIM RemoveX(102)
    + FOR i = 1 TO 102
    + RemoveX(i) = i
    + NEXT
    + FOR t = 0 TO INT(10 * RND(1)) + 1
    + FOR i = 1 TO 102
    + switch = INT(66 * RND(1)) + 1
    + temp = RemoveX(i)
    + RemoveX(i) = RemoveX(switch)
    + RemoveX(switch) = temp
    + NEXT
    + NEXT
    + COLOR 14: LOCATE 15, 11: PRINT "(c) 1999 ";
    + grimstext "mysticsoft", 1, 4, 2, 19, 15
    + grimstext "written by grim", 1, 4, 2, 13, 5
    + LINE (29 + x, 44)-(121 + x, 44), 15: LINE (29 + x, 44)-(29 + x, 95), 15
    + LINE (29 + x, 96)-(121 + x, 96), 7: LINE (121 + x, 45)-(121 + x, 96), 7
    + LINE (30 + x, 45)-(120 + x, 95), 2, BF: LINE (60 + x, 60)-(50 + x, 50), 1
    + LINE (50 + x, 50)-(35 + x, 75), 1: LINE (35 + x, 75)-(50 + x, 90), 1
    + LINE (50 + x, 90)-(60 + x, 75), 1: LINE (60 + x, 75)-(50 + x, 75), 1
    + LINE (70 + x, 50)-(70 + x, 90), 1: LINE (70 + x, 50)-(85 + x, 63), 1
    + LINE (85 + x, 63)-(70 + x, 76), 1: LINE (70 + x, 76)-(85 + x, 90), 1
    + LINE (90 + x, 60)-(90 + x, 65), 4: LINE (90 + x, 70)-(90 + x, 90), 4
    + LINE (95 + x, 50)-(95 + x, 90), 1: LINE (95 + x, 50)-(105 + x, 75), 1
    + LINE (105 + x, 75)-(115 + x, 50), 1: LINE (115 + x, 50)-(115 + x, 90), 1
    + Slow 2
    + i = 0
    + WHILE i < 103
    + LINE (RemoveX(i) + x + 28, 44)-(RemoveX(i) + x + 28, 96), 0
    + SOUND INT(100 * RND(1)) + 40 + RemoveX(i) + 100, .5
    + IF INKEY$ <> "" THEN EXIT SUB
    + i = i + 1
    + WEND
    + Slow .001
    +END SUB
    +