|
@@ -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 ---------------------------------
|