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


Python Character.setDefense方法代码示例

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


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

示例1: getTrial

# 需要导入模块: from Character import Character [as 别名]
# 或者: from Character.Character import setDefense [as 别名]
	def getTrial(self):
		return self.trial

charType = SelectCharacter()
name = SetName()
player = Character(name.getName(), charType.getType(), charType.getHP(), charType.getATK())
dragon = Dragon()
home = Home("")
while dragon.getHP() != 0 and player.getHP() != 0 and home.getTrial() != 99:
	if home.getTrial() == 1:
		string = ""
		diamond = DiamondDefense()
		if diamond.getDiamondStatus() == 0:
			string = "Oh no! You didn't find the Defense Diamond.\nYou can continue to your next trial, but you might want to try again.\nYou may need it later!"
		elif diamond.getDiamondStatus() == 1:
			player.setDefense()
			string = "Congratulations! You found the Defense Diamond!\nYou may choose your next trial.\nIf you have completed all the trials, you are ready to face the dragon!"
		home = Home(string)
	elif home.getTrial() == 2:
		string = ""
		riddle = Riddle()
		if riddle.getHammer() == 0:
			string = "Oh no! You did not attain War Hammer.\nYou can continue to your next trial, but you might want to try again.\nYou may need it later!"
		elif riddle.getHammer() == 1:
			player.setHammer()
			string = "Congratulations! You have attained War Hammer!\nYou may choose your next trial.\nIf you have completed all the trials, you are ready to face the dragon!"
		home = Home(string)
	elif home.getTrial() == 3:
		string = ""
		card = CardChallenge()
		if card.getLuckStatus() == 0:
开发者ID:AprilC1983,项目名称:RPGPROJECT,代码行数:33,代码来源:DragonSlayerGame.py


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