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 **********************************************************************************/
19 final void scrLevGenCreateChest (int mapx, int mapy) {
20 writeln("generating chest...");
21 auto obj = ItemChest(MakeMapObject(mapx, mapy, 'oChest'));
26 final void scrLevGenCreateCrate (int mapx, int mapy) {
27 writeln("generating crate...");
28 auto obj = ItemCrate(MakeMapObject(mapx, mapy, 'oCrate'));
33 final name scrGenSpikeType () {
34 if (global.config.woodSpikes) {
35 if (global.config.optSpikeVariations) {
36 if (global.randRoom(0, 100) >= 76) return 'oSpikes';
40 if (global.config.optSpikeVariations) {
41 if (global.randRoom(0, 100) >= 76) return 'oSpikesWood';
47 final name scrGenGetSnakeType () {
48 if (global.config.optEnemyVariations && global.currLevel > 1) {
49 int totdeath789 = stats.getDeathCountOnLevel(7)+stats.getDeathCountOnLevel(8)+stats.getDeathCountOnLevel(9);
50 if (totdeath789 < 12) {
51 if (global.randRoom(0, 100) >= 99-(global.currLevel-2)*8) return 'oCobra';
54 if (totdeath789 < 22) {
55 if (global.randRoom(0, 100) >= 85-(global.currLevel-2)*8) return 'oCobra';
58 if (totdeath789 < 32) {
59 if (global.randRoom(0, 100) >= 75-(global.currLevel-2)*8) return 'oCobra';
62 if (totdeath789 < 42) {
63 if (global.randRoom(0, 100) >= 65-(global.currLevel-2)*8) return 'oCobra';
66 if (totdeath789 < 52) {
67 if (global.randRoom(0, 100) >= 55-(global.currLevel-2)*8) return 'oCobra';
70 if (global.randRoom(0, 100) >= 42-(global.currLevel-2)*8) return 'oCobra';
76 final name scrGenGetSpiderType () {
77 if (global.config.optEnemyVariations && global.currLevel > 1) {
78 int totdeath789 = stats.getDeathCountOnLevel(7)+stats.getDeathCountOnLevel(8)+stats.getDeathCountOnLevel(9);
79 if (totdeath789 < 22) {
80 if (global.randRoom(0, 100) >= 99-(global.currLevel-2)*8) return 'oGreenSpiderHang';
83 if (totdeath789 < 32) {
84 if (global.randRoom(0, 100) >= 85-(global.currLevel-2)*8) return 'oGreenSpiderHang';
87 if (totdeath789 < 42) {
88 if (global.randRoom(0, 100) >= 75-(global.currLevel-2)*8) return 'oGreenSpiderHang';
91 if (totdeath789 < 52) {
92 if (global.randRoom(0, 100) >= 65-(global.currLevel-2)*8) return 'oGreenSpiderHang';
95 if (totdeath789 < 62) {
96 if (global.randRoom(0, 100) >= 55-(global.currLevel-2)*8) return 'oGreenSpiderHang';
99 if (global.randRoom(0, 100) >= 50-(global.currLevel-2)*8) return 'oGreenSpiderHang';
101 return 'oSpiderHang';