1 /**********************************************************************************
2 * Copyright (c) 2008, 2009 Derek Yu and Mossmouth, LLC
3 * Copyright (c) 2010, Moloch
4 * Copyright (c) 2018, Ketmar Dark
6 * This file is part of Spelunky.
8 * You can redistribute and/or modify Spelunky, including its source code, under
9 * the terms of the Spelunky User License.
11 * Spelunky is distributed in the hope that it will be entertaining and useful,
12 * but WITHOUT WARRANTY. Please see the Spelunky User License for more details.
14 * The Spelunky User License should be available in "Game Information", which
15 * can be found in the Resource Explorer, or as an external file called COPYING.
16 * If not, please obtain a new copy of Spelunky from <http://spelunkyworld.com/>
18 **********************************************************************************/
20 int starsRoomTimer0 = -1; //100;
21 int starsRoomTimer1 = 30*3;
22 int starsRoomTimer10 = 100; // music
23 int starsRoomTimer11 = 110;
26 void thinkFrameGameStars () {
28 if (starsRoomTimer1 > 0) {
29 if (--starsRoomTimer1 == 0) starsRoomTimer0 = 10;
33 if (starsRoomTimer10 > 0) {
34 if (--starsRoomTimer10 == 0) {
36 lg.musicName = 'musCave';
37 if (lg.musicName) global.playMusic(lg.musicName); else global.stopMusic();
42 if (starsRoomTimer0 > 0) {
43 if (--starsRoomTimer0 == 0) {
44 starsRoomTimer0 = 200;
46 auto n = global.randOther(0, 3);
47 MakeMapObject(32+n*80, 0, 'oShopkeeper');
48 if (starsKills >= 40) starsRoomTimer0 = 100;
49 else if (starsKills >= 30) starsRoomTimer0 = 125;
50 else if (starsKills >= 20) starsRoomTimer0 = 150;
51 else if (starsKills >= 10) starsRoomTimer0 = 175;
52 else starsRoomTimer0 = 200;
57 if (starsRoomTimer11 > 0) {
58 if (--starsRoomTimer11 == 0) {
59 if (!player.dead && global.randOther(1, 100) < starsKills) {
60 auto n = global.randOther(0, 3);
61 MakeMapObject(32+n*80, 0, 'oSpider');
63 if (!player.dead) starsRoomTimer11 = 20;
69 void createStarsRoom () {
71 global.darkLevel = false;
72 levBGImgName = 'bgCave';
76 starsRoomTimer0 = default.starsRoomTimer0;
77 starsRoomTimer1 = default.starsRoomTimer1;
78 starsRoomTimer10 = default.starsRoomTimer10;
79 starsRoomTimer11 = default.starsRoomTimer11;
81 //MakeMapTile(1, 0, 'oGame');
82 //MakeMapTile(1, 1, 'oStarsRoom');
83 //MakeMapTile(0, 1, 'oBricks');
84 //MakeMapTileAtPix(40, 200, 'oPlayer1');
86 setRoomBounds(0, 0, 304, 240-16);
88 MakeMapTile(0, 0, 'oHardBlock');
89 MakeMapTile(1, 0, 'oBrick');
90 MakeMapTile(3, 0, 'oBrick');
91 MakeMapTile(4, 0, 'oBrick');
92 MakeMapTile(5, 0, 'oBrick');
93 MakeMapTile(6, 0, 'oBrick');
94 MakeMapTile(8, 0, 'oBrick');
95 MakeMapTile(9, 0, 'oBrick');
96 MakeMapTile(10, 0, 'oBrick');
97 MakeMapTile(11, 0, 'oBrick');
98 MakeMapTile(13, 0, 'oBrick');
99 MakeMapTile(14, 0, 'oBrick');
100 MakeMapTile(15, 0, 'oBrick');
101 MakeMapTile(16, 0, 'oBrick');
102 MakeMapTile(18, 0, 'oBrick');
103 MakeMapTile(19, 0, 'oHardBlock');
104 MakeMapTile(0, 1, 'oBrick');
105 MakeMapTile(1, 1, 'oBrick');
106 MakeMapTile(3, 1, 'oBrick');
107 MakeMapTile(4, 1, 'oBrick');
108 MakeMapTile(5, 1, 'oBrick');
109 MakeMapTile(6, 1, 'oBrick');
110 MakeMapTile(8, 1, 'oBrick');
111 MakeMapTile(9, 1, 'oBrick');
112 MakeMapTile(10, 1, 'oBrick');
113 MakeMapTile(11, 1, 'oBrick');
114 MakeMapTile(13, 1, 'oBrick');
115 MakeMapTile(14, 1, 'oBrick');
116 MakeMapTile(15, 1, 'oBrick');
117 MakeMapTile(16, 1, 'oBrick');
118 MakeMapTile(18, 1, 'oBrick');
119 MakeMapTile(19, 1, 'oHardBlock');
120 MakeMapTile(0, 2, 'oBrick');
121 MakeMapTile(1, 2, 'oBrick');
122 MakeMapTile(9, 2, 'oBrick');
123 MakeMapTile(10, 2, 'oBrick');
124 MakeMapTile(18, 2, 'oBrick');
125 MakeMapTile(19, 2, 'oHardBlock');
126 MakeMapTile(0, 3, 'oHardBlock');
127 MakeMapTile(1, 3, 'oBrick');
128 MakeMapTile(18, 3, 'oBrick');
129 MakeMapTile(19, 3, 'oHardBlock');
130 MakeMapTile(0, 4, 'oHardBlock');
131 MakeMapTile(1, 4, 'oBrick');
132 MakeMapTile(18, 4, 'oBrick');
133 MakeMapTile(19, 4, 'oHardBlock');
134 MakeMapTile(0, 5, 'oHardBlock');
135 MakeMapTile(1, 5, 'oBrick');
136 MakeMapTile(18, 5, 'oBrick');
137 MakeMapTile(19, 5, 'oHardBlock');
138 MakeMapTile(0, 6, 'oHardBlock');
139 MakeMapTile(1, 6, 'oBrick');
140 MakeMapTile(5, 6, 'oBrick');
141 MakeMapTile(6, 6, 'oBrick');
142 MakeMapObject(10*16, 6*16, 'oShotgun');
143 MakeMapTile(13, 6, 'oBrick');
144 MakeMapTile(14, 6, 'oBrick');
145 MakeMapTile(18, 6, 'oBrick');
146 MakeMapTile(19, 6, 'oHardBlock');
147 MakeMapTile(0, 7, 'oHardBlock');
148 MakeMapTile(1, 7, 'oBrick');
149 MakeMapTile(2, 7, 'oBrick');
150 MakeMapTile(9, 7, 'oBrick');
151 MakeMapTile(10, 7, 'oBrick');
152 MakeMapTile(17, 7, 'oBrick');
153 MakeMapTile(18, 7, 'oBrick');
154 MakeMapTile(19, 7, 'oHardBlock');
155 MakeMapTile(0, 8, 'oHardBlock');
156 MakeMapTile(1, 8, 'oBrick');
157 MakeMapTile(2, 8, 'oBrick');
158 MakeMapTile(9, 8, 'oBrick');
159 MakeMapTile(10, 8, 'oBrick');
160 MakeMapTile(17, 8, 'oBrick');
161 MakeMapTile(18, 8, 'oBrick');
162 MakeMapTile(19, 8, 'oHardBlock');
163 MakeMapTile(0, 9, 'oHardBlock');
164 MakeMapTile(1, 9, 'oBrick');
165 MakeMapTile(2, 9, 'oBrick');
166 MakeMapTile(3, 9, 'oBrick');
167 MakeMapTile(8, 9, 'oBrick');
168 MakeMapTile(9, 9, 'oBrick');
169 MakeMapTile(10, 9, 'oBrick');
170 MakeMapTile(11, 9, 'oBrick');
171 MakeMapTile(16, 9, 'oBrick');
172 MakeMapTile(17, 9, 'oBrick');
173 MakeMapTile(18, 9, 'oBrick');
174 MakeMapTile(19, 9, 'oHardBlock');
175 MakeMapTile(0, 10, 'oHardBlock');
176 MakeMapTile(1, 10, 'oBrick');
177 MakeMapTile(18, 10, 'oBrick');
178 MakeMapTile(19, 10, 'oHardBlock');
179 MakeMapTile(0, 11, 'oHardBlock');
180 MakeMapTile(1, 11, 'oBrick');
181 MakeMapTile(6, 11, 'oBrick');
182 MakeMapTile(13, 11, 'oBrick');
183 MakeMapTile(18, 11, 'oBrick');
184 MakeMapTile(19, 11, 'oHardBlock');
185 MakeMapTile(0, 12, 'oHardBlock');
186 MakeMapTile(1, 12, 'oBrick');
187 MakeMapTile(2, 12, 'oEntrance');
188 MakeMapTile(5, 12, 'oBrick');
189 MakeMapTile(6, 12, 'oBrick');
190 MakeMapTile(7, 12, 'oBrick');
191 MakeMapTile(12, 12, 'oBrick');
192 MakeMapTile(13, 12, 'oBrick');
193 MakeMapTile(14, 12, 'oBrick');
194 MakeMapTile(18, 12, 'oBrick');
195 MakeMapTile(19, 12, 'oHardBlock');
196 MakeMapTile(0, 13, 'oBrick');
197 MakeMapTile(1, 13, 'oBrick');
198 MakeMapTile(2, 13, 'oBrick');
199 MakeMapTile(3, 13, 'oBrick');
200 MakeMapTile(4, 13, 'oBrick');
201 MakeMapTile(5, 13, 'oBrick');
202 MakeMapTile(6, 13, 'oBrick');
203 MakeMapTile(7, 13, 'oBrick');
204 MakeMapTile(8, 13, 'oBrick');
205 MakeMapTile(9, 13, 'oBrick');
206 MakeMapTile(10, 13, 'oBrick');
207 MakeMapTile(11, 13, 'oBrick');
208 MakeMapTile(12, 13, 'oBrick');
209 MakeMapTile(13, 13, 'oBrick');
210 MakeMapTile(14, 13, 'oBrick');
211 MakeMapTile(15, 13, 'oBrick');
212 MakeMapTile(16, 13, 'oBrick');
213 MakeMapTile(17, 13, 'oBrick');
214 MakeMapTile(18, 13, 'oBrick');
215 MakeMapTile(19, 13, 'oBrick');
216 MakeMapTile(0, 14, 'oBrick');
217 MakeMapTile(1, 14, 'oBrick');
218 MakeMapTile(2, 14, 'oBrick');
219 MakeMapTile(3, 14, 'oBrick');
220 MakeMapTile(4, 14, 'oBrick');
221 MakeMapTile(5, 14, 'oBrick');
222 MakeMapTile(6, 14, 'oBrick');
223 MakeMapTile(7, 14, 'oBrick');
224 MakeMapTile(8, 14, 'oBrick');
225 MakeMapTile(9, 14, 'oBrick');
226 MakeMapTile(10, 14, 'oBrick');
227 MakeMapTile(11, 14, 'oBrick');
228 MakeMapTile(12, 14, 'oBrick');
229 MakeMapTile(13, 14, 'oBrick');
230 MakeMapTile(14, 14, 'oBrick');
231 MakeMapTile(15, 14, 'oBrick');
232 MakeMapTile(16, 14, 'oBrick');
233 MakeMapTile(17, 14, 'oBrick');
234 MakeMapTile(18, 14, 'oBrick');
235 MakeMapTile(19, 14, 'oBrick');
236 MakeMapTile(0, 15, 'oBrick');
237 MakeMapTile(1, 15, 'oBrick');
238 MakeMapTile(2, 15, 'oBrick');
239 MakeMapTile(3, 15, 'oBrick');
240 MakeMapTile(4, 15, 'oBrick');
241 MakeMapTile(5, 15, 'oBrick');
242 MakeMapTile(6, 15, 'oBrick');
243 MakeMapTile(7, 15, 'oBrick');
244 MakeMapTile(8, 15, 'oBrick');
245 MakeMapTile(9, 15, 'oBrick');
246 MakeMapTile(10, 15, 'oBrick');
247 MakeMapTile(11, 15, 'oBrick');
248 MakeMapTile(12, 15, 'oBrick');
249 MakeMapTile(13, 15, 'oBrick');
250 MakeMapTile(14, 15, 'oBrick');
251 MakeMapTile(15, 15, 'oBrick');
252 MakeMapTile(16, 15, 'oBrick');
253 MakeMapTile(17, 15, 'oBrick');
254 MakeMapTile(18, 15, 'oBrick');
255 MakeMapTile(19, 15, 'oBrick');
257 // to prevent the Tunnel Man from tearing up the whole level
258 forEachTile(delegate bool (MapTile t) {
259 if (t.objType == 'oBrick') {
260 if (t.ix <= 16 || t.ix >= 288 || t.iy <= 16 || t.iy >= 208) t.invincible = true;
265 spawnPlayerAt(40, 200);
266 player.dir = MapEntity::Dir.Right;