Browse Source

Added Spell Skill Checks

Mike Greene 5 years ago
parent
commit
fc43245533
2 changed files with 25 additions and 7 deletions
  1. 15 0
      locations/castSpell.qsrc
  2. 10 7
      locations/treeCircActs.qsrc

+ 15 - 0
locations/castSpell.qsrc

@@ -10,20 +10,35 @@
 spellMana['teleport'] = 1000
 spellTime['teleport'] = 20
 spellWill['teleport'] = 20
+spellDiff['teleport'] = 20
 !glamour
 spellMana['glamour'] = 500
 spellTime['glamour'] = 1
 spellWill['glamour'] = 15
+spellDiff['glamour'] = 30
+
+spellSuccess = 0
 
 if spellKnown[$ARGS[0]] = 1:
+	!Incur the costs of casting the spell
 	pcs_manna -= spellMana[$ARGS[0]]
 	!pcs_willpwr -= spellWill[$ARGS[0]]
 	arouseVal = spellMana[$ARGS[0]] / 50
 	gs 'arousal', 'voyeur', arouseVal
 	minut -= arouseVal
 	killvar 'arouseVal'
+
+	!Make a Skill Check to see if the Spell succeeds
+	if pcs_splcstng - pcs_horny + rand(1,100) > spellDiff[$ARGS[0]]:
+		spellSuccess = 1
+		splcstng_exp += spellDiff[$ARGS[0]]
+	else:
+		splcstng_exp += spellDiff[$ARGS[0]] / 2
+	end
 end
 
 minut += spellTime[$ARGS[0]]
 
+result = spellSuccess
+
 --- castSpell ---------------------------------

+ 10 - 7
locations/treeCircActs.qsrc

@@ -18,14 +18,17 @@ if $EntryPoint = $ARGS[0]:
 else:
 	if canTeleport = 1 and tpKnown[$ARGS[0]] = 1:
 		act 'Will yourself to <<$treeCircName[$ARGS[0]]>>':
-			gs 'castSpell', 'teleport'
-			'The blur you see just outside the ring seems to shift.  You step outside the ring.'
-			wait 750
-
-			if $treeCircArg['<<$ARGS[0]>>'] = '':
-				gt $treeCircLoc['<<$ARGS[0]>>']
+			if func('castSpell', 'teleport') = 1:
+				''
+				'The blur you see just outside the ring seems to shift.'
+				wait 1000
+				if $treeCircArg['<<$ARGS[0]>>'] = '':
+					gt $treeCircLoc['<<$ARGS[0]>>']
+				else:
+					gt $treeCircLoc['<<$ARGS[0]>>'], $treeCircArg['<<$ARGS[0]>>']
+				end
 			else:
-				gt $treeCircLoc['<<$ARGS[0]>>'], $treeCircArg['<<$ARGS[0]>>']
+				'You feel drained, but the energy fizzles out and nothing happens'
 			end
 		end
 	end