Patch:Keen shooting (Galaxy)

From KeenWiki
Jump to: navigation, search

This page contains patches that cover Keen shooting and his firing rate, as well as his shots. Some patches will overlap other game actions, such as patches relating to Keen shooting on a pole. Since the three Galaxy games are so similar patches for all three are treated together on this page. Patches for individual episodes that relate to the player can be found at Patch:Keen (Keen 4), Patch:Keen (Keen 5) and Patch:Keen (Keen 6). Patches relating to the player's shot itself can be found at Patch:Keen's shot (Galaxy).


Remove impossible bullet

This patch removes the 'impossible bullet' bug in Keen 6 by preventing the bullet and Platforms from sharing the same collision code.

Patch: Keen 6
#Fix impossible bullet bug
%patch $BF24 $27 %patch $BF38 $EB $0F


Continuous firing

This patch allows Keen to fire continuously, that is, hold down the fire key and produce a constant (Though not very fast) stream of shots. Several patches are required due to the different things Keen can be doing while shooting.

Patch: Keen 4
#Continuous firing when shooting while...
%patch $BAA8 $EB $04
#Standing still
%patch $BEB7 $EB $04
#Walking
%patch $C464 $EB $04
#Jumping
%patch $C5E0 $EB $04
#Pogoing
%patch $C64F $EB $04
#On poles

Patch: Keen 5
#Continuous firing when shooting while...
%patch $AE70 $EB $04
#Standing still
%patch $B27C $EB $04
#Walking
%patch $B882 $EB $04
#Jumping
%patch $B9FE $EB $04
#Pogoing
%patch $BA6D $EB $04
#On poles

Patch: Keen 6
#Continuous firing when shooting while...
%patch $ACBE $EB $04
#Standing still
%patch $B0B8 $EB $04
#Walking
%patch $B665 $EB $04
#Jumping
%patch $B7E1 $EB $04
#Pogoing
%patch $B850 $EB $04
#On poles


Increase shot rate

This increases the rate Keen can shoot slightly faster. It has the advantage of making the shot rate directly proportional to Keen's shooting animation speed. (1 shot per animation.)

Patch: Keen 4
#Increase firing rate
%patch $2FBF6 $098CW
#Shoot left\right
%patch $2FC32 $098CW
#Shoot up
%patch $30088 $11A2W
#Shoot left\right in air
%patch $300E2 $11A2W
#Shoot up in air
%patch $3013C $11A2W
#Shoot down in air
%patch $2FE6C $0EF0W
#Shoot left\right on pole
%patch $2FEA8 $0EF0W
#Shoot up on pole
%patch $2FEE4 $0EF0W
#Shoot down on pole


Multiple shots per fire

This patch makes Keen produce several shots each time he fires (Except when in the air.) The exact number of shots will depend on the animation speed of his shooting. The default is five shots.

Patch: Multiple shots per firing
#Multiple shots per firing -Keen 4
%patch $2FBDE $0003W
#Shot left\right
%patch $2FC1A $0003W
#Shoot up
%patch $2FE54 $0003W
#Shoot left\right on pole
%patch $2FE90 $0003W
#Shoot up on pole
%patch $2FECC $0003W
#Shoot down on pole
#Multiple shots per firing -Keen 5
%patch $30F32 $0003W
#Shot left\right
%patch $30F6E $0003W
#Shoot up
%patch $31202 $0003W
#Shoot left\right on pole
%patch $3123E $0003W
#Shoot up on pole
%patch $3127A $0003W
#Shoot down on pole
#Multiple shots per firing -Keen 6
%patch $31916 $0003W
#Shot left\right
%patch $31952 $0003W
#Shoot up
%patch $31B8C $0003W
#Shoot left\right on pole
%patch $31BC8 $0003W
#Shoot up on pole
%patch $31C04 $0003W
#Shoot down on pole


What decreases when Keen shoots

When Keen shoots he loses one from his ammo counter. it is possible to change this so that something else is diminished. (See patch:Game stats.)

Patch: What decreases when Keen shoots
#Decrease ammo by 1 per shot -Keen 4
%patch $E57E $FF $0E $7A58W
#Decrease this by 1 per shot
#Decrease ammo by 1 per shot -Keen 5
%patch $DCAD $FF $0E $6F56W
#Decrease this by 1 per shot
#Decrease ammo by 1 per shot -Keen 6
%patch $D818 $FF $0E $7590W
#Decrease this by 1 per shot


Keen doesn't lose a shot when shooting

This patch stops Keen losing a shot when he shoots, which means as long as he has any shots at all he can shoot as much as he wants.

Patch: Don't lose a shot when shooting
#Don't lose a shot when shooting -Keen 4
%patch $E57E $9090W $9090W
#Don't lose a shot when shooting -Keen 5
%patch $DCAD $9090W $9090W
#Don't lose a shot when shooting -Keen 6
%patch $D818 $9090W $9090W


Keen doesn't lose a shot under some conditions

This patch adds a check to Keen's shooting code that skips the 'lose a shot' code under certain conditions. This can include if he has an item or is in a certain level. (Here the patch causes Keen not to lose shots in level 13.) As a side effect the 'bad dir' error does not occur and crash the game if Keen shoots invalidly instead causing Keen to do nothing.

The first line checks Keen's ammo, it is the second line that performs the loss check.

Patch: Don't lose a shot when shooting
#Modify shooting code to not decrement ammo in level 13
%patch $DC95 $55 $8B $EC $83 $3E $6F56W $00 $75 $07 $B8 $0015W $50 $E9 $0090W $83 $3E $9E55W $0D $74 $05 %patch $DD36 $9A $196E09EFRL $83 $C4 $02 $5D $CB %patch $DD55 $1046W
#Left (At $DCF6)
$108EW
#INVALID (At $DD3E)
$1056W
#Up (At $DD06)
$108EW
#INVALID (At $DD3E)
$1066W
#Right (At $DD16)
$108EW
#INVALID (At $DD3E)


Keen doesn't need ammo

This patch removes the ammo check (and decrease) when Keen shoots, so he can keep firing his stunner as many times as he wants, with his ammo counter remaining the same. (This means that he doesn't need rayguns or the ammo counter.)

Patch: Keen 4
#Keen can always shoot, don't lose ammo
%patch $E56E $EB $12

Patch: Keen 5
#Keen can always shoot, don't lose ammo
%patch $DC9D $EB $12

Patch: Keen 6
#Keen can always shoot, don't lose ammo
%patch $D802 $EB $18


What Keen needs to shoot

By default Keen needs any amount of ammunition that is not 0 to shoot. even negative ammunition will work. It is possible to allow Keen to shoot only in all sorts of strange situation (Such as having a keycard or not being able to shoot in a certain level.) using game stats.

Patch: Keen 4
#What Keen needs to shoot
%patch $E56B $7A58W $00 $75
#Keen has not 0 shots

Patch: Keen 5
#What Keen needs to shoot
%patch $DC9A $6F56W $00 $75
#Keen has not 0 shots

Patch: Keen 6
#What Keen needs to shoot
%patch $D804 $7590W $00 $75
#Keen has not 0 shots


Keen is always out of ammo

This patch makes Keen 'gunclick' no matter how much ammunition he has. That is, he will still make a shooting animation and a sound.

Patch: Keen 4
#Keen never shoots
%patch $E56E $90 $90

Patch: Keen 5
#Keen never shoots
%patch $DC9D $90 $90

Patch: Keen 6
#Keen never shoots
%patch $D807 $90 $90


Machine gun patch

This patch combines several of the above patches allowing Keen to shoot a continuous stream of shots (except again when falling through the air.) A side effect is that the limit for how many enemies\objects that can be placed in the level is reduced by about 10, since so many shots (each one itself a sprite) can be onscreen at one time. Using this patch without the 'don't lose a shot' line results in Keen's ammo being depleted very fast.

Patch: Keen 4 Machinegun patch
#Don't lose a shot
%patch $E57E $9090W $9090W
#Multiple shots when firing
%patch $BAA8 $EB $04
#Standing still
%patch $BEB7 $EB $04
#Walking
%patch $C464 $EB $04
#Jumping
%patch $C5E0 $EB $04
#Pogoing
%patch $C64F $EB $04
#On poles
#Increase firing rate
%patch $2FBF6 $098CW
#Shoot left\right
%patch $2FC32 $098CW
#Shoot up
%patch $30088 $11A2W
#Shoot left\right in air
%patch $300E2 $11A2W
#Shoot up in air
%patch $3013C $11A2W
#Shoot down in air
%patch $2FE6C $0EF0W
#Shoot left\right on pole
%patch $2FEA8 $0EF0W
#Shoot up on pole
%patch $2FEE4 $0EF0W
#Shoot down on pole
#Multiple shots per firing
%patch $2FBDE $0003W
#Shot left\right
%patch $2FC1A $0003W
#Shoot up
%patch $2FE54 $0003W
#Shoot left\right on pole
%patch $2FE90 $0003W
#Shoot up on pole
%patch $2FECC $0003W
#Shoot down on pole


Slingshot patch

This patch allows Keen to shoot in an arc, like in Keen Dreams. This is done in several steps. Firstly shots must be allowed vertical and horizontal directions (By default they have either/or.) Then all four different shot directions are given two speeds -a vertical and a horizontal speed. The line after this ensures that shots behave properly offscreen and shouldn't be messed with. Finally the shot is made to fall like a Berkeloid's shot. A side effect of this specific patch is that only one of Keen's shot frames will be shown, the other three are neglected.

Patch: Keen 4 Slingshot patch
#Keen shoots in an arc not a line:
#Set up shot to have h and v speeds
%patch $E59E $C7 $47 $0E $0001W %patch $E5A7 $C7 $47 $10 $0001W
#Shot speeds
#Up
%patch $E5D0 $C7 $47 $18 $FFB4W $EB $30
#Vertical
%patch $E5CB $C7 $47 $16 $0000W
#Horizontal
#Right
%patch $E5E0 $C7 $47 $18 $FFE8W $EB $20
#Vertical
%patch $E5DB $C7 $47 $16 $0030W
#Horizontal
#Down
%patch $E5F0 $C7 $47 $18 $0020W $EB $10
#Vertical
%patch $E5EB $C7 $47 $16 $0000W
#Horizontal
#Left
%patch $E600 $C7 $47 $18 $FFE8W $90 $90
#Vertical
%patch $E5FB $C7 $47 $16 $FFC0W
#Horizontal
#Shot foreground and activity
%patch $E607 $C7 $47 $20 $0000W $C7 $47 $02 $0002W $90 $90
#Change shot actions to work like Berkeloid shots, leaves three frames free
%patch $305A8 $00B1W $00B1W $0000W $0000W $0000W $0002W $0000W $0000W $09DC16E5RL $00000000L $0D8F0E32RL $1738W

Patch: Keen 6 Slingshot patch
#Keen shoots in an arc not a line:
#Set up shot to have h and v speeds
%patch $D838 $C7 $47 $0E $0001W %patch $D841 $C7 $47 $10 $0001W
#Shot speeds
#Up
%patch $D86A $C7 $47 $18 $FFB4W $EB $30
#Vertical
%patch $D865 $C7 $47 $16 $0000W
#Horizontal
#Right
%patch $D87A $C7 $47 $18 $FFE8W $EB $20
#Vertical
%patch $D875 $C7 $47 $16 $0030W
#Horizontal
#Down
%patch $D88A $C7 $47 $18 $0020W $EB $10
#Vertical
%patch $D885 $C7 $47 $16 $0000W
#Horizontal
#Left
%patch $D89A $C7 $47 $18 $FFE8W $90 $90
#Vertical
%patch $D895 $C7 $47 $16 $FFC0W
#Horizontal
#Shot foreground and activity
%patch $D8A1 $C7 $47 $20 $0000W $C7 $47 $02 $0002W $90 $90
#Change shot actions to work like Babobba shots, leaves three frames free
%patch $3226E $0060W $0060W $0000W $0000W $0000W $0002W $0000W $0000W $08F41765RL $00000000L $0CA60FB1RL $153EW


Stop Keen shooting

These patches selectively stop Keen shooting in certain situations. All of them together will stop Keen shooting entirely.


Disable shooting while pogoing

This patch stops Keen from shooting while pogoing.

Patch: Disable shooting while pogoing
#Disable shooting while pogoing -Keen 4
%patch $C5DE $EB
#Disable shooting while pogoing -Keen 5
%patch $B9FC $EB
#Disable shooting while pogoing -Keen 6
%patch $B7DF $EB


Disable shooting while jumping

This patch stops Keen from shooting while jumping\falling.

Patch: Disable shooting while jumping
#Disable shooting while jumping -Keen 4
%patch $C462 $EB
#Disable shooting while jumping -Keen 5
%patch $B880 $EB
#Disable shooting while jumping -Keen 6
%patch $B663 $EB


Disable shooting or jumping on poles

These patches disable Keen's ability to jump off poles, shoot on poles or both. (Keen can leave poles by turning left\right at the top of poles or moving off the bottom, so disabling jumping does not lock him onto poles permanently.)

Patch: Keen 4
#Disable jumping off poles (Frees $C682-$C6CF)
%patch $C680 $EB
#Disable shooting on poles (Frees $C648-$C67A)
%patch $C646 $EB
#Disable shooting and jumping on poles (Frees $C64F-$C6D2)
%patch $C641 $5E $5D $CB

Patch: Keen 5
#Disable jumping off poles (Frees $BAA0-$BAED)
%patch $BA9E $EB
#Disable shooting on poles (Frees $BA66 -$BA98)
%patch $BA64 $EB
#Disable shooting and jumping on poles (Frees $BA62-$BAF0)
%patch $BA5F $5E $5D $CB

Patch: Keen 6
#Disable jumping off poles (Frees $B883-$B8D0)
%patch $B881 $EB
#Disable shooting on poles (Frees $B849 -$B87B)
%patch $B847 $EB
#Disable shooting and jumping on poles (Frees $B845-$B8D3)
%patch $B842 $5E $5D $CB


Keen's shooting sprites

This section contains patches that relate to the action properties of Keen when he is shooting. These are such things as his speed, animations used and sprite collision.


Sprite Actions

Galaxy Keen's shooting-related actions can be divided into three major types: shooting on the ground, shooting in the air and shooting on a pole. Each of these groups comes in two or three subgroups: shooting horizontally, shooting up and shooting down. Each shooting subgroup consists of two or three actions. The first action is 'preparatory'; it readies Keen for making a shot, setting his animation and other parameters. The second actually produces the shot and the third is a 'post shooting' action used in some cases to reset certain variables so Keen can continue doing what he was doing beforehand.

There are also 'shooting checks'; these check Keen's current action to see what kind of shot he should produce and should always be the first action of the shooting sequence. This is required because all of Keen's 'make a shot' actions use the same code. This code checks to see which actions make shots in which directions. Messing with these can do things like make Keen shoot up when he meant to shoot right.

Shooting sequences can also be changed if Keen moves from air to ground. For example, when landing on the ground two checks are made to see if Keen is shooting left\right or up. For both these actions Keen then changes to shooting on the ground. (If Keen is shooting downwards in the air he will lose his shot.)


Keen 4

Actions:
$098CW #Keen standing
$0C02W #Keen looking up
$0D6AW #Keen shooting horizontally 1
$0D88W #Keen shooting horizontally 2
$0DA6W #Keen shooting up 1
$0DC4W #Keen shooting up 2
$0EF0W #Keen still on a pole
$0FE0W #Keen shooting horizontally on a pole 1
$0FFEW #Keen shooting horizontally on a pole 2
$101CW #Keen shoots up on pole 1
$103AW #Keen shoots up on pole 2
$1058W #Keen shooting down on a pole 1
$1076W #Keen shooting down on a pole 2
$11A2W #Keen falling
$11DEW #Keen start shooting horizontally in air 
$11FCW #Keen shoot horizontally in air 1
$121AW #Keen shoot horizontally in air 2
$1238W #Keen start shooting upwards in air 
$1256W #Keen shooting up in air 1
$1274W #Keen shooting up in air 2
$1292W #Keen start shooting downwards in air 
$12B0W #Keen shoot down in air 1
$12CEW #Keen shoot down in air 2

Patch: Shooting when landing
#When Keen lands on ground...
%patch $D50A $11DEW
#...if shooting left\right...
%patch $D50F $0D6AW
#...go to shooting left\right on ground, else...
%patch $D520 $1238W
#...if shooting upwards...
%patch $D525 $0DA6W
#...go to shooting up on ground

Patch: Shooting horizontally while standing
#Start shooting...
%patch $BAC0 $0D6AW
#While standing
%patch $BED1 $0D6AW
#While walking
#Check if Keen is already shooting
%patch $C99F $0D6AW
#Shooting horizontally while standing sequence
%patch $2FBF6 $0D88W %patch $2FC14 $098CW

Patch: Shooting up while standing
#Start shooting...
%patch $BAB8 $0DA6W
#While standing
%patch $BEC7 $0DA6W
#While walking
#Shooting check
%patch $CA62 $0DA6W
#Shooting up while standing sequence
%patch $2FC32 $0DC4W %patch $2FC50 $0C02W

Patch: Shooting horizontally while in air
#Start shooting...
%patch $C488 $11DEW
#While jumping\falling
%patch $C604 $11DEW
#While pogoing
#Shooting check
%patch $C9E2 $11FCW
#Shooting horizontally while in air sequence
%patch $3006A $11FCW %patch $30088 $121AW %patch $300A6 $11A2W

Patch: Shooting up while in air
#Start shooting...
%patch $C480 $1238W
#While jumping\falling
%patch $C5FC $1238W
#While pogoing
#Shooting check
%patch $CA42 $1256W
#Shooting up while in air sequence
%patch $300C4 $1256W %patch $300E2 $1274W %patch $30100 $11A2W

Patch: Shooting down while in air
#Start shooting...
%patch $C490 $1292W
#While jumping\falling
%patch $C60C $1292W
#While pogoing
#Shooting check
%patch $CA21 $12B0W
#Shooting down while in air sequence
%patch $3011E $12B0W %patch $3013C $12CEW %patch $3015A $11A2W

Patch: Shooting horizontally on a pole
#Start shooting
%patch $C672 $0FE0W
#Shooting check
%patch $CA82 $0FE0W
#Shooting horizontally on a pole sequence
%patch $2FE6C $0FFEW %patch $2FE8A $0EF0W

Patch: Shooting up on a pole
#Start shooting
%patch $C66B $101CW
#Shooting check
%patch $CAC5 $101CW
#Shooting up on a pole sequence
%patch $2FEA8 $103AW %patch $2FEC6 $0EF0W

Patch: Shooting down on a pole
#Start shooting
%patch $C679 $1058W
#Shooting check
%patch $CB06 $1058W
#Shooting down on a pole sequence
%patch $2FEE4 $1076W %patch $2FF02 $0EF0W


Keen 5

Actions:
$0888W #Keen standing
$0AC2W #Keen looking up
$0BEEW #Keen shooting horizontally 1
$0C0CW #Keen shooting horizontally 2
$0C2AW #Keen shooting up 1
$0C48W #Keen shooting up 2
$0DCEW #Keen still on a pole
$0EBEW #Keen shooting horizontally on a pole 1
$0EDCW #Keen shooting horizontally on a pole 2
$0EFAW #Keen shoots up on pole 1
$0F18W #Keen shoots up on pole 2
$0F36W #Keen shooting down on a pole 1
$0F54W #Keen shooting down on a pole 2
$109EW #Keen falling
$10BCW #Keen start shooting horizontally in air 
$10DAW #Keen shoot horizontally in air 1
$10F8W #Keen shoot horizontally in air 2
$1116W #Keen start shooting upwards in air 
$1134W #Keen shooting up in air 1
$1152W #Keen shooting up in air 2
$1170W #Keen start shooting downwards in air 
$118EW #Keen shoot down in air 1
$11ACW #Keen shoot down in air 2

Patch: Shooting horizontally while standing
#Shooting horizontally while standing sequence
%patch $30F4A $0C0CW %patch $30F68 $0888W

Patch: Shooting up while standing
#Shooting up while standing sequence
%patch $30F86 $0C48W %patch $30FA4 $0AC2W

Patch: Shooting horizontally while in air
#Shooting horizontally while in air sequence
%patch $31418 $10DAW %patch $31436 $10F8W %patch $31454 $1080W

Patch: Shooting up while in air
#Shooting up while in air sequence
%patch $31472 $1134W %patch $31490 $1152W %patch $314AE $1080W

Patch: Shooting down while in air
#Shooting down while in air sequence
%patch $314CC $118EW %patch $314EA $11ACW %patch $31508 $1080W

Patch: Shooting horizontally on a pole
#Start shooting horizontally
%patch $BA90 $0EBEW
#Shooting horizontally check
%patch $BEA0 $0EBEW
#Shooting horizontally on a pole sequence
%patch $3121A $0EDCW %patch $31238 $0DCEW

Patch: Shooting up on a pole
#Start shooting up
%patch $BA89 $0EFAW
#Shooting up check
%patch $BEE3 $0EFAW
#Shooting up on a pole sequence
%patch $31256 $0F18W %patch $31274 $0DCEW

Patch: Shooting down on a pole
#Start shooting down
%patch $BA97 $0F36W
#Shooting down check
%patch $BF24 $0F36W
#Shooting down on a pole sequence
%patch $31292 $0F54W %patch $312B0 $0DCEW


Keen 6

Actions:
$089AW #Keen standing
$0AB6W #Keen looking up
$0BE2W #Keen shooting horizontally 1
$0C00W #Keen shooting horizontally 2
$0C1EW #Keen shooting up 1
$0C3CW #Keen shooting up 2
$0D68W #Keen still on a pole
$0E58W #Keen shooting horizontally on a pole 1
$0E76W #Keen shooting horizontally on a pole 2
$0E94W #Keen shoots up on pole 1
$0EB2W #Keen shoots up on pole 2
$0ED0W #Keen shooting down on a pole 1
$0EEEW #Keen shooting down on a pole 2
$101AW #Keen falling
$1056W #Keen start shooting horizontally in air 
$1074W #Keen shoot horizontally in air 1
$1092W #Keen shoot horizontally in air 2
$10B0W #Keen start shooting upwards in air 
$10CEW #Keen shooting up in air 1
$10ECW #Keen shooting up in air 2
$110AW #Keen start shooting downwards in air 
$1128W #Keen shoot down in air 1
$1146W #Keen shoot down in air 2

Patch: Shooting when landing
#When Keen lands on ground...
%patch $C629 $1056W
#...if shooting left\right...
%patch $C62E $0BE2W
#...go to shooting left\right on ground, else...
%patch $C63F $10B0W
#...if shooting upwards...
%patch $C644 $0C1EW
#...go to shooting up on ground

Patch: Shooting horizontally while standing
#Start shooting...
%patch $ACD6 $0BE2W
#While standing
%patch $BD02 $0BE2W
#While walking
#Shooting check
%patch $BBA0 $0BE2W
#Shooting horizontally while standing sequence
%patch $3192E $0C00W %patch $3194C $089AW

Patch: Shooting up while standing
#Start shooting...
%patch $ACCE $0C1EW
#While standing
%patch $BC08 $0C1EW
#While walking
#Shooting check
%patch $BC63 $0C1EW
#Shooting up while standing sequence
%patch $3196A $0C3CW %patch $31988 $0AB6W

Patch: Shooting horizontally while in air
#Start shooting...
%patch $B689 $1056W
#While jumping\falling
%patch $B805 $1056W
#While pogoing
#Shooting checks
%patch $BBE3 $1074W %patch $C629 $1056W
#Shooting horizontally while in air sequence
%patch $31DA2 $1074W %patch $31DC0 $1092W %patch $31DDE $101AW

Patch: Shooting up while in air
#Start shooting...
%patch $B691 $10B0W
#While jumping\falling
%patch $B7FD $10B0W
#While pogoing
#Shooting check
%patch $BC43 $10CEW
#Shooting up while in air sequence
%patch $31DFC $10CEW %patch $31E1A $10ECW %patch $31E38 $101AW

Patch: Shooting down while in air
#Start shooting...
%patch $B691 $110AW
#While jumping\falling
%patch $B80D $110AW
#While pogoing
#Shooting check
%patch $BC22 $1128W
#Shooting down while in air sequence
%patch $31E56 $1128W %patch $31E74 $1146W %patch $31E92 $101AW

Patch: Shooting horizontally on a pole
#Start shooting
%patch $B873 $0E58W
#Shooting check
%patch $BC83 $0E58W
#Shooting horizontally on a pole sequence
%patch $31BA4 $0E76W %patch $31BC2 $0D68W

Patch: Shooting up on a pole
#Start shooting
%patch $B86C $0E94W
#Shooting check
%patch $BCC6 $0E94W
#Shooting up on a pole sequence
%patch $31BE0 $0EB2W %patch $31BFE $0D68W

Patch: Shooting down on a pole
#Start shooting
%patch $B87A $0ED0W
#Shooting check
%patch $BD07 $0ED0W
#Shooting down on a pole sequence
%patch $31C1C $0EEEW %patch $31C3A $0D68W


Sprite Behavior

Keen's shooting sequence can be divided into two kinds of action, 'active' and 'inactive'. Active actions produce the shot, there is one of these per shooting sequence. Inactive actions, as mentioned above, change various variables when starting or stopping shooting.

All actions where a shot is actually created use the 'spawnshot' behavior; the same behavior is used whether Keen is shooting in the air, on the ground or on poles. This behavior creates a shot (Or no ammo sound) at a certain position relative to Keen depending on his action and direction. This behavior must be used at least once in each shooting sequence. If it is replaced Keen cannot shoot using that sequence.

For ground and pole based shooting the 'inactive' shooting actions (those where a shot is not created) use no behavior at all. This means the player cannot 'interrupt' the shooting sequence by pressing other keys. For air-based shooting the general 'move through the air' behavior is used that causes Keen to fall under gravity. This stops Keen from 'floating' in the air while his shooting sequence runs.


Keen 4

Behaviors:
$09DC16C9RL #Move through the air
$0B801195RL #Shooting (Spawn Keen's shot in arrow direction)

Patch: Keen 4
#Shooting horizontally while standing
%patch $2FBEA $0B801195RL %patch $2FC08 $00000000L
#Shooting up while standing
%patch $2FC26 $0B801195RL %patch $2FC44 $00000000L
#Shooting horizontally on poles
%patch $2FE60 $0B801195RL %patch $2FE7E $00000000L
#Shooting up on poles
%patch $2FE9C $0B801195RL %patch $2FEBA $00000000L
#Shooting down on poles
%patch $2FED8 $0B801195RL %patch $2FEF6 $00000000L
#Shooting horizontally while in air
%patch $3005E $09DC16C9RL %patch $3007C $0B801195RL %patch $3009A $09DC16C9RL
#Shooting up while in air
%patch $300B8 $09DC16C9RL %patch $300D6 $0B801195RL %patch $300F4 $09DC16C9RL
#Shooting down while in air
%patch $30112 $09DC16C9RL %patch $30130 $0B801195RL %patch $3014E $09DC16C9RL


Keen shooting behavior code

This is the complete behavior code for Keen shooting. On the first line the game checks to see if Keen has any ammunition. If he doesn't then sound $15 is played and the code ends. If he does however then his ammunition counter is decremented 1 at the end of line 2 and a type 1 sprite (Keen's shot) is produced.

This sprite has a foreground value of 0, type of 3 and activity of 2. (The activity is especially important, allowing Keen's shot to act offscreen.) Sound $04 is then played.

At this point the shot's horizontal and vertical directions are set. To do this it refers to a list 6 + 1 entries long at $E625 ($D8F0 + $0D35). The entry number read here is set when Keen's shots are positioned. Three entries are invalid, crashing the game if used. (This should never happen.) The four remaining pointers point to code that sets the vertical and horizontal directions to 1, 0 or -1. All four codes then jump over the error code (Error $184C) to set the shot's action as $1738W.

Patch: Keen 4
#Keen shooting behavior code
%patch $E566 $55 $8B $EC $83 $3E $7A58W $00 $75 $0E $B8 $0015W $50 $9A $187409F1RL $83 $C4 $02 $5D $CB $FF $0E $7A58W $B8 $0001W $50 $9A $06BD1E11RL $83 $C4 $02 $8B $1E $D8 $A7 $8B $46 $06 $89 $47 $0A $8B $46 $08 $89 $47 $0C $C7 $47 $20 $0000W $C7 $07 $0003W $C7 $47 $02 $0002W $B8 $0004W $50 $9A $187409F1RL $83 $C4 $02 $8B $5E $0A $83 $FB $06 $77 $47 $D1 $E3 $2E $FF $A7 $0D35W $8B $1E $D8 $A7 $C7 $47 $0E $0000W $C7 $47 $10 $FFFFW $EB
#Left shot directions
$3C $8B $1E $D8 $A7 $C7 $47 $0E $0001W $C7 $47 $10 $0000W $EB
#Up shot directions
$2C $8B $1E $D8 $A7 $C7 $47 $0E $0000W $C7 $47 $10 $0001W $EB
#Right shot directions
$1C $8B $1E $D8 $A7 $C7 $47 $0E $FFFFW $C7 $47 $10 $0000W $EB
#Down shot directions
$0C $B8 $184CW $50 $9A $037D022FRL $83 $C4 $02 $B8 $1738W $50 $FF $36 $D8 $A7 $9A $09DC118CRL $83 $C4 $04 $5D $CB
#Shot direction pointer list
%patch $E625 $0CD7W
#Left (At $E5C7)
$0D17W
#INVALID (At $E607)
$0CE7W
#Up (At $E5D7)
$0D17W
#INVALID (At $E607)
$0CF7W
#Right (At $E5E7)
$0D17W
#INVALID (At $E607)
$0D07W
#Down (At $E5F7)


Keen 5

Behaviors:
$090B1710RL #Move through the air
$0AAF12C3RL #Keen shoot (Spawn shot)

Patch: Keen 5
#Shooting horizontally while standing
%patch $30F3E $0AAF12C3RL %patch $30F5C $00000000L
#Shooting up while standing
%patch $30F7A $0AAF12C3RL %patch $30F98 $00000000L
#Shooting horizontally on poles
%patch $3120E $0AAF12C3RL %patch $3122C $00000000L
#Shooting up on poles
%patch $3124A $0AAF12C3RL %patch $31268 $00000000L
#Shooting down on poles
%patch $31286 $0AAF12C3RL %patch $312A4 $00000000L
#Shooting horizontally while in air
%patch $3140C $090B1710RL %patch $3142A $0AAF12C3RL %patch $31448 $090B1710RL
#Shooting up while in air
%patch $31466 $090B1710RL %patch $31484 $0AAF12C3RL %patch $314A2 $090B1710RL
#Shooting down while in air
%patch $314C0 $090B1710RL %patch $314DE $0AAF12C3RL %patch $314FC $090B1710RL


Keen shooting behavior code

This is the complete behavior code for Keen shooting. On the first line the game checks to see if Keen has any ammunition. If he doesn't then sound $15 is played and the code ends. If he does however then his ammunition counter is decremented 1 at the end of line 2 and a type 1 sprite (Keen's shot) is produced.

This sprite has a foreground value of 0, type of 3 and activity of 2. (The activity is especially important, allowing Keen's shot to act offscreen.) Sound $04 is then played.

At this point the shot's horizontal and vertical directions are set. To do this it refers to a list 6 + 1 entries long at $DD55 ($CCB0 + $10A5). The entry number read here is set when Keen's shots are positioned. Three entries are invalid, crashing the game if used. (This should never happen.) The four remaining pointers point to code that sets the vertical and horizontal directions to 1, 0 or -1. All four codes then jump over the error code (Error $1631) to set the shot's action as $1502W.

Patch: Keen 5
#Keen shooting behavior code
%patch $DC95 $55 $8B $EC $83 $3E $6F56W $00 $75 $0E $B8 $0015W $50 $9A $196E09EFRL $83 $C4 $02 $5D $CB $FF $0E $6F56W $B8 $0001W $50 $9A $06B91DCDRL $83 $C4 $02 $8B $1E $40 $9E $8B $46 $06 $89 $47 $0A $8B $46 $08 $89 $47 $0C $C7 $47 $20 $0000W $C7 $07 $0003W $C7 $47 $02 $0002W $B8 $0004W $50 $9A $196E09EFRL $83 $C4 $02 $8B $5E $0A $83 $FB $06 $77 $47 $D1 $E3 $2E $FF $A7 $10A5W $8B $1E $40 $9E $C7 $47 $0E $0000W $C7 $47 $10 $FFFFW $EB $3C $8B $1E $40 $9E $C7 $47 $0E $0001W $C7 $47 $10 $0000W $EB $2C $8B $1E $40 $9E $C7 $47 $0E $0000W $C7 $47 $10 $0001W $EB $1C $8B $1E $40 $9E $C7 $47 $0E $FFFFW $C7 $47 $10 $0000W $EB $0C $B8 $1631W $50 $9A $037D022FRL $83 $C4 $02 $B8 $1502W $50 $FF $36 $40 $9E $9A $090B11C4RL $83 $C4 $04 $5D $CB
#Shot direction pointer list
%patch $DD55 $1046W
#Left (At $DCF6)
$1086W
#INVALID (At $DD36)
$1056W
#Up (At $DD06)
$1086W
#INVALID (At $DD36)
$1066W
#Right (At $DD16)
$1086W
#INVALID (At $DD36)
$1076W
#Down (At $DD26)


Keen 6

Behaviors:
$08F41765RL #Move through the air
$0AA21176RL #Keen shoot (Spawn shot)

Patch: Keen 6
#Shooting horizontally while standing
%patch $31922 $0AA21176RL %patch $31940 $00000000L
#Shooting up while standing
%patch $3195E $0AA21176RL %patch $3197C $00000000L
#Shooting horizontally on poles
%patch $31B98 $0AA21176RL %patch $31BB6 $00000000L
#Shooting up on poles
%patch $31BD4 $0AA21176RL %patch $31BF2 $00000000L
#Shooting down on poles
%patch $31C10 $0AA21176RL %patch $31C2E $00000000L
#Shooting horizontally while in air
%patch $31D96 $08F41765RL %patch $31DB4 $0AA21176RL %patch $31DD2 $08F41765RL
#Shooting up while in air
%patch $31DF0 $08F41765RL %patch $31E0E $0AA21176RL %patch $31E2C $08F41765RL
#Shooting down while in air
%patch $31E4A $08F41765RL %patch $31E68 $0AA21176RL %patch $31E86 $08F41765RL


Sprite Collision

These are the values of the sprite collisions Keen uses when shooting. Keen has two collision he uses for the majority of his actions. The first collision is the most complex and responds to things like the Foot. This is used by nearly all of Keen's shooting actions.

The second sprite collision is used when Keen shoots on poles. It is far simpler, meaning pole-shooting Keen cannot do things like grab item sprites. It is completely separate from the first collision.

The end result of this is that shooting Keen uses the same collision as what he did before shooting. This avoids anomalies when Keen shoots.


Keen 4

For patches relating to the second sprite collision see the link.

Collisions:
$0B8014A9RL #First Keen collision
$0B801632RL #Second Keen collision

Patch: Keen 4
#Shooting horizontally while standing
%patch $329EE $0B8014A9RL %patch $32A0C $0B8014A9RL
#Shooting up while standing
%patch $32A2A $0B8014A9RL %patch $32A48 $0B8014A9RL
#Shooting horizontally on poles
%patch $32C64 $0B801632RL %patch $32C82 $0B801632RL
#Shooting up on poles
%patch $32CA0 $0B801632RL %patch $32CBE $0B801632RL
#Shooting down on poles
%patch $32CDC $0B801632RL %patch $32CFA $0B801632RL
#Shooting horizontally while in air
%patch $32E62 $0B8014A9RL %patch $32E80 $0B8014A9RL %patch $32E9E $0B8014A9RL
#Shooting up while in air
%patch $32EBC $0B8014A9RL %patch $32EDA $0B8014A9RL %patch $32EF8 $0B8014A9RL
#Shooting down while in air
%patch $32F16 $0B8014A9RL %patch $32F34 $0B8014A9RL %patch $32F52 $0B8014A9RL


Keen 5

Collisions:
$0AAF1597RL #First Keen collision
$0AAF167FRL #Second Keen collision

Patch: Keen 5
#Shooting horizontally while standing
%patch $30F42 $0AAF1597RL %patch $30F60 $0AAF1597RL
#Shooting up while standing
%patch $30F7E $0AAF1597RL %patch $30F9C $0AAF1597RL
#Shooting horizontally on poles
%patch $31212 $0AAF167FRL %patch $31230 $0AAF167FRL
#Shooting up on poles
%patch $3124E $0AAF167FRL %patch $3126C $0AAF167FRL
#Shooting down on poles
%patch $3128A $0AAF167FRL %patch $312A8 $0AAF167FRL
#Shooting horizontally while in air
%patch $31410 $0AAF1597RL %patch $3142E $0AAF1597RL %patch $3144C $0AAF1597RL
#Shooting up while in air
%patch $3146A $0AAF1597RL %patch $31488 $0AAF1597RL %patch $314A6 $0AAF1597RL
#Shooting down while in air
%patch $314C4 $0AAF1597RL %patch $314E2 $0AAF1597RL %patch $31500 $0AAF1597RL


Keen 6

Collisions:
$0AA2144ARL #First Keen collision
$0AA2154CRL Second Keen collision

Patch: Keen 6
#Shooting horizontally while standing
%patch $31926 $0AA2144ARL %patch $31944 $0AA2144ARL
#Shooting up while standing
%patch $31962 $0AA2144ARL %patch $31980 $0AA2144ARL
#Shooting horizontally on poles
%patch $31B9C $0AA2154CRL %patch $31BBA $0AA2154CRL
#Shooting up on poles
%patch $31BD8 $0AA2154CRL %patch $31BF6 $0AA2154CRL
#Shooting down on poles
%patch $31C14 $0AA2154CRL %patch $31C32 $0AA2154CRL
#Shooting horizontally while in air
%patch $31D9A $0AA2144ARL %patch $31DB8 $0AA2144ARL %patch $31DD6 $0AA2144ARL
#Shooting up while in air
%patch $31DF4 $0AA2144ARL %patch $31E12 $0AA2144ARL %patch $31E30 $0AA2144ARL
#Shooting down while in air
%patch $31E4E $0AA2144ARL %patch $31E6C $0AA2144ARL %patch $31E8A $0AA2144ARL


Animations

These are the animations Keen uses when shooting. Notice that actions shooting horizontally have two animations, one for left and one for right, while those shooting vertically have two identical animations.

Patch: Keen 4
#Keen shooting horizontally
%patch $2FBDA $00A7W $00ACW %patch $2FBE4 $0009W
#Pause before shot
%patch $2FBF8 $00A7W $00ACW %patch $2FC02 $0006W
#Pause before standing
#Keen shooting up
%patch $2FC16 $00ABW $00ABW %patch $2FC20 $0009W
#Pause before shot
%patch $2FC34 $00ABW $00ABW %patch $2FC3E $0006W
#Pause before standing
#Keen shooting horizontally on a pole
%patch $2FE50 $00C2W $00C3W %patch $2FE5A $0009W
#Pause before shooting
%patch $2FE6E $00C2W $00C3W %patch $2FE78 $0006W
#Pause before going back
#Keen shooting up on pole
%patch $2FE8C $00BEW $00BFW %patch $2FE96 $0009W
#Pause before shooting
%patch $2FEAA $00BEW $00BFW %patch $2FEB4 $0006W
#Pause before going back
#Keen shooting down on a pole
%patch $2FEC8 $00C1W $00C0W %patch $2FED2 $0009W
#Pause before shooting
%patch $2FEE6 $00C1W $00C0W %patch $2FEF0 $0006W
#Pause before going back
#Keen shooting horizontally in air
%patch $3004E $00A8W $00ADW %patch $30058 $0009W
#Pause before shot
%patch $3006C $00A8W $00ADW %patch $30076 $0001W
#Pause before going to falling 1
%patch $3008A $00A8W $00ADW %patch $30094 $0006W
#Pause before going to falling 2
#Keen shooting up in air
%patch $300A8 $00AAW $00AAW %patch $300B2 $0009W
#Pause before shot
%patch $300C6 $00AAW $00AAW %patch $300D0 $0001W
#Pause before going to falling 2
%patch $300E4 $00AAW $00AAW %patch $300EE $0006W
#Pause before going to falling 2
#Keen shooting down in air
%patch $30102 $00A9W $00A9W %patch $3010C $0009W
#Pause before shot
%patch $30120 $00A9W $00A9W %patch $3012A $0001W
#Pause before going to falling 1
%patch $3013E $00A9W $00A9W %patch $30148 $0006W
#Pause before going to falling 2

Patch: Keen 5
#Keen shooting horizontally
%patch $30F2E $0092W $0097W
#Shoot l/r
%patch $30F38 $0009W
#Pause before shot
%patch $30F4C $0092W $0097W
#Shoot l/r
%patch $30F56 $0006W
#Pause before stop shooting
#Keen shooting up
%patch $30F6A $0096W $0096W
#Shoot up
%patch $30F74 $0009W
#Pause before shot
%patch $30F88 $0096W $0096W
#Shoot up
%patch $30F92 $0006W
#Pause before stop shooting
#Keen shooting horizontally on a pole
%patch $311FE $00ADW $00AEW
#Pole shoot l/r
%patch $31208 $0009W
#Pause before shot
%patch $3121C $00ADW $00AEW
#Pole shoot l/r
%patch $31226 $0006W
#Pause before stop shooting
#Keen shooting up on pole
%patch $3123A $00A9W $00AAW
#Pole shoot up
%patch $31244 $0009W
#Pause before shot
%patch $31258 $00A9W $00AAW
#Pole shoot up
%patch $31262 $0006W
#Pause before stop shooting
#Keen shooting down on a pole
%patch $31276 $00ACW $00ABW
#Pole shoot down
%patch $31280 $0009W
#Pause before shot
%patch $31294 $00ACW $00ABW
#Pole shoot down
%patch $3129E $0006W
#Pause before stop shooting
#Keen shooting horizontally in air
%patch $313FC $0093W $0098W
#Shoot in air
%patch $31406 $0009W
#Pause before shot
%patch $3141A $0093W $0098W
#Shoot in air
%patch $31424 $0001W
#Pause before stop shooting
%patch $31438 $0093W $0098W
#Shoot in air
%patch $31442 $0006W
#Pause before keep falling
#Keen shooting up in air
%patch $31456 $0095W $0095W
#Shoot up in air
%patch $31460 $0009W
#Pause before shot
%patch $31474 $0095W $0095W
#Shoot up in air
%patch $3147E $0001W
#Pause before stop shooting
%patch $31492 $0095W $0095W
#Shoot up in air
%patch $3149C $0006W
#Pause before keep falling
#Keen shooting down in air
%patch $314B0 $0094W $0094W
#Shoot d in air
%patch $314BA $0009W
#Pause before shot
%patch $314CE $0094W $0094W
#Shoot d in air
%patch $314D8 $0001W
#Pause before stop shooting
%patch $314EC $0094W $0094W
#Shoot d in air
%patch $314F6 $0006W
#Pause before keep falling

Patch: Keen 6
#Keen shooting horizontally
%patch $31920 $0059W $005EW
#Keen shoots l/r
%patch $3192A $0009W
#Animation speed
%patch $3193E $0059W $005EW
#Keen shoots (Make bullet, go to standing)
%patch $31948 $0006W
#Animation speed
#Keen shooting up
%patch $3195C $005DW $005DW
#Keen shoots up
%patch $31966 $0009W
#Animation speed
%patch $3197A $005DW $005DW
#Keen shoots up (Make bullet, go to looking up)
%patch $31984 $0006W
#Animation speed
#Keen shooting horizontally in air
%patch $31D94 $005AW $005FW
#Keen shoots in air
%patch $31D9E $0009W
#Animation speed
%patch $31DB2 $005AW $005FW
#Keen shoots in air (Make bullet)
%patch $31DBC $0001W
#Animation speed
%patch $31DD0 $005AW $005FW
#Keen shoots in air (Goes to falling)
%patch $31DDA $0006W
#Animation speed
#Keen shooting up in air
%patch $31DEE $005CW $005CW
#Keen shoots up in air
%patch $31DF8 $0009W
#Animation speed
%patch $31E0C $005CW $005CW
#Keen shoots up in air (Make bullet)
%patch $31E16 $0001W
#Animation speed
%patch $31E2A $005CW $005CW
#Keen shoots up in air (Go to falling)
%patch $31E34 $0006W
#Animation speed
#Keen shooting down in air
%patch $31E48 $005BW $005BW
#Keen shoots down in air
%patch $31E52 $0009W
#Animation speed
%patch $31E66 $005BW $005BW
#Keen shoots down in air (Make bullets)
%patch $31E70 $0001W
#Animation speed
%patch $31E84 $005BW $005BW
#Keen shoots down in air (Go back to falling)
%patch $31E8E $0006W
#Animation speed
#Keen shooting horizontally on a pole
%patch $31B96 $0074W $0075W
#Keen shoot on a pole
%patch $31BA0 $0009W
#Animation speed
%patch $31BB4 $0074W $0075W
#Keen shoot on a pole (Make bullet, go to Keen on pole)
%patch $31BBE $0006W
#Animation speed
#Keen shooting up on pole
%patch $31BD2 $0070W $0071W
#Keen shoot up on a pole
%patch $31BDC $0009W
#Animation speed
%patch $31BF0 $0070W $0071W
#Keen shoot up on a pole (Make bullet, go back to Keen on pole)
%patch $31BFA $0006W
#Animation speed
#Keen shooting down on a pole
%patch $31C0E $0073W $0072W
#Keen shoot down on a pole
%patch $31C18 $0009W
#Animation speed
%patch $31C2C $0073W $0072W
#Keen shoot down on a pole (Make bullet, go back to Keen on pole)
%patch $31C36 $0006W
#Animation speed


Sounds

There are three sounds associated with Keen shooting. The first two are that made by his shot when it is produced and the sound made when that shot smashes. These are more properly associated with Keen's shot itself. The third sound is that made when Keen does not have any ammo, the 'gunclick' sound. All these sounds can be disabled

Patch: Keen 4
#Keen gunclick sound
%patch $E571 $15
#Don't play Keen gunclick sound
%patch $E570 $5D $CB
#Keen shoots sound
%patch $E5AD $04
#Don't play Keen shoots sound
%patch $E5AC $EB $0A
#Keen's shot smashes sound
%patch $E64C $19
#Don't play Keen's shot smashes sound
%patch $E64B $EB $0A

Patch: Keen 5
#Gunclick sound
%patch $DCA0 $15
#Don't play Gunclick sound
%patch $DC9F $5D $CB
#Keen shoot sound
%patch $DCDC $04
#Don't play Keen shoot sound
%patch $DCDB $EB $0A
#Keen's shot smashes sound
%patch $DD7C $19
#Don't play Keen's shot smashes sound
%patch $DD7B $EB $0A

Patch: Keen 6
#Gunclick sound
%patch $D80A $15
#Don't play Gunclick sound
%patch $D809 $5D $CB
#Keen shoot sound
%patch $D847 $04
#Don't play Keen shoot sound
%patch $D846 $EB $0A
#Keen's shot smashes sound
%patch $D93B $19
#Don't play Keen's shot smashes sound
%patch $D93A $EB $0A


Sprite-tile interaction

The tile interactions of Keen shooting are broadly the same as those for him not. For example shooting on the ground uses Keen's standing tile interaction. There are some subtleties; when shooting down on poles Keen uses the 'sit on poles' interaction rather than the 'go down poles' one.

Patch: Keen 4
#Shoot horizontal
%patch $2FBF2 $0B801AA2RL %patch $2FC10 $0B801AA2RL
#Shoot up
%patch $2FC2E $0B801AA2RL %patch $2FC4C $0B801AA2RL
#Shoot horizontal on poles
%patch $2FE68 $0B801A7BRL %patch $2FE86 $0B801A7BRL
#Shoot up on poles
%patch $2FEA4 $0B801A7BRL %patch $2FEC2 $0B801A7BRL
#Shoot down on poles
%patch $2FEE0 $0B801A7BRL %patch $2FEFE $0B801A7BRL
#Shoot horizontal in air
%patch $30066 $0B801C48RL %patch $30084 $0B801C48RL %patch $300A2 $0B801C48RL
#Shoot up in air
%patch $300C0 $0B801C48RL %patch $300DE $0B801C48RL %patch $300FC $0B801C48RL
#Shoot down in air
%patch $3011A $0B801C48RL %patch $30138 $0B801C48RL %patch $30156 $0B801C48RL

Patch: Keen 5
#Shoot horizontal
%patch $30F46 $0AAF1AC6RL %patch $30F64 $0AAF1AC6RL
#Shoot up
%patch $30F82 $0AAF1AC6RL %patch $30FA0 $0AAF1AC6RL
#Shoot horizontal on poles
%patch $31216 $0AAF1A9FRL %patch $31234 $0AAF1A9FRL
#Shoot up on poles
%patch $31252 $0AAF1A9FRL %patch $31270 $0AAF1A9FRL
#Shoot down on poles
%patch $3128E $0AAF1A9FRL %patch $312AC $0AAF1A9FRL
#Shoot horizontal in air
%patch $31414 $0AAF1C6CRL %patch $31432 $0AAF1C6CRL %patch $31450 $0AAF1C6CRL
#Shoot up in air
%patch $3146E $0AAF1C6CRL %patch $3148C $0AAF1C6CRL %patch $314AA $0AAF1C6CRL
#Shoot down in air
%patch $314C8 $0AAF1C6CRL %patch $314E6 $0AAF1C6CRL %patch $31504 $0AAF1C6CRL

Patch: Keen 6
#Shoot horizontal
%patch $3192A $1117197CRL %patch $31948 $1117197CRL
#Shoot up
%patch $31966 $1117197CRL %patch $31984 $1117197CRL
#Shoot horizontal on poles
%patch $31BA0 $11171955RL %patch $31BBE $11171955RL
#Shoot up on poles
%patch $31BDC $11171955RL %patch $31BFA $11171955RL
#Shoot down on poles
%patch $31C18 $11171955RL %patch $31C36 $11171955RL
#Shoot horizontal in air
%patch $31D9E $11171B22RL %patch $31DBC $11171B22RL %patch $31DDA $11171B22RL
#Shoot up in air
%patch $31DF8 $11171B22RL %patch $31E16 $11171B22RL %patch $31E34 $11171B22RL
#Shoot down in air
%patch $31E52 $11171B22RL %patch $31E70 $11171B22RL %patch $31E8E $11171B22RL


Action type

In the air Keen uses action type 3 which allows him to fall smoothly while shooting. All other situations use type 0, since they don't have to move.

Patch: Keen 4
#Keen shoot horizontally
%patch $2FBDE $0000W %patch $2FBFC $0000W
#Keen shoot up
%patch $2FC1A $0000W %patch $2FC38 $0000W
#Keen shoot horizontally on pole
%patch $2FE54 $0000W %patch $2FE72 $0000W
#Keen shoot up on pole
%patch $2FE90 $0000W %patch $2FEAE $0000W
#Keen shoot down on pole
%patch $2FECC $0000W %patch $2FEEA $0000W
#Keen shoot horizontally in air
%patch $30052 $0003W %patch $30070 $0003W %patch $3008E $0003W
#Keen shoot up in air
%patch $300AC $0003W %patch $300CA $0003W %patch $300E8 $0003W
#Keen shoot down in air
%patch $30106 $0003W %patch $30124 $0003W %patch $30142 $0003W

Patch: Keen 5
#Keen shoot horizontally
%patch $30F32 $0000W %patch $30F50 $0000W
#Keen shoot up
%patch $30F6E $0000W %patch $30F8C $0000W
#Keen shoot horizontally on pole
%patch $31202 $0000W %patch $31220 $0000W
#Keen shoot up on pole
%patch $3123E $0000W %patch $3125C $0000W
#Keen shoot down on pole
%patch $3127A $0000W %patch $31298 $0000W
#Keen shoot horizontally in air
%patch $31400 $0003W %patch $3141E $0003W %patch $3143C $0003W
#Keen shoot up in air
%patch $3145A $0003W %patch $31478 $0003W %patch $31496 $0003W
#Keen shoot down in air
%patch $314B4 $0003W %patch $314D2 $0003W %patch $314F0 $0003W

Patch: Keen 6
#Shooting horizontally
%patch $31916 $0000W %patch $31934 $0000W
#Shooting up
%patch $31952 $0000W %patch $31970 $0000W
#Keen shoot horizontally on pole
%patch $31B8C $0000W %patch $31BAA $0000W
#Keen shoot up on pole
%patch $31BC8 $0000W %patch $31BE6 $0000W
#Keen shoot down on pole
%patch $31C04 $0000W %patch $31C22 $0000W
#Keen shoot horizontally in air
%patch $31D8A $0003W %patch $31DA8 $0003W %patch $31DC6 $0003W
#Keen shoot up in air
%patch $31DE4 $0003W %patch $31E02 $0003W %patch $31E20 $0003W
#Keen shoot down in air
%patch $31E3E $0003W %patch $31E5C $0003W %patch $31E7A $0003W


Shot spawn position relative to Keen

Depending on what action is being used when shooting and sometimes on what direction Keen is facing, Keen's shot will spawn at different positions relative to him. This is because different animations are different sizes and different appearances. A single shot position would look exceedingly awkward.

In essence the game checks every possible shooting action individually, shooting left\right, shooting up, shooting up while jumping... In the case of shooting left\right the game also checks what direction Keen is facing, as those actions have different animations for Keen facing either way, each of which needs a unique shot position and direction.

To understand the following patches it is helpful to have some knowledge of Sprite positioning and jump conditions. Note that two of the sprite positions are negative, despite having positive values. (They are reversed.) A knowledge of galaxy sprite parameters will assist in making unique patches by altering the action\direction checks to something more complex.

And of course, when in doubt, simply tweak the relevant patch until the desired result is obtained.

The following patches are given by episode, in each section of patches are subsections for each different shooting action. There are a total of 15 unique positions in the following order: Shoot left, Shoot right, Jump Shoot left, Jump Shoot right, Jump Shoot down, Jump Shoot up, Shoot up, Shoot left on poles, Shoot right on poles, Shoot up on poles, and Shoot down on poles.

Note that shot direction is also included in the position; this is actually based in the Spawn_Shot code at another location, but the upshot is that no patchable value is up, 2 is right, 4 down and 6 left. Other values will cause an error and crash. (Bad dir.)

Patch: Keen 4 shot positions
#Check direction and action - Shoot left\right
%patch $C99D $7C $1C $0D6AW $75 $3C $83 $7C $0E $01 $75
#Right Keen - Right 256,64
%patch $C9AA $0002W
#Direction
%patch $C9B1 $0040W
#Vertical position
%patch $C9B8 $0100W
#Horizontal position
#Left Keen - Left -128,64
%patch $C9C6 $0006W
#Direction
%patch $C9CD $0040W
#Vertical position
%patch $C9D4 $0080W
#Horizontal position
#Check direction and action - Shoot left\right jumping
%patch $C9E0 $7C $1C $11FCW $75 $38 $83 $7C $0E $01 $75
#Right Keen - Right 32,256
%patch $C9ED $0002W
#Direction
%patch $C9F4 $0020W
#Vertical position
%patch $C9FB $0100W
#Horizontal position
#Left Keen - Left 32,0
%patch $CA09 $0006W
#Direction
%patch $CA10 $0020W
#Vertical position
#Check action - Shoot down jumping
%patch $CA1F $7C $1C $12B0W $75
#Keen - Down 288,128
%patch $CA26 $0004W
#Direction
%patch $CA2D $0120W
#Vertical position
%patch $CA34 $0080W
#Horizontal position
#Check action - Shoot up jumping
%patch $CA40 $7C $1C $1256W $75
#Keen - Up 160,80
%patch $CA4D $00A0W
#Vertical position
%patch $CA54 $0050W
#Horizontal position
#Check action - Shoot up
%patch $CA60 $7C $1C $0DA6W $75
#Keen - Up 160,80
%patch $CA6D $00A0W
#Vertical position
%patch $CA74 $0050W
#Horizontal position
#Check direction and action - Shoot left\right on poles
%patch $CA80 $7C $1C $0FE0W $75 $3C $83 $7C $0E $01 $75
#Right Keen - Right 64,256
%patch $CA8D $0002W
#Direction
%patch $CA94 $0040W
#Vertical position
%patch $CA9B $0100W
#Horizontal position
#Left Keen - Left 64,128
%patch $CAA9 $0006W
#Direction
%patch $CAB0 $0040W
#Vertical position
%patch $CAB7 $0080W
#Horizontal position
#Check direction and action - Shoot up on poles
%patch $CAC3 $7C $1C $101CW $75 $3A $83 $7C $0E $01 $75
#Right Keen - Up 64,96
%patch $CAD6 $0040W
#Vertical position
%patch $CADD $0060W
#Horizontal position
#Left Keen - Up 64,192
%patch $CAF1 $0040W
#Vertical position
%patch $CAF8 $00C0W
#Horizontal position
#Check direction and action - Shoot down on poles
%patch $CB04 $7C $1C $1058W $75 $3D $83 $7C $0E $01 $75
#Right Keen - Down 384,96
%patch $CB11 $0004W
#Direction
%patch $CB18 $0180W
#Vertical position
%patch $CB1F $0060W
#Horizontal position
#Left Keen - Down 384,192
%patch $CB2E $0004W
#Direction
%patch $CB35 $0180W
#Vertical position
%patch $CB3C $00C0W
#Horizontal position

Patch: Keen 5 shot positions
#Check direction and action - Shoot left\right
%patch $BDBB $7C $1C $0BEEW $75 $3C $83 $7C $0E $01 $75
#Right Keen - Right 256,64
%patch $BDC8 $0002W
#Direction
%patch $BDCF $0040W
#Vertical position
%patch $BDD6 $0100W
#Horizontal position
#Left Keen - Left -128,64
%patch $BDE4 $0006W
#Direction
%patch $BDEB $0040W
#Vertical position
%patch $BDF2 $0080W
#Horizontal position
#Check direction and action - Shoot left\right jumping
%patch $BDFE $7C $1C $10DAW $75 $38 $83 $7C $0E $01 $75
#Right Keen - Right 32,256
%patch $BE0B $0002W
#Direction
%patch $BE12 $0020W
#Vertical position
%patch $BE19 $0100W
#Horizontal position
#Left Keen - Left 32,0
%patch $BE27 $0006W
#Direction
%patch $BE2E $0020W
#Vertical position
#Check action - Shoot down jumping
%patch $BE3D $7C $1C $118EW $75
#Keen - Down 288,128
%patch $BE44 $0004W
#Direction
%patch $BE4B $0120W
#Vertical position
%patch $BE52 $0080W
#Horizontal position
#Check action - Shoot up jumping
%patch $BE5E $7C $1C $1134W $75
#Keen - Up 160,80
%patch $BE6B $00A0W
#Vertical position
%patch $BE72 $0050W
#Horizontal position
#Check action - Shoot up
%patch $BE7E $7C $1C $0C2AW $75
#Keen - Up 160,80
%patch $BE8B $00A0W
#Vertical position
%patch $BE92 $0050W
#Horizontal position
#Check direction and action - Shoot left\right on poles
%patch $BE9E $7C $1C $0EBEW $75 $3C $83 $7C $0E $01 $75
#Right Keen - Right 64,256
%patch $BEAB $0002W
#Direction
%patch $BEB2 $0040W
#Vertical position
%patch $BEB9 $0100W
#Horizontal position
#Left Keen - Left 64,128
%patch $BEC7 $0006W
#Direction
%patch $BECE $0040W
#Vertical position
%patch $BED5 $0080W
#Horizontal position
#Check direction and action - Shoot up on poles
%patch $BEE1 $7C $1C $0EFAW $75 $3A $83 $7C $0E $01 $75
#Right Keen - Up 64,96
%patch $BEF4 $0040W
#Vertical position
%patch $BEFB $0060W
#Horizontal position
#Left Keen - Up 64,192
%patch $BF0F $0040W
#Vertical position
%patch $BF16 $00C0W
#Horizontal position
#Check direction and action - Shoot down on poles
%patch $BF22 $7C $1C $0F36W $75 $3D $83 $7C $0E $01 $75
#Right Keen - Down 384,96
%patch $BF2F $0004W
#Direction
%patch $BF36 $0180W
#Vertical position
%patch $BF3D $0060W
#Horizontal position
#Left Keen - Down 384,192
%patch $BF4C $0004W
#Direction
%patch $BF53 $0180W
#Vertical position
%patch $BF5A $00C0W
#Horizontal position

Patch: Keen 6 shot positions
#Check direction and action - Shoot left\right
%patch $BB9E $7C $1C $0BE2W $75 $3C $83 $7C $0E $01 $75
#Right Keen - Right 256,64
%patch $BBAB $0002W
#Direction
%patch $BBB2 $0040W
#Vertical position
%patch $BBB9 $0100W
#Horizontal position
#Left Keen - Left -128,64
%patch $BBC7 $0006W
#Direction
%patch $BBCE $0040W
#Vertical position
%patch $BBD5 $0080W
#Horizontal position
#Check direction and action - Shoot left\right jumping
%patch $BBE1 $7C $1C $1074W $75 $38 $83 $7C $0E $01 $75
#Right Keen - Right 32,256
%patch $BBEE $0002W
#Direction
%patch $BBF5 $0020W
#Vertical position
%patch $BBFC $0100W
#Horizontal position
#Left Keen - Left 32,0
%patch $BC0A $0006W
#Direction
%patch $BC11 $0020W
#Vertical position
#Check action - Shoot down jumping
%patch $BC20 $7C $1C $1128W $75
#Right Keen - Down 288,128
%patch $BC27 $0004W
#Direction
%patch $BC2E $0120W
#Vertical position
%patch $BC35 $0080W
#Horizontal position
#Check action - Shoot up jumping
%patch $BC41 $7C $1C $10CEW $75
#Keen - Up 160,80
%patch $BC4E $00A0W
#Vertical position
%patch $BC55 $0050W
#Horizontal position
#Check action - Shoot up
%patch $BC61 $7C $1C $0C1EW $75
#Keen - Up 160,80
%patch $BC6E $00A0W
#Vertical position
%patch $BC75 $0050W
#Horizontal position
#Check direction and action - Shoot left\right on poles
%patch $BC81 $7C $1C $0E58W $75 $3C $83 $7C $0E $01 $75
#Right Keen - Right 64,256
%patch $BC8E $0002W
#Direction
%patch $BC95 $0040W
#Vertical position
%patch $BC9C $0100W
#Horizontal position
#Left Keen - Left 64,128
%patch $BCAA $0006W
#Direction
%patch $BCB1 $0040W
#Vertical position
%patch $BCB8 $0080W
#Horizontal position
#Check direction and action - Shoot up on poles
%patch $BCC4 $7C $1C $0E94W $75 $3A $83 $7C $0E $01 $75
#Right Keen - Up 64,96
%patch $BCD7 $0040W
#Vertical position
%patch $BCDE $0060W
#Horizontal position
#Left Keen - Up 64,192
%patch $BCF2 $0040W
#Vertical position
%patch $BCF9 $00C0W
#Horizontal position
#Check direction and action - Shoot down on poles
%patch $BD05 $7C $1C $0ED0W $75 $3D $83 $7C $0E $01 $75
#Right Keen - Down 384,96
%patch $BD12 $0004W
#Direction
%patch $BD19 $0180W
#Vertical position
%patch $BD20 $0060W
#Horizontal position
#Left Keen - Down 384,192
%patch $BD2F $0004W
#Direction
%patch $BD36 $0180W
#Vertical position
%patch $BD3D $00C0W
#Horizontal position


Misc

Patches in this section do not fit neatly into the above sections.


Keen can teleport to where his shots smash

This patch and related ones are covered on Keen's shot's page.