ID:167985
 
how do i make somthing that deflects a projectile like this
obj/FireBolt
var/obj/S=new/obj/FB
S.loc=usr.loc
walk(S,usr.dir,1)
sleep(2)
usr.icon_state = "fire"
sleep(18)
del S
return

ignore the errors jp i didnt copy and apste it so there you should get the idea from this
That shouldn't even compile.
mob/var/Deflectors
mob/verb/Cast_Fire_Bolt()
var/obj/FireBolt/S = new /obj/FireBolt(usr.loc)
walk(S,usr.dir)
obj/FireBolt/Bump(mob/M)
if(istype(M,/mob/))
if(M.Deflectors)//this is where you check for the shield
view() << "[M] deflected the shot!"
else
view() << "[M] is hit by the shot!"
//add in the damage and icon stuff here.
del(src)


That works, it you want to use walk, but it you want to use missile or something, it's totally different.
In response to Bobthehobo
That won't compile, either.
In response to Jp
True, he forgot Bump().
In response to Mysame
I knew I was missing something , lol...
In response to Jp
That also won't work. =p
In response to Hell Ramen
He also forgot his output o.o.
In response to Mysame
I'm falling apart, lol. Maybe I should check it in Dream Maker first...