ID:1070349
 
(See the best response by NNAAAAHH.)
Code:
mob
verb
Attack()
set category = "Taijutsu"
for(var/mob/M in get_step(usr,usr.dir))
if(M.ingat||M.intank)
return
if(usr.battlingRC)
return
if(M.battlingRC)
return
if(M.Phasing)
usr<<"<font size=1>Your attack go right through [M]!"
return
if(M.drunk&&M.NonClan)
view()<<"[M] dodges [usr]'s attack"
return
if(!usr.canattack)
return
if(M.inspike)
usr<<"<font size=1>Your attack bounces off of [usr]!"
return
if(M.inbone)
usr<<"<font size=1>Your attack bounces off of [usr]!"
return
if(M.sphere)
usr<<"<font size=1>Your attack bounces off of the sand!"
return
if(M.PK==0)
usr<<"NONE PK ZONE!!!"
return
if(usr.PK==0)
usr<<"NONE PK ZONE!!!"
return
if(M.Kaiten)
var/damage = round(usr.tai-M.tai/4)
if(damage <= 1)
damage = 1
usr <<"<font size=1>You attack [M] but their kaiten hakkeshou reflects the damage back at you."
M <<"<font size=1>You reflect [usr]'s attack causing them to hurt themselfs."
usr.health -= damage
usr.Death(M)
usr.dead = 1
return
else
usr <<"<font size=1>You attack [M] but their kaiten hakkeshou reflects the damage back at you."
M <<"<font size=1>You reflect [usr]'s attack causing them to hurt themselfs."
usr.health -= damage
usr.Death(M)
src.dead = 1
return
if(M.ingat)
usr << "<font size=1>Your attack bounces off of [M] because they are in gatsuuga.."
return
if(M.bloodtaste)
for(var/obj/Religion/jashinsymbol2/A in oview(0,M))
if(A.owner==M)
for(var/mob/C in world)
if("[C]" in M.JashinRitual)
usr << "<font size=1>You attack [M]!"
var/damage = round(usr.tai/1.5 + usr.swordD)
damage+=rand(1,damage)
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
C.health -= damage
M.Death(usr)
C.Death(M)
return
if(M.immortal)
return
else
if(usr.Tekken&&usr.canattack)
usr.canattack=0
usr << "<font size=1>You attack [M]!"
flick("Attack",usr)

var/damage = round(usr.tai*1.5 + usr.swordD)
damage+=rand(1,damage)
if(damage <= 1)
damage = 1
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
if(istype(M,/mob/player))
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.exp += rand(1,2)
usr.Levelup()
usr.taiup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.canattack=1
return
else
usr.random = rand(1,20)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.canattack=1
return
else
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
if(istype(M,/mob/player))
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.canattack=1
return
else
usr.random = rand(1,20)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.canattack=1
return
else if(usr.Jyuken&&usr.canattack)
if(usr.chakra >= 2)
usr.canattack =0
usr << "<font size=1>You attack [M] using Jyuuken!"
flick("Attack",usr)
flick("Jyuken",usr)
var/damage = round(usr.tai + usr.swordD)
damage+=rand(1,damage)
if(damage <= 1)
damage = 1
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
M.chakra -= damage
usr.chakra -= 2
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
if(istype(M,/mob/player))
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
usr.random = rand(1,20)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
M.chakra -= damage
usr.chakra -= 2
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
if(istype(M,/mob/player))
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
usr.random = rand(1,20)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
usr<<"<font size=1>You dont have enough chakra to use Jyuuken so you are now useing tekken."
usr.Jyuken = 0
usr.Tekken = 1
return
else if(usr.FrogStyleKata&&usr.canattack)
if(usr.NaturalEnergy >= 2)
usr.canattack =0
usr << "<font size=1>You attack [M] using Frog Kata!"
flick("Attack",usr)
flick("Jyuken",usr)
var/damage = round(usr.tai + usr.swordD)
damage+=rand(1,damage)
if(damage <= 1)
damage = 1
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
usr.NaturalEnergy -= 2
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
if(istype(M,/mob/player))
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
usr.random = rand(1,20)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
usr.NaturalEnergy -= 2
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
if(istype(M,/mob/player))
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
usr.random = rand(1,20)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
usr<<"<font size=1>You dont have enough Natura to use Frog Style Kata so you are now useing tekken."
usr.FrogStyleKata = 0
usr.Tekken = 1
return
else if(usr.Basic&&usr.canattack)
usr.canattack =0
usr << "<font size=1>You attack [M]!"
flick("Attack",usr)
var/damage = round(usr.tai/1.5 + usr.swordD)
damage+=rand(1,damage)
if(damage <= 1)
damage = 1
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else
view() << "<font size=1>[usr] attacks [M] for [damage]!"
M.health -= damage
M.Death(usr)
if(istype(M,/mob/enemy))
M.killlist += src.name
usr.random = rand(1,8)
if(random == 5||random==1)
usr.taiexp += rand(1,3)
usr.taiup()
usr.exp += rand(1,2)
usr.Levelup()
sleep(2)
usr.canattack=1
else
sleep(2)
usr.Levelup()
usr.canattack=1
return
else if(usr.wearingscythe&&usr.canattack&&usr.bloodtaste)
usr << "<font size=1>You attack [M] with your scythe!"
view() << "<font size=1>[usr] strikes [M] with there Scythe for 0 Damage!"
M.blood()
usr.icon = 'hidan ritual form.dmi'
usr.bloodtaste = 1
usr.bloodhit = M.name
usr.JashinRitual.Add("[M]")
return
else if(usr.wearingscythe&&usr.canattack&&!usr.bloodtaste)
for(var/mob/Q in world)
if("[Q]" in usr.JashinRitual)
usr.JashinRitual.Remove("[Q]")
usr.JashinRitual.Remove("[Q]")
usr.JashinRitual.Remove("[Q]")
usr << "<font size=1>You attack [M] with your scythe!"
view() << "<font size=1>[usr] strikes [M] with there Scythe for 0 Damage!"
M.blood()
usr.icon = 'hidan ritual form.dmi'
usr.bloodtaste = 1
usr.bloodhit = M.name
usr.JashinRitual.Add("[M]")
sleep(300)
IMMORTALOMG
sleep(150)
src.icon = 'hidan ritual form.dmi'
src.jashinpride -= 1
src.immortal=1
if(src.jashinpride <= 0)
view(src)<<"Blood was not shead enough [src]'s immortality wears off!"
src.immortal = 0
src.icon = src.Oicon
src.jashinpride = 0
usr.bloodtaste = 0
for(var/mob/L in world)
if("[L]" in usr.JashinRitual)
usr.JashinRitual.Remove("[L]")
usr.JashinRitual.Remove("[L]")
usr.JashinRitual.Remove("[L]")
return
else
goto IMMORTALOMG
usr.canattack=0
sleep(15)
usr.canattack=1


Problem description: I do not know if you guys know Naruto but the skill are separated by categories!

  • Taijutsu: Hand to hand
  • Ninjutsu: Long Range or Close Range Attacks
  • Genjutsu: Use non-attackable techniques.

  • For my levelling, I want to code something in my death proc that if someone use Taijutsu it levels up his taijutsu of a little but if he ends a battle with a Taijutsu it levels up a lot but the problem is My team made tons of Jutsu and it would take me a lot of time to define every jutsu's category in their code. Isn't their another way if not do I just use variables to code the categories?

    Ex: usr.Taijutsu=1 or I use something else to define it?!?! Also if there is a faster method?

Best response
mob/proc
Damage(N as num, T as text, M as mob)//N is the amount of damage recieved, T the type, M the attacker
//This will also allow you to check the type of attack here, using whatever means you so choose, to determain what type of modifier to add to the damage
//ie: N=max(1,N+(M.stat-=src.statDef))
N=min(hp,N)//set N to be either the current HP or the damage amount, depending on whatever is smaller, allowing you to hopefully never go under 0 hp.
hp-=N//remove N from src's hp
src<<"[M] hit you for [N], by using their [T]."//Tell the src what's happening
DeathCheck(T,M)//Kill src/check for hp
DeathCheck(T as text, M as mob)//T is the type of damage recieved, M is the one who caused the damage.
if(hp) return//if src has hp still, cancel the death
switch(T)//switch the type
if("Taijutsu")//if the type is tai, increase tai
M.taijutsu++
if("Genjutsu")//if the type is gen, increase gen
M.genjutsu++
...//You get the idea here, I would hope.

and

mob/verb
NinAttack(M as mob)//just to demo out what I've shown you, three different kinds of attacks showing the three different types.
M.Damage(10,"Ninjutsu",src)
GenAttack(M as mob)
M.Damage(10,"Genjutsu",src)
TaiAttack(M as mob)
M.Damage(10,"Taijutsu",src)


Quick little edit:
I didn't read your entire post, I skipped most of the code snippit and read your problem, just figured I'd go for the issue here instead of reading through that. Also, I suspect you're dealing with a rip of some kind. If so, have fun with that. Most rips have horrible programming and never get improved uppon by anyone of actual talent in the feild. Not a good place to study codes from.
In response to NNAAAAHH
Yes, your are right I am dealing with a rip but do not worry this was just a spinet/example of verb. Also, the second box is to be put in all the Skills in the source?

Also, sorry for the late-respond. I've been quite busy the last month.
These leveling systems are awful D:
Just saying:

    if(M.PK==0)
usr<<"NONE PK ZONE!!!"
return
if(usr.PK==0)
usr<<"NONE PK ZONE!!!"
return


Instead of having 2 if() statements, do if(M.PK == 0 || src.PK == 0)

In response to Blastcore
if(!value) is far more robust and means you don't have to check value against all of the "falsey" values.
In response to Blastcore
no....
This is so horrible... There's no possible way this needs to be that long. I -really- suggest you learn some better programming habits. Even though this isn't yours.. if you can code better you should go ahead and recode it from scratch.
In response to Kitsueki
My Programming Language level is really, really low. Plus, I do not feel like reading the DM Guide I prefer that someone(Pro, I don't want to waste my time) teaches.
In response to Vegetas4
Then have fun going no where as a programmer. You should NEVER rely on someone else to get your somewhere you can get yourself.
In response to NNAAAAHH
NNAAAAHH wrote:
you can get yourself.

My English Level to one to 10 is 6. It's not enough for me to read an entire book of NINETEEN CHAPTERS. If I could find different languages of DM Guides I would have definitely read it and It's useless reading it since some Pros have never read the DM Guide they have been taught by good coders.
In response to Vegetas4
I've yet to meet anyone that's gone past ripping work and making half-working/broken programs that 'learned' from someone else. Either go to college for it or take it into your own hands. IF your English skills are ranked 6 out of a scale of 1-10, you're around average for most people in America. That's not to say their English is bad, it's to say English is a complex language.
"Would you like those two tu-tus to-go too?"
In response to Vegetas4
What you don't get is that you're wasting someone elses time to have to sit there and tell you something you could learn to do for yourself.
If you aren't driven enough to learn how to do it- or atleast try, no one with good sense will be willing to tell you how to do every other problem you come across.

From personal experience trying to tutor people in this language, they don't usually want tutoring, they usually just want people to tell them what to do, so they can avoid reading/studying. And... if that's how you feel you should just quit programming right now, otherwise you'll have to change your outlook on making games.