haha alice's pistols were defaulting to locked instead of 1/3, which meant generating alice with a fresh account would be invalid.
This commit is contained in:
		@@ -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.
 | 
					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),(0,0)],'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':{}}
 | 
					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):
 | 
					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.
 | 
						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)
 | 
						if namehash in conf: conf[namehash]['names'].add(name)
 | 
				
			||||||
@@ -95,11 +95,12 @@ def read_code(code,name=None,save=None):
 | 
				
			|||||||
	print(str(rank)+'/'+str(cap))
 | 
						print(str(rank)+'/'+str(cap))
 | 
				
			||||||
	print(data) # Extract medals and save them
 | 
						print(data) # Extract medals and save them
 | 
				
			||||||
	medals=data[1:-1]
 | 
						medals=data[1:-1]
 | 
				
			||||||
	if any(medals): conf[active_profile]['medals'][shared.muxhero(hero[0],hero[3],hero[4])]=shared.muxmedals(*medals)
 | 
					 | 
				
			||||||
	if not check: print('No name given, code validation not performed')
 | 
						if not check: print('No name given, code validation not performed')
 | 
				
			||||||
	else:
 | 
						else:
 | 
				
			||||||
		if check!=validator: print('code did not validate:',validator,check); return
 | 
							if check!=validator: print('code did not validate:',validator,check); return
 | 
				
			||||||
		else: print('code validated')
 | 
							else: # Do not save medals unless validation passed
 | 
				
			||||||
 | 
								if any(medals): conf[active_profile]['medals'][shared.muxhero(hero[0],hero[3],hero[4])]=shared.muxmedals(*medals)
 | 
				
			||||||
 | 
								print('code validated')
 | 
				
			||||||
	for thing in zip(tables.displays_str[:-1],hero):
 | 
						for thing in zip(tables.displays_str[:-1],hero):
 | 
				
			||||||
		saved=conf[active_profile][thing[0]][thing[1]]
 | 
							saved=conf[active_profile][thing[0]][thing[1]]
 | 
				
			||||||
		saved=(max(saved[0],rank),max(saved[1],cap))
 | 
							saved=(max(saved[0],rank),max(saved[1],cap))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ import random
 | 
				
			|||||||
import tables
 | 
					import tables
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def encode(name,clas,gun,armour,trait,spec,talent,rank=-1,cap=-1,xp=0, key=False,moh=False,pcc=False,cob=False,lsa=False,rem=False,seed=-1):
 | 
					def encode(name,clas,gun,armour,trait,spec,talent,rank=-1,cap=-1,xp=0, key=False,moh=False,pcc=False,cob=False,lsa=False,rem=False,seed=-1):
 | 
				
			||||||
 | 
						print(name,clas,gun,armour,trait,spec,talent,rank,cap,xp, key,moh,pcc,cob,lsa,rem,seed)
 | 
				
			||||||
	if rank==-1: # actually means gun wasn't given, so shift them
 | 
						if rank==-1: # actually means gun wasn't given, so shift them
 | 
				
			||||||
		gun,armour,trait,spec,talent,rank=-1,gun,armour,trait,spec,talent
 | 
							gun,armour,trait,spec,talent,rank=-1,gun,armour,trait,spec,talent
 | 
				
			||||||
	gtalent=tables.clas[clas][talent]
 | 
						gtalent=tables.clas[clas][talent]
 | 
				
			||||||
@@ -26,7 +27,9 @@ def encode_data(clas,armour,trait,spec,talent,rank,cap=-1,xp=0, key=False,moh=Fa
 | 
				
			|||||||
	if clas==8: clas=6; armour=0 # LR WM is light borg
 | 
						if clas==8: clas=6; armour=0 # LR WM is light borg
 | 
				
			||||||
	if clas==9: clas=6; armour=1 # GL WM is med borg
 | 
						if clas==9: clas=6; armour=1 # GL WM is med borg
 | 
				
			||||||
	seed,clas=rand(seed,clas)
 | 
						seed,clas=rand(seed,clas)
 | 
				
			||||||
 | 
						print(rank,cap)
 | 
				
			||||||
	rank,cap=adjust_rank(rank,cap,key,moh,pcc)
 | 
						rank,cap=adjust_rank(rank,cap,key,moh,pcc)
 | 
				
			||||||
 | 
						print(rank,cap,key,moh,pcc)
 | 
				
			||||||
	code1=0
 | 
						code1=0
 | 
				
			||||||
	weight=1
 | 
						weight=1
 | 
				
			||||||
	for n in list(zip(tables.weights,[xp//10,rank,cap,cob,lsa,rem,clas,armour,trait,spec,talent])):
 | 
						for n in list(zip(tables.weights,[xp//10,rank,cap,cob,lsa,rem,clas,armour,trait,spec,talent])):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user