Browse Source

Added Spell Prerequisites
Added Spell Options from Spell Book
Added "Makeup" spell
Added Spell Research in Downtown Library location.
Removed some spells from Tatiana, moved to Library to learn.

KeyMasterOfGozer 5 năm trước cách đây
mục cha
commit
88624c3d64

+ 62 - 74
locations/downlibrary.qsrc

@@ -8,7 +8,39 @@ menu_off = 0
 $location_type = 'public_indoors'
 frost = 0
 gs 'stat'
-	gs 'themes', 'indoors'
+gs 'themes', 'indoors'
+
+! Stuff to do on Studying a Book
+!	$ARGS[0] = Skill to Check
+$downlibrary['BookStudy'] = {
+	$downlibrary['Skill'] = $ARGS[0]
+	*clr & cla
+	menu_off = 1
+	if blizoruk = 100 or glassqw = 1:
+		glassqw = 1
+		msg'	The text blurs across the page, it seems you have poor eyesight. Maybe you should visit an ophthalmologists.'&gt $curloc
+	end
+	if pcs_nerd > 0:
+		lastread = totminut
+		lastreadday = daystart
+		pcs_nerd += 1
+	end
+	minut += 60
+	if $downlibrary['Skill'] ! '':
+		dynamic "
+			if pcs_<<$downlibrary['Skill']>> >= 50:
+				<<$downlibrary['Skill']>>_exp += RAND(0,1)
+			elseif pcs_<<$downlibrary['Skill']>> >= 25:
+				<<$downlibrary['Skill']>>_exp += RAND(1,2)
+			else
+				<<$downlibrary['Skill']>>_exp += RAND(1,3)
+			end"
+	end
+
+	blizoruk += 1
+	gs'stat'
+}
+
 '<center><b><font color="maroon">National Library of Russia</font></b></center>'
 '<center><img <<$set_imgh>> src="images/locations/city/citycenter/library/downlibint.jpg"></center>'
 'A huge library with thousands upon thousands of books. You could spend years here and you probably still wouldn''t be able to read it all.'
@@ -17,18 +49,6 @@ act 'Leave the library': minut += 5 & gt 'down'
 
 if hour >= 8 and hour <= 18:
 	act 'Read a science book (1:00)':
-		*clr & cla
-		menu_off = 1
-		if blizoruk = 100 or glassqw = 1:
-		glassqw = 1
-		msg'The text blurs across the page, it looks like you have got poor eyesight. It would be suitable to visit an ophthalmologists.'&gt $curloc
-		end
-		if pcs_nerd > 0:
-			lastread = totminut
-			lastreadday = daystart
-			pcs_nerd += 1
-		end
-		minut += 60
 		if pcs_intel >= 50:
 			intel_exp += RAND(0,1) + (mentats_dose - rand(0,mentats_dose))
 		elseif pcs_intel >= 25:
@@ -37,8 +57,7 @@ if hour >= 8 and hour <= 18:
 			intel_exp += RAND(1,3) + (mentats_dose - rand(0,mentats_dose))
 		end
 
-		blizoruk += 1
-		gs'stat'
+		dynamic $downlibrary['BookStudy'], ''
 
 		'	You read the book for an hour trying to make sense of all clever propositions and understand the subject of the description.'
 
@@ -46,22 +65,10 @@ if hour >= 8 and hour <= 18:
 	end
 
 	act 'Read an entertaining book (1:00)':
-		*clr & cla
-		menu_off = 1
-		if blizoruk = 100 or glassqw = 1:
-		glassqw = 1
-		msg'The text blurs across the page, it looks like you have got poor eyesight. It would be suitable to visit an ophthalmologists.'&gt $curloc
-		end
-		if pcs_nerd > 0:
-			lastread = totminut
-			lastreadday = daystart
-			pcs_nerd += 1
-		end
-		minut += 60
 		pcs_mood = 100
 		pcs_willpwr += 100
-		blizoruk += 1
-		gs'stat'
+
+		dynamic $downlibrary['BookStudy'], ''
 
 		'	You read an adventure fiction for an hour.'
 
@@ -69,28 +76,7 @@ if hour >= 8 and hour <= 18:
 	end
 
 	act 'Read the collected works of Leo Tolstoy (1:00)':
-		*clr & cla
-		menu_off = 1
-		if blizoruk = 100 or glassqw = 1:
-		glassqw = 1
-		msg'	The text blurs across the page, it looks like you have got poor eyesight. It would be suitable to visit an ophthalmologists.'&gt $curloc
-		end
-		if pcs_nerd > 0:
-			lastread = totminut
-			lastreadday = daystart
-			pcs_nerd += 1
-		end
-		minut += 60
-		if pcs_sprt >= 50:
-			sprt_exp += RAND(0,1)
-		elseif pcs_sprt >= 25:
-			sprt_exp += RAND(1,2)
-		else
-			sprt_exp += RAND(1,3)
-		end
-
-		blizoruk += 1
-		gs'stat'
+			dynamic $downlibrary['BookStudy'], 'sprt'
 
 		'	You read the book for an hour. Tolstoy is certainly a classic writer, no one denies this, but he wrote exceptionally wordily.'
 
@@ -98,37 +84,39 @@ if hour >= 8 and hour <= 18:
 	end
 	if MagicLibrary = 1:
 		act 'Read in magic books':
-			*clr & cla
-			menu_off = 1
-			if blizoruk = 100 or glassqw = 1:
-			glassqw = 1
-			msg'	The text blurs across the page, it looks like you have got poor eyesight. It would be suitable to visit an ophthalmologists.'&gt $curloc
-			end
-			if pcs_nerd > 0:
-				lastread = totminut
-				lastreadday = daystart
-				pcs_nerd += 1
-			end
-			minut += 60
-			if pcs_splcstng >= 50:
-				splcstng_exp += RAND(0,1)
-			elseif pcs_splcstng >= 25:
-				splcstng_exp += RAND(1,2)
-			else
-				splcstng_exp += RAND(1,3)
-			end
-			
-			blizoruk += 1
-			gs'stat'
+			dynamic $downlibrary['BookStudy'], 'splcstng'
 
 			'	You pick out one of the magic books you can actually read and sit down with it.'
 			'Not only is the subject matter complex and mostly a mystery to you, but the descriptions and explanations are unnecessarily wordy, as if the writer had something to prove.'
 			'After about an hour, you decide to take a break from it and, instead, test your memory. You don''t remember much, but you understand magic a tiny bit better than before nonetheless.'
 
+			! Find Researchable Spells
+			if arrsize('$ResearchingSP') < arrsize('$librarySpells'):
+				if rand(1,10) = 10:
+					NumResearching = arrsize('$ResearchingSP') + 1
+					if spellKnown[$librarySpells[NumResearching]] = 0:
+						*nl
+						*pl 'You have come across a lead on a new spell.'
+					end
+					i=0
+					:FindNewSpell1
+					if i < NumResearching:
+						$ResearchingSP[i] = $librarySpells[i]
+						i += 1
+						jump 'FindNewSpell1'
+					end
+					killvar 'i'
+					killvar 'NumResearching'
+				end
+			end
+
+			if arrsize('$ResearchingSP') > 0:
+				gs 'spellList', 'teacherActions', '$ResearchingSP', 'downlibrary', ''
+			end
 			act 'Put the book down':gt $curloc
 		end
 	end
-	
+
 else
 	'The library is closed.'
 end

+ 2 - 0
locations/lab.qsrc

@@ -526,6 +526,8 @@ if $ARGS[0] = 'Tatiana':
 
 	! Show Actions for Learning Spells
 	gs 'spellList', 'teacherActions', '$basicSpells', 'lab', 'Tatiana'
+	gs 'spellList', 'teacherActions', '$healSpells', 'lab', 'Tatiana'
+	!gs 'spellList', 'teacherActions', '$beautySpells', 'lab', 'Tatiana'
 
 	if pcs_magik >= 5 and spellavtoklon = 0:
 		act 'Learn technique preparation (1:00)':

+ 7 - 1
locations/saveupdater.qsrc

@@ -410,7 +410,7 @@ if arrsize('$bodimgsets') = 30:
 end
 
 !! reorganizes old spell variables into new arrrays
-if spell_update ! 1:
+if spell_update = 0:
 	spell_update = 1
 
 	if spelltuman = 1:spellKnown['fog'] = 1
@@ -448,6 +448,12 @@ if spell_update ! 1:
 	if spellwater5 = 1:spellKnown['greatflood'] = 1
 end
 
+if spell_update < 2:
+	spell_update = 2
+	killvar '$basicSpells'
+end
+gs 'spellList'
+
 !! Updater for manna > mana conversions
 
 if pcs_manna ! 0:

+ 33 - 0
locations/spell.qsrc

@@ -203,6 +203,39 @@ if $ARGS[0] = 'shower':
 	end
 end
 
+if $ARGS[0] = 'makeup':
+	if SuccessValue > 0:
+		! Argument should be 3 digit string representing Makeup to apply
+		$MakeupArg = $ARGS[2]
+		if $MakeupArg = '': $MakeupArg = '210'
+		! Arg[0] = Makeup Amount (0-3)
+		MakeupArg[0] = val(mid($MakeupArg,1,1))
+		! Arg[1] = Lip Balm application (0-1)
+		MakeupArg[1] = val(mid($MakeupArg,2,1))
+		! Arg[2] = False lash Application (0-2)
+		MakeupArg[2] = val(mid($MakeupArg,3,1))
+
+		! Brush hair
+		pcs_hairbsh = 1
+		! Apply Makeup
+		pcs_makeup = MakeupArg[0]
+		! Apply Lipbalm
+		pcs_lipbalm += 8*MakeupArg[1]
+		! Apply False Lashes
+		if MakeupArg[2] = 1 and pcs_lashes < 3:
+			pcs_lashes = 3
+		elseif MakeupArg[2] = 2 and pcs_lashes < 4:
+			pcs_lashes = 4
+		end
+
+		killvar 'MakeupArg'
+		killvar '$MakeupArg'
+		'<b><font color = green>makeup is applied to your face.</font></b>'
+	else
+		'<b>The spell fizzles.  Nothing seems to happen.</b>'
+	end
+end
+
 if $ARGS[0] = 'cosmetica':
 	if SuccessValue > 0:
 		! Take a Shower

+ 33 - 6
locations/spellBook.qsrc

@@ -61,13 +61,40 @@ else
 			</tr>"
 	$spellBookVar['RowCode'] = {
 		if spellKnown[$ThisSpellName] = 1:
-			$result = " 
-			<tr>
-				<td align='left'><a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>'& <<$spellBookVar['CodeAfterSpell']>>""><<$spellName[$ThisSpellName]>></a></td>
-				<td align='right'><<spellMana[$ThisSpellName]>></td>
-				<td align='left'><<$spellDesc[$ThisSpellName]>></td>
-			</tr>"
+			if $spellOptDesc[$ThisSpellName] = '':
+				$tmpHTMLCode = " 
+				<tr>
+					<td align='left'><a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>'& <<$spellBookVar['CodeAfterSpell']>>""><<$spellName[$ThisSpellName]>></a></td>
+					<td align='right'><<spellMana[$ThisSpellName]>></td>
+					<td align='left'><<$spellDesc[$ThisSpellName]>></td>
+				</tr>"
+			else
+				$tmpHTMLCode = " 
+				<tr>
+					<td align='left'><<$spellName[$ThisSpellName]>></td>
+					<td align='right'><<spellMana[$ThisSpellName]>></td>
+					<td align='left'><<$spellDesc[$ThisSpellName]>></td>
+				</tr>"
+				n=0
+				:RowCodeLoop99
+				if n < arrsize('<<$spellOptDesc[$ThisSpellName]>>'):
+					$spellBookVar['tmpVal'] = dyneval('$result = <<$spellOptVal[$ThisSpellName]>>[<<n>>]')
+					$spellBookVar['tmpName']= dyneval('$result = <<$spellOptDesc[$ThisSpellName]>>[<<n>>]')
+					$tmpHTMLCode += " 
+					<tr>
+						<td align='left'></td>
+						<td align='left'><a href=""EXEC: gs 'castSpell', '<<$ThisSpellName>>', '<<$spellBookVar['tmpVal']>>' & <<$spellBookVar['CodeAfterSpell']>>""><<$spellBookVar['tmpName']>></a></td>
+						<td align='left'></td>
+					</tr>"
+					n += 1
+					jump 'RowCodeLoop99'
+				end
+
+			end
+			$result = $tmpHTMLCode
 			spellBookVar['Counter'] += 1
+			killvar '$tmpHTMLCode'
+			killvar 'n'
 		else
 			$result = ''
 		end

+ 83 - 11
locations/spellList.qsrc

@@ -8,13 +8,19 @@
 !	spellTime['spellname'] = How much time will pass in the casting of the spell
 !	spellDiff['spellname'] = Difficulty to learn and cast this spell
 !	$spellName['spellname'] = Pretty name for the spell
-!	$sellDesc['spellname'] = Description of what the spell does.
+!	$psellDesc['spellname'] = Description of what the spell does.
+!	$spellReq['spellname'] = Prerequisite Spell needed to learn this spell
+!	$spellOptDesc['spellname'] = name of an array of Option Descriptions for this spell
+!	$spellOptVal['spellname'] = name of an array of values to pass for Spell Options
 !
 ! There are also defined lists of spells grouped together
 !	$combatSpells = Spells that can be used in Combat
 !	$nonComSpells = Non-Combat Spells, ones that can be executed in any location.
 !	---
 !	$basicSpells = basic spells that are taught by Tatiana
+!	$healSpells = Healing Spells
+!	$beautySpells = Beauty Spells
+!	$librarySpells = Spelsl Researchable in the Library
 !	$fireSpells = Fire-based spells
 !	$electSpells = Electricity based spells
 !	$earthSpells = Earth magic spells
@@ -60,6 +66,7 @@ spellTime['curewounds2'] = 60
 spellDiff['curewounds2'] = 75
 $spellName['curewounds2'] = "Greater Cure Wounds"
 $spellDesc['curewounds2'] = "You feel your body heal to perfection."
+$spellReq['curewounds2'] = 'curewounds'
 !painblock
 spellMana['painblock'] = 1000
 spellTime['painblock'] = 1
@@ -78,12 +85,60 @@ spellTime['shower'] = 1
 spellDiff['shower'] = 1
 $spellName['shower'] = "Shower"
 $spellDesc['shower'] = "Clean and refresh yourself as if you have taken a shower."
+!makeup
+spellMana['makeup'] = 100
+spellTime['makeup'] = 5
+spellDiff['makeup'] = 15
+$spellName['makeup'] = "Makeup"
+$spellDesc['makeup'] = "Apply Makeup to yourself magically."
+$spellOptDesc['makeup'] = '$MakeupSet'
+$spellOptVal['makeup'] = '$MakeupSetVal'
+if $routine1+$routine2+$routine3+$routine4 = '':
+	killvar '$MakeupSet'
+	killvar '$MakeupSetVal'
+	$MakeupSet[0] = 'No Makeup'
+	$MakeupSetVal[0] = '000'
+	$MakeupSet[1] = 'Light Makeup'
+	$makeupSetVal[1] = '110'
+	$MakeupSet[2] = 'Vibrant Makeup'
+	$makeupSetVal[2] = '210'
+	$MakeupSet[3] = 'Heavy Makeup'
+	$makeupSetVal[3] = '310'
+else
+	killvar '$MakeupSet'
+	killvar '$MakeupSetVal'
+	$MakeupSet[0] = 'No Makeup'
+	$MakeupSetVal[0] = '000'
+	i=1
+	if $routine1 ! '':
+		$MakeupSet[i] = $routine1custname
+		$MakeupSetVal[i] = $routine1
+		i += 1
+	end
+	if $routine2 ! '':
+		$MakeupSet[i] = $routine2custname
+		$MakeupSetVal[i] = $routine2
+		i += 1
+	end
+	if $routine3 ! '':
+		$MakeupSet[i] = $routine3custname
+		$MakeupSetVal[i] = $routine3
+		i += 1
+	end
+	if $routine4 ! '':
+		$MakeupSet[i] = $routine4custname
+		$MakeupSetVal[i] = $routine4
+		i += 1
+	end
+	killvar 'i'
+end
 !cosmetica
 spellMana['cosmetica'] = 10000
 spellTime['cosmetica'] = 5
 spellDiff['cosmetica'] = 50
 $spellName['cosmetica'] = "Cosmetica"
 $spellDesc['cosmetica'] = "Clean and tidy yourself, completely beautifying yourself; hair, makeup, grooming of all kinds."
+$spellReq['cosmetica'] = 'makeup'
 !glamour
 spellMana['glamour'] = 500
 spellTime['glamour'] = 1
@@ -133,6 +188,7 @@ spellTime['multiclone'] = 0
 spellDiff['multiclone'] = 2
 $spellName['multiclone'] = "Multi-Clone"
 $spellDesc['multiclone'] = "Summon three clones of yourself and slip out of the enemys sight."
+$spellReq['multiclone'] = 'clone'
 !energo
 spellMana['energo'] = 50
 spellTime['energo'] = 0
@@ -169,6 +225,7 @@ spellTime['burninghands'] = 0
 spellDiff['burninghands'] = 7
 $spellName['burninghands'] = "Burning Hands"
 $spellDesc['burninghands'] = "A torrent of flames jets from your hands."
+$spellReq['burninghands'] = 'scaldingtouch'
 !firebarrier
 spellMana['firebarrier'] = 150
 spellTime['firebarrier'] = 0
@@ -211,6 +268,7 @@ spellTime['1000birds'] = 0
 spellDiff['1000birds'] = 9
 $spellName['1000birds'] = "Dance of a Thousand Birds"
 $spellDesc['1000birds'] = "The air is filled with small lightning bolts leaping through the air with shrieks."
+$spellReq['1000birds'] = 'lightning'
 !dancingsphere
 spellMana['dancingsphere'] = 500
 spellTime['dancingsphere'] = 0
@@ -355,7 +413,8 @@ $nonComSpells[4] = 'curewounds2'
 $nonComSpells[5] = 'painblock'
 $nonComSpells[6] = 'berserk'
 $nonComSpells[7] = 'shower'
-$nonComSpells[8] = 'cosmetica'
+$nonComSpells[8] = 'makeup'
+$nonComSpells[9] = 'cosmetica'
 
 
 ! Basic Spells
@@ -366,14 +425,27 @@ $basicSpells[3] = 'wind'
 $basicSpells[4] = 'multiclone'
 $basicSpells[5] = 'energo'
 $basicSpells[6] = 'haste'
-$basicSpells[7] = 'regenerate'
-$basicSpells[8] = 'curedisease'
-$basicSpells[9] = 'curewounds'
-$basicSpells[10] = 'curewounds2'
-$basicSpells[11] = 'painblock'
-$basicSpells[12] = 'berserk'
-$basicSpells[13] = 'shower'
-$basicSpells[14] = 'cosmetica'
+$basicSpells[7] = 'berserk'
+
+!Healing Spells
+$healSpells[0] = 'painblock'
+$healSpells[1] = 'curewounds'
+$healSpells[2] = 'curewounds2'
+$healSpells[3] = 'curedisease'
+$healSpells[4] = 'heal'
+$healSpells[5] = 'regenerate'
+
+! Beauty Spells
+$beautySpells[0] = 'shower'
+$beautySpells[1] = 'makeup'
+$beautySpells[2] = 'cosmetica'
+
+
+! Researchable Spells
+$librarySpells[0] = 'painblock'
+$librarySpells[1] = 'shower'
+$librarySpells[2] = 'makeup'
+$librarySpells[3] = 'cosmetica'
 
 
 ! Elemental Spell Groups
@@ -427,7 +499,7 @@ if $ARGS[0] = 'teacherActions':
 	spellDifficulty = $spellDiff[$ThisSpellName]
 	if spellDifficulty = 0: spellDifficulty = 1
 	if i < ThisArraySize:
-		if pcs_magik >= spellDifficulty and spellKnown[$ThisSpellName] = 0:
+		if pcs_magik >= spellDifficulty and spellKnown[$ThisSpellName] = 0 and ($spellReq[$ThisSpellName] = '' or spellKnown[$spellReq[$ThisSpellName]]):
 			dynamic "act 'Learn <<$spellName[$ThisSpellName]>> (1:00)':
 				cla
 				if pcs_mana >= 1000: