//You hear a crash.//<<set $safe = true>>
[[Sam!|Yeah]]\n
<<start_timer 10>><<pause_timer>>Back in the wire room!\n\n<<if $darkRoomDark>>Dark room on the left.<<else>><<if $key>>Empty room on the left.<<else>><<if $seenKey>>Key room on the left.<<else>>Left room light is on. I see the edge of a table.<<endif>><<endif>><<endif>>\nDoor room on the right.\n\n[[Goto the left room.|Dark Room]]\n[[Goto the right room.|Light Room]]\n
<<display "Timer Addon">>//Over the radio you hear Sam's footsteps crunch on glass, then scuff on carpet. The pace changes, he's stepped over something. Then his progress pauses.//\n\nJack, it's a real mess in here.\n\n//You look at the collapsed hallway that separates you from Sam. Him the office temp and you the bomb disposal guy.//\n\n[[Just keep moving Sam, I can lead you out the back of the building. Keep an eye out for any more devices.|The Bomb]]\n
<<screenShake 3000>>//The explosion rocks the room you are in, but you're still safe.//\n\n<<if $safe>>[[Sam are you okay?|Say it again]]<<else>>[[Sam are you okay?|No answer]]<<endif>>
#timer_text\n{\n display: none;\n color: #000000; /* Jonah */\n color: #F7240C; /* Sugarcane */\n font-weight: bold;\n font-size: 28px;\n margin: 10px 0 20px 0;\n text-align:center;\n}\n\n#timer_canvas\n{\n display: none;\n width: 150px;\n height: 150px;\n}\n\nem { color: #BBBBBB; }\n\nul { text-align:right; }
<<resume_timer>>Whoa the timer started counting down!\n\n[[Put your foot back on the wire!|Get Ready]]\n
<<silently>>\n<<set $TimerAddon = \nfunction()\n{\n var div_timer_container = document.createElement('div');\n div_timer_container.setAttribute('id', 'timer');\n\n var div_timer_canvas = document.createElement('canvas');\n div_timer_canvas.setAttribute('id', 'timer_canvas');\n div_timer_canvas.setAttribute('width', '150');\n div_timer_canvas.setAttribute('height', '150');\n div_timer_canvas.width = div_timer_canvas.width;\n div_timer_container.appendChild(div_timer_canvas);\n \n var div_timer_text = document.createElement('span');\n div_timer_text.setAttribute('id', 'timer_text');\n div_timer_text.innerHTML = "";\n div_timer_container.appendChild(div_timer_text);\n\n var Timer_Active = false;\n var Timer_Paused = false;\n var Timer_Mode = 'none';\n var Timer_Param = "";\n var Timer_Max = 0;\n var Timer_Now = 0;\n \n var div_jonah_floater = document.getElementById('floater');\n if(div_jonah_floater) div_jonah_floater.appendChild(div_timer_container);\n\n var div_sugarcane_menu = document.getElementById('sidebar');\n if(div_sugarcane_menu) div_sugarcane_menu.appendChild(div_timer_container);\n\n function StartTimer(val)\n {\n Timer_Active = true;\n Timer_Paused = false;\n Timer_Max = val;\n Timer_Now = val;\n div_timer_text.style.display = 'block';\n div_timer_canvas.style.display = 'block';\n }\n\n function StopTimer()\n {\n Timer_Active = false;\n div_timer_text.style.display = 'none';\n div_timer_canvas.style.display = 'none';\n }\n\n function PauseTimer()\n {\n Timer_Paused = true;\n }\n\n function ResumeTimer()\n {\n Timer_Paused = false;\n }\n\n function SetTimerText(text)\n {\n div_timer_text.innerHTML = text;\n }\n\n function SetTimerMode(mode)\n {\n if(mode == 'display')\n {\n Timer_Mode = 'display';\n }\n else if(mode == 'restart')\n {\n Timer_Mode = 'restart';\n }\n else Timer_Mode = 'none';\n }\n\n function SetTimerParam(param)\n {\n Timer_Param = param;\n }\n\n function OnTimerEnd()\n {\n StopTimer();\n if(Timer_Mode == 'restart')\n {\n state.restart();\n if(Timer_Param) alert(Timer_Param);\n window.location.reload(true);\n \n } \n else if(Timer_Mode == 'display')\n {\n state.display(Timer_Param[0]);\n }\n }\n\n function OnTimerTick()\n {\n if(Timer_Active)\n {\n Timer_Now = Timer_Now - 0;\n if(!Timer_Paused){\n Timer_Now = Timer_Now - 0.1;\n if(Timer_Now <= 0) Timer_Now = 0;\n }\n var context = div_timer_canvas.getContext("2d");\n div_timer_canvas.width = div_timer_canvas.width;\n\n var x = div_timer_canvas.width / 2;\n var y = div_timer_canvas.height / 2;\n var radius = 65;\n var startAngle = 1.5 * Math.PI;\n \n var endAngle = (1.5 + (2 / Timer_Max * Timer_Now)) * Math.PI;\n var counterClockwise = false;\n\n context.beginPath();\n context.arc(x, y, radius, startAngle, endAngle, counterClockwise);\n context.lineWidth = 20;\n if(div_jonah_floater) context.strokeStyle = "black";\n if(div_sugarcane_menu) context.strokeStyle = "#FFC21C";\n context.stroke();\n\n context.font = 'bold 30px sans-serif';\n if(div_jonah_floater) context.fillStyle = "black";\n if(div_sugarcane_menu) context.fillStyle = "#F7FF14";\n if(Timer_Now < 10){\n context.fillText(Timer_Now.toFixed(1), 55, 85);\n } else {\n context.fillText(Timer_Now.toFixed(0), 55, 85);\n }\n if(Timer_Now <= 0) OnTimerEnd();\n }\n }\n\n setInterval(function(){ OnTimerTick(); }, 100); \n\n macros['start_timer'] =\n {\n handler: function(obj, fnc, val)\n {\n StartTimer(val);\n }\n }\n\n macros['stop_timer'] =\n {\n handler: function(obj, fnc, val)\n {\n StopTimer();\n }\n }\n\n macros['pause_timer'] =\n {\n handler: function(obj, fnc, val)\n {\n PauseTimer();\n }\n }\n\n macros['resume_timer'] =\n {\n handler: function(obj, fnc, val)\n {\n ResumeTimer();\n }\n }\n\n macros['set_timer_text'] =\n {\n handler: function(obj, fnc, val)\n {\n SetTimerText(val);\n }\n }\n\n macros['set_timer_mode'] =\n {\n handler: function(obj, fnc, val)\n {\n SetTimerMode(val);\n }\n }\n\n macros['set_timer_param'] =\n {\n handler: function(obj, fnc, val)\n {\n SetTimerParam(val);\n }\n }\n\n}\n>>\n<<print $TimerAddon()>>\n<<endsilently>>
//Sam enters the next room. You hear more of his lazy footsteps.//\n\nOh hey, I see something. Jeez Jack, this thing is out of a comic book.\n\nThere's a big timer thing here. It's blank, and there's two sets of wires coming out. One of those lead to all these packages in duct tape around the room... got these bags on them... what are these? Cake decorations?\n\n[[They're ball bearings Sam. Don't touch anything. Where do the other wires go?|The Timer]]\n
Dance Instructor
<<set $key = true>><<display "The Web">>
I ain't going anywhere. Hey I think I see the rest of your team. Hey! Over here!\n\n//You turn back from the hallway to the stairs.\n\nBreathing a sigh you begin to lift your foot and then pause in caution.\n\nYou look down.\n\nYou see a wire under your foot.\n\n...//
Looks like they fan out across the whole room, like a spokes on a wheel. Or like a web.\n\nMike, I've just noticed that timer thing is on now. It's reads 10. What's that? Minutes?\n\n[[Sam, listen to me. Don't move, stay right where you are.|The Wire]]\n<<silently>>\n<<set_timer_mode "display">>\n<<set_timer_param "Boom">>\n<<start_timer 10>>\n<<pause_timer>>\n<<set $darkRoomDark = true; $lightRoomLocked = true; $timing = false; $key = false; $seenKey = false; $safe = false; >>\n<<endsilently>>
[[Sam!|Static]]\n
It's Locked!\n\n[[Press the Switch|Pressed the Switch]]\n[[Get back in the wire room!|The Web]]\n<<if $key>>[[Use the goddammed key Sam!|The Balcony]]<<endif>>
<<start_timer 10>><<if $darkRoomDark>>\nCan't see a thing in here!\n<<else>>\nNothing in here.<<if $key eq false>>\n\n...except this key on the table<<set $seenKey = true>><<endif>><<endif>>\n\n<<if $key eq false and $darkRoomDark eq false>>\n[[Get the key and come back!|Got the key]]\n<<else>>\n[[Get back in the wire room!|The Web]]\n<<endif>>
//The radio hisses static at you.//
Aaron Steed
<<start_timer 10>><<pause_timer>>Jesus Jack! You do this for a living?\n\n[[Sorry! Look Sam, you're going to have to make a run for it. Tell me what you see and I'll lead you out. You ready?|Get Set]]\n
//Frantic sounds come from the radio.//\n\nIt's a just a balcony!\n\n[[Jump!|The Landing]]\n
@keyframes shakeit {\n 0% { transform: translate(2px, 1px) rotate(0deg); }\n 10% { transform: translate(-1px, -2px) rotate(-1deg); }\n 20% { transform: translate(-3px, 0px) rotate(1deg); }\n 30% { transform: translate(0px, 2px) rotate(0deg); }\n 40% { transform: translate(1px, -1px) rotate(1deg); }\n 50% { transform: translate(-1px, 2px) rotate(-1deg); }\n 60% { transform: translate(-3px, 1px) rotate(0deg); }\n 70% { transform: translate(2px, 1px) rotate(-1deg); }\n 80% { transform: translate(-1px, -1px) rotate(1deg); }\n 90% { transform: translate(2px, 2px) rotate(0deg); }\n 100% { transform: translate(1px, -2px) rotate(-1deg); }\n}\n\n@-o-keyframes shakeit {\n 0% { -o-transform: translate(2px, 1px) rotate(0deg); }\n 10% { -o-transform: translate(-1px, -2px) rotate(-1deg); }\n 20% { -o-transform: translate(-3px, 0px) rotate(1deg); }\n 30% { -o-transform: translate(0px, 2px) rotate(0deg); }\n 40% { -o-transform: translate(1px, -1px) rotate(1deg); }\n 50% { -o-transform: translate(-1px, 2px) rotate(-1deg); }\n 60% { -o-transform: translate(-3px, 1px) rotate(0deg); }\n 70% { -o-transform: translate(2px, 1px) rotate(-1deg); }\n 80% { -o-transform: translate(-1px, -1px) rotate(1deg); }\n 90% { -o-transform: translate(2px, 2px) rotate(0deg); }\n 100% { -o-transform: translate(1px, -2px) rotate(-1deg); }\n}\n\n@-webkit-keyframes shakeit {\n 0% { -webkit-transform: translate(2px, 1px) rotate(0deg); }\n 10% { -webkit-transform: translate(-1px, -2px) rotate(-1deg); }\n 20% { -webkit-transform: translate(-3px, 0px) rotate(1deg); }\n 30% { -webkit-transform: translate(0px, 2px) rotate(0deg); }\n 40% { -webkit-transform: translate(1px, -1px) rotate(1deg); }\n 50% { -webkit-transform: translate(-1px, 2px) rotate(-1deg); }\n 60% { -webkit-transform: translate(-3px, 1px) rotate(0deg); }\n 70% { -webkit-transform: translate(2px, 1px) rotate(-1deg); }\n 80% { -webkit-transform: translate(-1px, -1px) rotate(1deg); }\n 90% { -webkit-transform: translate(2px, 2px) rotate(0deg); }\n 100% { -webkit-transform: translate(1px, -2px) rotate(-1deg); }\n}\n\n@-moz-keyframes shakeit {\n 0% { -moz-transform: translate(2px, 1px) rotate(0deg); }\n 10% { -moz-transform: translate(-1px, -2px) rotate(-1deg); }\n 20% { -moz-transform: translate(-3px, 0px) rotate(1deg); }\n 30% { -moz-transform: translate(0px, 2px) rotate(0deg); }\n 40% { -moz-transform: translate(1px, -1px) rotate(1deg); }\n 50% { -moz-transform: translate(-1px, 2px) rotate(-1deg); }\n 60% { -moz-transform: translate(-3px, 1px) rotate(0deg); }\n 70% { -moz-transform: translate(2px, 1px) rotate(-1deg); }\n 80% { -moz-transform: translate(-1px, -1px) rotate(1deg); }\n 90% { -moz-transform: translate(2px, 2px) rotate(0deg); }\n 100% { -moz-transform: translate(1px, -2px) rotate(-1deg); }\n}\n\n.shake {\n -webkit-animation-name: shakeit;\n -webkit-animation-duration: 0.8s;\n -webkit-transform-origin:50% 50%;\n -webkit-animation-iteration-count: infinite;\n -webkit-animation-timing-function: linear;\n -moz-animation-name: shakeit;\n -moz-animation-duration: 0.8s;\n -moz-transform-origin:50% 50%;\n -moz-animation-iteration-count: infinite;\n -moz-animation-timing-function: linear;\n -o-animation-name: shakeit;\n -o-animation-duration: 0.8s;\n -o-transform-origin:50% 50%;\n -o-animation-iteration-count: infinite;\n -o-animation-timing-function: linear;\n animation-name: shakeit;\n animation-duration: 0.8s;\n transform-origin:50% 50%;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n.shake{\n display:inline-block\n}
<<set $darkRoomDark = ($darkRoomDark ? false : true)>>Pressed it.\n\n[[Press the switch again!|Pressed the Switch]]\n[[Get back in the wire room!|The Web]]\n[[Open the door!|It's Locked]]\n
Aah, ah. I landed on a car with a canvas roof.\n\nOw.\n\nYeah, I think I'm okay.\n\n...\n\nHow about you?\n\n[[I'm okay Sam. I'll come round the front. Stay where you are.|Not going anywhere]]\n
I'm ready.\n\nThere's two exits, left and right. The left is a dark room. In the right room the light is on and I can see a door.\n\n[[Goto the left room|Dark Room]]\n[[Goto the right room|Light Room]]\n
Okay, not moving.\n\n...\n\nWait. I'm standing on one of those wires. What do I do?\n\n[[Slowly take your foot off the wire.|Step Back On the Wire]]\n
<<start_timer 10>>Door's in front of me.\n\nThere's a light switch on the wall.\n\n[[Press the switch|Pressed the Switch]]\n[[Get back in the wire room!|The Web]]\n[[Open the door!|It's Locked]]\n
function screenShake(time) {\n console.log(document);\n var el = document.getElementsByClassName('content');\n baz = el;\n console.log(baz[0]);\n el[0].className = el[0].className + ' shake';\n if (time > 0) {\n setTimeout(function () {\n el[0].className = 'content';\n }, time);\n }\n};\n\ntry {\n version.extensions['screenShakeMacro'] = {\n major: 1,\n minor: 0,\n revision: 0\n };\n macros['screenShake'] = {\n handler: function (place, macroName, params, parser) {\n var time = parseInt(params[0]);\n if (typeof time !== 'number') {\n time = 1000;\n }\n \n // we're overriding the fade function. It behaves as usual except it runs screenShake() if time >= 0.\n fade = function (el, options) {\n var current;\n var proxy = el.cloneNode(true);\n var direction = (options.fade == 'in') ? 1 : -1;\n\n el.parentNode.replaceChild(proxy, el);\n\n if (options.fade == 'in') {\n current = 0;\n proxy.style.visibility = 'visible';\n } else current = 1;\n\n setOpacity(proxy, current);\n var interval = window.setInterval(tick, 25);\n\n function tick() {\n current += 0.05 * direction;\n\n setOpacity(proxy, Math.easeInOut(current));\n\n if (((direction == 1) && (current >= 1)) || ((direction == -1) && (current <= 0))) {\n console.log('swapping fader proxy out');\n el.style.visibility = (options.fade == 'in') ? 'visible' : 'hidden';\n proxy.parentNode.replaceChild(el, proxy);\n delete proxy;\n window.clearInterval(interval);\n\n if (options.onComplete) options.onComplete();\n\n if (time >= 0) {\n screenShake(time);\n time = -1;\n }\n\n }\n };\n\n function setOpacity(el, opacity) {\n var percent = Math.floor(opacity * 100);\n\n // IE\n el.style.zoom = 1;\n el.style.filter = 'alpha(opacity=' + percent + ')';\n\n // CSS 3\n el.style.opacity = opacity;\n };\n };\n },\n init: function () {},\n };\n} catch (e) {\n throwError(place, "screenShake Setup Error: " + e.message);\n}