ID:268119
 
mob
verb
Attacking()
set category="Fight"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
E.HP-=usr.Str
view()<<"[usr] attacks [E] ([usr.Str])"
if(E.HP<=1)
world<<"<font color=red>[usr] Slaughtered [E]!"
E.HP=E.MHP
E.MP=E.MMP
E.gold+=E.gold
E.gold=0
usr.Exp+=E.Expg
E.PK=0
LvlCheck(usr)
UserDcheck(E)
E<<"You Have Died!"
E.loc = locate(6,5,1)
E.gold -= E.gold
E.HP=E.MHP
E.MP=E.MMP
sleep(2)
E.PK=0
E<<"<Font color=gray>-=Game Over=-"
sleep(3)
E<<"<Font color=blue>-=30 seconds=-"
sleep(80)
E<<"<Font color=yellow>-=20 seconds=-"
sleep(80)
E.loc = locate(12,48,1)
E.icon_state="ghost"
if(E.NPC==1)
usr<<"You can't attack A NPC!"
return


My HP goes down to -1 and past and i dont die, any help?
Please dont post twice about the exact same thing, just wait paitently and some one will help you.

<Edit> Why did you start a new one any way? Oh and I posted some things you needed to fix up on [link] Which I know you read because you replied, then deleted that and edited your old one...nice. And from glancing at it very quickly you it doesnt seem you even bothered.
In response to Wanabe
Twice? I think that's the fifth time.
In response to Foomer
fifth time of posting eh,dont think so? this is a new post,the other problem i already fixed.[Edit] also i dont wish to argue i am just looking for some help.
Vash_616 wrote:
My HP goes down to -1 and past and i dont die, any help?

Required reading
you need to have a Deathcheck() on your code somewhere
In response to Redgar
Ok i fixed all that stuff on my own now i have a new problem when you kill a monster he respawns in the players area.. i dont want them to do that & you cant kill monsters.. here is my code
mob
verb
Attacking()
set category="Fight"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
E.HP-=usr.Str
view()<<"[usr] attacks [E] ([usr.Str])"
UserDcheck(E)
if(E.HP<=0 && E.player==1)
world<<"<font color=red>[usr] Slaughtered [E]!"
E.HP=E.MHP
E.MP=E.MMP
E.gold+=E.gold
E.gold=0
usr.Exp+=E.Expg
E.PK=0
LvlCheck(usr)
UserDcheck(E)
E.loc = locate(6,5,1)
E.gold -= E.gold
E.HP=E.MHP
E.MP=E.MMP
sleep(2)
E.PK=0
E<<"<Font color=gray>-=Game Over=-"
sleep(3)
E<<"<Font color=blue>-=30 seconds=-"
sleep(80)
E<<"<Font color=yellow>-=20 seconds=-"
sleep(80)
E.loc = locate(12,48,1)
E.icon_state="ghost"
if(E.NPC==1)
usr<<"You can't attack A NPC!"
return

mob
proc/UserDcheck(mob/M)
if(M.HP<=0)
if(M.dead==0)
if(M.player==1)
M<<"You Have Died!"
M.loc = locate(6,5,1)
M.gold -= M.gold
M.HP=M.MHP
M.MP=M.MMP
sleep(2)
M.PK=0
M<<"<Font color=gray>-=Game Over=-"
sleep(3)
M<<"<Font color=blue>-=30 seconds=-"
sleep(80)
M<<"<Font color=yellow>-=20 seconds=-"
sleep(80)
M.loc = locate(12,48,1)
M.icon_state="ghost"
M.dead=1
else
if(M.player==0)
if(src.HP <= 0)
src.HP = src.HP
usr.Exp+=src.Exp
usr.gold+=src.gold
del(src)
if(src.name == "Demon")
usr<<"Argh you have defeated me..damn you mortal"
usr.loc = locate(15,61,1)


Where did i go wrong?
In response to Vash_616
try messing with it =/
Here Try This:
mob
verb
Attacking()
set category="Fight"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
E.HP-=usr.Str
view()<<"[usr] attacks [E] ([usr.Str])"
UserDcheck(E)
if(E.HP<=0 && E.player==1)
world<<"<font color=red>[usr] Slaughtered [E]!"
E.HP=E.MHP
E.MP=E.MMP
E.gold+=E.gold
E.gold=0
usr.Exp+=E.Expg
E.PK=0
LvlCheck(usr)
UserDcheck(E)
E.loc = locate(6,5,1)
E.gold -= E.gold
E.HP=E.MHP
E.MP=E.MMP
sleep(2)
E.PK=0
E<<"<Font color=gray>-=Game Over=-"
sleep(3)
E<<"<Font color=blue>-=30 seconds=-"
sleep(80)
E<<"<Font color=yellow>-=20 seconds=-"
sleep(80)
E.loc = locate(12,48,1)
E.icon_state="ghost"
if(E.NPC==1)
usr<<"You can't attack A NPC!"
return
In response to Redgar
Ok that Works
mob
verb
Attacking()
set category="Fight"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
E.HP-=usr.Str
view()<<"[usr] attacks [E] ([usr.Str])"
UserDcheck(E)
if(E.HP<=0)
world<<"<font color=red>[usr] Slaughtered [E]!"
E.HP=E.MHP
E.MP=E.MMP
E.gold+=E.gold
E.gold=0
usr.Exp+=E.Expg
E.PK=0
LvlCheck(usr)
UserDcheck(E)
E.loc = locate(6,5,1)
E.gold -= E.gold
E.HP=E.MHP
E.MP=E.MMP
sleep(2)
E.PK=0
E<<"<Font color=gray>-=Game Over=-"
sleep(3)
E<<"<Font color=blue>-=30 seconds=-"
sleep(80)
E<<"<Font color=yellow>-=20 seconds=-"
sleep(80)
E.loc = locate(12,48,1)
E.icon_state="ghost"
if(src.name == "Demon")
usr<<"Argh you have defeated me..damn you mortal"
usr.loc = locate(15,61,1)
if(E.NPC==1)
usr<<"You can't attack A NPC!"
return


When i kill demon now i dont get transported any help?
In response to Vash_616
Instead of using if(src.name == "Demon), why dont you use E.name. You have been using E all the way through, so why have you converted to src now?
In response to Lazyboy
Lazyboy wrote:
Instead of using if(src.name == "Demon), why dont you use E.name. You have been using E all the way through, so why have you converted to src now?

mob
verb
Attacking()
set category="Fight"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
E.HP-=usr.Str
view()<<"[usr] attacks [E] ([usr.Str])"
UserDcheck(E)
if(E.HP<=0)
world<<"<font color=red>[usr] Slaughtered [E]!"
E.HP=E.MHP
E.MP=E.MMP
E.gold+=E.gold
E.gold=0
usr.Exp+=E.Expg
E.PK=0
LvlCheck(usr)
UserDcheck(E)
E.loc = locate(6,5,1)
E.gold -= E.gold
E.HP=E.MHP
E.MP=E.MMP
sleep(2)
E.PK=0
E<<"<Font color=gray>-=Game Over=-"
sleep(3)
E<<"<Font color=blue>-=30 seconds=-"
sleep(80)
E<<"<Font color=yellow>-=20 seconds=-"
sleep(80)
E.loc = locate(12,48,1)
E.icon_state="ghost"
if(E.name == "Demon")
usr<<"Argh you have defeated me..damn you mortal"
usr.loc = locate(15,61,1)
if(E.NPC==1)
usr<<"You can't attack A NPC!"
return
now it transfers me to that location but the monsters show up at the respawn area to and i dont want that how would i change this?*Note* The deathcheck is part of the attack so dont ask for it =P cause its there.
In response to Vash_616
Your deathcheck (assuming what i read was right) isnt making the distinction between monsters and player controlled character. Therefore any mob that is killed will be transported to the respawn location.
In response to Lazyboy
so how would i make it so players and monsters dont go to the same place?
In response to Vash_616
anyone..
In response to Vash_616
dont double post =/..
In response to Vash_616
Bump.
In response to Vash_616
Seriously know one is smart enough to help me ? =(
In response to Vash_616
We have shown you alot of times over in your multiple threads that you have posted how to solve your problems...Help your self first.
In response to Wanabe
Wanabe wrote:
We have shown you alot of times over in your multiple threads that you have posted how to solve your problems...Help your self first.

Yo Wanabe, i fixed the original problem if you bother reading lazyboys posts we are talking about something diffrent now. if you dont have anything nice to say dont say anything at all
In response to Vash_616
That's a stupid policy. If you don't say anything that isn't nice, then where would the world be?

"You know, I was thinking of making this nuclear reactor, and screw the protective shielding!"
*Silence*
Page: 1 2