Angband
Data Structures | Macros | Enumerations | Functions | Variables
player-timed.h File Reference

Timed effects handling. More...

#include "player.h"
#include "list-player-timed.h"

Go to the source code of this file.

Data Structures

struct  timed_grade
 
struct  timed_effect_data
 Data struct. More...
 

Macros

#define TMD(a, b, c)   TMD_##a,
 

Enumerations

enum  { TMD_MAX }
 Timed effects. More...
 
enum  { TMD_FAIL_FLAG_OBJECT = 1, TMD_FAIL_FLAG_RESIST, TMD_FAIL_FLAG_VULN, TMD_FAIL_FLAG_PLAYER }
 Effect failure flag types. More...
 

Functions

int timed_name_to_idx (const char *name)
 
bool player_timed_grade_eq (struct player *p, int idx, char *match)
 Return true if the player timed effect matches the given string. More...
 
bool player_set_timed (struct player *p, int idx, int v, bool notify)
 

Setting, increasing, decreasing and clearing timed effects

More...
 
bool player_inc_check (struct player *p, int idx, bool lore)
 Check whether a timed effect will affect the player. More...
 
bool player_inc_timed (struct player *p, int idx, int v, bool notify, bool check)
 Increase the timed effect idx by v. More...
 
bool player_dec_timed (struct player *p, int idx, int v, bool notify)
 Decrease the timed effect idx by v. More...
 
bool player_clear_timed (struct player *p, int idx, bool notify)
 Clear the timed effect idx. More...
 

Variables

int PY_FOOD_MAX
 Player food values. More...
 
int PY_FOOD_FULL
 
int PY_FOOD_HUNGRY
 
int PY_FOOD_WEAK
 
int PY_FOOD_FAINT
 
int PY_FOOD_STARVE
 
struct file_parser player_timed_parser
 
struct timed_effect_data timed_effects [TMD_MAX]
 

Detailed Description

Timed effects handling.

Copyright (c) 1997 Ben Harrison Copyright (c) 2007 A Sidwell andi@.nosp@m.takk.nosp@m.aria..nosp@m.org

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.

Macro Definition Documentation

◆ TMD

#define TMD (   a,
  b,
 
)    TMD_##a,

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Timed effects.

Enumerator
TMD_MAX 

◆ anonymous enum

anonymous enum

Effect failure flag types.

Enumerator
TMD_FAIL_FLAG_OBJECT 
TMD_FAIL_FLAG_RESIST 
TMD_FAIL_FLAG_VULN 
TMD_FAIL_FLAG_PLAYER 

Function Documentation

◆ player_clear_timed()

bool player_clear_timed ( struct player p,
int  idx,
bool  notify 
)

◆ player_dec_timed()

bool player_dec_timed ( struct player p,
int  idx,
int  v,
bool  notify 
)

Decrease the timed effect idx by v.

Mention this if notify is true.

References player_set_timed(), player::timed, and TMD_MAX.

Referenced by decrease_timeouts(), effect_handler_TIMED_DEC(), and process_world().

◆ player_inc_check()

bool player_inc_check ( struct player p,
int  idx,
bool  lore 
)

◆ player_inc_timed()

bool player_inc_timed ( struct player p,
int  idx,
int  v,
bool  notify,
bool  check 
)

◆ player_set_timed()

bool player_set_timed ( struct player p,
int  idx,
int  v,
bool  notify 
)

◆ player_timed_grade_eq()

bool player_timed_grade_eq ( struct player p,
int  idx,
char *  match 
)

Return true if the player timed effect matches the given string.

References timed_grade::grade, timed_effect_data::grade, timed_grade::max, timed_grade::name, timed_grade::next, streq, and player::timed.

Referenced by decrease_timeouts(), and process_world().

◆ timed_name_to_idx()

int timed_name_to_idx ( const char *  name)

References i, my_stricmp(), and N_ELEMENTS.

Referenced by effect_subtype().

Variable Documentation

◆ player_timed_parser

struct file_parser player_timed_parser

◆ PY_FOOD_FAINT

int PY_FOOD_FAINT

◆ PY_FOOD_FULL

int PY_FOOD_FULL

◆ PY_FOOD_HUNGRY

int PY_FOOD_HUNGRY

◆ PY_FOOD_MAX

int PY_FOOD_MAX

Player food values.

Referenced by do_cmd_wiz_cure_all(), parse_player_timed_grade(), and wiz_cheat_death().

◆ PY_FOOD_STARVE

int PY_FOOD_STARVE

◆ PY_FOOD_WEAK

int PY_FOOD_WEAK

◆ timed_effects

struct timed_effect_data timed_effects[TMD_MAX]