ID:165235
 
Yes, I looked through the Blue Book, however it doesn't have the type of randomization that I wanted.

Now I want 1 out of a number(which they have the code for set numbers, however I want mine to work so players can choose how many cards they want to use,not a set number)so it would be 1 out of deck size.

Yea, I can do this the long way, by going, 1-60=60 card deak,then do it for each number 1-61,1-62, and so on, but that will take up alot of lines. So can someone give me a code that would work the way I want it to?

PS. Yea, lol I know my example Isn't actual code, I just did it that way to explain what I want it to do, but not as sloppy, or long, as that example would need to be, if I coded it.
Zoltor wrote:
Yes, I looked through the Blue Book, however it doesn't have the type of randomization that I wanted.

Now I want 1 out of a number(which they have the code for set numbers, however I want mine to work so players can choose how many cards they want to use,not a set number)so it would be 1 out of deck size.

Yea, I can do this the long way, by going, 1-60=60 card deak,then do it for each number 1-61,1-62, and so on, but that will take up alot of lines. So can someone give me a code that would work the way I want it to?

PS. Yea, lol I know my example Isn't actual code, I just did it that way to explain what I want it to do, but not as sloppy, or long, as that example would need to be, if I coded it.

sound like you want the player's "INPUT" on the size of the deck. if that's what you are looking for:

<dm>
mob
var/Hand = 20 //starting amount of cards you have

proc/UseDeck(var/mob/M)
var/cards = 0
do
cards = input("How many cards?(1-[M.Hand])",,1) as num
if((cards>M.hand) || (cards<1)) //invalid number of cards
alert("You must pick between 1 and [M.Hand]")
while((cards>M.hand) || (cards<1))



In response to Jik (#1)
This seems like it might work, I'll have to try it out to see for sure, but it sounds like it will work, ty