ID:1890892
 
(See the best response by Ter13.)
Code:
mob
proc
Poison(var/who)
spawn(1)
var/time=0
time+=src.poisoned
time+=src.strongpoisoned
time+=src.sasoripoisoned
var/mob/M = who
if(!M)
M=src
var/T=time
if(T<0)
T=1
if(T==0||T==null)
T=1
if(src.poisonrun==0)
while(src&&T>=1)
src.poisonrun=1
var/booster=1
if(src.poisoned>=1)
booster+=0.5
src.poisoned-=1
if(src.poisoned>=22)
src.poisoned=22
if(src.strongpoisoned>=1)
booster+=1.5
src.strongpoisoned-=1
if(src.strongpoisoned>=22);
src.strongpoisoned=22
if(src.sasoripoisoned>=1)
booster+=2
src.sasoripoisoned-=1
if(src.sasoripoisoned>=22)
src.sasoripoisoned=22
if(src.Clan=="Human Puppet"||src.Clan=="Puppet"||src.inimmortal)
booster=0
src.poisoned=0
src.strongpoisoned=0
src.sasoripoisoned=0
T=0
src.health-=(src.maxhealth*0.005)*booster
src.deathcheck(M)
if(src.incircle)
if(src.someoneinhidanlist)
for(var/mob/U in world)
if(src.hidanlist == U.name)
if(!U.inimmortal)
U.health-=(src.maxhealth*0.005)*booster
src.deathcheck(U)
T=src.poisoned+src.strongpoisoned+src.sasoripoisoned
sleep(rand(15,20))
src.poisoned=0
src.strongpoisoned=0
src.sasoripoisoned=0
src.poisonrun=0


here is the verb for the poison cloud
obj/PoisonCloud
layer=MOB_LAYER+3
icon = 'PBall.dmi'
icon_state = "cloud"
New()
..()
spawn()
while(src)
sleep(rand(5,15))
for(var/mob/M in oview(0,src))
if(M.InKawarimi<=0)
var/mob/O = src.owner
if(O)
M.poisoned+=8
spawn(2)
if(M)
M.Poison(O)
else
M.Kawarimi_Teleport()
spawn(100)
del(src)

Problem description: It won't give the person that poisoned them with the cloud a kill for some reason


obj
Pball
density=1
icon = 'PBall.dmi'
Bump(A)
if(ismob(A))
var/mob/M = A
var/mob/O = src.owner
var/obj/PoisonCloud/Z = new/obj/PoisonCloud (locate(M.x,M.y,M.z))
Z.owner = O
var/obj/PoisonCloud/Z1 = new/obj/PoisonCloudleft (locate(M.x-1,M.y,M.z))
Z1.owner = O
var/obj/PoisonCloud/Z2 = new/obj/PoisonCloudright (locate(M.x+1,M.y,M.z))
Z2.owner = O
var/obj/PoisonCloud/Z3 = new/obj/PoisonClouddown (locate(M.x,M.y-1,M.z))
Z3.owner = O
var/obj/PoisonCloud/Z4 = new/obj/PoisonCloudup (locate(M.x,M.y+1,M.z))
Z4.owner = O
var/obj/PoisonCloud/Z5 = new/obj/PoisonCloudleftup (locate(M.x-1,M.y+1,M.z))
Z5.owner = O
var/obj/PoisonCloud/Z6 = new/obj/PoisonCloudrightup (locate(M.x+1,M.y+1,M.z))
Z6.owner = O
var/obj/PoisonCloud/Z7 = new/obj/PoisonCloudleftdown (locate(M.x-1,M.y-1,M.z))
Z7.owner = O
var/obj/PoisonCloud/Z8 = new/obj/PoisonCloudrightdown (locate(M.x+1,M.y-1,M.z))
Z8.owner = O
if(M.InKawarimi<=0)
M.poisoned+=15
M.Poison(O)
else
M.Kawarimi_Teleport()
sleep(2)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)
New()
spawn(27)
del(src)


this is the actual verb that goes with it all

mob/Puppets
verb
PBall()
set category="Puppetry"
set name="Posion Smoke Bomb"
for(var/mob/Puppets/Puppet/E in world)
if(E.owner==usr)
if(E.fired)
usr<<"You just used this, wait 10 seconds..."
else
if(usr.petout)
E.fired=1
var/obj/Pball/H = new()
H.loc=E.loc
H.dir=E.dir
H.owner=usr
walk(H,H.dir)
sleep(20)
E.fired=0

How does your deathcheck-procedure look like?
Sleep works in deciseconds.

You want sleep(100) for 10 seconds of waiting.
deathcheck is 1800 lines of code that I'm sure you probably dont wanna go through really, but you're saying that's probably where the issue is? this is where the kills come in though

            if(src.client)
if(src.client.address!=M.client.address)
if(M.iskage)
src.kagekills ++
else
src.kills ++
src<<"<small>You have killed [M]!</small>"
M.deaths ++
src.exp+=M.exp

I was under the impression that src was who was doing the poisoning and M was who was being poisoned.
When you're calling deathcheck it should be something like this.

obj
var
owner

poison

New()
//your code
M.poison(owner) //owner will become M in the poison proc.
mob
verb
poison_player()
//this is an examp
var/obj/poison/H = new()
H.owner = usr

proc
poison(var/M)
//code
src.DeathCheck(M) //M in deathcheck will become the attacker. This is because src aka the one being poisoned is calling the proc.


DeathCheck(var/attacker)
//code
attacker.kills++ //attacker before was M in the poison proc
src.deaths++


I believe this to be correct anyways. I've wrutten this quickly before I go out.
Why is Deathcheck 1800 lines? It shouldn't be that big.
well...its more like 1500, but it's because there's a lof of if this, if that, if this clan, if this village, and whatnot
Best response
well...its more like 1500, but it's because there's a lof of if this, if that, if this clan, if this village, and whatnot

I can promise you that 1500 lines for a proc is too long.

I wrote a runtime DM parser that was 1200 lines total. If the entire core of the language you are working in can be duplicated almost feature-for-feature in less lines than a deathcheck proc, you are probably doing something really bad.
In response to Ter13
Ter13 wrote:
well...its more like 1500, but it's because there's a lof of if this, if that, if this clan, if this village, and whatnot

I can promise you that 1500 lines for a proc is too long.

I wrote a runtime DM parser that was 1200 lines total. If the entire core of the language you are working in can be duplicated almost feature-for-feature in less lines than a deathcheck proc, you are probably doing something really bad.

This quote though.
I don't think I've ever written a system that's required 1800 lines of anything, ever...
The closest thing I know is the SS13 character setup, which is 1730 lines. And that's all HTML and Topic stuff.