mob/var/charging=0
mob/var/MaxCharge=10
mob/var/chargepower=0
mob/var/tmp/Form
mob/var/Attacking
mob/var/tmp/Frozen
mob/var/CanRelease
mob
verb
Charge()
if(src.Attacking)
return
if(src.Form=="Mana")
src.charging=1
spawn src.ChargeIt()
mob/verb/ReleaseCharge()
src.Release()
mob
proc
Release()
if(src.Form=="Mana")
src.CanRelease=0
src.Attacking=1
src.charging=0
src.KnockBack(1)
Projectile("ManaSphere",src.Int*src.chargepower)
spawn(10)
src.icon_state=""
src.Frozen=0
src.Attacking=0
src.chargepower=0the charge
mob
proc
ChargeIt()
while(src.charging)
if(src.chargepower>=10)
Release()
return
src.icon_state="Charge"
src.chargepower++ src.CanRelease=1
sleep(8)
Hi everybody! This is my "Charge n' shoot" code where you hold down the skill, and your chargepower goes up. When you release it, it shoots a sphere that deals damage based on your charge power. Simple enough. And it all works fine~ My only problem is is that when I charge, it charges really slowly... And yes, I know that it sleep(8)s, however if I put it any lower, your charge power var in your stat panel (just a test output) jumps like 0,2,3,5,6,7,10. Is there a way that I can get a person to be able to charge faster where it doesn't seem to jump like that? I want it to be able to increase like, once per 2/10ths of a second. (Sleep 2 does not fix the issue)
Problem description: