Homework 5, Solitaire Conquest
Short Description:
Write a program which will allow a user to play the game Solitaire Conquest.
This assignment is worth 100 points.
Goals
When you finish this homework, you should:
- Strengthened your skills with c++ data structures.
Formal Description
Read the rules for the game at Warp Spawn Games or my local copy (modified slightly for readability). You are to write a program which will allow a user to play this game.
For clarity in the RAISE ARMY PHASE:
- You must take at least three cards from the top of the ally deck.
- If you can not take three cards you must battle with the cards you can take.
I found the REINFORCEMENT PHASE of the rules somewhat confusing. This is my
interpretation:
- You may take as may additional ally cards as you wish.
- You are not required to take a card during this phase.
I also had some trouble with the MARCH PHASE. My interpretation is:
- You may attack either the horde on the left or on the right as long as there is a horde on the given side.
The some details of the CONQUEST PHASE are detailed further below.
Your game should begin by creating your two decks. These should be created by
reading the files foeDeck.dat and
allyDeck.dat. Each deck will contain with exactly
44 cards. The format is as follows:
- Each line of each file contains a card description.
- The first value is an integer representing the force value of the card.
- The second value is a character, identifying the type of the card.
- The third value is an integer representing the number of cards of this type in the deck.
- The fourth value is a string representing the name of the card. The name will not contain a comma.
- Optional fifth, sixth and seventh fields are indicated by a comma following the name. These field represent special bonuses.
- The fifth field represents the type of card effected by bonus. The is the bonus target
- The sixth field represents how the bonus is applied. This is the bonus type field.
- The seventh field represents the amount of the bonus. This is the bonus amount field.
Ally bonuses are applied as follows:
- If the bonus type field is a +: Check the opposing horde deck. If it contains any of the type in the bonus target field add to bonus amount to the force value of this card.
- If the bonus type field is an =: Check the ally deck. If it contains any of the type in the bonus target field, add the bonus amount to the force value of the ally card. The current card will not receive the bonus.
Example:
If the horde deck contains:
Stone Giant (2)
Orc Warband (3)
White Dragon (3)
Blue Dragon (6)
Since there are two dragons in the horde, the horde receives a +1 force bonus
The foe force would be 15, 2+3+3+6 +1 (bonus for two dragons)
And the Ally deck contains:
Elf Scouts (1)
Swordsmen (2)
Knights (5) D +1
Wizard (6) M =1
The Knight gains a +1 force since it is opposing dragons.
The Wizard adds a +1 bonus to all other men (Swordsmen and Knight)
The ally force would be
1 (Elf Scouts)
+ 2+1 (Swordsmen, +1 for Wizard)
+ 5+1+1 (Knights, +1 for dragons + 1 for Wizard)
+ 6 (Wizard)
=====
17
The game should perform the following steps:
- Shuffle the decks.
- Select a random start point for the player.
- Deal the foe cards four at a time onto the game board. Do not put any foe cards on the player's starting point.
- Play the game
- Report points, victory or loss quality (see FAQ question 5).
While playing the game, you should inform the player fully of the condition
of the game board. The following is an example presentation, you may alter this
if you wish.
Turn 1:
You are on square 5.
To your left (square 4) is a horde with a force of 8, containing:
Hill Giant,
Hill Giant,
Goblin Warparty,
White Dragon
To your right (square 6) is a horde with a force of 15, containing:
Stone Giant,
Orc Warband,
White Dragon,
Blue Dragon
Your current Ally deck has a force of 9 and contains:
Elf Scouts,
Swordsmen,
Knights
Do you wish to draw another card? Y
You draw the Wizard card.
You are on square 5.
To your left (square 4) is a horde with a force of 8, containing:
Hill Giant,
Hill Giant,
Goblin Warparty,
White Dragon
To your right (square 6) is a horde with a force of 15, containing:
Stone Giant,
Orc Warband,
White Dragon,
Blue Dragon
Your current Ally deck has a force of 17 and contains:
Elf Scouts,
Swordsmen,
Knights,
Wizard
Do you wish to draw another card? N
Do you wish to attack to the left? N
You attack to the right.
Your force is 17, the horde to the right has a force of 15.
You win the battle.
Turn 2:
Discussion
- Your game should be fully interactive, with attractive output, which
provides the player with sufficient information to understand what
is happening and play the game.
- You may not use deck.h from the previous assignment.
- You may not use containers from the STL for this assignment.
- You may, if you wish, implement your cards as a class. We will begin discussion
of classes while you are working on this program.
- You should probably do a preliminary design on this set of programs.
- You should probably write some experimental code, and then revise your design.
- You should create a sub-directory and perform all work for this project within this directory. This will make the creation of the tar file easier.
- If you need help, you should ask.
- Please do not put this work off until the weekend before it is due.
Required Files
You should submit the following in a tar file:
- All source code required to build all programs.
- A makefile which will build all programs as well as clean the directory
- A README describing
- Author identification information
- The project
- Problems encountered
- Any portions of the code which are not working.
- Any unique features of the code.
- Any other information you wish to share.
You should not submit
- Object files or executable.
- Core files.
- Source code files which are not related to the project.
Submission
Please create a tar file containing the files described above. Email this file to danbennett360@gmail.com by class time of the due date.