Credit to maxskywalker! This is based off of code from this thread:
IF YOU SEE A VERSION CLAIMING IT IS v4 OF THIS NOT ON THIS POST, IT IS NOT!
http://scratch.mit.edu/forums/viewtopic.php?id=68377
Here is is (Version 3.1):
##Importing##
import random
##########
##Initiating Variables and Such Items##
dmg = 0# dmg can also refer to choices such as menu selection and many other varying possibilites
edmg = 0
weap = 0
minDmg = 0
maxDmg = 0
hp = 70
ehp = 60
mp = 3
shieldOn = 1
eshieldOn = 1
gold = 0
level = 1
win = 0
loop = 1
##########
#Attacks in this release are: vine whip and special attack.
#This game is made by msdosdude, with credit to maxskywalker.
input('''Hello and Welcome to the Pokémon Arena, Bulbasaur!\n(Press the Enter Key to Continue)''')
print('''Your Fight has begun!\n\n\t\tGo get 'em, Bulbasaur!\n''')
while loop == 1:
print('''You have ''', hp, '''HP.\nYou have ''', mp, '''SP.''')
dmg = input('''>>> ''')
if dmg == '''vine whip''':
dmg = random.randint((1 + minDmg), (5 + maxDmg))
ehp -= (dmg + level + weap) // eshieldOn
print('''You have attacked.''')
print('''Dark Bulbasaur's HP:\n\t''', ehp)
elif dmg == '''special attack''':
if mp > 0:
dmg = random.randint(4, 9)
ehp -= (dmg + level + weap)
mp -= 1
print('''You have used a special attack''')
print('''Dark Bulbasaur's HP:\n\t''', ehp)
elif mp == 0:
print('''You do not have enough SP to use this ability.''')
elif dmg == '''riches''':
print('''Cheat Code detected''')
print('''You have earned 100 Gold!''')
gold += 100
else:
print('''That is not a valid option. Your character will now pass.''')
pass
if ehp <= 0:
print('''Congradulations! You have won!''')
win = 1
elif hp <= 0:
print('''You have lost!''')
loop = 0
win = 0
edmg = random.randint(0, 10)# Here we set the enemy choice: attack, magic, or shield
if loop == 1:
if edmg < 7:
hp -= 2 // shieldOn
print('''Dark Bulbasaur has attacked.''')
shieldOn = 1
elif edmg < 9 and edmg > 6:
hp -= 4 // shieldOn
print('''Dark Bulbasaur has used a special attack.''')
else:
print('''A bug in this game has been found. Please report the event to msdosdude.''')
##Ending Battle, Beginning Upgrade Stage##
if win == 1:
print('''\n\t\tWelcome to the shop! Feel free to look around.''')
dmg = input('''
Upgrade Attack Kit 1: +1 to average damage dealt, 75 Gold\n
Upgrade Attack Kit 2: +1 to minimum damage, 60 Gold\n
Upgrade Attack Kit 3: +1 to maximum damage, -1 to minimum damage, 45\n''')
if dmg.lower() == '''Upgrade Attack Kit 1''':
if gold >= 75:
weap += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''Upgrade Attack Kit 2''':
if gold >= 60:
minDmg += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''Upgrade Attack Kit 3''':
if gold >= 45:
maxDmg += 1
if minDmg > 0:
minDmg -= 1
level += 1
ehp = 35 + (level * 5)
hp = 70
mp = 3
win = 0
Old Code:
Version 3 Code:
##Importing##
import random
##########
##Initiating Variables and Such Items##
dmg = 0# dmg can also refer to choices such as menu selection and many other varying possibilites
edmg = 0
weap = 0
minDmg = 0
maxDmg = 0
hp = 70
ehp = 60
mp = 3
shieldOn = 1
eshieldOn = 1
gold = 0
level = 1
win = 0
loop = 1
##########
input('''Hello and Welcome to the Pokémon Arena, Bulbasaur!\n(Press the Enter Key to Continue)''')
print('''Your Fight has begun!\n\n\t\tGo get 'em, Bulbasaur!\n''')
while loop == 1:
print('''You have ''', hp, '''HP.\nYou have ''', mp, '''SP.''')
dmg = input('''>>> ''')
if dmg == '''attack''':
dmg = random.randint((1 + minDmg), (5 + maxDmg))
ehp -= (dmg + level + weap) // eshieldOn
eshieldOn = 1
print('''You have attacked.''')
print('''Dark Bulbasaur's HP:\n\t''', ehp)
elif dmg == '''special attack''':
if mp > 0:
dmg = random.randint(4, 9)
ehp -= (dmg + level + weap) // eshieldOn
mp -= 1
eshieldOn = 1
print('''You have used a special attack''')
print('''Dark Bulbasaur's HP:\n\t''', ehp)
elif mp == 0:
print('''You do not have enough SP to use this ability.''')
elif dmg == '''shield''':
print('''You have raised your shield.''')
shieldOn = 2
elif dmg == '''riches''':
print('''Cheat Code detected''')
print('''You have earned 100 Gold!''')
gold += 100
else:
print('''That is not a valid option. Your character will now pass.''')
pass
if ehp <= 0:
print('''Congradulations! You have won!''')
win = 1
elif hp <= 0:
print('''You have lost!''')
loop = 0
win = 0
edmg = random.randint(0, 10)# Here we set the enemy choice: attack, magic, or shield
if loop == 1:
if edmg < 7:
hp -= 2 // shieldOn
print('''Dark Bulbasaur has attacked.''')
shieldOn = 1
elif edmg < 9 and edmg > 6:
hp -= 4 // shieldOn
print('''Dark Bulbasaur has used a special attack.''')
elif edmg > 8:
print('''Dark Bulbasaur has raised it's shield.''')
eshield = 2
else:
print('''A bug in this game has been found. Please report the event to msdosdude.''')
##Ending Battle, Beginning Upgrade Stage##
if win == 1:
print('''\n\t\tWelcome to the shop! Feel free to look around.''')
dmg = input('''
Upgrade Attack Kit 1: +1 to average damage dealt, 75 Gold\n
Upgrade Attack Kit 2: +1 to minimum damage, 60 Gold\n
Upgrade Attack Kit 3: +1 to maximum damage, -1 to minimum damage, 45\n''')
if dmg.lower() == '''Upgrade Attack Kit 1''':
if gold >= 75:
weap += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''Upgrade Attack Kit 2''':
if gold >= 60:
minDmg += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''Upgrade Attack Kit 3''':
if gold >= 45:
maxDmg += 1
if minDmg > 0:
minDmg -= 1
level += 1
ehp = 35 + (level * 5)
hp = 70
mp = 3
win = 0
Version 2.1 Code:
##Importing##
import random
##########
##Initiating Variables and Such Items##
dmg = 0# dmg can also refer to choices such as menu selection and many other varying possibilites
edmg = 0
weap = 0
minDmg = 0
maxDmg = 0
hp = 70
ehp = 70
mp = 3
shieldOn = 1
eshieldOn = 1
gold = 0
level = 1
win = 0
loop = 1
##########
input('''Hello and Welcome to the Pokémon Arena, Mewtwo!\n(Press the Enter Key to Continue)''')
print('''Your Fight has begun!\n\n\t\tGo for it, Mewtwo!\n''')
while loop == 1:
print('''You have ''', hp, '''HP.\nYou have ''', mp, '''MP.''')
dmg = input('''>>> ''')
if dmg == '''attack''':
dmg = random.randint((1 + minDmg), (5 + maxDmg))
ehp -= (dmg + level + weap) // eshieldOn
eshieldOn = 1
print('''You have attacked.''')
print('''Wartortle's HP:\n\t''', ehp)
elif dmg == '''magic''':
if mp > 0:
dmg = random.randint(4, 9)
ehp -= (dmg + level + weap) // eshieldOn
mp -= 1
eshieldOn = 1
print('''You have used magic''')
print('''Wartortle's HP:\n\t''', ehp)
elif mp == 0:
print('''You do not have enough MP to use this ability.''')
elif dmg == '''shield''':
print('''You have raised your shield.''')
shieldOn = 2
elif dmg == '''riches''':
print('''Cheat Code detected''')
print('''You have earned 100 Gold!''')
gold += 100
else:
print('''That is not a valid option. Your character will now pass.''')
pass
if ehp <= 0:
print('''Congradulations! You have won!''')
win = 1
elif hp <= 0:
print('''You have lost!''')
loop = 0
win = 0
edmg = random.randint(0, 10)# Here we set the enemy choice: attack, magic, or shield
if loop == 1:
if edmg < 7:
hp -= 2 // shieldOn
print('''Wartortle has attacked.''')
shieldOn = 1
elif edmg < 9 and edmg > 6:
hp -= 4 // shieldOn
print('''Wartortle has used magic.''')
elif edmg > 8:
print('''Wartortle has raised their shield.''')
eshield = 2
else:
print('''A bug in this program has been found. Please report the event to *name removed*.''')
##Ending Battle, Beginning Upgrade Stage##
if win == 1:
print('''\n\t\tWelcome to the shop! Feel free to look around.''')
dmg = input('''
Diamond: +1 to average damage dealt, 75 Gold\n
Balance: +1 to minimum damage, 60 Gold\n
Weightened Blade: +1 to maximum damage, -1 to minimum damage, 45\n''')
if dmg.lower() == '''diamond''':
if gold >= 75:
weap += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''balance''':
if gold >= 60:
minDmg += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''weightened blade''':
if gold >= 45:
maxDmg += 1
if minDmg > 0:
minDmg -= 1
level += 1
ehp = 35 + (level * 5)
hp = 70
mp = 3
win = 0
v2 code:
##Importing##
import random
##########
##Initiating Variables and Such Items##
dmg = 0# dmg can also refer to choices such as menu selection and many other varying possibilites
edmg = 0
weap = 0
minDmg = 0
maxDmg = 0
hp = 70
ehp = 70
mp = 3
shieldOn = 1
eshieldOn = 1
gold = 0
level = 1
win = 0
loop = 1
##########
input('''Hello and Welcome to the Pokémon Arena, Mewtwo!\n(Press the Enter Key to Continue)''')
print('''Your Fight has begun!\n\n\t\tGo for it, Mewtwo!\n''')
while loop == 1:
print('''You have ''', hp, '''HP.\nYou have ''', mp, '''MP.''')
dmg = input('''>>> ''')
if dmg == '''attack''':
dmg = random.randint((1 + minDmg), (5 + maxDmg))
ehp -= (dmg + level + weap) // eshieldOn
eshieldOn = 1
print('''You have attacked.''')
print('''Wartortle's HP:\n\t''', ehp)
elif dmg == '''magic''':
if mp > 0:
dmg = random.randint(4, 9)
ehp -= (dmg + level + weap) // eshieldOn
mp -= 1
eshieldOn = 1
print('''You have used magic''')
print('''Wartortle's HP:\n\t''', ehp)
elif mp == 0:
print('''You do not have enough MP to use this ability.''')
elif dmg == '''shield''':
print('''You have raised your shield.''')
shieldOn = 2
elif dmg == '''riches''':
print('''Cheat Code detected''')
print('''You have earned 100 Gold!''')
gold += 100
else:
print('''That is not a valid option. Your character will now pass.''')
pass
if ehp <= 0:
print('''Congradulations! You have won!''')
win = 1
elif hp <= 0:
print('''You have lost!''')
loop = 0
win = 0
edmg = random.randint(0, 10)# Here we set the enemy choice: attack, magic, or shield
if loop == 1:
if edmg < 7:
hp -= 2 // shieldOn
print('''Wartortle has attacked.''')
shieldOn = 1
elif edmg < 9 and edmg > 6:
hp -= 4 // shieldOn
print('''Wartortle has used magic.''')
elif edmg > 8:
print('''SWartortle has raised their shield.''')
eshield = 2
else:
print('''A bug in this program has been found. Please report the event to *name removed*.''')
##Ending Battle, Beginning Upgrade Stage##
if win == 1:
print('''\n\t\tWelcome to the shop! Feel free to look around.''')
dmg = input('''
Diamond: +1 to average damage dealt, 75 Gold\n
Balance: +1 to minimum damage, 60 Gold\n
Weightened Blade: +1 to maximum damage, -1 to minimum damage, 45\n''')
if dmg.lower() == '''diamond''':
if gold >= 75:
weap += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''balance''':
if gold >= 60:
minDmg += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''weightened blade''':
if gold >= 45:
maxDmg += 1
if minDmg > 0:
minDmg -= 1
level += 1
ehp = 35 + (level * 5)
hp = 70
mp = 3
win = 0
v1 code:
##Importing##
import random
##########
##Initiating Variables and Such Items##
dmg = 0# dmg can also refer to choices such as menu selection and many other varying possibilites
edmg = 0
weap = 0
minDmg = 0
maxDmg = 0
hp = 90
ehp = 45
mp = 3
shieldOn = 1
eshieldOn = 1
gold = 0
level = 1
win = 0
loop = 1
##########
input('''Hello and Welcome to the Pokémon Arena, Raichu!\n(Press the Enter Key to Continue)''')
print('''Your Fight has begun!\n\n\t\tEngarde!\n''')
while loop == 1:
print('''You have ''', hp, '''HP.\nYou have ''', mp, '''MP.''')
dmg = input('''>>> ''')
if dmg == '''attack''':
dmg = random.randint((1 + minDmg), (5 + maxDmg))
ehp -= (dmg + level + weap) // eshieldOn
eshieldOn = 1
print('''You have attacked.''')
print('''Snivy's HP:\n\t''', ehp)
elif dmg == '''magic''':
if mp > 0:
dmg = random.randint(4, 9)
ehp -= (dmg + level + weap) // eshieldOn
mp -= 1
eshieldOn = 1
print('''You have used magic''')
print('''Snivy's HP:\n\t''', ehp)
elif mp == 0:
print('''You do not have enough MP to use this ability.''')
elif dmg == '''shield''':
print('''You have raised your shield.''')
shieldOn = 2
elif dmg == '''riches''':
print('''Cheat Code detected''')
print('''You have earned 100 Gold!''')
gold += 100
else:
print('''That is not a valid option. Your character will now pass.''')
pass
if ehp <= 0:
print('''Congradulations! You have won!''')
win = 1
elif hp <= 0:
print('''You have lost!''')
loop = 0
win = 0
edmg = random.randint(0, 10)# Here we set the enemy choice: attack, magic, or shield
if loop == 1:
if edmg < 7:
hp -= 2 // shieldOn
print('''Snivy has attacked.''')
shieldOn = 1
elif edmg < 9 and edmg > 6:
hp -= 4 // shieldOn
print('''Snivy has used magic.''')
elif edmg > 8:
print('''Snivy has raised their shield.''')
eshield = 2
else:
print('''A bug in this program has been found. Please report the event to *name removed*.''')
##Ending Battle, Beginning Upgrade Stage##
if win == 1:
print('''\n\t\tWelcome to the shop! Feel free to look around.''')
dmg = input('''
Diamond: +1 to average damage dealt, 75 Gold\n
Balance: +1 to minimum damage, 60 Gold\n
Weightened Blade: +1 to maximum damage, -1 to minimum damage, 45\n''')
if dmg.lower() == '''diamond''':
if gold >= 75:
weap += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''balance''':
if gold >= 60:
minDmg += 1
else:
print('''You do not have enough Gold for that upgrade.''')
elif dmg.lower() == '''weightened blade''':
if gold >= 45:
maxDmg += 1
if minDmg > 0:
minDmg -= 1
level += 1
ehp = 35 + (level * 5)
hp = 90
mp = 3
win = 0
Versions:
Version 1 (Download)
Version 2 (Download)
Version 2.1 (Download)
Version 3 (Download
Version 3.1 (Download)
Last edited by msdosdude (2011-07-25 10:37:33)
Offline
wmays wrote:
Looks pretty advanced. Maybe maxskywalker could add a list of pokemon, and using... IDK, what they're called, probably nested lists, for the attacks/magic/heal.
Maxskywalker made the original, and I modified it so it's a Pokémon Battle Arena.
Offline
I am FLATTERED!!! You ACTUALLY used MY code! Edit it and turn of smilies, though. It's making a Scratch block appear.
Offline
wmays wrote:
Looks pretty advanced. Maybe maxskywalker could add a list of pokemon, and using... IDK, what they're called, probably nested lists, for the attacks/magic/heal.
I haven't really learned about 'nested lists' yet (but I gather what it means from my experience with Adobe Flash) and I don't think that I'm going to do that very soon. My 'arena.py' was more of a test. It's my first game, and I wanted to keep it as simple as possible (it didn't start with a shop. I added that later). Maybe someday, though, I could make a Pokémon game. The only thing is that Pokémon has move-types, 4 different moves (mine only has 3), Pokémon types, and multiple Pokémon. That's alot of stuff to program.
Offline
All you really did was change the names, but I'm still (really) glad that you like my game enough to remix it! Might I suggest changing the names of items in the shop, though? Oh, and when Wartotle raises its shield, you typed 'SWARTOTLE' instead of 'WARTOTLE'.
Last edited by maxskywalker (2011-07-13 07:28:01)
Offline
maxskywalker wrote:
I am FLATTERED!!! You ACTUALLY used MY code! Edit it and turn of smilies, though. It's making a Scratch block appear.
Well, (unless that was sarcasm), I like your code, it was good!
Offline
Hi. Would you mind putting in a link to the thread you got this from (ie. mine)? Oh, and I'll get to work on a Pokémon game for you. Who should there be? Maybe Reshiram vs. Zekrom? If I just look at the different stats long enough, I should be able to figure some formula out. Expect your Version 3 (maybe version 4 if you care to do anything on your own) out soon- by the 27th of July. In the meantime, you can expect changes such as skills from Pokémon Black/White and PP for different moves.
Offline
maxskywalker wrote:
Expect your Version 3 (maybe version 4 if you care to do anything on your own) out soon- by the 27th of July.
I released version 3 already.
maxskywalker wrote:
Oh, and I'll get to work on a Pokémon game for you.
No thanks.
Offline
The name is pokemon styled but the battle system isn't...
You have weapons, "MP", shields, random forumals, more like final fantasy or something.
I think that you want to make this more accurate you should first learn python properly and code it based on the forumlas from smogon or someother pokemon site.
Offline
archmage wrote:
The name is pokemon styled but the battle system isn't...
You have weapons, "MP", shields, random forumals, more like final fantasy or something.
I think that you want to make this more accurate you should first learn python properly and code it based on the forumlas from smogon or someother pokemon site.
I was thinking the same thing. You kinda just took the original script and changed the names...
Offline
kayybee wrote:
Pokemon can't shield, unless they know protect/detect (or have wonder guard, and that occasionally shields...)
This game is far from done.
Offline
Harakou wrote:
archmage wrote:
The name is pokemon styled but the battle system isn't...
You have weapons, "MP", shields, random forumals, more like final fantasy or something.
I think that you want to make this more accurate you should first learn python properly and code it based on the forumlas from smogon or someother pokemon site.I was thinking the same thing. You kinda just took the original script and changed the names...
This game is far from done.
Offline
Hey, slight delay. I'm gonna need to postpone the Version 4.0 date indefinitely. I will work as quickly as I can (while still avoiding bugs), but it might not be out before the end of July.
Offline
kayybee wrote:
Pokemon can't shield, unless they know protect/detect (or have wonder guard, and that occasionally shields...)
This will be fixed in Version 4.
Offline
archmage wrote:
The name is pokemon styled but the battle system isn't...
You have weapons, "MP", shields, random forumals, more like final fantasy or something.
I think that you want to make this more accurate you should first learn python properly and code it based on the forumlas from smogon or someother pokemon site.
I am msodude's developer. I am currently working on a Pokémon battle system, but it's complicated. So far I'm still in the brainstorming stage; there's not so much as a file called 'Pokémon' on my computer, let alone a single line of code.
Offline
msdosdude wrote:
maxskywalker wrote:
Might I suggest changing the names of items in the shop, though?
Version 3.
![]()
Hey, what the .lower() function does is turn text into all lower-case. Instead of saying
if dmg.lower() == '''Attack Upgrade 1''':
#This is just a sample and is not meant to functionyou should do
if dmg.lower() == '''attack upgrade 1''':
#This is just a sample and is not meant to functionSound okay?
Offline