ID:139951
 
Code: this is my death check.
proc
DeathCheck()
if (HP <= 0) //check to see if attack is a death hit
world << "[src] dies!" //do the death messaging
usr.loc = locate (32,26,1)
usr.HP = usr.MaxHP
usr.Chacra = usr.MaxChacra
usr.Bloodline = 0

mob/verb
Fireball_Jutsu(mob/M in oview(5))
set category = "Jutsu"
DblClick()
if (M.HP <=0)
usr << "[M] is already dead!"
else
icon = 'Skills.dmi'
icon_state = "FireballJutsu"
usr << "you used fire ball jutsu on [M]!"
oview() << "[usr] fire ball jutsu [M]!"
var/damage=usr.Power/2
usr.Chacra -= 30
M.HP -= damage
M.DeathCheck()

Problem description:
the problem with my death check is the person that did the killing dies to and i just wanna set it so only the person with 0 hp dies. iv tried switching the usr. to M but it wont work.


also with the projectile thats my skill but when i use it the imiage doesnt come up it only changes the char's icon.

Remove usr in your DeathCheck()
In response to Ripiz
Put an argument in the DeathCheck() to take a mob. DeathCheck(var/mob/Killer), then use Killer to replace usr.
Also, wtf is that DblClick() in the 2nd section of code?
In response to Falacy
Falacy wrote:
Also, wtf is that DblClick() in the 2nd section of code?

I tried to ignore that one :( Too lazy to figure what it's supposed to do.
In response to Ripiz
the second code is a whole different code in itself its the skill i was talking about
In response to Bigj822
mob/var/HP=0

mob/proc/DeathCheck(var/mob/Whoskilled) // DeathCheck Proc.
if(Whoskilled.HP<=0) // Checks if Whoskilled HP is at 0.
world << "[Whoskilled] has been killed by [src]" //This outputs the killed Message, Ex. Gohan Games has been killed by Ripiz or Falacy has been killed by Gohan Games.

mob/verb/KillTest(var/mob/M in world)
usr.DeathCheck(M) //Calls DeathCheck Proc. Is called by usr, M = The mob/player who you killed.
In response to Falacy
Falacy wrote:
Put an argument in the DeathCheck() to take a mob. DeathCheck(var/mob/Killer), then use Killer to replace usr.

He's using usr where he should be using src. As in, relocating usr, resetting usr's health, blah blah blah. If he had something like "[usr] has killed [src]" then your advice would apply, but as it is now he should just be removing usr entirely.
Bigj822 wrote:

> mob/verb
> Fireball_Jutsu(mob/M in oview(5))
> set category = "Jutsu"
> DblClick()
> if (M.HP <=0)
> usr << "[M] is already dead!"
> else
> icon = 'Skills.dmi'
> icon_state = "FireballJutsu"
> usr << "you used fire ball jutsu on [M]!"
> oview() << "[usr] fire ball jutsu [M]!"
> var/damage=usr.Power/2
> usr.Chacra -= 30
> M.HP -= damage
> M.DeathCheck()
>

Problem description:

also with the projectile thats my skill but when i use it the imiage doesnt come up it only changes the char's icon.

In your code, you do not specify `who's` icon your changing. When you don't specifiy, it defaults to src.

you will need to create a new object, change its icon, then put it where it needs to go.
In response to Pirion
thanks guys you helped alot i got it to work!!!

also does anyone know about setting up multi arguments
im setting up a village system for my game and i need to have 4 different args in other words

Village = "Leaf","Sand","Sound","Snow"


but it doesnt compile right is there a back way to multi args??
In response to Bigj822
Village = list("Leaf","Sand","Sound","Snow")
In response to Falacy
thx
i hope this is my last question i feel like a nub for asking so many but i guess i have to learn some way.
so this is my newist code that has problem it keeps getting an error saying missing expression for the else if clauses. and i'd like to know.
1.What is an missing expression or what exactly the expression is.
2.how to solve the error.

mob/Hokage
verb
Promote(mob/M in (Clan <= "Leaf"))
set category = "Hokage"
var/a = input("Rank your Village")in list("Anbu","Jounin")
if(a== "Anbu")
M.Clantitle = "Anbu"
M << "You are now an Anbu"
usr << "You have made [M] an Anbu"
else if(M.Clantitle = "Academy Student")
M.Clantitle = "Academy Student"
usr << "They must pass Chunin exam first!"
else if(M.Clantitle = "Gunin")
M.Clantitle = "Gunin"
usr << "They must pass Chunin exam first!"
In response to Bigj822
Bigj822 wrote:
1.What is an missing expression or what exactly the expression is.

Means you have an if() with only 1 =s instead of 2, or something similar.
In response to Ripiz
Ripiz wrote:
Falacy wrote:
Also, wtf is that DblClick() in the 2nd section of code?
a DblClick() is the same as a normal click all it means is ur supposed to click twice instead of once. in the code i have it in it realy doesnt take effect at all but in others it will force a double click as such to get a description or other things of the sort.
In response to Bigj822
Thank you Cpt. Obvious
In response to Ripiz
if its obvious why the hell ask then -.- seems like your the dummy here not me -.-
In response to Bigj822
Bigj822 wrote:
if its obvious why the hell ask then -.- seems like your the dummy here not me -.-

Because you had it stuck in your code in a place that didn't make sense at first glance. Which is why I always use src.Whatever - for readability.
Also, there was no actual DblClick() code included so that seemingly does nothing.