ID:141338
 
Code:
obj
Swarm
icon = 'Aburame insect swarm jutsu.dmi'
icon_state = "trail"
density = 1
Bump(A)
icon_state="Insect swarm"
if(ismob(A))
var/mob/M = A
var/damage = round(usr.Ninjutsu*8/6)
if(damage >= 1)
M.hp -= damage
view(M) << "[M] was hit by Insect Swarm for [damage] damage!!"
var/mob/O
// if(M.hp<=0)
// M.Death(O)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)

mob
verb
Swarm() // Verb used for firing the beam
set category = "Jutsus"
set name = "Insect Swarm"
if(usr.Chakra <= 150&&usr.hp >= 200)
usr<<"You dont have enough power!"
return
if(usr.froze)
usr<<"Your frozen"
return
else // If the firing var isn't 1...
if(usr.hp >= 100)
usr.hp -= 10
// if(usr.hp<=0)
// usr.Death(usr)
if(usr.Chakra<=0)
usr.Chakra = 0
usr.froze = 1
var/obj/Swarm/K = new /obj/Swarm
K.loc = usr.loc
K.dir = usr.dir
K.name="[usr]"
walk(K,K.dir)
sleep(300)
usr.froze = 0
del(K)



obj/Move()
..()
sleep(5)


Problem description The Obj Appears But and now moves but wont deal damage

In the future, don't just post your problem in the topic line. There's a "Problem description" section of the post template for a reason (you put in a detailed description of what you're trying to do and what's going wrong, if you want any help).

Jub369 wrote:
Code:
> obj/Move()
> sleep(4)
>


In this single case, I ignored the lack of a problem description and decided to help some anyway. I didn't read any of your code besides these two lines, and I'll tell you this: If you don't call ..() in your Move() proc, your object won't move. When your object tries to move, all you're doing is calling sleep(4), but never anything involving actual movement.
In response to Kuraudo
Kuraudo wrote:
In the future, don't just post your problem in the topic line. There's a "Problem description" section of the post template for a reason (you put in a detailed description of what you're trying to do and what's going wrong, if you want any help).

Jub369 wrote:
Code:
> > obj/Move()
> > sleep(4)
> >

In this single case, I ignored the lack of a problem description and decided to help some anyway. I didn't read any of your code besides these two lines, and I'll tell you this: If you don't call ..() in your Move() proc, your object won't move. When your object tries to move, all you're doing is calling sleep(4), but never anything involving actual movement.












So what should i tlook like then

obj/Move()
..()
sleep(5)
Bump
In response to Jub369
I believe the problem is the usr.ninjitsu....there would be no user because its a new object. Define the dmg for K at the bottom...
In response to Pirion
Pirion wrote:
I believe the problem is the usr.ninjitsu....there would be no user because its a new object. Define the dmg for K at the bottom...



ok could you show me because i lost
In response to Jub369
obj
Swarm
var/damage

mob
verb
Swarm() // Verb used for firing the beam
set category = "Jutsus"
set name = "Insect Swarm"
if(usr.Chakra <= 150&&usr.hp >= 200)
usr<<"You dont have enough power!"
return
if(usr.froze)
usr<<"Your frozen"
return
else // If the firing var isn't 1...
if(usr.hp >= 100)
usr.hp -= 10
// if(usr.hp<=0)
// usr.Death(usr)
if(usr.Chakra<=0)
usr.Chakra = 0
usr.froze = 1
var/obj/Swarm/K = new /obj/Swarm
K.loc = usr.loc
K.dir = usr.dir
K.damage = 100000000 //Big damage Delt!
K.name="[usr]"
walk(K,K.dir)
sleep(300)
usr.froze = 0
del(K) //you already delete this dont you ?
In response to Pirion
1.Problem When It Bumps Into Them It dont Deal Damage It Just goes therw them
In response to Jub369
Is the density still set to 1?
In response to Pirion
yes this what it look like
when we use it it does no dmage



both swarm ad pepole are dens


You really shouldn't look at ripped programming as a "DM Bible" >_> What you have there is really terrible. You could shorten that Bump() proc by a bunch, and that verb by a bunch by overwriting the built-in New() proc.

obj/var/owner
obj/Swarm
New(loc,d,o) //loc = location, d = direction, o = owner
..()
owner = o
walk(src,d,5) //utilize the walk() proc's third argument please...
spawn(300) //30 seconds later...
del src //delete itself
Bump(atom/a)
if(ismob(a))
var/mob/m = a
var/mob/o = owner //type cast the obj's owner var
var/dmg = round(o.ninjutsu*8/6) //usr = null >_>
if(dmg >= 1) m.hp -= dmg
if(m.hp <= 0) m.Death(o) //that's the kind of check that should happen anyway, yes?
del src //delete itself when bumping into ANYTHING

mob/verb/Swarm()
new/obj/Swarm(loc,src.dir,src)
/*
Call obj/Swarm's New() proc with the src's location as 1st arg, src's direction as the 2nd, and src itself as the 3rd. The rest will be handled by the New() proc on the obj. Easy peasy :3
*/
In response to Spunky_Girl
Ok i lsot how this works is this whole code or only part of it
In response to Jub369
Ugh...does the term "notes" mean anything to you? And can you please actually spend the time to type correctly on the forums please? This isn't AIM or Myspace or whatever.

Just read the notes I put on there and fiddle around with it a bit until it fits your needs. That's just a generic snippet that I would use in this kind of situation.
In response to Spunky_Girl
How Would I speed up how fast it moves


and when hit it disappears but it don't says it did damage

obj/var/owner
obj/Swarm
icon='Aburame insect swarm jutsu.dmi'
icon_state="trail"
density=1
New(loc,d,o) //loc = location, d = direction, o = owner
..()
owner = o
walk(src,d,5) //utilize the walk() proc's third argument please...
spawn(300) //30 seconds later...
del src //delete itself
Bump(atom/a)
if(ismob(a))
var/mob/M = a
var/mob/o = owner //type cast the obj's owner var
var/dmg = round(o.Ninjutsu*8/6) //usr = null >_>
if(dmg >= 1)
M.hp -= dmg
view()<<"[M] Takes [dmg] from [usr]'s Insect Swarm Jutsu"
// if(M.hp <= 0)
// M.Death(o) //that's the kind of check that should happen anyway, yes?
del src //delete itself when bumping into ANYTHING

mob/verb/Swarm()
set category ="Ninjutsu"
set name ="Insect Swarm"
new/obj/Swarm(loc,src.dir,src)

In response to Jub369
"How Would I speed up how fast it moves"

Look up the walk() proc please...

"and when hit it disappears but it don't says it did damage"

Take out the 'if(dmg >= 1)' bit and change "view()" to "viewers(src)". If the message still doesn't appear, then that means there should be a runtime error or the obj isn't hitting a mob.
In response to Spunky_Girl
Thank you Spunky it worked and i made the five a 2 it was the Dmg part but it did do 133 so i guess the if dmg had a problem oh well Thank you so much again