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