I revisited this issue in DSB 0.73 and added significantly more flexibility.
DSB 0.73 adds
dsb_attack_info which takes a table as a parameter, as well as a ttl. The table is passed to
sys_render_attack_result which has been rewritten in 0.73 to pass any table parameters passed via
dsb_attack_info on to
h_render_attack_info so you can render them however you like.
For example, if you use the following
h_render_attack_info function:
Code: Select all
function h_render_attack_info(bmp, attack_table)
if (attack_table.graphic) then
dsb_bitmap_draw(attack_table.graphic, bmp, 0, 0, false)
end
end
Then this code would flash a picture of Mophus (the horror...) for 5 ticks.
Code: Select all
dsb_attack_info({ graphic = gfx.port_mophus }, 5)
If a
text property is defined, it will render that text (just like "can't reach" or "need ammo") on top of everything else.
Code: Select all
dsb_attack_info({ graphic = gfx.port_mophus, text = "IT'S MOPHUS" }, 5)