我正在使用 C++ 和 Lua 开发 MUD,并且正在尝试为表情创建一组函数。
我写过:
add_functions
{
['subject-bind-search say'] = 'none',
['player say string-type'] = function(player, msg)
player_text(player, 'You say "' .. msg.string .. '".')
witness_text(player, M('indefinite', player) .. ' says "' .. msg.string .. '".')
end,
['subject-bind-search say-to'] = 'none',
['player say-to string-type thing'] = function(player, msg, thing)
player_text(player, 'You say "' .. msg.string .. '" to ' .. M('definite',thing) .. '.')
witness_text(player, M('indefinite', player) .. ' says "' .. msg.string .. '" to ' .. M('indefinite', thing) .. '.')
end,
['player dance'] = function(player)
player_text(player, 'You burst into dance.')
witness_text(player, M('indefinite', player)..' bursts into dance.')
add_atoms{dance='verb'}
end
}
当我和其他人使用 telnet 连接到服务器时,我可以键入:
说“嗨”——>每个人都看到你想要的。
我可以打字:
对 playerBob 说“hi” --> playerBob 看到 hi 就好了
但是,如果我简单地键入:dance
当它无法识别任何动词时,我会收到一条错误消息。我以为已经add_atoms{ dance = 'verb' }
解决了,但是...
有人碰巧知道为什么我不能跳舞吗?