first commit

ljh_branch
Aurora 1 year ago
parent 2fdb95299c
commit 9220172a5a

@ -1,7 +1,43 @@
/* NetHack 3.7 nhlua.c $NHDT-Date: 1695159626 2023/09/19 21:40:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.115 $ */
/* Copyright (c) 2018 by Pasi Kallinen */
/* NetHack may be freely redistributed. See license for details. */
/*
nhl_get_cmd_key
nhl_callbackLua
nhl_doturn
nhl_debug_flags
nhl_timer_has_at
nhl_timer_peek_at
nhl_timer_stop_at
nhl_timer_start_at
nhl_gamestate
nhl_test
nhl_getmap
splev_typ2chr
nhl_gettrap
nhl_deltrap
nhl_impossible
nhl_pline
nhl_verbalize
nhl_parse_config
nhl_menu
nhl_text
nhl_getlin
nhl_makeplural
nhl_makesingular
nhl_s_suffix
nhl_ing_suffix
nhl_ana/an
nhl_rn2
nhl_random
nhl_level_difficulty
init_nhc_data
nhl_push_anythingLua
nhl_meta_u_index
nhl_meta_u_newindex
nhl_u_clear_inventory
nhl_u_giveobj
init_u_data*/
#include "hack.h"
#include "dlb.h"

@ -2,6 +2,29 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
/*putstr(tmpwin, iflags.menu_headings, let_to_name(oclass, FALSE, FALSE)); - 这个函数可能用于在一个临时窗口tmpwin中输出一个字符串。在这里它用于显示一个新类别的标题。
Strcpy(buf, objects[dis].oc_pre_discovered ? "* " : " "); - Strcpy buf
(void) sortloot_descr(dis, &buf[2]); - lootbuf
disco_append_typename(buf, dis); - buf
y_n("Dump information about all artifacts?") -
dump_artifact_info(tmpwin); - tmpwin
disp_artifact_discoveries(tmpwin); - tmpwin
def_char_to_objclass(c); -
oclass_to_name(oclass, buf); - buf
qsort(sorted_lines, sorted_ct, sizeof (char *), discovered_cmp); - qsort
dupstr(buf); -
discovered_cmp(a, b); - 便使*/
#include "hack.h"

@ -1,6 +1,18 @@
/* NetHack 3.7 objects.c $NHDT-Date: 1596498192 2020/08/03 23:43:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.66 $ */
/* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */
/*#include "config.h" #include "obj.h"
#include "prop.h" #include "skills.h" #include "color.h" #include "objclass.h"
// 存储对象描述的初始数组 NEARDATA struct objdescr obj_descr_init[NUM_OBJECTS + 1] = { #define OBJECTS_DESCR_INIT #include "objects.h" #undef OBJECTS_DESCR_INIT };
// 存储对象类别的初始数组 NEARDATA struct objclass obj_init[NUM_OBJECTS + 1] = { #define OBJECTS_INIT #include "objects.h" #undef OBJECTS_INIT };
void objects_globals_init(void); /* 在hack.h中定义但我们使用的是config.h */
// 全局对象描述和对象类别的初始化函数 struct objdescr obj_descr[SIZE(obj_descr_init)]; struct objclass objects[SIZE(obj_init)];
/*void objects_globals_init(void) { // 将初始值复制到全局数组中 memcpy(obj_descr, obj_descr_init, sizeof(obj_descr)); memcpy(objects, obj_init, sizeof(objects)); }
NetHackobjects.c
obj_descr_initobj_init
objects_globals_initobj_descrobjects
*/
#include "config.h"
#include "obj.h"

@ -2,6 +2,17 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
/*结构体 Jitem: 这个结构体包含了一个整数 item 和一个指向字符串的指针 name。它可能用于存储关于游戏物品的信息。
BSTRCMPI, BSTRNCMPI, Strcasecpy, GemStone:
_readobjnam_data:
strprepend:
nextobuf:
releaseobuf:
xcalled, xname_flags, minimal_xname:
add_erosion_words:
doname_base:
*/
#include "hack.h"

@ -2,6 +2,23 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
/*bad_negation(const char *, boolean):处理选项取反的错误情况。
change_inv_order(char *)
warning_opts(char *, const char *)
feature_alert_opts(char *, const char *)
duplicate_opt_detection(int)
complain_about_duplicate(int)
length_without_val(const char *, int len)
determine_ambiguities(void)
check_misc_menu_command(char *, char *)
opt2roleopt(int)
getoptstr(int, int)
saveoptstr(int, const char *)
unsaveoptstr(int, int)
shared_menu_optfn(int, int, boolean, char *, char *)
spcfn_misc_menu_cmd(int, int, boolean, char *, char *)
attr2attrname(int)
basic_menu_colors(boolean)*/
#ifdef OPTION_LISTS_ONLY /* (AMIGA) external program for opt lists */
#include "config.h"

@ -5,6 +5,29 @@
/* This file contains the command routines dowhatis() and dohelp() and */
/* a few other help related facilities */
/*1. dohelp()这个函数是NetHack游戏中的帮助命令用于显示游戏的帮助信息。
2. is_swallow_sym()
3. append_str()
4. trap_description()
5. look_at_object()
6. look_at_monster()
7. sysopt.fmtd_wizard_list
8. putstr()
9. display_nhwindow()NetHack
10. destroy_nhwindow()NetHack
11. dispfile_help()
12. dispfile_shelp()*/
#include "hack.h"
#include "dlb.h"

@ -6,6 +6,21 @@
/*
* 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)*/
#include "hack.h"

@ -2,6 +2,12 @@
/* 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 *, ...)
*/
#include "hack.h"

@ -18,7 +18,12 @@
*
* polymon (called directly) usually golem petrification
*/
/*see_monsters():此函数用于更新玩家视野内的怪物信息,以便玩家可以看到附近的怪物。
encumber_msg()
retouch_equipment(2)
selftouch()
hides_under()
canletgo()*/
#include "hack.h"
static void check_strangling(boolean);

Loading…
Cancel
Save