-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-en.strand
1260 lines (1105 loc) Β· 30.6 KB
/
main-en.strand
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
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
::start
<<if !this.started>>
<<do
// add `this.gotod(passage, delay)`
this.gotoo = this.goto;
this.goto = (passage) => {
window.clearTimeout(this.auto);
this.auto = 0;
return this.gotoo(passage);
};
this.gotod = (passage, delay) => {
window.clearTimeout(this.auto);
this.auto = window.setTimeout(() => {
this.goto(passage);
}, delay);
};
// middle mouse click to go back in debug
if (this.debug && !window.debugBack) {
window.debugBack = true;
window.addEventListener('pointerdown', (event) => {
if (event.button === 1) {
window.scene.strand.back();
}
});
}
// start with music off in debug
// camera
this.cameraPlaceholder = this.Model('camera_test');
this.cameraPlaceholder.visible = false;
const cameraPlaceholder = this.cameraPlaceholder.model.getChildByName('Camera');
this.scene.camera3d.position = cameraPlaceholder.position;
const camProps = window.resource('camera_test').descriptor.cameras[0].perspective;
this.scene.camera3d.fieldOfView = camProps.yfov / Math.PI * 180;
this.scene.camera3d.near = camProps.znear;
this.scene.camera3d.far = camProps.zfar;
this.groupTop = this.Container3D();
this.groupMiddle = this.Container3D();
this.groupBottom = this.Container3D();
this.groupTop.visible = false;
this.groupBottom.visible = false;
// road + sway
this.roadSpeed = 2;
const roadSize = 100;
this.roadAngle = 20; // degrees
const baseDepth = 85;
const roadSegments = Math.max(3, Math.ceil(this.scene.camera3d.far*2 / roadSize));
this.roadAngle = this.roadAngle / 180 * Math.PI;
const objs = this.Container3D();
this.groupMiddle.container.addChild(objs.container);
const top = this.Model('top', 'palette', { depth: 60 });
this.groupTop.container.addChild(top.model);
const topFarTrees = this.Model('topFarTrees', 'palette', { depth: 75 });
this.groupTop.container.addChild(topFarTrees.model);
const bottom = this.Model('bottom', 'palette', { depth: 65 });
this.groupBottom.container.addChild(bottom.model);
this.van = this.Model('van', 'palette', {depth: 28});
this.groupBottom.container.addChild(this.van.model);
for(let i = 0; i < roadSegments; ++i) {
const road = this.Model('groundPlane_3_20', 'palette', { depth: baseDepth });
if (i === 0) {
this.rootRoad = road;
this.groupMiddle.container.addChild(this.rootRoad.model);
} else {
this.rootRoad.model.addChild(road.model);
}
road.model.position.z = -i * roadSize * Math.cos(this.roadAngle);
road.model.position.y = i * roadSize * Math.sin(this.roadAngle);
}
const xRoot = this.rootRoad.model.position.x;
const yRoot = this.rootRoad.model.position.y;
let curPos = 0;
let roadDelta = 0;
let rootY = this.scene.camera3d.position.y;
this.stepping = 0;
this.clearObjs = () => {
objs.container.children.forEach(i => {
i.loops = 10
});
};
this.Updater(() => {
objs.container.children.forEach(i => {
if (i.loops >= 2) {
this.destroy(i.gameObject);
}
});
});
this.Updater(() => {
roadDelta = game.app.ticker.deltaMS / 1000 * this.roadSpeed * this.ease.cubicInOut(this.stepping);
this.scene.camera3d.position.y = rootY + (1-this.ease.cubicInOut(Math.abs(0.5-this.ease.cubicInOut(this.stepping))*2))*0.01;
curPos += roadDelta;
let oldz = objs.container.position.z;
let oldy = objs.container.position.y;
let looped = 0;
if (curPos > roadSize) {
looped = 1;
curPos -= roadSize;
} else if (curPos < 0) {
looped = -1;
curPos += roadSize;
}
let pos = curPos + roadSize/2;
objs.container.position.z = this.rootRoad.model.position.z = pos * Math.cos(this.roadAngle);
objs.container.position.y = this.rootRoad.model.position.y = -pos * Math.sin(this.roadAngle);
if (looped) {
objs.container.children.forEach(i => {
i.loops = (i.loops || 0) + 1;
i.position.z += oldz - objs.container.position.z;
i.position.y += oldy - objs.container.position.y;
});
}
});
// passenger
const poseBase = 'passenger';
const initialPose = 'walk';
this.passenger = this.Model('passenger', `${poseBase}_${initialPose}_n`, { transparent: true, doubleSided: true });
this.passengerLegs = this.Model('passenger', 'passenger_legs', { transparent: true, doubleSided: true });
// fix alpha
this.passenger.model.children.forEach(i => i.visible = false);
this.passengerPlane = this.passenger.model.getChildByName('passenger_plane');
this.passengerLegsPlane = this.passengerLegs.model.getChildByName('passenger_plane');
this.passengerPlane.visible = true;
this.passengerPlane.position.x -= 0.0001;
this.passenger.model.parent.setChildIndex(this.passenger.model, this.passenger.model.parent.children.length-1);
this.passengerLegs.model.children.forEach(i => i.visible = false);
this.passengerLegs.model.getChildByName('passenger_plane').visible = true;
this.passengerLegs.model.parent.setChildIndex(this.passengerLegs.model, this.passengerLegs.model.parent.children.length-1);
const passengerMouthFront = this.passenger.model.getChildByName('mouth_forward');
const passengerMouthBack = this.passenger.model.getChildByName('mouth_backward');
this.scene.pointDialogue.position = passengerMouthFront.position;
this.EnvModel = (...args) => {
const m = this.Model(...args);
objs.container.addChild(m.model);
m.model.position.x -= objs.container.position.x;
m.model.position.y -= objs.container.position.y;
m.model.position.z -= objs.container.position.z;
m.model.position.y -= (args[2].offset || 0) * Math.sin(this.roadAngle);
m.model.position.z += (args[2].offset || 0) * Math.cos(this.roadAngle);
return m;
};
this.tex('mountainTexture').baseTexture.scaleMode = 1;
this.Model('mountainShape2', 'mountainTexture');
this.groupMiddle.container.addChild(this.Model('mountainShape3', 'palette', {depth: 366}).model);
this.groupTop.container.addChild(this.Model('mountainShape3', 'palette', {depth: 300}).model);
this.groupMiddle.container.addChild(this.Model('mountainShape4', 'palette', {depth: 220}).model);
this.groupTop.container.addChild(this.Model('mountainShape4', 'palette', {depth: 90}).model);
this.groupBottom.container.addChild(this.Model('mountainShape5', 'mountainTexture').model);
const clouds1 = this.Model('cloudShape1', 'white', { depth: 366 });
const clouds2 = this.Model('cloudShape2', 'white', { depth: 256 });
const clouds3 = this.Model('cloudShape3', 'white', { depth: 300 });
const clouds4 = this.Model('cloudShape4', 'white', { depth: 300 });
// move clouds
clouds1.model.rotationQuaternion.setEulerAngles(this.roadAngle * 180 / Math.PI, 0, 0);
this.Updater(() => {
clouds1.model.getChildAt(0).rotationQuaternion.setEulerAngles(0, game.app.ticker.lastTime * 0.005, 0);
clouds2.model.position.y = Math.sin(game.app.ticker.lastTime * 0.0005) + Math.sin(game.app.ticker.lastTime * 0.00023)*0.5;
clouds3.model.position.y = Math.sin(game.app.ticker.lastTime * 0.0002) + Math.sin(game.app.ticker.lastTime * 0.00045)*0.5;
clouds4.model.position.y = Math.sin(game.app.ticker.lastTime * 0.0002) + Math.sin(game.app.ticker.lastTime * 0.00055)*0.5;
});
// pose helper
const poses = {
'._.': 'walk',
'o_o': 'walk_for',
'<_<': 'walk_bac',
'v_v': 'walk_write',
'π ._.': 'stand',
'π o_o': 'stand_for',
'π <_<': 'stand_bac',
'π v_v': 'stand_write',
'π ^_^': 'stand_bino',
};
const terr = this.tex('error');
let prev = '';
this.setPose = (pose, state) => {
this.pose = poses[pose] || pose;
const frame = this.passenger.animator.frame;
let offset = this.passenger.animator.offset;
let t = [poseBase, this.pose, state].filter(i => i).join('_');
if (t === prev) return;
prev = t;
if (this.tex(t) === terr) t = [poseBase, this.pose].filter(i => i).join('_');
if (this.tex(t) === terr) t = [poseBase, initialPose, state].filter(i => i).join('_');
if (this.tex(t) === terr) t = [poseBase, state].filter(i => i).join('_');
if (this.tex(t) === terr) t = poseBase;
this.passenger.setAnimation(t);
this.passenger.animator.frame = frame;
this.passenger.animator.offset = offset;
this.passenger.animator.updateTexture();
if (this.pose.includes('stand')) {
this.passengerLegs.setAnimation('blank');
this.passengerLegs.animator.updateTexture();
} else {
offset = this.passenger.animator.offset;
this.passengerLegs.setAnimation('passenger_legs');
this.passengerLegs.animator.updateTexture();
this.passengerLegs.animator.offset = offset;
}
};
// blinking and lip flaps
this.pose = initialPose;
this.blinking = false;
this.timeoutBlinking;
this.scene.dialogue.scripts.push({
gameObject: this.scene.dialogue,
update: () => {
if (!this.pose) return;
if (!this.timeoutBlinking) {
this.timeoutBlinking = setTimeout(() => {
this.blinking = !this.blinking;
this.timeoutBlinking = null;
}, this.blinking ? 100 : 2000+Math.random()*4000);
};
const letter = this.scene.dialogue.strText[scene.dialogue.pos];
const isLetter = letter && letter.replace(/[^\w]/, '');
if (isLetter) {
this.setPose(this.pose, 'o');
} else if (this.blinking) {
this.setPose(this.pose, 'b');
} else {
this.setPose(this.pose, 'n');
}
},
});
this.setPose(this.pose, 'n');
// footsteps
this.scene.dialogue.scripts.push({
gameObject: this.scene.dialogue,
update: () => {
if (this.passengerLegs.animator.frameChanged && (this.passengerLegs.animator.frame === 1 || this.passengerLegs.animator.frame === 4)) {
this.tweenAbort(this.steppingTween);
this.steppingTween = this.tween(this, 'stepping', 0, 1300, 1);
this.sfx(`step.${Math.floor(Math.random()*4)+1}`, {
rate: Math.random()*0.25+0.75,
volume: Math.random()*0.25 + (this.scene.dialogue.isOpen ? 0.5 : 0.7),
});
// passenger
if (this.passengerLegs.model.visible) {
if (this.roadSpeed > 0) {
const print = this.EnvModel('footprint', 'black', { depth: baseDepth });
// offset left/right
print.model.position.x += Math.sign(this.passengerLegs.animator.frame - 2) > 0 ? 0.2 : 0.05;
} else {
const print = this.EnvModel('footprint_backward', 'black', { depth: baseDepth });
// offset left/right
print.model.position.x += Math.sign(this.passengerLegs.animator.frame - 2) > 0 ? 0.35 : 0.2;
}
}
// player
if (this.roadSpeed > 0) {
const print = this.EnvModel('footprint', 'black', { depth: baseDepth, offset: 1 });
// offset left/right
print.model.position.x += (Math.sign(this.passengerLegs.animator.frame - 2) > 0 ? 0.2 : 0.05) - 1.5;
print.model.scale.x *= 1.15;
print.model.scale.y *= 1.15;
print.model.scale.z *= 1.15;
} else {
const print = this.EnvModel('footprint_backward', 'black', { depth: baseDepth, offset: 1 });
// offset left/right
print.model.position.x += (Math.sign(this.passengerLegs.animator.frame - 2) > 0 ? 0.35 : 0.2) - 1.5;
print.model.scale.x *= 1.15;
print.model.scale.y *= 1.15;
print.model.scale.z *= 1.15;
}
}
},
});
// walk direction
let baseScale = this.passengerPlane.scale.x;
this.scene.dialogue.scripts.push({
gameObject: this.scene.dialogue,
update: () => {
this.passengerLegsPlane.scale.x = this.passengerPlane.scale.x = baseScale * Math.sign(this.roadSpeed);
this.scene.pointDialogue.position = Math.sign(this.roadSpeed) > 0 ? passengerMouthFront.position : passengerMouthBack.position;
},
});
// add syntax sugar for poses like `:( - Blah blah`
const check = /^(.*) - /;
this.scene.dialogue.sayo = this.scene.dialogue.say;
this.scene.dialogue.say = (text, actions) => {
const match = check.exec(text);
if (match) {
this.setPose(match[1]);
return this.scene.dialogue.sayo(text.substring(match[0].length), actions);
} else {
return this.scene.dialogue.sayo(text, actions);
}
};
// this.music('bgm');
// start
this.started=true;
this.goto('start2');
>>
<<endif>>
::close
this should never render
::debug menu
debug menu
[[passage select>passage select]]
[[close]]
[[get interaction region|console.log(this.scene.x, this.scene.y)]]
[[back|this.back()]]
::start2
<<do
this.setPose('stand', 'n');
this.goto('close');
(async () => {
this.scene.container3d.visible = true;
this.scenarios = [].concat(
...this.shuffle(Object.keys(this.passages).filter(i => i.startsWith('scenario-up-'))),
'scenario-top',
...this.shuffle(Object.keys(this.passages).filter(i => i.startsWith('scenario-down-'))),
'scenario-end',
);
this.scenarios.reverse();
this.scrim(1);
this.scrim(0, 1000);
this.sfx('intro', { volume: 0.4 });
this.groupBottom.container.visible = true;
this.groupMiddle.container.visible = false;
this.groupTop.container.visible = false;
this.gotod('start3', 4000)
})();
>>
::start3
π o_o - I assume you're the taxi driver?
>
Good to meet you.
>
I'm just going up the mountain and then coming back down. Round trip.
>
π ._. - Just doing a little bird watching.
>
<<do this.setPose('π v_v', 'n');this.goto('close');this.gotod('start4', 3000)>>
::start4
π o_o - So! No time like the present.
>
<<do
this.goto('close');
this.scrim(1, 1000);
(async () => {
await this.delay(3000);
this.scene.x = 0;
this.scene.y = 0;
this.music('bgm', { volume: 0.1, fade: 5000 });
this.scrim(0, 1000);
this.groupBottom.container.visible = false;
this.groupMiddle.container.visible = true;
this.groupTop.container.visible = false;
this.setPose('walk', 'n');
await this.delay(556*8);
const t = scene.strand.Text('TAXI');
game.app.stage.addChild(t.display.container);
t.text.style.fontSize = 50;
t.text.style.fill = 0xd4dde2;
t.text.x = this.size.x - 330;
t.text.y = this.size.y - 240;
t.text.anchor.y = 1.0;
await this.delay(556*2);
t.text.text = 'TAXI QUEST';
await this.delay(556*2);
const t2 = scene.strand.Text('66');
game.app.stage.addChild(t2.display.container);
t2.text.style.fontSize = 240;
t2.text.style.fill = 0xd4dde2;
t2.text.x = this.size.x - 350;
t2.text.y = this.size.y + 30;
t2.text.anchor.y = 1.0;
await this.delay(556*6);
t.destroy();
t2.destroy();
this.gotod('start5', 3000)
})();
>>
::start5
<_< - Perfect weather, isn't it?
[[Yeah>weather-agree]]
[[Nah>weather-disagree]]
[[...|this.goto('close');this.gotod('weather-agree', 2000)]]
::weather-agree
._. - Yep. Just perfect.
[[>start5-2]]
::weather-disagree
._. - Well, for bird watching, it is.
[[>start5-2]]
::start5-2
<_< - Overcast, not too cold, enough light...
>
._. - Perfect.
>
<<do this.goto('close');this.gotod('start5-3', 1500)>>
::start5-3
Should be like this through the weekend.
>
Who knows, though. The weather's so unpredictable now.
>
o_o - You're okay if it starts to rain?
[[Yeah>start5-yeah]]
[[Nah>start5-nah]]
[[...|this.goto('close');this.gotod('start5-silent', 2000)]]
::start5-yeah
._. - I figured.
>
o_o - I do have an extra poncho, anyway.
>
._. - Hopefully we won't need them.
[[>main]]
::start5-nah
o_o - Oh. Well, I have an extra poncho in my bag.
>
You can borrow it.
>
._. - Hopefully we won't need them, though.
[[>main]]
::start5-silent
o_o - I do have an extra poncho, anyway.
>
._. - Hopefully we won't need them.
[[>main]]
::main
<<do
this.goto('close');
this.gotod(this.scenarios.pop() || 'scenario-end', this.debug ? 2000 : (Math.random()*10+12)*1000);
>>
::animation test
._. - walking normally
>
o_o - walking while looking at you
>
<_< - walking while looking away
>
v_v - walking while writing
>
π ._. - standing normally
>
π o_o - standing while looking at you
>
π <_< - standing while looking away
>
π v_v - standing while writing
>
π ^_^ - standing while using binoculars
[[animation test]]
[[start>main]]
// dP dP 888888ba
// 88 88 88 `8b
// 88 88 a88aaaa8P'
// 88 88 88
// Y8. .8P 88
// `Y88888P' dP
::scenario-up-birds
o_o - See many birds around here?
[[Nope>no-birds]]
[[Nah>no-birds]]
[[...|this.goto('close');this.gotod('silent-birds', 2000)]]
::no-birds
v_v - In­ter­est­ing.
>
<<do this.goto('close');this.gotod('birds2', 1500)>>
::silent-birds
v_v - It's fine, nothing to be embarrassed about.
>
<<do this.goto('close');this.gotod('birds2', 1500)>>
::birds2
<_< - I've heard there might be an eagle nest up here.
>
._. - And I'd love to see a chickadee.
>
v_v - You never know what you'll find, bird watching.
>
v_v - That's the fun part.
>
<<do this.goto('close');this.gotod('birds3', 2000)>>
::birds3
._. - One of the fun parts, anyway.
[[>main]]
::scenario-up-wait
π ._. - Wait.
>Yeah|What
π o_o - Shh!
>
<<do this.setPose('stand', 'n');this.goto('close');this.gotod('wait-2', 4000)>>
::wait-2
Hmm.
>
<<do this.setPose('π ^_^', 'n');this.goto('close');this.gotod('wait-3', 5000)>>
::wait-3
Huh.
>
π v_v - Interesting.
>
Just a sec.
>
<<do this.goto('close');this.gotod('wait-4', 6000)>>
::wait-4
π o_o - Okay, let's go.
>
<<do this.setPose('walk', 'n');this.goto('close');this.gotod('wait-5', 4000)>>
::wait-5
<_< - I just can't believe this weather.
>
._. - It's perfect.
[[>main]]
::scenario-up-kill
._. - Have you ever killed someone?
[[Yeah>kill-yeah]]
[[Nah>kill-nah]]
[[...|this.goto('close');this.gotod('kill-silent', 2000)]]
::kill-yeah
._. - Yeah, makes sense.
>
<_< - Not a ton of people around here, but...
>
._. - The kind of people who would come out here are probably capable of anything.
>
o_o - Well, not me. I'm pretty harmless.
>
._. - But you know what I mean.
>
<<do this.goto('close');this.gotod('kill-2', 3000)>>
::kill-nah
o_o - Really?
>
._. - Huh.
>
<_< - I guess there's not a lot of people out here.
>
._. - That's probably for the best.
>
<<do this.goto('close');this.gotod('kill-2', 3000)>>
::kill-silent
._. - You don't have to say.
>
<_< - I'm just making conversation.
>
<<do this.goto('close');this.gotod('kill-2', 3000)>>
::kill-2
o_o - I'm not armed, by the way.
>
I wasn't trying to imply anything.
>
._. - I really am just a bird watcher.
>
<<do this.goto('close');this.gotod('kill-3', 2000)>>
::kill-3
Well, okay, bird watching can get competitive.
>
o_o - Really­ competitive.
>
._. - But I'm not that kind of bird watcher.
>
<<do this.goto('close');this.gotod('main', 3000)>>
::scenario-up-missing
<_< - Huh...
>
<<do
this.goto('close');
let state = 0;
const couldSeePassenger = () => {
const x = this.scene.x;
const y = this.scene.y;
return !(
x < -120 ||
x > 20 ||
y < -50 ||
(x > 14 && y < 50) ||
(x > 7 && y < 25) ||
(x > -2 && y < 17) ||
(x > -11 && y < 3)
);
};
const check = () => {
const x = this.scene.x;
const y = this.scene.y;
if (state === 0) {
if (!couldSeePassenger()) {
this.passenger.model.visible = false;
this.passengerLegs.model.visible = false;
state = 1;
}
requestAnimationFrame(check);
} else if (state === 1) {
if (couldSeePassenger()) {
state = 2;
this.setPose('stand', 'n');
setTimeout(() => check(), 7000);
} else {
requestAnimationFrame(check);
}
} else if (state === 2) {
if (!couldSeePassenger()) {
setTimeout(() => {
if (couldSeePassenger()) {
requestAnimationFrame(check);
} else {
this.passenger.model.visible = true;
this.passengerLegs.model.visible = true;
this.goto('missing2');
}
}, 1000);
} else {
requestAnimationFrame(check);
}
}
};
check();
>>
::missing2
π v_v - Phew, sorry about that...
>
Just-- just a moment...
>
<<do this.goto('close');this.gotod('missing3', 3000)>>
::missing3
Okay.
>
π o_o - Shall we move on?
[[Yeah>move-on]]
[[Nah>dont-move]]
[[...>move-on]]
::dont-move
Oh. Why not?
>
π <_< - Is it because I-- Look, don't worry about it.
>
π o_o - I'll stick to the trail from now.
>
._. - Promise!
[[>main]]
::move-on
._. - Hope it's not much further...
[[>main]]
::scenario-up-quake
<<do
this.goto('close');
this.shake = 0;
this.sfx('rumble');
let t = this.tween(this, 'shake', 1, 500, undefined, this.ease.cubicOut);
setTimeout(() => {
this.tweenAbort(t);
this.goto('quake2');
}, 500);
const quake = () => {
if (this.shake === undefined) return;
this.scene.y += (Math.random()-0.5)*2*this.shake*0.1;
this.scene.x += (Math.random()-0.5)*2*this.shake*0.1;
requestAnimationFrame(quake);
};
quake();
>>
::quake2
π <_< - What is that?!
>
π o_o - An earthquake?! Mudslide?!
>
<<do
this.tween(this, 'shake', 0, 5000, undefined, this.ease.cubicIn);
setTimeout(() => {
this.shake = undefined;
}, 5500);
this.goto('close');
this.setPose('π <_<', 'n');
setTimeout(() => {
this.setPose('π o_o', 'n');
setTimeout(() => {
this.setPose('π <_<', 'n');
setTimeout(() => {
this.goto('quake3');
}, 2000);
}, 1000);
}, 1000);
>>
::quake3
π o_o - Is it-- I guess it's stopped.
>
π <_< - Is that normal?
>Yeah|Nah
π o_o - .­.­.­And­­ that's not­ concerning?
>Yeah|Nah|...
Okay. Well.
>
._. - I suppose it'd be silly to turn back now.
>
<<do this.goto('close');this.gotod('quake4', 1500)>>
::quake4
<_< - Very­ silly.
>
<<do setTimeout(() => this.setPose('._.', 'n'), 2000);this.goto('main')>>
// d888888P .88888. 888888ba
// 88 d8' `8b 88 `8b
// 88 88 88 a88aaaa8P'
// 88 88 88 88
// 88 Y8. .8P 88
// dP `8888P' dP
::scenario-top
<<do
this.goto('close');
this.scrim(1, 1000);
setTimeout(() => {
this.scrim(0, 1000);
this.music('wind', { volume: 0.1, fade: 5000 });
this.scene.x = 0;
this.scene.y = 0;
this.groupBottom.container.visible = false;
this.groupMiddle.container.visible = false;
this.groupTop.container.visible = true;
this.clearObjs();
this.setPose('stand', 'n');
this.gotod('scenario-top2', 3000)
}, 3000);
>>
::scenario-top2
π o_o - Well, we made it!
>
π <_< - Look at that view...
>
It looks like it goes on forever.
>
<<do this.goto('close');this.gotod('top2-1', 4000)>>
::top2-1
π ._. - It's a shame there's no eagle nest.
>
π v_v - I guess my intel was bad.
>
<<do this.goto('close');this.gotod('top2-12', 3000)>>
::top2-12
π o_o - Have you been up here before?
[[Yeah>top2-yeah]]
[[Nah>top2-nah]]
::top2-yeah
That's fun.
>
π ._. - Well, maybe it's not fun if you have to do it all the time.
>
<<do this.setPose('π ^_^', 'n');this.goto('close');this.gotod('top2-2', 3000)>>
::top2-nah
Isn't that your job?
>
<<do this.goto('close');this.gotod('top2-nah-2', 1000)>>
::top2-nah-2
Oh. Sarcasm.
>
π ._. - Well, I guess it's not fun if you have to do it all the time.
>
<<do this.setPose('π ^_^');this.goto('close');this.gotod('top2-2', 3000)>>
::top2-2
Oh!
>
Oh my gosh!
>
Do you see that?
>Nah|What
Over there!
>
It's...
>
Hmm.
>
No, nothing.
>
π o_o - Sorry. Wishful thinking, I guess.
>
π ._. - I really thought there'd be something up here.
>
<<do this.setPose('π <_<', 'n');this.goto('close');this.gotod('top2-3', 3000)>>
::top2-3
π ._. - Darn.
>
π o_o - Can we stay a little longer? Just in case?
[[Yeah>top2-yes]]
[[Nah>top2-no]]
::top2-yes
Thanks.
>
π ^_^ - Okay...
>
<<do
this.goto('close');
setTimeout(() => {
this.setPose('π v_v', 'n');
}, 3500);
setTimeout(() => {
this.setPose('π ^_^', 'n');
}, 6000);
this.gotod('top2-4', 10000);
>>
::top2-4
π v_v - Oh well.
>
π o_o - Okay, let's head back down.
[[>go-down]]
::top2-no
Oh.
>
π ._. - Um, okay.
>
π <_< - I guess we're­ heading back­ then.
[[>go-down]]
::go-down
<<do
this.goto('close');
this.scrim(1, 1000);
setTimeout(() => {
this.scrim(0, 1000);
this.music('bgm', { volume: 0.1, fade: 5000 });
this.groupBottom.container.visible = false;
this.groupMiddle.container.visible = true;
this.groupTop.container.visible = false;
this.roadSpeed *= -1;
this.scene.x = -180;
this.scene.y = 20;
this.setPose('walk', 'n');
this.gotod('main', 3000)
}, 3000);
>>
// 888888ba .88888. dP dP dP 888888ba
// 88 `8b d8' `8b 88 88 88 88 `8b
// 88 88 88 88 88 .8P .8P 88 88
// 88 88 88 88 88 d8' d8' 88 88
// 88 .8P Y8. .8P 88.d8P8.d8P 88 88
// 8888888P `8888P' 8888' Y88' dP dP
::scenario-down-good-life
._. - You know, I'm jealous of you.
>
o_o - You've got a good life here.
>
It's nice and simple.
>
._. - I don't mean to say it's easy.
>
In fact, it actually seems relatively difficult as far as lives go.
>
<_< - I certainly don't have the calves for this kind of life.
>
But... it's simple.
>
._. - Productive. Makes sense.
>
That makes me jealous.
>
Sense­ isn't very easy to come by, these days.
>
You have to hold on to it when you find it.
>
o_o - ...Sorry, you're here to do a job, not to hear me lecture.
>
I'm being rude, aren't I? You can tell me if I am.
[[Yeah>rude]]
[[Nah|this.goto('close');this.gotod('not rude', 2500)]]
[[...|this.goto('close');this.gotod('silent rude', 3000)]]
::rude
Thanks for being honest.
>
._. - Most people are scared of speaking the truth.
>
I'd rather hear them out, even if it might hurt.
>
I'm well used to a bit of criticism.
[[>polite]]
::not rude
._. - I appreciate you saying that.
>
But still...
[[>not rude2]]
::silent rude
No no, you don't need to say anything.
>
I can see it on your face.
[[>not rude2]]
::not rude2
._. - It's a bad habit, to talk like that about other people's lives.
>
Observation only goes so far.
>
You know your life better than I do.
>
It's not for me to comment on­ like I have more distance or a better perspective.
>