code.nut 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*********************
  2. * *
  3. * Created by Hume *
  4. * *
  5. *********************/
  6. println("[DEBUG] levels/hume_rainbow_cave/code.nut loaded");
  7. println("[INFO] Created by Hume");
  8. this.code<-{a="_",b="_",c="_",d="_",e="_",f="_"}
  9. function vynuluj(){
  10. this.code.a<-"_";
  11. this.code.b<-"_";
  12. this.code.c<-"_";
  13. this.code.d<-"_";
  14. this.code.e<-"_";
  15. this.code.f<-"_";
  16. this.posledni<-"a";
  17. }
  18. vynuluj();
  19. Text.set_anchor_point(ANCHOR_TOP_LEFT);
  20. Text.set_pos(30,120);
  21. Text.set_text("Enter the code of bonus levels.")
  22. Text.fade_in(0.2);
  23. function pridej(cislo){
  24. if(this.posledni!="g"){
  25. this.code[this.posledni]<-cislo;
  26. this.kod<-this.code.a+this.code.b+this.code.c+this.code.d+this.code.e+this.code.f;
  27. Text.set_text(this.kod);
  28. if (this.posledni=="f"){
  29. this.posledni<-"g"
  30. if(this.kod=="567418"){
  31. Text.set_text(_("567418 - Bonus levels are unlocked!"));
  32. sector.Tux.trigger_sequence("fireworks");
  33. }else{
  34. if(this.kod=="489641"){
  35. Text.set_text(_("489641 - 1 coin bonus!"));
  36. sector.Tux.add_coins(1);
  37. vynuluj();
  38. }else{
  39. if(this.kod=="028976"){
  40. Text.set_text(_("028976 - 10 coins bonus!"));
  41. sector.Tux.add_coins(10);
  42. vynuluj();
  43. }else{
  44. if(this.kod=="360126"){
  45. Text.set_text(_("360126 - 50 coins bonus!"));
  46. sector.Tux.add_coins(50);
  47. vynuluj();
  48. }else{
  49. if(this.kod=="289221"){
  50. Text.set_text(_("289221 - 100 coins bonus!"));
  51. sector.Tux.add_coins(100);
  52. vynuluj();
  53. }else{
  54. if(this.kod=="265813"){
  55. Text.set_text(_("265813 - 500 coins bonus!"));
  56. sector.Tux.add_coins(100);
  57. sector.Tux.add_coins(100);
  58. sector.Tux.add_coins(100);
  59. sector.Tux.add_coins(100);
  60. sector.Tux.add_coins(100);
  61. vynuluj();
  62. }else{
  63. if(this.kod=="310412"){
  64. Text.set_text(_("310412 - Large Tux bonus!"));
  65. sector.Tux.add_bonus("grow")
  66. vynuluj();
  67. }else{
  68. if(this.kod=="598126"){
  69. Text.set_text(_("598126 - Fire Tux bonus!"));
  70. sector.Tux.add_bonus("fireflower")
  71. vynuluj();
  72. }else{
  73. if(this.kod=="860312"){
  74. Text.set_text(_("860312 - Ice Tux bonus!"));
  75. sector.Tux.add_bonus("iceflower")
  76. vynuluj();
  77. }else{
  78. Text.set_text("Wrong code!");
  79. vynuluj();
  80. }
  81. }
  82. }
  83. }
  84. }
  85. }
  86. }
  87. }
  88. }
  89. }else{
  90. if (this.posledni=="e"){
  91. this.posledni<-"f"
  92. }
  93. if (this.posledni=="d"){
  94. this.posledni<-"e"
  95. }
  96. if (this.posledni=="c"){
  97. this.posledni<-"d"
  98. }
  99. if (this.posledni=="b"){
  100. this.posledni<-"c"
  101. }
  102. if (this.posledni=="a"){
  103. this.posledni<-"b"
  104. }
  105. }
  106. }
  107. }