Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Mob
- Inherits Character
- Private _life As Single?
- Private _x As Single
- Private _y As Single
- Private _id As Integer?
- Public Overrides ReadOnly Property Life As Single
- Get
- If _life Is Nothing Then
- _life = MyBase.Life
- End If
- Return _life
- End Get
- End Property
- Public Overrides Property X As Single
- Get
- Return _x
- End Get
- Set(ByVal value As Single)
- MyBase.X = value
- End Set
- End Property
- Public Overrides Property Y As Single
- Get
- Return _y
- End Get
- Set(ByVal value As Single)
- MyBase.Y = value
- End Set
- End Property
- Public Overrides ReadOnly Property ID As Integer
- Get
- If _id Is Nothing Then
- _id = MyBase.ID
- End If
- Return _id
- End Get
- End Property
- Public Sub New(ByVal firstAddress As Integer)
- MyBase.New(firstAddress)
- _x = MyBase.X
- _y = MyBase.Y
- End Sub
- 'si possono aggiungere anche proprietà che non si basano su valori esistenti realmente
- Public ReadOnly Property IsAlive As Boolean
- Get
- Return If(Me.Life >= 0, True, False)
- End Get
- End Property
- Public Shared Function IsAMob(ByVal firstAddress As Integer) As Boolean
- Dim value = MemoryManager.ReadInt(firstAddress + Offsets.Value)
- Return If(value >= 100 And value <= 8000, True, False)
- End Function
- Public Function CalculateDistance(ByVal playerX As Single, ByVal playerY As Single) As Single
- Return Math.Sqrt((Me.X - playerX) ^ 2 + (Me.Y - playerY) ^ 2)
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement