obj/Skills
icon = 'Skills.dmi'
density = 1
var
delay = 1
length=12
dmg=2
splash
mob/player/owner
New(_loc,mob/_owner)
if(_owner)
src.dir = _owner.dir
if(usr.Weapontype == "Bow")
flick("arrow",usr)
else
flick("blast",usr)
if(!src.loc) src.loc = get_step(usr,usr.loc)
src.owner = _owner
Move()
src.length--
if(!src.length) del src
return ..()
Bump(atom/O)
if(ismob(O) && src.owner)
var/mob/M = O
var/damage = round(rand(src.owner.Rei/O:Rei*7))+src.owner.Rei/20
if(damage <= 0)
damage = 1
O:Hp-=damage
s_damage(O, damage, "#FFFAFA")
O:Bars(O)
if(prob(50))
new/obj/Crater(O.loc)
if(damage <= 0)
damage = 1
if(src.owner.flash ==1)
switch(rand(1,10))
if(1)
src.loc=locate(x+1,y+1,z)
if(3)
src.loc=locate(x-1,y-1,z)
if(4)
src.loc=locate(x+1,y,z)
if(5)
src.loc=locate(x,y+1,z)
if(6)
src.loc=locate(x-1,y,z)
if(7)
src.loc=locate(x+1,y-1,z)
if(10)
src.loc=locate(x-1,y+1,z)
if(O:client)
O:UpDateHp()
O:Attacked(src.owner)
if(O:Hp <= 0)
M.Death(src.owner)
src.owner.Level_up()
else if(isobj(O))
new/obj/Effects/Smoke(O.loc)
if(prob(30))
new/obj/Smoke(O.loc)
Problem description:
the projectile starts on the same tile as mob and it is slow
i want the projectile to start 1 tile in front of the mob and also to be faster and also deletes at the end the the users screen
if(!src.loc) src.loc = get_step(usr,usr.loc)
You are using get_step() wrong here. Look it up in the reference. Also, you need to not be using usr in procs, you already have a perfectly serviceable _owner variable here. Also, the first argument to the new() directive (and also therefore the first argument to New()), if it's an atom, will be the location of the newly created object, so src.loc will only be null if you pass null or no argument (or an invalid argument, like a text string) to new()
As for the movement speed, that's clearly handled elsewhere, but it should literally be a matter of changing a single number.