Aside from the obj problem, my projectiles system is on the fritz. My verb/shoot() will produce a laser, and walk it in the user's direction, and even time out and del itself after a sleep command or bumping into any atom. The thing that irks me is that even though it recognizes that it has hit something, It fails to cause damage. Instead of defining the damage within the laser obj I called a proc that is the same thing as a normal attack.
Here is the snippet:
obj
projectiles
laser1
name = "laser"
icon = 'lasers.dmi'
icon_state = "laser1"
density = 1
Bump(atom/O)
if (ismob(O))
O:LaserBurn()//Damage causing proc
del (src)
else
del (src)
weapons
taser
name = "low charge taser"
icon_state = "taser"
var/Charge = 7 // sets usr.Attack to 7 when equiped
verbs
verb/shoot()
if(usr.icon_state == "male")
flick("tasershootm",usr)
else
flick("tasershootf",usr)
sleep(3)
var/obj/projectiles/laser1/laser1 = new /obj/projectiles/laser1(usr.loc) // 2nd half of above
walk(laser1,usr.dir)
sleep(12)
del laser1
proc/
LaserBurn()
src.Health -= 7
usr << "You shot [src] for 7 damage!"
view << "[usr] shot [src] for 7 damage!"
src.MonsterDeathCheck
mob/proc/MonsterDeathCheck()
if (src.Health <= 0)
usr.Exp += src:KillExp
for(var/obj/expbar/E in usr.client.screen)
var
si = usr.Exp
si = text2num(E.icon_state)//Disregard, for status bar
si += src:KillExp
E.icon_state = num2text(si)
usr.LvlCheck()
src.Respawn1()
view() << "[src] has died!"
del (src)
else
sleep(10)
walk(src,usr.loc)//this also will not work
if(usr.Health > 0)
src.MonsterAttack()
Sorry about length, I'm sure I stuck some useless info in there that is messing it up, but I haven't been able to catch it. Anyone have time to tackle this one?
-Thanks,
Vercingatorix
Copyright © 2024 BYOND Software.
All rights reserved.
if(ismob(A))
Damage(A)
del(src)
del(src)
mob/proc/Damage(mob/M)
var/O = 5
M.health -= O
DeathCheck(M)
mob/proc/DeathCheck(mob/M)
if(M.client)
if(M.health <= 0)
M.Move(locate(1,1,1))
M.health = M.maxhealth
else
return
else
del(M)
That is an approach I would do. Fit it in with your code and tell me if it works.