Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- #player stats
- playerLevel = 1
- playerHp = 85+15*playerLevel
- playerMana = 130 + 20*playerLevel
- playerExp = 75.0
- ressurects = 3
- #experience calculations
- playerExpForLevel = playerLevel*100
- playerExpToLevel = playerExpForLevel - playerExp
- playerExpPerc = playerExp/playerExpForLevel
- playerExpPercent = playerExpPerc*100
- #boss or regular mob
- randNum=8 #random.randint(1,10)
- if randNum >= 7:
- print "A boss has appeared!\n"
- bossHp=random.randint(200,500)*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:
- hitChance = random.randint(1,10)
- if hitChance >= 5:
- critChance = random.randint(1,10)
- if critChance >= 8:
- playerMana-=50
- #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"
- print "You have slain the boss! And have been rewarded 150 exp!"
- playerExp+=150
- if playerExp >= playerExpForLevel:
- difference = playerExp - playerExpForLevel
- playerExp = difference
- playerLevel+=1
- else:
- print "A mob has appeared!\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement