ID:167559
 
Hi. my friend and i are working on a bleach type game and im having trouble constructing one of the moves in the style of doubleclicking and launching an attack. but the problem is that we cant get it to exactly hurt anything when we launch it. we want it to make the missle mark if it hits the mob to deal damage. not the easy way around with if u just double click on them they get hurt. i keep having problems with marking what as what for mobs and objs for when i use one. it wont recognize the mobs health (m.pp) heres the portion that i think needs the work. if anybody has any suggestions.

mob
obj
SZ
icon = 'SZpetals.dmi'
icon_state = " "
density = 1





var/spcost =1000
var/spldmg


client/DblClick(O as obj)
if(usr.szshikai == 1)
usr.flash = 0
if(usr.sp > spcost)
var/spcost = round(1000/(1+(usr.shikaimastery)))
var/spldmg = round(usr.reiatsu*(1+(usr.shikaimastery))*(1+(usr.zanjutsu)))
usr.sp -= spcost
missile(new/mob/obj/SZ, src, O)
if(/mob/obj/SZ || M as mob)
M.pp -= spldmg



i appreciate all the help any of you are willing to give if u can solve this problem, i dont have much access to many good scources so im not sure what to do about how to work this perfectly. thanks
mob
density = 1
var
hp = 10
verb
demo_projectile()
var/obj/projectile/A = new/obj/projectile
A.skillname = "Demo attack"
A.impactedmg = 1
A.firedrange = 5
A.loc = locate(src.x,src.y,src.z)
A.dir = src.dir
A.owner = src
spawn(1) A.moveit()

obj
projectile // check the spelling ^_^
density = 1
var
impactedmg = 0 // the damage done
skillname = ""
firedrange = 0 // how many steps it has left
mob
owner = null
proc
moveit()
step(src,src.dir)
firedrange--
if(firedrange <= 0)
del(src)
Bump(atom/P)
if(owner)
if(P)
if(istype(P,/mob))
var/mob/R = P
R.hp -= impactedmg
R << "you where hit by [skillname] fired by [owner.name]"
owner << "your [skillname] hit [R.name]"
// ((( Death check on R here )))
del(src) // remove the attack
In response to Zmadpeter
Zmadpeter wrote:
> mob
> density = 1
> var
> hp = 10
> verb
> demo_projectile()
> var/obj/projectile/A = new/obj/projectile
> A.skillname = "Demo attack"
> A.impactedmg = 1
> A.firedrange = 5
> A.loc = locate(src.x,src.y,src.z)
> A.dir = src.dir
> A.owner = src
> spawn(1) A.moveit()
>
> obj
> projectile // check the spelling ^_^
> density = 1
> var
> impactedmg = 0 // the damage done
> skillname = ""
> firedrange = 0 // how many steps it has left
> mob
> owner = null
> proc
> moveit()
> step(src,src.dir)
> firedrange--
> if(firedrange <= 0)
> del(src)
> Bump(atom/P)
> if(owner)
> if(P)
> if(istype(P,/mob))
> var/mob/R = P
> R.hp -= impactedmg
> R << "you where hit by [skillname] fired by [owner.name]"
> owner << "your [skillname] hit [R.name]"
> // ((( Death check on R here )))
> del(src) // remove the attack
>





this is good and all. but how would i fix it to activate on clicking? =o