add bean vendor / village elder sprite logic
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
; Sprite Properties
|
; Sprite Properties
|
||||||
; =========================================================
|
; =========================================================
|
||||||
|
|
||||||
!SPRID = $00; The sprite ID you are overwriting (HEX)
|
!SPRID = $07 ; The sprite ID you are overwriting (HEX)
|
||||||
!NbrTiles = 00 ; Number of tiles used in a frame
|
!NbrTiles = 00 ; Number of tiles used in a frame
|
||||||
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
|
!Harmless = 00 ; 00 = Sprite is Harmful, 01 = Sprite is Harmless
|
||||||
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
|
!HVelocity = 00 ; Is your sprite going super fast? put 01 if it is
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
; =========================================================
|
; =========================================================
|
||||||
|
|
||||||
Sprite_BeanVendor_Long:
|
Sprite_BeanVendor_Long:
|
||||||
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
JSR Sprite_BeanVendor_Draw ; Call the draw code
|
JSR Sprite_BeanVendor_Draw ; Call the draw code
|
||||||
@@ -45,35 +46,105 @@ Sprite_BeanVendor_Long:
|
|||||||
.SpriteIsNotActive
|
.SpriteIsNotActive
|
||||||
PLB ; Get back the databank we stored previously
|
PLB ; Get back the databank we stored previously
|
||||||
RTL ; Go back to original code
|
RTL ; Go back to original code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Sprite_BeanVendor_Prep:
|
||||||
Sprite_BeanVendor_Prep:
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
; Add more code here to initialize data
|
LDA.w SprSubtype, X : STA SprAction, X
|
||||||
|
|
||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
|
}
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
|
|
||||||
Sprite_BeanVendor_Main:
|
Sprite_BeanVendor_Main:
|
||||||
LDA.w SprAction, X; Load the SprAction
|
{
|
||||||
JSL UseImplicitRegIndexedLocalJumpTable; Goto the SprAction we are currently in
|
LDA.w SprAction, X
|
||||||
dw Action00
|
JSL UseImplicitRegIndexedLocalJumpTable
|
||||||
|
|
||||||
|
dw BeanVendor
|
||||||
|
dw MagicBean
|
||||||
|
dw VillageElder
|
||||||
|
dw SpawnMagicBean
|
||||||
|
dw PlayerSaidNo
|
||||||
|
|
||||||
|
; 0x00 - Bean Vendor
|
||||||
|
BeanVendor:
|
||||||
|
{
|
||||||
|
%PlayAnimation(0,0,1)
|
||||||
|
|
||||||
|
JSL Sprite_PlayerCantPassThrough
|
||||||
|
|
||||||
|
%ShowSolicitedMessage($142) : BCC .no_message
|
||||||
|
LDA $1CE8 : BNE .player_said_no
|
||||||
|
%GotoAction(3)
|
||||||
|
RTS
|
||||||
|
.player_said_no
|
||||||
|
%GotoAction(4)
|
||||||
|
.no_message
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Action00:
|
; 0x01 - Liftable Magic Bean
|
||||||
|
MagicBean:
|
||||||
|
{
|
||||||
|
%PlayAnimation(1,1,1)
|
||||||
|
|
||||||
|
JSL Sprite_CheckIfLifted
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
|
; 0x02 - Village Elder
|
||||||
|
VillageElder:
|
||||||
|
{
|
||||||
|
%PlayAnimation(2,3,8)
|
||||||
|
JSL Sprite_PlayerCantPassThrough
|
||||||
|
|
||||||
|
%ShowSolicitedMessage($143) : BCC .no_message
|
||||||
|
|
||||||
|
.no_message
|
||||||
|
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
|
; 0x03 - Spawn Magic Bean
|
||||||
|
SpawnMagicBean:
|
||||||
|
{
|
||||||
|
%PlayAnimation(0,0,1)
|
||||||
|
|
||||||
|
LDA.b #$07
|
||||||
|
JSL Sprite_SpawnDynamically
|
||||||
|
LDA.b #$02 : STA.w SprAction, Y
|
||||||
|
LDA.w SprX, X : CLC : ADC.b #$08 : STA $00
|
||||||
|
LDA.w SprY, X : STA $02
|
||||||
|
LDA.w SprYH, X : STA $03
|
||||||
|
LDA.w SprXH, X : STA $01
|
||||||
|
; TODO: Set a flag that says you've got the magic bean
|
||||||
|
%ShowUnconditionalMessage($144)
|
||||||
|
%GotoAction(0)
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
|
; 0x04 - Player Said No
|
||||||
|
PlayerSaidNo:
|
||||||
|
{
|
||||||
|
%PlayAnimation(0,0,1)
|
||||||
|
%ShowUnconditionalMessage($145)
|
||||||
|
%GotoAction(0)
|
||||||
|
RTS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
|
|
||||||
Sprite_BeanVendor_Draw:
|
Sprite_BeanVendor_Draw:
|
||||||
|
{
|
||||||
JSL Sprite_PrepOamCoord
|
JSL Sprite_PrepOamCoord
|
||||||
JSL Sprite_OAM_AllocateDeferToPlayer
|
JSL Sprite_OAM_AllocateDeferToPlayer
|
||||||
|
|
||||||
@@ -159,3 +230,4 @@ Sprite_BeanVendor_Draw:
|
|||||||
db $02
|
db $02
|
||||||
db $02, $02, $02, $02, $00, $00
|
db $02, $02, $02, $02, $00, $00
|
||||||
db $02, $02, $02, $02, $00, $00
|
db $02, $02, $02, $02, $00, $00
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user