ID:160538
 
Yes Im Coding a Game that has Transformations in it i need help with the following in that Transformation Code...

-Draining of a Var such as Magic but i need it to Drain over time...
-i also need help with Making Sure that when the Verb for the Transformation is clicked again that it doesn't Repeat the effects of the verb again...

if you can help me with this code or Direct me to someWhere or someone who Can it would be Greatly Appreaciated
- Maikito
1:
while(src.iscasting)
src.Magic-=2 //minus 2


2:
mob/verb/Transform()
if(src.transforming)
//stuff to turn it off
else
//stuff to turn it on


Should help!
mob
var
Magic = 60
list/Effects = list() // Contain all the effects in a list.
verb
Transform()
if(!"Drain" in Effects) // If the effect Drain isn't in the Effects list..
Effects.Add("Drain") // Add it and begin draining magic.
DrainMagic()
UserTransform()
proc
DrainMagic()
while("Drain" in Effects)
Magic--
sleep(600)
UserTransform()
// Transform procedure.
In response to DemonSpree
mob/verb/Toggle_Transformation()
set category = "Transformation"
if(src.istransed)
src << "You return to your normal form."
src.istransed=0
else
src << "You transform!!!"
src.istransed=1
src.Drain()

mob/var/magic=10
mob/var/istransed=0

mob/proc/Drain()
if(src.istransed)
src.magic-=5
src.Drain()

That should work.

~Duper
In response to Duper
Too much spoonfeeding, IMO.
I was mainly showing him bare-bones.
In response to DemonSpree
Spoonfeeding xD. Sometimes, it's good. He can learn from it.

~Duper