mob/proc
ChannelSpell(_words)
src.icon_state = "casting"
var _verdict = TRUE
//show channeling bar if(_words >= 30)
while(_words--)
//adjust channeling bar
if(src.dead)//cancel or interrupts
_verdict = FALSE
break
sleep(src.castSpeed)//starts at 20 can level-up to 1
src.icon_state = null
return _verdict
Problem description:
Looking to create something much like either of the above two examples. It doesn't have to be fancy looking. Just something resource-efficient as it will be called quite often.
I can think of 2 ways to do it (both using image()):
1) Use drawbox(), drawing as % per loop.
2) Use an icon overlay datum, with states named 1-100 (representing percent values), and changing as needed per loop.
But as this bar will appear any time the spell is medium to long in cast-time, I'm concerned modifying icon_state so often will be expensive? Is there a better way? Are my concerns rational?
(Side note, I'm assuming there are no major concerns with the proc as a whole?)
You should experiment with transform matrices. They let you very efficiently resize and rotate graphics without having to create and save each frame as an icon.