From 946d101429a49b656ee37ad00a927787e2d463fd Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 19 Feb 2011 17:09:03 +0100 Subject: Remove dead (#if 0) code. --- src/birth.c | 19 ----- src/bldg.c | 68 --------------- src/cave.c | 46 ---------- src/cmd1.c | 142 ------------------------------- src/cmd2.c | 71 +--------------- src/cmd3.c | 28 ------ src/cmd4.c | 11 --- src/cmd6.c | 12 +-- src/cmd7.c | 79 ----------------- src/defines.h | 1 - src/dungeon.c | 168 ------------------------------------ src/externs.h | 1 - src/files.c | 259 -------------------------------------------------------- src/generate.c | 30 ------- src/loadsave.c | 8 -- src/main-gcu.c | 23 ----- src/melee1.c | 14 --- src/melee2.c | 41 --------- src/monster1.c | 17 ---- src/monster2.c | 43 +--------- src/monster3.c | 10 +-- src/object2.c | 81 ------------------ src/randart.c | 10 --- src/script.c | 39 --------- src/skills.c | 136 ----------------------------- src/spells1.c | 58 ------------- src/spells2.c | 17 ---- src/store.c | 32 +------ src/tables.c | 17 +--- src/traps.c | 263 +-------------------------------------------------------- src/util.c | 59 ------------- src/wild.c | 41 --------- src/wizard2.c | 5 -- src/xtra1.c | 18 +--- src/xtra2.c | 38 --------- src/z-term.c | 22 ----- 36 files changed, 11 insertions(+), 1916 deletions(-) (limited to 'src') diff --git a/src/birth.c b/src/birth.c index fa74c5e2..5fc6c4fd 100644 --- a/src/birth.c +++ b/src/birth.c @@ -1075,17 +1075,6 @@ void outfit_obj(int tv, int sv, int pval, int dd, int ds) if (pval) q_ptr->pval = pval; - /* Merchants get a chest which is currently empty */ -#if 0 /* DGDGDGDG -- use a skill */ - if ((tv == TV_CHEST) && (cp_ptr->magic_key == MKEY_TELEKINESIS)) - { - /* Put items into the chest */ - q_ptr->pval = -5; - - /* Set the number of items in the chest */ - q_ptr->pval2 = 6; - } -#endif /* These objects are "storebought" */ q_ptr->ident |= IDENT_MENTAL; q_ptr->number = damroll(dd, ds); @@ -3413,14 +3402,6 @@ void player_birth(void) message_add(MESSAGE_MSG, " ", TERM_L_BLUE); message_add(MESSAGE_MSG, " ", TERM_L_BLUE); - /* Verify autoskiller */ -#if 0 - if (validate_autoskiller(spp_ptr->skill_ideal) < 0) - { - message_add(MESSAGE_MSG, "WARNING: Bad autoskill chart", TERM_VIOLET); - } -#endif - /* Hack -- outfit the player */ player_outfit(); diff --git a/src/bldg.c b/src/bldg.c index 6a10a0f2..e5220031 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -782,24 +782,6 @@ static bool inn_comm(int cmd) } -#if 0 /* removes compiler warning */ - -/* - * share gold for thieves - */ -static void share_gold(void) -{ - int i; - - - i = (p_ptr->lev * 2) * 10; - msg_format("You collect %d gold pieces", i); - msg_print(NULL); - p_ptr->au += i; -} - -#endif - /* * Display quest information */ @@ -1154,15 +1136,6 @@ static bool fix_item(int istart, int iend, int ispecific, bool iac, bool repaired = FALSE; -#if 0 - if (set_reward && p_ptr->rewards[ireward]) - { - msg_print("You already have been rewarded today."); - msg_print(NULL); - - return (FALSE); - } -#endif clear_bldg(5, 18); strnfmt(tmp_str, 80, " Based on your skill, we can improve up to +%d", maxenchant); prt(tmp_str, 5, 0); @@ -1227,10 +1200,6 @@ static bool fix_item(int istart, int iend, int ispecific, bool iac, } else { -#if 0 - if (set_reward) - p_ptr->rewards[ireward] = TRUE; -#endif msg_print("Press the spacebar to continue"); msg_print(NULL); @@ -1719,15 +1688,6 @@ bool bldg_process_command(store_type *s_ptr, int i) break; } -#if 0 - case BACT_GREET_KING: - { - castle_greet(); - break; - } - -#endif - case BACT_QUEST1: case BACT_QUEST2: case BACT_QUEST3: @@ -1810,16 +1770,6 @@ bool bldg_process_command(store_type *s_ptr, int i) break; } -#if 0 - - case BACT_GREET: - { - greet_char(); - break; - } - -#endif - case BACT_ENCHANT_WEAPON: { paid = fix_item(INVEN_WIELD, INVEN_WIELD, 0, FALSE, @@ -1894,24 +1844,6 @@ bool bldg_process_command(store_type *s_ptr, int i) break; } - /* set timed reward flag */ - case BACT_GOLD: - { -#if 0 - if (!p_ptr->rewards[BACT_GOLD]) - { - share_gold(); - p_ptr->rewards[BACT_GOLD] = TRUE; - } - else - { - msg_print("You just had your daily allowance!"); - msg_print(NULL); - } -#endif - break; - } - case BACT_ENCHANT_ARROWS: { paid = fix_item(0, INVEN_WIELD, TV_ARROW, FALSE, diff --git a/src/cave.c b/src/cave.c index 1c229780..74e40fe0 100644 --- a/src/cave.c +++ b/src/cave.c @@ -4927,29 +4927,6 @@ void mmove2(int *y, int *x, int y1, int x1, int y2, int x2) /* Move mostly vertically */ if (dy > dx) { - -#if 0 - - int k; - - /* Starting shift factor */ - shift = dy >> 1; - - /* Extract a shift factor */ - for (k = 0; k < dist; k++) - { - if (shift <= 0) shift += dy; - shift -= dx; - } - - /* Sometimes move along minor axis */ - if (shift <= 0) (*x) = (x2 < x1) ? (*x - 1) : (*x + 1); - - /* Always move along major axis */ - (*y) = (y2 < y1) ? (*y - 1) : (*y + 1); - -#endif - /* Extract a shift factor */ shift = (dist * dx + (dy - 1) / 2) / dy; @@ -4963,29 +4940,6 @@ void mmove2(int *y, int *x, int y1, int x1, int y2, int x2) /* Move mostly horizontally */ else { - -#if 0 - - int k; - - /* Starting shift factor */ - shift = dx >> 1; - - /* Extract a shift factor */ - for (k = 0; k < dist; k++) - { - if (shift <= 0) shift += dx; - shift -= dy; - } - - /* Sometimes move along minor axis */ - if (shift <= 0) (*y) = (y2 < y1) ? (*y - 1) : (*y + 1); - - /* Always move along major axis */ - (*x) = (x2 < x1) ? (*x - 1) : (*x + 1); - -#endif - /* Extract a shift factor */ shift = (dist * dy + (dx - 1) / 2) / dx; diff --git a/src/cmd1.c b/src/cmd1.c index 12a30f48..4be7814b 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -713,109 +713,6 @@ void touch_zap_player(monster_type *m_ptr) } } -#if 0 /* not used, eliminates a compiler warning */ -static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath) -{ - int k, bonus, chance; - - int n_weight = 0; - bool done_crit; - - monster_type *m_ptr = &m_list[m_idx]; - - char m_name[80]; - - int dss, ddd; - - char *atk_desc; - - - switch (attack) - { - default: - { - dss = ddd = n_weight = 1; - atk_desc = "undefined body part"; - - break; - } - } - - /* Extract monster name (or "it") */ - monster_desc(m_name, m_ptr, 0); - - - /* Calculate the "attack quality" */ - bonus = p_ptr->to_h; - chance = (p_ptr->skill_thn + (bonus * BTH_PLUS_ADJ)); - - /* Test for hit */ - if (test_hit_norm(chance, m_ptr->ac, m_ptr->ml)) - { - /* Sound */ - sound(SOUND_HIT); - - msg_format("You hit %s with your %s.", m_name, atk_desc); - - k = damroll(ddd, dss); - k = critical_norm(n_weight, p_ptr->to_h, k, -1, &done_crit); - - /* Apply the player damage bonuses */ - k += p_ptr->to_d; - - /* No negative damage */ - if (k < 0) k = 0; - - /* Complex message */ - if (wizard) - { - msg_format("You do %d (out of %d) damage.", k, m_ptr->hp); - } - - switch (is_friend(m_ptr)) - { - case 1: - { - msg_format("%^s gets angry!", m_name); - change_side(m_ptr); - - break; - } - - case 0: - { - msg_format("%^s gets angry!", m_name); - m_ptr->status = MSTATUS_NEUTRAL_M; - - break; - } - } - - /* Damage, check for fear and mdeath */ - switch (attack) - { - default: - { - *mdeath = mon_take_hit(m_idx, k, fear, NULL); - break; - } - } - - touch_zap_player(m_ptr); - } - - /* Player misses */ - else - { - /* Sound */ - sound(SOUND_MISS); - - /* Message */ - msg_format("You miss %s.", m_name); - } -} - -#endif /* * Carried monster can attack too. @@ -911,13 +808,6 @@ static void carried_monster_attack(s16b m_idx, bool *fear, bool *mdeath, /* Extract visibility (before blink) */ visible = TRUE; -#if 0 - - /* Extract visibility from carrying lite */ - if (r_ptr->flags9 & RF9_HAS_LITE) visible = TRUE; - -#endif /* 0 */ - /* Extract the attack "power" */ switch (effect) { @@ -1554,13 +1444,6 @@ static void incarnate_monster_attack(s16b m_idx, bool *fear, bool *mdeath, /* Extract visibility (before blink) */ visible = TRUE; -#if 0 - - /* Extract visibility from carrying lite */ - if (r_ptr->flags9 & RF9_HAS_LITE) visible = TRUE; - -#endif /* 0 */ - /* Extract the attack "power" */ switch (effect) { @@ -3794,31 +3677,6 @@ void move_player_aux(int dir, int do_pickup, int run, bool disarm) command_new = '_'; } -#if 0 /* These are noxious -- pelpel */ - - /* Handle quest areas -KMW- */ - else if (cave[y][x].feat == FEAT_QUEST_ENTER) - { - /* Disturb */ - disturb(0, 0); - - /* Hack -- Enter quest level */ - command_new = '['; - } - - else if (cave[y][x].feat == FEAT_QUEST_EXIT) - { - leaving_quest = p_ptr->inside_quest; - - p_ptr->inside_quest = cave[y][x].special; - dun_level = 0; - p_ptr->oldpx = 0; - p_ptr->oldpy = 0; - p_ptr->leaving = TRUE; - } - -#endif /* 0 */ - else if (cave[y][x].feat >= FEAT_ALTAR_HEAD && cave[y][x].feat <= FEAT_ALTAR_TAIL) { diff --git a/src/cmd2.c b/src/cmd2.c index 532245d6..eeed812c 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -193,17 +193,7 @@ void do_cmd_go_up(void) if (go_up || go_up_many) { -#if 0 - /* - * I'm experimenting without this... otherwise the monsters get to - * act first when we go up stairs, theoretically resulting in a possible - * insta-death. - */ - /* Hack -- take a turn */ - energy_use = 100; -#else -energy_use = 0; -#endif + energy_use = 0; /* Success */ if (c_ptr->feat == FEAT_WAY_LESS) @@ -266,15 +256,6 @@ static bool between_effect(void) if (cave[p_ptr->py][p_ptr->px].feat == FEAT_BETWEEN) { -#if 0 /* The Between is out of the space-time continuum anyway */ - - if (p_ptr->resist_continuum) - { - msg_print("The space-time continuum can't be disrupted."); - return (TRUE); - } - -#endif bx = cave[p_ptr->py][p_ptr->px].special & 255; by = cave[p_ptr->py][p_ptr->px].special >> 8; @@ -445,13 +426,7 @@ void do_cmd_go_down(void) if (go_down || go_down_many) { - -#if 0 - /* Hack -- take a turn */ - energy_use = 100; -#else energy_use = 0; -#endif if (fall_trap) msg_print("You deliberately jump through the trap door."); @@ -2536,15 +2511,6 @@ void do_cmd_alter(void) py_attack(y, x, -1); } -#if 0 - /* Bash jammed doors */ - else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x08) && - (c_ptr->feat <= FEAT_DOOR_TAIL)) - { - /* Tunnel */ - more = do_cmd_bash_aux(y, x, dir); - } -#endif /* Open closed doors */ else if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_DOOR_TAIL)) @@ -3151,29 +3117,6 @@ void do_cmd_fire(void) return; } -#if 0 /* Old code without the quiver slot */ - - /* Require proper missile */ - item_tester_tval = p_ptr->tval_ammo; - - /* Get an item */ - q = "Fire which item? "; - s = "You have nothing to fire."; - if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return; - - - /* Access the item (if in the pack) */ - if (item >= 0) - { - o_ptr = &p_ptr->inventory[item]; - } - else - { - o_ptr = &o_list[0 - item]; - } - -#else /* New code with the quiver slot */ - /* Get the "ammo" (if any) */ o_ptr = &p_ptr->inventory[INVEN_AMMO]; @@ -3202,7 +3145,6 @@ void do_cmd_fire(void) } } -#endif /* Get a direction (or cancel) */ if (!get_aim_dir(&dir)) return; @@ -4323,17 +4265,6 @@ void do_cmd_unwalk() if (!get_rep_dir(&dir)) return; -#if 0 /* No more, but there are penalities */ - - /* A mold can't blink in small scale mode */ - if (p_ptr->wild_mode) - { - msg_print("You cannot move in the overview display."); - return; - } - -#endif - y = p_ptr->py + ddy[dir]; x = p_ptr->px + ddx[dir]; diff --git a/src/cmd3.c b/src/cmd3.c index 120d72f4..9c2b7aad 100644 --- a/src/cmd3.c +++ b/src/cmd3.c @@ -734,22 +734,6 @@ void do_cmd_destroy(void) automatizer_add_rule(o_ptr, TRUE); } -#if 0 /* DGDGDGDG -- use a skill */ - if (cp_ptr->magic_key == MKEY_TELEKINESIS) - { - /* Good merchants don't break anything... */ - s32b value = object_value_real(o_ptr); - - if (value < 0) value = -value; - - /* ... otherwise they lose some experience */ - value = value * amt / 10; - if (value == 0) value = 1; - - lose_exp(value); - msg_print("Good merchants should not break anything..."); - } -#endif /* * Hack -- If rods or wand are destroyed, the total maximum timeout or * charges of the stack needs to be reduced, unless all the items are @@ -2143,12 +2127,6 @@ void set_portable_hole_weight(void) { s32b weight, i, j; - - /* Portable holes can be used only by merchants */ -#if 0 /* DGDGDGDG -- use a skill */ - if (cp_ptr->magic_key == MKEY_TELEKINESIS) return; -#endif - /* Calculate the weight of items in home */ weight = portable_hole_weight(); @@ -2201,12 +2179,6 @@ void do_cmd_portable_hole(void) int feat, special, town_num; - - /* Portable holes can be used only by merchants */ -#if 0 /* DGDGDGDG -- use a skill */ - if (cp_ptr->magic_key != MKEY_TELEKINESIS) return; -#endif - /* Is it currently wielded? */ if (!p_ptr->inventory[INVEN_TOOL].k_idx || (p_ptr->inventory[INVEN_TOOL].tval != TV_TOOL) || diff --git a/src/cmd4.c b/src/cmd4.c index 6575b162..21464caf 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -1346,17 +1346,6 @@ void do_cmd_options(void) break; } -#if 0 /* DGDGDG -- has if anyone used those */ - /* Stacking Options */ - case 'S': - case 's': - { - /* Spawn */ - do_cmd_options_aux(7, "Stacking Options", FALSE); - - break; - } -#endif /* Cheating Options */ case 'C': { diff --git a/src/cmd6.c b/src/cmd6.c index 5511f6db..72c57f77 100644 --- a/src/cmd6.c +++ b/src/cmd6.c @@ -2381,9 +2381,6 @@ static bool quaff_potion(int tval, int sval, int pval, int pval2) case SV_POTION_NEW_LIFE: { do_cmd_rerate(); -#if 0 /* DGDGDGDG -- No, losing corruption should be near impossible, maybe a quest to do it once but thats it */ - lose_all_corruptions(); -#endif ident = TRUE; break; @@ -6370,11 +6367,7 @@ const char *activation_aux(object_type * o_ptr, bool doit, int item) case ACT_TERROR: { if (!doit) return "terror every 3 * (level+10) turns"; -#if 0 - for (i = 0; i < 8; i++) fear_monster(ddd[i], (p_ptr->lev) + 10); -#else -turn_monsters(40 + p_ptr->lev); -#endif + turn_monsters(40 + p_ptr->lev); o_ptr->timeout = 3 * (p_ptr->lev + 10); @@ -7418,10 +7411,7 @@ turn_monsters(40 + p_ptr->lev); case ACT_CURE_MUT: { -#if 0 // DGDGDGD -#else msg_print("Ahah, you wish."); -#endif /* Timeout is set before return */ break; diff --git a/src/cmd7.c b/src/cmd7.c index ed2d8293..a18616b2 100644 --- a/src/cmd7.c +++ b/src/cmd7.c @@ -3919,9 +3919,6 @@ void do_cmd_alchemist(void) if (o_ptr->tval == TV_POTION && o_ptr->sval == SV_POTION_DETONATIONS) { basechance /= 10; -#if 0 /* Let's see how it works */ - o_ptr->discount = 100; -#endif } } @@ -4893,82 +4890,6 @@ void do_cmd_powermage(void) } - -#if 0 - -/* - * Incremental sleep spell -KMW- - */ -static void do_sleep_monster(void) -{ - int dir; - - if (p_ptr->lev < 15) - { - if (!get_aim_dir(&dir)) return; - sleep_monster(dir); - } - else if (p_ptr->lev < 30) - { - sleep_monsters_touch(); - } - else - { - sleep_monsters(); - } -} - -#endif /* 0 */ - - -#if 0 - -/* - * Multiple Monster Fear -KMW- - */ -static bool fear_monsters(void) -{ - return (project_hack(GF_TURN_ALL, p_ptr->lev)); -} - - -/* - * Close to Player Monster Fear -KMW- - */ -static bool fear_monsters_touch(void) -{ - int flg = PROJECT_KILL | PROJECT_HIDE; - - return (project(0, 1, p_ptr->py, p_ptr->px, p_ptr->lev, - GF_TURN_ALL, flg)); -} - - -/* - * Incremental fear spell -KMW- - */ -static void do_fear_monster(void) -{ - int dir; - - if (p_ptr->lev < 15) - { - if (!get_aim_dir(&dir)) return; - fear_monster(dir, p_ptr->lev); - } - else if (p_ptr->lev < 30) - { - fear_monsters_touch(); - } - else - { - fear_monsters(); - } -} - -#endif /* 0 */ - - /* * Brand some ammunition. Used by Cubragol and a mage spell. The spell was * moved here from cmd6.c where it used to be for Cubragol only. I've also diff --git a/src/defines.h b/src/defines.h index e434e461..fa1eedeb 100644 --- a/src/defines.h +++ b/src/defines.h @@ -4005,7 +4005,6 @@ extern int PlayerUID; #define BACT_GREET_KING 4 #define BACT_KING_LEGENDS 5 #define BACT_QUEST1 6 -#define BACT_GOLD 7 #define BACT_POSTER 8 #define BACT_ARENA_RULES 9 #define BACT_ARENA 10 diff --git a/src/dungeon.c b/src/dungeon.c index 26c27c78..daff7499 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1027,129 +1027,6 @@ void apply_effect(int y, int x) } -#if 0 -/* - * Activate corruptions' effects on player - * - * All the rolls against arbitrarily chosen numbers are normalised - * (i.e. zero). They might have some cabalistic(?) significance, - * but I seriously doubt if processors take care of the Judeo-Christian - * tradition :) -- pelpel - */ -static void process_corruption_effects(void) -{} - -#endif - - - -#ifdef pelpel - -/* - * Handle staying spell effects once every 10 game turns - */ -static void process_effects(void) -{ - int i, j; - - /* Every 10 game turns */ - if (turn % 10) return; - - /* Not in the small-scale wilderness map */ - if (p_ptr->wild_mode) return; - - - /* Handle spell effects */ - for (j = 0; j < cur_hgt - 1; j++) - { - for (i = 0; i < cur_wid - 1; i++) - { - int e = cave[j][i].effect; - - if (e) - { - effect_type *e_ptr = &effects[e]; - - if (e_ptr->time) - { - /* Apply damage */ - project(0, 0, j, i, e_ptr->dam, e_ptr->type, - PROJECT_KILL | PROJECT_ITEM | PROJECT_HIDE); - } - else - { - cave[j][i].effect = 0; - } - - /* Hack -- notice death */ - if (!alive || death) return; - - if (((e_ptr->flags & EFF_WAVE) && !(e_ptr->flags & EFF_LAST)) || ((e_ptr->flags & EFF_STORM) && !(e_ptr->flags & EFF_LAST))) - { - if (distance(e_ptr->cy, e_ptr->cx, j, i) < e_ptr->rad - 1) - cave[j][i].effect = 0; - } - } - } - } - - - /* Reduce & handle effects */ - for (i = 0; i < MAX_EFFECTS; i++) - { - /* Skip empty slots */ - if (effects[i].time == 0) continue; - - /* Reduce duration */ - effects[i].time--; - - /* Creates a "wave" effect*/ - if (effects[i].flags & EFF_WAVE) - { - effect_type *e_ptr = &effects[i]; - int x, y; - - e_ptr->rad++; - for (y = e_ptr->cy - e_ptr->rad; y <= e_ptr->cy + e_ptr->rad; y++) - { - for (x = e_ptr->cx - e_ptr->rad; x <= e_ptr->cx + e_ptr->rad; x++) - { - if (!in_bounds(y, x)) continue; - - if (los(e_ptr->cy, e_ptr->cx, y, x) && - (distance(e_ptr->cy, e_ptr->cx, y, x) == e_ptr->rad)) - cave[y][x].effect = i; - } - } - } - /* Creates a "storm" effect*/ - else if (effects[i].flags & EFF_STORM) - { - effect_type *e_ptr = &effects[i]; - int x, y; - - e_ptr->cy = p_ptr->py; - e_ptr->cx = p_ptr->px; - for (y = e_ptr->cy - e_ptr->rad; y <= e_ptr->cy + e_ptr->rad; y++) - { - for (x = e_ptr->cx - e_ptr->rad; x <= e_ptr->cx + e_ptr->rad; x++) - { - if (!in_bounds(y, x)) continue; - - if (los(e_ptr->cy, e_ptr->cx, y, x) && - (distance(e_ptr->cy, e_ptr->cx, y, x) == e_ptr->rad)) - cave[y][x].effect = i; - } - } - } - } - - /* Apply sustained effect in the player grid, if any */ - apply_effect(p_ptr->py, p_ptr->px); -} - -#endif /* pelpel */ - /* XXX XXX XXX */ bool is_recall = FALSE; @@ -2482,8 +2359,6 @@ static void process_world(void) } } -#ifndef pelpel - /* handle spell effects */ if (!p_ptr->wild_mode) { @@ -2691,8 +2566,6 @@ static void process_world(void) apply_effect(p_ptr->py, p_ptr->px); } -#endif /* !pelpel */ - /* Arg cannot breath? */ if ((dungeon_flags2 & DF2_WATER_BREATH) && (!p_ptr->water_breath)) { @@ -3658,18 +3531,6 @@ static void process_command(void) break; } -#if 0 /* Merged with the '>' command -- pelpel */ - - /* Enter quest level -KMW- */ - case '[': - { - if (p_ptr->control) break; - if (!p_ptr->wild_mode) do_cmd_quest(); - break; - } - -#endif /* 0 */ - /* Go up staircase */ case '<': { @@ -5276,35 +5137,6 @@ static void dungeon(void) if (!alive || death) break; -#ifdef pelpel - - /* Process spell effects */ - process_effects(); - - /* Notice stuff */ - if (p_ptr->notice) notice_stuff(); - - /* Update stuff */ - if (p_ptr->update) update_stuff(); - - /* Redraw stuff */ - if (p_ptr->redraw) redraw_stuff(); - - /* Redraw stuff */ - if (p_ptr->window) window_stuff(); - - /* Hack -- Hilite the player */ - move_cursor_relative(p_ptr->py, p_ptr->px); - - /* Optional fresh */ - if (fresh_after) Term_fresh(); - - /* Hack -- Notice death or departure */ - if (!alive || death) break; - -#endif /* pelpel */ - - total_friends = 0; total_friend_levels = 0; diff --git a/src/externs.h b/src/externs.h index 4022dace..2460f2eb 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1884,7 +1884,6 @@ extern s16b get_melee_skills(void); extern s16b get_melee_skill(void); extern bool forbid_gloves(void); extern bool forbid_non_blessed(void); -extern int validate_autoskiller(s32b *ideal); extern void compute_skills(s32b *v, s32b *m, int i); extern void select_default_melee(void); extern void do_get_new_skill(void); diff --git a/src/files.c b/src/files.c index 95237b16..9fefcce4 100644 --- a/src/files.c +++ b/src/files.c @@ -1986,250 +1986,6 @@ void player_flags(u32b *f1, u32b *f2, u32b *f3, u32b *f4, u32b *f5, u32b *esp) (*esp) |= rmp_ptr->oesp[i]; } } -#if 0 /* DGDGDG? */ - else if (p_ptr->mimic_form) - { - switch (p_ptr->mimic_form) - { - case MIMIC_GOAT: - { - (*f3) |= (TR3_SLOW_DIGEST); - break; - } - case MIMIC_INSECT: - { - (*esp) |= (ESP_ANIMAL); - break; - } - case MIMIC_SPARROW: - { - (*f3) |= (TR3_FEATHER); - break; - } - case MIMIC_VAMPIRE: - { - (*f3) |= (TR2_HOLD_LIFE); - (*f3) |= (TR2_RES_DARK); - (*f3) |= (TR2_RES_NEXUS); - (*f3) |= (TR2_RES_BLIND); - (*f3) |= (TR3_LITE1); - break; - } - case MIMIC_SPIDER: - { - (*f3) |= (TR2_RES_FEAR); - (*f3) |= (TR2_RES_POIS); - break; - } - case MIMIC_MANA_BALL: - { - (*f3) |= (TR3_FEATHER); - (*f2) |= (TR2_INVIS); - (*f3) |= (TR3_TELEPORT); - (*f3) |= (TR2_RES_DISEN); - break; - } - case MIMIC_FIRE_CLOUD: - { - (*f3) |= (TR2_RES_LITE); - (*f3) |= (TR2_IM_FIRE); - (*f3) |= (TR3_SH_FIRE); - break; - } - case MIMIC_COLD_CLOUD: - { - (*f3) |= (TR2_RES_LITE); - (*f3) |= (TR2_IM_COLD); - (*f3) |= (TR3_SH_ELEC); - (*esp) |= (ESP_EVIL); - (*f3) |= (TR3_REGEN); - break; - } - case MIMIC_CHAOS_CLOUD: - { - (*f3) |= (TR2_RES_DISEN); - (*f3) |= (TR2_RES_CHAOS); - (*f3) |= (TR2_RES_LITE); - (*f3) |= (TR2_IM_FIRE); - (*f3) |= (TR2_IM_COLD); - (*f3) |= (TR3_SH_FIRE); - (*f3) |= (TR3_SH_ELEC); - break; - } - case MIMIC_GOST: - { - (*f3) |= (TR3_WRAITH); - (*f2) |= TR2_HOLD_LIFE; - break; - } - case MIMIC_ENT: - { - (*f2) |= TR2_SENS_FIRE; - break; - } - case MIMIC_KOBOLD: - { - (*f2) |= TR2_RES_POIS; - break; - } - case MIMIC_DRAGON: - { - (*f3) |= TR3_FEATHER; - (*f2) |= TR2_RES_FIRE; - (*f2) |= TR2_RES_COLD; - (*f2) |= TR2_RES_ELEC; - (*f2) |= TR2_RES_DARK; - break; - } - case MIMIC_DEMON: - { - (*f2) |= TR2_RES_CHAOS; - (*f2) |= TR2_RES_NETHER; - (*f2) |= TR2_HOLD_LIFE; - break; - } - case MIMIC_HOUND: - { - (*f1) |= TR1_SPEED; - (*f2) |= TR2_RES_LITE; - (*f2) |= TR2_RES_DARK; - break; - } - case MIMIC_QUYLTHULG: - { - (*f3) |= TR3_SEE_INVIS; - break; - } - case MIMIC_MAIAR: - { - (*f2) |= TR2_IM_ACID; - (*f2) |= TR2_IM_ELEC; - (*f2) |= TR2_IM_FIRE; - (*f2) |= TR2_IM_COLD; - (*f2) |= TR2_RES_POIS; - (*f2) |= TR2_RES_LITE; - (*f2) |= TR2_RES_DARK; - (*f2) |= TR2_RES_CHAOS; - (*f2) |= TR2_HOLD_LIFE; - (*f3) |= TR3_FEATHER; - (*f3) |= TR3_REGEN; - break; - } - case MIMIC_SERPENT: - { - (*f1) |= TR1_SPEED; - break; - } - case MIMIC_GIANT: - { - (*f2) |= TR2_RES_ACID; - (*f2) |= TR2_RES_ELEC; - (*f2) |= TR2_RES_FIRE; - (*f2) |= TR2_RES_COLD; - (*f2) |= TR2_RES_POIS; - (*f2) |= TR2_RES_CONF; - (*f2) |= TR2_RES_SOUND; - (*f2) |= TR2_RES_LITE; - (*f2) |= TR2_RES_DARK; - (*f2) |= TR2_RES_NEXUS; - (*f2) |= TR2_RES_FEAR; - (*f2) |= TR2_REFLECT; - break; - } - case MIMIC_VALAR: - { - (*f3) |= TR3_SEE_INVIS; - (*f2) |= TR2_FREE_ACT; - (*f3) |= TR3_SLOW_DIGEST; - (*f3) |= TR3_REGEN; - (*f3) |= TR3_FEATHER; - (*f2) |= TR2_HOLD_LIFE; - (*esp) |= ESP_ALL; - (*f3) |= TR3_LITE1; - (*f2) |= TR2_SUST_STR; - (*f1) |= TR1_INT; - (*f1) |= TR1_WIS; - (*f1) |= TR1_DEX; - (*f1) |= TR1_CON; - (*f1) |= TR1_CHR; - (*f2) |= TR2_RES_ACID; - (*f2) |= TR2_RES_ELEC; - (*f2) |= TR2_RES_FIRE; - (*f2) |= TR2_RES_COLD; - (*f2) |= TR2_RES_POIS; - (*f2) |= TR2_RES_CONF; - (*f2) |= TR2_RES_SOUND; - (*f2) |= TR2_RES_LITE; - (*f2) |= TR2_RES_DARK; - (*f2) |= TR2_RES_CHAOS; - (*f2) |= TR2_RES_DISEN; - (*f2) |= TR2_RES_SHARDS; - (*f2) |= TR2_RES_NEXUS; - (*f2) |= TR2_RES_BLIND; - (*f2) |= TR2_RES_NETHER; - (*f2) |= TR2_RES_FEAR; - (*f2) |= TR2_REFLECT; - (*f3) |= TR3_SH_FIRE; - (*f3) |= TR3_SH_ELEC; - (*f2) |= TR2_IM_FIRE; - (*f2) |= TR2_IM_COLD; - (*f2) |= TR2_IM_ELEC; - (*f2) |= TR2_IM_ACID; - break; - } - - case MIMIC_WEREWOLF: - { - (*f3) |= TR3_REGEN; - (*f3) |= TR3_AGGRAVATE; - break; - } - case MIMIC_BALROG: - { - (*f2) |= TR2_IM_ACID; - (*f2) |= TR2_IM_ELEC; - (*f2) |= TR2_IM_FIRE; - (*f2) |= TR2_RES_POIS; - (*f2) |= TR2_RES_DARK; - (*f2) |= TR2_RES_CHAOS; - (*f2) |= TR2_HOLD_LIFE; - (*f3) |= TR3_FEATHER; - (*f3) |= TR3_REGEN; - break; - } - case MIMIC_DEMON_LORD: - { - (*f3) |= TR3_SEE_INVIS; - (*f2) |= TR2_FREE_ACT; - (*f3) |= TR3_REGEN; - (*f3) |= TR3_FEATHER; - (*f2) |= TR2_HOLD_LIFE; - (*esp) |= ESP_EVIL | ESP_GOOD | ESP_DEMON; - (*f2) |= TR2_RES_ACID; - (*f2) |= TR2_RES_ELEC; - (*f2) |= TR2_RES_FIRE; - (*f2) |= TR2_RES_POIS; - (*f2) |= TR2_RES_CONF; - (*f2) |= TR2_RES_SOUND; - (*f2) |= TR2_RES_LITE; - (*f2) |= TR2_RES_DARK; - (*f2) |= TR2_RES_CHAOS; - (*f2) |= TR2_RES_DISEN; - (*f2) |= TR2_RES_SHARDS; - (*f2) |= TR2_RES_NEXUS; - (*f2) |= TR2_RES_BLIND; - (*f2) |= TR2_RES_NETHER; - (*f2) |= TR2_RES_FEAR; - (*f2) |= TR2_REFLECT; - (*f3) |= TR3_SH_FIRE; - (*f2) |= TR2_IM_FIRE; - (*f2) |= TR2_IM_ELEC; - (*f2) |= TR2_IM_ACID; - break; - } - } - } -#endif else { monster_race *r_ptr = &r_info[p_ptr->body_monster]; @@ -5058,15 +4814,6 @@ void do_cmd_save_game(void) */ long total_points(void) { -#if 0 /* Old calculation */ - s16b max_dl = 0, i; - - for (i = 0; i < max_d_idx; i++) - if (max_dlv[i] > max_dl) - max_dl = max_dlv[i]; - - return (p_ptr->max_exp + (100 * max_dl)); -#else /* New calculation */ s16b max_dl = 0, i, k; long temp, Total = 0; long mult = 20; /* was 100. Divided values by 5 because of an overflow error */ @@ -5170,7 +4917,6 @@ long total_points(void) return (temp); -#endif } @@ -5446,11 +5192,6 @@ static void show_info(void) { st_ptr = &town_info[k].store[7]; -#if 0 /* TODO -- actualy somewhere set the real variable */ - /* Step to the real towns */ - if (!(town_info[k].flags & (TOWN_REAL))) continue; -#endif - /* Home -- if anything there */ if (st_ptr->stock_num) { diff --git a/src/generate.c b/src/generate.c index ca9f58b0..98d3ff92 100644 --- a/src/generate.c +++ b/src/generate.c @@ -6488,36 +6488,6 @@ static bool possible_doorway(int y, int x) } -#if 0 - -/* - * Places door at y, x position if at least 2 walls found - */ -static void try_door(int y, int x) -{ - /* Paranoia */ - if (!in_bounds(y, x)) return; - - /* Some dungeons don't have doors at all */ - if (dungeon_flags1 & (DF1_NO_DOORS)) return; - - /* Ignore walls */ - if (f_info[cave[y][x].feat].flags1 & FF1_WALL) return; - - /* Ignore room grids */ - if (cave[y][x].info & (CAVE_ROOM)) return; - - /* Occasional door (if allowed) */ - if (possible_doorway(y, x) && (rand_int(100) < DUN_TUN_JCT)) - { - /* Place a door */ - place_random_door(y, x); - } -} - -#endif /* 0 */ - - /* * Places doors around y, x position */ diff --git a/src/loadsave.c b/src/loadsave.c index 7230d090..73b2f746 100644 --- a/src/loadsave.c +++ b/src/loadsave.c @@ -1836,14 +1836,6 @@ static void do_item(object_type *o_ptr, int flag) o_ptr->dd = k_ptr->dd; o_ptr->ds = k_ptr->ds; -#if 0 - /* Acquire correct weight */ - if ((o_ptr->tval != TV_CORPSE) && - (o_ptr->tval != TV_EGG)) o_ptr->weight = k_ptr->weight; - - /* Paranoia */ - o_ptr->name1 = o_ptr->name2 = 0; -#endif /* All done */ return; } diff --git a/src/main-gcu.c b/src/main-gcu.c index fa86da80..9583eebc 100644 --- a/src/main-gcu.c +++ b/src/main-gcu.c @@ -397,18 +397,6 @@ static void keymap_game_prepare(void) game_termio.c_cc[VEOF] = (char) - 1; game_termio.c_cc[VEOL] = (char) - 1; -#if 0 - /* Disable the non-posix control characters */ - game_termio.c_cc[VEOL2] = (char) - 1; - game_termio.c_cc[VSWTCH] = (char) - 1; - game_termio.c_cc[VDSUSP] = (char) - 1; - game_termio.c_cc[VREPRINT] = (char) - 1; - game_termio.c_cc[VDISCARD] = (char) - 1; - game_termio.c_cc[VWERASE] = (char) - 1; - game_termio.c_cc[VLNEXT] = (char) - 1; - game_termio.c_cc[VSTATUS] = (char) - 1; -#endif - /* Normally, block until a character is read */ game_termio.c_cc[VMIN] = 1; game_termio.c_cc[VTIME] = 0; @@ -511,17 +499,6 @@ static errr Term_xtra_gcu_alive(int v) } -#if 0 - -#ifdef USE_NCURSES -const char help_gcu[] = "NCurses, for terminal console, subopts -b(ig screen)"; -#else /* USE_NCURSES */ -const char help_gcu[] = "Curses, for terminal console, subopts -b(ig screen)"; -#endif /* USE_NCURSES */ - -#endif - - /* * Init the "curses" system */ diff --git a/src/melee1.c b/src/melee1.c index 9e34c110..5a309fc2 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -177,13 +177,6 @@ bool carried_make_attack_normal(int r_idx) /* Extract visibility (before blink) */ visible = TRUE; -#if 0 - - /* Extract visibility from carrying lite */ - if (r_ptr->flags9 & RF9_HAS_LITE) visible = TRUE; - -#endif /* 0 */ - /* Extract the attack "power" */ switch (effect) { @@ -1447,13 +1440,6 @@ bool make_attack_normal(int m_idx, byte divis) /* Extract visibility (before blink) */ if (m_ptr->ml) visible = TRUE; -#if 0 - - /* Extract visibility from carrying lite */ - if (r_ptr->flags9 & RF9_HAS_LITE) visible = TRUE; - -#endif - /* Extract the attack "power" */ switch (effect) { diff --git a/src/melee2.c b/src/melee2.c index 804b8f12..51e92675 100644 --- a/src/melee2.c +++ b/src/melee2.c @@ -693,11 +693,6 @@ static bool spell_annoy(byte spell) /* Teleport to */ if (spell == 160 + 6) return (TRUE); -#if 0 - /* Hand of Doom */ - if (spell == 160 + 1) return (TRUE); -#endif - /* Darkness, make traps, cause amnesia */ if (spell >= 160 + 9 && spell <= 160 + 11) return (TRUE); @@ -1154,9 +1149,6 @@ static bool monst_spell_monst(int m_idx) if (disturb_other) disturb(1, 0); if (!see_m) monster_msg("You hear a shriek."); else monster_msg("%^s shrieks at %s.", m_name, t_name); -#if 0 - aggravate_monsters(m_idx); -#endif wake_up = TRUE; break; } @@ -2690,14 +2682,6 @@ static bool monst_spell_monst(int m_idx) count += summon_specific(y, x, rlev, SUMMON_WRAITH); } -#if 0 - /* these are not Lords of Amber... */ - for (k = 0; k < 12; k++) - { - count += summon_specific(y, x, rlev, SUMMON_HI_UNDEAD); - } -#endif - if (blind && count) { monster_msg("You hear immortal beings appear nearby."); @@ -4604,14 +4588,6 @@ bool make_attack_spell(int m_idx) count += summon_specific(y, x, rlev, SUMMON_WRAITH); } -#if 0 - /* these are not Lords of Amber... */ - for (k = 0; k < 12; k++) - { - count += summon_specific(y, x, rlev, SUMMON_HI_UNDEAD); - } -#endif - if (blind && count) { msg_print("You hear immortal beings appear nearby."); @@ -6872,12 +6848,6 @@ static void process_monster(int m_idx, bool is_frien) /* Door power */ k = ((c_ptr->feat - FEAT_DOOR_HEAD) & 0x07); -#if 0 - /* XXX XXX XXX Old test (pval 10 to 20) */ - if (randint((m_ptr->hp + 1) * (50 + o_ptr->pval)) < - 40 * (m_ptr->hp - 10 - o_ptr->pval)); -#endif - /* Try to unlock it XXX XXX XXX */ if (rand_int(m_ptr->hp / 10) > k) { @@ -6899,12 +6869,6 @@ static void process_monster(int m_idx, bool is_frien) /* Door power */ k = ((c_ptr->feat - FEAT_DOOR_HEAD) & 0x07); -#if 0 - /* XXX XXX XXX Old test (pval 10 to 20) */ - if (randint((m_ptr->hp + 1) * (50 + o_ptr->pval)) < - 40 * (m_ptr->hp - 10 - o_ptr->pval)); -#endif - /* Attempt to Bash XXX XXX XXX */ if (rand_int(m_ptr->hp / 10) > k) { @@ -7033,11 +6997,6 @@ static void process_monster(int m_idx, bool is_frien) if (do_move && (ny == p_ptr->py) && (nx == p_ptr->px) && (r_ptr->flags1 & RF1_NEVER_BLOW)) { -#if 0 - /* Hack -- memorize lack of attacks */ - if (m_ptr->ml) r_ptr->r_flags1 |= (RF1_NEVER_BLOW); -#endif - /* Do not move */ do_move = FALSE; } diff --git a/src/monster1.c b/src/monster1.c index 7a44ffab..cb8be90b 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -135,23 +135,6 @@ static void roff_aux(int r_idx, int ego, int remem) -#if 0 - - /* Nothing erased */ - roff_old = 0; - - /* Reset the row */ - roff_row = 1; - - /* Reset the pointer */ - roff_p = roff_buf; - - /* No spaces yet */ - roff_s = NULL; - -#endif - - /* Access the race and lore */ r_ptr = race_info_idx(r_idx, ego); diff --git a/src/monster2.c b/src/monster2.c index 4e5b31db..ea75600e 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -1767,19 +1767,6 @@ void update_mon(int m_idx, bool full) } -#if 0 - - /* Process monster light for a monster within MAX_SIGHT + max radius */ - if (m_ptr->cdis <= MAX_SIGHT + 1) - { - if (r_ptr->flags9 & RF9_HAS_LITE) - { - p_ptr->update |= (PU_MON_LITE); - } - } - -#endif - /* Process "distant" monsters */ if (m_ptr->cdis > MAX_SIGHT) { @@ -1870,11 +1857,6 @@ void update_mon(int m_idx, bool full) } } - /* Merchants sense objects */ -#if 0 /* DGDGDGDG -- use a skill */ - if ((cp_ptr->magic_key == MKEY_TELEKINESIS) && (p_ptr->lev >= 20) && - (m_ptr->hold_o_idx)) flag = TRUE; -#endif /* Apply "detection" spells */ if (m_ptr->mflag & (MFLAG_MARK)) flag = TRUE; @@ -2303,26 +2285,8 @@ s16b place_monster_one(int y, int x, int r_idx, int ego, bool slp, int status) return 0; } - /* Anyway that doesn't work .... hum... TO FIX -- DG */ -#if 0 - /* Hack -- non "town" monsters are NEVER generated in town */ - if ((!(r_ptr->flags8 & (RF8_WILD_TOWN))) && (wf_info[wild_map[p_ptr->wilderness_y][p_ptr->wilderness_x].feat].terrain_idx == TERRAIN_TOWN) && !dun_level) - { - /* Cannot create */ - if (place_monster_one_race) KILL(place_monster_one_race, monster_race); - return (0); - } -#endif /* Hack -- "unique" monsters must be "unique" */ -#if 0 - if ((r_ptr->flags1 & (RF1_UNIQUE)) && (r_ptr->cur_num >= r_ptr->max_num) && (!m_allow_special[r_idx])) -#else -#if 0 - if ((r_ptr->flags1 & (RF1_UNIQUE)) && (r_ptr->cur_num >= r_ptr->max_num) && (!m_allow_special[r_idx]) && (r_ptr->max_num != -1)) -#else - if ((r_ptr->flags1 & (RF1_UNIQUE)) && (r_ptr->cur_num >= r_ptr->max_num) && (r_ptr->max_num != -1) && (!bypass_r_ptr_max_num)) -#endif -#endif + if ((r_ptr->flags1 & (RF1_UNIQUE)) && (r_ptr->cur_num >= r_ptr->max_num) && (r_ptr->max_num != -1) && (!bypass_r_ptr_max_num)) { /* Cannot create */ if (wizard) cmsg_format(TERM_L_RED, "WARNING: Refused monster %d: cur_num >= max_num", r_idx); @@ -3826,11 +3790,6 @@ void message_pain(int m_idx, int dam) monster_race *r_ptr = race_inf(m_ptr); char m_name[80]; -#if 0 - if (!(player_can_see_bold(m_ptr->fy, m_ptr->fx))) - return; -#endif - /* Get the monster name */ monster_desc(m_name, m_ptr, 0); diff --git a/src/monster3.c b/src/monster3.c index 81c6c2d0..786c6041 100644 --- a/src/monster3.c +++ b/src/monster3.c @@ -45,10 +45,7 @@ bool is_enemy(monster_type *m_ptr, monster_type *t_ptr) { monster_race *r_ptr = &r_info[m_ptr->r_idx], *rt_ptr = &r_info[t_ptr->r_idx]; int s1 = is_friend(m_ptr), s2 = is_friend(t_ptr); -#if 0 - /* Stupid monsters attacks just about everything */ - if ((r_ptr->flags2 & RF2_STUPID) && (r_ptr->d_char != rt_ptr->d_char)) return TRUE; -#endif + /* Monsters hates breeders */ if ((m_ptr->status != MSTATUS_NEUTRAL) && (rt_ptr->flags4 & RF4_MULTIPLY) && (num_repro > MAX_REPRO * 2 / 3) && (r_ptr->d_char != rt_ptr->d_char)) return TRUE; if ((t_ptr->status != MSTATUS_NEUTRAL) && (r_ptr->flags4 & RF4_MULTIPLY) && (num_repro > MAX_REPRO * 2 / 3) && (r_ptr->d_char != rt_ptr->d_char)) return TRUE; @@ -67,11 +64,6 @@ bool change_side(monster_type *m_ptr) /* neutrals and companions */ switch (m_ptr->status) { -#if 0 - case MSTATUS_ENEMY: - m_ptr->status = MSTATUS_FRIEND; - break; -#endif case MSTATUS_FRIEND: m_ptr->status = MSTATUS_ENEMY; if ((r_ptr->flags3 & RF3_ANIMAL) && (!(r_ptr->flags3 & RF3_EVIL))) diff --git a/src/object2.c b/src/object2.c index b4750a3a..2775e56b 100644 --- a/src/object2.c +++ b/src/object2.c @@ -12,58 +12,6 @@ #include "angband.h" -/* - * adds n flags to o_ptr chosen randomly from the masks f1..f4 - */ -#if 0 -static void enhance_random(object_type *o_ptr, int n, u32b f1, u32b f2, u32b f3, u32b f4) -{ - int counter = 0, null_mask; - u32b *f, *t, x; - - while (n) - { - /* inefficient, but simple */ - x = BIT(rand_int(32)); - switch (randint(4)) - { - case 1: - null_mask = TR1_NULL_MASK; - f = &f1; - t = &o_ptr->art_flags1; - break; - case 2: - null_mask = TR2_NULL_MASK; - f = &f2; - t = &o_ptr->art_flags2; - break; - case 3: - null_mask = TR3_NULL_MASK; - f = &f3; - t = &o_ptr->art_flags3; - break; - case 4: - null_mask = TR4_NULL_MASK; - f = &f4; - t = &o_ptr->art_flags4; - break; - default: - null_mask = 0; - f = t = NULL; - return; - } - if (++counter > 10000) break; - if (x & null_mask) continue; - if (!(x & *f)) continue; - if (x & *t) continue; - /* success */ - *f &= ~x; - *t |= x; - n--; - } -} -#endif - /* * Calculate the player's total inventory weight. */ @@ -1283,10 +1231,6 @@ s32b object_value_real(object_type *o_ptr) case TV_TRAPKIT: case TV_INSTRUMENT: { -#if 0 /* DG - no */ - /* Hack -- Negative "pval" is always bad */ - if (o_ptr->pval < 0) return (0L); -#endif /* No pval */ if (!o_ptr->pval) break; @@ -1806,15 +1750,6 @@ bool object_similar(object_type *o_ptr, object_type *j_ptr) /* Require identical "artifact" names */ if (o_ptr->name1 != j_ptr->name1) return (FALSE); - /* Random artifacts never stack */ - /* - I don't see why these shouldn't stack. - -- wilh - */ -#if 0 - if (o_ptr->art_name || j_ptr->art_name) return (FALSE); -#endif - /* Require identical "ego-item" names */ if (o_ptr->name2 != j_ptr->name2) return (FALSE); @@ -3540,14 +3475,6 @@ static void a_m_aux_4(object_type *o_ptr, int level, int power) case TV_TOOL: { - /* Hack - set the weight of portable holes */ -#if 0 /* DGDGDGDG -- use a skill */ - if ((o_ptr->sval == SV_PORTABLE_HOLE) && - (cp_ptr->magic_key == MKEY_TELEKINESIS)) - { - o_ptr->weight = portable_hole_weight(); - } -#endif break; } @@ -4245,15 +4172,7 @@ void apply_magic(object_type *o_ptr, int lev, bool okay, bool good, bool great) case TV_GLOVES: case TV_BOOTS: { -#if 0 - if (power || - ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) || - ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) || - ((o_ptr->tval == TV_CLOAK) && (o_ptr->sval == SV_ELVEN_CLOAK))) - a_m_aux_2(o_ptr, lev, power); -#else a_m_aux_2(o_ptr, lev, power); -#endif break; } diff --git a/src/randart.c b/src/randart.c index de1af12f..b44fdd6c 100644 --- a/src/randart.c +++ b/src/randart.c @@ -116,19 +116,9 @@ static bool grab_one_power(int *ra_idx, object_type *o_ptr, bool good, s16b *max void give_activation_power (object_type * o_ptr) { - /* int type = 0, chance = 0; */ - - - /* A type was chosen... */ -#if 0 /* DGDGDGDG -- Todo later */ - o_ptr->xtra2 = type; - o_ptr->art_flags3 |= TR3_ACTIVATE; - o_ptr->timeout = 0; -#else o_ptr->xtra2 = 0; o_ptr->art_flags3 &= ~TR3_ACTIVATE; o_ptr->timeout = 0; -#endif } diff --git a/src/script.c b/src/script.c index 44bb935a..4070e666 100644 --- a/src/script.c +++ b/src/script.c @@ -70,45 +70,6 @@ static struct luaL_reg tome_iolib[] = #define luaL_check_bit(L, n) ((long)luaL_check_number(L, n)) #define luaL_check_ubit(L, n) ((unsigned long)luaL_check_bit(L, n)) -#if 0 - -/* - * Nuked because they can confuse some compilers (lcc for example), - * and because of their obscurity -- pelpel - */ - -#define TDYADIC(name, op, t1, t2) \ -static int int_ ## name(lua_State* L) { \ -lua_pushnumber(L, \ -luaL_check_ ## t1 ## bit(L, 1) op luaL_check_ ## t2 ## bit(L, 2)); \ -return 1; \ -} - -#define DYADIC(name, op) \ -static int int_ ## name(lua_State* L) { \ -lua_pushnumber(L, \ -luaL_check_bit(L, 1) op luaL_check_bit(L, 2)); \ -return 1; \ -} - -#define MONADIC(name, op) \ -static int int_ ## name(lua_State* L) { \ -lua_pushnumber(L, op luaL_check_bit(L, 1)); \ -return 1; \ -} - -#define VARIADIC(name, op) \ -static int int_ ## name(lua_State *L) { \ -int n = lua_gettop(L), i; \ -long w = luaL_check_bit(L, 1); \ -for (i = 2; i <= n; i++) \ -w op ## = luaL_check_bit(L, i); \ -lua_pushnumber(L, w); \ -return 1; \ -} - -#endif - /* * Monadic bit negation operation diff --git a/src/skills.c b/src/skills.c index 5eb653b0..0272800a 100644 --- a/src/skills.c +++ b/src/skills.c @@ -1073,138 +1073,6 @@ bool forbid_non_blessed() } - - -/* - * The autoskiller gets fed with the desired skill values at level 50 and determines - * where to invest each levels - */ - -/* Checks if a given autoskill chart is realisable */ -int validate_autoskiller(s32b *ideal) -{ - int i; - s32b count = 0; - - for (i = 0; i < max_s_idx; i++) - { - s32b z, c; - - skill_type *s_ptr = &s_info[i]; - - if (!ideal[i]) continue; - - /* How much */ - z = (ideal[i] * SKILL_STEP) - s_ptr->value; - - /* How many points will we need to get there ? */ - if (s_ptr->mod) - c = z / s_ptr->mod; - else - c = 99999; - count += c; - } - /* DGDGDGDG: I dont work, fix me */ - /* return (SKILL_NB_BASE * 49) - count;*/ - return 0; -} - -void autoskiller_level(s32b *ideal) -{ -#if 0 - /* DGDGDGDG */ - int chart[196]; - int final[196]; - int ideal[3] = {50, 30, 25}; - int real[3] = {0, 0, 0}; - int mod[3] = {450, 1000, 1100}; - float pl[3], left[3] = {0, 0, 0}, finalization = 1; - int c[3], z; - int i, max = 0, ok = 3, a; - - for (i = 0; i < 3; i++) - { - c[i] = (ideal[i] * 1000) / mod[i]; - printf("point need c[%d] = %d\n", i, c[i]); - max += c[i]; - - pl[i] = (float)c[i] / 50.0; - printf("pl[%d] = %f\n", i, pl[i]); - } - printf("skill balance %d\n", 196 - max); - - for (i = 0; i < 196; i++) - { - chart[i] = -1; - } - - a = 0; - while ((a < 196) && (ok)) - { - int z = 0; - - for (z = 0; z < 3; z++) - { - int tmp, ii; - - if (real[z] == c[z]) - continue; - left[z] += pl[z]; - tmp = left[z]; - left[z] -= tmp; - printf("skill %02d: left %f tmp %d\n", z, left[z], tmp); - - while (tmp >= 1) - { - chart[a++] = z; - real[z]++; - tmp--; - if (real[z] == c[z]) - { - ok--; - break; - } - if (a == 196) - { - ok = 0; - break; - } - } - if (!ok) break; - } - } - printf("ok %d, a %d interval %f\n", ok, a, (float)a / 196); - real[0] = real[1] = real[2] = 0; - for (i = 0; i < 196; i++) - { - real[chart[i]]++; - } - z = 0; - i = 0; - while (z < a) - { - if (finalization > 1) - { - final[i] = chart[z++]; - finalization--; - } - else - final[i] = -1; - finalization += ((float)a / 196); - i++; - } - for (z = 0; z < 3; z++) - { - printf("skill %d real %d ideal %d\n", z, real[z], c[z]); - } - - for (i = 2; i <= 50; i++) - { - printf("level %02d, skills %02d %02d %02d %02d\n", i, final[i * 4], final[i * 4 + 1], final[i * 4 + 2], final[i * 4 + 3]); - } -#endif -} - /* * Gets the base value of a skill, given a race/class/... */ @@ -1675,11 +1543,7 @@ void do_cmd_ability() /* Initialise the abilities list */ for (i = 0; i < max_ab_idx; i++) { -#if 0 /* Only show learnable */ - if (ab_info[i].name && ((can_learn_ability(i) || has_ability(i)) || wizard)) -#else /* Show all */ if (ab_info[i].name) -#endif add_sorted_ability(table, &max, i); } diff --git a/src/spells1.c b/src/spells1.c index 58b102cf..387bf379 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -33,12 +33,6 @@ s16b poly_r_idx(int r_idx) int i, r; -#if 0 /* No more -- hehehe -- DG */ - /* Allowable range of "levels" for resulting monster */ - int lev1 = r_ptr->level - ((randint(20) / randint(9)) + 1); - int lev2 = r_ptr->level + ((randint(20) / randint(9)) + 1); -#endif - /* Hack -- Uniques never polymorph */ if (r_ptr->flags1 & RF1_UNIQUE) return (r_idx); @@ -58,11 +52,6 @@ s16b poly_r_idx(int r_idx) /* Ignore unique monsters */ if (r_ptr->flags1 & (RF1_UNIQUE)) continue; -#if 0 - /* Ignore monsters with incompatible levels */ - if ((r_ptr->level < lev1) || (r_ptr->level > lev2)) continue; -#endif - /* Use that index */ r_idx = r; @@ -945,14 +934,6 @@ void teleport_player_level(void) */ void recall_player(int d, int f) { -#if 0 - if (!p_ptr->town_num) - { - /* TODO: Recall the player to the last visited town */ - msg_print("Nothing happens."); - return; - } -#endif /* Rooted means no move */ if (p_ptr->tim_roots) { @@ -4413,14 +4394,6 @@ bool project_m(int who, int r, int y, int x, int dam, int typ) cptr note_dies = " dies."; -#if 0 - - /* Walls protect monsters */ - /* (No, they don't) */ - if (!cave_floor_bold(y, x)) return (FALSE); - -#endif - /* Nobody here */ if (!c_ptr->m_idx) return (FALSE); @@ -5632,9 +5605,6 @@ bool project_m(int who, int r, int y, int x, int dam, int typ) /* Death Ray */ case GF_DEATH_RAY: { -#if 0 - dam = 0; -#endif if (seen) obvious = TRUE; if ((r_ptr->flags3 & (RF3_UNDEAD)) || (r_ptr->flags3 & (RF3_NONLIVING))) @@ -5938,15 +5908,6 @@ bool project_m(int who, int r, int y, int x, int dam, int typ) (!(r_ptr->flags3 & RF3_UNDEAD)) || (m_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10)) { - -#if 0 - /* Memorize a flag */ - if (r_ptr->flags3 & (RF3_NO_CONF)) - { - if (seen) r_ptr->r_flags3 |= (RF3_NO_CONF); - } -#endif - /* Resist */ /* No obvious effect */ note = " is unaffected!"; @@ -7419,33 +7380,14 @@ static bool project_p(int who, int r, int y, int x, int dam, int typ, int a_rad) /* Holy Orb -- Player only takes partial damage */ case GF_HOLY_FIRE: { -#if 0 /* DGDGDGDGD */ - int diff = get_skill(SKILL_VALARIN) - get_skill(SKILL_NETHER); -#else - int diff = 0; -#endif if (fuzzy) msg_print("You are hit by something!"); - if (diff > 0) - dam /= 2; - else if (diff < 0) - dam *= 2; take_hit(dam, killer); break; } case GF_HELL_FIRE: { -#if 0 /* DGDGDGDGD */ - int diff = get_skill(SKILL_VALARIN) - get_skill(SKILL_NETHER); -#else - int diff = 0; -#endif - if (fuzzy) msg_print("You are hit by something!"); - if (diff < 0) - dam /= 2; - else if (diff > 0) - dam *= 2; take_hit(dam, killer); break; } diff --git a/src/spells2.c b/src/spells2.c index 2e409713..d902bf1d 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -813,15 +813,6 @@ void self_knowledge(FILE *fff) if (r_ptr->flags2 & RF2_MOVE_BODY) info[i++] = "You can move monsters."; /* Not implemented */ -#if 0 - /* They are disabled, because the r_info.txt array has to - * few RF2_TAKE_ITEM flags... */ - if (r_ptr->flags2 & RF2_TAKE_ITEM) - info[i++] = "You can pick up items."; - else - info[i++] = "You cannot pick up items."; -#endif - /* Not implemented */ if (r_ptr->flags3 & RF3_ORC) info[i++] = "You have orc blood in your veins."; /* Not implemented */ @@ -3222,9 +3213,6 @@ void curse_artifact(object_type * o_ptr) if (o_ptr->to_h) o_ptr->to_h = 0 - ((o_ptr->to_h) + randint(4)); if (o_ptr->to_d) o_ptr->to_d = 0 - ((o_ptr->to_d) + randint(4)); o_ptr->art_flags3 |= ( TR3_HEAVY_CURSE | TR3_CURSED ); -#if 0 /* Silly */ - if (randint(4) == 1) o_ptr-> art_flags3 |= TR3_PERMA_CURSE; -#endif if (randint(3) == 1) o_ptr-> art_flags3 |= TR3_TY_CURSE; if (randint(2) == 1) o_ptr-> art_flags3 |= TR3_AGGRAVATE; if (randint(3) == 1) o_ptr-> art_flags3 |= TR3_DRAIN_EXP; @@ -7095,11 +7083,6 @@ void call_chaos(void) Chaos_type = hurt_types[randint(30) - 1]; if (randint(4) == 1) line_chaos = TRUE; -#if 0 - /* Probably a meaningless line, a remnant from earlier code */ - while (Chaos_type > GF_GRAVITY && Chaos_type < GF_ROCKET); -#endif - if (randint(6) == 1) { for (dummy = 1; dummy < 10; dummy++) diff --git a/src/store.c b/src/store.c index 2ac73753..c35a33a2 100644 --- a/src/store.c +++ b/src/store.c @@ -392,11 +392,6 @@ static s32b price_item(object_type *o_ptr, int greed, bool flip) /* Add in the charisma factor */ factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]]; - /* Hack - merchants have better prices */ -#if 0 /* DGDGDGDG -- use a skill */ - if (cp_ptr->magic_key == MKEY_TELEKINESIS) - factor -= p_ptr->lev / 2; -#endif /* Shop is buying */ if (flip) { @@ -1594,13 +1589,7 @@ void display_store(void) /* The "Home" is special */ if (cur_store_num == 7) { - /* Put the owner name -- mega hack */ -#if 0 /* DGDGDGDG -- use a skill */ - if ((cp_ptr->magic_key == MKEY_TELEKINESIS) && - (p_ptr->town_num == TOWN_RANDOM)) put_str("Hole Contents", 3, 30); - else -#endif - put_str("Your Home", 3, 30); + put_str("Your Home", 3, 30); /* Label the item descriptions */ put_str("Item Description", 5, 3); @@ -3027,17 +3016,6 @@ void store_sell(void) } - /* Hack -- Cannot put a portable hole into home */ -#if 0 /* DGDGDGDG -- use a skill */ - if ((cp_ptr->magic_key == MKEY_TELEKINESIS) && - (o_ptr->tval == TV_TOOL) && (o_ptr->sval == SV_PORTABLE_HOLE)) - { - msg_print("Putting it into your home has extra-dimensional problems"); - - return; - } -#endif - /* Assume one item */ amt = 1; @@ -4487,14 +4465,6 @@ void store_request_item(void) object_type forge, *q_ptr = &forge; store_type *ost_ptr = st_ptr; - /* Paranoia */ -#if 0 /* DGDGDGDG -- use a skill */ - if (cp_ptr->magic_key == MKEY_TELEKINESIS) - { - st_ptr = ost_ptr; - return; - } -#endif /* Get the Black Market */ st_ptr = &town_info[p_ptr->town_num].store[6]; diff --git a/src/tables.c b/src/tables.c index 44973287..5ed48b43 100644 --- a/src/tables.c +++ b/src/tables.c @@ -1617,11 +1617,6 @@ option_type option_info[] = /*** Birth Options ***/ -#if 0 /* XXX free -- no more used */ - { &vanilla_town, FALSE, 6, 0, - "vanilla_town", "Use 'vanilla' town without quests and wilderness" }, -#endif - { &maximize, TRUE, 6, 1, "maximize", "Maximise stats" }, @@ -1633,10 +1628,7 @@ option_type option_info[] = { &point_based, FALSE, 6, 17, "point_based", "Generate character using a point system" }, -#if 0 - { &special_lvls, TRUE, 6, 4, - "special_lvls", "Allow the use of special, unique, levels" }, -#endif + { &ironman_rooms, FALSE, 6, 6, "ironman_rooms", "Always generate very unusual rooms" }, @@ -1646,10 +1638,6 @@ option_type option_info[] = { &auto_notes, TRUE, 6, 8, "auto_notes", "Automatically note important events" }, -#if 0 /* when Ill get some ideas */ - { &rand_birth, FALSE, 6, 9, - "rand_birth", "Random present at birth" }, -#endif { &fast_autoroller, FALSE, 6, 10, "fast_autoroller", "Fast autoroller(NOT on multiuser systems)" }, @@ -2923,9 +2911,6 @@ activation activation_info[MAX_T_ACT] = { "corruption", 100, ACT_MUT }, { "cure insanity", 2000, ACT_CURE_INSANITY }, { "light absortion", 800, ACT_LIGHT_ABSORBTION }, -#if 0 /* No more for the time being, ehehhe evil I am :> */ - { "cure corruption", 2000, ACT_CURE_MUT }, -#endif }; /* diff --git a/src/traps.c b/src/traps.c index 181c0bbe..bbc5b5c3 100644 --- a/src/traps.c +++ b/src/traps.c @@ -2415,97 +2415,7 @@ bool mon_hit_trap_aux_rod(int m_idx, object_type *o_ptr) */ bool mon_hit_trap_aux_staff(int m_idx, object_type *o_ptr) { - /* Monster pointer and position */ - monster_type *m_ptr = &m_list[m_idx]; - int y = m_ptr->fy; - int x = m_ptr->fx; - - /* sval and base level of the staff */ - int sval = o_ptr->sval; - - /* Damage amount, type, and radius */ - int dam = 0, typ = 0; - int rad = 0; - - /* Depend on staff type */ - switch (sval) - { -#if 0 /*must be tested*/ - case SV_STAFF_IDENTIFY: - case SV_STAFF_MANA: - case SV_STAFF_REMOVE_CURSES: - case SV_STAFF_REVEAL_WAYS: - case SV_STAFF_SENSE_MONSTER: - case SV_STAFF_VISION: - case SV_STAFF_DISARM: - return (FALSE); - - case SV_STAFF_LIGHT: - lite_room(y, x); - typ = GF_LITE_WEAK; - dam = damroll(2, 8); - rad = 2; - break; - - case SV_STAFF_SUMMON: - for (k = 0; k < randint(4) ; k++) - (void)summon_specific(y, x, dun_level, 0); - return (FALSE); - - case SV_STAFF_TELEPORTATION: - typ = GF_AWAY_ALL; - dam = 100 + 2 * level; - break; - - case SV_STAFF_HEALING: - typ = GF_OLD_HEAL; - dam = m_ptr->maxhp * (150 + 7 * level) / 1000; - break; - - case SV_STAFF_SHAKE: - earthquake(y, x, 4 + level / 5); /* was 10 */ - return (FALSE); - - case SV_STAFF_RECOVERY: - m_ptr->bleeding = 0; - m_ptr->poisoned = 0; - return (FALSE); - - case SV_STAFF_GENOCIDE: - { - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - genocide_aux(FALSE, r_ptr->d_char); - /* although there's no point in a multiple genocide trap... */ - return (cave[y][x].m_idx == 0 ? TRUE : FALSE); - } - - case SV_STAFF_SENSE_HIDDEN: - m_ptr->smart |= SM_NOTE_TRAP; - return (FALSE); - - case SV_STAFF_WISH: - acquirement(y, x, randint(2) + 1, TRUE, FALSE); - return (FALSE); - - case SV_STAFF_MITHRANDIR: - typ = GF_HOLY_FIRE; - dam = 50 + 6 * level; - rad = 9; /* instead of LOS */ - - /* How to implement these ? */ - case SV_STAFF_FIERY_SHIELD: - case SV_STAFF_WINGS_WIND: - case SV_STAFF_PROBABILITY_TRAVEL: - -#endif - - default: - return (FALSE); - } - - /* Actually hit the monster */ - (void) project( -2, rad, y, x, dam, typ, PROJECT_KILL | PROJECT_ITEM | PROJECT_JUMP); - return (cave[y][x].m_idx == 0 ? TRUE : FALSE); + return (FALSE); } /* @@ -2642,138 +2552,7 @@ bool mon_hit_trap_aux_scroll(int m_idx, int sval) */ bool mon_hit_trap_aux_wand(int m_idx, object_type *o_ptr) { - /* Monster pointer and position */ - monster_type *m_ptr = &m_list[m_idx]; - int y = m_ptr->fy; - int x = m_ptr->fx; - - /* sval and bonus level of the wand */ - int sval = o_ptr->sval; - - /* Damage amount, type, and radius */ - int dam = 0, typ = 0; - int rad = 0; - - /* Depend on wand type */ - switch (sval) - { - -#if 0 /* must be tested */ - - case SV_WAND_MANATHRUST: - typ = GF_MANA; - dam = damroll(3 + level, 1 + 2 * level / 5 ); - break; - - case SV_WAND_FIREFLASH: - typ = GF_FIRE; - dam = 20 + level * 10; - rad = 2 + level / 10; - break; - - case SV_WAND_NOXIOUS_CLOUD: - typ = GF_POIS; - dam = 7 + 3 * level; - rad = 3; - break; - - case SV_WAND_THUNDERSTORM: - typ = GF_ELEC; /* GF_LITE, GF_SOUND ??? */ - dam = damroll(5 + level / 5, 10 + level / 2); - break; - - case SV_WAND_DIG: - case SV_WAND_THRAIN: - typ = GF_KILL_WALL; - dam = 20 + randint(30); - break; - - case SV_WAND_STRIKE: - typ = GF_FORCE; - dam = 50 + level; - break; - - case SV_WAND_TELEPORT_AWAY: - typ = GF_AWAY_ALL; - dam = MAX_SIGHT * 5; - break; - - case SV_WAND_SUMMON_ANIMAL: - summon_specific(y, x, dun_level, SUMMON_ANIMAL); /* friendly ?*/ - return (FALSE); - - case SV_WAND_SLOW_MONSTER: - typ = GF_OLD_SLOW; - dam = 40 + 16 * level / 5; - break; - - case SV_WAND_BANISHMENT: - typ = GF_AWAY_ALL; - dam = 40 + 16 * level / 5; - rad = 9; /* instead of LOS */ - break; - - case SV_WAND_CHARM: - typ = GF_CHARM; - dam = 10 + 3 * level; - break; - - case SV_WAND_CONFUSE: - typ = GF_OLD_CONF; - dam = 10 + 3 * level; - break; - - case SV_WAND_HEAL_MONSTER: - typ = GF_OLD_HEAL; - dam = 20 + 38 * level / 5; - break; - - case SV_WAND_SPEED: - case SV_WAND_HASTE_MONSTER: - typ = GF_OLD_SPEED; - dam = damroll(5, 10); - break; - - case SV_WAND_STONE_PRISON: - wall_stone(y, x); - return (FALSE); - - case SV_WAND_DISPERSE_MAGIC: - m_ptr->confused = 0; - m_ptr->mspeed = 0; - return (FALSE); - - case SV_WAND_ICE_STORM: - typ = GF_COLD; - dam = 80 + 4 * level; - rad = 1 + 3 * level / 50; - break; - - case SV_WAND_TIDAL_WAVE: - typ = GF_WAVE; - dam = 40 + 4 * level; - rad = 6 + level / 5; - break; - - case SV_WAND_FIREWALL: - typ = GF_FIRE; - dam = 40 + 3 * level; - rad = 1; /*instead of beam*/ - - /* Not sure about these */ - case SV_WAND_MAGELOCK: - case SV_WAND_DEMON_BLADE: - case SV_WAND_POISON_BLOOD: - -#endif - - default: - return (FALSE); - } - - /* Actually hit the monster */ - (void) project( -2, rad, y, x, dam, typ, PROJECT_KILL | PROJECT_ITEM | PROJECT_JUMP); - return (cave[y][x].m_idx == 0 ? TRUE : FALSE); + return (FALSE); } /* @@ -2940,9 +2719,6 @@ bool mon_hit_trap(int m_idx) { monster_type *m_ptr = &m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; -#if 0 /* DGDGDGDG */ - monster_lore *l_ptr = &l_list[m_ptr->r_idx]; -#endif object_type *kit_o_ptr, *load_o_ptr, *j_ptr; @@ -3013,10 +2789,6 @@ bool mon_hit_trap(int m_idx) /* Smart monsters are better at detecting traps */ if (r_ptr->flags2 & RF2_SMART) smartness += 10; - /* Some monsters are great at detecting traps */ -#if 0 /* DGDGDGDG */ - if (r_ptr->flags2 & RF2_NOTICE_TRAP) smartness += 20; -#endif /* Some monsters have already noticed one of out traps */ if (m_ptr->smart & SM_NOTE_TRAP) smartness += 20; @@ -3032,10 +2804,6 @@ bool mon_hit_trap(int m_idx) /* The next traps will be easier to spot! */ m_ptr->smart |= SM_NOTE_TRAP; - /* Tell the player about it */ -#if 0 /* DGDGDGDG */ - if (m_ptr->ml) l_ptr->r_flags2 |= (RF2_NOTICE_TRAP & r_ptr->flags2); -#endif /* Get trap disarming difficulty */ difficulty = (kit_o_ptr->ac + kit_o_ptr->to_a); @@ -3043,14 +2811,6 @@ bool mon_hit_trap(int m_idx) /* Higher level monsters are better */ smartness = r_ptr->level / 5; - /* Some monsters are great at disarming */ -#if 0 /* DGDGDGDG */ - if (r_ptr->flags2 & RF2_DISARM_TRAP) smartness += 20; -#endif - /* After disarming one trap, the next is easier */ -#if 0 /* DGDGDGDG */ - if (m_ptr->status & STATUS_DISARM_TRAP) smartness += 20; -#endif /* Smart monsters are better at disarming */ if (r_ptr->flags2 & RF2_SMART) smartness *= 2; @@ -3069,19 +2829,11 @@ bool mon_hit_trap(int m_idx) { remove = TRUE; - /* Next time disarming will be easier */ -#if 0 /* DGDGDGDG */ - m_ptr->status |= STATUS_DISARM_TRAP; -#endif if (m_ptr->ml) { /* Get the name */ monster_desc(m_name, m_ptr, 0); - /* Tell the player about it */ -#if 0 /* DGDGDGDG */ - l_ptr->r_flags2 |= (RF2_DISARM_TRAP & r_ptr->flags2); -#endif /* Print a message */ msg_format("%^s disarms a trap!", m_name); } @@ -3362,17 +3114,6 @@ bool mon_hit_trap(int m_idx) while (shots-- && !dead) { -#if 0 - /* Message if visible */ - if (m_ptr->ml) - { - /* describe the monster (again, just in case :-) */ - monster_desc(m_name, m_ptr, 0); - - /* Print a message */ - msg_format("%^s is hit by some magic.", m_name); - } -#endif /* Get the effect effect */ switch (load_o_ptr->tval) { diff --git a/src/util.c b/src/util.c index 5d178780..c715ffc4 100644 --- a/src/util.c +++ b/src/util.c @@ -3960,65 +3960,6 @@ bool is_a_vowel(int ch) } - -#if 0 - -/* -* Replace the first instance of "target" in "buf" with "insert" -* If "insert" is NULL, just remove the first instance of "target" -* In either case, return TRUE if "target" is found. -* -* XXX Could be made more efficient, especially in the -* case where "insert" is smaller than "target". -*/ -static bool insert_str(char *buf, cptr target, cptr insert) -{ - int i, len; - int b_len, t_len, i_len; - - /* Attempt to find the target (modify "buf") */ - buf = strstr(buf, target); - - /* No target found */ - if (!buf) return (FALSE); - - /* Be sure we have an insertion string */ - if (!insert) insert = ""; - - /* Extract some lengths */ - t_len = strlen(target); - i_len = strlen(insert); - b_len = strlen(buf); - - /* How much "movement" do we need? */ - len = i_len - t_len; - - /* We need less space (for insert) */ - if (len < 0) - { - for (i = t_len; i < b_len; ++i) buf[i + len] = buf[i]; - } - - /* We need more space (for insert) */ - else if (len > 0) - { - for (i = b_len - 1; i >= t_len; --i) buf[i + len] = buf[i]; - } - - /* If movement occured, we need a new terminator */ - if (len) buf[b_len + len] = '\0'; - - /* Now copy the insertion string */ - for (i = 0; i < i_len; ++i) buf[i] = insert[i]; - - /* Successful operation */ - return (TRUE); -} - - -#endif - - /* * GH * Called from cmd4.c and a few other places. Just extracts diff --git a/src/wild.c b/src/wild.c index c22de8ab..07b5d239 100644 --- a/src/wild.c +++ b/src/wild.c @@ -281,47 +281,6 @@ int generate_area(int y, int x, bool border, bool corner, bool refresh) } } -#if 0 - /* Hack -- Use the "simple" RNG */ - Rand_quick = TRUE; - - /* Hack -- Induce consistant town layout */ - Rand_value = wilderness[y][x].seed; - - /* Generate a wilderness vault. */ - if (magik(DUN_WILD_VAULT)) - { - vault_type *v_ptr; - int vindex, vy, vx; - int i; - - /* Pick a wilderness vault */ - for (i = 0; i < 1000; i++) - { - /* Access a random vault record */ - vindex = rand_int(max_v_idx); - v_ptr = &v_info[vindex]; - - /* Accept the first greater vault */ - if (v_ptr->typ == 10) break; - } - - /* Message */ - if (cheat_room) msg_format("Wilderness Vault %d", vindex); - - /* Boost the rating */ - rating += v_ptr->rat; - - vy = rand_range((v_ptr->hgt / 2) + 1, MAX_HGT - (v_ptr->hgt / 2)-1); - vx = rand_range((v_ptr->wid / 2) + 1, MAX_WID - (v_ptr->wid / 2)-1); - - build_vault(vy, vx, v_ptr->hgt, v_ptr->wid, v_text + v_ptr->text); - } - - /* Use the complex RNG */ - Rand_quick = FALSE; -#endif - /* Hack -- Use the "simple" RNG */ Rand_quick = TRUE; diff --git a/src/wizard2.c b/src/wizard2.c index daabe4f3..83bcfc05 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -729,11 +729,6 @@ static void wiz_tweak_item(object_type *o_ptr) object_flags(o_ptr, &f1, &f2, &f3, &f4, &f5, &esp); -#if 0 /* DG -- A Wizard can do whatever he/she wants */ - /* Hack -- leave artifacts alone */ - if (artifact_p(o_ptr) || o_ptr->art_name) return; -#endif - p = "Enter new 'pval' setting: "; sprintf(tmp_val, "%ld", (long int) o_ptr->pval); if (!get_string(p, tmp_val, 5)) return; diff --git a/src/xtra1.c b/src/xtra1.c index d1996b18..2543baab 100644 --- a/src/xtra1.c +++ b/src/xtra1.c @@ -4537,7 +4537,6 @@ bool monk_heavy_armor(void) static int get_artifact_idx(int level) { int count = 0, i; - bool OK = FALSE; while (count < 1000) { @@ -4557,23 +4556,12 @@ static int get_artifact_idx(int level) /* Avoid granting SPECIAL_GENE artifacts */ if (a_ptr->flags4 & TR4_SPECIAL_GENE) continue; - OK = TRUE; - break; + return i; } /* No matches found */ - if (OK == FALSE) - { -#if 0 /* pelpel */ - /* XXX XXX XXX Grant the Phial */ - i = 1; -#endif /* pelpel */ - - /* Grant a randart */ - i = 0; - } - - return i; + /* Grant a randart */ + return 0; } /* Chose a fate */ diff --git a/src/xtra2.c b/src/xtra2.c index 0dbc2b02..e81db1da 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -3815,18 +3815,6 @@ void place_corpse(monster_type *m_ptr) int x = m_ptr->fx; int y = m_ptr->fy; -#if 0 /* If I can find some time to implement the decapitation ... */ - object_type *w_ptr = &p_ptr->inventory[INVEN_WIELD]; - - int i = w_ptr->weight + ((p_ptr->to_h + w_ptr->to_h) * 5) + (p_ptr->lev * 3); - - /* Handle decapitations. This is not allowed with hafted weapons. */ - bool crit = (randint(5000) <= i); - - bool decapitate = ((rand_int(m_ptr->maxhp) <= -(m_ptr->hp)) && - (w_ptr->tval != TV_HAFTED) && crit); -#endif - /* Get local object */ i_ptr = &object_type_body; @@ -5080,16 +5068,6 @@ void verify_panel(void) /* Recalculate the boundaries */ panel_bounds(); - /* Hack - merchants detect items */ -#if 0 /* DGDGDGDG -- use a skill */ - if (cp_ptr->magic_key == MKEY_TELEKINESIS) - { - hack_no_detect_message = TRUE; - detect_objects_normal(DEFAULT_RADIUS); - detect_objects_gold(DEFAULT_RADIUS); - hack_no_detect_message = FALSE; - } -#endif /* Update stuff */ p_ptr->update |= (PU_MONSTERS); @@ -6728,14 +6706,6 @@ void gain_level_reward(int chosen_reward) int type, effect; -#if 0 - if (!chosen_reward) - { - if (multi_rew) return; - else multi_rew = TRUE; - } -#endif - if (p_ptr->lev == 13) nasty_chance = 2; else if (!(p_ptr->lev % 13)) nasty_chance = 3; else if (!(p_ptr->lev % 14)) nasty_chance = 12; @@ -7418,14 +7388,6 @@ bool test_object_wish(char *name, object_type *o_ptr, object_type *forge, char * /* Hack hack hackery */ (o_ptr->tval == TV_ROD_MAIN && strstr(name, "rod of"))) { -#if 0 // DGDGDGDG - /* You can't wish for a wish! */ - if ((o_ptr->tval == TV_STAFF) && (o_ptr->sval == SV_STAFF_WISHING)) - { - msg_format("You cannot %s for a wish!", what); - return FALSE; - } -#endif /* try all ego */ for (j = max_e_idx - 1; j >= 0; j--) { diff --git a/src/z-term.c b/src/z-term.c index b93d8470..1570b9b2 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -2300,18 +2300,6 @@ errr Term_redraw_section(int x1, int y1, int x2, int y2) char *c_ptr; -#if 0 // DGDGDGDG - /* Pat */ - if ((do_movies == 1) && IN_MAINWINDOW) - { - if (!cmovie_get_msecond()) - { - fprintf(movfile, "W:1:\n"); - } - } - /* Endpat */ -#endif - /* Bounds checking */ if (y2 >= Term->hgt) y2 = Term->hgt - 1; if (x2 >= Term->wid) x2 = Term->wid - 1; @@ -2455,11 +2443,6 @@ errr Term_keypress(int k) /* Success (unless overflow) */ if (Term->key_head != Term->key_tail) return (0); -#if 0 - /* Hack -- Forget the oldest key */ - if (++Term->key_tail == Term->key_size) Term->key_tail = 0; -#endif - /* Problem */ return (1); } @@ -2482,11 +2465,6 @@ errr Term_key_push(int k) /* Success (unless overflow) */ if (Term->key_head != Term->key_tail) return (0); -#if 0 - /* Hack -- Forget the oldest key */ - if (++Term->key_tail == Term->key_size) Term->key_tail = 0; -#endif - /* Problem */ return (1); } -- cgit v1.2.3