It’s fairly simple, I want to call a function with a daemon but you can’t call a function normally, you use a pointer, I can’t find a way to use fuse/daemons with arguments, which is strange to me, am I missing something?
gist of it is, I have one major death method to handle an actor dying, it takes a ‘cause’ argument, so if a certain action needs to trigger a delayed death, (for flavor’s sake, of course) I seem out of luck. Here’s the extremely simplified, not direct code
death(cause)
if(cause == 'plague')
do x
elif(cause == 'stabbing')
do x
Same for an affliction system, this is where the real issue lies, there’s a blood boil spell, a gruesome spell that kills someone over three turns, the only issue is well, I’d like to have a master affliction function that handles the affliction based on an argument.
again, simplified
afflict(affliction)
if(affliction == 'bboil')
stage = 0
Switch statement progressing stage once per turn, with text to describe it
So take an action where we afflict this condition on the NPC while delayed, and the problem becomes clear
action()
new Daemon(self, &afflict, 1)
new Fuse (self, &death, 3)
I simply can’t find a way to pass my arguments. The daemon progresses for three turns, and at the end of the daemon the set fuse goes off, killing the actor, that’s the goal at least. I can just make separate methods for each type if I must, but I’d like to hear other possibilities.