@@ -30,7 +30,7 @@ describe('GameCustomSetting', (it, beforeEach) => {
30
30
settingsFrozen : GameDescription . kDefaultSettings ,
31
31
settings : [
32
32
new Setting (
33
- 'deathmatch' , 'objective' , new ObjectiveSetting , { type : 'Last man standing ' } ,
33
+ 'deathmatch' , 'objective' , new ObjectiveSetting , { type : 'Continuous ' } ,
34
34
'Objective' )
35
35
] ,
36
36
} ) ;
@@ -57,7 +57,7 @@ describe('GameCustomSetting', (it, beforeEach) => {
57
57
] ,
58
58
[
59
59
'Objective' ,
60
- 'Last man standing ' ,
60
+ 'Continuous ' ,
61
61
]
62
62
] ) ;
63
63
@@ -69,72 +69,30 @@ describe('GameCustomSetting', (it, beforeEach) => {
69
69
70
70
assert . isTrue ( settings . has ( 'deathmatch/objective' ) ) ;
71
71
assert . typeOf ( settings . get ( 'deathmatch/objective' ) , 'object' ) ;
72
- assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , { type : 'Last man standing' } ) ;
73
-
74
- // (3) Gunther is able to start a Last man standing game.
75
- gunther . respondToDialog ( { listitem : 2 /* Objective */ } ) . then (
76
- ( ) => gunther . respondToDialog ( { listitem : 0 /* Last man standing */ } ) ) . then (
77
- ( ) => gunther . respondToDialog ( { listitem : 0 /* Start the game! */ } ) ) ;
78
-
79
- settings = await commands . determineSettings ( description , gunther , params ) ;
80
- assert . isNotNull ( settings ) ;
81
-
82
- assert . isTrue ( settings . has ( 'deathmatch/objective' ) ) ;
83
- assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , { type : 'Last man standing' } ) ;
84
-
85
- assert . equal ( gunther . getLastDialogAsTable ( ) . rows . length , 3 ) ;
86
- assert . deepEqual ( gunther . getLastDialogAsTable ( ) . rows [ 2 ] , [
87
- 'Objective' ,
88
- 'Last man standing' ,
89
- ] ) ;
90
-
91
- if ( false ) {
92
- // (4) Gunther is able to start a Best of... game.
93
- gunther . respondToDialog ( { listitem : 2 /* Objective */ } ) . then (
94
- ( ) => gunther . respondToDialog ( { listitem : 1 /* Best of... */ } ) ) . then (
95
- ( ) => gunther . respondToDialog ( { inputtext : 'banana' /* invalid */ } ) ) . then (
96
- ( ) => gunther . respondToDialog ( { response : 1 /* try again */ } ) ) . then (
97
- ( ) => gunther . respondToDialog ( { inputtext : '9999' /* invalid */ } ) ) . then (
98
- ( ) => gunther . respondToDialog ( { response : 1 /* try again */ } ) ) . then (
99
- ( ) => gunther . respondToDialog ( { inputtext : '42' /* valid */ } ) ) . then (
100
- ( ) => gunther . respondToDialog ( { listitem : 0 /* Start the game! */ } ) ) ;
101
-
102
- settings = await commands . determineSettings ( description , gunther , params ) ;
103
- assert . isNotNull ( settings ) ;
104
-
105
- assert . isTrue ( settings . has ( 'deathmatch/objective' ) ) ;
106
- assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , { type : 'Best of...' , kills : 42 } ) ;
107
-
108
- assert . equal ( gunther . getLastDialogAsTable ( ) . rows . length , 3 ) ;
109
- assert . deepEqual ( gunther . getLastDialogAsTable ( ) . rows [ 2 ] , [
110
- 'Objective' ,
111
- '{FFFF00}Best of 42 rounds' ,
112
- ] ) ;
72
+ assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , { type : 'Continuous' } ) ;
113
73
114
- // (5 ) Gunther is able to start a First to... game.
74
+ // (3 ) Gunther is able to start a # of lives game.
115
75
gunther . respondToDialog ( { listitem : 2 /* Objective */ } ) . then (
116
- ( ) => gunther . respondToDialog ( { listitem : 2 /* First to... */ } ) ) . then (
117
- ( ) => gunther . respondToDialog ( { inputtext : 'banana' /* invalid */ } ) ) . then (
118
- ( ) => gunther . respondToDialog ( { response : 1 /* try again */ } ) ) . then (
119
- ( ) => gunther . respondToDialog ( { inputtext : '9999' /* invalid */ } ) ) . then (
120
- ( ) => gunther . respondToDialog ( { response : 1 /* try again */ } ) ) . then (
121
- ( ) => gunther . respondToDialog ( { inputtext : '31' /* valid */ } ) ) . then (
76
+ ( ) => gunther . respondToDialog ( { listitem : 0 /* Number of lives... */ } ) ) . then (
77
+ ( ) => gunther . respondToDialog ( { inputtext : '5' /* five lives */ } ) ) . then (
122
78
( ) => gunther . respondToDialog ( { listitem : 0 /* Start the game! */ } ) ) ;
123
79
124
80
settings = await commands . determineSettings ( description , gunther , params ) ;
125
81
assert . isNotNull ( settings ) ;
126
82
127
83
assert . isTrue ( settings . has ( 'deathmatch/objective' ) ) ;
128
- assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , { type : 'First to...' , kills : 31 } ) ;
84
+ assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , {
85
+ type : 'Number of lives...' ,
86
+ lives : 5 ,
87
+ } ) ;
129
88
130
89
assert . equal ( gunther . getLastDialogAsTable ( ) . rows . length , 3 ) ;
131
90
assert . deepEqual ( gunther . getLastDialogAsTable ( ) . rows [ 2 ] , [
132
91
'Objective' ,
133
- '{FFFF00}First to 31 kills ' ,
92
+ '{FFFF00}Lives (5) ' ,
134
93
] ) ;
135
- }
136
94
137
- // (6 ) Gunther is able to start a Time limit... game.
95
+ // (4 ) Gunther is able to start a Time limit... game.
138
96
gunther . respondToDialog ( { listitem : 2 /* Objective */ } ) . then (
139
97
( ) => gunther . respondToDialog ( { listitem : 1 /* Time limit... */ } ) ) . then (
140
98
( ) => gunther . respondToDialog ( { inputtext : 'banana' /* invalid */ } ) ) . then (
@@ -157,7 +115,7 @@ if (false) {
157
115
'{FFFF00}Time limit (12 minutes)' ,
158
116
] ) ;
159
117
160
- // (7 ) Gunther is able to start a Continuous game.
118
+ // (5 ) Gunther is able to start a Continuous game.
161
119
gunther . respondToDialog ( { listitem : 2 /* Objective */ } ) . then (
162
120
( ) => gunther . respondToDialog ( { listitem : 2 /* Continuous */ } ) ) . then (
163
121
( ) => gunther . respondToDialog ( { listitem : 0 /* Start the game! */ } ) ) ;
@@ -171,10 +129,10 @@ if (false) {
171
129
assert . equal ( gunther . getLastDialogAsTable ( ) . rows . length , 3 ) ;
172
130
assert . deepEqual ( gunther . getLastDialogAsTable ( ) . rows [ 2 ] , [
173
131
'Objective' ,
174
- '{FFFF00} Continuous' ,
132
+ 'Continuous' , // default value
175
133
] ) ;
176
134
177
- // (8 ) Gunther should be able to opt out of the dialog immediately.
135
+ // (6 ) Gunther should be able to opt out of the dialog immediately.
178
136
gunther . respondToDialog ( { listitem : 2 /* Objective */ } ) . then (
179
137
( ) => gunther . respondToDialog ( { listitem : 1 /* Time limit... */ } ) ) . then (
180
138
( ) => gunther . respondToDialog ( { inputtext : 'banana' /* invalid */ } ) ) . then (
@@ -185,6 +143,6 @@ if (false) {
185
143
assert . isNotNull ( settings ) ;
186
144
187
145
assert . isTrue ( settings . has ( 'deathmatch/objective' ) ) ;
188
- assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , { type : 'Last man standing ' } ) ;
146
+ assert . deepEqual ( settings . get ( 'deathmatch/objective' ) , { type : 'Continuous ' } ) ;
189
147
} ) ;
190
148
} ) ;
0 commit comments