proc
Death(mob/M)
if(src.type == /mob/PC)
PCDeath()
else
if(src.health <= 0)
del(src)
How would i make it where there a 50% chance of creating 1 item and a 50% chance of creating a differnt item when it dies?
ID:178683
Apr 17 2002, 5:43 pm
|
|
This is my deathcheck proc
|
In response to Jon Snow
|
|
Or
if(prob(50))//50% chance |
SuperGoku15 wrote:
How would i make it where there a 50% chance of creating 1 item and a 50% chance of creating a differnt item when it dies? Question: Do you mean that the 50% chance of creating each is independent, so that there's a 25% chance of creating both and a 25% chance of creating none? Or do you mean that you want to creat something no matter what, but as an either/or choice? (That is, you're basically flipping a coin to create something. Do you want to flip two coins, one for each different thing, or do you want to flip just one coin?) If the chances are independent, you'd do something like this: if(prob(50)) new /obj/thing1(src.loc) If you want to create either one item or the other, I suggest a different approach from either of the ones you've seen: var/list/dropitems=list(/obj/thing1,/obj/thing2) The beauty of this system is that it's extensible: You can add new types to the list. Lummox JR |
if(1)
blah blah
if(2)
blah blah
pretty simple :)