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


Python Player.getPower方法代码示例

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


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

示例1: attack

# 需要导入模块: import Player [as 别名]
# 或者: from Player import getPower [as 别名]
def attack(): #Gestion du combat
	if Map.isMonster(Player.getPosition()) == 0:
		descript = "Qui voulez-vous attaquer dites-moi? Les murs?"
	else :
		playerPow = Player.getPower()
		monsterPow = Map.getMonsterPower(Player.getPosition())
		player1, player2, monster1, monster2 = random.randint(1,6),random.randint(1,6),random.randint(1,6),random.randint(1,6)
		if Player.isEquip() == 1:
			equipPow = Player.getEquipModifier()
		else:
			equipPow = 0
		descript = "Vous chargez tous les deux."
		if playerPow+player1+player2+equipPow >= monsterPow+monster1+monster2:
			Map.editMonsterHealth(Player.getPosition(),-2)
			descript += "Vous blessez votre adversaire."
		else:
			if random.randint(1,6) == 6:
				Player.editHealth(-2)
			else:
				Player.editHealth(-1)
			descript += "Votre adversaire vous blesse. "
		if Map.getMonsterHealth(Player.getPosition()) <= 0:
			descript += "CE coup lui est fatal. Son corps tombe tel un pantin desarticule et, quelques secondes plus tard, il se desintegre." 
			Player.editXp(Map.getMonsterXp(Player.getPosition()))
			Map.removeMonster(Player.getPosition())
	Player.editTime(1)
	return descript
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:29,代码来源:GameFR.py

示例2: attack

# 需要导入模块: import Player [as 别名]
# 或者: from Player import getPower [as 别名]
def attack(): #Gestion du combat
	if Map.isMonster(Player.getPosition()) == 0:
		descript = "Tell me, who are you trying to fight? The walls perhaps?"
	else :
		playerPow = Player.getPower()
		monsterPow = Map.getMonsterPower(Player.getPosition())
		player1, player2, monster1, monster2 = random.randint(1,6),random.randint(1,6),random.randint(1,6),random.randint(1,6)
		if Player.isEquip() == 1:
			equipPow = Player.getEquipModifier()
		else:
			equipPow = 0
		descript = "You both charge at the other."
		if playerPow+player1+player2+equipPow >= monsterPow+monster1+monster2:
			Map.editMonsterHealth(Player.getPosition(),-2)
			descript += "You hit your opponent."
		else:
			if random.randint(1,6) == 6:
				Player.editHealth(-2)
			else :
				Player.editHealth(-1)
			descript += "Your opponent hits you. "
		if Map.getMonsterHealth(Player.getPosition()) <= 0:
			descript += "THIS blow is deadly. It's body falls like a ragdoll and, a few seconds later, it disintegrates." 
			Player.editXp(Map.getMonsterXp(Player.getPosition()))
			Map.removeMonster(Player.getPosition())
	Player.editTime(1)
	return descript
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:29,代码来源:GameEN.py

示例3: init

# 需要导入模块: import Player [as 别名]
# 或者: from Player import getPower [as 别名]
def init(): # Defini les variables de depart
	global descript, myBackground
	myBackground=Background.create("backgroundFR","winFR","loseFR","menuFR","menu2FR")
	Background.show(myBackground,"menu")
	Player.setName()
	Player.setMaxHealth()
	Player.setPower()
	difficulty = setDifficulty()
	Map.generate(difficulty)
	descript = descript()
	tty.setcbreak(sys.stdin.fileno())
	Map.doppel(Player.getMaxHealth(),Player.getPower())
	return descript, difficulty
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:15,代码来源:GameFR.py

示例4: checkXp

# 需要导入模块: import Player [as 别名]
# 或者: from Player import getPower [as 别名]
def checkXp(): # Verifie si le joueur change de niveau)
	global levelUp, levelPrev
	if Player.getXp() >= levelUp :
		if Player.getLevel() < 10:
			Player.editLevel(1)
			Player.editMaxHealth(2)
			if Player.getLevel()%2 == 0:
				Player.editPower(1)
			Player.setXp(Player.getXp()-levelUp)
			temp = levelUp
			levelUp += Player.getLevel()*100-levelPrev
			levelPrev = temp
			Map.doppel(Player.getMaxHealth(),Player.getPower()+Player.getEquipModifier())	
		Player.setHealth(Player.getMaxHealth())
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:16,代码来源:GameFR.py

示例5: display

# 需要导入模块: import Player [as 别名]
# 或者: from Player import getPower [as 别名]
def display(description,difficulty): # Affiche la description correspondant a la derniere action effectuee
	global visited
	Background.show(myBackground,"bg")
	description = description.split()
	descript = [""]
	word, line = 0, 0
	while word < len(description):
		if len(descript[line]) + len(description[word]) + 1 <= 27:
			descript[line] += " " + description[word]
			word += 1
		elif word < len(description):
			descript.append("")
			line +=1
	for line in range (len(descript)):
		sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (6+line, 10, descript[line]))
        sys.stdout.write("\033[1;34m") 
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (22,67,Player.getName()))
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (22,98,str(Player.getLevel())))
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (23,71,str(Player.getMaxHealth())))
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (23,97,str(Player.getPower()+Player.getEquipModifier())))
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (27,77,str(levelUp)))
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (25,76,str(difficulty*difficulty*14)))
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (24,97,str(difficulty*difficulty)))
        if Player.getXp() >= levelUp*80/100:
                sys.stdout.write("\033[1;32m")
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (26,74,str(Player.getXp())))
	if Player.getHealth() > Player.getMaxHealth()*20/100:
                sys.stdout.write("\033[1;32m")
        else:   
                sys.stdout.write("\033[1;31m")
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (23,83,str(Player.getHealth())))
	if Player.getTime() < difficulty*difficulty*14*80/100:
                sys.stdout.write("\033[1;32m")
        else:   
                sys.stdout.write("\033[1;31m")
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (24,76,str(Player.getTime())))
	if visited < difficulty*difficulty*80/100:
                sys.stdout.write("\033[1;32m")
        else:   
                sys.stdout.write("\033[1;31m")
	sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (25,96,str(visited)))
	sys.stdout.flush()
开发者ID:ForgetfulMuffin,项目名称:The-Shades,代码行数:44,代码来源:GameFR.py

示例6: display

# 需要导入模块: import Player [as 别名]
# 或者: from Player import getPower [as 别名]
def display(description,difficulty): # Affiche la description correspondant a la derniere action effectuee
    Background.show(myBackground,"bg")
    description = description.split()
    descript = [""]
    word, line = 0, 0
    while word < len(description):
        if len(descript[line]) + len(description[word]) + 1 <= 27:
            descript[line] += " " + description[word]
            word += 1
        elif word < len(description):
            descript.append("")
            line +=1
    for line in range (len(descript)):
        sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (6+line, 10, descript[line]))
    sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (22,70,Player.getName()))
    sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (23,67,str(Player.getHealth())))
    sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (23,78,str(Player.getPower()+Player.getEquipModifier())))
    sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (24,76,str(Player.getTime())))
    sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (25,76,str(difficulty*14)))
    sys.stdout.flush()
开发者ID:ValentinPearce,项目名称:The-Shades,代码行数:22,代码来源:OriginalGame.py


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