Răsfoiți Sursa

add difficulty selection

Mona Lisa 6 ani în urmă
părinte
comite
6cb87ac18b
4 a modificat fișierele cu 74 adăugiri și 3 ștergeri
  1. 1 0
      glife.qproj
  2. 10 0
      locations/Cheatmenu_din.qsrc
  3. 60 0
      locations/_difficulty.qsrc
  4. 3 3
      locations/stat_sklattrib.qsrc

+ 1 - 0
glife.qproj

@@ -18,6 +18,7 @@
       <Location name="restoreposition"/>
       <Location name="saveposition"/>
       <Location name="mod_setting"/>
+      <Location name="$difficulty"/>
     </Folder>
     <Folder name="clothing">
       <Location name="wardrobe"/>

+ 10 - 0
locations/Cheatmenu_din.qsrc

@@ -1347,6 +1347,7 @@ $cheatmenu['display'] = {
 
 	pl 'Mod management page: <a href="exec:gt ''mod_setting''">Here</a>'
 
+
 	if Enable_nogameover = 1:
 		pl'Prevent Non-Drama GAMEOVER: Currently ON - <a href="exec:Enable_nogameover = 0 & dynamic $cheatmenu[''display'']">Turn OFF</a>'
 	else
@@ -1385,6 +1386,15 @@ $cheatmenu['display'] = {
 		pl'Editing of the names of the porn movies you stared disabled: Currently OFF - <a href="exec:editpornname = 1 & dynamic $cheatmenu[''display'']">Turn ON</a>'
 	end
 	nl
+
+	pl '<center><B>Difficulty Setting</B></center>'
+
+	pl 'Difficulty: Currenty at <<func(''_difficulty'',''getdifficulty'')>>'
+	pl '<ul><li>set to <a href="exec:FUNC(''_difficulty'',''setdifficulty'',''easy peasy'') & dynamic $cheatmenu[''display'']">easy peasy</a></li>'
+	pl '<li>set to <a href="exec:FUNC(''_difficulty'',''setdifficulty'',''relaxed'') & dynamic $cheatmenu[''display'']">relaxed</a></li>'
+	pl '<li>set to <a href="exec:FUNC(''_difficulty'',''setdifficulty'',''realistic'') & dynamic $cheatmenu[''display'']">realistic</a></li>'
+	pl '<li>set to <a href="exec:FUNC(''_difficulty'',''setdifficulty'',''hardcore'') & dynamic $cheatmenu[''display'']">hardcore</a></li></ul>'
+	nl
 	pl '<center><B>Display Setting</B></center>'
 	if set_imgh > 0: set_imgw = 0
 	if set_imgw > 0: set_imgh = 0

+ 60 - 0
locations/_difficulty.qsrc

@@ -0,0 +1,60 @@
+# _difficulty
+
+if difficulty = 0:
+	difficulty = 3
+end
+
+if $ARGS[0] = 'setdifficulty':
+	difficulty = 3
+	if $ARGS[1] = 'easy peasy': difficulty = 1
+	if $ARGS[1] = 'relaxed': difficulty = 2
+	if $ARGS[1] = 'hardcore': difficulty = 4
+end		
+
+!! following function returns the current difficulty
+if $ARGS[0] = 'getdifficulty':
+	$result = 'realistic'
+	if difficulty = 1:	$result = 'easy peasy'
+	if difficulty = 2:	$result = 'relaxed'
+	if difficulty = 4:	$result = 'hardcore'
+end &! --- getdifficulty ---
+		
+
+!! following function returns the basic adjustment for stat gain via exp.
+!! hardcore: 80
+!! realistic: 60
+!! relaxed: 40
+!! easy peasy: 20
+!! use func('_difficulty','getexpadj')
+if $ARGS[0] = 'getexpadj':
+	result = 20 * difficulty
+end &! --- getexpadj ---
+
+!! following function adjusts money gain by difficulty.
+!! use func('_difficulty','addmoney', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'addmoney':
+	money += (ARGS[1] * (5-difficulty)) / 2
+end &! --- addmoney ---
+
+!! following function returns the adjusted money added (e.g. for displaying the correct amount of money earnt in texts)
+!! use func('_difficulty','addmoneystring', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'addmoneystring':
+	result = (ARGS[1] * (5-difficulty)) / 2
+end &! --- addmoneystring ---
+
+!! following function adjusts money spent by difficulty.
+!! use func('_difficulty','spendmoney', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'spendmoney':
+	money -= (ARGS[1] * (difficulty + 1)) / 4
+end &! --- spendmoney ---
+
+
+!! following function returns the adjusted money spent (e.g. for displaying the correct price in shops)
+!! use func('_difficulty','spendmoneystring', x) with x being the base amount (for 'realistic' difficulty)
+if $ARGS[0] = 'spendmoneystring':
+	result = (ARGS[1] * (difficulty + 1)) / 4
+end &! --- spendmoneystring ---
+
+
+--- _difficulty ---------------------------------
+

+ 3 - 3
locations/stat_sklattrib.qsrc

@@ -114,7 +114,7 @@ $traitattskl[2] = 'schlrly'
 if attsklupdate = 0:
 	i = 0 & x = 1
 	:rstloop
-	expadj = 60
+	expadj = func('_difficulty','getexpadj')
 	tl = 0
 	:trtrstloop
 	tltp = 0
@@ -176,7 +176,7 @@ if $ARGS[0] = 'daycall':
 	:degloop
 	degadj = 60
 	if x = 2: degadj += 30
-	expadj = 60
+	expadj = func('_difficulty','getexpadj')
 	tl = 0
 	:trtdegloop
 	tltp = 0
@@ -241,7 +241,7 @@ end
 !!Advancement Loop
 i = 0 & x = 1
 :advloop
-expadj = 60
+expadj = func('_difficulty','getexpadj')
 tl = 0
 :trtadvloop
 tltp = 0