Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- """
- I need cannot get playerMana to decrement when they cast fireball... I don't get it :/ I have used multiple methods.
- I tried to do playerMana-=50 but that did not work either...
- Skype: wetdog54
- """
- #player stats
- playerLevel = 1
- playerHp = 85+15*playerLevel
- playerMana = 130+20*playerLevel
- playerExp = 75
- ressurects = 3
- #experience calculations
- playerExpForLevel = playerLevel*100
- playerExpToLevel = playerExpForLevel - playerExp
- playerExpPercent = (playerExp / playerExpForLevel) * 100
- #boss or regular mob
- randNum=8 #random.randint(1,10)
- if randNum >= 7:
- print "A boss has appeared!\n"
- bossHp=random.randint(100,200)*playerLevel
- while bossHp > 0:
- print "The boss has " + `bossHp` + " HP!\n"
- print "You are level " + `playerLevel` + "!\nYour HP: " + `playerHp` + "!\nYour Mana: " + `playerMana`
- print "You are " + `playerExpPercent` + "% through this level, and need " + `playerExpToLevel` + " more exp!\n"
- print "Choose an attack...\n1. Fireball (50% hit, 50 mana)\n2. Melee (80% hit, 0 mana)"
- attack=raw_input("Attack: ")
- if attack == 1:
- playerMana=playerMana-50
- hitChance = random.randint(1,10)
- if hitChance >= 5:
- critChance = random.randint(1,10)
- if critChance >= 8:
- #player does critical hit, adding 10 damage, plus an additional 5 per level
- fireballHit = random.randint(35,85)*playerLevel
- bossDamage = fireballHit + 5*playerLevel
- bossHp-=bossDamage
- print "You crit the boss for " + `bossDamage` + " HP!\n\n"
- else:
- #player does regular hit
- fireballHit = random.randint(25,75)*playerLevel
- bossHp-= fireballHit
- print "You hit the boss for " + `fireballHit` + " HP!\n\n"
- else:
- print "You miss the boss, and deal no damage!\n\n"
- else:
- #melee attack, no mana consumption
- hitChance = random.randint(1,10)
- if hitChance <= 8:
- #player will hit
- critChance = random.randint(1,10)
- if critChance >= 8:
- #player does critical hit, adding10 damage, plus an additional 5 per level
- meleeHit=random.randint(30,60)*playerLevel
- bossDamage = meleeHit + 4*playerLevel
- bossHp-=bossDamage
- print "You crit the boss for " + `bossDamage` + " HP!\n\n"
- else:
- #player does normal hit
- meleeHit=random.randint(20,50)*playerLevel
- bossHp-=meleeHit
- print "You crit the boss for " + `meleeHit` + " HP!\n\n"
- else:
- print "You miss the boss, and deal no damage!\n\n"
- else:
- print "A mob has appeared!\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement