ID:172609
Apr 18 2004, 8:37 pm (Edited on Apr 18 2004, 9:58 pm)
|
|
ok
|
Apr 18 2004, 9:01 pm
|
|
Don't use usr in procs.
|
In response to Garthor
|
|
I have tried to fix this but keep getting errors, so I went back to my original part, Now how would this be coded so when my kamehamhea hits a solid wall it del's itself and so there arent spaces in between the icon pieces when you fire the beam?
mob/ A.POWER src.update usr.blasting /obj/attack/blast M.Raged mob/proc/src.update() mob/proc/Enrage() obj/attack/kamehead icon = 'Attacks-KamehamehaTop.dmi' name = "" POWER = 0 density = 1 Bump(mob/M) if(istype(M,/mob)) if(M.npc == 0) if(M.Barrier == 0) M.PL -= POWER/2 M.HP -= POWER if(M.Barrier == 1) M.PL -= POWER/4 M.HP -= POWER/10 var/a = (rand(-10,50))/10 M.Anger += a spawn() M.Enrage() M.update() spawn() M.KO() del(src) else del(src) if(istype(M,/obj/attack)) if(istype(M,/obj/attack/kamehead)) return if(istype(M,/obj/attack/kametrail)) return if(istype(M,/obj/attack/kametrailend)) return if(istype(M,/obj/attack/blast)) del(M) else sleep(10) del(M) del(src) else del(src) obj/attack/kametrail icon = 'Attacks-KamehamehaMiddle.dmi' name = "" POWER = 0 density = 1 Bump(mob/M) if(istype(M,/mob)) del(src) if(istype(M,/obj/attack)) if(istype(M,/obj/attack/kamehead)) return if(istype(M,/obj/attack/kametrail)) return if(istype(M,/obj/attack/kametrailend)) return else del(src) else del(src) obj/attack/kametrailend icon = 'Attacks-KamehamehaEnd.dmi' name = "" POWER = 0 density = 1 Bump(mob/M) if(istype(M,/mob)) del(src) if(istype(M,/obj/attack)) if(istype(M,/obj/attack/kamehead)) return if(istype(M,/obj/attack/kametrail)) return if(istype(M,/obj/attack/kametrailend)) return else del(src) else del(src) mob/verb/Kamehameha() set category = "Attacks" set name = "Kamehameha" if(usr.blasting == 0) if(usr.KO == 0) if(usr.PL < 165000) if(usr.Stamina > 3.5) usr.blasting = 1 var/ki = 0 switch(input("How much power will you feed into the attack?","") in list("Weak","Powerful","Super","Cancel")) if("Weak") ki = rand(usr.KI/20,usr.KI/30) if("Powerful") ki = rand(usr.KI/10,usr.KI/15) if("Super") if(usr.Anger > usr.AngerLimit/2) ki = rand(usr.KI/1.5,usr.KI/2) ki = ki*1.25 usr.Anger = 0 else ki = rand(usr.KI/2,usr.KI/4) if("Cancel") usr.blasting = 0 return var/power = ki*((usr.Will+usr.Int+usr.Wis)/375.0) var/damage = (rand((power * usr.Focus/5),(power * usr.Focus/10))+1) usr.Stamina -= 3.5 view(6) << "[usr]:Kaaaa..." sleep(5) view(6) << "[usr]:Meeeeeee..." sleep(10) view(6) << "[usr]:Haaaaaaaaaaa..." sleep(10) view(6) << "[usr]:Meeeeeeeeeeeeeeee..." sleep(15) view(6) << "[usr]:HAAAAAAAAAAAAAAAAAAAAAAA!!!!" var/obj/A = new /obj/attack/kamehead/ var/obj/B = new /obj/attack/kametrail/ var/obj/C = new /obj/attack/kametrail/ var/obj/D = new /obj/attack/kametrailend/ A.POWER = damage view(9) << "[usr] fires a Kamehameha Wave!" A.loc=locate(usr.x,usr.y,usr.z) walk(A,usr.dir) sleep(1) B.loc=locate(usr.x,usr.y,usr.z) walk(B,usr.dir) sleep(1) C.loc=locate(usr.x,usr.y,usr.z) walk(C,usr.dir) sleep(1) D.loc=locate(usr.x,usr.y,usr.z) walk(D,usr.dir) usr.PL = usr.PL-ki usr.update() usr.blasting = 0 spawn() usr.KO() else usr.blasting = 0 mob/proc/KO() if(src.PL <= 0||src.Stamina <= 0||src.HP <= 0) src.KO = 1 src.sight |= BLIND view(9) << "[src] is knocked out!" src << "You lose conciousness!" src.Anger -= rand(5,50) src.Training = 0 src.BagTraining = 0 src.Meditation = 0 src.Rest = 0 src.PL = 0 src.HP = 0 src.update() src.update() if(src.Anger < 0) src.Anger = 0 sleep(rand(300,1200)) if(src.KO == 1) src.KO = 0 src.sight &= ~BLIND src.PL = 1 src.HP = 1 src.Stamina = 25 var/damagegain = ((src.MaxKi/1500)*(100+src.Gain)/100) if(damagegain > 200) damagegain = 200 src.MaxKi += damagegain src.update() src.update() src << "You regain conciousness!" oview(9) << "[src] regains consiousness!" |
In response to Majinveku
|
|
What part of "don't use usr in procs" don't you understand?
|
In response to Garthor
|
|
Garthor wrote:
What part of "don't use usr in procs" don't you understand? Perhaps the part where view() and oview() have usr as a default argument. Instead of view(9), try oview(src, 9) |
In response to Garthor
|
|
well I tried taking it out but then I just get messed up
|