Angband
Data Structures | Typedefs | Functions | Variables
mon-blows.h File Reference

Functions for managing monster melee. More...

#include "player.h"
#include "monster.h"

Go to the source code of this file.

Data Structures

struct  blow_message
 
struct  blow_method
 
struct  melee_effect_handler_context_s
 Storage for context information for effect handlers called in make_attack_normal(). More...
 
struct  blow_effect
 

Typedefs

typedef struct melee_effect_handler_context_s melee_effect_handler_context_t
 Storage for context information for effect handlers called in make_attack_normal(). More...
 
typedef void(* melee_effect_handler_f) (melee_effect_handler_context_t *)
 Melee blow effect handler. More...
 

Functions

int blow_index (const char *name)
 

Monster blow effect helper functions

More...
 
char * monster_blow_method_action (struct blow_method *method, int midx)
 Print a monster blow message. More...
 
melee_effect_handler_f melee_handler_for_blow_effect (const char *name)
 

Monster blow melee handler selection

More...
 

Variables

struct blow_methodblow_methods
 
struct blow_effectblow_effects
 

Detailed Description

Functions for managing monster melee.

Copyright (c) 1997 Ben Harrison, David Reeve Sward, Keldon Jones. 2013 Ben Semmler

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.

Typedef Documentation

◆ melee_effect_handler_context_t

Storage for context information for effect handlers called in make_attack_normal().

The members of this struct are initialized in an order-dependent way (to be more cross-platform). If the members change, make sure to change any initializers. Ideally, this should eventually used named initializers.

◆ melee_effect_handler_f

typedef void(* melee_effect_handler_f) (melee_effect_handler_context_t *)

Melee blow effect handler.

Function Documentation

◆ blow_index()

int blow_index ( const char *  name)


Monster blow effect helper functions

References blow_effects, angband_constants::blow_effects_max, i, my_stricmp(), blow_effect::name, and z_info.

Referenced by lore_append_attack().

◆ melee_handler_for_blow_effect()

melee_effect_handler_f melee_handler_for_blow_effect ( const char *  name)

◆ monster_blow_method_action()

char* monster_blow_method_action ( struct blow_method method,
int  midx 
)

Print a monster blow message.

We fill in the monster name and/or pronoun where necessary in the message to replace instances of {name} or {pronoun}.

References blow_message::act_msg, BLOW_TAG_HAS, blow_tag_lookup(), BLOW_TAG_OF_TARGET, BLOW_TAG_TARGET, buf, cave, cave_monster(), MDESC_TARG, blow_method::messages, monster_desc(), msg, blow_message::next, blow_method::next, blow_method::num_messages, randint0, string_make(), strnfcat(), and tag.

Referenced by make_attack_normal(), and monster_attack_monster().

Variable Documentation

◆ blow_effects

struct blow_effect* blow_effects

Referenced by blow_color(), and blow_index().

◆ blow_methods

struct blow_method* blow_methods