//The Player
mob
var/projectile=/mob //This will be used to determine what they will shoot
icon='player.dmi'
Player
//Test to see if the Fire() proc works
verb
Test()
src.Fire()
//The Shooting
mob
proc
Fire()
world<<"Rawr!"
var/mob/P=src.projectile
new P(src.loc)
P.dir=src.dir
while(src.projectile)
step(P,P.dir)
var/turf/T=P.loc
if(T.density==1)
//Place Damage To Turfs Code here later
del P
world<<"[P] hit [T]!"
break
//If there is a mob in T
for(var/mob/M as mob in T)
if(M==src)
continue
//Place damage to players here
del P
sleep(5)
Problem description:
Whenever I fire, it spawns the projectile P just fine, but it won't let P step. Heres the error it gives:
runtime error: Cannot modify /mob.dir.
proc name: Fire (/mob/proc/Fire)
usr: Dead_Demon (/mob/Player)
src: Dead_Demon (/mob/Player)
call stack:
Dead_Demon (/mob/Player): Fire()
Dead_Demon (/mob/Player): Test()