Patch:Oracle Janitor

From KeenWiki
Jump to: navigation, search

The Oracle Janitor is a special version of the Council Member found throughout Keen 4. While it's sprite behavior is identical to, and inseparable from the ordinary member's, something different happens when Keen rescues him. Instead of the usual message sequence Keen gets a different, and much longer sequence, that results in him not exiting the level or saving a council member. It is however possible to separate the two sprites so they at differently, though this is difficult.

The difference depends on what level Keen meets the 'member' in. See also Patch: Oracle.


Disable

This patch will disable the Oracle Janitor, making him act like an ordinary Council Member.

Patch: Keen 4
#Disable Oracle janitor
%patch $CD92 $EB


Janitor vanishes when touched, no text

This patch disables the Janitor windows, so no message is displayed, but still removes the Janitor when Keen touches him. This creates a Council Messenger that vanishes when touched.

Patch: Keen 4
#Disable Janitor windows
%patch $CD94 $90 $90 $90 $90 $90


Disable individual windows

These patches will remove an individual window from the Janitor's message.

Patch: Keen 4
#Remove the last window (Keen's stare)
%patch $F2D8 $EB $62


Level Janitor appears in

This is the level that triggers the difference between the Janitor and ordinary council member. By default the unusual behavior occurs only in the Pyramid of the Forbidden. This can be altered to multiple levels, all levels or not at all. (See Patch:Jump conditions.)

Patch: Keen 4
#Level(s) that Janitor appears in:
%patch $CD91 $0E $75


Text windows

These patches cover the five windows displayed in sequence when the Janitor is rescued.


Images

The windows must cache the graphics they are using before they appear. In this case three sets of images are saved; Keen's head, the member's head and Keen giving a thumbs up. Notice that bitmaps are referred to by their 'chunk number', that is, what graphic chunk they are in EGAGRAPH.CK4; this is the bitmap number plus six (when exported via ModKeen, Keengraph numbers the bitmaps 'correctly') .

Patch: Keen 4
#Bitmap cache (3 bitmaps, 104, 105 and 107)
%patch $F0E6 $006EW
#Janitor
%patch $F0ED $006FW
#Keen
%patch $F0F4 $0071W
#Angry Keen

Window setup

The Oracle Janitor text windows differ in one important respect from most other text patches; their text is not in the data segment with most other game text, instead, each window has its own separate executable segment. This is handled with a text pointer divided into two parts. As an example the first window has two pointers, $1F58RW and $0000W which add as follows; 1F58 * 10 + 0000 = 1F580, the location of the first window's text.

This is of little import, unless the patcher desires to alter the length of the window's text significantly. (By default a lot of space is wasted.) As long as each window has its own segment (That is the first pointer is different.) then any location can be used.

Patch: Oracle Janitor - first window
#Janitor window 1
%patch $F113 $0008W
#Height
%patch $F117 $001AW
#Width
%patch $F16E $003CW
#Time displayed
%patch $F123 $006EW
#Bitmap displayed + 6 (Show BMP 104)
%patch $F146 $1F58RW
#Text read from 1
%patch $F14A $0000W
#2
#Text
%patch $1F580 "Thanks for going to all" $0A "that trouble, but I'm" $0A "just the janitor for the" $0A "High Council." $00

Patch: Oracle Janitor - second window
#Janitor window 2
%patch $F184 $0008W
#Height
%patch $F188 $001AW
#Width
%patch $F1DF $003CW
#Time displayed
%patch $F194 $006EW
#Bitmap displayed + 6 (Show BMP 104)
%patch $F1B7 $1F5ERW
#Text read from 1
%patch $F1BB $0000W
#2
#Text
%patch $1F5E0 "I tried to tell the" $0A "Shikadi that but they" $0A "just wouldn't listen..." $00

Patch: Oracle Janitor - third window
#Keen's reply
%patch $F1F5 $0008W
#Height
%patch $F1F9 $001AW
#Width
%patch $F252 $003CW
#Time displayed
%patch $F205 $006FW
#Bitmap displayed + 6 (Show BMP 105)
%patch $F22A $1F63RW
#Text read from 1
%patch $F22E $0000W
#2
#Text
%patch $1F630 "This had better" $0A "be a joke." $00

Patch: Oracle Janitor - fourth window
#Janitor window 4
%patch $F268 $0008W
#Height
%patch $F26C $001AW
#Width
%patch $F2C3 $003CW
#Time displayed
%patch $F278 $006EW
#Bitmap displayed + 6 (Show BMP 104)
%patch $F29B $1F65RW
#Text read from 1
%patch $F29F $0000W
#2
#Text
%patch $1F650 "Sorry. You aren't" $0A "mad, are you?" $00

Patch: Oracle Janitor - fifth window
#Keen's look (Is made up of two bitmaps)
%patch $F2D9 $0008W
#Height
%patch $F2DD $001AW
#Width
%patch $F327 $001EW
#Time displayed
%patch $F2E9 $006FW
#Bitmap displayed + 6 (Show BMP 105)
%patch $F2F8 $0030W
#Bitmap x position
%patch $F304 $0071W
#Bitmap displayed + 6 (Show BMP 107)
%patch $F30B $0018W
#Bitmap x
%patch $F316 $0018W
#Bitmap y


Windows don't wait for the player to press a key

These patches remove the 'wait for key' code from the various windows. This makes them seem much more immediate, since the player must read them before they vanish. Each window has a separate segment of code so they can be mixed; use one line only for the noted window.

Patch: Oracle Janitor windows don't wait for player keypress
#Oracle Janitor windows don't wait for player keypress
%patch $F17E $90 $90 $90 $90 $90
#Window 1
%patch $F1EF $90 $90 $90 $90 $90
#Window 2
%patch $F262 $90 $90 $90 $90 $90
#Window 3
%patch $F2D3 $90 $90 $90 $90 $90
#Window 4
%patch $F337 $90 $90 $90 $90 $90
#Window 5


Don't display bitmaps in windows

These patches remove some of the bitmaps from the Janitor windows.

Patch: Oracle Janitor fifth window
#Don't show Keen's face
%patch $F319 $90 $90 $90 $90 $90
#Don't show frowning part of Keen frowning bitmap
%patch $F2FB $90 $90 $90 $90 $90


Janitor wins the level

This patch changes things so that instead of vanishing the Janitor wins the level. Keen will not however be credited with saving a member. This patch works by changing the level state to 2, or 'win level'. Changing that value to other things can result in Keen doing things like losing the level or getting a Wetsuit.

Patch: Keen 4
#Oracle Janitor wins level
%patch $CD9E $C7 $06 $7A70W $0002W $90 $90 $90


Do not remove Janitor after text

This patch stops the Janitor being removed from the level when Keen contacts him. By itself this patch is quite useless; since Keen is still touching the Janitor, this loops the Janitor's message over and over about ten times before Keen can 'break free'; however in combination with other patches, especially ones that make the Janitor change after talking to Keen, this patch can be exceedingly useful.

Patch: Keen 4
#Don't remove Janitor when touched
%patch $CD9F $90 $90 $90 $90 $90


Music

By default new music plays when the Oracle Janitor is being spoken to, and it is stopped afterwards. The song used is a unique one not used for other levels. See also Patch:Music.

Note that while the new music code is part of the Janitor window code, the 'stop old music' code is not. This may be important when the window code is called in an odd way. (Such as when a sprite dies.)


Music played

By default the song played is -1, a unique song. It can however be turned into positive values for other songs. In that case the value is not the song number, but rather the level number of what music is desired. (So a value of +1 will play the same music as plays in level 1.)

Patch: Keen 4
#Music played when talking to Janitor
%patch $F107 $FFFFW


Don't change music

This patch stops the music changing when Keen is talking to the Member. Instead there is silence.

Patch: Keen 4
#Don't change music when talking to Oracle janitor
%patch $F106 $EB $0A