ljh_branch
Aurora 10 months ago
parent 9220172a5a
commit 23d49b3200

@ -6,22 +6,71 @@
/*
* Contains code for picking objects up, and container use.
*/
/*1. in_container(struct obj *):这个函数用于将指定的物品放入容器中。
2. out_container(struct obj *)
3. mbag_item_gone(boolean, struct obj *, boolean)
4. stash_ok(struct obj *)
5. explain_container_prompt(boolean)
6. traditional_loot(boolean)
7. menu_loot(int, boolean)
8. tip_ok(struct obj *)
9. tipcontainer_gettarget(struct obj *, boolean *)
10. tipcontainer_checks(struct obj *, struct obj *, boolean)
11. in_or_out_menu(const char *, struct obj *, boolean, boolean, boolean, boolean)
12. able_to_loot(coordxy, coordxy, boolean)
13. reverse_loot(void)
14. mon_beside(coordxy, coordxy)
15. do_loot_cont(struct obj **, int, int)*/
/*simple_look(struct obj *, boolean):用于简单地查看物体的函数。
query_classes(char *, boolean *, boolean *, const char *, struct obj *, boolean, int *)
fatal_corpse_mistake(struct obj *, boolean)
describe_decor(void)
check_here(boolean)
n_or_more(struct obj *)
all_but_uchain(struct obj *)
autopick(struct obj *, int, menu_item **)
count_categories(struct obj *, int)
delta_cwt(struct obj *, struct obj *)
carry_count(struct obj *, struct obj *, long, boolean, int *, int *)
lift_object(struct obj *, struct obj *, long *, boolean)
mbag_explodes(struct obj *, int)
is_boh_item_gone(void)
do_boh_explosion(struct obj *, boolean)
boh_loss(struct obj *, boolean)
in_container(struct obj *)
out_container(struct obj *)
mbag_item_gone(boolean, struct obj *, boolean)
stash_ok(struct obj *)
explain_container_prompt(boolean)
traditional_loot(boolean)
menu_loot(int, boolean)
tip_ok(struct obj *)
tipcontainer_gettarget(struct obj *, boolean *)
tipcontainer_checks(struct obj *, struct obj *, boolean)
in_or_out_menu(const char *, struct obj *, boolean, boolean, boolean, boolean)
able_to_loot(coordxy, coordxy, boolean)
reverse_loot(void)
mon_beside(coordxy, coordxy)
do_loot_cont(struct obj **, int, int)
doloot_core(void)
tipcontainer(struct obj *)*/
#include "hack.h"
#define CONTAINED_SYM '>' /* from invent.c */

@ -2,13 +2,21 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
/*putmesg(const char *):这个函数用于将传入的字符串(游戏中的消息)输出到屏幕上。
You_buf(int) ""You "你拾起了一把剑"
execplinehandler(const char *) MSGHANDLER 使 "NETHACK_MSGHANDLER"使
maybe_play_sound(const char *)
impossible(const char *, ...)
*/
/*putmesg 函数:将消息输出到消息窗口,并且根据消息的紧急程度以及是否需要记录历史消息做相应的处理。
pline
dumplogmsg dumplogfreemessages
YouYourYou_feel "You feel""Your sword"
verbalize
impossible
raw_printf
*/
#include "hack.h"
#define BIGBUFSZ (5 * BUFSZ) /* big enough to format a 4*BUFSZ string (from

@ -18,12 +18,23 @@
*
* polymon (called directly) usually golem petrification
*/
/*see_monsters():此函数用于更新玩家视野内的怪物信息,以便玩家可以看到附近的怪物。
encumber_msg()
retouch_equipment(2)
selftouch()
hides_under()
canletgo()*/
/*check_strangling 函数:用于检查角色是否处于被勒死状态,并采取相应的行动。
polyman
dropp
break_armor 穿
drop_weapon
armor_to_dragon 穿
newman
polysense
no_longer_petrify_resistant */
#include "hack.h"
static void check_strangling(boolean);

@ -2,7 +2,73 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
/*itimeout 函数:用于处理角色的定时器,返回一个计时器的剩余时间。
itimeout_incr
ghost_from_bottle
drink_ok
peffect_restore_ability
peffect_hallucination 使
peffect_water 使
peffect_booze 使
peffect_enlightenment 使
peffect_invisibility 使
peffect_see_invisible 使
peffect_paralysis 使
peffect_sleeping 使
peffect_monster_detection 使
peffect_object_detection 使
peffect_sickness 使
peffect_confusion 使
peffect_gain_ability 使
peffect_speed 使
peffect_blindness 使
peffect_gain_level 使
peffect_healing
peffect_extra_healing
peffect_full_healing
peffect_levitation 使
peffect_gain_energy 使
peffect_oil
peffect_acid 使
peffect_polymorph
H2Opotion_dip
mixtype
dip_ok
hold_potion
potion_dip */
#include "hack.h"
static long itimeout(long);

@ -1,7 +1,55 @@
/* NetHack 3.7 pray.c $NHDT-Date: 1684138081 2023/05/15 08:08:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.194 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
/*prayer_done 函数:处理玩家角色完成祈祷的逻辑。
worst_cursed_item
in_trouble
fix_curse_trouble
fix_worst_trouble
angrygods
at_your_feet
gcrownu
give_spell
pleased
godvoice
god_zaps_you
fry_by_god
gods_angry
gods_upset
consume_offering
offer_too_soon
desecrate_high_altar
offer_real_amulet
offer_fake_amulet
offer_different_alignment_altar
bestow_artifact
pray_revive 使
water_prayer
blocked_boulder */
#include "hack.h"
static int prayer_done(void);

@ -1,7 +1,41 @@
/* NetHack 3.7 priest.c $NHDT-Date: 1693292537 2023/08/29 07:02:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.93 $ */
/* Copyright (c) Izchak Miller, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
/*newepri为怪物分配额外的pri结构用于存储与教堂和祭坛相关的信息。
free_epripri
move_special
temple_occupied
histemple_at
inhistemple
pri_move
priestini
mon_aligntyp
priestname
p_coaligned
has_shrine
findpriest
intemple
forget_temple_entry
priest_talk
mk_roamer
*/
#include "hack.h"
#include "mfndpos.h"

@ -1,7 +1,25 @@
/* NetHack 3.7 quest.c $NHDT-Date: 1687036547 2023/06/17 21:15:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.38 $ */
/* Copyright 1991, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
/*n_start在游戏开始时初始化一些变量和状态。
on_locate
on_goal
not_capable
is_pure
expulsion
chat_with_leader
chat_with_nemesis
chat_with_guardian
prisoner_speaks*/
#include "hack.h"
/* quest dungeon branch routines. */

@ -1,7 +1,29 @@
/* NetHack 3.7 questpgr.c $NHDT-Date: 1687036548 2023/06/17 21:15:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.82 $ */
/* Copyright 1991, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
/*intermed返回中间目标的名称。
find_qarti
neminame
guardname
homebase
qtext_pronoun
convert_arg
convert_line
deliver_by_pline
deliver_by_window
skip_pager
com_pager_core*/
#include "hack.h"
#include "dlb.h"

@ -2,7 +2,83 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/*learnscrolltyp确定卷轴类型并提供相应的信息。
cap_spe
erode_obj_text
hawaiian_design
read_ok
stripspe
p_glow1
p_glow2
forget
maybe_tame
can_center_cloud
display_stinking_cloud_positions
seffect_enchant_armor
seffect_destroy_armor
seffect_confuse_monster
seffect_scare_monster
seffect_remove_curse
seffect_create_monster
seffect_enchant_weapon
seffect_taming
seffect_genocide
seffect_light
seffect_charging
seffect_amnesia
seffect_fire
seffect_earth
seffect_punishment
seffect_stinking_cloud
seffect_blank_paper
seffect_teleportation
seffect_gold_detection
seffect_food_detection
seffect_identify
seffect_magic_mapping
set_lit
do_class_genocide
do_stinking_cloud
create_particular_parse
create_particular_creation*/
#include "hack.h"
#define Your_Own_Role(mndx) ((mndx) == gu.urole.mnum)

@ -1,7 +1,25 @@
/* NetHack 3.7 rect.c $NHDT-Date: 1596498203 2020/08/03 23:43:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.14 $ */
/* Copyright (c) 1990 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
/*init_rect()函数用于初始化内部结构,需要在每个新建的地图层级中调用。它会为矩形数组分配内存,并设置一个初始的矩形区域。
free_rect()
get_rect_ind()
get_rect()
rnd_rect()
intersect()
rect_bounds()
remove_rect()
add_rect()
split_rects()*/
#include "hack.h"
int get_rect_ind(NhRect *);

@ -1,7 +1,33 @@
/* NetHack 3.7 region.c $NHDT-Date: 1683832331 2023/05/11 19:12:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.81 $ */
/* Copyright (c) 1996 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
/*inside_gas_cloud()函数用于判断一个位置是否在气体云gas cloud内部。
expire_gas_cloud()
inside_rect()
create_region()
add_rect_to_reg()
add_mon_to_reg()monst
remove_mon_from_reg()
mon_in_region()
free_region()
add_region()
remove_region()
reset_region_mids()
is_hero_inside_gas_cloud()
callbacks*/
#include "hack.h"
/*

@ -2,7 +2,51 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2009. */
/* NetHack may be freely redistributed. See license for details. */
/*dotcnt 和 dotrow 是与保存相关的变量,用于记录进度条的状态。
zerocomp_minit() zerocomp
zerocomp_mread() 使
zerocomp_mgetc() 使
find_lev_obj()
restlevchn()
restdamage()
restobj()
restobjchn()
restmon()
restmonchn()
loadfruitchn()
freefruitchn()
ghostfruit()
restgamestate()
restlevelstate()
restlevelfile()
rest_bubbles()
restore_gamelog()
restore_msghistory()
reset_oattached_mids()
rest_levl()
rest_stairs() */
#include "hack.h"
#include "tcap.h" /* for TERMLIB and ASCIIGRAPH */

@ -2,7 +2,14 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2017. */
/* NetHack may be freely redistributed. See license for details. */
/*center(int line, char *text):将文本居中显示在指定的行上。
genl_outrip(winid tmpwin, int how, time_t when)
winid tmpwinID
int how饿
time_t when
使TEXT_TOMBSTONE*/
#include "hack.h"
/* Defining TEXT_TOMBSTONE causes genl_outrip() to exist, but it doesn't

@ -1,7 +1,12 @@
/* NetHack 3.7 rnd.c $NHDT-Date: 1596498205 2020/08/03 23:43:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.30 $ */
/* Copyright (c) 2004 by Robert Patrick Rankin */
/* NetHack may be freely redistributed. See license for details. */
/*rn2(x): 这个函数返回一个大于等于0且小于x的随机整数。
rnl(x): 0x(Luck)
rnd(x): 1x
d(n, x): nxnx
rne(x): 1u.ulevel/35u.ulevel
rnz(i): i*/
#include "hack.h"
#ifdef USE_ISAAC64

@ -2,7 +2,17 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/*validrole(int rolenum) 函数用于检查给定的角色编号是否有效即是否在角色列表范围内。如果给定的角色编号有效则返回真true否则返回假false
randrole(boolean for_display) for_display 使使
randrole_filtered() randrole(boolean for_display) 使
promptsep(char *str, int num_choices) str num_choices
role_gendercount(int rolenum)
race_alignmentcount(int racenum) */
#include "hack.h"
/*** Table of all roles ***/

@ -40,7 +40,19 @@
* records, separated by "---" lines. The first oracle is a special case,
* and placed there by 'makedefs'.
*/
/*unpadline(char *) 函数用于去除字符串末尾的下划线字符。在代码中,该函数可能被用于处理游戏中的一些文本内容,例如传说、墓志铭、刻在墙上的文字等。
init_rumors(dlb *) dlb
get_rnd_line(dlb *, char *, unsigned, int (*)(int), long, long, unsigned)
init_oracles(dlb *) dlb
others_check(const char *ftype, const char *, winid *) 访
couldnt_open_file(const char *)
init_CapMons(void) CapitalMon() */
static void unpadline(char *);
static void init_rumors(dlb *);
static char *get_rnd_line(dlb *, char *, unsigned, int (*)(int),

@ -2,7 +2,45 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2009. */
/* NetHack may be freely redistributed. See license for details. */
/*savelevchn(NHFILE *) 函数用于将游戏的地图层次结构存储到文件中。它接受一个 NHFILE 类型的参数,可能是用于保存游戏状态的文件句柄。
savelevl(NHFILE *,boolean) NHFILE
savedamage(NHFILE *) NHFILE
save_bubbles(NHFILE *, xint8) NHFILE
save_stairs(NHFILE *) NHFILE
save_bc(NHFILE *) NHFILE
saveobj(NHFILE *,struct obj *) NHFILE obj
saveobjchn(NHFILE *,struct obj **) NHFILE
savemon(NHFILE *,struct monst *) NHFILE monst
savemonchn(NHFILE *,struct monst *) NHFILE
savetrapchn(NHFILE *,struct trap *) NHFILE
save_gamelog(NHFILE *) NHFILE
savegamestate(NHFILE *) NHFILE
savelev_core(NHFILE *, xint8) NHFILE
save_msghistory(NHFILE *) NHFILE
zerocomp_bufon(int)
zerocomp_bufoff(int)
zerocomp_bflush(int)
zerocomp_bwrite(int, genericptr_t, unsigned int)
zerocomp_bputc(int) */
#include "hack.h"
#ifndef NO_SIGNAL

@ -2,7 +2,23 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2009. */
/* NetHack may be freely redistributed. See license for details. */
/*getidx(int, int) 函数的作用是返回两个整数的索引。它接受两个整型参数,并返回一个整数作为索引。
#define USE_BUFFERING 是一个宏定义,用于定义编译时是否启用缓冲区功能。如果定义了该宏,则表示启用缓冲区功能。
struct restore_info
MAXFD
enum {NOFLG = 0, NOSLOT = 1};
bw_sticky[MAXFD] sticky-1
bw_buffered[MAXFD] 0
#ifdef USE_BUFFERING 是一个条件编译指令,用于判断是否启用缓冲区功能。
bw_FILE[MAXFD] NULL*/
#include "hack.h"
/*

@ -2,7 +2,121 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/*makekops(coord *): 在指定的坐标处生成警察。
call_kops(struct monst *, boolean):
kops_gone(boolean):
NOTANGRY(mon):
ANGRY(mon):
IS_SHOP(x):
muteshk(shkp):
append_honorific(char *):
addupbill(struct monst *):
pacify_shk(struct monst *, boolean): 使
onbill(struct obj *, struct monst *, boolean):
next_shkp(struct monst *, boolean):
shop_debt(struct eshk *):
shk_owns(char *, struct obj *):
mon_owns(char *, struct obj *):
clear_unpaid_obj(struct monst *, struct obj *):
clear_unpaid(struct monst *, struct obj *):
clear_no_charge_obj(struct monst *, struct obj *):
clear_no_charge(struct monst *, struct obj *):
check_credit(long, struct monst *):
pay(long, struct monst *):
get_cost(struct obj *, struct monst *):
set_cost(struct obj *, struct monst *):
shk_embellish(struct obj *, long):
cost_per_charge(struct monst *, struct obj *, boolean): 使
cheapest_item(struct monst *): 便
dopayobj(struct monst *, struct bill_x *, struct obj **, int, boolean):
stolen_container(struct obj *, struct monst *, long, boolean):
corpsenm_price_adj(struct obj *):
getprice(struct obj *, boolean):
shk_names_obj(struct monst *, struct obj *, const char *, long, const char *):
inherits(struct monst *, int, int, boolean):
set_repo_loc(struct monst *):
bp_to_obj(struct bill_x *):
get_pricing_units(struct obj *):
angry_shk_exists(void):
home_shk(struct monst *, boolean):
rile_shk(struct monst *):
rouse_shk(struct monst *, boolean):
shk_impaired(struct monst *):
repairable_damage(struct damage *, struct monst *):
find_damage(struct monst *):
discard_damage_struct(struct damage *):
discard_damage_owned_by(struct monst *):
shk_fixes_damage(struct monst *):
litter_getpos(uint8 *, coordxy, coordxy, struct monst *):
litter_scatter(uint8 *, coordxy, coordxy, struct monst *):
litter_newsyms(uint8 *, coordxy, coordxy):
repair_damage(struct monst *, struct damage *, boolean):
sub_one_frombill(struct obj *, struct monst *):
add_one_tobill(struct obj *, boolean, struct monst *):
dropped_container(struct obj *, struct monst *, boolean):
add_to_billobjs(struct obj *):
bill_box_content(struct obj *, boolean, boolean, struct monst *):
rob_shop(struct monst *):
deserted_shop(char *):
special_stock(struct obj *, struct monst *, boolean):
cad(boolean): */
#include "hack.h"
#define PAY_SOME 2

@ -4,7 +4,23 @@
/* NetHack may be freely redistributed. See license for details. */
/* shknam.c -- initialize a shop */
/*stock_room_goodpos(struct mkroom *, int, int, int, int): 检查指定房间是否适合放置货物。
veggy_item(struct obj * obj, int):
shkveg():
mkveggy_at(int, int):
mkshobj_at(const struct shclass *, int, int, boolean):
nameshk(struct monst *, const char *const *):
good_shopdoor(struct mkroom *, coordxy *, coordxy *):
shkinit(const struct shclass *, struct mkroom *):
VEGETARIAN_CLASS (MAXOCLASSES + 1): */
#include "hack.h"
static boolean stock_room_goodpos(struct mkroom *, int, int, int, int);

@ -2,7 +2,17 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/*take_gold这个函数用于从玩家的物品栏中移除所有金币并相应地更新游戏状态。
throne_sit_effect
lay_an_egg
dosit
rndcurse使
attrcurse使*/
#include "hack.h"
#include "artifact.h"

@ -1,7 +1,25 @@
/* NetHack 3.7 sounds.c $NHDT-Date: 1674548234 2023/01/24 08:17:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.134 $ */
/* Copyright (c) 1989 Janet Walz, Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */
/*throne_mon_sound(struct monst *):这个函数用于判断在坐在王座上时,是否会引起周围怪物的注意并产生声音。
beehive_mon_sound(struct monst *)
morgue_mon_sound(struct monst *)
zoo_mon_sound(struct monst *)
temple_priest_sound(struct monst *)殿
mon_is_gecko(struct monst *)
domonnoise(struct monst *)
dochat(void)
responsive_mon_at(int, int)
mon_in_room(struct monst *, int)*/
#include "hack.h"
static boolean throne_mon_sound(struct monst *);

@ -8,7 +8,611 @@
*
* It contains also the special level loader.
*/
/*int lspo_set_map_size(lua_State *);
Lua
int lspo_get_map_size(lua_State *);
Lua
int lspo_set_terrain(lua_State *);
Lua
int lspo_get_terrain(lua_State *);
Lua
int lspo_set_wall(lua_State *);
Lua
int lspo_get_wall(lua_State *);
Lua
int lspo_set_feature(lua_State *);
Lua
int lspo_get_feature(lua_State *);
Lua
int lspo_create_room(lua_State *);
Lua
int lspo_create_corridor(lua_State *);
Lua
int lspo_connect_rooms(lua_State *);
Lua
int lspo_connect_regions(lua_State *);
Lua
int lspo_place_player(lua_State *);
Lua
int lspo_place_stairs(lua_State *);
Lua
int lspo_place_items(lua_State *);
Lua
int lspo_place_monster(lua_State *);
Lua
int lspo_place_trap(lua_State *);
Lua
int lspo_place_feature(lua_State *);
Lua
int lspo_place_terrain(lua_State *);
Lua
int lspo_place_water(lua_State *);
Lua
int lspo_remove_item(lua_State *);
Lua
int lspo_remove_monster(lua_State *);
Lua
int lspo_remove_trap(lua_State *);
Lua
int lspo_remove_feature(lua_State *);
Lua
int lspo_remove_terrain(lua_State *);
Lua
int lspo_remove_water(lua_State *);
Lua
int lspo_is_valid_location(lua_State *);
Lua
int lspo_is_walkable(lua_State *);
Lua
int lspo_is_solid(lua_State *);
Lua
int lspo_is_transparent(lua_State *);
Lua
int lspo_is_wall(lua_State *);
Lua
int lspo_is_door(lua_State *);
Lua
int lspo_is_closed_door(lua_State *);
Lua
int lspo_is_locked_door(lua_State *);
Lua
int lspo_is_open_door(lua_State *);
Lua
int lspo_is_feature(lua_State *);
Lua
int lspo_is_terrain(lua_State *);
Lua
int lspo_is_water(lua_State *);
Lua
int lspo_get_room_id(lua_State *);
LuaID
int lspo_get_region_id(lua_State *);
LuaID
int lspo_get_item_id(lua_State *);
LuaID
int lspo_get_monster_id(lua_State *);
LuaID
int lspo_get_trap_id(lua_State *);
LuaID
int lspo_get_feature_id(lua_State *);
LuaID
int lspo_get_terrain_id(lua_State *);
LuaID
int lspo_get_water_id(lua_State *);
LuaID
int lspo_get_map_id(lua_State *);
LuaID
int lspo_get_player_position(lua_State *);
Lua
int lspo_get_stairs_up_position(lua_State *);
Lua
int lspo_get_stairs_down_position(lua_State *);
Lua
int lspo_light_region(lua_State *);
Lua
int lspo_map(lua_State *);
Lua
int lspo_mazewalk(lua_State *);
Lua
int lspo_monster(lua_State *);
Lua
int lspo_object(lua_State *);
Lua
int lspo_region(lua_State *);
Lua
int lspo_room(lua_State *);
Lua
int lspo_selection_flood(lua_State *);
Lua
int lspo_stair(lua_State *);
Lua
int lspo_subroom(lua_State *);
Lua
int lspo_terrain(lua_State *);
Lua
int lspo_trap(lua_State *);
Lua
int lspo_wall_property(lua_State *);
Lua
int lspo_warning(lua_State *);
Lua
int lspo_waterbody(lua_State *);
Lua
int lspo_grass(lua_State *);
Lua
int lspo_tree(lua_State *);
Lua
int lspo_rock(lua_State *);
Lua
int lspo_pool(lua_State *);
Lua
int lspo_fountain(lua_State *);
Lua
int lspo_sink(lua_State *);
Lua
int lspo_throne(lua_State *);
Lua
int lspo_altar_generic(lua_State *);
Lua
int lspo_feature_region(lua_State *);
Lua
int lspo_terrain_region(lua_State *);
Lua
int lspo_wallify_map(lua_State *);
Lua
int lspo_replace_terrain(lua_State *);
Lua
int lspo_replace_feature(lua_State *);
Lua
int lspo_replace_terrain_region(lua_State *);
Lua
int lspo_replace_feature_region(lua_State *);
Lua
int lspo_random_corridors(lua_State *);
Lua
int lspo_ensure_rng_seed(lua_State *);
Lua
int lspo_adjust_branch_walls(lua_State *);
Lua
int lspo_region_floodfill(lua_State *);
Lua
int lspo_remove_rooms(lua_State *);
Lua
int lspo_remove_corridors(lua_State *);
Lua
int lspo_remove_walls(lua_State *);
Lua
int lspo_remove_features(lua_State *);
Lua
int lspo_remove_terrain(lua_State *);
Lua
int lspo_remove_traps(lua_State *);
Lua
int lspo_remove_monsters(lua_State *);
Lua
int lspo_remove_objects(lua_State *);
Lua
int lspo_remove_regions(lua_State *);
Lua
int lspo_remove_grass(lua_State *);
Lua
int lspo_remove_trees(lua_State *);
Lua
int lspo_remove_rocks(lua_State *);
Lua
int lspo_remove_water(lua_State *);
Lua
int lspo_remove_fountains(lua_State *);
Lua
int lspo_remove_sinks(lua_State *);
Lua
int lspo_remove_throne(lua_State *);
Lua
int lspo_random_walls(lua_State *);
Lua
int lspo_dig(lua_State *);
Lua
int lspo_random_region(lua_State *);
Lua
int lspo_ensure_valid_map(lua_State *);
Lua
typedef void (*select_iter_func)(coordxy, coordxy, genericptr);
void mkmap(lev_init *);
static boolean match_maptyps(xint16, xint16);
static void solidify_map(void);
static void map_cleanup(void);
static void lvlfill_maze_grid(int, int, int, int, schar);
static void lvlfill_solid(schar, schar);
static void lvlfill_swamp(schar, schar, schar);
static void flip_dbridge_horizontal(struct rm *);
static void flip_dbridge_vertical(struct rm *);
static void flip_visuals(int, int, int, int, int);
static int flip_encoded_dir_bits(int, int);
static void flip_vault_guard(int, struct monst *,
coordxy, coordxy, coordxy, coordxy);
static void sel_set_wall_property(coordxy, coordxy, genericptr_t);
static void set_wall_property(coordxy, coordxy, coordxy, coordxy, int);
static void remove_boundary_syms(void);
static void set_door_orientation(int, int);
static boolean shared_with_room(int, int, struct mkroom *);
static void maybe_add_door(int, int, struct mkroom *);
static void link_doors_rooms(void);
static int rnddoor(void);
static int rndtrap(void);
static void get_location(coordxy *, coordxy *, getloc_flags_t,
struct mkroom *);
static void set_ok_location_func(boolean (*)(coordxy, coordxy));
static boolean is_ok_location(coordxy, coordxy, getloc_flags_t);
static unpacked_coord get_unpacked_coord(long, int);
static void get_room_loc(coordxy *, coordxy *, struct mkroom *);
static void get_free_room_loc(coordxy *, coordxy *, struct mkroom *,
packed_coord);
static boolean create_subroom(struct mkroom *, coordxy, coordxy, coordxy,
coordxy, xint16, xint16);
static void create_door(room_door *, struct mkroom *);
static void create_trap(spltrap *, struct mkroom *);
static int noncoalignment(aligntyp);
static boolean m_bad_boulder_spot(coordxy, coordxy);
static int pm_to_humidity(struct permonst *);
湿
static unsigned int sp_amask_to_amask(unsigned int sp_amask);
static void create_monster(monster *, struct mkroom *);
static struct obj *create_object(object *, struct mkroom *);
static void create_altar(altar *, struct mkroom *);
static boolean search_door(struct mkroom *, coordxy *, coordxy *, xint16, int);
static void create_corridor(corridor *);
static struct mkroom *build_room(room *, struct mkroom *);
static void light_region(region *);
static void maze1xy(coord *, int);
static void fill_empty_maze(void);
static void splev_initlev(lev_init *);
static boolean generate_way_out_method(coordxy nx, coordxy ny,
struct selectionvar *ov);
static void spo_end_moninvent(void);
static void spo_pop_container(void);
static int l_create_stairway(lua_State *, boolean);
static void spo_endroom(struct sp_coder *);
static void l_table_getset_feature_flag(lua_State *, int, int, const char *,
int);
static void l_get_lregion(lua_State *, lev_region *);
static void sel_set_lit(coordxy, coordxy, genericptr_t);
static void add_doors_to_room(struct mkroom *);
static void selection_iterate(struct selectionvar *, select_iter_func,
genericptr_t);
static void sel_set_ter(coordxy, coordxy, genericptr_t);
static void sel_set_door(coordxy, coordxy, genericptr_t);
static void sel_set_feature(coordxy, coordxy, genericptr_t);
static void levregion_add(lev_region *);
static void get_table_xy_or_coord(lua_State *, lua_Integer *, lua_Integer *);
static int get_table_region(lua_State *, const char *, lua_Integer *,
lua_Integer *, lua_Integer *, lua_Integer *, boolean);
static void set_wallprop_in_selection(lua_State *, int);
static coordxy random_wdir(void);
static int floodfillchk_match_under(coordxy, coordxy);
static int floodfillchk_match_accessible(coordxy, coordxy);
static boolean sel_flood_havepoint(coordxy, coordxy, coordxy *, coordxy *, int);
static long line_dist_coord(long, long, long, long, long, long);
static void l_push_mkroom_table(lua_State *, struct mkroom *);
Lua
static int get_table_align(lua_State *);
static int get_table_monclass(lua_State *);
static int find_montype(lua_State *, const char *, int *);
static int get_table_montype(lua_State *, int *);
static lua_Integer get_table_int_or_random(lua_State *, const char *, int);
static int get_table_buc(lua_State *);
static int get_table_objclass(lua_State *);
static int find_objtype(lua_State *, const char *);
static int get_table_objtype(lua_State *);
static const char *get_mkroom_name(int);
static int get_table_roomtype_opt(lua_State *, const char *, int);
static int get_table_traptype_opt(lua_State *, const char *, int);
static int get_traptype_byname(const char *);
static lua_Integer get_table_intarray_entry(lua_State *, int, int);
static struct sp_coder *sp_level_coder_init(void);
int lspo_altar(lua_State *);
Lua
int lspo_branch(lua_State *);
Lua
int lspo_corridor(lua_State *);
Lua
int lspo_door(lua_State *);
Lua
int lspo_drawbridge(lua_State *);
Lua
int lspo_engraving(lua_State *);
Lua
int lspo_feature(lua_State *);
Lua
int lspo_gold(lua_State *);
Lua
int lspo_grave(lua_State *);
Lua
int lspo_ladder(lua_State *);
Lua
int lspo_level_flags(lua_State *);
Lua
int lspo_level_init(lua_State *);
Lua
int lspo_levregion(lua_State *);
Lua*/
#define IN_SP_LEV_C
#include "hack.h"

@ -1,7 +1,68 @@
/* NetHack 3.7 spell.c $NHDT-Date: 1646838390 2022/03/09 15:06:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.131 $ */
/* Copyright (c) M. Stephenson 1988 */
/* NetHack may be freely redistributed. See license for details. */
/*static int spell_let_to_idx(char)
static boolean cursed_book(struct obj * bp)
static boolean confused_book(struct obj *)
static void deadbook_pacify_undead(struct monst *)
使
static void deadbook(struct obj *)
static int learn(void)
static boolean rejectcasting(void)
static boolean getspell(int *)
static int QSORTCALLBACK spell_cmp(const genericptr, const genericptr)
static void sortspells(void)
static boolean spellsortmenu(void)
static boolean dospellmenu(const char *, int, int *)
static int percent_success(int)
static char *spellretention(int, char *)
static int throwspell(void)
static void cast_protection(void)
static void spell_backfire(int)
static boolean spelleffects_check(int, int *, int *)
static const char *spelltypemnemonic(int)
static boolean can_center_spell_location(coordxy, coordxy)
static boolean spell_aim_step(genericptr_t, coordxy, coordxy)
*/
#include "hack.h"
/* spellmenu arguments; 0 thru n-1 used as gs.spl_book[] index when swapping */

@ -2,7 +2,27 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/*stealgold函数用于让怪物从玩家身上偷取金币根据玩家是否拥有真金gold或者数量不同的金币来进行不同的处理。
thiefdead
unresponsive
unstolenarm
stealarm
remove_worn_item穿
somegold
findgold
equipname
stealamulet
maybe_absorb_item*/
#include "hack.h"
static int stealarm(void);

@ -1,7 +1,27 @@
/* NetHack 3.7 steed.c $NHDT-Date: 1671838909 2022/12/23 23:41:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.108 $ */
/* Copyright (c) Kevin Hugo, 1998-1999. */
/* NetHack may be freely redistributed. See license for details. */
/*rider_cant_reach(void) - 当骑手无法到达某个位置时调用,用于通知玩家。
can_saddle(struct monst* mtmp) -
use_saddle(struct obj* otmp) -
put_saddle_on_mon(struct obj* saddle, struct monst* mtmp) -
can_ride(struct monst* mtmp) -
doride(void) -
mount_steed(struct monst *mtmp, boolean force) -
exercise_steed(void) -
kick_steed(void) -
landing_spot(coord *spot, int reason, int forceit) -
dismount_steed(int reason) - */
#include "hack.h"
/* Monsters that might be ridden */

@ -1,7 +1,25 @@
/* NetHack 3.7 symbols.c $NHDT-Date: 1661295669 2022/08/23 23:01:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.90 $ */
/* Copyright (c) NetHack Development Team 2020. */
/* NetHack may be freely redistributed. See license for details. */
/*savedsym_add(const char *, const char *, int) - 添加保存的符号到缓存中,用于保存和恢复游戏中的特殊符号。
savedsym_find(const char *, int) -
purge_custom_entries(enum graphics_sets which_set) -
def_r_oc_syms[MAXOCLASSES] -
decgraphics_mode_callback - DECtty_start_screen()
ibmgraphics_mode_callback - IBMtty_start_screen()PC9800
ascgraphics_mode_callback - ASCtty_start_screen()PC9800
cursesgraphics_mode_callback - Cursestty_start_screen()
ibmgraphics_mode_callback - IBMtty_start_screen()TTYWIN32
utf8graphics_mode_callback - UTF-8tty_start_screen()unixttywindtty*/
#include "hack.h"
#include "tcap.h"

@ -1,7 +1,9 @@
/* NetHack 3.7 sys.c $NHDT-Date: 1693083254 2023/08/26 20:54:14 $ $NHDT-Branch: keni-crashweb2 $:$NHDT-Revision: 1.63 $ */
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
/* NetHack may be freely redistributed. See license for details. */
/*sys_early_init()初始化系统选项结构体sysopt包括support、recover、wizards、debugfiles、dumplogfile、env_dbgfl、shellers、explorers、genericusers、maxplayers、bones_pools、livelog、persmax、entrymax、pointsmin、pers_is_uid、tt_oname_maxrank等选项的默认值。
sysopt_release()sysopt
sysopt_seduce_set(int val)valmons[PM_INCUBUS]mons[PM_SUCCUBUS] NetHack 3.7 getmattk() */
#include "hack.h"
#ifndef SYSCF

@ -2,7 +2,14 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
/*goodpos_onscary(coordxy, coordxy, struct permonst *):检查给定的坐标是否是在可怕的怪物周围的一个好位置。它用于确定在特定情况下玩家是否可以被传送到该位置。
tele_jump_ok(coordxy, coordxy, coordxy, coordxy)
teleok(coordxy, coordxy, boolean)
vault_tele(void)
rloc_pos_ok(coordxy, coordxy, struct monst *)
rloc_to_core(struct monst *, coordxy, coordxy, unsigned)
mvault_tele(struct monst *)
m_blocks_teleporting(struct monst *) */
#include "hack.h"
#define NEW_ENEXTO

@ -2,7 +2,19 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
/*stoned_dialogue(void):处理玩家因吸入致幻气体而变成石头的对话。它用于在玩家变成石头时显示相应的对话框和信息。
vomiting_dialogue(void)
choke_dialogue(void)
levitation_dialogue(void)
slime_dialogue(void)
slimed_to_death(struct kinfo *)
sickness_dialogue(void)
phaze_dialogue(void)
done_timeout(int, int)
slip_or_trip(void)
see_lamp_flicker(struct obj *, const char *)
lantern_message(struct obj *)
cleanup_burn(ANY_P *, long) */
#include "hack.h"
static void stoned_dialogue(void);

@ -2,7 +2,18 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/*topten_print(const char *):输出排行榜到终端或文件。
topten_print_bold(const char *)
outheader(void)
outentry(int, struct toptenentry *, boolean)
discardexcess(FILE *)
readentry(FILE *, struct toptenentry *)
writeentry(FILE *, struct toptenentry *)
free_ttlist(struct toptenentry *)
classmon(char *)
score_wanted(boolean, int, struct toptenentry *, int, const char **, int)
nsb_mung_line(char *)
nsb_unmung_line(char *)*/
#include "hack.h"
#include "dlb.h"

@ -3,7 +3,23 @@
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
/* track.c - version 1.0.2 */
/*initrack(void):初始化追踪系统,将计数器和指针重置为初始值。
settrack(void)
gettrack(coordxy x, coordxy y)
UTSZ
static NEARDATA int utcnt, utpnt
static NEARDATA coord utrack[UTSZ]
initrack
settrack
gettrack */
#include "hack.h"
#define UTSZ 50

@ -2,7 +2,66 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
/*mk_trap_statue(coordxy, coordxy):在给定的坐标上生成一个陷阱和一个雕像。
dng_bottom(d_level *lev)
hole_destination(d_level *)
keep_saddle_with_steedcorpse(unsigned, struct obj *, struct obj *)
mu_maybe_destroy_web(struct monst *, boolean, struct trap *)
t_missile(int, struct trap *)
floor_trigger(int)
check_in_air(struct monst *, unsigned)
trapeffect_arrow_trap(struct monst *, struct trap *, unsigned)
trapeffect_dart_trap(struct monst *, struct trap *, unsigned)
trapeffect_rocktrap(struct monst *, struct trap *, unsigned)
trapeffect_sqky_board(struct monst *, struct trap *, unsigned)
trapeffect_bear_trap(struct monst *, struct trap *, unsigned)
trapeffect_slp_gas_trap(struct monst *, struct trap *, unsigned)
trapeffect_rust_trap(struct monst *, struct trap *, unsigned)
trapeffect_fire_trap(struct monst *, struct trap *, unsigned)
trapeffect_pit(struct monst *, struct trap *, unsigned)
trapeffect_hole(struct monst *, struct trap *, unsigned)
trapeffect_telep_trap(struct monst *, struct trap *, unsigned)
trapeffect_level_telep(struct monst *, struct trap *, unsigned)
trapeffect_web(struct monst *, struct trap *, unsigned)
trapeffect_statue_trap(struct monst *, struct trap *, unsigned)
trapeffect_magic_trap(struct monst *, struct trap *, unsigned)
trapeffect_anti_magic(struct monst *, struct trap *, unsigned)
trapeffect_poly_trap(struct monst *, struct trap *, unsigned)
trapeffect_landmine(struct monst *, struct trap *, unsigned)
trapeffect_rolling_boulder_trap(struct monst *, struct trap *, unsigned)
trapeffect_magic_portal(struct monst *, struct trap *, unsigned)
trapeffect_vibrating_square(struct monst *, struct trap *, unsigned)
trapeffect_selector(struct monst *, struct trap *, unsigned)
trapnote(struct trap *, boolean)
choose_trapnote(struct trap *)
steedintrap(struct trap *, struct obj *)
launch_drop_spot(struct obj *, coordxy, coordxy)
find_random_launch_coord(struct trap *, coord *)
mkroll_launch(struct trap *, coordxy, coordxy, short, long)
isclearpath(coord *, int, schar, schar)
dofiretrap(struct obj *)
domagictrap(void)
emergency_disrobe(boolean *)
untrap_prob(struct trap *)
move_into_trap(struct trap *)
try_disarm(struct trap *, boolean)
reward_untrap(struct trap *, struct monst *)
disarm_holdingtrap(struct trap *)
disarm_landmine(struct trap *)
unsqueak_ok(struct obj *)
disarm_squeaky_board(struct trap *)
disarm_shooting_trap(struct trap *, int)
clear_conjoined_pits(struct trap *)
adj_nonconjoined_pit(struct trap *)
try_lift(struct monst *, struct trap *, int, boolean)
help_monster_out(struct monst *, struct trap *)
untrap_box(struct obj *, boolean, boolean)
maybe_finish_sokoban(void) Sokoban
a_your[2] "a" "your"
A_Your[2] "A" "Your"
tower_of_flame[] "tower of flame"
A_gush_of_water_hits "A gush of water hits"
blindgas[6]*/
#include "hack.h"
extern const char *const destroy_strings[][3]; /* from zap.c */

@ -2,7 +2,32 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2017. */
/* NetHack may be freely redistributed. See license for details. */
/*struct trobj:
ini_inv(struct trobj *):
knows_object(int):
knows_class(char):
restricted_spell_discipline(int):
#define:
UNDEF_TYPUNDEF_SPEUNDEF_BLESS
static struct trobj:
ArcheologistBarbarian
static struct trobj (Optional extra inventory items):
static const struct def_skill:
Archeologist*/
#include "hack.h"
struct trobj {

@ -2,7 +2,77 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
/*mhitm_mgc_atk_negated(struct monst *, struct monst *, boolean):用于判断一个怪物对另一个怪物进行魔法攻击时,是否被免疫或抵消。
known_hitum(struct monst *, struct obj *, int *, int, int, struct attack *, int)
theft_petrifies(struct obj *)使
steal_it(struct monst *, struct attack *)
hitum_cleave(struct monst *, struct attack *)
double_punch(void)
hitum(struct monst *, struct attack *)
hmon_hitmon_barehands(struct _hitmon_data *, struct monst *)
hmon_hitmon_weapon_ranged(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_weapon_melee(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_weapon(struct _hitmon_data *, struct monst *, struct obj *)使
hmon_hitmon_potion(struct _hitmon_data *, struct monst *, struct obj *)使
hmon_hitmon_misc_obj(struct _hitmon_data *, struct monst *, struct obj *)使
hmon_hitmon_do_hit(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_dmg_recalc(struct _hitmon_data *, struct obj *)
hmon_hitmon_poison(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_jousting(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_stagger(struct _hitmon_data *, struct monst *, struct obj *)使
hmon_hitmon_pet(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_splitmon(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_msg_hit(struct _hitmon_data *, struct monst *, struct obj *)
hmon_hitmon_msg_silver(struct _hitmon_data *, struct monst *, struct obj *)使
hmon_hitmon_msg_lightobj(struct _hitmon_data *, struct monst *, struct obj *)使
hmon_hitmon(struct monst *, struct obj *, int, int)
joust(struct monst *, struct obj *)
demonpet(void)
m_slips_free(struct monst *, struct attack *)
start_engulf(struct monst *)
end_engulf(void)
gulpum(struct monst *, struct attack *)
hmonas(struct monst *)
nohandglow(struct monst *)
mhurtle_to_doom(struct monst *, int, struct permonst **)
first_weapon_hit(struct obj *)
shade_aware(struct obj *)
PROJECTILE(obj)*/
#include "hack.h"
static const char brief_feeling[] =

@ -1,7 +1,49 @@
/* NetHack 3.7 utf8map.c */
/* Copyright (c) Michael Allison, 2021. */
/* NetHack may be freely redistributed. See license for details. */
/*extern const struct symparse loadsyms[];:声明一个外部定义的结构体数组,用于存储游戏中使用的符号和相应的属性。
extern struct enum_dump monsdump[];
extern struct enum_dump objdump[];
glyph_map glyphmap[MAX_GLYPH];
extern const char *const known_handling[];
#ifdef ENHANCED_SYMBOLS编译时条件判断如果定义了 ENHANCED_SYMBOLS则继续编译下面的代码块。
enum reserved_activities { res_nothing, res_dump_glyphids, res_fill_cache };
enum things_to_find { find_nothing, find_pm, find_oc, find_cmap, find_glyph };
struct find_struct {...};
const struct find_struct zero_find = { 0 };
struct glyphid_cache_t {...};
static void init_glyph_cache(void);
static void add_glyph_to_cache(int glyphnum, const char *id);
static int find_glyph_in_cache(const char *id);
static uint32 glyph_hash(const char *id);
static void to_custom_symset_entry_callback(int glyph, struct find_struct *findwhat);
static int unicode_val(const char *cp); Unicode
static int parse_id(const char *id, struct find_struct *findwhat);
static int glyph_find_core(const char *id, struct find_struct *findwhat);
static char *fix_glyphname(char *str);
static int32_t rgbstr_to_int32(const char *rgbstr); RGB
boolean closest_color(uint32_t lcolor, uint32_t *closecolor, int *clridx);*/
#include "hack.h"
#include <ctype.h>

@ -2,7 +2,29 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
/*static boolean clear_fcorr(struct monst *, boolean);:清空虚假走廊,将虚假走廊的标志设置为已经探索过,并根据参数判断是否需要清除它们的隐蔽状态。
static void blackout(coordxy, coordxy);
static void restfakecorr(struct monst *);
static void parkguard(struct monst *);true
static boolean in_fcorridor(struct monst *, coordxy, coordxy);true
static boolean find_guard_dest(struct monst *, coordxy *, coordxy *);
static void move_gold(struct obj *, int);
static void wallify_vault(struct monst *);
static void gd_mv_monaway(struct monst *, int, int);使
static void gd_pick_corridor_gold(struct monst *, int, int);
static int gd_move_cleanup(struct monst *, boolean, boolean);
static void gd_letknow(struct monst *);*/
#include "hack.h"
static boolean clear_fcorr(struct monst *, boolean);

@ -2,7 +2,33 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2018. */
/* NetHack may be freely redistributed. See license for details. */
/*version_string 函数:将游戏的短版本信息填充到缓冲区中。
getversionstring Git
doversion #versionshort
doextversion #version
early_version_info
insert_rtoption PATMATCH LUAVERSION
comp_times
check_version
uptodate
store_formatindicator
store_version
get_feature_notice_ver
get_current_feature_ver
copyright_banner_line */
#include "hack.h"
#include "dlb.h"

@ -1,7 +1,18 @@
/* NetHack 3.7 vision.c $NHDT-Date: 1657918095 2022/07/15 20:48:15 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.49 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
/*static seenV could_see[2][ROWNO][COLNO]:定义一个三维数组 could_see用于记录视野信息。
static seenV *cs_rows0[ROWNO], *cs_rows1[ROWNO] cs_rows0 cs_rows1
static coordxy cs_rmin0[ROWNO], cs_rmax0[ROWNO], cs_rmin1[ROWNO], cs_rmax1[ROWNO]
static char viz_clear[ROWNO][COLNO] viz_clear
static char *viz_clear_rows[ROWNO] viz_clear_rows
static coordxy left_ptrs[ROWNO][COLNO], right_ptrs[ROWNO][COLNO]线
void fill_point(int, int)
void dig_point(int, int)
void view_init(void)
void view_from(coordxy, coordxy, seenV**, coordxy*, coordxy*, int, void (*)(coordxy, coordxy, genericptr_t), genericptr_t)
void get_unused_cs(seenV***, coordxy**, coordxy**)使
void rogue_vision(seenV**, coordxy*, coordxy*)*/
#include "hack.h"
#include <assert.h>

@ -2,7 +2,12 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
/*static void give_may_advance_msg(int):给予可能进阶的提示信息,参数是技能等级。
static void finish_towel_change(struct obj *obj, int)
static boolean could_advance(int)
static boolean peaked_skill(int)
static int slots_required(int)
static void skill_advance(int)*/
/*
* This module contains code for calculation of "to hit" and damage
* bonuses for any given weapon used, as well as weapons selection

@ -2,7 +2,10 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2009. */
/* NetHack may be freely redistributed. See license for details. */
/*cant_wield_corpse检查是否无法装备尸体用于判断是否能够装备某个物品。
ready_weapon0-1
ready_ok
wield_ok*/
#include "hack.h"
/* KMH -- Differences between the three weapon slots.

@ -1,7 +1,68 @@
/* NetHack 3.7 windows.c $NHDT-Date: 1661202202 2022/08/22 21:03:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.97 $ */
/* Copyright (c) D. Cohrs, 1993. */
/* NetHack may be freely redistributed. See license for details. */
/*def_raw_print默认的原始输出函数用于将字符串直接输出到控制台或终端。
def_wait_synch
#ifdef TTY_GRAPHICS
wintty.h #endif
#ifdef CURSES_GRAPHICS
curses_procsCurses #endif
#ifdef X11_GRAPHICS
X11_procsX11
win_X11_initX11 #endif
#ifdef QT_GRAPHICS
Qt_procsQt #endif
#ifdef GEM_GRAPHICS
wingem.hGem #endif
#ifdef MAC
mac_procsMac #endif
#ifdef BEOS_GRAPHICS
beos_procsBeOS
be_win_initBeOS #endif
#ifdef AMIGA_INTUITION
amii_procsAmiga Intuition
amiv_procsAmiga V39 Intuition
ami_wininit_dataAmiga #endif
#ifdef GNOME_GRAPHICS
Gnome_procsGnome #endif
#ifdef MSWIN_GRAPHICS
mswin_procsMicrosoft Windows #endif
#ifdef SHIM_GRAPHICS
shim_procsShim #endif
#ifdef WINCHAIN
chainin_procs
chainin_procs_init
chainin_procs_chain
chainout_procs
chainout_procs_init
chainout_procs_chain
trace_procs
trace_procs_init
trace_procs_chain #endif
#ifdef DUMPLOG
dump_create_nhwindow
dump_clear_nhwindow
dump_display_nhwindow
dump_destroy_nhwindow
dump_start_menu
dump_add_menu
dump_end_menu
dump_select_menu
dump_putstr #endif /* DUMPLOG */*/
#include "hack.h"
#include "dlb.h"
#ifdef TTY_GRAPHICS

@ -2,7 +2,19 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2016. */
/* NetHack may be freely redistributed. See license for details. */
/*tatic short which_arti(int):这个函数用于确定在指定的槽位上是否存在一件指定类型的神器,并返回该神器的编号。
static boolean mon_has_arti(struct monst *, short)
static struct monst *other_mon_has_arti(struct monst *, short)
static struct obj *on_ground(short)
static boolean you_have(int)
static unsigned long target_on(int, struct monst *)
static unsigned long strategy(struct monst *)*/
/* wizard code - inspired by rogue code from Merlyn Leroy (digi-g!brian) */
/* - heavily modified to give the wiz balls. (genat!mike) */
/* - dewimped and given some maledictions. -3. */

@ -2,7 +2,13 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2009. */
/* NetHack may be freely redistributed. See license for details. */
/*struct wseg *wheads[MAX_NUM_WORMS]:这是一个指向虫子怪物身体部分的指针数组。它用于存储每个虫子怪物的头部的位置。
struct wseg *wtails[MAX_NUM_WORMS]
long wgrowtime[MAX_NUM_WORMS]
*/
#include "hack.h"
#define newseg() (struct wseg *) alloc(sizeof (struct wseg))

@ -2,7 +2,15 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
/*static void m_lose_armor(struct monst *, struct obj *):这个函数用于使怪物失去指定的护甲物品。它会修改怪物的属性,例如减少防御能力或改变外观。
static void clear_bypass(struct obj *)"bypass"NetHack
static void m_dowear_type(struct monst *, long, boolean, boolean)穿穿
static int extra_pref(struct monst *, struct obj *)
*/
#include "hack.h"
static void m_lose_armor(struct monst *, struct obj *);

@ -1,6 +1,22 @@
/* NetHack 3.7 write.c $NHDT-Date: 1596498232 2020/08/03 23:43:52 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.26 $ */
/* NetHack may be freely redistributed. See license for details. */
/*cost(struct obj *otmp):计算写在卷轴或咒语书上的基础成本。根据物品的类型和特定属性来返回不同的成本值。
label_known(int scrolltype, struct obj *objlist)
write_ok(struct obj *obj)
dowrite(struct obj *pen)使
new_book_description(int booktype, char *outbuf)
NetHack
*/
#include "hack.h"
static int cost(struct obj *);

@ -2,7 +2,51 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
/*zaptype(int):根据传入的参数判断魔法的类型,返回对应的值。
probe_objchain(struct obj *)
zombie_can_dig(coordxy x, coordxy y)
polyuse(struct obj *, int, int)使
create_polymon(struct obj *, int)
stone_to_flesh_obj(struct obj *)
zap_updown(struct obj *)
zhitu(int, int, const char *, coordxy, coordxy)
revive_egg(struct obj *)
zap_steed(struct obj *)
skiprange(int, int *, int *)
maybe_explode_trap(struct trap *, struct obj *, boolean *)
zap_map(coordxy, coordxy, struct obj *)
zap_hit(int, int)
disintegrate_mon(struct monst *, int, const char *)
adtyp_to_prop(int)
backfire(struct obj *)
zap_ok(struct obj *)使
boxlock_invent(struct obj *)
spell_hit_bonus(int)
destroy_one_item(struct obj *, int, int)
wishcmdassist(int)
NetHack*/
#include "hack.h"
/* Disintegration rays have special treatment; corpses are never left.

Loading…
Cancel
Save