obj
Ybeam
icon = 'Yoton Yokai No Jutsu.dmi'
icon_state = "head"
pixel_x = -32
pixel_y = -32
layer = 100
density = 0
Bump(A)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
New()
del(src)
Move()
for(var/mob/M in src.loc)
var/damage = 100
M.health -= damage
world <<"[M] got hit by [usr]'s Yoton Yokai No Jutsu for [damage] damage!"
var/K = new/obj/Tail1(src.loc)
K:dir = src.dir
..()
Problem description:
The 'text' appears as
The mob got hit by 0's Yoton Yokai No Jutsu for 100 damage!
Instead of
The mob got hit by (Name)'s Yoton Yokai No Jutsu for 100 damage!
How do I fix it :(
For your istype(A,/turf/) and istype(A,/obj/) calls, you can just use the built-in procedures isturf(A) and isobj(A).
Secondly, you should never call New() directly as you're doing in Bump(), though I'm not even sure what you're trying to accomplish in the first place with that.
On the subject of Bump(): It will never be called, because your projectile isn't dense. Bump() is only called if the source object is dense and it runs into another dense object.
usr is not valid in obj.Move(), which is why it is saying "0" instead of a name. If you want to tie an obj to a player, you'll need to create a variable that stores a reference to the person that fired the projectile.
Move is a bit of a weird choice to handle if the projectile has "stepped on" a player, as Crossed() will do the same thing with a bit more finesse.
Finally, you don't need to use the : operator as you're doing there. Simply doing var/obj/Tail1/Tail1 = new(src.loc); Tail1.dir = src.dir would suffice.