Mage
Ice
verb
Ice_Trail()
if(usr.Ice_Trail_On==0)
if(usr.Mana>100)
var/obj/A = new/obj/Mage/Ice_Magic/Trail/First_Trail(usr.loc)
var/obj/B = new/obj/Mage/Ice_Magic/Trail/Second_Trail(usr.loc)
var/obj/C = new/obj/Mage/Ice_Magic/Trail/First_Trail(usr.loc)
var/obj/D = new/obj/Mage/Ice_Magic/Trail/Second_Trail(usr.loc)
walk_to(A,usr,0,1)
walk_to(B,A,1,1)
walk_to(C,B,1,1)
walk_to(D,C,1,1)
usr.Ice_Trail_On=1
usr.Chikara_Drain()
else
for(var/obj/Mage/Ice_Magic/Trail/First_Trail/A in usr.loc)
del A
for(var/obj/Mage/Ice_Magic/Trail/Second_Trail/B)
del B
for(var/obj/Mage/Ice_Magic/Trail/First_Trail/C)
del C
for(var/obj/Mage/Ice_Magic/Trail/Second_Trail/D)
del D
usr.Ice_Trail_On=0
Problem description:I am trying to make the rest of the ice trail delete both when you click the verb again and when you run out of mana. It only deletes the first one, but when it deletes the others it deletes all others. What should I do?
What you'll want to do here is store the pieces as a variable contained by the mob, or just create one object and have it spawn the trails at it moves and contain the list of trail objects in that parent. Either way, here's an example.