Added @Player.DoWalkAnimation(bool)

Enables or disables the player's walking animation when walking or during a @player.move command.
This commit is contained in:
JappaWakka 2024-07-04 19:43:05 +02:00
parent 17c87d1b53
commit 6f41946e21
4 changed files with 21 additions and 8 deletions

View File

@ -84,18 +84,24 @@
End Sub
Private Sub Move()
If (Screen.Camera.IsMoving() = True And Me.DoAnimation = True) OrElse (Screen.Level.OwnPlayer IsNot Nothing AndAlso Screen.Level.OwnPlayer.isDancing) Then
If CurrentScreen.Identification <> Screen.Identifications.PauseScreen Then
Me.AnimationDelay -= 0.13F
If AnimationDelay <= 0.0F Then
AnimationDelay = GetAnimationDelay()
AnimationX += 1
If AnimationX > 4 Then
AnimationX = 1
If Core.Player.DoWalkAnimation = True Then
If (Screen.Camera.IsMoving() = True And Me.DoAnimation = True) OrElse (Screen.Level.OwnPlayer IsNot Nothing AndAlso Screen.Level.OwnPlayer.isDancing) Then
If CurrentScreen.Identification <> Screen.Identifications.PauseScreen Then
Me.AnimationDelay -= 0.13F
If AnimationDelay <= 0.0F Then
AnimationDelay = GetAnimationDelay()
AnimationX += 1
If AnimationX > 4 Then
AnimationX = 1
End If
End If
Else
AnimationX = 1
ChangeTexture()
End If
Else
AnimationX = 1
AnimationDelay = GetAnimationDelay()
ChangeTexture()
End If
Else

View File

@ -453,6 +453,8 @@
Public RunMode As Boolean = True
Public RunToggled As Boolean = False
Public DoWalkAnimation As Boolean = False
Public Structure Temp
Public Shared PokemonScreenIndex As Integer = 0
Public Shared PokemonStatusPageIndex As Integer = 0

View File

@ -376,6 +376,10 @@
Dim newOpacity As Single = sng(argument.Replace("~", Screen.Level.OwnPlayer.Opacity.ToString().Replace(".", GameController.DecSeparator)))
Screen.Level.OwnPlayer.Opacity = newOpacity
IsReady = True
Case "dowalkanimation"
Dim doWalkAnimation As Boolean = CBool(argument)
Core.Player.DoWalkAnimation = doWalkAnimation
IsReady = True
Case "quitgame"
'Reset VoltorbFlipScreen's Variables
VoltorbFlip.VoltorbFlipScreen.CurrentLevel = 1

View File

@ -534,6 +534,7 @@ Namespace ScriptVersion2
r(New ScriptCommand("player", "setrivalskin", {New ScriptArgument("skin", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Sets the rival's skin."))
r(New ScriptCommand("player", "setopacity", {New ScriptArgument("opacity", ScriptArgument.ArgumentTypes.Sng)}.ToList(), "Sets the player entity's opacity."))
r(New ScriptCommand("player", "QuitGame", {New ScriptArgument("doFade", ScriptArgument.ArgumentTypes.Bool, True, "")}.ToList(), "Quits the game and goes back to the Main Menu (with optionally a fade out and in)."))
r(New ScriptCommand("player", "DoWalkAnimation", {New ScriptArgument("walkAnimation", ScriptArgument.ArgumentTypes.Bool)}.ToList(), "Enables or disables the player's walking animation when walking or during a @player.move command."))
' Constructs:
r(New ScriptCommand("player", "position", "sngarr", {New ScriptArgument("coordinate", ScriptArgument.ArgumentTypes.StrArr, {"x", "y", "z"}, True, "")}.ToList(), "Returns the position of the player. The normal coordinate combination is ""X,Y,Z"".", ",", True))