-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Main.bb
11237 lines (9720 loc) · 345 KB
/
Main.bb
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
;SCP - 收容失效 汉化计划
; 游戏基于SCP基金会背景(http://scp-wiki-cn.wikidot.com/)
; 汉化计划基于SCP - Containment Breach TSS制作(https://github.com/ZiYueCommentary/scpcb-tss)
; 游戏遵循知识共享许可协议BY-SA 3.0(即必须署名、可商用、可二创、可二创商用)
; https://creativecommons.org/licenses/by-sa/3.0/deed.zh
; 打开"Credits.txt"文件查看详细制作人员名单
Local InitErrorStr$ = ""
If FileSize("dplayx.dll")=0 Then InitErrorStr=InitErrorStr+ "dplayx.dll"+Chr(13)+Chr(10)
If FileSize("FreeImage.dll")=0 Then InitErrorStr=InitErrorStr+ "FreeImage.dll"+Chr(13)+Chr(10)
If FileSize("fmod.dll")=0 Then InitErrorStr=InitErrorStr+ "fmod.dll"+Chr(13)+Chr(10)
If FileSize("opencc.dll")=0 Then InitErrorStr=InitErrorStr+ "opencc.dll"+Chr(13)+Chr(10)
If Len(InitErrorStr)>0 Then
RuntimeError "游戏文件夹中缺失以下dll文件:"+Chr(13)+Chr(10)+Chr(13)+Chr(10)+InitErrorStr
EndIf
Include "IniControler.bb"
IniWriteBuffer("options.ini")
IniWriteBuffer("Data\1499chunks.ini")
IniWriteBuffer("Data\achievementstrings.ini")
IniWriteBuffer("Data\events.ini")
IniWriteBuffer("Data\materials.ini")
IniWriteBuffer("Data\NPCBones.ini")
IniWriteBuffer("Data\NPCs.ini")
IniWriteBuffer("Data\rooms.ini")
IniWriteBuffer("Data\SCP-294.ini")
IniWriteBuffer("Data\subtitles.ini")
IniWriteBuffer("Loadingscreens\loadingscreens.ini")
Include "StrictLoads.bb"
Include "KeyName.bb"
Global OptionFile$ = "options.ini"
Include "Update.bb"
Include "DevilParticleSystem.bb"
Global UpdaterFont%
Global Font1%, Font2%, Font3%, Font4%, Font5%
Global ConsoleFont%
Global VersionNumber$ = "1.3.11"
Global SinicizationNumber$ = "2023.10-Fifth Revise" ; 汉化版本
Global CompatibleNumber$ = "1.3.11-2022.5" ; 当存档与构建版本不兼容时再更改 ——开发者 ENDSHN
Global OpenCC% = CreateOpenCC("Traditional\OpenCC\s2twp.json") ; 繁简转换工具
Global MenuWhite%, MenuBlack%
Global ButtonSFX% = LoadSound_Strict("SFX\Interact\Button.ogg")
Global EnableSFXRelease% = IniGetInt(OptionFile, "audio", "sfx release")
Global EnableSFXRelease_Prev% = EnableSFXRelease%
Global CanOpenConsole% = IniGetInt(OptionFile, "console", "enabled")
Dim ArrowIMG(4)
;[Block]
Global LauncherWidth%= Min(IniGetInt(OptionFile, "launcher", "launcher width"), 1024)
Global LauncherHeight% = Min(IniGetInt(OptionFile, "launcher", "launcher height"), 768)
Global LauncherEnabled% = IniGetInt(OptionFile, "launcher", "launcher enabled")
Global GraphicWidth% = IniGetInt(OptionFile, "options", "width")
Global GraphicHeight% = IniGetInt(OptionFile, "options", "height")
Global Depth% = 0, Fullscreen% = IniGetInt(OptionFile, "options", "fullscreen")
Global SelectedGFXMode%
Global SelectedGFXDriver% = Max(IniGetInt(OptionFile, "options", "gfx driver"), 1)
Global fresize_image%, fresize_texture%, fresize_texture2%
Global fresize_cam%
Global ShowFPS = IniGetInt(OptionFile, "options", "show FPS")
Global WireframeState
Global HalloweenTex
Global TotalGFXModes% = CountGfxModes3D(), GFXModes%
Dim GfxModeWidths%(TotalGFXModes), GfxModeHeights%(TotalGFXModes)
Global BorderlessWindowed% = IniGetInt(OptionFile, "options", "borderless windowed")
Global RealGraphicWidth%,RealGraphicHeight%
Global AspectRatioRatio#
Global EnableRoomLights% = IniGetInt(OptionFile, "options", "room lights enabled")
Global TextureDetails% = IniGetInt(OptionFile, "options", "texture details")
Global TextureFloat#
Select TextureDetails%
Case 0
TextureFloat# = 0.8
Case 1
TextureFloat# = 0.4
Case 2
TextureFloat# = 0.0
Case 3
TextureFloat# = -0.4
Case 4
TextureFloat# = -0.8
End Select
Global ConsoleOpening% = IniGetInt(OptionFile, "console", "auto opening")
Global SFXVolume# = IniGetFloat(OptionFile, "audio", "sound volume")
Global Bit16Mode = IniGetInt(OptionFile, "options", "16bit")
Global TraditionalChinese% = IniGetInt(OptionFile, "options", "traditional chinese")
Include "Subtitles.bb"
If LauncherEnabled Then
AspectRatioRatio = 1.0
UpdateLauncher()
;New "fake fullscreen" - ENDSHN Psst, it's called borderless windowed mode --Love Mark,
If BorderlessWindowed
DebugLog "Using Borderless Windowed Mode"
Graphics3DExt(DesktopWidth(), DesktopHeight(), 0, 4)
; -- Change the window style to 'WS_POPUP' and then set the window position to force the style to update.
RealGraphicWidth = DesktopWidth()
RealGraphicHeight = DesktopHeight()
AspectRatioRatio = (Float(GraphicWidth)/Float(GraphicHeight))/(Float(RealGraphicWidth)/Float(RealGraphicHeight))
Fullscreen = False
Else
AspectRatioRatio = 1.0
RealGraphicWidth = GraphicWidth
RealGraphicHeight = GraphicHeight
If Fullscreen Then
Graphics3DExt(GraphicWidth, GraphicHeight, (16*Bit16Mode), 1)
Else
Graphics3DExt(GraphicWidth, GraphicHeight, 0, 2)
End If
EndIf
Else
For i% = 1 To TotalGFXModes
Local samefound% = False
For n% = 0 To TotalGFXModes - 1
If GfxModeWidths(n) = GfxModeWidth(i) And GfxModeHeights(n) = GfxModeHeight(i) Then samefound = True : Exit
Next
If samefound = False Then
If GraphicWidth = GfxModeWidth(i) And GraphicHeight = GfxModeHeight(i) Then SelectedGFXMode = GFXModes
GfxModeWidths(GFXModes) = GfxModeWidth(i)
GfxModeHeights(GFXModes) = GfxModeHeight(i)
GFXModes=GFXModes+1
End If
Next
GraphicWidth = GfxModeWidths(SelectedGFXMode)
GraphicHeight = GfxModeHeights(SelectedGFXMode)
;New "fake fullscreen" - ENDSHN Psst, it's called borderless windowed mode --Love Mark,
If BorderlessWindowed
DebugLog "Using Faked Fullscreen"
Graphics3DExt(DesktopWidth(), DesktopHeight(), 0, 4)
; -- Change the window style to 'WS_POPUP' and then set the window position to force the style to update.
RealGraphicWidth = DesktopWidth()
RealGraphicHeight = DesktopHeight()
AspectRatioRatio = (Float(GraphicWidth)/Float(GraphicHeight))/(Float(RealGraphicWidth)/Float(RealGraphicHeight))
Fullscreen = False
Else
AspectRatioRatio = 1.0
RealGraphicWidth = GraphicWidth
RealGraphicHeight = GraphicHeight
If Fullscreen Then
Graphics3DExt(GraphicWidth, GraphicHeight, (16*Bit16Mode), 1)
Else
Graphics3DExt(GraphicWidth, GraphicHeight, 0, 2)
End If
EndIf
EndIf
Global MenuScale# = (GraphicHeight / 1024.0)
SetBuffer(BackBuffer())
Global CurTime%, PrevTime%, LoopDelay%, FPSfactor#, FPSfactor2#, PrevFPSFactor#
Local CheckFPS%, ElapsedLoops%, FPS%, ElapsedTime#
Global Framelimit% = IniGetInt(OptionFile, "options", "framelimit")
Global Vsync% = IniGetInt(OptionFile, "options", "vsync")
Global Opt_AntiAlias = IniGetInt(OptionFile, "options", "antialias")
Global CurrFrameLimit# = (Framelimit%-19)/100.0
Global ScreenGamma# = IniGetFloat(OptionFile, "options", "screengamma")
Const HIT_MAP% = 1, HIT_PLAYER% = 2, HIT_ITEM% = 3, HIT_APACHE% = 4, HIT_178% = 5, HIT_DEAD% = 6
SeedRnd MilliSecs()
;[End block]
Global GameSaved%
Global CanSave% = True
AppTitle "SCP - 收容失效 汉化计划 v" + VersionNumber
PlayStartupVideos()
;---------------------------------------------------------------------------------------------------------------------
;[Block]
Global CursorIMG% = LoadImage_Strict("GFX\cursor.png")
Global SelectedLoadingScreen.LoadingScreens, LoadingScreenAmount%, LoadingScreenText%
Global LoadingBack% = LoadImage_Strict("Loadingscreens\loadingback.jpg")
InitLoadingScreens("Loadingscreens\loadingscreens.ini")
; 由于玩家可以用输入法,所以输入的文本可能啥都有
; 为了让文字尽可能都显示,游戏最经常用的字体就没砍
; ——子悦 2022/12/22
Font1% = LoadFont_Strict("GFX\fonts\Containment Breach.ttf", Int(16 * (GraphicHeight / 1024.0)))
Font2% = LoadFont_Strict("GFX\fonts\Containment Breach.ttf", Int(55 * (GraphicHeight / 1024.0)))
Font3% = LoadFont_Strict("GFX\fonts\Unifont.ttf", Int(19 * (GraphicHeight / 1024.0)))
Font4% = LoadFont_Strict("GFX\fonts\Unifont.ttf", Int(57 * (GraphicHeight / 1024.0)))
Font5% = LoadFont_Strict("GFX\fonts\Journal.ttf", Int(55 * (GraphicHeight / 1024.0)))
Global CreditsFont%, CreditsFont2%, CreditsFont3%
ConsoleFont% = LoadFont_Strict("GFX\fonts\Containment Breach.ttf", Int(17 * (GraphicHeight / 1024.0)))
SetFont Font2
Global BlinkMeterIMG% = LoadImage_Strict("GFX\blinkmeter.jpg")
DrawLoading(0, True)
; - -Viewport.
Global viewport_center_x% = GraphicWidth / 2, viewport_center_y% = GraphicHeight / 2
; -- Mouselook.
Global mouselook_x_inc# = 0.3 ; This sets both the sensitivity and direction (+/-) of the mouse on the X axis.
Global mouselook_y_inc# = 0.3 ; This sets both the sensitivity and direction (+/-) of the mouse on the Y axis.
; Used to limit the mouse movement to within a certain number of pixels (250 is used here) from the center of the screen. This produces smoother mouse movement than continuously moving the mouse back to the center each loop.
Global mouse_left_limit% = 250, mouse_right_limit% = GraphicsWidth () - 250
Global mouse_top_limit% = 150, mouse_bottom_limit% = GraphicsHeight () - 150 ; As above.
Global mouse_x_speed_1#, mouse_y_speed_1#
Global KEY_RIGHT = IniGetInt(OptionFile, "binds", "Right key")
Global KEY_LEFT = IniGetInt(OptionFile, "binds", "Left key")
Global KEY_UP = IniGetInt(OptionFile, "binds", "Up key")
Global KEY_DOWN = IniGetInt(OptionFile, "binds", "Down key")
Global KEY_BLINK = IniGetInt(OptionFile, "binds", "Blink key")
Global KEY_SPRINT = IniGetInt(OptionFile, "binds", "Sprint key")
Global KEY_INV = IniGetInt(OptionFile, "binds", "Inventory key")
Global KEY_CROUCH = IniGetInt(OptionFile, "binds", "Crouch key")
Global KEY_SAVE = IniGetInt(OptionFile, "binds", "Save key")
Global KEY_CONSOLE = IniGetInt(OptionFile, "binds", "Console key")
Global MouseSmooth# = IniGetFloat(OptionFile,"options", "mouse smoothing", 1.0)
Global Mesh_MinX#, Mesh_MinY#, Mesh_MinZ#
Global Mesh_MaxX#, Mesh_MaxY#, Mesh_MaxZ#
Global Mesh_MagX#, Mesh_MagY#, Mesh_MagZ#
;player stats -------------------------------------------------------------------------------------------------------
Global KillTimer#, KillAnim%, FallTimer#, DeathTimer#
Global Sanity#, ForceMove#, ForceAngle#
Global RestoreSanity%
Global Playable% = True
Global BLINKFREQ#
Global BlinkTimer#, EyeIrritation#, EyeStuck#, BlinkEffect# = 1.0, BlinkEffectTimer#
Global Stamina#, StaminaEffect#=1.0, StaminaEffectTimer#
Global CameraShakeTimer#, Vomit%, VomitTimer#, Regurgitate%
Global SCP1025state#[6]
Global HeartBeatRate#, HeartBeatTimer#, HeartBeatVolume#
Global WearingGasMask%, WearingHazmat%, WearingVest%, Wearing714%, WearingNightVision%
Global NVTimer#
Global SuperMan%, SuperManTimer#
Global Injuries#, Bloodloss#, Infect#, HealTimer#
Global RefinedItems%
Include "Achievements.bb"
;player coordinates, angle, speed, movement etc ---------------------------------------------------------------------
Global DropSpeed#, HeadDropSpeed#, CurrSpeed#
Global user_camera_pitch#, side#
Global Crouch%, CrouchState#
Global PlayerZone%, PlayerRoom.Rooms
Global GrabbedEntity%
Global InvertMouse% = IniGetInt(OptionFile, "options", "invert mouse y")
Global MouseHit1%, MouseDown1%, MouseHit2%, DoubleClick%, LastMouseHit1%, MouseUp1%
Global GodMode%, NoClip%, NoClipSpeed# = 2.0
Global CoffinDistance# = 100.0
Global PlayerSoundVolume#
;camera/lighting effects (blur, camera shake, etc)-------------------------------------------------------------------
Global Shake#
Global ExplosionTimer#, ExplosionSFX%
Global LightsOn% = True
Global SoundTransmission%
;menus, GUI ---------------------------------------------------------------------------------------------------------
Global MainMenuOpen%, MenuOpen%, StopHidingTimer#, InvOpen%
Global OtherOpen.Items = Null
Global SelectedEnding$, EndingScreen%, EndingTimer#
Global MsgTimer#, Msg$, DeathMSG$
Global AccessCode%, KeypadInput$, KeypadTimer#, KeypadMSG$
Global DrawHandIcon%
Dim DrawArrowIcon%(4)
;misc ---------------------------------------------------------------------------------------------------------------
Include "Difficulty.bb"
Global MTFtimer#, MTFrooms.Rooms[10], MTFroomState%[10]
Dim RadioState#(10)
Dim RadioState3%(10)
Dim RadioState4%(9)
Dim RadioCHN%(8)
Dim OldAiPics%(5)
Global PlayTime%
Global ConsoleFlush%
Global ConsoleFlushSnd% = 0, ConsoleMusFlush% = 0, ConsoleMusPlay% = 0
Global InfiniteStamina% = False
Global NVBlink%
Global IsNVGBlinking% = False
;[End block]
;---------------------------------------------- Console -----------------------------------------------------
Global ConsoleOpen%, ConsoleInput$
Global ConsoleScroll#,ConsoleScrollDragging%
Global ConsoleMouseMem%
Global ConsoleReissue.ConsoleMsg = Null
Global ConsoleR% = 255,ConsoleG% = 255,ConsoleB% = 255
Type ConsoleMsg
Field txt$
Field isCommand%
Field r%,g%,b%
End Type
Function CreateConsoleMsg(txt$,r%=-1,g%=-1,b%=-1,isCommand%=False)
Local c.ConsoleMsg = New ConsoleMsg
Insert c Before First ConsoleMsg
c\txt = txt
c\isCommand = isCommand
c\r = r
c\g = g
c\b = b
If (c\r<0) Then c\r = ConsoleR
If (c\g<0) Then c\g = ConsoleG
If (c\b<0) Then c\b = ConsoleB
End Function
Function UpdateConsole()
Local e.Events
If CanOpenConsole = False Then
ConsoleOpen = False
Return
EndIf
If ConsoleOpen Then
Local cm.ConsoleMsg
SetFont ConsoleFont
ConsoleR = 255 : ConsoleG = 255 : ConsoleB = 255
Local x% = 0, y% = GraphicHeight-300*MenuScale, width% = GraphicWidth, height% = 300*MenuScale-30*MenuScale
Local StrTemp$, temp%, i%
Local ev.Events, r.Rooms, it.Items
DrawFrame x,y,width,height+30*MenuScale
Local consoleHeight% = 0
Local scrollbarHeight% = 0
For cm.ConsoleMsg = Each ConsoleMsg
consoleHeight = consoleHeight + 15*MenuScale
Next
scrollbarHeight = (Float(height)/Float(consoleHeight))*height
If scrollbarHeight>height Then scrollbarHeight = height
If consoleHeight<height Then consoleHeight = height
Color 50,50,50
inBar% = MouseOn(x+width-26*MenuScale,y,26*MenuScale,height)
If inBar Then Color 70,70,70
Rect x+width-26*MenuScale,y,26*MenuScale,height,True
Color 120,120,120
inBox% = MouseOn(x+width-23*MenuScale,y+height-scrollbarHeight+(ConsoleScroll*scrollbarHeight/height),20*MenuScale,scrollbarHeight)
If inBox Then Color 200,200,200
If ConsoleScrollDragging Then Color 255,255,255
Rect x+width-23*MenuScale,y+height-scrollbarHeight+(ConsoleScroll*scrollbarHeight/height),20*MenuScale,scrollbarHeight,True
If Not MouseDown(1) Then
ConsoleScrollDragging=False
ElseIf ConsoleScrollDragging Then
ConsoleScroll = ConsoleScroll+((ScaledMouseY()-ConsoleMouseMem)*height/scrollbarHeight)
ConsoleMouseMem = ScaledMouseY()
EndIf
If (Not ConsoleScrollDragging) Then
If MouseHit1 Then
If inBox Then
ConsoleScrollDragging=True
ConsoleMouseMem = ScaledMouseY()
ElseIf inBar Then
ConsoleScroll = ConsoleScroll+((ScaledMouseY()-(y+height))*consoleHeight/height+(height/2))
ConsoleScroll = ConsoleScroll/2
EndIf
EndIf
EndIf
mouseScroll = MouseZSpeed()
If mouseScroll=1 Then
ConsoleScroll = ConsoleScroll - 15*MenuScale
ElseIf mouseScroll=-1 Then
ConsoleScroll = ConsoleScroll + 15*MenuScale
EndIf
Local reissuePos%
If KeyHit(200) Then
reissuePos% = 0
If (ConsoleReissue=Null) Then
ConsoleReissue=First ConsoleMsg
While (ConsoleReissue<>Null)
If (ConsoleReissue\isCommand) Then
Exit
EndIf
reissuePos = reissuePos - 15*MenuScale
ConsoleReissue = After ConsoleReissue
Wend
Else
cm.ConsoleMsg = First ConsoleMsg
While cm<>Null
If cm=ConsoleReissue Then Exit
reissuePos = reissuePos-15*MenuScale
cm = After cm
Wend
ConsoleReissue = After ConsoleReissue
reissuePos = reissuePos-15*MenuScale
While True
If (ConsoleReissue=Null) Then
ConsoleReissue=First ConsoleMsg
reissuePos = 0
EndIf
If (ConsoleReissue\isCommand) Then
Exit
EndIf
reissuePos = reissuePos - 15*MenuScale
ConsoleReissue = After ConsoleReissue
Wend
EndIf
If ConsoleReissue<>Null Then
ConsoleInput = ConsoleReissue\txt
ConsoleScroll = reissuePos+(height/2)
EndIf
EndIf
If KeyHit(208) Then
reissuePos% = -consoleHeight+15*MenuScale
If (ConsoleReissue=Null) Then
ConsoleReissue=Last ConsoleMsg
While (ConsoleReissue<>Null)
If (ConsoleReissue\isCommand) Then
Exit
EndIf
reissuePos = reissuePos + 15*MenuScale
ConsoleReissue = Before ConsoleReissue
Wend
Else
cm.ConsoleMsg = Last ConsoleMsg
While cm<>Null
If cm=ConsoleReissue Then Exit
reissuePos = reissuePos+15*MenuScale
cm = Before cm
Wend
ConsoleReissue = Before ConsoleReissue
reissuePos = reissuePos+15*MenuScale
While True
If (ConsoleReissue=Null) Then
ConsoleReissue=Last ConsoleMsg
reissuePos=-consoleHeight+15*MenuScale
EndIf
If (ConsoleReissue\isCommand) Then
Exit
EndIf
reissuePos = reissuePos + 15*MenuScale
ConsoleReissue = Before ConsoleReissue
Wend
EndIf
If ConsoleReissue<>Null Then
ConsoleInput = ConsoleReissue\txt
ConsoleScroll = reissuePos+(height/2)
EndIf
EndIf
If ConsoleScroll<-consoleHeight+height Then ConsoleScroll = -consoleHeight+height
If ConsoleScroll>0 Then ConsoleScroll = 0
Color 255, 255, 255
SelectedInputBox = 2
Local oldConsoleInput$ = ConsoleInput
ConsoleInput = InputBox(x, y + height, width, 30*MenuScale, ConsoleInput, 2)
If oldConsoleInput<>ConsoleInput Then
ConsoleReissue = Null
EndIf
ConsoleInput = Left(ConsoleInput, 100)
If (KeyHit(28) Or KeyHit(156)) And ConsoleInput <> "" Then
ConsoleReissue = Null
ConsoleScroll = 0
CreateConsoleMsg(ConsoleInput,255,255,0,True)
If Instr(ConsoleInput, " ") > 0 Then
StrTemp$ = Lower(Left(ConsoleInput, Instr(ConsoleInput, " ") - 1))
Else
StrTemp$ = Lower(ConsoleInput)
End If
Select Lower(StrTemp)
Case "help"
;[Block]
If Instr(ConsoleInput, " ")<>0 Then
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Else
StrTemp$ = ""
EndIf
ConsoleR = 0 : ConsoleG = 255 : ConsoleB = 255
Select Lower(StrTemp)
Case "1",""
CreateConsoleMsg("命令列表 - 1/3页")
CreateConsoleMsg("******************************")
CreateConsoleMsg("- asd")
CreateConsoleMsg("- status")
CreateConsoleMsg("- camerapick")
CreateConsoleMsg("- ending")
CreateConsoleMsg("- noclipspeed")
CreateConsoleMsg("- noclip")
CreateConsoleMsg("- injure [值]")
CreateConsoleMsg("- infect [值]")
CreateConsoleMsg("- heal")
CreateConsoleMsg("- teleport [房间ID")
CreateConsoleMsg("- spawnitem [物品ID]")
CreateConsoleMsg("- wireframe")
CreateConsoleMsg("- 173speed")
CreateConsoleMsg("- 106speed")
CreateConsoleMsg("- 173state")
CreateConsoleMsg("- 106state")
CreateConsoleMsg("******************************")
CreateConsoleMsg("使用“help 2”或“help 3”以查看更多命令")
CreateConsoleMsg("使用“help [命令名]”以获得关于命令的详细信息")
CreateConsoleMsg("******************************")
Case "2"
CreateConsoleMsg("命令列表 - 2/3页")
CreateConsoleMsg("******************************")
CreateConsoleMsg("- spawn [NPC类型] [状态]")
CreateConsoleMsg("- reset096")
CreateConsoleMsg("- disable173")
CreateConsoleMsg("- enable173")
CreateConsoleMsg("- disable106")
CreateConsoleMsg("- enable106")
CreateConsoleMsg("- halloween")
CreateConsoleMsg("- sanic")
CreateConsoleMsg("- scp-420-j")
CreateConsoleMsg("- godmode")
CreateConsoleMsg("- revive")
CreateConsoleMsg("- noclip")
CreateConsoleMsg("- showfps")
CreateConsoleMsg("- 096state")
CreateConsoleMsg("- debughud")
CreateConsoleMsg("- camerafog [可视距离] [渲染距离]")
CreateConsoleMsg("- gamma [值]")
CreateConsoleMsg("- infinitestamina")
CreateConsoleMsg("******************************")
CreateConsoleMsg("使用“help [命令名]”以获得关于命令的详细信息")
CreateConsoleMsg("******************************")
Case "3"
CreateConsoleMsg("- playmusic [文件名 + .wav/.ogg]")
CreateConsoleMsg("- notarget")
CreateConsoleMsg("- unlockexits")
Case "asd"
CreateConsoleMsg("帮助 - asd")
CreateConsoleMsg("******************************")
CreateConsoleMsg("启用无敌模式,无碰撞,渲染线框,")
CreateConsoleMsg("并且设置可视距离为20,渲染距离为30。")
CreateConsoleMsg("******************************")
Case "camerafog"
CreateConsoleMsg("帮助 - camerafog")
CreateConsoleMsg("******************************")
CreateConsoleMsg("设置雾的绘制距离,迷雾在“可视距离”开始渲染,")
CreateConsoleMsg("直到“渲染距离”处变得完全不透明。")
CreateConsoleMsg("示例:camerafog 20 40")
CreateConsoleMsg("******************************")
Case "gamma"
CreateConsoleMsg("帮助 - gamma")
CreateConsoleMsg("******************************")
CreateConsoleMsg("设置游戏伽马值。")
CreateConsoleMsg("建议将伽马值设为0.0到2.0之内的值。")
CreateConsoleMsg("默认为1.0。")
CreateConsoleMsg("******************************")
Case "noclip","fly"
CreateConsoleMsg("帮助 - noclip")
CreateConsoleMsg("******************************")
CreateConsoleMsg("切换无碰撞,除非指定是否启用(on/off)。")
CreateConsoleMsg("允许视角无视任何碰撞移动。")
CreateConsoleMsg("******************************")
Case "godmode","god"
CreateConsoleMsg("帮助 - godmode")
CreateConsoleMsg("******************************")
CreateConsoleMsg("切换无敌模式,除非指定是否启用(on/off)。")
CreateConsoleMsg("防止玩家在正常情况下死亡。")
CreateConsoleMsg("******************************")
Case "wireframe"
CreateConsoleMsg("帮助 - wireframe")
CreateConsoleMsg("******************************")
CreateConsoleMsg("切换渲染线框,除非指定是否启用(on/off)。")
CreateConsoleMsg("只渲染几何体的边框,使其他部分不可见。")
CreateConsoleMsg("******************************")
Case "spawnitem"
CreateConsoleMsg("帮助 - spawnitem")
CreateConsoleMsg("******************************")
CreateConsoleMsg("在玩家的位置生成物品(可生成能在物品栏里出现的物品)。")
CreateConsoleMsg("在汉化计划中,你可以使用物品中文名、物品英文名或物品ID生成物品。")
CreateConsoleMsg("示例:spawnitem 万能钥匙卡 / spawnitem key card omni / spawnitem key6")
CreateConsoleMsg("******************************")
Case "spawn"
CreateConsoleMsg("帮助 - spawn")
CreateConsoleMsg("******************************")
CreateConsoleMsg("在玩家的位置生成NPC。")
CreateConsoleMsg("可用参数:")
CreateConsoleMsg("008zombie / 049 / 049-2 / 066 / 096 / 106 / 173")
CreateConsoleMsg("/ 178-1 / 372 / 513-1 / 966 / 1499-1 / class-d")
CreateConsoleMsg("/ guard / mtf / apache / tentacle")
CreateConsoleMsg("******************************")
Case "revive","undead","resurrect"
CreateConsoleMsg("帮助 - revive")
CreateConsoleMsg("******************************")
CreateConsoleMsg("在死亡动画触发后重置玩家的死亡计时器。")
CreateConsoleMsg("不影响受伤、失血和008感染。")
CreateConsoleMsg("******************************")
Case "teleport"
CreateConsoleMsg("帮助 - teleport")
CreateConsoleMsg("******************************")
CreateConsoleMsg("将玩家传送到指定房间。")
CreateConsoleMsg("可用的房间ID可在room.ini中找到。")
CreateConsoleMsg("******************************")
Case "stopsound", "stfu"
CreateConsoleMsg("帮助 - stopsound")
CreateConsoleMsg("******************************")
CreateConsoleMsg("停止播放所有声音。")
CreateConsoleMsg("******************************")
Case "camerapick"
CreateConsoleMsg("帮助 - camerapick")
CreateConsoleMsg("******************************")
CreateConsoleMsg("打印镜头指向的模型的贴图名称和坐标。")
CreateConsoleMsg("******************************")
Case "status"
CreateConsoleMsg("帮助 - status")
CreateConsoleMsg("******************************")
CreateConsoleMsg("打印玩家、视角和房间信息。")
CreateConsoleMsg("******************************")
Case "weed","scp-420-j","420"
CreateConsoleMsg("帮助 - 420")
CreateConsoleMsg("******************************")
CreateConsoleMsg("生成亿堆牛█的SCP-420-J!")
CreateConsoleMsg("******************************")
Case "playmusic"
CreateConsoleMsg("帮助 - playmusic")
CreateConsoleMsg("******************************")
CreateConsoleMsg("播放“SFX\Music\Custom\”文件夹内的.ogg/.wav格式文件。")
CreateConsoleMsg("******************************")
Default
CreateConsoleMsg("该命令没有可用的帮助",255,150,0)
End Select
;[End Block]
Case "asd"
;[Block]
WireFrame 1
WireframeState=1
GodMode = 1
NoClip = 1
CameraFogNear = 15
CameraFogFar = 20
;[End Block]
Case "status"
;[Block]
ConsoleR = 0 : ConsoleG = 255 : ConsoleB = 0
CreateConsoleMsg("******************************")
CreateConsoleMsg("状态: ")
CreateConsoleMsg("坐标: ")
CreateConsoleMsg(" - 碰撞: "+EntityX(Collider)+", "+EntityY(Collider)+", "+EntityZ(Collider))
CreateConsoleMsg(" - 视角: "+EntityX(Camera)+", "+EntityY(Camera)+", "+EntityZ(Camera))
CreateConsoleMsg("旋转: ")
CreateConsoleMsg(" - 碰撞: "+EntityPitch(Collider)+", "+EntityYaw(Collider)+", "+EntityRoll(Collider))
CreateConsoleMsg(" - 视角: "+EntityPitch(Camera)+", "+EntityYaw(Camera)+", "+EntityRoll(Camera))
CreateConsoleMsg("房间: "+PlayerRoom\RoomTemplate\Name)
For ev.Events = Each Events
If ev\room = PlayerRoom Then
CreateConsoleMsg("房间事件: "+ev\EventName)
CreateConsoleMsg("- state: "+ev\EventState)
CreateConsoleMsg("- state2: "+ev\EventState2)
CreateConsoleMsg("- state3: "+ev\EventState3)
Exit
EndIf
Next
CreateConsoleMsg("状态: "+Floor(EntityX(PlayerRoom\obj) / 8.0 + 0.5)+", "+ Floor(EntityZ(PlayerRoom\obj) / 8.0 + 0.5))
CreateConsoleMsg("耐力: "+Stamina)
CreateConsoleMsg("死亡计时: "+KillTimer)
CreateConsoleMsg("眨眼计时: "+BlinkTimer)
CreateConsoleMsg("受伤: "+Injuries)
CreateConsoleMsg("失血: "+Bloodloss)
CreateConsoleMsg("******************************")
;[End Block]
Case "camerapick"
;[Block]
ConsoleR = 0 : ConsoleG = 255 : ConsoleB = 0
c = CameraPick(Camera,GraphicWidth/2, GraphicHeight/2)
If c = 0 Then
CreateConsoleMsg("******************************")
CreateConsoleMsg("无实体被捡起")
CreateConsoleMsg("******************************")
Else
CreateConsoleMsg("******************************")
CreateConsoleMsg("捡起的实体:")
sf = GetSurface(c,1)
b = GetSurfaceBrush(sf)
t = GetBrushTexture(b,0)
texname$ = StripPath(TextureName(t))
CreateConsoleMsg("材质名: "+texname)
CreateConsoleMsg("坐标: "+EntityX(c)+", "+EntityY(c)+", "+EntityZ(c))
CreateConsoleMsg("******************************")
EndIf
;[End Block]
Case "hidedistance"
;[Block]
HideDistance = Float(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
CreateConsoleMsg("隐藏状态设置为"+HideDistance)
;[End Block]
Case "ending"
;[Block]
SelectedEnding = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
KillTimer = -0.1
;[End Block]
Case "noclipspeed"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
NoClipSpeed = Float(StrTemp)
;[End Block]
Case "injure"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Injuries = Float(StrTemp)
;[End Block]
Case "infect"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Infect = Float(StrTemp)
;[End Block]
Case "heal"
;[Block]
Injuries = 0
Bloodloss = 0
;[End Block]
Case "teleport"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "895", "scp-895"
StrTemp = "coffin"
Case "scp-914"
StrTemp = "914"
Case "offices", "office"
StrTemp = "room2offices"
End Select
For r.Rooms = Each Rooms
If r\RoomTemplate\Name = StrTemp Then
PositionEntity (Collider, EntityX(r\obj), EntityY(r\obj)+0.7, EntityZ(r\obj))
ResetEntity(Collider)
UpdateDoors()
UpdateRooms()
For it.Items = Each Items
it\disttimer = 0
Next
PlayerRoom = r
Exit
EndIf
Next
If PlayerRoom\RoomTemplate\Name <> StrTemp Then CreateConsoleMsg("房间未找到",255,150,0)
;[End Block]
Case "spawnitem"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
temp = False
For itt.Itemtemplates = Each ItemTemplates
If (Lower(itt\name) = StrTemp) Then
temp = True
CreateConsoleMsg(itt\displayName + " 已生成")
it.Items = CreateItem(itt\name, itt\tempname, EntityX(Collider), EntityY(Camera,True), EntityZ(Collider))
EntityType(it\collider, HIT_ITEM)
Exit
Else If (Lower(itt\tempname) = StrTemp) Then
temp = True
CreateConsoleMsg(itt\displayName + " 已生成")
it.Items = CreateItem(itt\name, itt\tempname, EntityX(Collider), EntityY(Camera,True), EntityZ(Collider))
EntityType(it\collider, HIT_ITEM)
Exit
Else If (Lower(itt\displayName) = StrTemp) Then
temp = True
CreateConsoleMsg(itt\displayName + " 已生成")
it.Items = CreateItem(itt\name, itt\tempname, EntityX(Collider), EntityY(Camera,True), EntityZ(Collider))
EntityType(it\collider, HIT_ITEM)
Exit
End If
Next
If temp = False Then CreateConsoleMsg("物品未找到",255,150,0)
;[End Block]
Case "wireframe"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Select StrTemp
Case "on", "1", "true"
WireframeState = True
Case "off", "0", "false"
WireframeState = False
Default
WireframeState = Not WireframeState
End Select
If WireframeState Then
CreateConsoleMsg("渲染选框 启用")
Else
CreateConsoleMsg("渲染选框 禁用")
EndIf
WireFrame WireframeState
;[End Block]
Case "173speed"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Curr173\Speed = Float(StrTemp)
CreateConsoleMsg("173速度已设为 " + StrTemp)
;[End Block]
Case "106speed"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Curr106\Speed = Float(StrTemp)
CreateConsoleMsg("106速度已设为 " + StrTemp)
;[End Block]
Case "173state"
;[Block]
CreateConsoleMsg("SCP-173")
CreateConsoleMsg("位置: " + EntityX(Curr173\obj) + ", " + EntityY(Curr173\obj) + ", " + EntityZ(Curr173\obj))
CreateConsoleMsg("游荡: " + Curr173\Idle)
CreateConsoleMsg("状态: " + Curr173\State)
;[End Block]
Case "106state"
;[Block]
CreateConsoleMsg("SCP-106")
CreateConsoleMsg("位置: " + EntityX(Curr106\obj) + ", " + EntityY(Curr106\obj) + ", " + EntityZ(Curr106\obj))
CreateConsoleMsg("游荡: " + Curr106\Idle)
CreateConsoleMsg("状态: " + Curr106\State)
;[End Block]
Case "reset096"
;[Block]
For n.NPCs = Each NPCs
If n\NPCtype = NPCtype096 Then
n\State = 0
StopStream_Strict(n\SoundChn) : n\SoundChn=0
If n\SoundChn2<>0
StopStream_Strict(n\SoundChn2) : n\SoundChn2=0
EndIf
Exit
EndIf
Next
;[End Block]
Case "disable173"
;[Block]
Curr173\Idle = 3 ;This phenominal comment is brought to you by PolyFox. His absolute wisdom in this fatigue of knowledge brought about a new era of 173 state checks.
HideEntity Curr173\obj
HideEntity Curr173\Collider
;[End Block]
Case "enable173"
;[Block]
Curr173\Idle = False
ShowEntity Curr173\obj
ShowEntity Curr173\Collider
;[End Block]
Case "disable106"
;[Block]
Curr106\Idle = True
Curr106\State = 200000
Contained106 = True
;[End Block]
Case "enable106"
;[Block]
Curr106\Idle = False
Contained106 = False
ShowEntity Curr106\Collider
ShowEntity Curr106\obj
;[End Block]
Case "halloween"
;[Block]
HalloweenTex = Not HalloweenTex
If HalloweenTex Then
Local tex = LoadTexture_Strict("GFX\npcs\173h.jpg", 1)
EntityTexture Curr173\obj, tex, 0, 0
FreeTexture tex
CreateConsoleMsg("南瓜173 启用")
Else
Local tex2 = LoadTexture_Strict("GFX\npcs\173texture.jpg", 1)
EntityTexture Curr173\obj, tex2, 0, 0
FreeTexture tex2
CreateConsoleMsg("南瓜173 禁用")
EndIf
;[End Block]
Case "sanic"
;[Block]
SuperMan = Not SuperMan
If SuperMan = True Then
CreateConsoleMsg("GOTTA GO FAST")
Else
CreateConsoleMsg("WHOA SLOW DOWN")
EndIf
;[End Block]
Case "scp-420-j","420","weed"
;[Block]
For i = 1 To 20
If Rand(2)=1 Then
it.Items = CreateItem("Some SCP-420-J","420", EntityX(Collider,True)+Cos((360.0/20.0)*i)*Rnd(0.3,0.5), EntityY(Camera,True), EntityZ(Collider,True)+Sin((360.0/20.0)*i)*Rnd(0.3,0.5))
Else
it.Items = CreateItem("Joint","420s", EntityX(Collider,True)+Cos((360.0/20.0)*i)*Rnd(0.3,0.5), EntityY(Camera,True), EntityZ(Collider,True)+Sin((360.0/20.0)*i)*Rnd(0.3,0.5))
EndIf
EntityType (it\collider, HIT_ITEM)
Next
PlaySound_Strict LoadTempSound("SFX\Music\420J.ogg")
;[End Block]
Case "godmode", "god"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))