KAZIK/src_graphics/artifact_shop.inc
Игорь Федосеев eaac8b861e feat: rework artifacts and tower relics
Extend profiles from 280 to 312 bytes with legacy compatibility.
Keep tower relics run-local and share the profile bankroll.
2026-10-30 23:22:19 +03:00

180 lines
5.3 KiB
PHP

HandleArtifactShop3D PROC uses ebx
invoke Pressed3D,09h
test eax,eax
jz @F
mov merchantTab3D,0
mov artifactBuyArmed3D,0
ret
@@:
invoke Pressed3D,26h
test eax,eax
jz @F
cmp merchantCharmSelected3D,0
je @F
dec merchantCharmSelected3D
mov artifactBuyArmed3D,0
mov merchantMessage3D,0
@@:
invoke Pressed3D,28h
test eax,eax
jz @F
cmp merchantCharmSelected3D,3
jae @F
inc merchantCharmSelected3D
mov artifactBuyArmed3D,0
mov merchantMessage3D,0
@@:
invoke Pressed3D,45h
test eax,eax
jz artifact_shop_mouse
invoke ToggleArtifact3D,merchantCharmSelected3D
mov artifactBuyArmed3D,0
artifact_shop_mouse:
cmp mouseClick3D,0
je artifact_shop_enter
mov mouseClick3D,0
cmp mouseY3D,27
jb artifact_shop_enter
cmp mouseY3D,45
jae artifact_shop_rows
cmp mouseX3D,96
jae artifact_shop_enter
mov merchantTab3D,0
ret
artifact_shop_rows:
cmp mouseX3D,8
jb artifact_shop_enter
cmp mouseX3D,108
jae artifact_shop_actions
mov eax,mouseY3D
sub eax,52
js artifact_shop_enter
xor edx,edx
mov ecx,34
div ecx
cmp eax,3
ja artifact_shop_enter
mov merchantCharmSelected3D,eax
mov artifactBuyArmed3D,0
mov merchantMessage3D,0
ret
artifact_shop_actions:
cmp mouseX3D,116
jb artifact_shop_enter
cmp mouseX3D,311
jae artifact_shop_enter
cmp mouseY3D,169
jb artifact_shop_enter
cmp mouseY3D,185
jae artifact_shop_buy_mouse
invoke ToggleArtifact3D,merchantCharmSelected3D
mov artifactBuyArmed3D,0
ret
artifact_shop_buy_mouse:
cmp mouseY3D,190
jb artifact_shop_enter
cmp mouseY3D,210
jae artifact_shop_enter
jmp artifact_shop_confirm
artifact_shop_enter:
invoke Pressed3D,0Dh
test eax,eax
jz artifact_shop_done
artifact_shop_confirm:
cmp artifactBuyArmed3D,0
jne artifact_shop_purchase
mov artifactBuyArmed3D,1
mov merchantMessage3D,0
ret
artifact_shop_purchase:
mov artifactBuyArmed3D,0
invoke BuyMerchantCharm3D,merchantCharmSelected3D
artifact_shop_done:
ret
HandleArtifactShop3D ENDP
RenderArtifactShop3D PROC uses ebx esi edi
local y:DWORD,x:DWORD,ink:DWORD
invoke DrawBox,0,0,320,240,0015191Bh
invoke DrawBox,0,0,320,24,002B302Ah
invoke DrawString8x8,8,7,OFFSET artifactShopTitle3D,00EED5A0h
invoke FormatNumber,bankroll,OFFSET artifactNum3D
invoke DrawString8x8,232,7,OFFSET artifactNum3D,00AAEEAAh
invoke DrawBoxBorder,8,28,88,17,002B302Ah,00667766h,1
invoke DrawString8x8,14,33,OFFSET merchantStock3D,00BBBBBBh
invoke DrawBoxBorder,100,28,212,17,003D4939h,00C8AE70h,1
invoke DrawString8x8,122,33,OFFSET merchantTabCharmsLabel,00FFE0A0h
xor ebx,ebx
mov y,52
artifact_shop_card:
mov ink,00465450h
cmp ebx,merchantCharmSelected3D
jne @F
mov ink,00D8B878h
@@:
invoke DrawBoxBorder,8,y,100,31,00232A2Bh,ink,1
mov eax,y
add eax,5
invoke DrawString8x8,13,eax,charmNames3D[ebx*4],artifactColors3D[ebx*4]
mov ecx,ebx
bt charmEnabledMask3D,ecx
mov esi,OFFSET artifactOff3D
jnc @F
mov esi,OFFSET artifactOn3D
@@:
mov eax,y
add eax,18
invoke DrawString8x8,13,eax,esi,00AAAAAAh
lea edi,charmCloverUses
invoke FormatNumber,[edi+ebx*4],OFFSET artifactNum3D
mov eax,y
add eax,18
invoke DrawString8x8,76,eax,OFFSET artifactNum3D,00FFFFFFh
add y,34
inc ebx
cmp ebx,4
jb artifact_shop_card
mov ebx,merchantCharmSelected3D
invoke DrawBoxBorder,114,52,198,115,001D2425h,00647770h,1
invoke DrawString8x8,120,59,charmNames3D[ebx*4],artifactColors3D[ebx*4]
invoke DrawString8x8,120,77,charmDescs3D[ebx*4],00FFFFFFh
; Detail descriptions use full width below cards to avoid clipped text.
invoke DrawString8x8,8,216,artifactRules3D[ebx*4],00DDCDAAh
invoke DrawString8x8,8,228,OFFSET artifactHelp3D,0099AAA5h
invoke DrawString8x8,120,96,OFFSET artifactPack3D,0099AAA5h
invoke FormatNumber,charmUsesPack3D[ebx*4],OFFSET artifactNum3D
invoke DrawString8x8,280,96,OFFSET artifactNum3D,00FFFFFFh
invoke DrawString8x8,120,112,OFFSET artifactStock3D,0099AAA5h
lea edi,charmCloverUses
invoke FormatNumber,[edi+ebx*4],OFFSET artifactNum3D
invoke DrawString8x8,280,112,OFFSET artifactNum3D,00FFFFFFh
invoke DrawString8x8,120,128,OFFSET artifactPrice3D,0099AAA5h
invoke FormatNumber,charmPrices3D[ebx*4],OFFSET artifactNum3D
invoke DrawString8x8,264,128,OFFSET artifactNum3D,00FFD080h
invoke DrawString8x8,120,150,artifactUseRules3D[ebx*4],00BBCCC0h
mov esi,OFFSET artifactTowerNote3D
cmp merchantMessage3D,1
jne @F
mov esi,OFFSET artifactBought3D
@@:
cmp merchantMessage3D,2
jne @F
mov esi,OFFSET merchantPoor3D
@@:
cmp merchantMessage3D,3
jne @F
mov esi,OFFSET artifactLimit3D
@@:
; Long status uses a full-width strip, not the detail card.
invoke DrawString8x8,8,202,esi,00E0B580h
invoke DrawBoxBorder,116,170,194,15,00303E37h,006F9982h,1
invoke DrawString8x8,128,174,OFFSET artifactToggle3D,00BBDDCCh
mov esi,OFFSET artifactBuy3D
cmp artifactBuyArmed3D,0
je @F
mov esi,OFFSET artifactConfirm3D
@@:
invoke DrawBoxBorder,116,188,194,13,0043372Ah,00CCAA66h,1
invoke DrawString8x8,120,191,esi,00FFE0A0h
ret
RenderArtifactShop3D ENDP