return;
}
+ BadStatusSetter bss(player_ptr);
if (cm_ptr->b < 15) {
msg_print(_("奇妙な光景が目の前で踊っている...", "Weird visions seem to dance before your eyes..."));
- hallucination(player_ptr, player_ptr->hallucinated + 5 + randint1(10));
+ (void)bss.hallucination(player_ptr->hallucinated + 5 + randint1(10));
return;
}
if (cm_ptr->b < 45) {
msg_print(_("あなたの頭は混乱した!", "Your brain is addled!"));
- BadStatusSetter bss(player_ptr);
(void)bss.confusion(player_ptr->confused + randint1(8));
return;
}
if (cm_ptr->b < 96) {
msg_print(_("まわりのものがキラキラ輝いている!", "Your brain is addled!"));
- hallucination(player_ptr, player_ptr->hallucinated + 5 + randint1(10));
+ (void)BadStatusSetter(player_ptr).hallucination(player_ptr->hallucinated + 5 + randint1(10));
return;
}
case SV_FOOD_CONFUSION:
return !has_resist_conf(player_ptr) && bss.confusion(player_ptr->confused + randint0(10) + 10);
case SV_FOOD_HALLUCINATION:
- return !has_resist_chaos(player_ptr) && hallucination(player_ptr, player_ptr->hallucinated + randint0(250) + 250);
+ return !has_resist_chaos(player_ptr) && bss.hallucination(player_ptr->hallucinated + randint0(250) + 250);
case SV_FOOD_PARALYSIS:
return !player_ptr->free_act && bss.paralysis(player_ptr->paralyzed + randint0(10) + 10);
case SV_FOOD_WEAKNESS:
BadStatusSetter bss(player_ptr);
auto effects = player_ptr->effects();
if (player_ptr->hallucinated) {
- (void)hallucination(player_ptr, player_ptr->hallucinated - dec_count);
+ (void)bss.hallucination(player_ptr->hallucinated - dec_count);
}
if (player_ptr->blind) {
}
if (!has_resist_chaos(player_ptr)) {
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint1(10));
+ (void)bss.hallucination(player_ptr->hallucinated + randint1(10));
if (one_in_(3)) {
msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
(void)gain_mutation(player_ptr, 0);
msg_print(_("深淵から何かがあなたを覗き込んでいる!", "Something gazes you from abyss!"));
if (!has_resist_chaos(player_ptr)) {
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint1(10));
+ (void)bss.hallucination(player_ptr->hallucinated + randint1(10));
}
if (!has_resist_conf(player_ptr)) {
}
if (!has_resist_chaos(player_ptr) && one_in_(3)) {
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint0(250) + 150);
+ (void)bss.hallucination(player_ptr->hallucinated + randint0(250) + 150);
}
player_ptr->csp -= 50;
(void)do_dec_stat(player_ptr, A_WIS);
if (!has_resist_chaos(player_ptr)) {
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint0(250) + 150);
+ (void)bss.hallucination(player_ptr->hallucinated + randint0(250) + 150);
}
}
int pattern_type = f_info[floor_ptr->grid_array[player_ptr->y][player_ptr->x].feat].subtype;
switch (pattern_type) {
case PATTERN_TILE_END:
- (void)hallucination(player_ptr, 0);
+ (void)BadStatusSetter(player_ptr).hallucination(0);
(void)restore_all_status(player_ptr);
(void)restore_level(player_ptr);
(void)cure_critical_wounds(player_ptr, 1000);
} else {
if (one_in_(3)) {
msg_print(_("き~れいなちょおちょらとんれいる~", "Thishcischs GooDSChtuff!"));
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint0(150) + 150);
+ (void)bss.hallucination(player_ptr->hallucinated + randint0(150) + 150);
}
}
}
if (!has_resist_chaos(player_ptr)) {
disturb(player_ptr, false, true);
player_ptr->redraw |= PR_EXTRA;
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint0(50) + 20);
+ (void)bss.hallucination(player_ptr->hallucinated + randint0(50) + 20);
}
}
create_rune_protection_one(player_ptr);
(void)bss.afraidness(0);
(void)bss.blindness(0);
- (void)hallucination(player_ptr, 0);
+ (void)bss.hallucination(0);
set_blessed(player_ptr, randint0(25) + 25, true);
set_bits(player_ptr->redraw, PR_STATS);
return true;
else if (!has_resist_conf(player_ptr))
player_ptr->special_attack |= ATTACK_SUIKEN;
- if (!has_resist_conf(player_ptr) && BadStatusSetter(player_ptr).confusion(randint0(20) + 15)) {
+ BadStatusSetter bss(player_ptr);
+ if (!has_resist_conf(player_ptr) && bss.confusion(randint0(20) + 15)) {
ident = true;
}
return ident;
}
- if (one_in_(2) && hallucination(player_ptr, player_ptr->hallucinated + randint0(150) + 150)) {
+ if (one_in_(2) && bss.hallucination(player_ptr->hallucinated + randint0(150) + 150)) {
ident = true;
}
break;
case SV_POTION_NEO_TSUYOSHI:
- (void)hallucination(player_ptr, 0);
+ (void)BadStatusSetter(player_ptr).hallucination(0);
(void)set_tsuyoshi(player_ptr, player_ptr->tsuyoshi + randint1(100) + 100, false);
ident = true;
break;
player_ptr->tsuyoshi = 1;
(void)set_tsuyoshi(player_ptr, 0, true);
if (!has_resist_chaos(player_ptr)) {
- (void)hallucination(player_ptr, 50 + randint1(50));
+ (void)BadStatusSetter(player_ptr).hallucination(50 + randint1(50));
}
ident = true;
break;
}
if (!has_resist_chaos(player_ptr) && one_in_(3)) {
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint0(250) + 150);
+ (void)bss.hallucination(player_ptr->hallucinated + randint0(250) + 150);
}
/*!< @todo いつからかは不明だがreturnとbreakが同時に存在している。どちらがデッドコードか不明瞭なので保留 */
(void)bss.paralysis(player_ptr->paralyzed + randint0(4) + 4);
}
if (!has_resist_chaos(player_ptr)) {
- (void)hallucination(player_ptr, player_ptr->hallucinated + randint0(250) + 150);
+ (void)bss.hallucination(player_ptr->hallucinated + randint0(250) + 150);
}
do {
(void)bss.poison(0);
(void)bss.blindness(0);
(void)bss.confusion(0);
- (void)hallucination(player_ptr, 0);
+ (void)bss.hallucination(0);
(void)set_stun(player_ptr, 0);
(void)set_cut(player_ptr, 0);
(void)bss.paralysis(0);
ident = true;
}
- if (hallucination(player_ptr, 0)) {
+ if (bss.hallucination(0)) {
ident = true;
}
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details Note that we must redraw the map when hallucination changes.
*/
-bool hallucination(player_type *player_ptr, TIME_EFFECT v)
+bool BadStatusSetter::hallucination(TIME_EFFECT v)
{
- bool notice = false;
+ auto notice = false;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
- if (player_ptr->is_dead)
+ if (this->player_ptr->is_dead) {
return false;
- if (is_chargeman(player_ptr))
+ }
+
+ if (is_chargeman(this->player_ptr)) {
v = 0;
+ }
if (v) {
- set_tsuyoshi(player_ptr, 0, true);
- if (!player_ptr->hallucinated) {
+ set_tsuyoshi(this->player_ptr, 0, true);
+ if (!this->player_ptr->hallucinated) {
msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
+ if (this->player_ptr->concent) {
+ reset_concentration(this->player_ptr, true);
+ }
- /* Sniper */
- if (player_ptr->concent)
- reset_concentration(player_ptr, true);
-
- player_ptr->counter = false;
+ this->player_ptr->counter = false;
notice = true;
}
} else {
- if (player_ptr->hallucinated) {
+ if (this->player_ptr->hallucinated) {
msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
notice = true;
}
}
- player_ptr->hallucinated = v;
- player_ptr->redraw |= (PR_STATUS);
-
- if (!notice)
+ this->player_ptr->hallucinated = v;
+ this->player_ptr->redraw |= PR_STATUS;
+ if (!notice) {
return false;
+ }
- if (disturb_state)
- disturb(player_ptr, false, true);
+ if (disturb_state) {
+ disturb(this->player_ptr, false, true);
+ }
- player_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
- player_ptr->update |= (PU_MONSTERS);
- player_ptr->window_flags |= (PW_OVERHEAD | PW_DUNGEON);
- handle_stuff(player_ptr);
+ this->player_ptr->redraw |= PR_MAP | PR_HEALTH | PR_UHEALTH;
+ this->player_ptr->update |= PU_MONSTERS;
+ this->player_ptr->window_flags |= PW_OVERHEAD | PW_DUNGEON;
+ handle_stuff(this->player_ptr);
return true;
}
bool poison(TIME_EFFECT v);
bool afraidness(TIME_EFFECT v);
bool paralysis(TIME_EFFECT v);
+ bool hallucination(TIME_EFFECT v);
private:
player_type *player_ptr;
};
-bool hallucination(player_type *player_ptr, TIME_EFFECT v);
bool set_slow(player_type *player_ptr, TIME_EFFECT v, bool do_dec);
bool set_stun(player_type *player_ptr, TIME_EFFECT v);
bool set_cut(player_type *player_ptr, TIME_EFFECT v);