If you just want to make Bounders act like the Dartfrogs from Atroxian Realm, you could just reuse the relevant patches from the demo (back when it was a Keen 4 mod):
Code: Select all
###
#Bounders
###
# Keen Collision Function
# Bounders are now toxic frog guys, so keen can't stand on them now
%patch $CCD2 $90 $90 $90 #nop slide over jump to call to keen-stand-on-bounder-funnctio
%patch $CDC9 $EB #and he can't stand on a stunned bounder ,either
# Actions
%patch $31D82
0x1EFW 0x1EFW 3W 0W 0W 20W 0W 0W $09DC16C9RL $10800938RL $1080097ERL $2F30W # sitting frame 1
0x1F0W 0x1F0W 3W 0W 0W 20W 0W 0W $09DC16C9RL $10800938RL $1080097ERL $2F12W # sitting frame 2
0x1ECW 0x1EEW 2W 0W 0W 20W 0W 0W $09DC16C9RL $10800938RL $1080097ERL $2F4EW # up frame
0x1EBW 0x1EDW 2W 0W 0W 20W 0W 0W $09DC16C9RL $10800938RL $1080097ERL $2F6CW # down frame
0x1EFW 0x1EFW 2W 0W 0W 0W 0W 0W $09DC16C9RL $0L $09DC1913RL $2FA8W
0x1F1W 0x1F1W 2W 0W 0W 0W 0W 0W $09DC16C9RL $0L $09DC1913RL $0W
# NEW Bounder Draw Function
#1080097E
%patch $1117E
$55 #push bp
$8B $EC #mov bp, sp
$83 $EC $02 #sub sp, 2
$56 #push si
$57 #push di
$8B $7E $06 #mov di, [bp+arg_0]
#botflags:
$83 $7D $3A $00 #cmp [di+OBJECT.botflags], 0
$74 $05 #jz topflags
$C7 $45 $18 0W #mov [di+OBJECT.ymove], 0
#topflags:
#;increase int34 until threshold, then jump
$83 $7D $36 $00 #cmp [di+OBJECT.topflags], 0
$75 28 #jnz #onground
$81 $7D $1C $2F4EW #cmp [di+OBJECT.action], bounder_air
$74 18 #jz #sideflags
$B8 $2F4EW # mov ax, offset bounder_air
$50 #push ax
$57 #push di
$9A $09DC120ARL #call CheckGround2
$83 $C4 $04 #add sp, 4
$C7 $45 $44 $0W #mov [di+objtype.int34], 0
$E9 99W #jmp sideflags
# onground:
$C7 $45 $16 $0000W #mov [di+object.xmotion], 0000W
$81 $7D $1C $2F6CW #cmp [di+OBJECT.action], bounder_air
$74 13 #jz checkbouncetime
$B8 $2F6CW # mov ax, offset bounder_ground
$50 # push ax
$57 # push di
$9A $09DC120ARL # call CheckGround2
$83 $C4 $04 # add sp, 4
# checkbouncetime:
$8B $45 $44 #mov ax, [di+objtype.int34]
$40 #inc ax
$89 $45 $44 #mov [di+objtype.int34], ax
$3D $0020W #cmp ax, BOUNDERJUMPTIME
$7C 57 #jl sideflags
$C7 $45 $44 $0W #mov word ptr [di+objtype.int34], 0
$8B $1E $A7D6W #mov bx, player
$8B $45 $0A #mov ax, [di+object.posx]
$39 $47 $0A #cmp [bx+object.posx], ax
$73 $07 #jnb BounceRight
#BounceLeft:
$C7 $45 $0E $FFFFW #mov [di+object.xmotion], FFFFW
$EB $05 #jmp short dobounce
#BounceRight:
$C7 $45 $0E $0001W #mov [di+object.xmotion, 1W
#dobounce:
$8B $45 $0E # mov ax, [di+OBJECT.xmotion]
$BA $10 $00 # mov dx, 10h
$F7 $EA # imul dx
$89 $45 $16 # mov [di+OBJECT.xmove], ax
$C7 $45 $18 $FFD0W #mov [di+OBJECT.ymove], FFD0
$B8 $0010W $50 $9A $187409F1RL $83 $C4 $02 #Play sound
#11208
$83 $7D $38 $00 #sideflags: cmp [di+OBJECT.rightflags], 0
$75 $06 # jnz short reverseX
$83 $7D $3C $00 # cmp [di+OBJECT.leftflags], 0
$74 $10 # jz short draw
$8B $45 $0E #reverseX: mov ax, [di+OBJECT.xmotion]
$F7 $D8 # neg ax
$89 $45 $0E # mov [di+OBJECT.xmotion], ax
$8B $45 $16 # mov ax, [di+OBJECT.xmove]
$F7 $D8 # neg ax
$89 $45 $16 # mov [di+OBJECT.xmove], ax
$FF $75 $20 #draw: push [di+OBJECT.zplane] ; int
$33 $C0 # xor ax, ax
$50 # push ax ; int
$FF $75 $1E # push [di+OBJECT.chunk] ; value
$FF $75 $0C # push [di+OBJECT.ypos] ; int
$FF $75 $0A # push [di+OBJECT.xpos] ; int
$8B $C7 $05 # mov ax, di
$46 $00 # add ax, 46h
$50 # push ax ; int
$9A $16541641RL # call RF_PlaceSprite
$83 $C4 $0C # add sp, 0Ch
$5F # pop di
$5E # pop si
$8B $E5 # mov sp, bp
$5D # pop bp
$CB # retf
#Collision
#Bounder kills Keen, can be shot:
%patch $11138
$55
$8B $EC
$56 $57
$8B $76 $06 # mov si, [bp+6]
$8B $7E $08 # mov di, [bp+8]
$83 $3D $02 # cmp [di], 2 ; stunner
$75 $09
$9A $0B8013E9RL $5F $5E $5D $CB # call killkeen and return
$83 $3D $03 # cmp [di], 3 ; stunner
$75 $1D
$C7 $44 $16 $00 $00
$C7 $44 $06 $01 $00
$B8 $A8 $2F
$50
$57
$56
$9A $09DC1695RL
$83 $C4 $06
#$C7 $44 $00 $00 $01 # type = 01, (obj_friendly)
$90 $90 $90 $90 $90
$5F $5E $5D $CB
#3 frame loop
%patch $32700
$1B8W $1B8W $4W $0W $0W $10W $0W $0W $10800D44RL $11A20D86RL $09DC176ERL $38AEW
$1B9W $1B9W $4W $0W $0W $10W $0W $0W $10800D44RL $11A20D86RL $09DC176ERL $38CCW
$1BAW $1BAW $4W $0W $0W $10W $0W $0W $10800D44RL $11A20D86RL $09DC176ERL $3890W
#Collision Function
#altered so that mine does not blow up and does not make sound when contact keen
%patch $127B9 $90 $90 $90 $90 $90 #don't change action to explosion
%patch $127C5 $90 $90 $90 $90 $90 #don't play a sound
#actions
#2 movement actions (smooth movement always thinking)
%patch $3154E
$1C9W $1C9W $1W $1W $1W $4W $11W $0W $10800071RL $108000B0RL $10800100RL $26FCW
$1C9W $1C9W $1W $1W $1W $4W $11W $0W $10800071RL $108000B0RL $10800100RL $26DEW
$1C9W $1C9W $1W $1W $1W $4W $18W $0W $0L $108000B0RL $10800100RL $2738W
$1C9W $1C9W $1W $1W $1W $4W $18W $0W $0L $108000B0RL $10800100RL $26DEW
#attacking actions
#stunned action
#default movement think
#if player is close enough, go to attacking action.
#spawn -- set health
%patch $1081C
$C7 $47 $3E 02W #mov [si+objtype.int31], 2
%patch $10836
$40W # map units to move sprite down on spawn
%patch $10871
#$10800071RL
$55 #push bp
$8B $EC #mov bp, sp
$56 #push si
$8B $76 $06 #mov si, [bp+6]
#checky;
$8B $1E $A7D6W # mov bx, [player]
$8B $47 $32 #mov ax, [bx+boxT.lr.y]
$2B $44 $32 #sub ax, [si+boxT.lr.y]
$3D $2W #cmp ax, 2
$7F 34 #jg return
$3D $FFFEW #cmp ax, -2
$7C 29 #jl return
#checkx:
$8B $47 $2A # mov ax, [bx+object.boxXmid]
$2B $44 $2A # sub ax, [si+object.boxXmid]
$3D $200W #cmp ax, 0x200
$7F 18 #jg return
$3D $FE00W #cmp ax, 0xFE00
$7C 13 #jl return
#doattack:
$B8 $271AW #mov ax, a_wormmouthattack1
$50 #push ax
$56 #push si
$9A $09DC120ARL #call CheckGround2
$83 $C4 $04 #add sp, 4
#return:
$5E
$8B $E5
$5D #pop si; mov sp, bp; pop bp
$CB #retf
#collision
#check for shots, decrease health, set whiteflash, die if health <0
%patch $108B0
#$108000B0RL
$55 #push bp
$8B $EC #mov bp, sp
$56 #push si
$57 #push di
$8B $76 $06 #mov si, [bp+6]
$8B $7E $08 #mov di, [bp+8]
#kill keen
$83 $3D $02 #cmp word ptr [di], 2
$75 07 #jnz checkstunner
$9A $0B8013E9RL #call KeenDie
$EB 44 #jmp return
#checkstunner:
$83 $3D $03 #cmp word ptr [di], 3
$75 39 #jnz return
$57 #push di
$9A $0D8F0D43RL #call StunnerZaps
$83 $C4 $02 #add sp, 2
$FF $4C $3E #dec [si+obtype.int31]
$75 20 #jnz notdead
#dead:
$C7 $44 $40 0W #mov [si+int32], 0
$B8 $2882W #mov ax, a_wormmouthstunned
$50 #push ax
$56 #push si
$9A $09DC120ARL #call CheckGround2
$83 $C4 $04 #add sp, 4
$EB 05 #jmp return
#notdead:
$C7 $44 $40 5W #mov [si+int32], WHITEFLASH
#return:
$5F $5E $8B $E5 $5D $CB #pop di;pop si; mov sp, bp; pop bp; retf
#drawfunc (decrease whiteflash, draw white if != 0)
%patch $10900
#$10800100RL
$55 #push bp
$8B $EC #mov bp, sp
$56 #push si
$8B $76 $06 #mov si, [bp+6]
#Portion of DrawFunc2 that turns actor around at walls and edges
$83 $7C $0E $01
$75 $2B
$83 $7C $3C $00
$74 $25
$8B $44 $12
$29 $44 $0A
$C7 $44 $0E $FF $FF
$9A $1D02002ARL
$B1 $05 $D3 $F8
$89 $44 $08
$FF $74 $1C
$56
$9A $09DC120ARL
$83 $C4 $04
$EB $5D
$83 $7C $0E
$FF $75 $2B
$83 $7C $38 $00
$74 $25
$8B $44 $12
$29 $44 $0A
$C7 $44 $0E $01 $00
$9A $1D02002ARL
$B1 $05 $D3 $F8
$89 $44 $08
$FF $74 $1C $56
$9A $09DC120ARL
$83 $C4 $04
$EB $2C
$83 $7C $36 $00
$75 $26
$8B $44 $12
$29 $44 $0A
$8B $44 $0E
$F7 $D8
$89 $44 $0E
$9A $1D02002ARL
$B1 $05 $D3 $F8
$89 $44 $08
$FF $74 $1C
$56
$9A $09DC120ARL
$83 $C4 $04
# Start Drawing
$FF $74 $20 #push [si+objtype.zplane]
$33 $C0 #xor ax, ax
$83 $7C $40 $00 #cmp [si+objtype.int32], 0
$74 $04 #jz draw
$FF $4C $40 #dec [si+obtype.int32]
$40 #inc ax ; push 1
#draw:
$50 #push ax
$FF $74 $1E
$FF $74 $0C
$FF $74 $0A
$8B $C6
$05 $46 $00
$50
$9A $16541641RL
$83 $C4 $0C
$5E $8B $E5 $5D #pop si; mov sp, bp; pop bp
$CB #retf
I set up a test copy of The Sunnylands (Keen 4 levelpack where most patches are just for text), put the above patches into the patch file, and it works just fine!
As for making the Bounder only harmful when bouncing, I'm not really a patching expert, but I imagine it would be tricky to perform, even for talented patch-makers. I could be wrong, though.