Code: Select all
/emit
<hr />
[h: jsonInit = getInitiativeList() ]
[H: ThisChar = nextInitiative() ]
[H: AllTokens = json.get(jsonInit, "tokens")]
[H: YourUP = json.get(json.get(AllTokens, ThisChar), "tokenId")]
<!-- [Init1 = "acts"]
[Init2 = "takes the initiative"]
[Init3 = "makes a move"]
[Init4 = "seizes the moment"]
[Init5 = "rolls the dice"]
[Init6 = "has a chance"]
[Init7 = "is up"]
[Init8 = "goes for it"]
[Num = 1d8]
[VariableName = "Init" + Num]
[TheInit = eval(VariableName)]
-->
<b><i>Round [r: getInitiativeRound()]: {getName(YourUP)} {TheInit}!</i></b>
<hr />
So basically. Assuming everyone's initiatives are in game, whenever I click the button, the initiative advances forward and a neat little message appears that (let's say the next guy up is called "Jack") says something like "Jack is up!" or "Jack seizes the moment!"
Pretty neat and it works fine as is, but I've hit a snag.
I want the random messages that appear to not be so gender neutral, so instead of it being "Jack makes of move!" it'll say "Jack makes his move!" or, if we're on Jill, it'll say "Jill makes her move!"
I've already made a GM only token property called "Gender" (with the input being his or her, respectively, or I can go 0 or 1 with 1 meaning male.
So what I'm trying to do here is make the random messages change slightly depending on the gender of the current PC. How would I go about making that if() statement?
Also is there a way to make it so it won't display a message for NPCs if I click the button?