Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim Color_Normal(0 To 3) As Long
- Dim color_Conectar(0 To 3) As Long
- 'particulas
- Private Type Particle
- friction As Single
- X As Single
- Y As Single
- vector_x As Single
- vector_y As Single
- angle As Single
- grh As grh
- alive_counter As Long
- X1 As Integer
- X2 As Integer
- Y1 As Integer
- Y2 As Integer
- vecx1 As Integer
- vecx2 As Integer
- vecy1 As Integer
- vecy2 As Integer
- life1 As Long
- life2 As Long
- fric As Integer
- spin_speedL As Single
- spin_speedH As Single
- gravity As Boolean
- grav_strength As Long
- bounce_strength As Long
- spin As Boolean
- XMove As Boolean
- YMove As Boolean
- move_x1 As Integer
- move_x2 As Integer
- move_y1 As Integer
- move_y2 As Integer
- rgb_list(0 To 3) As Long
- grh_resize As Boolean
- grh_resizex As Integer
- grh_resizey As Integer
- End Type
- Private Type Stream
- Name As String
- NumOfParticles As Long
- NumGrhs As Long
- id As Long
- X1 As Long
- Y1 As Long
- X2 As Long
- Y2 As Long
- angle As Long
- vecx1 As Long
- vecx2 As Long
- vecy1 As Long
- vecy2 As Long
- life1 As Long
- life2 As Long
- friction As Long
- spin As Byte
- spin_speedL As Single
- spin_speedH As Single
- AlphaBlend As Byte
- gravity As Byte
- grav_strength As Long
- bounce_strength As Long
- XMove As Byte
- YMove As Byte
- move_x1 As Long
- move_x2 As Long
- move_y1 As Long
- move_y2 As Long
- grh_list() As Long
- 'Todo
- colortint(0 To 3) As RGB
- Speed As Single
- life_counter As Long
- End Type
- 'Modified by: Ryan Cain (Onezero)
- 'Last modify date: 5/14/2003
- Private Type particle_group
- active As Boolean
- id As Long
- map_x As Integer
- map_y As Integer
- char_index As Long
- frame_counter As Single
- frame_speed As Single
- stream_type As Byte
- particle_stream() As Particle
- particle_count As Long
- grh_index_list() As Long
- grh_index_count As Long
- alpha_blend As Boolean
- alive_counter As Long
- never_die As Boolean
- X1 As Integer
- X2 As Integer
- Y1 As Integer
- Y2 As Integer
- angle As Integer
- vecx1 As Integer
- vecx2 As Integer
- vecy1 As Integer
- vecy2 As Integer
- life1 As Long
- life2 As Long
- fric As Long
- spin_speedL As Single
- spin_speedH As Single
- gravity As Boolean
- grav_strength As Long
- bounce_strength As Long
- spin As Boolean
- XMove As Boolean
- YMove As Boolean
- move_x1 As Integer
- move_x2 As Integer
- move_y1 As Integer
- move_y2 As Integer
- rgb_list(0 To 3) As Long
- 'Added by Juan Martín Sotuyo Dodero
- Speed As Single
- life_counter As Long
- 'Added by David Justus
- grh_resize As Boolean
- grh_resizex As Integer
- grh_resizey As Integer
- End Type
- Dim TotalStreams As Long
- Dim particle_group_list() As particle_group
- Dim particle_group_count As Long
- Dim particle_group_last As Long
- '/particulas
- Public bRunning As Boolean
- Private Const FVF = D3DFVF_XYZRHW Or D3DFVF_TEX1 Or D3DFVF_DIFFUSE Or D3DFVF_SPECULAR
- Private Const COLOR_KEY As Long = &HFF000000
- Dim font_count As Long
- Dim font_last As Long
- Private font_list() As D3DXFont
- Public Enum FontAlignment
- fa_center = DT_CENTER
- fa_top = DT_TOP
- fa_left = DT_LEFT
- fa_topleft = DT_TOP Or DT_LEFT
- fa_bottomleft = DT_BOTTOM Or DT_LEFT
- fa_bottom = DT_BOTTOM
- fa_right = DT_RIGHT
- fa_bottomright = DT_BOTTOM Or DT_RIGHT
- fa_topright = DT_TOP Or DT_RIGHT
- End Enum
- Dim Texture As Direct3DTexture8
- Dim TransTexture As Direct3DTexture8
- Private Declare Function QueryPerformanceFrequency _
- Lib "kernel32" (lpFrequency As Currency) As Long
- Private Declare Function QueryPerformanceCounter _
- Lib "kernel32" (lpPerformanceCount As Currency) As Long
- Public FPS As Integer
- Private FramesPerSecCounter As Integer
- Private timerElapsedTime As Single
- Private timerTicksPerFrame As Double
- Private particletimer As Single
- Public engineBaseSpeed As Single
- Private lFrameTimer As Long
- Private lFrameLimiter As Long
- Private ScrollPixelsPerFrameX As Byte
- Private ScrollPixelsPerFrameY As Byte
- Private TileBufferPixelOffsetX As Integer
- Private TileBufferPixelOffsetY As Integer
- Private MainViewTop As Integer
- Private MainViewLeft As Integer
- Private MainDestRect As RECT
- Private MainViewRect As RECT
- Private BackBufferRect As RECT
- Private MainViewWidth As Integer
- Private MainViewHeight As Integer
- Private MouseTileX As Byte
- Private MouseTileY As Byte
- Private RLluvia(7) As RECT 'RECT de la lluvia
- Private iFrameIndex As Byte 'Frame actual de la LL
- Private llTick As Long 'Contador
- Private LTLluvia(4) As Integer
- Private WindowTileWidth As Integer
- Private WindowTileHeight As Integer
- Private HalfWindowTileWidth As Integer
- Private HalfWindowTileHeight As Integer
- Private Const GrhFogata As Integer = 1521
- Public lastTime As Long 'Para controlar la velocidad
- Public fpsLastCheck As Long
- Dim bump_map_supported As Boolean
- 'Sets a Grh animation to loop indefinitely.
- #Const HARDCODED = False 'True ' == MÁS FPS ^^
- Private Function GetElapsedTime() As Single
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- 'Gets the time that past since the last call
- '**************************************************************
- Dim start_time As Currency
- Static end_time As Currency
- Static timer_freq As Currency
- 'Get the timer frequency
- If timer_freq = 0 Then
- QueryPerformanceFrequency timer_freq
- End If
- 'Get current time
- Call QueryPerformanceCounter(start_time)
- 'Calculate elapsed time
- GetElapsedTime = (start_time - end_time) / timer_freq * 1000
- 'Get next end time
- Call QueryPerformanceCounter(end_time)
- End Function
- Public Sub Text_Render(ByVal font As D3DXFont, _
- ByVal Text As String, _
- ByVal top As Long, _
- ByVal left As Long, _
- ByVal Width As Long, _
- ByVal Height As Long, _
- ByVal Color As Long, _
- ByVal format As Long, _
- Optional ByVal Shadow As Boolean = False, _
- Optional ByVal Nombre As Byte, _
- Optional ByVal Rojo As Byte, _
- Optional ByVal Verde As Byte, _
- Optional ByVal Azul As Byte)
- '*****************************************************
- '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
- '*****************************************************
- Dim TextRect As RECT
- Dim ShadowRect As RECT
- TextRect.top = top
- TextRect.left = left
- TextRect.bottom = top + Height
- TextRect.Right = left + Width
- If Shadow Then
- ShadowRect.top = top - 1
- ShadowRect.left = left - 2
- ShadowRect.bottom = (top + Height) - 1
- ShadowRect.Right = (left + Width) - 2
- End If
- D3DX.DrawText font, Color, Text, TextRect, format
- End Sub
- Public Sub Text_Render_Inventario(ByVal font As D3DXFont, _
- ByVal Text As String, _
- ByVal top As Long, _
- ByVal left As Long, _
- ByVal Width As Long, _
- ByVal Height As Long, _
- ByVal Color As Long, _
- ByVal format As Long, _
- Optional ByVal Shadow As Boolean = False)
- '*****************************************************
- '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
- ' editado por: juanjo
- '*****************************************************
- Dim TextRect As RECT
- Dim ShadowRect As RECT
- TextRect.top = top
- TextRect.left = left
- TextRect.bottom = top + Height
- TextRect.Right = left + Width
- If Shadow Then
- ShadowRect.top = top - 1
- ShadowRect.left = left - 2
- ShadowRect.bottom = (top + Height) - 1
- ShadowRect.Right = (left + Width) - 2
- 'D3DX.DrawText font, &HFF000000, Text, ShadowRect, format
- 'D3DX.DrawText font, D3DColorXRGB(0, 255, 0), Text, ShadowRect, format
- End If
- D3DX.DrawText font, Color, Text, TextRect, format
- End Sub
- Public Sub Text_Render_ext(ByVal Text As String, _
- ByVal top As Long, _
- ByVal left As Long, _
- ByVal Width As Long, _
- ByVal Height As Long, _
- ByVal Color As Long, _
- Optional ByVal Shadow As Boolean = False, _
- Optional ByVal Center As Boolean = False)
- If Center = True Then
- Call Text_Render_Inventario(font_list(1), Text, top, left, Width, Height, Color, fa_center, Shadow)
- Else
- Call Text_Render_Inventario(font_list(1), Text, top, left, Width, Height, Color, DT_TOP Or DT_LEFT, Shadow)
- End If
- End Sub
- Private Sub Font_Make(ByVal font_index As Long, _
- ByVal style As String, _
- ByVal bold As Boolean, _
- ByVal italic As Boolean, _
- ByVal size As Long)
- If font_index > font_last Then
- font_last = font_index
- ReDim Preserve font_list(1 To font_last)
- End If
- font_count = font_count + 1
- Dim font_desc As IFont
- Dim fnt As New StdFont
- fnt.Name = style
- fnt.size = size
- fnt.bold = bold
- fnt.italic = italic
- Set font_desc = fnt
- Set font_list(font_index) = D3DX.CreateFont(D3DDevice, font_desc.hFont)
- End Sub
- Public Function Font_Create(ByVal style As String, _
- ByVal size As Long, _
- ByVal bold As Boolean, _
- ByVal italic As Boolean) As Long
- On Error GoTo ErrorHandler:
- Font_Create = Font_Next_Open
- Font_Make Font_Create, style, bold, italic, size
- ErrorHandler:
- Font_Create = 0
- End Function
- Private Function Font_Next_Open() As Long
- Font_Next_Open = font_last + 1
- End Function
- Private Function Font_Check(ByVal font_index As Long) As Boolean
- '*****************************************************
- '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
- '*****************************************************
- If font_index > 0 And font_index <= font_last Then
- Font_Check = True
- End If
- End Function
- Function MakeVector(ByVal X As Single, ByVal Y As Single, ByVal Z As Single) As D3DVECTOR
- '*****************************************************
- '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
- '*****************************************************
- MakeVector.X = X
- MakeVector.Y = Y
- MakeVector.Z = Z
- End Function
- Public Sub Engine_Init()
- '*****************************************************
- '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
- '*****************************************************
- 'On Error GoTo ErrHandler:
- Dim DispMode As D3DDISPLAYMODE
- Dim DispModeBK As D3DDISPLAYMODE
- Dim D3DWindow As D3DPRESENT_PARAMETERS
- Dim ColorKeyVal As Long
- Set SurfaceDB = New clsSurfaceManDynDX8
- Set dX = New DirectX8
- Set D3D = dX.Direct3DCreate()
- Set D3DX = New D3DX8
- D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispMode
- D3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, DispModeBK
- With D3DWindow
- .Windowed = True
- .SwapEffect = D3DSWAPEFFECT_COPY
- .BackBufferFormat = DispMode.format
- .BackBufferWidth = 800
- .BackBufferHeight = 600
- .EnableAutoDepthStencil = 1
- .AutoDepthStencilFormat = D3DFMT_D16
- .hDeviceWindow = frmMain.renderer.hWnd
- End With
- DispMode.format = D3DFMT_X8R8G8B8
- If D3D.CheckDeviceFormat(0, D3DDEVTYPE_HAL, DispMode.format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8) = D3D_OK Then
- Dim Caps8 As D3DCAPS8
- D3D.GetDeviceCaps 0, D3DDEVTYPE_HAL, Caps8
- If (Caps8.TextureOpCaps And D3DTEXOPCAPS_DOTPRODUCT3) = D3DTEXOPCAPS_DOTPRODUCT3 Then
- bump_map_supported = True
- Else
- bump_map_supported = False
- DispMode.format = DispModeBK.format
- End If
- Else
- bump_map_supported = False
- DispMode.format = DispModeBK.format
- End If
- Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.renderer.hWnd, _
- D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)
- HalfWindowTileHeight = (frmMain.renderer.ScaleHeight / 32) \ 2
- HalfWindowTileWidth = (frmMain.renderer.ScaleWidth / 32) \ 2
- TileBufferSize = 9
- TileBufferPixelOffsetX = (TileBufferSize - 1) * 32
- TileBufferPixelOffsetY = (TileBufferSize - 1) * 32
- D3DDevice.SetVertexShader FVF
- '//Transformed and lit vertices dont need lighting
- ' so we disable it...
- D3DDevice.SetRenderState D3DRS_LIGHTING, False
- D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
- D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
- D3DDevice.SetRenderState D3DRS_ALPHABLENDENABLE, True
- Call SurfaceDB.Init(D3DX, D3DDevice, 90)
- engineBaseSpeed = 0.016
- ReDim MapData(XMinMapSize To XMaxMapSize, YMinMapSize To YMaxMapSize) As MapBlock
- ScrollPixelsPerFrameX = 9
- ScrollPixelsPerFrameY = 9
- UserPos.X = 50
- UserPos.Y = 50
- MinXBorder = XMinMapSize + (frmMain.renderer.ScaleWidth / 64)
- MaxXBorder = XMaxMapSize - (frmMain.renderer.ScaleWidth / 64)
- MinYBorder = YMinMapSize + (frmMain.renderer.ScaleHeight / 64)
- MaxYBorder = YMaxMapSize - (frmMain.renderer.ScaleHeight / 64)
- Texto.Engine_Init_FontSettings
- Texto.Engine_Init_FontTextures
- Color_Normal(0) = d3dcolorxrgb(255, 255, 255)
- Color_Normal(1) = Color_Normal(0)
- Color_Normal(2) = Color_Normal(0)
- Color_Normal(3) = Color_Normal(0)
- color_Conectar(0) = d3dcolorxrgb(120, 120, 120)
- color_Conectar(1) = color_Conectar(0)
- color_Conectar(2) = color_Conectar(0)
- color_Conectar(3) = color_Conectar(0)
- 'partículas
- 'D3DDevice.SetRenderState D3DRS_POINTSPRITE_ENABLE, 1
- 'D3DDevice.SetRenderState D3DRS_POINTSCALE_ENABLE, 0
- Font_Create "Tahoma", 8, True, 0
- 'Font_Create "Verdana", 8, False, 0
- bRunning = True
- Exit Sub
- ErrHandler:
- Debug.Print "Error Number Returned: " & Err.Number
- bRunning = False
- End Sub
- Public Sub Engine_Deinit()
- Erase MapData
- Erase charlist
- Set D3DDevice = Nothing
- Set D3D = Nothing
- Set dX = Nothing
- End
- End Sub
- Private Function CreateTLVertex(X As Single, _
- Y As Single, _
- Z As Single, _
- rhw As Single, _
- Color As Long, _
- Specular As Long, _
- tu As Single, _
- tv As Single) As TLVERTEX
- '*****************************************************
- '****** Coded by Menduz (lord.yo.wo@gmail.com) *******
- '*****************************************************
- CreateTLVertex.X = X
- CreateTLVertex.Y = Y
- CreateTLVertex.Z = Z
- CreateTLVertex.rhw = rhw
- CreateTLVertex.Color = Color
- CreateTLVertex.Specular = Specular
- CreateTLVertex.tu = tu
- CreateTLVertex.tv = tv
- End Function
- Public Sub Engine_ActFPS()
- If frmMain.Visible = True Then
- If mode = True Then
- TechoDesv.AlphaX = TechoDesv.AlphaX + 1
- If TechoDesv.AlphaX > 130 And TechoDesv.AlphaX < 140 Then
- TechoDesv.AlphaX = 130
- mode = False
- End If
- Else
- TechoDesv.AlphaX = TechoDesv.AlphaX - 1
- If TechoDesv.AlphaX < 10 And TechoDesv.AlphaX > 5 Then
- TechoDesv.AlphaX = 5
- mode = True
- End If
- End If
- If bTecho Then
- If Not Val(AlphaY) = 10 Then AlphaY = Val(AlphaY) - 1
- Else
- If Not AlphaY = 130 Then AlphaY = AlphaY + 1
- End If
- End If
- temp_rgb(0) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
- temp_rgb(1) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
- temp_rgb(2) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
- temp_rgb(3) = D3DColorARGB(AlphaY, AlphaY, AlphaY, AlphaY)
- LuzGrh(0) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
- LuzGrh(1) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
- LuzGrh(2) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
- LuzGrh(3) = D3DColorARGB(TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX, TechoDesv.AlphaX)
- LuzMuerto = D3DColorARGB(255, 255, 255, 255)
- If GetTickCount - lFrameTimer > 1000 Then
- FPS = FramesPerSecCounter
- FramesPerSecCounter = 0
- lFrameTimer = GetTickCount
- End If
- End Sub
- Function InMapBounds(ByVal X As Integer, ByVal Y As Integer) As Boolean
- '*****************************************************************
- 'Checks to see if a tile position is in the maps bounds
- '*****************************************************************
- If X < XMinMapSize Or X > XMaxMapSize Or Y < YMinMapSize Or Y > YMaxMapSize Then
- Exit Function
- End If
- InMapBounds = True
- End Function
- Public Sub Draw_Grhindex(ByVal grh_index As Integer, _
- ByVal X As Integer, _
- ByVal Y As Integer)
- If grh_index <= 0 Then Exit Sub
- Device_Box_Textured_Render grh_index, X, Y, GrhData(grh_index).pixelWidth, GrhData(grh_index).pixelHeight, _
- Color_Normal, GrhData(grh_index).sX, GrhData(grh_index).sY
- End Sub
- 'AURASSSSSSSS
- Private Sub Draw_Aura(ByRef grh As grh, _
- ByVal X As Integer, _
- ByVal Y As Integer, _
- ByVal Center As Byte, _
- ByVal Animate As Byte, _
- Optional ByVal Alpha As Boolean, _
- Optional ByVal angle As Single)
- Dim CurrentGrhIndex As Integer
- Dim Light(3) As Long
- If grh.grhindex = 0 Then Exit Sub
- If Animate Then
- If grh.Started = 1 Then
- grh.FrameCounter = grh.FrameCounter + (timerElapsedTime * GrhData(grh.grhindex).NumFrames / grh.Speed)
- If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
- grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
- If grh.Loops <> -1 Then
- If grh.Loops > 0 Then
- grh.Loops = grh.Loops - 1
- Else
- grh.Started = 0
- End If
- End If
- End If
- End If
- End If
- 'Figure out what frame to draw (always 1 if not animated)
- CurrentGrhIndex = GrhData(grh.grhindex).Frames(grh.FrameCounter)
- 'Center Grh over X,Y pos
- If Center Then
- If GrhData(CurrentGrhIndex).TileWidth <> 1 Then
- X = X - Int(GrhData(CurrentGrhIndex).TileWidth * (32 \ 2)) + 32 \ 2
- End If
- If GrhData(grh.grhindex).TileHeight <> 1 Then
- Y = Y - Int(GrhData(CurrentGrhIndex).TileHeight * 32) + 32
- End If
- End If
- Light(0) = d3dcolorxrgb(LuchoAuraR, LuchoAuraG, LuchoAuraB)
- Light(1) = Light(0)
- Light(2) = Light(0)
- Light(3) = Light(0)
- Device_Box_Textured_Render CurrentGrhIndex, X, Y, GrhData(CurrentGrhIndex).pixelWidth, GrhData( _
- CurrentGrhIndex).pixelHeight, Light(), GrhData(CurrentGrhIndex).sX, GrhData(CurrentGrhIndex).sY, Alpha, _
- angle
- End Sub
- Private Sub Draw_Grh(ByRef grh As grh, _
- ByVal X As Integer, _
- ByVal Y As Integer, _
- ByVal Center As Byte, _
- ByVal Animate As Byte, _
- ByRef Color() As Long, _
- Optional ByVal Alpha As Boolean, _
- Optional ByVal angle As Single, _
- Optional ByVal Invert_x As Boolean = False, _
- Optional ByVal Invert_y As Boolean = False)
- Dim CurrentGrhIndex As Integer
- If grh.grhindex = 0 Then Exit Sub
- If Animate Then
- If grh.Started = 1 Then
- If Not Invert_y Then
- grh.FrameCounter = grh.FrameCounter + (timerElapsedTime * GrhData(grh.grhindex).NumFrames / grh.Speed)
- Else
- grh.FrameCounter = grh.FrameCounter
- End If
- If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
- grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
- If grh.Loops <> -1 Then
- If grh.Loops > 0 Then
- grh.Loops = grh.Loops - 1
- Else
- grh.Started = 0
- End If
- End If
- End If
- End If
- End If
- 'Figure out what frame to draw (always 1 if not animated)
- CurrentGrhIndex = GrhData(grh.grhindex).Frames(grh.FrameCounter)
- 'Center Grh over X,Y pos
- If Center Then
- If GrhData(CurrentGrhIndex).TileWidth <> 1 Then
- X = X - Int(GrhData(CurrentGrhIndex).TileWidth * (32 \ 2)) + 32 \ 2
- End If
- If GrhData(grh.grhindex).TileHeight <> 1 Then
- Y = Y - Int(GrhData(CurrentGrhIndex).TileHeight * 32) + 32
- End If
- End If
- Device_Box_Textured_Render CurrentGrhIndex, X, Y, GrhData(CurrentGrhIndex).pixelWidth, GrhData( _
- CurrentGrhIndex).pixelHeight, Color, GrhData(CurrentGrhIndex).sX, GrhData( _
- CurrentGrhIndex).sY, Alpha, angle, 0, Invert_x, Invert_y
- 'exits:
- End Sub
- Sub ShowNextFrame()
- Static OffsetCounterX As Single
- Static OffsetCounterY As Single
- If UserMoving Then
- '****** Move screen Left and Right if needed ******
- If AddtoUserPos.X <> 0 Then
- OffsetCounterX = OffsetCounterX - ScrollPixelsPerFrameX * AddtoUserPos.X * timerTicksPerFrame
- If Abs(OffsetCounterX) >= Abs(32 * AddtoUserPos.X) Then
- OffsetCounterX = 0
- AddtoUserPos.X = 0
- UserMoving = False
- End If
- End If
- '****** Move screen Up and Down if needed ******
- If AddtoUserPos.Y <> 0 Then
- OffsetCounterY = OffsetCounterY - ScrollPixelsPerFrameY * AddtoUserPos.Y * timerTicksPerFrame
- If Abs(OffsetCounterY) >= Abs(32 * AddtoUserPos.Y) Then
- OffsetCounterY = 0
- AddtoUserPos.Y = 0
- UserMoving = False
- End If
- End If
- End If
- Call RenderScreen(UserPos.X - AddtoUserPos.X, UserPos.Y - AddtoUserPos.Y, OffsetCounterX, OffsetCounterY)
- engine.Engine_ActFPS
- End Sub
- Sub RenderScreen(ByVal tilex As Integer, _
- ByVal tiley As Integer, _
- ByVal PixelOffsetX As Integer, _
- ByVal PixelOffsetY As Integer)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 8/14/2007
- 'Last modified by: Juan Martín Sotuyo Dodero (Maraxus)
- 'Renders everything to the viewport
- '**************************************************************
- ' On Error Resume Next
- Dim Y As Long 'Keeps track of where on map we are
- Dim X As Long 'Keeps track of where on map we are
- Dim screenminY As Integer 'Start Y pos on current screen
- Dim screenmaxY As Integer 'End Y pos on current screen
- Dim screenminX As Integer 'Start X pos on current screen
- Dim screenmaxX As Integer 'End X pos on current screen
- Dim minY As Integer 'Start Y pos on current map
- Dim maxY As Integer 'End Y pos on current map
- Dim minX As Integer 'Start X pos on current map
- Dim maxX As Integer 'End X pos on current map
- Dim ScreenX As Integer 'Keeps track of where to place tile on screen
- Dim ScreenY As Integer 'Keeps track of where to place tile on screen
- Dim minXOffset As Integer
- Dim minYOffset As Integer
- Dim PixelOffsetXTemp As Integer 'For centering grhs
- Dim PixelOffsetYTemp As Integer 'For centering grhs
- Dim CurrentGrhIndex As Integer
- Dim offx As Integer
- Dim offy As Integer
- Dim I As Byte
- 'Figure out Ends and Starts of screen
- screenminY = tiley - HalfWindowTileHeight
- screenmaxY = tiley + HalfWindowTileHeight
- screenminX = tilex - HalfWindowTileWidth
- screenmaxX = tilex + HalfWindowTileWidth
- minY = screenminY - TileBufferSize
- maxY = screenmaxY + TileBufferSize
- minX = screenminX - TileBufferSize
- maxX = screenmaxX + TileBufferSize
- 'Make sure mins and maxs are allways in map bounds
- If minY < XMinMapSize Then
- minYOffset = YMinMapSize - minY
- minY = YMinMapSize
- End If
- If maxY > YMaxMapSize Then maxY = YMaxMapSize
- If minX < XMinMapSize Then
- minXOffset = XMinMapSize - minX
- minX = XMinMapSize
- End If
- If maxX > XMaxMapSize Then maxX = XMaxMapSize
- 'If we can, we render around the view area to make it smoother
- If screenminY > YMinMapSize Then
- screenminY = screenminY - 1
- Else
- screenminY = 1
- ScreenY = 1
- End If
- If screenmaxY < YMaxMapSize Then screenmaxY = screenmaxY + 1
- If screenminX > XMinMapSize Then
- screenminX = screenminX - 1
- Else
- screenminX = 1
- ScreenX = 1
- End If
- If screenmaxX < XMaxMapSize Then screenmaxX = screenmaxX + 1
- 'Draw floor layer
- For Y = screenminY To screenmaxY
- For X = screenminX To screenmaxX
- 'Layer 1 **********************************
- Call Draw_Grh(MapData(X, Y).Graphic(1), (ScreenX - 1) * 32 + PixelOffsetX, (ScreenY - 1) * 32 + _
- PixelOffsetY, 0, 1, MapData(X, Y).light_value)
- If MapData(X, Y).Graphic(2).grhindex <> 0 Then
- Call Draw_Grh(MapData(X, Y).Graphic(2), (ScreenX - 1) * 32 + PixelOffsetX, (ScreenY - 1) * 32 + _
- PixelOffsetY, 1, 1, MapData(X, Y).light_value)
- End If
- '******************************************
- ScreenX = ScreenX + 1
- Next X
- 'Reset ScreenX to original value and increment ScreenY
- ScreenX = ScreenX - X + screenminX
- ScreenY = ScreenY + 1
- Next Y
- ScreenY = minYOffset - TileBufferSize
- For Y = minY To maxY
- ScreenX = minXOffset - TileBufferSize
- For X = minX To maxX
- PixelOffsetXTemp = ScreenX * 32 + PixelOffsetX
- PixelOffsetYTemp = ScreenY * 32 + PixelOffsetY
- With MapData(X, Y)
- '******************************************
- 'Object Layer **********************************
- If .ObjGrh.grhindex <> 0 Then
- Call Draw_Grh(.ObjGrh, PixelOffsetXTemp, PixelOffsetYTemp, 1, 1, MapData(X, Y).light_value)
- End If
- '***********************************************
- 'Char layer ************************************
- If .charindex <> 0 Then
- Call Char_Render(.charindex, PixelOffsetXTemp, PixelOffsetYTemp, MapData(X, Y).light_value)
- End If
- '*************************************************
- 'Layer 3 *****************************************
- If .Graphic(3).grhindex <> 0 Then
- Call Draw_Grh(.Graphic(3), PixelOffsetXTemp, PixelOffsetYTemp, 1, 1, MapData(X, Y).light_value)
- End If
- '************************************************
- End With
- ScreenX = ScreenX + 1
- Next X
- ScreenY = ScreenY + 1
- Next Y
- ScreenY = minYOffset - 5
- D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_ONE
- D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_ONE
- ScreenY = minYOffset - TileBufferSize
- For Y = minY To maxY
- ScreenX = minXOffset - TileBufferSize
- For X = minX To maxX
- With MapData(X, Y)
- '***********************************************
- If .particle_group > 0 Then
- Particle_Group_Render .particle_group, ScreenX * 32 + PixelOffsetX, ScreenY * 32 + PixelOffsetY
- End If
- End With
- ScreenX = ScreenX + 1
- Next X
- ScreenY = ScreenY + 1
- Next Y
- D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
- D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
- If bTecho Then
- 'Draw blocked tiles and grid
- ScreenY = minYOffset - TileBufferSize
- For Y = minY To maxY
- ScreenX = minXOffset - TileBufferSize
- For X = minX To maxX
- 'Layer 4 **********************************
- If MapData(X, Y).Graphic(4).grhindex Then
- Call Grh_Render(MapData(X, Y).Graphic(4), ScreenX * 32 + PixelOffsetX, ScreenY * 32 + _
- PixelOffsetY, temp_rgb(), , , 1)
- End If
- '**********************************
- ScreenX = ScreenX + 1
- Next X
- ScreenY = ScreenY + 1
- Next Y
- Else
- ScreenY = minYOffset - TileBufferSize
- For Y = minY To maxY
- ScreenX = minXOffset - TileBufferSize
- For X = minX To maxX
- 'Layer 4 **********************************
- If MapData(X, Y).Graphic(4).grhindex Then
- If AlphaY = 130 Then
- Call Draw_Grh(MapData(X, Y).Graphic(4), ScreenX * 32 + PixelOffsetX, ScreenY * 32 + _
- PixelOffsetY, 1, 0, MapData(X, Y).light_value)
- Else
- Call Grh_Render(MapData(X, Y).Graphic(4), ScreenX * 32 + PixelOffsetX, ScreenY * 32 + _
- PixelOffsetY, temp_rgb(), , , 1)
- End If
- End If
- '**********************************
- ScreenX = ScreenX + 1
- Next X
- ScreenY = ScreenY + 1
- Next Y
- End If
- If Not NickAmiguito(1) = "" Then
- If MouseNickAmiguito = 1 Then
- Draw_FilledBox 105, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
- D3DColorARGB(255, 136, 0, 21)
- ElseIf CartelAmiguito(1) = 1 Then
- Draw_FilledBox 105, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
- 255, 0, 0, 0)
- Else
- Draw_FilledBox 105, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
- D3DColorARGB(255, 0, 0, 0)
- End If
- Text_Render font_list(1), NickAmiguito(1), 390, 59, 169, 22, D3DColorARGB(200, 255, 255, 255), DT_CENTER, True
- End If
- If Not NickAmiguito(2) = "" Then
- If MouseNickAmiguito = 2 Then
- Draw_FilledBox 185, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
- D3DColorARGB(255, 136, 0, 21)
- ElseIf CartelAmiguito(2) = 1 Then
- Draw_FilledBox 185, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
- 255, 0, 0, 0)
- Else
- Draw_FilledBox 185, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
- D3DColorARGB(255, 0, 0, 0)
- End If
- Text_Render font_list(1), NickAmiguito(2), 391, 140, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
- End If
- If Not NickAmiguito(3) = "" Then
- If MouseNickAmiguito = 3 Then
- Draw_FilledBox 265, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
- D3DColorARGB(255, 136, 0, 21)
- ElseIf CartelAmiguito(3) = 1 Then
- Draw_FilledBox 265, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
- 255, 0, 0, 0)
- Else
- Draw_FilledBox 265, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
- D3DColorARGB(255, 0, 0, 0)
- End If
- Text_Render font_list(1), NickAmiguito(3), 391, 220, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
- End If
- If Not NickAmiguito(4) = "" Then
- If MouseNickAmiguito = 4 Then
- Draw_FilledBox 343, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
- D3DColorARGB(255, 136, 0, 21)
- ElseIf CartelAmiguito(4) = 1 Then
- Draw_FilledBox 343, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
- 255, 0, 0, 0)
- Else
- Draw_FilledBox 343, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
- D3DColorARGB(255, 0, 0, 0)
- End If
- Text_Render font_list(1), NickAmiguito(4), 391, 296, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
- End If
- If Not NickAmiguito(5) = "" Then
- If MouseNickAmiguito = 5 Then
- Draw_FilledBox 420, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 136, 40, 40), _
- D3DColorARGB(255, 136, 0, 21)
- ElseIf CartelAmiguito(5) = 1 Then
- Draw_FilledBox 420, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 60, 60, 0), D3DColorARGB( _
- 255, 0, 0, 0)
- Else
- Draw_FilledBox 420, 390, (((500) / (200 + 1 / 200)) * 32), 16, D3DColorARGB(255, 40, 40, 40), _
- D3DColorARGB(255, 0, 0, 0)
- End If
- Text_Render font_list(1), NickAmiguito(5), 391, 373, 169, 21, D3DColorARGB(200, 255, 255, 255), DT_CENTER, False
- End If
- Text_Render font_list(1), NombreMapa & "(" & UserMap & "," & UserPos.X & "," & UserPos.Y & ")", 0, 2, 400, 200, _
- &HFFFFFFFF, DT_TOP Or DT_LEFT, False
- Text_Render font_list(1), "Onlines: " & UsuariosOnline, 10, 2, 400, 200, &HFFFFFFFF, DT_TOP Or DT_LEFT, False
- If SecondaryEffectIndex <> 0 Then
- X = 250
- Y = 0
- Call Particle_Group_Render(SecondaryEffectIndex, X, Y)
- End If
- If ClimaPermanente > 0 Then
- X = 250
- Y = 0
- Call Particle_Group_Render(SecondaryEffectIndex, X, Y)
- End If
- Light.Light_Render_All
- End Sub
- Private Function Geometry_Create_TLVertex(ByVal X As Single, _
- ByVal Y As Single, _
- ByVal Z As Single, _
- ByVal rhw As Single, _
- ByVal Color As Long, _
- ByVal Specular As Long, _
- tu As Single, _
- ByVal tv As Single) As TLVERTEX
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- '**************************************************************
- Geometry_Create_TLVertex.X = X
- Geometry_Create_TLVertex.Y = Y
- Geometry_Create_TLVertex.Z = Z
- Geometry_Create_TLVertex.rhw = rhw
- Geometry_Create_TLVertex.Color = Color
- Geometry_Create_TLVertex.Specular = Specular
- Geometry_Create_TLVertex.tu = tu
- Geometry_Create_TLVertex.tv = tv
- End Function
- Private Function Geometry_Create_TLVertex2(X As Single, _
- Y As Single, _
- Z As Single, _
- rhw As Single, _
- Color As Long, _
- Specular As Long, _
- tu1 As Single, _
- tv1 As Single, _
- tu2 As Single, _
- tv2 As Single) As TLVERTEX2
- 'mz
- Geometry_Create_TLVertex2.X = X
- Geometry_Create_TLVertex2.Y = Y
- Geometry_Create_TLVertex2.Z = Z
- Geometry_Create_TLVertex2.rhw = rhw
- Geometry_Create_TLVertex2.Color = Color
- Geometry_Create_TLVertex2.Specular = Specular
- Geometry_Create_TLVertex2.tu1 = tu1
- Geometry_Create_TLVertex2.tv1 = tv1
- Geometry_Create_TLVertex2.tu2 = tu2
- Geometry_Create_TLVertex2.tv2 = tv2
- End Function
- Private Sub Geometry_Create_Box(ByRef verts() As TLVERTEX, _
- ByRef dest As RECT, _
- ByRef src As RECT, _
- ByRef rgb_list() As Long, _
- Optional ByRef Textures_Width As Long, _
- Optional ByRef Textures_Height As Long, _
- Optional ByVal angle As Single, _
- Optional ByVal Invert_x As Boolean = False, _
- Optional ByVal Invert_y As Boolean = False)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Modified by Juan Martín Sotuyo Dodero
- 'Last Modify Date: 11/17/2002
- '
- ' * v1 * v3
- ' |\ |
- ' | \ |
- ' | \ |
- ' | \ |
- ' | \|
- ' * v0 * v2
- '**************************************************************
- Dim x_center As Single
- Dim y_center As Single
- Dim radius As Single
- Dim x_Cor As Single
- Dim y_Cor As Single
- Dim left_point As Single
- Dim right_point As Single
- Dim Temp As Single
- Dim auxr As RECT
- If angle <> 0 Then
- 'Center coordinates on screen of the square
- x_center = dest.left + (dest.Right - dest.left) / 2
- y_center = dest.top + (dest.bottom - dest.top) / 2
- 'Calculate radius
- radius = Sqr((dest.Right - x_center) ^ 2 + (dest.bottom - y_center) ^ 2)
- 'Calculate left and right points
- Temp = (dest.Right - x_center) / radius
- right_point = Atn(Temp / Sqr(-Temp * Temp + 1))
- left_point = PI - right_point
- End If
- 'Calculate screen coordinates of sprite, and only rotate if necessary
- If angle = 0 Then
- x_Cor = dest.left
- y_Cor = dest.bottom
- Else
- x_Cor = x_center + Cos(-left_point - angle) * radius
- y_Cor = y_center - Sin(-left_point - angle) * radius
- End If
- auxr = src
- If angle < 0 Then
- src.left = auxr.Right
- src.Right = auxr.left
- End If
- If Invert_x Then
- src.left = auxr.Right
- src.Right = auxr.left
- End If
- If Invert_y Then
- src.top = auxr.bottom
- src.bottom = auxr.top
- End If
- '0 - Bottom left vertex
- If Textures_Width And Textures_Height Then
- verts(0) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(0), 0, src.left / Textures_Width, ( _
- src.bottom + 1) / Textures_Height)
- Else
- verts(0) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(0), 0, 0, 0)
- End If
- 'Calculate screen coordinates of sprite, and only rotate if necessary
- If angle = 0 Then
- x_Cor = dest.left
- y_Cor = dest.top
- Else
- x_Cor = x_center + Cos(left_point - angle) * radius
- y_Cor = y_center - Sin(left_point - angle) * radius
- End If
- '1 - Top left vertex
- If Textures_Width And Textures_Height Then
- verts(1) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(1), 0, src.left / Textures_Width, src.top / _
- Textures_Height)
- Else
- verts(1) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(1), 0, 0, 1)
- End If
- 'Calculate screen coordinates of sprite, and only rotate if necessary
- If angle = 0 Then
- x_Cor = dest.Right
- y_Cor = dest.bottom
- Else
- x_Cor = x_center + Cos(-right_point - angle) * radius
- y_Cor = y_center - Sin(-right_point - angle) * radius
- End If
- '2 - Bottom right vertex
- If Textures_Width And Textures_Height Then
- verts(2) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(2), 0, (src.Right + 1) / Textures_Width, ( _
- src.bottom + 1) / Textures_Height)
- Else
- verts(2) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(2), 0, 1, 0)
- End If
- 'Calculate screen coordinates of sprite, and only rotate if necessary
- If angle = 0 Then
- x_Cor = dest.Right
- y_Cor = dest.top
- Else
- x_Cor = x_center + Cos(right_point - angle) * radius
- y_Cor = y_center - Sin(right_point - angle) * radius
- End If
- '3 - Top right vertex
- If Textures_Width And Textures_Height Then
- verts(3) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(3), 0, (src.Right + 1) / Textures_Width, _
- src.top / Textures_Height)
- Else
- verts(3) = Geometry_Create_TLVertex(x_Cor, y_Cor, 0, 1, rgb_list(3), 0, 1, 1)
- End If
- End Sub
- Private Sub Device_Box_Textured_Render_Advance(ByVal grhindex As Long, _
- ByVal dest_x As Integer, _
- ByVal dest_y As Integer, _
- ByVal src_width As Integer, _
- ByVal src_height As Integer, _
- ByRef rgb_list() As Long, _
- ByVal src_x As Integer, _
- ByVal src_y As Integer, _
- ByVal dest_width As Integer, _
- Optional ByVal dest_height As Integer, _
- Optional ByVal alpha_blend As Boolean, _
- Optional ByVal angle As Single)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 5/15/2003
- 'Copies the Textures allowing resizing
- 'Modified by Juan Martín Sotuyo Dodero
- '**************************************************************
- Static src_rect As RECT
- Static dest_rect As RECT
- Static temp_verts(3) As TLVERTEX
- Static d3dTextures As D3D8Textures
- If grhindex = 0 Then Exit Sub
- Set d3dTextures.Texture = SurfaceDB.GetTexture(GrhData(grhindex).FileNum, d3dTextures.texwidth, _
- d3dTextures.texheight)
- 'Set up the source rectangle
- With src_rect
- .bottom = src_y + src_height
- .left = src_x
- .Right = src_x + src_width
- .top = src_y
- End With
- 'Set up the destination rectangle
- With dest_rect
- .bottom = dest_y + dest_height
- .left = dest_x
- .Right = dest_x + dest_width
- .top = dest_y
- End With
- 'Set up the TempVerts(3) vertices
- Geometry_Create_Box temp_verts(), dest_rect, src_rect, rgb_list(), d3dTextures.texwidth, _
- d3dTextures.texheight, angle
- 'Set Textures
- D3DDevice.SetTexture 0, d3dTextures.Texture
- If alpha_blend Then
- 'Set Rendering for alphablending
- D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_ONE
- D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_ONE
- End If
- 'Draw the triangles that make up our square Textures
- D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, temp_verts(0), Len(temp_verts(0))
- If alpha_blend Then
- 'Set Rendering for colokeying
- D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
- D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
- End If
- End Sub
- Public Sub Device_Box_Textured_Render(ByVal grhindex As Long, _
- ByVal dest_x As Integer, _
- ByVal dest_y As Integer, _
- ByVal src_width As Integer, _
- ByVal src_height As Integer, _
- ByRef rgb_list() As Long, _
- ByVal src_x As Integer, _
- ByVal src_y As Integer, _
- Optional ByVal alpha_blend As Boolean, _
- Optional ByVal angle As Single, _
- Optional ByVal Shadow As Byte = 0, _
- Optional ByVal Invert_x As Boolean = False, _
- Optional ByVal Invert_y As Boolean = False)
- '**************************************************************
- 'Author: Juan Martín Sotuyo Dodero
- 'Last Modify Date: 2/12/2004
- 'Just copies the Textures
- '**************************************************************
- Static src_rect As RECT
- Static dest_rect As RECT
- Static temp_verts(3) As TLVERTEX
- Static d3dTextures As D3D8Textures
- If grhindex = 0 Then Exit Sub
- Set d3dTextures.Texture = SurfaceDB.GetTexture(GrhData(grhindex).FileNum, d3dTextures.texwidth, _
- d3dTextures.texheight)
- 'Set up the source rectangle
- With src_rect
- .bottom = src_y + src_height
- .left = src_x
- .Right = src_x + src_width
- .top = src_y
- End With
- 'Set up the destination rectangle
- With dest_rect
- .bottom = dest_y + src_height
- .left = dest_x
- .Right = dest_x + src_width
- .top = dest_y
- End With
- 'Set up the TempVerts(3) vertices
- Geometry_Create_Box temp_verts(), dest_rect, src_rect, rgb_list(), d3dTextures.texwidth, _
- d3dTextures.texheight, angle, Invert_x, Invert_y
- 'Set Textures
- D3DDevice.SetTexture 0, d3dTextures.Texture
- If Shadow Then
- temp_verts(1).X = temp_verts(1).X + src_width / 2
- temp_verts(1).Y = temp_verts(1).Y - src_height / 2
- temp_verts(3).X = temp_verts(3).X + src_width
- temp_verts(3).Y = temp_verts(3).Y - src_width
- End If
- If alpha_blend Then
- 'Set Rendering for alphablending
- D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_ONE
- D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_ONE
- End If
- 'Draw the triangles that make up our square Textures
- D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, temp_verts(0), Len(temp_verts(0))
- If alpha_blend Then
- 'Set Rendering for colokeying
- D3DDevice.SetRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA
- D3DDevice.SetRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA
- End If
- End Sub
- Public Sub Engine_MoveScreen(ByVal nHeading As E_Heading)
- '******************************************
- 'Starts the screen moving in a direction
- '******************************************
- Dim X As Integer
- Dim Y As Integer
- Dim tX As Integer
- Dim tY As Integer
- 'Figure out which way to move
- Select Case nHeading
- Case E_Heading.NORTH
- Y = -1
- Case E_Heading.EAST
- X = 1
- Case E_Heading.SOUTH
- Y = 1
- Case E_Heading.WEST
- X = -1
- End Select
- 'Fill temp pos
- tX = UserPos.X + X
- tY = UserPos.Y + Y
- 'Check to see if its out of bounds
- If tX < MinXBorder Or tX > MaxXBorder Or tY < MinYBorder Or tY > MaxYBorder Then
- Exit Sub
- Else
- 'Start moving... MainLoop does the rest
- AddtoUserPos.X = X
- UserPos.X = tX
- AddtoUserPos.Y = Y
- UserPos.Y = tY
- UserMoving = 1
- bTecho = IIf(MapData(UserPos.X, UserPos.Y).Trigger = 1 Or MapData(UserPos.X, UserPos.Y).Trigger = 2 Or _
- MapData(UserPos.X, UserPos.Y).Trigger = 4, True, False)
- End If
- End Sub
- Private Sub Char_Render(ByVal charindex As Long, _
- ByVal PixelOffsetX As Integer, _
- ByVal PixelOffsetY As Integer, _
- ByRef Color() As Long)
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modify Date: 12/03/04
- 'Draw char's to screen without offcentering them
- '***************************************************
- On Error Resume Next
- Dim moved As Boolean
- Dim Pos As Integer
- Dim line As String
- Dim Color As Long
- With charlist(charindex)
- If .Moving Then
- 'If needed, move left and right
- If .scrollDirectionX <> 0 Then
- .MoveOffsetX = .MoveOffsetX + ScrollPixelsPerFrameX * Sgn(.scrollDirectionX) * timerTicksPerFrame
- 'Start animations
- 'TODO : Este parche es para evita los uncornos exploten al moverse!! REVER!!!
- If .Body.Walk(.Heading).Speed > 0 Then .Body.Walk(.Heading).Started = 1
- .arma.WeaponWalk(.Heading).Started = 1
- .Escudo.ShieldWalk(.Heading).Started = 1
- 'Char moved
- moved = True
- 'Check if we already got there
- If (Sgn(.scrollDirectionX) = 1 And .MoveOffsetX >= 0) Or (Sgn(.scrollDirectionX) = -1 And _
- .MoveOffsetX <= 0) Then
- .MoveOffsetX = 0
- .scrollDirectionX = 0
- End If
- End If
- 'If needed, move up and down
- If .scrollDirectionY <> 0 Then
- .MoveOffsetY = .MoveOffsetY + ScrollPixelsPerFrameY * Sgn(.scrollDirectionY) * timerTicksPerFrame
- 'Start animations
- 'TODO : Este parche es para evita los uncornos exploten al moverse!! REVER!!!
- If .Body.Walk(.Heading).Speed > 0 Then .Body.Walk(.Heading).Started = 1
- .arma.WeaponWalk(.Heading).Started = 1
- .Escudo.ShieldWalk(.Heading).Started = 1
- 'Char moved
- moved = True
- 'Check if we already got there
- If (Sgn(.scrollDirectionY) = 1 And .MoveOffsetY >= 0) Or (Sgn(.scrollDirectionY) = -1 And _
- .MoveOffsetY <= 0) Then
- .MoveOffsetY = 0
- .scrollDirectionY = 0
- End If
- End If
- End If
- If UserCharIndex = MapData(X, Y).charindex And frmMain.Muerto.Visible = True Then
- .Body.Walk(.Heading).grhindex = 0
- .Head.Head(.Heading).grhindex = 0
- End If
- If .Ariete = True Then
- .Body.Walk(.Heading).Started = 1
- 'Char moved
- moved = True
- 'Check if we already got there
- If (Sgn(.scrollDirectionY) = 1 And .MoveOffsetY >= 0) Or (Sgn(.scrollDirectionY) = -1 And .MoveOffsetY <= _
- 0) Then
- .MoveOffsetY = 0
- .scrollDirectionY = 0
- End If
- End If
- If .Heading = 0 Then .Heading = EAST
- 'If done moving stop animation
- If Not moved Then
- 'Stop animations
- .Body.Walk(.Heading).Started = 0
- .Body.Walk(.Heading).FrameCounter = 1
- .arma.WeaponWalk(.Heading).Started = 0
- .arma.WeaponWalk(.Heading).FrameCounter = 1
- .Escudo.ShieldWalk(.Heading).Started = 0
- .Escudo.ShieldWalk(.Heading).FrameCounter = 1
- .Moving = False
- End If
- PixelOffsetX = PixelOffsetX + .MoveOffsetX
- PixelOffsetY = PixelOffsetY + .MoveOffsetY
- If FrmOpciones.Checkreflejos = 1 And .invisible = False Then
- If HayAgua(.Pos.X, .Pos.Y + 1) Then
- If .Body.Walk(.Heading).grhindex Then Call Draw_Grh(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY _
- + 40, 1, 1, Color, True, 0, False, True)
- If UserEstado = 0 Then
- Call Draw_Grh(.Head.Head(.Heading), PixelOffsetX - .Body.HeadOffset.X, PixelOffsetY - _
- .Body.HeadOffset.Y + 11, 1, 0, Color, True, 0, False, True)
- Else
- Call Draw_Grh(.Head.Head(.Heading), PixelOffsetX - .Body.HeadOffset.X, PixelOffsetY - _
- .Body.HeadOffset.Y + 24, 1, 0, Color, True, 0, False, True)
- If .Casco.Head(.Heading).grhindex Then Call Draw_Grh(.Casco.Head(.Heading), PixelOffsetX - _
- .Body.HeadOffset.X, PixelOffsetY - .Body.HeadOffset.Y + 11, 1, 1, Color, True, 0, False, _
- True)
- If .arma.WeaponWalk(.Heading).grhindex Then Call Draw_Grh(.arma.WeaponWalk(.Heading), _
- PixelOffsetX, PixelOffsetY + 40, 1, 1, Color, True, 0, False, True)
- If .Escudo.ShieldWalk(.Heading).grhindex Then Call Draw_Grh(.Escudo.ShieldWalk(.Heading), _
- PixelOffsetX, PixelOffsetY + 40, 1, 1, Color, True, 0, False, True)
- End If
- End If
- End If
- If Not charlist(MapData(X, Y).charindex).invisible Or UserCharIndex = MapData(X, Y).charindex Then
- 'Draw Body
- If .Aura_Index > 0 And UserNavegando = False Then
- If 1 = Aura(.Aura_Index).Giratoria Then
- .Aura_Angle = .Aura_Angle + 0.006
- If .Aura_Angle >= 180 Then .Aura_Angle = 0
- End If
- If Aura(.Aura_Index).Giratoria = 0 Then
- .Aura_Angle = 0
- End If
- LuchoAuraR = Aura(.Aura_Index).Rojo
- LuchoAuraG = Aura(.Aura_Index).Verde
- LuchoAuraB = Aura(.Aura_Index).Azul
- If Aura(.Aura_Index).offset > 0 Then
- Call Draw_Aura(.Aura, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + Val( _
- Aura(.Aura_Index).offset) + 65, 1, 0, True, .Aura_Angle)
- ElseIf Aura(.Aura_Index).offset < 0 Then
- Call Draw_Aura(.Aura, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + Val( _
- Aura(.Aura_Index).offset) + 65, 1, 0, True, .Aura_Angle)
- Else
- Call Draw_Aura(.Aura, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + 65, _
- 1, 0, True, .Aura_Angle)
- End If
- End If
- If .AuraEspada_Index > 0 And UserNavegando = False Then
- If 1 = Aura(.AuraEspada_Index).Giratoria Then
- .AuraEspada_Angle = .AuraEspada_Angle + 0.006
- If .AuraEspada_Angle >= 180 Then .AuraEspada_Angle = 0
- End If
- If Aura(.AuraEspada_Index).Giratoria = 0 Then
- .AuraEspada_Angle = 0
- End If
- LuchoAuraR = Aura(.AuraEspada_Index).Rojo
- LuchoAuraG = Aura(.AuraEspada_Index).Verde
- LuchoAuraB = Aura(.AuraEspada_Index).Azul
- If Aura(.AuraEspada_Index).offset > 0 Then
- Call Draw_Aura(.AuraEspada, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraEspada_Index).offset) + 65, 1, 0, True, .AuraEspada_Angle)
- ElseIf Aura(.AuraEspada_Index).offset < 0 Then
- Call Draw_Aura(.AuraEspada, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraEspada_Index).offset) + 65, 1, 0, True, .AuraEspada_Angle)
- Else
- Call Draw_Aura(.AuraEspada, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + 65, 1, 0, True, .AuraEspada_Angle)
- End If
- End If
- If .AuraEscudo_Index > 0 And UserNavegando = False Then
- If 1 = Aura(.AuraEscudo_Index).Giratoria Then
- .AuraEscudo_Angle = .AuraEscudo_Angle + 0.006
- If .AuraEscudo_Angle >= 180 Then .AuraEscudo_Angle = 0
- End If
- If Aura(.AuraEscudo_Index).Giratoria = 0 Then
- .AuraEscudo_Angle = 0
- End If
- LuchoAuraR = Aura(.AuraEscudo_Index).Rojo
- LuchoAuraG = Aura(.AuraEscudo_Index).Verde
- LuchoAuraB = Aura(.AuraEscudo_Index).Azul
- If Aura(.AuraEscudo_Index).offset > 0 Then
- Call Draw_Aura(.AuraEscudo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraEscudo_Index).offset) + 65, 1, 0, True, .AuraEscudo_Angle)
- ElseIf Aura(.AuraEscudo_Index).offset < 0 Then
- Call Draw_Aura(.AuraEscudo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraEscudo_Index).offset) + 65, 1, 0, True, .AuraEscudo_Angle)
- Else
- Call Draw_Aura(.AuraEscudo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + 65, 1, 0, True, .AuraEscudo_Angle)
- End If
- End If
- If .AuraTunica_Index > 0 And UserNavegando = False Then
- If 1 = Aura(.AuraTunica_Index).Giratoria Then
- .AuraTunica_Angle = .AuraTunica_Angle + 0.006
- If .AuraTunica_Angle >= 180 Then .AuraTunica_Angle = 0
- End If
- If Aura(.AuraTunica_Index).Giratoria = 0 Then
- .AuraTunica_Angle = 0
- End If
- LuchoAuraR = Aura(.AuraTunica_Index).Rojo
- LuchoAuraG = Aura(.AuraTunica_Index).Verde
- LuchoAuraB = Aura(.AuraTunica_Index).Azul
- If Aura(.AuraTunica_Index).offset > 0 Then
- Call Draw_Aura(.AuraTunica, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraTunica_Index).offset) + 65, 1, 0, True, .AuraTunica_Angle)
- ElseIf Aura(.AuraTunica_Index).offset < 0 Then
- Call Draw_Aura(.AuraTunica, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraTunica_Index).offset) + 65, 1, 0, True, .AuraTunica_Angle)
- Else
- Call Draw_Aura(.AuraTunica, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + 65, 1, 0, True, .AuraTunica_Angle)
- End If
- End If
- If .AuraCasco_Index > 0 And UserNavegando = False Then
- If 1 = Aura(.AuraCasco_Index).Giratoria Then
- .AuraCasco_Angle = .AuraCasco_Angle + 0.006
- If .AuraCasco_Angle >= 180 Then .AuraCasco_Angle = 0
- End If
- If Aura(.AuraCasco_Index).Giratoria = 0 Then
- .AuraCasco_Angle = 0
- End If
- LuchoAuraR = Aura(.AuraCasco_Index).Rojo
- LuchoAuraG = Aura(.AuraCasco_Index).Verde
- LuchoAuraB = Aura(.AuraCasco_Index).Azul
- If Aura(.AuraCasco_Index).offset > 0 Then
- Call Draw_Aura(.AuraCasco, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + _
- Val(Aura(.AuraCasco_Index).offset) + 65, 1, 0, True, .AuraCasco_Angle)
- ElseIf Aura(.AuraCasco_Index).offset < 0 Then
- Call Draw_Aura(.AuraCasco, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + _
- Val(Aura(.AuraCasco_Index).offset) + 65, 1, 0, True, .AuraCasco_Angle)
- Else
- Call Draw_Aura(.AuraCasco, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + _
- 65, 1, 0, True, .AuraCasco_Angle)
- End If
- End If
- If .AuraAnillo_Index > 0 And UserNavegando = False Then
- If 1 = Aura(.AuraAnillo_Index).Giratoria Then
- .AuraAnillo_Angle = .AuraAnillo_Angle + 0.006
- If .AuraAnillo_Angle >= 180 Then .AuraAnillo_Angle = 0
- End If
- If Aura(.AuraAnillo_Index).Giratoria = 0 Then
- .AuraAnillo_Angle = 0
- End If
- LuchoAuraR = Aura(.AuraAnillo_Index).Rojo
- LuchoAuraG = Aura(.AuraAnillo_Index).Verde
- LuchoAuraB = Aura(.AuraAnillo_Index).Azul
- If Aura(.AuraAnillo_Index).offset > 0 Then
- Call Draw_Aura(.AuraAnillo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraAnillo_Index).offset) + 65, 1, 0, True, .AuraAnillo_Angle)
- ElseIf Aura(.AuraAnillo_Index).offset < 0 Then
- Call Draw_Aura(.AuraAnillo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + Val(Aura(.AuraAnillo_Index).offset) + 65, 1, 0, True, .AuraAnillo_Angle)
- Else
- Call Draw_Aura(.AuraAnillo, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y _
- + 65, 1, 0, True, .AuraAnillo_Angle)
- End If
- End If
- If .invisible And Not .priv > 0 Then
- Draw_FilledBox 45, 42, 32, 7, D3DColorARGB(100, 230, 230, 230), D3DColorARGB(100, 150, 150, 150)
- Draw_FilledBox 45, 42, (((TimI + 1 / 150) / (200 + 1 / 200)) * 32), 7, D3DColorARGB(100, 255, 255, _
- 0), D3DColorARGB(1, 255, 255, 0)
- Call Draw_Grhindex(24849, 45, 7)
- End If
- If UserParalizado Then
- Draw_FilledBox 8, 42, 32, 7, D3DColorARGB(100, 230, 230, 230), D3DColorARGB(100, 150, 150, 150)
- Draw_FilledBox 8, 42, (((TimR + 1 / 150) / (200 + 1 / 200)) * 32), 7, D3DColorARGB(100, 255, 255, 0), _
- D3DColorARGB(1, 255, 255, 0)
- Call Draw_Grhindex(24835, 8, 7)
- End If
- If Cuenta = True Then
- Call Draw_Grhindex(Conteo, 210, 40)
- End If
- If Tiempo > 1 Then
- Call Draw_Grhindex(Conteo, 195, 40)
- Tiempo = Tiempo - 1
- End If
- If .Body.Walk(.Heading).grhindex Then
- If FrmOpciones.Checksombras = 1 And .invisible = False Then
- 'Call Draw_Grh_Sombra(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY, 1, 1, , X, Y, , 1)
- Call Draw_Grh_Sombra(.Body.Walk(.Heading), PixelOffsetX - 6, PixelOffsetY, 1, 1, , , 1)
- End If
- Call Draw_Grh(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY, 1, 1, Color)
- End If
- If .Head.Head(.Heading).grhindex Then
- If FrmOpciones.Checksombras = 1 And .invisible = False Then
- Call Draw_Grh_Sombra(.Head.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X + 5, PixelOffsetY + _
- .Body.HeadOffset.Y - 8, 1, 0, , , 1)
- End If
- Call Draw_Grh(.Head.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + _
- .Body.HeadOffset.Y, 1, 0, Color)
- If .Casco.Head(.Heading).grhindex Then Call Draw_Grh(.Casco.Head(.Heading), PixelOffsetX + _
- .Body.HeadOffset.X + 1, PixelOffsetY + .Body.HeadOffset.Y, 1, 1, Color)
- If .arma.WeaponWalk(.Heading).grhindex Then Call Draw_Grh(.arma.WeaponWalk(.Heading), PixelOffsetX + _
- .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + 38, 1, 1, Color)
- If .Escudo.ShieldWalk(.Heading).grhindex Then Call Draw_Grh(.Escudo.ShieldWalk(.Heading), _
- PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y + 38, 1, 1, Color)
- End If
- If UserCharIndex = MapData(X, Y).charindex And frmMain.Muerto.Visible = True Then
- .Body.Walk(.Heading).grhindex = 0
- .Head.Head(.Heading).grhindex = 0
- End If
- 'Draw name over head
- If Nombres Then
- If Len(.Nombre) > 0 Then
- Pos = InStr(.Nombre, "<")
- If Pos = 0 Then Pos = Len(.Nombre) + 2
- Select Case .priv
- Case 0
- 'Azthenwok
- Select Case .EsStatus
- Case 0
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- If SegundosPoder < 13 Then
- Color = d3dcolorxrgb(117 + SegundosPoder * 10, 117 + SegundosPoder * 10, _
- 117 + SegundosPoder * 10)
- ElseIf SegundosPoder >= 13 Then
- Color = d3dcolorxrgb(117 - SegundosPoder * 10, 117 - SegundosPoder * 10, _
- 117 - SegundosPoder * 10)
- End If
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(48).r, ColoresPJ(48).g, ColoresPJ(48).B)
- End If
- Case 1
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- If SegundosPoder < 13 Then
- Color = d3dcolorxrgb(0 + SegundosPoder * 10, 116 + SegundosPoder * 10, 232)
- ElseIf SegundosPoder >= 13 Then
- Color = d3dcolorxrgb(0 - SegundosPoder * 10, 116 - SegundosPoder * 10, 232)
- End If
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(46).r, ColoresPJ(46).g, ColoresPJ(46).B)
- End If
- Case 2
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- If SegundosPoder < 13 Then
- Color = d3dcolorxrgb(255, 25 + SegundosPoder * 10, 25 + SegundosPoder * 10)
- ElseIf SegundosPoder >= 13 Then
- Color = d3dcolorxrgb(255, 25 - SegundosPoder * 10, 25 - SegundosPoder * 10)
- End If
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(47).r, ColoresPJ(47).g, ColoresPJ(47).B)
- End If
- Case 3
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- Select Case SegundosPoder
- Case 0
- Color = d3dcolorxrgb(225, 225, 225)
- Case 1
- Color = d3dcolorxrgb(215, 215, 215)
- Case 2
- Color = d3dcolorxrgb(210, 210, 210)
- Case 3
- Color = d3dcolorxrgb(200, 200, 200)
- Case 4
- Color = d3dcolorxrgb(190, 190, 190)
- Case 5
- Color = d3dcolorxrgb(180, 180, 180)
- Case 6
- Color = d3dcolorxrgb(170, 170, 170)
- Case 7
- Color = d3dcolorxrgb(160, 160, 160)
- Case 8
- Color = d3dcolorxrgb(150, 150, 150)
- Case 9
- Color = d3dcolorxrgb(140, 140, 140)
- Case 10
- Color = d3dcolorxrgb(130, 130, 130)
- Case 11
- Color = d3dcolorxrgb(120, 120, 120)
- Case 12
- Color = d3dcolorxrgb(110, 110, 110)
- Case 13
- Color = d3dcolorxrgb(90, 90, 90)
- Case 14
- Color = d3dcolorxrgb(100, 100, 100)
- Case 15
- Color = d3dcolorxrgb(110, 110, 110)
- Case 16
- Color = d3dcolorxrgb(120, 120, 120)
- Case 17
- Color = d3dcolorxrgb(130, 130, 130)
- Case 18
- Color = d3dcolorxrgb(140, 140, 140)
- Case 19
- Color = d3dcolorxrgb(150, 150, 150)
- Case 20
- Color = d3dcolorxrgb(160, 160, 160)
- Case 21
- Color = d3dcolorxrgb(170, 170, 170)
- Case 22
- Color = d3dcolorxrgb(180, 180, 180)
- Case 23
- Color = d3dcolorxrgb(190, 190, 190)
- Case 24
- Color = d3dcolorxrgb(200, 200, 200)
- End Select
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- End If
- Case 4
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- Select Case SegundosPoder
- Case 0
- Color = d3dcolorxrgb(225, 225, 225)
- Case 1
- Color = d3dcolorxrgb(215, 215, 215)
- Case 2
- Color = d3dcolorxrgb(210, 210, 210)
- Case 3
- Color = d3dcolorxrgb(200, 200, 200)
- Case 4
- Color = d3dcolorxrgb(190, 190, 190)
- Case 5
- Color = d3dcolorxrgb(180, 180, 180)
- Case 6
- Color = d3dcolorxrgb(170, 170, 170)
- Case 7
- Color = d3dcolorxrgb(160, 160, 160)
- Case 8
- Color = d3dcolorxrgb(150, 150, 150)
- Case 9
- Color = d3dcolorxrgb(140, 140, 140)
- Case 10
- Color = d3dcolorxrgb(130, 130, 130)
- Case 11
- Color = d3dcolorxrgb(120, 120, 120)
- Case 12
- Color = d3dcolorxrgb(110, 110, 110)
- Case 13
- Color = d3dcolorxrgb(90, 90, 90)
- Case 14
- Color = d3dcolorxrgb(100, 100, 100)
- Case 15
- Color = d3dcolorxrgb(110, 110, 110)
- Case 16
- Color = d3dcolorxrgb(120, 120, 120)
- Case 17
- Color = d3dcolorxrgb(130, 130, 130)
- Case 18
- Color = d3dcolorxrgb(140, 140, 140)
- Case 19
- Color = d3dcolorxrgb(150, 150, 150)
- Case 20
- Color = d3dcolorxrgb(160, 160, 160)
- Case 21
- Color = d3dcolorxrgb(170, 170, 170)
- Case 22
- Color = d3dcolorxrgb(180, 180, 180)
- Case 23
- Color = d3dcolorxrgb(190, 190, 190)
- Case 24
- Color = d3dcolorxrgb(200, 200, 200)
- End Select
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- End If
- Case 5
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- Select Case SegundosPoder
- Case 0
- Color = d3dcolorxrgb(225, 225, 225)
- Case 1
- Color = d3dcolorxrgb(215, 215, 215)
- Case 2
- Color = d3dcolorxrgb(210, 210, 210)
- Case 3
- Color = d3dcolorxrgb(200, 200, 200)
- Case 4
- Color = d3dcolorxrgb(190, 190, 190)
- Case 5
- Color = d3dcolorxrgb(180, 180, 180)
- Case 6
- Color = d3dcolorxrgb(170, 170, 170)
- Case 7
- Color = d3dcolorxrgb(160, 160, 160)
- Case 8
- Color = d3dcolorxrgb(150, 150, 150)
- Case 9
- Color = d3dcolorxrgb(140, 140, 140)
- Case 10
- Color = d3dcolorxrgb(130, 130, 130)
- Case 11
- Color = d3dcolorxrgb(120, 120, 120)
- Case 12
- Color = d3dcolorxrgb(110, 110, 110)
- Case 13
- Color = d3dcolorxrgb(90, 90, 90)
- Case 14
- Color = d3dcolorxrgb(100, 100, 100)
- Case 15
- Color = d3dcolorxrgb(110, 110, 110)
- Case 16
- Color = d3dcolorxrgb(120, 120, 120)
- Case 17
- Color = d3dcolorxrgb(130, 130, 130)
- Case 18
- Color = d3dcolorxrgb(140, 140, 140)
- Case 19
- Color = d3dcolorxrgb(150, 150, 150)
- Case 20
- Color = d3dcolorxrgb(160, 160, 160)
- Case 21
- Color = d3dcolorxrgb(170, 170, 170)
- Case 22
- Color = d3dcolorxrgb(180, 180, 180)
- Case 23
- Color = d3dcolorxrgb(190, 190, 190)
- Case 24
- Color = d3dcolorxrgb(200, 200, 200)
- End Select
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(5).r, ColoresPJ(5).g, ColoresPJ(5).B)
- End If
- 'Consejo caos
- Case 6
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- Select Case SegundosPoder
- Case 0
- Color = d3dcolorxrgb(225, 225, 225)
- Case 1
- Color = d3dcolorxrgb(215, 215, 215)
- Case 2
- Color = d3dcolorxrgb(210, 210, 210)
- Case 3
- Color = d3dcolorxrgb(200, 200, 200)
- Case 4
- Color = d3dcolorxrgb(190, 190, 190)
- Case 5
- Color = d3dcolorxrgb(180, 180, 180)
- Case 6
- Color = d3dcolorxrgb(170, 170, 170)
- Case 7
- Color = d3dcolorxrgb(160, 160, 160)
- Case 8
- Color = d3dcolorxrgb(150, 150, 150)
- Case 9
- Color = d3dcolorxrgb(140, 140, 140)
- Case 10
- Color = d3dcolorxrgb(130, 130, 130)
- Case 11
- Color = d3dcolorxrgb(120, 120, 120)
- Case 12
- Color = d3dcolorxrgb(110, 110, 110)
- Case 13
- Color = d3dcolorxrgb(90, 90, 90)
- Case 14
- Color = d3dcolorxrgb(100, 100, 100)
- Case 15
- Color = d3dcolorxrgb(110, 110, 110)
- Case 16
- Color = d3dcolorxrgb(120, 120, 120)
- Case 17
- Color = d3dcolorxrgb(130, 130, 130)
- Case 18
- Color = d3dcolorxrgb(140, 140, 140)
- Case 19
- Color = d3dcolorxrgb(150, 150, 150)
- Case 20
- Color = d3dcolorxrgb(160, 160, 160)
- Case 21
- Color = d3dcolorxrgb(170, 170, 170)
- Case 22
- Color = d3dcolorxrgb(180, 180, 180)
- Case 23
- Color = d3dcolorxrgb(190, 190, 190)
- Case 24
- Color = d3dcolorxrgb(200, 200, 200)
- End Select
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(6).r, ColoresPJ(6).g, ColoresPJ(6).B)
- End If
- Case 8
- If charlist(MapData(X, Y).charindex).invisible Then
- Color = d3dcolorxrgb(ColoresPJ(24).r, ColoresPJ(24).g, ColoresPJ(24).B)
- ElseIf .ColorBlue = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(49).r, ColoresPJ(49).g, ColoresPJ(49).B)
- ElseIf .ColorRed = 1 Then
- Color = d3dcolorxrgb(ColoresPJ(50).r, ColoresPJ(50).g, ColoresPJ(50).B)
- ElseIf .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- ElseIf .GranPoder = 1 Then
- Select Case SegundosPoder
- Case 0
- Color = d3dcolorxrgb(225, 225, 225)
- Case 1
- Color = d3dcolorxrgb(215, 215, 215)
- Case 2
- Color = d3dcolorxrgb(210, 210, 210)
- Case 3
- Color = d3dcolorxrgb(200, 200, 200)
- Case 4
- Color = d3dcolorxrgb(190, 190, 190)
- Case 5
- Color = d3dcolorxrgb(180, 180, 180)
- Case 6
- Color = d3dcolorxrgb(170, 170, 170)
- Case 7
- Color = d3dcolorxrgb(160, 160, 160)
- Case 8
- Color = d3dcolorxrgb(150, 150, 150)
- Case 9
- Color = d3dcolorxrgb(140, 140, 140)
- Case 10
- Color = d3dcolorxrgb(130, 130, 130)
- Case 11
- Color = d3dcolorxrgb(120, 120, 120)
- Case 12
- Color = d3dcolorxrgb(110, 110, 110)
- Case 13
- Color = d3dcolorxrgb(90, 90, 90)
- Case 14
- Color = d3dcolorxrgb(100, 100, 100)
- Case 15
- Color = d3dcolorxrgb(110, 110, 110)
- Case 16
- Color = d3dcolorxrgb(120, 120, 120)
- Case 17
- Color = d3dcolorxrgb(130, 130, 130)
- Case 18
- Color = d3dcolorxrgb(140, 140, 140)
- Case 19
- Color = d3dcolorxrgb(150, 150, 150)
- Case 20
- Color = d3dcolorxrgb(160, 160, 160)
- Case 21
- Color = d3dcolorxrgb(170, 170, 170)
- Case 22
- Color = d3dcolorxrgb(180, 180, 180)
- Case 23
- Color = d3dcolorxrgb(190, 190, 190)
- Case 24
- Color = d3dcolorxrgb(200, 200, 200)
- End Select
- ElseIf .TieneCastillos = 1 Then
- Select Case SegundosCastillos
- Case 0
- Color = d3dcolorxrgb(255, 255, 200)
- Case 1
- Color = d3dcolorxrgb(255, 255, 190)
- Case 2
- Color = d3dcolorxrgb(255, 255, 180)
- Case 3
- Color = d3dcolorxrgb(255, 255, 175)
- Case 4
- Color = d3dcolorxrgb(255, 255, 160)
- Case 5
- Color = d3dcolorxrgb(255, 255, 150)
- Case 6
- Color = d3dcolorxrgb(255, 255, 140)
- Case 7
- Color = d3dcolorxrgb(255, 255, 130)
- Case 8
- Color = d3dcolorxrgb(255, 255, 120)
- Case 9
- Color = d3dcolorxrgb(255, 255, 110)
- Case 10
- Color = d3dcolorxrgb(255, 255, 100)
- Case 11
- Color = d3dcolorxrgb(255, 255, 90)
- Case 12
- Color = d3dcolorxrgb(255, 255, 80)
- Case 13
- Color = d3dcolorxrgb(255, 255, 70)
- Case 14
- Color = d3dcolorxrgb(255, 255, 60)
- Case 15
- Color = d3dcolorxrgb(255, 255, 50)
- Case 16
- Color = d3dcolorxrgb(255, 255, 40)
- Case 17
- Color = d3dcolorxrgb(255, 255, 50)
- Case 18
- Color = d3dcolorxrgb(255, 255, 60)
- Case 19
- Color = d3dcolorxrgb(255, 255, 70)
- Case 20
- Color = d3dcolorxrgb(255, 255, 80)
- Case 21
- Color = d3dcolorxrgb(255, 255, 90)
- Case 22
- Color = d3dcolorxrgb(255, 255, 100)
- Case 23
- Color = d3dcolorxrgb(255, 255, 110)
- Case 24
- Color = d3dcolorxrgb(255, 255, 120)
- Case 25
- Color = d3dcolorxrgb(255, 255, 130)
- Case 26
- Color = d3dcolorxrgb(255, 255, 140)
- Case 27
- Color = d3dcolorxrgb(255, 255, 150)
- Case 28
- Color = d3dcolorxrgb(255, 255, 160)
- Case 29
- Color = d3dcolorxrgb(255, 255, 170)
- Case 30
- Color = d3dcolorxrgb(255, 255, 180)
- Case 31
- Color = d3dcolorxrgb(255, 255, 190)
- Case 32
- Color = d3dcolorxrgb(255, 255, 200)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(22).r, ColoresPJ(22).g, ColoresPJ(22).B)
- End If
- End Select
- Case Is > 0 'admin
- If .EsNoble = 1 Then
- Select Case SegundosNoble
- Case 0
- Color = d3dcolorxrgb(0, 255, 0)
- Case 1
- Color = d3dcolorxrgb(0, 245, 0)
- Case 2
- Color = d3dcolorxrgb(0, 235, 0)
- Case 3
- Color = d3dcolorxrgb(0, 225, 0)
- Case 4
- Color = d3dcolorxrgb(0, 215, 0)
- Case 5
- Color = d3dcolorxrgb(0, 205, 0)
- Case 6
- Color = d3dcolorxrgb(0, 195, 0)
- Case 7
- Color = d3dcolorxrgb(0, 185, 0)
- Case 8
- Color = d3dcolorxrgb(0, 175, 0)
- Case 9
- Color = d3dcolorxrgb(0, 165, 0)
- Case 10
- Color = d3dcolorxrgb(0, 155, 0)
- Case 11
- Color = d3dcolorxrgb(0, 145, 0)
- Case 12
- Color = d3dcolorxrgb(0, 135, 0)
- Case 13
- Color = d3dcolorxrgb(0, 125, 0)
- Case 14
- Color = d3dcolorxrgb(0, 115, 0)
- Case 15
- Color = d3dcolorxrgb(0, 125, 0)
- Case 16
- Color = d3dcolorxrgb(0, 135, 0)
- Case 17
- Color = d3dcolorxrgb(0, 145, 0)
- Case 18
- Color = d3dcolorxrgb(0, 155, 0)
- Case 19
- Color = d3dcolorxrgb(0, 165, 0)
- Case 20
- Color = d3dcolorxrgb(0, 175, 0)
- Case 21
- Color = d3dcolorxrgb(0, 185, 0)
- Case 22
- Color = d3dcolorxrgb(0, 195, 0)
- Case 23
- Color = d3dcolorxrgb(0, 205, 0)
- Case 24
- Color = d3dcolorxrgb(0, 215, 0)
- Case 25
- Color = d3dcolorxrgb(0, 225, 0)
- Case 26
- Color = d3dcolorxrgb(0, 235, 0)
- Case 27
- Color = d3dcolorxrgb(0, 245, 0)
- Case 28
- Color = d3dcolorxrgb(0, 255, 0)
- End Select
- Else
- Color = d3dcolorxrgb(ColoresPJ(.priv).r, ColoresPJ(.priv).g, ColoresPJ(.priv).B)
- End If
- Case Else 'el resto
- Color = d3dcolorxrgb(ColoresPJ(.priv).r, ColoresPJ(.priv).g, ColoresPJ(.priv).B)
- End Select
- 'Jerarquias Azthenwok
- If .priv <> 0 Then
- If .priv = 1 And .EsNoble = 0 Then 'CONSE
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
- Color, , DT_CENTER)
- ElseIf .priv = 2 And .EsNoble = 0 Then 'SEMI DIOS
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
- Color, , DT_CENTER)
- ElseIf .priv = 3 And .EsNoble = 0 Then 'EVENT
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
- Color, , DT_CENTER)
- ElseIf .priv = 4 And .EsNoble = 0 Then 'DIOS
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
- Color, , DT_CENTER)
- ElseIf .priv = 5 And .EsNoble = 0 Then 'DESARROLLADOR
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Desarrollador>" & _
- line, Color, , DT_CENTER)
- ElseIf .priv = 8 And .EsNoble = 0 Then 'GRANDIOS
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Game Master>" & line, _
- Color, , DT_CENTER)
- ElseIf .priv = 9 And .EsNoble = 0 Then 'COORAINDOR
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Coordinador de GMs>" _
- & line, Color, , DT_CENTER)
- ElseIf .priv = 10 And .EsNoble = 0 Then 'DIRECTOR
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Director de GMs>" & _
- line, Color, , DT_CENTER)
- ElseIf .priv = 11 And .EsNoble = 0 Then 'ADMIN
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, "<Administrador>" & _
- line, Color, , DT_CENTER)
- End If
- End If
- 'Nick
- line = left$(.Nombre, Pos - 2)
- If .Estrellita = 1 And Not .invisible = True Then
- Call Draw_Grh(.Estrellitax, PixelOffsetX - Len(line) * 3, PixelOffsetY + 31, 1, 1, Color)
- End If
- If UserReputacione >= 2500 And Not .invisible = True Then
- Call Draw_Grh(.Emblema, PixelOffsetX + Len(line) * 7, PixelOffsetY + 31, 1, 1, Color)
- End If
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 30, line, Color, , DT_CENTER)
- 'Clan
- 'Evitamos que se le vea el clan a los GMs / Azthenwok /
- If .priv = 0 Then
- line = Mid$(.Nombre, Pos)
- Call Texto.Engine_Text_Draw(PixelOffsetX + 16, PixelOffsetY + 45, line, Color, , DT_CENTER)
- End If
- End If
- End If
- Else
- 'Draw Alpha Body
- 'Dibujado del pj en alpha
- 'Gus.Canaria
- 'If .Muerto = True Then Call Grh_Render(.Body.Walk(.Heading), PixelOffsetX, PixelOffsetY, , True)
- ' If .Head.Head(.Heading).grhindex Then _
- ' Call Grh_Render(.Head.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y, LuzGrh(), , , True)
- ' If .Casco.Head(.Heading).grhindex Then _
- ' Call Grh_Render(.Casco.Head(.Heading), PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y, LuzGrh(), , , True)
- ' If .arma.WeaponWalk(.Heading).grhindex Then _
- Call Grh_Render(.arma.WeaponWalk(.Heading), PixelOffsetX, PixelOffsetY, LuzGrh(), , , True)
- ' If .Escudo.ShieldWalk(.Heading).grhindex Then _
- ' Call Grh_Render(.Escudo.ShieldWalk(.Heading), PixelOffsetX, PixelOffsetY, LuzGrh(), , , True)
- End If 'If not visible
- ''Update dialogs
- Call Dialogos.UpdateDialogPos(PixelOffsetX + .Body.HeadOffset.X - 168, PixelOffsetY + .Body.HeadOffset.Y, _
- charindex)
- 'particulas para meditar
- Dim I As Integer
- If .particle_count > 0 Then
- For I = 1 To .particle_count
- If .particle_group(I) > 0 Then
- Particle_Group_Render .particle_group(I), PixelOffsetX, PixelOffsetY
- End If
- Next I
- End If
- 'Draw FX
- If .FxIndex <> 0 Then
- If .UsandoCarita = 1 Then
- Call Draw_Grh(.Fx, PixelOffsetX + .Body.HeadOffset.X, PixelOffsetY + .Body.HeadOffset.Y - 20, 1, 1, _
- Color, True)
- Else
- Call Draw_Grh(.Fx, PixelOffsetX + FxData(.FxIndex).OffsetX, PixelOffsetY + FxData(.FxIndex).OffsetY, _
- 1, 1, Color, True)
- End If
- If .Fx.Started = 0 Then .FxIndex = 0
- End If
- End With
- End Sub
- Public Sub Start()
- Dim f As Boolean
- Dim ulttick As Long, esttick As Long
- Dim timers(1 To 2) As Long
- Dim LoopC As Integer
- 'day_r_old = luz_dia(Hour(Time)).r
- 'day_g_old = luz_dia(Hour(Time)).g
- 'day_b_old = luz_dia(Hour(Time)).B
- 'base_light = ARGB(day_r_old, day_g_old, day_b_old, 255)
- Ambiente_Initialize
- 'On Error Resume Next ' putos timers!!!!!
- Do While prgRun
- If FrmConnect.Visible = True Then
- DibujarConectar
- Render
- End If
- If FrmCrearPj.Visible = True Then
- DibujarCrearpj
- Render
- End If
- 'TODO : Porque el pausado de 20 ms???
- If GetTickCount - lastTime > 60 Then
- If Not pausa And frmMain.Visible And Not frmForo.Visible And Not frmComerciar.Visible And Not _
- frmBancoObj.Visible And Not FrmBanco.Visible Then
- CheckKeys
- lastTime = GetTickCount
- End If
- End If
- If frmMain.WindowState <> vbMinimized And frmMain.Visible = True Then
- engine.Render
- engine.DrawInv
- Else
- Sleep 10&
- End If
- Ambiente_CheckState
- Rem Limitar FPS
- 'While (GetTickCount - lFrameLimiter) < FramesPerSecCounter
- 'Sleep 1
- 'Wend
- While (GetTickCount - fpsLastCheck) \ 10 < FramesPerSecCounter
- Sleep 5
- Wend
- lFrameLimiter = GetTickCount
- FramesPerSecCounter = FramesPerSecCounter + 1
- timerElapsedTime = GetElapsedTime()
- timerTicksPerFrame = timerElapsedTime * engineBaseSpeed
- particletimer = timerElapsedTime * 0.5
- esttick = GetTickCount
- For LoopC = 1 To UBound(timers)
- timers(LoopC) = timers(LoopC) + (esttick - ulttick)
- 'Timer de trabajo
- If timers(1) >= tUs Then
- timers(1) = 0
- NoPuedeUsar = False
- End If
- 'timer de attaque (77)
- If timers(2) >= tAt Then
- timers(2) = 0
- UserCanAttack = 1
- UserPuedeRefrescar = True
- End If
- Next LoopC
- ulttick = GetTickCount
- DoEvents
- Loop
- engine.Engine_Deinit
- EngineRun = False
- frmCargando.Show
- 'Destruimos los objetos públicos creados
- Set SurfaceDB = Nothing
- Set Dialogos = Nothing
- Set DialogosClanes = Nothing
- Set Audio = Nothing
- Set Inventario = Nothing
- Call UnloadAllForms
- End
- End Sub
- Public Sub SetCharacterFx(ByVal charindex As Integer, _
- ByVal Fx As Integer, _
- ByVal Loops As Integer)
- '***************************************************
- 'Author: Juan Martín Sotuyo Dodero (Maraxus)
- 'Last Modify Date: 12/03/04
- 'Sets an FX to the character.
- '***************************************************
- With charlist(charindex)
- .FxIndex = Fx
- If .FxIndex > 0 Then
- Call InitGrh(.Fx, FxData(Fx).Animacion)
- .Fx.Loops = Loops
- End If
- End With
- End Sub
- Public Sub Char_Move_by_Head(ByVal charindex As Integer, ByVal nHeading As E_Heading)
- '*****************************************************************
- 'Starts the movement of a character in nHeading direction
- '*****************************************************************
- Dim addx As Integer
- Dim addy As Integer
- Dim X As Integer
- Dim Y As Integer
- Dim nX As Integer
- Dim nY As Integer
- With charlist(charindex)
- X = .Pos.X
- Y = .Pos.Y
- 'Figure out which way to move
- Select Case nHeading
- Case E_Heading.NORTH
- addy = -1
- Case E_Heading.EAST
- addx = 1
- Case E_Heading.SOUTH
- addy = 1
- Case E_Heading.WEST
- addx = -1
- End Select
- nX = X + addx
- nY = Y + addy
- If nX < 1 Or nX > 100 Or nY < 1 Or nY > 100 Then Exit Sub
- MapData(nX, nY).charindex = charindex
- .Pos.X = nX
- .Pos.Y = nY
- MapData(X, Y).charindex = 0
- .MoveOffsetX = -1 * (32 * addx)
- .MoveOffsetY = -1 * (32 * addy)
- .Moving = 1
- .Heading = nHeading
- .scrollDirectionX = addx
- .scrollDirectionY = addy
- End With
- If UserEstado <> 1 Then Call DoPasosFx(charindex)
- 'areas viejos
- If (nY < MinLimiteY) Or (nY > MaxLimiteY) Or (nX < MinLimiteX) Or (nX > MaxLimiteX) Then
- Call EraseChar(charindex)
- End If
- End Sub
- Public Sub Char_Move_by_Pos(ByVal charindex As Integer, _
- ByVal nX As Integer, _
- ByVal nY As Integer)
- If charindex = UserCharIndex And UserParalizado Then Exit Sub
- On Error Resume Next
- Dim X As Integer
- Dim Y As Integer
- Dim addx As Integer
- Dim addy As Integer
- Dim nHeading As E_Heading
- With charlist(charindex)
- X = .Pos.X
- Y = .Pos.Y
- MapData(X, Y).charindex = 0
- addx = nX - X
- addy = nY - Y
- If Sgn(addx) = 1 Then
- nHeading = E_Heading.EAST
- End If
- If Sgn(addx) = -1 Then
- nHeading = E_Heading.WEST
- End If
- If Sgn(addy) = -1 Then
- nHeading = E_Heading.NORTH
- End If
- If Sgn(addy) = 1 Then
- nHeading = E_Heading.SOUTH
- End If
- MapData(nX, nY).charindex = charindex
- .Pos.X = nX
- .Pos.Y = nY
- .MoveOffsetX = -1 * (32 * addx)
- .MoveOffsetY = -1 * (32 * addy)
- .Moving = 1
- .Heading = nHeading
- .scrollDirectionX = Sgn(addx)
- .scrollDirectionY = Sgn(addy)
- 'parche para que no medite cuando camina
- If .FxIndex = FxMeditar.CHICO Or .FxIndex = FxMeditar.GRANDE Or .FxIndex = FxMeditar.MEDIANO Or .FxIndex = _
- FxMeditar.XGRANDE Or .FxIndex = FxMeditar.TRANSFO Then
- .FxIndex = 0
- End If
- End With
- If Not EstaPCarea(charindex) Then
- Call Dialogos.RemoveDialog(charindex)
- 'Call Hits.RemoveHit(CharIndex)
- End If
- If (nY < MinLimiteY) Or (nY > MaxLimiteY) Or (nX < MinLimiteX) Or (nX > MaxLimiteX) Then
- Call EraseChar(charindex)
- End If
- End Sub
- Private Function EstaPCarea(ByVal charindex As Integer) As Boolean
- With charlist(charindex).Pos
- EstaPCarea = .X > UserPos.X - MinXBorder And .X < UserPos.X + MinXBorder And .Y > UserPos.Y - MinYBorder And _
- .Y < UserPos.Y + MinYBorder
- End With
- End Function
- Public Function RemoveCharAparence(ByVal charindex As Integer, _
- ByVal Muerto As Integer, _
- ByVal Body As Integer, _
- ByVal Head As Integer, _
- ByVal Heading As E_Heading, _
- ByVal tempint As Integer, _
- ByVal tempweap As Integer, _
- ByVal tempesc As Integer, _
- ByVal Fx As Integer, _
- ByVal Loops As Integer)
- charindex = charindex
- charlist(charindex).Muerto = Muerto = 500
- If Body > NumCuerpos Then
- frmMensaje.Msg = "El body no existe."
- frmMensaje.Show , frmMain
- Exit Function
- End If
- charlist(charindex).Body = BodyData(Body)
- charlist(charindex).Head = HeadData(Head)
- charlist(charindex).Heading = Heading
- charlist(charindex).FxIndex = Fx
- charlist(charindex).Fx.Loops = Loops
- tempint = tempint
- If tempint <> 0 Then charlist(charindex).arma = WeaponAnimData(tempint)
- tempint = tempweap
- If tempint <> 0 Then charlist(charindex).Escudo = ShieldAnimData(tempint)
- tempint = tempesc
- If tempint <> 0 Then charlist(charindex).Casco = CascoAnimData(tempint)
- Call SetCharacterFx(charindex, charlist(charindex).FxIndex, charlist(charindex).Fx.Loops)
- Call RefreshAllChars
- End Function
- Public Sub Draw_FilledBox(ByVal X As Integer, _
- ByVal Y As Integer, _
- ByVal Width As Integer, _
- ByVal Height As Integer, _
- Color As Long, _
- outlinecolor As Long)
- Static box_rect As RECT
- Static Outline As RECT
- Static rgb_list(3) As Long
- Static rgb_list2(3) As Long
- Static Vertex(3) As TLVERTEX
- Static Vertex2(3) As TLVERTEX
- rgb_list(0) = Color
- rgb_list(1) = Color
- rgb_list(2) = Color
- rgb_list(3) = Color
- rgb_list2(0) = outlinecolor
- rgb_list2(1) = outlinecolor
- rgb_list2(2) = outlinecolor
- rgb_list2(3) = outlinecolor
- With box_rect
- .bottom = Y + Height - 1
- .left = X
- .Right = X + Width - 1
- .top = Y
- End With
- With Outline
- .bottom = Y + Height
- .left = X - 1
- .Right = X + Width
- .top = Y - 1
- End With
- Geometry_Create_Box Vertex2(), Outline, Outline, rgb_list2(), 0, 0
- Geometry_Create_Box Vertex(), box_rect, box_rect, rgb_list(), 0, 0
- D3DDevice.SetTexture 0, Nothing
- D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Vertex2(0), Len(Vertex2(0))
- D3DDevice.DrawPrimitiveUP D3DPT_TRIANGLESTRIP, 2, Vertex(0), Len(Vertex(0))
- End Sub
- Public Sub DrawInv()
- Static re As RECT
- re.left = 0
- re.top = 0
- re.bottom = 160
- re.Right = 160
- D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
- D3DDevice.BeginScene
- Inventario.DrawInventory
- D3DDevice.EndScene
- D3DDevice.Present re, ByVal 0, frmMain.picInv.hWnd, ByVal 0
- End Sub
- Public Sub GrhRenderToHdc(ByVal grh_index As Long, _
- desthDC As Long, _
- ByVal screen_x As Integer, _
- ByVal screen_y As Integer, _
- Optional transparent As Boolean = False)
- Dim file_path As String
- Dim src_x As Integer
- Dim src_y As Integer
- Dim src_width As Integer
- Dim src_height As Integer
- Dim hdcsrc As Long
- Dim MaskDC As Long
- Dim PrevObj As Long
- Dim PrevObj2 As Long
- If grh_index <= 0 Then Exit Sub
- 'If it's animated switch grh_index to first frame
- If GrhData(grh_index).NumFrames <> 1 Then
- grh_index = GrhData(grh_index).Frames(1)
- End If
- file_path = DirGraficos & GrhData(grh_index).FileNum & ".bmp"
- src_x = GrhData(grh_index).sX
- src_y = GrhData(grh_index).sY
- src_width = GrhData(grh_index).pixelWidth
- src_height = GrhData(grh_index).pixelHeight
- hdcsrc = CreateCompatibleDC(desthDC)
- PrevObj = SelectObject(hdcsrc, LoadPicture(file_path))
- If transparent = False Then
- BitBlt desthDC, screen_x, screen_y, src_width, src_height, hdcsrc, src_x, src_y, vbSrcCopy
- Else
- MaskDC = CreateCompatibleDC(desthDC)
- PrevObj2 = SelectObject(MaskDC, LoadPicture(file_path))
- Grh_Create_Mask hdcsrc, MaskDC, src_x, src_y, src_width, src_height
- 'Render tranparently
- BitBlt desthDC, screen_x, screen_y, src_width, src_height, MaskDC, src_x, src_y, vbSrcAnd
- BitBlt desthDC, screen_x, screen_y, src_width, src_height, hdcsrc, src_x, src_y, vbSrcPaint
- Call DeleteObject(SelectObject(MaskDC, PrevObj2))
- DeleteDC MaskDC
- End If
- Call DeleteObject(SelectObject(hdcsrc, PrevObj))
- DeleteDC hdcsrc
- Exit Sub
- End Sub
- Private Sub Draw_Grh_Sombra(ByRef grh As grh, _
- ByVal X As Integer, _
- ByVal Y As Integer, _
- ByVal Center As Byte, _
- ByVal Animate As Byte, _
- Optional ByVal Alpha As Boolean, _
- Optional ByVal angle As Single, _
- Optional ByVal Shadow As Byte = 0)
- Dim CurrentGrhIndex As Integer
- If grh.grhindex = 0 Then Exit Sub
- If Animate Then
- If grh.Started = 1 Then
- If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
- grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
- If grh.Loops <> -1 Then
- If grh.Loops > 0 Then
- grh.Loops = grh.Loops - 1
- Else
- grh.Started = 0
- End If
- End If
- End If
- End If
- End If
- 'Figure out what frame to draw (always 1 if not animated)
- CurrentGrhIndex = GrhData(grh.grhindex).Frames(grh.FrameCounter)
- 'Center Grh over X,Y pos
- If Center Then
- If GrhData(CurrentGrhIndex).TileWidth <> 1 Then
- X = X - Int(GrhData(CurrentGrhIndex).TileWidth * (32 \ 2)) + 32 \ 2
- End If
- If GrhData(grh.grhindex).TileHeight <> 1 Then
- Y = Y - Int(GrhData(CurrentGrhIndex).TileHeight * 32) + 32
- End If
- End If
- Dim shadowRgb(3) As Long
- shadowRgb(0) = 1677721600
- shadowRgb(1) = 1677721600
- shadowRgb(2) = 1677721600
- shadowRgb(3) = 1677721600
- Device_Box_Textured_Render CurrentGrhIndex, X + 5, Y + 8, (GrhData(CurrentGrhIndex).pixelWidth / 1.4), (GrhData( _
- CurrentGrhIndex).pixelHeight / 1.6), shadowRgb(), GrhData(CurrentGrhIndex).sX, GrhData( _
- CurrentGrhIndex).sY, Alpha, angle, 1
- End Sub
- '----------------------------------------PARTICULAS---------------------------------
- Private Sub Convert_Heading_to_Direction(ByVal Heading As Long, _
- ByRef direction_x As Integer, _
- ByRef direction_y As Integer)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- '
- '**************************************************************
- Dim addy As Long
- Dim addx As Long
- 'Figure out which way to move
- Select Case Heading
- Case 1
- addy = -1
- Case 2
- addx = 1
- Case 3
- addy = 1
- Case 4
- addx = -1
- End Select
- direction_x = direction_x + addx
- direction_y = direction_y + addy
- End Sub
- Private Function Particle_Group_Next_Open() As Long
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- '
- '*****************************************************************
- On Error GoTo ErrorHandler:
- Dim LoopC As Long
- If particle_group_last = 0 Then
- Particle_Group_Next_Open = 1
- Exit Function
- End If
- LoopC = 1
- Do Until particle_group_list(LoopC).active = False
- If LoopC = particle_group_last Then
- Particle_Group_Next_Open = particle_group_last + 1
- Exit Function
- End If
- LoopC = LoopC + 1
- Loop
- Particle_Group_Next_Open = LoopC
- Exit Function
- ErrorHandler:
- Particle_Group_Next_Open = 1
- End Function
- Public Function Particle_Group_Create(ByVal map_x As Integer, _
- ByVal map_y As Integer, _
- ByRef grh_index_list() As Long, _
- ByRef rgb_list() As Long, _
- Optional ByVal particle_count As Long = 20, _
- Optional ByVal stream_type As Long = 1, _
- Optional ByVal alpha_blend As Boolean, _
- Optional ByVal alive_counter As Long = -1, _
- Optional ByVal frame_speed As Single = 0.5, _
- Optional ByVal id As Long, _
- Optional ByVal X1 As Integer, _
- Optional ByVal Y1 As Integer, _
- Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, _
- Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, _
- Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, _
- Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, _
- Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, _
- Optional grav_strength As Long, _
- Optional bounce_strength As Long, _
- Optional ByVal X2 As Integer, Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer) As Long
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 12/15/2002
- 'Returns the particle_group_index if successful, else 0
- '**************************************************************
- If (map_x <> -1) And (map_y <> -1) Then
- If Map_Particle_Group_Get(map_x, map_y) = 0 Then
- Particle_Group_Create = Particle_Group_Next_Open
- Particle_Group_Make Particle_Group_Create, map_x, map_y, particle_count, stream_type, grh_index_list(), _
- rgb_list(), alpha_blend, alive_counter, frame_speed, id, X1, Y1, angle, vecx1, vecx2, vecy1, _
- vecy2, life1, life2, fric, spin_speedL, gravity, grav_strength, bounce_strength, X2, Y2, XMove, _
- move_x1, move_x2, move_y1, move_y2, YMove, spin_speedH, spin, grh_resize, grh_resizex, grh_resizey
- End If
- Else
- Particle_Group_Create = Particle_Group_Next_Open
- Particle_Group_Make Particle_Group_Create, map_x, map_y, particle_count, stream_type, grh_index_list(), _
- rgb_list(), alpha_blend, alive_counter, frame_speed, id, X1, Y1, angle, vecx1, vecx2, vecy1, vecy2, _
- life1, life2, fric, spin_speedL, gravity, grav_strength, bounce_strength, X2, Y2, XMove, move_x1, _
- move_x2, move_y1, move_y2, YMove, spin_speedH, spin, grh_resize, grh_resizex, grh_resizey
- End If
- End Function
- Public Function Particle_Group_Remove(ByVal particle_group_index As Long) As Boolean
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- '
- '*****************************************************************
- 'Make sure it's a legal index
- If Particle_Group_Check(particle_group_index) Then
- Particle_Group_Destroy particle_group_index
- Particle_Group_Remove = True
- End If
- End Function
- Public Function Particle_Group_Remove_All() As Boolean
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- '
- '*****************************************************************
- Dim Index As Long
- For Index = 1 To particle_group_last
- 'Make sure it's a legal index
- If Particle_Group_Check(Index) Then
- If Index <> SecondaryEffectIndex Then Particle_Group_Destroy Index
- ' Particle_Group_Destroy Index
- End If
- Next Index
- Particle_Group_Remove_All = True
- End Function
- Public Function Particle_Group_Find(ByVal id As Long) As Long
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- 'Find the index related to the handle
- '*****************************************************************
- On Error GoTo ErrorHandler:
- Dim LoopC As Long
- LoopC = 1
- Do Until particle_group_list(LoopC).id = id
- If LoopC = particle_group_last Then
- Particle_Group_Find = 0
- Exit Function
- End If
- LoopC = LoopC + 1
- Loop
- Particle_Group_Find = LoopC
- Exit Function
- ErrorHandler:
- Particle_Group_Find = 0
- End Function
- Private Sub Particle_Group_Make(ByVal particle_group_index As Long, _
- ByVal map_x As Integer, _
- ByVal map_y As Integer, _
- ByVal particle_count As Long, _
- ByVal stream_type As Long, _
- ByRef grh_index_list() As Long, _
- ByRef rgb_list() As Long, _
- Optional ByVal alpha_blend As Boolean, _
- Optional ByVal alive_counter As Long = -1, _
- Optional ByVal frame_speed As Single = 0.5, _
- Optional ByVal id As Long, _
- Optional ByVal X1 As Integer, _
- Optional ByVal Y1 As Integer, _
- Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, _
- Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, _
- Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, _
- Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, _
- Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, _
- Optional grav_strength As Long, _
- Optional bounce_strength As Long, Optional ByVal X2 As Integer, Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer)
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- 'Makes a new particle effect
- '*****************************************************************
- 'Update array size
- If particle_group_index > particle_group_last Then
- particle_group_last = particle_group_index
- ReDim Preserve particle_group_list(1 To particle_group_last)
- End If
- particle_group_count = particle_group_count + 1
- 'Make active
- particle_group_list(particle_group_index).active = True
- 'Map pos
- If (map_x <> -1) And (map_y <> -1) Then
- particle_group_list(particle_group_index).map_x = map_x
- particle_group_list(particle_group_index).map_y = map_y
- End If
- 'Grh list
- ReDim particle_group_list(particle_group_index).grh_index_list(1 To UBound(grh_index_list))
- particle_group_list(particle_group_index).grh_index_list() = grh_index_list()
- particle_group_list(particle_group_index).grh_index_count = UBound(grh_index_list)
- 'Sets alive vars
- If alive_counter = -1 Then
- particle_group_list(particle_group_index).alive_counter = -1
- particle_group_list(particle_group_index).never_die = True
- Else
- particle_group_list(particle_group_index).alive_counter = alive_counter
- particle_group_list(particle_group_index).never_die = False
- End If
- 'alpha blending
- particle_group_list(particle_group_index).alpha_blend = alpha_blend
- 'stream type
- particle_group_list(particle_group_index).stream_type = stream_type
- 'speed
- particle_group_list(particle_group_index).frame_speed = frame_speed
- particle_group_list(particle_group_index).X1 = X1
- particle_group_list(particle_group_index).Y1 = Y1
- particle_group_list(particle_group_index).X2 = X2
- particle_group_list(particle_group_index).Y2 = Y2
- particle_group_list(particle_group_index).angle = angle
- particle_group_list(particle_group_index).vecx1 = vecx1
- particle_group_list(particle_group_index).vecx2 = vecx2
- particle_group_list(particle_group_index).vecy1 = vecy1
- particle_group_list(particle_group_index).vecy2 = vecy2
- particle_group_list(particle_group_index).life1 = life1
- particle_group_list(particle_group_index).life2 = life2
- particle_group_list(particle_group_index).fric = fric
- particle_group_list(particle_group_index).spin = spin
- particle_group_list(particle_group_index).spin_speedL = spin_speedL
- particle_group_list(particle_group_index).spin_speedH = spin_speedH
- particle_group_list(particle_group_index).gravity = gravity
- particle_group_list(particle_group_index).grav_strength = grav_strength
- particle_group_list(particle_group_index).bounce_strength = bounce_strength
- particle_group_list(particle_group_index).XMove = XMove
- particle_group_list(particle_group_index).YMove = YMove
- particle_group_list(particle_group_index).move_x1 = move_x1
- particle_group_list(particle_group_index).move_x2 = move_x2
- particle_group_list(particle_group_index).move_y1 = move_y1
- particle_group_list(particle_group_index).move_y2 = move_y2
- particle_group_list(particle_group_index).rgb_list(0) = rgb_list(0)
- particle_group_list(particle_group_index).rgb_list(1) = rgb_list(1)
- particle_group_list(particle_group_index).rgb_list(2) = rgb_list(2)
- particle_group_list(particle_group_index).rgb_list(3) = rgb_list(3)
- particle_group_list(particle_group_index).grh_resize = grh_resize
- particle_group_list(particle_group_index).grh_resizex = grh_resizex
- particle_group_list(particle_group_index).grh_resizey = grh_resizey
- 'create particle stream
- particle_group_list(particle_group_index).particle_count = particle_count
- ReDim particle_group_list(particle_group_index).particle_stream(1 To particle_count)
- 'plot particle group on map
- If (map_x <> -1) And (map_y <> -1) Then
- MapData(map_x, map_y).particle_group = particle_group_index
- End If
- End Sub
- Private Sub Particle_Render(ByRef temp_particle As Particle, _
- ByVal screen_x As Integer, _
- ByVal screen_y As Integer, _
- ByVal grh_index As Long, _
- ByRef rgb_list() As Long, _
- Optional ByVal alpha_blend As Boolean, _
- Optional ByVal no_move As Boolean, _
- Optional ByVal X1 As Integer, _
- Optional ByVal Y1 As Integer, _
- Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, _
- Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, _
- Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, _
- Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, _
- Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, _
- Optional grav_strength As Long, _
- Optional ByVal bounce_strength As Long, _
- Optional ByVal X2 As Integer, _
- Optional ByVal Y2 As Integer, _
- Optional ByVal XMove As Boolean, _
- Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 4/24/2003
- '
- '**************************************************************
- If no_move = False Then
- If temp_particle.alive_counter = 0 Then
- InitGrh temp_particle.grh, grh_index, alpha_blend
- temp_particle.X = RandomNumber(X1, X2)
- temp_particle.Y = RandomNumber(Y1, Y2)
- temp_particle.vector_x = RandomNumber(vecx1, vecx2)
- temp_particle.vector_y = RandomNumber(vecy1, vecy2)
- temp_particle.angle = angle
- temp_particle.alive_counter = RandomNumber(life1, life2)
- temp_particle.friction = fric
- Else
- 'Continue old particle
- 'Do gravity
- If gravity = True Then
- temp_particle.vector_y = temp_particle.vector_y + grav_strength
- If temp_particle.Y > 0 Then
- 'bounce
- temp_particle.vector_y = bounce_strength
- End If
- End If
- 'Do rotation
- If spin = True Then temp_particle.grh.angle = temp_particle.grh.angle + (RandomNumber(spin_speedL, _
- spin_speedH) / 100)
- If temp_particle.angle >= 360 Then
- temp_particle.angle = 0
- End If
- If XMove = True Then temp_particle.vector_x = RandomNumber(move_x1, move_x2)
- If YMove = True Then temp_particle.vector_y = RandomNumber(move_y1, move_y2)
- End If
- 'Add in vector
- temp_particle.X = temp_particle.X + (temp_particle.vector_x \ temp_particle.friction)
- temp_particle.Y = temp_particle.Y + (temp_particle.vector_y \ temp_particle.friction)
- 'decrement counter
- temp_particle.alive_counter = temp_particle.alive_counter - 1
- End If
- 'Draw it
- If grh_resize = True Then
- If temp_particle.grh.grhindex Then
- Grh_Render_Advance temp_particle.grh, temp_particle.X + screen_x, temp_particle.Y + screen_y, _
- grh_resizex, grh_resizey, rgb_list(), True, True, alpha_blend
- Exit Sub
- End If
- End If
- 'Draw it
- If temp_particle.grh.grhindex Then
- Grh_Render temp_particle.grh, temp_particle.X + screen_x, temp_particle.Y + screen_y, rgb_list(), 1, False, _
- True, True
- End If
- End Sub
- Private Sub Particle_Group_Render(ByVal particle_group_index As Long, _
- ByVal screen_x As Integer, _
- ByVal screen_y As Integer)
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 12/15/2002
- 'Renders a particle stream at a paticular screen point
- '*****************************************************************
- Dim LoopC As Long
- Dim temp_rgb(0 To 3) As Long
- Dim no_move As Boolean
- 'Set colors
- temp_rgb(0) = particle_group_list(particle_group_index).rgb_list(0)
- temp_rgb(1) = particle_group_list(particle_group_index).rgb_list(1)
- temp_rgb(2) = particle_group_list(particle_group_index).rgb_list(2)
- temp_rgb(3) = particle_group_list(particle_group_index).rgb_list(3)
- If particle_group_list(particle_group_index).alive_counter Then
- 'See if it is time to move a particle
- particle_group_list(particle_group_index).frame_counter = particle_group_list( _
- particle_group_index).frame_counter + timerTicksPerFrame
- If particle_group_list(particle_group_index).frame_counter > particle_group_list( _
- particle_group_index).frame_speed Then
- particle_group_list(particle_group_index).frame_counter = 0
- no_move = False
- Else
- no_move = True
- End If
- 'If it's still alive render all the particles inside
- For LoopC = 1 To particle_group_list(particle_group_index).particle_count
- 'Render particle
- Particle_Render particle_group_list(particle_group_index).particle_stream(LoopC), screen_x, screen_y, _
- particle_group_list(particle_group_index).grh_index_list(Round(RandomNumber(1, _
- particle_group_list(particle_group_index).grh_index_count), 0)), temp_rgb(), particle_group_list( _
- particle_group_index).alpha_blend, no_move, particle_group_list(particle_group_index).X1, _
- particle_group_list(particle_group_index).Y1, particle_group_list(particle_group_index).angle, _
- particle_group_list(particle_group_index).vecx1, particle_group_list(particle_group_index).vecx2, _
- particle_group_list(particle_group_index).vecy1, particle_group_list(particle_group_index).vecy2, _
- particle_group_list(particle_group_index).life1, particle_group_list(particle_group_index).life2, _
- particle_group_list(particle_group_index).fric, particle_group_list( _
- particle_group_index).spin_speedL, particle_group_list(particle_group_index).gravity, _
- particle_group_list(particle_group_index).grav_strength, particle_group_list( _
- particle_group_index).bounce_strength, particle_group_list(particle_group_index).X2, _
- particle_group_list(particle_group_index).Y2, particle_group_list(particle_group_index).XMove, _
- particle_group_list(particle_group_index).move_x1, particle_group_list( _
- particle_group_index).move_x2, particle_group_list(particle_group_index).move_y1, _
- particle_group_list(particle_group_index).move_y2, particle_group_list( _
- particle_group_index).YMove, particle_group_list(particle_group_index).spin_speedH, _
- particle_group_list(particle_group_index).spin, particle_group_list( _
- particle_group_index).grh_resize, particle_group_list(particle_group_index).grh_resizex, _
- particle_group_list(particle_group_index).grh_resizey
- Next LoopC
- If no_move = False Then
- 'Update the group alive counter
- If particle_group_list(particle_group_index).never_die = False Then
- particle_group_list(particle_group_index).alive_counter = particle_group_list( _
- particle_group_index).alive_counter - 1
- End If
- End If
- Else
- 'If it's dead destroy it
- particle_group_list(particle_group_index).particle_count = particle_group_list( _
- particle_group_index).particle_count - 1
- If particle_group_list(particle_group_index).particle_count <= 0 Then Particle_Group_Destroy _
- particle_group_index
- End If
- End Sub
- Public Function Particle_Type_Get(ByVal particle_index As Long) As Long
- '*****************************************************************
- 'Author: Juan Martín Sotuyo Dodero ([URL='mailto:juansotuyo@hotmail.com']juansotuyo@hotmail.com[/URL])
- 'Last Modify Date: 8/27/2003
- 'Returns the stream type of a particle stream
- '*****************************************************************
- If Particle_Group_Check(particle_index) Then
- Particle_Type_Get = particle_group_list(particle_index).stream_type
- End If
- End Function
- Private Function Particle_Group_Check(ByVal particle_group_index As Long) As Boolean
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 1/04/2003
- '
- '**************************************************************
- 'check index
- If particle_group_index > 0 And particle_group_index <= particle_group_last Then
- If particle_group_list(particle_group_index).active Then
- Particle_Group_Check = True
- End If
- End If
- End Function
- Public Function Particle_Group_Map_Pos_Set(ByVal particle_group_index As Long, _
- ByVal map_x As Long, _
- ByVal map_y As Long) As Boolean
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 5/27/2003
- 'Returns true if successful, else false
- '**************************************************************
- 'Make sure it's a legal index
- If Particle_Group_Check(particle_group_index) Then
- 'Make sure it's a legal move
- If InMapBounds(map_x, map_y) Then
- 'Move it
- particle_group_list(particle_group_index).map_x = map_x
- particle_group_list(particle_group_index).map_y = map_y
- Particle_Group_Map_Pos_Set = True
- End If
- End If
- End Function
- Public Function Particle_Group_Move(ByVal particle_group_index As Long, _
- ByVal Heading As Long) As Boolean
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 5/27/2003
- 'Returns true if successful, else false
- '**************************************************************
- Dim map_x As Long
- Dim map_y As Long
- Dim nX As Integer
- Dim nY As Integer
- 'Check for valid heading
- If Heading < 1 Or Heading > 8 Then
- Particle_Group_Move = False
- Exit Function
- End If
- 'Make sure it's a legal index
- If Particle_Group_Check(particle_group_index) Then
- map_x = particle_group_list(particle_group_index).map_x
- map_y = particle_group_list(particle_group_index).map_y
- nX = map_x
- nY = map_y
- Convert_Heading_to_Direction Heading, nX, nY
- 'Make sure it's a legal move
- If InMapBounds(nX, nY) Then
- 'Move it
- particle_group_list(particle_group_index).map_x = nX
- particle_group_list(particle_group_index).map_y = nY
- Particle_Group_Move = True
- End If
- End If
- End Function
- Private Sub Particle_Group_Destroy(ByVal particle_group_index As Long)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 10/07/2002
- '
- '**************************************************************
- Dim Temp As particle_group
- Dim I As Integer
- If particle_group_list(particle_group_index).map_x > 0 And particle_group_list(particle_group_index).map_y > 0 Then
- MapData(particle_group_list(particle_group_index).map_x, particle_group_list( _
- particle_group_index).map_y).particle_group = 0
- ElseIf particle_group_list(particle_group_index).char_index Then
- If Char_Check(particle_group_list(particle_group_index).char_index) Then
- For I = 1 To charlist(particle_group_list(particle_group_index).char_index).particle_count
- If charlist(particle_group_list(particle_group_index).char_index).particle_group(I) = _
- particle_group_index Then
- charlist(particle_group_list(particle_group_index).char_index).particle_group(I) = 0
- Exit For
- End If
- Next I
- End If
- ElseIf particle_group_index = SecondaryEffectIndex Then
- SecondaryEffectIndex = 0
- End If
- particle_group_list(particle_group_index) = Temp
- 'Update array size
- If particle_group_index = particle_group_last Then
- Do Until particle_group_list(particle_group_last).active
- particle_group_last = particle_group_last - 1
- If particle_group_last = 0 Then
- particle_group_count = 0
- Exit Sub
- End If
- Loop
- ReDim Preserve particle_group_list(1 To particle_group_last)
- End If
- particle_group_count = particle_group_count - 1
- End Sub
- Private Sub Char_Particle_Group_Make(ByVal particle_group_index As Long, _
- ByVal char_index As Integer, _
- ByVal particle_char_index As Integer, _
- ByVal particle_count As Long, _
- ByVal stream_type As Long, _
- ByRef grh_index_list() As Long, _
- ByRef rgb_list() As Long, _
- Optional ByVal alpha_blend As Boolean, _
- Optional ByVal alive_counter As Long = -1, _
- Optional ByVal frame_speed As Single = 0.5, _
- Optional ByVal id As Long, _
- Optional ByVal X1 As Integer, _
- Optional ByVal Y1 As Integer, _
- Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, _
- Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, _
- Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, _
- Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, _
- Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, _
- Optional grav_strength As Long, _
- Optional bounce_strength As Long, Optional ByVal X2 As Integer, Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer)
- '*****************************************************************
- 'Author: Aaron Perkins
- 'Modified by: Ryan Cain (Onezero)
- 'Last Modify Date: 5/15/2003
- 'Makes a new particle effect
- 'Modified by Juan Martín Sotuyo Dodero
- '*****************************************************************
- 'Update array size
- If particle_group_index > particle_group_last Then
- particle_group_last = particle_group_index
- ReDim Preserve particle_group_list(1 To particle_group_last)
- End If
- particle_group_count = particle_group_count + 1
- 'Make active
- particle_group_list(particle_group_index).active = True
- 'Char index
- particle_group_list(particle_group_index).char_index = char_index
- 'Grh list
- ReDim particle_group_list(particle_group_index).grh_index_list(1 To UBound(grh_index_list))
- particle_group_list(particle_group_index).grh_index_list() = grh_index_list()
- particle_group_list(particle_group_index).grh_index_count = UBound(grh_index_list)
- 'Sets alive vars
- If alive_counter = -1 Then
- particle_group_list(particle_group_index).alive_counter = -1
- particle_group_list(particle_group_index).never_die = True
- Else
- particle_group_list(particle_group_index).alive_counter = alive_counter
- particle_group_list(particle_group_index).never_die = False
- End If
- 'alpha blending
- particle_group_list(particle_group_index).alpha_blend = alpha_blend
- 'stream type
- particle_group_list(particle_group_index).stream_type = stream_type
- 'speed
- particle_group_list(particle_group_index).frame_speed = frame_speed
- particle_group_list(particle_group_index).X1 = X1
- particle_group_list(particle_group_index).Y1 = Y1
- particle_group_list(particle_group_index).X2 = X2
- particle_group_list(particle_group_index).Y2 = Y2
- particle_group_list(particle_group_index).angle = angle
- particle_group_list(particle_group_index).vecx1 = vecx1
- particle_group_list(particle_group_index).vecx2 = vecx2
- particle_group_list(particle_group_index).vecy1 = vecy1
- particle_group_list(particle_group_index).vecy2 = vecy2
- particle_group_list(particle_group_index).life1 = life1
- particle_group_list(particle_group_index).life2 = life2
- particle_group_list(particle_group_index).fric = fric
- particle_group_list(particle_group_index).spin = spin
- particle_group_list(particle_group_index).spin_speedL = spin_speedL
- particle_group_list(particle_group_index).spin_speedH = spin_speedH
- particle_group_list(particle_group_index).gravity = gravity
- particle_group_list(particle_group_index).grav_strength = grav_strength
- particle_group_list(particle_group_index).bounce_strength = bounce_strength
- particle_group_list(particle_group_index).XMove = XMove
- particle_group_list(particle_group_index).YMove = YMove
- particle_group_list(particle_group_index).move_x1 = move_x1
- particle_group_list(particle_group_index).move_x2 = move_x2
- particle_group_list(particle_group_index).move_y1 = move_y1
- particle_group_list(particle_group_index).move_y2 = move_y2
- 'color
- particle_group_list(particle_group_index).rgb_list(0) = rgb_list(0)
- particle_group_list(particle_group_index).rgb_list(1) = rgb_list(1)
- particle_group_list(particle_group_index).rgb_list(2) = rgb_list(2)
- particle_group_list(particle_group_index).rgb_list(3) = rgb_list(3)
- particle_group_list(particle_group_index).grh_resize = grh_resize
- particle_group_list(particle_group_index).grh_resizex = grh_resizex
- particle_group_list(particle_group_index).grh_resizey = grh_resizey
- 'handle
- particle_group_list(particle_group_index).id = id
- 'create particle stream
- particle_group_list(particle_group_index).particle_count = particle_count
- ReDim particle_group_list(particle_group_index).particle_stream(1 To particle_count)
- 'plot particle group on char
- charlist(char_index).particle_group(particle_char_index) = particle_group_index
- End Sub
- Public Function Char_Particle_Group_Create(ByVal char_index As Integer, _
- ByRef grh_index_list() As Long, _
- ByRef rgb_list() As Long, _
- Optional ByVal particle_count As Long = 20, _
- Optional ByVal stream_type As Long = 1, _
- Optional ByVal alpha_blend As Boolean, _
- Optional ByVal alive_counter As Long = -1, _
- Optional ByVal frame_speed As Single = 0.5, _
- Optional ByVal id As Long, _
- Optional ByVal X1 As Integer, _
- Optional ByVal Y1 As Integer, _
- Optional ByVal angle As Integer, _
- Optional ByVal vecx1 As Integer, _
- Optional ByVal vecx2 As Integer, _
- Optional ByVal vecy1 As Integer, _
- Optional ByVal vecy2 As Integer, _
- Optional ByVal life1 As Integer, _
- Optional ByVal life2 As Integer, _
- Optional ByVal fric As Integer, _
- Optional ByVal spin_speedL As Single, _
- Optional ByVal gravity As Boolean, _
- Optional grav_strength As Long, _
- Optional bounce_strength As Long, _
- Optional ByVal X2 As Integer, _
- Optional ByVal Y2 As Integer, Optional ByVal XMove As Boolean, Optional ByVal move_x1 As Integer, Optional ByVal move_x2 As Integer, Optional ByVal move_y1 As Integer, Optional ByVal move_y2 As Integer, Optional ByVal YMove As Boolean, Optional ByVal spin_speedH As Single, Optional ByVal spin As Boolean, Optional grh_resize As Boolean, Optional grh_resizex As Integer, Optional grh_resizey As Integer) As Long
- '**************************************************************
- 'Author: Augusto José Rando
- '**************************************************************
- Dim char_part_free_index As Integer
- 'If Char_Particle_Group_Find(char_index, stream_type) Then Exit Function ' hay que ver si dejar o sacar esto...
- If Not Char_Check(char_index) Then Exit Function
- char_part_free_index = Char_Particle_Group_Next_Open(char_index)
- If char_part_free_index > 0 Then
- Char_Particle_Group_Create = Particle_Group_Next_Open
- Char_Particle_Group_Make Char_Particle_Group_Create, char_index, char_part_free_index, particle_count, _
- stream_type, grh_index_list(), rgb_list(), alpha_blend, alive_counter, frame_speed, id, X1, Y1, _
- angle, vecx1, vecx2, vecy1, vecy2, life1, life2, fric, spin_speedL, gravity, grav_strength, _
- bounce_strength, X2, Y2, XMove, move_x1, move_x2, move_y1, move_y2, YMove, spin_speedH, spin, _
- grh_resize, grh_resizex, grh_resizey
- End If
- End Function
- Private Function Char_Particle_Group_Find(ByVal char_index As Integer, _
- ByVal stream_type As Long) As Integer
- '*****************************************************************
- 'Author: Augusto José Rando
- 'Modified: returns slot or -1
- '*****************************************************************
- Dim I As Integer
- For I = 1 To charlist(char_index).particle_count
- If particle_group_list(charlist(char_index).particle_group(I)).stream_type = stream_type Then
- Char_Particle_Group_Find = charlist(char_index).particle_group(I)
- Exit Function
- End If
- Next I
- Char_Particle_Group_Find = -1
- End Function
- Private Function Char_Particle_Group_Next_Open(ByVal char_index As Integer) As Integer
- '*****************************************************************
- 'Author: Augusto José Rando
- '*****************************************************************
- On Error GoTo ErrorHandler:
- Dim LoopC As Long
- If charlist(char_index).particle_count = 0 Then
- charlist(char_index).particle_count = 1
- ReDim charlist(char_index).particle_group(1 To 1) As Long
- Char_Particle_Group_Next_Open = 1
- Exit Function
- End If
- LoopC = 1
- Do Until charlist(char_index).particle_group(LoopC) = 0
- If LoopC = charlist(char_index).particle_count Then
- Char_Particle_Group_Next_Open = charlist(char_index).particle_count + 1
- charlist(char_index).particle_count = Char_Particle_Group_Next_Open
- ReDim Preserve charlist(char_index).particle_group(1 To Char_Particle_Group_Next_Open) As Long
- Exit Function
- End If
- LoopC = LoopC + 1
- Loop
- Char_Particle_Group_Next_Open = LoopC
- Exit Function
- ErrorHandler:
- charlist(char_index).particle_count = 1
- ReDim charlist(char_index).particle_group(1 To 1) As Long
- Char_Particle_Group_Next_Open = 1
- End Function
- Public Function Char_Particle_Group_Remove(ByVal char_index As Integer, _
- ByVal stream_type As Long)
- '**************************************************************
- 'Author: Augusto José Rando
- '**************************************************************
- Dim char_part_index As Integer
- If Char_Check(char_index) Then
- char_part_index = Char_Particle_Group_Find(char_index, stream_type)
- If char_part_index = -1 Then Exit Function
- Call Particle_Group_Remove(char_part_index)
- End If
- End Function
- Public Function Char_Particle_Group_Remove_All(ByVal char_index As Integer)
- '**************************************************************
- 'Author: Augusto José Rando
- '**************************************************************
- Dim I As Integer
- If Char_Check(char_index) Then
- For I = 1 To charlist(char_index).particle_count
- If charlist(char_index).particle_group(I) <> 0 Then Call Particle_Group_Remove(charlist( _
- char_index).particle_group(I))
- Next I
- End If
- End Function
- Public Function Map_Particle_Group_Get(ByVal map_x As Integer, _
- ByVal map_y As Integer) As Long
- If InMapBounds(map_x, map_y) Then
- Map_Particle_Group_Get = MapData(map_x, map_y).particle_group
- Else
- Map_Particle_Group_Get = 0
- End If
- End Function
- Private Sub Grh_Render_Advance(ByRef grh As grh, _
- ByVal screen_x As Integer, _
- ByVal screen_y As Integer, _
- ByVal Height As Integer, _
- ByVal Width As Integer, _
- ByRef rgb_list() As Long, _
- Optional ByVal h_center As Boolean, _
- Optional ByVal v_center As Boolean, _
- Optional ByVal alpha_blend As Boolean = False)
- '**************************************************************
- 'Author: Juan Martín Sotuyo Dodero ([URL='mailto:juansotuyo@hotmail.com']juansotuyo@hotmail.com[/URL])
- 'Last Modify Date: 11/19/2003
- 'Similar to Grh_Render, but let´s you resize the Grh
- '**************************************************************
- Dim tile_width As Integer
- Dim tile_height As Integer
- Dim grh_index As Long
- 'Animation
- If grh.Started Then
- grh.FrameCounter = grh.FrameCounter + (timerTicksPerFrame * grh.Speed)
- If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
- 'If Grh.noloop Then
- ' Grh.FrameCounter = GrhData(Grh.GrhIndex).NumFrames
- 'Else
- grh.FrameCounter = 1
- 'End If
- End If
- End If
- 'Figure out what frame to draw (always 1 if not animated)
- If grh.FrameCounter = 0 Then grh.FrameCounter = 1
- grh_index = GrhData(grh.grhindex).Frames(grh.FrameCounter)
- 'Center Grh over X, Y pos
- If GrhData(grh.grhindex).TileWidth <> 1 Then
- screen_x = screen_x - Int(GrhData(grh.grhindex).TileWidth * (32 \ 2)) + 32 \ 2
- End If
- If GrhData(grh.grhindex).TileHeight <> 1 Then
- screen_y = screen_y - Int(GrhData(grh.grhindex).TileHeight * 32) + 32
- End If
- 'Draw it to device
- Device_Box_Textured_Render_Advance grh_index, screen_x, screen_y, GrhData(grh_index).pixelWidth, GrhData( _
- grh_index).pixelHeight, rgb_list, GrhData(grh_index).sX, GrhData(grh_index).sY, Width, Height, _
- alpha_blend ', grh.angle
- End Sub
- Private Function Char_Check(ByVal char_index As Integer) As Boolean
- 'check char_index
- If char_index > 0 And char_index <= LastChar Then
- Char_Check = (charlist(char_index).Heading > 0)
- End If
- End Function
- Private Sub Grh_Render(ByRef grh As grh, _
- ByVal screen_x As Integer, _
- ByVal screen_y As Integer, _
- ByRef rgb_list() As Long, _
- Optional ByVal h_centered As Boolean = True, _
- Optional ByVal v_centered As Boolean = True, _
- Optional ByVal alpha_blend As Boolean = False, _
- Optional ByVal KillAnim As Boolean = 0)
- '**************************************************************
- 'Author: Aaron Perkins
- 'Last Modify Date: 2/28/2003
- 'Modified by Juan Martín Sotuyo Dodero
- 'Added centering
- '**************************************************************
- On Error Resume Next
- Dim tile_width As Integer
- Dim tile_height As Integer
- Dim grh_index As Long
- If grh.grhindex = 0 Then Exit Sub
- 'Animation
- If grh.Started = 1 Then
- grh.FrameCounter = grh.FrameCounter + (timerElapsedTime * GrhData(grh.grhindex).NumFrames / grh.Speed)
- If grh.FrameCounter > GrhData(grh.grhindex).NumFrames Then
- grh.FrameCounter = (grh.FrameCounter Mod GrhData(grh.grhindex).NumFrames) + 1
- If grh.Loops <> -1 Then
- If grh.Loops > 0 Then
- grh.Loops = grh.Loops - 1
- Else
- grh.Started = 0
- End If
- End If
- End If
- End If
- 'Figure out what frame to draw (always 1 if not animated)
- If grh.FrameCounter = 0 Then grh.FrameCounter = 1
- 'If Not Grh_Check(Grh.grhindex) Then Exit Sub
- grh_index = GrhData(grh.grhindex).Frames(grh.FrameCounter)
- If grh_index <= 0 Then Exit Sub
- If GrhData(grh_index).FileNum = 0 Then Exit Sub
- 'Modified by Augusto José Rando
- 'Simplier function - according to basic ORE engine
- If h_centered Then
- If GrhData(grh.grhindex).TileWidth <> 1 Then
- screen_x = screen_x - Int(GrhData(grh.grhindex).TileWidth * (32 \ 2)) + 32 \ 2
- End If
- End If
- If v_centered Then
- If GrhData(grh.grhindex).TileHeight <> 1 Then
- screen_y = screen_y - Int(GrhData(grh.grhindex).TileHeight * 32) + 32
- End If
- End If
- 'Draw it to device
- Device_Box_Textured_Render grh_index, screen_x, screen_y, GrhData(grh_index).pixelWidth, GrhData( _
- grh_index).pixelHeight, rgb_list(), GrhData(grh_index).sX, GrhData(grh_index).sY, alpha_blend
- End Sub
- Private Sub Grh_Create_Mask(ByRef hdcsrc As Long, _
- ByRef MaskDC As Long, _
- ByVal src_x As Integer, _
- ByVal src_y As Integer, _
- ByVal src_width As Integer, _
- ByVal src_height As Integer)
- Dim X As Integer
- Dim Y As Integer
- Dim TransColor As Long
- Dim ColorKey As String
- ColorKey = "0"
- TransColor = &H0
- 'Make it a mask (set background to black and foreground to white)
- 'And set the sprite's background white
- For Y = src_y To src_height + src_y
- For X = src_x To src_width + src_x
- If GetPixel(hdcsrc, X, Y) = TransColor Then
- SetPixel MaskDC, X, Y, vbWhite
- SetPixel hdcsrc, X, Y, vbBlack
- Else
- SetPixel MaskDC, X, Y, vbBlack
- End If
- Next X
- Next Y
- End Sub
- '---------------------------------------FIN PARTICULAS-------------------------------
- Public Sub Render()
- '*****************************************************
- '****** Coded by Menduz ([email=lord.yo.wo@gmail.com]lord.yo.wo@gmail.com[/email]) *******
- '*****************************************************
- Static dre As RECT
- dre.left = 0
- dre.top = 0
- dre.bottom = 407
- dre.Right = 522
- D3DDevice.BeginScene
- D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
- ShowNextFrame
- frmMain.FpsMain.Caption = FPS
- 'SendData "FPS " & FPS
- Call Dialogos.Render
- Call DialogosClanes.Draw
- D3DDevice.EndScene
- D3DDevice.Present dre, ByVal 0, frmMain.renderer.hWnd, ByVal 0
- End Sub
- Public Sub DibujarConectar()
- D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
- D3DDevice.BeginScene
- Dim X As Long
- Dim Y As Long
- '// Draw layer 1
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- 'Layer 1 **********************************
- If .Graphic(1).grhindex <> 0 Then
- Call Draw_Grh(.Graphic(1), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- ' Call Draw_Grh(.Graphic(1), (X - 1) * 32, _
- (Y - 1) * 32, 1, 0, , X, Y)
- End If
- '******************************************
- End With
- Next X
- Next Y
- 'capa2
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- If .Graphic(2).grhindex <> 0 Then
- Call Draw_Grh(.Graphic(2), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- 'Call Draw_Grh(.Graphic(2), (X - 1) * 32, _
- (Y - 1) * 32, 1, 0, , X, Y)
- End If
- End With
- Next X
- Next Y
- 'objeto
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- If .ObjGrh.grhindex <> 0 Then
- 'Call Draw_Grh(.Graphic(3), (X - 1) * 32, (Y - 1) * 32, 60, 30, , 37 + X, 23 + Y)
- Call Draw_Grh(.ObjGrh, (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- End If
- End With
- Next X
- Next Y
- 'capa3
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- If .Graphic(3).grhindex <> 0 Then
- Call Draw_Grh(.Graphic(3), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- 'Call Draw_Grh(.Graphic(3), (X - 1) * 32, _
- (Y - 1) * 32, 1, 0, , X, Y)
- End If
- End With
- Next X
- Next Y
- 'particulas
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- '***********************************************
- If .particle_group > 0 Then
- Particle_Group_Render .particle_group, (X - 1) * 32, (Y - 1) * 32
- End If
- End With
- Next X
- Next Y
- Static re As RECT
- re.left = 0
- re.top = 0
- re.bottom = 600
- re.Right = 800
- Call Draw_Grhindex(31623, 0, 0)
- If ButtonLogin = "Iluminado" Then
- Call Draw_Grhindex(31625, 338, 340)
- ElseIf ButtonLogin = "Normal" Then
- Call Draw_Grhindex(31624, 338, 340)
- End If
- If ButtonRecuperar = "Iluminado" Then
- Call Draw_Grhindex(31627, 175, 542)
- ElseIf ButtonRecuperar = "Normal" Then
- Call Draw_Grhindex(31626, 175, 542)
- End If
- If ButtonCrear = "Iluminado" Then
- Call Draw_Grhindex(31629, 343, 542)
- ElseIf ButtonCrear = "Normal" Then
- Call Draw_Grhindex(31628, 343, 542)
- End If
- If ButtonWeb = "Iluminado" Then
- Call Draw_Grhindex(31631, 510, 542)
- ElseIf ButtonWeb = "Normal" Then
- Call Draw_Grhindex(31630, 510, 542)
- End If
- Call Draw_Grhindex(22656, 180, 430)
- Call Draw_Grhindex(22656, 600, 430)
- If ClickeoTextCuenta = True Then
- If (BarritaTextConnect / 2) = Int((BarritaTextConnect / 2)) Then
- Draw_FilledBox 415 + (Len(TextBoxCuenta) * 3.4), 240, 1, 11, D3DColorARGB(100, 255, 255, 0), D3DColorARGB( _
- 100, 255, 255, 0)
- End If
- ElseIf ClickeoTextPassw = True Then
- If (BarritaTextConnect / 2) = Int((BarritaTextConnect / 2)) Then
- Draw_FilledBox 415 + (Len(TextBoxPassw) * 3.4), 305, 1, 11, D3DColorARGB(100, 255, 255, 0), D3DColorARGB( _
- 100, 255, 255, 0)
- End If
- End If
- If ClickeoTextCuenta = True Then
- Text_Render font_list(1), TextBoxCuenta, 240, 330, 169, 21, D3DColorARGB(200, 164, 161, 69), DT_CENTER, True
- Else
- Text_Render font_list(1), TextBoxCuenta, 240, 330, 169, 21, D3DColorARGB(200, 164, 161, 160), DT_CENTER, True
- End If
- If ClickeoTextPassw = True Then
- Text_Render font_list(1), TextBoxPasswR, 305, 330, 169, 21, D3DColorARGB(200, 164, 161, 69), DT_CENTER, True
- Else
- Text_Render font_list(1), TextBoxPasswR, 305, 330, 169, 21, D3DColorARGB(200, 164, 161, 160), DT_CENTER, True
- End If
- 'Text_Render font_list(1), "Millenium Ao 2016", 587, 360, 110, 20, D3DColorARGB(255, 255, 255, 0), DT_TOP Or DT_LEFT, True
- 'Text_Render font_list(1), "Fps:" & FPS, 50, 30, 50, 20, D3DColorARGB(255, 255, 255, 1), DT_TOP Or DT_LEFT, True
- ' Light.Create_Light_To_Map 50, 32, 22, 25, 25, 25
- ' Light.Create_Light_To_Map 50, 32, 7, 25, 25, 25
- ' Light.Create_Light_To_Map 45, 32, 5, 25, 25, 25
- ' Light.Create_Light_To_Map 55, 32, 5, 25, 25, 25
- ' Light.Create_Light_To_Map 50, 36, 5, 25, 25, 25
- 'Light.Create_Light_To_Map 48, 36, 4, 25, 25, 25
- 'Light.Light_Render_All
- D3DDevice.EndScene
- D3DDevice.Present re, ByVal 0, FrmConnect.renderer.hWnd, ByVal 0
- End Sub
- Public Sub DibujarCrearpj()
- D3DDevice.Clear 0, ByVal 0, D3DCLEAR_TARGET, 0, 0, 0
- D3DDevice.BeginScene
- Dim X As Long
- Dim Y As Long
- '// Draw layer 1
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- 'Layer 1 **********************************
- If .Graphic(1).grhindex <> 0 Then
- Call Draw_Grh(.Graphic(1), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- End If
- '******************************************
- End With
- Next X
- Next Y
- 'capa2
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- If .Graphic(2).grhindex <> 0 Then
- Call Draw_Grh(.Graphic(2), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- End If
- End With
- Next X
- Next Y
- 'objeto
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- If .ObjGrh.grhindex <> 0 Then
- Call Draw_Grh(.ObjGrh, (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- End If
- End With
- Next X
- Next Y
- 'capa3
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- If .Graphic(3).grhindex <> 0 Then
- Call Draw_Grh(.Graphic(3), (X - 1) * 32, (Y - 1) * 32, 1, 0, color_Conectar)
- End If
- End With
- Next X
- Next Y
- 'particulas
- For Y = 1 To 19
- For X = 1 To 25
- With MapData(37 + X, 70 + Y)
- '***********************************************
- If .particle_group > 0 Then
- Particle_Group_Render .particle_group, (X - 1) * 32, (Y - 1) * 32
- End If
- End With
- Next X
- Next Y
- Static re As RECT
- re.left = 0
- re.top = 0
- re.bottom = 600
- re.Right = 800
- With FrmCrearPj
- 'Botones y Main
- Call Draw_Grhindex(28979, .Main.left, .Main.top)
- Call Draw_Grhindex(28982, .CrearPersonaje.left, .CrearPersonaje.top)
- Call Draw_Grhindex(28985, .Volver.left, .Volver.top)
- If BotonCrearArriba = 1 Then
- Call Draw_Grhindex(28981, .CrearPersonaje.left, .CrearPersonaje.top)
- Call Draw_Grhindex(28985, .Volver.left, .Volver.top)
- End If
- If BotonCrearApretado = 1 Then
- Call Draw_Grhindex(28980, .CrearPersonaje.left, .CrearPersonaje.top)
- Call Draw_Grhindex(28985, .Volver.left, .Volver.top)
- End If
- If BotonVolverArriba = 1 Then
- Call Draw_Grhindex(28982, .CrearPersonaje.left, .CrearPersonaje.top)
- Call Draw_Grhindex(28984, .Volver.left, .Volver.top)
- End If
- If BotonVolverApretado = 1 Then
- Call Draw_Grhindex(28982, .CrearPersonaje.left, .CrearPersonaje.top)
- Call Draw_Grhindex(28983, .Volver.left, .Volver.top)
- End If
- 'Genero
- Call Draw_Grhindex(28974, .Hombre.left, .Hombre.top)
- Call Draw_Grhindex(28976, .Mujer.left, .Mujer.top)
- 'Genero Clickeado
- If SexoClickeado = "Hombre" Then
- Call Draw_Grhindex(28973, .Hombre.left, .Hombre.top)
- Call Draw_Grhindex(28976, .Mujer.left, .Mujer.top)
- End If
- If SexoClickeado = "Mujer" Then
- Call Draw_Grhindex(28975, .Mujer.left, .Mujer.top)
- Call Draw_Grhindex(28974, .Hombre.left, .Hombre.top)
- End If
- 'Raza
- Call Draw_Grhindex(28972, .Humano.left, .Humano.top)
- Call Draw_Grhindex(28964, .Elfo.left, .Elfo.top)
- Call Draw_Grhindex(28966, .ElfoOscuro.left, .ElfoOscuro.top)
- Call Draw_Grhindex(28968, .Enano.left, .Enano.top)
- Call Draw_Grhindex(28970, .Gnomo.left, .Gnomo.top)
- 'Raza clickeada
- If RazaClickeada = "Humano" Then
- Call Draw_Grhindex(28971, .Humano.left, .Humano.top)
- End If
- If RazaClickeada = "Elfo" Then
- Call Draw_Grhindex(28963, .Elfo.left, .Elfo.top)
- End If
- If RazaClickeada = "Elfo Oscuro" Then
- Call Draw_Grhindex(28965, .ElfoOscuro.left, .ElfoOscuro.top)
- End If
- If RazaClickeada = "Enano" Then
- Call Draw_Grhindex(28967, .Enano.left, .Enano.top)
- End If
- If RazaClickeada = "Gnomo" Then
- Call Draw_Grhindex(28969, .Gnomo.left, .Gnomo.top)
- End If
- 'Raza clickeada anterior
- If RazaClickeadaAnterior = "Humano" Then
- Call Draw_Grhindex(28972, .Humano.left, .Humano.top)
- End If
- If RazaClickeadaAnterior = "Elfo" Then
- Call Draw_Grhindex(28964, .Elfo.left, .Elfo.top)
- End If
- If RazaClickeadaAnterior = "Elfo Oscuro" Then
- Call Draw_Grhindex(28966, .ElfoOscuro.left, .ElfoOscuro.top)
- End If
- If RazaClickeadaAnterior = "Enano" Then
- Call Draw_Grhindex(28968, .Enano.left, .Enano.top)
- End If
- If RazaClickeadaAnterior = "Gnomo" Then
- Call Draw_Grhindex(28970, .Gnomo.left, .Gnomo.top)
- End If
- 'Clase
- Call Draw_Grhindex(28954, .Mago.left, .Mago.top)
- Call Draw_Grhindex(28952, .Guerrero.left, .Guerrero.top)
- Call Draw_Grhindex(28958, .Paladin.left, .Paladin.top)
- Call Draw_Grhindex(28948, .Clerigo.left, .Clerigo.top)
- Call Draw_Grhindex(28942, .Asesino.left, .Asesino.top)
- Call Draw_Grhindex(28944, .Bardo.left, .Bardo.top)
- Call Draw_Grhindex(28950, .Druida.left, .Druida.top)
- Call Draw_Grhindex(28946, .Cazador.left, .Cazador.top)
- Call Draw_Grhindex(28956, .Ladron.left, .Ladron.top)
- 'Clase clickeado
- If ClaseClickeada = "Mago" Then
- Call Draw_Grhindex(28953, .Mago.left, .Mago.top)
- End If
- If ClaseClickeada = "Guerrero" Then
- Call Draw_Grhindex(28951, .Guerrero.left, .Guerrero.top)
- End If
- If ClaseClickeada = "Paladin" Then
- Call Draw_Grhindex(28957, .Paladin.left, .Paladin.top)
- End If
- If ClaseClickeada = "Clerigo" Then
- Call Draw_Grhindex(28947, .Clerigo.left, .Clerigo.top)
- End If
- If ClaseClickeada = "Asesino" Then
- Call Draw_Grhindex(28941, .Asesino.left, .Asesino.top)
- End If
- If ClaseClickeada = "Bardo" Then
- Call Draw_Grhindex(28943, .Bardo.left, .Bardo.top)
- End If
- If ClaseClickeada = "Druida" Then
- Call Draw_Grhindex(28949, .Druida.left, .Druida.top)
- End If
- If ClaseClickeada = "Cazador" Then
- Call Draw_Grhindex(28945, .Cazador.left, .Cazador.top)
- End If
- If ClaseClickeada = "Ladron" Then
- Call Draw_Grhindex(28955, .Ladron.left, .Ladron.top)
- End If
- 'Clase clickeado anterior
- If ClaseClickeadaAnterior = "Mago" Then
- Call Draw_Grhindex(28954, .Mago.left, .Mago.top)
- End If
- If ClaseClickeadaAnterior = "Guerrero" Then
- Call Draw_Grhindex(28952, .Guerrero.left, .Guerrero.top)
- End If
- If ClaseClickeadaAnterior = "Paladin" Then
- Call Draw_Grhindex(28958, .Paladin.left, .Paladin.top)
- End If
- If ClaseClickeadaAnterior = "Clerigo" Then
- Call Draw_Grhindex(28948, .Clerigo.left, .Clerigo.top)
- End If
- If ClaseClickeadaAnterior = "Asesino" Then
- Call Draw_Grhindex(28942, .Asesino.left, .Asesino.top)
- End If
- If ClaseClickeadaAnterior = "Bardo" Then
- Call Draw_Grhindex(28944, .Bardo.left, .Bardo.top)
- End If
- If ClaseClickeadaAnterior = "Druida" Then
- Call Draw_Grhindex(28950, .Druida.left, .Druida.top)
- End If
- If ClaseClickeadaAnterior = "Cazador" Then
- Call Draw_Grhindex(28946, .Cazador.left, .Cazador.top)
- End If
- If ClaseClickeadaAnterior = "Ladron" Then
- Call Draw_Grhindex(28956, .Ladron.left, .Ladron.top)
- End If
- 'Existe el pj o no
- If EstadoPj = 1 Then
- Call Draw_Grhindex(28978, .EstadoPj.left, .EstadoPj.top)
- Else
- Call Draw_Grhindex(28977, .EstadoPj.left, .EstadoPj.top)
- End If
- End With
- Text_Render font_list(1), "Millenium Ao 2016", 587, 360, 110, 20, D3DColorARGB(255, 255, 255, 0), DT_TOP Or _
- DT_LEFT, True
- Text_Render font_list(1), "Fps:" & FPS, 50, 30, 50, 20, D3DColorARGB(255, 255, 255, 1), DT_TOP Or DT_LEFT, True
- D3DDevice.EndScene
- D3DDevice.Present re, ByVal 0, FrmCrearPj.renderer.hWnd, ByVal 0
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement