2016-09-07 18:50:38 +02:00
Public Class CutDownTree
Inherits Entity
Public Overrides Sub UpdateEntity ( )
If Me . Rotation . Y <> Screen . Camera . Yaw Then
Me . Rotation . Y = Screen . Camera . Yaw
Me . CreatedWorld = False
End If
MyBase . UpdateEntity ( )
End Sub
Public Overrides Sub ClickFunction ( )
Dim pName As String = " "
For Each p As Pokemon In Core . Player . Pokemons
If p . IsEgg ( ) = False Then
For Each a As BattleSystem . Attack In p . Attacks
If a . Name = " Cut " Then
pName = p . GetDisplayName ( )
Exit For
End If
Next
End If
If pName <> " " Then
Exit For
End If
Next
2023-07-30 18:16:27 +02:00
Dim text As String = Localization . GetString ( " fieldmove_cut_1 " , " This tree looks like it~can be Cut down! " )
2016-09-07 18:50:38 +02:00
If pName <> " " And Badge . CanUseHMMove ( Badge . HMMoves . Cut ) = True Or Core . Player . SandBoxMode = True Or GameController . IS_DEBUG_ACTIVE = True Then
2023-07-30 18:16:27 +02:00
text &= Localization . GetString ( " fieldmove_cut_2 " , " *Do you want to use Cut? " ) & " % " & Localization . GetString ( " global_yes " , " Yes " ) & " | " & Localization . GetString ( " global_no " , " No " ) & " % "
2016-09-07 18:50:38 +02:00
End If
Screen . TextBox . Show ( text , { Me } )
SoundManager . PlaySound ( " select " )
End Sub
Public Overrides Sub ResultFunction ( Result As Integer )
If Result = 0 Then
2023-09-13 10:46:31 +02:00
Dim pName As String = " MissingNo. "
2016-09-07 18:50:38 +02:00
For Each p As Pokemon In Core . Player . Pokemons
If p . IsEgg ( ) = False Then
For Each a As BattleSystem . Attack In p . Attacks
If a . Name = " Cut " Then
pName = p . GetDisplayName ( )
Exit For
End If
Next
End If
2024-02-08 20:48:08 +01:00
If pName <> " MissingNo. " Then
2016-09-07 18:50:38 +02:00
Exit For
End If
Next
2023-07-30 18:16:27 +02:00
Dim Text As String = pName & " " & Localization . GetString ( " fieldmove_cut_used " , " used~Cut! " )
2016-09-07 18:50:38 +02:00
Me . CanBeRemoved = True
Dim s As String =
2018-01-07 18:01:32 +01:00
" version=2 " & Environment . NewLine &
" @text.show( " & Text & " ) " & Environment . NewLine &
2023-07-30 18:16:27 +02:00
" @sound.play(FieldMove_Cut,0) " & Environment . NewLine &
2016-09-07 18:50:38 +02:00
" :end "
PlayerStatistics . Track ( " Cut used " , 1 )
CType ( Core . CurrentScreen , OverworldScreen ) . ActionScript . StartScript ( s , 2 , False )
End If
End Sub
Public Overrides Sub Render ( )
2022-07-13 00:12:16 +02:00
If Me . Model Is Nothing Then
Me . Draw ( Me . BaseModel , Textures , False )
Else
2022-07-16 14:48:29 +02:00
UpdateModel ( )
2022-07-13 00:12:16 +02:00
Draw ( Me . BaseModel , Me . Textures , True , Me . Model )
End If
2016-09-07 18:50:38 +02:00
End Sub
End Class