OK... get ready! I have an attack verb which is:
mob
verb/Attack(var/mob/M in oview(1)) //attack a mob within 1 tile of you
set category = "Battle"
var/damage=usr.ATTACK-M:DEF
if(damage <= 0)
return
else
M.HP-=damage
usr << "You attack [M]!" //send this message to the usr
M << "[usr] attacks you for [damage] damage!" //send this message to the mob
usr << "[damage] damage!" //tell the damage to the usr
M:LevelUp()
M:DeathCheck()
What i would like to do is change or have 2 different endings for a death of a character.
for another human player.. when 2 humans r fighting and one dies it will go to deathcheck which is:
proc
DeathCheck()//checks to see if an attack is deadly
if (HP <= 0) //if the defender's HP is low enough...
world << "\blue [src] \green dies!" //do the death messaging
src.loc=locate(33,7,1)
HP = HPMAX
it would, if im correct, send them to 33,7,1 with there health full
BUT!...... if your are training against a boxing bag type character that is stable and doesnt move, you get plus 1 exp for every time you attack it. so i tried this:
if(istype(src, /mob/training1))
if(src.HP <= 0)
usr.EXP += 1
why does this not work and it sends the bag to 33,7,1 and not have its own death..????
--DarkFireball
note: if this is unclear, reply saying that it is...
ID:149603
Mar 27 2002, 7:59 pm
|
|
In response to Pillsverry
|
|
Im lost u didnt explain in detail what do u put in between if and else???
if(src.client) //what the heck is client!?!??! //what goes here??? example code.... else //and also here I want a few so that *IF* player dies he gets his health back and gets warped to the inn 33,7,1 I want a death proc so that *IF* training bag gets hit(because it has 1 health it dies every hit) to get one exp etc..... DarkFireball |
In response to DarkFireball
|
|
DarkFireball wrote:
Im lost u didnt explain in detail what do u put in between if and else???okay, well, "if(src.client)" this line means, if the src has a client(or is a player) "//what goes here??? example code...." like i said, you put the code that warps the user and gives him his health "else" this is if the src doesnt have a client(or isnt a player) "//and also here" you put the code to delete the NPC or whatever you want ot do to it |
In response to Pillsverry
|
|
EXCELLENT!!!!!!!!! thank you!!!!
|
I usualy use: