summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusalva Jesusalva <jesusalva@themanaworld.org>2022-12-22 22:31:42 +0000
committerJesusalva Jesusalva <jesusalva@themanaworld.org>2022-12-22 22:31:42 +0000
commitbffe0518682f4e85fd3712d081e5ad12c3072772 (patch)
tree3dcd9b94e8a5ab25752814b33afee40408ae6c3d
parent1625a53bbf6ad7a1ee23e411618de75dd05eb1f2 (diff)
parente79a7af67e956c9f4eed023c927efd9cdc65acb7 (diff)
downloadtools-bffe0518682f4e85fd3712d081e5ad12c3072772.tar.gz
tools-bffe0518682f4e85fd3712d081e5ad12c3072772.tar.bz2
tools-bffe0518682f4e85fd3712d081e5ad12c3072772.tar.xz
tools-bffe0518682f4e85fd3712d081e5ad12c3072772.zip
Merge branch 'evolved_py' into 'master'
evolved.py critical_def and spaces See merge request legacy/tools!25
-rwxr-xr-xevolved.py108
1 files changed, 94 insertions, 14 deletions
diff --git a/evolved.py b/evolved.py
index 256116c..2d421bc 100755
--- a/evolved.py
+++ b/evolved.py
@@ -8,10 +8,12 @@
# Author: Jesusalva
import datetime
-import sys, traceback
+import sys, traceback, re
aegis=open("../world/map/db/const-aegis.txt", "w")
+description_m="//ID, Name, Jname, LV, HP, SP, EXP, JEXP, Range1, ATK1, ATK2, DEF, MDEF, CRITDEF,STR, AGI, VIT, INT, DEX, LUK, Range2, Range3, Scale, Race, Element,Mode, Speed, Adelay, Amotion,Dmotion,Drop0id,Drop0%, Drop1id,Drop1%, Drop2id,Drop2%, Drop3id,Drop3%, Drop4id,Drop4%, Drop5id,Drop5%, Drop6id,Drop6%, Drop7id,Drop7%, Drop8id,Drop8%, Drop9id,Drop9%, Item1, Item2, MEXP, ExpPer, MVP1id, MVP1per,MVP2id, MVP2per,MVP3id, MVP3per,mutationcount,mutationstrength"
+
# the TYPEs we use to determine where to pack things
IT_HEALING=[]
IT_ETC=[]
@@ -94,6 +96,7 @@ class Mob:
self.md=0
self.df="0"
self.mdf="0"
+ self.cdf="0"
# Stats
self.str="0"
@@ -201,6 +204,8 @@ def testMobs():
x.df=stp(a)
elif " Mdef:" in a:
x.mdf=stp(a)
+ elif " CriticalDef:" in a:
+ x.cdf=stp(a)
elif " Attack:" in a:
x.atk=stp(a)
elif " AttackRange:" in a:
@@ -279,7 +284,7 @@ def testMobs():
src.close()
def stp(x):
- return x.replace('\n', '').replace('|', '').replace('(int, defaults to ', '').replace(')', '').replace('basic experience', '').replace('"','').replace(" ","").replace("\t","").replace('(string', '').replace('SpriteName: ','').replace('Name: ','').replace('AttackDelay: ', '').replace('AttackMotion: ', '').replace('DamageMotion: ', '').replace('MoveSpeed: ', '').replace('AttackRange: ', '').replace('ViewRange: ','').replace('ChaseRange: ','').replace('Attack: ','').replace('Hp: ','').replace('Sp: ','').replace('Id: ','').replace('Lv: ','').replace('view range','').replace('attack range','').replace('move speed','').replace('health','').replace('(int','').replace('attack delay','atk.').replace("Str:", "").replace("Agi:", "").replace("Vit:", "").replace("Int:", "").replace("Dex:", "").replace("Luk:", "").replace("Mdef:","").replace("Def:","").replace("Size:","").replace("Race:", "").replace("Element:","").replace("JExp: ","").replace("MvpExp: ","").replace("Exp: ","").replace("MutationCount: ","").replace("MutationStrength: ","").strip()
+ return x.replace('\n', '').replace('|', '').replace('(int, defaults to ', '').replace(')', '').replace('basic experience', '').replace('"','').replace(" ","").replace("\t","").replace('(string', '').replace('SpriteName: ','').replace('Name: ','').replace('AttackDelay: ', '').replace('AttackMotion: ', '').replace('DamageMotion: ', '').replace('MoveSpeed: ', '').replace('AttackRange: ', '').replace('ViewRange: ','').replace('ChaseRange: ','').replace('Attack: ','').replace('Hp: ','').replace('Sp: ','').replace('Id: ','').replace('Lv: ','').replace('view range','').replace('attack range','').replace('move speed','').replace('health','').replace('(int','').replace('attack delay','atk.').replace("Str:", "").replace("Agi:", "").replace("Vit:", "").replace("Int:", "").replace("Dex:", "").replace("Luk:", "").replace("Mdef:","").replace("CriticalDef:","").replace("Def:","").replace("Size:","").replace("Race:", "").replace("Element:","").replace("JExp: ","").replace("MvpExp: ","").replace("Exp: ","").replace("MutationCount: ","").replace("MutationStrength: ","").strip()
@@ -420,7 +425,6 @@ def newItemDB():
if a == "{\n":
ItAlloc(x)
x=It()
-
# sti() block
if " Id:" in a:
x.id=sti(a)
@@ -493,13 +497,12 @@ def stin(x):
-
-
def write_mob(m, f):
## Prepare new drop list
i=0
+
dl=[]
- while i < 8:
+ while i < 10:
if len(m.drops) > i:
try:
it = m.drops[i][0] # TODO: Convert to INT
@@ -520,21 +523,98 @@ def write_mob(m, f):
dl.append(str(it))
dl.append(str(ch))
i+=1
+
+ ## Add spaces
+ el=str(int("%s%s" % (m.elLv, m.elem)))
+ atk1=m.atk.replace('[','').split(",")[0]
+ atk2=m.atk.replace(']','').split(",")[1].strip()
+ md=str(m.md)
+ item1="0"
+ item2="0"
+ expper="0"
+ mvp1id="0"
+ mvp1p="0"
+ mvp2id="0"
+ mvp2p="0"
+ mvp3id="0"
+ mvp3p="0"
+
+ m.id=m.id+','+' '*(len(re.findall('//ID, *', description_m)[0])-len(m.id)-1)
+ m.aegis=m.aegis+','+' '*(len(re.findall('Name, *', description_m)[0])-len(m.aegis)-1)
+ m.mobpt=m.mobpt+','+' '*(len(re.findall('LV, *', description_m)[0])-len(m.mobpt)-1)
+ m.hp=m.hp+','+' '*(len(re.findall('HP, *', description_m)[0])-len(m.hp)-1)
+ m.sp=m.sp+','+' '*(len(re.findall('SP, *', description_m)[0])-len(m.sp)-1)
+ m.xp=m.xp+','+' '*(len(re.findall('EXP, *', description_m)[0])-len(m.xp)-1)
+ m.jp=m.jp+','+' '*(len(re.findall('JEXP, *', description_m)[0])-len(m.jp)-1)
+ m.range=m.range+','+' '*(len(re.findall('Range1, *', description_m)[0])-len(m.range)-1)
+ atk1=atk1+','+' '*(len(re.findall('ATK1, *', description_m)[0])-len(atk1)-1)
+ atk2=atk2+','+' '*(len(re.findall('ATK2, *', description_m)[0])-len(atk2)-1)
+ m.df=m.df+','+' '*(len(re.findall('DEF, *', description_m)[0])-len(m.df)-1)
+ m.mdf=m.mdf+','+' '*(len(re.findall('MDEF, *', description_m)[0])-len(m.mdf)-1)
+ m.cdf=m.cdf+','+' '*(len(re.findall('CRITDEF, *', description_m)[0])-len(m.cdf)-1)
+ m.str=m.str+','+' '*(len(re.findall('STR, *', description_m)[0])-len(m.str)-1)
+ m.agi=m.agi+','+' '*(len(re.findall('AGI, *', description_m)[0])-len(m.agi)-1)
+ m.vit=m.vit+','+' '*(len(re.findall('VIT, *', description_m)[0])-len(m.vit)-1)
+ m.int=m.int+','+' '*(len(re.findall('INT, *', description_m)[0])-len(m.int)-1)
+ m.dex=m.dex+','+' '*(len(re.findall('DEX, *', description_m)[0])-len(m.dex)-1)
+ m.luk=m.luk+','+' '*(len(re.findall('LUK, *', description_m)[0])-len(m.luk)-1)
+ m.view=m.view+','+' '*(len(re.findall('Range2, *', description_m)[0])-len(m.view)-1)
+ m.chase=m.chase+','+' '*(len(re.findall('Range3, *', description_m)[0])-len(m.chase)-1)
+ m.size=m.size+','+' '*(len(re.findall('Scale, *', description_m)[0])-len(m.size)-1)
+ m.race=m.race+','+' '*(len(re.findall('Race, *', description_m)[0])-len(m.race)-1)
+ el=el+','+' '*(len(re.findall('Element, *', description_m)[0])-len(el)-1)
+ md=md+','+' '*(len(re.findall('Mode, *', description_m)[0])-len(md)-1)
+ m.move=m.move+','+' '*(len(re.findall('Speed, *', description_m)[0])-len(m.move)-1)
+ m.adelay=m.adelay+','+' '*(len(re.findall('Adelay, *', description_m)[0])-len(m.adelay)-1)
+ m.amotion=m.amotion+','+' '*(len(re.findall('Amotion, *', description_m)[0])-len(m.amotion)-1)
+ m.dmotion=m.dmotion+','+' '*(len(re.findall('Dmotion, *', description_m)[0])-len(m.dmotion)-1)
+ dl[0]=dl[0]+','+' '*(len(re.findall('Drop0id, *', description_m)[0])-len(dl[0])-1)
+ dl[1]=dl[1]+','+' '*(len(re.findall('Drop0%, *', description_m)[0])-len(dl[1])-1)
+ dl[2]=dl[2]+','+' '*(len(re.findall('Drop1id, *', description_m)[0])-len(dl[2])-1)
+ dl[3]=dl[3]+','+' '*(len(re.findall('Drop1%, *', description_m)[0])-len(dl[3])-1)
+ dl[4]=dl[4]+','+' '*(len(re.findall('Drop2id, *', description_m)[0])-len(dl[4])-1)
+ dl[5]=dl[5]+','+' '*(len(re.findall('Drop2%, *', description_m)[0])-len(dl[5])-1)
+ dl[6]=dl[6]+','+' '*(len(re.findall('Drop3id, *', description_m)[0])-len(dl[6])-1)
+ dl[7]=dl[7]+','+' '*(len(re.findall('Drop3%, *', description_m)[0])-len(dl[7])-1)
+ dl[8]=dl[8]+','+' '*(len(re.findall('Drop4id, *', description_m)[0])-len(dl[8])-1)
+ dl[9]=dl[9]+','+' '*(len(re.findall('Drop4%, *', description_m)[0])-len(dl[9])-1)
+ dl[10]=dl[10]+','+' '*(len(re.findall('Drop5id, *', description_m)[0])-len(dl[10])-1)
+ dl[11]=dl[11]+','+' '*(len(re.findall('Drop5%, *', description_m)[0])-len(dl[11])-1)
+ dl[12]=dl[12]+','+' '*(len(re.findall('Drop6id, *', description_m)[0])-len(dl[12])-1)
+ dl[13]=dl[13]+','+' '*(len(re.findall('Drop6%, *', description_m)[0])-len(dl[13])-1)
+ dl[14]=dl[14]+','+' '*(len(re.findall('Drop7id, *', description_m)[0])-len(dl[14])-1)
+ dl[15]=dl[15]+','+' '*(len(re.findall('Drop7%, *', description_m)[0])-len(dl[15])-1)
+ dl[16]=dl[16]+','+' '*(len(re.findall('Drop8id, *', description_m)[0])-len(dl[16])-1)
+ dl[17]=dl[17]+','+' '*(len(re.findall('Drop8%, *', description_m)[0])-len(dl[17])-1)
+ dl[18]=dl[18]+','+' '*(len(re.findall('Drop9id, *', description_m)[0])-len(dl[18])-1)
+ dl[19]=dl[19]+','+' '*(len(re.findall('Drop9%, *', description_m)[0])-len(dl[19])-1)
+ item1=item1+','+' '*(len(re.findall('Item1, *', description_m)[0])-len(item1)-1)
+ item2=item2+','+' '*(len(re.findall('Item2, *', description_m)[0])-len(item2)-1)
+ m.mvp=m.mvp+','+' '*(len(re.findall('MEXP, *', description_m)[0])-len(m.mvp)-1)
+ expper=expper+','+' '*(len(re.findall('ExpPer, *', description_m)[0])-len(expper)-1)
+ mvp1id=mvp1id+','+' '*(len(re.findall('MVP1id, *', description_m)[0])-len(mvp1id)-1)
+ mvp1p=mvp1p+','+' '*(len(re.findall('MVP1per, *', description_m)[0])-len(mvp1p)-1)
+ mvp2id=mvp2id+','+' '*(len(re.findall('MVP2id, *', description_m)[0])-len(mvp2id)-1)
+ mvp2p=mvp2p+','+' '*(len(re.findall('MVP2per, *', description_m)[0])-len(mvp2p)-1)
+ mvp3id=mvp3id+','+' '*(len(re.findall('MVP3id, *', description_m)[0])-len(mvp3id)-1)
+ mvp3p=mvp3p+','+' '*(len(re.findall('MVP3per, *', description_m)[0])-len(mvp3p)-1)
+ m.mtcnt=m.mtcnt+','+' '*(len(re.findall('mutationcount, *', description_m)[0])-len(m.mtcnt)-1)
+# m.mtstr=m.mtstr+','+' '*(len(re.findall('mutationstrength, *', description_m)[0])-len(m.mtstr)-1)
+
## Write the line
- f.write("""%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, 0, 0, %s, 0, 0, 0, 0, 0, 0, 0, %s, %s\n""" % (m.id, m.aegis, m.aegis, m.mobpt, m.hp, m.sp,
-m.xp, m.jp, m.range, m.atk.replace('[','').split(",")[0], m.atk.replace(']','').split(",")[1].strip(), m.df, m.mdf, m.str, m.agi, m.vit,
-m.int, m.dex, m.luk, m.view, m.chase, m.size, m.race, int("%s%s" % (m.elLv, m.elem)), m.md, m.move,
-m.adelay, m.amotion, m.dmotion, dl[0],dl[1], dl[2],dl[3], dl[4],dl[5],
-dl[6],dl[7], dl[8],dl[9], dl[10],dl[11], dl[12],dl[13], dl[14],dl[15],
-m.mvp, m.mtcnt, m.mtstr))
+ f.write("""%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n""" % (m.id, m.aegis, m.aegis, m.mobpt, m.hp, m.sp,
+m.xp, m.jp, m.range, atk1, atk2, m.df, m.mdf, m.cdf, m.str, m.agi, m.vit,
+m.int, m.dex, m.luk, m.view, m.chase, m.size, m.race, el, md, m.move,
+m.adelay, m.amotion, m.dmotion, dl[0],dl[1], dl[2],dl[3], dl[4],dl[5],
+dl[6],dl[7], dl[8],dl[9], dl[10],dl[11], dl[12],dl[13], dl[14],dl[15],
+dl[16],dl[17], dl[18],dl[19], item1, item2, m.mvp, expper, mvp1id, mvp1p, mvp2id, mvp2p, mvp3id, mvp3p, m.mtcnt, m.mtstr))
return
def write_mob_header(f):
f.write("//THIS FILE IS GENERATED AUTOMATICALLY\n//DO NOT EDIT IT DIRECTLY\n//Edit mob_db.conf instead!\n")
- f.write("//ID, Name, Jname, LV, HP, SP, EXP, JEXP, Range1, ATK1, ATK2, DEF, MDEF, STR, AGI, VIT, INT, DEX, LUK, Range2, Range3, Scale, Race, Element,Mode, Speed, Adelay, Amotion,Dmotion,Drop1id,Drop1per,Drop2id,Drop2%, Drop3id,Drop3%, Drop4id,Drop4%, Drop5id,Drop5%, Drop6id,Drop6%, Drop7id,Drop7%, Drop8id,Drop8%, Item1, Item2, MEXP, ExpPer, MVP1id, MVP1per,MVP2id, MVP2per,MVP3id, MVP3per,mutationcount,mutationstrength\n")
+ f.write(description_m + "\n")
return
-
def save_mobs():
global Mobs1, Mobs2, Mobs3, Mobs4, Mobs5, Mobs6, MobsA
## Mobs