Browse Source

12/23/2022

BradDev
Joe DiPrima 3 years ago
parent
commit
9078e7ee55
  1. 130
      qmutants.py

130
qmutants.py

@ -126,6 +126,11 @@ class mutant(QWidget):
#value tracking
self.riblets = 0
self.ions = 0
self.hp = 0
self.exp = 0
self.clss = "Thief"
self.level = 0
self.riblet_thresh = 200000
self.farm_year=2000
self.year_limit=2500
@ -190,6 +195,10 @@ class mutant(QWidget):
self.formGroupBox.addRow(self.text_button,self.text_input)
self.layout.addLayout(self.formGroupBox)
#stat group
self.createStatGroup()
self.layout.addLayout(self.stat_layout)
#mode group
self.createModeGroup()
self.layout.addLayout(self.mode_layout)
@ -290,7 +299,53 @@ class mutant(QWidget):
self.mode_layout.addLayout(hbox1)
self.mode_layout.addLayout(hbox2)
#stat labels
def createStatGroup(self):
self.stat_layout = QVBoxLayout()
hbox1 = QHBoxLayout()
hbox2 = QHBoxLayout()
userLabel = QLabel("User: ")
self.userLabel = QLabel("None")
expLabel = QLabel("Exp: ")
self.expLabel = QLabel("None")
levelLabel = QLabel("Level: ")
self.levelLabel = QLabel("None")
yearLabel = QLabel("Year: ")
self.yearLabel = QLabel("None")
locationLabel = QLabel("Loc: ")
self.locationLabel = QLabel("None")
hpLabel = QLabel("HP: ")
self.hpLabel = QLabel("None")
ribletLabel = QLabel("Riblets: ")
self.ribletLabel = QLabel("None")
ionLabel = QLabel("Ions: ")
self.ionLabel = QLabel("None")
hbox1.addWidget(userLabel)
hbox1.addWidget(self.userLabel)
hbox1.addWidget(expLabel)
hbox1.addWidget(self.expLabel)
hbox1.addWidget(levelLabel)
hbox1.addWidget(self.levelLabel)
hbox1.addWidget(yearLabel)
hbox1.addWidget(self.yearLabel)
hbox2.addWidget(locationLabel)
hbox2.addWidget(self.locationLabel)
hbox2.addWidget(hpLabel)
hbox2.addWidget(self.hpLabel)
hbox2.addWidget(ribletLabel)
hbox2.addWidget(self.ribletLabel)
hbox2.addWidget(ionLabel)
hbox2.addWidget(self.ionLabel)
self.stat_layout.addLayout(hbox1)
self.stat_layout.addLayout(hbox2)
#Text inputs
def createSettingsGroup(self):
self.settingsGroupBox = QFormLayout()
self.fy_input = QLineEdit("2000")
@ -657,6 +712,54 @@ class mutant(QWidget):
for i in range(x):
self.stock_list.append(item_l)
#HP
if self.status.find("Hit Points :") != -1:
start_index = self.status.index('Hit Points : ') + 15
hp_str = self.status[start_index:]
try:
end_index = hp_str.index('/')
except:
pass
hp_str = hp_str[:end_index]
try:
self.hp = int(hp_str)
except:
pass
#exp
if self.status.find("Exp. Points :") != -1:
start_index = self.status.index('Exp. Points : ') + 15
exp_str = self.status[start_index:]
try:
end_index = exp_str.index('Level')
except:
pass
exp_str = exp_str[:end_index]
try:
self.exp = int(exp_str)
except:
pass
#scrape level
if self.status.find("Level: ") != -1:
start_index = self.status.index('Level: ') + 7
level_str = self.status[start_index:]
try:
end_index = level_str.index('Riblets')
except:
pass
level_str = level_str[:end_index]
try:
self.level = int(level_str)
except:
pass
#scrape riblets
if self.status.find("Riblets :") != -1:
start_index = self.status.index('Riblets : ') + 16
@ -673,6 +776,22 @@ class mutant(QWidget):
except:
pass
#scrape ions
if self.status.find("Ions : ") != -1:
start_index = self.status.index('Ions : ') + 16
ions_str = self.status[start_index:]
try:
end_index = riblets_str.index('Wearing')
except:
pass
ions_str = ions_str[:end_index]
#print("Riblets:" + riblets_str)
try:
self.ions = int(ions_str)
except:
pass
#scrape year
if self.status.find("Year A.D. :") != -1:
start_index = self.status.index('Year A.D. : ') + 17
@ -758,7 +877,16 @@ class mutant(QWidget):
def mutants(self,result):
#update farm year text box
try:
self.fy_input.setText(str(self.farm_year))
self.userLabel.setText(self.user)
self.expLabel.setText(str(self.exp))
self.levelLabel.setText(str(self.level))
self.yearLabel.setText(str(self.farm_year))
self.locationLabel.setText(str(self.location))
self.hpLabel.setText(str(self.hp))
self.ribletLabel.setText(str(self.riblets))
self.ionLabel.setText(str(self.ions))
self.na_thresh = int(self.na_input.text())
self.year_limit = int(self.yl_input.text())
self.selected_path = int(self.path_input.text())

Loading…
Cancel
Save