ID:141547
 
Code:
mob
proc
Logincrap()
usr.underlays-=/obj/bottomright1
usr.underlays-=/obj/bottomleft1
usr.underlays-=/obj/bottomaa
usr.underlays-=/obj/topright1
usr.overlays-=/obj/bottomright
usr.overlays-=/obj/bottomleft
usr.overlays-=/obj/topright
usr.overlays-=/obj/topleft

mob
proc
SixtyFourPalms(mob/M in oview(2))
src.Pk_Check()
if(usr.Frozen)
return
if(usr.pk == 0)
return
if(!usr.inbyakugon)
usr<<"<font size = 1> You must have byakugon on"
return
if(usr.Chakra <= 350)
usr<<"<font size = 1>You need more Chakra"
return
if(M)
M.Frozen=1
usr.Frozen=1
usr.underlays+=/obj/bottomright1
usr.underlays+=/obj/bottomleft1
usr.underlays+=/obj/bottomaa
usr.underlays+=/obj/topright1
var/damage1 = rand(usr.Power / 3)// change these to whatever u want them to hit for each damage strike.. example .. u might want the last damage one to be strongest since its 64 strikes ,right?
var/damage = rand(usr.Power / 3)
var/damage2 = rand(usr.Power / 3)


view()<<"<font size = 1>Hyuuga Style! : Gentle Fist: 64 palms"
view()<<"<font size = 1>[usr]:2 strikes!"
view()<<"<font size = 1>[usr] hit [M] for [damage] damage!"
M.Hp -= damage
M.Death(usr)
sleep(15)

view()<<"<font size = 1>[usr]:4 strikes!"
M.Hp -= damage1
view()<<"<font size = 1>[usr] hit [M] for [damage] damage!"
M.Death(usr)
sleep(15)

view()<<"<font size = 1>[usr]:8 strikes!"
M.Hp -= damage2
view()<<"<font size = 1>[usr] hit [M] for [damage] damage!"
M.Death(usr)
sleep(15)

view()<<"<font size = 1>[usr]:16 strikes!"
M.Hp -= damage2
view()<<"<font size = 1>[usr] hit [M] for [damage] damage!"
M.Death(usr)
sleep(15)

view()<<"<font size = 1>[usr]:32 strikes!"
M.Hp -= damage2
view()<<"<font size = 1>[usr] hit [M] for [damage] damage!"
M.Death(usr)
sleep(15)

view()<<"<font size = 1>[usr]:64 strikes!"
M.Hp -= damage2
view()<<"<font size = 1>[usr] hit [M] for [damage] damage!"
M.Death(usr)
M.Frozen=0
usr.Frozen=0

usr.underlays-=/obj/bottomaa
usr.underlays-=/obj/bottomright1
usr.underlays-=/obj/topright1
usr.underlays-=/obj/bottomleft1


Problem description:


The problem is that everytime i am using the technique and i log off (i got auto save so it auto saves) then when i log back in the underlays are still there. I tried putting them in my proc which i put under my login proc. but it still wont go away.. i checked everything else in the logincrap works, expect for it, help plz!
When you relog, it fuses your overlays with your icon. The best way around this is to keep track of your overlays in a separate list, and delete them on log out. This is a common topic, search.
Nice ripped coding by the way :)
In response to Jeff8500
thats wat i did, i made a proc which carries all my overlays and vars being set to 0 or being deleted, but still, the vars are reset some icon overlays are reset, its just these specific ones that dont
You might be calling Logincrap() before Read(). You should do the inverse.

Please, minimize the usage of usr in porcs.
In response to Jemai1
Correction... NEVER use usr in procs :)
In response to Jemai1
Jemai1 wrote:
Please, minimize the usage of usr in porcs.

Or just don't eat porc. =P

Mizukouken Ketsu wrote:
Correction... NEVER use usr in procs :)

This isn't strictly accurate because usr is generally safer (though src is still preferable when applicable) in client procs, and a must in mouse procs. =P
Also, similarly to things like goto, if you know what you're doing when using it, usr-in-proc might be of use some time. Though even then it could very well be unsafe to rely upon, but whatever. :D
In response to Kaioken
Kaioken wrote:
Jemai1 wrote:
Please, minimize the usage of usr in porcs.

Or just don't eat porc. =P

Oh, yea.. XD