InvaiderZim
New Member
- Reaction score
- 2
I have a some what of a simple problem that alot of you have the experience to solve. I'm trying to make a deck of cards. Then shuffle the cards and deal them out to the players. I made the deck, i shuffled the deck, but when i deal the cards, i cant change the owner of the cards to match the suits.
For example: I would like Hearts to be Red, Diamonds to be pink, etc...
Here is what i got so far:
For example: I would like Hearts to be Red, Diamonds to be pink, etc...
Here is what i got so far:
Trigger:
- Deck
- Events
- Map initialization
- Conditions
- Actions
- Set Number_of_Cards = 52
- Set The_Deck[1] = 2 Heart
- Set The_Deck[2] = 3 Heart
- Set The_Deck[3] = 4 Heart
- Set The_Deck[4] = 5 Heart
- Set The_Deck[5] = 6 Heart
- Set The_Deck[6] = 7 Heart
- Set The_Deck[7] = 8 Heart
- Set The_Deck[8] = 9 Heart
- Set The_Deck[9] = 10 Heart
- Set The_Deck[10] = Jack Heart
- Set The_Deck[11] = Queen Heart
- Set The_Deck[12] = King Heart
- Set The_Deck[13] = Ace Heart
- Set The_Deck[14] = 2 Diamond
- Set The_Deck[15] = 3 Diamond
- Set The_Deck[16] = 4 Diamond
- Set The_Deck[17] = 5 Diamond
- Set The_Deck[18] = 6 Diamond
- Set The_Deck[19] = 7 Diamond
- Set The_Deck[20] = 8 Diamond
- Set The_Deck[21] = 9 Diamond
- Set The_Deck[22] = 10 Diamond
- Set The_Deck[23] = Jack Diamond
- Set The_Deck[24] = Queen Diamond
- Set The_Deck[25] = King Diamond
- Set The_Deck[26] = Ace Diamond
- ETC....
- Events
Trigger:
- Suffle Deck
- Events
- Player - Player 1 (Red) types a chat message containing -s as An exact match
- Player - Player 2 (Blue) types a chat message containing -s as An exact match
- Player - Player 3 (Teal) types a chat message containing -s as An exact match
- Player - Player 4 (Purple) types a chat message containing -s as An exact match
- Conditions
- Actions
- Trigger - Run Deck <gen> (ignoring conditions)
- For each (Integer A) from 1 to 52, do (Actions)
- Loop - Actions
- Set Temp_Int = (Random integer number between 1 and 52)
- Set Shuffled_Deck[(Integer A)] = The_Deck[Temp_Int]
- Set The_Deck[Temp_Int] = The_Deck[Number_of_Cards]
- Set Number_of_Cards = (Number_of_Cards - 1)
- Loop - Actions
- Trigger - Run Deal Cards <gen> (ignoring conditions)
- Events
Trigger:
- Deal Cards
- Events
- Conditions
- Actions
- Unit - Create 1 Shuffled_Deck[1] for Player 1 (Red) at (Center of First Card <gen>) facing Default building facing degrees
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to 2 Heart
- (Unit-type of (Last created unit)) Equal to 3 Heart
- (Unit-type of (Last created unit)) Equal to 4 Heart
- (Unit-type of (Last created unit)) Equal to 5 Heart
- (Unit-type of (Last created unit)) Equal to 6 Heart
- (Unit-type of (Last created unit)) Equal to 7 Heart
- (Unit-type of (Last created unit)) Equal to 8 Heart
- (Unit-type of (Last created unit)) Equal to 9 Heart
- (Unit-type of (Last created unit)) Equal to 10 Heart
- (Unit-type of (Last created unit)) Equal to Jack Heart
- (Unit-type of (Last created unit)) Equal to Queen Heart
- (Unit-type of (Last created unit)) Equal to King Heart
- (Unit-type of (Last created unit)) Equal to Ace Heart
- Then - Actions
- Do nothing
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to 2 Diamond
- (Unit-type of (Last created unit)) Equal to 3 Diamond
- (Unit-type of (Last created unit)) Equal to 4 Diamond
- (Unit-type of (Last created unit)) Equal to 5 Diamond
- (Unit-type of (Last created unit)) Equal to 6 Diamond
- (Unit-type of (Last created unit)) Equal to 7 Diamond
- (Unit-type of (Last created unit)) Equal to 8 Diamond
- (Unit-type of (Last created unit)) Equal to 9 Diamond
- (Unit-type of (Last created unit)) Equal to 10 Diamond
- (Unit-type of (Last created unit)) Equal to Jack Diamond
- (Unit-type of (Last created unit)) Equal to Queen Diamond
- (Unit-type of (Last created unit)) Equal to King Diamond
- (Unit-type of (Last created unit)) Equal to Ace Diamond
- Then - Actions
- Unit - Change ownership of (Last created unit) to Player 8 (Pink) and Change color
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Last created unit)) Equal to 2 Club
- (Unit-type of (Last created unit)) Equal to 3 Club
- (Unit-type of (Last created unit)) Equal to 4 Club
- (Unit-type of (Last created unit)) Equal to 5 Club
- (Unit-type of (Last created unit)) Equal to 6 Club
- (Unit-type of (Last created unit)) Equal to 7 Club
- (Unit-type of (Last created unit)) Equal to 8 Club
- (Unit-type of (Last created unit)) Equal to 9 Club
- (Unit-type of (Last created unit)) Equal to 10 Club
- (Unit-type of (Last created unit)) Equal to Jack Club
- (Unit-type of (Last created unit)) Equal to Queen Club
- (Unit-type of (Last created unit)) Equal to King Club
- (Unit-type of (Last created unit)) Equal to Ace Club
- Then - Actions
- Unit - Change ownership of (Last created unit) to Player 11 (Dark Green) and Change color
- Else - Actions
- If - Conditions