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 **********************************************************************************/
18 final void scrLevGenCreateChest (int mapx, int mapy) {
19 writeln("generating chest...");
20 auto obj = ItemChest(MakeMapObject(mapx, mapy, 'oChest'));
25 final void scrLevGenCreateCrate (int mapx, int mapy) {
26 writeln("generating crate...");
27 auto obj = ItemCrate(MakeMapObject(mapx, mapy, 'oCrate'));
32 final name scrGenSpikeType () {
33 if (global.config.woodSpikes) {
34 if (global.config.optSpikeVariations) {
35 if (global.randRoom(0, 100) >= 76) return 'oSpikes';
39 if (global.config.optSpikeVariations) {
40 if (global.randRoom(0, 100) >= 76) return 'oSpikesWood';
46 final name scrGenGetSnakeType () {
47 if (global.config.optEnemyVariations && global.currLevel > 1) {
48 int totdeath789 = stats.getDeathCountOnLevel(7)+stats.getDeathCountOnLevel(8)+stats.getDeathCountOnLevel(9);
49 if (totdeath789 < 12) {
50 if (global.randRoom(0, 100) >= 99-(global.currLevel-2)*8) return 'oCobra';
53 if (totdeath789 < 22) {
54 if (global.randRoom(0, 100) >= 85-(global.currLevel-2)*8) return 'oCobra';
57 if (totdeath789 < 32) {
58 if (global.randRoom(0, 100) >= 75-(global.currLevel-2)*8) return 'oCobra';
61 if (totdeath789 < 42) {
62 if (global.randRoom(0, 100) >= 65-(global.currLevel-2)*8) return 'oCobra';
65 if (totdeath789 < 52) {
66 if (global.randRoom(0, 100) >= 55-(global.currLevel-2)*8) return 'oCobra';
69 if (global.randRoom(0, 100) >= 42-(global.currLevel-2)*8) return 'oCobra';
75 final name scrGenGetSpiderType () {
76 if (global.config.optEnemyVariations && global.currLevel > 1) {
77 int totdeath789 = stats.getDeathCountOnLevel(7)+stats.getDeathCountOnLevel(8)+stats.getDeathCountOnLevel(9);
78 if (totdeath789 < 22) {
79 if (global.randRoom(0, 100) >= 99-(global.currLevel-2)*8) return 'oGreenSpiderHang';
82 if (totdeath789 < 32) {
83 if (global.randRoom(0, 100) >= 85-(global.currLevel-2)*8) return 'oGreenSpiderHang';
86 if (totdeath789 < 42) {
87 if (global.randRoom(0, 100) >= 75-(global.currLevel-2)*8) return 'oGreenSpiderHang';
90 if (totdeath789 < 52) {
91 if (global.randRoom(0, 100) >= 65-(global.currLevel-2)*8) return 'oGreenSpiderHang';
94 if (totdeath789 < 62) {
95 if (global.randRoom(0, 100) >= 55-(global.currLevel-2)*8) return 'oGreenSpiderHang';
98 if (global.randRoom(0, 100) >= 50-(global.currLevel-2)*8) return 'oGreenSpiderHang';
100 return 'oSpiderHang';