Browse Source

Merge remote-tracking branch 'KeyMasterOfGozer/master'

KevinSmarts 3 years ago
parent
commit
6ab2d8cca0
5 changed files with 131 additions and 27 deletions
  1. 8 18
      locations/city_library.qsrc
  2. 20 5
      locations/kakuzu.qsrc
  3. 27 0
      locations/saveupdater.qsrc
  4. 54 4
      locations/spellList.qsrc
  5. 22 0
      locations/tatiana_lab.qsrc

+ 8 - 18
locations/city_library.qsrc

@@ -84,28 +84,18 @@ if hour >= 8 and hour <= 18:
 			'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 func('spellList','numAvailableSpells','librarySpells') > 0:
 				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'
+					gs 'spellList','addAvailableSpells','librarySpells'
+					*nl
+					*pl 'You have come across a lead on a new spell.'
 				end
+			else
+				'There don''t seem to be any more spells to learn here, but perhaps I can still improve my skills in the ones that I''ve already found.'
 			end
 
-			if arrsize('$ResearchingSP') > 0:
-				gs 'spellList', 'teacherActions', '$ResearchingSP', 'city_library', ''
-			end
+			gs 'spellList', 'teacherActions', '$librarySpells', 'city_library', ''
+
 			act 'Put the book down':gt $curloc
 		end
 	end

+ 20 - 5
locations/kakuzu.qsrc

@@ -104,11 +104,26 @@ if $ARGS[0] = 'mansion1':
 			elseif srodstvo >= 100:
 				srodpaper -= 1
 
-				if srodrand = 1:'Paper broke in your hands. Kakuzu nods approvingly. Affinity with fire. Will you take it?'
-				if srodrand = 2:'Paper electrified in your hands, and sparks dance on it. Kakuzu nods approvingly. Affinity with lightning. Will you take it?'
-				if srodrand = 3:'Paper hardened in your hands. Kakuzu nods approvingly. Affinity with the land. Will you take it?'
-				if srodrand = 4:'Paper shredded to pieces in your hands. Kakuzu nods approvingly. Affinity with the wind. Will you take it?'
-				if srodrand = 5:'Paper soaked in your hands. Kakuzu nods approvingly. Affinity for water. Will you take it?'
+				if srodrand = 1:
+					'Paper broke in your hands. Kakuzu nods approvingly. Affinity with fire. Will you take it?'
+					gs 'spellList','addAvailableSpells','fireSpells', 20
+				end
+				if srodrand = 2:
+					'Paper electrified in your hands, and sparks dance on it. Kakuzu nods approvingly. Affinity with lightning. Will you take it?'
+					gs 'spellList','addAvailableSpells','electSpells', 20
+				end
+				if srodrand = 3:
+					'Paper hardened in your hands. Kakuzu nods approvingly. Affinity with the land. Will you take it?'
+					gs 'spellList','addAvailableSpells','earthSpells', 20
+				end
+				if srodrand = 4:
+					'Paper shredded to pieces in your hands. Kakuzu nods approvingly. Affinity with the wind. Will you take it?'
+					gs 'spellList','addAvailableSpells','airSpells', 20
+				end
+				if srodrand = 5:
+					'Paper soaked in your hands. Kakuzu nods approvingly. Affinity for water. Will you take it?'
+					gs 'spellList','addAvailableSpells','waterSpells', 20
+				end
 
 				act 'Secure affinity':
 					cla

+ 27 - 0
locations/saveupdater.qsrc

@@ -317,6 +317,33 @@ if spell_update < 2:
 end
 gs 'spellList'
 
+if spell_update < 3:
+	spell_update = 3
+	! Fix Spell learn avaiability for Kakuzu if needed
+	if tobiQW = 3:
+		if stihia = 1:
+			gs 'spellList','addAvailableSpells','fireSpells', 20
+		end
+		if stihia = 2:
+			gs 'spellList','addAvailableSpells','electSpells', 20
+		end
+		if stihia = 3:
+			gs 'spellList','addAvailableSpells','earthSpells', 20
+		end
+		if stihia = 4:
+			gs 'spellList','addAvailableSpells','airSpells', 20
+		end
+		if stihia = 5:
+			gs 'spellList','addAvailableSpells','waterSpells', 20
+		end
+	end
+	! Fix Library spells found if needed
+	if arrsize('$ResearchingSP')>0:
+		gs 'spellList','addAvailableSpells','librarySpells', arrsize('$ResearchingSP')
+	end
+end
+gs 'spellList'
+
 
 if array_updater = 0:
 	array_updater = 1

+ 54 - 4
locations/spellList.qsrc

@@ -2,6 +2,7 @@
 ! Information pertaining to PC for each spell
 !	spellKnown['spellname'] = 1 if the spell is known by the player
 !	spellLearn['spellname'] = 0-100, percentage of study that has occured to learn this spell. 100+ will learn it.
+!	spellListAvail['spellListArrayName'] = Number of spells that teacher will teach in the list
 !
 ! MetaData for Each Spell
 !	spellMana['spellname'] = Mana cost to cast this spell
@@ -593,17 +594,18 @@ if $ARGS[0] = 'teacherActions':
 	! Example:
 	!	gs 'spellList', 'teacherActions', '$fireSpells', 'kakuzu', 'mansion1'
 
-	$ThisArrayName = $ARGS[1]
+	$ThisArrayName = $replace($ARGS[1],'$')
 	$ExitLocation = $ARGS[2]
 	$ExitLocation2 = $ARGS[3]
 
-	ThisArraySize = dyneval("result=arrsize('<<$ThisArrayName>>')")
+	ThisArraySize = dyneval("result=arrsize('$<<$ThisArrayName>>')")
+	MaxAvailable = spellListAvail[$ThisArrayName]
 	i = 0
 	:LearnSpellLoop
-	$ThisSpellName = dyneval("$result = <<$ThisArrayName>>[<<i>>]")
+	$ThisSpellName = dyneval("$result = $<<$ThisArrayName>>[<<i>>]")
 	spellDifficulty = $spellDiff[$ThisSpellName]
 	if spellDifficulty = 0: spellDifficulty = 1
-	if i < ThisArraySize:
+	if i < ThisArraySize and i < MaxAvailable:
 		if pcs_magik >= spellDifficulty and spellKnown[$ThisSpellName] = 0 and ($spellReq[$ThisSpellName] = '' or spellKnown[$spellReq[$ThisSpellName]]):
 			dynamic "act 'Learn <<$spellName[$ThisSpellName]>> (1:00)':
 				cla
@@ -634,6 +636,7 @@ if $ARGS[0] = 'teacherActions':
 	killvar 'i'
 	killvar '$ThisSpellName'
 	killvar 'ThisArraySize'
+	killvar 'MaxAvailable'
 	killvar '$ThisArrayName'
 	killvar '$ExitLocation'
 	killvar '$ExitLocation2'
@@ -641,4 +644,51 @@ if $ARGS[0] = 'teacherActions':
 end
 
 
+if $ARGS[0] = 'numAvailableSpells':
+	! Function that returns if the number of spells left to learn from this spell list
+	!	$ARGS[1] = spelllist arrayname
+	! Example:
+	!	if func('spellList','numAvailableSpells','librarySpells') > 0: !do stuff to earn next spell
+
+	$ThisArrayName = $replace($ARGS[1],'$')
+
+	ThisArraySize = dyneval("result=arrsize('$<<$ThisArrayName>>') - spellListAvail['<<$ThisArrayName>>']")
+
+	result = ThisArraySize
+
+	killvar 'ThisArraySize'
+	killvar '$ThisArrayName'
+end
+
+if $ARGS[0] = 'addAvailableSpells':
+	! Increases Spell Available to be taught by this instructor by a given amount, default 1
+	!	$ARGS[1] = spelllist arrayname
+	!	 ARGS[2] = number of spells to add to avaiable list for learning
+	! Example:
+	!	!This adds one more spell to the list of library spells
+	!	gs 'spellList','addAvailableSpells','librarySpells'
+	!	!This adds 3 more spells
+	!	gs 'spellList','addAvailableSpells','librarySpells', 3
+
+	$ThisArrayName = $replace($ARGS[1],'$')
+	ThisNumToAdd = ARGS[2]
+	if ThisNumToAdd = 0:
+		ThisNumToAdd = 1
+	end
+
+	ThisArraySize = dyneval("result=arrsize('$<<$ThisArrayName>>')")
+
+	if ThisArraySize - ThisNumToAdd - spellListAvail[$ThisArrayName] < 0:
+		! This mean that we are trying to add more spells than are avaiable in the list
+		spellListAvail[$ThisArrayName] = ThisArraySize
+	else
+		! Else we just add the requested number
+		spellListAvail[$ThisArrayName] += ThisNumToAdd
+	end
+
+	killvar 'ThisNumToAdd'
+	killvar 'ThisArraySize'
+	killvar '$ThisArrayName'
+end
+
 --- spellList ---------------------------------

+ 22 - 0
locations/tatiana_lab.qsrc

@@ -493,6 +493,28 @@ if $ARGS[0] = 'Tatiana':
 		end
 	end
 
+	if func('spellList','numAvailableSpells','basicSpells') > 0 or  func('spellList','numAvailableSpells','healSpells') > 0:
+		act 'Are there other spells you can teach me? (1:00)':
+			cla
+			'Placeholder scene where Tatiana uses device to pull mana in exchange for her help.'
+			! Takes time
+			minut += 60
+			! takes mana
+			pcs_mana -= 10000
+			if pcs_mana < 0: pcs_mana = 0
+			! causes orgasm
+			$orgasm_or = 'yes'
+			gs 'arousal', 'masturbate', 15
+			gs 'arousal', 'end'
+			gs 'stat'
+			! Adds new spells
+			gs 'spellList','addAvailableSpells','basicSpells'
+			gs 'spellList','addAvailableSpells','healSpells'
+
+			act 'Leave':gt 'tatiana_lab', 'Tatiana'
+		end
+	end
+
 	! Show Actions for Learning Spells
 	gs 'spellList', 'teacherActions', '$basicSpells', 'tatiana_lab', 'Tatiana'
 	gs 'spellList', 'teacherActions', '$healSpells', 'tatiana_lab', 'Tatiana'