ID:172076
 
The problem is that it never kills the mob and just -'s their score down to 1000 so if they was on 30 it would be
-970Hp also if it doesn't have enough mp it still shows the icon attack yet won't allow them to attack.

obj
verb
Teta(mob/M as mob in oview(1))
icon = 'Skills.dmi'
icon_state = "teta"
src.icon = 'PC.dmi'
src.icon_state = "tuta"
sleep(6)
src.icon = 'PC.dmi'
src.icon_state = "female mage"
sleep(6)
if(usr.MP>=60)
if(M.HP > 0)
src << "You attack [M]!"
src << "You attack [M]!"
view() << "[usr] deals 10000 damage to [M]!"
if(M.MP>M.MAX_MP)
M.HP -= 10000
M.MAX_HP -= 10000
M.DeathCheck()
src.MP-=60
else
src<<"You're don't have enough MP"
Wow, that's some pretty buggy code.

icon and src.icon are doing the same thing, I believe. the if(M.HP > 0) part is useless. If they had less than 0 hp, your deathcheck proc ~should~ have deleted M, or at least made it unattackable. You're displaying "You attack [M]" twice, though that's not really much of a problem. the else and "you don't have enough mp" message should go back one indentation. Ok, the mp part is where I really get confused. if M's mp is larger than it's max mp (which should never happen), then both the hp AND max hp get reduced by 10000 (max hp is the maximum, so it shouldn't be reduced)?

I can see alot of bugs in there. But I don't understand what you think the problem with it is.
In response to Rippy
icon = 'Skills.dmi'
icon_state = "Heal"

= The picture in the skill menu

src.icon = 'PC.dmi'
src.icon_state = "tuta"
sleep(6)
src.icon = 'PC.dmi'
src.icon_state = "female mage"
= The Animation of the attack and when finished goes back to there original character 'female mage'(I dislike flicks..)

I'm trying to get it so it damages a mob and takes mp of it yet that other way or this way didn't work x_x

I changed it to(yet still did the same thing, it's not like my DeathCheck is wrong since it works on my attack.) :

obj
verb
Teta(mob/M as mob in oview(1))
icon = 'Skills.dmi'
icon_state = "teta"
src.icon = 'PC.dmi'
src.icon_state = "tuta"
sleep(6)
src.icon = 'PC.dmi'
src.icon_state = "female mage"
sleep(6)
if(usr.MP>=60)
src << "You attack [M]!"
view() << "[usr] deals 10000 damage to [M]!"
if(M.MP>M.MAX_MP)
M.HP -= 10000
M.DeathCheck()
src.MP-=60
else
src<<"You're don't have enough MP"
In response to Shouri
When he said that it was buggy, he wasn't lying. Let me lay down what your code is doing just so you can see how off it is.

The verb teta assigns the icon and icon state first. Then, using src.icon and src.icon_state, it changes the icon that you first assigned it to. Then it changes it again. You say you dislike flicks, well start liking them right now. Because what you're doing is a waste of effort.

Next your code checks if the usr's MP is greater than or equal to 60. If it is, then it displays the following message to the obj: "You attack [M]" Why would you want to display that message to an object? That seems pretty useless. Maybe you meant to put usr there instead of src?

Immediately after your code checks to see if M's MP is greater than it's maxium MP. And as Rippy said, it should never be like that. Not only that, but why would you want to check that anyway? Also, you'r doing the damage to M after that check, which, ~if~ your code is how it ~should~ be, will never return true because your code keeps MP from going over Max_MP.

Here is what it should look like:

obj
verb
Teta(mob/M as mob in oview(1))
icon = 'Skills.dmi'
icon_state = "teta"
flick("tuta",usr)
if(usr.MP>=60)
usr << "You attack [M]!"
view() << "[usr] deals 10000 damage to [M]!"
M.HP -= 10000
M.DeathCheck()
usr.MP-=60
else
usr<<"You don't have enough MP"


Your DeathCheck proc should take care of whether or not M's HP is below zero.

Resonating Light
In response to Resonating_Light
Thanks Resonating Light for the code and Rippy for showing me what i did wrong, i got a question how would i go by turning that obj/verb into a obj? everytime i try to do i i get like: name() undefined proc, is there a tutorial around i ain't passed one yet on how to convert verbs into a obj? Sorry if this is a dumb question. :\
In response to Shouri
I'm not too sure what you mean. But if my assumptions are right, then the below two sentences should answer your question.

You can't make a verb an obj. But you can give objects verbs.

Resonating Light
In response to Resonating_Light
Example on what i ment:
(So that inside my Skill menu it'll show a picture of the Teta icon then i can just click on it then it'll do that attack to whoever i choose.

Yet i keep getting: objs.dm:94:error:Teta :undefined proc

I hope that makes it more clear what i ment by how can i turn that verb at the start into a obj)

obj
Teta(mob/M as mob in oview(1))
icon = 'Skills.dmi'
icon_state = "Teta"
Click()
flick("tuta",usr)
if(usr.MP>=60)
usr << "You attack [M]!"
view() << "[usr] deals 10000 damage to [M]!"
M.HP -= 10000
M.DeathCheck()
usr.MP-=60
else
usr<<"You don't have enough MP"
In response to Shouri
Shouri wrote:
Example on what i ment:
(So that inside my Skill menu it'll show a picture of the Teta icon then i can just click on it then it'll do that attack to whoever i choose.

Yet i keep getting: objs.dm:94:error:Teta :undefined proc

I hope that makes it more clear what i ment by how can i turn that verb at the start into a obj)

> obj
> Teta(mob/M as mob in oview(1))
> icon = 'Skills.dmi'
> icon_state = "Teta"
> Click()
> flick("tuta",usr) //you messed up the click procedure by not tabbing it enough tab everything from here below once
> if(usr.MP>=60)
> usr << "You attack [M]!"
> view() << "[usr] deals 10000 damage to [M]!"
> M.HP -= 10000
> M.DeathCheck()
> usr.MP-=60
> else
> usr<<"You don't have enough MP"
>


Also are you making this obj go into the players contents? if so thats a bad idea might want to make a list called skills which contains nothing and have it create this object and add it into it, if you need example reply im really tired and i shouldn't be trying to help so...lol man i am so tired right now gonna go to bed before i fall asleep on table
In response to LilTrunks
Making a list like LilTrunks said is a good idea. Change Teta back to a verb and add "set src in usr.(whatever you want the list to be)". Then when the player logs in, create the object in thier Skill list. (BTW, you might want to change the path to something like: /obj/skills/Teta, instead of /obj which will interfere by giving all objects the verb.) Next, all you have to do stat thier skills
with something like "stat(src.Skills)". That should work. but if you want it to exicute the Teta verb by clicking on it, then switch it over to Click(). I hope I helped. Sorry if this is really confusing..
In response to LilTrunks
yeah, can you give me some examples? Kinda been stuck on this for quite along time yeti tried to keep doing verbs yet that didn't go right since it wouldn't allow me to have a picture icon inside my skill stat
So you see what i mean by why i was trying to get it to be var obj,

Oh if you need my statpanel skill part so you know where it comes from its:


    statpanel("Skills")
stat("Your Current Skills:")
for(var/obj in usr.contents)
stat(skills)


normally its:
usr.skills += new /obj/skillname if i put a skill in yet i'm having trouble with this one since what i'm trying to do is get it so they need to talk to a npc or a certain lvl to get that skill and it won't be shown till they get it from npc/lvlsuch and also when the skill does come it shows it inside my skill menu as the picture i made it be hope that explains what im ment, i would be greatful if you could give me some examples if theres a easier way then trying to do what i'm doing, since i'm really lost on this subject i've tried to look for tutorials/demos on it yet i can't find any.
In response to Shouri
>   statpanel("Skills")
> stat("Your Current Skills:")
> for(var/obj in usr.contents)
> stat(skills)
>
>

normally its:
usr.skills += new /obj/skillname

for the stat you should have:
    statpanel("Skills")
stat("Your Current Skills:")
stat(src.skills)


and "usr.skills += new /obj/skillname" should work.

for example:
obj
Skill//to better organize this you should give skills thier own path
icon = 'Skill.dmi' //to save space you could have all the skill icons in one place
CarzyManFirePunch
icon_state = "CarzyManFirePunch" //the skills icon_state
Click()
usr<<"You use the move CarzyManFirePunch and destroy the world!!!!!" //To use the skill, all you have to do is click on it in the stat window

proc
Levelup(mob/M)
////Your normal level up stuff
M.skills += new/obj/Skill/CarzyManFirePunch //add CarzyManFirePunch to thier skills

mob
Stat()
statpanel("Skills")
stat("Your current skills")
stat(src.skills)//stat all their skills


I hoped that helped, let me explain it anyway though.
When you level up (I assume thats how they learn skills..) the skill CarzyManFirePunch is added to thier skill list. The stat proc then show the skill CarzyManFirePunch in all it's glory in the stat window. Then all you have to do is click on it, and volia, you've destroyed the world with CarzyManFirePunch!

Good luck!
In response to DarkCampainger
Thanks for the examples they helped a really lot in setting up my skills yet i'm really confused what you ment by:

"Change Teta back to a verb and add "set src in usr.(whatever you want the list to be)". Then when the player logs in, create the object in thier Skill list. (BTW, you might want to change the path to something like: /obj/skills/Teta, instead of /obj which will interfere by giving all objects the verb.) "

Do you mean i leave it as

obj
verb
Teta

but how would i set it so it would be set as a skill since whenver i add in for Teta would i: usr.skills += new /obj/Teta or usr.skills += new /obj/verb/Teta?


You see if i kept it at obj/Teta i would get 'objs.dm:94:error:Teta :undefined proc'

and if i kept it as obj/verb/Teta it wouldn't go into my skill list it'll go into something like Commands and when i target something it shows all the obj's like Keys and stuff instead of the mob

i hope you see where i'm coming from on the part i'm confused about.
In response to Shouri
you should Ignore that. The last post had a better way of doing it.
Try to change it so it kind of follows the example I gave you in my last post.
In response to DarkCampainger
Oh i get it so you ment:

I make a obj then i call a proc to call it?
(i didn't get any errors with that so does that look right?)

and if i set it so i would be able to get it from a npc it would be: usr.skills += new/obj/Skill/Teta right?

For some reason it doesn't call the proc yet it shows up in my skill menu and says 'You use Teta.'

obj
Skill//to better organize this you should give skills thier own path
icon = 'Skills.dmi' //to save space you could have all the skill icons in one place
Teta
icon_state = "Teta" //the skills icon_state
Click()
usr<<"You use Teta." //To use the skill, all you have to do is click on it in the stat window

mob/proc
Teta(mob/M as mob in oview(1))
flick("tuta",usr)
if(usr.MP>=60)
usr << "You attack [M]!"
view() << "[usr] deals 10000 damage to [M]!"
M.HP -= 10000
M.DeathCheck()
usr.MP-=60
else
usr<<"You don't have enough MP"
In response to Shouri
Shouri wrote:
Oh i get it so you ment:

I make a obj then i call a proc to call it?
(i didn't get any errors with that so does that look right?)

and if i set it so i would be able to get it from a npc it would be: usr.skills += new/obj/Skill/Teta right?

For some reason it doesn't call the proc yet it shows up in my skill menu and says 'You use Teta.'

> 
> obj
> Skill//to better organize this you should give skills thier own path
> icon = 'Skills.dmi' //to save space you could have all the skill icons in one place
> Teta
> icon_state = "Teta" //the skills icon_state
> Click()
> usr<<"You use Teta." //To use the skill, all you have to do is click on it in the stat window
usr.Teta()////Add This!!!!!!!!!!!!
>
> mob/proc
> Teta(mob/M as mob in oview(1))
> flick("tuta",usr)
> if(usr.MP>=60)
> usr << "You attack [M]!"
> view() << "[usr] deals 10000 damage to [M]!"
> M.HP -= 10000
> M.DeathCheck()
> usr.MP-=60
> else
> usr<<"You don't have enough MP"
>
>


add the line with "//Add This!!!!!!!!"