Sfoglia il codice sorgente

Merge remote-tracking branch 'Netuttki/master'

Kevin_Smarts 1 anno fa
parent
commit
9d9ca20cfc

+ 3 - 5
locations/albina_chat2.qsrc

@@ -245,7 +245,7 @@ if $ARGS[0] = 'first_model_talk4':
 			'Albina stops, turning to look at you with a frown. You give her a stare and she stares back.'
 			*nl
 			'"Damn!" she swears after a moment. "Tell me what to search!"'
-			gs 'albina_chat','first_model_talk_tell'
+			gs 'albina_chat2','first_model_talk_tell'
 		end
 			
 		act'Let her search':
@@ -255,7 +255,7 @@ if $ARGS[0] = 'first_model_talk4':
 			'"Why can''t I find it?!" she grumbles, cursing.'
 			'"I don''t use my <i>actual</i> name when modelling," you say. "Do you think I''m crazy?"'
 			'"Come ooooonnn!" she moans. "Tell me what to search!"'
-			gs 'albina_chat','first_model_talk_tell'
+			gs 'albina_chat2','first_model_talk_tell'
 		end
 	end
 end
@@ -891,10 +891,8 @@ if $ARGS[0] = 'recurrent_model_talk1':
 		cla & *nl
 		'"It''s whatever," you shrug. "Same as any other job I guess. Show up, do the work, get paid."'
 		'"That''s all you have to say about being a fucking super model?" she grins back, punching you in the arm. "You bitch."'
-		if ''
+		!! if '' -> commented out just so it does not cause problems elsewhere  
 	end
-	
-	
 end
 
 if $ARGS[0] = 'recurrent_porn_talk1':

+ 1 - 1
locations/albinahome.qsrc

@@ -836,7 +836,7 @@ if $ARGS[0] = 'first_anal1':
 	end
 end
 
-if ARGS[0] = 'anal_refuse':
+if $ARGS[0] = 'anal_refuse':
 	*clr & cla
 	menu_off = 1
 	gs 'arousal', 'end'

+ 3 - 3
locations/alexandriaChat.qsrc

@@ -662,7 +662,7 @@ if $ARGS[0] = 'sword':
 	elseif AlexandriaQW = 16:
 		*clr & cla
 		minut += 5
-		pcs_mood - 20
+		pcs_mood -= 20
 		npc_rel['A241'] = 0
 		gs 'stat'
 		'<center><img <<$set_imgh>> src="images/characters/city/alexandria/saber.jpg"></center>'
@@ -809,8 +809,8 @@ if $ARGS[0] = 'sword':
 	
 	else
 	    *clr & cla
-		minut += 2
-		if AlexandriaMissionQW > 1: AlexandriaMissionQW - 1
+		minut += 2 
+		if AlexandriaMissionQW > 1: AlexandriaMissionQW -= 1 
 	    gs 'stat'
 	    '<center><b><font color="maroon">Aleksei</font></b></center>'
 	    '<center><img <<$set_imgh>> src="images/characters/city/alexandria/chair.jpg"></center>'

+ 1 - 1
locations/bank.qsrc

@@ -581,7 +581,7 @@ if $ARGS[0] = 'cikl':
 	end
 
 	!! Checking for tenants moving out
-	gs 'homes_properties', 'tenant_movements'
+	gs 'homes_properties', 'tenant_move_out_check'
 	
 
 	!!----------------------------------------

+ 1 - 1
locations/bedrPar2.qsrc

@@ -67,7 +67,7 @@ if $ARGS[0] = 'kamasutra':
 end
 
 ! read book
-if $args = 'read_book':
+if $ARGS[0] = 'read_book':
 	*clr & cla
 	menu_off = 1
 	pcs_horny += 2

+ 1 - 1
locations/korrPar.qsrc

@@ -361,7 +361,7 @@ if hour >= 16 and hour <= 20 and locat['Fam_inGad'] = 0:
 				schoolPredupr = 3
 				npc_rel['A29'] = 0
 				SchoolBlock = 1
-				gs 'homes_properties', 'block_acces', 'parents_home'
+				gs 'homes_properties', 'block_access', 'parents_home'
 				schoolprogul = 0
 				gs 'grades', 'grade_award', 'school', 'math', -100
 				gs 'grades', 'grade_award', 'school', 'rus', -100

+ 132 - 0
tools/callvalidator.py

@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+# usage: txtmerge.py <input_dir> <output_file_name> 
+# does the exact opposite of txtsplit.py
+
+from os import listdir
+from os.path import isfile, join
+import sys
+import re
+import io
+import time
+
+callList = []
+locationCallList = []
+
+
+def functionEmptyOrNamed(callArray):
+    if len(callArray) == 1:
+        return None
+    else:
+        return callArray[1].strip(" \t\n").lower()
+    #endif
+#enddef
+
+def processLines(lines):
+    pattern = "(gt|gs|xgt|xgs)\s*('|\")\w+('|\")(,\s*('|\")\w+('|\"))?"
+    locationCalls = {"calllocation": lines[0].strip(' #\n').lower(), "callIds": []}
+        
+    for line in lines:
+        if not line.strip(" \t").startswith("!"): 
+            match = re.search(pattern, line)
+            if match != None:
+                temp = match.group().strip('xgst\t\n').replace('"','').replace("'", "").replace(" ","").split(",")
+                loc = temp[0].lower()
+                fun = functionEmptyOrNamed(temp)
+                call = {"location": loc, "function": fun, "valid": 0}
+                if call not in callList:
+                    callList.append(call)
+                    locationCalls['callIds'].append(len(callList)-1) 
+                elif callList.index(call) not in locationCalls['callIds']:
+                    locationCalls['callIds'].append(callList.index(call))
+                #endif
+            #endif
+        #endif
+    #endfor
+
+    locationCallList.append(locationCalls)
+#enddedf 
+
+def validateCalls(lines):
+    calls = [c for c in callList if c['location'] == lines[0].strip(' #\n').lower()]
+
+    for call in calls:
+        if call['function'] == None or call['function'] == 'start' or call['function'] == '':
+            call['valid'] = 1
+        else:
+            findString = "if$args[0]='%s'" % call['function'].lower()
+            findString2 = "if$args[i]='%s'" % call['function'].lower()
+            targets = [line.replace(" ", "").lower().strip(' \n\t') for line in lines if findString in line.replace(" ", "").lower() or findString2 in line.replace(" ", "").lower()]
+            for t in targets:
+                if t.startswith("if$args[") or t.startswith("elseif$args["):
+                    call['valid'] = 1
+                    break;
+                #endif
+            #endfor
+        #endif
+    #endfor
+#enddef
+
+
+assert len(sys.argv) == 2, "usage:\ntest_txtmerge.py <src_input_dir>"
+
+idir = str(sys.argv[1])
+
+print("Start building call list: %s" % time.strftime("%H:%M:%S", time.localtime()))
+
+# grab the location files
+filelist = [f for f in listdir(idir) if ".qsrc" in f]
+buildlist_start = time.time()
+# build a list of all the calls happening
+for file in filelist:
+    with io.open(join(idir, file), 'rt', encoding='utf-8') as ifile:
+        lines = ifile.readlines()
+        processLines(lines)
+
+print("Finished building call list: %s" % time.strftime("%H:%M:%S", time.localtime()))
+
+# validating that all the calls are for valid locations
+for file in filelist:
+    with io.open(join(idir, file), 'rt', encoding='utf-8') as ifile:
+        lines = ifile.readlines()
+        validateCalls(lines)
+#endfor
+
+print("Finished validation %s" % time.strftime("%H:%M:%S", time.localtime()))
+
+# create the call validity file and a list of files that call invalid locations
+oname = "call_validity.txt"
+try:
+    with io.open(oname, 'w', encoding='utf-8') as ofile: 
+        ofile.write("----- List of Invalid calls -----\n")
+        ofile.write("\n")
+
+        for call in callList:
+            if call['valid'] == 0:
+                ofile.write("\t\t '%s', '%s' : invalid call\n" % (call['location'], call['function']) )
+        #endfor
+
+        ofile.write('\n')
+
+        ofile.write("----- List of Locations and invalid calls they make -----\n")
+        ofile.write('\n')
+        
+        for locationCall in locationCallList:
+            headWritten = 0 
+            for callId in locationCall["callIds"]:
+                call = callList[callId]
+                if call["valid"] == 0:
+                    if headWritten == 0:
+                        ofile.write("\t---- %s:\n" % locationCall["calllocation"])
+                        headWritten = 1
+                    ofile.write("\t\t '%s', '%s' : invalid call\n" % (call['location'], call['function']) )
+            #endfor
+            if headWritten != 0:
+                ofile.write("\n")
+        #endfor
+    #endwith
+
+except IOError as e:
+    raise SystemExit("ERROR: call validity file was not created! REASON: %s" % e.strerror)
+#endtry_except
+
+print("File saved finish: %s" % time.strftime("%H:%M:%S", time.localtime()))