Results 1 to 2 of 2

Thread: Pokemon Stat Calculator

  1. #1
    Join Date
    Nov 2008
    Location
    Troy, MO
    Posts
    46

    Default Pokemon Stat Calculator

    from Tkinter import *
    class Application():
    def hNature(self, event):
    self.nature=0.9
    self.NatureOut['text']="Hindering Nature"
    def nNature(self, event):
    self.nature=1.0
    self.NatureOut['text']="Neutral Nature"
    def bNature(self,event):
    self.nature=1.1
    self.NatureOut['text']="Beneficial Nature"
    def calc_HP(self, event):
    base=eval(self.BaseEntry.get())
    effort=eval(self.EffortEntry.get())
    level=eval(self.LevelEntry.get())
    deter=eval(self.DeterEntry.get())
    self.Calc_Out['text']=str(int((base*2.0+effort/4.0+deter)*(level/100.0)+level+10))

    def calc_Other(self,event):
    base=eval(self.BaseEntry.get())
    effort=eval(self.EffortEntry.get())
    level=eval(self.LevelEntry.get())
    deter=eval(self.DeterEntry.get())[/FONT]
    self.Calc_Out['text']=str(int(((base*2.0+effort/4.0+deter)*(level/100.0)+5)*self.nature))
    def __init__(self):
    self.container=container=Frame(root,width=300,heig ht=150)
    self.container.pack()[/FONT]
    Label(container, text="Base Value").place(x=5,y=5)
    Label(container, text="Effort Value").place(x=5,y=25)
    Label(container, text="Level Value").place(x=5, y=45)
    Label(container, text="Deter Value").place(x=5,y=65)
    self.BaseEntry=Entry(container, width=12)
    self.BaseEntry.place(x=70,y=5)

    self.EffortEntry=Entry(container, width=12)
    self.EffortEntry.place(x=70,y=25)[/FONT]
    self.LevelEntry=Entry(container, width=12)
    self.LevelEntry.place(x=70,y=45)[/FONT]
    self.DeterEntry=Entry(container, width=12)
    self.DeterEntry.place(x=70,y=65)[/FONT]
    self.HP_calc=Button(container, text="Calculate HP",width=16)
    self.HP_calc.bind("<Button-1>", self.calc_HP)
    self.HP_calc.place(x=175,y=15)
    self.Other_calc=Button(container, text="Calculate Other",width=16)
    self.Other_calc.bind("<Button-1>", self.calc_Other)
    self.Other_calc.place(x=175,y=50)[/FONT]
    self.Calc_Out=Label(container, text="Stat Calculation")
    self.Calc_Out.place(x=5,y=85)

    self.nature=1.0
    self.hButton=Button(container, width=16, text="Hindering Nature")
    self.hButton.bind("<Button-1>", self.hNature)
    self.hButton.place(x=175, y=80)

    self.nButton=Button(container, width=16, text="Neutral Nature")
    self.nButton.bind("<Button-1>", self.nNature)
    self.nButton.place(x=175, y=102)

    self.bButton=Button(container, width=16, text="Beneficial Nature")
    self.bButton.bind("<Button-1>", self.bNature)
    self.bButton.place(x=175, y=125)

    self.NatureOut=Label(container, text="Neutral Nature")
    self.NatureOut.place(x=5, y=105)

    root=Tk()
    App=Application()
    root.wm_resizable(width=False, height=False)
    root.wm_title("Pokemon Stat Monitor")
    mainloop()
    Last edited by Pokemon_Veteran; 15th February 2009 at 5:08 PM.
    Current System Hardware
    Intel DG31PR Motherboard
    3.0GHz Intel Core 2 Quad
    4GB DDR2 RAM (800MHz speed)
    XFX 6750 Radeon Video Card
    80GB Intel SSD, 40GB Intel SSD,
    12x Blu-Ray burner
        Spoiler:- What else I have:

  2. #2
    Join Date
    Aug 2006
    Location
    Raito alt; white guy.
    Posts
    4,202

    Default

    Erm what.

    Closed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •