A gift...

B

blackneos940

Guest
This is a component to an eventual RPG I'll be making!..... :) It deals with the purchasing of Items, like a Sword, a Potion, etc., etc...... :3 Soon, you'll be able to SELL items too!..... ^^ It's FOSS, so enjoy!..... ^^ (Also, if you guys have any ideas for tweaking it, edit the code, and I'll append those changes!..... :D) Thanks!!..... ^^

Code:
#This program is Free Software Licensed under the GNU GPL V1. You may distribute it under the GPL, or, at your option, any LATER version.

import time as t

money_ammt = 65000

#This (inventory) is your Inventory.

inventory = ["Masamune", "Chocobo Feather", "Cracked Bat", "Rune Armlet", "Wooden Sword", "Phoenix Down", "Elixir", "Potion", "Hi-Potion"]

print ("\nYour Inventory includes:", inventory)

print ("Welcome to my shop!\nWhat can I get ya?\n")

print ("---------------------\n| ~Potion 200        |\n| ~Ether 700        |\n| ~Elixer  4000      |\n| ~Mithril Sword 1200|\n|                    |\n|____________________|")

choice = int(input("Enter a number now.\n1 = Potion\n2 = Ether\n3 = Elixir\n4 = Mithril Sword\n>>> "))

#This is where the bulk of the shopping mechanic resides.

#It deals with the subtraction of the money you possess, though, at this point I had to do pre-calculations, as Python is being weird with Math today...

#So basically, there's no REAL calculations. For now...  Enjoy!!!  :D

if choice == 1:

    print ("Here's yer Potion! Next!")
  
    money_ammt = 64800
  
    inventory.append("Potion")
  
    print (inventory)
  
    t.sleep(2)
  
    print (inventory)
  
elif choice == 2:
  
    print ("Here's yer Ether! Next in line!")
  
    money_ammt = 64300
  
    print (inventory)
  
    inventory.append("Ether")
  
    t.sleep(2)
  
    print (inventory)
  
elif choice == 3:
  
    print ("The Elixir you ordered! Next!")
  
    money_ammt = 61000
  
    print (inventory)
  
    inventory.append("Elixir")
  
    t.sleep(2)
  
    print (inventory)
  
elif choice == 4:
  
    print ("Ah, a TOUGH guy, are ya? Here ya go! Who else wants a PIECE of m-- Er, Who's next??")

    money_ammt = 63800

    print (inventory)

    inventory.append("Mithril Sword")

    t.sleep(2)
  
    print (inventory)
  
else:
  
    print ("We don't carry that, I think.")

    #Think I should put "exit()" here.....?   :\
 
Last edited:


Also, there's a reference to Earthbound..... :3
 
I'm no programmer, but it's great to watch you progress... keep up the good work!

Cheers!
 
I'm no programmer, but it's great to watch you progress... keep up the good work!

Cheers!

Thank you good sir..... :3 I made some minor modifications since then, so this isn't the FINAL product....... :D
 

Members online


Top