mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-28 00:04:33 +02:00
MoveHits effects added
Effects added: message, drainhp, gainhp Status effect now have a second argument (separated with a ",") to define the chance (integer between 0 and 100) Also fixed Freeze effect, which used to execute a Burn effect instead.
This commit is contained in:
parent
d96fdbd80a
commit
4cca56097e
@ -12,23 +12,71 @@
|
|||||||
''' <param name="own">Own toggle.</param>
|
''' <param name="own">Own toggle.</param>
|
||||||
''' <param name="BattleScreen">Reference to the BattleScreen.</param>
|
''' <param name="BattleScreen">Reference to the BattleScreen.</param>
|
||||||
Public Shared Sub ExecuteAttackFunction(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
Public Shared Sub ExecuteAttackFunction(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
||||||
Dim functions() As String = Move.GameModeFunction.Split(CChar(","))
|
Dim functions() As String = Move.GameModeFunction.Split(CChar("|"))
|
||||||
|
For i = 0 To functions.Count - 1
|
||||||
For Each f As String In functions
|
Dim f As String = functions(i)
|
||||||
Select Case f.ToLower()
|
Dim fMain As String = f
|
||||||
Case "paralyze"
|
Dim fSub As String = ""
|
||||||
Paralyze(Move, own, BattleScreen)
|
If f.Contains(",") = True Then
|
||||||
Case "poison"
|
fMain = f.GetSplit(0, ",")
|
||||||
Poison(Move, own, BattleScreen)
|
Select Case fMain.ToLower()
|
||||||
Case "toxic", "badpoison"
|
Case "message"
|
||||||
BadPoison(Move, own, BattleScreen)
|
fSub = Localization.GetString(f.GetSplit(1, ","), f.GetSplit(1, ","))
|
||||||
Case "burn"
|
Case "reducehp", "drainhp", "damage"
|
||||||
Burn(Move, own, BattleScreen)
|
Dim HPAmount As Integer = CInt(fSub.GetSplit(0, ","))
|
||||||
Case "freeze"
|
Dim Message As String = ""
|
||||||
Burn(Move, own, BattleScreen)
|
Dim Target As Boolean = True
|
||||||
Case "sleep"
|
If fSub.Split(CChar(",")).Count > 1 Then
|
||||||
Sleep(Move, own, BattleScreen)
|
Target = CBool(fSub.GetSplit(1, ","))
|
||||||
|
If fSub.Split(CChar(",")).Count > 2 Then
|
||||||
|
Message = fSub.GetSplit(2, ",")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
BattleScreen.Battle.ReduceHP(HPAmount, Not Target, Target, BattleScreen, Message, Move.Name.ToLower)
|
||||||
|
Case "gainhp", "increasehp", "heal"
|
||||||
|
Dim HPAmount As Integer = CInt(fSub.GetSplit(0, ","))
|
||||||
|
Dim Message As String = ""
|
||||||
|
Dim Target As Boolean = True
|
||||||
|
If fSub.Split(CChar(",")).Count > 1 Then
|
||||||
|
Target = CBool(fSub.GetSplit(1, ","))
|
||||||
|
If fSub.Split(CChar(",")).Count > 2 Then
|
||||||
|
Message = fSub.GetSplit(2, ",")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
BattleScreen.Battle.GainHP(HPAmount, Target, Target, BattleScreen, Message, Move.Name.ToLower)
|
||||||
|
Case Else
|
||||||
|
fSub = CInt(f.GetSplit(1, ",")).Clamp(0, 100).ToString
|
||||||
End Select
|
End Select
|
||||||
|
Else
|
||||||
|
Select Case f.ToLower()
|
||||||
|
Case "freeze"
|
||||||
|
fSub = "15"
|
||||||
|
Case "poison"
|
||||||
|
fSub = "40"
|
||||||
|
Case "toxic", "badpoison"
|
||||||
|
fSub = "25"
|
||||||
|
Case Else
|
||||||
|
fSub = "30"
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
Select Case fMain.ToLower()
|
||||||
|
Case "message"
|
||||||
|
BattleScreen.BattleQuery.Add(New TextQueryObject(fSub))
|
||||||
|
Case "paralyze"
|
||||||
|
Paralyze(Move, own, BattleScreen, CInt(fSub))
|
||||||
|
Case "poison"
|
||||||
|
Poison(Move, own, BattleScreen, CInt(fSub))
|
||||||
|
Case "toxic", "badpoison"
|
||||||
|
BadPoison(Move, own, BattleScreen, CInt(fSub))
|
||||||
|
Case "burn"
|
||||||
|
Burn(Move, own, BattleScreen, CInt(fSub))
|
||||||
|
Case "freeze"
|
||||||
|
Freeze(Move, own, BattleScreen, CInt(fSub))
|
||||||
|
Case "sleep"
|
||||||
|
Sleep(Move, own, BattleScreen, CInt(fSub))
|
||||||
|
End Select
|
||||||
|
i += 1
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -36,52 +84,52 @@
|
|||||||
If move.Category = Attack.Categories.Special Then
|
If move.Category = Attack.Categories.Special Then
|
||||||
Return True
|
Return True
|
||||||
Else
|
Else
|
||||||
Return Core.Random.Next(0, 100) < chance
|
Return Core.Random.Next(0, 100) <= chance
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Shared Sub Paralyze(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
Private Shared Sub Paralyze(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
If GetEffectChanceResult(Move, 30) = True Then
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
If BattleScreen.Battle.InflictParalysis(Not own, own, BattleScreen, "", "move:" & Move.Name.ToLower()) = False Then
|
If BattleScreen.Battle.InflictParalysis(Not own, own, BattleScreen, "", "move:" & Move.Name.ToLower()) = False Then
|
||||||
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Burn(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
Private Shared Sub Burn(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
If GetEffectChanceResult(Move, 30) = True Then
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
If BattleScreen.Battle.InflictBurn(Not own, own, BattleScreen, "", "move:" & Move.Name.ToLower()) = False Then
|
If BattleScreen.Battle.InflictBurn(Not own, own, BattleScreen, "", "move:" & Move.Name.ToLower()) = False Then
|
||||||
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Sleep(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
Private Shared Sub Sleep(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
If GetEffectChanceResult(Move, 30) = True Then
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
If BattleScreen.Battle.InflictSleep(Not own, own, BattleScreen, -1, "", "move:" & Move.Name.ToLower()) = False Then
|
If BattleScreen.Battle.InflictSleep(Not own, own, BattleScreen, -1, "", "move:" & Move.Name.ToLower()) = False Then
|
||||||
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Freeze(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
Private Shared Sub Freeze(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
If GetEffectChanceResult(Move, 15) = True Then
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
If BattleScreen.Battle.InflictFreeze(Not own, own, BattleScreen, "", "move:" & Move.Name.ToLower()) = False Then
|
If BattleScreen.Battle.InflictFreeze(Not own, own, BattleScreen, "", "move:" & Move.Name.ToLower()) = False Then
|
||||||
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub Poison(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
Private Shared Sub Poison(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
If GetEffectChanceResult(Move, 40) = True Then
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
If BattleScreen.Battle.InflictPoison(Not own, own, BattleScreen, False, "", "move:" & Move.Name.ToLower()) = False Then
|
If BattleScreen.Battle.InflictPoison(Not own, own, BattleScreen, False, "", "move:" & Move.Name.ToLower()) = False Then
|
||||||
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub BadPoison(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen)
|
Private Shared Sub BadPoison(ByVal Move As Attack, ByVal own As Boolean, ByVal BattleScreen As BattleScreen, Chance As Integer)
|
||||||
If GetEffectChanceResult(Move, 25) = True Then
|
If GetEffectChanceResult(Move, Chance) = True Then
|
||||||
If BattleScreen.Battle.InflictPoison(Not own, own, BattleScreen, True, "", "move:" & Move.Name.ToLower()) = False Then
|
If BattleScreen.Battle.InflictPoison(Not own, own, BattleScreen, True, "", "move:" & Move.Name.ToLower()) = False Then
|
||||||
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
If Move.Category = Attack.Categories.Status Then BattleScreen.BattleQuery.Add(New TextQueryObject(Move.Name & " failed!"))
|
||||||
End If
|
End If
|
||||||
|
@ -63,8 +63,12 @@
|
|||||||
move.CurrentPP = CInt(value)
|
move.CurrentPP = CInt(value)
|
||||||
move.MaxPP = CInt(value)
|
move.MaxPP = CInt(value)
|
||||||
move.OriginalPP = CInt(value)
|
move.OriginalPP = CInt(value)
|
||||||
Case "function"
|
Case "function", "movehits"
|
||||||
|
If move.GameModeFunction = "" Then
|
||||||
move.GameModeFunction = value
|
move.GameModeFunction = value
|
||||||
|
Else
|
||||||
|
move.GameModeFunction &= "|" & value
|
||||||
|
End If
|
||||||
Case "power", "basepower"
|
Case "power", "basepower"
|
||||||
move.Power = CInt(value)
|
move.Power = CInt(value)
|
||||||
Case "accuracy", "acc"
|
Case "accuracy", "acc"
|
||||||
@ -105,7 +109,6 @@
|
|||||||
move.Priority = CInt(value)
|
move.Priority = CInt(value)
|
||||||
Case "timestoattack", "tta"
|
Case "timestoattack", "tta"
|
||||||
move.TimesToAttack = CInt(value)
|
move.TimesToAttack = CInt(value)
|
||||||
|
|
||||||
Case "makescontact", "contact"
|
Case "makescontact", "contact"
|
||||||
move.MakesContact = CBool(value)
|
move.MakesContact = CBool(value)
|
||||||
Case "protectaffected"
|
Case "protectaffected"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user