diff -w -c -r Borg/borg1.c adamborg/borg1.c *** Borg/borg1.c Sun Apr 13 23:19:47 1997 --- adamborg/borg1.c Sun Apr 13 23:23:21 1997 *************** *** 4,9 **** --- 4,10 ---- #include "angband.h" + #ifdef ALLOW_BORG #include "borg1.h" *************** *** 43,53 **** */ bool auto_flag_save = FALSE; /* Save savefile at each level */ - bool auto_flag_dump = FALSE; /* Save savefile at each death */ - /* * Use a simple internal random number generator */ --- 44,53 ---- */ bool auto_flag_save = FALSE; /* Save savefile at each level */ bool auto_flag_dump = FALSE; /* Save savefile at each death */ + bool borg_save; /* do a save next level */ /* * Use a simple internal random number generator */ *************** *** 59,65 **** --- 59,67 ---- u32b auto_rand_local; /* Save personal setting */ + bool auto_do_star_id; + /* * Hack -- Time variables */ *************** *** 66,72 **** s16b c_t = 0L; /* Current "time" */ - /* * Hack -- Other time variables */ --- 68,73 ---- *************** *** 96,105 **** --- 97,109 ---- bool goal_recalling; /* Currently waiting for recall */ + s16b borg_times_twitch; /* how often twitchy on this level */ + bool stair_less; /* Use the next "up" staircase */ bool stair_more; /* Use the next "down" staircase */ s32b auto_began; /* When this level began */ + s32b auto_time_town; /* how long it has been since I was in town */ s16b avoidance = 0; /* Current danger thresh-hold */ *************** *** 106,115 **** --- 110,132 ---- bool auto_failure; /* Notice failure */ bool auto_simulate; /* Simulation flag */ + bool borg_attacking; /* Simulation flag */ bool auto_completed; /* Completed the level */ + /* defence flags */ + bool borg_prot_from_evil; + bool borg_speed; + bool borg_bless; + bool borg_temp_fire; + bool borg_temp_cold; + bool borg_temp_acid; + bool borg_temp_poison; + bool borg_temp_elec; + s16b borg_goi; + bool borg_shield; + /* * Current shopping information */ *************** *** 133,138 **** --- 150,158 ---- int g_x; /* Goal location (X) */ int g_y; /* Goal location (Y) */ + /* BIG HACK! Assume only 10 cursed artifacts */ + int bad_obj_x[10]; /* Dropped cursed artifact at location (X) */ + int bad_obj_y[10]; /* Dropped cursed artifact at location (Y) */ /* *************** *** 152,157 **** --- 172,178 ---- bool do_cut; /* Currently bleeding */ bool do_stun; /* Currently stunned */ + bool do_heavy_stun; /* Currently very stunned */ bool do_image; /* May be hallucinating */ bool do_study; /* May learn spells */ *************** *** 170,176 **** --- 191,205 ---- s16b my_stat_cur[6]; /* Current "natural" stat values */ s16b my_stat_use[6]; /* Current "resulting" stat values */ s16b my_stat_ind[6]; /* Current "additions" to stat values */ + bool my_need_stat_check[6]; /* do I need to check my stats? */ + s16b my_stat_add[6]; /* additions to stats This will allow upgrading of */ + /* equiptment to allow a ring of int +4 to be traded */ + /* for a ring of int +6 even if maximized to allow a */ + /* later swap to be better. */ + + s16b home_stat_add[6]; + s16b my_ac; /* Base armor */ s16b my_to_ac; /* Plusses to ac */ s16b my_to_hit; /* Plusses to hit */ *************** *** 187,203 **** byte my_resist_cold; /* Resist cold */ byte my_resist_pois; /* Resist poison */ ! byte my_resist_fear; /* Resist fear */ byte my_resist_lite; /* Resist light */ byte my_resist_dark; /* Resist darkness */ - byte my_resist_blind; /* Resist blindness */ - byte my_resist_confu; /* Resist confusion */ - byte my_resist_sound; /* Resist sound */ - byte my_resist_shard; /* Resist shards */ - byte my_resist_nexus; /* Resist nexus */ - byte my_resist_nethr; /* Resist nether */ byte my_resist_chaos; /* Resist chaos */ byte my_resist_disen; /* Resist disenchant */ byte my_sustain_str; /* Keep strength */ byte my_sustain_int; /* Keep intelligence */ --- 216,232 ---- byte my_resist_cold; /* Resist cold */ byte my_resist_pois; /* Resist poison */ ! byte my_resist_conf; /* Resist confusion */ ! byte my_resist_sound; /* Resist sound */ byte my_resist_lite; /* Resist light */ byte my_resist_dark; /* Resist darkness */ byte my_resist_chaos; /* Resist chaos */ byte my_resist_disen; /* Resist disenchant */ + byte my_resist_shard; /* Resist shards */ + byte my_resist_nexus; /* Resist nexus */ + byte my_resist_blind; /* Resist blindness */ + byte my_resist_neth; /* Resist nether */ + byte my_resist_fear; /* Resist fear */ byte my_sustain_str; /* Keep strength */ byte my_sustain_int; /* Keep intelligence */ *************** *** 218,223 **** --- 247,268 ---- byte my_telepathy; /* Telepathy */ byte my_slow_digest; /* Slower digestion */ + /* various slays */ + byte my_slay_animal; + byte my_slay_evil; + byte my_slay_undead; + byte my_slay_demon; + byte my_slay_orc; + byte my_slay_troll; + byte my_slay_giant; + byte my_slay_dragon; + byte my_kill_dragon; + byte my_impact; + byte my_brand_acid; + byte my_brand_elec; + byte my_brand_fire; + byte my_brand_cold; + s16b my_see_infra; /* Infravision range */ s16b my_skill_dis; /* Skill: Disarming */ *************** *** 263,273 **** --- 308,324 ---- s16b amt_fuel; s16b amt_food; s16b amt_ident; + s16b amt_star_ident; s16b amt_recall; s16b amt_phase; s16b amt_escape; s16b amt_teleport; + s16b amt_teleport_staff; + s16b amt_heal; + s16b amt_ez_heal; + s16b amt_mana; + s16b amt_ez_mana; s16b amt_cure_critical; s16b amt_cure_serious; *************** *** 282,287 **** --- 333,340 ---- s16b amt_fix_stat[6]; s16b amt_fix_exp; + s16b amt_speed; + s16b amt_enchant_to_a; s16b amt_enchant_to_d; s16b amt_enchant_to_h; *************** *** 291,299 **** * Various "amounts" (for the home) */ - s16b num_fuel; s16b num_food; s16b num_ident; s16b num_recall; s16b num_phase; s16b num_escape; --- 344,352 ---- * Various "amounts" (for the home) */ s16b num_food; s16b num_ident; + s16b num_star_ident; s16b num_recall; s16b num_phase; s16b num_escape; *************** *** 309,320 **** --- 362,420 ---- s16b num_fix_stat[6]; s16b num_fix_exp; + s16b num_mana; + s16b num_heal; s16b num_enchant_to_a; s16b num_enchant_to_d; s16b num_enchant_to_h; + s16b num_artifact; + s16b home_slot_free; + s16b home_damage; + s16b num_duplicate_items; + s16b num_slow_digest; + s16b num_regenerate; + s16b num_telepathy; + s16b num_lite; + s16b num_see_inv; + s16b num_ffall; + s16b num_free_act; + s16b num_hold_life; + s16b num_immune_acid; + s16b num_immune_elec; + s16b num_immune_fire; + s16b num_immune_cold; + s16b num_resist_acid; + s16b num_resist_elec; + s16b num_resist_fire; + s16b num_resist_cold; + s16b num_resist_pois; + s16b num_resist_conf; + s16b num_resist_sound; + s16b num_resist_lite; + s16b num_resist_dark; + s16b num_resist_chaos; + s16b num_resist_disen; + s16b num_resist_shard; + s16b num_resist_nexus; + s16b num_resist_blind; + s16b num_resist_neth; + s16b num_speed; + s16b num_edged_weapon; + s16b num_bad_gloves; + s16b num_weapons; + s16b num_bow; + s16b num_rings; + s16b num_neck; + s16b num_armor; + s16b num_cloaks; + s16b num_shields; + s16b num_hats; + s16b num_gloves; + s16b num_boots; + /* * Hack -- extra state variables */ *************** *** 324,329 **** --- 424,430 ---- int auto_max_level = 0; /* Maximum player level */ int auto_max_depth = 0; /* Maximum dungeon depth */ + int fear_depth = 0; /* Maximum dungeon depth */ /* *************** *** 342,347 **** --- 443,450 ---- int auto_level; /* Current level */ + bool borg_king; /* We won! Time to retire. */ + s32b auto_exp; /* Current experience */ s32b auto_gold; /* Current gold */ *************** *** 348,354 **** int auto_speed; /* Current speed */ ! int auto_ac; /* Current class */ int auto_chp; /* Current hitpoints */ int auto_mhp; /* Maximum hitpoints */ --- 451,457 ---- int auto_speed; /* Current speed */ ! int auto_ac; /* Current ac */ int auto_chp; /* Current hitpoints */ int auto_mhp; /* Maximum hitpoints */ *************** *** 478,484 **** /* * Hack -- depth readiness */ ! bool auto_fear_depth[128]; /* --- 581,594 ---- /* * Hack -- depth readiness */ ! int auto_fear_depth = 0; /* number of times level completed */ ! bool finished_level; ! bool borg_collect_potions_morgoth; ! /* a 3 state boolean */ ! /*-1 = not checked yet */ ! /* 0 = not ready */ ! /* 1 = ready */ ! int borg_ready_morgoth; /* *************** *** 645,653 **** bool auto_do_crush_slow = FALSE; - /* * Query the "attr/char" at a given location on the screen * We return "zero" if the given location was legal --- 755,764 ---- bool auto_do_crush_slow = FALSE; + /* am I fighting a unique? */ + bool borg_fighting_unique; /* * Query the "attr/char" at a given location on the screen * We return "zero" if the given location was legal *************** *** 984,990 **** int i; /* Nothing ready */ ! if (auto_key_head == auto_key_tail) return (0); /* Extract the keypress */ i = auto_key_queue[auto_key_tail]; --- 1095,1102 ---- int i; /* Nothing ready */ ! if (auto_key_head == auto_key_tail) ! return (0); /* Extract the keypress */ i = auto_key_queue[auto_key_tail]; *************** *** 1176,1181 **** --- 1288,1306 ---- auto_level = atoi(buf); } + /* Extract current level */ + if (0 == borg_what_text(COL_TITLE, ROW_TITLE, -8, &t_a, buf)) + { + /* Note "Lev" vs "LEV" */ + borg_king = (buf[0] == '*' && + buf[1] == '*' && + buf[2] == 'K' && + buf[3] == 'I' && + buf[4] == 'N' && + buf[5] == 'G' && + buf[6] == '*' && + buf[7] == '*'); + } /* Assume experience is fine */ do_fix_exp = FALSE; *************** *** 1208,1213 **** --- 1333,1343 ---- { /* Extract "Fast (+x)" or "Slow (-x)" */ auto_speed = 110 + atoi(buf + 6); + + /* if hasting, it doesn't count as 'auto_speed'. The speed */ + /* gained from hasting is counted seperately. */ + if (borg_speed) + auto_speed -= 10; } /* Extract armor class */ *************** *** 1252,1258 **** /* Clear all the "state flags" */ do_weak = do_hungry = do_full = do_gorged = FALSE; do_blind = do_confused = do_afraid = do_poisoned = FALSE; ! do_cut = do_stun = do_image = do_study = FALSE; /* Check for hunger */ if (0 == borg_what_text(COL_HUNGRY, ROW_HUNGRY, -1, &t_a, buf)) --- 1382,1388 ---- /* Clear all the "state flags" */ do_weak = do_hungry = do_full = do_gorged = FALSE; do_blind = do_confused = do_afraid = do_poisoned = FALSE; ! do_cut = do_stun = do_heavy_stun = do_image = do_study = FALSE; /* Check for hunger */ if (0 == borg_what_text(COL_HUNGRY, ROW_HUNGRY, -1, &t_a, buf)) *************** *** 1309,1316 **** /* XXX XXX Check for stun */ if (0 == borg_what_text(COL_STUN, ROW_STUN, -1, &t_a, buf)) { ! /* Check for any text */ ! if (isalpha(buf[0])) do_stun = TRUE; } --- 1439,1449 ---- /* XXX XXX Check for stun */ if (0 == borg_what_text(COL_STUN, ROW_STUN, -1, &t_a, buf)) { ! /* Check for Stun */ ! if (buf[0] == 'S') do_stun = TRUE; ! ! /* Check for Heavy Stun */ ! if (buf[0] == 'H') do_heavy_stun = TRUE; } *************** *** 1368,1373 **** --- 1501,1507 ---- /* Prapare a local random number seed */ + if (!auto_rand_local) auto_rand_local = rand_int(0x10000000); *************** *** 1543,1555 **** /* Hack -- Access max depth */ auto_max_depth = p_ptr->max_dlv; } #else #ifdef MACINTOSH static int HACK = 0; ! #endif /* MACINTOSH */ ! #endif /* ALLOW_BORG */ --- 1677,1695 ---- /* Hack -- Access max depth */ auto_max_depth = p_ptr->max_dlv; + + /* HACK when restarting the fear depth is the current max depth */ + fear_depth = p_ptr->max_dlv; + auto_fear_depth = 0; + finished_level = FALSE; } + #else #ifdef MACINTOSH static int HACK = 0; ! #endif ! #endif diff -w -c -r Borg/borg1.h adamborg/borg1.h *** Borg/borg1.h Sun Apr 13 23:19:57 1997 --- adamborg/borg1.h Sun Apr 13 23:23:31 1997 *************** *** 364,370 **** --- 364,372 ---- extern bool auto_cheat_panel; /* Cheat for "panel mode" */ + extern bool auto_do_star_id; + /* * Various silly flags */ *************** *** 373,379 **** --- 375,383 ---- extern bool auto_flag_dump; /* Save savefile at each death */ + extern bool borg_save; /* do a save next time we get to press a key! */ + /* * Use a simple internal random number generator */ *************** *** 420,429 **** --- 424,436 ---- extern bool goal_recalling; /* Currently waiting for recall */ + extern s16b borg_times_twitch; /* how often twitchy on this level */ + extern bool stair_less; /* Use the next "up" staircase */ extern bool stair_more; /* Use the next "down" staircase */ extern s32b auto_began; /* When this level began */ + extern s32b auto_time_town; /* how long it has been since I was in town */ extern s16b avoidance; /* Current danger thresh-hold */ *************** *** 430,440 **** extern bool auto_failure; /* Notice failure */ extern bool auto_simulate; /* Simulation flag */ extern bool auto_completed; /* Completed the level */ - /* * Shop goals */ --- 437,458 ---- extern bool auto_failure; /* Notice failure */ extern bool auto_simulate; /* Simulation flag */ + extern bool borg_attacking; /* Are we attacking a monster? */ extern bool auto_completed; /* Completed the level */ + /* defence flags */ + extern bool borg_prot_from_evil; + extern bool borg_speed; + extern bool borg_bless; + extern bool borg_temp_fire; + extern bool borg_temp_cold; + extern bool borg_temp_acid; + extern bool borg_temp_poison; + extern bool borg_temp_elec; + extern s16b borg_goi; + extern bool borg_shield; /* * Shop goals */ *************** *** 457,463 **** --- 475,484 ---- extern int g_x; /* Goal location (X) */ extern int g_y; /* Goal location (Y) */ + extern int bad_obj_x[10]; /* Dropped cursed artifact at location (X) */ + extern int bad_obj_y[10]; /* Dropped cursed artifact at location (Y) */ + /* * State variables extracted from the screen */ *************** *** 475,480 **** --- 496,502 ---- extern bool do_cut; /* Currently bleeding */ extern bool do_stun; /* Currently stunned */ + extern bool do_heavy_stun; /* Currently stunned */ extern bool do_image; /* May be hallucinating */ extern bool do_study; /* May learn spells */ *************** *** 494,500 **** --- 516,527 ---- extern s16b my_stat_cur[6]; /* Current "natural" stat values */ extern s16b my_stat_use[6]; /* Current "resulting" stat values */ extern s16b my_stat_ind[6]; /* Current "additions" to stat values */ + extern bool my_need_stat_check[6]; /* do I need to check my stats */ + extern s16b my_stat_add[6]; /* aditions to stats */ + + extern s16b home_stat_add[6]; + extern s16b my_ac; /* Base armor */ extern s16b my_to_ac; /* Plusses to ac */ extern s16b my_to_hit; /* Plusses to hit */ *************** *** 511,527 **** extern byte my_resist_cold; /* Resist cold */ extern byte my_resist_pois; /* Resist poison */ ! extern byte my_resist_fear; /* Resist fear */ extern byte my_resist_lite; /* Resist light */ extern byte my_resist_dark; /* Resist darkness */ - extern byte my_resist_blind; /* Resist blindness */ - extern byte my_resist_confu; /* Resist confusion */ - extern byte my_resist_sound; /* Resist sound */ - extern byte my_resist_shard; /* Resist shards */ - extern byte my_resist_nexus; /* Resist nexus */ - extern byte my_resist_nethr; /* Resist nether */ extern byte my_resist_chaos; /* Resist chaos */ extern byte my_resist_disen; /* Resist disenchant */ extern byte my_sustain_str; /* Keep strength */ extern byte my_sustain_int; /* Keep intelligence */ --- 538,554 ---- extern byte my_resist_cold; /* Resist cold */ extern byte my_resist_pois; /* Resist poison */ ! extern byte my_resist_conf; /* Resist confusion */ ! extern byte my_resist_sound; /* Resist sound */ extern byte my_resist_lite; /* Resist light */ extern byte my_resist_dark; /* Resist darkness */ extern byte my_resist_chaos; /* Resist chaos */ extern byte my_resist_disen; /* Resist disenchant */ + extern byte my_resist_shard; /* Resist shards */ + extern byte my_resist_nexus; /* Resist nexus */ + extern byte my_resist_blind; /* Resist blindness */ + extern byte my_resist_neth; /* Resist nether */ + extern byte my_resist_fear; /* Resist fear */ extern byte my_sustain_str; /* Keep strength */ extern byte my_sustain_int; /* Keep intelligence */ *************** *** 542,547 **** --- 569,590 ---- extern byte my_telepathy; /* Telepathy */ extern byte my_slow_digest; /* Slower digestion */ + /* various slays */ + extern byte my_slay_animal; + extern byte my_slay_evil; + extern byte my_slay_undead; + extern byte my_slay_demon; + extern byte my_slay_orc; + extern byte my_slay_troll; + extern byte my_slay_giant; + extern byte my_slay_dragon; + extern byte my_kill_dragon; + extern byte my_impact; + extern byte my_brand_acid; + extern byte my_brand_elec; + extern byte my_brand_fire; + extern byte my_brand_cold; + extern s16b my_see_infra; /* Infravision range */ extern s16b my_skill_dis; /* Skill: Disarming */ *************** *** 588,598 **** --- 631,647 ---- extern s16b amt_fuel; extern s16b amt_food; extern s16b amt_ident; + extern s16b amt_star_ident; extern s16b amt_recall; extern s16b amt_phase; extern s16b amt_escape; extern s16b amt_teleport; + extern s16b amt_teleport_staff; + extern s16b amt_heal; + extern s16b amt_ez_heal; + extern s16b amt_mana; + extern s16b amt_ez_mana; extern s16b amt_cure_critical; extern s16b amt_cure_serious; *************** *** 608,613 **** --- 657,664 ---- extern s16b amt_fix_exp; + extern s16b amt_speed; + extern s16b amt_enchant_to_a; extern s16b amt_enchant_to_d; extern s16b amt_enchant_to_h; *************** *** 617,625 **** * Various "amounts" (for the home) */ - extern s16b num_fuel; extern s16b num_food; extern s16b num_ident; extern s16b num_recall; extern s16b num_phase; extern s16b num_escape; --- 668,676 ---- * Various "amounts" (for the home) */ extern s16b num_food; extern s16b num_ident; + extern s16b num_star_ident; extern s16b num_recall; extern s16b num_phase; extern s16b num_escape; *************** *** 635,647 **** --- 686,746 ---- extern s16b num_fix_stat[6]; extern s16b num_fix_exp; + extern s16b num_mana; + extern s16b num_heal; extern s16b num_enchant_to_a; extern s16b num_enchant_to_d; extern s16b num_enchant_to_h; + extern s16b num_artifact; + extern s16b home_slot_free; + extern s16b home_damage; + extern s16b num_duplicate_items; + extern s16b num_slow_digest; + extern s16b num_regenerate; + extern s16b num_telepathy; + extern s16b num_lite; + extern s16b num_see_inv; + extern s16b num_ffall; + extern s16b num_free_act; + extern s16b num_hold_life; + extern s16b num_immune_acid; + extern s16b num_immune_elec; + extern s16b num_immune_fire; + extern s16b num_immune_cold; + extern s16b num_resist_acid; + extern s16b num_resist_elec; + extern s16b num_resist_fire; + extern s16b num_resist_cold; + extern s16b num_resist_pois; + extern s16b num_resist_conf; + extern s16b num_resist_sound; + extern s16b num_resist_lite; + extern s16b num_resist_dark; + extern s16b num_resist_chaos; + extern s16b num_resist_disen; + extern s16b num_resist_shard; + extern s16b num_resist_nexus; + extern s16b num_resist_blind; + extern s16b num_resist_neth; + extern s16b num_speed; + extern s16b num_edged_weapon; + extern s16b num_bad_gloves; + extern s16b num_weapons; + extern s16b num_bow; + extern s16b num_rings; + extern s16b num_neck; + extern s16b num_armor; + extern s16b num_cloaks; + extern s16b num_shields; + extern s16b num_hats; + extern s16b num_gloves; + extern s16b num_boots; + + /* * Hack -- extra state variables */ *************** *** 650,655 **** --- 749,755 ---- extern int auto_max_level; /* Maximum player level */ extern int auto_max_depth; /* Maximum dungeon depth */ + extern int fear_depth; /* fear below this dungeon depth */ *************** *** 669,674 **** --- 769,776 ---- extern int auto_level; /* Current level */ + extern bool borg_king; /* We won! */ + extern s32b auto_exp; /* Current experience */ extern s32b auto_gold; /* Current gold */ *************** *** 803,811 **** /* * Hack -- depth readiness */ ! extern bool auto_fear_depth[128]; - /* * Hack -- extra fear per "region" */ --- 905,915 ---- /* * Hack -- depth readiness */ ! extern int auto_fear_depth; ! extern bool finished_level; ! extern bool borg_collect_potions_morgoth; ! extern int borg_ready_morgoth; /* * Hack -- extra fear per "region" */ *************** *** 964,969 **** --- 1068,1075 ---- extern bool auto_do_crush_slow; + /* am I fighting a unique */ + extern bool borg_fighting_unique; diff -w -c -r Borg/borg2.c adamborg/borg2.c *** Borg/borg2.c Sun Apr 13 23:20:09 1997 --- adamborg/borg2.c Sun Apr 13 23:23:44 1997 *************** *** 620,627 **** ar = borg_free_room(); /* Initialize the new room */ ! ar->x = ar->x1 = x1; ar->x2 = x2; ! ar->y = ar->y1 = y1; ar->y2 = y2; /* Save the room index */ i = ar->self; --- 620,629 ---- ar = borg_free_room(); /* Initialize the new room */ ! /* ar->x = ar->x1 = x1; ar->x2 = x2;*/ ! /* ar->y = ar->y1 = y1; ar->y2 = y2;*/ ! ar->x1 = x1; ar->x2 = x2; ! ar->y1 = y1; ar->y2 = y2; /* Save the room index */ i = ar->self; *************** *** 660,667 **** /* That room is now "gone" */ ar->when = 0L; ! ar->x1 = ar->x2 = ar->x = 0; ! ar->y1 = ar->y2 = ar->y = 0; /* Add it to the "free list" */ auto_rooms[j].free = auto_rooms[0].free; --- 662,671 ---- /* That room is now "gone" */ ar->when = 0L; ! /* ar->x1 = ar->x2 = ar->x = 0; */ ! /* ar->y1 = ar->y2 = ar->y = 0; */ ! ar->x1 = ar->x2 = 0; ! ar->y1 = ar->y2 = 0; /* Add it to the "free list" */ auto_rooms[j].free = auto_rooms[0].free; *************** *** 761,767 **** /* * Clear out the "room" array */ ! static void borg_wipe_rooms(void) { int i, x, y; --- 765,771 ---- /* * Clear out the "room" array */ ! void borg_wipe_rooms(void) { int i, x, y; *************** *** 1047,1054 **** /* Get the grid */ ag = &auto_grids[y][x]; ! /* Hack -- assume unknown grids are walls */ ! if (dist && (ag->feat == FEAT_NONE)) break; /* Never pass through walls/doors */ if (dist && (!borg_cave_floor_grid(ag))) break; --- 1051,1059 ---- /* Get the grid */ ag = &auto_grids[y][x]; ! /* Assume all unknow grids more than distance 10 from you */ ! /* are walls. */ ! if ((dist > 10) && (ag->feat == FEAT_NONE)) break; /* Never pass through walls/doors */ if (dist && (!borg_cave_floor_grid(ag))) break; *************** *** 1906,1915 **** } #else #ifdef MACINTOSH static int HACK = 0; ! #endif /* MACINTOSH */ ! #endif /* ALLOW_BORG */ --- 1911,1921 ---- } + #else #ifdef MACINTOSH static int HACK = 0; ! #endif ! #endif diff -w -c -r Borg/borg2.h adamborg/borg2.h *** Borg/borg2.h Sun Apr 13 23:20:12 1997 --- adamborg/borg2.h Sun Apr 13 23:23:46 1997 *************** *** 59,64 **** --- 59,68 ---- */ extern bool borg_clear_room(int y, int x); + /* + * Clear out the "room" array + */ + extern void borg_wipe_rooms(void); #endif diff -w -c -r Borg/borg3.c adamborg/borg3.c *** Borg/borg3.c Sun Apr 13 23:20:31 1997 --- adamborg/borg3.c Sun Apr 13 23:24:16 1997 *************** *** 34,39 **** --- 34,40 ---- */ auto_item *safe_items; /* Safety "inventory" */ + auto_item *safe_home; /* Safety "home stuff" */ auto_shop *safe_shops; /* Safety "shops" */ *************** *** 339,345 **** 85 /* A "Magic Missile" */, 5 /* "Detect Monsters" */, 75 /* E "Phase Door" */, ! 75 /* D "Light Area" */, 5 /* "Treasure Detection" */, 55 /* H "Cure Light Wounds" */, 5 /* "Object Detection" */, --- 340,346 ---- 85 /* A "Magic Missile" */, 5 /* "Detect Monsters" */, 75 /* E "Phase Door" */, ! 65 /* D "Light Area" */, 5 /* "Treasure Detection" */, 55 /* H "Cure Light Wounds" */, 5 /* "Object Detection" */, *************** *** 366,372 **** 55 /* O "Recharge Item I" */, 5 /* "Sleep II" */, 5 /* "Polymorph Other" */, ! 95 /* O "Identify" */, 5 /* "Sleep III" */, 85 /* A "Fire Bolt" */, 5 /* "Slow Monster" */, --- 367,373 ---- 55 /* O "Recharge Item I" */, 5 /* "Sleep II" */, 5 /* "Polymorph Other" */, ! 96 /* O "Identify" */, 5 /* "Sleep III" */, 85 /* A "Fire Bolt" */, 5 /* "Slow Monster" */, *************** *** 378,384 **** 85 /* A "Frost Ball" */, 75 /* O "Recharge Item II" */, 5 /* "Teleport Other" */, ! 5 /* "Haste Self" */, 85 /* A "Fire Ball" */, 0 /* X "Word of Destruction" */, 5 /* "Genocide" */, --- 379,385 ---- 85 /* A "Frost Ball" */, 75 /* O "Recharge Item II" */, 5 /* "Teleport Other" */, ! 75 /* "Haste Self" */, 85 /* A "Fire Ball" */, 0 /* X "Word of Destruction" */, 5 /* "Genocide" */, *************** *** 388,398 **** { /* Resistance of Scarabtarices (sval 4) */ ! 5 /* "Resist Fire" */, ! 5 /* "Resist Cold" */, ! 5 /* "Resist Acid" */, ! 5 /* "Resist Poison" */, ! 5 /* "Resistance" */, 0 /* "(blank)" */, 0 /* "(blank)" */, 0 /* "(blank)" */, --- 389,399 ---- { /* Resistance of Scarabtarices (sval 4) */ ! 70 /* "Resist Fire" */, ! 65 /* "Resist Cold" */, ! 60 /* "Resist Acid" */, ! 70 /* "Resist Poison" */, ! 75 /* "Resistance" */, 0 /* "(blank)" */, 0 /* "(blank)" */, 0 /* "(blank)" */, *************** *** 428,437 **** { /* Tenser's transformations... (sval 7) */ 55 /* H "Heroism" */, ! 5 /* "Shield" */, 55 /* H "Berserker" */, ! 5 /* "Essence of Speed" */, ! 5 /* "Globe of Invulnerability" */, 0 /* "(blank)" */, 0 /* "(blank)" */, 0 /* "(blank)" */, --- 429,438 ---- { /* Tenser's transformations... (sval 7) */ 55 /* H "Heroism" */, ! 75 /* "Shield" */, 55 /* H "Berserker" */, ! 75 /* "Essence of Speed" */, ! 75 /* "Globe of Invulnerability" */, 0 /* "(blank)" */, 0 /* "(blank)" */, 0 /* "(blank)" */, *************** *** 461,468 **** 5 /* "Detect Evil" */, 55 /* H "Cure Light Wounds" */, 5 /* "Bless" */, ! 65 /* H "Remove Fear" */, ! 65 /* D "Call Light" */, 75 /* D "Find Traps" */, 75 /* D "Detect Doors/Stairs" */, 5 /* "Slow Poison" */, --- 462,469 ---- 5 /* "Detect Evil" */, 55 /* H "Cure Light Wounds" */, 5 /* "Bless" */, ! 35 /* H "Remove Fear" */, ! 35 /* D "Call Light" */, 75 /* D "Find Traps" */, 75 /* D "Detect Doors/Stairs" */, 5 /* "Slow Poison" */, *************** *** 485,491 **** { /* Chants and Blessings (sval 2) */ 65 /* H "Neutralize Poison" */, ! 85 /* A "Orb of Draining" */, 55 /* H "Cure Critical Wounds" */, 5 /* "Sense Invisible" */, 5 /* "Protection from Evil" */, --- 486,492 ---- { /* Chants and Blessings (sval 2) */ 65 /* H "Neutralize Poison" */, ! 90 /* A "Orb of Draining" */, 55 /* H "Cure Critical Wounds" */, 5 /* "Sense Invisible" */, 5 /* "Protection from Evil" */, *************** *** 549,559 **** { /* Holy Infusions (sval 7) */ ! 55 /* F "Unbarring Ways" */, ! 55 /* O "Recharging" */, 5 /* "Dispel Curse" */, ! 55 /* O "Enchant Weapon" */, ! 55 /* O "Enchant Armour" */, 5 /* "Elemental Brand" */, 0 /* "(blank)" */, 0 /* "(blank)" */, --- 550,560 ---- { /* Holy Infusions (sval 7) */ ! 50 /* F "Unbarring Ways" */, ! 50 /* O "Recharging" */, 5 /* "Dispel Curse" */, ! 50 /* O "Enchant Weapon" */, ! 50 /* O "Enchant Armour" */, 5 /* "Elemental Brand" */, 0 /* "(blank)" */, 0 /* "(blank)" */, *************** *** 678,687 **** --- 679,1195 ---- return (-1); } + /* + * Get the *ID information + * + * This function pulls the information from the screen if it is not passed + * a *real* item. It is only passed in *real* items if the borg is allowed + * to 'cheat' for inventory. + * This function returns TRUE if space needs to be pressed + */ + bool borg_object_star_id_aux(auto_item *borg_item, object_type *real_item) + { + u32b f1, f2, f3; + /* If a real item pointer is passed in then we are cheating to get */ + /* the data directly from the real item */ + if (real_item) + { + object_flags(real_item, &f1, &f2, &f3); + } + else + { + int i; + byte t_a; + char buf[71]; + + for (i = 2; i < 22; i++) + { + if (!(0 == borg_what_text(15, i, 65, &t_a, buf))) + { + /* bummer, problem reading from screen */ + borg_oops("cannot read from screen"); + return FALSE; + } + + /* Gives Stat Bonus */ + if (prefix(buf, "It affects your strength.")) + { + f1 &= TR1_STR; + continue; + } + if (prefix(buf, "It affects your intelligence.")) + { + f1 &= TR1_INT; + continue; + } + if (prefix(buf, "It affects your wisdom.")) + { + f1 &= TR1_WIS; + continue; + } + if (prefix(buf, "It affects your dexterity.")) + { + f1 &= TR1_DEX; + continue; + } + if (prefix(buf, "It affects your constitution.")) + { + f1 &= TR1_CON; + continue; + } + if (prefix(buf, "It affects your charisma.")) + { + f1 &= TR1_CHR; + continue; + } + /* Gives stealth Bonus */ + if (prefix(buf, "It affects your stealth.")) + { + f1 &= TR1_STEALTH; + continue; + } + /* Gives searching Bonus */ + if (prefix(buf, "It affects your searching.")) + { + f1 &= TR1_SEARCH; + continue; + } + /* Gives Infravision Bonus */ + if (prefix(buf, "It affects your infravision.")) + { + f1 &= TR1_INFRA; + continue; + } + /* Gives digging Bonus */ + if (prefix(buf, "It affects your ability to tunnel.")) + { + f1 &= TR1_TUNNEL; + continue; + } + /* Gives Speed Bonus (Wee!) */ + if (prefix(buf, "It affects your speed.")) + { + f1 &= TR1_SPEED; + continue; + } + /* Gives Extra Blows */ + if (prefix(buf, "It affects your attack speed.")) + { + f1 &= TR1_BLOWS; + continue; + } + /* Various Brands */ + if (prefix(buf, "It does extra damage from acid.")) + { + f1 &= TR1_BRAND_ACID; + continue; + } + if (prefix(buf, "It does extra damage from electricity.")) + { + f1 &= TR1_BRAND_ELEC; + continue; + } + if (prefix(buf, "It does extra damage from fire.")) + { + f1 &= TR1_BRAND_FIRE; + continue; + } + if (prefix(buf, "It does extra damage from frost.")) + { + f1 &= TR1_BRAND_COLD; + continue; + } + /* This is Grond. */ + if (prefix(buf, "It can cause earthquakes.")) + { + f1 &= TR1_IMPACT; + continue; + } + /* *SLAY* Dragon */ + if (prefix(buf, "It is a great bane of dragons.")) + { + f1 &= TR1_KILL_DRAGON; + continue; + } + /* Various Slays */ + if (prefix(buf, "It is especially deadly against dragons.")) + { + f1 &= TR1_SLAY_DRAGON; + continue; + } + if (prefix(buf, "It is especially deadly against orcs.")) + { + f1 &= TR1_SLAY_ORC; + continue; + } + if (prefix(buf, "It is especially deadly against trolls.")) + { + f1 &= TR1_SLAY_TROLL; + continue; + } + if (prefix(buf, "It is especially deadly against giants.")) + { + f1 &= TR1_SLAY_GIANT; + continue; + } + if (prefix(buf, "It strikes at demons with holy wrath.")) + { + f1 &= TR1_SLAY_DEMON; + continue; + } + if (prefix(buf, "It strikes at undead with holy wrath.")) + { + f1 &= TR1_SLAY_UNDEAD; + continue; + } + if (prefix(buf, "It fights against evil with holy fury.")) + { + f1 &= TR1_SLAY_EVIL; + continue; + } + if (prefix(buf, "It is especially deadly against natural creatures.")) + { + f1 &= TR1_SLAY_ANIMAL; + continue; + } + /* Various Sustains */ + if (prefix(buf, "It sustains your strength.")) + { + f2 &= TR2_SUST_STR; + continue; + } + if (prefix(buf, "It sustains your intelligence.")) + { + f2 &= TR2_SUST_INT; + continue; + } + if (prefix(buf, "It sustains your wisdom.")) + { + f2 &= TR2_SUST_WIS; + continue; + } + if (prefix(buf, "It sustains your dexterity.")) + { + f2 &= TR2_SUST_DEX; + continue; + } + if (prefix(buf, "It sustains your constitution.")) + { + f2 &= TR2_SUST_CON; + continue; + } + if (prefix(buf, "It sustains your charisma.")) + { + f2 &= TR2_SUST_CHR; + continue; + } + /* Various immunities */ + if (prefix(buf, "It provides immunity to acid.")) + { + f2 &= TR2_IM_ACID; + continue; + } + if (prefix(buf, "It provides immunity to electricity.")) + { + f2 &= TR2_IM_ELEC; + continue; + } + if (prefix(buf, "It provides immunity to fire.")) + { + f2 &= TR2_IM_FIRE; + continue; + } + if (prefix(buf, "It provides immunity to cold.")) + { + f2 &= TR2_IM_COLD; + continue; + } + /* Free Action */ + if (prefix(buf, "It provides immunity to paralysis.")) + { + f2 &= TR2_FREE_ACT; + continue; + } + /* Hold Life */ + if (prefix(buf, "It provides resistance to life draining.")) + { + f2 &= TR2_HOLD_LIFE; + continue; + } + /* Resists */ + if (prefix(buf, "It provides resistance to acid.")) + { + f2 &= TR2_RES_ACID; + continue; + } + if (prefix(buf, "It provides resistance to electricity.")) + { + f2 &= TR2_RES_ELEC; + continue; + } + if (prefix(buf, "It provides resistance to fire.")) + { + f2 &= TR2_RES_FIRE; + continue; + } + if (prefix(buf, "It provides resistance to cold.")) + { + f2 &= TR2_RES_COLD; + continue; + } + if (prefix(buf, "It provides resistance to poison.")) + { + f2 &= TR2_RES_POIS; + continue; + } + if (prefix(buf, "It provides resistance to light.")) + { + f2 &= TR2_RES_LITE; + continue; + } + if (prefix(buf, "It provides resistance to dark.")) + { + f2 &= TR2_RES_DARK; + continue; + } + if (prefix(buf, "It provides resistance to blindness.")) + { + f2 &= TR2_RES_BLIND; + continue; + } + if (prefix(buf, "It provides resistance to confusion.")) + { + f2 &= TR2_RES_CONF; + continue; + } + if (prefix(buf, "It provides resistance to sound.")) + { + f2 &= TR2_RES_SOUND; + continue; + } + if (prefix(buf, "It provides resistance to shards.")) + { + f2 &= TR2_RES_SHARDS; + continue; + } + if (prefix(buf, "It provides resistance to nether.")) + { + f2 &= TR2_RES_NETHER; + continue; + } + if (prefix(buf, "It provides resistance to nexus.")) + { + f2 &= TR2_RES_NEXUS; + continue; + } + if (prefix(buf, "It provides resistance to chaos.")) + { + f2 &= TR2_RES_CHAOS; + continue; + } + if (prefix(buf, "It provides resistance to disenchantment.")) + { + f2 &= TR2_RES_DISEN; + continue; + } + /* Feather Fall */ + if (prefix(buf, "It induces feather falling.")) + { + f3 &= TR3_FEATHER; + continue; + } + /* It Glows! */ + if (prefix(buf, "It provides permanent light.")) + { + f3 &= TR3_LITE; + continue; + } + /* See Invisible */ + if (prefix(buf, "It allows you to see invisible monsters.")) + { + f3 &= TR3_SEE_INVIS; + continue; + } + /* ESP */ + if (prefix(buf, "It gives telepathic powers.")) + { + f3 &= TR3_TELEPATHY; + continue; + } + /* Slow Digestion */ + if (prefix(buf, "It slows your metabolism.")) + { + f3 &= TR3_SLOW_DIGEST; + continue; + } + /* Regenerate */ + if (prefix(buf, "It speeds your regenerative powers.")) + { + f3 &= TR3_REGEN; + continue; + } + /* Extra Mult for Missle Weapons */ + if (prefix(buf, "It fires missiles with extra might.")) + { + f3 &= TR3_XTRA_MIGHT; + continue; + } + /* Extra Shots */ + if (prefix(buf, "It fires missiles excessively fast.")) + { + f3 &= TR3_XTRA_SHOTS; + continue; + } + /* The One Ring! */ + if (prefix(buf, "It drains experience.")) + { + f3 &= TR3_DRAIN_EXP; + continue; + } + /* Teleports (cursed) */ + if (prefix(buf, "It induces random teleportation.")) + { + f3 &= TR3_TELEPORT; + continue; + } + /* Aggravate */ + if (prefix(buf, "It aggravates nearby creatures.")) + { + f3 &= TR3_AGGRAVATE; + continue; + } + /* Can be used by priests */ + if (prefix(buf, "It has been blessed by the gods.")) + { + f3 &= TR3_BLESSED; + continue; + } + /* Perma-curse */ + if (prefix(buf, "It is permanently cursed.")) + { + f3 &= TR3_PERMA_CURSE; + continue; + } + /* Regualar old curse */ + if (prefix(buf, "It is cursed.")) + { + f3 &= TR3_CURSED; + continue; + } + /* Item imunity */ + if (prefix(buf, "It cannot be harmed by acid.")) + { + f3 &= TR3_IGNORE_ACID; + continue; + } + if (prefix(buf, "It cannot be harmed by electricity.")) + { + f3 &= TR3_IGNORE_ELEC; + continue; + } + if (prefix(buf, "It cannot be harmed by fire.")) + { + f3 &= TR3_IGNORE_FIRE; + continue; + } + if (prefix(buf, "It cannot be harmed by cold.")) + { + f3 &= TR3_IGNORE_COLD; + continue; + } + /* press space to go to next screen. */ + if (prefix(buf, "-- more --")) + { + return (TRUE); + } + + } + } + + borg_item->flags1 = f1; + borg_item->flags2 = f2; + borg_item->flags3 = f3; + + borg_item->needs_I = FALSE; + return (FALSE); + } + /* + * Look for an item that needs to be analysed because it has been *ID*d + * + * This will go through inventory and look for items that were just*ID*'d + * and examine them for their bonuses. + */ + bool borg_object_star_id( void ) + { + int i; + + /* look in inventory and equiptment for something to *id* */ + for (i = 0; i < INVEN_TOTAL; i++) + { + if (auto_items[i].needs_I) + { + if ((auto_cheat_equip && i >= INVEN_WIELD ) || + auto_cheat_inven && i < INVEN_WIELD ) + { + /* cheat to get the information. */ + borg_object_star_id_aux( &auto_items[i], &inventory[i]); + } + else + { + byte t_a; + + char buf[10]; + + /* Check to see if we are looking at the 'I' screen. */ + if (!(0 == borg_what_text(0, 0, 9, &t_a, buf) && + buf[0] == 'E' & + buf[1] == 'x' & + buf[2] == 'a' & + buf[3] == 'm' & + buf[4] == 'i' & + buf[5] == 'n' & + buf[6] == 'i' & + buf[7] == 'n' & + buf[8] == 'g') ) + { + borg_keypress('I'); + if (i < INVEN_WIELD) + { + borg_keypress(I2A(i)); + } + else + { + borg_keypress('/'); + borg_keypress(I2A(i - INVEN_WIELD)); + } + return (TRUE); + } + + /* Look at the screen to get the information */ + if (borg_object_star_id_aux( &auto_items[i], 0 )) + { + borg_keypress(' '); + return (TRUE); + } + + /* Get rid of the *ID* screen */ + borg_keypress(' '); + borg_keypress(' '); + borg_keypress(' '); + return (TRUE); + } + } + } + return (FALSE); + } + + + + /* * Determine the "base price" of a known item (see below) * * This function is adapted from "object_value_known()". *************** *** 952,958 **** /* Save a pointer to the inscription */ item->note = scan; - /* Empty item */ if (!desc[0]) return; --- 1460,1465 ---- *************** *** 1267,1272 **** --- 1774,1785 ---- case TV_WAND: case TV_STAFF: { + /* assume 1 charge unless empty. This will allow use of */ + /* staffs of teleport to get away when hit with a forget spell. */ + item->pval = 1; + + if (streq(item->note, "{empty}")) item->pval = 0; + /* Require the prefix and suffix */ if (!prefix(tail, " (")) break; /* --(-- */ if (!suffix(tail, " charge)") && !suffix(tail, " charges)")) break; *************** *** 1704,1709 **** --- 2217,2225 ---- /* Apply "discount" if any */ if (item->discount) item->value -= item->value * item->discount / 100; + + /* Assume not fully Identified. */ + item->needs_I = item->fully_identified = FALSE; } *************** *** 2038,2046 **** return (FALSE); } - - - /* * Determine if borg can cast a given spell (when fully rested) */ --- 2554,2559 ---- *************** *** 2087,2092 **** --- 2600,2686 ---- } /* + * fail rate on a spell + */ + static int borg_spell_fail_rate(int book, int what) + { + int chance, minfail; + auto_magic *as = &auto_magics[book][what]; + + /* Access the spell */ + chance = as->sfail; + + /* Reduce failure rate by "effective" level adjustment */ + chance -= 3 * (auto_level - as->level); + + /* Reduce failure rate by INT/WIS adjustment */ + chance -= 3 * (adj_mag_stat[my_stat_ind[A_INT]] - 1); + + /* Not enough mana to cast */ + /* Do not bother with this check because it will be taken care + of seperatly. + if (as->power > auto_csp) + { + chance += 5 * (as->power - auto_csp); + } + */ + + /* Extract the minimum failure rate */ + minfail = adj_mag_fail[my_stat_ind[A_INT]]; + + /* Non mage characters never get too good */ + if (auto_class != CLASS_MAGE) + { + if (minfail < 5) minfail = 5; + } + + /* Minimum failure rate */ + if (chance < minfail) chance = minfail; + + /* Stunning makes spells harder */ + if (do_heavy_stun) chance += 25; + if (do_stun) chance += 15; + + /* Always a 5 percent chance of working */ + if (chance > 95) chance = 95; + + /* Return the chance */ + return (chance); + + + } + + /* + * same as borg_spell_okay with a fail % check + */ + bool borg_spell_okay_fail(int book, int what, int allow_fail ) + { + if (borg_spell_fail_rate(book, what) > allow_fail) + return FALSE; + return borg_spell_okay( book, what ); + } + + /* + * Same as borg_spell with a fail % check + */ + bool borg_spell_fail(int book, int what, int allow_fail) + { + if (borg_spell_fail_rate(book, what) > allow_fail) + return FALSE; + return borg_spell( book, what ); + } + + /* + * Same as borg_spell_legal with a fail % check + */ + bool borg_spell_legal_fail(int book, int what, int allow_fail) + { + if (borg_spell_fail_rate(book, what) > allow_fail) + return FALSE; + return borg_spell_legal( book, what ); + } + + /* * Attempt to cast a spell */ bool borg_spell(int book, int what) *************** *** 2162,2168 **** --- 2756,2854 ---- return (TRUE); } + static int borg_prayer_fail_rate(int book, int what) + { + int chance, minfail; + auto_magic *as = &auto_magics[book][what]; + + /* Access the spell */ + chance = as->sfail; + + /* Reduce failure rate by "effective" level adjustment */ + chance -= 3 * (auto_level - as->level); + + /* Reduce failure rate by INT/WIS adjustment */ + chance -= 3 * (adj_mag_stat[my_stat_ind[A_WIS]] - 1); + + /* Not enough mana to cast */ + /* Do not bother with this check because it will be taken care + of seperatly. + if (as->power > auto_csp) + { + chance += 5 * (as->power - auto_csp); + } + */ + /* Extract the minimum failure rate */ + minfail = adj_mag_fail[my_stat_ind[A_WIS]]; + + /* Non priest characters never get too good */ + if (auto_class != CLASS_PRIEST) + { + if (minfail < 5) minfail = 5; + } + + /* Hack -- Priest prayer penalty for "edged" weapons -DGK */ + if (auto_class == CLASS_PRIEST) + { + auto_item *item; + + item = &auto_items[INVEN_WIELD]; + + /* Penalize non-blessed edged weapons */ + if (((item->tval == TV_SWORD) || (item->tval == TV_POLEARM)) && + (!(item->flags3 & TR3_BLESSED))) + { + chance += 25; + } + } + /* Minimum failure rate */ + if (chance < minfail) chance = minfail; + + /* Stunning makes spells harder */ + if (do_heavy_stun) chance += 25; + if (do_stun) chance += 15; + + /* Always a 5 percent chance of working */ + if (chance > 95) chance = 95; + + /* Return the chance */ + return (chance); + + + } + + /* + * same as borg_prayer_okay with a fail % check + */ + bool borg_prayer_okay_fail(int book, int what, int allow_fail ) + { + if (borg_prayer_fail_rate(book, what) > allow_fail) + return FALSE; + return borg_prayer_okay( book, what ); + } + + /* + * Same as borg_prayer with a fail % check + */ + bool borg_prayer_fail(int book, int what, int allow_fail) + { + if (borg_prayer_fail_rate(book, what) > allow_fail) + return FALSE; + return borg_prayer( book, what ); + } + + /* + * Same as borg_prayer_legal with a fail % check + */ + bool borg_prayer_legal_fail(int book, int what, int allow_fail) + { + if (borg_prayer_fail_rate(book, what) > allow_fail) + return FALSE; + return borg_prayer_legal( book, what ); + } + + /* * Attempt to pray a prayer */ bool borg_prayer(int book, int what) *************** *** 2192,2201 **** return (TRUE); } - - - - /* * Cheat the "equip" screen */ --- 2878,2883 ---- *************** *** 2219,2230 **** } /* Ignore "unchanged" items */ if (streq(buf, auto_items[i].desc)) continue; ! /* Analyze the item (no price) */ borg_item_analyze(&auto_items[i], buf); } } /* --- 2901,2925 ---- } /* Ignore "unchanged" items */ + /* !FIX do I still need this? I forget... AJG */ + if (auto_items[i].needs_I) + { if (streq(buf, auto_items[i].desc)) continue; ! } /* Analyze the item (no price) */ borg_item_analyze(&auto_items[i], buf); + + /* get the fully id stuff */ + #ifdef ID_MENTAL + if (inventory[i].ident & ID_MENTAL) + { + auto_items[i].fully_identified = TRUE; + auto_items[i].needs_I = TRUE; + auto_do_star_id = TRUE; } + #endif } + } /* *************** *** 2255,2263 **** --- 2950,2970 ---- /* Ignore "unchanged" items */ if (streq(buf, auto_items[i].desc)) continue; + /* inventory changed so goals must change. */ + goal_shop = goal_ware = goal_item = -1; + /* Analyze the item (no price) */ borg_item_analyze(&auto_items[i], buf); + /* get the fully id stuff */ + #ifdef ID_MENTAL + if (inventory[i].ident & ID_MENTAL) + { + auto_items[i].fully_identified = TRUE; + auto_items[i].needs_I = TRUE; + auto_do_star_id = TRUE; + } + #endif /* Note changed inventory */ auto_do_crush_junk = TRUE; auto_do_crush_hole = TRUE; *************** *** 2328,2335 **** --- 3035,3052 ---- /* Analyze the item (no price) */ borg_item_analyze(&auto_items[i], buf); + + /* get the fully *id* stuff */ + #ifdef ID_MENTAL + if (inventory[i].ident & ID_MENTAL) + { + auto_items[i].fully_identified = TRUE; + auto_items[i].needs_I = TRUE; + auto_do_star_id = TRUE; } + #endif } + } /* *************** *** 2408,2413 **** --- 3125,3139 ---- /* Analyze the item (no price) */ borg_item_analyze(&auto_items[i], buf); + /* get the fully id stuff */ + #ifdef ID_MENTAL + if (inventory[i].ident & ID_MENTAL) + { + auto_items[i].fully_identified = TRUE; + auto_items[i].needs_I = TRUE; + auto_do_star_id = TRUE; + } + #endif /* Note changed inventory */ auto_do_crush_junk = TRUE; auto_do_crush_hole = TRUE; *************** *** 2416,2424 **** } - - - /* * Hack -- Cheat the "spell" info (given the book) * --- 3142,3147 ---- *************** *** 2447,2454 **** /* Note "forgotten" spells */ if ((j < 32) ? ! ((p_ptr->spell_forgotten1 & (1L << j))) : ! ((p_ptr->spell_forgotten2 & (1L << (j - 32))))) { /* Forgotten */ as->status = BORG_MAGIC_LOST; --- 3170,3177 ---- /* Note "forgotten" spells */ if ((j < 32) ? ! ((spell_forgotten1 & (1L << j))) : ! ((spell_forgotten2 & (1L << (j - 32))))) { /* Forgotten */ as->status = BORG_MAGIC_LOST; *************** *** 2463,2470 **** /* Note "unknown" spells */ else if (!((j < 32) ? ! (p_ptr->spell_learned1 & (1L << j)) : ! (p_ptr->spell_learned2 & (1L << (j - 32))))) { /* Unknown */ as->status = BORG_MAGIC_OKAY; --- 3186,3193 ---- /* Note "unknown" spells */ else if (!((j < 32) ? ! (spell_learned1 & (1L << j)) : ! (spell_learned2 & (1L << (j - 32))))) { /* Unknown */ as->status = BORG_MAGIC_OKAY; *************** *** 2472,2479 **** /* Note "untried" spells */ else if (!((j < 32) ? ! (p_ptr->spell_worked1 & (1L << j)) : ! (p_ptr->spell_worked2 & (1L << (j - 32))))) { /* Untried */ as->status = BORG_MAGIC_TEST; --- 3195,3202 ---- /* Note "untried" spells */ else if (!((j < 32) ? ! (spell_worked1 & (1L << j)) : ! (spell_worked2 & (1L << (j - 32))))) { /* Untried */ as->status = BORG_MAGIC_TEST; *************** *** 2488,2497 **** } } - - - - /* * Hack -- Parse the "spell" info (given the book) */ --- 3211,3216 ---- *************** *** 2567,2576 **** /* * Prepare a book */ ! void borg_prepare_book(int book) { int i, what; --- 3286,3296 ---- + /* * Prepare a book */ ! static void prepare_book_info(int book) { int i, what; *************** *** 2646,2651 **** --- 3366,3374 ---- /* Extract the level and power */ as->level = s_ptr->slevel; as->power = s_ptr->smana; + + /* extract fail rate. */ + as->sfail = s_ptr->sfail; } } *************** *** 2652,2657 **** --- 3375,3393 ---- /* + * Hack -- prepare some stuff based on the player race and class + */ + void prepare_race_class_info(void) + { + int book; + + /* Initialize the various spell arrays by book */ + for (book = 0; book < 9; book++) prepare_book_info(book); + } + + + + /* * Sorting hook -- comp function -- see below * * We use "u" to point to an array of strings, and "v" to point to *************** *** 2753,2758 **** --- 3489,3495 ---- /* Make the "safe" inventory array */ C_MAKE(safe_items, INVEN_TOTAL, auto_item); + C_MAKE(safe_home, STORE_INVEN_MAX, auto_item); /* Make the "safe" stores in the town */ C_MAKE(safe_shops, 8, auto_shop); *************** *** 2781,2786 **** --- 3518,3524 ---- if (k_ptr->flags3 & TR3_INSTA_ART) continue; /* Hack -- make an item */ + /* invcopy(&hack, k); This has gone - Tim */ object_prep(&hack, k); /* Describe a "plural" object */ *************** *** 2835,2840 **** --- 3573,3579 ---- if (k_ptr->flags3 & TR3_INSTA_ART) continue; /* Hack -- make an item */ + /* invcopy(&hack, k); this has changed - Tim*/ object_prep(&hack, k); /* Describe a "singular" object */ *************** *** 2866,2871 **** --- 3605,3611 ---- k = lookup_kind(a_ptr->tval, a_ptr->sval); /* Hack -- make an item */ + /* invcopy(&hack, k); this has changed - Tim */ object_prep(&hack, k); /* Save the index */ *************** *** 2965,2974 **** } #else #ifdef MACINTOSH static int HACK = 0; ! #endif /* MACINTOSH */ ! #endif /* ALLOW_BORG */ --- 3705,3715 ---- } + #else #ifdef MACINTOSH static int HACK = 0; ! #endif ! #endif diff -w -c -r Borg/borg3.h adamborg/borg3.h *** Borg/borg3.h Sun Apr 13 23:20:34 1997 --- adamborg/borg3.h Sun Apr 13 23:24:19 1997 *************** *** 55,60 **** --- 55,64 ---- bool able; /* True if item is identified */ + bool fully_identified; /* True if item is fully identified (AJG) */ + + bool needs_I; /* True if item needs to be 'I'd (AJG) */ + bool xxxx; /* Unused */ byte tval; /* Item type */ *************** *** 155,160 **** --- 159,166 ---- byte power; /* Required power */ + byte sfail; /* Minimum chance of failure */ + byte cheat; /* Actual "spell index" (or 99) */ }; *************** *** 174,179 **** --- 180,186 ---- */ extern auto_item *safe_items; /* Safety "inventory" */ + extern auto_item *safe_home; /* Safety "home" */ extern auto_shop *safe_shops; /* Safety "shops" */ *************** *** 198,203 **** --- 205,216 ---- extern void borg_item_analyze(auto_item *item, cptr desc); + /* look for a *id*'d item */ + extern bool borg_object_star_id( void ); + + /* look for a *id*'d item */ + extern bool borg_object_star_id_aux(auto_item *borg_item, object_type *real_item); + /* * Inscribe an object */ *************** *** 242,247 **** --- 255,263 ---- extern bool borg_spell_legal(int book, int what); extern bool borg_spell_okay(int book, int what); extern bool borg_spell(int book, int what); + extern bool borg_spell_fail(int book, int what, int allow_fail); + extern bool borg_spell_okay_fail(int book, int what, int allow_fail ); + extern bool borg_spell_legal_fail(int book, int what, int allow_fail ); /* * Prayer functions *************** *** 249,254 **** --- 265,273 ---- extern bool borg_prayer_legal(int book, int what); extern bool borg_prayer_okay(int book, int what); extern bool borg_prayer(int book, int what); + extern bool borg_prayer_fail(int book, int what, int allow_fail); + extern bool borg_prayer_okay_fail(int book, int what, int allow_fail ); + extern bool borg_prayer_legal_fail(int book, int what, int allow_fail ); *************** *** 267,275 **** extern void borg_parse_spell(int book); /* ! * Prepare a book */ ! extern void borg_prepare_book(int book); /* * Initialize this file --- 286,294 ---- extern void borg_parse_spell(int book); /* ! * Hack -- prepare stuff based on the race/class */ ! extern void prepare_race_class_info(void); /* * Initialize this file diff -w -c -r Borg/borg4.c adamborg/borg4.c *** Borg/borg4.c Sun Apr 13 23:20:55 1997 --- adamborg/borg4.c Sun Apr 13 23:25:02 1997 *************** *** 11,16 **** --- 11,17 ---- #include "borg3.h" #include "borg4.h" + bool borg_full_damage; /* make danger = full damage. */ /* * Note that we assume that any item with quantity zero does not exist, *************** *** 71,85 **** int extra_shots = 0; int extra_might = 0; - int stat_add[6]; - auto_item *item; - /* Clear the stat modifiers */ - for (i = 0; i < 6; i++) stat_add[i] = 0; - /* Clear the armor class */ my_ac = 0; --- 72,81 ---- *************** *** 87,97 **** my_to_hit = my_to_dam = my_to_ac = 0; ! /* Reset blows */ my_num_blow = 1; ! /* Reset shots */ ! my_num_fire = 0; /* Assume normal speed */ --- 83,93 ---- my_to_hit = my_to_dam = my_to_ac = 0; ! /* Start with a single blow per turn */ my_num_blow = 1; ! /* Start with a single shot per turn */ ! my_num_fire = 1; /* Assume normal speed */ *************** *** 126,131 **** --- 122,142 ---- my_telepathy = FALSE; my_lite = FALSE; + my_slay_animal = FALSE; + my_slay_evil = FALSE; + my_slay_undead = FALSE; + my_slay_demon = FALSE; + my_slay_orc = FALSE; + my_slay_troll = FALSE; + my_slay_giant = FALSE; + my_slay_dragon = FALSE; + my_kill_dragon = FALSE; + my_impact = FALSE; + my_brand_acid = FALSE; + my_brand_elec = FALSE; + my_brand_fire = FALSE; + my_brand_cold = FALSE; + my_immune_acid = FALSE; my_immune_elec = FALSE; my_immune_fire = FALSE; *************** *** 136,152 **** my_resist_fire = FALSE; my_resist_cold = FALSE; my_resist_pois = FALSE; ! my_resist_fear = FALSE; my_resist_lite = FALSE; my_resist_dark = FALSE; - my_resist_blind = FALSE; - my_resist_confu = FALSE; - my_resist_sound = FALSE; - my_resist_shard = FALSE; - my_resist_nexus = FALSE; - my_resist_nethr = FALSE; my_resist_chaos = FALSE; my_resist_disen = FALSE; my_sustain_str = FALSE; my_sustain_int = FALSE; --- 147,163 ---- my_resist_fire = FALSE; my_resist_cold = FALSE; my_resist_pois = FALSE; ! my_resist_conf = FALSE; ! my_resist_sound = FALSE; my_resist_lite = FALSE; my_resist_dark = FALSE; my_resist_chaos = FALSE; my_resist_disen = FALSE; + my_resist_shard = FALSE; + my_resist_nexus = FALSE; + my_resist_blind = FALSE; + my_resist_neth = FALSE; + my_resist_fear = FALSE; my_sustain_str = FALSE; my_sustain_int = FALSE; *************** *** 216,221 **** --- 227,234 ---- if (auto_race == RACE_HIGH_ELF) my_resist_lite = TRUE; if (auto_race == RACE_HIGH_ELF) my_see_inv = TRUE; + /* Clear the stat modifiers */ + for (i = 0; i < 6; i++) my_stat_add[i] = 0; /* Scan the usable inventory */ for (i = INVEN_WIELD; i < INVEN_TOTAL; i++) *************** *** 226,238 **** if (!item->iqty) continue; /* Affect stats */ ! if (item->flags1 & TR1_STR) stat_add[A_STR] += item->pval; ! if (item->flags1 & TR1_INT) stat_add[A_INT] += item->pval; ! if (item->flags1 & TR1_WIS) stat_add[A_WIS] += item->pval; ! if (item->flags1 & TR1_DEX) stat_add[A_DEX] += item->pval; ! if (item->flags1 & TR1_CON) stat_add[A_CON] += item->pval; ! if (item->flags1 & TR1_CHR) stat_add[A_CHR] += item->pval; /* Affect infravision */ if (item->flags1 & TR1_INFRA) my_see_infra += item->pval; --- 239,267 ---- if (!item->iqty) continue; /* Affect stats */ ! if (item->flags1 & TR1_STR) my_stat_add[A_STR] += item->pval; ! if (item->flags1 & TR1_INT) my_stat_add[A_INT] += item->pval; ! if (item->flags1 & TR1_WIS) my_stat_add[A_WIS] += item->pval; ! if (item->flags1 & TR1_DEX) my_stat_add[A_DEX] += item->pval; ! if (item->flags1 & TR1_CON) my_stat_add[A_CON] += item->pval; ! if (item->flags1 & TR1_CHR) my_stat_add[A_CHR] += item->pval; + /* various slays */ + if (item->flags1 & TR1_SLAY_ANIMAL) my_slay_animal = TRUE; + if (item->flags1 & TR1_SLAY_EVIL) my_slay_evil = TRUE; + if (item->flags1 & TR1_SLAY_UNDEAD) my_slay_undead = TRUE; + if (item->flags1 & TR1_SLAY_DEMON) my_slay_demon = TRUE; + if (item->flags1 & TR1_SLAY_ORC) my_slay_orc = TRUE; + if (item->flags1 & TR1_SLAY_TROLL) my_slay_troll = TRUE; + if (item->flags1 & TR1_SLAY_GIANT) my_slay_giant = TRUE; + if (item->flags1 & TR1_SLAY_DRAGON) my_slay_dragon = TRUE; + if (item->flags1 & TR1_KILL_DRAGON) my_kill_dragon = TRUE; + if (item->flags1 & TR1_IMPACT) my_impact = TRUE; + if (item->flags1 & TR1_BRAND_ACID) my_brand_acid = TRUE; + if (item->flags1 & TR1_BRAND_ELEC) my_brand_elec = TRUE; + if (item->flags1 & TR1_BRAND_FIRE) my_brand_fire = TRUE; + if (item->flags1 & TR1_BRAND_COLD) my_brand_cold = TRUE; + /* Affect infravision */ if (item->flags1 & TR1_INFRA) my_see_infra += item->pval; *************** *** 255,284 **** if (item->flags1 & TR1_BLOWS) extra_blows += item->pval; /* Boost shots */ ! if (item->flags1 & TR1_SHOTS) extra_shots += item->pval; /* Boost might */ ! if (item->flags1 & TR1_MIGHT) extra_might += item->pval; ! /* Good flags */ if (item->flags3 & TR3_SLOW_DIGEST) my_slow_digest = TRUE; ! if (item->flags3 & TR3_FEATHER) my_ffall = TRUE; ! if (item->flags3 & TR3_LITE) my_lite = TRUE; if (item->flags3 & TR3_REGEN) my_regenerate = TRUE; if (item->flags3 & TR3_TELEPATHY) my_telepathy = TRUE; if (item->flags3 & TR3_SEE_INVIS) my_see_inv = TRUE; ! if (item->flags3 & TR3_FREE_ACT) my_free_act = TRUE; ! if (item->flags3 & TR3_HOLD_LIFE) my_hold_life = TRUE; - /* Bad flags */ - if (item->flags3 & TR3_TELEPORT) my_teleport = TRUE; - if (item->flags3 & TR3_AGGRAVATE) my_aggravate = TRUE; - /* Immunity flags */ ! if (item->flags2 & TR2_IM_FIRE) my_immune_fire = TRUE; ! if (item->flags2 & TR2_IM_ACID) my_immune_acid = TRUE; ! if (item->flags2 & TR2_IM_COLD) my_immune_cold = TRUE; ! if (item->flags2 & TR2_IM_ELEC) my_immune_elec = TRUE; /* Resistance flags */ if (item->flags2 & TR2_RES_ACID) my_resist_acid = TRUE; --- 284,328 ---- if (item->flags1 & TR1_BLOWS) extra_blows += item->pval; /* Boost shots */ ! if (item->flags3 & TR3_XTRA_SHOTS) extra_shots++; /* Boost might */ ! if (item->flags3 & TR3_XTRA_MIGHT) extra_might++; ! /* Various flags */ if (item->flags3 & TR3_SLOW_DIGEST) my_slow_digest = TRUE; ! if (item->flags3 & TR3_AGGRAVATE) my_aggravate = TRUE; ! if (item->flags3 & TR3_TELEPORT) my_teleport = TRUE; if (item->flags3 & TR3_REGEN) my_regenerate = TRUE; if (item->flags3 & TR3_TELEPATHY) my_telepathy = TRUE; + if (item->flags3 & TR3_LITE) my_lite = TRUE; if (item->flags3 & TR3_SEE_INVIS) my_see_inv = TRUE; ! if (item->flags3 & TR3_FEATHER) my_ffall = TRUE; ! if (item->flags2 & TR2_FREE_ACT) my_free_act = TRUE; ! if (item->flags2 & TR2_HOLD_LIFE) my_hold_life = TRUE; /* Immunity flags */ ! /* if you are immune you automaticly resist */ ! if (item->flags2 & TR2_IM_FIRE) ! { ! my_immune_fire = TRUE; ! my_resist_fire = TRUE; ! } ! if (item->flags2 & TR2_IM_ACID) ! { ! my_immune_acid = TRUE; ! my_resist_acid = TRUE; ! } ! if (item->flags2 & TR2_IM_COLD) ! { ! my_immune_cold = TRUE; ! my_resist_cold = TRUE; ! } ! if (item->flags2 & TR2_IM_ELEC) ! { ! my_immune_elec = TRUE; ! my_resist_elec = TRUE; ! } /* Resistance flags */ if (item->flags2 & TR2_RES_ACID) my_resist_acid = TRUE; *************** *** 286,302 **** if (item->flags2 & TR2_RES_FIRE) my_resist_fire = TRUE; if (item->flags2 & TR2_RES_COLD) my_resist_cold = TRUE; if (item->flags2 & TR2_RES_POIS) my_resist_pois = TRUE; ! if (item->flags2 & TR2_RES_FEAR) my_resist_fear = TRUE; if (item->flags2 & TR2_RES_LITE) my_resist_lite = TRUE; if (item->flags2 & TR2_RES_DARK) my_resist_dark = TRUE; - if (item->flags2 & TR2_RES_BLIND) my_resist_blind = TRUE; - if (item->flags2 & TR2_RES_CONFU) my_resist_confu = TRUE; - if (item->flags2 & TR2_RES_SOUND) my_resist_sound = TRUE; - if (item->flags2 & TR2_RES_SHARD) my_resist_shard = TRUE; - if (item->flags2 & TR2_RES_NEXUS) my_resist_nexus = TRUE; - if (item->flags2 & TR2_RES_NETHR) my_resist_nethr = TRUE; if (item->flags2 & TR2_RES_CHAOS) my_resist_chaos = TRUE; if (item->flags2 & TR2_RES_DISEN) my_resist_disen = TRUE; /* Sustain flags */ if (item->flags2 & TR2_SUST_STR) my_sustain_str = TRUE; --- 330,345 ---- if (item->flags2 & TR2_RES_FIRE) my_resist_fire = TRUE; if (item->flags2 & TR2_RES_COLD) my_resist_cold = TRUE; if (item->flags2 & TR2_RES_POIS) my_resist_pois = TRUE; ! if (item->flags2 & TR2_RES_CONF) my_resist_conf = TRUE; ! if (item->flags2 & TR2_RES_SOUND) my_resist_sound = TRUE; if (item->flags2 & TR2_RES_LITE) my_resist_lite = TRUE; if (item->flags2 & TR2_RES_DARK) my_resist_dark = TRUE; if (item->flags2 & TR2_RES_CHAOS) my_resist_chaos = TRUE; if (item->flags2 & TR2_RES_DISEN) my_resist_disen = TRUE; + if (item->flags2 & TR2_RES_SHARDS) my_resist_shard = TRUE; + if (item->flags2 & TR2_RES_NEXUS) my_resist_nexus = TRUE; + if (item->flags2 & TR2_RES_BLIND) my_resist_blind = TRUE; + if (item->flags2 & TR2_RES_NETHER) my_resist_neth = TRUE; /* Sustain flags */ if (item->flags2 & TR2_SUST_STR) my_sustain_str = TRUE; *************** *** 324,330 **** } /* Hack -- Chaos / Confusion */ ! if (my_resist_chaos) my_resist_confu = TRUE; /* Update "stats" */ --- 367,373 ---- } /* Hack -- Chaos / Confusion */ ! if (my_resist_chaos) my_resist_conf = TRUE; /* Update "stats" */ *************** *** 333,339 **** int use, ind; /* Extract the new "use_stat" value for the stat */ ! use = modify_stat_value(my_stat_cur[i], stat_add[i]); /* Save the stat */ my_stat_use[i] = use; --- 376,382 ---- int use, ind; /* Extract the new "use_stat" value for the stat */ ! use = modify_stat_value(my_stat_cur[i], my_stat_add[i]); /* Save the stat */ my_stat_use[i] = use; *************** *** 386,391 **** --- 429,444 ---- /* Examine the "current bow" */ item = &auto_items[INVEN_BOW]; + /* attacking with bare hands */ + if (item->iqty == 0) + { + item->ds = 0; + item->dd = 0; + item->to_d = 0; + item->to_h = 0; + item->weight = 0; + } + /* It is hard to carholdry a heavy bow */ if (hold < item->weight / 10) { *************** *** 394,451 **** } /* Compute "extra shots" if needed */ ! if (item->iqty) { ! /* Single shot */ ! my_num_fire = 1; ! ! /* Analyze bow */ switch (item->sval) { case SV_SLING: - { my_ammo_tval = TV_SHOT; my_ammo_sides = 3; my_ammo_power = 2; break; - } case SV_SHORT_BOW: - { my_ammo_tval = TV_ARROW; my_ammo_sides = 4; my_ammo_power = 2; break; - } case SV_LONG_BOW: - { my_ammo_tval = TV_ARROW; my_ammo_sides = 4; my_ammo_power = 3; break; - } case SV_LIGHT_XBOW: - { my_ammo_tval = TV_BOLT; my_ammo_sides = 5; my_ammo_power = 3; break; - } case SV_HEAVY_XBOW: - { my_ammo_tval = TV_BOLT; my_ammo_sides = 5; my_ammo_power = 4; break; } - } - /* Light */ - if (hold >= item->weight / 10) - { /* Add in extra power */ my_ammo_power += extra_might; --- 447,488 ---- } /* Compute "extra shots" if needed */ ! if (item->iqty && (hold >= item->weight / 10)) { ! /* Take note of required "tval" for missiles */ switch (item->sval) { case SV_SLING: my_ammo_tval = TV_SHOT; my_ammo_sides = 3; my_ammo_power = 2; break; case SV_SHORT_BOW: my_ammo_tval = TV_ARROW; my_ammo_sides = 4; my_ammo_power = 2; break; case SV_LONG_BOW: my_ammo_tval = TV_ARROW; my_ammo_sides = 4; my_ammo_power = 3; break; case SV_LIGHT_XBOW: my_ammo_tval = TV_BOLT; my_ammo_sides = 5; my_ammo_power = 3; break; case SV_HEAVY_XBOW: my_ammo_tval = TV_BOLT; my_ammo_sides = 5; my_ammo_power = 4; break; } /* Add in extra power */ my_ammo_power += extra_might; *************** *** 453,459 **** my_ammo_range = 10 + my_ammo_power * 5; /* Hack -- High Level Rangers shoot arrows quickly */ ! if ((auto_class == CLASS_RANGER) && (my_ammo_tval == TV_ARROW)) { /* Extra shot at level 20 */ if (auto_max_level >= 20) my_num_fire++; --- 490,496 ---- my_ammo_range = 10 + my_ammo_power * 5; /* Hack -- High Level Rangers shoot arrows quickly */ ! if ((auto_class == 4) && (my_ammo_tval == TV_ARROW)) { /* Extra shot at level 20 */ if (auto_max_level >= 20) my_num_fire++; *************** *** 464,480 **** /* Add in the "bonus shots" */ my_num_fire += extra_shots; - } - } - /* Paranoia */ /* Require at least one shot */ if (my_num_fire < 1) my_num_fire = 1; /* Examine the "main weapon" */ item = &auto_items[INVEN_WIELD]; /* It is hard to hold a heavy weapon */ if (hold < item->weight / 10) { --- 501,526 ---- /* Add in the "bonus shots" */ my_num_fire += extra_shots; /* Require at least one shot */ if (my_num_fire < 1) my_num_fire = 1; + } + /* Examine the "main weapon" */ item = &auto_items[INVEN_WIELD]; + /* attacking with bare hands */ + if (item->iqty == 0) + { + item->ds = 0; + item->dd = 0; + item->to_d = 0; + item->to_h = 0; + item->weight = 0; + } + /* It is hard to hold a heavy weapon */ if (hold < item->weight / 10) { *************** *** 624,629 **** --- 670,690 ---- if (!item->able) continue; /* Enchant all weapons (to hit) */ + if (borg_prayer_legal(7, 3)) + { + if (item->to_h < 12) + { + my_need_enchant_to_h += (12 - item->to_h); + } + + /* Enchant all weapons (to damage) */ + if (item->to_d < 12) + { + my_need_enchant_to_d += (12 - item->to_d); + } + } + else + { if (item->to_h < 8) { my_need_enchant_to_h += (8 - item->to_h); *************** *** 635,640 **** --- 696,702 ---- my_need_enchant_to_d += (8 - item->to_d); } } + } /* Hack -- enchant all the equipment (armor) */ for (i = INVEN_BODY; i <= INVEN_FEET; i++) *************** *** 648,658 **** --- 710,730 ---- if (!item->able) continue; /* Note need for enchantment */ + if (borg_prayer_legal(7, 4)) + { + if (item->to_a < 15) + { + my_need_enchant_to_a += (15 - item->to_a); + } + } + else + { if (item->to_a < 8) { my_need_enchant_to_a += (8 - item->to_a); } } + } /* Examine the lite */ *************** *** 677,688 **** if (!item->pval) my_cur_lite = 0; /* Artifact lites -- radius three */ ! if (item->name1) my_cur_lite = 3; /* Artifact lites -- assume glowing */ ! if (item->name1) my_lite = TRUE; } } /* --- 749,765 ---- if (!item->pval) my_cur_lite = 0; /* Artifact lites -- radius three */ ! /* HACK assume non-torch/non lantern lite is artifact */ ! if ((item->sval != SV_LITE_TORCH) && ! (item->sval != SV_LITE_LANTERN)) ! { ! my_cur_lite = 3; /* Artifact lites -- assume glowing */ ! my_lite = TRUE; } } + } /* *************** *** 701,712 **** --- 778,795 ---- amt_fuel = 0; amt_food = 0; amt_ident = 0; + amt_star_ident = 0; amt_recall = 0; amt_phase = 0; amt_escape = 0; amt_teleport = 0; + amt_teleport_staff = 0; /* Reset healing */ + amt_mana = 0; + amt_ez_mana = 0; + amt_heal = 0; + amt_ez_heal = 0; amt_cure_critical = 0; amt_cure_serious = 0; *************** *** 743,748 **** --- 826,833 ---- amt_fix_stat[A_CHR] = 0; amt_fix_exp = 0; + amt_speed = 0; + /* Reset enchantment */ amt_enchant_to_a = 0; amt_enchant_to_d = 0; *************** *** 799,804 **** --- 884,898 ---- /* Analyze */ switch (item->sval) { + case SV_POTION_HEALING: + amt_heal += item->iqty; + break; + + case SV_POTION_STAR_HEALING: + case SV_POTION_LIFE: + amt_ez_heal += item->iqty; + break; + case SV_POTION_CURE_CRITICAL: amt_cure_critical += item->iqty; break; *************** *** 858,863 **** --- 952,966 ---- case SV_POTION_RESTORE_EXP: amt_fix_exp += item->iqty; break; + + case SV_POTION_SPEED: + amt_speed += item->iqty; + break; + + case SV_POTION_RESTORE_MANA: + amt_mana += item->iqty; + break; + } break; *************** *** 873,878 **** --- 976,985 ---- amt_ident += item->iqty; break; + case SV_SCROLL_STAR_IDENTIFY: + amt_star_ident += item->iqty; + break; + case SV_SCROLL_PHASE_DOOR: amt_phase += item->iqty; break; *************** *** 927,932 **** --- 1034,1048 ---- amt_detect_trap += item->iqty * 100; amt_detect_door += item->iqty * 100; break; + + case SV_ROD_SPEED: + amt_speed += item->iqty * 100; + break; + + case SV_ROD_HEALING: + /* only +1 per rod because of long charge time. */ + amt_ez_heal += item->iqty; + break; } break; *************** *** 944,950 **** --- 1060,1082 ---- case SV_STAFF_TELEPORTATION: amt_teleport += item->iqty * item->pval; + /* do not count staffs with no changes */ + if (item->pval) + amt_teleport_staff += item->iqty; break; + + case SV_STAFF_SPEED: + amt_speed += item->iqty * item->pval; + break; + + case SV_STAFF_HEALING: + amt_ez_heal += item->iqty * item->pval; + break; + + case SV_STAFF_THE_MAGI: + amt_ez_mana += item->iqty * item->pval; + break; + } break; *************** *** 976,981 **** --- 1108,1143 ---- /* Count them */ amt_missile += item->iqty; + /* if we have shit loads of cash (as we will at level 35), */ + /* enchant missiles */ + if (auto_level > 35) + { + if (borg_prayer_legal(7, 3) && item->iqty >= 10) + { + if (item->to_h < 10) + { + my_need_enchant_to_h += (10 - item->to_h); + } + + if (item->to_d < 10) + { + my_need_enchant_to_d += (10 - item->to_d); + } + } + else + { + if (item->to_h < 8) + { + my_need_enchant_to_h += (8 - item->to_h); + } + + if (item->to_d < 8) + { + my_need_enchant_to_d += (8 - item->to_d); + } + } + } + break; } } *************** *** 984,990 **** /*** Process the Spells and Prayers ***/ /* Handle "satisfy hunger" -> infinite food */ ! if (borg_spell_legal(2, 0) || borg_prayer_legal(1, 5)) { amt_food += 1000; } --- 1146,1152 ---- /*** Process the Spells and Prayers ***/ /* Handle "satisfy hunger" -> infinite food */ ! if (borg_spell_legal_fail(2, 0, 20) || borg_prayer_legal_fail(1, 5, 20)) { amt_food += 1000; } *************** *** 1034,1053 **** amt_enchant_to_a += 1000; } /*** Process the Needs ***/ /* No need for fuel */ ! if (auto_items[INVEN_LITE].name1) amt_fuel += 1000; /* No need to *buy* stat increase potions */ ! if (my_stat_cur[A_STR] >= 18+80) amt_add_stat[A_STR] += 1000; ! if (my_stat_cur[A_INT] >= 18+80) amt_add_stat[A_INT] += 1000; ! if (my_stat_cur[A_WIS] >= 18+80) amt_add_stat[A_WIS] += 1000; ! if (my_stat_cur[A_DEX] >= 18+80) amt_add_stat[A_DEX] += 1000; ! if (my_stat_cur[A_CON] >= 18+80) amt_add_stat[A_CON] += 1000; ! if (my_stat_cur[A_CHR] >= 18+80) amt_add_stat[A_CHR] += 1000; /* No need to *buy* stat repair potions XXX XXX XXX */ if (!do_fix_stat[A_STR]) amt_fix_stat[A_STR] += 1000; if (!do_fix_stat[A_INT]) amt_fix_stat[A_INT] += 1000; --- 1196,1246 ---- amt_enchant_to_a += 1000; } + /* Handle recall */ + if (borg_prayer_legal(4, 4) || borg_spell_legal(5, 4)) + { + amt_recall += 1000; + } + /* speed spells */ + if ( borg_spell_legal( 3, 3 ) || + borg_spell_legal( 7, 3 )) + { + amt_speed += 1000; + } + + /*** Process the Needs ***/ /* No need for fuel */ ! if ((auto_items[INVEN_LITE].sval != SV_LITE_TORCH) && ! (auto_items[INVEN_LITE].sval != SV_LITE_LANTERN)) amt_fuel += 1000; /* No need to *buy* stat increase potions */ ! if (my_stat_cur[A_STR] >= (18+100) + 10 * p_ptr->maximize * ! (rp_ptr->r_adj[A_STR] + cp_ptr->c_adj[A_STR])) ! amt_add_stat[A_STR] += 1000; + if (my_stat_cur[A_INT] >= (18+100) + 10 * p_ptr->maximize * + (rp_ptr->r_adj[A_INT] + cp_ptr->c_adj[A_INT])) + amt_add_stat[A_INT] += 1000; + + if (my_stat_cur[A_WIS] >= (18+100) + 10 * p_ptr->maximize * + (rp_ptr->r_adj[A_WIS] + cp_ptr->c_adj[A_WIS])) + amt_add_stat[A_WIS] += 1000; + + if (my_stat_cur[A_DEX] >= (18+100) + 10 * p_ptr->maximize * + (rp_ptr->r_adj[A_DEX] + cp_ptr->c_adj[A_DEX])) + amt_add_stat[A_DEX] += 1000; + + if (my_stat_cur[A_CON] >= (18+100) + 10 * p_ptr->maximize * + (rp_ptr->r_adj[A_CON] + cp_ptr->c_adj[A_CON])) + amt_add_stat[A_CON] += 1000; + + if (my_stat_cur[A_CHR] >= (18+100) + 10 * p_ptr->maximize * + (rp_ptr->r_adj[A_CHR] + cp_ptr->c_adj[A_CHR])) + amt_add_stat[A_CHR] += 1000; + /* No need to *buy* stat repair potions XXX XXX XXX */ if (!do_fix_stat[A_STR]) amt_fix_stat[A_STR] += 1000; if (!do_fix_stat[A_INT]) amt_fix_stat[A_INT] += 1000; *************** *** 1078,1112 **** /* * Helper function -- notice the home equipment */ ! static void borg_notice_home_aux1(void) { - /* Nothing */ - } - - /* - * Helper function -- notice the home inventory - */ - static void borg_notice_home_aux2(void) - { - int i; - - auto_item *item; - - auto_shop *shop = &auto_shops[7]; - - /*** Reset counters ***/ /* Reset basic */ - num_fuel = 0; num_food = 0; num_ident = 0; num_recall = 0; num_phase = 0; num_escape = 0; num_teleport = 0; /* Reset healing */ num_cure_critical = 0; num_cure_serious = 0; --- 1271,1340 ---- /* * Helper function -- notice the home equipment */ ! static void borg_notice_home_aux1(auto_item* in_item, bool no_items) { /*** Reset counters ***/ /* Reset basic */ num_food = 0; num_ident = 0; + num_star_ident = 0; num_recall = 0; num_phase = 0; num_escape = 0; num_teleport = 0; + num_artifact = 0; + + num_slow_digest = 0; + num_regenerate = 0; + num_telepathy = 0; + num_see_inv = 0; + num_ffall = 0; + num_free_act = 0; + num_hold_life = 0; + num_immune_acid = 0; + num_immune_elec = 0; + num_immune_fire = 0; + num_immune_cold = 0; + num_resist_acid = 0; + num_resist_elec = 0; + num_resist_fire = 0; + num_resist_cold = 0; + num_resist_pois = 0; + num_resist_conf = 0; + num_resist_sound = 0; + num_resist_lite = 0; + num_resist_dark = 0; + num_resist_chaos = 0; + num_resist_disen = 0; + num_resist_shard = 0; + num_resist_nexus = 0; + num_resist_blind = 0; + num_resist_neth = 0; + home_stat_add[A_STR] = 0; + home_stat_add[A_INT] = 0; + home_stat_add[A_WIS] = 0; + home_stat_add[A_DEX] = 0; + home_stat_add[A_CON] = 0; + home_stat_add[A_CHR] = 0; + num_weapons = 0; + + num_bow =0; + num_rings = 0; + num_neck = 0; + num_armor = 0; + num_cloaks = 0; + num_shields = 0; + num_hats = 0; + num_gloves = 0; + num_boots = 0; + num_lite = 0; + num_speed = 0; + num_edged_weapon = 0; + num_bad_gloves= 0; + /* Reset healing */ num_cure_critical = 0; num_cure_serious = 0; *************** *** 1133,1138 **** --- 1361,1368 ---- num_fix_stat[A_CON] = 0; num_fix_stat[A_CHR] = 0; num_fix_exp = 0; + num_mana = 0; + num_heal = 0; /* Reset enchantment */ num_enchant_to_a = 0; *************** *** 1139,1162 **** num_enchant_to_d = 0; num_enchant_to_h = 0; /*** Process the inventory ***/ /* Scan the home */ ! for (i = 0; i < STORE_INVEN_MAX; i++) { item = &shop->ware[i]; /* Skip empty items */ ! if (!item->iqty) continue; /* Hack -- skip un-aware items */ ! if (!item->kind) continue; /* Analyze the item */ switch (item->tval) { /* Books */ case TV_MAGIC_BOOK: case TV_PRAYER_BOOK: --- 1369,1771 ---- num_enchant_to_d = 0; num_enchant_to_h = 0; + home_slot_free = 0; + home_damage = 0; + num_duplicate_items = 0; + } + + + /* + * This checks for duplicate items in the home + */ + static void borg_notice_home_dupe(auto_item *item, bool check_sval, int i) + { + /* eventually check for power overlap... armor of resistence is same as weak elvenkind.*/ + /* two armors of elvenkind that resist poison is a dupe. AJG*/ + + int dupe_count, x; + auto_item *item2; + + /* check for a duplicate. */ + /* be carefull about extra powers (elvenkind/magi) */ + switch (item->name2) + { + case EGO_BLESS_BLADE: + case EGO_PERMANENCE: + case EGO_ELVENKIND: + case EGO_MAGI: + case EGO_AMAN: + return; + break; + case EGO_HA: + case EGO_DF: + default: + break; + } + + /* if this is a stack of items then all after the first are a */ + /* duplicate */ + dupe_count = item->iqty-1; + + /* Look for other items before this one that are the same */ + for (x = 0; x < i; x++) + { + if (x < STORE_INVEN_MAX) + item2 = &auto_shops[7].ware[x]; + else + /* Check what the borg has on as well.*/ + item2 = &auto_items[((x-STORE_INVEN_MAX)+INVEN_WIELD)]; + + /* if everything matches it is a duplicate item */ + /* Note that we only check sval on certain items. This */ + /* is because, for example, two pairs of dragon armor */ + /* are not the same unless thier subtype (color) matches */ + /* but a defender is a defender even if one is a dagger and */ + /* one is a mace */ + if ( (item->tval == item2->tval) && + (check_sval ? (item->sval == item2->sval) : TRUE) && + (item->name1 == item2->name1) && + (item->name2 == item2->name2) ) + { + dupe_count++; + } + } + + /* there can be one dupe of rings because there are two ring slots. */ + if (item->tval == TV_RING && dupe_count) + dupe_count--; + + /* Add this items count to the total duplicate count */ + num_duplicate_items += dupe_count; + } + + /* + * Helper function -- notice the home inventory + */ + static void borg_notice_home_aux2(auto_item *in_item, bool no_items) + { + int i; + + auto_item *item; + + auto_shop *shop = &auto_shops[7]; + /*** Process the inventory ***/ /* Scan the home */ ! for (i = 0; i < (STORE_INVEN_MAX+(INVEN_TOTAL-INVEN_WIELD)); i++) { + if (no_items) break; + + if (!in_item) + if (i < STORE_INVEN_MAX) item = &shop->ware[i]; + else + item = &auto_items[((i-STORE_INVEN_MAX)+INVEN_WIELD)]; + else + item = in_item; /* Skip empty items */ ! if (!item->iqty) ! { ! home_slot_free++; ! continue; ! } /* Hack -- skip un-aware items */ ! if (!item->kind) ! { ! home_slot_free++; ! continue; ! } + if (item->flags3 & TR3_SLOW_DIGEST) num_slow_digest += item->iqty; + if (item->flags3 & TR3_REGEN) num_regenerate += item->iqty; + if (item->flags3 & TR3_TELEPATHY) num_telepathy += item->iqty; + if (item->flags3 & TR3_SEE_INVIS) num_see_inv += item->iqty; + if (item->flags3 & TR3_FEATHER) num_ffall += item->iqty; + if (item->flags2 & TR2_FREE_ACT) num_free_act += item->iqty; + if (item->flags2 & TR2_HOLD_LIFE) num_hold_life += item->iqty; + if (item->flags2 & TR2_IM_FIRE) + { + num_immune_fire += item->iqty; + num_resist_fire += item->iqty; + } + if (item->flags2 & TR2_IM_ACID) + { + num_immune_acid += item->iqty; + num_resist_acid += item->iqty; + } + if (item->flags2 & TR2_IM_COLD) + { + num_immune_cold += item->iqty; + num_resist_cold += item->iqty; + } + if (item->flags2 & TR2_IM_ELEC) + { + num_immune_elec += item->iqty; + num_resist_elec += item->iqty; + } + if (item->flags2 & TR2_RES_ACID) num_resist_acid += item->iqty; + if (item->flags2 & TR2_RES_ELEC) num_resist_elec += item->iqty; + if (item->flags2 & TR2_RES_FIRE) num_resist_fire += item->iqty; + if (item->flags2 & TR2_RES_COLD) num_resist_cold += item->iqty; + if (item->flags2 & TR2_RES_POIS) num_resist_pois += item->iqty; + if (item->flags2 & TR2_RES_SOUND) num_resist_sound += item->iqty; + if (item->flags2 & TR2_RES_LITE) num_resist_lite += item->iqty; + if (item->flags2 & TR2_RES_DARK) num_resist_dark += item->iqty; + if (item->flags2 & TR2_RES_CHAOS) num_resist_chaos += item->iqty; + /* chaos also does confusion */ + if (item->flags2 & TR2_RES_CONF || item->flags2 & TR2_RES_CHAOS) + num_resist_conf += item->iqty; + if (item->flags2 & TR2_RES_DISEN) num_resist_disen += item->iqty; + if (item->flags2 & TR2_RES_SHARDS) num_resist_shard += item->iqty; + if (item->flags2 & TR2_RES_NEXUS) num_resist_nexus += item->iqty; + if (item->flags2 & TR2_RES_BLIND) num_resist_blind += item->iqty; + if (item->flags2 & TR2_RES_NETHER) num_resist_neth += item->iqty; + /* count up bonus to stats */ + /* HACK only collect stat rings above +3 */ + if (item->flags1 & TR1_STR) + { + if (item->tval != TV_RING || item->pval > 3) + home_stat_add[A_STR] += item->pval * item->iqty; + } + if (item->flags1 & TR1_INT) + { + if (item->tval != TV_RING || item->pval > 3) + home_stat_add[A_INT] += item->pval * item->iqty; + } + if (item->flags1 & TR1_WIS) + { + if (item->tval != TV_RING || item->pval > 3) + home_stat_add[A_WIS] += item->pval * item->iqty; + } + if (item->flags1 & TR1_DEX) + { + if (item->tval != TV_RING || item->pval > 3) + home_stat_add[A_DEX] += item->pval * item->iqty; + } + if (item->flags1 & TR1_CON) + { + if (item->tval != TV_RING || item->pval > 3) + home_stat_add[A_CON] += item->pval * item->iqty; + } + if (item->flags1 & TR1_CHR) + { + if (item->tval != TV_RING || item->pval > 3) + home_stat_add[A_CHR] += item->pval * item->iqty; + } + + /* count up bonus to speed */ + if (item->flags1 & TR1_SPEED) num_speed += item->pval * item->iqty; + + /* count artifacts */ + if (item->name1) num_artifact += item->iqty; + /* Analyze the item */ switch (item->tval) { + case TV_SOFT_ARMOR: + case TV_HARD_ARMOR: + num_armor += item->iqty; + + /* see if this item is duplicated */ + borg_notice_home_dupe( item, FALSE, i ); + break; + + case TV_DRAG_ARMOR: + num_armor += item->iqty; + + /* see if this item is duplicated */ + borg_notice_home_dupe( item, TRUE, i ); + break; + + case TV_CLOAK: + num_cloaks += item->iqty; + + /* see if this item is duplicated */ + borg_notice_home_dupe( item, FALSE, i ); + + break; + + case TV_SHIELD: + num_shields += item->iqty; + + /* see if this item is duplicated */ + borg_notice_home_dupe( item, FALSE, i ); + break; + + case TV_HELM: + case TV_CROWN: + num_hats += item->iqty; + + /* see if this item is duplicated */ + borg_notice_home_dupe( item, FALSE, i ); + + break; + + case TV_GLOVES: + num_gloves += item->iqty; + + /* most gloves hurt magic for spell-casters */ + if (mb_ptr->spell_book == TV_MAGIC_BOOK) + { + /* Penalize non-usable gloves */ + if (item->iqty && + (!(item->flags2 & TR2_FREE_ACT)) && + (!((item->flags1 & TR1_DEX) && (item->pval > 0)))) + { + num_bad_gloves += item->iqty; + } + } + + /* gloves of slaying give a damage bonus */ + home_damage += item->to_d * 3; + + /* see if this item is duplicated */ + borg_notice_home_dupe( item, FALSE, i ); + + break; + + case TV_LITE: + num_lite += item->iqty; + break; + + case TV_BOOTS: + num_boots += item->iqty; + + /* see if this item is duplicated */ + borg_notice_home_dupe( item, FALSE, i ); + break; + + case TV_SWORD: + case TV_POLEARM: + case TV_HAFTED: + case TV_DIGGING: + { + s16b num_blow; + + num_weapons += item->iqty; + /* most edged weapons hurt magic for priests */ + if (auto_class == CLASS_PRIEST) + { + /* Penalize non-blessed edged weapons */ + if (((item->tval == TV_SWORD) || (item->tval == TV_POLEARM)) && + (!(item->flags3 & TR3_BLESSED))) + { + num_edged_weapon += item->iqty; + } + } + + + /* NOTE: This damage does not take slays into account. */ + /* it is just a rough estimate to make sure the glave of pain*/ + /* is kept if it is found */ + /* It is hard to hold a heavy weapon */ + num_blow = 1; + if (adj_str_hold[my_stat_ind[A_STR]] >= item->weight / 10) + { + int str_index, dex_index; + int num = 0, wgt = 0, mul = 0, div = 0; + + /* Analyze the class */ + switch (auto_class) + { + /* Warrior */ + case 0: num = 6; wgt = 30; mul = 5; break; + + /* Mage */ + case 1: num = 4; wgt = 40; mul = 2; break; + + /* Priest (was mul = 3.5) */ + case 2: num = 5; wgt = 35; mul = 3; break; + + /* Rogue */ + case 3: num = 5; wgt = 30; mul = 3; break; + + /* Ranger */ + case 4: num = 5; wgt = 35; mul = 4; break; + + /* Paladin */ + case 5: num = 5; wgt = 30; mul = 4; break; + } + + /* Enforce a minimum "weight" */ + div = ((item->weight < wgt) ? wgt : item->weight); + + /* Access the strength vs weight */ + str_index = (adj_str_blow[my_stat_ind[A_STR]] * mul / div); + + /* Maximal value */ + if (str_index > 11) str_index = 11; + + /* Index by dexterity */ + dex_index = (adj_dex_blow[my_stat_ind[A_DEX]]); + + /* Maximal value */ + if (dex_index > 11) dex_index = 11; + + /* Use the blows table */ + num_blow = blows_table[str_index][dex_index]; + + /* Maximal value */ + if (num_blow > num) num_blow = num; + + } + + /* Require at least one blow */ + if (num_blow < 1) num_blow = 1; + + if (item->flags1 & TR1_BLOWS) + num_blow += item->pval; + num_blow *= item->iqty; + if ( item->to_d > 8 || auto_level < 15 ) + { + home_damage += num_blow * (item->dd * (item->ds) + + (my_to_dam + item->to_d)); + } + else + { + home_damage += num_blow * (item->dd * (item->ds) + + (my_to_dam + 8)); + } + + /* see if this item is a duplicate */ + borg_notice_home_dupe( item, FALSE, i ); + break; + } + + case TV_BOW: + num_bow += item->iqty; + + /* see if this item is a duplicate */ + borg_notice_home_dupe( item, FALSE, i ); + break; + + case TV_RING: + num_rings += item->iqty; + + /*ring of damage */ + #if 0 + /* these are common as dirt so i commented this out */ + home_damage += item->to_d * 10; + #endif + + /* see if this item is a duplicate */ + borg_notice_home_dupe( item, TRUE, i ); + + break; + + case TV_AMULET: + num_neck += item->iqty; + + /* see if this item is a duplicate */ + borg_notice_home_dupe( item, TRUE, i ); + break; + + /* Books */ case TV_MAGIC_BOOK: case TV_PRAYER_BOOK: *************** *** 1225,1230 **** --- 1834,1847 ---- case SV_POTION_RESTORE_EXP: num_fix_exp += item->iqty; break; + + case SV_POTION_RESTORE_MANA: + num_mana += item->iqty; + break; + + case SV_POTION_HEALING: + num_heal += item->iqty; + break; } break; *************** *** 1240,1245 **** --- 1857,1866 ---- num_ident += item->iqty; break; + case SV_SCROLL_STAR_IDENTIFY: + num_star_ident += item->iqty; + break; + case SV_SCROLL_PHASE_DOOR: num_phase += item->iqty; break; *************** *** 1289,1294 **** --- 1910,1919 ---- /* Staffs */ case TV_STAFF: + /* only collect staves with more than 3 charges at high level */ + if (item->pval <= 3 && auto_level > 30) + break; + /* Analyze */ switch (item->sval) { *************** *** 1304,1318 **** break; - /* Flasks */ - case TV_FLASK: - - /* Use as fuel for lanterns */ - num_fuel += item->iqty; - - break; - - /* Missiles */ case TV_SHOT: case TV_ARROW: --- 1929,1934 ---- *************** *** 1329,1334 **** --- 1945,1953 ---- break; } + + /* if only doing one item, break. */ + if (in_item) break; } *************** *** 1359,1370 **** num_enchant_to_a += 1000; } /*** Process the Needs ***/ - /* No need for fuel */ - if (auto_items[INVEN_LITE].name1) num_fuel += 1000; - /* Hack -- No need for stat repair */ if (my_sustain_str) num_fix_stat[A_STR] += 1000; if (my_sustain_int) num_fix_stat[A_INT] += 1000; --- 1978,1997 ---- num_enchant_to_a += 1000; } + /* handle restore */ + if (borg_prayer_legal(6, 4)) + { + num_fix_exp += 1000; + } + /* Handle recall */ + if (borg_prayer_legal(4, 4) || borg_spell_legal(5, 4)) + { + num_recall += 1000; + } + /*** Process the Needs ***/ /* Hack -- No need for stat repair */ if (my_sustain_str) num_fix_stat[A_STR] += 1000; if (my_sustain_int) num_fix_stat[A_INT] += 1000; *************** *** 1372,1396 **** if (my_sustain_dex) num_fix_stat[A_DEX] += 1000; if (my_sustain_con) num_fix_stat[A_CON] += 1000; if (my_sustain_chr) num_fix_stat[A_CHR] += 1000; } - /* ! * Extract various bonuses */ ! void borg_notice_home(void) { /* Notice the home equipment */ ! borg_notice_home_aux1(); /* Notice the home inventory */ ! borg_notice_home_aux2(); } - - - - /* * Helper function -- calculate "power" of equipment */ --- 1999,2031 ---- if (my_sustain_dex) num_fix_stat[A_DEX] += 1000; if (my_sustain_con) num_fix_stat[A_CON] += 1000; if (my_sustain_chr) num_fix_stat[A_CHR] += 1000; + + /* race bonuses */ + if (auto_race == RACE_ELF) num_resist_lite = 1000; + if (auto_race == RACE_GNOME) num_free_act = 1000; + if (auto_race == RACE_DWARF) num_resist_blind = 1000; + if (auto_race == RACE_HALF_ORC) num_resist_dark = 1000; + if (auto_race == RACE_HIGH_ELF) num_resist_lite = 1000; + if (auto_race == RACE_HIGH_ELF) num_see_inv = 1000; } /* ! * Extract the bonuses for items in the home. ! * ! * in_item is passed in if you want to pretent that in_item is ! * the only item in the home. ! * no_items is passed in as TRUE if you want to pretend that the ! * home is empty. */ ! void borg_notice_home(auto_item *in_item, bool no_items) { /* Notice the home equipment */ ! borg_notice_home_aux1(in_item, no_items); /* Notice the home inventory */ ! borg_notice_home_aux2(in_item, no_items); } /* * Helper function -- calculate "power" of equipment */ *************** *** 1399,1404 **** --- 2034,2041 ---- int hold; int damage; + int i; + int cur_wgt = 0; int max_wgt = 0; *************** *** 1407,1436 **** auto_item *item; ! /* Obtain the "hold" value */ hold = adj_str_hold[my_stat_ind[A_STR]]; - /*** Analyze weapon ***/ /* Examine current weapon */ item = &auto_items[INVEN_WIELD]; ! /* Calculate "average" damage per "normal" blow (times 2) */ ! damage = (item->dd * (item->ds + 1) + ((my_to_dam + item->to_d) * 2)); - /* XXX XXX XXX reward "extra" damage from "slaying" flags */ - /* Reward "damage" */ ! value += (my_num_blow * damage * 500L); /* Reward "bonus to hit" */ ! value += ((my_to_hit + item->to_h) * 100L); /* Hack -- It is hard to hold a heavy weapon */ if (hold < item->weight / 10) value -= 500000L; - /*** Analyze bow ***/ /* Examine current bow */ --- 2044,2107 ---- auto_item *item; ! /* Obtain the "hold" value (weight limit for weapons) */ hold = adj_str_hold[my_stat_ind[A_STR]]; /*** Analyze weapon ***/ /* Examine current weapon */ item = &auto_items[INVEN_WIELD]; ! /* Calculate "average" damage per "normal" blow */ ! /* and assume we can enchant up to +8 if auto_level > 25 */ ! if ( item->to_d > 8 || auto_level < 25 ) ! { ! damage = (item->dd * (item->ds) + (my_to_dam + item->to_d)); ! } ! else ! { ! damage = (item->dd * (item->ds) + (my_to_dam + 8)); ! } /* Reward "damage" */ ! value += (my_num_blow * damage * 110L); /* Reward "bonus to hit" */ ! if ( item->to_h > 8 || auto_level < 25 ) ! value += ((my_to_hit + item->to_h) * 25L); ! else ! value += ((my_to_hit + 8) * 25L); + /* assume 2x base damage for x% of creatures */ + damage = (item->dd * (item->ds)) * 2 * my_num_blow * 110L; + + if (my_slay_animal) value += (damage * 2) / 10; + if (my_slay_evil) value += (damage * 2) / 10; + + /* assume 3x base damage for x% of creatures */ + damage = (item->dd * (item->ds)) * 3 * my_num_blow * 110L; + + if (my_slay_undead) value += (damage * 9) / 100; + if (my_slay_demon) value += (damage * 6) / 100; + if (my_slay_orc) value += (damage * 9) / 100; + if (my_slay_troll) value += (damage * 9) / 100; + if (my_slay_giant) value += (damage * 9) / 100; + if (my_slay_dragon) value += (damage * 11) / 100; + if (my_brand_acid) value += (damage * 17) / 100; + if (my_brand_elec) value += (damage * 17) / 100; + if (my_brand_fire) value += (damage * 14) / 100; + if (my_brand_cold) value += (damage * 14) / 100; + + /* assume 5x base damage for x% of creatures */ + damage = (item->dd * (item->ds)) * 5 * my_num_blow * 110L; + if (my_kill_dragon) value += (damage * 11) / 100; + + /* what ever... Will never get this anyway. it is only on Grond */ + if (my_impact) value += 5000L; + /* Hack -- It is hard to hold a heavy weapon */ if (hold < item->weight / 10) value -= 500000L; /*** Analyze bow ***/ /* Examine current bow */ *************** *** 1437,1449 **** item = &auto_items[INVEN_BOW]; /* Calculate "average" damage per "normal" shot (times 2) */ ! damage = ((my_ammo_sides + 1) + (item->to_d * 2)) * my_ammo_power; /* Reward "damage" */ ! value += (my_num_fire * damage * 500L); /* Reward "bonus to hit" */ ! value += ((my_to_hit + item->to_h) * 100L); /* Analyze the class */ switch (auto_class) --- 2108,2126 ---- item = &auto_items[INVEN_BOW]; /* Calculate "average" damage per "normal" shot (times 2) */ ! if ( item->to_d > 8 || auto_level < 25 ) ! damage = ((my_ammo_sides) + (item->to_d)) * my_ammo_power; ! else ! damage = (my_ammo_sides + 8) * my_ammo_power; /* Reward "damage" */ ! value += (my_num_fire * damage * 300L); /* Reward "bonus to hit" */ ! if ( item->to_h > 8 || auto_level < 25 ) ! value += ((my_to_hit + item->to_h) * 50L); ! else ! value += ((my_to_hit + 8) * 50L); /* Analyze the class */ switch (auto_class) *************** *** 1453,1477 **** case CLASS_ROGUE: case CLASS_PRIEST: case CLASS_PALADIN: ! if (my_ammo_tval == TV_BOLT) value += 200000L; /* Prefer bows */ case CLASS_MAGE: case CLASS_RANGER: ! if (my_ammo_tval == TV_ARROW) value += 100000L; } /* Hack -- It is hard to hold a heavy weapon */ if (hold < item->weight / 10) value -= 500000L; - /*** Reward various things ***/ /* Hack -- Reward light radius */ value += (my_cur_lite * 1000000L); /* Hack -- Reward speed */ ! value += ((my_speed - 100) * 100000L); /* Hack -- Reward strength bonus */ value += (my_stat_ind[A_STR] * 500L); --- 2130,2164 ---- case CLASS_ROGUE: case CLASS_PRIEST: case CLASS_PALADIN: ! if (my_ammo_tval == TV_BOLT) value += 50000L; /* Prefer bows */ case CLASS_MAGE: case CLASS_RANGER: ! if (my_ammo_tval == TV_ARROW) value += 30000L; } /* Hack -- It is hard to hold a heavy weapon */ if (hold < item->weight / 10) value -= 500000L; /*** Reward various things ***/ /* Hack -- Reward light radius */ value += (my_cur_lite * 1000000L); + /* HACK reward upgrading artifact lites. (for activation) */ + /* do this by assuming more valueable artifact lights are better */ + if (my_cur_lite == 3) + value += (auto_items[INVEN_LITE].value / 1000); + /* Hack -- Reward speed */ ! if (my_speed < 130) ! value += ((my_speed - 110) * 20000L); ! else ! if (my_speed < 140) ! value += ((my_speed - 130) * 5000L) + 400000L; ! else ! value += ((my_speed - 140) * 500L) + 450000L; /* Hack -- Reward strength bonus */ value += (my_stat_ind[A_STR] * 500L); *************** *** 1479,1547 **** /* Hack -- Reward intelligence bonus */ if (mb_ptr->spell_book == TV_MAGIC_BOOK) { ! value += (my_stat_ind[A_INT] * 200L); } /* Hack -- Reward wisdom bonus */ if (mb_ptr->spell_book == TV_PRAYER_BOOK) { ! value += (my_stat_ind[A_WIS] * 200L); } ! /* Hack -- Reward charisma bonus */ ! value += (my_stat_ind[A_CHR] * 10L); /*** Reward current skills ***/ /* Hack -- tiny rewards */ ! value += (my_skill_dis * 1L); ! value += (my_skill_dev * 1L); ! value += (my_skill_sav * 1L); ! value += (my_skill_stl * 1L); value += (my_skill_srh * 1L); value += (my_skill_fos * 1L); ! value += (my_skill_thn * 1L); ! value += (my_skill_thb * 1L); ! value += (my_skill_tht * 1L); ! value += (my_skill_dig * 1L); /*** Reward current flags ***/ /* Various flags */ - if (my_see_inv) value += 5000L; - if (my_free_act) value += 10000L; if (my_slow_digest) value += 10L; - if (my_regenerate) value += 50000L; if (my_ffall) value += 10L; - if (my_hold_life) value += 10000L; - if (my_telepathy) value += 50000L; if (my_lite) value += 2000L; /* Immunity flags */ ! if (my_immune_acid) value += 80000L; if (my_immune_elec) value += 40000L; if (my_immune_fire) value += 60000L; ! if (my_immune_cold) value += 30000L; /* Resistance flags */ - if (my_resist_acid) value += 8000L; - if (my_resist_elec) value += 4000L; - if (my_resist_fire) value += 6000L; if (my_resist_cold) value += 3000L; if (my_resist_pois) value += 20000L; ! if (my_resist_fear) value += 2000L; if (my_resist_lite) value += 200L; if (my_resist_dark) value += 200L; - if (my_resist_blind) value += 5000L; - if (my_resist_confu) value += 5000L; - if (my_resist_sound) value += 100L; - if (my_resist_shard) value += 100L; - if (my_resist_nexus) value += 100L; - if (my_resist_nethr) value += 2000L; if (my_resist_chaos) value += 2000L; if (my_resist_disen) value += 5000L; /* Sustain flags */ if (my_sustain_str) value += 50L; --- 2166,2296 ---- /* Hack -- Reward intelligence bonus */ if (mb_ptr->spell_book == TV_MAGIC_BOOK) { ! value += (my_stat_ind[A_INT] * 500L); ! ! /* Bonus for sp. */ ! value += ((adj_mag_mana[my_stat_ind[A_INT]] * auto_level) / 2) * 175L; ! ! /* bonus for fail rate */ ! value += adj_mag_stat[my_stat_ind[A_INT]] * 3100L; ! ! /* mage should try to get min fail to 0 */ ! if (auto_class == CLASS_MAGE) ! { ! if (adj_mag_fail[my_stat_ind[A_INT]] < 1) ! value += 70000L; ! } + } /* Hack -- Reward wisdom bonus */ if (mb_ptr->spell_book == TV_PRAYER_BOOK) { ! value += (my_stat_ind[A_WIS] * 500L); ! ! /* Bonus for sp. */ ! value += ((adj_mag_mana[my_stat_ind[A_WIS]] * auto_level) / 2) * 150L; ! ! /* bonus for fail rate */ ! value += adj_mag_stat[my_stat_ind[A_WIS]] * 3000L; ! ! /* priest should try to get min fail to 0 */ ! if (auto_class == CLASS_PRIEST) ! { ! if (adj_mag_fail[my_stat_ind[A_WIS]] < 1) ! value += 70000L; } ! } + /* Bonus for hp. */ + value += (((adj_con_mhp[my_stat_ind[A_CON]] -128) * auto_level) / 2) *100L; + + /* HACK - a small bonus for adding to stats even above max. */ + /* This will allow us to swap a ring of int +6 for */ + /* our ring of int +2 even though we are at max int because */ + /* we are wielding a weapon that has +4 int */ + /* later it might be nice to swap to a weapon that does not */ + /* have an int bonus */ + for (i = 0; i < 6; i++) value += my_stat_add[i]; + + /* Hack -- Reward charisma bonus up to level 25 */ + if (auto_level < 25) + value += (my_stat_ind[A_CHR] * 10L); + /*** Reward current skills ***/ /* Hack -- tiny rewards */ ! value += (my_skill_dis * 2L); ! value += (my_skill_dev * 50L); ! value += (my_skill_sav * 50L); ! /* perfect saves are very nice */ ! if (my_skill_sav > 99) ! value += 10000; ! value += (my_skill_stl * 2L); value += (my_skill_srh * 1L); value += (my_skill_fos * 1L); ! value += (my_skill_thn * 10L); ! value += (my_skill_thb * 70L); ! value += (my_skill_tht * 2L); ! value += (my_skill_dig * 2L); /*** Reward current flags ***/ /* Various flags */ if (my_slow_digest) value += 10L; if (my_ffall) value += 10L; if (my_lite) value += 2000L; + if (my_telepathy) + { + if (my_see_inv) value += 500L; + } + else + if (my_see_inv) value += 5000L; + if (my_free_act) value += 10000L; + /* after you max out you are pretty safe from drainers.*/ + if (auto_level < 50) + { + if (my_hold_life) value += 2000L; + } + else + { + if (my_hold_life) value += 200L; + } + if (my_regenerate) value += 2000L; + if (my_telepathy) value += 50000L; + /* Immunity flags */ ! if (my_immune_cold) value += 30000L; if (my_immune_elec) value += 40000L; if (my_immune_fire) value += 60000L; ! if (my_immune_acid) value += 80000L; /* Resistance flags */ if (my_resist_cold) value += 3000L; + if (my_resist_elec) value += 4000L; + if (my_resist_acid) value += 6000L; + if (my_resist_fire) value += 8000L; + /* extra bonus for getting all basic resist */ + if (my_resist_fire && + my_resist_acid && + my_resist_elec && + my_resist_cold) value += 17500L; if (my_resist_pois) value += 20000L; ! if (my_resist_sound) value += 2000L; if (my_resist_lite) value += 200L; if (my_resist_dark) value += 200L; if (my_resist_chaos) value += 2000L; + if (my_resist_conf) value += 5000L; if (my_resist_disen) value += 5000L; + if (my_resist_shard) value += 100L; + if (my_resist_nexus) value += 100L; + if (my_resist_blind) value += 5000L; + if (my_resist_neth) value += 5500L; + if (my_resist_fear) value += 2000L; /* Sustain flags */ if (my_sustain_str) value += 50L; *************** *** 1549,1570 **** if (my_sustain_wis) value += 50L; if (my_sustain_con) value += 50L; if (my_sustain_dex) value += 50L; - if (my_sustain_chr) value += 50L; /*** XXX XXX XXX Reward "necessary" flags ***/ /* Mega-Hack -- See invisible (level 10) */ ! if (my_see_inv && (auto_max_depth+1 >= 10)) value += 100000L; /* Mega-Hack -- Free action (level 20) */ if (my_free_act && (auto_max_depth+1 >= 20)) value += 100000L; /*** Reward powerful armor ***/ /* Reward armor */ ! value += ((my_ac + my_to_ac) * 300L); /*** Penalize various things ***/ --- 2298,2330 ---- if (my_sustain_wis) value += 50L; if (my_sustain_con) value += 50L; if (my_sustain_dex) value += 50L; /*** XXX XXX XXX Reward "necessary" flags ***/ /* Mega-Hack -- See invisible (level 10) */ ! if ((my_see_inv || my_telepathy) && (auto_max_depth+1 >= 10)) value += 100000L; /* Mega-Hack -- Free action (level 20) */ if (my_free_act && (auto_max_depth+1 >= 20)) value += 100000L; + /* Mega-Hack -- resist nether (level 50) */ + if (my_resist_neth && (auto_max_depth+1 >= 50)) value += 100000L; + /* Mega-Hack -- resist poison (level 40) */ + if (my_resist_pois && (auto_max_depth+1 >= 40)) value += 100000L; + + /* Mega-Hack -- resist disenchant (level 60) */ + if (my_resist_disen && (auto_max_depth+1 >= 60)) value += 100000L; + /*** Reward powerful armor ***/ /* Reward armor */ ! /* HACK first 10 points are very important */ ! if ((my_ac + my_to_ac) < 10) ! value += ((my_ac + my_to_ac) * 10000L); ! else ! value += (((my_ac + my_to_ac)-10) * 15L) + 100000L; /*** Penalize various things ***/ *************** *** 1573,1579 **** if (my_teleport) value -= 100000L; if (my_aggravate) value -= 50000L; - /*** Penalize armor weight ***/ /* Compute the total armor weight */ --- 2333,2338 ---- *************** *** 1590,1599 **** /* Hack -- heavy armor hurts magic */ if ((mb_ptr->spell_book) && (((cur_wgt - max_wgt) / 10) > 0) && ! (auto_max_level < 20)) { /* Mega-Hack -- Penalize heavy armor which hurts mana */ ! value -= (((cur_wgt - max_wgt) / 10) * (20 - auto_max_level) * 10L); } --- 2349,2358 ---- /* Hack -- heavy armor hurts magic */ if ((mb_ptr->spell_book) && (((cur_wgt - max_wgt) / 10) > 0) && ! (auto_max_level < 30)) { /* Mega-Hack -- Penalize heavy armor which hurts mana */ ! value -= (((cur_wgt - max_wgt) / 10) * (30 - auto_max_level) * 10L); } *************** *** 1606,1612 **** /* Penalize non-usable gloves */ if (item->iqty && ! (!(item->flags3 & TR3_FREE_ACT)) && (!((item->flags1 & TR1_DEX) && (item->pval > 0)))) { /* Hack -- Major penalty */ --- 2365,2371 ---- /* Penalize non-usable gloves */ if (item->iqty && ! (!(item->flags2 & TR2_FREE_ACT)) && (!((item->flags1 & TR1_DEX) && (item->pval > 0)))) { /* Hack -- Major penalty */ *************** *** 1628,1633 **** --- 2387,2437 ---- } } + + /* HUGE MEGA MONDO HACK! prepare for the big fight */ + /* go after Morgoth new priorities. */ + if ((auto_max_depth+1 >= 100) && + borg_collect_potions_morgoth) + { + /* protect from stat drain */ + if (my_sustain_str) value += 30000L; + if (my_sustain_int) value += 30000L; + if (my_sustain_wis) value += 30000L; + if (my_sustain_con) value += 30000L; + if (my_sustain_dex) value += 30000L; + + /* Another bonus for resist nether, poison and base four */ + if (my_resist_neth) value += 100000L; + if (my_resist_disen) value += 100000L; + + /* to protect against summoned baddies */ + if (my_resist_pois) value += 100000L; + if (my_resist_fire && + my_resist_acid && + my_resist_elec && + my_resist_cold) value += 100000L; + + /* another damage bonus! need to hit hard to kill morgoth */ + item = &auto_items[INVEN_WIELD]; + + /* Calculate "average" damage per "normal" blow (times 2) */ + if ( item->to_d > 8 || auto_level < 25 ) + { + damage = (item->dd * (item->ds) + (my_to_dam + item->to_d)); + } + else + { + damage = (item->dd * (item->ds) + (my_to_dam + 8)); + } + + /* Reward "damage" */ + value += (my_num_blow * damage * 110L); + damage = (item->dd * (item->ds)) * 2 * my_num_blow * 110L; + if (my_slay_evil) value += (damage * 2) / 10; + damage = (item->dd * (item->ds)) * 3 * my_num_blow * 110L; + if (my_slay_giant) value += (damage * 9) / 100; + } + /* Result */ return (value); } *************** *** 1652,1657 **** --- 2456,2467 ---- for (; k < 10 && k < amt_fuel; k++) value += 6000L; /* Reward food */ + /* if weak, do not count food spells */ + if (do_weak && amt_food > 1000) + amt_food -= 1000; + /* if hungry, food is THE top priority */ + if (do_hungry) + if (amt_food) value += 100000; k = 0; for (; k < 5 && k < amt_food; k++) value += 50000L; for (; k < 10 && k < amt_food; k++) value += 5000L; *************** *** 1661,1666 **** --- 2471,2479 ---- for (; k < 20 && k < amt_ident; k++) value += 6000L; for (; k < 40 && k < amt_ident; k++) value += 600L; + /* Reward *id* (only carry one!) */ + if (amt_star_ident) value += 10000L; + /* Reward recall */ k = 0; for (; k < 3 && k < amt_recall; k++) value += 50000L; *************** *** 1667,1673 **** for (; k < 5 && k < amt_recall; k++) value += 5000L; /* Reward phase */ ! k = 0; for (; k < 20 && k < amt_phase; k++) value += 500L; /* Reward escape */ --- 2480,2488 ---- for (; k < 5 && k < amt_recall; k++) value += 5000L; /* Reward phase */ ! k = 1; ! /* first phase door is very important */ ! if (amt_phase) value += 50000; for (; k < 20 && k < amt_phase; k++) value += 500L; /* Reward escape */ *************** *** 1678,1686 **** --- 2493,2581 ---- k = 0; for (; k < 5 && k < amt_teleport; k++) value += 10000L; + /* Reward teleport staves */ + /*(try to carry more than one if we can afford it)*/ + if (auto_level > 25) + { + k = 0; + for (; k < 2 && k < amt_teleport_staff; k++) value += 2000L; + } /*** Healing ***/ + if (auto_mhp > 400) + { + /* normally keep all the heal you can get */ + int heal_to_keep = 100; + /* until getting ready for Morgoth */ + if (fear_depth > 98) + { + /* if almost at Morgoth, keep only 5 to wipe out last uniques */ + heal_to_keep = 5; + + /* unless we are heading for Morgoth land, then only keep one */ + /* this will prevent us from whiping out our supply on Morgoth */ + if (fear_depth > 99) + { + /* if in town, don't carry any */ + if (!auto_depth) + heal_to_keep = 0; + else + heal_to_keep = 1; + + /* unless going after morgoth, then get all potions! */ + if (borg_collect_potions_morgoth) + heal_to_keep = 100; + } + } + + k = 0; + for (; k < heal_to_keep && k < amt_heal; k++) value += 4000L; + + /* preists do not collect extra heals, */ + /* they clutter inventory too much */ + if (auto_class != CLASS_PRIEST) + { + k = 0; + for (; k < 100 && k < amt_ez_heal; k++) value += 4000L; + } + } + + /* Restore Mana */ + if (auto_msp > 100) + { + /* normally keep all the restore manas you can get */ + int mana_to_keep = 100; + + /* getting ready for Morgoth */ + if (fear_depth > 98) + { + /* if almost at Morgoth, keep only 5 to wipe out last uniques */ + mana_to_keep = 5; + + /* unless we are heading for Morgoth land, then only keep one */ + /* this will prevent us from whiping out our supply on Morgoth */ + if (fear_depth > 99) + { + /* if in town, don't carry any */ + if (!auto_depth) + mana_to_keep = 0; + else + mana_to_keep = 1; + + /* unless going after Morgoth, then get all potions! */ + if (borg_collect_potions_morgoth) + mana_to_keep = 100; + } + } + + k = 0; + for (; k < mana_to_keep && k < amt_mana; k++) value += 4000L; + + k = 0; + for (; k < 100 && k < amt_ez_mana; k++) value += 4000L; + } + /* Reward cure critical */ k = 0; for (; k < 5 && k < amt_cure_critical; k++) value += 5000L; *************** *** 1687,1697 **** for (; k < 20 && k < amt_cure_critical; k++) value += 500L; /* Reward cure serious */ k = 0; ! for (; k < 5 && k < amt_cure_serious; k++) value += 500L; ! for (; k < 10 && k < amt_cure_serious; k++) value += 50L; - /*** Detection ***/