-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDesign Document.txt
254 lines (196 loc) · 9.17 KB
/
Design Document.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
There should be at least 2 modules
1. Core gameplay handled by java
Duel object - used for handling an overall game state, 2 players, and keeping to the rules
(abstract class so front ends can extend how to interact with certain game elements)
2 Players
Logger
turnOwner
currentPhase
triggerHandler
setup()
-initalize zones per rules
-Stock
-Clock
-Level
-Stage(center and back)
-Hand
-Deck
-Waiting Room,
-Memory
-Resolution
-obtain decks
-load all cards, set the owner and master to the respective players
-check deck restrictions
pregame()
-begin game setup interactions *(overridable method)
- shuffle decks, place on deck zone
- randomly determine who goes first (*overridable method)
- draw 5 and mill, redraw up to 5
startTurn(player)
-go through the phases.
- When End Phase is done, start turn of other player.
endGame(condition)
-based on the condition, determine who won and who lost (or a draw)
- send game information somewhere?
-declare the game over and exit execution.
Helper Functions - helper functions for scripts to preform effects
-getZoneGroupCount(player zoneOwner, zone, searchCriteria)
Phase Object Interface - objects will implement this to preform a phase
checkTiming(CheckTiming) - this may not belong here, could be hell, checktimings are VERY SPECIFIC
playTiming(Phase) - overridable for obvious reasons
moveToNextPhase()
Timing interface throws LoseCondition - holder for check timings and play timings
-CheckTiming object throws LoseCondition
-handles checkTimings whenever they could occur
-PlayTiming object throws LoseCondition
--handles how a player goes about thier turn, most of the game occurs in these objects
Card object - holds all information about a particular card and the states during a match
-General card properties
- card name, jp name, english name
-needs to be localized? any effect that includes names should be able to look for cards via english or japan name
- ID
- level
- Cost
- Trigger Icon(s)
- Description
- Power
- SoulCount
- trait(s)
- Color
- Affiliation (Weiss, Schwarz, or both)
- Effect(s)
- Attributes
- Picture
-During play properties
- battleOpponent
- attacking
- being attacked
- UID - needed to distinguish this particular card from other cards)
getPicture()
-returns the picture form of this card)
registerEffect(card)
-does a validation to make sure this is a valid effect
-adds the effect to the card
- REMEMBER, all character cards get auto encore
Ability Object - "An ability refers to an instruction generated by a card text or an effect"
Ability Categories:
- Act - "can be executed by a player witha playing timing by paying the cost"
- Auto - "automatically played as a result of a designated situation occurring during the game. "
- Cont - "abilities which event some effect for the duration that ability is in effect."
"
Effect object - holds an effect that occurs during gameplay
-Effects must have a declared Ability
-Auto
-Cont
-Act
-Effects may have a declared cost
-some cost templates
-Pay (discard from stock into waiting room)
-Discard (discard from hand into waiting room)
-Mill (reveal top card of deck, send to waiting room
-Rest (turn some card(s) sideways
-some effects have a time limit
-Until end of turn
-Until end of next turn
-Until end of opponents next turn
-effects may have keywords, and keywords we will add
-
createEffect(EffectAbility)
- static method to return a blank effect with the given ability
- abiltiies: (ACT, con, AUTO)
setCategory()
- determines what type of effect this
- One shot
- Continuous
- Replacement
setCondition(boolean)
- sets whether the effect currently meets the conditions to preform at this moment in time
-this doesnt take into effect blocking effects, and may need to be refactored
setOptional(EffectOptional)
-Whether the player MUST preform this effect, or if it's "you may"
setCode(EffectCode)
-the big one, these codes determine what type of effect the card preforms
- works alongside "target" and "value" to produce a complete effect
setTarget(EffectTarget)
-Sets what the target of this effect is, (the card itself, a choice, all in front row, etc)
setValue(object vararg?)
-works with setCode to set the value for a particular effect
setTrigger(EffectTrigger)
-The Trigger needed for this ability to activate
setCost(Cost)
-Sets the cost to preform this action,
setRepeatUpTo(int)
-set the number of times this effect repeats, up to a number)
EffectCost object - holds preset handlings of what to do for effect-based costs
-costs include
-paying
-discarding
-send to "zone"
-Resting
append(EffectCost)
-add a specific cost to this cost, so the game can handle all at once (in order)
EffectTrigger objects - holds (enums or functions?) for cardTriggers
-should be registered by the game's cardTrigger handler
EffectsListener -
RuleAction object (throwable?)- predefined rule actions that the rule defines and actions happen when they occur
-inturrupt type, which halts game entirelly and proceeds to do function
-check type, happens during check timings
-look at the rules for what should be defined and how to carry them out.
DuelUtil object - holds functions that a user can call in scripting to preform actions to the game
- this function will be exposed to scripting as "Duel"
move(card, PlayZone) [private]
-moves a card to another location
- moveCardOnStage
- SendCardToZone
- SendCardToMemory
- SendCardToHand
PlayZone object - interface that represents one of the squares on a playing mat.
- will be extended for each specific zone
- in the event a zone cant preform a certain action..exception handling may need to be added to all functions.
common states:
--hidden or public zone
common functions:
* add (add a card to a zone)
* remove (remove a specific card from a zone)
* clear (clear a zone of all cards)
* contains ( see if a zone contains a card)
+ get name (enum name of zone)
+ get zone type (hidden or public)
* size (number of cards inside zone)
* isEmpty (if no cards)
+ getContents (get the cards that are in the zone)
+ replace (exchange first card with a second card) (for clock shifts.)
StackZone object - a zone that could be represented in a queue or a stack (e.g. a stack of cards if IRL)
common functions:
- addBottom (add a card to the bottom of the stack of cards)
* add (adds a card to the top of the stack)
* add multiple
* remove multiple
* remove bottom
* Pop (remove a card from the top)
* Pop multiple
* Peek (look at the card on the top)
* Peek Multiple
* setContents
SingleCardZone object - a zone that only has to hold 1 card
common functions:
* getLastCard (gets a reference to the last card that was in the zone (or null)
MultiCardZone object - a zone that holds cards in a list format
common functions:
The Stage Zones -
BackStageZone
- gets references to the two that are in front of it based on name
FrontRowStageZone
-gets references to the list of zones that are behind it based on name
2. a Swing Frontend that interacts with the backend for gameplay
this allows us to freely modify the front end for future things (web front-end,
C# frontend, etc)
things to think about:
- First connection method should be direct IP. makes for easy lan and direct internet
- server room browser? (requires having a always-on-game server
-exposed classes:
-everything we must expose to lua for the scripts to function properly
-Duel Object
-ALL enum values
-SearchCriteria object
-DuelUtil object