Trying to decide how to make a cardgame (something similar to poker, or a CCG for something to do on long runs, or to break up the monotony of killing, questing, and killing some more). I'd like to be able to use one deck of cards, and allow people to play things like Poker, Rummy, Spades, ect., just for something to do.
Nothing like drinking a beer with your best pipe, and laying cards with your friends to make you run out of money...
What you could start off doing is make a new obj type, have v0 (or something) be the card value. (King would be 10 or 1 etc) Then code in some commands like shuffle, deal and so on. Just a basic overview.
I was honestly thinking something more long the lines of ASCii (or whatever it is) mapping. Individual items like that would make for a rather odd set-up, since for games like poker, or if you are playing rummy and you lay the cards down, mob w/ spec_janitor walks by and steals half the deck. Not something cool. Replacing a deck of cards every run or two would be a bit annoying.
One of these days I'll learn to be more specific on my first post
That'd be quite difficult. I'd have some problems doing it myself. I wouldn't suggest attempting it if you aren't experienced. Or getting some direct help.
I've got Txzeenath on Yahoo to help me some, but if you know a way you could do it other then ASCii, require only one object, and being able to deal/draw/discard/ect. without having to make an object for each individual card, I'd appretiate it.
There is a blackjack snippet out there, that will help you most of the way, have a look at it, if you cannot find it let me know, i will find the link or email you the code.
Plus it is also alot more to keep up with, and god forbid you lose a card. Plus, I just want to do something besides with objects (I'd still require one to play, just one instead of 53...)
Janitor mob solution is as simple as not puting the take flag on the object
Question: How would a person pick up the cards if, say, the container was destroyed? The jan mob solution is a flag to make the item untakable by a mob with the spec_janitor applied to it, and I'd rather do it another way anyways then requiring 53 items for one card set.
Then dont have 53 items. Have the dealer mpoload whatever cards the player is dealt (if you have cards at all, thats another matter entirely) and keep a running total of his own cards. Even simpler still, have the code maintain the running total for player and dealer and skip objects entirely. But the *simple* solution to fixing objects so janitor mobs dont grab them is just not to set the take flag (ala fountains) and not either write a new flag or rewrite an existing one. As for picking up cards if the container is destroyed, you dont - have the mob check every minute or so for the container in the room and purge the room if it doesnt exist. Of course, if the container is a room object, Im curious as to how it would be destroyed but thats for another day...
keeping a running total is what I want to do, but just want to use an item to make it a little more realistic. Once I get around to it, I'm probably going to play around with the blackjack snippet and see if I cann't make it do what I want it to do.
Got the Blackjack snippet, and from the looks of it, it seems incomplete.
In any case, working on modifying the cards struct that came with it, changing things to a more defined state
const struct mycards allcards[52]={
{2c, "2 of clubs"},
{2h, "2 of hearts"},
{2d, "2 of diamonds"},
{2s, "2 of spades"},
Just curious if this setup will work, or if I'm going to have to change everything around...
Edit #1
Or would using something like
{021, "2 of clubs" },
{031, "3 of clubs" },
work better?
Edit #2
Cleaned up the code for the blackjack snippet some. Looking through it, it has added in cards_[insert difrent word here] to flag players as playing or not playing. Question is, do I need to add fields to save these flags, or can I set cards_notplaying to a default somehow?