mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-04-08 18:35:09 +02:00
Fixed friend list, Trainer screen, play time, Woobat evolution condition.
This commit is contained in:
parent
b2ce407b0c
commit
98188fa3ef
@ -50,4 +50,4 @@ Move|36,248
|
||||
Move|41,94
|
||||
Move|47,283
|
||||
TradeValue|25
|
||||
EvolutionCondition|527,friendship,220,level
|
||||
EvolutionCondition|528,friendship,220,level
|
||||
|
@ -28,8 +28,8 @@ Public Class TimeHelpers
|
||||
Public Shared Function GetCurrentPlayTime() As TimeSpan
|
||||
Dim PTime As TimeSpan = Core.Player.PlayTime
|
||||
|
||||
Dim diff As Integer = (Date.Now - Core.Player.GameStart).Seconds
|
||||
PTime += ConvertSecondToTime(diff)
|
||||
Dim diff As TimeSpan = (Date.Now - Core.Player.GameStart)
|
||||
PTime += diff
|
||||
|
||||
Return PTime
|
||||
End Function
|
||||
|
@ -70,8 +70,8 @@ Namespace GameJolt
|
||||
|
||||
Dim loggedIn As Boolean
|
||||
|
||||
Const CONST_GAMEID As String = "" ' CLASSIFIED
|
||||
Const CONST_GAMEKEY As String = "" ' CLASSIFIED
|
||||
Const CONST_GAMEID As String = ' CLASSIFIED
|
||||
Const CONST_GAMEKEY As String = ' CLASSIFIED
|
||||
Const HOST As String = "http://api.gamejolt.com/api/game/"
|
||||
|
||||
Dim Exception As System.Exception = Nothing
|
||||
@ -478,69 +478,12 @@ Namespace GameJolt
|
||||
Public Sub FetchFriendList(ByVal user_id As String)
|
||||
Dim url As New APIURL("/friends/")
|
||||
url.AddKeyValuePair("game_id", GameID)
|
||||
url.AddKeyValuePair("user_id", user_id)
|
||||
|
||||
Initialize(url.GetURL(), RequestMethod.GET)
|
||||
End Sub
|
||||
|
||||
Public Sub FetchSentFriendRequest()
|
||||
Dim url As New APIURL("/friends/sent-requests/")
|
||||
url.AddKeyValuePair("game_id", GameID)
|
||||
url.AddKeyValuePair("username", username)
|
||||
url.AddKeyValuePair("user_token", token)
|
||||
|
||||
Initialize(url.GetURL(), RequestMethod.GET)
|
||||
End Sub
|
||||
|
||||
Public Sub FetchReceivedFriendRequests()
|
||||
Dim url As New APIURL("/friends/received-requests/")
|
||||
url.AddKeyValuePair("game_id", GameID)
|
||||
url.AddKeyValuePair("username", username)
|
||||
url.AddKeyValuePair("user_token", token)
|
||||
|
||||
Initialize(url.GetURL(), RequestMethod.GET)
|
||||
End Sub
|
||||
|
||||
Public Sub SendFriendRequest(ByVal targetuserID As String)
|
||||
Dim url As New APIURL("/friends/send-request/")
|
||||
url.AddKeyValuePair("game_id", GameID)
|
||||
url.AddKeyValuePair("username", username)
|
||||
url.AddKeyValuePair("user_token", token)
|
||||
url.AddKeyValuePair("target_user_id", targetuserID)
|
||||
|
||||
Initialize(url.GetURL(), RequestMethod.POST)
|
||||
End Sub
|
||||
|
||||
Public Sub CancelFriendRequest(ByVal targetUserID As String)
|
||||
Dim url As New APIURL("/friends/cancel-request/")
|
||||
url.AddKeyValuePair("game_id", GameID)
|
||||
url.AddKeyValuePair("username", username)
|
||||
url.AddKeyValuePair("user_token", token)
|
||||
url.AddKeyValuePair("target_user_id", targetUserID)
|
||||
|
||||
Initialize(url.GetURL(), RequestMethod.POST)
|
||||
End Sub
|
||||
|
||||
Public Sub AcceptFriendRequest(ByVal targetUserID As String)
|
||||
Dim url As New APIURL("/friends/accept-request/")
|
||||
url.AddKeyValuePair("game_id", GameID)
|
||||
url.AddKeyValuePair("username", username)
|
||||
url.AddKeyValuePair("user_token", token)
|
||||
url.AddKeyValuePair("target_user_id", targetUserID)
|
||||
|
||||
Initialize(url.GetURL(), RequestMethod.POST)
|
||||
End Sub
|
||||
|
||||
Public Sub DeclineFriendRequest(ByVal targetUserID As String)
|
||||
Dim url As New APIURL("/friends/decline-request/")
|
||||
url.AddKeyValuePair("game_id", GameID)
|
||||
url.AddKeyValuePair("username", username)
|
||||
url.AddKeyValuePair("user_token", token)
|
||||
url.AddKeyValuePair("target_user_id", targetUserID)
|
||||
|
||||
Initialize(url.GetURL(), RequestMethod.POST)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Private url As String = ""
|
||||
|
@ -295,6 +295,9 @@
|
||||
End Function
|
||||
|
||||
Public Shared Function GetPointsForLevel(ByVal level As Integer) As Integer
|
||||
If level = 1 Then
|
||||
Return 0
|
||||
End If
|
||||
Dim points As Double = Math.Ceiling((5 / 4) * (Math.Pow(level, 3) / 10))
|
||||
Return CInt(points)
|
||||
End Function
|
||||
|
@ -26,14 +26,12 @@ Namespace GameJolt
|
||||
Private Const ID_PLAYEREMBLEM As Integer = 1
|
||||
Private Const ID_PLAYERGENDER As Integer = 2
|
||||
Private Const ID_FRIENDS As Integer = 3
|
||||
Private Const ID_SENTREQUESTS As Integer = 4
|
||||
Private Const ID_RECEIVEDREQUESTS As Integer = 5
|
||||
|
||||
'The amount of files to download.
|
||||
'SAVEFILEs represent the amount of files that would get stored in an offline save.
|
||||
'EXTRADATA is stuff that does get saved extra and that offline profiles don't have, like global points, friends etc.
|
||||
Public Const SAVEFILECOUNT As Integer = 16
|
||||
Public Const EXTRADATADOWNLOADCOUNT As Integer = 6
|
||||
Public Const EXTRADATADOWNLOADCOUNT As Integer = 4
|
||||
Public Const EXTRADATAUPLOADCOUNT As Integer = 3
|
||||
|
||||
'The current version of the save files.
|
||||
@ -354,12 +352,6 @@ Namespace GameJolt
|
||||
Dim APIFriendsCall As New APICall(AddressOf SaveFriends)
|
||||
APIFriendsCall.FetchFriendList(GameJoltID)
|
||||
|
||||
Dim APISentCall As New APICall(AddressOf SaveSentRequests)
|
||||
APISentCall.FetchSentFriendRequest()
|
||||
|
||||
Dim APIReceivedCall As New APICall(AddressOf SaveReceivedRequests)
|
||||
APIReceivedCall.FetchReceivedFriendRequests()
|
||||
|
||||
If MainSave = True Then
|
||||
Dim t As New Threading.Thread(AddressOf DownloadSpriteSub)
|
||||
t.IsBackground = True
|
||||
@ -860,47 +852,7 @@ Namespace GameJolt
|
||||
_downloadedFlags(SAVEFILECOUNT + ID_FRIENDS) = True
|
||||
End Sub
|
||||
|
||||
Private Sub SaveSentRequests(ByVal result As String)
|
||||
Dim list As List(Of API.JoltValue) = API.HandleData(result)
|
||||
|
||||
If list.Count > 1 Then
|
||||
SentRequests = ""
|
||||
|
||||
For Each Item As API.JoltValue In list
|
||||
If Item.Name = "user_id" Then
|
||||
If SentRequests <> "" Then
|
||||
SentRequests &= ","
|
||||
End If
|
||||
SentRequests &= Item.Value
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
SentRequests = ""
|
||||
End If
|
||||
|
||||
_downloadedFlags(SAVEFILECOUNT + ID_SENTREQUESTS) = True
|
||||
End Sub
|
||||
|
||||
Private Sub SaveReceivedRequests(ByVal result As String)
|
||||
Dim list As List(Of API.JoltValue) = API.HandleData(result)
|
||||
|
||||
If list.Count > 1 Then
|
||||
ReceivedRequests = ""
|
||||
|
||||
For Each Item As API.JoltValue In list
|
||||
If Item.Name = "user_id" Then
|
||||
If ReceivedRequests <> "" Then
|
||||
ReceivedRequests &= ","
|
||||
End If
|
||||
ReceivedRequests &= Item.Value
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
ReceivedRequests = ""
|
||||
End If
|
||||
|
||||
_downloadedFlags(SAVEFILECOUNT + ID_RECEIVEDREQUESTS) = True
|
||||
End Sub
|
||||
|
||||
#Region "DefaultData"
|
||||
|
||||
|
@ -1246,8 +1246,8 @@
|
||||
Dim c As OverworldCamera = GetOverworldCamera()
|
||||
Dim freeCameraString As String = c.FreeCameraMode.ToNumberString()
|
||||
|
||||
Dim diff As Integer = (Date.Now - GameStart).Seconds
|
||||
Dim p As TimeSpan = PlayTime + TimeHelpers.ConvertSecondToTime(diff)
|
||||
Dim diff As TimeSpan = (Date.Now - GameStart)
|
||||
Dim p As TimeSpan = PlayTime + diff
|
||||
Dim PlayTimeString As String = p.Hours & "," & p.Minutes & "," & p.Seconds & "," & p.Days
|
||||
|
||||
Dim lastPokemonPosition As String = "999,999,999"
|
||||
|
@ -107,7 +107,7 @@
|
||||
Canvas.DrawRectangle(_textBatch, New Rectangle(-10, 300, 190, 30), New Color(0, 0, 0, 150))
|
||||
|
||||
Dim emblemName = GameJoltSave.Emblem
|
||||
_textBatch.DrawString(FontManager.MiniFont, emblemName(0).ToString().ToUpper() & emblemName.Substring(1, emblemName.Length - 1), New Vector2(0, 305), Color.White)
|
||||
_textBatch.DrawString(FontManager.MiniFont, emblemName(0).ToString().ToUpper() & emblemName.Substring(1, emblemName.Length - 1), New Vector2(15, 305), Color.White)
|
||||
|
||||
DrawLevelProgress()
|
||||
End If
|
||||
@ -189,21 +189,23 @@
|
||||
|
||||
Dim needPoints As Integer = 0
|
||||
Dim totalNeedPoints As Integer = 0
|
||||
Dim hasPointsThisLevel As Integer = 0
|
||||
|
||||
|
||||
Dim hasPoints As Integer = Core.GameJoltSave.Points
|
||||
Dim needPointsCurrentLevel As Integer = GameJolt.Emblem.GetPointsForLevel(currentLevel)
|
||||
Dim needPointsNextLevel As Integer = GameJolt.Emblem.GetPointsForLevel(currentLevel + 1)
|
||||
|
||||
totalNeedPoints = needPointsNextLevel - needPointsCurrentLevel
|
||||
needPoints = totalNeedPoints - (hasPoints - needPointsCurrentLevel) + 1
|
||||
hasPointsThisLevel = hasPoints - needPointsCurrentLevel
|
||||
|
||||
Dim hasPointsThisLevel As Integer = totalNeedPoints - needPoints
|
||||
needPoints = totalNeedPoints - hasPointsThisLevel
|
||||
|
||||
Dim nextSprite As Texture2D = GameJolt.Emblem.GetPlayerSprite(currentLevel + 1, Core.GameJoltSave.GameJoltID, Core.GameJoltSave.Gender)
|
||||
|
||||
_spriteBatch.Draw(nextSprite, New Rectangle(570, 310, 32, 32), New Rectangle(0, 64, 32, 32), Color.White)
|
||||
|
||||
Dim value = hasPointsThisLevel / totalNeedPoints * 310
|
||||
Dim value = Clamp(hasPointsThisLevel / totalNeedPoints * 310, 0, 310)
|
||||
|
||||
If currentLevel >= 100 Then
|
||||
value = 310
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user