obj
ToushirouShikai
Head
icon='Daiguren Hyourinmaru.dmi'
icon_state = "shikai_head"
var/trails = 0
Bump(A)
if(ismob(A))
if(src.Owner==A)
return
else
var/mob/O = src.Owner
var/mob/M = A
var/dmg = (O.rei/3 - M.rei/3 + 40)
if(dmg<=0)
dmg = 0
var/mob/P = M
P.health -= dmg
for(var/obj/D in src.trails)
del (D)
del src
if(M.health<=0)
M.Death(O)
Move()
var/turf/old_loc = src.loc
. = ..()
if(!.) return
var/obj/O = new(old_loc)
O.name = "trail"
O.icon_state="shikai_tail"
O.icon = 'Daiguren Hyourinmaru.dmi'
O.dir = src.dir
src.trails += O
Problem description:
it kinda works the problem is it goes away but i dont want to
This part is wrong. del(src) should be at the VERY end of the proc. Deleting src will cause the proc to stop and, therefore, nothing else will be processed, including deleting parts of the tail after the first one found, and causing M to die.
var/trails = 0
This is also wrong. It should be:
var/list/trails = list()