Language…
14 users online: Deluxe, dylanthebluekoopa, DyroccYT, encore, ForthRightMC, Gasterus155, Hammerbrother24, Masaya Murakami, PixlBitNick, signature_steve, timmytenfingers, underway, X11Gbyte, Zavok - Guests: 133 - Bots: 164
Users: 67,616 (2,007 active)
Latest user: duu

How to make enemy projectiles interact with Icy blocks?

I've seen a few other hacks with some kind of way for enemy fireballs (such as the fireballs from jumping piranha plants or even custom sprites) to interact with and melt Icy blocks just like the player can with a fire flower. Is there some patch or uberasm code that I haven't been able to find that can make this happen?
your simplistic human mind cannot possibly comprehend the complexities of my thoughts
Absolutely! There is an UberASM code KevinM made and gave me that does exactly what you want. (for some reason he didn't release it publicly even though I suggested him that in Discord...)

'ext_sprite_interact_template.asm' is meant as game mode or level code, whereas 'ext_sprites_block_interact.asm' goes in the 'library' folder. Additionally, in 'other/macro_library.asm', you'll need to add this:

Code
macro define_base2_address(name, addr)
    if !sa1 == 0
        !<name> = <addr>
    else
        !<name> = <addr>|!addr
    endif
endmacro
!ext_sprite_slots = 10
!extended_offset  = $13
%define_base2_address(extended_num,$170B)
%define_base2_address(extended_y_low,$1715)
%define_base2_address(extended_y_high,$1729)
%define_base2_address(extended_x_low,$171F)
%define_base2_address(extended_x_high,$1733)
%define_base2_address(extended_x_speed,$1747)
%define_base2_address(extended_y_speed,$173D)
%define_base2_address(extended_table,$1765)
%define_base2_address(extended_timer,$176F)
%define_base2_address(extended_behind,$1779)


(note that if you're on SA-1, the entire code may not work, so you may need to change all the addresses in the '%define_base2_address' macros to their SA-1 counterparts)


Now, to make your extended sprites (in your case, the piranha plant fireball) interact with your icy blocks, turn on the '!custom_blocks' define and the '!vanilla_blocks' off. Conveniently enough, the sprite number for the piranha plant fireball is already added under the 'ext_sprite_numbers:' table. However, you should get rid of the $0D, as that's the baseball extended sprite number and you probably don't want that to interact with your blocks. Here's a list of vanilla extended sprites for your convenience:

Code
00	(empty)
01	Smoke puff
02	Reznor fireball
03	Flame left by hopping flame
04	Hammer
05	Player fireball
06	Bone from Dry Bones
07	Lava splash
08	Torpedo Ted shooter's arm
09	Unknown flickering object
0A	Coin from coin cloud game
0B	Piranha Plant fireball
0C	Lava Lotus's fiery objects
0D	Baseball
0E	Wiggler's flower
0F	Trail of smoke (from Yoshi stomping the ground)
10	Spinjump stars
11	Yoshi fireballs
12	Water bubble


Finally, you'll have to edit the block's code by copy-pasting this directly under the 'FIAR:' label:

Code
    LDX $0DD4|!addr
    BEQ .fireball_found
	DEX

.fireball_found


$0DD4 is a free RAM dictated by the define '!custom_interaction_flag'. If you're already using that RAM for something else, change it.

Anyways, I hope you understood me!
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!