Skip to content

Commit

Permalink
refactor(pkuxkx): 重构房间信息,现在物品叫 getable 和 lookable
Browse files Browse the repository at this point in the history
  • Loading branch information
dzpao committed Apr 23, 2024
1 parent 28a7cf2 commit 1cca478
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions mud/pkuxkx/plugins/basic/map/room.extra.tin
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ event.HandleOnce {map/init} {pkuxkx/map/room} {map} {pkuxkx.map.Room.init};
#var gMapRoom[existShown] {false}; #nop 出口信息已出现;
#var gMapRoom[lookable] {}; #nop 你可以看看(look)的东西;
#var gMapRoom[colorItems] {}; #nop 带颜色的房间特殊物品;
#var gMapRoom[dynItems] {}; #nop 你可以获取(get)的东西;
#var gMapRoom[getable] {}; #nop 你可以获取(get)的东西;
#var gMapRoom[objs] {}; #nop 房间物品,不包含生物;
#var gMapRoom[npcs] {}; #nop 房间NPC, 不包含非生物和玩家;
#var gMapRoom[players] {}; #nop 房间玩家,不包含非生物和NPC;
Expand Down Expand Up @@ -198,6 +198,7 @@ event.HandleOnce {map/init} {pkuxkx/map/room} {map} {pkuxkx.map.Room.init};
#case {"NPC"} {#local type {<134>房间 NPC}};
#case {"物品"} {#local type {<164>房间物品}};
#case {"玩家"} {#local type {<174>房间玩家}};
#default {#local type {<164>房间物品}};
};
#if { @isFalse{$gMapRoom[existShown]} } {
#var gMapRoom[existShown] {true};
Expand Down Expand Up @@ -250,22 +251,22 @@ event.HandleOnce {map/init} {pkuxkx/map/room} {map} {pkuxkx.map.Room.init};
};

#action {^%+4s你可以获取(get):%*。$} {
#local items {@str.Split{{%%2};{{,|,}}}};
#var gMapRoom[dynItems] {$items};
#local getable {@str.Split{{%%2};{{,|,}}}};
#var gMapRoom[getable] {$getable};

#local item {};
#foreach {$items} {item} {
#foreach {$getable} {item} {
#list gMapRoom[objs] add {{
{id} {$item}
{type} {dynItems}
{type} {getable}
}};
};

#class map.Room.getInfo.map kill;
#class map.Room.getInfo.desc kill;

#if { @option.IsEnable{MapDebug} } {
#echo {%s} {<171>动态物品<299> {$items}};
#echo {%s} {<171>动态物品<299> {$getable}};
#line gag;
};
};
Expand Down
2 changes: 1 addition & 1 deletion mud/pkuxkx/plugins/basic/map/tab.tin
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ event.HandleOnce {map/init} {map/tab} {map} {map.tab-completion.init};
};

#local item {};
#foreach {$gMapRoom[items]} {item} {
#foreach {$gMapRoom[lookable]} {item} {
#if { "$item" != "" } {
#tab $item;
};
Expand Down
2 changes: 1 addition & 1 deletion mud/pkuxkx/plugins/basic/map/xiaoyao.tin
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ event.HandleOnce {map/init} {map/xiaoyao} {map} {xiaoyao.Init};
#local dock {$gMapRoom[dock]};
#local location {};

#if { @slist.Contains{{$gMapRoom[items]};{<node>}} } {
#if { @slist.Contains{{$gMapRoom[lookable]};{<node>}} } {
#nop 节点以 walk 节点名称标记;
#local location {$node($area的$room)};
};
Expand Down

0 comments on commit 1cca478

Please sign in to comment.