Update VillageDog and EonDog lifting logic
This commit is contained in:
@@ -32,36 +32,29 @@
|
|||||||
|
|
||||||
%Set_Sprite_Properties(Sprite_VillageDog_Prep, Sprite_VillageDog_Long)
|
%Set_Sprite_Properties(Sprite_VillageDog_Prep, Sprite_VillageDog_Long)
|
||||||
|
|
||||||
|
|
||||||
Sprite_VillageDog_Long:
|
Sprite_VillageDog_Long:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
LDA.w WORLDFLAG : BEQ .village
|
LDA.w WORLDFLAG : BEQ .village
|
||||||
JSR Sprite_EonDog_Draw
|
JSR Sprite_EonDog_Draw
|
||||||
JMP +
|
JMP +
|
||||||
.village
|
.village
|
||||||
JSR Sprite_VillageDog_Draw ; Call the draw code
|
JSR Sprite_VillageDog_Draw
|
||||||
+
|
+
|
||||||
JSL Sprite_DrawShadow
|
JSL Sprite_DrawShadow
|
||||||
JSL Sprite_CheckActive ; Check if game is not paused
|
JSL Sprite_CheckActive : BCC .SpriteIsNotActive
|
||||||
BCC .SpriteIsNotActive ; Skip Main code is sprite is innactive
|
JSR Sprite_VillageDog_Main
|
||||||
|
|
||||||
JSR Sprite_VillageDog_Main ; Call the main sprite code
|
|
||||||
|
|
||||||
.SpriteIsNotActive
|
.SpriteIsNotActive
|
||||||
PLB ; Get back the databank we stored previously
|
PLB
|
||||||
RTL ; Go back to original code
|
RTL
|
||||||
}
|
}
|
||||||
|
|
||||||
Sprite_VillageDog_Prep:
|
Sprite_VillageDog_Prep:
|
||||||
{
|
{
|
||||||
PHB : PHK : PLB
|
PHB : PHK : PLB
|
||||||
|
|
||||||
LDA.w WORLDFLAG : BEQ .village
|
LDA.w WORLDFLAG : BEQ .village
|
||||||
LDA.b #$07 : STA.w SprAction, X
|
LDA.b #$07 : STA.w SprAction, X
|
||||||
.village
|
.village
|
||||||
|
|
||||||
PLB
|
PLB
|
||||||
RTL
|
RTL
|
||||||
}
|
}
|
||||||
@@ -74,7 +67,8 @@ HandleTossedDog:
|
|||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
macro LiftOrTalk()
|
LiftOrTalk:
|
||||||
|
{
|
||||||
LDA.w $02B2 : BEQ .lifting
|
LDA.w $02B2 : BEQ .lifting
|
||||||
CMP.b #$03 : BEQ .wolf
|
CMP.b #$03 : BEQ .wolf
|
||||||
CMP.b #$05 : BEQ .minish
|
CMP.b #$05 : BEQ .minish
|
||||||
@@ -87,7 +81,8 @@ macro LiftOrTalk()
|
|||||||
JSL Sprite_CheckIfLifted
|
JSL Sprite_CheckIfLifted
|
||||||
JSL ThrownSprite_TileAndSpriteInteraction_long
|
JSL ThrownSprite_TileAndSpriteInteraction_long
|
||||||
+
|
+
|
||||||
endmacro
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
Sprite_VillageDog_Main:
|
Sprite_VillageDog_Main:
|
||||||
{
|
{
|
||||||
@@ -109,20 +104,16 @@ Sprite_VillageDog_Main:
|
|||||||
Dog_Handler:
|
Dog_Handler:
|
||||||
{
|
{
|
||||||
%PlayAnimation(8,8,8) ; Sitting
|
%PlayAnimation(8,8,8) ; Sitting
|
||||||
|
|
||||||
JSR HandleTossedDog
|
JSR HandleTossedDog
|
||||||
|
|
||||||
LDA $0309 : AND #$03 : BNE .lifting
|
LDA $0309 : AND #$03 : BNE .lifting
|
||||||
LDA #$20 : STA.w SprTimerD, X
|
LDA #$20 : STA.w SprTimerD, X
|
||||||
JSL Sprite_IsToRightOfPlayer : TYA : BEQ .walk_right
|
JSL Sprite_IsToRightOfPlayer : TYA : BEQ .walk_right
|
||||||
%GotoAction(1)
|
%GotoAction(1)
|
||||||
JMP .lifting
|
JMP .lifting
|
||||||
|
|
||||||
.walk_right
|
.walk_right
|
||||||
%GotoAction(2)
|
%GotoAction(2)
|
||||||
|
.lifting
|
||||||
%LiftOrTalk()
|
JSR LiftOrTalk
|
||||||
|
|
||||||
JSL Sprite_Move
|
JSL Sprite_Move
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
@@ -134,7 +125,7 @@ Sprite_VillageDog_Main:
|
|||||||
JSR HandleTossedDog
|
JSR HandleTossedDog
|
||||||
LDA.w SprTimerD, X : BNE +
|
LDA.w SprTimerD, X : BNE +
|
||||||
; Load the timer for the run
|
; Load the timer for the run
|
||||||
LDA #$60 : STA.w SprTimerD, X
|
LDA.b #$60 : STA.w SprTimerD, X
|
||||||
%GotoAction(3)
|
%GotoAction(3)
|
||||||
+
|
+
|
||||||
RTS
|
RTS
|
||||||
@@ -147,7 +138,7 @@ Sprite_VillageDog_Main:
|
|||||||
JSR HandleTossedDog
|
JSR HandleTossedDog
|
||||||
LDA.w SprTimerD, X : BNE +
|
LDA.w SprTimerD, X : BNE +
|
||||||
; Load the timer for the run
|
; Load the timer for the run
|
||||||
LDA #$60 : STA.w SprTimerD, X
|
LDA.b #$60 : STA.w SprTimerD, X
|
||||||
%GotoAction(4)
|
%GotoAction(4)
|
||||||
+
|
+
|
||||||
RTS
|
RTS
|
||||||
@@ -174,7 +165,7 @@ Sprite_VillageDog_Main:
|
|||||||
STZ $06 : STZ $07
|
STZ $06 : STZ $07
|
||||||
JSL Sprite_MoveLong
|
JSL Sprite_MoveLong
|
||||||
|
|
||||||
%LiftOrTalk()
|
JSR LiftOrTalk
|
||||||
|
|
||||||
LDA.w SprTimerD, X : BNE +
|
LDA.w SprTimerD, X : BNE +
|
||||||
%GotoAction(0)
|
%GotoAction(0)
|
||||||
@@ -201,7 +192,7 @@ Sprite_VillageDog_Main:
|
|||||||
JSL Sprite_ApplySpeedTowardsPlayer
|
JSL Sprite_ApplySpeedTowardsPlayer
|
||||||
STZ $06 : STZ $07
|
STZ $06 : STZ $07
|
||||||
JSL Sprite_MoveLong
|
JSL Sprite_MoveLong
|
||||||
%LiftOrTalk()
|
JSR LiftOrTalk
|
||||||
|
|
||||||
LDA.w SprTimerD, X : BNE ++
|
LDA.w SprTimerD, X : BNE ++
|
||||||
%GotoAction(0)
|
%GotoAction(0)
|
||||||
@@ -213,9 +204,7 @@ Sprite_VillageDog_Main:
|
|||||||
Dog_WagTailLeft:
|
Dog_WagTailLeft:
|
||||||
{
|
{
|
||||||
%PlayAnimation(0,1, 8)
|
%PlayAnimation(0,1, 8)
|
||||||
|
JSR LiftOrTalk
|
||||||
%LiftOrTalk()
|
|
||||||
|
|
||||||
JSR HandleTossedDog
|
JSR HandleTossedDog
|
||||||
LDA.w SprTimerD, X : BNE +
|
LDA.w SprTimerD, X : BNE +
|
||||||
%GotoAction(0)
|
%GotoAction(0)
|
||||||
@@ -227,8 +216,7 @@ Sprite_VillageDog_Main:
|
|||||||
Dog_WagTailRight:
|
Dog_WagTailRight:
|
||||||
{
|
{
|
||||||
%PlayAnimation(11,12,8)
|
%PlayAnimation(11,12,8)
|
||||||
%LiftOrTalk()
|
JSR LiftOrTalk
|
||||||
|
|
||||||
JSR HandleTossedDog
|
JSR HandleTossedDog
|
||||||
LDA.w SprTimerD, X : BNE +
|
LDA.w SprTimerD, X : BNE +
|
||||||
%GotoAction(0)
|
%GotoAction(0)
|
||||||
@@ -239,21 +227,18 @@ Sprite_VillageDog_Main:
|
|||||||
EonDog_Handler:
|
EonDog_Handler:
|
||||||
{
|
{
|
||||||
%PlayAnimation(0,1,8)
|
%PlayAnimation(0,1,8)
|
||||||
|
JSR LiftOrTalk
|
||||||
JSR HandleTossedDog
|
JSR HandleTossedDog
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
EonDog_Right:
|
EonDog_Right:
|
||||||
{
|
{
|
||||||
%PlayAnimation(2,3,8)
|
%PlayAnimation(2,3,8)
|
||||||
|
JSR LiftOrTalk
|
||||||
JSR HandleTossedDog
|
JSR HandleTossedDog
|
||||||
|
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckIfPlayerIsNearby:
|
CheckIfPlayerIsNearby:
|
||||||
@@ -290,7 +275,6 @@ Sprite_VillageDog_Draw:
|
|||||||
LDA $0DC0, X : CLC : ADC $0D90, X : TAY ; Animation Frame
|
LDA $0DC0, X : CLC : ADC $0D90, X : TAY ; Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ; amount of tiles -1
|
LDX .nbr_of_tiles, Y ; amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
@@ -423,7 +407,6 @@ Sprite_EonDog_Draw:
|
|||||||
LDA.w SprFrame, X : TAY ;Animation Frame
|
LDA.w SprFrame, X : TAY ;Animation Frame
|
||||||
LDA .start_index, Y : STA $06
|
LDA .start_index, Y : STA $06
|
||||||
|
|
||||||
|
|
||||||
PHX
|
PHX
|
||||||
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
LDX .nbr_of_tiles, Y ;amount of tiles -1
|
||||||
LDY.b #$00
|
LDY.b #$00
|
||||||
|
|||||||
Reference in New Issue
Block a user