Angband
Data Structures | Functions
mon-group.h File Reference

Monster group behaviours. More...

#include "monster.h"

Go to the source code of this file.

Data Structures

struct  mon_group_list_entry
 
struct  monster_group
 

Functions

struct monster_groupmonster_group_new (void)
 Allocate a new monster group. More...
 
void monster_group_free (struct chunk *c, struct monster_group *group)
 Free a monster group. More...
 
void monster_remove_from_groups (struct chunk *c, struct monster *mon)
 Remove a monster from a monster group, deleting the group if it's empty. More...
 
int monster_group_index_new (struct chunk *c)
 Get the next available monster group index. More...
 
void monster_add_to_group (struct chunk *c, struct monster *mon, struct monster_group *group)
 Add a monster to an existing monster group. More...
 
void monster_group_start (struct chunk *c, struct monster *mon, int which)
 Make a monster group for a single monster. More...
 
void monster_group_assign (struct chunk *c, struct monster *mon, struct monster_group_info *info, bool loading)
 Assign a monster to a monster group. More...
 
int monster_group_index (struct monster_group *group)
 Get the index of a monster group. More...
 
struct monster_groupmonster_group_by_index (struct chunk *c, int index)
 Get a monster group from its index. More...
 
bool monster_group_change_index (struct chunk *c, int new, int old)
 Change the group record of the index of a monster (for one or two groups) More...
 
struct monster_groupsummon_group (struct chunk *c, int midx)
 Get the group of summons of a monster. More...
 
void monster_group_rouse (struct chunk *c, struct monster *mon)
 Monster who is aware of the player tries to let its group know. More...
 
int monster_primary_group_size (struct chunk *c, const struct monster *mon)
 Get the size of a monster's primary group. More...
 
struct monstergroup_monster_tracking (struct chunk *c, const struct monster *mon)
 Find a group monster which is tracking. More...
 
int monster_group_leader_idx (struct monster_group *group)
 Get the index of the leader of a monster group. More...
 
struct monstermonster_group_leader (struct chunk *c, struct monster *mon)
 Get the leader of a monster group. More...
 
void monster_groups_verify (struct chunk *c)
 Verify the integrity of all the monster groups. More...
 

Detailed Description

Monster group behaviours.

Copyright (c) 2018 Nick McConnell

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Function Documentation

◆ group_monster_tracking()

struct monster* group_monster_tracking ( struct chunk c,
const struct monster mon 
)

◆ monster_add_to_group()

void monster_add_to_group ( struct chunk c,
struct monster mon,
struct monster_group group 
)

◆ monster_group_assign()

void monster_group_assign ( struct chunk c,
struct monster mon,
struct monster_group_info info,
bool  loading 
)

◆ monster_group_by_index()

struct monster_group* monster_group_by_index ( struct chunk c,
int  index 
)

Get a monster group from its index.

References index, and chunk::monster_groups.

Referenced by monster_group_assign(), monster_group_change_index(), and summon_group().

◆ monster_group_change_index()

bool monster_group_change_index ( struct chunk c,
int  new,
int  old 
)

◆ monster_group_free()

void monster_group_free ( struct chunk c,
struct monster_group group 
)

◆ monster_group_index()

int monster_group_index ( struct monster_group group)

Get the index of a monster group.

References monster_group::index.

◆ monster_group_index_new()

int monster_group_index_new ( struct chunk c)

Get the next available monster group index.

References index, angband_constants::level_monster_max, chunk::monster_groups, and z_info.

Referenced by build_pit(), monster_group_start(), and place_new_monster().

◆ monster_group_leader()

struct monster* monster_group_leader ( struct chunk c,
struct monster mon 
)

◆ monster_group_leader_idx()

int monster_group_leader_idx ( struct monster_group group)

Get the index of the leader of a monster group.

References monster_group::leader.

◆ monster_group_new()

struct monster_group* monster_group_new ( void  )

Allocate a new monster group.

References mem_zalloc().

Referenced by monster_group_assign(), and monster_group_start().

◆ monster_group_rouse()

void monster_group_rouse ( struct chunk c,
struct monster mon 
)

◆ monster_group_start()

void monster_group_start ( struct chunk c,
struct monster mon,
int  which 
)

◆ monster_groups_verify()

void monster_groups_verify ( struct chunk c)

◆ monster_primary_group_size()

int monster_primary_group_size ( struct chunk c,
const struct monster mon 
)

◆ monster_remove_from_groups()

void monster_remove_from_groups ( struct chunk c,
struct monster mon 
)

◆ summon_group()

struct monster_group* summon_group ( struct chunk c,
int  midx 
)