ID:146352
 
Code:
mob
verb
Punch()
if(usr.stamina == 2.9)
usr <<"You need to rest before continuing"
if(usr.resting == 1)
usr <<"You Need"
if(usr.resting == 0 && usr.stamina == 3)
Punch_System()
verb
Kick()
if(usr.stamina == 3.9)
usr <<"You need to rest before continuing"
if(usr.resting == 1)
usr <<"You Need"
if(usr.resting == 0 && usr.stamina == 4)
Kick_System()
proc
Punch_System()
if(usr.stamina == 2.9)
usr <<"You need to rest before continuing"
if(usr.resting == 1)
usr <<"You Need"
if(usr.resting == 0 && usr.stamina == 3)
usr.random = rand(1,4)
if(usr. random == 1)
M.powerlevel = -usr.strength
M <<"[usr] Has Attacked You For [usr.strength] Damnage!"
usr.stamina = -1.8
usr <<"You Attacked [M] For [usr.strength] Damnage!"
Tired()
M.Death()
if(usr. random == 2)
usr.stamina = -0.5
usr <<"You Tried To Attack [M], But Missed!"
M <<"[usr] Tried To Attack You, But Missed!"
Tired()
if(usr. random == 3)
usr.stamina = -0.5
usr <<"You Tried To Attack [M], But Missed!"
M <<"[usr] Tried To Attack You, But Missed!"
Tired()
if(usr. random == 4)
M.powerlevel = -usr.strength
M <<"[usr] Has Attacked You For [usr.strength] Damnage!"
usr.stamina = -2.6
usr <<"You Attacked [M] For [usr.strength] Damnage!"
Tired()
M.Death()
proc
Kick_System()
if(usr.stamina == 3.9)
usr <<"You need to rest before continuing"
if(usr.resting == 1)
usr <<"You Need"
if(usr.resting == 0 && usr.stamina == 4)
usr.random = rand(1,4)
if(usr. random == 1)
M.powerlevel = -usr.strength
M <<"[usr] Has Attacked You For [usr.strength] Damnage!"
usr.stamina = -3.8
usr <<"You Attacked [M] For [usr.strength] Damnage!"
Tired()
M.Death()
if(usr. random == 2)
M.powerlevel = -usr.strength
M <<"[usr] Has Attacked You For [usr.strength] Damnage!"
usr.stamina = -3.8
usr <<"You Attacked [M] For [usr.strength] Damnage!"
Tired()
M.Death()
if(usr. random == 3)
usr.stamina = -2.5
usr <<"You Tried To Attack [M], But Missed!"
M <<"[usr] Tried To Attack You, But Missed!"
Tired()
if(usr. random == 4)
M.powerlevel = -usr.strength
M <<"[usr] Has Attacked You For [usr.strength] Damnage!"
usr.stamina = -3.9
usr <<"You Attacked [M] For [usr.strength] Damnage!"
Tired()
M.Death()



proc
Death()
if(usr.powerlever == 0)
usr.loc =locate(1,2,2)
usr <<"You Have Died!"
world <<"[usr] Has Died!"
usr.powerlever =usr.maxpowerlevel
usr.stamina =100
usr.resting =0
proc
Tired()
if(usr.stamina == 0)
usr <<"You Must Wait for Your Stamina To Replensih Before Continuing"
usr.resting =+1
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
sleep(10)
usr.stamina =+10
usr.resting =0


Problem description:My Game Does Not Have Much In It Yet So Its Had To Try And Test My Battle System. Also How Do I Make It So That When They Attack [M]'s defenses is subtracted from [usr]'s attack reducing the damnage? This Is My Custom Battle System, So If It Does Not Work Please Tell Me Why So I Can Continue Working On It. And If It Does Work And You Like It, Feel Free To Use It But Please Give Me Credit.

:/ When you capitalize every word, it's kinda' hard to read what you said.
In response to Ol' Yeller
I can read it, but can u help me?
In response to Animekid09
I can't, edit your post and make it readable. I'll think about it after that.
In response to Ol' Yeller
Thats sad that you can't read. I don't think u know what ur even doing.
In response to Animekid09
I Can't Read It When You Type Like This, It's Very Annoying.

It's sad when morons can't even type right, don't you think?

[edit]What do you mean by not knowing what I'm doing? :/
very,very,VERY ugly code.
  • change all the usr's to src's
  • if(usr.stamina == 2.9)=WRONG! it should be if(usr.stamina <= 2.9). in your code everywhere were the players stamina IS 2.9 or something it can attack, use the >= and <= operators
  • M.powerlevel = -usr.strength thats.. also wrong. it should be -= not = -
M <<"[usr] Has Attacked You For [usr.strength] Damnage!"
tsk tsk, it should be 'damage' not 'damnage',
Tired()
M.Death()
should be:
Tired(src)
Death(M)

and a example of what you wanted:
mob
verb
attack(mob/M in oview(1))
var/damage=(usr.strenght-M.defense) // the damage, usr's strenght - M.defense
M.defense-=damage //removes the damage from M's defence
if(M.defense<=2)//if M's defence is lower that 2
Death(M)//M dies
usr <<"you killed [M]!"
M << "[usr] Killed you!"

// this is something for you to start on. this is a little example how to do what you wanted


You've got massive usr abuse all throughout your code. It should not appear inside any one of your procs--only verbs. Until you fix that, you have very little hope of debugging your code. (And as Ol' Yeller mentioned, the headline style of Capitalizing Every Word is annoying and hard to read, and will just prevent more people from helping you. Please don't do that.)

Another thing you should change are the ==1 and ==0 tests on certain vars like resting. That should be if(resting), not if(resting==1), and likewise if(!resting) instead of if(resting==0). Comparing against a specific number is brittle programming, and will break if the value isn't quite what you expect it to be. Never do that with a true/false value; always just use if(var) or if(!var) instead.

Finally, the Tired() proc which replenishes stamina should clearly have a loop in there to avoid all those redundant lines. That proc is just ridicuous. You could replace about 20 lines of code in there with:

while(stamina < 100)
sleep(10)
stamina += 10


Note that you're also using stamina=+10 currently, which is wrong; that's going to keep setting stamina to 10 instead of adding 10. The operator is +=, not =+.

Lummox JR
In response to Animekid09
Animekid09 wrote:
Thats sad that you can't read.

he can read, Its Only Really Annoying If You Type Like This.

Thats sad that you can't read. I don't think u know what ur even doing.

Whats That Supposed To Mean?

O-matic