ID:142322
 
Code:
obj
ice
icon = 'Hitsuyaga.dmi'
icon_state = ""
density = 1
layer = 60
New()
spawn(100)
del src
Del()
for(var/obj/icetrail/X in world)
if(X.owner == src)
del X
..()
Move()
..()
var/obj/icetrail/K = new /obj/icetrail
if(src.dir == NORTH)
K.loc = locate(src.x,src.y-1,src.z)
if(src.dir == WEST)
K.loc = locate(src.x+1,src.y,src.z)
if(src.dir == EAST)
K.loc = locate(src.x-1,src.y,src.z)
if(src.dir == SOUTH)
K.loc = locate(src.x,src.y+1,src.z)
K.dir = src.dir
K.owner = src
obj/ice/Bump(mob/M)
if(ismob(M) && M != src.Gowner && !M.ispedal) // Qualify instead of reject.
var/mob/O = src.Gowner
var/damage = round(O.Rei * 2.2 - M.Rei / 2)
if(damage >= 1)
M.Health -= damage
view(O,8) << "<b><font color = red>[O] hit [M] with his Ice Dragon for [damage] damage!"
if(M.Health<=0)
M.Death()

del src

------deathcheck---------
proc
Death(mob/M as mob)
if(src.inko==1)
return
if(src.enemy&&src.Health <= 0)
var/mob/L = src
var/mob/A = usr
L << "<b>[A] has defeated a [L]! You gained [src.expgive] experience!"
A.Exp+=L.expgive
del(L)

if(src.client&&src.Health<=0)
src<<"You got knocked out"
src.overlays+='ko.dmi'
src.move=0
src.Spirit+=40
src.inko=1
sleep(100)
src.inko=0
src.overlays-='ko.dmi'
src.Health=src.Mhealth
src.move=1
src<<"You gained concious" //death proc with M as usr or as the creature you killed
if(src.client&&src.Spirit>=99)
src<<"Good job, You got owned"
src.loc = locate(32,24,4) //sends M to 1,1,1 on map
src.Spirit=0
src.Health = src.Mhealth
src.Rei=src.Mrei


Problem description:

Id like to warn you before this, that it has nothing to do with Death proc because other techniques i have that kill the monster/human work perfectly. So it has to do with the beam and how I am calling the Death proc, any help?
Shouldn't Death() require an arg, 2nd to bottom line before death() proc, before the del()
Agrey123 wrote:
Id like to warn you before this, that it has nothing to do with Death proc because other techniques i have that kill the monster/human work perfectly.

There is no need to "warn" anyone, neither does the fact a proc or a block of code happens to work in a number of cases mean it is done properly. In fact, it is not, and considering it uses usr there is no telling when it will break (well, so to speak, since it'd clearly likely break when called by Bump() involving an NPC movement, etc).

Anyway, looks like you have a misuse of Bump() and didn't look it up before using it. Bump() is called on the object that did the moving, the actual bump, therefore your override will only run if an /obj/ice tries to move and bumps into something. There is also a plethora of more issues in your code.
In response to Kaioken
The most blaring being the inconsistent uses of different kinds of indentation. Single- and double-spaced indentation should never be used. As soon as I saw that, I refused to even glance at it.
In response to Giantpandaman
As you can see, he has defined an argument, but brilliantly left it unused, in favor of using usr in proc. Ugh. Probably because he missed altering it after copying and piecing together his code, but Ugh nonetheless.
In response to Kaioken
instead of making fun of my code, how about helping me. I belive i am in code problems, not code jokes. by the way u tell me not to use usr alot i know not too, but i had no choice , anyways kioken u told me once a way to not use usr and define it as something else or something i tired that but i still couldnt get it. iv been at this for like a week now, u guys have noticed since i kept posting these. if you want me to stop posting these posts about beam, why dont u just help me for once, any of u. please i really need this , its slowing me down , can any of u please help me.
In response to Agrey123
Uh. I'll demonstrate "making fun" for you. Even of a 2 sentence post.

Agrey123 wrote:
instead of making fun of my code,

I wasn't making fun of it. It isn't a funny sight.

how about helping me.

I already have, or attempted to at least. How about reading the topic before complaining, or replying for that matter.

I belive i am in code problems, not code jokes.

We were clearly discussing your Code Problems. At this point, you could replace "We" with whoever you want that participated at this topic: me, Giantpandaman and/or Popisfizzy.

thanks

No problem, come again.

EDIT:
Oh, you've edited your post. I shall respond to that as well or I will be rude for ignoring you.

by the way u tell me not to use usr alot i know not too, but i had no choice

Wrong. You really need to read the links in this page, but considering I've already linked you to an article specifically on usr abuse this is probably all futile; you've ignored it.

, anyways kioken u told me once a way to not use usr and define it as something else or something i tired that but i still couldnt get it.

Read the topic. As posters have said you actually happen to have an argument defined in the respective proc (Death()), which should be used instead of usr. The fact you use usr instead is a giveaway that you copied code you don't understand. If you still couldn't get it even after it being explained by me then, you likely need even MORE to refer to the above linked page.

iv been at this for like a week now, u guys have noticed since i kept posting these.

Correct. We've noticed. That doesn't give us any more of a desire to spoon-feed you code or be cattle of your help vampirism.

if you want me to stop posting these posts about beam, why dont u just help me for once, any of u. please i really need this , its slowing me down , can any of u please help me.

We don't need you to stop posting. We can ignore your posts just fine if we want to, we're NOT employed or otherwise forced to help you. That is done voluntarily. If you go overboard with topics or something, that's none of my business to do something about either, I'm not part of the forum staff.
Put simply, we have no desire to program people's games for them, even more so when they have no apparent desire to make an effort to learn to do it themselves.
In response to Kaioken
It would be fairly fun to have a code jokes forum.
So, a datum and and a vector walk into a bar......
In response to Giantpandaman
Perhaps we should ask a BYOND Member to start a guild. It has potential.
You need to send O to the Death() proc (M.Death(O)). You'll also want to change usr to M inside of your Death() proc (you can get rid of the "as mob" part in the parameters by the way, "as" is for player input).

This will break your other attacks if you haven't been sending the attacker to Death() in them, but if that's the case they were broken before. Just double-check and make sure you're always sending an argument to Death() for the mob doing the killing.