22 short mage_spell_pos
= 0,priest_spell_pos
= 0,skill_pos
= 0;
23 pc_record_type
*store_pc
;
24 creature_data_type
*store_m
;
25 short store_trait_mode
,store_item_pc
,store_pc_num
;
26 item_record_type store_i
;
28 extern short spell_w_cast
[2][62];
29 extern short spell_level
[62];
30 extern short skill_cost
[20];
31 extern short skill_max
[20];
32 extern short skill_g_cost
[20];
33 extern pc_record_type far adven
[6];
34 extern short which_pc_displayed
;
35 extern party_record_type far party
;
36 extern short far mage_range
[66];
37 extern short far priest_range
[66];
38 extern short spell_cost
[2][62];
39 extern Boolean in_startup_mode
,give_intro_hint
;
40 extern pascal Boolean
cd_event_filter();
41 extern Boolean dialog_not_toast
;
43 extern short on_monst_menu
[256],cur_town_talk_loaded
;
44 extern big_tr_type far t_d
;
45 extern location tinraya_portculli
[12];
46 extern char far scen_strs2
[110][256];
47 extern scenario_data_type far scenario
;
48 extern piles_of_stuff_dumping_type3
*data_store3
;
49 extern piles_of_stuff_dumping_type4
*data_store4
;
50 extern piles_of_stuff_dumping_type5
*data_store5
;
52 Boolean full_roster
= FALSE
;
54 extern short far dest_personalities
[40];
55 extern location far dest_locs
[40];
57 extern short dest_personalities
[40];
58 location source_locs
[6] = {{2,9},{0,6},{3,6},{3,4},{6,2},{0,0}};
59 extern location dest_locs
[40] ;
61 // Displaying string vars
66 short store_which_string_dlog
;
67 short store_page_on
,store_num_i
;
68 short store_str_label_1
,store_str_label_2
,store_str_label_1b
,store_str_label_2b
;
71 short store_display_mode
,store_displayed_item
,position
,cur_entry
,num_entries
,store_help_mode
;
72 creature_data_type hold_m
;
80 pos
= (store_display_mode
== 0) ? mage_spell_pos
: priest_spell_pos
;
81 res
= (store_display_mode
== 0) ? 7 : 8;
82 ran
= (store_display_mode
== 0) ? mage_range
[pos
] : priest_range
[pos
];
84 get_str (store_text
, res
, pos
* 2 + 1);
85 cd_set_item_text(1096,4,(char *) store_text
);
87 if (spell_cost
[store_display_mode
][pos
] > 0)
88 sprintf((char *) store_text
, "%d/%d",spell_level
[pos
],spell_cost
[store_display_mode
][pos
]);
89 else sprintf((char *) store_text
, "%d/?",spell_level
[pos
]);
90 cd_set_item_text(1096,5,(char *) store_text
);
93 cd_set_item_text(1096,6,"");
95 else cd_set_item_num(1096,6,ran
);
96 get_str (store_text
, res
, pos
* 2 + 2);
98 cd_set_item_text(1096,7,(char *) store_text
);
99 get_str (store_text
, 11, 1 + spell_w_cast
[store_display_mode
][pos
]);
100 cd_set_item_text(1096,11,(char *) store_text
);
104 Boolean
display_spells_event_filter (short item_hit
)
109 dialog_not_toast
= FALSE
;
113 store
= (store_display_mode
== 0) ? mage_spell_pos
: priest_spell_pos
;
115 store
= (store
== 0) ? 61 : store
- 1;
118 store
= (store
+ 1) % 62;
120 if (store_display_mode
== 0)
121 mage_spell_pos
= store
;
122 else priest_spell_pos
= store
;
129 void display_spells(short mode
,short force_spell
,short parent_num
)
130 //short mode; // 0 - mage 1 - priest
131 //short force_spell; // if 100, ignore
133 short buy_val
,i
,store
,item_hit
;
136 store_display_mode
= mode
;
137 if (force_spell
< 100) {
139 mage_spell_pos
= force_spell
;
140 else priest_spell_pos
= force_spell
;
145 cd_create_dialog_parent_num(1096,parent_num
);
147 cd_set_pict(1096,18,714 + mode
);
150 csit(1096,3,"Mage Spells");
151 else csit(1096,3,"Priest Spells");
152 while (dialog_not_toast
)
155 cd_kill_dialog(1096,0);
159 void put_skill_info()
161 char store_text
[256];
166 get_str(store_text
,9,pos
* 2 + 1);
167 cd_set_item_text(1097,3,(char *) store_text
);
168 cd_set_item_num(1097,4,skill_cost
[pos
]);
169 cd_set_item_num(1097,5,skill_g_cost
[pos
]);
170 cd_set_item_num(1097,6,skill_max
[pos
]);
172 get_str (store_text
, 9, pos
* 2 + 2);
173 cd_set_item_text(1097,7,(char *) store_text
);
174 get_str (store_text
, 12, 1 + pos
);
175 cd_set_item_text(1097,8,(char *) store_text
);
179 Boolean
display_skills_event_filter (short item_hit
)
183 dialog_not_toast
= FALSE
;
188 skill_pos
= (skill_pos
== 0) ? 18 : skill_pos
- 1;
191 skill_pos
= (skill_pos
+ 1) % 19;
199 void display_skills(short force_skill
,short parent
)
203 short buy_val
,i
,store
,item_hit
;
205 if (force_skill
< 100)
206 skill_pos
= force_skill
;
212 cd_create_dialog_parent_num(1097,parent
);
215 while (dialog_not_toast
)
216 ModalDialog(); cd_kill_dialog(1097,0);
220 void put_pc_graphics()
222 short item_hit
,what_talk_field
,i
;
224 for (i
= 3; i
< 65; i
++) {
225 if (((store_trait_mode
== 0) && (adven
[which_pc_displayed
].mage_spells
[i
- 3] == TRUE
)) ||
226 ((store_trait_mode
== 1) && (adven
[which_pc_displayed
].priest_spells
[i
- 3] == TRUE
)))
228 else cd_set_led(991,i
,0);
231 cd_set_item_text(991,69,adven
[which_pc_displayed
].name
);
233 Boolean
display_pc_event_filter (short item_hit
)
237 pc_num
= which_pc_displayed
;
240 dialog_not_toast
= FALSE
;
245 pc_num
= (pc_num
== 0) ? 5 : pc_num
- 1;
246 } while (adven
[pc_num
].main_status
== 0);
247 which_pc_displayed
= pc_num
;
252 pc_num
= (pc_num
== 5) ? 0 : pc_num
+ 1;
253 } while (adven
[pc_num
].main_status
== 0);
254 which_pc_displayed
= pc_num
;
265 void display_pc(short pc_num
,short mode
,short parent
)
270 if (adven
[pc_num
].main_status
== 0) {
271 for (pc_num
= 0; pc_num
< 6; pc_num
++)
272 if (adven
[pc_num
].main_status
== 1)
275 which_pc_displayed
= pc_num
;
276 store_trait_mode
= mode
;
280 cd_create_dialog_parent_num(991,parent
);
282 for (i
= 3; i
< 65; i
++) {
283 get_str(label_str
,(mode
== 0) ? 7 : 8,(i
- 3) * 2 + 1);
284 cd_add_label(991,i
,(char *)label_str
,46);
288 cd_set_pict(991,2,714 + mode
);
289 while (dialog_not_toast
)
290 ModalDialog(); cd_kill_dialog(991,0);
293 void put_item_info(short pc
,short item
)
295 char store_text
[256];
298 item_record_type s_i
;
299 char *item_types
[] = {"","1-Handed weapon","2-Handed weapon","","Bow","Arrows","Thrown missile",
300 "Potion/Magic Item","Scroll/Magic Item","Wand","Tool","","Shield","Armor","Helm",
301 "Gloves","Shield","Boots","Ring","Necklace",
302 "Weapon Poison","Gem, Stone, Etc.","Pants","Crossbow","Bolts","Missile Weapon"};
308 if (s_i
.graphic_num
>= 150)
309 csp(998,1,s_i
.graphic_num
- 150 + 2000);
310 else csp(998,1,1800 + s_i
.graphic_num
);
313 if ((is_magic(store_i
) == TRUE
) && (is_ident(store_i
) == TRUE
))
314 cd_set_led(998,17,1);
315 else cd_set_led(998,17,0);
316 if (is_ident(store_i
) == TRUE
)
317 cd_set_led(998,16,1);
318 else cd_set_led(998,16,0);
319 cd_set_item_text(998,4, item_types
[s_i
.variety
]);
322 for (i
= 5; i
< 13; i
++) {
323 cd_set_item_text(998,i
, "");
327 if (is_ident(s_i
) == FALSE
) {
328 cd_set_item_text(998,3, s_i
.name
);
332 cd_set_item_text(998,3, s_i
.full_name
);
333 i
= item_weight(s_i
);
334 cd_set_item_num(998,20,i
);
336 cd_set_item_num(998,5,(s_i
.charges
> 0) ? s_i
.value
* s_i
.charges
: s_i
.value
);
338 if (s_i
.ability
> 0) {////
339 get_str(desc_str
,23,s_i
.ability
+ 1);
340 cd_set_item_text(998,12,(char *) desc_str
);
343 cd_set_item_num(998,10,s_i
.charges
);
344 if (s_i
.protection
> 0)
345 cd_set_item_num(998,8,s_i
.protection
);
347 switch (s_i
.variety
) {
349 cd_set_item_num(998,6,s_i
.item_level
);
350 cd_set_item_num(998,7,s_i
.bonus
);
353 case 1:sprintf((char *) store_text
, "Edged weapon");
355 case 2:sprintf((char *) store_text
, "Bashing weapon");
357 case 3:sprintf((char *) store_text
, "Pole weapon");
360 if (s_i
.ability
== 0)
361 cd_set_item_text(998,12,store_text
);
364 cd_set_item_num(998,6,s_i
.item_level
);
365 cd_set_item_num(998,7,s_i
.bonus
);
367 case 5: case 6: case 24: case 25:
368 cd_set_item_num(998,6,s_i
.item_level
);
369 cd_set_item_num(998,7,s_i
.bonus
);
372 cd_set_item_num(998,11,s_i
.item_level
);
374 case 12: case 13: case 14: case 15: case 16: case 17:
375 cd_set_item_num(998,7,s_i
.bonus
+ s_i
.protection
);
376 cd_set_item_num(998,8,s_i
.item_level
);
377 cd_set_item_num(998,9,s_i
.awkward
);
380 cd_set_item_num(998,11,s_i
.item_level
);
386 Boolean
display_pc_item_event_filter (short item_hit
)
390 item
= store_displayed_item
;
391 pc_num
= store_item_pc
;
395 dialog_not_toast
= FALSE
;
400 item
= (item
== 0) ? 23 : item
- 1;
401 } while (adven
[pc_num
].items
[item
].variety
== 0);
402 store_displayed_item
= item
;
403 store_i
= adven
[pc_num
].items
[item
];
404 put_item_info(pc_num
,item
);
408 item
= (item
== 23) ? 0 : item
+ 1;
409 } while (adven
[pc_num
].items
[item
].variety
== 0);
410 store_displayed_item
= item
;
411 store_i
= adven
[pc_num
].items
[item
];
412 put_item_info(pc_num
,item
);
422 void display_pc_item(short pc_num
,short item
,item_record_type si
,short parent
)
426 store_item_pc
= pc_num
;
429 else store_i
= adven
[pc_num
].items
[item
];
430 store_displayed_item
= item
;
433 if (cd_create_dialog_parent_num(998,parent
) < 0)
436 if (store_item_pc
>= 6) {
437 cd_activate_item(998,14,0);
438 cd_activate_item(998,15,0);
440 cd_add_label(998,3,"Name:",1026);
441 cd_add_label(998,4,"Type:",1026);
442 cd_add_label(998,5,"Value:",1020);
443 cd_add_label(998,6,"Damage:",1026);
444 cd_add_label(998,7,"Bonus:",1024);
445 cd_add_label(998,8,"Defend:",1025);
446 cd_add_label(998,9,"Encumb.:",1029);
447 cd_add_label(998,10,"Uses:",1019);
448 cd_add_label(998,11,"Item Level:",1037);
449 cd_add_label(998,12,"Ability:",1026);
450 cd_add_label(998,16,"ID?",1013);
451 cd_add_label(998,17,"Magic?",1022);
452 cd_add_label(998,20 ,"Weight",1022);
454 put_item_info(pc_num
,item
);
455 while (dialog_not_toast
)
456 ModalDialog(); cd_kill_dialog(998,0);
461 void put_monst_info()
463 char store_text
[256];
467 if ( store_m
->m_d
.spec_skill
== 11)
468 cd_set_pict(999,4,400);
469 else if (store_m
->m_d
.picture_num
< 1000)
470 cd_set_pict(999,4,400 + store_m
->m_d
.picture_num
);
471 else cd_set_pict(999,4,2000 + (store_m
->m_d
.picture_num
% 1000));
473 get_m_name((char *) store_text
,store_m
->number
);
474 cd_set_item_text(999,5,store_text
);
476 for (i
= 6; i
< 20; i
++) {
477 cd_set_item_text(999,i
,"");
480 abil
= store_m
->m_d
.spec_skill
;
481 get_str(str
,20,abil
+ 1);
482 cd_set_item_text(999,19,(char *) str
);
483 get_str(str
,20,store_m
->m_d
.radiate_1
+ 50);
484 cd_set_item_text(999,31,(char *) str
);
486 for (i
= 0; i
< 3; i
++)
487 if (store_m
->m_d
.a
[i
] > 0) {
488 sprintf((char *) store_text
," %dd%d ",
489 store_m
->m_d
.a
[i
] / 100 + 1, store_m
->m_d
.a
[i
] % 100);
491 cd_set_item_text(999,13 + i
,store_text
);
493 cd_set_item_num(999,6,store_m
->m_d
.level
);
494 cd_set_item_num(999,7,store_m
->m_d
.health
);
495 cd_set_item_num(999,8,store_m
->m_d
.mp
);
496 cd_set_item_num(999,9,store_m
->m_d
.armor
);
497 cd_set_item_num(999,10,store_m
->m_d
.skill
);
498 cd_set_item_num(999,11,store_m
->m_d
.morale
);
499 cd_set_item_num(999,12,store_m
->m_d
.speed
);
500 cd_set_item_num(999,16,store_m
->m_d
.mu
);
501 cd_set_item_num(999,17,store_m
->m_d
.cl
);
502 cd_set_item_num(999,18,store_m
->m_d
.poison
);
503 // 2140 - lit 2141 - dark
505 for (i
= 0; i
< 8; i
++)
506 if (store_m
->m_d
.immunities
& (char)(s_pow(2,i
)))
507 cd_set_led(999,20 + i
,1);
508 else cd_set_led(999,20 + i
,0);
514 Boolean
display_monst_event_filter (short item_hit
)
520 dialog_not_toast
= FALSE
;
525 for (i
= 255; on_monst_menu
[i
] < 0 && i
> 0; i
--)
531 if (on_monst_menu
[position
] < 0)
533 store_m
->number
= (unsigned char)on_monst_menu
[position
];
534 store_m
->m_d
= return_monster_template((unsigned char)on_monst_menu
[position
]);
539 if (on_monst_menu
[position
] < 0)
541 store_m
->number
= (unsigned char)on_monst_menu
[position
];
542 store_m
->m_d
= return_monster_template((unsigned char)on_monst_menu
[position
]);
554 void display_monst(short array_pos
,creature_data_type
*which_m
,short mode
)
555 //creature_data_type *which_m; // if NULL, show full roster
556 //short mode; // if 1, full roster, else use monster from storwhich_me_m
561 position
= array_pos
;
566 store_m
->number
= on_monst_menu
[array_pos
];
567 store_m
->m_d
= return_monster_template((unsigned char)on_monst_menu
[array_pos
]);
576 cd_create_dialog(999,mainPtr
);
578 if (full_roster
== FALSE
) {
579 cd_activate_item(999,28,0);
580 cd_activate_item(999,29,0);
582 cd_add_label(999,5,"Name",1026);
583 cd_add_label(999,6,"Level",1021);
584 cd_add_label(999,7,"Health",1024);
585 cd_add_label(999,8,"Magic Pts.",1032);
586 cd_add_label(999,9,"Armor",1023);
587 cd_add_label(999,10,"Skill",1018);
588 cd_add_label(999,11,"Morale",1023);
589 cd_add_label(999,12,"Speed",1019);
590 cd_add_label(999,13,"Att #1",1026);
591 cd_add_label(999,14,"Att #2",1023);
592 cd_add_label(999,15,"Att #3",1022);
593 cd_add_label(999,16,"Mage L.",1034);
594 cd_add_label(999,17,"Priest L.",1030);
595 cd_add_label(999,18,"Poison",1023);
596 cd_add_label(999,19,"Ability 1",1029);
597 cd_add_label(999,31,"Ability 2",1029);
598 cd_add_label(999,20,"Magic Resistant",45);
599 cd_add_label(999,21,"Immune To Magic",45);
600 cd_add_label(999,22,"Fire Resistant",45);
601 cd_add_label(999,23,"Immune To Fire",45);
602 cd_add_label(999,24,"Cold Resistant",45);
603 cd_add_label(999,25,"Immune To Cold",45);
604 cd_add_label(999,26,"Poison Resistant",45);
605 cd_add_label(999,27,"Immune To Poison",45);
607 while (dialog_not_toast
)
608 ModalDialog(); cd_kill_dialog(999,0);
612 Boolean
display_help_event_filter (short item_hit
)
618 dialog_not_toast
= FALSE
;
623 cur_entry
= (cur_entry
== 3) ? num_entries
+ 2 : cur_entry
- 1;
624 else cur_entry
= (cur_entry
== num_entries
+ 2) ? 3 : cur_entry
+ 1;
625 get_str (get_text
, 25 + store_help_mode
, cur_entry
);
626 cd_set_item_text(997,7,(char *) get_text
);
633 void display_help(short mode
,short parent
)
639 store_help_mode
= mode
;
644 cd_create_dialog_parent_num(997,parent
);
646 get_str (get_text
, 25 + mode
, 1);
647 csit( 997,6,(char *) get_text
);
648 GetIndString (get_text
, 25 + mode
, 2);
649 StringToNum(get_text
,&get_val
);
650 num_entries
= (short) get_val
;
651 get_str (get_text
, 25 + mode
, cur_entry
);
652 csit( 997,7,(char *) get_text
);
654 while (dialog_not_toast
)
655 ModalDialog(); cd_kill_dialog(997,0);
661 Boolean
display_alchemy_event_filter (short item_hit
)
665 dialog_not_toast
= FALSE
;
672 void display_alchemy()
675 char *alch_names
[] = {"Weak Curing Potion (1)","Weak Healing Potion (1)","Weak Poison (1)",
676 "Weak Speed Potion (3)","Medium Poison (3)",
677 "Medium Heal Potion (4)","Strong Curing (5)","Medium Speed Potion (5)",
678 "Graymold Salve (7)","Weak Energy Potion (9)",
679 "Potion of Clarity (9)","Strong Poison (10)","Strong Heal Potion (12)","Killer Poison (12)",
680 "Resurrection Balm (9)","Medium Energy Ptn. (14)","Knowledge Brew (19)",
681 "Strong Strength (10)","Bliss (16)","Strong Power (20)"
686 cd_create_dialog_parent_num(996,1019);
689 for (i
= 0; i
< 20; i
++) {
690 cd_add_label(996,i
+ 4,alch_names
[i
],1083);
691 if (party
.alchemy
[i
] > 0)
692 cd_set_led(996,i
+ 4,1);
693 else cd_set_led(996,i
+ 4,0);
696 while (dialog_not_toast
)
697 ModalDialog(); cd_kill_dialog(996,0);
698 dialog_not_toast
= TRUE
;
703 void display_traits_graphics()
708 for (i
= 0; i
< 3; i
++) {
709 cd_set_led(1013,4 + i
,(store_pc
->race
== i
) ? 1 : 0);
711 for (i
= 0; i
< 10; i
++) {
712 cd_set_led(1013,7 + i
,(store_pc
->traits
[i
] > 0) ? 1 : 0);
714 for (i
= 0; i
< 5; i
++) {
715 cd_set_led(1013,36 + i
,(store_pc
->traits
[10 + i
] > 0) ? 1 : 0);
718 store
= get_tnl(store_pc
);
719 cdsin(1013,18,store
);
722 void pick_race_abil_event_filter(short item_hit
)
730 dialog_not_toast
= FALSE
;
732 case 4: case 5: case 6:
733 if (store_trait_mode
== 0)
734 pc
->race
= item_hit
- 4;
735 display_traits_graphics();
736 get_str(abil_str
,5,12 + item_hit
);
737 csit(1013,19,(char *) abil_str
);
739 case 36: case 37: case 38: case 39: case 40:
740 if (store_trait_mode
!= 1)
741 pc
->traits
[item_hit
- 36 + 10] = (pc
->traits
[item_hit
- 36 + 10] == TRUE
) ? FALSE
: TRUE
;
742 display_traits_graphics();
743 get_str(abil_str
,5,item_hit
- 36 + 11);
744 csit(1013,19,(char *) abil_str
);
749 if (store_trait_mode
!= 1)
750 pc
->traits
[item_hit
- 7] = (pc
->traits
[item_hit
- 7] == TRUE
) ? FALSE
: TRUE
;
751 display_traits_graphics();
752 get_str(abil_str
,5,item_hit
- 6);
753 csit(1013,19,(char *) abil_str
);
759 void pick_race_abil(pc_record_type
*pc
,short mode
,short parent_num
)
760 //mode; // 0 - edit 1 - just display 2 - can't change race
762 char *start_str1
= "Click on button by name for description.";
763 char *start_str2
= "Click on advantage button to add/remove.";
766 store_trait_mode
= mode
;
770 cd_create_dialog_parent_num(1013,parent_num
);
772 display_traits_graphics();
774 csit(1013,19,start_str1
);
775 else csit(1013,19,start_str2
);
777 while (dialog_not_toast
)
778 ModalDialog(); cd_kill_dialog(1013,0);
779 dialog_not_toast
= TRUE
;
782 void display_pc_info()
789 short weap1
= 24,weap2
= 24,hit_adj
= 0, dam_adj
= 0,skill_item
;
793 store
= pc_carry_weight(pc
);
794 i
= amount_pc_can_carry(pc
);
795 sprintf ((char *) to_draw
, "%s is carrying %d stones out of %d.",adven
[pc
].name
,store
,i
);
796 csit(1019,69,(char *) to_draw
);
798 sprintf((char *) str
,"%d out of %d.",
799 adven
[pc
].cur_health
,adven
[pc
].max_health
);
800 csit(1019,65,(char *) str
);
801 sprintf((char *) str
,"%d out of %d.",
802 adven
[pc
].cur_sp
,adven
[pc
].max_sp
);
803 csit(1019,67,(char *) str
);
805 for (i
= 0; i
< 19; i
++) {
806 cdsin(1019,18 + i
* 2,adven
[pc
].skills
[i
]);
808 store
= total_encumberance(pc
);
809 cdsin(1019,62,store
);
810 csit(1019,9,adven
[pc
].name
);
811 cdsin(1019,11,adven
[pc
].level
);
812 cdsin(1019,13,adven
[pc
].experience
);
813 cdsin(1019,71,adven
[pc
].skill_pts
);
814 store
= adven
[pc
].level
* get_tnl(&adven
[pc
]);
815 cdsin(1019,15,store
);
816 csp(1019,7,800 + adven
[pc
].which_graphic
);
819 for (i
= 0; i
< 24; i
++)
820 if (((adven
[pc
].items
[i
].variety
== 1) || (adven
[pc
].items
[i
].variety
== 2)) &&
821 (adven
[pc
].equip
[i
] == TRUE
)) {
827 hit_adj
= stat_adj(pc
,1) * 5 - (total_encumberance(pc
)) * 5
828 + (5 * minmax(-8,8,adven
[pc
].status
[1]));
829 if ((adven
[pc
].traits
[2] == FALSE
) && (weap2
< 24))
832 dam_adj
= stat_adj(pc
,0) + minmax(-8,8,adven
[pc
].status
[1]);
833 if ((skill_item
= text_pc_has_abil_equip(pc
,101)) < 24) {
834 hit_adj
+= 5 * (adven
[pc
].items
[skill_item
].item_level
+ 1);
835 dam_adj
+= adven
[pc
].items
[skill_item
].item_level
;
837 if ((skill_item
= text_pc_has_abil_equip(pc
,96)) < 24) {
841 if ((skill_item
= text_pc_has_abil_equip(pc
,97)) < 24) {
846 csit(1019,56,"No weapon.");
848 csit(1019,59,"No weapon.");
851 if (is_ident(adven
[pc
].items
[weap1
]) == FALSE
)
852 csit(1019,56,"Not identified.");
854 if (hit_adj
+ 5 * adven
[pc
].items
[weap1
].bonus
< 0)
855 sprintf(to_draw
,"Penalty to hit: %%%d",hit_adj
+ 5 * adven
[pc
].items
[weap1
].bonus
);
856 else sprintf(to_draw
,"Bonus to hit: +%%%d",hit_adj
+ 5 * adven
[pc
].items
[weap1
].bonus
);
857 csit(1019,56,to_draw
);
858 sprintf(to_draw
,"Damage: (1-%d) + %d",adven
[pc
].items
[weap1
].item_level
859 ,dam_adj
+ adven
[pc
].items
[weap1
].bonus
);
860 csit(1019,57,to_draw
);
865 if (is_ident(adven
[pc
].items
[weap2
]) == FALSE
)
866 csit(1019,59,"Not identified.");
868 if (hit_adj
+ 5 * adven
[pc
].items
[weap2
].bonus
< 0)
869 sprintf(to_draw
,"Penalty to hit: %%%d",hit_adj
+ 5 * adven
[pc
].items
[weap2
].bonus
);
870 else sprintf(to_draw
,"Bonus to hit: +%%%d",hit_adj
+ 5 * adven
[pc
].items
[weap2
].bonus
);
871 csit(1019,59,to_draw
);
872 sprintf(to_draw
,"Damage: (1-%d) + %d",adven
[pc
].items
[weap2
].item_level
873 ,dam_adj
+ adven
[pc
].items
[weap2
].bonus
);
874 csit(1019,60,to_draw
);
881 void give_pc_info_event_filter(short item_hit
)
889 dialog_not_toast
= FALSE
;
893 store_pc_num
= (store_pc_num
== 0) ? 5 : store_pc_num
- 1;
894 while (adven
[store_pc_num
].main_status
!= 1);
899 store_pc_num
= (store_pc_num
+ 1) % 6;
900 while (adven
[store_pc_num
].main_status
!= 1);
904 display_pc(pc
,0,1019);
907 display_pc(pc
,1,1019);
910 pick_race_abil(&adven
[pc
],1,1019);
919 void give_pc_info(short pc_num
)
924 store_pc_num
= pc_num
;
927 cd_create_dialog_parent_num(1019,0);
929 for (i
= 0; i
< 19; i
++) {
930 get_str(str
,9,1 + i
* 2);
931 csit(1019,17 + i
* 2,(char *) str
);
934 while (dialog_not_toast
)
935 ModalDialog(); cd_kill_dialog(1019,0);
938 void adventure_notes_event_filter (short item_hit
)
945 dialog_not_toast
= FALSE
;
950 if (store_page_on
== 0)
951 store_page_on
= (store_num_i
- 1) / 3;
952 else store_page_on
--;
955 if (store_page_on
== (store_num_i
- 1) / 3)
957 else store_page_on
++;
961 case 10: case 9: case 11:
962 party
.special_notes_str
[(store_page_on
* 3) + item_hit
- 9][0] = -1;
965 for (i
= 0; i
< 3; i
++) {
966 if (party
.special_notes_str
[i
][0] > 0) {
967 switch (party
.special_notes_str
[i
][0] / 1000) {
968 case 0: if (party
.special_notes_str
[i
][0] % 1000 < 160)
969 strcpy((char *) place_str
,data_store5
->scen_strs
[party
.special_notes_str
[i
][0] % 1000]);
970 else strcpy((char *) place_str
,scen_strs2
[(party
.special_notes_str
[i
][0] % 1000) - 160]);
973 load_outdoors(party
.special_notes_str
[i
][1] % scenario
.out_width
,
974 party
.special_notes_str
[i
][1] / scenario
.out_width
,
975 0,0,1,party
.special_notes_str
[i
][0] % 1000,(char *)place_str
);
977 case 2: load_town(party
.special_notes_str
[i
][1],2,party
.special_notes_str
[i
][0],(char *)place_str
); break;
980 get_str(place_str
,party
.special_notes_str
[i
][0],party
.special_notes_str
[i
][1]);
981 csit(961,3 + i
,(char *) place_str
);
982 cd_activate_item(961,9 + i
,1);
984 else cd_activate_item(961,9 + i
,0);
986 for (i
= store_page_on
* 3; i
< (store_page_on
* 3) + 3; i
++) {
987 if (party
.special_notes_str
[i
][0] > 0) {
988 switch (party
.special_notes_str
[i
][0] / 1000) {
989 case 0: if (party
.special_notes_str
[i
][0] % 1000 < 160)
990 strcpy((char *) place_str
,data_store5
->scen_strs
[party
.special_notes_str
[i
][0] % 1000]);
991 else strcpy((char *) place_str
,scen_strs2
[(party
.special_notes_str
[i
][0] % 1000) - 160]);
994 load_outdoors(party
.special_notes_str
[i
][1] % scenario
.out_width
,
995 party
.special_notes_str
[i
][1] / scenario
.out_width
,
996 0,0,1,party
.special_notes_str
[i
][0] % 1000,(char *)place_str
);
998 case 2: load_town(party
.special_notes_str
[i
][1],2,party
.special_notes_str
[i
][0] % 1000,(char *)place_str
); break;
1002 csit(961,3 + (i
- store_page_on
* 3),(char *) place_str
);
1003 cd_activate_item(961,9 + (i
- store_page_on
* 3),1);
1006 csit(961,3 + (i
- store_page_on
* 3),"");
1007 cd_activate_item(961,9 + (i
- store_page_on
* 3),0);
1012 void adventure_notes()
1017 char place_str
[256];
1020 for (i
= 0; i
< 140; i
++)
1021 if (party
.special_notes_str
[i
][0] > 0)
1022 store_num_i
= i
+ 1;
1024 if (store_num_i
== 0) {
1025 ASB("Nothing in your journal.");
1030 make_cursor_sword();
1032 cd_create_dialog_parent_num(961,0);
1034 for (i
= 0; i
< 3; i
++) {
1035 if (party
.special_notes_str
[i
][0] > 0) {
1036 switch (party
.special_notes_str
[i
][0] / 1000) {
1038 if (party
.special_notes_str
[i
][0] % 1000 < 160)
1039 strcpy((char *) place_str
,data_store5
->scen_strs
[party
.special_notes_str
[i
][0] % 1000]);
1040 else strcpy((char *) place_str
,scen_strs2
[(party
.special_notes_str
[i
][0] % 1000) - 160]);
1043 load_outdoors(party
.special_notes_str
[i
][1] % scenario
.out_width
,
1044 party
.special_notes_str
[i
][1] / scenario
.out_width
,
1045 0,0,1,party
.special_notes_str
[i
][0] % 1000,(char *)place_str
);
1047 case 2: load_town(party
.special_notes_str
[i
][1],2,party
.special_notes_str
[i
][0] % 1000,(char *)place_str
); break;
1050 csit(961,3 + i
,(char *) place_str
);
1051 cd_activate_item(961,9 + i
,1);
1053 else cd_activate_item(961,9 + i
,0);
1055 if (store_num_i
<= 3) {
1056 cd_activate_item(961,7,0);
1057 cd_activate_item(961,8,0);
1059 while (dialog_not_toast
)
1061 cd_kill_dialog(961,0);
1068 char place_str
[256];
1074 if ((personality
= party
.talk_save
[store_page_on
].personality
) >= 0) {
1075 if (personality
/ 10 != cur_town_talk_loaded
)
1076 load_town(personality
/ 10,1,0,NULL
);
1078 load_town(party
.talk_save
[store_page_on
].town_num
,2,0,(char *) place_str
);
1079 csit(960,9,(char *) place_str
);
1081 //get_str(place_str,120 + ((personality - 1) / 10),((personality - 1) % 10) + 1);
1082 csit(960,7,data_store3
->talk_strs
[personality
% 10]);
1084 if (party
.talk_save
[store_page_on
].str1
>= 1000) {
1085 if (party
.talk_save
[store_page_on
].str1
>= 3000) {
1086 if (party
.talk_save
[store_page_on
].str1
- 3000 < 160)
1087 csit(960,3,data_store5
->scen_strs
[party
.talk_save
[store_page_on
].str1
- 3000 ]);
1088 else csit(960,3,scen_strs2
[party
.talk_save
[store_page_on
].str1
- 3000 - 160]);
1092 load_town(party
.talk_save
[store_page_on
].town_num
,2,
1093 party
.talk_save
[store_page_on
].str1
- 2000 ,(char *) place_str
);
1094 csit(960,3,(char *) place_str
);
1097 else if ((party
.talk_save
[store_page_on
].str1
> 0) &&
1098 (party
.talk_save
[store_page_on
].str1
< 170))
1099 csit(960,3,data_store3
->talk_strs
[party
.talk_save
[store_page_on
].str1
]);
1101 if (party
.talk_save
[store_page_on
].str2
>= 1000) {
1102 if (party
.talk_save
[store_page_on
].str2
>= 3000) {
1103 if (party
.talk_save
[store_page_on
].str2
- 3000 < 160)
1104 csit(960,5,data_store5
->scen_strs
[party
.talk_save
[store_page_on
].str2
- 3000 ]);
1105 else csit(960,5,scen_strs2
[party
.talk_save
[store_page_on
].str2
- 3000 - 160]);
1109 load_town(party
.talk_save
[store_page_on
].town_num
,2,
1110 party
.talk_save
[store_page_on
].str2
- 2000 + 20,(char *) place_str
);
1111 csit(960,5,(char *) place_str
);
1114 else if ((party
.talk_save
[store_page_on
].str2
> 0) &&
1115 (party
.talk_save
[store_page_on
].str2
< 170))
1116 csit(960,5,data_store3
->talk_strs
[party
.talk_save
[store_page_on
].str2
]);
1120 void talk_notes_event_filter (short item_hit
)
1123 char place_str
[256];
1126 dialog_not_toast
= FALSE
;
1130 if (item_hit
== 10) {
1131 if (store_page_on
== 0)
1132 store_page_on
= store_num_i
- 1;
1133 else store_page_on
--;
1136 if (store_page_on
== store_num_i
- 1)
1138 else store_page_on
++;
1143 party
.talk_save
[store_page_on
].personality
= -1;
1154 char place_str
[256];
1157 for (i
= 0; i
< 120; i
++)
1158 if (party
.talk_save
[i
].personality
!= -1)
1159 store_num_i
= i
+ 1;
1161 if (store_num_i
== 0) {
1162 ASB("Nothing in your talk journal.");
1167 make_cursor_sword();
1169 cd_create_dialog_parent_num(960,0);
1172 if (store_num_i
== 1) {
1173 cd_activate_item(960,10,0);
1174 cd_activate_item(960,11,0);
1177 while (dialog_not_toast
)
1179 cd_kill_dialog(960,0);
1185 // Only call these when main window is in foreground!
1186 void display_enc_string(short val1
,short val2
,short sound
)
1189 void display_2_enc_string(short val1
,short val2
,short val3
,short val4
,short sound
)
1193 // Call call this anywhere, but don't forget parent!!!
1194 void give_help(short help1
,short help2
,short parent_num
)
1196 Boolean help_forced
= FALSE
;
1197 char str1
[256],str2
[256];
1203 if ((PSD
[306][4] > 0) && (help_forced
== FALSE
))
1205 if (party
.help_received
[help1
] > 0)
1208 party
.help_received
[help1
] = 1;
1209 get_str(str1
,10,help1
);
1211 get_str(str2
,10,help2
);
1213 display_strings((char *)str1
, "",-1,-1,-1,-1,"Instant Help",57,724, parent_num
);
1214 else display_strings((char *)str1
,(char *)str2
,-1,-1,-1,-1,"Instant Help",57,724, parent_num
);
1218 void put_spec_item_info (short which_i
)
1220 char item_name
[256];
1222 display_strings(data_store5
->scen_strs
[60 + 1 + which_i
* 2],"",
1224 data_store5
->scen_strs
[60 + which_i
* 2],57,1600 + scenario
.intro_pic
,0);
1227 void display_strings_event_filter (short item_hit
)
1230 Boolean had1
= FALSE
, had2
= FALSE
;
1234 dialog_not_toast
= FALSE
;
1238 for (i
= 0; i
< 140; i
++)
1239 if ((store_str_label_1
== party
.special_notes_str
[i
][0]) &&
1240 (store_str_label_1b
== party
.special_notes_str
[i
][1]))
1242 if (had1
== FALSE
) {
1243 //give_help(58,0,store_which_string_dlog);
1244 for (i
= 0; i
< 140; i
++)
1245 if (party
.special_notes_str
[i
][0] <= 0) {
1246 party
.special_notes_str
[i
][0] = store_str_label_1
;
1247 party
.special_notes_str
[i
][1] = store_str_label_1b
;
1248 //party.special_notes_str[i][1] = store_str1b;
1249 ASB("Info added to Encounter Notes.");
1254 for (i
= 0; i
< 140; i
++)
1255 if ((store_str_label_2
== party
.special_notes_str
[i
][0]) &&
1256 (store_str_label_2b
== party
.special_notes_str
[i
][1]))
1258 if (had2
== FALSE
) {
1259 for (i
= 0; i
< 140; i
++)
1260 if (party
.special_notes_str
[i
][0] <= 0) {
1261 party
.special_notes_str
[i
][0] = store_str_label_2
;
1262 party
.special_notes_str
[i
][1] = store_str_label_2b
;
1263 //party.special_notes_str[i][1] = store_str2b;
1272 // str_label_1 & str_label_2 uysed for saving button for journal
1273 // 1000 + x scen 2000 + x out 3000 + x town
1274 void display_strings(char *text1
, char *text2
,short str_label_1
,short str_label_2
,short str_label_1b
,
1276 char *title
,short sound_num
,short graphic_num
,short parent_num
)
1280 char sign_text
[256];
1282 Boolean sound_done
= FALSE
;
1284 make_cursor_sword();
1286 store_str_label_1
= str_label_1
;
1287 store_str_label_2
= str_label_2
;
1288 store_str_label_1b
= str_label_1b
;
1289 store_str_label_2b
= str_label_2b
;
1291 store_which_string_dlog
= 970;
1292 if (strlen(title
) > 0)
1293 store_which_string_dlog
+= 2;
1294 if ((text2
!= NULL
) && (text2
[0] != 0))
1295 store_which_string_dlog
++;
1296 cd_create_dialog_parent_num(store_which_string_dlog
,parent_num
);
1298 csp(store_which_string_dlog
,store_which_string_dlog
,graphic_num
);
1300 csit(store_which_string_dlog
,4,(char *) text1
);
1301 if (text2
!= NULL
) {
1302 csit(store_which_string_dlog
,5,(char *) text2
);
1304 if (strlen(title
) > 0)
1305 csit(store_which_string_dlog
,6,title
);
1306 csp(store_which_string_dlog
,3,graphic_num
);
1308 play_sound(sound_num
);
1310 if ((str_label_1
< 0) && (str_label_2
< 0))
1311 cd_activate_item(store_which_string_dlog
,2,0);
1312 while (dialog_not_toast
)
1313 ModalDialog(); //cd_kill_dialog(store_which_string_dlog,0);
1314 final_process_dialog(store_which_string_dlog
);
1317 void give_error(char *text1
, char *text2
,short parent_num
)
1319 display_strings(text1
,text2
,-1,-1,-1,-1,"Error!",57,716,parent_num
);
1322 void display_strings_with_nums(short a1
,short a2
, short b1
, short b2
,
1323 char *title
,short sound_num
,short graphic_num
,short parent_num
)
1325 char str1
[256] = "", str2
[256] = "";
1327 if ((a1
> 0) && (a2
> 0))
1328 get_str(str1
,a1
,a2
);
1329 if ((b1
> 0) && (b2
> 0))
1330 get_str(str2
,b1
,b2
);
1331 display_strings((char *) str1
,(char *) str2
,-1,-1,-1,-1,
1332 title
, sound_num
, graphic_num
, parent_num
);