ID:272350
 
ok im trying to make an attak called bladesofblood but i have no idea where to start i typed in projectile in the resources box but no good examples... i want to make it where when u shoot it it hits the person and takes away health and i want the damage to be based of of how high the user str is if someone could help me with that i would appreciate it


and before you go saying that i ripped a game or something here is the link it is up now so you can feel free to walk around also im letting u get on this becuase i dont want you to say im a help vampire...or what ever you want to call it but yeh check it out and i need help with the attack thing http://www.byond.com/games/SesshomaruXX/InuyashaBloodShed
Programming, like most things in life, involves learning the tools of the trades (per say) and knowing how to apply them. If you do not know, you learn.

Projectiles are movable atoms (/atom/movable, though most people use /obj, which is a branch in that path, for projectiles). When created, where New() is called, most people make it start walk()ing. When the projectile hits something, it calls Bump() on itself (not on the object it hit) - which almost always have a 'del src' at the end, as it is no longer needed.

For Bump(argument), the argument is what was src (the projectile) bumped into. Note that you need to check the argument for what you want. If you put (mob/M) in the parenthesis, it will NOT filter the object (meaning it will not check if it is a /mob) so you need to use procedures such as ismob() and istype() before doing the intended action(s).

So now you know that, use your head. I gave you a couple of hints:
- The type of path you should place your projectile under
- What procedures to use and
- What you must need, at the very least, in the said proecures.
In response to GhostAnime
proc/Projectile(mob/M,obj/O,distance,dmg,delay,Homing,Area,mob/H,duration,radious)
if(Homing&&H)
while(distance>0&&O&&M&&H)
var/mob/target
O.dir=get_dir(O,H)
for(var/mob/A in get_step(O,O.dir))
if(A&&A!=M&&ismob(A))
target=A
step_towards(O,H)
sleep(delay)
distance--
if(target) return target//
if(M&&O&&H)
return 1
else if(!H&&M&&O)
Homing=0
Projectile(M,O,distance,dmg,delay,0,0,0,0,0)
else if(Area)//If an area attack
while(duration>0&&O&&M)
duration-=1
var/list/mob/targets=list()
for(var/mob/S in oview(radious,O))
if(S!=M)
targets+=S//sets mobs in the target list to attack
sleep(10)
if(targets) return targets
else
while(distance>0&&O&&M)
var/mob/target
for(var/mob/A in get_step(O,O.dir))
if(A&&A!=M&&ismob(A))
target=A
step(O,O.dir)
sleep(delay)
distance--
if(target) return target
if(M&&O)
return 1
mob/verb
StraightAttack()
var/obj/Attack/A=new(src.loc)
A.dir=src.dir
var/dmg=10
var/mob/M=Projectile(src,A,5,dmg,2,0,0,0,0,0)
if(M==1)

del(A)
else if(M)//If hit
world<<"[src.name] hit [M.name] for [dmg]!"
del(A)


obj
Attack
icon='obj.dmi'
mob
Human
icon='mob.dmi'
density=1
New()
walk_rand(src,8)
Human2
icon='mob.dmi'
density=1
New()
walk_rand(src,8)
Login()
src.icon='Player.dmi'
src.loc=locate(1,1,1)
turf
grass
icon='Grass.dmi'<dm>

thats what i have so far but when it hits the player it does 10 damage i know becuase i put that in but it hits 10 damage regarless on how high my str is i would like the damage to be based of the str how would i go about that??
In response to Sesshomaru XX
Where do you define the str var for each mob?

When you do so, that can be added/multiplied to the base damage (10 as you used here) to increase it.