- Fixed the Reunite and Leave Town debug option

- Removed the cartoon_happening code
- Added a MODE_CUTSCENE for possible future use


git-svn-id: http://openexile.googlecode.com/svn/trunk@102 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-06-29 02:33:39 +00:00
parent b90130c425
commit 372a275608
7 changed files with 85 additions and 135 deletions

View File

@@ -93,7 +93,7 @@ extern short cen_x, cen_y, stat_window,give_delays;//,pc_moves[6];
extern eGameMode overall_mode;
extern Point to_create;
extern bool in_startup_mode,All_Done,play_sounds,frills_on,spell_forced,save_maps,monsters_going;
extern bool cartoon_happening,party_in_memory,in_scen_debug;
extern bool party_in_memory,in_scen_debug;
// game info globals
@@ -1596,7 +1596,7 @@ bool handle_keystroke(char chr,char chr2,EventRecord event){
// add_string_to_buf((char *) debug);
// print_buf();
if (overall_mode == MODE_TALKING) {
if (chr2 == 53)
if (chr2 == 53) // escape
chr = 'd';
if (chr == ' ')
chr = 'g';
@@ -1610,7 +1610,7 @@ bool handle_keystroke(char chr,char chr2,EventRecord event){
}
}
else if (overall_mode == MODE_SHOPPING) { // shopping keystrokes
if (chr2 == 53) {
if (chr2 == 53) { // escape
pass_point.h = 222;
pass_point.v = 398;
AddPt(ul,&pass_point);
@@ -1618,16 +1618,14 @@ bool handle_keystroke(char chr,char chr2,EventRecord event){
are_done = handle_action(event);
}
for (i = 0; i < 8; i++)
if (chr == 97 + i) {
if (chr == 'a' + i) {
pass_point.h = shopping_rects[i][1].left + 9;
pass_point.v = shopping_rects[i][1].top + 9;
AddPt(ul,&pass_point);
event.where = pass_point;
are_done = handle_action(event);
}
}
if ((overall_mode != MODE_TALKING) && (overall_mode != MODE_SHOPPING)) {
} else {
for (i = 0; i < 10; i++)
if (chr2 == keypad[i]) {
if (i == 0) {
@@ -1754,6 +1752,9 @@ bool handle_keystroke(char chr,char chr2,EventRecord event){
case 'B':
if(!in_scen_debug) break;
PSD[SDF_IS_PARTY_SPLIT] = 0;
for(i=0;i<6;i++)
if(univ.party[i].main_status >= MAIN_STATUS_SPLIT)
univ.party[i].main_status -= MAIN_STATUS_SPLIT;
if(overall_mode == MODE_OUTDOORS){
add_string_to_buf("Debug - Leave Town: You're not in town!");
print_buf();
@@ -1875,11 +1876,11 @@ bool handle_keystroke(char chr,char chr2,EventRecord event){
break;
case 'I': // TODO: Seems useless?
if(!in_scen_debug) break;
sout << "Debug: The party's age is " << univ.party.age;
add_string_to_buf(sout.str());
add_string_to_buf("Debug: Reset map."); // Surely this won't work?
print_buf();
// if(!in_scen_debug) break;
// sout << "Debug: The party's age is " << univ.party.age;
// add_string_to_buf(sout.str());
// add_string_to_buf("Debug: Reset map."); // Surely this won't work?
// print_buf();
break;
case 'Q':
@@ -2200,8 +2201,6 @@ void post_load()
clear_map();
adjust_spell_menus();
adjust_monst_menu();
cartoon_happening = false;
}
void do_save(short mode)

View File

@@ -85,6 +85,7 @@ enum eGameMode {
MODE_LOOK_COMBAT = 37,
MODE_STARTUP = 45,
MODE_RESTING = 50,
MODE_CUTSCENE = 51, // for future use
};
// Directions!

View File

@@ -32,7 +32,7 @@ extern WindowPtr mainPtr;
extern Rect windRect;
extern short stat_window,give_delays;
extern eGameMode overall_mode;
extern short current_spell_range,town_type,store_anim_type;
extern short current_spell_range,town_type;
extern bool in_startup_mode,anim_onscreen,play_sounds,frills_on,startup_loaded,party_in_memory;
extern short anim_step;
extern ter_num_t combat_terrain[64][64];
@@ -41,7 +41,7 @@ extern bool web,crate,barrel,fire_barrier,force_barrier,quickfire,force_wall,fir
extern Point ul;
extern location pc_pos[6],pc_dir[6],center;
extern short which_combat_type,current_pc;
extern bool monsters_going,boom_anim_active,cartoon_happening,skip_boom_delay;
extern bool monsters_going,boom_anim_active,skip_boom_delay;
extern PicHandle spell_pict;
extern short current_ground;
extern short num_targets_left;
@@ -1279,9 +1279,7 @@ void draw_terrain(short mode)
}
else if (is_combat()) {
spec_terrain = combat_terrain[where_draw.x][where_draw.y];
if (cartoon_happening == true)
can_draw = true;
else can_draw = (((is_explored(where_draw.x,where_draw.y)) ||
can_draw = (((is_explored(where_draw.x,where_draw.y)) ||
(which_combat_type == 0) || (monsters_going == true) || (overall_mode != MODE_COMBAT))
&& (party_can_see(where_draw) < 6)) ? 1 : 0;
}
@@ -1299,9 +1297,7 @@ void draw_terrain(short mode)
spot_seen[q][r] = can_draw;
if ((can_draw != 0) && (overall_mode != MODE_RESTING)) { // if can see, not a pit, and not resting
if ((is_combat()) && (cartoon_happening == false)) {
anim_ticks = 0;
}
if (is_combat()) anim_ticks = 0;
eTrimType trim = scenario.ter_types[spec_terrain].trim_type;
@@ -1354,10 +1350,8 @@ void draw_terrain(short mode)
draw_one_terrain_spot(q,r,-1);
}
if ((can_draw != 0) && (overall_mode != MODE_RESTING) && (frills_on == true)
&& (draw_frills == true) && (cartoon_happening == false)) { // Place the trim TODO: Alter trim
if ((can_draw != 0) && (overall_mode != MODE_RESTING) && frills_on && (draw_frills))
place_trim((short) q,(short) r,where_draw,spec_terrain);
}
// if((is_town() && univ.town.is_spot(where_draw.x,where_draw.y)) ||
// (is_out() && univ.out.outdoors[univ.party.i_w_c.x][univ.party.i_w_c.y].special_spot[where_draw.x][where_draw.y]))
// Draw_Some_Item(roads_gworld, calc_rect(6, 0), terrain_screen_gworld, loc(q,r), 1, 0);
@@ -1407,13 +1401,11 @@ void draw_terrain(short mode)
if (mode == 0) {
redraw_terrain();
if (cartoon_happening == false) {
draw_text_bar(0);
if ((overall_mode >= MODE_COMBAT) && (overall_mode != MODE_LOOK_OUTDOORS) && (overall_mode != MODE_LOOK_TOWN) && (overall_mode != MODE_RESTING))
draw_pcs(center,1);
if (overall_mode == MODE_FANCY_TARGET)
draw_targets(center);
}
draw_text_bar(0);
if ((overall_mode >= MODE_COMBAT) && (overall_mode != MODE_LOOK_OUTDOORS) && (overall_mode != MODE_LOOK_TOWN) && (overall_mode != MODE_RESTING))
draw_pcs(center,1);
if (overall_mode == MODE_FANCY_TARGET)
draw_targets(center);
}
SetPort(old_port);
supressing_some_spaces = false;
@@ -1835,13 +1827,13 @@ void boom_space(location where,short mode,short type,short damage,short sound)
// if ((cartoon_happening == true) && (anim_step < 140))
// return;
if ((cartoon_happening == false) && ((mode != 100) && (party_can_see(where) == 6)))
if ((mode != 100) && (party_can_see(where) == 6))
return;
if ((type < 0) || (type > 4))
return;
if ((boom_anim_active == true) && (type != 3))
return;
if ((cartoon_happening == false) && (PSD[SDF_NO_FRILLS] > 0) && (fast_bang == true))
if ((PSD[SDF_NO_FRILLS] > 0) && fast_bang)
return;
if (is_out())
return;
@@ -1880,17 +1872,12 @@ void boom_space(location where,short mode,short type,short damage,short sound)
OffsetRect(&dest_rect,x_adj,y_adj);
SectRect(&dest_rect,&big_to,&dest_rect);
if (cartoon_happening == false)
OffsetRect(&dest_rect,win_to_rects[0].left,win_to_rects[0].top);
else if (store_anim_type == 0)
OffsetRect(&dest_rect,306,5);
else OffsetRect(&dest_rect,store_anim_ul.h,store_anim_ul.v);
OffsetRect(&dest_rect,win_to_rects[0].left,win_to_rects[0].top);
OffsetRect(&source_rect,-1 * store_rect.left + 28 * type,-1 * store_rect.top);
rect_draw_some_item(boom_gworld,source_rect,dest_rect,ul,transparent);
if ((cartoon_happening == false) && (dest_rect.right - dest_rect.left >= 28)
&& (dest_rect.bottom - dest_rect.top >= 36)) {
if ((dest_rect.right - dest_rect.left >= 28) && (dest_rect.bottom - dest_rect.top >= 36)) {
sprintf((char *) dam_str,"%d",damage);
TextSize(10);
TextFace(bold);
@@ -1916,7 +1903,7 @@ void boom_space(location where,short mode,short type,short damage,short sound)
FlushAndPause(del_len);
}
redraw_terrain();
if ((cartoon_happening == false) && (overall_mode >= MODE_COMBAT/*9*/) && (overall_mode != MODE_LOOK_OUTDOORS) && (overall_mode != MODE_LOOK_TOWN) && (overall_mode != MODE_RESTING))
if ((overall_mode >= MODE_COMBAT/*9*/) && (overall_mode != MODE_LOOK_OUTDOORS) && (overall_mode != MODE_LOOK_TOWN) && (overall_mode != MODE_RESTING))
draw_pcs(center,1);
}
@@ -1947,14 +1934,7 @@ void redraw_terrain()
{
Rect to_rect;
if (cartoon_happening == false)
to_rect = win_to_rects[0];
else {
GetPortBounds(terrain_screen_gworld, &to_rect);
if (store_anim_type == 0)
OffsetRect(&to_rect,306,5);
else OffsetRect(&to_rect,store_anim_ul.h,store_anim_ul.v);
}
to_rect = win_to_rects[0];
rect_draw_some_item (terrain_screen_gworld, win_from_rects[0], to_rect,ul);

View File

@@ -25,7 +25,7 @@ extern Rect windRect;
extern short stat_window,give_delays;
extern eGameMode overall_mode;
extern short current_spell_range,town_type;
extern bool in_startup_mode,anim_onscreen,play_sounds,frills_on,startup_loaded,cartoon_happening;
extern bool in_startup_mode,anim_onscreen,play_sounds,frills_on,startup_loaded;
//extern short town_size[3];
//extern cParty party;
//extern pc_record_type adven[6];
@@ -99,7 +99,7 @@ void draw_one_terrain_spot (short i,short j,short terrain_to_draw) ////
where_draw = calc_rect(i,j);
OffsetRect(&where_draw,13,13);
if (terrain_to_draw == -1) {
if ((cartoon_happening == false) && (terrain_there[i][j] == 300)) {
if (terrain_there[i][j] == 300) {
return;
}
terrain_there[i][j] = 300;
@@ -139,12 +139,8 @@ void draw_one_terrain_spot (short i,short j,short terrain_to_draw) ////
anim_type = 0;
}
else {
if (cartoon_happening == false) {
if (terrain_there[i][j] == scenario.ter_types[terrain_to_draw].picture) {
return;
}
terrain_there[i][j] = scenario.ter_types[terrain_to_draw].picture;
}
if (terrain_there[i][j] == scenario.ter_types[terrain_to_draw].picture) return;
terrain_there[i][j] = scenario.ter_types[terrain_to_draw].picture;
terrain_to_draw = scenario.ter_types[terrain_to_draw].picture;
source_gworld = terrain_gworld[terrain_to_draw / 50];
terrain_there[i][j] = terrain_to_draw;
@@ -267,8 +263,7 @@ void draw_monsters() ////
if (is_combat()) {
for (i = 0; i < univ.town->max_monst(); i++)
if ((univ.town.monst[i].active != 0) && (univ.town.monst[i].spec_skill != 11))
if (((point_onscreen(center,univ.town.monst[i].cur_loc) == true) && (cartoon_happening == true))
|| (party_can_see_monst(i) == true)) {
if (point_onscreen(center,univ.town.monst[i].cur_loc) || party_can_see_monst(i)) {
check_if_monst_seen(univ.town.monst[i].number);
where_draw.x = univ.town.monst[i].cur_loc.x - center.x + 4;
where_draw.y = univ.town.monst[i].cur_loc.y - center.y + 4;
@@ -348,38 +343,35 @@ void draw_pcs(location center,short mode)
return;
if (can_draw_pcs == false)
return;
if ((mode == 1) && (cartoon_happening == true))
return;
for (i = 0; i < 6; i++)
if (univ.party[i].main_status == 1)
if (((point_onscreen(center, pc_pos[i])) == true) &&
((cartoon_happening == true) || (party_can_see(pc_pos[i]) < 6))){
where_draw.x = pc_pos[i].x - center.x + 4;
where_draw.y = pc_pos[i].y - center.y + 4;
source_rect = calc_rect(2 * (univ.party[i].which_graphic / 8), univ.party[i].which_graphic % 8);
if(pc_dir[i] >= 4)
OffsetRect(&source_rect,28,0);
if (combat_posing_monster == i)
OffsetRect(&source_rect,0,288);
if (mode == 0) {
Draw_Some_Item(pc_gworld, source_rect, terrain_screen_gworld, where_draw, 1, 0);
}
if ((current_pc == i) && (mode == 1) && (monsters_going == false)) {
active_pc_rect.top = 18 + where_draw.y * 36;
active_pc_rect.left = 18 + where_draw.x * 28;
active_pc_rect.bottom = 54 + where_draw.y * 36;
active_pc_rect.right = 46 + where_draw.x * 28;
OffsetRect(&active_pc_rect,ul.h,ul.v);
ForeColor(magentaColor);
FrameRoundRect(&active_pc_rect,8,8);
ForeColor(blackColor);
}
}
// if (((point_onscreen(center, pc_pos[i])) == true) &&
// ((cartoon_happening == true) || (party_can_see(pc_pos[i]) < 6))){
// where_draw.x = pc_pos[i].x - center.x + 4;
// where_draw.y = pc_pos[i].y - center.y + 4;
// source_rect = calc_rect(2 * (univ.party[i].which_graphic / 8), univ.party[i].which_graphic % 8);
// if(pc_dir[i] >= 4)
// OffsetRect(&source_rect,28,0);
// if (combat_posing_monster == i)
// OffsetRect(&source_rect,0,288);
//
// if (mode == 0) {
// Draw_Some_Item(pc_gworld, source_rect, terrain_screen_gworld, where_draw, 1, 0);
// }
//
// if ((current_pc == i) && (mode == 1) && (monsters_going == false)) {
// active_pc_rect.top = 18 + where_draw.y * 36;
// active_pc_rect.left = 18 + where_draw.x * 28;
// active_pc_rect.bottom = 54 + where_draw.y * 36;
// active_pc_rect.right = 46 + where_draw.x * 28;
// OffsetRect(&active_pc_rect,ul.h,ul.v);
//
// ForeColor(magentaColor);
// FrameRoundRect(&active_pc_rect,8,8);
// ForeColor(blackColor);
// }
// }
// Draw current pc on top
if ( ((point_onscreen(center, pc_pos[current_pc])) == true) && (univ.party[current_pc].main_status == 1)) {
@@ -405,7 +397,7 @@ void draw_items(location where){
for (int i = 0; i < NUM_TOWN_ITEMS; i++) {
if(univ.town.items[i].variety != ITEM_TYPE_NO_ITEM && univ.town.items[i].item_loc == where) {
if(univ.town.items[i].is_contained()) continue;
if(!cartoon_happening && party_can_see(where) >= 6) continue;
if(party_can_see(where) >= 6) continue;
if(univ.town.items[i].graphic_num >= 1000){
from_rect = get_custom_rect(univ.town.items[i].graphic_num - 1000);
to_rect = coord_to_rect(where.x,where.y);
@@ -489,7 +481,7 @@ void draw_town_boat(location center)
void draw_fields(location where){
if(!point_onscreen(center,where)) return;
if(!cartoon_happening && party_can_see(where) >= 6) return;
if(party_can_see(where) >= 6) return;
location where_draw(4 + where.x - center.x, 4 + where.y - center.y);
if(is_out()){
if(univ.out.outdoors[univ.party.i_w_c.x][univ.party.i_w_c.y].special_spot[where.x][where.y])

View File

@@ -93,7 +93,7 @@ short current_spell_range;
eGameMode overall_mode = MODE_STARTUP;
bool first_update = true,anim_onscreen = false,frills_on = true,sys_7_avail,suppress_stat_screen = false;
short stat_window = 0,store_modifier;
bool monsters_going = false,boom_anim_active = false,cartoon_happening = false;
bool monsters_going = false,boom_anim_active = false;
short give_delays = 0;
bool modeless_exists[18] = {false,false,false,false,false,false,
false,false,false,false,false,false,

View File

@@ -50,7 +50,7 @@ extern Rect bg[];
extern WindowPtr mainPtr;
extern short dungeon_font_num,geneva_font_num,town_type,which_combat_type;
extern eGameMode overall_mode;
extern bool play_sounds,boom_anim_active,cartoon_happening,in_startup_mode;
extern bool play_sounds,boom_anim_active,in_startup_mode;
extern GWorldPtr fields_gworld,boom_gworld,dlg_buttons_gworld[NUM_BUTTONS][2],terrain_screen_gworld,missiles_gworld,invenbtn_gworld;
//extern party_record_type party;
extern GWorldPtr bg_gworld;
@@ -128,20 +128,19 @@ Rect explode_place_rect[30];
// Animation vars
//extern town_record_type anim_town;
//extern tiny_tr_type anim_t_d;
extern short anim_step;
short store_anim_type;
extern char anim_str[60];
extern location anim_str_loc;
// if < 6; target PC, if >= 100, targ monst, if 6, go to anim_pc_loc
short anim_pc_targets[6];
short anim_monst_targets[60];
short anim_pcs[6];
location anim_pc_locs[6],anim_monst_locs[60];
location anim_string_loc;
char anim_string[60];
//extern short anim_step;
//extern char anim_str[60];
//extern location anim_str_loc;
//
//// if < 6; target PC, if >= 100, targ monst, if 6, go to anim_pc_loc
//short anim_pc_targets[6];
//short anim_monst_targets[60];
//
//short anim_pcs[6];
//
//location anim_pc_locs[6],anim_monst_locs[60];
//location anim_string_loc;
//char anim_string[60];
char last_light_mask[13][13];
void apply_unseen_mask()
@@ -438,16 +437,10 @@ void do_missile_anim(short num_steps,location missile_origin,short sound_num)
return;
// initialize general data
if ((in_startup_mode == true) && (store_anim_type == 0)) {
if (in_startup_mode) {
current_terrain_ul.h = 306;
current_terrain_ul.v = 5;
}
else if ((cartoon_happening == true) && (store_anim_type > 0)) {
current_terrain_ul = store_anim_ul;
}
else {
current_terrain_ul.h = current_terrain_ul.v = 5;
}
} else current_terrain_ul.h = current_terrain_ul.v = 5;
// make terrain_template contain current terrain all nicely
draw_terrain(1);
@@ -621,17 +614,10 @@ void do_explosion_anim(short sound_num,short special_draw)
return;
// initialize general data
if ((in_startup_mode == true) && (store_anim_type == 0)) {
if (in_startup_mode) {
current_terrain_ul.h = 306;
current_terrain_ul.v = 5;
}
else if ((cartoon_happening == true) && (store_anim_type > 0)) {
current_terrain_ul = store_anim_ul;
}
else {
current_terrain_ul.h = current_terrain_ul.v = 5;
}
} else current_terrain_ul.h = current_terrain_ul.v = 5;
// make terrain_template contain current terrain all nicely
draw_terrain(1);

View File

@@ -83,7 +83,7 @@ extern short terrain_there[9][9];
//extern unsigned char out[96][96];
//extern big_tr_type t_d;
extern Point ul;
extern bool play_sounds,suppress_stat_screen,cartoon_happening,in_startup_mode;
extern bool play_sounds,suppress_stat_screen,in_startup_mode;
extern Rect item_buttons[8][6];
// name, use, give, drip, info, sell/id
extern Rect pc_buttons[6][5];
@@ -92,7 +92,7 @@ extern bool item_area_button_active[8][6];
extern bool pc_area_button_active[6][5];
extern Rect item_screen_button_rects[9];
extern short spec_item_array[60];
extern short abil_chart[200],store_anim_type;
extern short abil_chart[200];
// combat globals
extern short item_bottom_button_active[9];
extern cUniverse univ;
@@ -1419,15 +1419,7 @@ const BitMap * store_dest;
test1 = GetPortPixMap(src_gworld);
destrec = coord_to_rect(target.x,target.y);
if (main_win == 1) {
if (cartoon_happening == true) {
OffsetRect(&destrec,ul.h,ul.v);
if (store_anim_type == 0)
OffsetRect(&destrec,306,5);
else OffsetRect(&destrec,store_anim_ul.h,store_anim_ul.v);
}
else OffsetRect(&destrec,ul.h + 5,ul.v + 5);
}
if (main_win == 1) OffsetRect(&destrec,ul.h + 5,ul.v + 5);
LockPixels(test1);
if (main_win == 0) {