Browse Source

Theme_ArmorStand bin exact

pull/25/head
Robin Eklind 8 years ago
parent
commit
5236c196df
  1. 1
      Source/objects.cpp
  2. 53
      Source/themes.cpp
  3. 2
      Source/themes.h

1
Source/objects.cpp

@ -1883,7 +1883,6 @@ void __fastcall AddArmorStand(int i)
} }
object[i]._oRndSeed = GetRndSeed(); object[i]._oRndSeed = GetRndSeed();
} }
// 6AAA3C: using guessed type int armorFlag;
void __fastcall AddDecap(int i) void __fastcall AddDecap(int i)
{ {

53
Source/themes.cpp

@ -3,7 +3,7 @@
#include "../types.h" #include "../types.h"
int numthemes; // idb int numthemes; // idb
bool armorFlag; // weak BOOL armorFlag;
int ThemeGoodIn[4]; int ThemeGoodIn[4];
BOOL weaponFlag; BOOL weaponFlag;
bool treasureFlag; // weak bool treasureFlag; // weak
@ -505,7 +505,7 @@ void __cdecl InitThemes()
v0 = 0; v0 = 0;
bCrossFlag = FALSE; bCrossFlag = FALSE;
numthemes = 0; numthemes = 0;
armorFlag = 1; armorFlag = TRUE;
bFountainFlag = 1; bFountainFlag = 1;
cauldronFlag = 1; cauldronFlag = 1;
mFountainFlag = 1; mFountainFlag = 1;
@ -584,7 +584,6 @@ void __cdecl InitThemes()
} }
} }
} }
// 6AAA3C: using guessed type int armorFlag;
// 6AAA54: using guessed type int treasureFlag; // 6AAA54: using guessed type int treasureFlag;
// 6AAA58: using guessed type int mFountainFlag; // 6AAA58: using guessed type int mFountainFlag;
// 6AAA5C: using guessed type int cauldronFlag; // 6AAA5C: using guessed type int cauldronFlag;
@ -1015,20 +1014,17 @@ void __fastcall Theme_PurifyingFountain(int t)
PlaceThemeMonsts(t, monstrnd[leveltype - 1]); PlaceThemeMonsts(t, monstrnd[leveltype - 1]);
} }
// Theme_ArmorStand initializes the armor stand theme.
//
// Parameters:
// - t: theme number (index into themes array).
void __fastcall Theme_ArmorStand(int t) void __fastcall Theme_ArmorStand(int t)
{ {
int v1; // esi int xp;
int v2; // ebx int yp;
char *v3; // edi char armorrnd[4];
//int v4; // eax char monstrnd[4];
int ta; // [esp+Ch] [ebp-14h]
int *v7; // [esp+10h] [ebp-10h]
char monstrnd[4]; // [esp+14h] [ebp-Ch]
int *v9; // [esp+18h] [ebp-8h]
char armorrnd[4]; // [esp+1Ch] [ebp-4h]
v1 = 0;
ta = t;
armorrnd[0] = 6; armorrnd[0] = 6;
armorrnd[1] = 8; armorrnd[1] = 8;
armorrnd[2] = 3; armorrnd[2] = 3;
@ -1041,30 +1037,19 @@ void __fastcall Theme_ArmorStand(int t)
TFit_Obj3(t); TFit_Obj3(t);
AddObject(OBJ_ARMORSTAND, themex, themey); AddObject(OBJ_ARMORSTAND, themex, themey);
} }
v9 = (int *)dPiece; for (yp = 0; yp < 112; yp++) {
do { for (xp = 0; xp < 112; xp++) {
v2 = 0; if (dung_map[xp][yp] == themes[t].ttval && !nSolidTable[dPiece[xp][yp]]) {
v3 = (char *)dung_map + v1; if (CheckThemeObj3(xp, yp, t, -1)) {
v7 = v9;
do {
if (*v3 == themes[ta].ttval && !nSolidTable[*v7]) {
//LOBYTE(v4) = CheckThemeObj3(v2, v1, ta, -1);
if (CheckThemeObj3(v2, v1, ta, -1)) {
if (!random(0, armorrnd[leveltype - 1])) if (!random(0, armorrnd[leveltype - 1]))
AddObject(OBJ_ARMORSTANDN, v2, v1); AddObject(OBJ_ARMORSTANDN, xp, yp);
} }
} }
v7 += 112; }
++v2; }
v3 += 112; PlaceThemeMonsts(t, monstrnd[leveltype - 1]);
} while (v2 < 112); armorFlag = FALSE;
++v9;
++v1;
} while ((signed int)v9 < (signed int)dPiece[1]);
PlaceThemeMonsts(ta, monstrnd[leveltype - 1]);
armorFlag = 0;
} }
// 6AAA3C: using guessed type int armorFlag;
// Theme_GoatShrine initializes the goat shrine theme. // Theme_GoatShrine initializes the goat shrine theme.
// //

2
Source/themes.h

@ -3,7 +3,7 @@
#define __THEMES_H__ #define __THEMES_H__
extern int numthemes; // idb extern int numthemes; // idb
extern bool armorFlag; // weak extern BOOL armorFlag;
extern int ThemeGoodIn[4]; extern int ThemeGoodIn[4];
extern BOOL weaponFlag; extern BOOL weaponFlag;
extern bool treasureFlag; // weak extern bool treasureFlag; // weak

Loading…
Cancel
Save