- * @brief 武器の祝福処理 /
- * Bless a weapon
- * @return ターン消費を要する処理を行ったならばTRUEを返す
- */
-bool bless_weapon(void)
-{
- OBJECT_IDX item;
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- GAME_TEXT o_name[MAX_NLEN];
- concptr q, s;
-
- /* Bless only weapons */
- item_tester_hook = object_is_weapon;
-
- q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
- s = _("祝福できる武器がありません。", "You have weapon to bless.");
-
- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
- if (!o_ptr) return FALSE;
-
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- object_flags(o_ptr, flgs);
-
- if (object_is_cursed(o_ptr))
- {
- if (((o_ptr->curse_flags & TRC_HEAVY_CURSE) && (randint1(100) < 33)) ||
- have_flag(flgs, TR_ADD_L_CURSE) ||
- have_flag(flgs, TR_ADD_H_CURSE) ||
- (o_ptr->curse_flags & TRC_PERMA_CURSE))
- {
-#ifdef JP
- msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
-#else
- msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
-#endif
-
- return TRUE;
- }
-
-#ifdef JP
- msg_format("%s から邪悪なオーラが消えた。", o_name);
-#else
- msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
-#endif
-
-
- o_ptr->curse_flags = 0L;
-
- o_ptr->ident |= (IDENT_SENSE);
- o_ptr->feeling = FEEL_NONE;
-
- /* Recalculate the bonuses */
- p_ptr->update |= (PU_BONUS);
- p_ptr->window |= (PW_EQUIP);
- }
-
- /*
- * Next, we try to bless it. Artifacts have a 1/3 chance of
- * being blessed, otherwise, the operation simply disenchants
- * them, godly power negating the magic. Ok, the explanation
- * is silly, but otherwise priests would always bless every
- * artifact weapon they find. Ego weapons and normal weapons
- * can be blessed automatically.
- */
- if (have_flag(flgs, TR_BLESSED))
- {
-#ifdef JP
- msg_format("%s は既に祝福されている。", o_name);
-#else
- msg_format("%s %s %s blessed already.",
- ((item >= 0) ? "Your" : "The"), o_name,
- ((o_ptr->number > 1) ? "were" : "was"));
-#endif
-
- return TRUE;
- }
-
- if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
- {
-#ifdef JP
- msg_format("%sは輝いた!", o_name);
-#else
- msg_format("%s %s shine%s!",
- ((item >= 0) ? "Your" : "The"), o_name,
- ((o_ptr->number > 1) ? "" : "s"));
-#endif
-
- add_flag(o_ptr->art_flags, TR_BLESSED);
- o_ptr->discount = 99;
- }
- else
- {
- bool dis_happened = FALSE;
- msg_print(_("その武器は祝福を嫌っている!", "The weapon resists your blessing!"));
-
- /* Disenchant tohit */
- if (o_ptr->to_h > 0)
- {
- o_ptr->to_h--;
- dis_happened = TRUE;
- }
-
- if ((o_ptr->to_h > 5) && (randint0(100) < 33)) o_ptr->to_h--;
-
- /* Disenchant todam */
- if (o_ptr->to_d > 0)
- {
- o_ptr->to_d--;
- dis_happened = TRUE;
- }
-
- if ((o_ptr->to_d > 5) && (randint0(100) < 33)) o_ptr->to_d--;
-
- /* Disenchant toac */
- if (o_ptr->to_a > 0)
- {
- o_ptr->to_a--;
- dis_happened = TRUE;
- }
-
- if ((o_ptr->to_a > 5) && (randint0(100) < 33)) o_ptr->to_a--;
-
- if (dis_happened)
- {
- msg_print(_("周囲が凡庸な雰囲気で満ちた...", "There is a static feeling in the air..."));
-
-#ifdef JP
- msg_format("%s は劣化した!", o_name);
-#else
- msg_format("%s %s %s disenchanted!", ((item >= 0) ? "Your" : "The"), o_name,
- ((o_ptr->number > 1) ? "were" : "was"));
-#endif
-
- }
- }
-
- p_ptr->update |= (PU_BONUS);
- p_ptr->window |= (PW_EQUIP | PW_PLAYER);
- calc_android_exp();
-
- return TRUE;
-}
-
-
-/*!
- * @brief 盾磨き処理 /
- * pulish shield
- * @return ターン消費を要する処理を行ったならばTRUEを返す
- */
-bool pulish_shield(void)
-{
- OBJECT_IDX item;
- object_type *o_ptr;
- BIT_FLAGS flgs[TR_FLAG_SIZE];
- GAME_TEXT o_name[MAX_NLEN];
- concptr q, s;
-
- /* Assume enchant weapon */
- item_tester_tval = TV_SHIELD;
-
- q = _("どの盾を磨きますか?", "Pulish which weapon? ");
- s = _("磨く盾がありません。", "You have weapon to pulish.");
-
- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
- if (!o_ptr) return FALSE;
-
- object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- object_flags(o_ptr, flgs);
-
- if (o_ptr->k_idx && !object_is_artifact(o_ptr) && !object_is_ego(o_ptr) &&
- !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
- {
-#ifdef JP
- msg_format("%sは輝いた!", o_name);
-#else
- msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
-#endif
- o_ptr->name2 = EGO_REFLECTION;
- enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
-
- o_ptr->discount = 99;
- chg_virtue(V_ENCHANT, 2);
-
- return TRUE;
- }
- else
- {
- if (flush_failure) flush();
-
- msg_print(_("失敗した。", "Failed."));
- chg_virtue(V_ENCHANT, -2);
- }
- calc_android_exp();
-
- return FALSE;
-}
-
-
-/*!
- * @brief 薬の破損効果処理 /
- * Potions "smash open" and cause an area effect when
- * @param who 薬破損の主体ID(プレイヤー所持アイテムが壊れた場合0、床上のアイテムの場合モンスターID)
- * @param y 破壊時のY座標
- * @param x 破壊時のX座標
- * @param k_idx 破損した薬のアイテムID
- * @return 薬を浴びたモンスターが起こるならばTRUEを返す
- * @details
- * <pre>
- * (1) they are shattered while in the player's inventory,
- * due to cold (etc) attacks;
- * (2) they are thrown at a monster, or obstacle;
- * (3) they are shattered by a "cold ball" or other such spell
- * while lying on the floor.
- *
- * Arguments:
- * who --- who caused the potion to shatter (0=player)
- * potions that smash on the floor are assumed to
- * be caused by no-one (who = 1), as are those that
- * shatter inside the player inventory.
- * (Not anymore -- I changed this; TY)
- * y, x --- coordinates of the potion (or player if
- * the potion was in her inventory);
- * o_ptr --- pointer to the potion object.
- * </pre>
- */
-bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx)
-{
- int radius = 2;
- int dt = 0;
- int dam = 0;
- bool angry = FALSE;
-
- object_kind *k_ptr = &k_info[k_idx];
-
- switch (k_ptr->sval)
- {
- case SV_POTION_SALT_WATER:
- case SV_POTION_SLIME_MOLD:
- case SV_POTION_LOSE_MEMORIES:
- case SV_POTION_DEC_STR:
- case SV_POTION_DEC_INT:
- case SV_POTION_DEC_WIS:
- case SV_POTION_DEC_DEX:
- case SV_POTION_DEC_CON:
- case SV_POTION_DEC_CHR:
- case SV_POTION_WATER: /* perhaps a 'water' attack? */
- case SV_POTION_APPLE_JUICE:
- return TRUE;
-
- case SV_POTION_INFRAVISION:
- case SV_POTION_DETECT_INVIS:
- case SV_POTION_SLOW_POISON:
- case SV_POTION_CURE_POISON:
- case SV_POTION_BOLDNESS:
- case SV_POTION_RESIST_HEAT:
- case SV_POTION_RESIST_COLD:
- case SV_POTION_HEROISM:
- case SV_POTION_BESERK_STRENGTH:
- case SV_POTION_RES_STR:
- case SV_POTION_RES_INT:
- case SV_POTION_RES_WIS:
- case SV_POTION_RES_DEX:
- case SV_POTION_RES_CON:
- case SV_POTION_RES_CHR:
- case SV_POTION_INC_STR:
- case SV_POTION_INC_INT:
- case SV_POTION_INC_WIS:
- case SV_POTION_INC_DEX:
- case SV_POTION_INC_CON:
- case SV_POTION_INC_CHR:
- case SV_POTION_AUGMENTATION:
- case SV_POTION_ENLIGHTENMENT:
- case SV_POTION_STAR_ENLIGHTENMENT:
- case SV_POTION_SELF_KNOWLEDGE:
- case SV_POTION_EXPERIENCE:
- case SV_POTION_RESISTANCE:
- case SV_POTION_INVULNERABILITY:
- case SV_POTION_NEW_LIFE:
- /* All of the above potions have no effect when shattered */
- return FALSE;
- case SV_POTION_SLOWNESS:
- dt = GF_OLD_SLOW;
- dam = 5;
- angry = TRUE;
- break;
- case SV_POTION_POISON:
- dt = GF_POIS;
- dam = 3;
- angry = TRUE;
- break;
- case SV_POTION_BLINDNESS:
- dt = GF_DARK;
- angry = TRUE;
- break;
- case SV_POTION_BOOZE: /* Booze */
- dt = GF_OLD_CONF;
- angry = TRUE;
- break;
- case SV_POTION_SLEEP:
- dt = GF_OLD_SLEEP;
- angry = TRUE;
- break;
- case SV_POTION_RUINATION:
- case SV_POTION_DETONATIONS:
- dt = GF_SHARDS;
- dam = damroll(25, 25);
- angry = TRUE;
- break;
- case SV_POTION_DEATH:
- dt = GF_DEATH_RAY; /* !! */
- dam = k_ptr->level * 10;
- angry = TRUE;
- radius = 1;
- break;
- case SV_POTION_SPEED:
- dt = GF_OLD_SPEED;
- break;
- case SV_POTION_CURE_LIGHT:
- dt = GF_OLD_HEAL;
- dam = damroll(2, 3);
- break;
- case SV_POTION_CURE_SERIOUS:
- dt = GF_OLD_HEAL;
- dam = damroll(4, 3);
- break;
- case SV_POTION_CURE_CRITICAL:
- case SV_POTION_CURING:
- dt = GF_OLD_HEAL;
- dam = damroll(6, 3);
- break;
- case SV_POTION_HEALING:
- dt = GF_OLD_HEAL;
- dam = damroll(10, 10);
- break;
- case SV_POTION_RESTORE_EXP:
- dt = GF_STAR_HEAL;
- dam = 0;
- radius = 1;
- break;
- case SV_POTION_LIFE:
- dt = GF_STAR_HEAL;
- dam = damroll(50, 50);
- radius = 1;
- break;
- case SV_POTION_STAR_HEALING:
- dt = GF_OLD_HEAL;
- dam = damroll(50, 50);
- radius = 1;
- break;
- case SV_POTION_RESTORE_MANA: /* MANA */
- dt = GF_MANA;
- dam = damroll(10, 10);
- radius = 1;
- break;
- default:
- /* Do nothing */ ;
- }
-
- (void)project(who, radius, y, x, dam, dt, (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL), -1);
-
- /* XXX those potions that explode need to become "known" */
- return angry;
-}
-
-
-/*!