(no commit message)
[asgard.git] / docs / reqs / rpg_rev0.1.1.txt
blob6a8d080654f8564ad4cf8f0107c932a98289ed92
1 Battle
2 ===================================================
3         -party1: Party
4         -party2: Party
6         -controller: ConsoleController
7         A link to the controller.  Set by the ConsoleController.
9         -view: ConsoleView
10         A link to the view.  Set by the ConsoleController.
12         -currentTime: int
13         The number of iterations of the gameLoop since the battle began.
15         +Battle()
16         Instantiates and populates Party and Fighter objects.
18         +executeNextEvent(ct: int, cont: ConsoleController): boolean 
19         Query the two parties to see if there are any events that can be generated this iteration of the game loop.  Return whether or not the event was executed or not.
21         +getCurrentTime(): int
22         +setCurrentTime(ct: int): void
23         +getParty1(): Party
24         +getParty2(): Party
26         +setView(v: ConsoleView): void
27         Sets the view object link.  Used by ConsoleController.
29         +setController(c: ConsoleView): void
30         Sets the controller object link.  Used by ConsoleController.
32 ConsoleController
33 ===================================================
34         -battle: Battle
35         A link to the Battle.  Set by constructor.
37         -view: ConsoleView
38         A link to ConsoleView.  Set by constructor.
40         -ConsoleController(b: Battle, v: ConsoleView)
41         Sets the links for Battle and ConsoleView so that each of them can ConsoleController and themselves.  Afterwards, the game loop starts.
43         +getCommand(f: Fighter): string
44         Prints out an event selection menu and collects a choice from the user.
46         -gameLoop(): void
47         Print out the state of affairs before the battle begins.        
49         Loop until one of the parties dies, pausing for some duration each iteration.  After the pause, increment the current time of the battle.  Then, execute all the events that are available for execution this iteration.  Print out the state of affairs.
51 ConsoleView
52 ===================================================
54         A lot of the methods in this class require a lot of printing.  The print outs should be compact and organized, utilizing the real estate of each line of output.
57         -battle: Battle
58         A link to the battle.  Set by the ConsoleController.
59         
60         -controller: ConsoleController
61         A link to the controller.  Set by the ConsoleController.
63         +ConsoleView()
65         +printParty(p: Party): void
66         Prints out the stats for all the fighters in a party.  Groups those fighters together.
68         +printFighter(f: Fighter): void
69         Print out the state of the given fighter.  This should include all stats and equiption.
71         +printEvent(e: Event): void
72         Print an event's stats.  Nothing special, just the attacker, defender, and type.
74         +printEquiption(eq: Equiption): void
75         Print out equiption information.
77         +printEventTypeMenu(f: Fighter): void
78         Print out an enumerated list of events (menu) that a Fighter can actually do.  This list can be accesed through the Fighter's getEventTypes method.  Keep the same formate as printEventTypeMenu().
80         +printEnemySelectMenu(p: Party): void
81         Print out an enumerated list of fighters (menu) that a the user can select.  Keep the same format as printEventTypeMenu().
83         +printState(): void
84         Then print the state of the parties.
86         +setBattle(b: Battle): void
87         Sets the battle object link.  Used by ConsoleController.
88         
89         +setController(c: ConsoleController): void
90         Sets the controller object link.  Used by ConsoleController.
92 Event
93 ===================================================
94         -attacker: Fighter
95         The Fighter that initiated the event.
97         -defender: Fighter
98         The Fighter affected by the event.
100         -type: string
101         The type of event to be executed.  Currently there is only "Attack".
103         +Event(atk: Fighter,def: Fighter, attackType: string)
104         Initializes and populates the event.  Used by Fighter.makeEvent() either by AI or user choice.
106         +getAttacker(): Fighter
107         +getDefender(): Fighter
108         +getType(): string
111         +execute():string
112         Only handles "Attack" event:
114         If the Attacker succeeds in hitting the Defender, compute the hp loss and subtract that from the defender.
116 Equiption
117 ===================================================
118         -head: string
119         A string representing the head equiption.
121         -armor: string
122         A string representing the armor equiption.
124         -left: string
125         A string representing the left hand/arm equiption.
127         -right: string
128         A string representing the right hand/arm equiption.
130         +Equiption(head: string, armor: string, left: string, right: string)
131         Initialize and populate the Equiption object.
133         +getHead(): string
134         +setHead(head: string): void 
135         +getArmor(): string
136         +setArmor(armor: string): void 
137         +getLeft(): string
138         +setLeft(left: string): void 
139         +getRight(): string
140         +setRight(right: string): void 
142         +computeAtkMod(): int
143         Compute Attack value modifiers from equiption data.  Current hard coded.
145         +computeDefMod(): int
146         Compute Defense value modifiers from equiption data.  Current hard coded.
147         
148         +computeEvaMod(): int
149         Compute Evasion value modifiers from equiption data.  Current hard coded.
152 Fighter
153 ===================================================
154 This object represents playable and non-playable battle participants.
156         -name: string
157         Name of the fighter.  Let's keep it down to 15 characters.
158         
159         -hp: int
160         Health Points.  No more than 1,000,000.
162         -strength: int
163         Affects "Attack" events.  Fall between 1 and 255.
165         -dexterity: int
166         Affects "Evasion."  Falls between 1 and 255.
168         -timeOfMove: int
169         Time that the Fighter gets to move next.
171         -playable: boolean
172         Whether the user get to decide this Fighter course of action or not.
174         +getName(): string
175         +setName(name:string): void
176         +getHp(): int
177         +setHp(hp:int): void
178         +getStrength(): int
179         +setStrength(str:int): void
180         +getDexterity(): int
181         +setDexterity(dex:int): void
183         +getAttack(): int
184                 Computes attack statistic, taking into account all modifiers.
186         +getDefense(): int
187                 Computes defense statistic, taking into account all modifiers.
188         
189         +getEvade(): int
190                 Computes evasde statistic, taking into account all modifiers.
192         +makeEvent(enemy: Party, currentTime: int, controller: ConsoleController): Event
193                 
194                 If the Fighter is ready to move (when the current time is the time of the player's next move).  There are two cases:
195                 
196                 Case #1:  Fighter is playable.
197                 An event selection menu is displayed, and an event type is selected from the user through ConsoleController. 
199                 Case #2:  Fighter is not playable
200                 A random enemy (alive) from the enemy party is selected.  Next, an event type is selected (at the moment "Attack" is the only type) from the list returned from getEventTypes().   Finally an Event is constructed and returned.
202                 Return the None object if the Fighter is not ready to move.
204         +isAlive(): boolean
205                 Return true if hp is greater than 0, false otherwise.
207         +getEventTypes(): string[]
208                 Return a list of event types available to this player.  (Currently only return Attack)  Feel free to hard code.
210 Party
211 ===================================================
212         -fighters: Fighter[]
213         A list of fighter representing a party.  Between 1 and 6.
215         +Party()
216         Instantiate the object.  Nothing special.
218         +isAlive(): boolean
219         Is the party still alive?  Is there a fighter in the party that's still alive?
221         +getNextEvent(enemy: Party, ctime: int, c:ConsoleController): Event
222         Find the first fighter in the party that is ready to generate an event.  Return that event.  If no events available, return the None object.
224         +addFighter(fighter: Fighter): boolean
225         Add a fighter to the party.
227         +getFighter(findex: int): Fighter
228         Get a fighter from the party.
230         +sizeOfParty(): int
231         Return a list indicating the size of the party.  This should include dead members.