#include "object-hook.h"
#include "melee.h"
#include "player-status.h"
+#include "projection.h"
+#include "spells-summon.h"
+#include "quest.h"
+#include "artifact.h"
+#include "avatar.h"
+
/*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
#define MAX_TRIES 100
/* Paranoia */
if (!m_ptr->r_idx) return (FALSE);
- /* Save the old location */
oy = m_ptr->fy;
ox = m_ptr->fx;
ny = m_ptr->fy;
nx = m_ptr->fx;
-
- /* Save the old location */
oy = m_ptr->fy;
ox = m_ptr->fx;
msg_format("『こっちだぁ、%s』", p_ptr->name);
#endif
- /* Move the player */
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
-
return TRUE;
}
void teleport_player(POSITION dis, BIT_FLAGS mode)
{
POSITION yy, xx;
-
- /* Save the old location */
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
{
POSITION yy, xx;
-
- /* Save the old location */
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
{
for (yy = -1; yy < 2; yy++)
{
- IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
/* A monster except your mount or caster may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
}
sound(SOUND_TELEPORT);
-
- /* Move the player */
(void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
}
}
+bool teleport_level_other(player_type *creature_ptr)
+{
+ MONSTER_IDX target_m_idx;
+ monster_type *m_ptr;
+ monster_race *r_ptr;
+ GAME_TEXT m_name[MAX_NLEN];
+
+ if (!target_set(TARGET_KILL)) return FALSE;
+ target_m_idx = cave[target_row][target_col].m_idx;
+ if (!target_m_idx) return TRUE;
+ if (!player_has_los_bold(target_row, target_col)) return TRUE;
+ if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
+ m_ptr = &m_list[target_m_idx];
+ r_ptr = &r_info[m_ptr->r_idx];
+ monster_desc(m_name, m_ptr, 0);
+ msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
+
+ if ((r_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE)) ||
+ (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > creature_ptr->lev + randint1(60)))
+ {
+ msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name);
+ }
+ else teleport_level(target_m_idx);
+ return TRUE;
+}
+
/*!
* @brief プレイヤー及びモンスターをレベルテレポートさせる /
* Teleport the player one level up or down (random when legal)
}
/* Allocate the "dun" array */
- C_MAKE(dun, max_d_idx, s16b);
+ C_MAKE(dun, max_d_idx, DUNGEON_IDX);
screen_save();
for(i = 1; i < max_d_idx; i++)
if ((i == ESCAPE) || !num)
{
/* Free the "dun" array */
- C_KILL(dun, max_d_idx, s16b);
+ C_KILL(dun, max_d_idx, DUNGEON_IDX);
screen_load();
return 0;
screen_load();
/* Free the "dun" array */
- C_KILL(dun, max_d_idx, s16b);
+ C_KILL(dun, max_d_idx, DUNGEON_IDX);
return select_dungeon;
}
bool apply_disenchant(BIT_FLAGS mode)
{
int t = 0;
- object_type *o_ptr;
+ object_type *o_ptr;
GAME_TEXT o_name[MAX_NLEN];
int to_h, to_d, to_a, pval;
int ii, jj, i;
/* Pick a pair of stats */
- ii = randint0(6);
- for (jj = ii; jj == ii; jj = randint0(6)) /* loop */;
+ ii = randint0(A_MAX);
+ for (jj = ii; jj == ii; jj = randint0(A_MAX)) /* loop */;
max1 = p_ptr->stat_max[ii];
cur1 = p_ptr->stat_cur[ii];
p_ptr->stat_max[jj] = max1;
p_ptr->stat_cur[jj] = cur1;
- for (i=0;i<6;i++)
+ for (i = 0; i < A_MAX; i++)
{
if(p_ptr->stat_max[i] > p_ptr->stat_max_max[i]) p_ptr->stat_max[i] = p_ptr->stat_max_max[i];
if(p_ptr->stat_cur[i] > p_ptr->stat_max_max[i]) p_ptr->stat_cur[i] = p_ptr->stat_max_max[i];
/* Perma-Cursed Items can NEVER be uncursed */
if (o_ptr->curse_flags & TRC_PERMA_CURSE)
{
- /* Uncurse it */
o_ptr->curse_flags &= (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE);
continue;
}
- /* Uncurse it */
o_ptr->curse_flags = 0L;
-
- /* Hack -- Assume felt */
o_ptr->ident |= (IDENT_SENSE);
-
o_ptr->feeling = FEEL_NONE;
p_ptr->update |= (PU_BONUS);
msg_format(_("%sを$%d の金に変えた。", "You turn %s to %ld coins worth of gold."), o_name, price);
p_ptr->au += price;
-
- /* Redraw gold */
p_ptr->redraw |= (PR_GOLD);
-
p_ptr->window |= (PW_PLAYER);
-
}
/* Eliminate the item (from the pack) */
/* Failure */
if (!res) return (FALSE);
-
- /* Combine / Reorder the pack (later) */
p_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
chg_virtue(V_KNOWLEDGE, 1);
}
- /* Identify it fully */
object_aware(o_ptr);
object_known(o_ptr);
-
- /* Player touches it */
o_ptr->marked |= OM_TOUCHED;
p_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
bool ident_spell(bool only_equip)
{
OBJECT_IDX item;
- object_type *o_ptr;
+ object_type *o_ptr;
GAME_TEXT o_name[MAX_NLEN];
concptr q, s;
bool old_known;
bool mundane_spell(bool only_equip)
{
OBJECT_IDX item;
- object_type *o_ptr;
- concptr q, s;
+ object_type *o_ptr;
+ concptr q, s;
if (only_equip) item_tester_hook = object_is_weapon_armour_ammo;
}
}
}
-
- /* Combine / Reorder the pack (later) */
p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
#endif
- /* Uncurse it */
o_ptr->curse_flags = 0L;
- /* Hack -- Assume felt */
o_ptr->ident |= (IDENT_SENSE);
-
o_ptr->feeling = FEEL_NONE;
/* Recalculate the bonuses */
bool pulish_shield(void)
{
OBJECT_IDX item;
- object_type *o_ptr;
+ object_type *o_ptr;
BIT_FLAGS flgs[TR_FLAG_SIZE];
GAME_TEXT o_name[MAX_NLEN];
concptr q, s;
dt = GF_DARK;
angry = TRUE;
break;
- case SV_POTION_CONFUSION: /* Booze */
+ case SV_POTION_BOOZE: /* Booze */
dt = GF_OLD_CONF;
angry = TRUE;
break;
/* Do nothing */ ;
}
- (void)project(who, radius, y, x, dam, dt,
- (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL), -1);
+ (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;
GAME_TEXT name[MAX_NLEN];
char out_val[160];
-
- /* Erase window */
clear_from(0);
/* They have too many spells to list */
GAME_TEXT o_name[MAX_NLEN];
-
/* Curse the body armor */
o_ptr = &inventory[INVEN_BODY];
{
/* Cool */
#ifdef JP
-msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
-"恐怖の暗黒オーラ", "防具", o_name);
+ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返した!",
+ "恐怖の暗黒オーラ", "防具", o_name);
#else
msg_format("A %s tries to %s, but your %s resists the effects!",
- "terrible black aura", "surround your armor", o_name);
+ "terrible black aura", "surround your armor", o_name);
#endif
}
/* Break it */
o_ptr->ident |= (IDENT_BROKEN);
- p_ptr->update |= (PU_BONUS);
-
- /* Recalculate mana */
- p_ptr->update |= (PU_MANA);
-
+ p_ptr->update |= (PU_BONUS | PU_MANA);
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
}
/* Break it */
o_ptr->ident |= (IDENT_BROKEN);
- p_ptr->update |= (PU_BONUS);
-
- /* Recalculate mana */
- p_ptr->update |= (PU_MANA);
-
+ p_ptr->update |= (PU_BONUS | PU_MANA);
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
}
DEPTH lev1, lev2;
/* Hack -- Uniques/Questors never polymorph */
- if ((r_ptr->flags1 & RF1_UNIQUE) ||
- (r_ptr->flags1 & RF1_QUESTOR))
+ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags1 & RF1_QUESTOR))
return (r_idx);
/* Allowable range of "levels" for resulting monster */
}
else if (back_m.hold_o_idx) /* Failed (paranoia) */
{
- /* Delete objects */
for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
/* Acquire next object */
next_o_idx = o_list[this_o_idx].next_o_idx;
-
delete_object_idx(this_o_idx);
}
}
p_ptr->csp = p_ptr->msp;
}
- /* Redraw mana and hp */
p_ptr->redraw |= (PR_MANA);
-
p_ptr->update |= (PU_COMBINE | PU_REORDER);
p_ptr->window |= (PW_INVEN);
void massacre(void)
{
POSITION x, y;
- cave_type *c_ptr;
- monster_type *m_ptr;
+ cave_type *c_ptr;
+ monster_type *m_ptr;
DIRECTION dir;
for (dir = 0; dir < 8; dir++)
y = p_ptr->y + ddy_ddd[dir];
x = p_ptr->x + ddx_ddd[dir];
c_ptr = &cave[y][x];
-
- /* Get the monster */
m_ptr = &m_list[c_ptr->m_idx];
/* Hack -- attack monsters */
/* Destroy the wall */
cave_alter_feat(y, x, FF_HURT_ROCK);
- /* Move the player */
(void)move_player_effect(y, x, MPE_DONT_PICKUP);
return TRUE;
}
if (cave[y][x].m_idx)
{
int i;
- int ty = y, tx = x;
- int oy = y, ox = x;
+ POSITION ty = y, tx = x;
+ POSITION oy = y, ox = x;
MONSTER_IDX m_idx = cave[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
cave[oy][ox].m_idx = 0;
- cave[ty][tx].m_idx = (s16b)m_idx;
- m_ptr->fy = (byte_hack)ty;
- m_ptr->fx = (byte_hack)tx;
+ cave[ty][tx].m_idx = m_idx;
+ m_ptr->fy = ty;
+ m_ptr->fx = tx;
update_monster(m_idx, TRUE);
lite_spot(oy, ox);
}
}
return TRUE;
+}
+
+bool booze(player_type *creature_ptr)
+{
+ bool ident = FALSE;
+ if (creature_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
+ else if (!creature_ptr->resist_conf) creature_ptr->special_attack |= ATTACK_SUIKEN;
+ if (!creature_ptr->resist_conf)
+ {
+ if (set_confused(randint0(20) + 15))
+ {
+ ident = TRUE;
+ }
+ }
+
+ if (!creature_ptr->resist_chaos)
+ {
+ if (one_in_(2))
+ {
+ if (set_image(creature_ptr->image + randint0(150) + 150))
+ {
+ ident = TRUE;
+ }
+ }
+ if (one_in_(13) && (creature_ptr->pclass != CLASS_MONK))
+ {
+ ident = TRUE;
+ if (one_in_(3)) lose_all_info();
+ else wiz_dark();
+ (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+ wiz_dark();
+ msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
+ msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing, or how you got here!"));
+ }
+ }
+ return ident;
+}
+
+bool detonation(player_type *creature_ptr)
+{
+ msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
+ take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
+ (void)set_stun(creature_ptr->stun + 75);
+ (void)set_cut(creature_ptr->cut + 5000);
+ return TRUE;
}
\ No newline at end of file