Compare commits

..

No commits in common. "a7e9d92d82f691a1bc1635c7ec3fdbba0a7874a1" and "2ac4e42645bf1f497c86920fd41d9ff8f5edd600" have entirely different histories.

5 changed files with 2 additions and 12 deletions

View File

@ -6,7 +6,7 @@ conf={}
confp=os.path.expanduser('~/.config/swat.cfg') # This won't work on Windows. You'll need to tweak this to run it on Windows. Not my problem.
defaults={'classes':[(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(0,0),(0,0),(1,3),(1,3),(1,3)],'guns':[(1,3),(1,3),(1,3),(1,3),(1,3),(0,0),(0,0),(1,3)],'armour':[(1,3),(1,3),(1,3),(1,3)],'traits':[(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3)],'specs':[(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3)],'talents':[(12,12),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3)],'medals':{},'saves':{}}
defaults={'classes':[(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(0,0),(0,0),(1,3),(1,3),(1,3)],'guns':[(1,3),(1,3),(1,3),(1,3),(1,3),(0,0),(0,0),(1,3)],'armour':[(1,3),(1,3),(1,3),(1,3)],'traits':[(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3)],'specs':[(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3)],'talents':[(12,12),(1,3),(1,3),(1,3),(1,3),(1,3),(1,3)],'medals':{}}
def add_user(name):
namehash=encode.hash_name(name) # Store the hash so that if they request a different name that happens to have the same hash, it can just be stored together.
if namehash in conf: conf[namehash]['names'].add(name)
@ -158,7 +158,7 @@ def lookup_piece(piece,table,name,partial=False):
if not partial:
try: return table.index(p)
except ValueError: raise LookupException(f"Couldn't resolve {piece} from {name}")
res=list(filter(lambda x:x.startswith(p),table))
res=list(filter(lambda x:p in x,table))
if len(res)!=1: raise LookupException(f"Couldn't resolve {piece} with partial match from {name} (found {len(res)} possibilities)") # Ambiguous lookups not allowed
return table.index(res[0])
class LookupException(Exception): pass
@ -170,15 +170,6 @@ def ranks():
print(f'{o[0]}: {o[1][0]}/{o[1][1]}',end=', ')
print()
def savebuild(code,name):
pass
def builds():
pass
def medals():
pass
load_conf()

View File

@ -35,5 +35,4 @@ def muxhero(clas,trait,spec):
def muxmedals(key,moh=-1,pcc=-1,cob=-1,lsa=-1,rem=-1):
print(key,moh,pcc,cob,lsa,rem)
if moh!=-1: return key+moh*2+pcc*4+cob*8+lsa*16+rem*32
print(bool(key&1),bool(key&2),bool(key&4),bool(key&8),bool(key&16),key//32)
return bool(key&1),bool(key&2),bool(key&4),bool(key&8),bool(key&16),key//32