-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
640 lines (621 loc) · 11.9 KB
/
main.js
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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
class App {
constructor(rootEl, slides) {
const currentSlideId = localStorage.getItem('currentSlideId') || 0;
this.slides = slides;
this.rootEl = rootEl;
this.setCurrentSlideId(currentSlideId);
this.updateCurrentSlide();
}
updateCurrentSlide = () => {
this.currentSlide = this.slides.find(({ id }) => id === this.currentSlideId);
this.render();
}
setCurrentSlideId = (id) => {
this.currentSlideId = Number(id);
localStorage.setItem('currentSlideId', this.currentSlideId);
}
createEl = (tag, props = {}) => {
let element = document.createElement(tag);
Object.keys(props).forEach((prop) => (element[prop] = props[prop]));
element.tabIndex = 0;
this.rootEl.appendChild(element);
};
onClick = (slideId) => {
const slide = this.slides.find(({ id }) => id === slideId);
if (slide) {
this.setCurrentSlideId(slideId);
this.updateCurrentSlide();
} else if (slideId === 100) {
window.location = 'https://www.fedsimulator.com';
}
};
displayCurrentSlide = () => {
const { id, type, text } = this.currentSlide;
return this.createEl('div', {
className: [ 'slide', 'slide-' + id, type ].join(' '),
innerText: text
});
};
displayOption = (option) =>
this.createEl('div', {
className: 'option',
innerText: option.text,
onclick: () => this.onClick(option.goto),
onkeypress: () => this.onClick(option.goto)
});
clearSlide = () => {
this.rootEl.innerHTML = '';
this.rootEl.className = 'slide-' + this.currentSlide.id;
};
render = () => {
this.clearSlide();
let currentView = this.displayCurrentSlide();
this.currentSlide.options.forEach((option) => {
currentView += this.displayOption(option);
});
return currentView;
};
}
const slides = [
{
id: 0,
type: 'intro',
text: 'Fed Sim - story mode',
options: [
{
goto: 1,
text: 'Start'
},
{
goto: 100,
text: 'Go to fedsimulator.com'
}
]
},
{
id: 1,
type: 'decision',
text: 'Its your debut match against Sheamus!',
options: [
{
goto: 2,
text: 'Start the match with a superkick'
},
{
goto: 2,
text: 'Start the match with a quick rollup'
}
]
},
{
id: 2,
type: 'loss',
text: 'Sheamus knows its coming and kicks you right in the face for the 3 count \n\n Vince wants a word',
options: [
{
goto: 3,
text: 'Go chat to the boss'
}
]
},
{
id: 3,
type: 'scene',
text:
'Losing is part of the business - try to make an impact \n\n Show me some ruthless agression, some attitude...',
options: [
{
goto: 4,
text: 'Vince has an idea...'
}
]
},
{
id: 4,
type: 'decision',
text: 'We could try tag competition to ease you in... \n\n Do you want to be part of a tag team?',
options: [
{
goto: 5,
text: 'Yeah, pair me with your best!'
},
{
goto: 26,
text: "Forget that, I'm born to be a solo star!"
}
]
},
{
id: 5,
type: 'scene',
text: 'You are teamed with the phenomenal one A.J Styles!! You both decide to work towards the tag titles',
options: [
{
goto: 6,
text: 'You take over a segment on the tv taping'
}
]
},
{
id: 6,
type: 'scene',
text: 'Other teams are gathering and things get heated',
options: [
{
goto: 7,
text: 'A match is being made...'
}
]
},
{
id: 7,
type: 'match',
text: 'A Tag Team Battle Royal is taking place',
options: [
{
goto: 9,
text: 'Go for victory: charge at the last competitor'
},
{
goto: 8,
text: 'Play it cool: wait in the corner and go for a suprise superkick'
}
]
},
{
id: 8,
type: 'win',
text:
"You kicked them right out! \n\n You win the Tag Team Battle Royal!! \n\n Now you'll get a tag team championship match at the next pay per view!",
options: [
{
goto: 11,
text: "We're ready to fight!"
}
]
},
{
id: 9,
type: 'loss',
text: 'You lost the tournament, nevermind, oh wait the boss wants to have a chat',
options: [
{
goto: 10,
text: 'Listen to some constructive criticism'
}
]
},
{
id: 10,
type: 'scene',
text: 'Pull your weight! Lets try rebranding you',
options: [
{
goto: 5,
text: "Let's repackage your team"
}
]
},
{
id: 11,
type: 'match',
text: 'Your PPV match begins \n\n You have the advantage - time to finish the Usos off',
options: [
{
goto: 12,
text: 'Hit the Diving forearm driver'
},
{
goto: 13,
text: 'Hit the Phenomenal driver!'
}
]
},
{
id: 12,
type: 'loss',
text: 'No good! It got reversed and now you lost!',
options: [
{
goto: 7,
text: 'Lets train, work hard and take a shot at the next Battle Royal'
}
]
},
{
id: 13,
type: 'win',
text: 'One, two, threeeee! \n\n You win! \n\n New Tag Team Champions!',
options: [
{
goto: 14,
text: "What a night. \n\n Let's go to the next nights TV taping"
}
]
},
{
id: 14,
type: 'match',
text:
'You get attacked by the Usos when cutting your promo \n\n You agree to a rematch for the title, right NOW',
options: [
{
goto: 16,
text: 'You hit the superkick'
},
{
goto: 15,
text: 'You hit a top rope splash'
}
]
},
{
id: 15,
type: 'loss',
text: 'They roll out the way and pin you for the three. Ouch - you lost but theres still hope',
options: [
{
goto: 11,
text: 'Get a rematch the next pay per view'
}
]
},
{
id: 16,
type: 'win',
text: 'Another victory, now its that time of the year...',
options: [
{
goto: 17,
text: 'Wrestlemania!'
}
]
},
{
id: 17,
type: 'match',
text: 'Its your big Wrestlemania match. You face off against the best in the world',
options: [
{
goto: 19,
text: '...but you still win this match easily'
},
{
goto: 18,
text: 'You lose... theres always next year...'
}
]
},
{
id: 18,
type: 'scene',
text: 'Back to working as hard as we can to get to wrestlemania as the champs again!',
options: [
{
goto: 7,
text: 'Lets do the work'
}
]
},
{
id: 19,
type: 'win',
text: 'What a victory, your both celebrating in the ring!',
options: [
{
goto: 20,
text: 'you turn your back...'
}
]
},
{
id: 20,
type: 'scene',
text: '...grab the chair and smash your partner in the back!',
options: [
{
goto: 21,
text: '"but why?!" the commentators scream!'
}
]
},
{
id: 21,
type: 'decision',
text: '"I will tell you why I turned my back on him!" You scream down the microphone',
options: [
{
goto: 22,
text: "I've always been the one carrying this team, hes nothing compared to me!"
},
{
goto: 23,
text: 'I wanted to go solo all along - call out the boss to discuss what you want to do next'
}
]
},
{
id: 22,
type: 'scene',
text: 'You throw down the title and declare you hated A.J Styles all along and you wanted your own freedom',
options: [
{
goto: 24,
text: 'The boss comes out and accepts the Tag Team Championship, he hands it right over to vacant'
}
]
},
{
id: 23,
type: 'decision',
text: 'The boss comes out and puts you in a handicap match for the tag titles!',
options: [
{
goto: 24,
text: 'You lost, quickly'
}
]
},
{
id: 24,
type: 'loss',
text: 'Now you have lost everything and think its time for a change',
options: [
{
goto: 25,
text: 'You decide to take the next step'
}
]
},
{
id: 25,
type: 'scene',
text: 'You have decided its time to prove yourself alone',
options: [
{
goto: 26,
text: 'Its time to get back in solo competition'
}
]
},
{
id: 26,
type: 'scene',
text: 'This is a big singles match - lets make it count! You will face...',
options: [
{
goto: 27,
text: 'AJ Styles'
}
]
},
{
id: 27,
type: 'match',
text: 'You know each other well - how will you try to win this one?',
options: [
{
goto: 30,
text: 'Superkick'
},
{
goto: 28,
text: 'Running powerslam'
}
]
},
{
id: 28,
type: 'loss',
text:
'Reversal out of nowhere! You eat a your opponents finisher \n\n You go backstage and the boss is staring you out',
options: [
{
goto: 29,
text: 'Time for a pep talk'
}
]
},
{
id: 29,
type: 'scene',
text: '"Sometimes you have to take a half step back to take two forward" - Vince',
options: [
{
goto: 26,
text: "I'll try harder boss"
}
]
},
{
id: 30,
type: 'win',
text: 'You win! Thats a big victory!',
options: [
{
goto: 31,
text: 'Lets take out Randy Orton at pay per view'
}
]
},
{
id: 31,
type: 'match',
text:
'Randy Orton controls the start of the match, you see an opening and do some serious leg damage to him - nows your chance',
options: [
{
goto: 32,
text: 'Set a trap so Randy attempts an RKO - then lock him in a leg crab'
},
{
goto: 28,
text: 'Kick him in the face and try a leverage pin'
}
]
},
{
id: 32,
type: 'win',
text: "He didn't see it coming! You've climbed the ladder!!",
options: [
{
goto: 33,
text: 'Now its time to get a title match'
}
]
},
{
id: 33,
type: 'decision',
text: 'The boss is so impressed by your win streak he lets you choose the title match',
options: [
{
goto: 34,
text: 'One on One versus the WWE Champion'
},
{
goto: 39,
text: 'Triple threat: A.J Styles vs Daniel Bryan vs YOU'
}
]
},
{
id: 34,
type: 'match',
text:
'Daniel Bryan is ready for you and controls most the match, how can you possibly beat such a ring technician',
options: [
{
goto: 35,
text: 'Smash him as hard as you can in the face'
},
{
goto: 37,
text: 'Try to lock him in a submission'
}
]
},
{
id: 35,
type: 'win',
text:
'The champion goes down for the count, you are the NEW WWE Champion! \n\n The former champ is carried off on a stretcher...',
options: [
{
goto: 100,
text: 'Now go play fedsimulator.com to put DB back on top you fickle player'
},
{
goto: 0,
text: 'Go back to the start'
}
]
},
{
id: 36,
type: 'scene',
text: 'new champ scene, the end!',
options: [
{
goto: 100,
text: 'You win! Now go play some fedsimulator.com'
},
{
goto: 0,
text: 'Go back to the start'
}
]
},
{
id: 37,
type: 'loss',
text: 'You should have known a submission victory over Daniel Bryan is impossible - you lose',
options: [
{
goto: 38,
text: 'What could be next for you?'
}
]
},
{
id: 38,
type: 'scene',
text: 'You rest up and decide to get face a new up and comer',
options: [
{
goto: 43,
text: 'Lets face Mustafa Ali'
}
]
},
{
id: 39,
type: 'decision',
text:
'The triple threat for the WWE Champioship title is underway... \n\n Daniel Bryan goes hard, you fight hard \n\n AJ Styles controls both of you',
options: [
{
goto: 40,
text: 'Hit Daniel Bryan with your finisher'
},
{
goto: 42,
text: 'Hit AJ Styles with your finisher'
}
]
},
{
id: 40,
type: 'win',
text: 'Daniel stays down for the three, making you the NEW WWE Champion!',
options: [
{
goto: 41,
text: "It's time to celebrate"
}
]
},
{
id: 41,
type: 'win',
text: "You've reached the top of WWE - you are now the champ!",
options: [
{
goto: 100,
text: 'Go play some full fedsimulator.com simulations'
},
{
goto: 0,
text: 'Go back to the start'
}
]
},
{
id: 42,
type: 'loss',
text: 'AJ Styles is quick and knows your moveset well - he dodges it and hits the Styles Clash on you!',
options: [
{
goto: 38,
text: 'What could be next for you?'
}
]
},
{
id: 43,
type: 'match',
text: 'Mustafa Ali is fast! You go back and forth. After a missed finisher, you see an opening',
options: [
{
goto: 28,
text: 'Roll up Mustafa Ali'
},
{
goto: 30,
text: 'Spear Mustafa and try to lock in a submission'
}
]
}
];
new App(document.getElementById('output'), slides);