Patch:Keycard (Vorticons)

From KeenWiki
Jump to navigation Jump to search

These are patches for Keycard items used to open doors. For cheat codes that can give you keycards see Patch:C T Space Cheat, for removing keycards on level exit see Patch:Level exit. For patches concerning how doors work see Patch:Doors (Vorticons)

See also Patch:Items, Patch:Ship Parts, Patch:Pogo (Item), Patch:Raygun.

Keycards at game start

See also Patch:New Game. This affects whether Keen has any of the four key cards when he starts the game. A value of 1 means he does, a value of 0 means he doesn't. By default he has no cards.

It is also possible to change what Keen has, by default this code resets his keycards, so that any remaining from the last game played are lost. If the game stat value is changed to no longer affect keycards, Keen will have the cards he had last time he played. (If you quit with a yellow card the new game will start with a yellow card.) This can allow for some interesting tricks, but can be difficult.

Keen 1: Keen has cards at game start

%patch $9045 {$AA9EW} [$0001W] #Yellow
%patch $904B {$AAA0W} [$0001W] #Red
%patch $9051 {$AAA2W} [$0001W] #Green
%patch $9057 {$AAA4W} [$0001W] #Blue

Keen 2: Keen has cards at game start

%patch $8AD9 {$9AB4W} [$0001W] #Yellow
%patch $8ADF {$9AB6W} [$0001W] #Red
%patch $8AE5 {$9AB8W} [$0001W] #Green
%patch $8AEB {$9ABAW} [$0001W] #Blue

Sound effect when keycards obtained

This patch affects the sound the keycard makes when obtained and can even block it entirely.

Keycard got sound

#Keycard sound:
%patch $450B [$20] #Keen 1
%patch $731F [$20] #Keen 2
%patch $7B40 [$20] #Keen 3

#Don't play sound when keycard got:
%patch $450A $EB $07 #Keen 1
%patch $731E $EB $07 #Keen 2
%patch $7B3F $EB $06 #Keen 3

Keen gains\loses keycards when dying

This patch changes the value of four things Keen has when he dies. In the example provided below it gives Keen all four keycards (Sets them to 1) when he dies. (Setting them to 0 is useless unless using the change things on level win patch.) The four variables changed are marked in brown, the four values they are set to in blue. To set less than four variables, simply delete a $C7 $06 $AAxxW} $yyyyW string. To add a variable to change simply insert a $C7 $06 $AAxxW} $yyyyW string. A maximum of 10 variables can be altered in this way.

The final 'extra' variable changed is Keen's lives, $FF $0E $AAC6W means 'decrease Keen's lives by 1'; something usually wanted when Keen dies. Removing this will in effect give Keen infinite lives.

See also Patch:Game stats. This patch, and all that are built on it is incompatible with Keen losing ship parts when dying in their levels. Using it will overwrite the relevant code, meaning Keen can get a ship part in a level, die, and still have it. It will also stop Keen losing keycards when he exits a level.

Keen 1

#When Keen dies, give keycards
%patch $8041 $E8 $CF16W  $90
%patch $4F58 $EB $46 $C7 $06 {$AA9EW}  [$0001W]  $C7 $06 {$AAA0W}  [$0001W]
             $C7 $06 {$AAA2W}  [$0001W]  $C7 $06 {$AAA4W}  [$0001W]  $FF $0E 
             {$AAC6W}  $C3

Keen gains\loses keycards when exiting level

This is the default code responsible for removing all of Keen's keycards when he dies or exits the level. The brown value is the game stat to start at, the first blue value is what it is set to, and the second blue value the number of following stats to also set. By default then the game sets Keen's yellow card and the following three variables (red, blue and green cards) to zero on level exit. Changing the first value to 1 makes the game give Keen all the cards while making the second value 0 doesn't affect cards at all.

Default keycard code

#Default keycard code -Keen 1
%patch $4F43 $C7 $46 $FC $0000W  $EB $0E $8B $5E $FC $D1 $E3 $C7 $87 {$AA9EW}
             [$0000W]  $FF $46 $FC $83 $7E $FC [$04] $7C $EC

#Default keycard code -Keen 2
%patch $7C9A $C7 $46 $FC $0000W  $EB $0E $8B $5E $FC $D1 $E3 $C7 $87 {$9AB4W}
             [$0000W]  $FF $46 $FC $83 $7E $FC [$04] $7C $EC

#Default keycard code -Keen 3
%patch $8617 $C7 $46 $FC $0000W  $EB $0E $8B $5E $FC $D1 $E3 $C7 $87 {$9D1EW}
             [$0000W]  $FF $46 $FC $83 $7E $FC [$04] $7C $EC

Keep keycards when exiting a level or dying

This patch disables the above effects; that is it allows Keen to keep any keycards he has when he exits the level. This patch also lets Keen keep any cards he has when he dies, which can allow death to be used as a shortcut.

Keep keycards when exiting a level or dying

#Keep keycards when exiting a level or dying -Keen 1
%patch $4F43 $EB $19

#Keep keycards when exiting a level or dying -Keen 2
%patch $7C9A $EB $19

#Keep keycards when exiting a level or dying -Keen 3
%patch $8617 $EB $19

Keep keycards when exiting a level

This patch disables the above effects; that is it allows Keen to keep any keycards he has when he exits the level. If he dies however his keycards are removed. This patch will interfere with the 'don't remove ship parts patch' in Keen 1 and the 'Keep saved city' patch in Keen 2.

Keep keycards when exiting a level only

#Keep keycards when exiting a level only -Keen 1
%patch $4F43 $83 $3E $6C60W  $00 $75 $56 $C7 $46 $FC $0000W  $EB $0E $8B $5E $FC
             $D1 $E3 $C7 $87 {$AA9EW}  [$0000W]  $FF $46 $FC $83 $7E $FC [$04] $7C $EC

#Keep keycards when exiting a level only -Keen 2
%patch $7C9A $83 $3E $6C3CW  $00 $75 $6B $C7 $46 $FC $0000W  $EB $0E $8B $5E $FC
             $D1 $E3 $C7 $87 {$9AB4W}  [$0000W]  $FF $46 $FC $83 $7E $FC [$04] $7C $EC

#Keep keycards when exiting a level only -Keen 3
%patch $8617 $83 $3E $6E8CW  $00 $75 $1B $C7 $46 $FC $0000W  $EB $0E $8B $5E $FC
             $D1 $E3 $C7 $87 {$9D1EW}  [$0000W]  $FF $46 $FC $83 $7E $FC [$04] $7C $EC

Keycard tile code

The parts tile code is the same for all four keycards. Unlike the ship parts tile code there is no tile type check. On the first line it appears as if the first keycard value is set to 1, however the actual variable set will depend on which tile type (And thus keycard) Keen obtained, $AA7AW is merely the first of four variables.

Following this sound $20 is played and the tile is removed and replaced with tile $8F.

Keen 1

#Default keycard tile code
%patch $44FF $8B $5E $F6 $D1 $E3 $C7 $87 {$AA7AW}  [$0001W]  $B8 [$0020W]  $50 $E8
             $79E2W  $44 $44 $8B $C6 $F7 $2E $08 $6C $03 $C7 $D1 $E0 $C4 $1E
             $48 $6C $03 $D8 $26 $C7 $07 [$008FW]  $EB $4E

Keycards exit the level

These three patches cause Keen to exit the level when he obtains a keycard. The first patch simply fuses the two tile codes. When Keen obtains a keycard the exit door code is run, including the sound and the alteration of level tiles. This will only happen if Keen is standing on ground however, in midair the keycard will simply vanish and play the keycard sound. (This can be used to create two different types of keycard.)

The second patch is identical, except Keen can exit in midair and using the keycard got sound. This means all keycards will exit the level. Again the exit door tile changes will occur.

The third patch simply wins the level when the keycard is obtained. The game will pause for a short while while the keycard sound plays, then the level will be exited and won. The keycard itself will not vanish, unlike in the previous two patches.

Keen 1

#Keycards call exit code after got
%patch $4529 $A8

Keen 1

#Keycards make Keen exit walk when got
%patch $4529 $BC

Keen 1

#Keycards make Keen win the level when got
%patch $4513 $C7 $06 {$6C60W} [$0001W]  $EB $5C

Keycards teleport Keen

This patch causes keycards to act like teleporters, taking Keen to the map when obtained. Keen will have the keycard when he teleports. Difficulties may occur if this is used with the 'teleport in level' patch.

Keen 1

#Keycards teleport Keen
%patch $4513 $C7 $06 {$6C60W} [$0002W]  $EB $5C