Fix registered trainers still do in sight check
This commit is contained in:
parent
edf225189d
commit
b7a045e37c
|
@ -352,7 +352,7 @@
|
||||||
|
|
||||||
If distance <= Me.TrainerSight Then
|
If distance <= Me.TrainerSight Then
|
||||||
Dim InSightMusic As String = "nomusic"
|
Dim InSightMusic As String = "nomusic"
|
||||||
|
Dim t As Trainer = Nothing
|
||||||
If Me.IsTrainer = True Then
|
If Me.IsTrainer = True Then
|
||||||
Dim trainerFilePath As String = GameModeManager.GetScriptPath(Me.AdditionalValue & ".dat")
|
Dim trainerFilePath As String = GameModeManager.GetScriptPath(Me.AdditionalValue & ".dat")
|
||||||
Security.FileValidation.CheckFileValid(trainerFilePath, False, "NPC.vb")
|
Security.FileValidation.CheckFileValid(trainerFilePath, False, "NPC.vb")
|
||||||
|
@ -365,7 +365,7 @@
|
||||||
If Trainer.IsBeaten(trainerID) = True Then
|
If Trainer.IsBeaten(trainerID) = True Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
Else
|
Else
|
||||||
Dim t As New Trainer(trainerID)
|
t = New Trainer(trainerID)
|
||||||
InSightMusic = t.GetInSightMusic()
|
InSightMusic = t.GetInSightMusic()
|
||||||
End If
|
End If
|
||||||
ElseIf l.StartsWith("@battle.starttrainer(") = True Then
|
ElseIf l.StartsWith("@battle.starttrainer(") = True Then
|
||||||
|
@ -373,73 +373,74 @@
|
||||||
If Trainer.IsBeaten(trainerID) = True Then
|
If Trainer.IsBeaten(trainerID) = True Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
Else
|
Else
|
||||||
Dim t As New Trainer(trainerID)
|
t = New Trainer(trainerID)
|
||||||
InSightMusic = t.GetInSightMusic()
|
InSightMusic = t.GetInSightMusic()
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
If t IsNot Nothing Then
|
||||||
|
Dim needFacing As Integer = 0
|
||||||
|
Select Case Me.faceRotation
|
||||||
|
Case 0
|
||||||
|
needFacing = 2
|
||||||
|
Case 1
|
||||||
|
needFacing = 3
|
||||||
|
Case 2
|
||||||
|
needFacing = 0
|
||||||
|
Case 3
|
||||||
|
needFacing = 1
|
||||||
|
End Select
|
||||||
|
Dim turns As Integer = needFacing - Screen.Camera.GetPlayerFacingDirection()
|
||||||
|
If turns < 0 Then
|
||||||
|
turns = 4 - turns.ToPositive()
|
||||||
|
End If
|
||||||
|
|
||||||
Dim needFacing As Integer = 0
|
CType(Core.CurrentScreen, OverworldScreen).TrainerEncountered = True
|
||||||
Select Case Me.faceRotation
|
If InSightMusic <> "nomusic" And InSightMusic <> "" Then
|
||||||
Case 0
|
MusicManager.Play(InSightMusic, True, 0.0F)
|
||||||
needFacing = 2
|
End If
|
||||||
Case 1
|
Screen.Camera.StopMovement()
|
||||||
needFacing = 3
|
Me.Movement = Movements.Still
|
||||||
Case 2
|
|
||||||
needFacing = 0
|
|
||||||
Case 3
|
|
||||||
needFacing = 1
|
|
||||||
End Select
|
|
||||||
Dim turns As Integer = needFacing - Screen.Camera.GetPlayerFacingDirection()
|
|
||||||
If turns < 0 Then
|
|
||||||
turns = 4 - turns.ToPositive()
|
|
||||||
End If
|
|
||||||
|
|
||||||
CType(Core.CurrentScreen, OverworldScreen).TrainerEncountered = True
|
Dim offset As New Vector2(0, 0)
|
||||||
If InSightMusic <> "nomusic" And InSightMusic <> "" Then
|
Select Case Me.faceRotation
|
||||||
MusicManager.Play(InSightMusic, True, 0.0F)
|
Case 0
|
||||||
End If
|
offset.Y = -0.01F
|
||||||
Screen.Camera.StopMovement()
|
Case 1
|
||||||
Me.Movement = Movements.Still
|
offset.X = -0.01F
|
||||||
|
Case 2
|
||||||
|
offset.Y = 0.01F
|
||||||
|
Case 3
|
||||||
|
offset.X = 0.01F
|
||||||
|
End Select
|
||||||
|
|
||||||
Dim offset As New Vector2(0, 0)
|
Dim s As String = "version=2" & Environment.NewLine &
|
||||||
Select Case Me.faceRotation
|
|
||||||
Case 0
|
|
||||||
offset.Y = -0.01F
|
|
||||||
Case 1
|
|
||||||
offset.X = -0.01F
|
|
||||||
Case 2
|
|
||||||
offset.Y = 0.01F
|
|
||||||
Case 3
|
|
||||||
offset.X = 0.01F
|
|
||||||
End Select
|
|
||||||
|
|
||||||
Dim s As String = "version=2" & Environment.NewLine &
|
|
||||||
"@player.turn(" & turns & ")" & Environment.NewLine
|
"@player.turn(" & turns & ")" & Environment.NewLine
|
||||||
|
|
||||||
With CType(Screen.Camera, OverworldCamera)
|
With CType(Screen.Camera, OverworldCamera)
|
||||||
If CType(Screen.Camera, OverworldCamera).ThirdPerson = True And IsOnScreen() = False Then
|
If CType(Screen.Camera, OverworldCamera).ThirdPerson = True And IsOnScreen() = False Then
|
||||||
s &= "@camera.setfocus(npc," & Me.NPCID & ")" & Environment.NewLine
|
s &= "@camera.setfocus(npc," & Me.NPCID & ")" & Environment.NewLine
|
||||||
Dim cPosition = .ThirdPersonOffset.X.ToString() & "," & .ThirdPersonOffset.Y.ToString() & "," & .ThirdPersonOffset.Z.ToString()
|
Dim cPosition = .ThirdPersonOffset.X.ToString() & "," & .ThirdPersonOffset.Y.ToString() & "," & .ThirdPersonOffset.Z.ToString()
|
||||||
s &= "@sound.play(Emote_Exclamation)" & Environment.NewLine &
|
s &= "@sound.play(Emote_Exclamation)" & Environment.NewLine &
|
||||||
"@entity.showmessagebulb(1|" & Me.Position.X + offset.X & "|" & Me.Position.Y + 0.7F & "|" & Me.Position.Z + offset.Y & ")" & Environment.NewLine &
|
"@entity.showmessagebulb(1|" & Me.Position.X + offset.X & "|" & Me.Position.Y + 0.7F & "|" & Me.Position.Z + offset.Y & ")" & Environment.NewLine &
|
||||||
"@npc.move(" & Me.NPCID & "," & distance - 1 & ")" & Environment.NewLine &
|
"@npc.move(" & Me.NPCID & "," & distance - 1 & ")" & Environment.NewLine &
|
||||||
"@script.start(" & Me.AdditionalValue & ")" & Environment.NewLine &
|
"@script.start(" & Me.AdditionalValue & ")" & Environment.NewLine &
|
||||||
"@camera.resetfocus" & Environment.NewLine &
|
"@camera.resetfocus" & Environment.NewLine &
|
||||||
"@camera.setposition(" & cPosition & ")" & Environment.NewLine &
|
"@camera.setposition(" & cPosition & ")" & Environment.NewLine &
|
||||||
":end"
|
":end"
|
||||||
Else
|
Else
|
||||||
s &= "@sound.play(Emote_Exclamation)" & Environment.NewLine &
|
s &= "@sound.play(Emote_Exclamation)" & Environment.NewLine &
|
||||||
"@entity.showmessagebulb(1|" & Me.Position.X + offset.X & "|" & Me.Position.Y + 0.7F & "|" & Me.Position.Z + offset.Y & ")" & Environment.NewLine &
|
"@entity.showmessagebulb(1|" & Me.Position.X + offset.X & "|" & Me.Position.Y + 0.7F & "|" & Me.Position.Z + offset.Y & ")" & Environment.NewLine &
|
||||||
"@npc.move(" & Me.NPCID & "," & distance - 1 & ")" & Environment.NewLine &
|
"@npc.move(" & Me.NPCID & "," & distance - 1 & ")" & Environment.NewLine &
|
||||||
"@script.start(" & Me.AdditionalValue & ")" & Environment.NewLine &
|
"@script.start(" & Me.AdditionalValue & ")" & Environment.NewLine &
|
||||||
":end"
|
":end"
|
||||||
End If
|
End If
|
||||||
End With
|
End With
|
||||||
|
|
||||||
CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(s, 2,,, "NPCInSight")
|
CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(s, 2,,, "NPCInSight")
|
||||||
ActionScript.IsInSightScript = True
|
ActionScript.IsInSightScript = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
Loading…
Reference in New Issue