!---------------------------------------------------------------------------- routine SubtractObj(obj, wrapyesno) { obj.misc-- if obj.misc = 0 { remove obj "That was the last of your "; : print obj.name; } elseif obj.misc = 1 { "Only one more of "; : print The(obj); " "; "remain"; } else { "You are left with "; : print number obj.misc; " "; : print obj.name; } if (wrapyesno) print "." else print ". "; } !---------------------------------------------------------------------------- !Check to see if the watch is in context, to print/give a clue. routine CheckWatchContext(context) { local showit=false if (wristwatch not in player) { return } !We don't have it if (wristwatch is not worn) { return } !We're not wearing it if (wristwatch.misc = context) { return } !Already in this mode if (wristwatch.misc #2 = false) { return } !It can't do MODE commands if (context=1) { if (CountCupsInInv(false) > 0) { showit=true !Has a non-empty cup } } if (context=2) { if (ruhnestory=10) and (prev_location ~= location) and \ (location is not interior) { showit=true !Dust storm is in full effect. } } if (context=3) { if (location = dryroom) and (yellowbutton.misc > 0) { showit=true !We've seen the message, give clue to translate } } if (showit) { "Your father's wristwatch hums slightly on your wrist, warming for a moment." } } !---------------------------------------------------------------------------- !Command the wristwatch to set its mode. New modes defined in NEWVERBS.G/H. ! routine SetWatchMode(modenum) { !Does the player HAVE the watch? if Contains(player,wristwatch) and (modenum<99) { !Is the player WEARING it? if (wristwatch is worn) { !Is the player wearing the diving suit? if Contains(player,divesuit) and (divesuit is worn) { "That doesn't work, since your diving suit covers your entire body; that includes your wrists." } else { !Are MODE commands valid? if (wristwatch.misc #2) { !Is it already in this MODE? if (wristwatch.misc = modenum) { "Father's wristwatch is already in "; PrintWatchMode : print " mode." } else { wristwatch.misc = modenum indent "You command your father's wristwatch into "; PrintWatchMode : print " mode. "; RunWatchMode(player) : print "" ! To finish the line. } } else { if (Chapter = 3) and (Section = 2) { "Father's wristwatch takes no notice to the MODE command now." } else { "Father's wristwatch is no longer able to respond to MODE commands. It has been a simple timepiece for a ten-cycle, give or take." } } } else { "Father's wristwatch will only respond to \"MODE\" commands while being worn." } } } else { "Nothing happens." } } !---------------------------------------------------------------------------- routine RunWatchMode(atobj) { local okuse = false self = wristwatch ! Just so we deal with a short, easy name. !******************************* Normal/Time mode if (self.misc = 0) { if (atobj = player) { "White lettering appears in the light above, not on it, declaring today's date as "; !COLOR WHITE, BGCOLOR COLOR WHITE Font(DEFAULT_FONT | BOLD_ON) print player.misc #4; Font(DEFAULT_FONT | BOLD_OFF) !COLOR TEXTCOLOR, BGCOLOR COLOR TEXTCOLOR print ". The current time is then shown under the date. "; okuse = true } } !******************************* INTOX Mode if (self.misc = 1) { if (atobj = player) or (atobj is living) { local ilev, imax, custmsg = false imax = atobj.misc #6 : ilev = atobj.misc #7 !The watch is in "alcohol" mode. "White words rise above the face of the watch. "; COLOR BRIGHT_WHITE "\"Intoxicant Tolerance: \B"; if (imax = 0) { "None Detected"; } else { print number imax; "\b. Current Intoxication: \B"; !!!!!print "["; number ilev; "] "; !DEBUG ONLY if (GetPercent(ilev,imax) >= 85) { "Critical"; } elseif (GetPercent(ilev,imax) >= 70) { "Very High"; } elseif (GetPercent(ilev,imax) >= 55) { "High"; } elseif (GetPercent(ilev,imax) >= 40) { "Moderate"; } elseif (GetPercent(ilev,imax) >= 25) { "Low"; } elseif (ilev > 0) { "Very Low"; } else { "None"; } } if (atobj = player ) { "\b. Point me at someone else for remote intoxication check.\" "; } else { print "\b.\" "; } COLOR TEXTCOLOR okuse = true } } !******************************* COMPASS Mode if (self.misc = 2) { "A list of compass directions appears in white, floating in the blue light above the face of the watch. "; COLOR BRIGHT_WHITE PrintExits COLOR TEXTCOLOR } !******************************* TRANSLATE Mode if (self.misc = 3) { "The words \""; COLOR BRIGHT_WHITE "Translation Mode Active"; COLOR TEXTCOLOR "\" appear in white, floating in the blue light above the face of the watch. "; } !THEN........ Print any auto-detect messages. if (atobj = player) { if (self.misc ~= 1) { !If watch not in alcohol mode, AND we have alcohol or have taken !at least one drink, then tell us about the avaialable IntoxMode if (CountCupsInInv(false) > 0) or (player.misc #7 > 0) { custmsg = true PrintParaIndent !newline and indentation "A bold green message appears next. "; COLOR LIGHT_GREEN "\"\BIntoxicant detected.\b Use "; "'\BMode Intox\b'"; " to change the mode.\" "; COLOR TEXTCOLOR } } if (self.misc ~= 2) { !If the chapter 2 duststorm is in effect. if (Chapter = 2) and (ruhnestory=10) { custmsg = true PrintParaIndent !newline and indentation "A bold green message appears next. "; COLOR LIGHT_GREEN "\"\BVisibility Alert.\b Use "; "'\BMode Compass\b'"; " to change the mode.\" "; COLOR TEXTCOLOR } } if (self.misc ~= 3) { if (location = dryroom) and (yellowbutton.misc > 0) { custmsg = true PrintParaIndent !newline and indentation "A bold green message appears next. "; COLOR LIGHT_GREEN "\"\BKnown Language Detected.\b Use "; "'\BMode Translate\b'"; " to change the mode.\" "; COLOR TEXTCOLOR } } if (self.misc > 0) and (custmsg = false) { PrintParaIndent !newline and indentation "A bold green message appears next. "; COLOR LIGHT_GREEN "\"Use "; !!!!COLOR BRIGHT_WHITE "'\BMode Normal\b'"; !!!!COLOR LIGHT_GREEN " to change the mode.\" "; COLOR TEXTCOLOR } } else { if (okuse = false) { "Nothing happens when you point the watch at"; if (atobj is living) { print " "; : PrintHimHer(atobj) : print ". "; } else { MatchPlural(atobj,"that","them") : print ". "; } print "It is currently set to "; PrintWatchMode : print " mode."; } } } !---------------------------------------------------------------------------- !If the player is wearing the watch and it's in COMPASS mode, show dirs! !Master event for running every turn and checking various things. event { if (prev_location ~= location) or (roomdesc_seen) { if (wristwatch.misc = 2) { if Contains(player,wristwatch) { if (wristwatch is worn) { indent !For auto-dirs, don't do bright white "Father's wristwatch shows: "; !!!!COLOR BRIGHT_WHITE PrintExits : print "" !!!!COLOR TEXTCOLOR } } } } } !---------------------------------------------------------------------------- routine BeforeString(str) { if (VerbRoutine = &DoYell) { if IsEqual(str,"thyras","Thyras","THYRAS","brother","Brother") { return YellAboutThyras } } } !---------------------------------------------------------------------------- routine AfterString(str) { } !---------------------------------------------------------------------------- routine PrintAboutMessage { print "Trading Punches" print "Part 1 of The Convergence Saga" print "Copyright (c) 2004 by Sidney Merk" print StringPrint(versionbuf) print "Updated (post-competition) version" print "Website: http://www.sidneymerk.com" print "Email: sidneymerk@hotmail.com" } !---------------------------------------------------------------------------- !Replaces "PrintStatusLine" from the library, so we can do our own thing. !It has been stripped down some, because it's tailored just to this game. ! replace PrintStatusline { local offset, len, sth !Add total line length, and allow for the colon-space we include. len = (string(tempbuf1,player.misc #2,100) + \ string(tempbuf1,player.misc #3,100) + 2) !Then give an offset so we can right-align the line. offset = display.linelength - len if (display.linelength < 60) { sth = 2 } else { sth = 1 } display.statusline_height = sth Font(BOLD_OFF | ITALIC_OFF | UNDERLINE_OFF | PROP_OFF) window sth { color SL_TEXTCOLOR, SL_BGCOLOR : cls locate 1, (sth) print "\_"; capital location.name; if (sth = 1) { locate offset,1 } else { locate 1,1 : print "\_"; } print player.misc #2; ": "; player.misc #3; } color TEXTCOLOR, BGCOLOR Font(DEFAULT_FONT) }