Language…
11 users online: adamzralko12, Daldi, drkrdnk, Hidincuzimsmokin, Maw, PixelFhacks,  Saphros, Shiki_Makiro, Triple P, wye, xhsdf - Guests: 85 - Bots: 93
Users: 70,118 (2,533 active)
Latest user: efilyarps

Flutter Jump UberASM only when Caped?

Hi there!

I was wondering how I could make this Flutter Jump UberASM only apply to the player when you have the feather? It currently applies to Mario in all power states (Small, Big, Flower, & Caped). Help would be appreciated! In the final steps of releasing my hack!

Here's the code:
Code
!TTFJ = $18B4|!addr	;[T]ime [T]o [F]lutter [J]ump
!FJR = $18B7|!addr	;[F]lutter [J]ump [R]est
!FC = $18CD|!addr	;[F]lutter [C]arry

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Other defines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!FlutterAnimation = 1	; Change this to 0 to disable the flutter animation
!PlayerFlutter = 0		; Change this to 1 so only player 1 can flutter and 2 if only player 2 can flutter
!YoshiFlutter = 0		; Change this to 1 so you can't flutter with Yoshi and 2 if only Yoshi can flutter
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

main:
	LDA $9D
	BNE .Return1
if !PlayerFlutter == 1
	LDA $0DB3|!addr
	BEQ .GoOn
else
	if !PlayerFlutter == 2
		LDA $0DB3|!addr
		BNE .GoOn
	else
		BRA .GoOn
	endif
endif
.Return1
RTL

.GoOn
	LDA $187A|!addr
if !YoshiFlutter == 2
	BEQ .Reset
else
	if !YoshiFlutter == 1
		BNE .Reset
	else
		BNE .NotFluttering
	endif

	if !FlutterAnimation
		LDA !TTFJ
		BEQ .NotFluttering
		AND #$03
		CMP #$03
		BNE +
		LDA #$01
	+	LDY $148F|!addr
		BEQ +
		CLC : ADC #$07
		BRA .Store
	+	LDY $72
		CPY #$0C
		BNE .Store
		CLC : ADC #$04
	.Store
		STA $13E0|!addr
	.NotFluttering
	endif
endif

    LDA $77     	;(in order)Doesn't work if not in air, swimming, climbing, or on yoshi
    AND #$04		;On the ground?
    ORA $71			;Controllable
    ORA $75			;Swimming?
    ORA $74			;Climbing?
	ORA $1407|!addr	;Gliding with the cape
	ORA $1891|!addr
	;Add more checks if you don't want Mario to flutter
    BNE .Reset		;Exit
    LDA $1499|!addr  ;temperarily stops when facing screen
;    BEQ NoReturn
;    JMP Return
    BNE .Return
.NoReturn:
	LDA !TTFJ
	BEQ .NoFlutter	;If the player isn't flutter jumping then don't apply its effects
		DEC !FC		;boost more
		LDA !FC		;load boost amount
		STA $7D		;apply boost
		DEC !TTFJ	;decrement flutter jump counter
		BRA .Fluttered	;don't run the resting code if we're flutter jumping
.NoFlutter:
	LDA !FJR		;Is there still rest time to take care of?
	BEQ .NoRest	;Nope, skip
	DEC !FJR		;Yes, decrement the rest timer
.NoRest:
.Fluttered:
	LDA $16       ;change these two lines to alter which button you want to press. controller values are in the RAM section of smwcentral.net
	CMP #$80
	BNE .Return

	STZ $140D|!addr     ;remove this line if you don't want to allow mario to flutter while spin jumping (without this, mario spin flutters)
	LDA !FJR		;Are we resting?
	BNE .NoCheck
	LDA #$16	;How long to flutter jump
	STA !TTFJ
	LDA #$F8	;Starting Y speed for flutter jump
	STA !FC
	LDA #$20	;How long to rest afterwards
	STA !FJR
	LDA #$09     ;What sound to play		
	STA $1DF9|!addr	;Sound Bank to use
.NoCheck:
	BRA .Return
.Reset:	;Stop the flutter jump
	STZ !TTFJ
	STZ !FC
;	BRA Return
.Return:
	RTL


Right after the "main" label, try adding this:

Code
main:
	LDA $19
	CMP #$02
	BNE .Return1


Professional frame-by-frame time wizard. YouTube - Bluesky - SMW Glitch List - SMW Randomizer
Originally posted by Thomas
Right after the "main" label, try adding this:

Code
main:
	LDA $19
	CMP #$02
	BNE .Return1

Works!! Thanks again Thomas! Ryckert’s Island wouldn’t be anywhere without your assistance the last few years.

This is also absurdly simple. Surprised I wasn’t able to find it easily by searching. Hopefully this post will help others figure out how to implement powerup specific Uberasm in the future.