diff --git a/itemdatatables.asm b/itemdatatables.asm index d7e23d0..53395bb 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -696,7 +696,7 @@ endmacro %InventoryItem($01, $0081, SwordTime, $0000) ; 01 - Master sword %InventoryItem($02, $0001, SwordTime, $0000) ; 02 - Tempered sword %InventoryItem($03, $0081, SwordTime, $0000) ; 03 - Butter sword -%InventoryItem($04, $0081, $0000, $0000) ; 04 - Fighter shield +%InventoryItem($04, $0080, $0000, $0000) ; 04 - Fighter shield %InventoryItem($05, $0081, $0000, $0000) ; 05 - Fire shield %InventoryItem($06, $0081, $0000, $0000) ; 06 - Mirror shield %InventoryItem($07, $0085, $0000, $0000) ; 07 - Fire rod diff --git a/multiworld.asm b/multiworld.asm index dea0e40..1367777 100644 --- a/multiworld.asm +++ b/multiworld.asm @@ -89,6 +89,9 @@ GetMultiworldItem: PHP LDA.l !MULTIWORLD_ITEM : BNE + LDA.l !MULTIWORLD_HUD_TIMER : BNE + + LDA.l ShieldEquipment : BNE ++ + LDA.l PikitItem : CMP.b #$04 : BNE + + ++ BRL .return + @@ -123,6 +126,34 @@ GetMultiworldItem: BRL .return + + LDA.l ShieldEquipment : BNE + + LDA.l PikitItem : CMP.b #$04 : BEQ + + + LDY.b #$10 + - + DEY + BMI .restore_shield + LDA.w $0E20, Y + CMP.b #$AA + BNE - ; go to next sprite if this sprite isn't a pikit + LDA.w $0DD0, Y + BEQ - ; go to next sprite if this sprite is dead/inactive + LDA.w $0ED0, Y + CMP.b #$04 + BNE - ; go to next sprite if this pikit isn't grabbing a shield + LDA.w $0E90, Y + CMP.b #$04 + BNE - ; go to next sprite if this pikit isn't grabbing a shield + + BRA + ; active pikit has a shield + + .restore_shield + ; we have a pikit item, but no shield, and there's no pikit actively + ; eating a shield, so return the shield to prevent a softlock + LDA.b #$01 + STA.l ShieldEquipment + + + LDA.l !MULTIWORLD_ITEM : BNE + BRL .return + diff --git a/pikit.asm b/pikit.asm index f0d477b..dfba23e 100644 --- a/pikit.asm +++ b/pikit.asm @@ -166,6 +166,11 @@ PikitDigest: STZ.w $0E90, X + LDA.b $6C + BNE + ; link is in a doorway; giving him an item could be scary :< + + JSL IncrementPikitCounter + LDA.l PikitItem CMP.b #$04 BEQ + diff --git a/shopkeeper.asm b/shopkeeper.asm index 3183eec..f30d04c 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -436,7 +436,7 @@ Shopkeeper_BuyItem: BRA + .refill JSL Sprite_GetEmptyBottleIndex : BMI .full_bottles - LDA.b #$1 : STA.l ShopkeeperRefill ; If this is on, don't toggle bit to remove from shop + LDA.b #$01 : STA.l ShopkeeperRefill ; If this is on, don't toggle bit to remove from shop + LDA.l ShopType : AND.b #$80 : BNE .buy ; don't charge if this is a take-any @@ -453,6 +453,16 @@ Shopkeeper_BuyItem: LDA.b #$3C : STA.w SFX2 ; error sound JMP .done .buy + + LDA.l ShopInventory, X + TAY + JSL ShieldCheck + BCS + + JMP .done + + + ; Y now has the (possibly-substituted) item ID + + LDA.l ShopType : AND.b #$80 : BNE ++ ; don't charge if this is a take-any REP #$20 : LDA.l CurrentRupees : !SUB.l ShopInventory+1, X : STA.l CurrentRupees : SEP #$20 ; Take price away ++ @@ -464,9 +474,9 @@ Shopkeeper_BuyItem: LDA.l EnableShopItemCount, X : STA.l ShopEnableCount ; If so, store the permission to count the item here. +++ PLX - LDA.l ShopInventory, X - JSL AttemptItemSubstitution - TAY : JSL Link_ReceiveItem + + ; Y still has item ID + JSL Link_ReceiveItem LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X LDA.b #$00 : STA.l ShopEnableCount TXA : LSR #2 : TAX diff --git a/sram.asm b/sram.asm index 64f9057..802bdcc 100644 --- a/sram.asm +++ b/sram.asm @@ -323,7 +323,7 @@ MagicCounter: skip 2 ; Magic used by player (16-bit integer) HighestMail: skip 1 ; Highest mail level SmallKeyCounter: skip 1 ; Total Number of small keys collected (integer) HeartPieceCounter: skip 1 ; Total Number of heartpieces collected (integer) -skip 1 ; Unused +PikitFed: skip 1 ; Total Number of shields fed to pikit DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize has been collected. ; This has the same shape as the dungeon item bitfields. MapCountDisplay: skip 2 ; diff --git a/stats.asm b/stats.asm index 492b6de..fe8bab4 100644 --- a/stats.asm +++ b/stats.asm @@ -5,6 +5,13 @@ ; ; See sram.asm for adresses and documentation of stat values ;-------------------------------------------------------------------------------- +IncrementPikitCounter: + LDA.l StatsLocked : BNE + + LDA.l PikitFed : INC A : BEQ + ; overflow + STA.l PikitFed + + +RTL +;-------------------------------------------------------------------------------- IncrementBonkCounter: LDA.l StatsLocked : BNE + LDA.l BonkCounter : INC : BEQ + ; overflow diff --git a/stats/credits.asm b/stats/credits.asm index ef6b8da..9c4120b 100755 --- a/stats/credits.asm +++ b/stats/credits.asm @@ -504,6 +504,15 @@ CreditsLineBlank: %blankline() %blankline() +%smallcredits("PIKIT FEEDER", "red") + +%blankline() + +%bigcredits("KARAFRUIT") + +%blankline() +%blankline() + %smallcredits("SPRITE DEVELOPMENT", "yellow") %blankline() @@ -623,12 +632,6 @@ endif %bigcredits("HTTPS://ALTTPR.COM/DISCORD") -%emptyline() -%emptyline() -%emptyline() -%emptyline() -%emptyline() -%emptyline() %emptyline() %emptyline() @@ -755,10 +758,9 @@ endif %bigcreditsleft("TOTAL LAG TIME") %blankline() -%blankline() +%bigcreditsleft("SHIELDS EATEN") -%blankline() %blankline() diff --git a/stats/statConfig.asm b/stats/statConfig.asm index 1ef49dd..3ccc17a 100755 --- a/stats/statConfig.asm +++ b/stats/statConfig.asm @@ -32,6 +32,8 @@ !TOTAL_MENU_TIME_Y = 364 !TOTAL_LAG_TIME_X = 19 !TOTAL_LAG_TIME_Y = 367 +!PIKIT_FED_X = 26 +!PIKIT_FED_Y = 370 !COLLECTION_RATE_X = 22 !COLLECTION_RATE_Y = 380 !TOTAL_TIME_X = 19 @@ -64,8 +66,9 @@ CreditsStats: %AddStat(FaerieRevivalCounter, 0, 0, 08, 3, !FAERIE_REVIVALS_X, !FAERIE_REVIVALS_Y) %AddStat(MenuFrames, 1, 8, 32, 4, !TOTAL_MENU_TIME_X, !TOTAL_MENU_TIME_Y) %AddStat(LagTime, 1, 0, 32, 4, !TOTAL_LAG_TIME_X, !TOTAL_LAG_TIME_Y) +%AddStat(PikitFed, 0, 0, 8, 3, !PIKIT_FED_X, !PIKIT_FED_Y) print "Collection Rate config: ", pc -warnpc $A39864 +; warnpc $A39864 %AddStat(TotalItemCounter, 0, 0, 16, 3, !COLLECTION_RATE_X, !COLLECTION_RATE_Y) %AddStat(NMIFrames, 1, 0, 32, 4, !TOTAL_TIME_X, !TOTAL_TIME_Y)