I'm just working on some final building blocks for my game but want to try and have the player statistics factor in to certain dice rolls for stealth, close-combat, intelligence etc. I can make the dice rolls work off a 'roll under $dexterity' etc. But I'm trying to do some even more advanced stuff like
Roll under x (if $class then a +10, -10 modifier etc applies).
I'm running into 'Bad conditional expression' issues unfortunately. I'm not sure of the final piece of the puzzle...
This is how my code looks:
<<set $enemyHP == 34>>
<<set $CurHP == 40>>
Roll a 55 or under!<br>
<span id='dice-outcome'></span>
<span id='dice-button'>
<<button 'Melee!'>>
<<set $roll to random(0, 100)>>
<<if $class == $Observer ($roll-= 30)>>
<<if$class == $cqbScout ($roll -= 40>>
<<if $roll gte 56>>
<<replace '#dice-outcome'>>
Your blade misses the enemy bandit, he strikes and you shudder from his blow! Lose 10HP.<br>
<<set $CurHP -= 10>>
<</replace>>
<<else>>
<<if $roll lte 55>>
<<set $enemyHP -= 17>>
<<replace '#dice-outcome'>>
You rolled a $roll. The bandit loses 17 HP.<br>
<</replace>><</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<</if>>
<<if $enemyHP lte 0>>
<<replace '#dice-outcome'>>
You rolled a $roll. The bandit collapses.<br>
<</replace>>
<<replace '#dice-button'>><</replace>> /% remove button %/
<</if>>
<</button>>
</span>