
- Various aesthetics fixes (no more buttons cut in half, justified some buttons, etc) - Clicking the help icon next to the (unused) job button now correctly displays help. - Redid the implementation of the (new) "check statistic node" (replaces "has enough mage lore") to prevent potential compatibility breaking with legacy scenarios. - Small change to the (new) "Set town status" (replaces "Make Town Hostile") for the same reason. - To clarify, renamed the "Dispel spirit" item ability to "Ravage spirit" (as it is, in fact, the spell called by the ability). - For the same reason, renamed the monster spell "Heal All" to "Full Heal", as it isn't a mass spell but a powerful (and reliable) self-healing spell for monsters. - Aligned the sleep immunity on the mac version : Slimes (regardless of the monster number), Stone and Undead types monsters are immuned to sleep. - Dart throwing now only takes 2 ap for monsters (corrected from invisibility ability). - Field generating monsters are now immuned to the type of field they generate (corrected from an Exile 3 incomplete transition). - Rewrote the pending special queue for better events handling (no more potential overflow, entering/exiting town events are now sure to happens) - Implemented the "No Terrain Animation" option. - Un/Equipping something while in combat now correctly updates the ap display. - MOnsters missile abilities now show their correct damage range in description (game and editor). - Bashing weapons charges (if any) are now correctly shown (as usual, next to the name). Codewise : - The game shouldn't check if the item to be equipped is food anymore. - Replaced lots of number checks by "human-readable" constants (some new). - Removed some false checks about awaken spell supposed to work as dispel field. - Fleeing and winning an outdoor battle now call the run_special function with the correct parameter (was reversed, with no consequences, since it's never checked) - AI doesn't check the monster number, when deciding if the monster should cast a mage spell, anymore. Chokboyz git-svn-id: http://openexile.googlecode.com/svn/trunk@159 4ebdad44-0ea0-11de-aab3-ff745001d230
131 lines
2.2 KiB
C++
131 lines
2.2 KiB
C++
#include <cstdlib>
|
|
#include "global.h"
|
|
#include <cmath>
|
|
#include "globvar.h"
|
|
#include "tools/mathutil.h"
|
|
|
|
RECT RECT16::rect32()
|
|
{
|
|
RECT tmp;
|
|
tmp.left = left;
|
|
tmp.top = top;
|
|
tmp.right = right;
|
|
tmp.bottom = bottom;
|
|
return tmp;
|
|
}
|
|
|
|
RECT16::RECT16 (const RECT & tmp)
|
|
{
|
|
left = tmp.left;
|
|
top = tmp.top;
|
|
right = tmp.right;
|
|
bottom = tmp.bottom;
|
|
}
|
|
|
|
RECT16 & RECT16::operator=(const RECT & tmp)
|
|
{
|
|
left = tmp.left;
|
|
top = tmp.top;
|
|
right = tmp.right;
|
|
bottom = tmp.bottom;
|
|
return (*this);
|
|
}
|
|
|
|
POINT MAKEPOINT(LONG lParam)
|
|
{
|
|
POINT point;
|
|
|
|
point.x = LOWORD(lParam);
|
|
point.y = HIWORD(lParam);
|
|
|
|
return point;
|
|
}
|
|
|
|
void DebugQuit(char * msg)
|
|
{
|
|
MessageBox(0, msg, "DebugQuit", MB_OK);
|
|
PostQuitMessage(EXIT_FAILURE);
|
|
PostQuitMessage(EXIT_FAILURE);
|
|
PostQuitMessage(EXIT_FAILURE);
|
|
}
|
|
|
|
void alter_rect(RECT *r)
|
|
{
|
|
long a;
|
|
|
|
a = r->top;
|
|
r->top = r->left;
|
|
r->left = a;
|
|
a = r->bottom;
|
|
r->bottom = r->right;
|
|
r->right = a;
|
|
}
|
|
|
|
void alter_rect(RECT16 *r)
|
|
{
|
|
short a;
|
|
|
|
a = r->top;
|
|
r->top = r->left;
|
|
r->left = a;
|
|
a = r->bottom;
|
|
r->bottom = r->right;
|
|
r->right = a;
|
|
}
|
|
|
|
/*short get_ran (short times, short min, short max) => already defined in mathutil.cpp
|
|
{
|
|
short store;
|
|
short i, to_ret = 0;
|
|
|
|
if ((max - min + 1) == 0)
|
|
return 0;
|
|
|
|
for (i = 1; i < times + 1; i++)
|
|
{
|
|
store = rand() % (max - min + 1);
|
|
to_ret = to_ret + min + store;
|
|
}
|
|
return to_ret;
|
|
}*/
|
|
|
|
Boolean same_point(location p1,location p2)
|
|
{
|
|
if ((p1.x == p2.x) && (p1.y == p2.y))
|
|
return true;
|
|
else return false;
|
|
}
|
|
|
|
/*short s_pow(short x,short y) => already defined in mathutil.cpp
|
|
{
|
|
if (y == 0)
|
|
return 1;
|
|
return (short) pow((double) x, (double) y);
|
|
}*/
|
|
|
|
void Delay(short val, long *)
|
|
{
|
|
long then,now,wait_val;
|
|
|
|
wait_val = (long) val;
|
|
wait_val = wait_val * 16;
|
|
then = (long)GetCurrentTime();
|
|
now = then;
|
|
while (now - then < wait_val) {
|
|
now = (long) GetCurrentTime();
|
|
}
|
|
}
|
|
|
|
void pause(short length)
|
|
{
|
|
if (give_delays == 0) Delay(length, NULL);
|
|
}
|
|
|
|
// stuff done legit, i.e. flags are within proper ranges for stuff done flag
|
|
Boolean sd_legit(short a, short b)
|
|
{
|
|
if ((minmax(0,299,(int)a) == a) && (minmax(0,9,(int)b) == b))
|
|
return true;
|
|
return false;
|
|
}
|