Classic Blades of Exile :

- 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
This commit is contained in:
Chokboyz
2010-11-26 21:27:18 +00:00
parent 8dcea3eddf
commit 821d7609a2
39 changed files with 5229 additions and 4908 deletions

View File

@@ -24,15 +24,15 @@ short vdist(location p1,location p2) {
Boolean adjacent(location p1,location p2)
{
if ((ex_abs((short) (p1.x - p2.x)) <= 1) && (ex_abs((short) (p1.y - p2.y)) <= 1))
return TRUE;
else return FALSE;
return true;
else return false;
}
Boolean point_onscreen(location center,location check)
{
if ((ex_abs((short) (center.x - check.x)) <=4) && (ex_abs((short) (center.y - check.y)) <= 4))
return TRUE;
else return FALSE;
return true;
else return false;
}
@@ -59,26 +59,26 @@ short set_direction (location old_pt, location new_pt)
Boolean loc_off_world(location p1)
{
if ((p1.x < 0) || (p1.x > town_size[town_type]) || (p1.y < 0) || (p1.y > town_size[town_type]))
return TRUE;
else return FALSE;
return true;
else return false;
}
Boolean loc_off_act_area(location p1)
{
if ((p1.x > c_town.town.in_town_rect.left) && (p1.x < c_town.town.in_town_rect.right) &&
(p1.y > c_town.town.in_town_rect.top) && (p1.y < c_town.town.in_town_rect.bottom))
return FALSE;
return TRUE;
return false;
return true;
}
location get_cur_loc()
{
switch (overall_mode) {
case MODE_OUTDOORS: case 35:
case MODE_OUTDOORS: case MODE_LOOK_OUTDOORS:
return party.p_loc;
break;
case MODE_TOWN: case 2: case 3: case 4: case 36:
case MODE_TOWN: case MODE_TALK_TOWN: case MODE_TOWN_TARGET: case MODE_USE: case MODE_LOOK_TOWN:
return c_town.p_loc;
break;
@@ -103,8 +103,8 @@ Boolean is_lava(short x,short y)////
{
unsigned char ter = coord_to_ter(x,y);
if (scenario.ter_types[ter].picture == 404)
return TRUE;
else return FALSE;
return true;
else return false;
}
@@ -116,12 +116,12 @@ short can_see(location p1,location p2,short mode)
short dx,dy,count,storage = 0;
if (is_combat()) { // Light check
if ((mode != 2) && (combat_pt_in_light(p2) == FALSE)) {
if ((mode != 2) && (combat_pt_in_light(p2) == false)) {
return 6;
}
}
else {
if ((mode != 2) && (pt_in_light(p1,p2) == FALSE)) {
if ((mode != 2) && (pt_in_light(p1,p2) == false)) {
return 6;
}
}
@@ -130,7 +130,7 @@ short can_see(location p1,location p2,short mode)
if (p1.x > p2.x) {
for (count = p2.x + 1; count < p1.x; count++) {
storage = storage + get_obscurity(count, p1.y);
if (((terrain_blocked[coord_to_ter(count,p1.y)] > 2) || (is_lava(count,p1.y) == TRUE)) && (mode == 1))
if (((terrain_blocked[coord_to_ter(count,p1.y)] > 2) || (is_lava(count,p1.y) == true)) && (mode == 1))
return 5;
}
}
@@ -138,7 +138,7 @@ short can_see(location p1,location p2,short mode)
for (count = p1.x + 1; count < p2.x; count++) {
storage = storage + get_obscurity(count, p1.y);
if (((terrain_blocked[coord_to_ter(count,p1.y)] > 2) || (is_lava(count,p1.y) == TRUE)) && (mode == 1))
if (((terrain_blocked[coord_to_ter(count,p1.y)] > 2) || (is_lava(count,p1.y) == true)) && (mode == 1))
return 5;
}
}
@@ -148,14 +148,14 @@ short can_see(location p1,location p2,short mode)
if (p1.y > p2.y) {
for (count = p1.y - 1; count > p2.y; count--) {
storage = storage + get_obscurity(p1.x, count);
if (((terrain_blocked[coord_to_ter(p1.x,count)] > 2) || (is_lava(p1.x,count) == TRUE)) && (mode == 1))
if (((terrain_blocked[coord_to_ter(p1.x,count)] > 2) || (is_lava(p1.x,count) == true)) && (mode == 1))
return 5;
}
}
else {
for (count = p1.y + 1; count < p2.y; count++) {
storage = storage + get_obscurity(p1.x, count);
if (((terrain_blocked[coord_to_ter(p1.x,count)] > 2) || (is_lava(p1.x,count) == TRUE)) && (mode == 1))
if (((terrain_blocked[coord_to_ter(p1.x,count)] > 2) || (is_lava(p1.x,count) == true)) && (mode == 1))
return 5;
}
}
@@ -169,7 +169,7 @@ short can_see(location p1,location p2,short mode)
for (count = 1; count < dy; count++) {
storage = storage + get_obscurity(p1.x + (count * dx) / dy, p1.y + count);
if ( ((terrain_blocked[coord_to_ter(p1.x + (count * dx) / dy,p1.y + count)] > 2) ||
(is_lava(p1.x + (count * dx) / dy,p1.y + count) == TRUE))
(is_lava(p1.x + (count * dx) / dy,p1.y + count) == true))
&& (mode == 1))
return 5;
}
@@ -178,7 +178,7 @@ short can_see(location p1,location p2,short mode)
for (count = -1; count > dy; count--) {
storage = storage + get_obscurity(p1.x + (count * dx) / dy, p1.y + count);
if ( ((terrain_blocked[coord_to_ter(p1.x + (count * dx) / dy, p1.y + count)] > 2) ||
(is_lava(p1.x + (count * dx) / dy, p1.y + count) == TRUE))
(is_lava(p1.x + (count * dx) / dy, p1.y + count) == true))
&& (mode == 1))
return 5;
}
@@ -190,7 +190,7 @@ short can_see(location p1,location p2,short mode)
for (count = 1; count < dx; count++) {
storage = storage + get_obscurity(p1.x + count, p1.y + (count * dy) / dx);
if (((terrain_blocked[coord_to_ter(p1.x + count,p1.y + (count * dy) / dx)] > 2) ||
(is_lava(p1.x + count,p1.y + (count * dy) / dx) == TRUE))
(is_lava(p1.x + count,p1.y + (count * dy) / dx) == true))
&& (mode == 1))
return 5;
}
@@ -199,7 +199,7 @@ short can_see(location p1,location p2,short mode)
for (count = -1; count > dx; count--) {
storage = storage + get_obscurity(p1.x + count, p1.y + (count * dy) / dx);
if ( ((terrain_blocked[coord_to_ter(p1.x + count,p1.y + (count * dy) / dx)] > 2) ||
(is_lava(p1.x + count,p1.y + (count * dy) / dx) == TRUE))
(is_lava(p1.x + count,p1.y + (count * dy) / dx) == true))
&& (mode == 1))
return 5;
}
@@ -239,8 +239,8 @@ unsigned char coord_to_ter(short x,short y)
{
char what_terrain;
if ((overall_mode == MODE_OUTDOORS) || (overall_mode == 35)) what_terrain = out[x][y];
else if (((overall_mode > MODE_OUTDOORS) && (overall_mode < MODE_COMBAT))|| (overall_mode == 36))
if ((overall_mode == MODE_OUTDOORS) || (overall_mode == MODE_LOOK_OUTDOORS)) what_terrain = out[x][y];
else if (((overall_mode > MODE_OUTDOORS) && (overall_mode < MODE_COMBAT))|| (overall_mode == MODE_LOOK_TOWN))
what_terrain = t_d.terrain[x][y];
else what_terrain = combat_terrain[x][y];
return what_terrain;
@@ -251,10 +251,10 @@ Boolean is_container(location loc)
{
unsigned char ter;
if ((is_barrel(loc.x,loc.y)) || (is_crate(loc.x,loc.y))) return TRUE;
if ((is_barrel(loc.x,loc.y)) || (is_crate(loc.x,loc.y))) return true;
ter = coord_to_ter(loc.x,loc.y);
if (scenario.ter_types[ter].special == 14) return TRUE;
return FALSE;
if (scenario.ter_types[ter].special == TER_SPEC_IS_A_CONTAINER) return true;
return false;
}
void update_explored(location dest)
@@ -287,8 +287,8 @@ void update_explored(location dest)
make_explored(dest.x,dest.y);
for (look2.x = max(0,dest.x - 4); look2.x < min(town_size[town_type],dest.x + 5); look2.x++)
for (look2.y = max(0,dest.y - 4); look2.y < min(town_size[town_type],dest.y + 5); look2.y++)
if (is_explored(look2.x,look2.y) == FALSE)
if ((can_see(dest, look2,0) < 5) && (pt_in_light(dest,look2) == TRUE))
if (is_explored(look2.x,look2.y) == false)
if ((can_see(dest, look2,0) < 5) && (pt_in_light(dest,look2) == true))
make_explored(look2.x,look2.y);
}
}
@@ -301,16 +301,16 @@ Boolean is_blocked(location to_check)
unsigned char ter;
if (is_out()) {
if (impassable(out[to_check.x][to_check.y]) == TRUE) {
return TRUE;
if (impassable(out[to_check.x][to_check.y]) == true) {
return true;
}
if (same_point (to_check,party.p_loc) == TRUE)
return TRUE;
if (same_point (to_check,party.p_loc) == true)
return true;
for (i = 0; i < 20; i++)
if ((party.out_c[i].exists) == TRUE)
if (same_point(party.out_c[i].m_loc, to_check) == TRUE)
return TRUE;
return FALSE;
if ((party.out_c[i].exists) == true)
if (same_point(party.out_c[i].m_loc, to_check) == true)
return true;
return false;
}
if ((is_town()) || (is_combat())) {
@@ -318,48 +318,48 @@ Boolean is_blocked(location to_check)
gr = scenario.ter_types[ter].picture;
// Terrain blocking?
if (impassable(ter) == TRUE) {
return TRUE;
if (impassable(ter) == true) {
return true;
}
// Keep away from marked specials during combat
if ((is_combat()) && (gr <= 212) && (gr >= 207))
return TRUE;
return true;
if ((is_combat()) && (gr == 406))//portal
return TRUE;
return true;
// Party there?
if (is_town())
if (same_point (to_check,c_town.p_loc) == TRUE)
return TRUE;
if (same_point (to_check,c_town.p_loc) == true)
return true;
if (is_combat())
for (i = 0; i < 6; i++)
if ((adven[i].isAlive()) && (same_point (to_check,pc_pos[i]) == TRUE))
return TRUE;
if ((adven[i].isAlive()) && (same_point (to_check,pc_pos[i]) == true))
return true;
// Monster there?
if (monst_there(to_check) < 90)
return TRUE;
return true;
// Magic barrier?
if (is_force_barrier(to_check.x,to_check.y))
return TRUE;
return true;
return FALSE;
return false;
}
return TRUE;
return true;
}
Boolean monst_on_space(location loc,short m_num)
{
if (c_town.monst.dudes[m_num].active == 0)
return FALSE;
return false;
if ((loc.x - c_town.monst.dudes[m_num].m_loc.x >= 0) &&
(loc.x - c_town.monst.dudes[m_num].m_loc.x <= c_town.monst.dudes[m_num].m_d.x_width - 1) &&
(loc.y - c_town.monst.dudes[m_num].m_loc.y >= 0) &&
(loc.y - c_town.monst.dudes[m_num].m_loc.y <= c_town.monst.dudes[m_num].m_d.y_width - 1))
return TRUE;
return FALSE;
return true;
return false;
}
short monst_there(location where) // returns 90 if no
@@ -367,7 +367,7 @@ short monst_there(location where) // returns 90 if no
short i;
for (i = 0; i < T_M; i++)
if ((c_town.monst.dudes[i].active != 0) && (monst_on_space(where,i) == TRUE))
if ((c_town.monst.dudes[i].active != 0) && (monst_on_space(where,i) == true))
return i;
return 90;
}
@@ -382,14 +382,14 @@ Boolean monst_can_be_there(location loc,short m_num)
for (i = 0; i < c_town.monst.dudes[m_num].m_d.x_width; i++)
for (j = 0; j < c_town.monst.dudes[m_num].m_d.y_width; j++) {
destination.x = loc.x + i; destination.y = loc.y + j;
if ((is_blocked(destination) == TRUE)
|| (loc_off_act_area(destination) == TRUE)) {
if ((is_blocked(destination) == true)
|| (loc_off_act_area(destination) == true)) {
c_town.monst.dudes[m_num].m_loc.x -= 100;
return FALSE;
return false;
}
}
c_town.monst.dudes[m_num].m_loc.x -= 100;
return TRUE;
return true;
}
Boolean monst_adjacent(location loc,short m_num)
@@ -401,10 +401,10 @@ Boolean monst_adjacent(location loc,short m_num)
for (j = 0; j < c_town.monst.dudes[m_num].m_d.y_width; j++) {
destination.x = c_town.monst.dudes[m_num].m_loc.x + i;
destination.y = c_town.monst.dudes[m_num].m_loc.y + j;
if (adjacent(destination,loc) == TRUE)
return TRUE;
if (adjacent(destination,loc) == true)
return true;
}
return FALSE;
return false;
}
Boolean monst_can_see(short m_num,location l)
@@ -417,9 +417,9 @@ Boolean monst_can_see(short m_num,location l)
destination.x = c_town.monst.dudes[m_num].m_loc.x + i;
destination.y = c_town.monst.dudes[m_num].m_loc.y + j;
if (can_see(destination,l,0) < 5)
return TRUE;
return true;
}
return FALSE;
return false;
}
Boolean party_can_see_monst(short m_num)
@@ -432,9 +432,9 @@ Boolean party_can_see_monst(short m_num)
destination.x = c_town.monst.dudes[m_num].m_loc.x + i;
destination.y = c_town.monst.dudes[m_num].m_loc.y + j;
if (party_can_see(destination) < 6)
return TRUE;
return true;
}
return FALSE;
return false;
}
Boolean can_see_monst(location l,short m_num)
@@ -447,9 +447,9 @@ Boolean can_see_monst(location l,short m_num)
destination.x = c_town.monst.dudes[m_num].m_loc.x + i;
destination.y = c_town.monst.dudes[m_num].m_loc.y + j;
if (can_see(l,destination,0) < 5)
return TRUE;
return true;
}
return FALSE;
return false;
}
Boolean outd_is_blocked(location to_check)
@@ -457,16 +457,16 @@ Boolean outd_is_blocked(location to_check)
short i;
if (overall_mode == MODE_OUTDOORS) {
if (impassable(out[to_check.x][to_check.y]) == TRUE) {
return TRUE;
if (impassable(out[to_check.x][to_check.y]) == true) {
return true;
}
for (i = 0; i < 10; i++)
if ((party.out_c[i].exists) == TRUE)
if (same_point(party.out_c[i].m_loc, to_check) == TRUE)
return TRUE;
return FALSE;
if ((party.out_c[i].exists) == true)
if (same_point(party.out_c[i].m_loc, to_check) == true)
return true;
return false;
}
return FALSE;
return false;
}
// Checks if space is a special that prevents movement into or placement of a PC on
@@ -475,29 +475,29 @@ Boolean is_special(location to_check)
unsigned char which_ter;
if (terrain_blocked[coord_to_ter(to_check.x,to_check.y)] == 2)
return FALSE;
return false;
which_ter = coord_to_ter(to_check.x,to_check.y);
if (terrain_blocked[which_ter] == 2)
return TRUE;
else return FALSE;
return true;
else return false;
}
Boolean outd_is_special(location to_check)
{
if (overall_mode == MODE_OUTDOORS) {
if (terrain_blocked[out[to_check.x][to_check.y]] == 2) {
return TRUE;
return true;
}
else return FALSE;
else return false;
}
return FALSE;
return false;
}
Boolean impassable(unsigned char terrain_to_check)
{
if (terrain_blocked[terrain_to_check] > 2)
return TRUE;
else return FALSE;
return true;
else return false;
}
short get_blockage(unsigned char terrain_type)
@@ -533,17 +533,17 @@ short light_radius()
Boolean pt_in_light(location from_where,location to_where) // Assumes, of course, in town or combat
{
if (c_town.town.lighting == 0)
return TRUE;
return true;
if ((to_where.x < 0) || (to_where.x >= town_size[town_type])
|| (to_where.y < 0) || (to_where.y >= town_size[town_type]))
return TRUE;
return true;
if (t_d.lighting[to_where.x / 8][to_where.y] & (char) (s_pow(2,to_where.x % 8)))
return TRUE;
return true;
if (dist(from_where,to_where) <= light_radius())
return TRUE;
return true;
return FALSE;
return false;
}
Boolean combat_pt_in_light(location to_where)
@@ -551,21 +551,21 @@ Boolean combat_pt_in_light(location to_where)
short i, rad;
if ((c_town.town.lighting == 0) || (which_combat_type == 0))
return TRUE;
return true;
if ((to_where.x < 0) || (to_where.x >= town_size[town_type])
|| (to_where.y < 0) || (to_where.y >= town_size[town_type]))
return TRUE;
return true;
if (t_d.lighting[to_where.x / 8][to_where.y] & (char) (s_pow(2,to_where.x % 8)))
return TRUE;
return true;
rad = light_radius();
for (i = 0; i < 6; i++)
if (adven[i].isAlive()) {
if (dist(pc_pos[i],to_where) <= rad)
return TRUE;
return true;
}
return FALSE;
return false;
}
Boolean party_sees_a_monst() // Returns true is a hostile monster is in sight.
@@ -575,11 +575,11 @@ Boolean party_sees_a_monst() // Returns true is a hostile monster is in sight.
for (i = 0; i < T_M; i++) {
if (c_town.monst.dudes[i].active > 0)
if ((c_town.monst.dudes[i].attitude == 1) &&
(party_can_see_monst(i) == TRUE))
return TRUE;
(party_can_see_monst(i) == true))
return true;
}
return FALSE;
return false;
}
@@ -589,12 +589,12 @@ short party_can_see(location where)
short i;
if (is_out()) {
if ((point_onscreen(party.p_loc,where) == TRUE) && (can_see(party.p_loc,where,0) < 5))
if ((point_onscreen(party.p_loc,where) == true) && (can_see(party.p_loc,where,0) < 5))
return 1;
else return 6;
}
if (is_town()) {
if ( ((point_onscreen(c_town.p_loc,where) == TRUE) || (overall_mode == 36)) && (pt_in_light(c_town.p_loc,where) == TRUE)
if ( ((point_onscreen(c_town.p_loc,where) == true) || (overall_mode == MODE_LOOK_TOWN)) && (pt_in_light(c_town.p_loc,where) == true)
&& (can_see(c_town.p_loc,where,0) < 5))
return 1;
else return 6;
@@ -602,7 +602,7 @@ short party_can_see(location where)
// Now for combat checks. Doing separately for efficiency. Check first for light. If
// dark, give up.
if ((which_combat_type != 0) && (combat_pt_in_light(where) == FALSE))
if ((which_combat_type != 0) && (combat_pt_in_light(where) == false))
return 6;
for (i = 0; i < 6; i++)
@@ -631,7 +631,7 @@ location push_loc(location from_where,location to_where)
}
if ((get_obscurity((short) loc_to_try.x,(short) loc_to_try.y) > 0) ||
(terrain_blocked[t_d.terrain[loc_to_try.x][loc_to_try.y]] > 0) ||
(loc_off_act_area(loc_to_try) == TRUE) ||
(loc_off_act_area(loc_to_try) == true) ||
(monst_there(loc_to_try) < 90) ||
(pc_there(loc_to_try) < 6))
return from_where;
@@ -646,8 +646,8 @@ Boolean spot_impassable(short i,short j)
ter = coord_to_ter(i,j);
if (terrain_blocked[ter] == 5)
return TRUE;
else return FALSE;
return true;
else return false;
}
void alter_space(short i,short j,unsigned char ter)
@@ -667,8 +667,8 @@ void alter_space(short i,short j,unsigned char ter)
else {
t_d.terrain[i][j] = ter;
combat_terrain[i][j] = ter;
if ((scenario.ter_types[t_d.terrain[i][j]].special >= 16) &&
(scenario.ter_types[t_d.terrain[i][j]].special <= 19))
belt_present = TRUE;
if ((scenario.ter_types[t_d.terrain[i][j]].special >= TER_SPEC_CONVEYOR_NORTH) &&
(scenario.ter_types[t_d.terrain[i][j]].special <= TER_SPEC_CONVEYOR_WEST))
belt_present = true;
}
}