Patch:Wetsuit

From KeenWiki
Jump to navigation Jump to search

The Wetsuit is an item in Keen 4 that allows Keen to swim on water on the game map. If Keen does not have the Wetsuit then '???' will appear on his status screen and touching 'water entrance' tiles will cause a message to appear saying he can't swim. Getting the Wetsuit entails a sound playing,t he Wetsuit item being given and a message appearing. With the Wetsuit Keen can swim on map water and has 'Wetsuit' on his status screen.

Map patches can be found at Patch:Map (Keen 4), including those that involve swimming on the map, while patches involving the Wetsuit sprite and how it acts can be found at Patch:Wetsuit (Sprite).


Can't swim message

This message is displayed whenever something with the 'map Keen tile collision' hits a tile with one of the 'water entrance' properties. It is thus possible to get other things than Keen to produce the message and not only on the map. However, using other sprites tends to produce the dreaded 'infinitely repeating message' problem.

Using this patch requires knowledge of Patch:Game stats and Patch:Text patches. When the window is opened it stores a graphic chunk in memory, then displays it in the window. The image is right aligned (its rightmost edge touches the right side of the window.) according to the 'image width' variable. This doesn't have to be the actual width of the image and can be used to position the image in the window. (For example, by default the displayed image is 48 pixels wide and the width value keeps it on the right of the window. If the value is made larger than the actual image width then the image appears more left in the window.)

In this case only one chunk is cached and displayed, so the two values MUST be the same. The final value is the wait time, how long it is before the player can dismiss the window by pressing any key.

Keen 4

#Can't swim message
%patch $F370 [$0008W] #Window height
%patch $F374 [$001AW] #Window width
%patch $F364 [$006FW] #Cache chunk 111
%patch $F380 [$006FW] #Display chunk 111
%patch $F38F [$0030W] #'Width of image'
%patch $F3A5 [$1BCDW] #Text read from
%patch $F3B6 [$001EW] #Wait time

#Text
%patch $30A3D  "I can't swim!" $00


Disable message

This patch disables the message entirely, Keen will move against the water's edge as if it were solid tiles until he gets the Wetsuit.

Keen 4

#Disable 'Can't swim' message (Free $F356-$F3D1)
%patch $E219 $90 $90 $90 $90 $90


Can use message, block in normal levels

This patch allows Keen to be blocked by water entrance tiles in regular levels as well as the map. A side effect of this is that Keen will not go to swimming on the map when he has the Wetsuit, instead he will just continue walking through. In regular levels the blocking will bring up the message, turn Keen around and make him stand.

Keen 4

#Keen can use "can't swim" blocks in levels
%patch $D257 $2A06W #Top water: nothing (At $D21E)
%patch $D259 $2A06W #Right water: nothing (At $D21E)
%patch $D25B $2A06W #Bottom water: nothing (At $D21E)
%patch $D25D $2A06W #Left water: nothing (At $D21E)
%patch $E20C $37


Got Wetsuit message

This message is very similar to the message above, and similar concerns relate to it.

Keen 4

#Got Wetsuit message
%patch $F400 $0008W #Window height
%patch $F404 $001AW #Window width
%patch $F3F2 $0070W #Cache chunk 111
%patch $F410 $0070W #Display chunk 112
%patch $F41F $0030W #X location of image (From window right)
%patch $F435 $1BDBW #Text read from

#Text
%patch $30A4B  "Cool!  I can breathe" $0A
               "under water now!" $00


Disable message

This patch disables the message entirely, Keen will simply exit the level when he contacts the Wetsuit.

Keen 4

#Disable got Wetsuit message (Free $F3D2-$F494)
%patch $12A58 $90 $90 $90 $90 $90


Wetsuit doesn't win level

This patch changes things so that when Keen gets the Wetsuit it vanishes after the message appears and the level is not won. (As a side effect Keen's score in the Scorebox may 'grey out'; this will be fixed when he next gets points and is of minor concern only.) As a side effect Keen can get the Wetsuit even while in the air.

This patch is incompatible with many other Wetsuit patches; including those that change or disable the sound played ($2D) and what the Wetsuit gives. It should be relatively obvious how to fuse such patches with the code below however to combine effects.

Keen 4

#Wetsuit doesn't win level
%patch $12A30 $55 $8B $EC $56 $57 $8B $7E $06 $8B $76 $08 $83 $3C [$02] {$75} $2A
              $C7 $06 {$7A5CW}  [$0001W]  $B8 [$002DW]  $50 $9A $187409F1RL     $83
              $C4 $02 $9A $0E8F0AE2RL     $9A $16540D59RL     $57 $9A $06BD1E8BRL
                      $83 $C4 $02 $9A $16540D59RL        $5F $5E $5D $CB


Wetsuit wins game

This patch creates a new level state that automatically wins the game, then makes the Wetsuit sprite trigger it (instead of winning the level.) Nothing else is changed, the Wetsuit still brings up a window and gives the Wetsuit and Keen can still win the game by rescuing 8 Council Members.

Keen 4

#State 13 wins game
%patch $6BD9 [$0EB2W]

#Wetsuit sets level state to 13 instead of 2
%patch $12A62 $C7 $06 {$7A70W}  [$000DW]


Misc

These patches mostly affect the manipulation of the swimsuit variable and require a knowledge of game stats


What suit sprite gives

This affects what touching the Wetsuit sprite gives Keen. By default it gives him one Wetsuit, but it can be made to give a key or points or nothing or what have you.

What suit sprite gives

#What Wetsuit gives
%patch $12A48 {$7A5CW} [$0001W]

#Don't give anything
%patch $12A46 $90 $90 $90 $90 $90 $90


Wetsuit got sound

The Wetsuit makes a sound when Keen touches it. These patches are incompatible with the complete collision code patches above.

Keen 4

#Wetsuit got sound
%patch $12A4D $2D

#Don't play Wetsuit got sound
%patch $12A4A $EB $0A


Play music when Wetsuit got

This patch causes the music to change when the Wetsuit is got. As a side-effect no sound plays when the Wetsuit is got. The blue value used here is the level who's music is used. (For example a value of 0 will play the map level's music.)

Keen 4

#Change music when Wetsuit got
%patch $12A51 $06BD20C7RL
%patch $12A4D [$0001W]      #Play this level's song


What triggers 'can't swim'

This is what the map looks for when either letting Keen swim or not. By default if the suit variable is NOT equal to 0 then Keen can swim. It is thus possible to make the trigger something like a gem or completed level. Looking at Patch:Jump conditions will allow you to make it so Keen can always or never swim on the map.

Map item check

#Swimsuit map trigger:
%patch $E208 {$7A5C} [$00] $75


Keen can never swim on map

This patch makes it so that Keen can never enter water on the map, the 'can't swim' message will always play, even if he has the Wetsuit.

Keen can never swim on map

#Keen can never swim on map
%patch $E206 $EB $05


Disable getting Wetsuit with cheats

This stops the player getting the Wetsuit with the BAT or free items cheats. (It may be better tho change what is affected rather than just disabling this, see the cheat's pages for details.)

The first patch removes any effect at all, whereas the second removes the Wetsuit when the cheat is used.

Keen 4

#Disable giving Wetsuit on BAT and F10-I cheat
%patch $788F $EB $02 #BAT cheat
%patch $755C $EB $04 #F10-I cheat

Keen 4

#Remove Wetsuit on BAT and F10-I cheat
%patch $7894 $0000W #BAT cheat
%patch $7560 $0000W #F10-I cheat


Wetsuit and status window

For patches involving how the Wetsuit is displayed in the status window see Patch:Status Window (Galaxy).


Don't show Wetsuit in status window

This patch completely removes the Wetsuit from the status window leaving only a blank space.

Keen 4

#Don't display any Wetsuit stuff
%patch $8058 $EB $4D