Both the game and the scenario editor now properly load a scenario.

This means that the game can in fact be played – though saving is not currently operational.

git-svn-id: http://openexile.googlecode.com/svn/trunk@32 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
2009-04-25 22:50:58 +00:00
parent 3ba7021543
commit d3be0c107e
41 changed files with 1790 additions and 1638 deletions

View File

@@ -2,6 +2,7 @@
#include "pc.graphics.h"
#include "pc.global.h"
#include "classes.h"
#include "pc.editors.h"
#include "pc.fileio.h"
#include "pc.action.h"
@@ -13,25 +14,26 @@
#include "dlgutil.h"
/* Adventure globals */
extern party_record_type party;
extern pc_record_type adven[6];
extern outdoor_record_type outdoors[2][2];
extern current_town_type c_town;
extern big_tr_type t_d;
extern town_item_list t_i;
extern unsigned char out[96][96],out_e[96][96];
extern setup_save_type setup_save;
extern stored_items_list_type stored_items[3];
extern stored_town_maps_type town_maps;
extern stored_outdoor_maps_type o_maps;
//extern party_record_type party;
//extern pc_record_type ADVEN[6];
//extern outdoor_record_type outdoors[2][2];
//extern current_town_type c_town;
//extern big_tr_type t_d;
//extern town_item_list t_i;
//extern unsigned char out[96][96],out_e[96][96];
//extern setup_save_type setup_save;
//extern stored_items_list_type stored_items[3];
//extern stored_town_maps_type town_maps;
//extern stored_outdoor_maps_type o_maps;
extern cUniverse univ;
extern Boolean ed_reg;
extern long ed_flag,ed_key;
//extern Boolean ed_reg;
//extern long ed_flag,ed_key;
extern WindowPtr mainPtr;
extern Boolean file_in_mem;
extern short current_cursor,dialog_answer;
extern long register_flag;
//extern long register_flag;
extern GWorldPtr pc_gworld;
extern Boolean diff_depth_ok,save_blocked;
@@ -51,7 +53,7 @@ extern Rect edit_rect[5][2];
short store_trait_mode,store_train_pc;
pc_record_type *store_xp_pc;
cPlayer *store_xp_pc;
// Variables for spending xp
Boolean talk_done = FALSE;
@@ -91,7 +93,7 @@ Boolean handle_action(EventRecord event,short mode)
for (i = 0; i < 6; i++)
if ((PtInRect(the_point,&pc_area_buttons[i][0]) == TRUE) &&
(adven[i].main_status > 0)) {
(ADVEN[i].main_status > 0)) {
do_button_action(0,i);
current_active_pc = i;
display_party(6,1);
@@ -99,9 +101,9 @@ Boolean handle_action(EventRecord event,short mode)
}
for (i = 0; i < 5; i++)
if ((PtInRect(the_point,&edit_rect[i][0]) == TRUE) &&
(adven[current_active_pc].main_status > 0)) {
(ADVEN[current_active_pc].main_status > 0)) {
do_button_action(0,i + 10);
if ((ed_reg == FALSE) && (save_blocked == FALSE))
if (save_blocked == FALSE)
if ((choice = FCD(904,0)) == 1)
return to_return;
else save_blocked = TRUE;
@@ -113,29 +115,29 @@ Boolean handle_action(EventRecord event,short mode)
display_pc(current_active_pc,1,0);
break;
case 2:
pick_race_abil(&adven[current_active_pc],0,0);
pick_race_abil(&ADVEN[current_active_pc],0,0);
break;
case 3:
spend_xp(current_active_pc,1,0);
break;
case 4:
edit_xp(&adven[current_active_pc]);
edit_xp(&ADVEN[current_active_pc]);
break;
}
}
for (i = 0; i < 24; i++)
if ((PtInRect(the_point,&item_string_rects[i][1]) == TRUE) && // drop item
(adven[current_active_pc].items[i].variety > 0)) { // variety = 0 no item in slot/ non 0 item exists
(ADVEN[current_active_pc].items[i].variety > 0)) { // variety = 0 no item in slot/ non 0 item exists
flash_rect(item_string_rects[i][1]);
take_item(current_active_pc,i);
draw_items(1);
}
for (i = 0; i < 24; i++)
if ((PtInRect(the_point,&item_string_rects[i][2]) == TRUE) && // identify item
(adven[current_active_pc].items[i].variety > 0)) {
(ADVEN[current_active_pc].items[i].variety > 0)) {
flash_rect(item_string_rects[i][2]);
adven[current_active_pc].items[i].item_properties = adven[current_active_pc].items[i].item_properties | 1;
ADVEN[current_active_pc].items[i].item_properties = ADVEN[current_active_pc].items[i].item_properties | 1;
draw_items(1);
}
@@ -183,16 +185,16 @@ void edit_gold_or_food(short which_to_edit)
make_cursor_sword();
cd_create_dialog((which_to_edit == 0) ? 1012 : 947, mainPtr);
sprintf((char *) sign_text,"%d",(short) ((which_to_edit == 0) ? party.gold : party.food));
sprintf((char *) sign_text,"%d",(short) ((which_to_edit == 0) ? univ.party.gold : univ.party.food));
cd_set_text_edit_str((which_to_edit == 0) ? 1012 : 947,2,(char *) sign_text);
item_hit = cd_run_dialog();
cd_kill_dialog((which_to_edit == 0) ? 1012 : 947,0);
dialog_answer = minmax(0,25000,dialog_answer);
if (which_to_edit == 0)
party.gold = dialog_answer;
univ.party.gold = dialog_answer;
else
party.food = dialog_answer;
univ.party.food = dialog_answer;
}
void edit_day_event_filter (short item_hit)
@@ -224,7 +226,7 @@ void edit_day()
cd_create_dialog(917,mainPtr);
sprintf((char *) sign_text,"%d",(short) ( ((party.age) / 3700) + 1));
sprintf((char *) sign_text,"%d",(short) ( ((univ.party.age) / 3700) + 1));
cd_set_text_edit_str(917,2,(char *) sign_text);
item_hit = cd_run_dialog();
@@ -233,7 +235,7 @@ void edit_day()
dialog_answer = minmax(0,500,dialog_answer);
party.age = (long) (3700) * (long) (dialog_answer);
univ.party.age = (long long) (3700) * (long long) (dialog_answer);
}
@@ -242,13 +244,13 @@ void put_pc_graphics()
short item_hit,what_talk_field,i;
for (i = 3; i < 65; i++) {
if (((store_trait_mode == 0) && (adven[which_pc_displayed].mage_spells[i - 3] == TRUE)) ||
((store_trait_mode == 1) && (adven[which_pc_displayed].priest_spells[i - 3] == TRUE)))
if (((store_trait_mode == 0) && (ADVEN[which_pc_displayed].mage_spells[i - 3] == TRUE)) ||
((store_trait_mode == 1) && (ADVEN[which_pc_displayed].priest_spells[i - 3] == TRUE)))
cd_set_led(991,i,1);
else cd_set_led(991,i,0);
}
cd_set_item_text(991,69,adven[which_pc_displayed].name);
cd_set_item_text(991,69,ADVEN[which_pc_displayed].name);
}
void display_pc_event_filter (short item_hit)
{
@@ -263,25 +265,25 @@ void display_pc_event_filter (short item_hit)
case 66:
do {
pc_num = (pc_num == 0) ? 5 : pc_num - 1;
} while (adven[pc_num].main_status == 0);
} while (ADVEN[pc_num].main_status == 0);
which_pc_displayed = pc_num;
put_pc_graphics();
break;
case 67:
do {
pc_num = (pc_num == 5) ? 0 : pc_num + 1;
} while (adven[pc_num].main_status == 0);
} while (ADVEN[pc_num].main_status == 0);
which_pc_displayed = pc_num;
put_pc_graphics();
break;
default:
if (store_trait_mode == 0)
adven[which_pc_displayed].mage_spells[item_hit - 3] =
1 - adven[which_pc_displayed].mage_spells[item_hit - 3];
ADVEN[which_pc_displayed].mage_spells[item_hit - 3] =
1 - ADVEN[which_pc_displayed].mage_spells[item_hit - 3];
else
adven[which_pc_displayed].priest_spells[item_hit - 3] =
1 - adven[which_pc_displayed].priest_spells[item_hit - 3];
ADVEN[which_pc_displayed].priest_spells[item_hit - 3] =
1 - ADVEN[which_pc_displayed].priest_spells[item_hit - 3];
put_pc_graphics();
break;
}
@@ -292,9 +294,9 @@ void display_pc(short pc_num,short mode,short parent)
short i,item_hit;
Str255 label_str;
if (adven[pc_num].main_status == 0) {
if (ADVEN[pc_num].main_status == 0) {
for (pc_num = 0; pc_num < 6; pc_num++)
if (adven[pc_num].main_status == 1)
if (ADVEN[pc_num].main_status == 1)
break;
}
which_pc_displayed = pc_num;
@@ -326,12 +328,12 @@ void display_alchemy_event_filter (short item_hit)
toast_dialog();
break;
default:
party.alchemy[item_hit - 4] = 1 - party.alchemy[item_hit - 4];
univ.party.alchemy[item_hit - 4] = 1 - univ.party.alchemy[item_hit - 4];
break;
}
for (i = 0; i < 20; i++) {
if (party.alchemy[i] > 0)
if (univ.party.alchemy[i] > 0)
cd_set_led(996,i + 4,1);
else cd_set_led(996,i + 4,0);
}
@@ -356,7 +358,7 @@ void display_alchemy()
for (i = 0; i < 20; i++) {
cd_add_label(996,i + 4,alch_names[i],1083);
if (party.alchemy[i] > 0)
if (univ.party.alchemy[i] > 0)
cd_set_led(996,i + 4,1);
else cd_set_led(996,i + 4,0);
}
@@ -370,11 +372,11 @@ void display_alchemy()
void do_xp_keep(short pc_num,short mode)
{
for (i = 0; i < 20; i++)
adven[pc_num].skills[i] = store_skills[i];
adven[pc_num].cur_health += store_h - adven[pc_num].max_health;
adven[pc_num].max_health = store_h;
adven[pc_num].cur_sp += store_sp - adven[pc_num].max_sp;
adven[pc_num].max_sp = store_sp;
ADVEN[pc_num].skills[i] = store_skills[i];
ADVEN[pc_num].cur_health += store_h - ADVEN[pc_num].max_health;
ADVEN[pc_num].max_health = store_h;
ADVEN[pc_num].cur_sp += store_sp - ADVEN[pc_num].max_sp;
ADVEN[pc_num].max_sp = store_sp;
}
@@ -409,15 +411,15 @@ void do_xp_draw()
pc_num = store_train_pc;
sprintf((char *) get_text, "%s",(char *) adven[pc_num].name);
sprintf((char *) get_text, "%s",(char *) ADVEN[pc_num].name);
cd_set_item_text (1010, 51,get_text);
for (i = 0; i < 20; i++)
store_skills[i] = adven[pc_num].skills[i];
store_h = adven[pc_num].max_health;
store_sp = adven[pc_num].max_sp;
store_skills[i] = ADVEN[pc_num].skills[i];
store_h = ADVEN[pc_num].max_health;
store_sp = ADVEN[pc_num].max_sp;
store_g = 12000;
store_skp = 10000;
@@ -508,7 +510,7 @@ void spend_xp_event_filter (short item_hit)
do_xp_keep(pc_num,0);
do {
pc_num = (pc_num == 0) ? 5 : pc_num - 1;
} while (adven[pc_num].main_status != 1);
} while (ADVEN[pc_num].main_status != 1);
store_train_pc = pc_num;
do_xp_draw();
break;
@@ -518,7 +520,7 @@ void spend_xp_event_filter (short item_hit)
do_xp_keep(pc_num,0);
do {
pc_num = (pc_num == 5) ? 0 : pc_num + 1;
} while (adven[pc_num].main_status != 1);
} while (ADVEN[pc_num].main_status != 1);
store_train_pc = pc_num;
do_xp_draw();
break;
@@ -651,7 +653,7 @@ void edit_xp_event_filter (short item_hit)
toast_dialog();
}
void edit_xp(pc_record_type *pc)
void edit_xp(cPlayer *pc)
{
short item_hit;
@@ -666,7 +668,7 @@ void edit_xp(pc_record_type *pc)
sprintf((char *) sign_text,"%d",(short)pc->experience);
cd_set_text_edit_str(1024,2,(char *) sign_text);
item_hit = get_tnl(store_xp_pc);
item_hit = store_xp_pc->get_tnl();
cdsin(1024,8,item_hit);
item_hit = cd_run_dialog();

View File

@@ -20,4 +20,4 @@ void do_registration();
void edit_day();
void edit_day_event_filter (short item_hit);
void edit_xp_event_filter (short item_hit);
void edit_xp(pc_record_type *pc);
void edit_xp(cPlayer *pc);

View File

@@ -1,20 +1,22 @@
#include "pc.graphics.h"
#include "pc.global.h"
#include "classes.h"
#include "pc.editors.h"
#include "graphtool.h"
#include "dlgtool.h"
/* Adventure globals */
extern party_record_type party;
extern pc_record_type adven[6];
extern outdoor_record_type outdoors[2][2];
extern current_town_type c_town;
extern big_tr_type t_d;
extern town_item_list t_i;
extern unsigned char out[96][96],out_e[96][96];
extern setup_save_type setup_save;
extern stored_items_list_type stored_items[3];
//extern party_record_type party;
//extern pc_record_type ADVEN[6];
//extern outdoor_record_type outdoors[2][2];
//extern current_town_type c_town;
//extern big_tr_type t_d;
//extern town_item_list t_i;
//extern unsigned char out[96][96],out_e[96][96];
//extern setup_save_type setup_save;
//extern stored_items_list_type stored_items[3];
extern cUniverse univ;
extern short dialog_answer;
@@ -40,7 +42,7 @@ Boolean choice_active[6];
extern short store_trait_mode;
pc_record_type *store_pc;
cPlayer *store_pc;
GWorldPtr button_num_gworld;
@@ -51,49 +53,49 @@ void combine_things(short pc_num)
short i,j,test;
for (i = 0; i < 24; i++) {
if ((adven[pc_num].items[i].variety > 0) &&
(adven[pc_num].items[i].type_flag > 0) && (adven[pc_num].items[i].item_properties & 254 != 0)) {
if ((ADVEN[pc_num].items[i].variety > 0) &&
(ADVEN[pc_num].items[i].type_flag > 0) && (ADVEN[pc_num].items[i].item_properties & 254 != 0)) {
for (j = i + 1; j < 24; j++)
if ((adven[pc_num].items[j].variety > 0) &&
(adven[pc_num].items[j].type_flag == adven[pc_num].items[i].type_flag)
&& (adven[pc_num].items[j].item_properties & 254 != 0)) {
if ((ADVEN[pc_num].items[j].variety > 0) &&
(ADVEN[pc_num].items[j].type_flag == ADVEN[pc_num].items[i].type_flag)
&& (ADVEN[pc_num].items[j].item_properties & 254 != 0)) {
add_string_to_buf("(items combined)");
test = (short) (adven[pc_num].items[i].charges) + (short) (adven[pc_num].items[j].charges);
test = (short) (ADVEN[pc_num].items[i].charges) + (short) (ADVEN[pc_num].items[j].charges);
if (test > 125) {
adven[pc_num].items[i].charges = 125;
ADVEN[pc_num].items[i].charges = 125;
ASB("Can have at most 125 of any item.");
}
else adven[pc_num].items[i].charges += adven[pc_num].items[j].charges;
if (adven[pc_num].equip[j] == TRUE) {
adven[pc_num].equip[i] = TRUE;
adven[pc_num].equip[j] = FALSE;
else ADVEN[pc_num].items[i].charges += ADVEN[pc_num].items[j].charges;
if (ADVEN[pc_num].equip[j] == TRUE) {
ADVEN[pc_num].equip[i] = TRUE;
ADVEN[pc_num].equip[j] = FALSE;
}
take_item(pc_num,j);
}
}
if ((adven[pc_num].items[i].variety > 0) && (adven[pc_num].items[i].charges < 0))
adven[pc_num].items[i].charges = 1;
if ((ADVEN[pc_num].items[i].variety > 0) && (ADVEN[pc_num].items[i].charges < 0))
ADVEN[pc_num].items[i].charges = 1;
}
}
Boolean give_to_pc(short pc_num,item_record_type item, short print_result)
Boolean give_to_pc(short pc_num,cItemRec item, short print_result)
{
short free_space;
char announce_string[60];
if (item.variety == 0)
return TRUE;
if (((free_space = pc_has_space(pc_num)) == 24 ) || (adven[pc_num].main_status != 1))
if (((free_space = pc_has_space(pc_num)) == 24 ) || (ADVEN[pc_num].main_status != 1))
return FALSE;
else {
adven[pc_num].items[free_space] = item;
ADVEN[pc_num].items[free_space] = item;
combine_things(pc_num);
return TRUE;
}
return FALSE;
}
Boolean give_to_party(item_record_type item,short print_result)
Boolean give_to_party(cItemRec item,short print_result)
{
short free_space, i = 0;
@@ -107,14 +109,14 @@ Boolean give_to_party(item_record_type item,short print_result)
void give_gold(short amount,Boolean print_result)
{
party.gold = party.gold + amount;
univ.party.gold = univ.party.gold + amount;
}
Boolean take_gold(short amount,Boolean print_result)
{
if (party.gold < amount)
if (univ.party.gold < amount)
return FALSE;
party.gold = party.gold - amount;
univ.party.gold = univ.party.gold - amount;
return TRUE;
}
@@ -124,7 +126,7 @@ short pc_has_space(short pc_num)
short i = 0;
while (i < 24) {
if (adven[pc_num].items[i].variety == 0)
if (ADVEN[pc_num].items[i].variety == 0)
return i;
i++;
}
@@ -138,48 +140,48 @@ void take_item(short pc_num,short which_item)
short i;
Boolean do_print = TRUE;
if ((adven[pc_num].weap_poisoned == which_item) && (adven[pc_num].status[0] > 0)) {
if ((ADVEN[pc_num].weap_poisoned == which_item) && (ADVEN[pc_num].status[0] > 0)) {
// add_string_to_buf(" Poison lost. ");
adven[pc_num].status[0] = 0;
ADVEN[pc_num].status[0] = 0;
}
if ((adven[pc_num].weap_poisoned > which_item) && (adven[pc_num].status[0] > 0))
adven[pc_num].weap_poisoned--;
if ((ADVEN[pc_num].weap_poisoned > which_item) && (ADVEN[pc_num].status[0] > 0))
ADVEN[pc_num].weap_poisoned--;
for (i = which_item; i < 23; i++) {
adven[pc_num].items[i] = adven[pc_num].items[i + 1];
adven[pc_num].equip[i] = adven[pc_num].equip[i + 1];
ADVEN[pc_num].items[i] = ADVEN[pc_num].items[i + 1];
ADVEN[pc_num].equip[i] = ADVEN[pc_num].equip[i + 1];
}
adven[pc_num].items[23].variety = 0;
adven[pc_num].equip[23] = FALSE;
ADVEN[pc_num].items[23].variety = 0;
ADVEN[pc_num].equip[23] = FALSE;
}
void fancy_choice_dialog_event_filter (short item_hit)
{
toast_dialog();
dialog_answer = item_hit;
}
short fancy_choice_dialog(short which_dlog,short parent)
// ignore parent in Mac version
{
short item_hit,i,store_dialog_answer;
Str255 temp_str;
store_dialog_answer = dialog_answer;
make_cursor_sword();
cd_create_dialog_parent_num(which_dlog,parent);
item_hit = cd_run_dialog();
cd_kill_dialog(which_dlog,0);
i = dialog_answer;
dialog_answer = store_dialog_answer;
return i;
}
//void fancy_choice_dialog_event_filter (short item_hit)
//{
// toast_dialog();
// dialog_answer = item_hit;
//}
//
//short fancy_choice_dialog(short which_dlog,short parent)
//// ignore parent in Mac version
//{
// short item_hit,i,store_dialog_answer;
// Str255 temp_str;
//
// store_dialog_answer = dialog_answer;
// make_cursor_sword();
//
// cd_create_dialog_parent_num(which_dlog,parent);
//
// item_hit = cd_run_dialog();
// cd_kill_dialog(which_dlog,0);
//
// i = dialog_answer;
// dialog_answer = store_dialog_answer;
//
// return i;
//}
void select_pc_event_filter (short item_hit)
{
@@ -203,13 +205,13 @@ short char_select_pc(short active_only,short free_inv_only,char *title)
else csit( 1018,15,title);
for (i = 0; i < 6; i++) {
if ((adven[i].main_status == 0) ||
((active_only == TRUE) && (adven[i].main_status > 1)) ||
((free_inv_only == 1) && (pc_has_space(i) == 24)) || (adven[i].main_status == 5)) {
if ((ADVEN[i].main_status == 0) ||
((active_only == TRUE) && (ADVEN[i].main_status > 1)) ||
((free_inv_only == 1) && (pc_has_space(i) == 24)) || (ADVEN[i].main_status == 5)) {
cd_activate_item(1018, 3 + i, 0);
}
if (adven[i].main_status != 0) {
csit(1018,9 + i,adven[i].name);
if (ADVEN[i].main_status != 0) {
csit(1018,9 + i,ADVEN[i].name);
}
else cd_activate_item(1018, 9 + i, 0);
}
@@ -285,8 +287,8 @@ short party_total_level()
short i,j = 0;
for (i = 0; i < 6; i++)
if (adven[i].main_status == 1)
j += adven[i].level;
if (ADVEN[i].main_status == 1)
j += ADVEN[i].level;
return j;
}
@@ -297,8 +299,8 @@ short luck_total()
short i = 0;
for (i = 0; i < 6; i++)
if (adven[i].main_status == 1)
i += adven[i].skills[18];
if (ADVEN[i].main_status == 1)
i += ADVEN[i].skills[18];
return i;
}
@@ -317,14 +319,14 @@ void display_traits_graphics()
cd_set_led(1013,36 + i,(store_pc->traits[10 + i] > 0) ? 1 : 0);
}
store = get_tnl(store_pc);
store = store_pc->get_tnl();
cdsin(1013,18,store);
}
void pick_race_abil_event_filter(short item_hit)
{
Str255 abil_str;
pc_record_type *pc;
cPlayer *pc;
pc = store_pc;
switch (item_hit) {
@@ -358,7 +360,7 @@ void pick_race_abil_event_filter(short item_hit)
}
void pick_race_abil(pc_record_type *pc,short mode,short parent_num)
void pick_race_abil(cPlayer *pc,short mode,short parent_num)
//mode; // 0 - edit 1 - just display 2 - can't change race
{
char *start_str1 = "Click on advantage button for description.";
@@ -383,22 +385,22 @@ void pick_race_abil(pc_record_type *pc,short mode,short parent_num)
}
short get_tnl(pc_record_type *pc)
{
short tnl = 100,i,store_per = 100;
short rp[3] = {0,12,20};
short ap[15] = {10,20,8,10,4, 6,10,7,12,15, -10,-8,-8,-20,-8};
tnl = (tnl * (100 + rp[pc->race])) / 100;
for (i = 0; i < 15; i++)
if (pc->traits[i] == TRUE)
store_per = store_per + ap[i];
tnl = (tnl * store_per) / 100;
return tnl;
}
//short get_tnl(pc_record_type *pc)
//{
// short tnl = 100,i,store_per = 100;
// short rp[3] = {0,12,20};
// short ap[15] = {10,20,8,10,4, 6,10,7,12,15, -10,-8,-8,-20,-8};
//
// tnl = (tnl * (100 + rp[pc->race])) / 100;
// for (i = 0; i < 15; i++)
// if (pc->traits[i] == TRUE)
// store_per = store_per + ap[i];
//
// tnl = (tnl * store_per) / 100;
//
// return tnl;
//}
//
//display_strings(20,7,0,0,"Editing party",57,707,916);

View File

@@ -1,11 +1,11 @@
Boolean give_to_pc(short pc_num,item_record_type item, short print_result);
Boolean give_to_party(item_record_type item,short print_result);
Boolean give_to_pc(short pc_num,cItemRec item, short print_result);
Boolean give_to_party(cItemRec item,short print_result);
void give_gold(short amount,Boolean print_result);
Boolean take_gold(short amount,Boolean print_result);
short pc_has_space(short pc_num);
void take_item(short pc_num,short which_item);
void fancy_choice_dialog_event_filter (short item_hit);
short fancy_choice_dialog(short which_dlog,short parent);
//void fancy_choice_dialog_event_filter (short item_hit);
//short fancy_choice_dialog(short which_dlog,short parent);
void select_pc_event_filter (short item_hit);
short char_select_pc(short active_only,short free_inv_only,char *title);
short select_pc(short active_only,short free_inv_only);
@@ -16,7 +16,7 @@ short party_total_level();
short luck_total();
void display_traits_graphics();
void pick_race_abil_event_filter(short item_hit);
void pick_race_abil(pc_record_type *pc,short mode,short parent_num);
short get_tnl(pc_record_type *pc);
void pick_race_abil(cPlayer *pc,short mode,short parent_num);
//short get_tnl(pc_record_type *pc);
void reset_boats();
void combine_things(short pc_num);

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,10 @@
bool select_save_location(FSSpec* to_save_ptr);
void save_file(FSSpec to_save);
void load_file();
//void save_file(FSSpec to_save);
//void load_file();
void leave_town();
long do_waterfall(long flag);
short init_data(short flag);
long open_pref_file();
void make_pref_file(FSSpec pref);
void save_prefs();
//long open_pref_file();
//void make_pref_file(FSSpec pref);
//void save_prefs();
void remove_party_from_scen();

View File

@@ -30,7 +30,8 @@
#define TEXT_WIN_UL_Y 283
#define NUM_BUTTONS 15
#define ASB add_string_to_buf
#define PSD party.stuff_done
#define PSD univ.party.stuff_done
#define ADVEN univ.party.adven
#define DES display_enc_string
#define D2ES display_2_enc_string
@@ -49,385 +50,385 @@
#define printFlag() printf("%s %i\n",__FILE__,__LINE__)
typedef struct {
char x,y;
} location;
typedef struct {
short x,y;} shortloc;
//typedef struct {
// char x,y;
// } location;
//typedef struct {
// short x,y;} shortloc;
typedef struct {
short type,sd1,sd2,pic,m1,m2,ex1a,ex1b,ex2a,ex2b,jumpto;
} special_node_type;
//typedef struct {
// short type,sd1,sd2,pic,m1,m2,ex1a,ex1b,ex2a,ex2b,jumpto;
// } special_node_type;
typedef struct {
short personality,type;
char link1[4],link2[4];
short extras[4];
} talking_node_type;
//typedef struct {
// short personality,type;
// char link1[4],link2[4];
// short extras[4];
// } talking_node_type;
typedef struct {
unsigned char strlens[200];
talking_node_type talk_nodes[60];
} talking_record_type;
//typedef struct {
// unsigned char strlens[200];
// talking_node_type talk_nodes[60];
// } talking_record_type;
typedef struct {
short picture;
unsigned char blockage,flag1,flag2,special,trans_to_what,fly_over,boat_over;
unsigned char block_horse,light_radius,step_sound,shortcut_key,res1,res2,res3;
} terrain_type_type;
//typedef struct {
// short picture;
// unsigned char blockage,flag1,flag2,special,trans_to_what,fly_over,boat_over;
// unsigned char block_horse,light_radius,step_sound,shortcut_key,res1,res2,res3;
// } terrain_type_type;
typedef struct {
unsigned char monst[4];
} wandering_type;
//typedef struct {
// unsigned char monst[4];
// } wandering_type;
typedef struct {
unsigned char monst[7];
unsigned char friendly[3];
short spec_on_meet,spec_on_win,spec_on_flee,cant_flee;
short end_spec1,end_spec2;
} out_wandering_type;
//typedef struct {
// unsigned char monst[7];
// unsigned char friendly[3];
// short spec_on_meet,spec_on_win,spec_on_flee,cant_flee;
// short end_spec1,end_spec2;
//} out_wandering_type;
typedef struct {
unsigned char terrain[48][48];
location special_locs[18];
unsigned char special_id[18];
location exit_locs[8];
char exit_dests[8];
location sign_locs[8];
out_wandering_type wandering[4],special_enc[4];
location wandering_locs[4];
Rect info_rect[8];
unsigned char strlens[180];
special_node_type specials[60];
} outdoor_record_type;
//typedef struct {
// unsigned char terrain[48][48];
// location special_locs[18];
// unsigned char special_id[18];
// location exit_locs[8];
// char exit_dests[8];
// location sign_locs[8];
// out_wandering_type wandering[4],special_enc[4];
// location wandering_locs[4];
// Rect info_rect[8];
// unsigned char strlens[180];
// special_node_type specials[60];
// } outdoor_record_type;
typedef struct {
unsigned char number;
unsigned char start_attitude;
location start_loc;
unsigned char mobile;
unsigned char time_flag;
unsigned char extra1,extra2;
short spec1, spec2;
char spec_enc_code,time_code;
short monster_time,personality;
short special_on_kill,facial_pic;
//typedef struct {
// unsigned char number;
// unsigned char start_attitude;
// location start_loc;
// unsigned char mobile;
// unsigned char time_flag;
// unsigned char extra1,extra2;
// short spec1, spec2;
// char spec_enc_code,time_code;
// short monster_time,personality;
// short special_on_kill,facial_pic;
//
// } creature_start_type;
//typedef struct {
// short variety, item_level;
// char awkward, bonus, protection, charges, type;
// unsigned char graphic_num,ability, type_flag, is_special;
// short value;
// Boolean identified, magic;
// unsigned char weight, description_flag;
// char full_name[25], name[15];
// unsigned char reserved1,reserved2;
// unsigned char magic_use_type, ability_strength, treas_class, real_abil;
//
//} short_item_record_type;
//typedef struct {
// short variety, item_level;
// char awkward, bonus, protection, charges, type, magic_use_type;
// unsigned char graphic_num,ability, ability_strength,type_flag, is_special;
// short value;
// unsigned char weight, special_class;
// location item_loc;
// char full_name[25], name[15];
// unsigned char treas_class,item_properties,reserved1,reserved2;
//} item_record_type;
//typedef struct {
// location item_loc;
// short item_code,ability;
// unsigned char charges,always_there,property,contained;
// } preset_item_type;
} creature_start_type;
typedef struct {
short variety, item_level;
char awkward, bonus, protection, charges, type;
unsigned char graphic_num,ability, type_flag, is_special;
short value;
Boolean identified, magic;
unsigned char weight, description_flag;
char full_name[25], name[15];
unsigned char reserved1,reserved2;
unsigned char magic_use_type, ability_strength, treas_class, real_abil;
//typedef struct {
// location field_loc;
// short field_type;
// } preset_field_type;
} short_item_record_type;
//typedef struct {
// short town_chop_time,town_chop_key;
// wandering_type wandering[4];
// location wandering_locs[4];
// location special_locs[50];
// unsigned char spec_id[50];
// location sign_locs[15];
// short lighting;
// location start_locs[4];
// location exit_locs[4];
// short exit_specs[4];
// Rect in_town_rect;
// preset_item_type preset_items[64];
// short max_num_monst;
// preset_field_type preset_fields[50];
// short spec_on_entry,spec_on_entry_if_dead;
// short timer_spec_times[8];
// short timer_specs[8];
// unsigned char strlens[180];
// special_node_type specials[100];
// unsigned char specials1,specials2,res1,res2;
// short difficulty;
// } town_record_type;
typedef struct {
short variety, item_level;
char awkward, bonus, protection, charges, type, magic_use_type;
unsigned char graphic_num,ability, ability_strength,type_flag, is_special;
short value;
unsigned char weight, special_class;
location item_loc;
char full_name[25], name[15];
unsigned char treas_class,item_properties,reserved1,reserved2;
} item_record_type;
typedef struct {
location item_loc;
short item_code,ability;
unsigned char charges,always_there,property,contained;
} preset_item_type;
//typedef struct {
// unsigned char terrain[64][64];
// Rect room_rect[16];
// creature_start_type creatures[60];
// unsigned char lighting[8][64];
// } big_tr_type;
//typedef struct {
// unsigned char terrain[48][48];
// Rect room_rect[16];
// creature_start_type creatures[40];
// unsigned char lighting[6][48];
// } ave_tr_type;
typedef struct {
location field_loc;
short field_type;
} preset_field_type;
//typedef struct {
// unsigned char terrain[32][32];
// Rect room_rect[16];
// creature_start_type creatures[30];
// unsigned char lighting[4][32];
// } tiny_tr_type;
//typedef struct {
// short block_type;
// short block_destroy_time;
// char block_alignment;
// char block_key_time;
// location block_loc;
// } city_block_type;
typedef struct {
short town_chop_time,town_chop_key;
wandering_type wandering[4];
location wandering_locs[4];
location special_locs[50];
unsigned char spec_id[50];
location sign_locs[15];
short lighting;
location start_locs[4];
location exit_locs[4];
short exit_specs[4];
Rect in_town_rect;
preset_item_type preset_items[64];
short max_num_monst;
preset_field_type preset_fields[50];
short spec_on_entry,spec_on_entry_if_dead;
short timer_spec_times[8];
short timer_specs[8];
unsigned char strlens[180];
special_node_type specials[100];
unsigned char specials1,specials2,res1,res2;
short difficulty;
} town_record_type;
typedef struct {
unsigned char terrain[64][64];
Rect room_rect[16];
creature_start_type creatures[60];
unsigned char lighting[8][64];
} big_tr_type;
typedef struct {
unsigned char terrain[48][48];
Rect room_rect[16];
creature_start_type creatures[40];
unsigned char lighting[6][48];
} ave_tr_type;
//typedef struct {
// Rect what_rect;
// unsigned char ter_type;
// unsigned char hollow;
// } city_ter_rect_type;
typedef struct {
unsigned char terrain[32][32];
Rect room_rect[16];
creature_start_type creatures[30];
unsigned char lighting[4][32];
} tiny_tr_type;
//typedef struct {
// creature_start_type creatures[30];
// city_block_type city_block[15];
// city_ter_rect_type city_ter_rect[10];
// } template_town_type;
typedef struct {
short block_type;
short block_destroy_time;
char block_alignment;
char block_key_time;
location block_loc;
} city_block_type;
typedef struct {
Rect what_rect;
unsigned char ter_type;
unsigned char hollow;
} city_ter_rect_type;
typedef struct {
creature_start_type creatures[30];
city_block_type city_block[15];
city_ter_rect_type city_ter_rect[10];
} template_town_type;
//typedef struct {
// item_record_type scen_items[400];
// char monst_names[256][20];
// char ter_names[256][30];
// } scen_item_data_type;
typedef struct {
item_record_type scen_items[400];
char monst_names[256][20];
char ter_names[256][30];
} scen_item_data_type;
//typedef struct {
// short ter_type,item_num[10],item_odds[10],property;
// } item_storage_shortcut_type;
typedef struct {
short ter_type,item_num[10],item_odds[10],property;
} item_storage_shortcut_type;
typedef struct {
unsigned char m_num,level,m_name[26];
short health,m_health,mp,max_mp;
unsigned char armor,skill;
short a[3];
unsigned char a1_type,a23_type,m_type,speed,ap,mu,cl,breath,breath_type,treasure,spec_skill,poison;
short morale,m_morale;
short corpse_item,corpse_item_chance;
short status[15];
unsigned char direction,immunities,x_width,y_width,radiate_1,radiate_2;
unsigned char default_attitude,summon_type,default_facial_pic,res1,res2,res3;
short picture_num;
//typedef struct {
// unsigned char m_num,level,m_name[26];
// short health,m_health,mp,max_mp;
// unsigned char armor,skill;
// short a[3];
// unsigned char a1_type,a23_type,m_type,speed,ap,mu,cl,breath,breath_type,treasure,spec_skill,poison;
// short morale,m_morale;
// short corpse_item,corpse_item_chance;
// short status[15];
// unsigned char direction,immunities,x_width,y_width,radiate_1,radiate_2;
// unsigned char default_attitude,summon_type,default_facial_pic,res1,res2,res3;
// short picture_num;
//
// } monster_record_type;
} monster_record_type;
typedef struct {
short active,attitude;
unsigned char number;
location m_loc;
monster_record_type m_d;
Boolean mobile;
short summoned;
creature_start_type monst_start;
} creature_data_type;
//typedef struct {
// short active,attitude;
// unsigned char number;
// location m_loc;
// monster_record_type m_d;
// Boolean mobile;
// short summoned;
// creature_start_type monst_start;
// } creature_data_type;
typedef struct {
location horse_loc,horse_loc_in_sec,horse_sector;
short which_town;
Boolean exists,property;
} horse_record_type;
typedef struct {
location boat_loc,boat_loc_in_sec,boat_sector;
short which_town;
Boolean exists,property;
} boat_record_type;
//typedef struct {
// location horse_loc,horse_loc_in_sec,horse_sector;
// short which_town;
// Boolean exists,property;
// } horse_record_type;
//typedef struct {
// location boat_loc,boat_loc_in_sec,boat_sector;
// short which_town;
// Boolean exists,property;
//} boat_record_type;
typedef struct {
unsigned char flag1, flag2, flag3, flag4;
unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns;
unsigned char out_width,out_height,difficulty,intro_pic,default_ground;
} scen_header_type;
//typedef struct {
// unsigned char flag1, flag2, flag3, flag4;
// unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns;
// unsigned char out_width,out_height,difficulty,intro_pic,default_ground;
// } scen_header_type;
typedef struct {
unsigned char flag1, flag2, flag3, flag4;
unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns;
unsigned char out_width,out_height,difficulty,intro_pic,default_ground;
unsigned char town_size[200];
unsigned char town_hidden[200];
short flag_a;
short intro_mess_pic,intro_mess_len;
location where_start,out_sec_start,out_start;
short which_town_start;
short flag_b;
short town_data_size[200][5];
short town_to_add_to[10];
short flag_to_add_to_town[10][2];
short flag_c;
short out_data_size[100][2];
Rect store_item_rects[3];
short store_item_towns[3];
short flag_e;
short special_items[50];
short special_item_special[50];
short rating,uses_custom_graphics;
short flag_f;
monster_record_type scen_monsters[256];
boat_record_type scen_boats[30];
horse_record_type scen_horses[30];
short flag_g;
terrain_type_type ter_types[256];
short scenario_timer_times[20];
short scenario_timer_specs[20];
short flag_h;
special_node_type scen_specials[256];
item_storage_shortcut_type storage_shortcuts[10];
short flag_d;
unsigned char scen_str_len[300];
short flag_i;
location last_out_edited;
short last_town_edited;
} scenario_data_type;
// typedef struct {
// unsigned char flag1, flag2, flag3, flag4;
// unsigned char ver[3],min_run_ver,prog_make_ver[3],num_towns;
// unsigned char out_width,out_height,difficulty,intro_pic,default_ground;
// unsigned char town_size[200];
// unsigned char town_hidden[200];
// short flag_a;
// short intro_mess_pic,intro_mess_len;
// location where_start,out_sec_start,out_start;
// short which_town_start;
// short flag_b;
// short town_data_size[200][5];
// short town_to_add_to[10];
// short flag_to_add_to_town[10][2];
// short flag_c;
// short out_data_size[100][2];
// Rect store_item_rects[3];
// short store_item_towns[3];
// short flag_e;
// short special_items[50];
// short special_item_special[50];
// short rating,uses_custom_graphics;
// short flag_f;
// monster_record_type scen_monsters[256];
// boat_record_type scen_boats[30];
// horse_record_type scen_horses[30];
// short flag_g;
// terrain_type_type ter_types[256];
// short scenario_timer_times[20];
// short scenario_timer_specs[20];
// short flag_h;
// special_node_type scen_specials[256];
// item_storage_shortcut_type storage_shortcuts[10];
// short flag_d;
// unsigned char scen_str_len[300];
// short flag_i;
// location last_out_edited;
// short last_town_edited;
//
// } scenario_data_type;
// for game
typedef struct {
short personality;
short town_num;
short str1,str2;
} talk_save_type;
//typedef struct {
// short personality;
// short town_num;
// short str1,str2;
// } talk_save_type;
typedef struct {
creature_data_type dudes[60];
short which_town;
short friendly;
} creature_list_type;
//typedef struct {
// creature_data_type dudes[60];
// short which_town;
// short friendly;
// } creature_list_type;
typedef struct {
short town_num, difficulty;
town_record_type town;
char explored[64][64];
Boolean hostile;
creature_list_type monst;
Boolean in_boat;
location p_loc;
} current_town_type;
//typedef struct {
// short town_num, difficulty;
// town_record_type town;
// char explored[64][64];
// Boolean hostile;
// creature_list_type monst;
// Boolean in_boat;
// location p_loc;
// } current_town_type;
typedef struct {
Boolean exists;
short direction;
out_wandering_type what_monst;
location which_sector,m_loc;
} outdoor_creature_type;
//typedef struct {
// Boolean exists;
// short direction;
// out_wandering_type what_monst;
// location which_sector,m_loc;
// } outdoor_creature_type;
typedef struct {
long age;
short gold,food;
unsigned char stuff_done[310][10],item_taken[200][8];
short light_level;
location outdoor_corner,i_w_c,p_loc,loc_in_sec;
boat_record_type boats[30];
horse_record_type horses[30];
creature_list_type creature_save[4];
short in_boat,in_horse;
outdoor_creature_type out_c[10];
item_record_type magic_store_items[5][10];
short imprisoned_monst[4];
char m_seen[256];
char journal_str[50];
short journal_day[50];
short special_notes_str[140][2];
talk_save_type talk_save[120];
short direction,at_which_save_slot;
char alchemy[20];
Boolean can_find_town[200];
short key_times[100];
short party_event_timers[30];
short global_or_town[30];
short node_to_call[30];
char spec_items[50],help_received[120];
short m_killed[200];
long total_m_killed,total_dam_done,total_xp_gained,total_dam_taken;
char scen_name[256];
} party_record_type;
//typedef struct {
// long age;
// short gold,food;
// unsigned char stuff_done[310][10],item_taken[200][8];
// short light_level;
// location outdoor_corner,i_w_c,p_loc,loc_in_sec;
// boat_record_type boats[30];
// horse_record_type horses[30];
// creature_list_type creature_save[4];
// short in_boat,in_horse;
// outdoor_creature_type out_c[10];
// item_record_type magic_store_items[5][10];
// short imprisoned_monst[4];
// char m_seen[256];
// char journal_str[50];
// short journal_day[50];
// short special_notes_str[140][2];
// talk_save_type talk_save[120];
// short direction,at_which_save_slot;
// char alchemy[20];
// Boolean can_find_town[200];
// short key_times[100];
// short party_event_timers[30];
// short global_or_town[30];
// short node_to_call[30];
// char spec_items[50],help_received[120];
// short m_killed[200];
// long total_m_killed,total_dam_done,total_xp_gained,total_dam_taken;
// char scen_name[256];
// } party_record_type;
typedef struct {
char town_maps[200][8][64];
} stored_town_maps_type;
typedef struct {
char town_strs[180][256];
//char out_strs[120][256];
char scen_strs[270][256];
char talk_strs[170][256];
char scen_header_strs[25][3][80];
Str255 scen_names[25];
scen_item_data_type scen_item_list;
stored_town_maps_type town_maps;
} piles_of_stuff_dumping_type;
typedef struct {
char out_strs[9][256];
} outdoor_strs_type;
typedef struct {
short main_status;
char name[20];
short skills[30];
short max_health,cur_health,max_sp,cur_sp,experience,skill_pts,level;
short status[15];
item_record_type items[24];
Boolean equip[24];
Boolean priest_spells[62],mage_spells[62];
short which_graphic,weap_poisoned;
Boolean advan[15],traits[15];
short race,exp_adj,direction;
} pc_record_type;
//typedef struct {
// char town_maps[200][8][64];
// } stored_town_maps_type;
//typedef struct {
// char town_strs[180][256];
// //char out_strs[120][256];
// char scen_strs[270][256];
// char talk_strs[170][256];
// char scen_header_strs[25][3][80];
// Str255 scen_names[25];
// scen_item_data_type scen_item_list;
// stored_town_maps_type town_maps;
// } piles_of_stuff_dumping_type;
//typedef struct {
// char out_strs[9][256];
// } outdoor_strs_type;
//typedef struct {
// short main_status;
// char name[20];
// short skills[30];
// short max_health,cur_health,max_sp,cur_sp,experience,skill_pts,level;
// short status[15];
// item_record_type items[24];
// Boolean equip[24];
// Boolean priest_spells[62],mage_spells[62];
// short which_graphic,weap_poisoned;
// Boolean advan[15],traits[15];
// short race,exp_adj,direction;
// } pc_record_type;
typedef struct {
unsigned char setup[4][64][64];
} setup_save_type;
//typedef struct {
// unsigned char setup[4][64][64];
// } setup_save_type;
typedef struct {
item_record_type items[NUM_TOWN_ITEMS];
} town_item_list;
//typedef struct {
// item_record_type items[NUM_TOWN_ITEMS];
// } town_item_list;
typedef struct {short i;} flag_type;
//typedef struct {short i;} flag_type;
typedef struct {unsigned char pattern[9][9];} effect_pat_type;
typedef struct {
item_record_type items[NUM_TOWN_ITEMS];
} stored_items_list_type;
//typedef struct {
// item_record_type items[NUM_TOWN_ITEMS];
// } stored_items_list_type;
typedef struct {
char outdoor_maps[100][6][48];
} stored_outdoor_maps_type;
//typedef struct {
// char outdoor_maps[100][6][48];
// } stored_outdoor_maps_type;
typedef struct {
long l[10];

View File

@@ -2,6 +2,7 @@
#include <stdio.h>
#include <string.h>
#include "pc.global.h"
#include "classes.h"
#include "pc.graphics.h"
#include "pc.editors.h"
#include "pc.action.h"
@@ -9,19 +10,21 @@
#include "graphtool.h"
#include "dlgtool.h"
#include "dlglowlevel.h"
#include "dlgutil.h"
/* Adventure globals */
extern party_record_type party;
extern pc_record_type adven[6];
extern outdoor_record_type outdoors[2][2];
extern current_town_type c_town;
extern big_tr_type t_d;
extern town_item_list t_i;
extern unsigned char out[96][96],out_e[96][96];
extern setup_save_type setup_save;
extern stored_items_list_type stored_items[3];
extern stored_town_maps_type maps;
extern stored_outdoor_maps_type o_maps;
//extern party_record_type party;
//extern pc_record_type ADVEN[6];
//extern outdoor_record_type outdoors[2][2];
//extern current_town_type c_town;
//extern big_tr_type t_d;
//extern town_item_list t_i;
//extern unsigned char out[96][96],out_e[96][96];
//extern setup_save_type setup_save;
//extern stored_items_list_type stored_items[3];
//extern stored_town_maps_type maps;
//extern stored_outdoor_maps_type o_maps;
extern cUniverse univ;
extern WindowPtr mainPtr;
extern Boolean play_sounds,file_in_mem,party_in_scen,scen_items_loaded;
@@ -29,10 +32,10 @@ extern Boolean play_sounds,file_in_mem,party_in_scen,scen_items_loaded;
extern short store_flags[3];
extern GWorldPtr button_num_gworld;
extern short current_active_pc;
extern Boolean ed_reg;
//extern Boolean ed_reg;
extern long register_flag,stored_key;
extern long ed_flag,ed_key;
//extern long register_flag,stored_key;
//extern long ed_flag,ed_key;
GWorldPtr title_gworld,pc_gworld,dlogpics_gworld;
GWorldPtr mixed_gworld,buttons_gworld;
@@ -64,6 +67,7 @@ short store_page_on,store_num_i;
Rect ed_buttons_from[2] = {{0,0,57,57},{0,57,57,114}};
short current_pressed_button = -1;
Boolean init_once = FALSE;
GWorldPtr spec_scen_g; // not actually needed; just here to silence compiler because it's reference in fileio.h
void init_dialogs(){
cd_init_dialogs(NULL,NULL,NULL,NULL,NULL,&dlogpics_gworld,NULL,NULL,NULL,NULL,NULL,NULL/*,NULL,NULL,NULL,NULL,NULL,NULL,NULL*/,NULL,NULL);
@@ -353,7 +357,7 @@ void draw_main_screen()
TextSize(10);
TextFace(0);
OffsetRect(&dest_rect,300,0);
char_win_draw_string(mainPtr,dest_rect,"Copyright 1997, Spiderweb Software, Inc.",0,10,true);
char_win_draw_string(mainPtr,dest_rect,"Created in 1997 by Spiderweb Software, Inc.",0,10,true);
TextFace(bold);
@@ -362,11 +366,6 @@ void draw_main_screen()
reg_rect.top += 8;
reg_rect.right -= 3;
if (ed_reg == FALSE) {
sprintf((char *)temp_str,"Unregistered Copy |To find out how to order, |select How To Order from File Menu.");
win_draw_string(GetWindowPort(mainPtr),reg_rect,temp_str,0,12,true);
}
}
void do_button_action(short which_pc,short which_button)
@@ -453,28 +452,28 @@ void draw_items(short clear_first)
}
// First, draw "Fred's Items:"
//sprintf((char *)to_draw,"%s items:",adven[current_active_pc].name);
//sprintf((char *)to_draw,"%s items:",ADVEN[current_active_pc].name);
//TextSize(12);
//ClipRect(&dest_rect);
//win_draw_string(mainPtr,item_string_rects[0][0],to_draw,0,12);
//undo_clip();
//TextSize(10);
if (adven[current_active_pc].main_status != 1){
if (ADVEN[current_active_pc].main_status != 1){
frame_dlog_rect(GetWindowPort(mainPtr),pc_info_rect,1); // re draw entire frame
frame_dlog_rect(GetWindowPort(mainPtr),info_area_rect,1); // draw the frame
frame_dlog_rect(GetWindowPort(mainPtr),pc_race_rect,1); // draw the frame
return; // If PC is dead, it has no items
}
for (i = 0; i < 24; i++) // Loop through items and draw each
if (adven[current_active_pc].items[i].variety > 0) { // i.e. does item exist
if (ADVEN[current_active_pc].items[i].variety > 0) { // i.e. does item exist
sprintf((char *) to_draw, "");
if (adven[current_active_pc].items[i].item_properties & 1 == 0)
sprintf((char *) to_draw, "%d. %s ",i + 1,adven[current_active_pc].items[i].name);
else if (adven[current_active_pc].items[i].charges > 0)
sprintf((char *) to_draw, "%d. %s (%d)",i + 1,adven[current_active_pc].items[i].full_name,
adven[current_active_pc].items[i].charges);
else sprintf((char *) to_draw, "%d. %s ",i + 1,adven[current_active_pc].items[i].full_name);
if (ADVEN[current_active_pc].items[i].item_properties & 1 == 0)
sprintf((char *) to_draw, "%d. %s ",i + 1,ADVEN[current_active_pc].items[i].name);
else if (ADVEN[current_active_pc].items[i].charges > 0)
sprintf((char *) to_draw, "%d. %s (%d)",i + 1,ADVEN[current_active_pc].items[i].full_name,
ADVEN[current_active_pc].items[i].charges);
else sprintf((char *) to_draw, "%d. %s ",i + 1,ADVEN[current_active_pc].items[i].full_name);
//if (i % 2 == 0)
// sprintf((char *) to_draw, "%d %d %d %d",
@@ -507,7 +506,7 @@ void display_party(short mode,short clear_first)
// lots of stuff is global. Like ...
// Boolean file_in_mem
// short current_active_pc
// pc_record_type adven[6]
// pc_record_type ADVEN[6]
if (clear_first == 1) { // first erase what's already there
for (i = 0; i < 6; i++)
FillCRect(&pc_area_buttons[i][0],bg[12]);
@@ -541,24 +540,24 @@ void display_party(short mode,short clear_first)
rect_draw_some_item(buttons_gworld,from_rect,buttons_gworld,pc_area_buttons[i][0],0,1);
ForeColor(blackColor);
// pc_record_type adven[6] is the records that contains chaarcters
// pc_record_type ADVEN[6] is the records that contains chaarcters
// main_status determins 0 - not exist, 1 - alive, OK, 2 - dead, 3 - stoned, 4 - dust
if (adven[i].main_status != 0) { // PC exists?
if (ADVEN[i].main_status != 0) { // PC exists?
from_rect = from_base;
// draw PC graphic
OffsetRect(&from_rect,56 * (adven[i].which_graphic / 8),36 * (adven[i].which_graphic % 8));
OffsetRect(&from_rect,56 * (ADVEN[i].which_graphic / 8),36 * (ADVEN[i].which_graphic % 8));
rect_draw_some_item(pc_gworld,from_rect,pc_gworld,pc_area_buttons[i][1],1,1);
//frame_dlog_rect(GetWindowPort(mainPtr),pc_area_buttons[i][1],0);
// draw name
TextSize(9);
if( (strlen(adven[i].name)) >= 10) {
if( (strlen(ADVEN[i].name)) >= 10) {
TextFace(0);
sprintf((char *) to_draw, "%-s ", (char *) adven[i].name);
sprintf((char *) to_draw, "%-s ", (char *) ADVEN[i].name);
TextSize(6);
}
else {
sprintf((char *) to_draw, "%-s ", (char *) adven[i].name);
sprintf((char *) to_draw, "%-s ", (char *) ADVEN[i].name);
}
ForeColor(whiteColor);
@@ -567,31 +566,31 @@ void display_party(short mode,short clear_first)
TextSize(10);
if (i == current_active_pc){
sprintf((char *) to_draw, "%-.18s ", (char *) adven[i].name);
if( (strlen(adven[i].name)) > 12)
sprintf((char *) to_draw, "%-.18s ", (char *) ADVEN[i].name);
if( (strlen(ADVEN[i].name)) > 12)
TextSize(8);
ForeColor(blackColor);
win_draw_string(GetWindowPort(mainPtr),name_rect,to_draw,1,10,true);
TextSize(10);
}
if ((current_pressed_button < 0) || (current_pressed_button == i))
switch (adven[i].main_status) {
switch (ADVEN[i].main_status) {
// draw statistics
case 1:
if (i == current_active_pc) {
//Draw in race
if (adven[i].race == 0)
if (ADVEN[i].race == 0)
char_win_draw_string(mainPtr,pc_race_rect,"Human ",1,10,true);
if (adven[i].race == 1)
if (ADVEN[i].race == 1)
char_win_draw_string(mainPtr,pc_race_rect,"Nephilim ",1,10,true);
if (adven[i].race == 2)
if (ADVEN[i].race == 2)
char_win_draw_string(mainPtr,pc_race_rect,"Slithzerikai ",1,10,true);
// Draw in skills
sprintf((char *) to_draw, "Skills:");
win_draw_string(GetWindowPort(mainPtr),skill_rect,to_draw,0,10,true);
sprintf((char *) to_draw, "Hp: %d/%d Sp: %d/%d",adven[i].cur_health,adven[i].max_health,adven[i].cur_sp,
adven[i].max_sp);
sprintf((char *) to_draw, "Hp: %d/%d Sp: %d/%d",ADVEN[i].cur_health,ADVEN[i].max_health,ADVEN[i].cur_sp,
ADVEN[i].max_sp);
win_draw_string(GetWindowPort(mainPtr),hp_sp_rect,to_draw,0,10,true);
@@ -606,7 +605,7 @@ void display_party(short mode,short clear_first)
get_str(to_draw,9,string_num);
win_draw_string(GetWindowPort(mainPtr),pc_skills_rect[k],to_draw,0,9,true);
sprintf((char *) skill_value,"%d",adven[i].skills[k]);
sprintf((char *) skill_value,"%d",ADVEN[i].skills[k]);
win_draw_string(GetWindowPort(mainPtr),temp_rect,skill_value,0,9,true);
//frame_dlog_rect(GetWindowPort(mainPtr),pc_skills_rect[k],0);
string_num+=2;
@@ -623,82 +622,82 @@ void display_party(short mode,short clear_first)
TextFace(0);
//for(k = 0 ; k < 10; k++)
//frame_dlog_rect(GetWindowPort(mainPtr),pc_status_rect[k],0);
if (adven[i].status[0] > 0)
if (ADVEN[i].status[0] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Poisoned Weap.",0,9,true);
cur_rect++;
}
if (adven[i].status[1] > 0)
if (ADVEN[i].status[1] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Blessed",0,9,true);
cur_rect++;
}
else if(adven[i].status[1] < 0)
else if(ADVEN[i].status[1] < 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Cursed",0,9,true);
cur_rect++;
}
if (adven[i].status[2] > 0)
if (ADVEN[i].status[2] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Poisoned",0,9,true);
cur_rect++;
}
if (adven[i].status[3] > 0)
if (ADVEN[i].status[3] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Hasted",0,9,true);
cur_rect++;
}
else if(adven[i].status[3] < 0)
else if(ADVEN[i].status[3] < 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Slowed",0,9,true);
cur_rect++;
}
if (adven[i].status[4] > 0)
if (ADVEN[i].status[4] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Invulnerable",0,9,true);
cur_rect++;
}
if (adven[i].status[5] > 0)
if (ADVEN[i].status[5] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Magic Resistant",0,9,true);
cur_rect++;
}
if (adven[i].status[6] > 0)
if (ADVEN[i].status[6] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Webbed",0,9,true);
cur_rect++;
}
if (adven[i].status[7] > 0)
if (ADVEN[i].status[7] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Diseased",0,9,true);
cur_rect++;
}
if (adven[i].status[8] > 0)
if (ADVEN[i].status[8] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Sanctury",0,9,true);
cur_rect++;
}
if (adven[i].status[9] > 0)
if (ADVEN[i].status[9] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Dumbfounded",0,9,true);
cur_rect++;
}
if (adven[i].status[10] > 0)
if (ADVEN[i].status[10] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Martyr's Shield",0,9,true);
cur_rect++;
}
if (adven[i].status[11] > 0)
if (ADVEN[i].status[11] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Asleep",0,9,true);
cur_rect++;
}
if (adven[i].status[12] > 0)
if (ADVEN[i].status[12] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Paralyzed",0,9,true);
cur_rect++;
}
if (adven[i].status[13] > 0)
if (ADVEN[i].status[13] > 0)
if(cur_rect <= 9) {
char_win_draw_string(mainPtr,pc_status_rect[cur_rect],"Acid",0,9,true);
cur_rect++;
@@ -715,78 +714,78 @@ void display_party(short mode,short clear_first)
TextSize(9);
TextFace(0);
cur_rect=0;
if (adven[i].traits[0] == 1)
if (ADVEN[i].traits[0] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Toughness",0,9,true);
cur_rect++;
}
if (adven[i].traits[1] == 1)
if (ADVEN[i].traits[1] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Magically Apt",0,9,true);
cur_rect++;
}
if (adven[i].traits[2] == 1)
if (ADVEN[i].traits[2] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Ambidextrous",0,9,true);
cur_rect++;
}
if (adven[i].traits[3] == 1)
if (ADVEN[i].traits[3] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Nimble Fingers",0,9,true);
cur_rect++;
}
if (adven[i].traits[4] == 1)
if (ADVEN[i].traits[4] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Cave Lore",0,9,true);
cur_rect++;
}
if (adven[i].traits[5] == 1)
if (ADVEN[i].traits[5] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Woodsman",0,9,true);
cur_rect++;
}
if (adven[i].traits[6] == 1)
if (ADVEN[i].traits[6] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Good Constitution",0,9,true);
cur_rect++;
}
if (adven[i].traits[7] == 1)
if (ADVEN[i].traits[7] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Highly Alert",0,9,true);
cur_rect++;
}
if (adven[i].traits[8] == 1)
if (ADVEN[i].traits[8] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Exceptional Str.",0,9,true);
cur_rect++;
}
if (adven[i].traits[9] == 1)
if (ADVEN[i].traits[9] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Recuperation",0,9,true);
cur_rect++;
}
if (adven[i].traits[10] == 1)
if (ADVEN[i].traits[10] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Sluggish",0,9,true);
cur_rect++;
}
if (adven[i].traits[11] == 1)
if (ADVEN[i].traits[11] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Magically Inept",0,9,true);
cur_rect++;
}
if (adven[i].traits[12] == 1)
if (ADVEN[i].traits[12] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Frail",0,9,true);
cur_rect++;
}
if (adven[i].traits[13] == 1)
if (ADVEN[i].traits[13] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Chronic Disease",0,9,true);
cur_rect++;
}
if (adven[i].traits[14] == 1)
if (ADVEN[i].traits[14] == 1)
if(cur_rect <= 15) {
char_win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Bad Back",0,9,true);
cur_rect++;
@@ -1097,69 +1096,69 @@ void add_string_to_buf(char *str) {
// SetPort(old_port);
//}
void display_strings_event_filter (short item_hit)
{
short i;
Boolean had1 = FALSE, had2 = FALSE;
switch (item_hit) {
case 1:
toast_dialog();
break;
}
}
//void display_strings_event_filter (short item_hit)
//{
// short i;
// Boolean had1 = FALSE, had2 = FALSE;
//
// switch (item_hit) {
// case 1:
// toast_dialog();
// break;
// }
//}
void record_display_strings(){}
void display_strings(short str1a,short str1b,short str2a,short str2b,
char *title,short sound_num,short graphic_num,short graphic_type,short parent_num)
{
short item_hit;
Str255 text;
location view_loc;
Boolean sound_done = FALSE;
//void display_strings(short str1a,short str1b,short str2a,short str2b,
// char *title,short sound_num,short graphic_num,short graphic_type,short parent_num)
//{
// short item_hit;
// Str255 text;
// location view_loc;
// Boolean sound_done = FALSE;
//
// make_cursor_sword();
//
// store_str1a = str1a;
// store_str1b = str1b;
// store_str2a = str2a;
// store_str2b = str2b;
//
// if ((str1a <= 0) || (str1b <= 0))
// return;
// store_which_string_dlog = 970;
// if (strlen(title) > 0)
// store_which_string_dlog += 2;
// if ((str2a > 0) && (str2b > 0))
// store_which_string_dlog++;
// cd_create_dialog_parent_num(store_which_string_dlog,parent_num);
//
// cd_activate_item(store_which_string_dlog,2,0);
//
// csp(store_which_string_dlog,store_which_string_dlog,graphic_num,graphic_type);
//
// get_str(text,str1a,str1b);
// csit(store_which_string_dlog,4,(char *) text);
// if ((str2a > 0) && (str2b > 0)) {
// get_str(text,str2a,str2b);
// csit(store_which_string_dlog,5,(char *) text);
// }
// if (strlen(title) > 0)
// csit(store_which_string_dlog,6,title);
// csp(store_which_string_dlog,3,graphic_num,graphic_type);
// if (sound_num >= 0)
// play_sound(sound_num);
//
// item_hit = cd_run_dialog();
// cd_kill_dialog(store_which_string_dlog,0);
//}
make_cursor_sword();
store_str1a = str1a;
store_str1b = str1b;
store_str2a = str2a;
store_str2b = str2b;
if ((str1a <= 0) || (str1b <= 0))
return;
store_which_string_dlog = 970;
if (strlen(title) > 0)
store_which_string_dlog += 2;
if ((str2a > 0) && (str2b > 0))
store_which_string_dlog++;
cd_create_dialog_parent_num(store_which_string_dlog,parent_num);
cd_activate_item(store_which_string_dlog,2,0);
csp(store_which_string_dlog,store_which_string_dlog,graphic_num,graphic_type);
get_str(text,str1a,str1b);
csit(store_which_string_dlog,4,(char *) text);
if ((str2a > 0) && (str2b > 0)) {
get_str(text,str2a,str2b);
csit(store_which_string_dlog,5,(char *) text);
}
if (strlen(title) > 0)
csit(store_which_string_dlog,6,title);
csp(store_which_string_dlog,3,graphic_num,graphic_type);
if (sound_num >= 0)
play_sound(sound_num);
item_hit = cd_run_dialog();
cd_kill_dialog(store_which_string_dlog,0);
}
void get_str(Str255 str,short i, short j)
{
GetIndString(str, i, j);
p2cstr(str);
}
//void get_str(Str255 str,short i, short j)
//{
// GetIndString(str, i, j);
// p2cstr(str);
//}
void make_cursor_sword()
{

View File

@@ -8,10 +8,9 @@ void draw_items(short clear_first);
void display_party(short mode,short clear_first);
void undo_clip();
void add_string_to_buf(char *str) ;
void display_strings_event_filter (short item_hit);
void display_strings(short str1a,short str1b,short str2a,short str2b,
char *title,short sound_num,short graphic_num,short graphic_type,short parent_num);
void get_str(Str255 str,short i, short j);
//void display_strings_event_filter (short item_hit);
//void display_strings(short str1a,short str1b,short str2a,short str2b, char *title,short sound_num,short graphic_num,short graphic_type,short parent_num);
//void get_str(Str255 str,short i, short j);
short string_length(char *str);
void make_cursor_sword();
void init_dialogs();

View File

@@ -1,8 +1,9 @@
//#include <Memory.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include "pc.global.h"
#include "classes.h"
#include "pc.graphics.h"
#include "pc.editors.h"
#include "pc.action.h"
@@ -13,6 +14,9 @@
#include "graphtool.h"
#include "boe.consts.h"
#include "dlgutil.h"
#include "fileio.h"
cUniverse univ;
Rect pc_area_buttons[6][4] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later
Rect item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 -
@@ -30,7 +34,7 @@ Rect pc_race_rect; //Holds current pc's race
Rect edit_rect[5][2]; //Buttons that bring up pc edit dialog boxs
short current_active_pc = 0;
short dialog_answer;
//short dialog_answer;
/* Mac stuff globals */
Rect windRect, Drag_Rect;
@@ -45,27 +49,27 @@ Boolean party_in_scen = FALSE;
Boolean scen_items_loaded = FALSE;
/* Adventure globals */
party_record_type party;
pc_record_type adven[6];
outdoor_record_type outdoors[2][2];
current_town_type c_town;
big_tr_type t_d;
town_item_list t_i;
unsigned char out[96][96],out_e[96][96];
setup_save_type setup_save;
unsigned char misc_i[64][64],sfx[64][64];
unsigned char template_terrain[64][64];
//party_record_type party;
//pc_record_type ADVEN[6];
//outdoor_record_type outdoors[2][2];
//current_town_type c_town;
//big_tr_type t_d;
//town_item_list t_i;
//unsigned char out[96][96],out_e[96][96];
//setup_save_type setup_save;
//unsigned char misc_i[64][64],sfx[64][64];
//unsigned char template_terrain[64][64];
short store_flags[3];
extern short sword_curs;
town_record_type anim_town;
tiny_tr_type anim_t_d;
//town_record_type anim_town;
//tiny_tr_type anim_t_d;
stored_items_list_type stored_items[3];
stored_town_maps_type maps;
stored_town_maps_type town_maps;
stored_outdoor_maps_type o_maps;
//stored_items_list_type stored_items[3];
//stored_town_maps_type maps;
//stored_town_maps_type town_maps;
//stored_outdoor_maps_type o_maps;
short old_depth = 16;
extern FSSpec file_to_load;
@@ -101,15 +105,17 @@ void set_up_apple_events();
void set_pixel_depth();
void restore_depth();
void handle_item_menu(int item_hit);
item_record_type convert_item (short_item_record_type s_item);
//item_record_type convert_item (short_item_record_type s_item);
bool cur_scen_is_mac, mac_is_intel;
std::string progDir;
// File io
short specials_res_id;
Str255 start_name;
ResFileRefNum graphicsRef, soundRef, mainRef;
//#include "pc.itemdata.h"
item_record_type item_list[400];
cItemRec item_list[400];
cScenario scenario;
//
// Main body of program Exile
@@ -222,6 +228,22 @@ void Initialize(void)
ExitToShell();
}
CFStringRef progURL = CFURLCopyFileSystemPath(CFBundleCopyBundleURL(mainBundle), kCFURLPOSIXPathStyle);
const char* tmp = CFStringGetCStringPtr(progURL, kCFStringEncodingASCII);//kCFStringEncodingUTF8);
if(tmp == NULL){
bool success = CFStringGetCString(progURL, cPath, sizeof(cPath), kCFStringEncodingUTF8);
if(success) {
progDir = cPath;
std::cout << cPath << "\n\n" << progDir << "\n\n";
} else {
std::cout << "Couldn't retrieve application path.\n";
exit(1);
}
}else progDir = tmp;
//progDir = cPath;
size_t last_slash = progDir.find_last_of('/');
progDir.erase(last_slash);
std::cout<<progDir<<'\n';
//
// Test the computer to be sure we can do color.
// If not we would crash, which would be bad.
@@ -510,15 +532,18 @@ void handle_file_menu(int item_hit)
switch (item_hit) {
case 1://save
save_file(file_to_load);
save_party(file_to_load);
break;
case 2://save as
if(select_save_location(&file))
save_file(file);
save_party(file);
break;
case 3://open
if (verify_restore_quit(1) == TRUE)
load_file();
if (verify_restore_quit(1) == TRUE){
FSSpec* file = nav_get_party();
file_to_load = *file;
load_party(file_to_load);
}
break;
case 5://how to order
give_reg_info();
@@ -532,7 +557,7 @@ void handle_file_menu(int item_hit)
void handle_extra_menu(int item_hit)
{
short i,j,choice;
boat_record_type v_boat = {{12,17},{0,0},{0,0},80,TRUE,FALSE};
//cVehicle v_boat = {{12,17},{0,0},{0,0},80,TRUE,FALSE};
if (file_in_mem == FALSE) {
display_strings(20,5,0,0,"Editing party",57,7,PICT_DLG,0);
@@ -561,49 +586,49 @@ void handle_extra_menu(int item_hit)
break;
}
FCD(910,0);
c_town.p_loc.x = PSD[SDF_PARTY_SPLIT_X];
c_town.p_loc.y = PSD[SDF_PARTY_SPLIT_Y];
univ.town.p_loc.x = PSD[SDF_PARTY_SPLIT_X];
univ.town.p_loc.y = PSD[SDF_PARTY_SPLIT_Y];
PSD[SDF_IS_PARTY_SPLIT] = 0;
for (i = 0; i < 6; i++)
if (adven[i].main_status >= 10)
adven[i].main_status -= 10;
if (ADVEN[i].main_status >= 10)
ADVEN[i].main_status -= 10;
break;
case 6:
display_strings(20,20,0,0,"Editing party",57,7,PICT_DLG,0);
for (i = 0; i < 4; i++)
party.creature_save[i].which_town = 200;
univ.party.creature_save[i].which_town = 200;
break;
case 8: // damage
display_strings(20,1,0,0,"Editing party",57,15,PICT_DLG,0);
for (i = 0; i < 6; i++)
adven[i].cur_health = adven[i].max_health;
ADVEN[i].cur_health = ADVEN[i].max_health;
break;
case 9: // spell pts
display_strings(20,2,0,0,"Editing party",57,15,PICT_DLG,0);
for (i = 0; i < 6; i++)
adven[i].cur_sp = adven[i].max_sp;
ADVEN[i].cur_sp = ADVEN[i].max_sp;
break;
case 10: // raise dead
display_strings(20,3,0,0,"Editing party",57,15,PICT_DLG,0);
for (i = 0; i < 6; i++)
if ((adven[i].main_status == 2) || (adven[i].main_status == 3) ||
(adven[i].main_status == 4))
adven[i].main_status = 1;
if ((ADVEN[i].main_status == 2) || (ADVEN[i].main_status == 3) ||
(ADVEN[i].main_status == 4))
ADVEN[i].main_status = 1;
break;
case 11: // conditions
display_strings(20,4,0,0,"Editing party",57,15,PICT_DLG,0);
for (i = 0; i < 6; i++) {
adven[i].status[2] = 0;
if (adven[i].status[3] < 0)
adven[i].status[3] = 0;
adven[i].status[6] = 0;
adven[i].status[7] = 0;
adven[i].status[9] = 0;
adven[i].status[11] = 0;
adven[i].status[12] = 0;
adven[i].status[13] = 0;
ADVEN[i].status[2] = 0;
if (ADVEN[i].status[3] < 0)
ADVEN[i].status[3] = 0;
ADVEN[i].status[6] = 0;
ADVEN[i].status[7] = 0;
ADVEN[i].status[9] = 0;
ADVEN[i].status[11] = 0;
ADVEN[i].status[12] = 0;
ADVEN[i].status[13] = 0;
}
break;
@@ -640,8 +665,8 @@ void handle_edit_menu(int item_hit)
case 2: // all property
display_strings(20,6,0,0,"Editing party",57,7,PICT_DLG,0);
for (i = 0; i < 30; i++) {
party.boats[i].property = FALSE;
party.horses[i].property = FALSE;
univ.party.boats[i].property = FALSE;
univ.party.horses[i].property = FALSE;
}
break;
case 4: // edit day
@@ -656,7 +681,7 @@ void handle_edit_menu(int item_hit)
for (i = 0; i < 100; i++)
for (j = 0; j < 6; j++)
for (k = 0; k < 48; k++)
o_maps.outdoor_maps[i][j][k] = 255;
univ.out.maps[i][j][k] = 255;
break;
case 7: // town maps
if (party_in_scen == FALSE) {
@@ -667,7 +692,7 @@ void handle_edit_menu(int item_hit)
for (i = 0; i < 200; i++)
for (j = 0; j < 8; j++)
for (k = 0; k < 64; k++)
town_maps.town_maps[i][j][k] = 255;
univ.town.maps[i][j][k] = 255;
break;
case 9:
display_pc(current_active_pc,0,0);
@@ -676,73 +701,73 @@ void handle_edit_menu(int item_hit)
display_pc(current_active_pc,1,0);
break;
case 11:
pick_race_abil(&adven[current_active_pc],0,0);
pick_race_abil(&ADVEN[current_active_pc],0,0);
break;
case 12:
spend_xp(current_active_pc,1,0);
break;
case 13:
edit_xp(&adven[current_active_pc]);
edit_xp(&ADVEN[current_active_pc]);
break;
}
}
item_record_type convert_item (short_item_record_type s_item) {
item_record_type i;
location l = {0,0};
short temp_val;
i.variety = (short) s_item.variety;
i.item_level = (short) s_item.item_level;
i.awkward = (short) s_item.awkward;
i.bonus = (short) s_item.bonus;
i.protection = (short) s_item.protection;
i.charges = (short) s_item.charges;
i.type = (short) s_item.type;
i.graphic_num = (short) s_item.graphic_num;
if (i.graphic_num >= 25)
i.graphic_num += 20;
i.ability = (short) s_item.real_abil;
i.type_flag = (short) s_item.type_flag;
i.is_special = (short) s_item.is_special;
i.value = (short) s_item.value;
i.weight = s_item.weight;
i.special_class = 0;
i.item_loc = l;
strcpy((char *)i.full_name,(char *)s_item.full_name);
strcpy((char *)i.name,(char *)s_item.name);
if (i.charges > 0)
temp_val = i.value * i.charges;
else temp_val = i.value;
if (temp_val >= 15)
i.treas_class = 1;
if (temp_val >= 100)
i.treas_class = 2;
if (temp_val >= 900)
i.treas_class = 3;
if (temp_val >= 2400)
i.treas_class = 4;
i.magic_use_type = s_item.magic_use_type;
i.ability_strength = s_item.ability_strength;
i.reserved1 = 0;
i.reserved2 = 0;
i.item_properties = 0;
if (s_item.identified == TRUE)
i.item_properties = i.item_properties | 1;
if ((s_item.ability == 14) || (s_item.ability == 129) || (s_item.ability == 95))
i.item_properties = i.item_properties | 16;
if (s_item.magic == TRUE)
i.item_properties = i.item_properties | 4;
return i;
}
//item_record_type convert_item (short_item_record_type s_item) {
// item_record_type i;
// location l = {0,0};
// short temp_val;
//
// i.variety = (short) s_item.variety;
// i.item_level = (short) s_item.item_level;
// i.awkward = (short) s_item.awkward;
// i.bonus = (short) s_item.bonus;
// i.protection = (short) s_item.protection;
// i.charges = (short) s_item.charges;
// i.type = (short) s_item.type;
// i.graphic_num = (short) s_item.graphic_num;
// if (i.graphic_num >= 25)
// i.graphic_num += 20;
// i.ability = (short) s_item.real_abil;
// i.type_flag = (short) s_item.type_flag;
// i.is_special = (short) s_item.is_special;
// i.value = (short) s_item.value;
// i.weight = s_item.weight;
// i.special_class = 0;
// i.item_loc = l;
// strcpy((char *)i.full_name,(char *)s_item.full_name);
// strcpy((char *)i.name,(char *)s_item.name);
//
// if (i.charges > 0)
// temp_val = i.value * i.charges;
// else temp_val = i.value;
// if (temp_val >= 15)
// i.treas_class = 1;
// if (temp_val >= 100)
// i.treas_class = 2;
// if (temp_val >= 900)
// i.treas_class = 3;
// if (temp_val >= 2400)
// i.treas_class = 4;
//
// i.magic_use_type = s_item.magic_use_type;
// i.ability_strength = s_item.ability_strength;
// i.reserved1 = 0;
// i.reserved2 = 0;
// i.item_properties = 0;
// if (s_item.identified == TRUE)
// i.item_properties = i.item_properties | 1;
// if ((s_item.ability == 14) || (s_item.ability == 129) || (s_item.ability == 95))
// i.item_properties = i.item_properties | 16;
// if (s_item.magic == TRUE)
// i.item_properties = i.item_properties | 4;
//
// return i;
//}
void handle_item_menu(int item_hit)
{
short choice;
item_record_type store_i;
cItemRec store_i;
if (file_in_mem == FALSE) {
display_strings(20,5,0,0,"Editing party",57,7,PICT_DLG,0);
@@ -918,7 +943,7 @@ Boolean verify_restore_quit(short mode)
return FALSE;
if (choice == 2)
return TRUE;
save_file(file_to_load);
save_party(file_to_load);
return TRUE;
}