Switch macro?

33 views
Skip to first unread message

Zero Identity

unread,
May 19, 2013, 12:59:13 PM5/19/13
to twee...@googlegroups.com
Has anyone developed a switch macro? I want to implement a status system that will report on status and appearance screens according to what value the stats have, but it's a little cumbersome to write:

<<if $confidence / 10 eq 5>>You are the master of yourself and your surroundings. Nothing happens that you aren't ready for, and you have an unshakable belief in yourself.<<endif>><<if $confidence / 10 eq 4>>You project an air of confidence, a strong faith in yourself.<<endif>><<if $confidence / 10 eq 3>>You are a bit cocky, willing to try anything.<<endif>><<if $confidence / 10 eq 2>>You are a bit unsure of yourself, and find yourself wanting to play things safe more often than not.<<endif>><<if $confidence / 10 eq 1>>You have little self-esteem, and little doubt that whatever challenge presents itself, you are not up to the task.<<endif>><<if $confidence / 10 eq 0>>You are meek, shy and unassuming. You quail in the presence of strangers and large crowds.<<endif>>


What I'm looking for is to style it more after a switch, like so:
<<switch $confidence / 10>><<case 5>>blablabla<<case 4>>blablabla . . . <<case 0>>blablabla<<endswitch>>

Is this possible?

tuddster

unread,
May 20, 2013, 6:53:49 PM5/20/13
to twee...@googlegroups.com
L wrote an <<else if>> macro which is pretty close to what you want. Here's how you would use it:
<<if $fire eq "warm">>
The fire isn't hot yet.
<<else if $medal eq "water">>
You medal protects you.
<<else if $dead gt 0>>
Not again!
<<else>>
You died!
<<endif>>

And you can get it here.
Reply all
Reply to author
Forward
0 new messages