Fixed slideblock and waterfall

This commit is contained in:
JappaWakka 2023-02-12 18:57:20 +01:00
parent 10a2faa62c
commit 300aa87738
4 changed files with 19 additions and 6 deletions

View File

@ -5,6 +5,7 @@
Dim TempScriptEntity As ScriptBlock = Nothing Dim TempScriptEntity As ScriptBlock = Nothing
Public Overrides Function WalkAgainstFunction() As Boolean Public Overrides Function WalkAgainstFunction() As Boolean
CType(Screen.Camera, OverworldCamera).PreventMovement = True
Dim facing As Integer = CInt(Me.Rotation.Y / MathHelper.PiOver2) Dim facing As Integer = CInt(Me.Rotation.Y / MathHelper.PiOver2)
facing -= 2 facing -= 2
If facing < 0 Then If facing < 0 Then
@ -59,7 +60,8 @@
"@player.setmovement(" & Screen.Camera.GetMoveDirection().X & ",0," & Screen.Camera.GetMoveDirection().Z & ")" & Environment.NewLine & "@player.setmovement(" & Screen.Camera.GetMoveDirection().X & ",0," & Screen.Camera.GetMoveDirection().Z & ")" & Environment.NewLine &
"@overworldpokemon.hide" & Environment.NewLine & "@overworldpokemon.hide" & Environment.NewLine &
"@player.move(1)" & Environment.NewLine & "@player.move(1)" & Environment.NewLine &
"@overworldpokemon.hide" & Environment.NewLine "@overworldpokemon.hide" & Environment.NewLine &
"@player.allowmovement" & Environment.NewLine
If Not Me.TempScriptEntity Is Nothing Then If Not Me.TempScriptEntity Is Nothing Then
s &= GetScriptStartLine(Me.TempScriptEntity) & Environment.NewLine s &= GetScriptStartLine(Me.TempScriptEntity) & Environment.NewLine
@ -71,6 +73,7 @@
CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(s, 2, False) CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(s, 2, False)
Return True Return True
Else Else
CType(Screen.Camera, OverworldCamera).PreventMovement = False
Return True Return True
End If End If
@ -79,9 +82,11 @@
facing += 4 facing += 4
End If End If
If Screen.Camera.GetPlayerFacingDirection() = facing Then If Screen.Camera.GetPlayerFacingDirection() = facing Then
CType(Screen.Camera, OverworldCamera).PreventMovement = False
Return False Return False
End If End If
CType(Screen.Camera, OverworldCamera).PreventMovement = False
Return True Return True
End Function End Function
@ -103,6 +108,7 @@
End Function End Function
Public Overrides Sub WalkOntoFunction() Public Overrides Sub WalkOntoFunction()
CType(Screen.Camera, OverworldCamera).PreventMovement = True
Dim facing As Integer = CInt(Me.Rotation.Y / MathHelper.PiOver2) Dim facing As Integer = CInt(Me.Rotation.Y / MathHelper.PiOver2)
Screen.Camera.PlannedMovement = Vector3.Zero Screen.Camera.PlannedMovement = Vector3.Zero
@ -152,7 +158,8 @@
"@player.move(1)" & Environment.NewLine & "@player.move(1)" & Environment.NewLine &
"@player.setmovement(" & Screen.Camera.GetMoveDirection().X & ",-1," & Screen.Camera.GetMoveDirection().Z & ")" & Environment.NewLine & "@player.setmovement(" & Screen.Camera.GetMoveDirection().X & ",-1," & Screen.Camera.GetMoveDirection().Z & ")" & Environment.NewLine &
"@player.move(" & Steps & ")" & Environment.NewLine & "@player.move(" & Steps & ")" & Environment.NewLine &
"@overworldpokemon.hide" & Environment.NewLine "@overworldpokemon.hide" & Environment.NewLine &
"@player.allowmovement" & Environment.NewLine
If Not Me.TempScriptEntity Is Nothing Then If Not Me.TempScriptEntity Is Nothing Then
s &= GetScriptStartLine(Me.TempScriptEntity) & Environment.NewLine s &= GetScriptStartLine(Me.TempScriptEntity) & Environment.NewLine
@ -162,6 +169,8 @@
s &= ":end" s &= ":end"
CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(s, 2, False) CType(Core.CurrentScreen, OverworldScreen).ActionScript.StartScript(s, 2, False)
Else
CType(Screen.Camera, OverworldCamera).PreventMovement = False
End If End If
End Sub End Sub

View File

@ -199,7 +199,7 @@
If Me.ActionValue = 1 Then If Me.ActionValue = 1 Then
Exit Sub Exit Sub
End If End If
CType(Screen.Camera, OverworldCamera).PreventMovement = True
Dim isOnTop As Boolean = True Dim isOnTop As Boolean = True
Dim OnTopcheckPosition As Vector3 = New Vector3(Me.Position.X, Me.Position.Y + 1, Me.Position.Z) Dim OnTopcheckPosition As Vector3 = New Vector3(Me.Position.X, Me.Position.Y + 1, Me.Position.Z)
Dim Oe As Entity = GetEntity(Screen.Level.Entities, OnTopcheckPosition, True, {GetType(Waterfall)}) Dim Oe As Entity = GetEntity(Screen.Level.Entities, OnTopcheckPosition, True, {GetType(Waterfall)})
@ -234,7 +234,6 @@
End While End While
s = "version=2" & Environment.NewLine & s = "version=2" & Environment.NewLine &
"@player.preventmovement" & Environment.NewLine &
"@player.stopmovement" & Environment.NewLine & "@player.stopmovement" & Environment.NewLine &
"@player.move(2)" & Environment.NewLine & "@player.move(2)" & Environment.NewLine &
"@player.setmovement(0,-1,0)" & Environment.NewLine & "@player.setmovement(0,-1,0)" & Environment.NewLine &
@ -254,6 +253,7 @@
Dim p As Pokemon = ReturnWaterFallPokemonName() Dim p As Pokemon = ReturnWaterFallPokemonName()
If Badge.CanUseHMMove(Badge.HMMoves.Waterfall) = True And Not p Is Nothing Or GameController.IS_DEBUG_ACTIVE = True Or Core.Player.SandBoxMode = True Then If Badge.CanUseHMMove(Badge.HMMoves.Waterfall) = True And Not p Is Nothing Or GameController.IS_DEBUG_ACTIVE = True Or Core.Player.SandBoxMode = True Then
CType(Screen.Camera, OverworldCamera).PreventMovement = True
Dim s As String = "" Dim s As String = ""
Dim pName As String = "" Dim pName As String = ""
@ -284,7 +284,6 @@
End If End If
End While End While
s = "version=2" & Environment.NewLine & s = "version=2" & Environment.NewLine &
"@player.preventmovement" & Environment.NewLine &
"@player.stopmovement" & Environment.NewLine & "@player.stopmovement" & Environment.NewLine &
"@pokemon.cry(" & pNumber & ")" & Environment.NewLine & "@pokemon.cry(" & pNumber & ")" & Environment.NewLine &
"@sound.play(select)" & Environment.NewLine & "@sound.play(select)" & Environment.NewLine &

View File

@ -3,6 +3,7 @@ Public Class ActionScript
Public Scripts As New List(Of Script) Public Scripts As New List(Of Script)
Public AllowMovementAfterEnd As Boolean = False
Public Class ScriptLevel Public Class ScriptLevel
Public WaitingEndWhen As New List(Of Boolean) Public WaitingEndWhen As New List(Of Boolean)
Public Switched As New List(Of Boolean) Public Switched As New List(Of Boolean)
@ -79,6 +80,10 @@ nextScript:
reDelay = 0.0F reDelay = 0.0F
End If End If
End If End If
If AllowMovementAfterEnd = True Then
CType(Screen.Camera, OverworldCamera).PreventMovement = False
AllowMovementAfterEnd = False
End If
End If End If
End Sub End Sub

View File

@ -228,7 +228,7 @@
IsReady = True IsReady = True
Case "allowmovement" Case "allowmovement"
CType(Screen.Camera, OverworldCamera).PreventMovement = False CType(CurrentScreen, OverworldScreen).ActionScript.AllowMovementAfterEnd = True
IsReady = True IsReady = True
Case "money", "addmoney" Case "money", "addmoney"