本文整理汇总了Python中room.Room.talktargets方法的典型用法代码示例。如果您正苦于以下问题:Python Room.talktargets方法的具体用法?Python Room.talktargets怎么用?Python Room.talktargets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类room.Room
的用法示例。
在下文中一共展示了Room.talktargets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Room
# 需要导入模块: from room import Room [as 别名]
# 或者: from room.Room import talktargets [as 别名]
from room import Room
r = Room()
r.roomname = 'testroom2'
r.exits = {'up': 'testroom'}
r.roomdesc = """
As you look around, you notice there seems to be not much here.
it appears you can go up and get back to where you came from
there is a pile of gold and a large monster looking at you strangely.
"""
r.looktargets = {'gold': 'oooh. Shiny!\n\n',
'monster': 'HOLY CRAP ITS A MONSTER\n\n',
'pile': 'oooh. Shiny!\n\n',
'pile of gold': 'oooh. Shiny!\n\n',
}
r.talktargets = {'monster': 'test_monster'}
r.characters = ['test_monster']
示例2: Room
# 需要导入模块: from room import Room [as 别名]
# 或者: from room.Room import talktargets [as 别名]
from room import Room
r = Room()
r.roomname = 'testroom'
r.exits = {'under table': 'testroom2'}
r.roomdesc = """
This room seems very empty except for a small round table
in the very center. This table is covered by a white tablecloth
and has a single mysterious object sitting exactly in the center
of the table. Also there is an old man.
"""
r.looktargets = {'object': 'You cant seem to descern what it is\n\n',
'old man': 'He appears very old. maybe you should talk to him?\n\n',
'table': 'This seems to be a normal table\n\n',
'tablecloth': 'perfect white linen tablecloth. Nice!\n\n\n',
}
r.talktargets = {'old man':'test_npc'}
r.characters = ['test_npc']