0

hey I'm making my own adventure text game and I need help.

def getEnergyAndMana(magicExp, energyExp, maxYourMana, bonus, energyLevel, bonus1):
    magicLevel = 0
    if magicExp >= 0:
	magicLevel = 0
        maxYourMana = 50 + bonus
    if magicExp >= 550:
        magicLevel = 1
        maxYourMana = 100 + bonus
    if magicMax >= 1150:
        magicLevel = 2
        maxYourMana = 150 + bonus
    if magicExp >= 1750:
        magicLevel = 3
        maxYourMana = 200 + bonus
    if magicExp >= 2350:
        magicLevel = 4
        maxYourMana = 250 + bonus
    if magicExp >= 3050:
        magicLevel = 5
        maxYourMana = 300 + bonus
    if magicExp >= 3750:
        magicLevel = 6
        maxYourMana = 350 + bonus
    if magicExp >= 4650:
        magicLevel = 7
        maxYourMana = 400 + bonus
    if magicExp >= 5050:
        magicLevel = 8
        maxYourMana = 450 + bonus
    if magicExp >= 5750:
        magicLevel = 9
        maxYourMana = 500 + bonus
    if magicExp >= 6350:
        magicLevel = 10
        maxYourMana = 550 + bonus

	if energyExp >= 0:
        energyLevel = 0
        maxYourEnergy = 50 + bonus1
    if energyExp >= 550:
        energyLevel = 1
        maxYourEnergy = 100 + bonus1
    if energyExp >= 1150:
        energyLevel = 2
        maxYourEnergy = 150 + bonus1
    if energyExp >= 1750:
        energyLevel = 3
        maxYourEnergy = 200 + bonus1
    if energyExp >= 2350:
        energyLevel = 4
        maxYourEnergy = 250 + bonus1
    if energyExp >= 3050:
        energyLevel = 5
        maxYourEnergy = 300 + bonus1
    if energyExp >= 3750:
        energyLevel = 6
        maxYourEnergy = 350 + bonus1
    if energyExp >= 4650:
        energyLevel = 7
        maxYourEnergy = 400 + bonus1
    if energyExp >= 5050:
        energyLevel = 8
        maxYourEnergy = 450 + bonus1
    if energyExp >= 5750:
        energyLevel = 9
        maxYourEnergy = 500 + bonus1
    if energyExp >= 6350:
        energyLevel = 10
        maxYourEnergy = 550 + bonus1
	yourEnergy = maxYourEnergy
	yourMana = maxYourMana
	return maxYourEnergy, maxYourMana, yourMana, yourEnergy

it's the 3rd line

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by jeffery12109
0

It isn't the third line that is having the issues. It is line 37. If you look there, there is an if yet no indentation after it. Though i assume all you need to do is backspace that if a couple of times to get it on the correct level.

Like this:

def getEnergyAndMana(magicExp, energyExp, maxYourMana, bonus, energyLevel, bonus1):
    magicLevel = 0
    if magicExp >= 0:
        magicLevel = 0
        maxYourMana = 50 + bonus
    if magicExp >= 550:
        magicLevel = 1
        maxYourMana = 100 + bonus
    if magicMax >= 1150:
        magicLevel = 2
        maxYourMana = 150 + bonus
    if magicExp >= 1750:
        magicLevel = 3
        maxYourMana = 200 + bonus
    if magicExp >= 2350:
        magicLevel = 4
        maxYourMana = 250 + bonus
    if magicExp >= 3050:
        magicLevel = 5
        maxYourMana = 300 + bonus
    if magicExp >= 3750:
        magicLevel = 6
        maxYourMana = 350 + bonus
    if magicExp >= 4650:
        magicLevel = 7
        maxYourMana = 400 + bonus
    if magicExp >= 5050:
        magicLevel = 8
        maxYourMana = 450 + bonus
    if magicExp >= 5750:
        magicLevel = 9
        maxYourMana = 500 + bonus
    if magicExp >= 6350:
        magicLevel = 10
        maxYourMana = 550 + bonus

    if energyExp >= 0:
        energyLevel = 0
        maxYourEnergy = 50 + bonus1
    if energyExp >= 550:
        energyLevel = 1
        maxYourEnergy = 100 + bonus1
    if energyExp >= 1150:
        energyLevel = 2
        maxYourEnergy = 150 + bonus1
    if energyExp >= 1750:
        energyLevel = 3
        maxYourEnergy = 200 + bonus1
    if energyExp >= 2350:
        energyLevel = 4
        maxYourEnergy = 250 + bonus1
    if energyExp >= 3050:
        energyLevel = 5
        maxYourEnergy = 300 + bonus1
    if energyExp >= 3750:
        energyLevel = 6
        maxYourEnergy = 350 + bonus1
    if energyExp >= 4650:
        energyLevel = 7
        maxYourEnergy = 400 + bonus1
    if energyExp >= 5050:
        energyLevel = 8
        maxYourEnergy = 450 + bonus1
    if energyExp >= 5750:
        energyLevel = 9
        maxYourEnergy = 500 + bonus1
    if energyExp >= 6350:
        energyLevel = 10
        maxYourEnergy = 550 + bonus1
    yourEnergy = maxYourEnergy
    yourMana = maxYourMana
    return maxYourEnergy, maxYourMana, yourMana, yourEnergy

Also, your code was mixing tabs and spaces.. thats a dangerous thing to do. Try just using spaces for the best results.

Hope that helps :)

Edited by Paul Thompson: n/a

0

btw line 37 was a glitch when copying and pasting
THANKS!!! it turns out that I was mixing tabs and spaces, so I deleted the tabs and it works!!!!
thanks again :p

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.