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


Python World.armor方法代码示例

本文整理汇总了Python中World.armor方法的典型用法代码示例。如果您正苦于以下问题:Python World.armor方法的具体用法?Python World.armor怎么用?Python World.armor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在World的用法示例。


在下文中一共展示了World.armor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: buildEquipmentFromFile

# 需要导入模块: import World [as 别名]
# 或者: from World import armor [as 别名]

#.........这里部分代码省略.........
				oddsEntry[1] = int(oddsEntry[1])
				if oddsEntry[0] == 'True':
					oddsEntry[0] = True
				elif oddsEntry[0] == 'False':
					oddsEntry[0] = False
			#print nestedOddsList
			spawnOdds = nestedOddsList
		if Data.startswith('kind.objectSpawner.container='):
			text = Data[29:-1]
			if text == 'None':
				container = None
			else:
				container = text[1:-1]		# this should be a reference to another object
				container = container.split(', ')
		if Data.startswith('kind.objectSpawner.cycles='):
			cycles = int(Data[26:-1])
		if Data.startswith('kind.objectSpawner.repeat='):
			text = Data[26:-1]
			if text == 'True':
				repeat = True
			elif text == 'False':
				repeat = False
		if Data.startswith('kind.objectSpawner.active='):
			text = Data[26:-1]
			#print "***active:" + text
			if text == 'True':
				active = True
			elif text == 'False':
				active = False


	if equipmentType == 'weapon':
		newWeapon = World.weapon()
	elif equipmentType == 'armor':
		newArmor = World.armor()

	if itemGrabHandler == True:
		newItemGrabHandler = World.itemGrabHandler(notDroppable=notDroppable)
	else:
		newItemGrabHandler = None
	if objectSpawner == True:
		newObjectSpawner = World.objectSpawner(owner=None, TIMERS=Globals.TIMERS, time=time, obj=None, oddsList=oddsList, container=container, cycles=cycles, repeat=repeat, active=active)
	else:
		newObjectSpawner = None


	newEquipment = World.equipment(owner=None, weapon=newWeapon, armor=newArmor, slot=slot, durability=durability, maxDurability=maxDurability, worth=worth, hp=hp, pp=pp, offense=offense, defense=defense, speed=speed, guts=guts, luck=luck, vitality=vitality, IQ=IQ, battleCommands=battleCommands, statusEffect=statusEffect, onUse=onUse)
	newItem = World.item(isCarryable=isCarryable, respawns=respawns, itemGrabHandler=newItemGrabHandler, objectSpawner=newObjectSpawner, equipment=newEquipment, onUse=onUse)
	if newItem.itemGrabHandler:
		newItem.itemGrabHandler.owner = newItem
	if newItem.objectSpawner:
		newItem.objectSpawner.owner = newItem
	newEquipment.owner = newItem
	newObject = World.Object(name=name, description=description, isVisible=isVisible, spawnContainer=spawnContainer, longDescription=longDescription, kind=newItem)
	if newObject.kind.objectSpawner:
		newObject.kind.objectSpawner.obj = newObject
	newObject.ID = ID
	newItem.owner = newObject


	equipmentFromFile.append(newObject)

	print "\n"
	print "name:" + str(newObject.name)
	print "description:" + str(newObject.description)
	print "currentRoom:" + str(newObject.currentRoom)
开发者ID:buckets1337,项目名称:MotherMUD,代码行数:70,代码来源:Objects.py


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