Angband
Functions
cmds.h File Reference

Header for game command files. More...

#include "cave.h"
#include "cmd-core.h"

Go to the source code of this file.

Functions

void do_cmd_go_up (struct command *cmd)
 Go up one level. More...
 
void do_cmd_go_down (struct command *cmd)
 Go down one level. More...
 
void do_cmd_open (struct command *cmd)
 Open a closed/locked/jammed door or a closed/locked chest. More...
 
void do_cmd_close (struct command *cmd)
 Close an open door. More...
 
void do_cmd_tunnel (struct command *cmd)
 Tunnel through "walls" (including rubble and doors, secret or otherwise) More...
 
void do_cmd_disarm (struct command *cmd)
 Disarms a trap, or a chest. More...
 
void do_cmd_alter_aux (int dir)
 Manipulate an adjacent grid in some way. More...
 
void do_cmd_alter (struct command *cmd)
 
void move_player (int dir, bool disarm)
 Move player in the given direction. More...
 
void do_cmd_walk (struct command *cmd)
 Walk in the given direction. More...
 
void do_cmd_jump (struct command *cmd)
 Walk into a trap. More...
 
void do_cmd_run (struct command *cmd)
 Start running. More...
 
void do_cmd_pathfind (struct command *cmd)
 Start running with pathfinder. More...
 
void do_cmd_hold (struct command *cmd)
 Stay still. More...
 
void do_cmd_rest (struct command *cmd)
 Rest (restores hit points and mana and such) More...
 
void do_cmd_sleep (struct command *cmd)
 Spend a turn doing nothing. More...
 
void display_feeling (bool obj_only)
 Display the feeling. More...
 
void do_cmd_feeling (void)
 
void do_cmd_wizard (void)
 Toggle wizard mode. More...
 
void do_cmd_suicide (struct command *cmd)
 Commit suicide. More...
 
void do_cmd_note (void)
 Record the player's thoughts as a note. More...
 
void do_cmd_uninscribe (struct command *cmd)
 

Inscriptions

More...
 
void do_cmd_inscribe (struct command *cmd)
 Add inscription. More...
 
void do_cmd_autoinscribe (struct command *cmd)
 Autoinscribe all appropriate objects. More...
 
void do_cmd_takeoff (struct command *cmd)
 

Taking off/putting on

More...
 
void do_cmd_wield (struct command *cmd)
 Wield or wear an item. More...
 
void do_cmd_drop (struct command *cmd)
 Drop an item. More...
 
void do_cmd_read_scroll (struct command *cmd)
 Read a scroll. More...
 
void do_cmd_use_staff (struct command *cmd)
 Use a staff. More...
 
void do_cmd_aim_wand (struct command *cmd)
 Aim a wand. More...
 
void do_cmd_zap_rod (struct command *cmd)
 Zap a rod. More...
 
void do_cmd_activate (struct command *cmd)
 Activate an object. More...
 
void do_cmd_eat_food (struct command *cmd)
 Eat some food. More...
 
void do_cmd_quaff_potion (struct command *cmd)
 Quaff a potion. More...
 
void do_cmd_use (struct command *cmd)
 Use any usable item. More...
 
void do_cmd_refill (struct command *cmd)
 
void do_cmd_cast (struct command *cmd)
 

Spell casting

More...
 
void do_cmd_study_spell (struct command *cmd)
 Gain a specific spell, specified by spell number (for mages). More...
 
void do_cmd_study_book (struct command *cmd)
 Gain a random spell from the given book (for priests) More...
 
void do_cmd_study (struct command *cmd)
 Choose the way to study. More...
 
int do_autopickup (struct player *p)
 Pick up everything on the floor that requires no player action. More...
 
void do_cmd_pickup (struct command *cmd)
 Pick up objects at the player's request. More...
 
void do_cmd_autopickup (struct command *cmd)
 Pick up or look at objects on a square when the player steps onto it. More...
 

Detailed Description

Header for game command files.

Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke Copyright (c) 2007-9 Andi Sidwell, Chris Carr, Ed Graham, Erik Osheim

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

void display_feeling ( bool  obj_only)

Display the feeling.

Players always get a monster feeling. Object feelings are delayed until the player has explored some of the level.

References cave, player::depth, disturb(), chunk::feeling, angband_constants::feeling_need, chunk::feeling_squares, mon_feeling_text, msg, N_ELEMENTS, obj_feeling_text, OPT, and z_info.

Referenced by do_cmd_feeling(), on_new_level(), and update_one().

int do_autopickup ( struct player p)

Pick up everything on the floor that requires no player action.

References auto_pickup_okay(), cave, disturb(), ignore_item_ok(), inven_carry_num(), object::next, player_pickup_aux(), player_pickup_gold(), player::px, player::py, and square_object().

Referenced by do_cmd_autopickup(), and do_cmd_hold().

void do_cmd_activate ( struct command cmd)
void do_cmd_aim_wand ( struct command cmd)
void do_cmd_alter ( struct command cmd)
void do_cmd_alter_aux ( int  dir)

Manipulate an adjacent grid in some way.

Attack monsters, tunnel through walls, disarm traps, open doors.

This command must always take energy, to prevent free detection of invisible monsters.

The "semantics" of this command must be chosen before the player is confused, and it must be verified against the new grid.

References cave, ddx, ddy, disturb(), do_cmd_disarm_aux(), do_cmd_open_aux(), do_cmd_tunnel_aux(), player_upkeep::energy_use, square::mon, angband_constants::move_energy, msg, player_confuse_dir(), player::px, player::py, py_attack(), square_iscloseddoor(), square_isdiggable(), square_isdisarmabletrap(), chunk::squares, player::upkeep, and z_info.

Referenced by do_cmd_alter(), and move_player().

void do_cmd_autoinscribe ( struct command cmd)

Autoinscribe all appropriate objects.

References autoinscribe_ground(), autoinscribe_pack(), PR_EQUIP, PR_INVEN, player_upkeep::redraw, and player::upkeep.

void do_cmd_autopickup ( struct command cmd)

Pick up or look at objects on a square when the player steps onto it.

References do_autopickup(), player_upkeep::energy_use, EVENT_SEEFLOOR, event_signal(), angband_constants::move_energy, PR_ITEMLIST, player_upkeep::redraw, player::upkeep, and z_info.

void do_cmd_cast ( struct command cmd)
void do_cmd_close ( struct command cmd)
void do_cmd_disarm ( struct command cmd)
void do_cmd_drop ( struct command cmd)
void do_cmd_eat_food ( struct command cmd)

Eat some food.

References cmd_get_item(), CMD_OK, tval_is_edible(), use_aux(), USE_FLOOR, USE_INVEN, and USE_SINGLE.

Referenced by do_cmd_use().

void do_cmd_feeling ( void  )

References display_feeling().

void do_cmd_go_down ( struct command cmd)
void do_cmd_go_up ( struct command cmd)
void do_cmd_hold ( struct command cmd)
void do_cmd_inscribe ( struct command cmd)
void do_cmd_jump ( struct command cmd)
void do_cmd_note ( void  )

Record the player's thoughts as a note.

This both displays the note back to the player and adds it to the game log. Two fancy note types are supported: notes beginning with "/say" will be written as 'Frodo says: "____"', and notes beginning with "/me" will be written as 'Frodo ____'.

References player::full_name, get_string(), history_add(), msg, my_strcpy(), note(), and strnfmt().

void do_cmd_open ( struct command cmd)
void do_cmd_pathfind ( struct command cmd)

Start running with pathfinder.

Note that running while confused is not allowed.

References cmd_get_arg_point(), findpath(), PU_TORCH, run_step(), player_upkeep::running, player_upkeep::running_withpathfind, player::timed, player_upkeep::update, and player::upkeep.

void do_cmd_pickup ( struct command cmd)
void do_cmd_quaff_potion ( struct command cmd)

Quaff a potion.

References cmd_get_item(), CMD_OK, tval_is_potion(), use_aux(), USE_FLOOR, USE_INVEN, and USE_SINGLE.

Referenced by do_cmd_use().

void do_cmd_read_scroll ( struct command cmd)
void do_cmd_refill ( struct command cmd)
void do_cmd_rest ( struct command cmd)
void do_cmd_run ( struct command cmd)

Start running.

Note that running while confused is not allowed.

References cmd_get_direction(), CMD_OK, ddx, ddy, do_cmd_walk_test(), player_confuse_dir(), player::px, player::py, and run_step().

void do_cmd_sleep ( struct command cmd)

Spend a turn doing nothing.

References player_upkeep::energy_use, angband_constants::move_energy, player::upkeep, and z_info.

void do_cmd_study ( struct command cmd)

Choose the way to study.

Choose life. Choose a career. Choose family. Choose a fucking big monster, choose orc shamans, kobolds, dark elven druids, and Mim, Betrayer of Turin.

References do_cmd_study_book(), do_cmd_study_spell(), and player_has.

void do_cmd_study_book ( struct command cmd)
void do_cmd_study_spell ( struct command cmd)
void do_cmd_suicide ( struct command cmd)

Commit suicide.

References player::died_from, player::is_dead, and my_strcpy().

void do_cmd_takeoff ( struct command cmd)
void do_cmd_tunnel ( struct command cmd)

Tunnel through "walls" (including rubble and doors, secret or otherwise)

Digging is very difficult without a "digger" weapon, but can be accomplished by strong players using heavy weapons.

References cave, cmd_get_direction(), ddx, ddy, disturb(), do_cmd_tunnel_aux(), do_cmd_tunnel_test(), player_upkeep::energy_use, square::mon, angband_constants::move_energy, msg, player_confuse_dir(), player::px, player::py, py_attack(), chunk::squares, player::upkeep, and z_info.

void do_cmd_uninscribe ( struct command cmd)
void do_cmd_use ( struct command cmd)
void do_cmd_use_staff ( struct command cmd)
void do_cmd_walk ( struct command cmd)
void do_cmd_wield ( struct command cmd)
void do_cmd_wizard ( void  )
void do_cmd_zap_rod ( struct command cmd)
void move_player ( int  dir,
bool  disarm 
)