;IBJ Prevention by person701
;After the defined amount of bomb jumps, bombs give out, no longer propelling you upward.
;Every bomb jump, a counter is increased by 1, and is set to 0 upon touching the ground.
;By default, bomb jumps won't work from mid-air morphs. It's possible to remove this feature by commenting out two lines.
;I did do a slight no-no in using the last two bytes of RAM for enemy 1F, but that should only cause problems if a room has 1F enemies in it.

lorom

;You can change the below value. Sets how many bomb jumps you can do before touching the ground agian. #$0003 allows for double bomb jumping. Anything lower only allows for single bomb jumping.
!BOMBS = #$0003
	
org $91F1E2
	JSR $EE10
	
org $91EE10			;prevent abuse of the bomb jump counter
	LDA #$0000
	STA $7FFA02		;STZ $7FFA02 wasn't working. :/
	STZ $0B36
	RTS
	
org $A0984B
	JSR $F7F0
	
org $A0F7F0
	PHA
	LDA $0B36		;comment these codes to allow bombs to affect you from mid-air morph
	BEQ +			; <----------'
	LDA $7FFA02
	BEQ ++
	+
	LDA $7FFA02
	CMP !BOMBS
	BEQ ++
	INC A
	STA $7FFA02
	PLA
	STA $0A56
	RTS
	++
	PLA
	STZ $7FFA02
	STZ $0A56
	RTS