ID:263331
 
Code:
tag
verb
Explode()
set category = "Exploding Tag"
for(var/obj/ExplodingTag/T in world)
if(T.Gowner==usr)
if(T.tagset)
flick("explode",T)
sleep(5)
del(T)
for(var/mob/M in view(3,T))
var/damage=usr.nin*3
M<<"You have been hit by [usr]'s exploding tag for [damage] damage!"
usr<<"You hit [M] with your exploding tag for [damage] damage!"
M.health-=damage
if(M.health<=0)
M.Death(usr)
for(var/mob/npcs/Bunshin/B in oview(3,T))
flick("smoke2",B)
sleep(4)
del(B)
usr.verbs-= new /mob/tag/verb/Explode
usr.verbs-= new /mob/tag/verb/Explode
usr.verbs-= new /mob/tag/verb/Explode
usr.verbs-= new /mob/tag/verb/Explode
usr.verbs-= new /mob/tag/verb/Explode
usr.verbs-= new /mob/tag/verb/Explode
usr.verbs-= new /mob/tag/verb/Explode


Problem description:

Everything works fine to set it and stuff, but when i put it next to someone and i explode it, i get the damage instead of the mob(s) in the exploding tag area
Because you have it in view(3), thats you and 3 tiles away from you in all directions.
In response to Pyro_dragons (#1)
how can i make this for all persons in that view(3) cuz now its mob in view, so im exploding to when i explode one.
Its supposed to explode in view(3) of that exploding tag.
Ultimate Productions wrote:
Code:
> tag
> verb
> Explode()
> set category = "Exploding Tag"
> for(var/obj/ExplodingTag/T in world)
> if(T.Gowner==usr)
> if(T.tagset)
> flick("explode",T)
> sleep(5)
> for(var/mob/M in view(3,T))
> var/damage=usr.nin*3
> M<<"You have been hit by [usr]'s exploding tag for [damage] damage!"
> usr<<"You hit [M] with your exploding tag for [damage] damage!"
> M.health-=damage
> if(M.health<=0)
> M.Death(usr)
> for(var/mob/npcs/Bunshin/B in oview(3,T))
> flick("smoke2",B)
> sleep(4)
> del(B)
> del(T)
> usr.verbs-= new /mob/tag/verb/Explode
> usr.verbs-= new /mob/tag/verb/Explode
> usr.verbs-= new /mob/tag/verb/Explode
> usr.verbs-= new /mob/tag/verb/Explode
> usr.verbs-= new /mob/tag/verb/Explode
> usr.verbs-= new /mob/tag/verb/Explode
> usr.verbs-= new /mob/tag/verb/Explode
>
>

T was being deleted before u checked its oview o.o
In response to Falacy (#3)
WOTS coding >_>...

why dont you just recode it? The WOTS coding is crapply coded(yea, im saying that my old coding is garbage >_>)
In response to Axerob (#4)
wut the heck is WOTS coding o.O
In response to Falacy (#5)
The exploding tag code snippet which he showed. But anyways, we are digressing and let's not start another stupid flaming topic/post >_>

- GhostAnime
In response to GhostAnime (#6)
ooooo, WOTS is a game? i guess?... thought it was some type of coding sytle or something lol
In response to Falacy (#5)
WOTS = Way Of The Shinobi
In response to Gooseheaded (#8)
Well, what you could do is create an invisble mob on the same location as the exploding tag and use that mobs view. Just be sure to delete the mob before you deal any damage.

PS: Criticize are you want, I'm just kinda...saying stuff. It's 1:45am leave meh alone =p
There are various things wrong with this.

1.) You're deleting T too soon, so the T argument in view(3,T) shouldn't be valid.

2.) It'd be ever s slightly more efficient to calculate the damage before you get into either of those loops, since it simply depends on the user executing the verb.

3.) Don't se [atom] to output an atom's name, instead use [atom.name]. The reason being is that BYOND will go insane if it comes across a key with the first letter lowercase and treat it as an improper noun.

4.) That technically shouldn't even compile, as you have multiple infinite loops. You cnanot remove the verb from within the verb.

5.) You only need to remove the verb once.

6.) You don't use 'new' on a verb to remove it from usr.verbs.