From b59468d65b015f7f172762b2a2653ac574af6535 Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Mon, 2 Sep 2019 14:06:52 -0400 Subject: [PATCH] Fix Murahdahla overriding messages --- contrib.asm | 46 ++++++++++++++++++++++++++++++++++++++++++++++ elder.asm | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/contrib.asm b/contrib.asm index ac5991d..0fbf354 100644 --- a/contrib.asm +++ b/contrib.asm @@ -135,3 +135,49 @@ Sprite_ShowSolicitedMessageIfPlayerFacing_Alt: RTL } ;================================================================ +Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage: +{ + PHY + PHA + + JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha + JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha + + LDA $F6 : BPL .alpha + LDA $0F10, X : BNE .alpha + LDA $4D : CMP.b #$02 : BEQ .alpha + + JSL Sprite_DirectionToFacePlayerLong : PHX : TYX + + ; Make sure that the sprite is facing towards the player, otherwise + ; talking can't happen. (What sprites actually use this???) + LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other + + PLA : XBA : PLA + + PHY + + TAY : XBA + + JSL Sprite_ShowMessageUnconditional + + LDA.b #$40 : STA $0F10, X + + PLA : EOR.b #$03 + + SEC + + RTL + +.not_facing_each_other +.alpha + PLY + PLA + + LDA $0DE0, X + + CLC + + RTL +} +;================================================================ diff --git a/elder.asm b/elder.asm index e36d8fc..b206e7c 100644 --- a/elder.asm +++ b/elder.asm @@ -50,7 +50,7 @@ RTL LDA.b #$96 LDY.b #$01 - JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .dont_show + JSL Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage : BCC .dont_show LDA !GOAL_COUNTER CMP GoalItemRequirement : !BLT + JSL.l ActivateGoal