当前位置: 首页>>代码示例>>Python>>正文


Python Room.talktargets方法代码示例

本文整理汇总了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']
开发者ID:elstupido,项目名称:rpg,代码行数:20,代码来源:testroom2.room.py

示例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']
开发者ID:elstupido,项目名称:rpg,代码行数:20,代码来源:testroom1.room.py


注:本文中的room.Room.talktargets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。