summaryrefslogtreecommitdiff
path: root/wiki
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-20 13:02:20 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-20 13:02:20 -0300
commit315d9d6166ca7b2d46b1e4a641df466ac3866900 (patch)
tree028131d52476d469f2af88d4cca8d163732bc08a /wiki
parent4a683755533644c96ebae040833ec1bc73eab3a1 (diff)
downloadtools-315d9d6166ca7b2d46b1e4a641df466ac3866900.tar.gz
tools-315d9d6166ca7b2d46b1e4a641df466ac3866900.tar.bz2
tools-315d9d6166ca7b2d46b1e4a641df466ac3866900.tar.xz
tools-315d9d6166ca7b2d46b1e4a641df466ac3866900.zip
Update wikigen to new healing item rules
Diffstat (limited to 'wiki')
-rwxr-xr-xwiki/wikigen.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/wiki/wikigen.py b/wiki/wikigen.py
index dcad2b3..6d0887c 100755
--- a/wiki/wikigen.py
+++ b/wiki/wikigen.py
@@ -325,6 +325,8 @@ class It:
self.minheal="0"
self.maxheal="0"
self.delheal="0"
+ self.typheal="0"
+ self.rarheal="0"
def ItAlloc(it):
if (it.sl == "0" and it.ac) or (it.sl in ["1","2","3","4"] and not it.ac):
@@ -446,6 +448,20 @@ def newItemDB():
x.maxheal=sti(a)
elif "@delay" in a:
x.delheal=sti(a)
+ elif "@type" in a:
+ x.typheal=sti(a)
+ try:
+ x.minheal=str(int(x.rarheal) * (int(x.typheal)*1 + 1)) + " %"
+ x.maxheal=str(int(x.rarheal) * (int(x.typheal)*2 + 1)) + " %"
+ if (x.delheal == "0"):
+ x.delheal=int(x.typheal)*2 + 1
+ except:
+ x.delheal="ERROR"
+ pass
+ elif "@rarity" in a:
+ x.rarheal=sti(a)
+ x.minheal=str(int(x.rarheal) * (int(x.typheal)*1 + 1)) + " %"
+ x.maxheal=str(int(x.rarheal) * (int(x.typheal)*2 + 1)) + " %"
# Write last entry
ItAlloc(x)
@@ -454,7 +470,7 @@ def newItemDB():
src.close()
def sti(x):
- return x.replace('\n', '').replace('|', '').replace(')', '').replace('Id: ', '').replace('"','').replace(" ","").replace("\t","").replace('AegisName: ', '').replace('Name: ','').replace('Sell: ', '').replace('Weight: ', '').replace('Type: ', '').replace('Loc: ', '').replace('Atk: ', '').replace('Matk: ', '').replace('Range: ', '').replace('Def: ', '').replace('EquipLv: ', '').replace('Slots: ','').replace(" ", "").replace('@min=','').replace('@max=','').replace('@delay=','').replace(';','')
+ return x.replace('\n', '').replace('|', '').replace(')', '').replace('Id: ', '').replace('"','').replace(" ","").replace("\t","").replace('AegisName: ', '').replace('Name: ','').replace('Sell: ', '').replace('Weight: ', '').replace('Type: ', '').replace('Loc: ', '').replace('Atk: ', '').replace('Matk: ', '').replace('Range: ', '').replace('Def: ', '').replace('EquipLv: ', '').replace('Slots: ','').replace(" ", "").replace('@min=','').replace('@max=','').replace('@delay=','').replace('@type=','').replace('@rarity=','').replace(';','')
def stin(x):
return x.replace('\n', '').replace('|', '').replace(')', '').replace('Id: ', '').replace('"','').replace(" ","").replace("\t","").replace('Name: ','').replace(';','')
@@ -600,6 +616,16 @@ def ItemWrite(tbl, ID=False, AEGIS=False, NAME=False, PRICE=False, WEIGHT=False,
wikia.write("</tr>\n")
for i in tbl:
+ """
+ # To sort by weight, for example, uncomment this block.
+ try:
+ zt=int(i.weight)
+ except:
+ tbl.remove(i)
+
+ for i in sorted(tbl, key=lambda xcv: int(xcv.weight), reverse=True):
+ """
+
wikia.write('<tr>')
if ID: