extern void display_roff(int r_idx);
extern void output_monster_spoiler(int r_idx, void (*roff_func)(byte attr, cptr str));
extern void create_name(int type, char *name);
-/* monster1.c (was in monster3.c ??) */
-extern bool monster_quest(int r_idx);
-extern bool monster_dungeon(int r_idx);
-extern bool monster_ocean(int r_idx);
-extern bool monster_shore(int r_idx);
-extern bool monster_town(int r_idx);
-extern bool monster_wood(int r_idx);
-extern bool monster_volcano(int r_idx);
-extern bool monster_mountain(int r_idx);
-extern bool monster_grass(int r_idx);
-extern bool monster_deep_water(int r_idx);
-extern bool monster_shallow_water(int r_idx);
-extern bool monster_lava(int r_idx);
+extern bool mon_hook_dungeon(int r_idx);
+
extern monster_hook_type get_monster_hook(void);
extern monster_hook_type get_monster_hook2(int y, int x);
extern void set_friendly(monster_type *m_ptr);
}
-bool monster_quest(int r_idx)
-{
- monster_race *r_ptr = &r_info[r_idx];
-
- /* Random quests are in the dungeon */
- if (r_ptr->flags8 & RF8_WILD_ONLY) return FALSE;
-
- /* No random quests for aquatic monsters */
- if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
-
- /* No random quests for multiplying monsters */
- if (r_ptr->flags2 & RF2_MULTIPLY) return FALSE;
-
- /* No quests to kill friendly monsters */
- if (r_ptr->flags7 & RF7_FRIENDLY) return FALSE;
-
- return TRUE;
-}
-
-
-bool monster_dungeon(int r_idx)
+bool mon_hook_dungeon(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_ocean(int r_idx)
+static bool mon_hook_ocean(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_shore(int r_idx)
+static bool mon_hook_shore(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-static bool monster_waste(int r_idx)
+static bool mon_hook_waste(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_town(int r_idx)
+static bool mon_hook_town(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_wood(int r_idx)
+static bool mon_hook_wood(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_volcano(int r_idx)
+static bool mon_hook_volcano(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_mountain(int r_idx)
+static bool mon_hook_mountain(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_grass(int r_idx)
+static bool mon_hook_grass(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
}
-bool monster_deep_water(int r_idx)
+static bool mon_hook_deep_water(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- if (!monster_dungeon(r_idx)) return FALSE;
+ if (!mon_hook_dungeon(r_idx)) return FALSE;
if (r_ptr->flags7 & RF7_AQUATIC)
return TRUE;
}
-bool monster_shallow_water(int r_idx)
+static bool mon_hook_shallow_water(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- if (!monster_dungeon(r_idx)) return FALSE;
+ if (!mon_hook_dungeon(r_idx)) return FALSE;
if (r_ptr->flags2 & RF2_AURA_FIRE)
return FALSE;
}
-bool monster_lava(int r_idx)
+static bool mon_hook_lava(int r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- if (!monster_dungeon(r_idx)) return FALSE;
+ if (!mon_hook_dungeon(r_idx)) return FALSE;
if (((r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK) ||
(r_ptr->flags7 & RF7_CAN_FLY)) &&
}
+static bool mon_hook_floor(int r_idx)
+{
+ monster_race *r_ptr = &r_info[r_idx];
+
+ if (!mon_hook_dungeon(r_idx)) return FALSE;
+
+ if (!(r_ptr->flags7 & RF7_AQUATIC) ||
+ (r_ptr->flags7 & RF7_CAN_FLY))
+ return TRUE;
+ else
+ return FALSE;
+}
+
+
monster_hook_type get_monster_hook(void)
{
if (!dun_level && !p_ptr->inside_quest)
switch (wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].terrain)
{
case TERRAIN_TOWN:
- return (monster_hook_type)monster_town;
+ return (monster_hook_type)mon_hook_town;
case TERRAIN_DEEP_WATER:
- return (monster_hook_type)monster_ocean;
+ return (monster_hook_type)mon_hook_ocean;
case TERRAIN_SHALLOW_WATER:
case TERRAIN_SWAMP:
- return (monster_hook_type)monster_shore;
+ return (monster_hook_type)mon_hook_shore;
case TERRAIN_DIRT:
case TERRAIN_DESERT:
- return (monster_hook_type)monster_waste;
+ return (monster_hook_type)mon_hook_waste;
case TERRAIN_GRASS:
- return (monster_hook_type)monster_grass;
+ return (monster_hook_type)mon_hook_grass;
case TERRAIN_TREES:
- return (monster_hook_type)monster_wood;
+ return (monster_hook_type)mon_hook_wood;
case TERRAIN_SHALLOW_LAVA:
case TERRAIN_DEEP_LAVA:
- return (monster_hook_type)monster_volcano;
+ return (monster_hook_type)mon_hook_volcano;
case TERRAIN_MOUNTAIN:
- return (monster_hook_type)monster_mountain;
+ return (monster_hook_type)mon_hook_mountain;
default:
- return (monster_hook_type)monster_dungeon;
+ return (monster_hook_type)mon_hook_dungeon;
}
}
else
{
- return (monster_hook_type)monster_dungeon;
+ return (monster_hook_type)mon_hook_dungeon;
}
}
switch (cave[y][x].feat)
{
case FEAT_SHAL_WATER:
- return (monster_hook_type)monster_shallow_water;
+ return (monster_hook_type)mon_hook_shallow_water;
case FEAT_DEEP_WATER:
- return (monster_hook_type)monster_deep_water;
+ return (monster_hook_type)mon_hook_deep_water;
case FEAT_DEEP_LAVA:
case FEAT_SHAL_LAVA:
- return (monster_hook_type)monster_lava;
+ return (monster_hook_type)mon_hook_lava;
default:
- return NULL;
+ return (monster_hook_type)mon_hook_floor;
}
}