ID:139903
 
Code:
mob
verb
LionsBarrage(M in oview(3,usr))
set category = "Battle"
set name = "Lions Barrage"
if(usr.chakra >=60)
usr<<"Not Enough Chakra!"
if(usr.resting)
usr<<"Not while resting"
return
if(usr.Frozen)
return
if(!usr.firing)
var/mob/E = usr
usr.chakra -= 60
usr.firing = 1
spawn(7)
usr.firing = 0
view()<<"<font size=1><font face=verdana><b><font color=White><font size = 1>[usr]<font color= white> says: Lions Barrage!!"
var/damage = round((((4*src.Str/target.def)*rand(50,100))/100)*4.5)
target.health -= damage
usr.loc = locate(E.x,E.y-1,E.z)
flick('BaseW.dmi',usr)
flick("LKLBKicking",usr)
usr.StrExp += rand(1,5)
usr.StrGain()


Problem description:

The problem is, is that it only moves you down one square, my friend told me it would move you in front of whoever you use it on. The other problem is, if i add the damage, calculations to it I get a runtime error:

runtime error: Cannot read 0.def
proc name: Lions Barrage (/mob/verb/LionsBarrage)
usr: Jutachi (/mob/usr)
src: Jutachi (/mob/usr)
call stack:
Jutachi (/mob/usr): Lions Barrage(the area (/area))

That error only appears when I add the damage.

Chaorace wrote:
Code:
> mob
> verb
> LionsBarrage(M in oview(3,usr))
> set category = "Battle"
> set name = "Lions Barrage"
> if(usr.chakra >=60)
> usr<<"Not Enough Chakra!"
> if(usr.resting)
> usr<<"Not while resting"
> return
> if(usr.Frozen)
> return
> if(!usr.firing)
> var/mob/E = usr
> usr.chakra -= 60
> usr.firing = 1
> spawn(7)
> usr.firing = 0
> view()<<"<font size=1><font face=verdana><b><font color=White><font size = 1>[usr]<font color= white> says: Lions Barrage!!"
> var/damage = round((((4*src.Str/target.def)*rand(50,100))/100)*4.5)
> target.health -= damage
> usr.loc = locate(E.x,E.y-1,E.z)
> flick('BaseW.dmi',usr)
> flick("LKLBKicking",usr)
> usr.StrExp += rand(1,5)
> usr.StrGain()
>

Problem description:

The problem is, is that it only moves you down one square, my friend told me it would move you in front of whoever you use it on. The other problem is, if i add the damage, calculations to it I get a runtime error:

runtime error: Cannot read 0.def
proc name: Lions Barrage (/mob/verb/LionsBarrage)
usr: Jutachi (/mob/usr)
src: Jutachi (/mob/usr)
call stack:
Jutachi (/mob/usr): Lions Barrage(the area (/area))

That error only appears when I add the damage.



Well, you've obviously at some point didn't set the player's "target" or set it to "0". So, before you try reading said variables from the "target" you need to make sure it's a /mob/ type. Which is quite simple.

mob
verb
LionsBarrage(mob/M in oview(3,src))
set category = "Battle"
set name = "Lions Barrage"
if(!ismob(M)) //if our enemy isn't a /mob/ type
return
src.target=M //IMPORTANT, sets our "target"
if(src.chakra >=60)
src<<"Not Enough Chakra!"
return
if(src.resting)
src<<"Not while resting"
return
if(src.Frozen)
return
if(!src.firing)
src.chakra= max(src.chakra-60,0) //makes it so chakra doesn't fall below 0
src.firing = 1
spawn(7)
src.firing = 0
view(src)<<"<b><font face=verdana color=White size = 1>[src.name]</font><font color= white> says: Lions Barrage!!</font></b>" //need to close your html tags
if(!ismob(src.target)) //again, at this point the "target" could have logged out or been deleted, so need to check again
return
var/damage = round((((4*src.Str/src.target.def)*rand(50,100))/100)*4.5)
src.target.health=max(src.target.health-damage,0) //make it so health doesn't go below 0
var/turf/T=get_step(src.target,src.target.dir)
if(isturf(T))
src.loc=T
flick('BaseW.dmi',src)
flick("LKLBKicking",src)
src.StrExp += rand(1,5)
spawn()
src.StrGain()
In response to Teh Governator
Teh Governator wrote:
Chaorace wrote:
Code:
> > mob
> > verb
> > LionsBarrage(M in oview(3,usr))
> > set category = "Battle"
> > set name = "Lions Barrage"
> > if(usr.chakra >=60)
> > usr<<"Not Enough Chakra!"
> > if(usr.resting)
> > usr<<"Not while resting"
> > return
> > if(usr.Frozen)
> > return
> > if(!usr.firing)
> > var/mob/E = usr
> > usr.chakra -= 60
> > usr.firing = 1
> > spawn(7)
> > usr.firing = 0
> > view()<<"<font size=1><font face=verdana><b><font color=White><font size = 1>[usr]<font color= white> says: Lions Barrage!!"
> > var/damage = round((((4*src.Str/target.def)*rand(50,100))/100)*4.5)
> > target.health -= damage
> > usr.loc = locate(E.x,E.y-1,E.z)
> > flick('BaseW.dmi',usr)
> > flick("LKLBKicking",usr)
> > usr.StrExp += rand(1,5)
> > usr.StrGain()
> >

Problem description:

The problem is, is that it only moves you down one square, my friend told me it would move you in front of whoever you use it on. The other problem is, if i add the damage, calculations to it I get a runtime error:

runtime error: Cannot read 0.def
proc name: Lions Barrage (/mob/verb/LionsBarrage)
usr: Jutachi (/mob/usr)
src: Jutachi (/mob/usr)
call stack:
Jutachi (/mob/usr): Lions Barrage(the area (/area))

That error only appears when I add the damage.



Well, you've obviously at some point didn't set the player's "target" or set it to "0". So, before you try reading said variables from the "target" you need to make sure it's a /mob/ type. Which is quite simple.

> mob
> verb
> LionsBarrage(mob/M in oview(3,src))
> set category = "Battle"
> set name = "Lions Barrage"
> if(!ismob(M)) //if our enemy isn't a /mob/ type
> return
> src.target=M //IMPORTANT, sets our "target"
> if(src.chakra >=60)
> src<<"Not Enough Chakra!"
> return
> if(src.resting)
> src<<"Not while resting"
> return
> if(src.Frozen)
> return
> if(!src.firing)
> src.chakra= max(src.chakra-60,0) //makes it so chakra doesn't fall below 0
> src.firing = 1
> spawn(7)
> src.firing = 0
> view(src)<<"<b><font face=verdana color=White size = 1>[src.name]</font><font color= white> says: Lions Barrage!!</font></b>" //need to close your html tags
> if(!ismob(src.target)) //again, at this point the "target" could have logged out or been deleted, so need to check again
> return
> var/damage = round((((4*src.Str/src.target.def)*rand(50,100))/100)*4.5)
> src.target.health=max(src.target.health-damage,0) //make it so health doesn't go below 0
> var/turf/T=get_step(src.target,src.target.dir)
> if(isturf(T))
> src.loc=T
> flick('BaseW.dmi',src)
> flick("LKLBKicking",src)
> src.StrExp += rand(1,5)
> spawn()
> src.StrGain()
>





Okay, the runtime errors is gone, but now for some reason it says I don't have enough Chakra, even though I have ABOVE the required Chakra to use the technique.
In response to Chaorace
If user chakra is greater than 60.
Output: Not enough chakra.
Change it to less than.
In response to RichardKW
oh, haha thanks I didn't see that XD


One more problem LOL, It doesn't do any damage to your oppenent, it tele's you under them(thank god ) but It does no damage

In response to Chaorace
still need help, maybe I have to move the damage code up in the code somewhere?
In response to Chaorace
Chaorace wrote:
still need help, maybe I have to move the damage code up in the code somewhere?

Did you make sure damage is actually a positive number and not a negative one?
In response to Teh Governator
It has the same damage calculations as every jutsu in the game just about. Plus I was using it on a clone so..., But yeah, all the other jutsu do damage to the clone but this one. So I'm pretty sure it's positive, but When you use the tech,it teles your right infront(yay) and does the icon state and says Lion Barrage, thats about it, no damage or anything.

Btw, i'm using the code you gave me when you fixed it.
In response to Chaorace
Chaorace wrote:
It has the same damage calculations as every jutsu in the game just about. Plus I was using it on a clone so..., But yeah, all the other jutsu do damage to the clone but this one. So I'm pretty sure it's positive, but When you use the tech,it teles your right infront(yay) and does the icon state and says Lion Barrage, thats about it, no damage or anything.

Btw, i'm using the code you gave me when you fixed it.

Hmmm...try outputting the damage var to your self and see what it says.
world<<"[damage]"
In response to Teh Governator
I did what you said, it now shows damage, but for some reason the clones do not disperse. All the other jutsus kill the clones in one blow, this just says the damage and doesn't kill the clone.


mob
verb
LionsBarrage(mob/M in oview(6,src))
set category = "Battle"
set name = "Lions Barrage"
if(!ismob(M)) //if our enemy isn't a /mob/ type
return
src.target=M //IMPORTANT, sets our "target"
if(src.chakra <=60)
src<<"Not Enough Chakra!"
return
if(src.resting)
src<<"Not while resting"
return
if(src.Frozen)
return
if(!src.firing)
src.chakra= max(src.chakra-60,0) //makes it so chakra doesn't fall below 0
src.firing = 1
spawn(7)
src.firing = 0
view(src)<<"<b><font face=verdana color=White size = 1>[src.name]</font><font color= white> says: Lions Barrage!!</font></b>" //need to close your html tags
if(!ismob(src.target)) //again, at this point the "target" could have logged out or been deleted, so need to check again
return
var/damage = round((((4*src.Str/src.target.def)*rand(50,100))/100)*4.5)
world<<"[damage]"
src.target.health=max(src.target.health-damage,0) //make it so health doesn't go below 0
var/turf/T=get_step(src.target,src.target.dir)
if(isturf(T))
src.loc=T
flick('BaseW.dmi',src)
flick("LKLBKicking",src)
src.StrExp += rand(1,5)
spawn()
src.StrGain()
In response to Chaorace
Hmmm...try this:

src.target.health=max((src.target.health-damage),0) //make it so health doesn't go below 0
In response to Teh Governator
Teh Governator wrote:
Hmmm...try this:

> src.target.health=max((src.target.health-damage),0) //make it so health doesn't go below 0
>



Alright I added that and it still doesn't disperse the clones!:
mob
verb
LionsBarrage(mob/M in oview(6,src))
set category = "Battle"
set name = "Lions Barrage"
if(!ismob(M)) //if our enemy isn't a /mob/ type
return
src.target=M //IMPORTANT, sets our "target"
if(src.chakra <=60)
src<<"Not Enough Chakra!"
return
if(src.resting)
src<<"Not while resting"
return
if(src.Frozen)
return
if(!src.firing)
src.chakra= max(src.chakra-60,0) //makes it so chakra doesn't fall below 0
src.firing = 1
spawn(7)
src.firing = 0
view(src)<<"<b><font face=verdana color=White size = 1>[src.name]</font><font color= white> says: Lions Barrage!!</font></b>" //need to close your html tags
if(!ismob(src.target)) //again, at this point the "target" could have logged out or been deleted, so need to check again
return
var/damage = round((((4*src.Str/src.target.def)*rand(50,100))/100)*4.5)
view()<<"[target] was hit by [src]'s Lions Barrage for [damage] damage!"
src.target.health = max((src.target.health-damage),0) //make it so health doesn't go below 0
var/turf/T=get_step(src.target,src.target.dir)
if(isturf(T))
src.loc=T
flick('BaseW.dmi',src)
flick("LKLBKicking",src)
src.StrExp += rand(1,5)
spawn()
src.StrGain()
In response to Chaorace
one hour later, I still need help D;, I changed it to

usr.health -= damage
, and it still doesn't work D';