Added @Pokemon.AddEV(pokeIndex,evStat,evValue)
Adds the evValue argument to the Effort Value stat of a Pokémon in the player's party and makes sure it's legal.
This commit is contained in:
parent
0e8170a449
commit
9971ed1d5f
|
@ -437,6 +437,52 @@
|
||||||
If Core.Player.Pokemons.Count - 1 >= Index Then
|
If Core.Player.Pokemons.Count - 1 >= Index Then
|
||||||
Core.Player.Pokemons(Index).Ability = Ability.GetAbilityByID(abilityID)
|
Core.Player.Pokemons(Index).Ability = Ability.GetAbilityByID(abilityID)
|
||||||
End If
|
End If
|
||||||
|
Case "addev"
|
||||||
|
Dim Index As Integer = int(argument.GetSplit(0, ","))
|
||||||
|
Dim ev As String = argument.GetSplit(1, ",")
|
||||||
|
Dim evValue As Integer = int(argument.GetSplit(2, ","))
|
||||||
|
|
||||||
|
If Core.Player.Pokemons.Count - 1 >= Index Then
|
||||||
|
With Core.Player.Pokemons(Index)
|
||||||
|
Dim TotalEV As Integer = .EVHP + .EVAttack + .EVDefense + .EVSpAttack + .EVSpDefense + .EVSpeed
|
||||||
|
If TotalEV + evValue > 510 Then
|
||||||
|
evValue = 510 - TotalEV
|
||||||
|
End If
|
||||||
|
|
||||||
|
Select Case ev.ToLower()
|
||||||
|
Case "hp"
|
||||||
|
If .EVHP + evValue > 255 Then
|
||||||
|
evValue = 255 - .EVHP
|
||||||
|
End If
|
||||||
|
.EVHP = evValue
|
||||||
|
Case "atk", "attack"
|
||||||
|
If .EVAttack + evValue > 255 Then
|
||||||
|
evValue = 255 - .EVAttack
|
||||||
|
End If
|
||||||
|
.EVAttack = evValue
|
||||||
|
Case "def", "defense"
|
||||||
|
If .EVDefense + evValue > 255 Then
|
||||||
|
evValue = 255 - .EVDefense
|
||||||
|
End If
|
||||||
|
.EVDefense = evValue
|
||||||
|
Case "spatk", "specialattack", "spattack"
|
||||||
|
If .EVSpAttack + evValue > 255 Then
|
||||||
|
evValue = 255 - .EVSpAttack
|
||||||
|
End If
|
||||||
|
.EVSpAttack = evValue
|
||||||
|
Case "spdef", "specialdefense", "spdefense"
|
||||||
|
If .EVSpDefense + evValue > 255 Then
|
||||||
|
evValue = 255 - .EVSpDefense
|
||||||
|
End If
|
||||||
|
.EVSpDefense = evValue
|
||||||
|
Case "speed"
|
||||||
|
If .EVSpeed + evValue > 255 Then
|
||||||
|
evValue = 255 - .EVSpeed
|
||||||
|
End If
|
||||||
|
.EVSpeed = evValue
|
||||||
|
End Select
|
||||||
|
End With
|
||||||
|
End If
|
||||||
Case "setev"
|
Case "setev"
|
||||||
Dim Index As Integer = int(argument.GetSplit(0, ","))
|
Dim Index As Integer = int(argument.GetSplit(0, ","))
|
||||||
Dim ev As String = argument.GetSplit(1, ",")
|
Dim ev As String = argument.GetSplit(1, ",")
|
||||||
|
|
|
@ -750,6 +750,9 @@ Namespace ScriptVersion2
|
||||||
r(New ScriptCommand("pokemon", "setev", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int),
|
r(New ScriptCommand("pokemon", "setev", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int),
|
||||||
New ScriptArgument("evStat", ScriptArgument.ArgumentTypes.Str, {"hp", "atk", "attack", "def", "defense", "spatk", "specialattack", "spattack", "spdef", "specialdefense", "spdefense", "speed"}),
|
New ScriptArgument("evStat", ScriptArgument.ArgumentTypes.Str, {"hp", "atk", "attack", "def", "defense", "spatk", "specialattack", "spattack", "spdef", "specialdefense", "spdefense", "speed"}),
|
||||||
New ScriptArgument("evValue", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Sets the value of the Effort Value stat of a Pokémon in the player's party."))
|
New ScriptArgument("evValue", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Sets the value of the Effort Value stat of a Pokémon in the player's party."))
|
||||||
|
r(New ScriptCommand("pokemon", "addev", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int),
|
||||||
|
New ScriptArgument("evStat", ScriptArgument.ArgumentTypes.Str, {"hp", "atk", "attack", "def", "defense", "spatk", "specialattack", "spattack", "spdef", "specialdefense", "spdefense", "speed"}),
|
||||||
|
New ScriptArgument("evValue", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Adds the evValue argument to the Effort Value stat of a Pokémon in the player's party and makes sure it's legal."))
|
||||||
r(New ScriptCommand("pokemon", "setiv", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int),
|
r(New ScriptCommand("pokemon", "setiv", {New ScriptArgument("pokemonIndex", ScriptArgument.ArgumentTypes.Int),
|
||||||
New ScriptArgument("ivStat", ScriptArgument.ArgumentTypes.Str, {"hp", "atk", "attack", "def", "defense", "spatk", "specialattack", "spattack", "spdef", "specialdefense", "spdefense", "speed"}),
|
New ScriptArgument("ivStat", ScriptArgument.ArgumentTypes.Str, {"hp", "atk", "attack", "def", "defense", "spatk", "specialattack", "spattack", "spdef", "specialdefense", "spdefense", "speed"}),
|
||||||
New ScriptArgument("ivValue", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Sets the value of the Individual Value stat of a Pokémon in the player's party."))
|
New ScriptArgument("ivValue", ScriptArgument.ArgumentTypes.Int)}.ToList(), "Sets the value of the Individual Value stat of a Pokémon in the player's party."))
|
||||||
|
|
Loading…
Reference in New Issue