a few more prototypes
This commit is contained in:
parent
819049a416
commit
f601b1b9b0
|
@ -90,6 +90,8 @@
|
|||
<Compile Include="World\ActionScript\V3\ApiMethodSignatureAttribute.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\CameraPrototype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\DaycarePrototype.vb" />
|
||||
<Content Include="World\ActionScript\V3\plan.txt" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\InventoryPrototype.vb" />
|
||||
<None Include="maps\battle\fortune\altering.dat">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -12691,6 +12693,8 @@
|
|||
<Compile Include="World\ActionScript\V3\Prototypes\EntityPrototype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\ItemPrototype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\MovePrototype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\PlayerPrototype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\PokedexPrototype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\PokemonPrototype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\TrainerProtoype.vb" />
|
||||
<Compile Include="World\ActionScript\V3\Prototypes\TypeContract.vb" />
|
||||
|
|
|
@ -51,6 +51,10 @@ Namespace Scripting.V3
|
|||
Me.New({returnType}, {paramName}, {paramType}, 0)
|
||||
End Sub
|
||||
|
||||
Public Sub New(returnType As Type, paramName As String, paramType As Type, optionalNum As Integer)
|
||||
Me.New({returnType}, {paramName}, {paramType}, optionalNum)
|
||||
End Sub
|
||||
|
||||
Public Sub New(returnType As Type, paramNames As String(), paramTypes As Type(), optionalNum As Integer)
|
||||
Me.New({returnType}, paramNames, paramTypes, optionalNum)
|
||||
End Sub
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
Option Strict On
|
||||
Imports Kolben.Adapters
|
||||
|
||||
Namespace Scripting.V3.Prototypes
|
||||
|
||||
<ScriptPrototype(VariableName:="Player")>
|
||||
Friend NotInheritable Class InventoryPrototype
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Standard, VariableName:="add")>
|
||||
<ApiMethodSignature({"item", "amount"}, {GetType(ItemPrototype), GetType(Integer)}, 1)>
|
||||
<ApiMethodSignature({"id", "amount"}, {GetType(Integer), GetType(Integer)}, 1)>
|
||||
Public Shared Function Add(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
If TypeContract.Ensure(parameters, {GetType(ItemPrototype), GetType(Integer)}, 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim item = helper.Pop(Of ItemPrototype)
|
||||
Dim amount = helper.Pop(1)
|
||||
|
||||
Core.Player.Inventory.AddItem(ItemPrototype.GetItem(item).ID, amount)
|
||||
|
||||
ElseIf TypeContract.Ensure(parameters, {GetType(Integer), GetType(Integer)}, 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim itemId = helper.Pop(Of Integer)
|
||||
Dim amount = helper.Pop(1)
|
||||
|
||||
Core.Player.Inventory.AddItem(itemId, amount)
|
||||
|
||||
End If
|
||||
|
||||
Return NetUndefined.Instance
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Standard, VariableName:="remove")>
|
||||
<ApiMethodSignature({"item", "amount"}, {GetType(ItemPrototype), GetType(Integer)}, 1)>
|
||||
<ApiMethodSignature({"id", "amount"}, {GetType(Integer), GetType(Integer)}, 1)>
|
||||
Public Shared Function Remove(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
If TypeContract.Ensure(parameters, {GetType(ItemPrototype), GetType(Integer)}, 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim item = helper.Pop(Of ItemPrototype)
|
||||
Dim amount = helper.Pop(1)
|
||||
|
||||
Core.Player.Inventory.RemoveItem(ItemPrototype.GetItem(item).ID, amount)
|
||||
|
||||
ElseIf TypeContract.Ensure(parameters, {GetType(Integer), GetType(Integer)}, 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim itemId = helper.Pop(Of Integer)
|
||||
Dim amount = helper.Pop(1)
|
||||
|
||||
Core.Player.Inventory.RemoveItem(itemId, amount)
|
||||
|
||||
End If
|
||||
|
||||
Return NetUndefined.Instance
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Standard, VariableName:="clear")>
|
||||
<ApiMethodSignature("item", GetType(ItemPrototype), 1)>
|
||||
<ApiMethodSignature("id", GetType(Integer), 1)>
|
||||
Public Shared Function Clear(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
If TypeContract.Ensure(parameters, GetType(ItemPrototype), 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim item = helper.Pop(Of ItemPrototype)
|
||||
|
||||
If (item IsNot Nothing) Then
|
||||
Core.Player.Inventory.RemoveItem(ItemPrototype.GetItem(item).ID)
|
||||
Else
|
||||
Core.Player.Inventory.Clear()
|
||||
End If
|
||||
|
||||
ElseIf TypeContract.Ensure(parameters, GetType(Integer), 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim itemId = helper.Pop(0)
|
||||
|
||||
If (itemId > 0) Then
|
||||
Core.Player.Inventory.RemoveItem(itemId)
|
||||
Else
|
||||
Core.Player.Inventory.Clear()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Return NetUndefined.Instance
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Standard, VariableName:="count")>
|
||||
<ApiMethodSignature(GetType(Integer), "item", GetType(ItemPrototype), 1)>
|
||||
<ApiMethodSignature(GetType(Integer), "id", GetType(Integer), 1)>
|
||||
Public Shared Function Count(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
If TypeContract.Ensure(parameters, GetType(ItemPrototype), 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim item = helper.Pop(Of ItemPrototype)
|
||||
|
||||
If (item IsNot Nothing) Then
|
||||
Return Core.Player.Inventory.GetItemAmount(ItemPrototype.GetItem(item).ID)
|
||||
Else
|
||||
Return Core.Player.Inventory.Count
|
||||
End If
|
||||
|
||||
ElseIf TypeContract.Ensure(parameters, GetType(Integer), 1) Then
|
||||
|
||||
Dim helper = New ParamHelper(parameters)
|
||||
Dim itemId = helper.Pop(0)
|
||||
|
||||
If (itemId > 0) Then
|
||||
Return Core.Player.Inventory.GetItemAmount(itemId)
|
||||
Else
|
||||
Return Core.Player.Inventory.Count
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Return 0
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
|
@ -9,7 +9,7 @@ Namespace Scripting.V3.Prototypes
|
|||
<Reference>
|
||||
Public ref As Item
|
||||
|
||||
Public Shared Function ToItem(This As Object) As Item
|
||||
Public Shared Function GetItem(This As Object) As Item
|
||||
Return CType(This, ItemPrototype).ref
|
||||
End Function
|
||||
|
||||
|
@ -48,6 +48,24 @@ Namespace Scripting.V3.Prototypes
|
|||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="id")>
|
||||
<ApiMethodSignature(GetType(Integer))>
|
||||
Public Shared Function GetId(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Dim item = GetItem(This)
|
||||
Return item.ID
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="name")>
|
||||
<ApiMethodSignature(GetType(String))>
|
||||
Public Shared Function GetName(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Dim item = GetItem(This)
|
||||
Return item.Name
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
Option Strict On
|
||||
Imports Kolben.Adapters
|
||||
|
||||
Namespace Scripting.V3.Prototypes
|
||||
|
||||
<ScriptPrototype(VariableName:="Player")>
|
||||
Friend NotInheritable Class PlayerPrototype
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="hasPokedex", IsStatic:=True)>
|
||||
<ApiMethodSignature(GetType(Boolean))>
|
||||
Public Shared Function GetHasPokedex(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Return Core.Player.HasPokedex
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Setter, VariableName:="hasPokedex", IsStatic:=True)>
|
||||
<ApiMethodSignature(GetType(Boolean))>
|
||||
Public Shared Function SetHasPokedex(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
If TypeContract.Ensure(parameters, GetType(Boolean)) Then
|
||||
|
||||
Core.Player.HasPokedex = CType(parameters(0), Boolean)
|
||||
' register team in pokedex
|
||||
If Core.Player.HasPokedex Then
|
||||
Dim data = Core.Player.PokedexData
|
||||
For Each pokemon In Core.Player.Pokemons
|
||||
data = Pokedex.RegisterPokemon(data, pokemon)
|
||||
Next
|
||||
Core.Player.PokedexData = data
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Return NetUndefined.Instance
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
|
@ -0,0 +1,101 @@
|
|||
Option Strict On
|
||||
Imports Kolben.Adapters
|
||||
|
||||
Namespace Scripting.V3.Prototypes
|
||||
|
||||
<ScriptPrototype(VariableName:="Pokedex")>
|
||||
Friend NotInheritable Class PokedexPrototype
|
||||
|
||||
<Reference>
|
||||
Public ref As Integer
|
||||
|
||||
Public Shared Function GetId(This As Object) As Integer
|
||||
Return CType(This, PokedexPrototype).ref
|
||||
End Function
|
||||
|
||||
Public Shared Function GetPokedex(This As Object) As Pokedex
|
||||
Return Core.Player.Pokedexes(CType(This, PokedexPrototype).ref)
|
||||
End Function
|
||||
|
||||
Public Sub New() : End Sub
|
||||
|
||||
Public Sub New(id As Integer)
|
||||
ref = id
|
||||
End Sub
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="id")>
|
||||
<ApiMethodSignature(GetType(Integer))>
|
||||
Public Shared Function GetId(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Dim id = GetId(This)
|
||||
Return id
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="caught")>
|
||||
<ApiMethodSignature(GetType(Integer))>
|
||||
Public Shared Function GetCaught(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Dim pokedex = GetPokedex(This)
|
||||
Return pokedex.Obtained
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="seen")>
|
||||
<ApiMethodSignature(GetType(Integer))>
|
||||
Public Shared Function GetSeen(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Dim pokedex = GetPokedex(This)
|
||||
Return pokedex.Seen
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="autoDetect", IsStatic:=True)>
|
||||
<ApiMethodSignature(GetType(Boolean))>
|
||||
Public Shared Function GetAutoDetect(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Return Pokedex.AutoDetect
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Setter, VariableName:="autoDetect", IsStatic:=True)>
|
||||
<ApiMethodSignature(GetType(Boolean))>
|
||||
Public Shared Function SetAutoDetect(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
If TypeContract.Ensure(parameters, {GetType(Boolean)}) Then
|
||||
|
||||
Pokedex.AutoDetect = CType(parameters(0), Boolean)
|
||||
|
||||
End If
|
||||
|
||||
Return NetUndefined.Instance
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="caughtTotal", IsStatic:=True)>
|
||||
<ApiMethodSignature(GetType(Integer))>
|
||||
Public Shared Function GetCaughtTotal(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Return Pokedex.CountEntries(Core.Player.PokedexData, {2, 3})
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="shinyTotal", IsStatic:=True)>
|
||||
<ApiMethodSignature(GetType(Integer))>
|
||||
Public Shared Function GetShinyTotal(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Return Pokedex.CountEntries(Core.Player.PokedexData, {3})
|
||||
|
||||
End Function
|
||||
|
||||
<ScriptFunction(ScriptFunctionType.Getter, VariableName:="seenTotal", IsStatic:=True)>
|
||||
<ApiMethodSignature(GetType(Integer))>
|
||||
Public Shared Function GetSeenTotal(This As Object, objLink As ScriptObjectLink, parameters As Object()) As Object
|
||||
|
||||
Return Pokedex.CountEntries(Core.Player.PokedexData, {1})
|
||||
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
|
@ -370,7 +370,7 @@ Namespace Scripting.V3.Prototypes
|
|||
If TypeContract.Ensure(parameters, GetType(ItemPrototype)) Then
|
||||
|
||||
Dim p = GetPokemon(This)
|
||||
p.CatchBall = ItemPrototype.ToItem(parameters(0))
|
||||
p.CatchBall = ItemPrototype.GetItem(parameters(0))
|
||||
|
||||
End If
|
||||
|
||||
|
@ -405,7 +405,7 @@ Namespace Scripting.V3.Prototypes
|
|||
Else
|
||||
|
||||
Dim item = CType(parameters(0), ItemPrototype)
|
||||
p.Item = ItemPrototype.ToItem(item)
|
||||
p.Item = ItemPrototype.GetItem(item)
|
||||
|
||||
End If
|
||||
|
||||
|
|
|
@ -0,0 +1,166 @@
|
|||
???
|
||||
Entity.showmessagebulb
|
||||
|
||||
System
|
||||
- save
|
||||
- random
|
||||
- createNewGame
|
||||
|
||||
Text
|
||||
- showItemGetMessage
|
||||
- showBadgeGotMessage
|
||||
- showOptions
|
||||
|
||||
Level
|
||||
- wait
|
||||
- update
|
||||
- load
|
||||
- reload
|
||||
- (get) file
|
||||
- (get) music
|
||||
- playMusic
|
||||
- pauseMusic
|
||||
- resumeMusic
|
||||
- (get, set) canFly
|
||||
- (get, set) canDig
|
||||
- (get, set) canTeleport
|
||||
- (get, set) wildPokemonGrass
|
||||
- (get, set) wildPokemonWater
|
||||
- (get, set) wildPokemonEverywhere
|
||||
- (get, set) isSafariZone
|
||||
- (get, set) isDark
|
||||
- getEntity
|
||||
- getNPC
|
||||
- addEntity
|
||||
- addNPC
|
||||
- getFollowPokemon
|
||||
|
||||
World
|
||||
- (get) daytime
|
||||
- (get) season
|
||||
- (get) weather
|
||||
- (get, set) regionWeather
|
||||
- useRepel
|
||||
- (get) level
|
||||
- showFishingRod
|
||||
- hideFishingRod
|
||||
- addRoamingPokemon
|
||||
|
||||
Entity
|
||||
- (get) id
|
||||
- (get) type
|
||||
- (get, set) opacity
|
||||
- (get, set) isvisible
|
||||
- (get, set) additionalData
|
||||
- (get, set) actionValue
|
||||
- (get, set) hasCollision
|
||||
- setTexture
|
||||
|
||||
NPC
|
||||
- fromEntity
|
||||
- (get) skin
|
||||
- setSkin
|
||||
- move
|
||||
- moveVertical
|
||||
- (get, set) direction
|
||||
- (get, set) speed
|
||||
- isMoving
|
||||
- (get, set) name
|
||||
- (get) npcid
|
||||
|
||||
FollowPokemon
|
||||
- getPokemon
|
||||
- (get) position
|
||||
- (get, set) isVisible
|
||||
- (get) skin
|
||||
|
||||
Register
|
||||
- exists
|
||||
- add
|
||||
- remove
|
||||
- changeValue
|
||||
- addNPC
|
||||
- removeNPC
|
||||
|
||||
Rival
|
||||
- (get, set) name
|
||||
|
||||
Player
|
||||
- (get) inventory
|
||||
- (get) pokegear
|
||||
- (get) isRiding
|
||||
- (get) isSurfing
|
||||
- getPokedex
|
||||
- (get, set) hasPokegear
|
||||
- setSkin
|
||||
- (get) skin
|
||||
- move
|
||||
- (get) direction
|
||||
- turnTo
|
||||
- warp
|
||||
- (get, set) position
|
||||
- (get, set) money
|
||||
- (get) badges
|
||||
- addBadge
|
||||
- removeBadge
|
||||
- (get, set) battlePoints
|
||||
- (get, set) name
|
||||
- (get, set) OT
|
||||
- (get, set) opacity
|
||||
- (get) gender
|
||||
- (get) party
|
||||
- blackout
|
||||
|
||||
Pokegear
|
||||
- (get) isReceivingCall
|
||||
- allowRadioChannel
|
||||
- blockRadioChannel
|
||||
- (get) currentRadioChannel
|
||||
|
||||
Pokedex
|
||||
- (get) id
|
||||
- (get) caught
|
||||
- (get) seen
|
||||
- (get, set) autodetect
|
||||
- (get) caughtTotal
|
||||
- (get) seenTotal
|
||||
- (get) shinyTotal
|
||||
|
||||
Party
|
||||
- (indexerGet) pokemon
|
||||
- (indexerSet) pokemon
|
||||
- (get) count
|
||||
- add
|
||||
- remove
|
||||
- clear
|
||||
|
||||
X Item
|
||||
- id
|
||||
- name
|
||||
|
||||
HallOfFame
|
||||
- recordParty
|
||||
|
||||
Screen
|
||||
- openStorageSystem
|
||||
- openApricorn
|
||||
- openStore
|
||||
- openMap
|
||||
- openDonations
|
||||
- openPokemonPreview
|
||||
- openCredits
|
||||
- openHallOfFame
|
||||
- openMoveTutor
|
||||
- openMailSystem
|
||||
- openPvPLobby
|
||||
- openInput
|
||||
- openMysteryEvent
|
||||
- openSecretBase
|
||||
- openSkinSelection
|
||||
- openRivalName
|
||||
- (get) selectedSkin
|
||||
- fadeOut
|
||||
- fadeIn
|
||||
- (get, set) fadeValue
|
||||
- showTitle
|
||||
- clearTitles
|
|
@ -1039,34 +1039,22 @@ Public Class Level
|
|||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Returns a list of all NPCs on the map.
|
||||
''' </summary>
|
||||
Public Function GetNPCs() As List(Of NPC)
|
||||
Dim reList As New List(Of NPC)
|
||||
|
||||
For Each Entity As Entity In Me.Entities
|
||||
If Entity.EntityID = "NPC" Then
|
||||
reList.Add(CType(Entity, NPC))
|
||||
End If
|
||||
Next
|
||||
|
||||
Return reList
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Returns an NPC based on their ID.
|
||||
''' </summary>
|
||||
''' <param name="ID">The ID of the NPC to return from the level.</param>
|
||||
''' <returns>Returns either a matching NPC or Nothing.</returns>
|
||||
Public Function GetNPC(ByVal ID As Integer) As NPC
|
||||
For Each NPC As NPC In GetNPCs()
|
||||
If NPC.NPCID = ID Then
|
||||
Return NPC
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim ent = Me.Entities.FirstOrDefault(Function(e As Entity) As Boolean
|
||||
Return e.EntityID = "NPC" And
|
||||
TypeOf e Is NPC And
|
||||
CType(e, NPC).NPCID = ID
|
||||
End Function)
|
||||
If ent IsNot Nothing Then
|
||||
Return CType(ent, NPC)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
|
|
Loading…
Reference in New Issue