From e2b98e51d988da3ddeae8f529f37d8bd4be1b0dc Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Mon, 23 Feb 2015 09:11:56 +0100 Subject: Remove last remnants of the Merchant class - Merchant's guild removed, it was unusable anyway - Removed "loan" code - Removed PWR_MERCHANT code --- src/powers.cc | 193 ---------------------------------------------------------- 1 file changed, 193 deletions(-) (limited to 'src/powers.cc') diff --git a/src/powers.cc b/src/powers.cc index 662d535a..ae7afbcd 100644 --- a/src/powers.cc +++ b/src/powers.cc @@ -171,199 +171,6 @@ static void power_activate(int power) } } break; - case PWR_MERCHANT: - /* Select power to use */ - while (TRUE) - { - if (!get_com("[A]ppraise item, [W]arp item or [I]dentify item? ", &ch)) - { - amber_power = 0; - break; - } - - if (ch == 'A' || ch == 'a') - { - amber_power = 1; - break; - } - - if (ch == 'W' || ch == 'w') - { - amber_power = 2; - break; - } - - if (ch == 'I' || ch == 'i') - { - amber_power = 3; - break; - } - } - - if (amber_power == 1) - { - x_ptr_foo.level = 5; - x_ptr_foo.cost = 5; - x_ptr_foo.stat = A_INT; - x_ptr_foo.diff = 5; - if (power_chance(&x_ptr_foo)) - { - /* Appraise an object */ - int idx; - cptr q, s; - - /* Get the item */ - q = "Appraise which item? "; - s = "You have nothing to appraise."; - if (get_item(&idx, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) - { - object_type *o_ptr; - char out_val[80], value[16]; - - /* The item is in the pack */ - if (idx >= 0) o_ptr = &p_ptr->inventory[idx]; - /* The item is on the floor */ - else o_ptr = &o_list[0 - idx]; - - /* Appraise it */ - sprintf(value, FMTs32b " au", object_value(o_ptr)); - - /* Inscribe the value */ - /* Get the original inscription */ - if (o_ptr->note) - { - strcpy(out_val, quark_str(o_ptr->note)); - strcat(out_val, " "); - } - else - out_val[0] = '\0'; - - strcat(out_val, value); - - /* Save the new inscription */ - o_ptr->note = quark_add(out_val); - - /* Combine the pack */ - p_ptr->notice |= (PN_COMBINE); - - /* Window stuff */ - p_ptr->window |= (PW_INVEN | PW_EQUIP); - } - } - } - if (amber_power == 2) - { - x_ptr_foo.level = 15; - x_ptr_foo.cost = 10; - x_ptr_foo.stat = A_INT; - x_ptr_foo.diff = 7; - if (power_chance(&x_ptr_foo)) - { - int chest, item; - cptr q1, s1, q2, s2; - u32b flag = (USE_EQUIP | USE_INVEN | USE_FLOOR); - object_type *o1_ptr = &p_ptr->inventory[0], *o2_ptr = &p_ptr->inventory[1]; - int ok = 0; - - q1 = "Select a chest! "; - s1 = "You need a chest to warp items."; - - q2 = "Warp which item? "; - s2 = "You have nothing to warp."; - - item_tester_tval = TV_CHEST; - - /* Get the chest */ - if (get_item(&chest, q1, s1, flag)) - { - if (chest >= 0) o1_ptr = &p_ptr->inventory[chest]; - else o1_ptr = &o_list[0 - chest]; - - /* Is the chest disarmed? */ - if (o1_ptr->pval > 0) - msg_print("This chest may be trapped."); - - /* Is it ruined? */ - else if (k_info[o1_ptr->k_idx].level <= 0) - msg_print("This chest is broken."); - - /* Is it empty? */ - else if (o1_ptr->pval2 >= (o1_ptr->sval % SV_CHEST_MIN_LARGE) * 2) - msg_print("This chest is full."); - - else ok = 1; - } - - /* Get the item */ - if (ok && get_item(&item, q2, s2, flag)) - { - ok = 0; - - o2_ptr = get_object(item); - - /* Is the item cursed? */ - if ((item >= INVEN_WIELD) && cursed_p(o2_ptr)) - msg_print("Hmmm, it seems to be cursed."); - - /* Is it the same chest? */ - if (item == chest) - msg_print("You can't put a chest into itself."); - - /* Is it another chest? */ - if (o2_ptr->tval == TV_CHEST) - msg_print("You can't put a chest into another one."); - - /* Try to use the power */ - else ok = 1; - } - - if (ok) - { - int tmp, level; - - /* Calculate the level of objects */ - tmp = o1_ptr->pval; - - /* Get the level of the current object */ - /* Cursed items/cheap items always break */ - if (k_info[o2_ptr->k_idx].cost < 20) level = 0; - /* Not-so-cheap items break 90% of the time */ - else if (k_info[o2_ptr->k_idx].cost < 100) level = 1; - else level = k_info[o2_ptr->k_idx].level; - - /* Break some items */ - if (randint(10) > level) - msg_print("The item disappeared!"); - else - { - level /= (o1_ptr->sval % SV_CHEST_MIN_LARGE) * 2; - - /* Increase the number of objects in - * the chest */ - o1_ptr->pval2++; - - /* Set the level of chest */ - tmp = tmp - level; - o1_ptr->pval = tmp; - } - - /* Destroy item */ - inc_stack_size(item, -1); - } - } - } - if (amber_power == 3) - { - x_ptr_foo.level = 30; - x_ptr_foo.cost = 20; - x_ptr_foo.stat = A_INT; - x_ptr_foo.diff = 7; - if (power_chance(&x_ptr_foo)) - { - ident_spell(); - } - } - break; case PWR_LAY_TRAP: { do_cmd_set_trap(); -- cgit v1.2.3