View difference between Paste ID: sz4Twyry and iU8Wk1d5
SHOW: | | - or go back to the newest paste.
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..bf6fd49 100644
17+
index eeb003b..63503a3 100644
18
--- a/js/calendar.js
19
+++ b/js/calendar.js
20-
@@ -446,7 +446,12 @@ dojo.declare("com.nuclearunicorn.game.Calendar", null, {
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.challenges.currentChallenge == "blackSky") {
26+
27-
+                eventChance = 0
27+
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
 					this.observeHandler();
41
-				} else {
42
+                }  else {
43
 					this.observeClear();
44
 					this.game.msg($I("calendar.msg.event"), "", "astronomicalEvent");
45
 					var node = dojo.byId("observeButton");
46
@@ -818,7 +823,13 @@ dojo.declare("com.nuclearunicorn.game.Calendar", null, {
47
 		}
48
 
49
 		var pyramidVal = this.game.religion.getZU("blackPyramid").val;
50
-		var markerVal = this.game.religion.getZU("marker").val;
51
+        var markerVal = this.game.religion.getZU("marker").val;
52
+
53
+        if (this.game.challenges.getChallenge("blackSky").researched) {
54
+            pyramidVal += 1
55
+            markerVal *= 1.1
56
+        }
57
+
58
 		if ( pyramidVal > 0 ){
59
 			if (this.game.rand(1000) < 35 * pyramidVal * (1 + 0.1 * markerVal)){   //3.5% per year per BP, x10% per marker
60
 				this.game.diplomacy.unlockElders();
61
diff --git a/js/challenges.js b/js/challenges.js
62
index 2c66b92..89bb9e7 100644
63
--- a/js/challenges.js
64
+++ b/js/challenges.js
65
@@ -51,7 +51,14 @@ dojo.declare("classes.managers.ChallengesManager", com.nuclearunicorn.core.TabMa
66
 		effectDesc: $I("challendge.1000Years.effect.desc"),
67
         researched: false,
68
         unlocked: false
69
-	}],
70
+	},{
71
+		name: "blackSky",
72
+		label: "Black Sky",
73
+		description: "Restart the game with no astronomical events to observe.<br/><br/>Goal: build one Space Beacon.",
74
+		effectDesc: "elders comes early",
75
+        researched: false,
76
+        unlocked: false
77
+    }],
78
 
79
 	game: null,
80
 
81
@@ -106,8 +113,12 @@ dojo.declare("classes.managers.ChallengesManager", com.nuclearunicorn.core.TabMa
82
 			if (this.game.bld.get("aiCore").val > 0){
83
 				this.researchChallenge("anarchy");
84
 			}
85
+		} else if (this.currentChallenge == "blackSky") {
86
+			if (this.game.space.getBuilding('spaceBeacon').val > 0){
87
+				this.researchChallenge("blackSky");
88
+			}
89
+        }
90
 
91
-		}
92
 		// winterIsComing
93
 		if (this.currentChallenge == "winterIsComing") {
94
 			if (this.game.space.getPlanet("helios").reached){
95
diff --git a/js/diplomacy.js b/js/diplomacy.js
96
index bd74954..24278e7 100644
97
--- a/js/diplomacy.js
98
+++ b/js/diplomacy.js
99
@@ -326,6 +326,10 @@ dojo.declare("classes.managers.DiplomacyManager", null, {
100
 
101
     onNewDay: function(){
102
         var elders = this.get("leviathans");
103
+        if (elders.unlocked) {
104
+            this.game.challenges.getChallenge("blackSky").unlocked = true;
105
+        }
106
+
107
         if (elders.duration <= 0  && elders.unlocked){
108
 			elders.unlocked = false;
109
 			this.game.msg($I("trade.msg.elders.departed"), "notice");
110
diff --git a/js/space.js b/js/space.js
111
index cee2816..508fe82 100644
112
--- a/js/space.js
113
+++ b/js/space.js
114
@@ -1152,6 +1152,13 @@ dojo.declare("com.nuclearunicorn.game.ui.SpaceProgramBtnController", com.nuclear
115
                 var reductionRatio = this.game.getHyperbolicEffect(this.game.getEffect("oilReductionRatio"), 0.75);
116
                 prices[i].val *= (1 - reductionRatio);
117
             }
118
+
119
+            if (this.game.challenges.currentChallenge == "blackSky"
120
+                && model.metadata.name == "orbitalLaunch"
121
+                && prices[i].name == "starchart") {
122
+                prices[i].val = 0
123
+            }
124
+
125
         }
126
 
127
         return prices;
128
@@ -1232,6 +1239,13 @@ dojo.declare("classes.ui.space.PlanetBuildingBtnController", com.nuclearunicorn.
129
                 var reductionRatio = this.game.getHyperbolicEffect(this.game.getEffect("oilReductionRatio"), 0.75);
130
                 prices[i].val *= (1 - reductionRatio);
131
              }
132
+
133
+            if (this.game.challenges.currentChallenge == "blackSky"
134
+                && meta.name == "sattelite"
135
+                && meta.val == 0
136
+                && prices[i].name == "starchart") {
137
+                prices[i].val = 0
138
+            }
139
         }
140
 
141
         return prices;