Skip to content

Commit

Permalink
Fixed a bug with the Ulgrin event, added 173 texture change on Hallow…
Browse files Browse the repository at this point in the history
…een and added ambience to the pause menu.
  • Loading branch information
CommanderMark committed Oct 15, 2016
1 parent a66162a commit 7236582
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 42 deletions.
70 changes: 34 additions & 36 deletions Main.bb
Original file line number Diff line number Diff line change
Expand Up @@ -827,14 +827,6 @@ Function UpdateConsole()
Next

If PlayerRoom\RoomTemplate\Name <> StrTemp Then CreateConsoleMsg("Room not found.",255,150,0)

Case "unlockexits"

RemoteDoorOn=True
For e.Events = Each Events
If e\EventName="exit1" Or e\EventName="gatea" Then e\EventState3=1
Next
PlaySound_Strict (LoadTempSound("SFX\SCP\079\GateB.ogg"))

Case "spawnitem"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))
Expand Down Expand Up @@ -1149,26 +1141,32 @@ Function UpdateConsole()
e\EventState = (Not e\EventState)
Exit
EndIf
Next

Case "toggle_079_deal"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))

Select StrTemp
Case "a"
For e.Events = Each Events
If e\EventName="gateaentrance" Then
e\EventState3 = (Not e\EventState3)
Exit
EndIf
Next
Case "b"
For e.Events = Each Events
If e\EventName="exit1" Then
e\EventState3 = (Not e\EventState3)
Exit
EndIf
Next
Next

Case "unlockexits", "toggle_079_deal"
StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " ")))

Select StrTemp
Case "a"
For e.Events = Each Events
If e\EventName = "gateaentrance" Then
e\EventState3 = (Not e\EventState3)
Exit
EndIf
Next
Case "b"
For e.Events = Each Events
If e\EventName = "exit1" Then
e\EventState3 = (Not e\EventState3)
Exit
EndIf
Next
Default
For e.Events = Each Events
If e\EventName = "exit1" Or e\EventName = "gatea" Then e\EventState3 = (Not e\EventState3)
Next

RemoteDoorOn = (Not RemoteDoorOn)
End Select

Case "kill","suicide"
Expand Down Expand Up @@ -2583,27 +2581,27 @@ Repeat
If KeyHit(KEY_INV) Then
If InvOpen Then
ResumeSounds()
MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0
MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1# = 0.0 : mouse_y_speed_1# = 0.0
Else
PauseSounds()
EndIf
InvOpen = Not InvOpen
If OtherOpen<>Null Then OtherOpen=Null
If OtherOpen <> Null Then OtherOpen = Null
SelectedItem = Null
EndIf

If (Not MenuOpen) And (Not ConsoleOpen) And PlayerRoom\RoomTemplate\Name <> "pocketdimension" And PlayerRoom\RoomTemplate\Name <> "gatea" And PlayerRoom\RoomTemplate\Name <> "exit1" Then
If PlayerRoom\RoomTemplate\Name <> "pocketdimension" And PlayerRoom\RoomTemplate\Name <> "gatea" And PlayerRoom\RoomTemplate\Name <> "exit1" And (Not MenuOpen) And (Not ConsoleOpen) Then

If Rand(1500) = 1 Then
For i = 0 To 5
If AmbientSFX(i,CurrAmbientSFX)<>0 Then
If ChannelPlaying(AmbientSFXCHN)=0 Then FreeSound_Strict AmbientSFX(i,CurrAmbientSFX) : AmbientSFX(i,CurrAmbientSFX) = 0
If AmbientSFX(i,CurrAmbientSFX) <> 0 Then
If ChannelPlaying(AmbientSFXCHN) = 0 Then FreeSound_Strict AmbientSFX(i,CurrAmbientSFX) : AmbientSFX(i,CurrAmbientSFX) = 0
EndIf
Next

PositionEntity (SoundEmitter, EntityX(Camera) + Rnd(-1.0, 1.0), 0.0, EntityZ(Camera) + Rnd(-1.0, 1.0))

If Rand(3)=1 Then PlayerZone = 3
If Rand(3) = 1 Then PlayerZone = 3

If PlayerRoom\RoomTemplate\Name = "173" Then
PlayerZone = 4
Expand Down Expand Up @@ -2634,8 +2632,8 @@ Repeat
End Select

AmbientSFXCHN = PlaySound2(AmbientSFX(PlayerZone,CurrAmbientSFX), Camera, SoundEmitter)
EndIf

EndIf
If Rand(50000) = 3 Then
Local RN$ = PlayerRoom\RoomTemplate\Name$
If RN$ <> "room860" And RN$ <> "room1123" And RN$ <> "173" And RN$ <> "dimension1499" Then
Expand Down
13 changes: 11 additions & 2 deletions NPCs.bb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,16 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#)
EntityType n\Collider, HIT_PLAYER
n\Gravity = True

n\obj = LoadMesh_Strict("GFX\npcs\173_2.b3d")
n\obj = LoadMesh_Strict("GFX\npcs\173_2.b3d")

;On Halloween set jack-o-latern texture.
If (Left(CurrentDate(), 7) = "31 Oct ") Then
HalloweenTex = True
Local texFestive = LoadTexture_Strict("GFX\npcs\173h.pt", 1)
EntityTexture n\obj, texFestive, 0, 0
FreeTexture texFestive
EndIf

temp# = (GetINIFloat("DATA\NPCs.ini", "SCP-173", "scale") / MeshDepth(n\obj))
ScaleEntity n\obj, temp,temp,temp

Expand Down Expand Up @@ -6140,7 +6149,7 @@ Function Shoot(x#, y#, z#, hitProb# = 1.0, particles% = True, instaKill% = False

If (Not GodMode) Then

If instaKill Then Kill() : DebugLog "WOw cringe" : Return
If instaKill Then Kill() : PlaySound_Strict BullethitSFX : Return

If Rnd(1.0) =< hitProb Then
TurnEntity Camera, Rnd(-3,3), Rnd(-3,3), 0
Expand Down
Binary file modified SFX/Room/Intro/WhatThe.ogg
Binary file not shown.
11 changes: 7 additions & 4 deletions UpdateEvents.bb
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,13 @@ Function UpdateEvents()
EndIf
EndIf

;If Ulgrin can see the player then start shooting at them.
If (CurrTrigger = "173scene_end") And EntityVisible(e\room\NPC[2]\Collider, Collider) And (Not GodMode) Then
e\room\NPC[2]\State = 1
e\room\NPC[2]\State3 = 1
;If Ulgrin can see the player then start shooting at them.
If (CurrTrigger = "173scene_end") And EntityVisible(e\room\NPC[2]\Collider, Collider) And (Not GodMode) Then
e\room\NPC[2]\State = 1
e\room\NPC[2]\State3 = 1
ElseIf e\room\NPC[2]\State = 1 And (Not EntityVisible(e\room\NPC[2]\Collider, Collider))
e\room\NPC[2]\State = 0
e\room\NPC[2]\State3 = 0
EndIf

If e\room\NPC[2]\State = 1 Then e\room\RoomDoors[5]\open = True
Expand Down

0 comments on commit 7236582

Please sign in to comment.