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.


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 (struct command *cmd)
void do_cmd_steal (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_mon_command (struct command *cmd)
 Make a monster perform an action. More...
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)


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

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

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

◆ display_feeling()

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().

◆ do_autopickup()

int do_autopickup ( struct player p)

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

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

Referenced by do_cmd_autopickup(), and do_cmd_hold().

◆ do_cmd_activate()

void do_cmd_activate ( struct command cmd)

◆ do_cmd_aim_wand()

void do_cmd_aim_wand ( struct command cmd)

◆ do_cmd_alter()

void do_cmd_alter ( struct command cmd)

◆ do_cmd_autoinscribe()

void do_cmd_autoinscribe ( struct command cmd)

◆ do_cmd_autopickup()

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.

◆ do_cmd_cast()

void do_cmd_cast ( struct command cmd)

◆ do_cmd_close()

void do_cmd_close ( struct command cmd)

◆ do_cmd_disarm()

void do_cmd_disarm ( struct command cmd)

◆ do_cmd_drop()

void do_cmd_drop ( struct command cmd)

◆ do_cmd_eat_food()

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().

◆ do_cmd_feeling()

void do_cmd_feeling ( void  )

References display_feeling().

◆ do_cmd_go_down()

void do_cmd_go_down ( struct command cmd)

◆ do_cmd_go_up()

void do_cmd_go_up ( struct command cmd)

◆ do_cmd_hold()

void do_cmd_hold ( struct command cmd)

◆ do_cmd_inscribe()

void do_cmd_inscribe ( struct command cmd)

◆ do_cmd_jump()

void do_cmd_jump ( struct command cmd)

◆ do_cmd_mon_command()

void do_cmd_mon_command ( struct command cmd)

Make a monster perform an action.

Currently possible actions are cast a random spell, drop a random item, stand still, or move (attacking any intervening monster).

References monster_lore::cast_innate, monster_lore::cast_spell, cave, choose_attack_spell(), CMD_CAST, CMD_DROP, cmd_get_direction(), CMD_HOLD, CMD_OK, CMD_READ_SCROLL, CMD_WALK, command::code, ddgrid, monster_lore::deaths, DIR_UNKNOWN, do_mon_spell(), drop_near(), player_upkeep::energy_use, monster_lore::flags, monster_race::flags, get_aim_dir(), get_commanded_monster(), get_lore(), get_random_monster_object(), monster::grid, object::held_m_idx, monster::held_obj, monster::hp, ignore_item_ok(), player::is_dead, loc_sum(), lore_update(), MDESC_CAPITAL, MDESC_IND_HID, target::midx, monster::midx, mon_clear_timed(), mon_spell_is_innate(), MON_TMD_FLG_NOTIFY, monster_attack_monster(), monster_desc(), monster_is_visible(), monster_swap(), angband_constants::move_energy, msg, object_desc(), ODESC_FULL, ODESC_PREFIX, pile_excise(), player_clear_timed(), PU_MONSTERS, PU_UPDATE_VIEW, monster::race, randint0, rf_has, rf_on, rsf_copy, rsf_on, RSF_SIZE, monster_lore::spell_flags, monster_race::spell_flags, square_destroy_wall(), square_door_power(), square_iscloseddoor(), square_islockeddoor(), square_ispassable(), square_isperm(), square_issecretdoor(), square_iswall(), square_monster(), square_open_door(), square_set_door_lock(), square_smash_door(), square_smash_wall(), monster::target, target_get_monster(), target_set_monster(), player::timed, player_upkeep::update, player::upkeep, and z_info.

◆ do_cmd_note()

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().

◆ do_cmd_open()

void do_cmd_open ( struct command cmd)

◆ do_cmd_pathfind()

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, player::upkeep, loc::x, and loc::y.

◆ do_cmd_pickup()

void do_cmd_pickup ( struct command cmd)

◆ do_cmd_quaff_potion()

void do_cmd_quaff_potion ( struct command cmd)

◆ do_cmd_read_scroll()

void do_cmd_read_scroll ( struct command cmd)

◆ do_cmd_refill()

void do_cmd_refill ( struct command cmd)

◆ do_cmd_rest()

void do_cmd_rest ( struct command cmd)

◆ do_cmd_run()

void do_cmd_run ( struct command cmd)

Start running.

Note that running while confused is not allowed.

References cmd_get_direction(), CMD_OK, ddgrid, do_cmd_walk_test(), player::grid, loc_sum(), command::nrepeats, player_confuse_dir(), run_step(), player_upkeep::running, and player::upkeep.

◆ do_cmd_sleep()

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.

◆ do_cmd_steal()

void do_cmd_steal ( struct command cmd)

◆ do_cmd_study()

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(), get_check(), msg, player_shape::name, player_has, player_is_shapechanged(), player_resume_normal_shape(), and player::shape.

◆ do_cmd_study_book()

void do_cmd_study_book ( struct command cmd)

◆ do_cmd_study_spell()

void do_cmd_study_spell ( struct command cmd)

◆ do_cmd_suicide()

void do_cmd_suicide ( struct command cmd)

Commit suicide.

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

◆ do_cmd_takeoff()

void do_cmd_takeoff ( struct command cmd)

◆ do_cmd_tunnel()

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(), ddgrid, disturb(), do_cmd_tunnel_aux(), do_cmd_tunnel_test(), player_upkeep::energy_use, player::grid, loc_sum(), angband_constants::move_energy, msg, player_confuse_dir(), py_attack(), square(), player::upkeep, and z_info.

◆ do_cmd_uninscribe()

void do_cmd_uninscribe ( struct command cmd)

◆ do_cmd_use()

void do_cmd_use ( struct command cmd)

◆ do_cmd_use_staff()

void do_cmd_use_staff ( struct command cmd)

◆ do_cmd_walk()

void do_cmd_walk ( struct command cmd)

◆ do_cmd_wield()

void do_cmd_wield ( struct command cmd)

◆ do_cmd_wizard()

void do_cmd_wizard ( void  )

◆ do_cmd_zap_rod()

void do_cmd_zap_rod ( struct command cmd)

◆ move_player()

void move_player ( int  dir,
bool  disarm