[I7] - How to add lotsa conditions to an action?

This is a problem I have stumbled on at various times. I have an action - sing to someone, for instance - but I want different results depending on a lot of parameters - if the actor has a pretty voice, if the victim is tone deaf, if the room is noisy, etc.

How would be a logical way to add lotsa if conditions to an action? Just stuffing if conditions inside a carry out block doesn’t work.

Well, the head of the rule itself allows multiple conditionals, so you can write something like this:

Carry out singing when the actor has a pretty voice and the room is not noisy:

However, if I’m reading you correctly, you have a combination of parameters which do slightly different things. You could probably eliminate entire categories of said combinations without a problem.

Check singing to Cheryl when the room is noisy: say "She points at you and mimes being unable to hear you." instead. Carry out singing to a not tone deaf Cheryl when yourself has a pretty voice: say "Cheryl listens, her gaze sharpening with interest as you belt out the first bars." Carry out singing to Cheryl: say "Cheryl listens politely."

(In this instance, we can just ignore the combination Tone Deaf + Pretty Voice, and claim that if Cheryl is tone deaf she wouldn’t notice the difference. Likewise, if the room is noisy, the perceived quality of the performance just won’t matter.)

This is often the use of Check rules: they ensure the action doesn’t go through to the Carry Out stage unless all its conditions are met.

Check singing when the player is tone deaf: say "You have difficulty figuring out the notes, and trail off awkwardly." instead. Check singing when the room is noisy: say "You can barely hear yourself." instead.

I hadn’t considered adding conditions to carry out - quite helpful!

Anyway, I sometimes ends up adding lotsa conditions inside a single Say sentence:

Say “[if the actor][but only][otherwise][whatever][else]”. …

… Something like that. It gets kinda messy. Maybe I could use several lines to construct the sencence, so I had more control? Something like:

bloated-paragraph is "";
If actor is a tone-deaf then bloated-paragraph is "With a voice reminiscent of the slaugter of pigs";
Otherwise bloated-paragraph is "With a gentle, melodious voice ";
If actor is angry then bloated-paragraph is "[bloated-paragraph]you sing 'They're Coming to Take Me Away'";
otherwise bloated-paragraph is "[bloated-paragraph]you sing 'Bridge Over Troubled Water'";
Say "[bloated-paragraph]".

Does this make sense? I remember reading about something akin to this, but don’t remember where …

Seems a kind of roundabout way to do it. If you do want to expand you code out for readability, you can just say each thing as you come to it.

say "With a ";
if the actor is tone-deaf:
    say "voice reminiscent of slaughter";
    say "gentle, melodious voice";
say ", [the actor] [sing] ";
if the actor is angry:
    say "'They're Coming to Take Me Away'";

Of course!