-
Notifications
You must be signed in to change notification settings - Fork 109
/
Main.bb
12087 lines (10385 loc) · 371 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 - Containment Breach
; The game is based on the works of the SCP Foundation community (http://www.scp-wiki.net/).
; The source code is licensed under Creative Commons Attribution-ShareAlike 3.0 License.
; http://creativecommons.org/licenses/by-sa/3.0/
; See Credits.txt for a list of contributors
Local InitErrorStr$ = ""
;If FileSize("bb_fmod.dll")=0 Then InitErrorStr=InitErrorStr+ "bb_fmod.dll"+Chr(13)+Chr(10)
If FileSize("fmod.dll")=0 Then InitErrorStr=InitErrorStr+ "fmod.dll"+Chr(13)+Chr(10)
If FileSize("zlibwapi.dll")=0 Then InitErrorStr=InitErrorStr+ "zlibwapi.dll"+Chr(13)+Chr(10)
If Len(InitErrorStr)>0 Then
RuntimeError "The following DLLs were not found in the game directory:"+Chr(13)+Chr(10)+Chr(13)+Chr(10)+InitErrorStr
EndIf
Include "FMod.bb"
Include "StrictLoads.bb"
Include "fullscreen_window_fix.bb"
Include "KeyName.bb"
Global OptionFile$ = "options.ini"
Include "Blitz_Basic_Bank.bb"
Include "Blitz_File_FileName.bb"
Include "Blitz_File_ZipApi.bb"
Include "Update.bb"
Include "DevilParticleSystem.bb"
Global ErrorFile$ = "error_log_"
Local ErrorFileInd% = 0
While FileType(ErrorFile+Str(ErrorFileInd)+".txt")<>0
ErrorFileInd = ErrorFileInd+1
Wend
ErrorFile = ErrorFile+Str(ErrorFileInd)+".txt"
Global UpdaterFont%
Global Font1%, Font2%, Font3%, Font4%, Font5%
Global ConsoleFont%
Global VersionNumber$ = "1.3.11"
Global CompatibleNumber$ = "1.3.11" ;Only change this if the version given isn't working with the current build version - ENDSHN
Global MenuWhite%, MenuBlack%
Global ButtonSFX%
Global EnableSFXRelease% = GetINIInt(OptionFile, "audio", "sfx release")
Global EnableSFXRelease_Prev% = EnableSFXRelease%
Global CanOpenConsole% = GetINIInt(OptionFile, "console", "enabled")
Dim ArrowIMG(4)
;[Block]
Global LauncherWidth%= Min(GetINIInt(OptionFile, "launcher", "launcher width"), 1024)
Global LauncherHeight% = Min(GetINIInt(OptionFile, "launcher", "launcher height"), 768)
Global LauncherEnabled% = GetINIInt(OptionFile, "launcher", "launcher enabled")
Global LauncherIMG%
Global GraphicWidth% = GetINIInt(OptionFile, "options", "width")
Global GraphicHeight% = GetINIInt(OptionFile, "options", "height")
Global Depth% = 0, Fullscreen% = GetINIInt(OptionFile, "options", "fullscreen")
Global SelectedGFXMode%
Global SelectedGFXDriver% = Max(GetINIInt(OptionFile, "options", "gfx driver"), 1)
Global fresize_image%, fresize_texture%, fresize_texture2%
Global fresize_cam%
Global ShowFPS = GetINIInt(OptionFile, "options", "show FPS")
Global WireframeState
Global HalloweenTex
Global TotalGFXModes% = CountGfxModes3D(), GFXModes%
Dim GfxModeWidths%(TotalGFXModes), GfxModeHeights%(TotalGFXModes)
Global BorderlessWindowed% = GetINIInt(OptionFile, "options", "borderless windowed")
Global RealGraphicWidth%,RealGraphicHeight%
Global AspectRatioRatio#
Global EnableRoomLights% = GetINIInt(OptionFile, "options", "room lights enabled")
Global TextureDetails% = GetINIInt(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% = GetINIInt(OptionFile, "console", "auto opening")
Global SFXVolume# = GetINIFloat(OptionFile, "audio", "sound volume")
Global Bit16Mode = GetINIInt(OptionFile, "options", "16bit")
Include "AAText.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 G_viewport_width, G_viewport_height, 0, 2
; -- Change the window style to 'WS_POPUP' and then set the window position to force the style to update.
api_SetWindowLong( G_app_handle, C_GWL_STYLE, C_WS_POPUP )
api_SetWindowPos( G_app_handle, C_HWND_TOP, G_viewport_x, G_viewport_y, G_viewport_width, G_viewport_height, C_SWP_SHOWWINDOW )
RealGraphicWidth = G_viewport_width
RealGraphicHeight = G_viewport_height
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 G_viewport_width, G_viewport_height, 0, 2
; -- Change the window style to 'WS_POPUP' and then set the window position to force the style to update.
api_SetWindowLong( G_app_handle, C_GWL_STYLE, C_WS_POPUP )
api_SetWindowPos( G_app_handle, C_HWND_TOP, G_viewport_x, G_viewport_y, G_viewport_width, G_viewport_height, C_SWP_SHOWWINDOW )
RealGraphicWidth = G_viewport_width
RealGraphicHeight = G_viewport_height
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% = GetINIInt(OptionFile, "options", "framelimit")
Global Vsync% = GetINIInt(OptionFile, "options", "vsync")
Global Opt_AntiAlias = GetINIInt(OptionFile, "options", "antialias")
Global CurrFrameLimit# = (Framelimit%-19)/100.0
Global ScreenGamma# = GetINIFloat(OptionFile, "options", "screengamma")
;If Fullscreen Then UpdateScreenGamma()
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 - Containment Breach 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")
InitAAFont()
;For some reason, Blitz3D doesn't load fonts that have filenames that
;don't match their "internal name" (i.e. their display name in applications
;like Word and such). As a workaround, I moved the files and renamed them so they
;can load without FastText.
Font1% = AALoadFont("GFX\font\cour\Courier New.ttf", Int(19 * (GraphicHeight / 1024.0)), 0,0,0)
Font2% = AALoadFont("GFX\font\courbd\Courier New.ttf", Int(58 * (GraphicHeight / 1024.0)), 0,0,0)
Font3% = AALoadFont("GFX\font\DS-DIGI\DS-Digital.ttf", Int(22 * (GraphicHeight / 1024.0)), 0,0,0)
Font4% = AALoadFont("GFX\font\DS-DIGI\DS-Digital.ttf", Int(60 * (GraphicHeight / 1024.0)), 0,0,0)
Font5% = AALoadFont("GFX\font\Journal\Journal.ttf", Int(58 * (GraphicHeight / 1024.0)), 0,0,0)
Global CreditsFont%,CreditsFont2%
ConsoleFont% = AALoadFont("Blitz", Int(20 * (GraphicHeight / 1024.0)), 0,0,0,1)
AASetFont 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 = GetINIInt(OptionFile, "binds", "Right key")
Global KEY_LEFT = GetINIInt(OptionFile, "binds", "Left key")
Global KEY_UP = GetINIInt(OptionFile, "binds", "Up key")
Global KEY_DOWN = GetINIInt(OptionFile, "binds", "Down key")
Global KEY_BLINK = GetINIInt(OptionFile, "binds", "Blink key")
Global KEY_SPRINT = GetINIInt(OptionFile, "binds", "Sprint key")
Global KEY_INV = GetINIInt(OptionFile, "binds", "Inventory key")
Global KEY_CROUCH = GetINIInt(OptionFile, "binds", "Crouch key")
Global KEY_SAVE = GetINIInt(OptionFile, "binds", "Save key")
Global KEY_CONSOLE = GetINIInt(OptionFile, "binds", "Console key")
Global MouseSmooth# = GetINIFloat(OptionFile,"options", "mouse smoothing", 1.0)
Const INFINITY# = (999.0) ^ (99999.0), NAN# = (-1.0) ^ (0.5)
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% = GetINIInt(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
AASetFont 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) 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("LIST OF COMMANDS - PAGE 1/3")
CreateConsoleMsg("******************************")
CreateConsoleMsg("- asd")
CreateConsoleMsg("- status")
CreateConsoleMsg("- camerapick")
CreateConsoleMsg("- ending")
CreateConsoleMsg("- noclipspeed")
CreateConsoleMsg("- noclip")
CreateConsoleMsg("- injure [value]")
CreateConsoleMsg("- infect [value]")
CreateConsoleMsg("- heal")
CreateConsoleMsg("- teleport [room name]")
CreateConsoleMsg("- spawnitem [item name]")
CreateConsoleMsg("- wireframe")
CreateConsoleMsg("- 173speed")
CreateConsoleMsg("- 106speed")
CreateConsoleMsg("- 173state")
CreateConsoleMsg("- 106state")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Use "+Chr(34)+"help 2/3"+Chr(34)+" to find more commands.")
CreateConsoleMsg("Use "+Chr(34)+"help [command name]"+Chr(34)+" to get more information about a command.")
CreateConsoleMsg("******************************")
Case "2"
CreateConsoleMsg("LIST OF COMMANDS - PAGE 2/3")
CreateConsoleMsg("******************************")
CreateConsoleMsg("- spawn [npc type] [state]")
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 [near] [far]")
CreateConsoleMsg("- gamma [value]")
CreateConsoleMsg("- infinitestamina")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Use "+Chr(34)+"help [command name]"+Chr(34)+" to get more information about a command.")
CreateConsoleMsg("******************************")
Case "3"
CreateConsoleMsg("- playmusic [clip + .wav/.ogg]")
CreateConsoleMsg("- notarget")
CreateConsoleMsg("- unlockexits")
Case "asd"
CreateConsoleMsg("HELP - asd")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Actives godmode, noclip, wireframe and")
CreateConsoleMsg("sets fog distance to 20 near, 30 far")
CreateConsoleMsg("******************************")
Case "camerafog"
CreateConsoleMsg("HELP - camerafog")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Sets the draw distance of the fog.")
CreateConsoleMsg("The fog begins generating at 'CameraFogNear' units")
CreateConsoleMsg("away from the camera and becomes completely opaque")
CreateConsoleMsg("at 'CameraFogFar' units away from the camera.")
CreateConsoleMsg("Example: camerafog 20 40")
CreateConsoleMsg("******************************")
Case "gamma"
CreateConsoleMsg("HELP - gamma")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Sets the gamma correction.")
CreateConsoleMsg("Should be set to a value between 0.0 and 2.0.")
CreateConsoleMsg("Default is 1.0.")
CreateConsoleMsg("******************************")
Case "noclip","fly"
CreateConsoleMsg("HELP - noclip")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Toggles noclip, unless a valid parameter")
CreateConsoleMsg("is specified (on/off).")
CreateConsoleMsg("Allows the camera to move in any direction while")
CreateConsoleMsg("bypassing collision.")
CreateConsoleMsg("******************************")
Case "godmode","god"
CreateConsoleMsg("HELP - godmode")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Toggles godmode, unless a valid parameter")
CreateConsoleMsg("is specified (on/off).")
CreateConsoleMsg("Prevents player death under normal circumstances.")
CreateConsoleMsg("******************************")
Case "wireframe"
CreateConsoleMsg("HELP - wireframe")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Toggles wireframe, unless a valid parameter")
CreateConsoleMsg("is specified (on/off).")
CreateConsoleMsg("Allows only the edges of geometry to be rendered,")
CreateConsoleMsg("making everything else transparent.")
CreateConsoleMsg("******************************")
Case "spawnitem"
CreateConsoleMsg("HELP - spawnitem")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Spawns an item at the player's location.")
CreateConsoleMsg("Any name that can appear in your inventory")
CreateConsoleMsg("is a valid parameter.")
CreateConsoleMsg("Example: spawnitem Key Card Omni")
CreateConsoleMsg("******************************")
Case "spawn"
CreateConsoleMsg("HELP - spawn")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Spawns an NPC at the player's location.")
CreateConsoleMsg("Valid parameters are:")
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("HELP - revive")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Resets the player's death timer after the dying")
CreateConsoleMsg("animation triggers.")
CreateConsoleMsg("Does not affect injury, blood loss")
CreateConsoleMsg("or 008 infection values.")
CreateConsoleMsg("******************************")
Case "teleport"
CreateConsoleMsg("HELP - teleport")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Teleports the player to the first instance")
CreateConsoleMsg("of the specified room. Any room that appears")
CreateConsoleMsg("in rooms.ini is a valid parameter.")
CreateConsoleMsg("******************************")
Case "stopsound", "stfu"
CreateConsoleMsg("HELP - stopsound")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Stops all currently playing sounds.")
CreateConsoleMsg("******************************")
Case "camerapick"
CreateConsoleMsg("HELP - camerapick")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Prints the texture name and coordinates of")
CreateConsoleMsg("the model the camera is pointing at.")
CreateConsoleMsg("******************************")
Case "status"
CreateConsoleMsg("HELP - status")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Prints player, camera, and room information.")
CreateConsoleMsg("******************************")
Case "weed","scp-420-j","420"
CreateConsoleMsg("HELP - 420")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Generates dank memes.")
CreateConsoleMsg("******************************")
Case "playmusic"
CreateConsoleMsg("HELP - playmusic")
CreateConsoleMsg("******************************")
CreateConsoleMsg("Will play tracks in .ogg/.wav format")
CreateConsoleMsg("from "+Chr(34)+"SFX\Music\Custom\"+Chr(34)+".")
CreateConsoleMsg("******************************")
Default
CreateConsoleMsg("There is no help available for that command.",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("Status: ")
CreateConsoleMsg("Coordinates: ")
CreateConsoleMsg(" - collider: "+EntityX(Collider)+", "+EntityY(Collider)+", "+EntityZ(Collider))
CreateConsoleMsg(" - camera: "+EntityX(Camera)+", "+EntityY(Camera)+", "+EntityZ(Camera))
CreateConsoleMsg("Rotation: ")
CreateConsoleMsg(" - collider: "+EntityPitch(Collider)+", "+EntityYaw(Collider)+", "+EntityRoll(Collider))
CreateConsoleMsg(" - camera: "+EntityPitch(Camera)+", "+EntityYaw(Camera)+", "+EntityRoll(Camera))
CreateConsoleMsg("Room: "+PlayerRoom\RoomTemplate\Name)
For ev.Events = Each Events
If ev\room = PlayerRoom Then
CreateConsoleMsg("Room event: "+ev\EventName)
CreateConsoleMsg("- state: "+ev\EventState)
CreateConsoleMsg("- state2: "+ev\EventState2)
CreateConsoleMsg("- state3: "+ev\EventState3)
Exit
EndIf
Next
CreateConsoleMsg("Room coordinates: "+Floor(EntityX(PlayerRoom\obj) / 8.0 + 0.5)+", "+ Floor(EntityZ(PlayerRoom\obj) / 8.0 + 0.5))
CreateConsoleMsg("Stamina: "+Stamina)
CreateConsoleMsg("Death timer: "+KillTimer)
CreateConsoleMsg("Blinktimer: "+BlinkTimer)
CreateConsoleMsg("Injuries: "+Injuries)
CreateConsoleMsg("Bloodloss: "+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("No entity picked")
CreateConsoleMsg("******************************")
Else
CreateConsoleMsg("******************************")
CreateConsoleMsg("Picked entity:")
sf = GetSurface(c,1)
b = GetSurfaceBrush( sf )
t = GetBrushTexture(b,0)
texname$ = StripPath(TextureName(t))
CreateConsoleMsg("Texture name: "+texname)
CreateConsoleMsg("Coordinates: "+EntityX(c)+", "+EntityY(c)+", "+EntityZ(c))
CreateConsoleMsg("******************************")
EndIf
;[End Block]
Case "hidedistance"
;[Block]
HideDistance = Float(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
CreateConsoleMsg("Hidedistance set to "+HideDistance)
;[End Block]
Case "ending"
;[Block]
SelectedEnding = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
KillTimer = -0.1
;EndingTimer = -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), 0.7, EntityZ(r\obj))
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("Room not found.",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\name + " spawned.")
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\name + " spawned.")
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("Item not found.",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("WIREFRAME ON")
Else
CreateConsoleMsg("WIREFRAME OFF")
EndIf
WireFrame WireframeState
;[End Block]
Case "173speed"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Curr173\Speed = Float(StrTemp)
CreateConsoleMsg("173's speed set to " + StrTemp)
;[End Block]
Case "106speed"
;[Block]
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Curr106\Speed = Float(StrTemp)
CreateConsoleMsg("106's speed set to " + StrTemp)
;[End Block]
Case "173state"
;[Block]
CreateConsoleMsg("SCP-173")
CreateConsoleMsg("Position: " + EntityX(Curr173\obj) + ", " + EntityY(Curr173\obj) + ", " + EntityZ(Curr173\obj))
CreateConsoleMsg("Idle: " + Curr173\Idle)
CreateConsoleMsg("State: " + Curr173\State)
;[End Block]
Case "106state"
;[Block]
CreateConsoleMsg("SCP-106")
CreateConsoleMsg("Position: " + EntityX(Curr106\obj) + ", " + EntityY(Curr106\obj) + ", " + EntityZ(Curr106\obj))
CreateConsoleMsg("Idle: " + Curr106\Idle)
CreateConsoleMsg("State: " + 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.pt", 1)
EntityTexture Curr173\obj, tex, 0, 0
FreeTexture tex
CreateConsoleMsg("173 JACK-O-LANTERN ON")
Else
Local tex2 = LoadTexture_Strict("GFX\npcs\173texture.jpg", 1)
EntityTexture Curr173\obj, tex2, 0, 0
FreeTexture tex2
CreateConsoleMsg("173 JACK-O-LANTERN OFF")
EndIf
;[End Block]
Case "sanic"
;[Block]
SuperMan = Not SuperMan
If SuperMan = True Then