ID:141458
 
Code:
mob
proc
DeathCheck(mob/M = usr)
if(src.HP <= 0)
if(istype(src.client))
world << "[M] killed [src]"
src.loc = locate(9,76,3)
src.attacked = 0
src.safe = 1
src.dead = 1
src.Flight = 0
src.density = 1
M.kills += 1
var/tps = rand(45,65)
var/amount = rand(2000,6800)
M.tp += tps
M.Money += amount
M << "You have gained [tps] Tps!"
src.deaths += 1
HP = MaxHP
Mana = MaxMana
else
src.attacked = 0
var/tps = rand(10,20)
var/amount = rand(1000,5500)
M.tp += tps
M.Money += amount
M << "You have killed [src]!"
M << "You have gained [tps] Tps!"
del(src)
else
..()
mob
proc
Poisoner()
for(var/mob/M in src.poisoner)
if(M.Damager == 1)
M.HP -= 25
M << "You are hurt by poison."
M:DeathCheck(src)
if(M.dead)
M << "You have been killed by the poison."
M.Damager = 0
M.Poisoner()
else
spawn(40)
M.HP -= 25
M << "You are hurt by poison."
M:DeathCheck(src)
if(M.dead)
M << "You have been killed by the poison."
M.Damager = 0
M.Poisoner()
else
spawn(40)
M.HP -= 25
M << "You are hurt by poison."
M:DeathCheck(src)
if(M.dead)
M << "You have been killed by the poison."
M.Damager = 0
M.Poisoner()
else
spawn(40)
M.HP -= 25
M << "You are hurt by poison."
M:DeathCheck(src)
if(M.dead)
M << "You have been killed by the poison."
M.Damager = 0
M.Poisoner()
else
spawn(40)
M.Damager = 0
M << "You have survived the poison."

obj
Poisonball
icon = 'poisontechniques.dmi'
icon_state = "1"
density = 1
New()
spawn(100)
del src
Bump(mob/A)
if(ismob(A))
var/mob/M = A
if(M == src.Gowner)
del src
return
if(M.safe == 1)
del src
return
if(M.pk == 0)
del src
return
if(M.dead)
del src
return
var/mob/L = src.Gowner
var/damage = round(L.MaxMana * 1.2)
if(ismob(L))
if(damage <= 1)
damage = 1
M.HP -= damage
view(L,8) << "[L] hit [M] with Poison Ball for [damage] damage!"
M.Damager = rand(0,1)
if(M.Damager == 1)
view(L,8) << "[L] has poisoned [M] with Poison Ball!"
M.poisoner.Add(M)
M.Poisoner()
M.DeathCheck(L)
del(src)
else
M.HP -= damage
view(L,8) << "[L] hit [M] with Poison Ball for [damage] damage!"
M.Damager = rand(0,1)
if(M.Damager == 1)
view(L,8) << "[L] has poisoned [M] with Poison Ball!"
M.poisoner.Add(M)
M.Poisoner()
M.DeathCheck(L)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)
ob/Poison/verb
Poison_Ball()
set category = "Fighting"
set name = "Poison Ball"
if(usr.safe)
return
if(usr.Mana <= 49)
usr << "<b>Your mana is too low!"
return
if(usr.Flight)
return
if(usr.resting)
return
if(usr.dead)
usr << "You are dead!"
return
if(usr.pk == 0)
usr << "You are not a Fighter!"
return
if(usr.mana_lock)
src << "You cannot use this Skill right now."
return
if(!usr.firing)
usr.mana_lock = 1
spawn(10) src.mana_lock = 0
usr.Mana -= 50
usr.overlays += poison_charge
view(6) << "[usr]: Poison..."
sleep(8)
view(6) << "[usr]: Ball!"
usr.overlays -= poison_charge
usr.firing = 1
var/K = new/obj/Poisonball(usr.loc)
K:Gowner = usr
K:dir = usr.dir
walk(K,usr.dir)
sleep(30)
usr.firing = 0
mob
var
list
poisoner = list()


Problem description: Whenever you shoot the ball and poison someone and you kill them this shows up:

Inferno741 hit Skydragon792 with Poison Ball for 223 damage!
Inferno741 has poisoned Skydragon792 with Poison Ball!
You are hurt by poison.
Skydragon792 killed Skydragon792
You have gained 52 Tps!
You have been killed by the poison.

I know almost nothing about his code so I showed everything that was relevant to this problem what should happen is something like this:(NOTE: Inferno was on both of those keys and he switched back and forth to figure out relevent data so the You are hurt by poison and You have been killed by the poison are both from SkyDragon I believe)

Inferno741 hit Skydragon792 with Poison Ball for 223 damage!
Inferno741 has poisoned Skydragon792 with Poison Ball!
You are hurt by poison.
Inferno741 killed Skydragon792
You have been killed by the poison.

Other then that I have no relevent data, my friend wouldnt post on the forum because he thinks people will talk back to him(they probably would to) so if your not going to talk back to him and you need more information page his key: Inferno741.
Don't use :, ever.
Is there a difference in the outcomes other than the below line?

"You have gained 52 Tps!"
In response to Spunky_Girl
You shouldnt receive that message unless your killing an NPC however it happens to everything
In response to SadoSoldier
is client a type? I don't think it is, although I could be wrong...
In response to Spunky_Girl
Yeah, /client. Look it up.
In response to Jeff8500
Okay, then I think it should be if(istype(M.client)). Don't you want to check if the thing you're killing has a client, rather than the caller of the proc?
In response to Spunky_Girl
No, because istype(client) makes absolutely no sense. First of all, you aren't offering it a type to check if it is. Second of all, the client var can only ever be a client, so if(client) is all he needs.
In response to Jeff8500
So you couldn't do something like "if(istype(M,/client))"?
In response to Spunky_Girl
Isn't M a mob? That would make no sense, a client is a separate entity.
In response to Jeff8500
So there's 4 types of atoms?

mob
obj
turf
client
In response to Spunky_Girl
Yeah, area, turf, obj, and mob are atoms. Client, as I said, is a separate entity. It has no physical location, etc. It is merely an object tied to mobs.

In BYOND, there are different forms of objects.

Atoms: Already listed above
Datums: include /sound, /icon, etc.
None of the above: /savefile, /list, /world, and /client (these are supposed to be transformed into datums eventually, though I'm curious as to whether this will actually be done anytime soon).
In response to Jeff8500
D'oh! 5* xD Forgot about areas.
In response to Spunky_Girl
No, because clients aren't atoms.
In response to Jeff8500
I just tried if(client) and it still says Inferno741 has killed Inferno741. When Skydragon792 shoots a poison ball at me and it poisons me. =S
In response to Inferno741
Why did you set mob/M = usr ? In this case, usr = src, so whenever you reference usr, you're referencing src.

Take out the " = usr" bit.
mob/proc/DeathCheck(mob/M)
In response to Spunky_Girl
Skydragon792 hit Inferno741 with Poison Ball for 302 damage!
Skydragon792 has poisoned Inferno741 with Poison Ball!
You are hurt by poison.
Inferno741 killed Inferno741
You have gained 65 Tps!
You have been killed by the poison.

no changes =S
In response to Spunky_Girl
You cannot judge whether usr would be equivalent to src in every case, as it depends exactly on how it is called.



Sadosoldier and Sadosoldier's friend, I doubt you will get much help here, as that code is rather big and ugly.
In response to Jeff8500
I said in THIS case, not every case. Read more carefully next time.
In response to Spunky_Girl
He calls death check many times in many different ways in his snippet. Why would you bother to hunt them all down just to tell him, "That makes no sense, because usr is equivalent to M," when "That makes no sense, you don't use usr in a proc" would have been infinitely better?
Page: 1 2