diff --git a/registration-system/view/signups/game1/js/environment.js b/registration-system/view/signups/game1/js/environment.js index baede69580413721cb45cf2944a03201e292f9a5..9ee43fa8d5c8e2fabc9878132a371ec91602f413 100644 --- a/registration-system/view/signups/game1/js/environment.js +++ b/registration-system/view/signups/game1/js/environment.js @@ -30,6 +30,7 @@ Environment.progress = { dorf_pickedFood: false, dorf_pickedFootAndLeftPub: false, dorf_boughtTicket: false, + sleep_inn: false, // ufer related ufer_princessApproach: false, diff --git a/registration-system/view/signups/game1/js/story.js b/registration-system/view/signups/game1/js/story.js index bd3c8d29193472d4a2a5cd1610ef1cfc71f9e1a5..3e510dcd35a75a3852585d3b9926f822ad6c8eff 100644 --- a/registration-system/view/signups/game1/js/story.js +++ b/registration-system/view/signups/game1/js/story.js @@ -573,6 +573,7 @@ Story.actions = { .transition().attr('transform', 'translate(50, 20)') .transition().attr('transform', 'translate(50, -20)') .transition().attr('display', 'none'); + Game.log("Schlafe im INN bis die Reise beginnt."); }); function blinkChoice(id) { @@ -644,7 +645,7 @@ Story.actions = { } }, { bubble: '#wirt_speech', - message: 'Wenn du kein Fleisch ist, mache ich dir Käse und Brot.', + message: 'Wenn du kein Fleisch isst, mache ich dir Käse und Brot.', action: function () { appearanceBlast(nodes.kaeseBlast, food.kaese); } @@ -733,6 +734,103 @@ Story.actions = { } }, + 'sleep_inn': { + state: { + }, + possible: function () { + return Environment.progress.dorf_boughtTicket && !Environment.progress.sleep_inn; + }, + action: function(event, context) { + if (!context.bEnter) return; + Environment.progress.sleep_inn = true; + + var gameOverlay = $('#game-overlay'); + gameOverlay.fadeIn(300); + + var queue = [ + color('#000000'), + color('#ffffff'), + delay(2000), + storyTalk(0), + delay(2000), + color('#000000'), + color('#30f040'), + color('#6020f0'), + color('#205010'), + color('#6020f0'), + color('#30f040'), + color('#205010', 800), + color('#6020f0', 600), + color('#30f040', 400), + color('#205010', 400), + color('#6020f0', 350), + color('#205010', 300), + color('#6020f0', 200), + color('#30f040', 200), + color('#205010', 200), + color('#6020f0', 200), + color('#30f040', 150), + color('#205010', 150), + color('#6020f0', 150), + color('#205010', 100), + color('#30f040', 100), + color('#6020f0', 100), + color('#30f040', 60), + color('#6020f0', 60), + color('#205010', 60), + color('#000000', 1000), + delay(2000), + color('#ffffff', 1000), + delay(3000), + storyTalk(1), + delay(3000), + color('#000000', 2000), + nextMap + ]; + nextAction(); // start the LSD process + + function storyTalk(num) { + return function() { + switch (num) { + case 0: + Story.dialogueHelper([{ + message: 'George: Trinkt nicht zu viel ja?!' + }], null, nextAction); + break; + case 1: + Story.dialogueHelper([{ + message: 'George: Ich habs euch gesagt! Ihr hättet nicht so viel trinken dürfen!' + }], null, nextAction); + break; + } + }; + } + function delay(time) { + return function() { + setTimeout(nextAction, time); + }; + } + function nextAction() { + if (queue.length == 0) return; + queue.shift()(); + } + function color(color, duration) { + if (!duration) duration = 1000; + return function() { + gameOverlay.animate({'backgroundColor': color}, { + 'duration': duration, + 'complete': function () { + nextAction(); + } + }); + } + } + function nextMap() { + Game.instance.nextMap('ufer'); + } + } + }, + // ================================================================================================================= // Actions am Ufer diff --git a/registration-system/view/signups/game1/maps/dorf.svg b/registration-system/view/signups/game1/maps/dorf.svg index 1f93948de78be03db5f43921a1cb3a424cbc7dbe..87e8c94fa7d04f80bddddc52428022d4c2b3b60e 100644 Binary files a/registration-system/view/signups/game1/maps/dorf.svg and b/registration-system/view/signups/game1/maps/dorf.svg differ diff --git a/registration-system/view/signups/game1/test.html b/registration-system/view/signups/game1/test.html index 86b329c03cf81c2a702a406232f92abd1568ce84..d109b619d517a9baa10e836cc1f47e2f5bbc6019 100644 --- a/registration-system/view/signups/game1/test.html +++ b/registration-system/view/signups/game1/test.html @@ -55,12 +55,10 @@ <div id="game-game"> <div id="gameCanvas" style="overflow:hidden;position:relative"> <div id="gameRoot" style="position:relative"></div> + <div id="game-overlay"></div> <div id="gameDialogue" class="bordered-box"></div> </div> </div> - <div id="game-overlay"> - - </div> </div> <script> g_smallValue = 0.000001; // fun with floats