Browse Source

PlaceThemeMonsts bin exact.

pull/25/head
Robin Eklind 8 years ago
parent
commit
8ae9c03b46
  1. 34
      Source/themes.cpp

34
Source/themes.cpp

@ -670,38 +670,38 @@ void __cdecl HoldThemeRooms()
} }
} }
// PlaceThemeMonsts places theme monsters with the specified frequency.
//
// Parameters:
// - t: theme number (index into themes array).
// - f: frequency (1/f likelihood of adding monster).
void __fastcall PlaceThemeMonsts(int t, int f) void __fastcall PlaceThemeMonsts(int t, int f)
{ {
int numscattypes; // edx int xp;
int i; // ecx int yp;
int yp; // ebx int mtype;
int xp; // edi int scattertypes[111];
int scattertypes[111]; // [esp+Ch] [ebp-1D0h] int numscattypes;
int mtype; // [esp+1CCh] [ebp-10h] int i;
numscattypes = 0; numscattypes = 0;
for (i = 0; i < nummtypes; i++) {
if (nummtypes > 0) { if (Monsters[i].mPlaceFlags & 1) {
for (i = 0; i < nummtypes; i++) { scattertypes[numscattypes] = i;
if (Monsters[i].mPlaceFlags & 1) { numscattypes++;
scattertypes[numscattypes++] = i;
}
} }
} }
mtype = scattertypes[random(0, numscattypes)]; mtype = scattertypes[random(0, numscattypes)];
for (yp = 0; yp < 112; yp++) { for (yp = 0; yp < 112; yp++) {
for (xp = 0; xp < 112; xp++) { for (xp = 0; xp < 112; xp++) {
if (dung_map[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]] && !dItem[xp][yp] && !dObject[xp][yp]) { if (dung_map[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]] && dItem[xp][yp] == 0 && dObject[xp][yp] == 0) {
if (!random(0, f)) { if (random(0, f) == 0) {
AddMonster(xp, yp, random(0, 8), mtype, 1); AddMonster(xp, yp, random(0, 8), mtype, 1);
} }
} }
} }
} }
} }
// 45D0E1: using guessed type int var_1D0[111];
// Theme_Barrel initializes the barrel theme. // Theme_Barrel initializes the barrel theme.
// //

Loading…
Cancel
Save