castle_cutscene.nut 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. function initialize()
  2. {
  3. Tux.deactivate();
  4. Effect.sixteen_to_nine(0);
  5. Effect.fade_in(1.5);
  6. Tux.walk(150);
  7. wait(3.5);
  8. Text.set_text(_("Tux had reached the end of the castle."));
  9. Text.fade_in(1);
  10. wait(2.2);
  11. Tux.walk(100);
  12. wait(0.3);
  13. Tux.walk(75);
  14. wait(0.1);
  15. Tux.walk(0);
  16. wait(1.4);
  17. Text.fade_out(1);
  18. wait(2);
  19. Text.set_text(_("But to his surprise all he could find was a letter."));
  20. Text.fade_in(1);
  21. wait(4);
  22. Text.fade_out(1);
  23. wait(1);
  24. Tux.walk(100);
  25. wait(0.35);
  26. Tux.walk(0);
  27. wait(1);
  28. Text.set_text(_("A letter from Penny telling Tux that Nolok has taken her to a far forest."));
  29. Text.fade_in(1);
  30. wait(4);
  31. Text.fade_out(1);
  32. wait(2);
  33. Text.set_text(_("Unsure about what Nolok was doing to her, Tux became worried about his beloved Penny."));
  34. Text.fade_in(1);
  35. wait(4);
  36. Text.fade_out(1);
  37. wait(3);
  38. Text.set_text(_("Until suddenly..."));
  39. Text.fade_in(1);
  40. wait(4);
  41. Text.fade_out(1);
  42. wait(1);
  43. YETI.set_pos(96, 426);
  44. YETI.set_action("stand-right");
  45. YETI.set_visible(true);
  46. play_sound("sounds/yeti_roar.wav");
  47. Tux.do_jump(-250);
  48. wait(0.8);
  49. Tux.set_dir(false);
  50. Camera.scroll_to(0, 128, 0.1);
  51. play_music("music/antarctic/voc-boss.music");
  52. wait(0.3);
  53. YETI.set_action("stomp-right");
  54. play_sound("sounds/yeti_gna.wav");
  55. YETI.set_velocity(0, -300);
  56. wait(0.5);
  57. YETI.set_action("stand-right");
  58. wait(0.3);
  59. YETI.set_action("stomp-right");
  60. play_sound("sounds/yeti_gna.wav");
  61. YETI.set_velocity(0, -300);
  62. wait(0.4);
  63. YETI.set_action("stand-right");
  64. wait(0.3);
  65. YETI.set_action("walking-right");
  66. YETI.set_velocity(225, 0);
  67. wait(0.1);
  68. Camera.scroll_to(480, 128, 0.2);
  69. Tux.do_jump(-250);
  70. wait(0.5);
  71. Tux.set_dir(true);
  72. Tux.walk(300);
  73. wait(1.3);
  74. Effect.fade_out(1);
  75. wait(0.5);
  76. play_sound("sounds/door.wav");
  77. DOOR.set_action("opening");
  78. wait(1);
  79. Level.spawn("balcony", "door");
  80. }
  81. function outdoor()
  82. {
  83. Effect.sixteen_to_nine(0);
  84. YETI.set_action("stand-right");
  85. Tux.deactivate();
  86. DOOR.set_action("open");
  87. Effect.fade_in(1);
  88. wait(0.5);
  89. DOOR.set_action("closing");
  90. Tux.walk(250);
  91. wait(0.6);
  92. DOOR.set_action("closed");
  93. wait(0.5);
  94. Tux.do_jump(-500);
  95. wait(1.3);
  96. DOOR.set_action("opening");
  97. play_sound("sounds/door.wav");
  98. wait(0.6);
  99. DOOR.set_action("open");
  100. YETI.set_pos(192, 288);
  101. YETI.set_visible(true);
  102. wait(0.5);
  103. YETI.set_action("stomp-right");
  104. play_sound("sounds/yeti_gna.wav");
  105. YETI.set_velocity(0, -300);
  106. wait(0.5);
  107. Tux.walk(0);
  108. YETI.set_action("stand-right");
  109. wait(0.5);
  110. YETI.set_action("walking-right");
  111. YETI.set_velocity(250, 0);
  112. wait(1);
  113. YETI.set_action("jump-right");
  114. play_sound("sounds/yeti_roar.wav");
  115. YETI.set_velocity(300, -450);
  116. wait(2);
  117. Effect.fade_out(2);
  118. wait(2);
  119. Level.finish(true);
  120. }
  121. state_idx <- 0;
  122. states <- { init=0, start=1, outdoor=2};
  123. function trigger_state(state) {
  124. local idx = states[state];
  125. if(!idx || idx <= state_idx)
  126. return;
  127. state_idx = idx;
  128. switch(state) {
  129. case "start":
  130. initialize();
  131. break;
  132. case "outdoor":
  133. outdoor();
  134. break;
  135. }
  136. }