ID:167680
 
obj/spells
var
mob
caster = null
bullet
icon='fx.dmi'
icon_state="bullets"
layer=5
density=1
Bump(mob/M)
//here is the effects

if(M.client)//if it is a mob
if(M.class == caster.class)
usr << "NO!"
return
if(caster.altitude!=M.altitude)
caster << "<i><font color=red>You shoot at [M] but you are not on the same altitude so you do no damage!"
return
if(M.altitude==caster.altitude)
if(M.barrelroll==1)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 5 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 5 dmg!"
caster << "<font color=green><font size=2>*You gain 5 credits!"
M.armor-=5
deathcheck(M)
allydmgcheck(M)
caster.credits+=5
del(src)
return
if(M.loop==1)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] but misses!"
M << "<font color=red><font size=2>*You dodge [caster]'s shots!"
// caster << "<font color=green><font size=2>*You gain 5 credits!"
// M.armor-=5
// deathcheck(M)
// caster.credits+=5
del(src)
return
if(M.hardright==1)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 3 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 3 dmg!"
caster << "<font color=green><font size=2>*You gain 3 credits!"
M.armor-=3
deathcheck(M)
allydmgcheck(M)
caster.credits+=3
del(src)
return
if(M.hardleft==1)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 3 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 3 dmg!"
caster << "<font color=green><font size=2>*You gain 3 credits!"
M.armor-=3
deathcheck(M)
allydmgcheck(M)
caster.credits+=3
del(src)
return
if(M.zigzag==1)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 4 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 4 dmg!"
caster << "<font color=green><font size=2>*You gain 4 credits!"
M.armor-=4
deathcheck(M)
allydmgcheck(M)
caster.credits+=4
del(src)
return
///////////////////////////////////////
//////////////////////////////////////
if(M.barrelroll==0)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 10 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 10 dmg!"
caster << "<font color=green><font size=2>*You gain 10 credits!"
M.armor-=10
deathcheck(M)
allydmgcheck(M)
caster.credits+=10
del(src)
return
if(M.loop==0)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 10 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 10 dmg!"
caster << "<font color=green><font size=2>*You gain 10 credits!"
M.armor-=10
deathcheck(M)
allydmgcheck(M)
caster.credits+=10
del(src)
return
if(M.hardright==0)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 10 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 10 dmg!"
caster << "<font color=green><font size=2>*You gain 10 credits!"
M.armor-=10
deathcheck(M)
allydmgcheck(M)
caster.credits+=10
del(src)
return
if(M.hardleft==0)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 10 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 10 dmg!"
caster << "<font color=green><font size=2>*You gain 10 credits!"
M.armor-=10
deathcheck(M)
allydmgcheck(M)
caster.credits+=10
del(src)
return
if(M.zigzag==0)
view() << "<font color=red><font size=2>*[caster]'s shoots at [M] for 10 dmg!"
M << "<font color=red><font size=2>*You have been hit by [caster] for 10 dmg!"
caster << "<font color=green><font size=2>*You gain 10 credits!"
M.armor-=10
deathcheck(M)
allydmgcheck(M)
caster.credits+=10
del(src)
return

Ok this is a projectile that gets shot out, my problem is that when you shoot it fast somtimes the bullets run into each other causing them to get stuck and give a proc error because it doesnt knwo what to do when bumping another bullet. Does anyone know how to make the bullets sort of by pass each other because there getting stuck or make it so that when they bump each other it doesnt do anthing or stop.
Make it check for the type of thing it bumps into. Check to see if its a player, or another bullet. Not sure about the pass through part though.
In response to Pyro_dragons
    Bump(mob/M)
if(istype(M,/obj/bullet))return
if(M.client)//if it is a mob


Try that i think it will work
In response to A.T.H.K
Thanks, that worked for the proc error msg's but i still face the problem of the bullets clogging up together. I tried to change the density to 0 of the bullet but then the bump didnt work. Any ideas?
In response to A.T.H.K
A.T.H.K wrote:
>     Bump(mob/M)
> if(istype(M,/obj/bullet))return
> if(M.client)//if it is a mob
>

Try that i think it will work

Ugh. No. You've managed to check one type of objects without checking all the others. M.client will still fail if this bumps into a wall. And you put no space between your code and the // comments. No soup for you!
    Bump(mob/M)
if(ismob(M) && M.client)

Lummox JR
Your deathcheck() proc is tragically wrong. Actually doubly so, since you seem to have two of them for no reason:
deathcheck(M)
allydmgcheck(M)

Since this is occurring within Bump() for a projectile, the call should look like this:
M.deathcheck(owner)


  • You must have only one deathcheck proc.
  • The deathcheck proc's src must be the victim.
  • The killer must be passed as an argument to that proc, unless knowing the killer does not matter.

    Lummox JR
In response to Drakiel
Bump(mob/M)
//here is the effects
if(istype(M,/obj/spells/bullet))
M.density=0
sleep(10)
M.density=1

I kinda did this, it sorta helps....i guess??
In response to Drakiel
Drakiel wrote:
> Bump(mob/M)
> //here is the effects
> if(istype(M,/obj/spells/bullet))
> M.density=0
> sleep(10)
> M.density=1
>

I kinda did this, it sorta helps....i guess??

I don't see how that could possibly help. That'll end up with bullets skipping through walls.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
    Bump(mob/M)
> if(ismob(M) && M.client)



My bad