Implemented ability activation upon Mega Evolution

This commit is contained in:
CaptainSegis 2016-10-18 02:16:14 -05:00
parent 709658d953
commit 35613b57fc
2 changed files with 157 additions and 272 deletions

View File

@ -430,9 +430,9 @@
Me.ChangeCameraAngel(1, own, BattleScreen) Me.ChangeCameraAngel(1, own, BattleScreen)
BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1)) BattleScreen.BattleQuery.Add(New ToggleEntityQueryObject(own, ToggleEntityQueryObject.BattleEntities.OwnPokemon, PokemonForms.GetOverworldSpriteName(p), 0, 1, -1, -1))
BattleScreen.BattleQuery.Add(New TextQueryObject(_base & " has Mega Evolved!")) BattleScreen.BattleQuery.Add(New TextQueryObject(_base & " has Mega Evolved!"))
TriggerAbilityEffect(BattleScreen, own)
End If End If
End Sub End Sub
'Checks if any pokemon is mega evolving, order based on speed 'Checks if any pokemon is mega evolving, order based on speed
Sub MegaEvolCheck(ByVal BattleScreen As BattleScreen) Sub MegaEvolCheck(ByVal BattleScreen As BattleScreen)
If BattleCalculation.MovesFirst(BattleScreen) Then If BattleCalculation.MovesFirst(BattleScreen) Then
@ -3700,6 +3700,149 @@
End If End If
End Sub End Sub
Public Sub TriggerAbilityEffect(ByVal BattleScreen As BattleScreen, ByVal own As Boolean)
With BattleScreen
Dim p, op As Pokemon
If own Then
p = .OwnPokemon
op = .OppPokemon
Else
p = .OppPokemon
op = .OwnPokemon
End If
If BattleScreen.FieldEffects.CanUseAbility(own, BattleScreen, 1) = True Then
Select Case p.Ability.Name.ToLower()
Case "drizzle"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Rain, 10000, BattleScreen, "Drizzle makes it rain!", "drizzle")
Case "cloud nine"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Clear, 0, BattleScreen, "", "cloudnine")
Case "intimidate"
LowerStat(True, False, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Intimidate cuts " & op.GetDisplayName() & "'s attack!", "intimidate")
Case "trace"
If op.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() <> "illusion" Then
p.OriginalAbility = p.Ability
p.Ability = op.Ability
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " copied the ability " & op.Ability.Name & " from " & op.GetDisplayName() & "!"))
End If
Case "sand stream"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Sandstorm, 10000, BattleScreen, "Sand Stream creates a sandstorm!", "sandstream")
Case "forecast"
ApplyForecast(BattleScreen)
Case "drought"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Sunny, 10000, BattleScreen, "The sunlight turned harsh!", "drought")
Case "air lock"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Clear, 0, BattleScreen, "", "airlock")
Case "download"
If op.Defense < op.SpDefense Then
RaiseStat(False, False, BattleScreen, "Attack", 1, "Download analyzed the foe!", "download")
Else
RaiseStat(False, False, BattleScreen, "Special Attack", 1, "Download analyzed the foe!", "download")
End If
Case "mold breaker"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " breakes the mold!"))
Case "turbo blaze"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is radiating a blazing aura!"))
Case "teravolt"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is radiating a bursting aura!"))
Case "anticipation"
Dim doShudder As Boolean = False
'Check every move if it is: super effective/1hitko/explosion/selfdestruct
If doShudder = True Then
.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " makes " & p.GetDisplayName() & " shudder!"))
End If
Case "forewarn"
Dim moves As New List(Of Attack)
'Add attacks with highest base power here
Dim move As Attack = Nothing
If moves.Count > 1 Then
move = moves(Core.Random.Next(0, moves.Count))
ElseIf moves.Count = 1 Then
move = moves(0)
End If
If Not move Is Nothing Then
.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " makes " & p.GetDisplayName() & " shudder!"))
End If
Case "snow warning"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Hailstorm, 10000, BattleScreen, "Snow Warning summoned a hailstorm!", "snowwarning")
Case "frisk"
If Not op.Item Is Nothing Then
.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " is holding " & op.Item.Name & "."))
End If
Case "multitype"
p.OriginalType1 = p.Type1
p.OriginalType2 = p.Type2
p.Type1 = New Element(Element.Types.Normal)
p.Type2 = New Element(Element.Types.Blank)
If Not p.Item Is Nothing Then
Dim changeType As Boolean = False
Dim newType As Element = Nothing
Select Case p.Item.Name.ToLower()
Case "draco plate"
changeType = True
newType = New Element(Element.Types.Dragon)
Case "dread plate"
changeType = True
newType = New Element(Element.Types.Dark)
Case "earth plate"
changeType = True
newType = New Element(Element.Types.Ground)
Case "fist plate"
changeType = True
newType = New Element(Element.Types.Fighting)
Case "flame plate"
changeType = True
newType = New Element(Element.Types.Fire)
Case "icicle plate"
changeType = True
newType = New Element(Element.Types.Ice)
Case "insect plate"
changeType = True
newType = New Element(Element.Types.Bug)
Case "iron plate"
changeType = True
newType = New Element(Element.Types.Steel)
Case "meadow plate"
changeType = True
newType = New Element(Element.Types.Grass)
Case "mind plate"
changeType = True
newType = New Element(Element.Types.Psychic)
Case "sky plate"
changeType = True
newType = New Element(Element.Types.Flying)
Case "splash plate"
changeType = True
newType = New Element(Element.Types.Water)
Case "spooky plate"
changeType = True
newType = New Element(Element.Types.Ghost)
Case "stone plate"
changeType = True
newType = New Element(Element.Types.Rock)
Case "toxic plate"
changeType = True
newType = New Element(Element.Types.Poison)
Case "zap plate"
changeType = True
newType = New Element(Element.Types.Electric)
End Select
If changeType = True Then
p.Type1 = newType
p.Type2 = New Element(Element.Types.Blank)
End If
End If
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s type changed to " & p.Type1.ToString() & "!"))
Case "imposter"
'Doing the ditto stuff!
End Select
End If
End With
End Sub
Private Sub ApplyForecast(ByVal BattleScreen As BattleScreen) Private Sub ApplyForecast(ByVal BattleScreen As BattleScreen)
With BattleScreen With BattleScreen
Dim p As Pokemon = .OwnPokemon Dim p As Pokemon = .OwnPokemon
@ -5720,137 +5863,7 @@
End If End If
End If End If
If BattleScreen.FieldEffects.CanUseAbility(True, BattleScreen, 1) = True Then TriggerAbilityEffect(BattleScreen, True)
Select Case p.Ability.Name.ToLower()
Case "drizzle"
ChangeWeather(True, True, BattleWeather.WeatherTypes.Rain, 10000, BattleScreen, "Drizzle makes it rain!", "drizzle")
Case "cloud nine"
ChangeWeather(True, True, BattleWeather.WeatherTypes.Clear, 0, BattleScreen, "", "cloudnine")
Case "intimidate"
LowerStat(False, True, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Intimidate cuts " & op.GetDisplayName() & "'s attack!", "intimidate")
Case "trace"
If op.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() <> "illusion" Then
p.OriginalAbility = p.Ability
p.Ability = op.Ability
.AddToQuery(InsertIndex, New TextQueryObject(p.GetDisplayName() & " copied the ability " & op.Ability.Name & " from " & op.GetDisplayName() & "!"))
End If
Case "sand stream"
ChangeWeather(True, True, BattleWeather.WeatherTypes.Sandstorm, 10000, BattleScreen, "Sand Stream creates a sandstorm!", "sandstream")
Case "forecast"
ApplyForecast(BattleScreen)
Case "drought"
ChangeWeather(True, True, BattleWeather.WeatherTypes.Sunny, 10000, BattleScreen, "The sunlight turned harsh!", "drought")
Case "air lock"
ChangeWeather(True, True, BattleWeather.WeatherTypes.Clear, 0, BattleScreen, "", "airlock")
Case "download"
If op.Defense < op.SpDefense Then
RaiseStat(True, True, BattleScreen, "Attack", 1, "Download analysed the foe!", "download")
Else
RaiseStat(True, True, BattleScreen, "Special Attack", 1, "Download analysed the foe!", "download")
End If
Case "mold breaker"
.AddToQuery(InsertIndex, New TextQueryObject(p.GetDisplayName() & " breakes the mold!"))
Case "turbo blaze"
.AddToQuery(InsertIndex, New TextQueryObject(p.GetDisplayName() & " is radiating a blazing aura!"))
Case "teravolt"
.AddToQuery(InsertIndex, New TextQueryObject(p.GetDisplayName() & " is radiating a bursting aura!"))
Case "anticipation"
Dim doShudder As Boolean = False
'Check every move if it is: super effective/1hitko/explosion/selfdestruct
If doShudder = True Then
.AddToQuery(InsertIndex, New TextQueryObject(op.GetDisplayName() & " makes " & p.GetDisplayName() & " shudder!"))
End If
Case "forewarn"
Dim moves As New List(Of Attack)
'Add attacks with highest base power here
Dim move As Attack = Nothing
If moves.Count > 1 Then
move = moves(Core.Random.Next(0, moves.Count))
ElseIf moves.Count = 1 Then
move = moves(0)
End If
If Not move Is Nothing Then
.AddToQuery(InsertIndex, New TextQueryObject(op.GetDisplayName() & " makes " & p.GetDisplayName() & " shudder!"))
End If
Case "snow warning"
ChangeWeather(True, True, BattleWeather.WeatherTypes.Hailstorm, 10000, BattleScreen, "Snow Warning summoned a hailstorm!", "snowwarning")
Case "frisk"
If Not op.Item Is Nothing Then
.AddToQuery(InsertIndex, New TextQueryObject(op.GetDisplayName() & " is holding " & op.Item.Name & "."))
End If
Case "multitype"
p.OriginalType1 = p.Type1
p.OriginalType2 = p.Type2
p.Type1 = New Element(Element.Types.Normal)
p.Type2 = New Element(Element.Types.Blank)
If Not p.Item Is Nothing Then
Dim changeType As Boolean = False
Dim newType As Element = Nothing
Select Case p.Item.Name.ToLower()
Case "draco plate"
changeType = True
newType = New Element(Element.Types.Dragon)
Case "dread plate"
changeType = True
newType = New Element(Element.Types.Dark)
Case "earth plate"
changeType = True
newType = New Element(Element.Types.Ground)
Case "fist plate"
changeType = True
newType = New Element(Element.Types.Fighting)
Case "flame plate"
changeType = True
newType = New Element(Element.Types.Fire)
Case "icicle plate"
changeType = True
newType = New Element(Element.Types.Ice)
Case "insect plate"
changeType = True
newType = New Element(Element.Types.Bug)
Case "iron plate"
changeType = True
newType = New Element(Element.Types.Steel)
Case "meadow plate"
changeType = True
newType = New Element(Element.Types.Grass)
Case "mind plate"
changeType = True
newType = New Element(Element.Types.Psychic)
Case "sky plate"
changeType = True
newType = New Element(Element.Types.Flying)
Case "splash plate"
changeType = True
newType = New Element(Element.Types.Water)
Case "spooky plate"
changeType = True
newType = New Element(Element.Types.Ghost)
Case "stone plate"
changeType = True
newType = New Element(Element.Types.Rock)
Case "toxic plate"
changeType = True
newType = New Element(Element.Types.Poison)
Case "zap plate"
changeType = True
newType = New Element(Element.Types.Electric)
End Select
If changeType = True Then
p.Type1 = newType
p.Type2 = New Element(Element.Types.Blank)
End If
End If
.AddToQuery(InsertIndex, New TextQueryObject(p.GetDisplayName() & "'s type changed to " & p.Type1.ToString() & "!"))
Case "imposter"
'Doing the ditto stuff!
End Select
End If
If .OwnPokemon.Status = Pokemon.StatusProblems.Sleep Then If .OwnPokemon.Status = Pokemon.StatusProblems.Sleep Then
.FieldEffects.OwnSleepTurns = Core.Random.Next(1, 4) .FieldEffects.OwnSleepTurns = Core.Random.Next(1, 4)
@ -6141,135 +6154,7 @@
End If End If
End If End If
Select Case p.Ability.Name.ToLower() TriggerAbilityEffect(BattleScreen, False)
Case "drizzle"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Rain, 10000, BattleScreen, "Drizzle makes it rain!", "drizzle")
Case "cloud nine"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Clear, 0, BattleScreen, "", "cloudnine")
Case "intimidate"
LowerStat(True, False, BattleScreen, "Attack", 1, p.GetDisplayName() & "'s Intimidate cuts " & op.GetDisplayName() & "'s attack!", "intimidate")
Case "trace"
If op.Ability.Name.ToLower() <> "multitype" And op.Ability.Name.ToLower() <> "illusion" Then
p.OriginalAbility = p.Ability
p.Ability = op.Ability
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " copied the ability " & op.Ability.Name & " from " & op.GetDisplayName() & "!"))
End If
Case "sand stream"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Sandstorm, 10000, BattleScreen, "Sand Stream creates a sandstorm!", "sandstream")
Case "forecast"
ApplyForecast(BattleScreen)
Case "drought"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Sunny, 10000, BattleScreen, "The sunlight turned harsh!", "drought")
Case "air lock"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Clear, 0, BattleScreen, "", "airlock")
Case "download"
If op.Defense < op.SpDefense Then
RaiseStat(False, False, BattleScreen, "Attack", 1, "Download analysed the foe!", "download")
Else
RaiseStat(False, False, BattleScreen, "Special Attack", 1, "Download analysed the foe!", "download")
End If
Case "mold breaker"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " breakes the mold!"))
Case "turbo blaze"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is radiating a blazing aura!"))
Case "teravolt"
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & " is radiating a bursting aura!"))
Case "anticipation"
Dim doShudder As Boolean = False
'Check every move if it is: super effective/1hitko/explosion/selfdestruct
If doShudder = True Then
.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " makes " & p.GetDisplayName() & " shudder!"))
End If
Case "forewarn"
Dim moves As New List(Of Attack)
'Add attacks with highest base power here
Dim move As Attack = Nothing
If moves.Count > 1 Then
move = moves(Core.Random.Next(0, moves.Count))
ElseIf moves.Count = 1 Then
move = moves(0)
End If
If Not move Is Nothing Then
.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " makes " & p.GetDisplayName() & " shudder!"))
End If
Case "snow warning"
ChangeWeather(False, False, BattleWeather.WeatherTypes.Hailstorm, 10000, BattleScreen, "Snow Warning summoned a hailstorm!", "snowwarning")
Case "frisk"
If Not op.Item Is Nothing Then
.BattleQuery.Add(New TextQueryObject(op.GetDisplayName() & " is holding " & op.Item.Name & "."))
End If
Case "multitype"
p.OriginalType1 = p.Type1
p.OriginalType2 = p.Type2
p.Type1 = New Element(Element.Types.Normal)
p.Type2 = New Element(Element.Types.Blank)
If Not p.Item Is Nothing Then
Dim changeType As Boolean = False
Dim newType As Element = Nothing
Select Case p.Item.Name.ToLower()
Case "draco plate"
changeType = True
newType = New Element(Element.Types.Dragon)
Case "dread plate"
changeType = True
newType = New Element(Element.Types.Dark)
Case "earth plate"
changeType = True
newType = New Element(Element.Types.Ground)
Case "fist plate"
changeType = True
newType = New Element(Element.Types.Fighting)
Case "flame plate"
changeType = True
newType = New Element(Element.Types.Fire)
Case "icicle plate"
changeType = True
newType = New Element(Element.Types.Ice)
Case "insect plate"
changeType = True
newType = New Element(Element.Types.Bug)
Case "iron plate"
changeType = True
newType = New Element(Element.Types.Steel)
Case "meadow plate"
changeType = True
newType = New Element(Element.Types.Grass)
Case "mind plate"
changeType = True
newType = New Element(Element.Types.Psychic)
Case "sky plate"
changeType = True
newType = New Element(Element.Types.Flying)
Case "splash plate"
changeType = True
newType = New Element(Element.Types.Water)
Case "spooky plate"
changeType = True
newType = New Element(Element.Types.Ghost)
Case "stone plate"
changeType = True
newType = New Element(Element.Types.Rock)
Case "toxic plate"
changeType = True
newType = New Element(Element.Types.Poison)
Case "zap plate"
changeType = True
newType = New Element(Element.Types.Electric)
End Select
If changeType = True Then
p.Type1 = newType
p.Type2 = New Element(Element.Types.Blank)
End If
End If
.BattleQuery.Add(New TextQueryObject(p.GetDisplayName() & "'s type changed to " & p.Type1.ToString() & "!"))
Case "imposter"
'Doing the ditto stuff!
End Select
If .OppPokemon.Status = Pokemon.StatusProblems.Sleep Then If .OppPokemon.Status = Pokemon.StatusProblems.Sleep Then
.FieldEffects.OppSleepTurns = Core.Random.Next(1, 4) .FieldEffects.OppSleepTurns = Core.Random.Next(1, 4)

View File

@ -182,11 +182,11 @@
Dim speed As Integer = CInt(p.Speed * GetMultiplierFromStat(p.StatSpeed)) 'Calculate the speed's basic value from the speed and the speed stat Dim speed As Integer = CInt(p.Speed * GetMultiplierFromStat(p.StatSpeed)) 'Calculate the speed's basic value from the speed and the speed stat
If own = True Then If own = True Then
If BattleScreen.IsPVPBattle = False Then If BattleScreen.IsPVPBattle = False Then
If Core.Player.Badges.Contains(3) = True Then If Core.Player.Badges.Contains(3) = True Then
speed = CInt(speed + (speed * (1 / 8))) 'Add 1/8 of the speed if the player has the 3rd badge and it's not a PvP battle speed = CInt(speed + (speed * (1 / 8))) 'Add 1/8 of the speed if the player has the 3rd badge and it's not a PvP battle
End If End If
End If End If
End If End If
If p.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Paralyzed And p.Ability.Name.ToLower() <> "quick feet" Then If p.Status = net.Pokemon3D.Game.Pokemon.StatusProblems.Paralyzed And p.Ability.Name.ToLower() <> "quick feet" Then
@ -538,7 +538,7 @@
If UsedAttack.ID = 524 Then If UsedAttack.ID = 524 Then
Return True Return True
End If End If
Return False Return False
End Function End Function
@ -621,7 +621,7 @@
Dim effectiveness As Single = Type1 * Type2 Dim effectiveness As Single = Type1 * Type2
'Freeze Dry 'Freeze Dry
If move.ID = 573 Then If move.ID = 573 Then
If op.Type1.Type = Element.Types.Water Or op.Type2.Type = Element.Types.Water Then If op.Type1.Type = Element.Types.Water Or op.Type2.Type = Element.Types.Water Then
effectiveness *= 4 effectiveness *= 4
End If End If
@ -1172,7 +1172,7 @@
Case Else Case Else
UA = 1.0F UA = 1.0F
End Select End Select
'FA (Foe ability) 'FA (Foe ability)
Select Case Op.Ability.Name.ToLower() Select Case Op.Ability.Name.ToLower()
Case "thick fat" Case "thick fat"
@ -1378,7 +1378,7 @@
End Select End Select
End If End If
End If End If
'Critical hit interaction with attack stat change 'Critical hit interaction with attack stat change
If ASM < 1.0F AndAlso Critical = True Then If ASM < 1.0F AndAlso Critical = True Then
ASM = 1.0F ASM = 1.0F
@ -1462,16 +1462,16 @@
End If End If
End If End If
End If End If
If DSM > 1.0F AndAlso Critical = True Then If DSM > 1.0F AndAlso Critical = True Then
DSM = 1.0F DSM = 1.0F
End If End If
'Sacred Sword ignores defense stat changes 'Sacred Sword ignores defense stat changes
If Attack.ID = 533 Then If Attack.ID = 533 Then
DSM = 1.0F DSM = 1.0F
End If End If
Def = CInt(Math.Floor(DStat * DSM * DMod * SX)) Def = CInt(Math.Floor(DStat * DSM * DMod * SX))
If Def <= 0 Then If Def <= 0 Then
@ -1861,7 +1861,7 @@
Return 1.0F Return 1.0F
End Select End Select
End Function End Function
Public Shared Function GetMultiplierFromAccEvasion(ByVal StatValue As Integer) As Single Public Shared Function GetMultiplierFromAccEvasion(ByVal StatValue As Integer) As Single
Select Case StatValue Select Case StatValue
Case -6 Case -6