{"pages":{"start":[{"choice":{"options":[{"label":"Orig-block","commands":[{"goto":{"target":"Stage4-2"}}]},{"label":"Simple-block","commands":[{"goto":{"target":"Simple-block"}}]},{"label":"Extended-example","commands":[{"goto":{"target":"Extended-example"}}]}]}}],"Stage4-2":[{"eval":{"script":"BlockRoll = Block()"}},{"say":{"label":"<p>Enemy Attack<\/p>","mode":"autoplay","allowSkip":true}},{"if":{"condition":"BlockRoll == 1 || BlockRoll == 3 || BlockRoll == 5","commands":[{"say":{"label":"<p>Fail to block<\/p>","mode":"autoplay","allowSkip":true}}]}},{"if":{"condition":"BlockRoll == 2 || BlockRoll == 4 || BlockRoll == 6","commands":[{"say":{"label":"<p>Success block<\/p>","mode":"autoplay","allowSkip":true}}]}},{"goto":{"target":"start"}}],"Simple-block":[{"say":{"label":"<p>Swing<\/p>","mode":"autoplay","allowSkip":true}},{"if":{"condition":"Math.random() < 0.5","commands":[{"say":{"label":"<p>Blocked!<\/p>","mode":"autoplay","allowSkip":true}}],"elseCommands":[{"say":{"label":"<p>Got Hit!<\/p>","mode":"autoplay","allowSkip":true}}]}},{"goto":{"target":"start"}}],"Extended-example":[{"say":{"label":"<p>Ext-example, Attacking for <eval>enemyAttack<\/eval><\/p>","mode":"autoplay","allowSkip":true}},{"if":{"condition":"Math.random() < playerBlockChance","commands":[{"say":{"label":"<p>Blocked!<\/p>","mode":"autoplay","allowSkip":true}},{"eval":{"script":""}}],"elseCommands":[{"say":{"label":"<p>Got hit!<\/p>","mode":"instant"}},{"eval":{"script":"playerHP = playerHP - enemyAttack"}},{"say":{"label":"<p>Your HP is <eval>playerHP<\/eval><\/p>","mode":"autoplay","allowSkip":true}}]}},{"if":{"condition":"playerHP <= 0","commands":[{"goto":{"target":"Extended-died"}}]}},{"goto":{"target":"start"}}],"Extended-died":[{"say":{"label":"<p>You died! Restarting<\/p>","mode":"pause"}},{"eval":{"script":"playerHP = 50"}},{"goto":{"target":"start"}}]},"init":"var Block1 = [\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"]\n\nfunction Block() {\n  return Block1[Math.floor(Math.random() * Block1.length)]\n}\n\n\n\/\/ Added some health stuff for an extended example\nvar playerHP = 50\nvar playerBlockChance = 0.3\n\nvar enemyAttack = 10"}