1
0
Ver Fonte

Merge remote-tracking branch 'KeyMasterOfGozer/master'

KevinSmarts há 5 anos atrás
pai
commit
8f3dd84cf8

+ 1 - 1
glife.qproj

@@ -1101,7 +1101,7 @@
 	<Location name="BanSexType"/>
 	<Folder name="Magic">
 		<Location name="castSpell"/>
-		<Location name="spellTeleport"/>
+		<Location name="spell_teleport"/>
 		<Location name="treeCircle"/>
 		<Location name="treeCircActs"/>
 		<Location name="treeCircEntry"/>

+ 34 - 13
locations/castSpell.qsrc

@@ -2,8 +2,12 @@
 ! Used to cast a spell.  Use as a function.  Returns 1 OR 0 for Success or Failure.
 !
 ! ARGS[0] is the spell being cast
-!	Valid Spells are
+!	Valid Spells are listed below
 !		teleport
+! ARGS[1-n] are any parameters that need to be passed to the Spell
+!
+!	Example:
+!		gs 'castSpell', 'teleport', 'CentralPark'
 
 !teleport
 spellMana['teleport'] = 1000
@@ -18,38 +22,49 @@ spellDiff['glamour'] = 30
 
 spellSuccess = 0
 
-if spellKnown[$ARGS[0]] = 1:
+$SpellName = $ARGS[0]
+$SpellArgs = ""
+i=1
+:ArgLoop
+if i < arrsize('$ARGS'):
+	i += 1
+	$SpellArgs = $SpellArgs + ", '<<$ARGS[i - 1]>>'"
+	jump 'ArgLoop'
+end
+killvar 'i'
+
+if spellKnown[$SpellName] = 1:
 	!Make a Skill Check to see if the Spell succeeds
-	spellRoll = pcs_splcstng - spellDiff[$ARGS[0]] - (pcs_horny/5) + rand(1,100)
+	spellRoll = pcs_splcstng - spellDiff[$SpellName] - (pcs_horny/5) + rand(1,100)
 	if spellRoll > 50:
 		!Critical Success
 		spellSuccess = 2
-		splcstng_exp += rand(1,spellDiff[$ARGS[0]]) + rand(0,5)
+		splcstng_exp += rand(1,spellDiff[$SpellName]) + rand(0,5)
 	elseif spellRoll > 10:
 		!Success
 		spellSuccess = 1
-		splcstng_exp += rand(1,spellDiff[$ARGS[0]])
+		splcstng_exp += rand(1,spellDiff[$SpellName])
 	elseif spellRoll > -20:
 		!Failure
 		spellSuccess = 0
-		splcstng_exp += rand(1,spellDiff[$ARGS[0]]) / 2
+		splcstng_exp += rand(1,spellDiff[$SpellName]) / 2
 	else:
 		!Critical Failure
 		spellSuccess = -1
-		splcstng_exp += rand(1,spellDiff[$ARGS[0]]) / 2
+		splcstng_exp += rand(1,spellDiff[$SpellName]) / 2
 	end
 	killvar 'spellRoll'
 
 	!Incur the costs of casting the spell
 	if spellSuccess = 2:
-		manaCost = spellMana[$ARGS[0]] / 2
+		manaCost = spellMana[$SpellName] / 2
 	elseif spellSuccess = -1:
-		manaCost = spellMana[$ARGS[0]] * 2
+		manaCost = spellMana[$SpellName] * 2
 	else:
-		manaCost = spellMana[$ARGS[0]]
+		manaCost = spellMana[$SpellName]
 	end
 	pcs_manna -= manaCost
-	!pcs_willpwr -= spellWill[$ARGS[0]]
+	!pcs_willpwr -= spellWill[$SpellName]
 	arouseVal = manaCost / 50
 	gs 'arousal', 'voyeur', arouseVal
 	minut -= arouseVal
@@ -58,10 +73,16 @@ if spellKnown[$ARGS[0]] = 1:
 
 end
 
-minut += spellTime[$ARGS[0]]
+minut += spellTime[$SpellName]
 
 gs 'stat'
 
-result = spellSuccess
+$SpellExec = "gs 'spell_<<$SpellName>>', '<<spellSuccess>>'<<$SpellArgs>>"
+
+dynamic $SpellExec
+
+killvar '$SpellName'
+killvar '$SpellArgs'
+killvar '$SpellExec'
 
 --- castSpell ---------------------------------

+ 6 - 6
locations/spellTeleport.qsrc → locations/spell_teleport.qsrc

@@ -1,8 +1,10 @@
-#spellTeleport
+#spell_teleport
 ! Do the stuff of a Teleport
-!	ARGS[0] = the Target Location
+!	ARGS[0] = Success/Failure level
+!	ARGS[1] = the Target Location
 
-$NewLocation = $ARGS[0]
+didItWork = $ARGS[0]
+$NewLocation = $ARGS[1]
 
 :RandLocLoop
 $randomLoc = $tpLocations[rand(0,arrsize($tpLocations) - 1)]
@@ -10,8 +12,6 @@ if $randomLoc = $NewLocation or $randomLoc = $EntryPoint:
 	jump 'RandLocLoop'
 end
 
-didItWork = func("castSpell", "teleport")
-
 if didItWork > 0:
 	*nl
 	"The blur you see just outside the ring seems to shift."
@@ -38,4 +38,4 @@ killvar '$randomLoc'
 killvar '$NewLocation'
 killvar didItWork
 
--- spellTeleport ---------------------------------
+-- spell_teleport ---------------------------------

+ 1 - 5
locations/treeCircActs.qsrc

@@ -2,10 +2,6 @@
 ! Handles making Action Entries for Different Tree Circle Entry Points
 !	Call as a GoSub with ARGS:
 !	ARGS[0] = Location Identifier	['CentralPark']
-!	ARGS[1] = Localtion Label		['Central Park']
-!	ARGS[2] = location leaving to	['park']
-!	ARGS[3] = parameter for prev	['start']
-
 
 
 if $EntryPoint = $ARGS[0]:
@@ -18,7 +14,7 @@ if $EntryPoint = $ARGS[0]:
 	end
 else:
 	if canTeleport = 1 and tpKnown[$ARGS[0]] = 1:
-		$dynAction = "act 'Will yourself to <<$treeCircName[$ARGS[0]]>>': gs 'spellTeleport', '<<$ARGS[0]>>'"
+		$dynAction = "act 'Will yourself to <<$treeCircName[$ARGS[0]]>>': gs 'castSpell', 'teleport', '<<$ARGS[0]>>'"
 		dynamic $dynAction
 	end
 end

+ 2 - 0
locations/treeCircEntry.qsrc

@@ -12,6 +12,8 @@ if MagikDostup = 0:
 	end
 	dynamic $EntryAction
 
+	killvar '$EntryAction'
+
 end
 
 --- treeCircEntry ---------------------------------