Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/game.js b/game.js
  2. index c40cb33..6e197ec 100644
  3. --- a/game.js
  4. +++ b/game.js
  5. @@ -3426,6 +3426,10 @@ dojo.declare("com.nuclearunicorn.game.ui.GamePage", null, {
  6.             "paragon": paragonPoints
  7.         };
  8.  
  9. +        if (this.challenges.currentChallenge == "blackSky") {
  10. +            addRes["ship"] = 1
  11. +        }
  12. +
  13.         var karmaZebras = parseInt(this.karmaZebras);   //hack
  14.         //that's all folks
  15.  
  16. diff --git a/js/calendar.js b/js/calendar.js
  17. index eeb003b..4413f51 100644
  18. --- a/js/calendar.js
  19. +++ b/js/calendar.js
  20. @@ -446,7 +446,8 @@ dojo.declare("com.nuclearunicorn.game.Calendar", null, {
  21.         //------------------------- astronomical events -------------------------
  22.         if (this.game.bld.get("library").on > 0) {
  23.             var eventChance = (0.0025 + this.game.getEffect("starEventChance")) * chanceRatio;
  24. -           if (this.game.prestige.getPerk("astromancy").researched) {
  25. +
  26. +            if (this.game.prestige.getPerk("astromancy").researched) {
  27.                 eventChance *= 2;
  28.             }
  29.  
  30. @@ -455,10 +456,14 @@ dojo.declare("com.nuclearunicorn.game.Calendar", null, {
  31.                     this.observeTimeout();
  32.                 }
  33.  
  34. +
  35. +                if (this.game.challenges.currentChallenge == "blackSky") {
  36. +                    this.game.msg("The night is dark, no stars to observe.", "astronomicalEvent");
  37. +
  38.                 //---------------- SETI hack-------------------
  39. -               if (this.game.workshop.get("seti").researched) {
  40. +                } else if (this.game.workshop.get("seti").researched) {
  41.                     this.observeHandler();
  42. -               } else {
  43. +                }  else {
  44.                     this.observeClear();
  45.                     this.game.msg($I("calendar.msg.event"), "", "astronomicalEvent");
  46.                     var node = dojo.byId("observeButton");
  47. @@ -818,7 +823,13 @@ dojo.declare("com.nuclearunicorn.game.Calendar", null, {
  48.         }
  49.  
  50.         var pyramidVal = this.game.religion.getZU("blackPyramid").val;
  51. -       var markerVal = this.game.religion.getZU("marker").val;
  52. +        var markerVal = this.game.religion.getZU("marker").val;
  53. +
  54. +        if (this.game.challenges.getChallenge("blackSky").researched) {
  55. +            pyramidVal += 1
  56. +            markerVal *= 1.1
  57. +        }
  58. +
  59.         if ( pyramidVal > 0 ){
  60.             if (this.game.rand(1000) < 35 * pyramidVal * (1 + 0.1 * markerVal)){   //3.5% per year per BP, x10% per marker
  61.                 this.game.diplomacy.unlockElders();
  62. diff --git a/js/challenges.js b/js/challenges.js
  63. index 2c66b92..89bb9e7 100644
  64. --- a/js/challenges.js
  65. +++ b/js/challenges.js
  66. @@ -51,7 +51,14 @@ dojo.declare("classes.managers.ChallengesManager", com.nuclearunicorn.core.TabMa
  67.         effectDesc: $I("challendge.1000Years.effect.desc"),
  68.          researched: false,
  69.          unlocked: false
  70. -   }],
  71. +   },{
  72. +       name: "blackSky",
  73. +       label: "Black Sky",
  74. +       description: "Restart the game with no astronomical events to observe.<br/><br/>Goal: build one Space Beacon.",
  75. +       effectDesc: "elders comes early",
  76. +        researched: false,
  77. +        unlocked: false
  78. +    }],
  79.  
  80.     game: null,
  81.  
  82. @@ -106,8 +113,12 @@ dojo.declare("classes.managers.ChallengesManager", com.nuclearunicorn.core.TabMa
  83.             if (this.game.bld.get("aiCore").val > 0){
  84.                 this.researchChallenge("anarchy");
  85.             }
  86. +       } else if (this.currentChallenge == "blackSky") {
  87. +           if (this.game.space.getBuilding('spaceBeacon').val > 0){
  88. +               this.researchChallenge("blackSky");
  89. +           }
  90. +        }
  91.  
  92. -       }
  93.         // winterIsComing
  94.         if (this.currentChallenge == "winterIsComing") {
  95.             if (this.game.space.getPlanet("helios").reached){
  96. diff --git a/js/diplomacy.js b/js/diplomacy.js
  97. index bd74954..24278e7 100644
  98. --- a/js/diplomacy.js
  99. +++ b/js/diplomacy.js
  100. @@ -326,6 +326,10 @@ dojo.declare("classes.managers.DiplomacyManager", null, {
  101.  
  102.      onNewDay: function(){
  103.          var elders = this.get("leviathans");
  104. +        if (elders.unlocked) {
  105. +            this.game.challenges.getChallenge("blackSky").unlocked = true;
  106. +        }
  107. +
  108.          if (elders.duration <= 0  && elders.unlocked){
  109.             elders.unlocked = false;
  110.             this.game.msg($I("trade.msg.elders.departed"), "notice");
  111. diff --git a/js/space.js b/js/space.js
  112. index cee2816..9dce189 100644
  113. --- a/js/space.js
  114. +++ b/js/space.js
  115. @@ -498,10 +498,14 @@ dojo.declare("classes.managers.SpaceManager", com.nuclearunicorn.core.TabManager
  116.                 "scienceMax": 0
  117.             },
  118.              calculateEffects: function(self, game){
  119. -               self.effects = {
  120. +                self.effects = {
  121.                     "starchartPerTickBaseSpace": 0.01,
  122.                     "scienceMax": 10000 * (1 + game.getEffect("spaceScienceRatio"))
  123.                 };
  124. +
  125. +                if (game.challenges.currentChallenge == "blackSky") {
  126. +                    self.effects.starchartPerTickBaseSpace = 0
  127. +                }
  128.              }
  129.          },{
  130.              name: "orbitalArray",
  131. @@ -1152,6 +1156,13 @@ dojo.declare("com.nuclearunicorn.game.ui.SpaceProgramBtnController", com.nuclear
  132.                  var reductionRatio = this.game.getHyperbolicEffect(this.game.getEffect("oilReductionRatio"), 0.75);
  133.                  prices[i].val *= (1 - reductionRatio);
  134.              }
  135. +
  136. +            if (this.game.challenges.currentChallenge == "blackSky"
  137. +                && model.metadata.name == "orbitalLaunch"
  138. +                && prices[i].name == "starchart") {
  139. +                prices[i].val = 0
  140. +            }
  141. +
  142.          }
  143.  
  144.          return prices;
  145. @@ -1232,6 +1243,13 @@ dojo.declare("classes.ui.space.PlanetBuildingBtnController", com.nuclearunicorn.
  146.                  var reductionRatio = this.game.getHyperbolicEffect(this.game.getEffect("oilReductionRatio"), 0.75);
  147.                  prices[i].val *= (1 - reductionRatio);
  148.               }
  149. +
  150. +            if (this.game.challenges.currentChallenge == "blackSky"
  151. +                && meta.name == "sattelite"
  152. +                && meta.val == 0
  153. +                && prices[i].name == "starchart") {
  154. +                prices[i].val = 0
  155. +            }
  156.          }
  157.  
  158.          return prices;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement