Cleaned out many of the warnings (reducing warning count from 718 to 334). Almost all the remaining errors are about unused parameters.
git-svn-id: http://openexile.googlecode.com/svn/trunk@85 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
@@ -75,12 +75,10 @@ short skill_bonus[21] = {-3,-3,-2,-1,0,0,1,1,1,2,
|
||||
bool handle_action(EventRecord event,short mode)
|
||||
//short mode; // ignore,
|
||||
{
|
||||
short i,j,button_hit = 100,first_existing_pc = 0;
|
||||
short i;
|
||||
|
||||
char debug_line[60];
|
||||
RGBColor s;
|
||||
Point the_point;
|
||||
short choice = 4,for_pc = 6;
|
||||
short choice = 4;
|
||||
|
||||
bool to_return = false;
|
||||
|
||||
@@ -145,8 +143,6 @@ bool handle_action(EventRecord event,short mode)
|
||||
|
||||
void flash_rect(Rect to_flash)
|
||||
{
|
||||
RGBColor test_color, store_color;
|
||||
int i;
|
||||
unsigned long dummy;
|
||||
|
||||
InvertRect (&to_flash);
|
||||
@@ -158,17 +154,10 @@ void flash_rect(Rect to_flash)
|
||||
void edit_gold_or_food_event_filter (short item_hit)
|
||||
{
|
||||
Str255 get_text;
|
||||
long dummy;
|
||||
|
||||
cd_retrieve_text_edit_str((store_which_to_edit == 0) ? 1012 : 947,2,(char *) get_text);
|
||||
dialog_answer = 0;
|
||||
#ifndef EXILE_BIG_GUNS
|
||||
sscanf((char *) get_text,"%d",&dialog_answer);
|
||||
#endif
|
||||
#ifdef EXILE_BIG_GUNS
|
||||
sscanf((char *) get_text,"%d",&dummy);
|
||||
dialog_answer = dummy;
|
||||
#endif
|
||||
toast_dialog();
|
||||
}
|
||||
|
||||
@@ -199,17 +188,10 @@ void edit_gold_or_food(short which_to_edit)
|
||||
void edit_day_event_filter (short item_hit)
|
||||
{
|
||||
Str255 get_text;
|
||||
long dummy;
|
||||
|
||||
cd_retrieve_text_edit_str(917,2,(char *) get_text);
|
||||
dialog_answer = 0;
|
||||
#ifndef EXILE_BIG_GUNS
|
||||
sscanf((char *) get_text,"%d",&dialog_answer);
|
||||
#endif
|
||||
#ifdef EXILE_BIG_GUNS
|
||||
sscanf((char *) get_text,"%d",&dummy);
|
||||
dialog_answer = dummy;
|
||||
#endif
|
||||
toast_dialog();
|
||||
}
|
||||
|
||||
@@ -240,7 +222,7 @@ void edit_day()
|
||||
|
||||
void put_pc_graphics()
|
||||
{
|
||||
short item_hit,what_talk_field,i;
|
||||
short i;
|
||||
|
||||
for (i = 3; i < 65; i++) {
|
||||
if (((store_trait_mode == 0) && (univ.party[which_pc_displayed].mage_spells[i - 3] == true)) ||
|
||||
@@ -400,11 +382,7 @@ void draw_xp_skills()
|
||||
}
|
||||
|
||||
|
||||
void do_xp_draw()
|
||||
|
||||
{
|
||||
|
||||
short item_hit,what_talk_field;
|
||||
void do_xp_draw(){
|
||||
char get_text[256];
|
||||
short pc_num;
|
||||
|
||||
@@ -429,8 +407,7 @@ void do_xp_draw()
|
||||
|
||||
void spend_xp_event_filter (short item_hit)
|
||||
{
|
||||
short what_talk_field,i,j,pc_num,mode = 1;
|
||||
char get_text[256];
|
||||
short pc_num;
|
||||
bool talk_done = false;
|
||||
|
||||
pc_num = store_train_pc;
|
||||
@@ -608,8 +585,6 @@ bool spend_xp(short pc_num, short mode, short parent)
|
||||
|
||||
void give_reg_info_event_filter (short item_hit)
|
||||
{
|
||||
short i;
|
||||
Str255 place_str;
|
||||
|
||||
switch (item_hit) {
|
||||
case 1:
|
||||
@@ -620,11 +595,7 @@ void give_reg_info_event_filter (short item_hit)
|
||||
|
||||
void give_reg_info()
|
||||
{
|
||||
long val_for_text;
|
||||
|
||||
short i,item_hit;
|
||||
Str255 place_str;
|
||||
|
||||
short item_hit;
|
||||
|
||||
make_cursor_sword();
|
||||
|
||||
@@ -638,17 +609,10 @@ void give_reg_info()
|
||||
void edit_xp_event_filter (short item_hit)
|
||||
{
|
||||
Str255 get_text;
|
||||
long dummy;
|
||||
|
||||
cd_retrieve_text_edit_str(1024,2,(char *) get_text);
|
||||
dialog_answer = 0;
|
||||
#ifndef EXILE_BIG_GUNS
|
||||
sscanf((char *) get_text,"%d",&dialog_answer);
|
||||
#endif
|
||||
#ifdef EXILE_BIG_GUNS
|
||||
sscanf((char *) get_text,"%d",&dummy);
|
||||
dialog_answer = dummy;
|
||||
#endif
|
||||
toast_dialog();
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,6 @@ void combine_things(short pc_num)
|
||||
bool give_to_pc(short pc_num,cItemRec item, short print_result)
|
||||
{
|
||||
short free_space;
|
||||
char announce_string[60];
|
||||
|
||||
if (item.variety == 0)
|
||||
return true;
|
||||
@@ -96,7 +95,7 @@ bool give_to_pc(short pc_num,cItemRec item, short print_result)
|
||||
|
||||
bool give_to_party(cItemRec item,short print_result)
|
||||
{
|
||||
short free_space, i = 0;
|
||||
short i = 0;
|
||||
|
||||
while (i < 6) {
|
||||
if (give_to_pc(i,item,print_result) == true)
|
||||
@@ -137,7 +136,6 @@ void take_item(short pc_num,short which_item)
|
||||
//short pc_num,which_item; // if which_item > 20, don't update stat win, item is which_item - 20
|
||||
{
|
||||
short i;
|
||||
bool do_print = true;
|
||||
|
||||
if ((univ.party[pc_num].weap_poisoned == which_item) && (univ.party[pc_num].status[0] > 0)) {
|
||||
// add_string_to_buf(" Poison lost. ");
|
||||
@@ -234,14 +232,7 @@ short select_pc(short active_only,short free_inv_only)
|
||||
short choice_dialog(short pic,short num)
|
||||
{
|
||||
DialogPtr select_dialog = NULL;
|
||||
short the_type;
|
||||
Handle the_handle = NULL;
|
||||
Rect the_rect;
|
||||
short item_hit,i;
|
||||
Str255 pc_name;
|
||||
GrafPtr old_port;
|
||||
PicHandle pict_to_draw;
|
||||
|
||||
short item_hit;
|
||||
|
||||
select_dialog = GetNewDialog (num, 0, IN_FRONT);
|
||||
if (select_dialog == NULL) {
|
||||
@@ -306,7 +297,6 @@ short luck_total()
|
||||
void display_traits_graphics()
|
||||
{
|
||||
short i,store;
|
||||
Str255 str;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
cd_set_led(1013,4 + i,(store_pc->race == i) ? 1 : 0);
|
||||
|
@@ -90,14 +90,13 @@ void init_dialogs(){
|
||||
void init_main_buttons()
|
||||
{
|
||||
|
||||
short i,j;
|
||||
short i;
|
||||
int indent = 0, indent2 = 0;
|
||||
Rect start_rect = {0,0,36,28};
|
||||
GrafPtr old_port;
|
||||
|
||||
Str255 fn1 = "\pGeneva";
|
||||
Str255 fn3 = "\pPalatino";
|
||||
Rect mask_rect = {0,0,396,308},r,base_rect;
|
||||
Rect base_rect;
|
||||
|
||||
if (init_once == false) {
|
||||
init_once = true;
|
||||
@@ -268,7 +267,7 @@ void init_main_buttons()
|
||||
|
||||
void Set_up_win ()
|
||||
{
|
||||
short i,j;
|
||||
short i;
|
||||
title_gworld = load_pict(5000);
|
||||
pc_gworld = load_pict(902);
|
||||
mixed_gworld = load_pict(903);
|
||||
@@ -292,8 +291,6 @@ void draw_main_screen()
|
||||
{
|
||||
Rect source_rect, dest_rec,dest_rect;
|
||||
Rect reg_rect;
|
||||
Str255 temp_str;
|
||||
int i=0;
|
||||
|
||||
SetPort(GetWindowPort(mainPtr));
|
||||
FillCRect(&whole_win_rect,bg[12]); // fill whole window with background texture
|
||||
@@ -390,7 +387,6 @@ GWorldPtr load_pict(short picture_to_get)
|
||||
QDErr check_error;
|
||||
PixMapHandle offPMHandle;
|
||||
char good;
|
||||
char debug[60];
|
||||
|
||||
current_pic_handle = GetPicture (picture_to_get);
|
||||
if (current_pic_handle == NULL) {
|
||||
@@ -466,13 +462,13 @@ void draw_items(short clear_first)
|
||||
}
|
||||
for (i = 0; i < 24; i++) // Loop through items and draw each
|
||||
if (univ.party[current_active_pc].items[i].variety > 0) { // i.e. does item exist
|
||||
sprintf((char *) to_draw, "");
|
||||
strcpy((char *) to_draw, "");
|
||||
if (univ.party[current_active_pc].items[i].item_properties & 1 == 0)
|
||||
sprintf((char *) to_draw, "%d. %s ",i + 1,univ.party[current_active_pc].items[i].name);
|
||||
sprintf((char *) to_draw, "%d. %s ",i + 1,univ.party[current_active_pc].items[i].name.c_str());
|
||||
else if (univ.party[current_active_pc].items[i].charges > 0)
|
||||
sprintf((char *) to_draw, "%d. %s (%d)",i + 1,univ.party[current_active_pc].items[i].full_name,
|
||||
sprintf((char *) to_draw, "%d. %s (%d)",i + 1,univ.party[current_active_pc].items[i].full_name.c_str(),
|
||||
univ.party[current_active_pc].items[i].charges);
|
||||
else sprintf((char *) to_draw, "%d. %s ",i + 1,univ.party[current_active_pc].items[i].full_name);
|
||||
else sprintf((char *) to_draw, "%d. %s ",i + 1,univ.party[current_active_pc].items[i].full_name.c_str());
|
||||
|
||||
//if (i % 2 == 0)
|
||||
// sprintf((char *) to_draw, "%d %d %d %d",
|
||||
@@ -497,10 +493,9 @@ void display_party(short mode,short clear_first)
|
||||
//short mode; // 0 - 5 this pc, 6 - all
|
||||
//short clear_first; // 1 - redraw over what's already there, 0 - don't redraw over
|
||||
{
|
||||
short i,j,k,string_num, cur_rect=0, flag;
|
||||
short i,k,string_num, cur_rect=0;
|
||||
Str255 to_draw, skill_value;
|
||||
short start_v = 115, start_h = 80;
|
||||
Rect to_rect,from_base = {0,0,36,28},from_rect,no_party_rect,temp_rect;
|
||||
Rect from_base = {0,0,36,28},from_rect,no_party_rect,temp_rect;
|
||||
|
||||
// lots of stuff is global. Like ...
|
||||
// bool file_in_mem
|
||||
|
@@ -123,12 +123,6 @@ cScenario scenario;
|
||||
//MW specified return type was 'void', changed to ISO C style for Carbonisation -jmr
|
||||
int main(void)
|
||||
{
|
||||
short error;
|
||||
OSErr err;
|
||||
MenuHandle cur_menu;
|
||||
FSSpec spec;
|
||||
short refNum, localizedRefNum;
|
||||
CFBundleRef bundle;
|
||||
start_time = TickCount();
|
||||
|
||||
Initialize();
|
||||
@@ -322,7 +316,6 @@ void Handle_One_Event()
|
||||
{
|
||||
short chr,chr2;
|
||||
long menu_choice,cur_time;
|
||||
bool event_in_dialog = false;
|
||||
GrafPtr old_port;
|
||||
|
||||
//ed_reg = false;
|
||||
@@ -425,7 +418,7 @@ void Mouse_Pressed()
|
||||
{
|
||||
WindowPtr the_window;
|
||||
BitMap screenBits;
|
||||
short the_part,choice,i;
|
||||
short the_part;
|
||||
long menu_choice;
|
||||
bool try_to_end;
|
||||
|
||||
@@ -529,7 +522,6 @@ void handle_apple_menu(int item_hit)
|
||||
|
||||
void handle_file_menu(int item_hit)
|
||||
{
|
||||
short choice;
|
||||
FSSpec file;
|
||||
|
||||
switch (item_hit) {
|
||||
@@ -573,7 +565,7 @@ void check_for_intel(){
|
||||
|
||||
void handle_extra_menu(int item_hit)
|
||||
{
|
||||
short i,j,choice;
|
||||
short i;
|
||||
//cVehicle v_boat = {{12,17},{0,0},{0,0},80,true,false};
|
||||
|
||||
if (file_in_mem == false) {
|
||||
@@ -811,7 +803,7 @@ void update_item_menu()
|
||||
for (j = 0; j < 4; j++){
|
||||
DeleteMenuItems(item_menu[j],1,100);
|
||||
for (i = 0; i < 100; i++) {
|
||||
sprintf((char *) item_name, " %s",item_list[i + j * 100].full_name);
|
||||
sprintf((char *) item_name, " %s",item_list[i + j * 100].full_name.c_str());
|
||||
c2pstr((char *) item_name);
|
||||
AppendMenu(item_menu[j],item_name);
|
||||
}
|
||||
@@ -910,13 +902,13 @@ pascal OSErr handle_open_app(AppleEvent *theAppleEvent,AppleEvent *reply,long ha
|
||||
|
||||
pascal OSErr handle_open_doc(AppleEvent *theAppleEvent,AppleEvent *reply,long handlerRefcon)
|
||||
{
|
||||
FSSpec myFSS;
|
||||
AEDescList docList;
|
||||
OSErr myErr, ignoreErr;
|
||||
long index, itemsInList;
|
||||
Size actualSize;
|
||||
AEKeyword keywd;
|
||||
DescType returnedType;
|
||||
// FSSpec myFSS;
|
||||
// AEDescList docList;
|
||||
// OSErr myErr, ignoreErr;
|
||||
// long index, itemsInList;
|
||||
// Size actualSize;
|
||||
// AEKeyword keywd;
|
||||
// DescType returnedType;
|
||||
|
||||
/* myErr = AEGetParamDesc(theAppleEvent,keyDirectObject, typeAEList, &docList);
|
||||
if (myErr == noErr) {
|
||||
@@ -942,7 +934,6 @@ pascal OSErr handle_open_doc(AppleEvent *theAppleEvent,AppleEvent *reply,long ha
|
||||
|
||||
pascal OSErr handle_quit(AppleEvent *theAppleEvent,AppleEvent *reply,long handlerRefcon)
|
||||
{
|
||||
short choice;
|
||||
|
||||
All_Done = verify_restore_quit(0);
|
||||
return noErr;
|
||||
|
@@ -110,7 +110,7 @@ void reset_rb() {
|
||||
// is slot >= 0, force that slot
|
||||
// if -1, use 1st free slot
|
||||
void set_rb(short slot, short mode, char *label, short do_draw) {
|
||||
short i,highest_used = 0;
|
||||
short i;
|
||||
|
||||
if (slot < 0) {
|
||||
for (i = 0; i < NRS; i++)
|
||||
|
@@ -589,7 +589,7 @@ void draw_rb_slot (short which,short mode) {
|
||||
|
||||
void set_up_terrain_buttons() {
|
||||
short i,j,pic,small_i;
|
||||
Rect ter_from,ter_to,ter_from_base = {0,0,36,28};
|
||||
Rect ter_from,ter_from_base = {0,0,36,28};
|
||||
Rect tiny_from,tiny_to;
|
||||
|
||||
Rect palette_from,palette_to = palette_button_base;
|
||||
@@ -948,9 +948,8 @@ void draw_terrain(){
|
||||
void draw_monsts() {
|
||||
short i,k,width,height,m_start_pic;
|
||||
GWorldPtr from_gworld;
|
||||
Rect source_rect,draw_rect;
|
||||
Rect source_rect;
|
||||
location where_draw,store_loc;
|
||||
GrafPtr cur_port;
|
||||
|
||||
for (i = 0; i < town->max_monst(); i++)
|
||||
if (town->creatures(i).number != 0) {
|
||||
@@ -1008,7 +1007,6 @@ void draw_items() {
|
||||
Rect source_rect,dest_rect;
|
||||
location where_draw;
|
||||
short pic_num;
|
||||
GrafPtr cur_port;
|
||||
|
||||
for (i = 0; i < town->max_items(); i++) {
|
||||
if (town->preset_items[i].code >= 0) {
|
||||
@@ -1093,8 +1091,8 @@ void draw_one_terrain_spot (short i,short j,ter_num_t terrain_to_draw) {
|
||||
void draw_one_tiny_terrain_spot (short i,short j,ter_num_t terrain_to_draw) {
|
||||
|
||||
location where_draw;
|
||||
Rect source_rect,dest_rect = {0,0,4,4},from_rect = {0,0,4,4};
|
||||
short picture_wanted,k;
|
||||
Rect dest_rect = {0,0,4,4},from_rect = {0,0,4,4};
|
||||
short picture_wanted;
|
||||
GWorldPtr source_gworld;
|
||||
|
||||
picture_wanted = scenario.ter_types[terrain_to_draw].picture;
|
||||
@@ -1153,9 +1151,6 @@ void draw_one_tiny_terrain_spot (short i,short j,ter_num_t terrain_to_draw) {
|
||||
void Draw_Some_Item ( GWorldPtr src_gworld,Rect src_rect,GWorldPtr targ_gworld,location target,
|
||||
char masked,short main_win) {
|
||||
Rect destrec;
|
||||
PixMapHandle test1, test2;
|
||||
RGBColor test_color, store_color;
|
||||
BitMap store_dest;
|
||||
|
||||
if ((target.x < 0) || (target.x > 8) || (target.y < 0) || (target.y > 8))
|
||||
return;
|
||||
@@ -1175,7 +1170,6 @@ void Draw_Some_Item ( GWorldPtr src_gworld,Rect src_rect,GWorldPtr targ_gworld,l
|
||||
desired pixmap, or Rect to darkness if desired map not present */
|
||||
Rect get_template_rect (unsigned short type_wanted) {
|
||||
Rect store_rect;
|
||||
short i,j;
|
||||
short picture_wanted;
|
||||
|
||||
picture_wanted = scenario.ter_types[type_wanted].picture;
|
||||
@@ -1191,7 +1185,7 @@ Rect get_template_rect (unsigned short type_wanted) {
|
||||
}
|
||||
|
||||
void draw_frames() {
|
||||
char q,r,i,k;
|
||||
char q,r,i;
|
||||
location which_pt;
|
||||
Rect draw_rect;
|
||||
|
||||
@@ -1228,9 +1222,8 @@ void draw_frames() {
|
||||
|
||||
|
||||
void place_location() {
|
||||
Rect text_rect = {367,290,384,510};
|
||||
Str255 draw_str;
|
||||
Rect from_rect,draw_rect,source_rect,erase_rect;
|
||||
Rect draw_rect,source_rect,erase_rect;
|
||||
short picture_wanted;
|
||||
|
||||
/*
|
||||
@@ -1257,7 +1250,7 @@ void place_location() {
|
||||
sprintf((char *) draw_str,"Center: x = %d, y = %d ",cen_x,cen_y);
|
||||
else {
|
||||
//MoveTo(5 ,terrain_rects[255].top + 28);
|
||||
sprintf((char *) draw_str,"Click terrain to edit. ",cen_x,cen_y);
|
||||
sprintf((char *) draw_str,"Click terrain to edit. ");
|
||||
}
|
||||
c2pstr((char*) draw_str);
|
||||
DrawString(draw_str);
|
||||
@@ -1326,11 +1319,8 @@ void place_location() {
|
||||
|
||||
// klugde for speed ...exactly like place location above, but just writes location
|
||||
void place_just_location() {
|
||||
Rect text_rect = {367,290,384,510};
|
||||
Str255 draw_str;
|
||||
Rect from_rect,draw_rect,source_rect,erase_rect;
|
||||
short picture_wanted;
|
||||
|
||||
Rect from_rect,draw_rect,erase_rect;
|
||||
|
||||
SetPort( terrain_buttons_gworld);
|
||||
|
||||
@@ -1424,7 +1414,7 @@ void sort_specials() {
|
||||
}
|
||||
|
||||
bool is_field_type(short i,short j,short field_type) {
|
||||
short k;
|
||||
unsigned short k;
|
||||
|
||||
for (k = 0; k < town->preset_fields.size(); k++)
|
||||
if ((town->preset_fields[k].type == field_type) &&
|
||||
@@ -1435,7 +1425,7 @@ bool is_field_type(short i,short j,short field_type) {
|
||||
}
|
||||
|
||||
void make_field_type(short i,short j,short field_type) {
|
||||
short k;
|
||||
unsigned short k;
|
||||
|
||||
if (is_field_type(i,j,field_type) == true)
|
||||
return;
|
||||
@@ -1456,7 +1446,7 @@ void make_field_type(short i,short j,short field_type) {
|
||||
|
||||
|
||||
void take_field_type(short i,short j,short field_type) {
|
||||
short k;
|
||||
unsigned short k;
|
||||
|
||||
for (k = 0; k < town->preset_fields.size(); k++)
|
||||
if ((town->preset_fields[k].type == field_type) &&
|
||||
@@ -1542,9 +1532,6 @@ void take_quickfire(short i,short j) {
|
||||
}
|
||||
|
||||
bool container_there(location l) {
|
||||
|
||||
ter_num_t ter;
|
||||
|
||||
if (editing_town == false)
|
||||
return false;
|
||||
if (scenario.ter_types[town->terrain(l.x,l.y)].special == TER_SPEC_IS_A_CONTAINER)
|
||||
|
@@ -1244,8 +1244,6 @@ void edit_scen_intro_event_filter (short item_hit) {
|
||||
|
||||
void edit_scen_intro() {
|
||||
short i,item_hit;
|
||||
short num_s_strs[3] = {100,90,100};
|
||||
|
||||
|
||||
cd_create_dialog_parent_num(804,0);
|
||||
|
||||
|
@@ -382,7 +382,11 @@ bool handle_action(EventRecord event)
|
||||
main_button_click(overall_mode,combat_buttons[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// either resting or startup; do nothing
|
||||
// TODO: A call to handle_startup_action() would make sense here, though
|
||||
break;
|
||||
}
|
||||
|
||||
// Then, handle a button being hit.
|
||||
if (button_hit != 12)
|
||||
@@ -963,34 +967,29 @@ bool handle_action(EventRecord event)
|
||||
put_pc_screen();
|
||||
put_item_screen(stat_window,0);
|
||||
}
|
||||
if ((overall_mode > MODE_TALK_TOWN) && (overall_mode < MODE_COMBAT/*6*/)) {
|
||||
destination.x = destination.x + i - 4;
|
||||
destination.y = destination.y + j - 4;
|
||||
switch (overall_mode) {
|
||||
case MODE_TOWN_TARGET:
|
||||
cast_town_spell(destination);
|
||||
did_something = true;
|
||||
break;
|
||||
case MODE_USE_TOWN:
|
||||
if (adjacent(destination,univ.town.p_loc) == false)
|
||||
add_string_to_buf(" Must be adjacent. ");
|
||||
else {
|
||||
did_something = use_space(destination);
|
||||
}
|
||||
break;
|
||||
case MODE_DROP_TOWN:
|
||||
if (adjacent(univ.town.p_loc,destination) == false)
|
||||
add_string_to_buf("Drop: must be adjacent.");
|
||||
else if (get_obscurity(destination.x,destination.y) == 5)
|
||||
ASB("Drop: Space is blocked.");
|
||||
else drop_item(current_pc,store_drop_item,destination);
|
||||
break;
|
||||
}
|
||||
overall_mode = MODE_TOWN;
|
||||
need_redraw = true;
|
||||
put_pc_screen();
|
||||
put_item_screen(stat_window,0);
|
||||
}
|
||||
if ((overall_mode > MODE_TALK_TOWN) && (overall_mode < MODE_COMBAT/*6*/)) {
|
||||
destination.x = destination.x + i - 4;
|
||||
destination.y = destination.y + j - 4;
|
||||
if (overall_mode == MODE_TOWN_TARGET) {
|
||||
cast_town_spell(destination);
|
||||
did_something = true;
|
||||
}else if(overall_mode == MODE_USE_TOWN) {
|
||||
if (adjacent(destination,univ.town.p_loc) == false)
|
||||
add_string_to_buf(" Must be adjacent. ");
|
||||
else
|
||||
did_something = use_space(destination);
|
||||
}else if(overall_mode == MODE_DROP_TOWN) {
|
||||
if (adjacent(univ.town.p_loc,destination) == false)
|
||||
add_string_to_buf("Drop: must be adjacent.");
|
||||
else if (get_obscurity(destination.x,destination.y) == 5)
|
||||
ASB("Drop: Space is blocked.");
|
||||
else drop_item(current_pc,store_drop_item,destination);
|
||||
}
|
||||
overall_mode = MODE_TOWN;
|
||||
need_redraw = true;
|
||||
put_pc_screen();
|
||||
put_item_screen(stat_window,0);
|
||||
}
|
||||
// End : Targeting a space
|
||||
|
||||
}
|
||||
@@ -2504,7 +2503,7 @@ eDirection find_waterfall(short x, short y, short mode){
|
||||
for(eDirection i = DIR_N; i < DIR_HERE; i++){
|
||||
if(mode == 0){
|
||||
to_dir[i] = (scenario.ter_types[univ.town->terrain(x + dir_x_dif[i],y + dir_y_dif[i])].special == TER_SPEC_WATERFALL);
|
||||
printf("%i\n",scenario.ter_types[univ.town->terrain(x + dir_x_dif[i],y + dir_y_dif[i])].flag1);
|
||||
//printf("%i\n",scenario.ter_types[univ.town->terrain(x + dir_x_dif[i],y + dir_y_dif[i])].flag1);
|
||||
if(scenario.ter_types[univ.town->terrain(x + dir_x_dif[i],y + dir_y_dif[i])].flag1.u != i) to_dir[i] = false;
|
||||
}else{
|
||||
to_dir[i] = (scenario.ter_types[univ.out[x + dir_x_dif[i]][y + dir_y_dif[i]]].special == TER_SPEC_WATERFALL);
|
||||
|
@@ -171,10 +171,10 @@ void end_shop_mode()
|
||||
|
||||
HideControl(shop_sbar);
|
||||
if (store_pre_shop_mode == 20) {
|
||||
sprintf((char *)old_str1,"You conclude your business.");
|
||||
sprintf((char *)old_str2,"");
|
||||
sprintf((char *)one_back1,"You conclude your business.");
|
||||
sprintf((char *)one_back2,"");
|
||||
strcpy((char *)old_str1,"You conclude your business.");
|
||||
strcpy((char *)old_str2,"");
|
||||
strcpy((char *)one_back1,"You conclude your business.");
|
||||
strcpy((char *)one_back2,"");
|
||||
|
||||
strnum1 = strnum2 = oldstrnum1 = oldstrnum2 = 0;
|
||||
place_talk_str((char *)old_str1,"",0,dummy_rect);
|
||||
@@ -739,10 +739,10 @@ void handle_talk_event(Point p)
|
||||
if ((which_talk_entry < 0) || (which_talk_entry > 59)) {
|
||||
strcpy((char *) one_back1,(char *) old_str1);
|
||||
strcpy((char *) one_back2,(char *) old_str2);
|
||||
sprintf((char *) old_str2,"");
|
||||
strcpy((char *) old_str2,"");
|
||||
sprintf((char *) old_str1,"%s",univ.town.cur_talk->talk_strs[store_personality % 10 + 160]);
|
||||
if (strlen((char *) old_str1) < 2)
|
||||
sprintf((char *) old_str1,"You get no response.");
|
||||
strcpy((char *) old_str1,"You get no response.");
|
||||
place_talk_str((char *) old_str1,(char *) old_str2,0,dummy_rect);
|
||||
strnum1 = -1;
|
||||
return;
|
||||
@@ -768,7 +768,7 @@ void handle_talk_event(Point p)
|
||||
strnum1 = strnum2;
|
||||
strcpy((char *) place_string1,(char *) place_string2);
|
||||
}
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum2 = 0;
|
||||
break;
|
||||
case 2:
|
||||
@@ -791,14 +791,14 @@ void handle_talk_event(Point p)
|
||||
center = univ.town.p_loc;
|
||||
}
|
||||
strnum2 = 0;
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
break;
|
||||
case 4:
|
||||
if (day_reached((unsigned char) a,0) == true) {
|
||||
strnum1 = strnum2;
|
||||
strcpy((char *) place_string1,(char *) place_string2);
|
||||
}
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum2 = 0;
|
||||
break;
|
||||
case 5:
|
||||
@@ -806,7 +806,7 @@ void handle_talk_event(Point p)
|
||||
strnum1 = strnum2;
|
||||
strcpy((char *) place_string1,(char *) place_string2);
|
||||
}
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum2 = 0;
|
||||
break;
|
||||
case 6:
|
||||
@@ -814,7 +814,7 @@ void handle_talk_event(Point p)
|
||||
strnum1 = strnum2;
|
||||
strcpy((char *) place_string1,(char *) place_string2);
|
||||
}
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum2 = 0;
|
||||
break;
|
||||
case 7:
|
||||
@@ -878,7 +878,7 @@ void handle_talk_event(Point p)
|
||||
put_pc_screen();
|
||||
|
||||
}
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum2 = 0;
|
||||
break;
|
||||
case 19:
|
||||
@@ -898,14 +898,14 @@ void handle_talk_event(Point p)
|
||||
else give_error("Invalid Stuff Done flag called in conversation.","",0);
|
||||
}
|
||||
strnum2 = 0;
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
break;
|
||||
case 20:
|
||||
if (univ.party.gold < a) {
|
||||
strnum1 = strnum2;
|
||||
strnum2 = 0;
|
||||
strcpy((char *) place_string1,(char *) place_string2);
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
break;
|
||||
}
|
||||
else {
|
||||
@@ -914,15 +914,15 @@ void handle_talk_event(Point p)
|
||||
univ.party.gold -= a;
|
||||
put_pc_screen();
|
||||
univ.party.boats[i].property = false;
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum2 = 0;
|
||||
i = 1000;
|
||||
}
|
||||
if (i >= 1000)
|
||||
break;
|
||||
}
|
||||
sprintf((char *) place_string1, "There are no boats left.");
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string1, "There are no boats left.");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum1 = -1;
|
||||
strnum2 = -1;
|
||||
break;
|
||||
@@ -931,7 +931,7 @@ void handle_talk_event(Point p)
|
||||
strnum1 = strnum2;
|
||||
strnum2 = 0;
|
||||
strcpy((char *) place_string1,(char *) place_string2);
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
break;
|
||||
}
|
||||
else {
|
||||
@@ -940,15 +940,15 @@ void handle_talk_event(Point p)
|
||||
univ.party.gold -= a;
|
||||
put_pc_screen();
|
||||
univ.party.horses[i].property = false;
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum2 = 0;
|
||||
i = 1000;
|
||||
}
|
||||
if (i >= 1000)
|
||||
break;
|
||||
}
|
||||
sprintf((char *) place_string1, "There are no horses left.");
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string1, "There are no horses left.");
|
||||
strcpy((char *) place_string2,"");
|
||||
strnum1 = -1;
|
||||
strnum2 = -1;
|
||||
break;
|
||||
@@ -967,7 +967,7 @@ void handle_talk_event(Point p)
|
||||
univ.party.spec_items[a] = 1;
|
||||
}
|
||||
strnum2 = 0;
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
break;
|
||||
case 23:
|
||||
start_shop_mode(5 + b,0,
|
||||
@@ -987,7 +987,7 @@ void handle_talk_event(Point p)
|
||||
univ.party.can_find_town[b] = 1;
|
||||
}
|
||||
strnum2 = 0;
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
break;
|
||||
case 25:
|
||||
talk_end_forced = true;
|
||||
@@ -1014,8 +1014,8 @@ void handle_talk_event(Point p)
|
||||
if ((s1 >= 0) || (s2 >= 0)) {
|
||||
strnum1 = -1;
|
||||
strnum2 = -1;
|
||||
sprintf((char *) place_string1,"");
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string1,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
}
|
||||
get_strs((char *) place_string1,(char *) place_string2,2,s1,s2);
|
||||
//strnum1 = -1;
|
||||
@@ -1031,8 +1031,8 @@ void handle_talk_event(Point p)
|
||||
if ((s1 >= 0) || (s2 >= 0)) {
|
||||
strnum1 = -1;
|
||||
strnum2 = -1;
|
||||
sprintf((char *) place_string1,"");
|
||||
sprintf((char *) place_string2,"");
|
||||
strcpy((char *) place_string1,"");
|
||||
strcpy((char *) place_string2,"");
|
||||
}
|
||||
get_strs((char *) place_string1,(char *) place_string2,0,s1,s2);
|
||||
//strnum1 = -1;
|
||||
|
@@ -4,8 +4,6 @@
|
||||
#include <sstream>
|
||||
#include "boe.consts.h"
|
||||
|
||||
//#define EXILE_BIG_GUNS 1
|
||||
|
||||
#define SLEEP_TICKS 2L
|
||||
#define MOUSE_REGION 0L
|
||||
#define DRAG_EDGE 15
|
||||
|
@@ -630,9 +630,27 @@ void draw_startup_stats()
|
||||
switch (univ.party[i].main_status) {
|
||||
case MAIN_STATUS_ALIVE:
|
||||
switch (univ.party[i].race) {
|
||||
case 0: sprintf((char *) str,"Level %d Human",univ.party[i].level); break;
|
||||
case 1: sprintf((char *) str,"Level %d Nephilim",univ.party[i].level); break;
|
||||
case 2: sprintf((char *) str,"Level %d Slithzerikai",univ.party[i].level); break;
|
||||
case RACE_HUMAN: sprintf((char *) str,"Level %d Human",univ.party[i].level); break;
|
||||
case RACE_NEPHIL: sprintf((char *) str,"Level %d Nephilim",univ.party[i].level); break;
|
||||
case RACE_SLITH: sprintf((char *) str,"Level %d Slithzerikai",univ.party[i].level); break;
|
||||
case RACE_VAHNATAI: sprintf((char *) str,"Level %d Vahnatai",univ.party[i].level); break;
|
||||
case RACE_REPTILE: sprintf((char *) str,"Level %d Reptile",univ.party[i].level); break;
|
||||
case RACE_BEAST: sprintf((char *) str,"Level %d Beast",univ.party[i].level); break;
|
||||
case RACE_IMPORTANT: sprintf((char *) str,"Level %d V.I.P.",univ.party[i].level); break;
|
||||
case RACE_MAGE: sprintf((char *) str,"Level %d Human Mage",univ.party[i].level); break;
|
||||
case RACE_PRIEST: sprintf((char *) str,"Level %d Human Priest",univ.party[i].level); break;
|
||||
case RACE_HUMANOID: sprintf((char *) str,"Level %d Humanoid",univ.party[i].level); break;
|
||||
case RACE_DEMON: sprintf((char *) str,"Level %d Demon",univ.party[i].level); break;
|
||||
case RACE_UNDEAD: sprintf((char *) str,"Level %d Undead",univ.party[i].level); break;
|
||||
case RACE_GIANT: sprintf((char *) str,"Level %d Giant",univ.party[i].level); break;
|
||||
case RACE_SLIME: sprintf((char *) str,"Level %d Slime",univ.party[i].level); break;
|
||||
case RACE_STONE: sprintf((char *) str,"Level %d Golem",univ.party[i].level); break;
|
||||
case RACE_BUG: sprintf((char *) str,"Level %d Bug",univ.party[i].level); break;
|
||||
case RACE_DRAGON: sprintf((char *) str,"Level %d Dragon",univ.party[i].level); break;
|
||||
case RACE_MAGICAL: sprintf((char *) str,"Level %d Magical Creature",univ.party[i].level); break;
|
||||
case RACE_PLANT: sprintf((char *) str,"Level %d Plant",univ.party[i].level); break;
|
||||
case RACE_BIRD: sprintf((char *) str,"Level %d Bird",univ.party[i].level); break;
|
||||
default: sprintf((char *) str,"Level %d *ERROR INVALID RACE*",univ.party[i].level); break;
|
||||
}
|
||||
char_win_draw_string(mainPtr,pc_rect,(char *) str,0,18,true);
|
||||
OffsetRect(&pc_rect,0,13);
|
||||
@@ -1757,7 +1775,6 @@ GWorldPtr load_pict(short picture_to_get)
|
||||
// right now, trying a restrictive rule (just cave floor and grass, mainly)
|
||||
bool is_nature(char x, char y, unsigned char ground_t)
|
||||
{
|
||||
short pic;
|
||||
ter_num_t ter_type;
|
||||
|
||||
ter_type = coord_to_ter((short) x,(short) y);
|
||||
|
@@ -350,7 +350,8 @@ void put_item_info(short pc,short item)////
|
||||
cd_set_item_num(998,8,s_i.protection);
|
||||
|
||||
switch (s_i.variety) {
|
||||
case 1: case 2:
|
||||
case ITEM_TYPE_ONE_HANDED:
|
||||
case ITEM_TYPE_TWO_HANDED:
|
||||
cd_set_item_num(998,6,s_i.item_level);
|
||||
cd_set_item_num(998,7,s_i.bonus);
|
||||
|
||||
@@ -371,25 +372,42 @@ void put_item_info(short pc,short item)////
|
||||
if (s_i.ability == 0)
|
||||
cd_set_item_text(998,12,store_text);
|
||||
break;
|
||||
case 4: case 23:
|
||||
case ITEM_TYPE_BOW:
|
||||
case ITEM_TYPE_CROSSBOW:
|
||||
cd_set_item_num(998,6,s_i.item_level);
|
||||
cd_set_item_num(998,7,s_i.bonus);
|
||||
break;
|
||||
case 5: case 6: case 24: case 25:
|
||||
case ITEM_TYPE_ARROW:
|
||||
case ITEM_TYPE_THROWN_MISSILE:
|
||||
case ITEM_TYPE_BOLTS:
|
||||
case ITEM_TYPE_MISSILE_NO_AMMO:
|
||||
cd_set_item_num(998,6,s_i.item_level);
|
||||
cd_set_item_num(998,7,s_i.bonus);
|
||||
break;
|
||||
case 7: case 18:
|
||||
case ITEM_TYPE_POTION:
|
||||
case ITEM_TYPE_RING:
|
||||
case ITEM_TYPE_SCROLL: // TODO: Does this make sense for a scroll, though?
|
||||
case ITEM_TYPE_TOOL: // and what about for a tool?
|
||||
case ITEM_TYPE_WAND: // and a wand? Maybe showing ability strength would be better...
|
||||
case ITEM_TYPE_NECKLACE: // TODO: This doesn't seem right for a necklace...
|
||||
cd_set_item_num(998,11,s_i.item_level);
|
||||
break;
|
||||
case 12: case 13: case 14: case 15: case 16: case 17:
|
||||
case ITEM_TYPE_SHIELD:
|
||||
case ITEM_TYPE_ARMOR:
|
||||
case ITEM_TYPE_HELM:
|
||||
case ITEM_TYPE_GLOVES:
|
||||
case ITEM_TYPE_SHIELD_2:
|
||||
case ITEM_TYPE_BOOTS: // TODO: Should this also check ITEM_TYPE_PANTS?
|
||||
cd_set_item_num(998,7,s_i.bonus + s_i.protection);
|
||||
cd_set_item_num(998,8,s_i.item_level);
|
||||
cd_set_item_num(998,9,s_i.awkward);
|
||||
break;
|
||||
case 20:
|
||||
case ITEM_TYPE_WEAPON_POISON:
|
||||
cd_set_item_num(998,11,s_i.item_level);
|
||||
break;
|
||||
default:
|
||||
// no item, gold, food, non-use, unused 1 and 2: do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1413,7 +1413,6 @@ bool summon_monster(m_num_t which,location where,short duration,short given_atti
|
||||
void activate_monsters(short code,short attitude)
|
||||
{
|
||||
short i;
|
||||
m_num_t which;
|
||||
|
||||
if (code == 0)
|
||||
return;
|
||||
|
@@ -882,7 +882,7 @@ char *cost_strs[] = {"Extremely Cheap","Very Reasonable","Pretty Average","Somew
|
||||
base_item = store_alchemy(what_chosen - 500);
|
||||
draw_dialog_graphic( talk_gworld, shopping_rects[i][2],53,PICT_ITEM, false,1);//// all graphic nums
|
||||
strcpy(cur_name,base_item.full_name.c_str());
|
||||
sprintf(cur_info_str,"");
|
||||
strcpy(cur_info_str,"");
|
||||
break;
|
||||
case 6:
|
||||
//base_item = food_types[what_chosen - 600];
|
||||
@@ -894,20 +894,20 @@ char *cost_strs[] = {"Extremely Cheap","Very Reasonable","Pretty Average","Somew
|
||||
what_chosen -= 700;
|
||||
draw_dialog_graphic( talk_gworld, shopping_rects[i][2],99,PICT_ITEM, false,1);
|
||||
strcpy(cur_name,heal_types[what_chosen]);
|
||||
sprintf(cur_info_str,"");
|
||||
strcpy(cur_info_str,"");
|
||||
break;
|
||||
case 8:
|
||||
base_item = store_mage_spells(what_chosen - 800 - 30);
|
||||
draw_dialog_graphic( talk_gworld, shopping_rects[i][2],base_item.graphic_num,PICT_ITEM, false,1);
|
||||
|
||||
strcpy(cur_name,base_item.full_name.c_str());
|
||||
sprintf(cur_info_str,"");
|
||||
strcpy(cur_info_str,"");
|
||||
break;
|
||||
case 9:
|
||||
base_item = store_priest_spells(what_chosen - 900 - 30);
|
||||
draw_dialog_graphic( talk_gworld, shopping_rects[i][2],base_item.graphic_num,PICT_ITEM, false,1);
|
||||
strcpy(cur_name,base_item.full_name.c_str());
|
||||
sprintf(cur_info_str,"");
|
||||
strcpy(cur_info_str,"");
|
||||
break;
|
||||
default:
|
||||
what_magic_shop = (what_chosen / 1000) - 1;
|
||||
@@ -1043,15 +1043,15 @@ cItemRec store_alchemy(short which_s)
|
||||
void get_item_interesting_string(cItemRec item,char *message)
|
||||
{
|
||||
if (item.is_property() == true) {
|
||||
sprintf(message,"Not yours.");
|
||||
strcpy(message,"Not yours.");
|
||||
return;
|
||||
}
|
||||
if (item.is_ident() == false) {
|
||||
sprintf(message,"");
|
||||
strcpy(message,"");
|
||||
return;
|
||||
}
|
||||
if (item.is_cursed() == true) {
|
||||
sprintf(message,"Cursed item.");
|
||||
strcpy(message,"Cursed item.");
|
||||
return;
|
||||
}
|
||||
switch (item.variety) {
|
||||
@@ -1077,7 +1077,7 @@ void get_item_interesting_string(cItemRec item,char *message)
|
||||
sprintf(message,"Poison: Does %d-%d damage.",item.item_level,item.item_level * 6);
|
||||
break;
|
||||
default:
|
||||
sprintf(message,"");
|
||||
strcpy(message,"");
|
||||
if (item.charges > 0)
|
||||
sprintf(message,"Uses: %d",item.charges);
|
||||
break;
|
||||
|
@@ -129,6 +129,7 @@ cMonster::cAttack::operator int(){
|
||||
cMonster::cAttack& cMonster::cAttack::operator=(int n){
|
||||
dice = n / 100;
|
||||
sides = n % 100;
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::ostream& operator << (std::ostream& out, eStatus& e){
|
||||
|
@@ -970,7 +970,6 @@ void load_spec_graphics()
|
||||
bool load_party_v1(FSSpec file_to_load, bool town_restore, bool in_scen, bool maps_there, bool must_port);
|
||||
bool load_party_v2(FSSpec file_to_load, bool town_restore, bool in_scen, bool maps_there);
|
||||
bool load_party(FSSpec file_to_load){
|
||||
long file_size;
|
||||
OSErr error;
|
||||
bool town_restore = false;
|
||||
bool maps_there = false;
|
||||
|
Reference in New Issue
Block a user