X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmonster2.c;h=db89286e723b645510d1534f3b55eb1ce601659b;hb=7de4d6dfb51f88bb16a02b538ab727fc1a6b9858;hp=0ced3fe3c4344adaee50500be5e201d7fc1598cb;hpb=3a2cdc25bc82ffde221861af828cf937ce1e6ec8;p=hengband%2Fhengband.git diff --git a/src/monster2.c b/src/monster2.c index 0ced3fe3c..db89286e7 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -23,7 +23,7 @@ * @var horror_desc * @brief ELDRITCH HORROR効果時のモンスターの形容メッセージ(通常時) */ -cptr horror_desc[MAX_SAN_HORROR] = +concptr horror_desc[MAX_SAN_HORROR] = { #ifdef JP "忌まわしい", @@ -81,7 +81,7 @@ cptr horror_desc[MAX_SAN_HORROR] = * @var funny_desc * @brief ELDRITCH HORROR効果時のモンスターの形容メッセージ(幻覚状態時) */ -cptr funny_desc[MAX_SAN_FUNNY] = +concptr funny_desc[MAX_SAN_FUNNY] = { #ifdef JP "間抜けな", @@ -145,7 +145,7 @@ cptr funny_desc[MAX_SAN_FUNNY] = * @var funny_comments * @brief ELDRITCH HORROR効果時の幻覚時間延長を示す錯乱表現 */ -cptr funny_comments[MAX_SAN_COMMENT] = +concptr funny_comments[MAX_SAN_COMMENT] = { #ifdef JP /* nuke me */ @@ -468,7 +468,7 @@ void compact_monsters(int size) if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE); do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_COMPACT, m_name); } @@ -793,7 +793,6 @@ static bool summon_specific_aux(MONRACE_IDX r_idx) break; } - case SUMMON_KIN: { okay = ((r_ptr->d_char == summon_kin_type) && (r_idx != MON_HAGURE)); @@ -1170,7 +1169,7 @@ errr get_mon_num_prep(monsterrace_hook_type monster_hook, /* Scan the allocation table */ for (i = 0; i < alloc_race_size; i++) { - monster_race *r_ptr; + monster_race *r_ptr; /* Get the entry */ alloc_entry *entry = &alloc_race_table[i]; @@ -1457,12 +1456,12 @@ MONRACE_IDX get_mon_num(DEPTH level) */ void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode) { - cptr res; + concptr res; monster_race *r_ptr; - cptr name; + concptr name; char buf[128]; - char silly_name[1024]; + GAME_TEXT silly_name[1024]; bool seen, pron; bool named = FALSE; @@ -1904,7 +1903,7 @@ void sanity_blast(monster_type *m_ptr, bool necro) if (!necro && m_ptr) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; monster_race *r_ptr = &r_info[m_ptr->ap_r_idx]; power = r_ptr->level / 2; @@ -1983,8 +1982,8 @@ void sanity_blast(monster_type *m_ptr, bool necro) else if(!necro) { monster_race *r_ptr; - char m_name[80]; - cptr desc; + GAME_TEXT m_name[MAX_NLEN]; + concptr desc; get_mon_num_prep(get_nightmare, NULL); @@ -1994,7 +1993,6 @@ void sanity_blast(monster_type *m_ptr, bool necro) get_mon_num_prep(NULL, NULL); - /* Describe it */ #ifndef JP if (!(r_ptr->flags1 & RF1_UNIQUE)) sprintf(m_name, "%s %s", (is_a_vowel(desc[0]) ? "an" : "a"), desc); @@ -2474,7 +2472,6 @@ void update_monster(MONSTER_IDX m_idx, bool full) /* Handle "cold blooded" monsters */ if ((r_ptr->flags2 & (RF2_COLD_BLOOD | RF2_AURA_FIRE)) == RF2_COLD_BLOOD) { - /* Take note */ do_cold_blood = TRUE; } @@ -2492,7 +2489,6 @@ void update_monster(MONSTER_IDX m_idx, bool full) /* Handle "invisible" monsters */ if (r_ptr->flags2 & (RF2_INVISIBLE)) { - /* Take note */ do_invisible = TRUE; /* See invisible */ @@ -2735,7 +2731,7 @@ void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx) int oldmaxhp; monster_type *m_ptr = &m_list[m_idx]; monster_race *r_ptr; - char old_m_name[80]; + char old_m_name[MAX_NLEN]; bool old_unique = FALSE; int old_r_idx = m_ptr->r_idx; @@ -2801,7 +2797,7 @@ void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx) if (m_idx == p_ptr->riding) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); msg_format(_("突然%sが変身した。", "Suddenly, %s transforms!"), old_m_name); if (!(r_ptr->flags7 & RF7_RIDING)) @@ -2941,7 +2937,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I cave_type *c_ptr = &cave[y][x]; monster_type *m_ptr; monster_race *r_ptr = &r_info[r_idx]; - cptr name = (r_name + r_ptr->name); + concptr name = (r_name + r_ptr->name); int cmi; @@ -3252,9 +3248,9 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I { if (r_ptr->flags1 & RF1_UNIQUE) { - cptr color; + concptr color; object_type *o_ptr; - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; if (r_ptr->level > p_ptr->lev + 30) color = _("黒く", "black"); @@ -3585,7 +3581,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id place_monster_m_idx = hack_m_idx_ii; /* Reinforcement */ - for(i = 0; i < 6; i++) + for(i = 0; i < A_MAX; i++) { if(!r_ptr->reinforce_id[i]) break; n = damroll(r_ptr->reinforce_dd[i], r_ptr->reinforce_ds[i]); @@ -3722,18 +3718,18 @@ bool alloc_horde(POSITION y, POSITION x) m_idx = cave[y][x].m_idx; if (m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[m_list[m_idx].r_idx]; - summon_kin_type = r_ptr->d_char; for (attempts = randint1(10) + 5; attempts; attempts--) { scatter(&cy, &cx, y, x, 5, 0); - (void)summon_specific(m_idx, cy, cx, dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP); + (void)summon_specific(m_idx, cy, cx, dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP, r_ptr->d_char); y = cy; x = cx; } + if (cheat_hear) msg_format(_("モンスターの大群(%c)", "Monster horde (%c)."), r_ptr->d_char); return TRUE; } @@ -3831,7 +3827,6 @@ bool alloc_monster(POSITION dis, BIT_FLAGS mode) { if (alloc_horde(y, x)) { - if (cheat_hear) msg_format(_("モンスターの大群(%c)", "Monster horde (%c)."), summon_kin_type); return (TRUE); } } @@ -3924,7 +3919,7 @@ static bool summon_specific_okay(MONRACE_IDX r_idx) * * Note that this function may not succeed, though this is very rare. */ -bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode) +bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode, SYMBOL_CODE symbol) { POSITION x, y; MONRACE_IDX r_idx; @@ -3939,6 +3934,8 @@ bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int t /* Save the "summon" type */ summon_specific_type = type; + summon_kin_type = symbol; + summon_unique_okay = (mode & PM_ALLOW_UNIQUE) ? TRUE : FALSE; /* Prepare allocation table */ @@ -3979,7 +3976,7 @@ bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int t * @param mode 生成オプション * @return 召喚できたらtrueを返す */ -bool summon_named_creature (MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode) +bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode) { POSITION x, y; @@ -4044,15 +4041,15 @@ bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode) */ void message_pain(MONSTER_IDX m_idx, HIT_POINT dam) { - long oldhp, newhp, tmp; - int percentage; + HIT_POINT oldhp, newhp; + HIT_POINT tmp; + PERCENTAGE percentage; monster_type *m_ptr = &m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; - /* Get the monster name */ monster_desc(m_name, m_ptr, 0); if(dam == 0) // Notice non-damage @@ -4062,10 +4059,10 @@ void message_pain(MONSTER_IDX m_idx, HIT_POINT dam) } /* Note -- subtle fix -CFT */ - newhp = (long)(m_ptr->hp); - oldhp = newhp + (long)(dam); + newhp = m_ptr->hp; + oldhp = newhp + dam; tmp = (newhp * 100L) / oldhp; - percentage = (int)(tmp); + percentage = tmp; if(my_strchr(",ejmvwQ", r_ptr->d_char)) // Mushrooms, Eyes, Jellies, Molds, Vortices, Worms, Quylthulgs { @@ -4373,10 +4370,8 @@ void message_pain(MONSTER_IDX m_idx, HIT_POINT dam) void update_smart_learn(MONSTER_IDX m_idx, int what) { monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - /* Not allowed to learn */ if (!smart_learn) return; @@ -4386,8 +4381,6 @@ void update_smart_learn(MONSTER_IDX m_idx, int what) /* Not intelligent, only learn sometimes */ if (!(r_ptr->flags2 & (RF2_SMART)) && (randint0(100) < 50)) return; - - /* Analyze the knowledge */ switch (what) {