diff --git a/.gitignore b/.gitignore
index 0169b2647..f02fbbf68 100644
--- a/.gitignore
+++ b/.gitignore
@@ -110,3 +110,7 @@ git-journal.fish
/Set-AssemblyVersion.ps1
/packages
*.DoxyFile
+*.meta
+* - Copy.cs
+* - Copy.cs.meta
+/PokemonUnity.WinForm/Resources
diff --git a/PokemonLibrary.sln b/PokemonLibrary.sln
index c77e3ca6c..347ab6a64 100644
--- a/PokemonLibrary.sln
+++ b/PokemonLibrary.sln
@@ -10,6 +10,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1909DF4C-3567-4A1F-8BB6-C2DE6584088D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
+ PokemonUnity.Application\.editorconfig = PokemonUnity.Application\.editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
.gitmodules = .gitmodules
diff --git a/PokemonUnity.Application/.editorconfig b/PokemonUnity.Application/.editorconfig
new file mode 100644
index 000000000..2d657d2aa
--- /dev/null
+++ b/PokemonUnity.Application/.editorconfig
@@ -0,0 +1,13 @@
+[*.cs]
+
+# CS0162: Unreachable code detected
+dotnet_diagnostic.CS0162.severity = silent
+# CS0219: The variable is assigned but its value is never used
+dotnet_diagnostic.CS0219.severity = silent
+dotnet_diagnostic.CS0414.severity = silent
+dotnet_diagnostic.CS0067.severity = silent
+# CS0472: The result of the expression is always 'true'
+dotnet_diagnostic.CS0472.severity = silent
+# CS0618: Entity used is obsolete
+#dotnet_diagnostic.CS0618.severity = silent
+#dotnet_diagnostic.CS0612.severity = silent
diff --git a/PokemonUnity.Application/Character/Bag.cs b/PokemonUnity.Application/Character/Bag.cs
index af80004c5..70c7fc3ce 100644
--- a/PokemonUnity.Application/Character/Bag.cs
+++ b/PokemonUnity.Application/Character/Bag.cs
@@ -10,19 +10,19 @@
using PokemonUnity.Character;
namespace PokemonUnity.Character
-{
+{
///
/// Collection of KeyValuePairs grouped by Items.
- /// Used in combination with quantity[],
- /// one holds the itemId (Key) and the other
+ /// Used in combination with quantity[],
+ /// one holds the itemId (Key) and the other
/// has amount (value).
///
/// I'd feel more comfortable if instead of {get;set;}
/// it was a {get;} only, that returned an iqueryable
/// ToDo: remove static
/// so trainerbag can load multiple players (for netplay)
- /*[System.Obsolete("Something i plan to transistion to; not yet ready for full integration")]
- public class Bag_Refactor
+ /*[System.Obsolete("Something i plan to transition to; not yet ready for full integration")]
+ public class Bag : PokemonEssentials.Interface.Screen.IBag
{
#region Variables
private List items { get; set; }
@@ -246,7 +246,7 @@ public KeyValuePair[] Sort(Order by)
}
return items.ToArray();
}
-
+
///
/// If the player has the in their inventory.
///
@@ -269,7 +269,7 @@ public bool HasMegaBracelet()
/// newer gens automatically give at start, so default is true...
public bool HasRunningShoes()
{
- //if (!items.Contains(Items.RUNNING_SHOES))
+ //if (!items.Contains(Items.RUNNING_SHOES))
// return false;
return true;
@@ -340,7 +340,7 @@ public bool CanStore(Items item)
//Check if item has storage limit
//Check if storage limit is met
//ToDo: If pocket is full, cannot hold any more items.
- //ToDo: if individual item capicity is reached, reject add
+ //ToDo: if individual item capacity is reached, reject add
if (Kernal.ItemData[item].Pocket == ItemPockets.MISC)
{
if (Core.MAXPOCKETSIZE[(int)ItemPockets.MISC] == -1) return true;
@@ -368,13 +368,13 @@ public void GetMessageReceive(Items item, IScene scene, int quantity = 1)
Message = Game.GameData.Player.Name + " stored it in the~" + Kernal.ItemData[item].Pocket.ToString() + " pocket.";
else
Message = Game.GameData.Player.Name + " stored them~in the " + Kernal.ItemData[item].Pocket.ToString() + " pocket.";
- //scene.pbDisplayMessage(Message);
+ //scene.DisplayMessage(Message);
}
public enum Order
{
Alphabet,
- Quantity,
+ Quantity,
Category,
Price
}
@@ -393,7 +393,7 @@ public partial class PokemonBag : PokemonEssentials.Interface.Screen.IBag {
private Dictionary choices;
public string[] pocketNames { get {
- return null; //Game.GameData.pbPocketNames();
+ return null; //Game.GameData.PocketNames();
} }
//public ItemPockets pockets { get {
// rearrange();
@@ -429,7 +429,7 @@ public void rearrange() {
int nump=numPockets;
for (int i = 0; i < @pockets.Length; i++) {
foreach (Items item in @pockets[i]) {
- //ItemPockets p=pbGetPocket(item[0]);
+ //ItemPockets p=GetPocket(item[0]);
ItemPockets p=Kernal.ItemData[item].Pocket??ItemPockets.MISC;
if ((int)p<=nump) newpockets[(int)p].Add(item);
}
@@ -484,9 +484,9 @@ public void setChoice(ItemPockets pocket,int value) {
/// Can be retrieved with
///
///
- public void pbRegisterKeyItem(Items item) {
+ public void RegisterKeyItem(Items item) {
//if (item is String || item is Symbol) {
- // item=getID(PBItems,item);
+ // item=getID(Items,item);
//}
//if (item == null || item<1) {
// //throw new Exception(Game._INTL("The item number is invalid."));
@@ -501,105 +501,105 @@ public int maxPocketSize(int pocket) {
return maxsize.Value;
}
- public int pbQuantity(Items item) {
+ public int Quantity(Items item) {
//if (item is String || item is Symbol) {
- // item=getID(PBItems,item);
+ // item=getID(Items,item);
//}
//if (item == null || item<1) {
// //throw new Exception(Game._INTL("The item number is invalid."));
// return 0;
//}
- //ItemPockets pocket=pbGetPocket(item);
+ //ItemPockets pocket=GetPocket(item);
int pocket=(int)(Kernal.ItemData[item].Pocket??ItemPockets.MISC);
int maxsize=maxPocketSize(pocket);
if (maxsize<0) maxsize=@pockets[(int)pocket].Length;
- return ItemStorageHelper.pbQuantity(@pockets[pocket],maxsize,item);
+ return ItemStorageHelper.Quantity(@pockets[pocket],maxsize,item);
}
- public bool pbHasItem (Items item) {
- return pbQuantity(item)>0;
+ public bool HasItem (Items item) {
+ return Quantity(item)>0;
}
- public bool pbDeleteItem(Items item,int qty=1) {
+ public bool DeleteItem(Items item,int qty=1) {
//if (item is String || item is Symbol) {
- // item=getID(PBItems,item);
+ // item=getID(Items,item);
//}
//if (item == null || item<1) {
// //throw new Exception(Game._INTL("The item number is invalid."));
// return false;
//}
- //ItemPockets pocket=pbGetPocket(item);
+ //ItemPockets pocket=GetPocket(item);
int pocket=(int)(Kernal.ItemData[item].Pocket??ItemPockets.MISC);
int maxsize=maxPocketSize(pocket);
if (maxsize<0) maxsize=@pockets[pocket].Length;
- bool ret=ItemStorageHelper.pbDeleteItem(ref @pockets[pocket],maxsize,item,qty);
+ bool ret=ItemStorageHelper.DeleteItem(ref @pockets[pocket],maxsize,item,qty);
if (ret) {
- if (@registeredItem==item && !pbHasItem(item)) @registeredItem=0;
+ if (@registeredItem==item && !HasItem(item)) @registeredItem=0;
}
return ret;
}
- public bool pbCanStore (Items item,int qty=1) {
+ public bool CanStore (Items item,int qty=1) {
//if (item is String || item is Symbol) {
- // item=getID(PBItems,item);
+ // item=getID(Items,item);
//}
//if (!item || item<1) {
// //throw new Exception(Game._INTL("The item number is invalid."));
// return false;
//}
- //ItemPockets pocket=pbGetPocket(item);
+ //ItemPockets pocket=GetPocket(item);
int pocket=(int)(Kernal.ItemData[item].Pocket??ItemPockets.MISC);
int maxsize=maxPocketSize(pocket);
if (maxsize<0) maxsize=@pockets[pocket].Length+1;
- return ItemStorageHelper.pbCanStore(
+ return ItemStorageHelper.CanStore(
@pockets[pocket],maxsize,Core.BAGMAXPERSLOT,item,qty);
}
- public bool pbStoreAllOrNone(Items item,int qty=1) {
- //if (item is String || item is Symbol) {
- // item=getID(PBItems,item);
- //}
- //if (item == null || item<1) {
- // //throw new Exception(Game._INTL("The item number is invalid."));
- // return false;
- //}
- //ItemPockets pocket=pbGetPocket(item);
- int pocket=(int)(Kernal.ItemData[item].Pocket??ItemPockets.MISC);
- int maxsize=maxPocketSize(pocket);
- if (maxsize<0) maxsize=@pockets[pocket].Length+1;
- return ItemStorageHelper.pbStoreItem(ref
- @pockets[pocket],maxsize,Core.BAGMAXPERSLOT,item,qty);
+ public bool StoreAllOrNone(Items item,int qty=1) {
+ //if (item is String || item is Symbol) {
+ // item=getID(Items,item);
+ //}
+ //if (item == null || item<1) {
+ // //throw new Exception(Game._INTL("The item number is invalid."));
+ // return false;
+ //}
+ //ItemPockets pocket=GetPocket(item);
+ int pocket=(int)(Kernal.ItemData[item].Pocket??ItemPockets.MISC);
+ int maxsize=maxPocketSize(pocket);
+ if (maxsize<0) maxsize=@pockets[pocket].Length+1;
+ return ItemStorageHelper.StoreItem(ref
+ @pockets[pocket],maxsize,Core.BAGMAXPERSLOT,item,qty);
}
- public bool pbStoreItem(Items item,int qty=1) {
+ public bool StoreItem(Items item,int qty=1) {
//if (item is String || item is Symbol) {
- // item=getID(PBItems,item);
+ // item=getID(Items,item);
//}
//if (item == null || item<1) {
// //throw new Exception(Game._INTL("The item number is invalid."));
// return false;
//}
- //ItemPockets pocket=pbGetPocket(item);
+ //ItemPockets pocket=GetPocket(item);
int pocket=(int)(Kernal.ItemData[item].Pocket??ItemPockets.MISC);
int maxsize=maxPocketSize(pocket);
if (maxsize<0) maxsize=@pockets[pocket].Length+1;
- return ItemStorageHelper.pbStoreItem(ref
+ return ItemStorageHelper.StoreItem(ref
@pockets[pocket],maxsize,Core.BAGMAXPERSLOT,item,qty,true);
}
- public bool pbChangeItem(Items olditem,Items newitem) {
+ public bool ChangeItem(Items olditem,Items newitem) {
//if (olditem is String || olditem is Symbol) {
- // olditem=getID(PBItems,olditem);
+ // olditem=getID(Items,olditem);
//}
//if (newitem is String || newitem is Symbol) {
- // newitem=getID(PBItems,newitem);
+ // newitem=getID(Items,newitem);
//}
//if (olditem == null || olditem<1 || newitem == null || newitem<1) {
if ((int)olditem<1 || (int)newitem<1) {
//throw new Exception(Game._INTL("The item number is invalid."));
return false;
}
- //ItemPockets pocket=pbGetPocket(olditem);
+ //ItemPockets pocket=GetPocket(olditem);
int pocket=(int)(Kernal.ItemData[olditem].Pocket??ItemPockets.MISC);
int maxsize=maxPocketSize(pocket);
if (maxsize<0) maxsize=@pockets[pocket].Length;
diff --git a/PokemonUnity.Application/Character/DayCare.cs b/PokemonUnity.Application/Character/DayCare.cs
index 9161ef1b8..946e613bd 100644
--- a/PokemonUnity.Application/Character/DayCare.cs
+++ b/PokemonUnity.Application/Character/DayCare.cs
@@ -26,7 +26,7 @@ public class DayCare : PokemonEssentials.Interface.Field.IDayCare
public bool HasEgg { get; }
public int Egg { get; }
public IPokemon this[int index]
- {
+ {
get { return Slot[index].Key; }
set { Slot[index] = new KeyValuePair(value, 0); } //ToDo: Add if/else null?
}
@@ -40,12 +40,12 @@ public DayCare(int slots)
#endregion
#region Methods
- public bool pbEggGenerated() {
- if (pbDayCareDeposited()!=2) return false;
+ public bool EggGenerated() {
+ if (DayCareDeposited()!=2) return false;
return Game.GameData.Global.daycareEgg;//==1;
}
- public int pbDayCareDeposited() {
+ public int DayCareDeposited() {
int ret=0;
for (int i = 0; i < 2; i++) {
if (this[i].IsNotNullOrNone()) ret+=1;//[0]
@@ -53,7 +53,7 @@ public int pbDayCareDeposited() {
return ret;
}
- public void pbDayCareDeposit(int index) {
+ public void DayCareDeposit(int index) {
for (int i = 0; i < 2; i++) {
if (!this[i].IsNotNullOrNone()) {//[0]
this[i]=Game.GameData.Trainer.party[index];//[0]
@@ -72,7 +72,7 @@ public void pbDayCareDeposit(int index) {
GameDebug.LogError(Game._INTL("No room to deposit a Pokémon"));
}
- public bool pbDayCareGetLevelGain(int index,int nameVariable,int levelVariable) {
+ public bool DayCareGetLevelGain(int index,int nameVariable,int levelVariable) {
IPokemon pkmn=this[index];//[0];
if (!pkmn.IsNotNullOrNone()) return false;
Game.GameData.GameVariables[nameVariable]=pkmn.Name;
@@ -80,7 +80,7 @@ public bool pbDayCareGetLevelGain(int index,int nameVariable,int levelVariable)
return true;
}
- public void pbDayCareGetDeposited(int index,int nameVariable,int costVariable) {
+ public void DayCareGetDeposited(int index,int nameVariable,int costVariable) {
for (int i = 0; i < 2; i++) {
if ((index<0||i==index) && this[i].IsNotNullOrNone()) {//[0]
int cost=this[i].Level-this[i].Level;//[0]|[1] ToDo: Levels raised since drop-off
@@ -96,9 +96,9 @@ public void pbDayCareGetDeposited(int index,int nameVariable,int costVariable) {
GameDebug.LogError(Game._INTL("Can't find deposited Pokémon"));
}
- public bool pbIsDitto (IPokemon pokemon) {
- //dexdata=pbOpenDexData();
- //pbDexDataOffset(dexdata,pokemon.Species,31);
+ public bool IsDitto (IPokemon pokemon) {
+ //dexdata=OpenDexData();
+ //DexDataOffset(dexdata,pokemon.Species,31);
EggGroups compat10=Kernal.PokemonData[pokemon.Species].EggGroup[0]; //dexdata.fgetb();
EggGroups compat11=Kernal.PokemonData[pokemon.Species].EggGroup[1]; //dexdata.fgetb();
//dexdata.close();
@@ -106,29 +106,29 @@ public bool pbIsDitto (IPokemon pokemon) {
compat11 == EggGroups.DITTO;
}
- public bool pbDayCareCompatibleGender(IPokemon pokemon1,IPokemon pokemon2) {
+ public bool DayCareCompatibleGender(IPokemon pokemon1,IPokemon pokemon2) {
if ((pokemon1.IsFemale && pokemon2.IsMale) ||
(pokemon1.IsMale && pokemon2.IsFemale)) {
return true;
}
- bool ditto1=pbIsDitto(pokemon1);
- bool ditto2=pbIsDitto(pokemon2);
+ bool ditto1=IsDitto(pokemon1);
+ bool ditto2=IsDitto(pokemon2);
if (ditto1 && !ditto2) return true;
if (ditto2 && !ditto1) return true;
return false;
}
- public int pbDayCareGetCompat() {
- if (pbDayCareDeposited()==2) {
+ public int DayCareGetCompat() {
+ if (DayCareDeposited()==2) {
IPokemon pokemon1=this[0];//[0];
IPokemon pokemon2=this[1];//[0];
if (pokemon1 is IPokemonShadowPokemon s0 && s0.isShadow) return 0; //? rescue false
if (pokemon2 is IPokemonShadowPokemon s1 && s1.isShadow) return 0; //? rescue false
- //dexdata=pbOpenDexData();
- //pbDexDataOffset(dexdata,pokemon1.Species,31);
+ //dexdata=OpenDexData();
+ //DexDataOffset(dexdata,pokemon1.Species,31);
EggGroups compat10=Kernal.PokemonData[pokemon1.Species].EggGroup[0]; //dexdata.fgetb();
EggGroups compat11=Kernal.PokemonData[pokemon1.Species].EggGroup[1]; //dexdata.fgetb();
- //pbDexDataOffset(dexdata,pokemon2.Species,31);
+ //DexDataOffset(dexdata,pokemon2.Species,31);
EggGroups compat20=Kernal.PokemonData[pokemon1.Species].EggGroup[0]; //dexdata.fgetb();
EggGroups compat21=Kernal.PokemonData[pokemon1.Species].EggGroup[1]; //dexdata.fgetb();
//dexdata.close();
@@ -142,7 +142,7 @@ public int pbDayCareGetCompat() {
compat11 == EggGroups.DITTO ||
compat20 == EggGroups.DITTO ||
compat21 == EggGroups.DITTO) {
- if (pbDayCareCompatibleGender(pokemon1,pokemon2)) {
+ if (DayCareCompatibleGender(pokemon1,pokemon2)) {
int ret=1;
if (pokemon1.Species==pokemon2.Species) ret+=1;
if (pokemon1.publicID!=pokemon2.publicID) ret+=1;
@@ -154,11 +154,11 @@ public int pbDayCareGetCompat() {
return 0;
}
- public void pbDayCareGetCompatibility(int variable) {
- Game.GameData.GameVariables[variable]=pbDayCareGetCompat();
+ public void DayCareGetCompatibility(int variable) {
+ Game.GameData.GameVariables[variable]=DayCareGetCompat();
}
- public void pbDayCareWithdraw(int index) {
+ public void DayCareWithdraw(int index) {
if (!this[index].IsNotNullOrNone()) {//[0]
//raise Game._INTL("There's no Pokémon here...");
//throw new Exception(Game._INTL("There's no Pokémon here..."));
@@ -175,8 +175,8 @@ public void pbDayCareWithdraw(int index) {
}
}
- public void pbDayCareChoose(string text,int variable) {
- int count=pbDayCareDeposited();
+ public void DayCareChoose(string text,int variable) {
+ int count=DayCareDeposited();
if (count==0) {
//raise Game._INTL("There's no Pokémon here...");
//throw new Exception(Game._INTL("There's no Pokémon here..."));
@@ -196,13 +196,13 @@ public void pbDayCareChoose(string text,int variable) {
}
}
choices.Add(Game._INTL("CANCEL"));
- int command=Game.GameData is IGameMessage m ? m.pbMessage(text,choices.ToArray(),choices.Count) : -1;
+ int command=Game.GameData is IGameMessage m ? m.Message(text,choices.ToArray(),choices.Count) : -1;
Game.GameData.GameVariables[variable]=(command==2) ? -1 : command;
}
}
- public void pbDayCareGenerateEgg() {
- if (pbDayCareDeposited()!=2) {
+ public void DayCareGenerateEgg() {
+ if (DayCareDeposited()!=2) {
return;
} else if (Game.GameData.Trainer.party.Length>=6) {
//raise Game._INTL("Can't store the egg");
@@ -214,8 +214,8 @@ public void pbDayCareGenerateEgg() {
IPokemon mother=null;
IPokemon father=null;
Pokemons babyspecies=0;
- bool ditto0=pbIsDitto(pokemon0);
- bool ditto1=pbIsDitto(pokemon1);
+ bool ditto0=IsDitto(pokemon0);
+ bool ditto1=IsDitto(pokemon1);
if ((pokemon0.IsFemale || ditto0)) {
babyspecies=(ditto0) ? pokemon1.Species : pokemon0.Species;
mother=pokemon0;
@@ -225,24 +225,24 @@ public void pbDayCareGenerateEgg() {
mother=pokemon1;
father=pokemon0;
}
- babyspecies= EvolutionHelper.pbGetBabySpecies(babyspecies,mother.Item,father.Item);
- if (babyspecies == Pokemons.MANAPHY) { //&& hasConst?(PBSpecies,:PHIONE)
+ babyspecies= EvolutionHelper.GetBabySpecies(babyspecies,mother.Item,father.Item);
+ if (babyspecies == Pokemons.MANAPHY) { //&& hasConst?(Species,:PHIONE)
babyspecies=Pokemons.PHIONE;
- } else if ((babyspecies == Pokemons.NIDORAN_F) || //&& hasConst?(PBSpecies,:NIDORANmA)
- (babyspecies == Pokemons.NIDORAN_M)) { //&& hasConst?(PBSpecies,:NIDORANfE)
+ } else if ((babyspecies == Pokemons.NIDORAN_F) || //&& hasConst?(Species,:NIDORANmA)
+ (babyspecies == Pokemons.NIDORAN_M)) { //&& hasConst?(Species,:NIDORANfE)
babyspecies=new Pokemons[]{ Pokemons.NIDORAN_M,
Pokemons.NIDORAN_F }[Core.Rand.Next(2)];
- } else if ((babyspecies == Pokemons.VOLBEAT) || //&& hasConst?(PBSpecies,:ILLUMISE)
- (babyspecies == Pokemons.ILLUMISE)) { //&& hasConst?(PBSpecies,:VOLBEAT)
+ } else if ((babyspecies == Pokemons.VOLBEAT) || //&& hasConst?(Species,:ILLUMISE)
+ (babyspecies == Pokemons.ILLUMISE)) { //&& hasConst?(Species,:VOLBEAT)
babyspecies=new Pokemons[] { Pokemons.VOLBEAT,
Pokemons.ILLUMISE }[Core.Rand.Next(2)];
}
//Generate egg
//IPokemon egg=new PokeBattle_Pokemon(babyspecies,Core.EGGINITIALLEVEL,Game.GameData.Player);
IPokemon egg=new Pokemon(babyspecies,Core.EGGINITIALLEVEL,isEgg: true);//,Game.GameData.Player
- //Randomise personal ID
- int pid=Core.Rand.Next(65536);
- pid|=(Core.Rand.Next(65536)<<16);
+ //Randomize personal ID
+ //int pid=Core.Rand.Next(65536);
+ //pid|=(Core.Rand.Next(65536)<<16);
//egg.PersonalId=pid;
//Inheriting form
if ((egg is IPokemonMultipleForms e && mother is IPokemonMultipleForms m) && (
@@ -256,13 +256,13 @@ public void pbDayCareGenerateEgg() {
HashSet moves=new HashSet();
HashSet othermoves=new HashSet();
IPokemon movefather=father;IPokemon movemother=mother;
- if (pbIsDitto(movefather) && !mother.IsFemale) {
+ if (IsDitto(movefather) && !mother.IsFemale) {
movefather=mother; movemother=father;
}
//Initial Moves
Moves[] initialmoves=egg.getMoveList(); //Level|Moves
//foreach (Moves k in initialmoves) { //Key: Level | Value: Move
- foreach (KeyValuePair k in Kernal.PokemonMovesData[egg.Species].LevelUp) {
+ foreach (KeyValuePair k in Kernal.PokemonMovesData[egg.Species].LevelUp) {
if (k.Value<=Core.EGGINITIALLEVEL) {
moves.Add(k.Key);
} else {
@@ -290,7 +290,7 @@ public void pbDayCareGenerateEgg() {
}
// Inheriting Egg Moves
if (movefather.IsMale) {
- //pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
+ //RgssOpen("Data/eggEmerald.dat","rb"){|f|
// f.pos=(babyspecies-1)*8;
// int offset=f.fgetdw;
// int length=f.fgetdw;
@@ -305,7 +305,7 @@ public void pbDayCareGenerateEgg() {
//}
}
if (Core.USENEWBATTLEMECHANICS) {
- //pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
+ //RgssOpen("Data/eggEmerald.dat","rb"){|f|
// f.pos=(babyspecies-1)*8;
// offset=f.fgetdw;
// length=f.fgetdw;
@@ -321,18 +321,18 @@ public void pbDayCareGenerateEgg() {
}
// Volt Tackle
bool lightball=false;
- if ((father.Species == Pokemons.PIKACHU ||
- father.Species == Pokemons.RAICHU) &&
+ if ((father.Species == Pokemons.PIKACHU ||
+ father.Species == Pokemons.RAICHU) &&
father.Item == Items.LIGHT_BALL) {
lightball=true;
}
- if ((mother.Species == Pokemons.PIKACHU ||
- mother.Species == Pokemons.RAICHU) &&
+ if ((mother.Species == Pokemons.PIKACHU ||
+ mother.Species == Pokemons.RAICHU) &&
mother.Item == Items.LIGHT_BALL) {
lightball=true;
}
if (lightball && babyspecies == Pokemons.PICHU
- ) { //&& hasConst?(PBMoves,:VOLTTACKLE)
+ ) { //&& hasConst?(Moves,:VOLTTACKLE)
moves.Add(Moves.VOLT_TACKLE);
}
//moves|=[]; // remove duplicates
@@ -398,8 +398,8 @@ public void pbDayCareGenerateEgg() {
// Masuda method and Shiny Charm
int shinyretries=0;
//if (father.language!=mother.language) shinyretries+=5;
- if (//hasConst?(PBItems,:SHINYCHARM) &&
- Game.GameData.Bag.pbQuantity(Items.SHINY_CHARM)>0) shinyretries+=2;
+ if (//hasConst?(Items,:SHINYCHARM) &&
+ Game.GameData.Bag.Quantity(Items.SHINY_CHARM)>0) shinyretries+=2;
if (shinyretries>0) {
for (int i = 0; i < shinyretries; i++) {
if (egg.IsShiny) break;
@@ -426,8 +426,8 @@ public void pbDayCareGenerateEgg() {
}
// Inheriting Poké Ball from the mother
if (mother.IsFemale &&
- mother.ballUsed != Items.MASTER_BALL && //!pbBallTypeToBall(mother.ballUsed)
- mother.ballUsed != Items.CHERISH_BALL){ //!pbBallTypeToBall(mother.ballUsed)
+ mother.ballUsed != Items.MASTER_BALL && //!BallTypeToBall(mother.ballUsed)
+ mother.ballUsed != Items.CHERISH_BALL){ //!BallTypeToBall(mother.ballUsed)
egg.ballUsed=mother.ballUsed;
}
egg.IV[0]=(byte)ivs[0];
@@ -443,8 +443,8 @@ public void pbDayCareGenerateEgg() {
//egg.calcStats();
//egg.obtainText=Game._INTL("Day-Care Couple"); //ToDo: Set obtain for daycare
//egg.Name=Game._INTL("Egg");
- //dexdata=pbOpenDexData();
- //pbDexDataOffset(dexdata,babyspecies,21);
+ //dexdata=OpenDexData();
+ //DexDataOffset(dexdata,babyspecies,21);
//int eggsteps=dexdata.fgetw;
//dexdata.close();
//egg.eggsteps=eggsteps;
@@ -457,15 +457,15 @@ public void pbDayCareGenerateEgg() {
//Events.onStepTaken+=delegate(object sender, EventArgs e) {
public void OnStepTakenEventHandler(object sender, IOnStepTakenFieldMovementEventArgs e) {
if (Game.GameData.Player == null) return;
- int deposited= this.pbDayCareDeposited();
+ int deposited= this.DayCareDeposited();
if (deposited==2 && !Game.GameData.Global.daycareEgg) {//==0
if (Game.GameData.Global.daycareEggSteps == null) Game.GameData.Global.daycareEggSteps=0;
Game.GameData.Global.daycareEggSteps+=1;
if (Game.GameData.Global.daycareEggSteps==256) {
Game.GameData.Global.daycareEggSteps=0;
- int compatval=new int[] {0,20,50,70}[this.pbDayCareGetCompat()];
- if (Game.GameData.Bag.pbQuantity(Items.OVAL_CHARM)>0) { //hasConst?(PBItems,:OVALCHARM) &&
- compatval=new int[] {0,40,80,88}[this.pbDayCareGetCompat()];
+ int compatval=new int[] {0,20,50,70}[this.DayCareGetCompat()];
+ if (Game.GameData.Bag.Quantity(Items.OVAL_CHARM)>0) { //hasConst?(Items,:OVALCHARM) &&
+ compatval=new int[] {0,40,80,88}[this.DayCareGetCompat()];
}
int rnd=Core.Rand.Next(100);
if (rnd j in movelist) {
- if (j.Value==pkmn.Level) pkmn.pbLearnMove(j.Key); // Learned a new move
+ if (j.Value==pkmn.Level) pkmn.LearnMove(j.Key); // Learned a new move
}
}
}
@@ -506,12 +506,12 @@ public void OnStepTakenEventHandler(object sender, IOnStepTakenFieldMovementEven
public bool Equals(DayCare obj)
{
if (obj == null) return false;
- return this == obj;
+ return this == obj;
}
public bool Equals(Character.Player obj)
{
if (obj == null) return false;
- return this == obj;
+ return this == obj;
}
public override bool Equals(object obj)
{
diff --git a/PokemonUnity.Application/Character/ItemStorage.cs b/PokemonUnity.Application/Character/ItemStorage.cs
new file mode 100644
index 000000000..d88e861a1
--- /dev/null
+++ b/PokemonUnity.Application/Character/ItemStorage.cs
@@ -0,0 +1,180 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using PokemonUnity;
+using PokemonUnity.Monster;
+using PokemonUnity.Attack;
+using PokemonUnity.Inventory;
+using PokemonUnity.Saving.SerializableClasses;
+using PokemonUnity.Character;
+
+namespace PokemonUnity.Character
+{
+ ///
+ /// The PC item storage object, which actually contains all the items
+ ///
+ public partial class PCItemStorage : PokemonEssentials.Interface.Screen.IPCItemStorage, IList, ICollection
+ {
+ ///
+ /// Number of different slots in storage
+ ///
+ public const int MAXSIZE = 50;
+ ///
+ /// Max. number of items per slot
+ ///
+ public const int MAXPERSLOT = 999;
+ private IList items;
+ int ICollection.Count { get { return items.Count; } }
+ bool ICollection.IsReadOnly { get { return items.IsReadOnly; } }
+
+ public PCItemStorage() { initialize(); }
+
+ public PokemonEssentials.Interface.Screen.IPCItemStorage initialize()
+ {
+ @items = new Items[0]; //[];
+ // Start storage with a Potion
+ //if (hasConst(Items,:POTION)) {
+ //ItemStorageHelper.StoreItem(ref
+ // @items.ToArray(), MAXSIZE, MAXPERSLOT, Items.POTION, 1);
+ //}
+ return this;
+ }
+
+ public bool empty()
+ {
+ return @items.Count == 0;
+ }
+
+ public int length()
+ {
+ return @items.Count;
+ }
+
+ public Items this[int i]
+ {
+ get
+ {
+ return @items[i];
+ }
+ set { (this as IList).Insert(i, value); }
+ }
+
+ public Items getItem(int index)
+ {
+ if (index < 0 || index >= @items.Count)
+ {
+ return 0;
+ }
+ else
+ {
+ return @items[index];//[0];
+ //return @items[index].Key;//[0];
+ }
+ }
+
+ public int getCount(int index)
+ {
+ if (index < 0 || index >= @items.Count)
+ {
+ return 0;
+ }
+ else
+ {
+ //return @items[index].Value;//[1];
+ return @items.Count;
+ }
+ }
+
+ public int Quantity(Items item)
+ {
+ return ItemStorageHelper.Quantity(@items.ToArray(), MAXSIZE, item);
+ }
+
+ public bool DeleteItem(Items item, int qty = 1)
+ {
+ Items[] i = @items.ToArray();
+ //return ItemStorageHelper.DeleteItem(ref @items.ToArray(), MAXSIZE, item, qty);
+ return ItemStorageHelper.DeleteItem(ref i, MAXSIZE, item, qty);
+ }
+
+ public bool CanStore(Items item, int qty = 1)
+ {
+ return ItemStorageHelper.CanStore(@items.ToArray(), MAXSIZE, MAXPERSLOT, item, qty);
+ }
+
+ public bool StoreItem(Items item, int qty = 1)
+ {
+ //Items[] i = @items.ToArray();
+ //return ItemStorageHelper.StoreItem(@items.ToArray(), MAXSIZE, MAXPERSLOT, item, qty);
+ //return ItemStorageHelper.StoreItem(ref items.ToArray(), MAXSIZE, MAXPERSLOT, item, qty);
+ return false; //ToDo: Uncomment and Finish
+ }
+
+ #region Interface Methods
+ void ICollection.Add(Items item)
+ {
+ //if there is space add to box
+ //if (!items.Contains(item) && item != Items.NONE)
+ // //items.Add(item);
+ // ItemStorageHelper.StoreItem(ref items.ToArray(), MAXSIZE, MAXPERSLOT, item, 1);
+ }
+
+ void ICollection.Clear()
+ {
+ //items.Clear();
+ initialize();
+ }
+
+ bool ICollection.Contains(Items item)
+ {
+ //should return false for both null and none
+ if (item == Items.NONE) return false;
+ return items.Contains(item);
+ }
+
+ void ICollection.CopyTo(Items[] array, int arrayIndex)
+ {
+ items.CopyTo(array, arrayIndex);
+ }
+
+ bool ICollection.Remove(Items item)
+ {
+ if (item == Items.NONE) return true;
+ //if object is removed, it will remove nulls and empty space
+ return items.Remove(item);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return items.GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return items.GetEnumerator();
+ }
+
+ int IList.IndexOf(Items item)
+ {
+ if (item == Items.NONE) return -1;
+ //return ((IList)items).IndexOf(item);
+ return items.IndexOf(item);
+ }
+
+ void IList.Insert(int index, Items item)
+ {
+ if (item == Items.NONE) return;
+ //return ((IList)items).Insert(index, item);
+ items.Insert(index, item);
+ }
+
+ void IList.RemoveAt(int index)
+ {
+ //((IList)items).RemoveAt(index);
+ items.RemoveAt(index);
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/PokemonUnity.Application/Character/PC.cs b/PokemonUnity.Application/Character/PC.cs
index b129af0c0..e3dde94fa 100644
--- a/PokemonUnity.Application/Character/PC.cs
+++ b/PokemonUnity.Application/Character/PC.cs
@@ -8,114 +8,19 @@
using PokemonUnity.Inventory;
using PokemonUnity.Saving.SerializableClasses;
using PokemonUnity.Character;
+using PokemonEssentials.Interface.Screen;
+using PokemonEssentials.Interface.PokeBattle;
namespace PokemonUnity.Character
{
- ///
- /// The PC item storage object, which actually contains all the items
- ///
- public partial class PCItemStorage : PokemonEssentials.Interface.Screen.IPCItemStorage
- {
- ///
- /// Number of different slots in storage
- ///
- public const int MAXSIZE = 50;
- ///
- /// Max. number of items per slot
- ///
- public const int MAXPERSLOT = 999;
- private IList items;
-
-
- public PCItemStorage() { initialize(); }
- public PokemonEssentials.Interface.Screen.IPCItemStorage initialize()
- {
- @items = new Items[0]; //[];
- // Start storage with a Potion
- //if (hasConst(PBItems,:POTION)) {
- //ItemStorageHelper.pbStoreItem(ref
- // @items.ToArray(), MAXSIZE, MAXPERSLOT, Items.POTION, 1);
- //}
- return this;
- }
-
- public bool empty()
- {
- return @items.Count == 0;
- }
-
- public int length()
- {
- return @items.Count;
- }
-
- public Items this[int i]
- {
- get
- {
- return @items[i];
- }
- }
-
- public Items getItem(int index)
- {
- if (index < 0 || index >= @items.Count)
- {
- return 0;
- }
- else
- {
- return @items[index];//[0];
- //return @items[index].Key;//[0];
- }
- }
-
- public int getCount(int index)
- {
- if (index < 0 || index >= @items.Count)
- {
- return 0;
- }
- else
- {
- //return @items[index].Value;//[1];
- return @items.Count;
- }
- }
-
- public int pbQuantity(Items item)
- {
- return ItemStorageHelper.pbQuantity(@items.ToArray(), MAXSIZE, item);
- }
-
- public bool pbDeleteItem(Items item, int qty = 1)
- {
- Items[] i = @items.ToArray();
- //return ItemStorageHelper.pbDeleteItem(ref @items.ToArray(), MAXSIZE, item, qty);
- return ItemStorageHelper.pbDeleteItem(ref i, MAXSIZE, item, qty);
- }
-
- public bool pbCanStore(Items item, int qty = 1)
- {
- return ItemStorageHelper.pbCanStore(@items.ToArray(), MAXSIZE, MAXPERSLOT, item, qty);
- }
-
- public bool pbStoreItem(Items item, int qty = 1)
- {
- Items[] i = @items.ToArray();
- //return ItemStorageHelper.pbStoreItem(@items.ToArray(), MAXSIZE, MAXPERSLOT, item, qty);
- return ItemStorageHelper.pbStoreItem(ref i, MAXSIZE, MAXPERSLOT, item, qty);
- }
- }
-
//ToDo: Add Function to add more boxes to player pc
// OR! A function to disable boxes until they're "unlocked"
// Max # of boxes would be hard-capped if option 2
//Add Game.GameData.Feature where player unlocks more boxes
- [System.Obsolete("Something i plan to transistion to; not yet ready for full integration")]
- public class PC_Refactor
+ [System.Obsolete("Something i plan to transition to; not yet ready for full integration")]
+ public class PC : PokemonEssentials.Interface.Screen.IPCPokemonStorage
{
- #region Variables
+ #region Variables
//private List mails { get; set; } //ToDo: Add Mail to PC class
///
///
@@ -124,13 +29,13 @@ public class PC_Refactor
///
//private List items { get; set; }
private Dictionary items { get; set; }
- private Pokemon[,] pokemons { get; set; }
+ private IPokemon[,] pokemons { get; set; }
//public Pokemon[,] AllBoxes { get { return pokemons; } }
- public Pokemon[][] AllBoxes
+ public IPokemon[][] AllBoxes
{
get
{
- Pokemon[][] pkmns = new Pokemon[pokemons.GetLength(0)][];
+ IPokemon[][] pkmns = new Pokemon[pokemons.GetLength(0)][];
for (int i = 0; i < pkmns.GetLength(0); i++)
{
pkmns[i] = new Pokemon[pokemons.GetLength(1)];
@@ -147,12 +52,12 @@ public Pokemon[][] AllBoxes
public int[] BoxTextures { get; private set; }
public string Name { get { return BoxNames[ActiveBox] ?? "Box " + (ActiveBox + 1).ToString(); } }
public int Texture { get { return BoxTextures[ActiveBox]; } }
- public Pokemon[] Pokemons
+ public IPokemon[] Pokemons
{
get
{
- Pokemon[] p = new Pokemon[30];
- for (int t = 0; t < 30; t++)
+ IPokemon[] p = new Pokemon[pokemons.GetLength(1)];
+ for (int t = 0; t < p.Length; t++)
{
p[t] = pokemons[ActiveBox, t];
}
@@ -181,7 +86,7 @@ public KeyValuePair[] Items
//int count = items.Where(x => x == item).Count();
int count = item.Value;
int groups = (int)Math.Floor(total / 99d);
- //Max number of items in an individual slot is capped
+ //Max number of items in an individual slot is capped
for (int i = 0; i < (int)Math.Floor(count / 99d); i++)
{
// pairs[index] = new KeyValuePair(item.Key, 99);
@@ -199,28 +104,82 @@ public KeyValuePair[] Items
return l.ToArray();
}
}
- //ToDo: return pokemon box, without changing activebox
- public PC_Refactor this[byte i]
+
+ #region Interface
+ IPokemonBox[] IPCPokemonStorage.boxes
{
get
{
- i = (byte)(i % Core.STORAGEBOXES);
+ IPokemonBox[] boxes = new PokemonBox[pokemons.GetLength(0)];
+ for (int i = 0; i < boxes.Length; i++)
+ {
+ //int ip1 = i + 1;
+ @boxes[i] = new PokemonBox(BoxNames[i] ?? "Box " + (i + 1).ToString(), //string.Format("Box {0}", ip1),
+ pokemons.GetLength(1));
+ //int backid = i % 24;
+ @boxes[i].background = BoxTextures[i].ToString(); //$"box{backid}";
+ }
+ return boxes;
+ }
+ }
+
+ int IPCPokemonStorage.currentBox { get { return ActiveBox; } set { ActiveBox = (byte)value; } }
+
+ int IPCPokemonStorage.maxBoxes { get { return pokemons.GetLength(0); } }
+
+ IPokemon[] IPCPokemonStorage.party { get { return Game.GameData.Trainer.party; } }
+
+ bool IPCPokemonStorage.full
+ {
+ get
+ {
+ for(int i = 0; i < pokemons.GetLength(1);i++)
+ {
+ if (!pokemons[ActiveBox, i].IsNotNullOrNone())
+ return false;
+ }
+ return true; //pokemons.Count(p => p.IsNotNullOrNone());
+ }
+ }
+
+ IPokemon IPCPokemonStorage.this[int x, int y] { get { return pokemons[x,y]; } set { pokemons[x, y] = value; } }
+
+ IPokemonBox IPCPokemonStorage.this[int x]
+ {
+ get
+ {
+ x = (byte)(x % pokemons.GetLength(0)); //Core.STORAGEBOXES);
+ return this[(byte)x];
+ }
+ }
+
+ //ToDo: return pokemon box, without changing activebox?
+ public IPokemonBox this[byte i]
+ {
+ get
+ {
+ i = (byte)(i % pokemons.GetLength(0)); //Core.STORAGEBOXES);
this.ActiveBox = i;
- //Pokemon[] p = new Pokemon[30];
- //for (int t = 0; t < 30; t++)
- //{
- // p[t] = Game.GameData.PC_Poke[i, t];
- //}
- //this.Pokemons = p;
- //this.Texture = Game.GameData.PC_boxTexture[i];
- //this.Name = Game.GameData.PC_boxNames[i] ?? "Box " + (i + 1).ToString();
- return this;
+ IPokemonBox box = new PokemonBox(BoxNames[i] ?? "Box " + (i + 1).ToString(), //string.Format("Box {0}", ip1),
+ pokemons.GetLength(1));
+ box.background = BoxTextures[i].ToString(); //$"box{backid}";
+ for (int t = 0; t < box.length; t++)
+ {
+ IPokemon p = pokemons[i, t];
+ if (p.IsNotNullOrNone())
+ {
+ //box[t] = pokemons[x, t];
+ box[t] = p; //Add
+ }
+ }
+ return box;
}
}
#endregion
+ #endregion
#region Constructors
- public PC_Refactor()
+ public PC()
{
//PC_Poke = new Pokemon[Core.STORAGEBOXES, 30];
pokemons = new Pokemon[Core.STORAGEBOXES, 30];
@@ -239,13 +198,13 @@ public PC_Refactor()
//ToDo: Using string from translator here
BoxNames[i] = string.Format("Box {0}", (i + 1).ToString());
//PC_boxTexture[i] = i;
- BoxTextures[i] = i;
+ BoxTextures[i] = i;
}
//PC_Items = new List();
items = new Dictionary() { { Inventory.Items.POTION, 1 } };
}
- public PC_Refactor(Pokemon[][] pkmns = null, KeyValuePair[] items = null, byte? box = null, string[] names = null, int[] textures = null) : this()
+ public PC(IPokemon[][] pkmns = null, KeyValuePair[] items = null, byte? box = null, string[] names = null, int[] textures = null) : this()
{
if (names != null)
BoxNames = names;
@@ -270,6 +229,11 @@ public PC_Refactor(Pokemon[][] pkmns = null, KeyValuePair[] items = n
pokemons[x, y] = pkmns[x][y];
}
//public PC(Pokemon[] pokemons = null, Items[] items = null, byte? box = null, string[] names = null, int[] textures = null) : this()
+
+ IPCPokemonStorage IPCPokemonStorage.initialize(int maxBoxes, int maxPokemon)
+ {
+ throw new NotImplementedException();
+ }
#endregion
#region Methods
@@ -318,13 +282,14 @@ public int getBoxCount(int box)
return result;
}
-
public bool removePokemon(int boxID, int pkmnID)
{
- if (this[Convert.ToByte(boxID)].Pokemons[pkmnID].IsNotNullOrNone())
+ byte x = (byte)(boxID % pokemons.GetLength(0)); //Core.STORAGEBOXES);
+ byte y = (byte)(pkmnID % pokemons.GetLength(1));
+ if (pokemons[x,y].IsNotNullOrNone())
{
Pokemons[pkmnID] = new Pokemon();
- pokemons[boxID, pkmnID] = new Pokemon();
+ pokemons[x, y] = new Pokemon();
return true;
}
return false;
@@ -333,7 +298,7 @@ public bool removePokemon(int boxID, int pkmnID)
//{
// try
// {
- // PokemonEssentials.Interface.PokeBattle.IPokemon PartyHolder = player.party[PartyID];
+ // PokemonEssentials.Interface.PokeBattle.IPokemon PartyHolder = player.party[PartyID];
// player.party[PartyID] = player.PC.Pokemons[PCBoxID];
// Pokemons[PCBoxID] = PartyHolder;
// pokemons[ActiveBox, PCBoxID] = PartyHolder;
@@ -345,7 +310,7 @@ public bool removePokemon(int boxID, int pkmnID)
// return false;
// }
//}
- public bool addPokemon(int box, int position, Pokemon pokemon)
+ public bool addPokemon(int box, int position, IPokemon pokemon)
{
try
{
@@ -359,14 +324,14 @@ public bool addPokemon(int box, int position, Pokemon pokemon)
}
///
- /// Add a new pokemon directly to active box.
+ /// Add a new pokemon directly to active box.
///
///
///
/// Returns position of stored pokemon.
/// If pokemon could not be added return null.
///
- public KeyValuePair? addPokemon(Pokemon acquiredPokemon)
+ public KeyValuePair? addPokemon(IPokemon acquiredPokemon)
{
//attempt to add to the earliest available opening in active box. no array packing needed.
if (hasSpace())
@@ -382,10 +347,51 @@ public bool addPokemon(int box, int position, Pokemon pokemon)
public void swapPokemon(int box1, int pos1, int box2, int pos2)
{
- Pokemon temp = pokemons[box1, pos1];
+ IPokemon temp = pokemons[box1, pos1];
pokemons[box1, pos1] = pokemons[box2, pos2];
pokemons[box2, pos2] = temp;
}
+
+ int IPCPokemonStorage.maxPokemon(int box)
+ {
+ throw new NotImplementedException();
+ }
+
+ int IPCPokemonStorage.FirstFreePos(int box)
+ {
+ throw new NotImplementedException();
+ }
+
+ bool IPCPokemonStorage.Copy(int boxDst, int indexDst, int boxSrc, int indexSrc)
+ {
+ throw new NotImplementedException();
+ }
+
+ bool IPCPokemonStorage.Move(int boxDst, int indexDst, int boxSrc, int indexSrc)
+ {
+ throw new NotImplementedException();
+ }
+
+ void IPCPokemonStorage.MoveCaughtToParty(IPokemon pkmn)
+ {
+ throw new NotImplementedException();
+ }
+
+ bool IPCPokemonStorage.MoveCaughtToBox(IPokemon pkmn, int box)
+ {
+ throw new NotImplementedException();
+ }
+
+ int IPCPokemonStorage.StoreCaught(IPokemon pkmn)
+ {
+ KeyValuePair? kv = addPokemon(pkmn);
+ return kv == null ? -1 : kv.Value.Key; //return the box
+ }
+
+ void IPCPokemonStorage.Delete(int box, int index)
+ {
+ removePokemon(box, index);
+ }
#endregion
}
}
@@ -497,7 +503,7 @@ public bool hasSpace()
}* /
///
- /// Add a new pokemon directly to active box.
+ /// Add a new pokemon directly to active box.
/// If pokemon could not be added return false.
///
///
diff --git a/PokemonUnity.Application/Character/PokemonStorage.cs b/PokemonUnity.Application/Character/PokemonStorage.cs
index d45fe9ed3..a91444cbd 100644
--- a/PokemonUnity.Application/Character/PokemonStorage.cs
+++ b/PokemonUnity.Application/Character/PokemonStorage.cs
@@ -1,5 +1,7 @@
using System;
+using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
using PokemonUnity;
using PokemonUnity.Utility;
@@ -20,7 +22,7 @@ namespace PokemonUnity
{
namespace Character
{
- public partial class PokemonBox : PokemonEssentials.Interface.Screen.IPokemonBox {
+ public partial class PokemonBox : PokemonEssentials.Interface.Screen.IPokemonBox, IList, ICollection {
public IList pokemon { get; protected set; }
public string name { get; set; }
public string background { get; set; }
@@ -31,7 +33,7 @@ public PokemonBox(string name, int maxPokemon = 30)
}
public IPokemonBox initialize (string name,int maxPokemon=30) {
- @pokemon=new List();
+ @pokemon=new List(capacity: maxPokemon);
this.name=name;
@background=null;
for (int i = 0; i < maxPokemon; i++) {
@@ -46,13 +48,17 @@ public bool full { get {
} }
public int nitems { get { //item count
- return @pokemon.Count;
+ return @pokemon.Count(p=>p.IsNotNullOrNone());
} }
public int length { get { //capacity
return (@pokemon as List).Capacity;
} }
+ int ICollection.Count { get { return nitems; } }
+
+ bool ICollection.IsReadOnly { get { return pokemon.IsReadOnly; } }
+
public IEnumerable each() {
foreach (PokemonEssentials.Interface.PokeBattle.IPokemon item in @pokemon) { yield return item; }
}
@@ -65,15 +71,88 @@ public PokemonEssentials.Interface.PokeBattle.IPokemon this[int i] { set {
return @pokemon[i];
} }
+ #region Interface Methods
+ void ICollection.Add(IPokemon item)
+ {
+ //if there is space add to box
+ if (!full)
+ {
+ if (!pokemon.Contains(item)
+ && item.IsNotNullOrNone())
+ pokemon.Add(item);
+ }
+ //move to next box, if full? or send player message to remove?
+ }
+
+ void ICollection.Clear()
+ {
+ string bg = background;
+ //pokemon.Clear();
+ initialize(name, pokemon.Count);
+ background = bg;
+ }
+
+ bool ICollection.Contains(IPokemon item)
+ {
+ //should return false for both null and none
+ if (!item.IsNotNullOrNone()) return false;
+ return pokemon.Contains(item);
+ }
+
+ void ICollection.CopyTo(IPokemon[] array, int arrayIndex)
+ {
+ pokemon.CopyTo(array, arrayIndex);
+ }
+
+ bool ICollection.Remove(IPokemon item)
+ {
+ if (!item.IsNotNullOrNone()) return true;
+ //if object is removed, it will remove nulls and empty space
+ return pokemon.Remove(item);
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return pokemon.GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return pokemon.GetEnumerator();
+ }
+
+ int IList.IndexOf(IPokemon item)
+ {
+ if (!item.IsNotNullOrNone()) return -1;
+ //return ((IList)pokemon).IndexOf(item);
+ return pokemon.IndexOf(item);
+ }
+
+ void IList.Insert(int index, IPokemon item)
+ {
+ if (!item.IsNotNullOrNone()) return;
+ //return ((IList)pokemon).Insert(index, item);
+ pokemon.Insert(index, item);
+ }
+
+ void IList.RemoveAt(int index)
+ {
+ //((IList)pokemon).RemoveAt(index);
+ pokemon.RemoveAt(index);
+ }
+ #endregion
+
public static implicit operator PokemonBox (PokemonEssentials.Interface.PokeBattle.IPokemon[] party)
{
IPokemonBox box = new PokemonBox("party", (Game.GameData as Game).Features.LimitPokemonPartySize);
int i = 0;
foreach(PokemonEssentials.Interface.PokeBattle.IPokemon p in party)
{
- if(p.IsNotNullOrNone())
- box[i] = p;
- i++;
+ if (p.IsNotNullOrNone() && i != box.length)
+ {
+ box[i] = p; //Add
+ i++; //Move to next slot
+ }
}
return (PokemonBox)box;
}
@@ -83,7 +162,7 @@ public static implicit operator PokemonBox (PokemonEssentials.Interface.PokeBatt
//}
}
- public partial class PokemonStorage : PokemonEssentials.Interface.Screen.IPokemonStorage {
+ public partial class PokemonStorage : PokemonEssentials.Interface.Screen.IPCPokemonStorage {
public IPokemonBox[] boxes { get; protected set; }
//public IPokemon party { get; }
public int currentBox { get; set; }
@@ -96,9 +175,10 @@ public int maxBoxes { get {
public virtual PokemonEssentials.Interface.PokeBattle.IPokemon[] party{ get {
return Game.GameData.Trainer.party;
}
- set {
+ protected set {
//throw new Exception("Not supported");
- GameDebug.LogError("Not supported");
+ //GameDebug.LogError("Not supported");
+ Game.GameData.Trainer.party = value;
} }
///
@@ -107,7 +187,7 @@ public virtual PokemonEssentials.Interface.PokeBattle.IPokemon[] party{ get {
public static string[] MARKINGCHARS=new string[] { "●", "▲", "■", "♥", "★", "♦︎" };
public PokemonStorage(int maxBoxes = Core.STORAGEBOXES, int maxPokemon = 30) { initialize(maxBoxes, maxPokemon); }
- public PokemonEssentials.Interface.Screen.IPokemonStorage initialize (int maxBoxes=Core.STORAGEBOXES,int maxPokemon=30) {
+ public PokemonEssentials.Interface.Screen.IPCPokemonStorage initialize (int maxBoxes=Core.STORAGEBOXES,int maxPokemon=30) {
@boxes=new PokemonBox[maxBoxes];
for (int i = 0; i < maxBoxes; i++) {
int ip1=i+1;
@@ -134,7 +214,8 @@ public IPokemonBox this[int x] { get {
// return (x==-1) ? (IList=6) {
//if (this.party.GetCount()>=6) {
return;
@@ -214,12 +295,12 @@ public void pbMoveCaughtToParty(PokemonEssentials.Interface.PokeBattle.IPokemon
this.party[this.party.Length]=pkmn;
}
- public bool pbMoveCaughtToBox(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn,int box) {
+ public bool MoveCaughtToBox(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn,int box) {
for (int i = 0; i < maxPokemon(box); i++) {
if (this[box,i]==null) {
if (box>=0) {
pkmn.Heal();
- if (pkmn is IPokemonMultipleForms p && //pkmn.respond_to("formTime") &&
+ if (pkmn is IPokemonMultipleForms p && //pkmn.respond_to("formTime") &&
p.formTime != null) p.formTime=null;
}
this[box,i]=pkmn;
@@ -229,7 +310,7 @@ public bool pbMoveCaughtToBox(PokemonEssentials.Interface.PokeBattle.IPokemon pk
return false;
}
- public int pbStoreCaught(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn) {
+ public int StoreCaught(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn) {
for (int i = 0; i < maxPokemon(@currentBox); i++) {
if (this[@currentBox,i]==null) {
this[@currentBox,i]=pkmn;
@@ -248,7 +329,7 @@ public int pbStoreCaught(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn) {
return -1;
}
- public void pbDelete(int box,int index) {
+ public void Delete(int box,int index) {
if (this[box,index].IsNotNullOrNone()) {
this[box,index]=null;
if (box==-1) {
@@ -259,20 +340,20 @@ public void pbDelete(int box,int index) {
}
public partial class PokemonStorageWithParty : PokemonStorage, PokemonEssentials.Interface.Screen.IPokemonStorageWithParty {
- public override PokemonEssentials.Interface.PokeBattle.IPokemon[] party { get {
- return base.party;
- }
- set {
- base.party=party;
- } }
-
- public PokemonStorageWithParty(int maxBoxes = 24, int maxPokemon = 30, PokemonEssentials.Interface.PokeBattle.IPokemon[] party = null) //: base (maxBoxes,maxPokemon)
+ //public override PokemonEssentials.Interface.PokeBattle.IPokemon[] party { get {
+ // return base.party;
+ // }
+ // protected set {
+ // base.party=party;
+ //} }
+
+ public PokemonStorageWithParty(int maxBoxes = 24, int maxPokemon = 30, PokemonEssentials.Interface.PokeBattle.IPokemon[] party = null) : base (maxBoxes,maxPokemon)
{ initialize(maxBoxes, maxPokemon, party); }
- public IPokemonStorageWithParty initialize(int maxBoxes=24,int maxPokemon=30,PokemonEssentials.Interface.PokeBattle.IPokemon[] party=null)
+ public IPokemonStorageWithParty initialize(int maxBoxes=24,int maxPokemon=30,PokemonEssentials.Interface.PokeBattle.IPokemon[] party=null)
{
- base.initialize(maxBoxes,maxPokemon);
+ //base.initialize(maxBoxes,maxPokemon);
if (party != null) {
- //ToDo: Feature not setup...
+ //ToDo: Feature not setup...
this.party=party;
} else {
@party=new Pokemon[(Game.GameData as Game).Features.LimitPokemonPartySize];
@@ -285,24 +366,24 @@ public IPokemonStorageWithParty initialize(int maxBoxes=24,int maxPokemon=30,Pok
// Regional Storage scripts
// ###############################################################################
public partial class RegionalStorage : IRegionalStorage {
- protected IList storages { get; set; }
+ protected IList storages { get; set; }
protected int lastmap { get; set; }
protected int rgnmap { get; set; }
public IRegionalStorage initialize() {
- @storages=new List();
+ @storages=new List();
@lastmap=-1;
@rgnmap=-1;
return this;
}
- public IPokemonStorage getCurrentStorage { get {
+ public IPCPokemonStorage getCurrentStorage { get {
if (Game.GameData.GameMap == null) {
//throw Exception(Game._INTL("The player is not on a map, so the region could not be determined."));
GameDebug.LogError(Game._INTL("The player is not on a map, so the region could not be determined."));
}
if (@lastmap!=Game.GameData.GameMap.map_id) {
- @rgnmap=Game.GameData is IGameUtility g ? g.pbGetCurrentRegion() : -1; // may access file IO, so caching result
+ @rgnmap=Game.GameData is IGameUtility g ? g.GetCurrentRegion() : -1; // may access file IO, so caching result
@lastmap=Game.GameData.GameMap.map_id;
}
if (@rgnmap<0) {
@@ -325,7 +406,7 @@ public PokemonEssentials.Interface.PokeBattle.IPokemon[] party { get {
public int currentBox { get {
return getCurrentStorage.currentBox;
- }
+ }
set {
getCurrentStorage.currentBox=value;
} }
@@ -352,32 +433,32 @@ public bool full { get {
return getCurrentStorage.full;
} }
- public void pbFirstFreePos(int box) {
- getCurrentStorage.pbFirstFreePos(box);
+ public void FirstFreePos(int box) {
+ getCurrentStorage.FirstFreePos(box);
}
- public void pbCopy(int boxDst,int indexDst,int boxSrc,int indexSrc) {
- getCurrentStorage.pbCopy(boxDst,indexDst,boxSrc,indexSrc);
+ public void Copy(int boxDst,int indexDst,int boxSrc,int indexSrc) {
+ getCurrentStorage.Copy(boxDst,indexDst,boxSrc,indexSrc);
}
- public void pbMove(int boxDst,int indexDst,int boxSrc,int indexSrc) {
- getCurrentStorage.pbCopy(boxDst,indexDst,boxSrc,indexSrc);
+ public void Move(int boxDst,int indexDst,int boxSrc,int indexSrc) {
+ getCurrentStorage.Copy(boxDst,indexDst,boxSrc,indexSrc);
}
- public void pbMoveCaughtToParty(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn) {
- getCurrentStorage.pbMoveCaughtToParty(pkmn);
+ public void MoveCaughtToParty(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn) {
+ getCurrentStorage.MoveCaughtToParty(pkmn);
}
- public void pbMoveCaughtToBox(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn,int box) {
- getCurrentStorage.pbMoveCaughtToBox(pkmn,box);
+ public void MoveCaughtToBox(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn,int box) {
+ getCurrentStorage.MoveCaughtToBox(pkmn,box);
}
- public void pbStoreCaught(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn) {
- getCurrentStorage.pbStoreCaught(pkmn);
+ public void StoreCaught(PokemonEssentials.Interface.PokeBattle.IPokemon pkmn) {
+ getCurrentStorage.StoreCaught(pkmn);
}
- public void pbDelete(int box,int index) {
- getCurrentStorage.pbDelete(box, index);
+ public void Delete(int box,int index) {
+ getCurrentStorage.Delete(box, index);
}
}
@@ -391,8 +472,8 @@ public string name { get {
} }
public void access() {
- if (Game.GameData is IGameMessage m) m.pbMessage(Game._INTL("\\se[accesspc]Accessed {1}'s PC.",Game.GameData.Trainer.name));
- if (Game.GameData is IGamePCStorage s) s.pbTrainerPCMenu();
+ if (Game.GameData is IGameMessage m) m.Message(Game._INTL("\\se[accesspc]Accessed {1}'s PC.",Game.GameData.Trainer.name));
+ if (Game.GameData is IGamePCStorage s) s.TrainerPCMenu();
}
}
@@ -403,16 +484,16 @@ public bool shouldShow { get {
public string name { get {
if (Game.GameData.Global.seenStorageCreator && Game.GameData is IGamePCStorage s) {
- return Game._INTL("{1}'s PC",s.pbGetStorageCreator());
+ return Game._INTL("{1}'s PC",s.GetStorageCreator());
} else {
return Game._INTL("Someone's PC");
}
} }
public void access() {
- if (Game.GameData is IGameMessage m) m.pbMessage(Game._INTL("\\se[accesspc]The Pokémon Storage System was opened."));
+ if (Game.GameData is IGameMessage m) m.Message(Game._INTL("\\se[accesspc]The Pokémon Storage System was opened."));
do { //;loop
- int command=Game.GameData is IGameMessage m0 ? m0.pbShowCommandsWithHelp(null,
+ int command=Game.GameData is IGameMessage m0 ? m0.ShowCommandsWithHelp(null,
new string[] {Game._INTL("Withdraw Pokémon"),
Game._INTL("Deposit Pokémon"),
Game._INTL("Move Pokémon"),
@@ -424,7 +505,7 @@ public void access() {
) : -1;
if (command>=0 && command<3) {
if (command==0 && Game.GameData.PokemonStorage.party.Length>=6) {
- if (Game.GameData is IGameMessage m1) m1.pbMessage(Game._INTL("Your party is full!"));
+ if (Game.GameData is IGameMessage m1) m1.Message(Game._INTL("Your party is full!"));
continue;
}
int count=0;
@@ -432,13 +513,13 @@ public void access() {
if (p.IsNotNullOrNone() && !p.isEgg && p.HP>0) count+=1;
}
if (command==1 && count<=1) {
- if (Game.GameData is IGameMessage m1) m1.pbMessage(Game._INTL("Can't deposit the last Pokémon!"));
+ if (Game.GameData is IGameMessage m1) m1.Message(Game._INTL("Can't deposit the last Pokémon!"));
continue;
}
- if (Game.GameData is IGameSpriteWindow g) g.pbFadeOutIn(99999, block: () => {
+ if (Game.GameData is IGameSpriteWindow g) g.FadeOutIn(99999, block: () => {
IPokemonStorageScene scene=(Game.GameData as Game).Scenes.PokemonStorageScene; //new PokemonStorageScene();
IPokemonStorageScreen screen=(Game.GameData as Game).Screens.PokemonStorageScreen.initialize(scene,Game.GameData.PokemonStorage); //new PokemonStorageScreen(scene,Game.GameData.PokemonStorage);
- screen.pbStartScreen(command);
+ screen.StartScreen(command);
});
} else {
break;
@@ -447,7 +528,7 @@ public void access() {
}
}
- public static class PokemonPCList //: IPokemonPCList
+ public static class PokemonPCList //: IPokemonPCList
{
//PokemonPCList.registerPC(new StorageSystemPC());
//PokemonPCList.registerPC(new TrainerPC());
@@ -487,21 +568,21 @@ public static bool callCommand(int cmd) {
}
}
- public partial class Game : PokemonEssentials.Interface.Screen.IGamePCStorage {
+ public partial class Game : PokemonEssentials.Interface.Screen.IGamePCStorage {
// ###############################################################################
// PC menus
// ###############################################################################
- public string pbGetStorageCreator() {
- string creator=null;//pbStorageCreator();
+ public string GetStorageCreator() {
+ string creator=null;//StorageCreator();
//if (creator == null || creator=="") creator=Game._INTL("Bill");
if (string.IsNullOrEmpty(creator)) creator=Game._INTL("Bill");
return creator;
}
-
- public virtual void pbPCItemStorage() {
+
+ public virtual void PCItemStorage() {
//Items ret = Items.NONE;
do { //;loop
- int command=(this as IGameMessage).pbShowCommandsWithHelp(null,
+ int command=(this as IGameMessage).ShowCommandsWithHelp(null,
new string[] { Game._INTL("Withdraw Item"),
Game._INTL("Deposit Item"),
Game._INTL("Toss Item"),
@@ -516,31 +597,31 @@ public virtual void pbPCItemStorage() {
Global.pcItemStorage=new PCItemStorage();
}
if (Global.pcItemStorage.empty()) {
- (this as IGameMessage).pbMessage(Game._INTL("There are no items."));
+ (this as IGameMessage).Message(Game._INTL("There are no items."));
} else {
- pbFadeOutIn(99999, block: () => {
+ FadeOutIn(99999, block: () => {
IWithdrawItemScene scene = Scenes.Bag_ItemWithdraw;//new WithdrawItemScene();
IBagScreen screen = Screens.Bag.initialize((IBagScene)scene,Bag);//new PokemonBagScreen(scene,Bag);
- screen.pbWithdrawItemScreen();//ret=
+ screen.WithdrawItemScreen();//ret=
});
}
} else if (command==1) { // Deposit Item
- pbFadeOutIn(99999, block: () => {
+ FadeOutIn(99999, block: () => {
IBagScene scene = Scenes.Bag;//new PokemonBag_Scene();
IBagScreen screen = Screens.Bag.initialize(scene,Bag);//new PokemonBagScreen(scene,Bag);
- screen.pbDepositItemScreen();//ret=
+ screen.DepositItemScreen();//ret=
});
} else if (command==2) { // Toss Item
if (Global.pcItemStorage == null) {
Global.pcItemStorage=new PCItemStorage();
}
if (Global.pcItemStorage.empty()) {
- (this as IGameMessage).pbMessage(Game._INTL("There are no items."));
+ (this as IGameMessage).Message(Game._INTL("There are no items."));
} else {
- pbFadeOutIn(99999, block: () => {
+ FadeOutIn(99999, block: () => {
ITossItemScene scene = Scenes.Bag_ItemToss;//new TossItemScene();
IBagScreen screen = Screens.Bag.initialize((IBagScene)scene,Bag);//new PokemonBagScreen(scene,Bag);
- screen.pbTossItemScreen();//ret=
+ screen.TossItemScreen();//ret=
});
}
} else {
@@ -549,9 +630,9 @@ public virtual void pbPCItemStorage() {
} while (true);
}
- public virtual void pbPCMailbox() {
+ public virtual void PCMailbox() {
if (Global.mailbox == null || Global.mailbox.Count==0) {
- (this as IGameMessage).pbMessage(Game._INTL("There's no Mail here."));
+ (this as IGameMessage).Message(Game._INTL("There's no Mail here."));
} else {
do { //;loop
List commands=new List();
@@ -559,10 +640,10 @@ public virtual void pbPCMailbox() {
commands.Add(mail.sender);
}
commands.Add(Game._INTL("Cancel"));
- int command=(this as IGameMessage).pbShowCommands(null,commands.ToArray(),-1);
+ int command=(this as IGameMessage).ShowCommands(null,commands.ToArray(),-1);
if (command>=0 && command {
- if(this is IGameMail m) m.pbDisplayMail(Global.mailbox[mailIndex]);
+ FadeOutIn(99999, block: () => {
+ if(this is IGameMail m) m.DisplayMail(Global.mailbox[mailIndex]);
});
} else if (command==1) { // Move to Bag
- if ((this as IGameMessage).pbConfirmMessage(_INTL("The message will be lost. Is that OK?"))) {
- if (Bag.pbStoreItem(Global.mailbox[mailIndex].item)) {
- (this as IGameMessage).pbMessage(_INTL("The Mail was returned to the Bag with its message erased."));
+ if ((this as IGameMessage).ConfirmMessage(_INTL("The message will be lost. Is that OK?"))) {
+ if (Bag.StoreItem(Global.mailbox[mailIndex].item)) {
+ (this as IGameMessage).Message(_INTL("The Mail was returned to the Bag with its message erased."));
//Global.mailbox.delete_at(mailIndex);
Global.mailbox.RemoveAt(mailIndex);
} else {
- (this as IGameMessage).pbMessage(_INTL("The Bag is full."));
+ (this as IGameMessage).Message(_INTL("The Bag is full."));
}
}
} else if (command==2) { // Give
- pbFadeOutIn(99999, block: () => {
+ FadeOutIn(99999, block: () => {
IPartyDisplayScene sscene=Scenes.Party; //new PokemonScreen_Scene();
IPartyDisplayScreen sscreen=Screens.Party.initialize(sscene,Trainer.party); //new PokemonScreen(sscene,Trainer.party);
- sscreen.pbPokemonGiveMailScreen(mailIndex);
+ sscreen.PokemonGiveMailScreen(mailIndex);
});
}
} else {
@@ -597,40 +678,40 @@ public virtual void pbPCMailbox() {
}
}
- public void pbTrainerPCMenu() {
+ public void TrainerPCMenu() {
do { //;loop
- int command=(this as IGameMessage).pbMessage(Game._INTL("What do you want to do?"),new string[] {
+ int command=(this as IGameMessage).Message(Game._INTL("What do you want to do?"),new string[] {
Game._INTL("Item Storage"),
Game._INTL("Mailbox"),
Game._INTL("Turn Off")
},-1);
if (command==0) {
- pbPCItemStorage();
+ PCItemStorage();
} else if (command==1) {
- pbPCMailbox();
+ PCMailbox();
} else {
break;
}
} while (true);
}
- public void pbTrainerPC() {
- (this as IGameMessage).pbMessage(Game._INTL("\\se[computeropen]{1} booted up the PC.",Trainer.name));
- pbTrainerPCMenu();
- (this as IGameAudioPlay).pbSEPlay("computerclose");
+ public void TrainerPC() {
+ (this as IGameMessage).Message(Game._INTL("\\se[computeropen]{1} booted up the PC.",Trainer.name));
+ TrainerPCMenu();
+ (this as IGameAudioPlay).SEPlay("computerclose");
}
- public void pbPokeCenterPC() {
- (this as IGameMessage).pbMessage(Game._INTL("\\se[computeropen]{1} booted up the PC.",Trainer.name));
+ public void PokeCenterPC() {
+ (this as IGameMessage).Message(Game._INTL("\\se[computeropen]{1} booted up the PC.",Trainer.name));
do { //;loop
string[] commands=PokemonPCList.getCommandList();
- int command=(this as IGameMessage).pbMessage(Game._INTL("Which PC should be accessed?"),
+ int command=(this as IGameMessage).Message(Game._INTL("Which PC should be accessed?"),
commands,commands.Length);
if (!PokemonPCList.callCommand(command)) {
break;
}
} while (true);
- (this as IGameAudioPlay).pbSEPlay("computerclose");
+ (this as IGameAudioPlay).SEPlay("computerclose");
}
}
}
\ No newline at end of file
diff --git a/PokemonUnity.Application/Combat/AI.cs b/PokemonUnity.Application/Combat/AI.cs
index cb6c67930..9ea272582 100644
--- a/PokemonUnity.Application/Combat/AI.cs
+++ b/PokemonUnity.Application/Combat/AI.cs
@@ -22,7 +22,7 @@ namespace PokemonUnity.Combat
// 32-47: Some skill
// 48-99: High skill
// 100+: Gym Leaders, E4, Champion, highest level
- public static class PBTrainerAI {
+ public static class TrainerAI {
// Minimum skill level to be in each AI category
public const int minimumSkill = 1;
// dont want to lose
@@ -42,11 +42,11 @@ public partial class Battle : PokemonEssentials.Interface.PokeBattle.IBattleAI {
///
///
///
- public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,int skill=100) {
- if (skill=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
score=0;
}
break;
case Attack.Data.Effects.x0FF: // Struggle
break;
case Attack.Data.Effects.x002:
- if (obe?.pbCanSleep(attacker,false)??false) {
+ if (obe?.CanSleep(attacker,false)??false) {
score+=30;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (opponent.effects.Yawn>0) score-=30;
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=30;
}
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
foreach (var i in opponent.moves) {
Attack.Data.MoveData movedata=Kernal.MoveData[i.id];
if (movedata.Effect==Attack.Data.Effects.x062 || // Sleep Talk
@@ -104,23 +104,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.basedamage==0) score-=90;
}
}
break;
case Attack.Data.Effects.x0BC:
- if (opponent.effects.Yawn>0 || !(obe?.pbCanSleep(attacker,false)??false)) {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (opponent.effects.Yawn>0 || !(obe?.CanSleep(attacker,false)??false)) {
+ if (skill>=TrainerAI.mediumSkill) {
score-=90;
}
}
else {
score+=30;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=30;
}
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
foreach (var i in opponent.moves) {
Attack.Data.MoveData movedata=Kernal.MoveData[i.id];
if (movedata.Effect==Attack.Data.Effects.x062 || // Sleep Talk
@@ -133,58 +133,58 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x003: case Attack.Data.Effects.x022: case Attack.Data.Effects.x04E:
- if (obe?.pbCanPoison(attacker,false)??false) {
+ if (obe?.CanPoison(attacker,false)??false) {
score+=30;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (opponent.HP<=opponent.TotalHP/4) score+=30;
if (opponent.HP<=opponent.TotalHP/8) score+=50;
if (opponent.effects.Yawn>0) score-=40;
}
- if (skill>=PBTrainerAI.highSkill) {
- if (pbRoughStat(opponent,Stats.DEFENSE,skill)>100) score+=10;
- if (pbRoughStat(opponent,Stats.SPDEF,skill)>100) score+=10;
+ if (skill>=TrainerAI.highSkill) {
+ if (RoughStat(opponent,Stats.DEFENSE,skill)>100) score+=10;
+ if (RoughStat(opponent,Stats.SPDEF,skill)>100) score+=10;
if (opponent.hasWorkingAbility(Abilities.GUTS)) score-=40;
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=40;
if (opponent.hasWorkingAbility(Abilities.TOXIC_BOOST)) score-=40;
}
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.basedamage==0) score-=90;
}
}
break;
case Attack.Data.Effects.x007: case Attack.Data.Effects.x099: case Attack.Data.Effects.x114: case Attack.Data.Effects.x14C:
- if (obe?.pbCanParalyze(attacker,false)??false &&
- !(skill>=PBTrainerAI.mediumSkill &&
+ if (obe?.CanParalyze(attacker,false)??false &&
+ !(skill>=TrainerAI.mediumSkill &&
move.id == Moves.THUNDER_WAVE &&
- pbTypeModifier(move.Type,attacker,opponent)==0)) {
+ TypeModifier(move.Type,attacker,opponent)==0)) {
score+=30;
- if (skill>=PBTrainerAI.mediumSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.mediumSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score-=40;
}
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.GUTS)) score-=40;
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=40;
if (opponent.hasWorkingAbility(Abilities.QUICK_FEET)) score-=40;
}
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.basedamage==0) score-=90;
}
}
break;
case Attack.Data.Effects.x005: case Attack.Data.Effects.x112: case Attack.Data.Effects.x14D:
- if (obe?.pbCanBurn(attacker,false)??false) {
+ if (obe?.CanBurn(attacker,false)??false) {
score+=30;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.GUTS)) score-=40;
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=40;
if (opponent.hasWorkingAbility(Abilities.QUICK_FEET)) score-=40;
@@ -192,33 +192,33 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.basedamage==0) score-=90;
}
}
break;
case Attack.Data.Effects.x006: case Attack.Data.Effects.x105: case Attack.Data.Effects.x113:
- if (obe?.pbCanFreeze(attacker,false)??false) {
+ if (obe?.CanFreeze(attacker,false)??false) {
score+=30;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=20;
}
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.basedamage==0) score-=90;
}
}
break;
case Attack.Data.Effects.x020:
score+=30;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (!opponent.hasWorkingAbility(Abilities.INNER_FOCUS) &&
opponent.effects.Substitute==0) score+=30;
}
break;
case Attack.Data.Effects.x097:
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (!opponent.hasWorkingAbility(Abilities.INNER_FOCUS) &&
opponent.effects.Substitute==0) score+=30;
}
@@ -227,38 +227,38 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x05D:
if (attacker.Status==Status.SLEEP) {
score+=100; // Because it can be used while asleep
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (!opponent.hasWorkingAbility(Abilities.INNER_FOCUS) &&
opponent.effects.Substitute==0) score+=30;
}
}
else {
score-=90; // Because it will fail here
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
score=0;
}
}
break;
case Attack.Data.Effects.x09F:
if (attacker.turncount==0) {
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (!opponent.hasWorkingAbility(Abilities.INNER_FOCUS) &&
opponent.effects.Substitute==0) score+=30;
}
}
else {
score-=90; // Because it will fail here
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
score=0;
}
}
break;
case Attack.Data.Effects.x04D: case Attack.Data.Effects.x10C: case Attack.Data.Effects.x14E:
- if (obe?.pbCanConfuse(attacker,false)??false) {
+ if (obe?.CanConfuse(attacker,false)??false) {
score+=30;
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.basedamage==0) score-=90;
}
}
@@ -271,13 +271,13 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=90; canattract=false;
} else if (opponent.effects.Attract>=0) {
score-=80; canattract=false;
- } else if (skill>=PBTrainerAI.bestSkill &&
+ } else if (skill>=TrainerAI.bestSkill &&
opponent.hasWorkingAbility(Abilities.OBLIVIOUS)) {
score-=80; canattract=false;
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (canattract && opponent.hasWorkingItem(Items.DESTINY_KNOT) &&
- (abe?.pbCanAttract(opponent,false)??false)) {
+ (abe?.CanAttract(opponent,false)??false)) {
score-=30;
}
}
@@ -290,10 +290,10 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score+=40;
} else if (attacker.Status==Status.POISON) {
score+=40;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.HP=PBTrainerAI.highSkill &&
+ } else if (skill>=TrainerAI.highSkill &&
attacker.HP<(attacker.effects.Toxic+1)*attacker.TotalHP/16) {
score+=60;
}
@@ -306,7 +306,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x067:
- PokemonEssentials.Interface.PokeBattle.IPokemon[] party=pbParty(attacker.Index);
+ PokemonEssentials.Interface.PokeBattle.IPokemon[] party=Party(attacker.Index);
int statuses=0;
for (int i = 0; i < party.Length; i++) {
if (party[i].IsNotNullOrNone() && party[i].Status!=0) statuses+=1;
@@ -319,7 +319,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x07D:
- if (attacker.pbOwnSide.Safeguard>0) {
+ if (attacker.OwnSide.Safeguard>0) {
score-=80 ;
} else if (attacker.Status!=0) {
score-=40;
@@ -338,22 +338,22 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x00B:
if (move.basedamage==0) {
- if (abe?.pbTooHigh(Stats.ATTACK)??false) {
+ if (abe?.TooHigh(Stats.ATTACK)??false) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.ATTACK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -361,11 +361,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
else {
if (attacker.stages[(int)Stats.ATTACK]<0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
@@ -377,7 +377,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x00C: case Attack.Data.Effects.x09D: case Attack.Data.Effects.x092:
if (move.basedamage==0) {
- if (abe?.pbTooHigh(Stats.DEFENSE)??false) {
+ if (abe?.TooHigh(Stats.DEFENSE)??false) {
score-=90;
}
else {
@@ -390,14 +390,14 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x128:
if (move.basedamage==0) {
- if (abe?.pbTooHigh(Stats.SPEED)??false) {
+ if (abe?.TooHigh(Stats.SPEED)??false) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.SPEED]*10;
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=30;
}
@@ -410,22 +410,22 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x115:
if (move.basedamage==0) {
- if (abe?.pbTooHigh(Stats.SPATK)??false) {
+ if (abe?.TooHigh(Stats.SPATK)??false) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.SPATK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -433,11 +433,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
else {
if (attacker.stages[(int)Stats.SPATK]<0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
@@ -457,7 +457,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
}
if (move.basedamage==0) {
- if (abe?.pbTooHigh(Stats.SPDEF)??false) {
+ if (abe?.TooHigh(Stats.SPDEF)??false) {
score-=90;
}
else {
@@ -472,7 +472,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x011:
if (move.basedamage==0) {
- if (abe?.pbTooHigh(Stats.EVASION)??false) {
+ if (abe?.TooHigh(Stats.EVASION)??false) {
score-=90;
}
else {
@@ -497,50 +497,50 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x0D1:
- if ((abe?.pbTooHigh(Stats.ATTACK)??false) &&
- (abe?.pbTooHigh(Stats.DEFENSE)??false)) {
+ if ((abe?.TooHigh(Stats.ATTACK)??false) &&
+ (abe?.TooHigh(Stats.DEFENSE)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.ATTACK]*10;
score-=attacker.stages[(int)Stats.DEFENSE]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
}
break;
case Attack.Data.Effects.x143:
- if ((abe?.pbTooHigh(Stats.ATTACK)??false) &&
- (abe?.pbTooHigh(Stats.DEFENSE)??false) &&
- (abe?.pbTooHigh(Stats.ACCURACY)??false)) {
+ if ((abe?.TooHigh(Stats.ATTACK)??false) &&
+ (abe?.TooHigh(Stats.DEFENSE)??false) &&
+ (abe?.TooHigh(Stats.ACCURACY)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.ATTACK]*10;
score-=attacker.stages[(int)Stats.DEFENSE]*10;
score-=attacker.stages[(int)Stats.ACCURACY]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -548,30 +548,30 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x0D5:
if (attacker.turncount==0) score+=40; // Dragon Dance tends to be popular
- if ((abe?.pbTooHigh(Stats.ATTACK)??false) &&
- (abe?.pbTooHigh(Stats.SPEED)??false)) {
+ if ((abe?.TooHigh(Stats.ATTACK)??false) &&
+ (abe?.TooHigh(Stats.SPEED)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.ATTACK]*10;
score-=attacker.stages[(int)Stats.SPEED]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=20;
}
@@ -579,14 +579,14 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x148: case Attack.Data.Effects.x13D:
- if ((abe?.pbTooHigh(Stats.ATTACK)??false) &&
- (abe?.pbTooHigh(Stats.SPATK)??false)) {
+ if ((abe?.TooHigh(Stats.ATTACK)??false) &&
+ (abe?.TooHigh(Stats.SPATK)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.ATTACK]*10;
score-=attacker.stages[(int)Stats.SPATK]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasdamagingattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0) {
@@ -595,42 +595,42 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
if (hasdamagingattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
if (move.Effect==Attack.Data.Effects.x13D) { // Growth
- if (pbWeather==Weather.SUNNYDAY) score+=20;
+ if (Weather==Weather.SUNNYDAY) score+=20;
}
}
break;
case Attack.Data.Effects.x116:
- if ((abe?.pbTooHigh(Stats.ATTACK)??false) &&
- (abe?.pbTooHigh(Stats.ACCURACY)??false)) {
+ if ((abe?.TooHigh(Stats.ATTACK)??false) &&
+ (abe?.TooHigh(Stats.ACCURACY)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.ATTACK]*10;
score-=attacker.stages[(int)Stats.ACCURACY]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
}
break;
case Attack.Data.Effects.x0CF:
- if ((abe?.pbTooHigh(Stats.DEFENSE)??false) &&
- (abe?.pbTooHigh(Stats.SPDEF)??false)) {
+ if ((abe?.TooHigh(Stats.DEFENSE)??false) &&
+ (abe?.TooHigh(Stats.SPDEF)??false)) {
score-=90;
}
else {
@@ -639,32 +639,32 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x123:
- if ((abe?.pbTooHigh(Stats.SPEED)??false) &&
- (abe?.pbTooHigh(Stats.SPATK)??false) &&
- (abe?.pbTooHigh(Stats.SPDEF)??false)) {
+ if ((abe?.TooHigh(Stats.SPEED)??false) &&
+ (abe?.TooHigh(Stats.SPATK)??false) &&
+ (abe?.TooHigh(Stats.SPDEF)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.SPATK]*10;
score-=attacker.stages[(int)Stats.SPDEF]*10;
score-=attacker.stages[(int)Stats.SPEED]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=20;
}
@@ -672,25 +672,25 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x0D4:
- if ((abe?.pbTooHigh(Stats.SPATK)??false) &&
- (abe?.pbTooHigh(Stats.SPDEF)??false)) {
+ if ((abe?.TooHigh(Stats.SPATK)??false) &&
+ (abe?.TooHigh(Stats.SPDEF)??false)) {
score-=90;
}
else {
if (attacker.turncount==0) score+=40; // Calm Mind tends to be popular
score-=attacker.stages[(int)Stats.SPATK]*10;
score-=attacker.stages[(int)Stats.SPDEF]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -702,7 +702,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (attacker.stages[(int)Stats.SPEED]<0) score+=10;
if (attacker.stages[(int)Stats.SPATK]<0) score+=10;
if (attacker.stages[(int)Stats.SPDEF]<0) score+=10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasdamagingattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0) {
@@ -716,23 +716,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x033:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.ATTACK)??false)) {
+ if ((abe?.TooHigh(Stats.ATTACK)??false)) {
score-=90;
}
else {
if (attacker.turncount==0) score+=40;
score-=attacker.stages[(int)Stats.ATTACK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -741,11 +741,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
else {
if (attacker.turncount==0) score+=10;
if (attacker.stages[(int)Stats.ATTACK]<0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
@@ -757,7 +757,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x034:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.DEFENSE)??false)) {
+ if ((abe?.TooHigh(Stats.DEFENSE)??false)) {
score-=90;
}
else {
@@ -772,15 +772,15 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x035: case Attack.Data.Effects.x11D:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.SPEED)??false)) {
+ if ((abe?.TooHigh(Stats.SPEED)??false)) {
score-=90;
}
else {
if (attacker.turncount==0) score+=20;
score-=attacker.stages[(int)Stats.SPEED]*10;
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=30;
}
@@ -794,23 +794,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x036:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.SPATK)??false)) {
+ if ((abe?.TooHigh(Stats.SPATK)??false)) {
score-=90;
}
else {
if (attacker.turncount==0) score+=40;
score-=attacker.stages[(int)Stats.SPATK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -819,11 +819,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
else {
if (attacker.turncount==0) score+=10;
if (attacker.stages[(int)Stats.SPATK]<0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
@@ -835,7 +835,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x037:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.SPDEF)??false)) {
+ if ((abe?.TooHigh(Stats.SPDEF)??false)) {
score-=90;
}
else {
@@ -850,7 +850,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x06D:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.EVASION)??false)) {
+ if ((abe?.TooHigh(Stats.EVASION)??false)) {
score-=90;
}
else {
@@ -869,7 +869,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=attacker.stages[(int)Stats.SPATK]*20;
score+=attacker.stages[(int)Stats.DEFENSE]*10;
score+=attacker.stages[(int)Stats.SPDEF]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasdamagingattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0) {
@@ -882,30 +882,30 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x139:
- if ((abe?.pbTooHigh(Stats.ATTACK)??false) &&
- (abe?.pbTooHigh(Stats.SPEED)??false)) {
+ if ((abe?.TooHigh(Stats.ATTACK)??false) &&
+ (abe?.TooHigh(Stats.SPEED)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.ATTACK]*10;
score-=attacker.stages[(int)Stats.SPEED]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=30;
}
@@ -913,13 +913,13 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x0E3:
- if ((obe?.pbTooHigh(Stats.ATTACK)??false) &&
- (obe?.pbTooHigh(Stats.DEFENSE)??false) &&
- (obe?.pbTooHigh(Stats.SPEED)??false) &&
- (obe?.pbTooHigh(Stats.SPATK)??false) &&
- (obe?.pbTooHigh(Stats.SPDEF)??false) &&
- (obe?.pbTooHigh(Stats.ACCURACY)??false) &&
- (obe?.pbTooHigh(Stats.EVASION)??false)) {
+ if ((obe?.TooHigh(Stats.ATTACK)??false) &&
+ (obe?.TooHigh(Stats.DEFENSE)??false) &&
+ (obe?.TooHigh(Stats.SPEED)??false) &&
+ (obe?.TooHigh(Stats.SPATK)??false) &&
+ (obe?.TooHigh(Stats.SPDEF)??false) &&
+ (obe?.TooHigh(Stats.ACCURACY)??false) &&
+ (obe?.TooHigh(Stats.EVASION)??false)) {
score-=90;
}
else {
@@ -937,7 +937,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x149:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.DEFENSE)??false)) {
+ if ((abe?.TooHigh(Stats.DEFENSE)??false)) {
score-=90;
}
else {
@@ -952,23 +952,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x142:
if (move.basedamage==0) {
- if ((abe?.pbTooHigh(Stats.SPATK)??false)) {
+ if ((abe?.TooHigh(Stats.SPATK)??false)) {
score-=90;
}
else {
if (attacker.turncount==0) score+=40;
score-=attacker.stages[(int)Stats.SPATK]*30;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -977,11 +977,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
else {
if (attacker.turncount==0) score+=10;
if (attacker.stages[(int)Stats.SPATK]<0) score+=30;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
@@ -992,23 +992,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x08F:
- if ((abe?.pbTooHigh(Stats.ATTACK)??false) ||
+ if ((abe?.TooHigh(Stats.ATTACK)??false) ||
attacker.HP<=attacker.TotalHP/2) {
score-=100;
}
else {
score+=(6-attacker.stages[(int)Stats.ATTACK])*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=40;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -1037,7 +1037,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score+=attacker.stages[(int)Stats.SPATK]*10;
break;
case Attack.Data.Effects.x0A7:
- if (!obe?.pbCanConfuse(attacker,false)??false) {
+ if (!obe?.CanConfuse(attacker,false)??false) {
score-=90;
}
else {
@@ -1045,7 +1045,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x077:
- if (!obe?.pbCanConfuse(attacker,false)??false) {
+ if (!obe?.CanConfuse(attacker,false)??false) {
score-=90;
}
else {
@@ -1054,22 +1054,22 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x16D:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.ATTACK,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.ATTACK,attacker)??false) {
score-=90;
}
else {
score+=opponent.stages[(int)Stats.ATTACK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -1077,11 +1077,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
else {
if (opponent.stages[(int)Stats.ATTACK]>0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
@@ -1093,7 +1093,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x014:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.DEFENSE,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.DEFENSE,attacker)??false) {
score-=90;
}
else {
@@ -1106,14 +1106,14 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x015:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.SPEED,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.SPEED,attacker)??false) {
score-=90;
}
else {
score+=opponent.stages[(int)Stats.SPEED]*10;
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=30;
}
@@ -1126,22 +1126,22 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x048:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.SPATK,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.SPATK,attacker)??false) {
score-=90;
}
else {
score+=attacker.stages[(int)Stats.SPATK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -1149,11 +1149,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
else {
if (attacker.stages[(int)Stats.SPATK]>0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
@@ -1165,7 +1165,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x049:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.SPDEF,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.SPDEF,attacker)??false) {
score-=90;
}
else {
@@ -1178,7 +1178,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x018:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.ACCURACY,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.ACCURACY,attacker)??false) {
score-=90;
}
else {
@@ -1191,7 +1191,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x019:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.EVASION,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.EVASION,attacker)??false) {
score-=90;
}
else {
@@ -1204,7 +1204,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x103:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.EVASION,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.EVASION,attacker)??false) {
score-=90;
}
else {
@@ -1214,13 +1214,13 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
else {
if (opponent.stages[(int)Stats.EVASION]>0) score+=20;
}
- if (opponent.pbOwnSide.Reflect>0 ||
- opponent.pbOwnSide.LightScreen>0 ||
- opponent.pbOwnSide.Mist>0 ||
- opponent.pbOwnSide.Safeguard>0) score+=30;
- if (opponent.pbOwnSide.Spikes>0 ||
- opponent.pbOwnSide.ToxicSpikes>0 ||
- opponent.pbOwnSide.StealthRock) score-=30;
+ if (opponent.OwnSide.Reflect>0 ||
+ opponent.OwnSide.LightScreen>0 ||
+ opponent.OwnSide.Mist>0 ||
+ opponent.OwnSide.Safeguard>0) score+=30;
+ if (opponent.OwnSide.Spikes>0 ||
+ opponent.OwnSide.ToxicSpikes>0 ||
+ opponent.OwnSide.StealthRock) score-=30;
break;
case Attack.Data.Effects.x0CE:
avg=opponent.stages[(int)Stats.ATTACK]*10;
@@ -1229,23 +1229,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x03B:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.ATTACK,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.ATTACK,attacker)??false) {
score-=90;
}
else {
if (attacker.turncount==0) score+=40;
score+=opponent.stages[(int)Stats.ATTACK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -1254,11 +1254,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
else {
if (attacker.turncount==0) score+=10;
if (opponent.stages[(int)Stats.ATTACK]>0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
@@ -1270,7 +1270,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x03C:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.DEFENSE,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.DEFENSE,attacker)??false) {
score-=90;
}
else {
@@ -1285,15 +1285,15 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x03D:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.SPEED,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.SPEED,attacker)??false) {
score-=90;
}
else {
if (attacker.turncount==0) score+=20;
score+=opponent.stages[(int)Stats.SPEED]*20;
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=30;
}
@@ -1311,23 +1311,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
opponent.hasWorkingAbility(Abilities.OBLIVIOUS)) {
score-=90;
} else if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.SPATK,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.SPATK,attacker)??false) {
score-=90;
}
else {
if (attacker.turncount==0) score+=40;
score+=opponent.stages[(int)Stats.SPATK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -1336,11 +1336,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
else {
if (attacker.turncount==0) score+=10;
if (opponent.stages[(int)Stats.SPATK]>0) score+=20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
@@ -1352,7 +1352,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x03F:
if (move.basedamage==0) {
- if (!obe?.pbCanReduceStatStage(Stats.SPDEF,attacker)??false) {
+ if (!obe?.CanReduceStatStage(Stats.SPDEF,attacker)??false) {
score-=90;
}
else {
@@ -1387,11 +1387,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x01A:
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
int stages=0;
for (int i = 0; i < 4; i++) {
- IBattler battler=@battlers[i];
- if (attacker.pbIsOpposing(i)) {
+ IBattler battler=_battlers[i];
+ if (attacker.IsOpposing(i)) {
stages+=battler.stages[(int)Stats.ATTACK];
stages+=battler.stages[(int)Stats.DEFENSE];
stages+=battler.stages[(int)Stats.SPEED];
@@ -1414,7 +1414,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x0F4:
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
aatk=attacker.stages[(int)Stats.ATTACK];
aspa=attacker.stages[(int)Stats.SPATK];
oatk=opponent.stages[(int)Stats.ATTACK];
@@ -1432,7 +1432,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x0F5:
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
adef=attacker.stages[(int)Stats.DEFENSE];
aspd=attacker.stages[(int)Stats.SPDEF];
odef=opponent.stages[(int)Stats.DEFENSE];
@@ -1450,7 +1450,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x0FB:
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
astages=attacker.stages[(int)Stats.ATTACK];
astages+=attacker.stages[(int)Stats.DEFENSE];
astages+=attacker.stages[(int)Stats.SPEED];
@@ -1472,7 +1472,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x090:
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
bool equal=true;
foreach (var i in new Stats[] { Stats.ATTACK,Stats.DEFENSE,Stats.SPEED,
Stats.SPATK,Stats.SPDEF,Stats.ACCURACY,Stats.EVASION }) {
@@ -1487,12 +1487,12 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x02F:
- if (attacker.pbOwnSide.Mist>0) score-=80;
+ if (attacker.OwnSide.Mist>0) score-=80;
break;
case Attack.Data.Effects.x0EF:
- if (skill>=PBTrainerAI.mediumSkill) {
- aatk=pbRoughStat(attacker,Stats.ATTACK,skill);
- adef=pbRoughStat(attacker,Stats.DEFENSE,skill);
+ if (skill>=TrainerAI.mediumSkill) {
+ aatk=RoughStat(attacker,Stats.ATTACK,skill);
+ adef=RoughStat(attacker,Stats.DEFENSE,skill);
if (aatk==adef ||
attacker.effects.PowerTrick) { // No flip-flopping
score-=90;
@@ -1508,11 +1508,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x119:
- if (skill>=PBTrainerAI.mediumSkill) {
- aatk=pbRoughStat(attacker,Stats.ATTACK,skill);
- aspatk=pbRoughStat(attacker,Stats.SPATK,skill);
- oatk=pbRoughStat(opponent,Stats.ATTACK,skill);
- ospatk=pbRoughStat(opponent,Stats.SPATK,skill);
+ if (skill>=TrainerAI.mediumSkill) {
+ aatk=RoughStat(attacker,Stats.ATTACK,skill);
+ aspatk=RoughStat(attacker,Stats.SPATK,skill);
+ oatk=RoughStat(opponent,Stats.ATTACK,skill);
+ ospatk=RoughStat(opponent,Stats.SPATK,skill);
if (aatk=PBTrainerAI.mediumSkill) {
- adef=pbRoughStat(attacker,Stats.DEFENSE,skill);
- aspdef=pbRoughStat(attacker,Stats.SPDEF,skill);
- odef=pbRoughStat(opponent,Stats.DEFENSE,skill);
- ospdef=pbRoughStat(opponent,Stats.SPDEF,skill);
+ if (skill>=TrainerAI.mediumSkill) {
+ adef=RoughStat(attacker,Stats.DEFENSE,skill);
+ aspdef=RoughStat(attacker,Stats.SPDEF,skill);
+ odef=RoughStat(opponent,Stats.DEFENSE,skill);
+ ospdef=RoughStat(opponent,Stats.SPDEF,skill);
if (adef0) {
+ if (attacker.OwnSide.Tailwind>0) {
score-=90;
}
break;
@@ -1607,7 +1607,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
foreach (var i in attacker.moves) {
if (i.id==move.id) continue;
//if (Types.isPseudoType(i.Type)) continue;
- if (attacker.pbHasType(i.Type)) continue;
+ if (attacker.HasType(i.Type)) continue;
bool found=false;
if (!types.Contains(i.Type)) types.Add(i.Type);
}
@@ -1620,14 +1620,14 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (attacker.Ability == Abilities.MULTITYPE) {
score-=90;
} else if (opponent.lastMoveUsed<=0
- ) { //|| PBTypes.isPseudoType(Kernal.MoveData[opponent.lastMoveUsed].Type)
+ ) { //|| Types.isPseudoType(Kernal.MoveData[opponent.lastMoveUsed].Type)
score-=90;
}
else {
Types atype=Types.UNKNOWN;
foreach (var i in opponent.moves) {
if (i.id==opponent.lastMoveUsed) {
- atype=i.pbType(move.Type,attacker,opponent); break;
+ atype=i.GetType(move.Type,attacker,opponent); break;
}
}
if (atype<0) {
@@ -1637,7 +1637,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
List types=new List();
//for (int i = 0; i < Kernal.TypeData.Keys.Count; i++) {
foreach (Types i in Kernal.TypeData.Keys) {
- if (attacker.pbHasType(i)) continue;
+ if (attacker.HasType(i)) continue;
if (atype.GetEffectiveness(i)<2 ) types.Add(i);
}
if (types.Count==0) {
@@ -1649,7 +1649,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x0D6:
if (attacker.Ability == Abilities.MULTITYPE) {
score-=90;
- } else if (skill>=PBTrainerAI.mediumSkill) {
+ } else if (skill>=TrainerAI.mediumSkill) {
Types[] envtypes=new Types[] {
Types.NORMAL, // None
Types.GRASS, // Grass
@@ -1662,31 +1662,31 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
Types.GROUND // Sand
};
Types type=envtypes[(int)@environment];
- if (attacker.pbHasType(type)) score-=90;
+ if (attacker.HasType(type)) score-=90;
}
break;
case Attack.Data.Effects.x127:
if (opponent.effects.Substitute>0 ||
opponent.Ability == Abilities.MULTITYPE) {
score-=90;
- } else if (opponent.pbHasType(Types.WATER)) {
+ } else if (opponent.HasType(Types.WATER)) {
score-=90;
}
break;
case Attack.Data.Effects.x13F:
if (attacker.Ability == Abilities.MULTITYPE) {
score-=90;
- } else if (attacker.pbHasType(opponent.Type1) &&
- attacker.pbHasType(opponent.Type2) &&
- opponent.pbHasType(attacker.Type1) &&
- opponent.pbHasType(attacker.Type2)) {
+ } else if (attacker.HasType(opponent.Type1) &&
+ attacker.HasType(opponent.Type2) &&
+ opponent.HasType(attacker.Type1) &&
+ opponent.HasType(attacker.Type2)) {
score-=90;
}
break;
case Attack.Data.Effects.x12B:
if (opponent.effects.Substitute>0) {
score-=90;
- } else if (skill>=PBTrainerAI.mediumSkill) {
+ } else if (skill>=TrainerAI.mediumSkill) {
if (opponent.Ability == Abilities.MULTITYPE ||
opponent.Ability == Abilities.SIMPLE ||
opponent.Ability == Abilities.TRUANT) {
@@ -1697,7 +1697,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x0F8:
if (opponent.effects.Substitute>0) {
score-=90;
- } else if (skill>=PBTrainerAI.mediumSkill) {
+ } else if (skill>=TrainerAI.mediumSkill) {
if (opponent.Ability == Abilities.MULTITYPE ||
opponent.Ability == Abilities.INSOMNIA ||
opponent.Ability == Abilities.TRUANT) {
@@ -1707,7 +1707,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x0B3:
score-=40; // don't prefer this move
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (opponent.Ability==0 ||
attacker.Ability==opponent.Ability ||
attacker.Ability == Abilities.MULTITYPE ||
@@ -1722,12 +1722,12 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=90;
}
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.Ability == Abilities.TRUANT &&
- attacker.pbIsOpposing(opponent.Index)) {
+ attacker.IsOpposing(opponent.Index)) {
score-=90;
} else if (opponent.Ability == Abilities.SLOW_START &&
- attacker.pbIsOpposing(opponent.Index)) {
+ attacker.IsOpposing(opponent.Index)) {
score-=90;
}
}
@@ -1736,7 +1736,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=40; // don't prefer this move
if (opponent.effects.Substitute>0) {
score-=90;
- } else if (skill>=PBTrainerAI.mediumSkill) {
+ } else if (skill>=TrainerAI.mediumSkill) {
if (attacker.Ability==0 ||
attacker.Ability==opponent.Ability ||
opponent.Ability == Abilities.MULTITYPE ||
@@ -1750,12 +1750,12 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
attacker.Ability == Abilities.ZEN_MODE) {
score-=90;
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.Ability == Abilities.TRUANT &&
- attacker.pbIsOpposing(opponent.Index)) {
+ attacker.IsOpposing(opponent.Index)) {
score+=90;
} else if (attacker.Ability == Abilities.SLOW_START &&
- attacker.pbIsOpposing(opponent.Index)) {
+ attacker.IsOpposing(opponent.Index)) {
score+=90;
}
}
@@ -1763,7 +1763,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x0C0:
score-=40; // don't prefer this move
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if ((attacker.Ability==0 && opponent.Ability==0) ||
attacker.Ability==opponent.Ability ||
attacker.Ability == Abilities.ILLUSION ||
@@ -1775,12 +1775,12 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=90;
}
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.Ability == Abilities.TRUANT &&
- attacker.pbIsOpposing(opponent.Index)) {
+ attacker.IsOpposing(opponent.Index)) {
score-=90;
} else if (opponent.Ability == Abilities.SLOW_START &&
- attacker.pbIsOpposing(opponent.Index)) {
+ attacker.IsOpposing(opponent.Index)) {
score-=90;
}
}
@@ -1789,7 +1789,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (opponent.effects.Substitute>0 ||
opponent.effects.GastroAcid) {
score-=90;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
if (opponent.Ability == Abilities.MULTITYPE) score-=90;
if (opponent.Ability == Abilities.SLOW_START) score-=90;
if (opponent.Ability == Abilities.TRUANT) score-=90;
@@ -1834,11 +1834,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=90;
}
else {
- attack=pbRoughStat(attacker,Stats.ATTACK,skill);
- spatk=pbRoughStat(attacker,Stats.SPATK,skill);
+ attack=RoughStat(attacker,Stats.ATTACK,skill);
+ spatk=RoughStat(attacker,Stats.SPATK,skill);
if (attack*1.5=PBTrainerAI.mediumSkill &&
+ } else if (skill>=TrainerAI.mediumSkill &&
opponent.lastMoveUsed>0) {
moveData=Kernal.MoveData[opponent.lastMoveUsed];
if (moveData.Power>0 &&
@@ -1854,11 +1854,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=90;
}
else {
- attack=pbRoughStat(attacker,Stats.ATTACK,skill);
- spatk=pbRoughStat(attacker,Stats.SPATK,skill);
+ attack=RoughStat(attacker,Stats.ATTACK,skill);
+ spatk=RoughStat(attacker,Stats.SPATK,skill);
if (attack>spatk*1.5) {
score-=60;
- } else if (skill>=PBTrainerAI.mediumSkill && opponent.lastMoveUsed>0) {
+ } else if (skill>=TrainerAI.mediumSkill && opponent.lastMoveUsed>0) {
moveData=Kernal.MoveData[opponent.lastMoveUsed];
if (moveData.Power>0 &&
(Core.USEMOVECATEGORY && moveData.Category==Attack.Category.SPECIAL) ||
@@ -1872,7 +1872,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (opponent.effects.HyperBeam>0) score-=90;
break;
case Attack.Data.Effects.x122:
- if (!opponent.pbPartner.isFainted()) score+=10;
+ if (!opponent.Partner.isFainted()) score+=10;
break;
case Attack.Data.Effects.x102:
break;
@@ -1881,7 +1881,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x096:
break;
case Attack.Data.Effects.x093:
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (!opponent.hasWorkingAbility(Abilities.INNER_FOCUS) &&
opponent.effects.Substitute==0) score+=30;
}
@@ -1906,23 +1906,23 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x0DE:
break;
case Attack.Data.Effects.x0BA:
- int attspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- int oppspeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ int attspeed=RoughStat(attacker,Stats.SPEED,skill);
+ int oppspeed=RoughStat(opponent,Stats.SPEED,skill);
if (oppspeed>attspeed) score+=30;
break;
case Attack.Data.Effects.x0E8:
if (@doublebattle) score+=20;
break;
case Attack.Data.Effects.x12E:
- if (skill>=PBTrainerAI.mediumSkill) {
- if (@doublebattle && !attacker.pbPartner.isFainted() &&
- //attacker.pbPartner.pbHasMove(move.id)) score+=20;
- attacker.pbPartner.moves.Any(n => n.id == move.id)) score+=20;
+ if (skill>=TrainerAI.mediumSkill) {
+ if (@doublebattle && !attacker.Partner.isFainted() &&
+ //attacker.Partner.HasMove(move.id)) score+=20;
+ attacker.Partner.moves.Any(n => n.id == move.id)) score+=20;
}
break;
case Attack.Data.Effects.x0E7:
- attspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- oppspeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ attspeed=RoughStat(attacker,Stats.SPEED,skill);
+ oppspeed=RoughStat(opponent,Stats.SPEED,skill);
if (oppspeed>attspeed) score+=30;
break;
case Attack.Data.Effects.x140:
@@ -1960,7 +1960,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x124:
break;
case Attack.Data.Effects.x0B1:
- if (attacker.pbPartner.isFainted()) score-=90;
+ if (attacker.Partner.isFainted()) score-=90;
break;
case Attack.Data.Effects.x0CA:
if (attacker.effects.MudSport) score-=90;
@@ -1973,13 +1973,13 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x121:
break;
case Attack.Data.Effects.x0F1:
- if (attacker.pbOwnSide.LuckyChant>0) score-=90;
+ if (attacker.OwnSide.LuckyChant>0) score-=90;
break;
case Attack.Data.Effects.x042:
- if (attacker.pbOwnSide.Reflect>0) score-=90;
+ if (attacker.OwnSide.Reflect>0) score-=90;
break;
case Attack.Data.Effects.x024:
- if (attacker.pbOwnSide.LightScreen>0) score-=90;
+ if (attacker.OwnSide.LightScreen>0) score-=90;
break;
case Attack.Data.Effects.x0C6:
break;
@@ -1992,7 +1992,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x072:
if (opponent.effects.Foresight) {
score-=90;
- } else if (opponent.pbHasType(Types.GHOST)) {
+ } else if (opponent.HasType(Types.GHOST)) {
score+=70;
} else if (opponent.stages[(int)Stats.EVASION]<=0) {
score-=60;
@@ -2001,7 +2001,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x0D9:
if (opponent.effects.MiracleEye) {
score-=90;
- } else if (opponent.pbHasType(Types.DARK)) {
+ } else if (opponent.HasType(Types.DARK)) {
score+=70;
} else if (opponent.stages[(int)Stats.EVASION]<=0) {
score-=60;
@@ -2015,7 +2015,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=90;
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
score-=(attacker.effects.ProtectRate*40);
}
if (attacker.turncount==0) score+=50;
@@ -2030,7 +2030,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x00A:
score-=40;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.lastMoveUsed<=0 ||
//(Kernal.MoveData[opponent.lastMoveUsed].flags&0x010)==0) score-=100; // flag e: Copyable by Mirror Move
Kernal.MoveData[opponent.lastMoveUsed].Flags.Mirror) score-=100;
@@ -2074,8 +2074,8 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (opponent.effects.HealBlock>0) score-=90;
break;
case Attack.Data.Effects.x05B:
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (opponent.effects.Encore>0) {
score-=90;
} else if (aspeed>ospeed) {
@@ -2087,7 +2087,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (moveData.Power==0 && (moveData.Target==(Attack.Data.Targets)0x10 || moveData.Target==(Attack.Data.Targets)0x20)) {
score+=60;
} else if (moveData.Power!=0 && moveData.Target==0x00 &&
- pbTypeModifier(moveData.Type,opponent,attacker)==0) {
+ TypeModifier(moveData.Type,opponent,attacker)==0) {
score+=60;
}
}
@@ -2109,7 +2109,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x04C:
if (attacker.effects.FocusEnergy>0) score+=20;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (!opponent.hasWorkingAbility(Abilities.INNER_FOCUS) &&
opponent.effects.Substitute==0) score+=20;
}
@@ -2162,7 +2162,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=90;
}
else {
- switch (pbWeather) {
+ switch (Weather) {
case Weather.SUNNYDAY:
score+=30;
break;
@@ -2175,7 +2175,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x026:
- if (attacker.HP==attacker.TotalHP || !(abe?.pbCanSleep(attacker,false,null,true)??false)) {
+ if (attacker.HP==attacker.TotalHP || !(abe?.CanSleep(attacker,false,null,true)??false)) {
score-=90;
}
else {
@@ -2193,7 +2193,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x055:
if (opponent.effects.LeechSeed>=0) {
score-=90;
- } else if (skill>=PBTrainerAI.mediumSkill && opponent.pbHasType(Types.GRASS)) {
+ } else if (skill>=TrainerAI.mediumSkill && opponent.HasType(Types.GRASS)) {
score-=90;
}
else {
@@ -2201,7 +2201,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x15A:
- if (skill>=PBTrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.LIQUID_OOZE)) {
+ if (skill>=TrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.LIQUID_OOZE)) {
score-=70;
}
else {
@@ -2211,7 +2211,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x009:
if (opponent.Status!=Status.SLEEP) {
score-=100;
- } else if (skill>=PBTrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.LIQUID_OOZE)) {
+ } else if (skill>=TrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.LIQUID_OOZE)) {
score-=70;
}
else {
@@ -2219,7 +2219,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x136:
- if (attacker.pbIsOpposing(opponent.Index)) {
+ if (attacker.IsOpposing(opponent.Index)) {
score-=100;
}
else {
@@ -2228,13 +2228,13 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x008:
- int reserves=attacker.pbNonActivePokemonCount;
- int foes=attacker.pbOppositeOpposing.pbNonActivePokemonCount;
- if (pbCheckGlobalAbility(Abilities.DAMP).IsNotNullOrNone()) {
+ int reserves=attacker.NonActivePokemonCount;
+ int foes=attacker.OppositeOpposing.NonActivePokemonCount;
+ if (CheckGlobalAbility(Abilities.DAMP).IsNotNullOrNone()) {
score-=100;
- } else if (skill>=PBTrainerAI.mediumSkill && reserves==0 && foes>0) {
+ } else if (skill>=TrainerAI.mediumSkill && reserves==0 && foes>0) {
score-=100; // don't want to lose
- } else if (skill>=PBTrainerAI.highSkill && reserves==0 && foes==0) {
+ } else if (skill>=TrainerAI.highSkill && reserves==0 && foes==0) {
score-=100; // don't want to draw
}
else {
@@ -2244,10 +2244,10 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x141:
break;
case Attack.Data.Effects.x0A9:
- if (!(obe?.pbCanReduceStatStage(Stats.ATTACK,attacker)??false) &&
- !(obe?.pbCanReduceStatStage(Stats.SPATK,attacker)??false)) {
+ if (!(obe?.CanReduceStatStage(Stats.ATTACK,attacker)??false) &&
+ !(obe?.CanReduceStatStage(Stats.SPATK,attacker)??false)) {
score-=100;
- } else if (attacker.pbNonActivePokemonCount==0) {
+ } else if (attacker.NonActivePokemonCount==0) {
score-=100;
}
else {
@@ -2260,7 +2260,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
score-=70;
break;
case Attack.Data.Effects.x073:
- if (attacker.pbNonActivePokemonCount==0) {
+ if (attacker.NonActivePokemonCount==0) {
score-=90;
}
else {
@@ -2279,7 +2279,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x075:
if (attacker.HP>(attacker.TotalHP/2)) score-=25;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.effects.ProtectRate>1) score-=90;
if (opponent.effects.HyperBeam>0) score-=90;
}
@@ -2301,33 +2301,33 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x01D:
if (opponent.effects.Ingrain ||
- (skill>=PBTrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.SUCTION_CUPS))) {
+ (skill>=TrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.SUCTION_CUPS))) {
score-=90;
}
else {
- party=pbParty(opponent.Index);
+ party=Party(opponent.Index);
int ch=0;
for (int i = 0; i < party.Length; i++) {
- if (pbCanSwitchLax(opponent.Index,i,false)) ch+=1;
+ if (CanSwitchLax(opponent.Index,i,false)) ch+=1;
}
if (ch==0) score-=90;
}
if (score>20) {
- if (opponent.pbOwnSide.Spikes>0) score+=50;
- if (opponent.pbOwnSide.ToxicSpikes>0) score+=50;
- if (opponent.pbOwnSide.StealthRock) score+=50;
+ if (opponent.OwnSide.Spikes>0) score+=50;
+ if (opponent.OwnSide.ToxicSpikes>0) score+=50;
+ if (opponent.OwnSide.StealthRock) score+=50;
}
break;
case Attack.Data.Effects.x13A:
if (!opponent.effects.Ingrain &&
- !(skill>=PBTrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.SUCTION_CUPS))) {
- if (opponent.pbOwnSide.Spikes>0) score+=40;
- if (opponent.pbOwnSide.ToxicSpikes>0) score+=40;
- if (opponent.pbOwnSide.StealthRock) score+=40;
+ !(skill>=TrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.SUCTION_CUPS))) {
+ if (opponent.OwnSide.Spikes>0) score+=40;
+ if (opponent.OwnSide.ToxicSpikes>0) score+=40;
+ if (opponent.OwnSide.StealthRock) score+=40;
}
break;
case Attack.Data.Effects.x080:
- if (!pbCanChooseNonActive(attacker.Index)) {
+ if (!CanChooseNonActive(attacker.Index)) {
score-=80;
}
else {
@@ -2364,12 +2364,12 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (opponent.effects.MeanLook>=0) score-=90;
break;
case Attack.Data.Effects.x0BD:
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.Item!=0) score+=20;
}
break;
case Attack.Data.Effects.x06A:
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.Item==0 && opponent.Item!=0) {
score+=40;
}
@@ -2384,7 +2384,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x0B2:
if (attacker.Item==0 && opponent.Item==0) {
score-=90;
- } else if (skill>=PBTrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.STICKY_HOLD)) {
+ } else if (skill>=TrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.STICKY_HOLD)) {
score-=90;
} else if (attacker.hasWorkingItem(Items.FLAME_ORB) ||
attacker.hasWorkingItem(Items.TOXIC_ORB) ||
@@ -2419,7 +2419,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x0E1: case Attack.Data.Effects.x13B:
if (opponent.effects.Substitute==0) {
- if (skill>=PBTrainerAI.highSkill && Game.GameData is IItemCheck c && c.pbIsBerry(opponent.Item)) {
+ if (skill>=TrainerAI.highSkill && Game.GameData is IItemCheck c && c.IsBerry(opponent.Item)) {
score+=30;
}
}
@@ -2433,9 +2433,9 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x0EA:
if (attacker.Item==0 ||
- pbIsUnlosableItem(attacker,attacker.Item) ||
- Game.GameData is IItemCheck g && g.pbIsPokeBall(attacker.Item) ||
- //ItemData.pbIsPokeBall(attacker.Item) ||
+ IsUnlosableItem(attacker,attacker.Item) ||
+ Game.GameData is IItemCheck g && g.IsPokeBall(attacker.Item) ||
+ //ItemData.IsPokeBall(attacker.Item) ||
attacker.hasWorkingAbility(Abilities.KLUTZ) ||
attacker.effects.Embargo>0) {
score-=90;
@@ -2463,18 +2463,18 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x107:
score-=30;
- if (obe?.pbCanParalyze(attacker,false)??false) {
+ if (obe?.CanParalyze(attacker,false)??false) {
score+=30;
- if (skill>=PBTrainerAI.mediumSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.mediumSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score-=40;
}
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.GUTS)) score-=40;
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=40;
if (opponent.hasWorkingAbility(Abilities.QUICK_FEET)) score-=40;
@@ -2483,9 +2483,9 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
break;
case Attack.Data.Effects.x0FE:
score-=30;
- if (obe?.pbCanBurn(attacker,false)??false) {
+ if (obe?.CanBurn(attacker,false)??false) {
score+=30;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.GUTS)) score-=40;
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=40;
if (opponent.hasWorkingAbility(Abilities.QUICK_FEET)) score-=40;
@@ -2494,10 +2494,10 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x08A:
- if (pbCheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
- pbCheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
+ if (CheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
+ CheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
score-=90;
- } else if (pbWeather==Weather.SUNNYDAY) {
+ } else if (Weather==Weather.SUNNYDAY) {
score-=90;
}
else {
@@ -2510,10 +2510,10 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x089:
- if (pbCheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
- pbCheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
+ if (CheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
+ CheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
score-=90;
- } else if (pbWeather==Weather.RAINDANCE) {
+ } else if (Weather==Weather.RAINDANCE) {
score-=90;
}
else {
@@ -2526,57 +2526,57 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x074:
- if (pbCheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
- pbCheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
+ if (CheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
+ CheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
score-=90;
- } else if (pbWeather==Weather.SANDSTORM) {
+ } else if (Weather==Weather.SANDSTORM) {
score-=90;
}
break;
case Attack.Data.Effects.x0A5:
- if (pbCheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
- pbCheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
+ if (CheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
+ CheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
score-=90;
- } else if (pbWeather==Weather.HAIL) {
+ } else if (Weather==Weather.HAIL) {
score-=90;
}
break;
case Attack.Data.Effects.x071:
- if (attacker.pbOpposingSide.Spikes>=3) {
+ if (attacker.OpposingSide.Spikes>=3) {
score-=90;
- } else if (!pbCanChooseNonActive(attacker.pbOpposing1.Index) &&
- !pbCanChooseNonActive(attacker.pbOpposing2.Index)) {
+ } else if (!CanChooseNonActive(attacker.Opposing1.Index) &&
+ !CanChooseNonActive(attacker.Opposing2.Index)) {
// Opponent can't switch in any Pokemon
score-=90;
}
else {
- score+=5*attacker.pbOppositeOpposing.pbNonActivePokemonCount;
- score+=new int[] { 40, 26, 13 }[attacker.pbOpposingSide.Spikes];
+ score+=5*attacker.OppositeOpposing.NonActivePokemonCount;
+ score+=new int[] { 40, 26, 13 }[attacker.OpposingSide.Spikes];
}
break;
case Attack.Data.Effects.x0FA:
- if (attacker.pbOpposingSide.ToxicSpikes>=2) {
+ if (attacker.OpposingSide.ToxicSpikes>=2) {
score-=90;
- } else if (!pbCanChooseNonActive(attacker.pbOpposing1.Index) &&
- !pbCanChooseNonActive(attacker.pbOpposing2.Index)) {
+ } else if (!CanChooseNonActive(attacker.Opposing1.Index) &&
+ !CanChooseNonActive(attacker.Opposing2.Index)) {
// Opponent can't switch in any Pokemon
score-=90;
}
else {
- score+=4*attacker.pbOppositeOpposing.pbNonActivePokemonCount;
- score+=new int[] { 26, 13 }[attacker.pbOpposingSide.ToxicSpikes];
+ score+=4*attacker.OppositeOpposing.NonActivePokemonCount;
+ score+=new int[] { 26, 13 }[attacker.OpposingSide.ToxicSpikes];
}
break;
case Attack.Data.Effects.x10B:
- if (attacker.pbOpposingSide.StealthRock) {
+ if (attacker.OpposingSide.StealthRock) {
score-=90;
- } else if (!pbCanChooseNonActive(attacker.pbOpposing1.Index) &&
- !pbCanChooseNonActive(attacker.pbOpposing2.Index)) {
+ } else if (!CanChooseNonActive(attacker.Opposing1.Index) &&
+ !CanChooseNonActive(attacker.Opposing2.Index)) {
// Opponent can't switch in any Pokemon
score-=90;
}
else {
- score+=5*attacker.pbOppositeOpposing.pbNonActivePokemonCount;
+ score+=5*attacker.OppositeOpposing.NonActivePokemonCount;
}
break;
case Attack.Data.Effects.x147:
@@ -2588,8 +2588,8 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x023:
break;
case Attack.Data.Effects.x0BB:
- if (attacker.pbOpposingSide.Reflect>0) score+=20;
- if (attacker.pbOpposingSide.LightScreen>0) score+=20;
+ if (attacker.OpposingSide.Reflect>0) score+=20;
+ if (attacker.OpposingSide.LightScreen>0) score+=20;
break;
case Attack.Data.Effects.x02E:
score+=10*(attacker.stages[(int)Stats.ACCURACY]-opponent.stages[(int)Stats.EVASION]);
@@ -2602,11 +2602,11 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
}
break;
case Attack.Data.Effects.x06E:
- if (attacker.pbHasType(Types.GHOST)) {
+ if (attacker.HasType(Types.GHOST)) {
if (opponent.effects.Curse) {
score-=90;
} else if (attacker.HP<=(attacker.TotalHP/2)) {
- if (attacker.pbNonActivePokemonCount==0) {
+ if (attacker.NonActivePokemonCount==0) {
score-=90;
}
else {
@@ -2640,16 +2640,16 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x082:
if (attacker.effects.MultiTurn>0) score+=30;
if (attacker.effects.LeechSeed>=0) score+=30;
- if (attacker.pbNonActivePokemonCount>0) {
- if (attacker.pbOwnSide.Spikes>0) score+=80;
- if (attacker.pbOwnSide.ToxicSpikes>0) score+=80;
- if (attacker.pbOwnSide.StealthRock) score+=80;
+ if (attacker.NonActivePokemonCount>0) {
+ if (attacker.OwnSide.Spikes>0) score+=80;
+ if (attacker.OwnSide.ToxicSpikes>0) score+=80;
+ if (attacker.OwnSide.StealthRock) score+=80;
}
break;
case Attack.Data.Effects.x095:
if (opponent.effects.FutureSight>0) {
score-=100;
- } else if (attacker.pbNonActivePokemonCount==0) {
+ } else if (attacker.NonActivePokemonCount==0) {
// Future Sight tends to be wasteful if down to last Pokemon
score-=70;
}
@@ -2696,19 +2696,19 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x0AD:
if (!@doublebattle) {
score-=100;
- } else if (attacker.pbPartner.isFainted()) {
+ } else if (attacker.Partner.isFainted()) {
score-=90;
}
break;
case Attack.Data.Effects.x0D8:
if (@field.Gravity>0) {
score-=90;
- } else if (skill>=PBTrainerAI.mediumSkill) {
+ } else if (skill>=TrainerAI.mediumSkill) {
score-=30;
if (attacker.effects.SkyDrop) score-=20;
if (attacker.effects.MagnetRise>0) score-=20;
if (attacker.effects.Telekinesis>0) score-=20;
- if (attacker.pbHasType(Types.FLYING)) score-=20;
+ if (attacker.HasType(Types.FLYING)) score-=20;
if (attacker.hasWorkingAbility(Abilities.LEVITATE)) score-=20;
if (attacker.hasWorkingItem(Items.AIR_BALLOON)) score-=20;
if (opponent.effects.SkyDrop) score+=20;
@@ -2717,7 +2717,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (Kernal.MoveData[opponent.effects.TwoTurnAttack].Effect==Attack.Data.Effects.x09C || // Fly
Kernal.MoveData[opponent.effects.TwoTurnAttack].Effect==Attack.Data.Effects.x108 || // Bounce
Kernal.MoveData[opponent.effects.TwoTurnAttack].Effect==Attack.Data.Effects.x138) score+=20; // Sky Drop
- if (opponent.pbHasType(Types.FLYING)) score+=20;
+ if (opponent.HasType(Types.FLYING)) score+=20;
if (opponent.hasWorkingAbility(Abilities.LEVITATE)) score+=20;
if (opponent.hasWorkingItem(Items.AIR_BALLOON)) score+=20;
}
@@ -2739,12 +2739,12 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x0D0:
break;
case Attack.Data.Effects.x120:
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (opponent.effects.MagnetRise>0) score+=20;
if (opponent.effects.Telekinesis>0) score+=20;
if (Kernal.MoveData[opponent.effects.TwoTurnAttack].Effect==Attack.Data.Effects.x09C || // Fly
Kernal.MoveData[opponent.effects.TwoTurnAttack].Effect==Attack.Data.Effects.x108) score+=20; // Bounce
- if (opponent.pbHasType(Types.FLYING)) score+=20;
+ if (opponent.HasType(Types.FLYING)) score+=20;
if (opponent.hasWorkingAbility(Abilities.LEVITATE)) score+=20;
if (opponent.hasWorkingItem(Items.AIR_BALLOON)) score+=20;
}
@@ -2762,8 +2762,8 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
case Attack.Data.Effects.x11B:
break;
case Attack.Data.Effects.x125:
- if (!opponent.pbHasType(attacker.Type1) &&
- !opponent.pbHasType(attacker.Type2)) {
+ if (!opponent.HasType(attacker.Type1) &&
+ !opponent.HasType(attacker.Type2)) {
score-=90;
}
break;
@@ -2776,18 +2776,18 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
// break;
//case 0x127:
// score+=20; // Shadow moves are more preferable
- // if (obe?.pbCanParalyze(attacker,false)??false) {
+ // if (obe?.CanParalyze(attacker,false)??false) {
// score+=30;
- // if (skill>=PBTrainerAI.mediumSkill) {
- // int aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- // int ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ // if (skill>=TrainerAI.mediumSkill) {
+ // int aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ // int ospeed=RoughStat(opponent,Stats.SPEED,skill);
// if (aspeedospeed) {
// score-=40;
// }
// }
- // if (skill>=PBTrainerAI.highSkill) {
+ // if (skill>=TrainerAI.highSkill) {
// if (opponent.hasWorkingAbility(Abilities.GUTS)) score-=40;
// if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=40;
// if (opponent.hasWorkingAbility(Abilities.QUICK_FEET)) score-=40;
@@ -2796,9 +2796,9 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
// break;
//case 0x128:
// score+=20; // Shadow moves are more preferable
- // if (obe?.pbCanBurn(attacker,false)??false) {
+ // if (obe?.CanBurn(attacker,false)??false) {
// score+=30;
- // if (skill>=PBTrainerAI.highSkill) {
+ // if (skill>=TrainerAI.highSkill) {
// if (opponent.hasWorkingAbility(Abilities.GUTS)) score-=40;
// if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=40;
// if (opponent.hasWorkingAbility(Abilities.QUICK_FEET)) score-=40;
@@ -2808,27 +2808,27 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
// break;
//case 0x129:
// score+=20; // Shadow moves are more preferable
- // if (obe?.pbCanFreeze(attacker,false)??false) {
+ // if (obe?.CanFreeze(attacker,false)??false) {
// score+=30;
- // if (skill>=PBTrainerAI.highSkill) {
+ // if (skill>=TrainerAI.highSkill) {
// if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=20;
// }
// }
// break;
//case Attack.Data.Effects.x032:
// score+=20; // Shadow moves are more preferable
- // if (obe?.pbCanConfuse(attacker,false)??false) {
+ // if (obe?.CanConfuse(attacker,false)??false) {
// score+=30;
// }
// else {
- // if (skill>=PBTrainerAI.mediumSkill) {
+ // if (skill>=TrainerAI.mediumSkill) {
// score-=90;
// }
// }
// break;
//case 0x12B:
// score+=20; // Shadow moves are more preferable
- // if (!opponent.pbCanReduceStatStage(Stats.DEFENSE,attacker)) {
+ // if (!opponent.CanReduceStatStage(Stats.DEFENSE,attacker)) {
// score-=90;
// }
// else {
@@ -2838,7 +2838,7 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
// break;
//case Attack.Data.Effects.x714:
// score+=20; // Shadow moves are more preferable
- // if (!opponent.pbCanReduceStatStage(Stats.EVASION,attacker)) {
+ // if (!opponent.CanReduceStatStage(Stats.EVASION,attacker)) {
// score-=90;
// }
// else {
@@ -2863,22 +2863,22 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
// break;
//case Attack.Data.Effects.x716:
// score+=20; // Shadow moves are more preferable
- // if (pbCheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
- // pbCheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
+ // if (CheckGlobalAbility(Abilities.AIR_LOCK).IsNotNullOrNone() ||
+ // CheckGlobalAbility(Abilities.CLOUD_NINE).IsNotNullOrNone()) {
// score-=90;
- // } else if (pbWeather==Weather.SHADOWSKY) {
+ // } else if (Weather==Weather.SHADOWSKY) {
// score-=90;
// }
// break;
//case Attack.Data.Effects.x715:
// score+=20; // Shadow moves are more preferable
- // if (opponent.pbOwnSide.Reflect>0 ||
- // opponent.pbOwnSide.LightScreen>0 ||
- // opponent.pbOwnSide.Safeguard>0) {
+ // if (opponent.OwnSide.Reflect>0 ||
+ // opponent.OwnSide.LightScreen>0 ||
+ // opponent.OwnSide.Safeguard>0) {
// score+=30;
- // if (attacker.pbOwnSide.Reflect>0 ||
- // attacker.pbOwnSide.LightScreen>0 ||
- // attacker.pbOwnSide.Safeguard>0) score-=90;
+ // if (attacker.OwnSide.Reflect>0 ||
+ // attacker.OwnSide.LightScreen>0 ||
+ // attacker.OwnSide.Safeguard>0) score-=90;
// }
// else {
// score-=110;
@@ -2887,14 +2887,14 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
//case 0x133:
case Attack.Data.Effects.x172:
score-=95;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
score=0;
}
break;
case Attack.Data.Effects.x17C:
- if (obe?.pbCanFreeze(attacker,false)??false) {
+ if (obe?.CanFreeze(attacker,false)??false) {
score+=30;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE)) score-=20;
}
}
@@ -2903,50 +2903,50 @@ public int pbGetMoveScore(IBattleMove move,IBattler attacker,IBattler opponent,i
if (attacker.stages[(int)Stats.DEFENSE]<0) score+=20;
break;
case Attack.Data.Effects.x16F:
- if ((abe?.pbTooHigh(Stats.DEFENSE)??false) &&
- (abe?.pbTooHigh(Stats.SPDEF)??false) &&
- !attacker.pbPartner.isFainted() &&
- attacker.pbPartner is IBattlerEffect p &&
- p.pbTooHigh(Stats.DEFENSE) &&
- p.pbTooHigh(Stats.SPDEF)) {
+ if ((abe?.TooHigh(Stats.DEFENSE)??false) &&
+ (abe?.TooHigh(Stats.SPDEF)??false) &&
+ !attacker.Partner.isFainted() &&
+ attacker.Partner is IBattlerEffect p &&
+ p.TooHigh(Stats.DEFENSE) &&
+ p.TooHigh(Stats.SPDEF)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.DEFENSE]*10;
score-=attacker.stages[(int)Stats.SPDEF]*10;
- if (!attacker.pbPartner.isFainted()) {
- score-=attacker.pbPartner.stages[(int)Stats.DEFENSE]*10;
- score-=attacker.pbPartner.stages[(int)Stats.SPDEF]*10;
+ if (!attacker.Partner.isFainted()) {
+ score-=attacker.Partner.stages[(int)Stats.DEFENSE]*10;
+ score-=attacker.Partner.stages[(int)Stats.SPDEF]*10;
}
}
break;
case Attack.Data.Effects.x16B:
if (!@doublebattle) {
score-=100;
- } else if (attacker.pbPartner.isFainted()) {
+ } else if (attacker.Partner.isFainted()) {
score-=90;
}
else {
- score-=attacker.pbPartner.stages[(int)Stats.SPDEF]*10;
+ score-=attacker.Partner.stages[(int)Stats.SPDEF]*10;
}
break;
case Attack.Data.Effects.x165:
- if (!(obe?.pbCanReduceStatStage(Stats.ATTACK,attacker)??false)) {
+ if (!(obe?.CanReduceStatStage(Stats.ATTACK,attacker)??false)) {
score-=90;
}
else {
score+=opponent.stages[(int)Stats.ATTACK]*20;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasphysicalattack=false;
foreach (var thismove in opponent.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsPhysical(thismove.Type)) {
+ thismove.IsPhysical(thismove.Type)) {
hasphysicalattack=true;
}
}
if (hasphysicalattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
@@ -2969,7 +2969,7 @@ attacker.pbPartner is IBattlerEffect p &&
if (opponent.stages[(int)Stats.SPATK]>0) score+=20;
break;
case Attack.Data.Effects.x03E:
- if (!(obe?.pbCanReduceStatStage(Stats.SPATK,attacker)??false)) {
+ if (!(obe?.CanReduceStatStage(Stats.SPATK,attacker)??false)) {
score-=90;
}
else {
@@ -2980,11 +2980,11 @@ attacker.pbPartner is IBattlerEffect p &&
case Attack.Data.Effects.x154:
count=0;
for (int i = 0; i < 4; i++) {
- IBattler battler=@battlers[i];
- if (battler.pbHasType(Types.GRASS) && !battler.isAirborne() &&
- battler is IBattlerEffect b && (!b.pbTooHigh(Stats.ATTACK) || !b.pbTooHigh(Stats.SPATK))) {
+ IBattler battler=_battlers[i];
+ if (battler.HasType(Types.GRASS) && !battler.isAirborne() &&
+ battler is IBattlerEffect b && (!b.TooHigh(Stats.ATTACK) || !b.TooHigh(Stats.SPATK))) {
count+=1;
- if (attacker.pbIsOpposing(battler.Index)) {
+ if (attacker.IsOpposing(battler.Index)) {
score-=20;
}
else {
@@ -2998,10 +2998,10 @@ attacker.pbPartner is IBattlerEffect p &&
case Attack.Data.Effects.x15F:
count=0;
for (int i = 0; i < 4; i++) {
- IBattler battler=@battlers[i];
- if (battler.pbHasType(Types.GRASS) && battler is IBattlerEffect b && !b.pbTooHigh(Stats.DEFENSE)) {
+ IBattler battler=_battlers[i];
+ if (battler.HasType(Types.GRASS) && battler is IBattlerEffect b && !b.TooHigh(Stats.DEFENSE)) {
count+=1;
- if (attacker.pbIsOpposing(battler.Index)) {
+ if (attacker.IsOpposing(battler.Index)) {
score-=20;
}
else {
@@ -3014,13 +3014,13 @@ attacker.pbPartner is IBattlerEffect p &&
case Attack.Data.Effects.x16C:
count=0;
for (int i = 0; i < 4; i++) {
- IBattler battler=@battlers[i];
+ IBattler battler=_battlers[i];
if (battler.Status==Status.POISON && battler is IBattlerEffect b &&
- (!b.pbTooLow(Stats.ATTACK) ||
- !b.pbTooLow(Stats.SPATK) ||
- !b.pbTooLow(Stats.SPEED))) {
+ (!b.TooLow(Stats.ATTACK) ||
+ !b.TooLow(Stats.SPATK) ||
+ !b.TooLow(Stats.SPEED))) {
count+=1;
- if (attacker.pbIsOpposing(battler.Index)) {
+ if (attacker.IsOpposing(battler.Index)) {
score+=attacker.stages[(int)Stats.ATTACK]*10;
score+=attacker.stages[(int)Stats.SPATK]*10;
score+=attacker.stages[(int)Stats.SPEED]*10;
@@ -3052,20 +3052,20 @@ attacker.pbPartner is IBattlerEffect p &&
}
break;
case Attack.Data.Effects.x157:
- if (opponent.pbHasType(Types.GHOST)) {
+ if (opponent.HasType(Types.GHOST)) {
score-=90;
}
break;
case Attack.Data.Effects.x178:
- if (opponent.pbHasType(Types.GRASS)) {
+ if (opponent.HasType(Types.GRASS)) {
score-=90;
}
break;
case Attack.Data.Effects.x152:
break;
case Attack.Data.Effects.x162:
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeed>ospeed) {
score-=90;
}
@@ -3075,13 +3075,13 @@ attacker.pbPartner is IBattlerEffect p &&
//case 0x147:
// break;
case Attack.Data.Effects.x17A:
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeed>ospeed) {
score-=90;
}
else {
- if (opponent.pbHasMoveType(Types.FIRE)) score+=30;
+ if (opponent.HasMoveType(Types.FIRE)) score+=30;
}
break;
case Attack.Data.Effects.x179:
@@ -3090,7 +3090,7 @@ attacker.pbPartner is IBattlerEffect p &&
}
else {
score-=90; // Because it will fail here
- if (skill>=PBTrainerAI.bestSkill) score=0;
+ if (skill>=TrainerAI.bestSkill) score=0;
}
break;
case Attack.Data.Effects.x15E:
@@ -3101,7 +3101,7 @@ attacker.pbPartner is IBattlerEffect p &&
score-=90;
}
else {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
score-=(attacker.effects.ProtectRate*40);
}
if (attacker.turncount==0) score+=50;
@@ -3111,32 +3111,32 @@ attacker.pbPartner is IBattlerEffect p &&
//case 0x14D:
// break;
case Attack.Data.Effects.x16E:
- if ((abe?.pbTooHigh(Stats.SPATK)??false) &&
- (abe?.pbTooHigh(Stats.SPDEF)??false) &&
- (abe?.pbTooHigh(Stats.SPEED)??false)) {
+ if ((abe?.TooHigh(Stats.SPATK)??false) &&
+ (abe?.TooHigh(Stats.SPDEF)??false) &&
+ (abe?.TooHigh(Stats.SPEED)??false)) {
score-=90;
}
else {
score-=attacker.stages[(int)Stats.SPATK]*10; // Only *10 isntead of *20
score-=attacker.stages[(int)Stats.SPDEF]*10; // because two-turn attack
score-=attacker.stages[(int)Stats.SPEED]*10;
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
hasspecialattack=false;
foreach (var thismove in attacker.moves) {
if (thismove.id!=0 && thismove.basedamage>0 &&
- thismove.pbIsSpecial(thismove.Type)) {
+ thismove.IsSpecial(thismove.Type)) {
hasspecialattack=true;
}
}
if (hasspecialattack) {
score+=20;
- } else if (skill>=PBTrainerAI.highSkill) {
+ } else if (skill>=TrainerAI.highSkill) {
score-=90;
}
}
- if (skill>=PBTrainerAI.highSkill) {
- aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
- ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
+ if (skill>=TrainerAI.highSkill) {
+ aspeed=RoughStat(attacker,Stats.SPEED,skill);
+ ospeed=RoughStat(opponent,Stats.SPEED,skill);
if (aspeedospeed) {
score+=30;
}
@@ -3144,7 +3144,7 @@ attacker.pbPartner is IBattlerEffect p &&
}
break;
case Attack.Data.Effects.x15D:
- if (skill>=PBTrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.LIQUID_OOZE)) {
+ if (skill>=TrainerAI.highSkill && opponent.hasWorkingAbility(Abilities.LIQUID_OOZE)) {
score-=80;
}
else {
@@ -3152,7 +3152,7 @@ attacker.pbPartner is IBattlerEffect p &&
}
break;
case Attack.Data.Effects.x156:
- if (!(abe?.pbTooHigh(Stats.ATTACK)??false) && opponent.HP<=(opponent.TotalHP/4)) score+=20;
+ if (!(abe?.TooHigh(Stats.ATTACK)??false) && opponent.HP<=(opponent.TotalHP/4)) score+=20;
break;
case Attack.Data.Effects.x15B:
avg=opponent.stages[(int)Stats.ATTACK]*10;
@@ -3162,7 +3162,7 @@ attacker.pbPartner is IBattlerEffect p &&
case Attack.Data.Effects.x163:
break;
case Attack.Data.Effects.x155:
- if (opponent.pbOwnSide.StickyWeb) score-=95;
+ if (opponent.OwnSide.StickyWeb) score-=95;
break;
case Attack.Data.Effects.x171:
break;
@@ -3182,9 +3182,9 @@ attacker.pbPartner is IBattlerEffect p &&
#endregion
#region Other score modifications ###############################################
// Prefer damaging moves if AI has no more Pokémon
- if (attacker.pbNonActivePokemonCount==0) {
- if (skill>=PBTrainerAI.mediumSkill &&
- !(skill>=PBTrainerAI.highSkill && opponent.pbNonActivePokemonCount>0)) {
+ if (attacker.NonActivePokemonCount==0) {
+ if (skill>=TrainerAI.mediumSkill &&
+ !(skill>=TrainerAI.highSkill && opponent.NonActivePokemonCount>0)) {
if (move.basedamage==0) {
score/=1.5f;
} else if (opponent.HP<=opponent.TotalHP/2) {
@@ -3194,13 +3194,13 @@ attacker.pbPartner is IBattlerEffect p &&
}
// Don't prefer attacking the opponent if they'd be semi-invulnerable
if (opponent.effects.TwoTurnAttack>0 &&
- skill>=PBTrainerAI.highSkill) {
+ skill>=TrainerAI.highSkill) {
Attack.Data.Effects invulmove=Kernal.MoveData[opponent.effects.TwoTurnAttack].Effect;
if (move.Accuracy>0 && // Checks accuracy, i.e. targets opponent
(new Attack.Data.Effects[] { Attack.Data.Effects.x09C,Attack.Data.Effects.x101,Attack.Data.Effects.x100,Attack.Data.Effects.x108,Attack.Data.Effects.x111,Attack.Data.Effects.x138 }.Contains(invulmove) ||
opponent.effects.SkyDrop) &&
attacker.SPE>opponent.SPE) {
- if (skill>=PBTrainerAI.bestSkill) { // Can get past semi-invulnerability
+ if (skill>=TrainerAI.bestSkill) { // Can get past semi-invulnerability
bool miss=false;
switch (invulmove) {
case Attack.Data.Effects.x09C: case Attack.Data.Effects.x108: // Fly: Bounce
@@ -3254,7 +3254,7 @@ attacker.pbPartner is IBattlerEffect p &&
if (attacker.hasWorkingItem(Items.CHOICE_BAND) ||
attacker.hasWorkingItem(Items.CHOICE_SPECS) ||
attacker.hasWorkingItem(Items.CHOICE_SCARF)) {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.basedamage>=60) {
score+=60;
} else if (move.basedamage>0) {
@@ -3270,7 +3270,7 @@ attacker.pbPartner is IBattlerEffect p &&
// If user has King's Rock, prefer moves that may cause flinching with it // TODO
// If user is asleep, prefer moves that are usable while asleep
if (attacker.Status==Status.SLEEP) {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.Effect!=Attack.Data.Effects.x05D && move.Effect!=Attack.Data.Effects.x062) { // Snore, Sleep Talk
bool hasSleepMove=false;
foreach (var m in attacker.moves) {
@@ -3284,7 +3284,7 @@ attacker.pbPartner is IBattlerEffect p &&
}
// If user is frozen, prefer a move that can thaw the user
if (attacker.Status==Status.FROZEN) {
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (move.Flags.Defrost) { //.canThawUser()
score+=40;
}
@@ -3303,28 +3303,28 @@ attacker.pbPartner is IBattlerEffect p &&
#endregion
// Adjust score based on how much damage it can deal
if (move.basedamage>0) {
- float typemod=pbTypeModifier(move.Type,attacker,opponent);
+ float typemod=TypeModifier(move.Type,attacker,opponent);
if (typemod==0 || score<=0) {
score=0;
- } else if (skill>=PBTrainerAI.mediumSkill && typemod<=8 &&
+ } else if (skill>=TrainerAI.mediumSkill && typemod<=8 &&
opponent.hasWorkingAbility(Abilities.WONDER_GUARD)) {
score=0;
- } else if (skill>=PBTrainerAI.mediumSkill && move.Type == Types.GROUND &&
+ } else if (skill>=TrainerAI.mediumSkill && move.Type == Types.GROUND &&
(opponent.hasWorkingAbility(Abilities.LEVITATE) ||
opponent.effects.MagnetRise>0)) {
score=0;
- } else if (skill>=PBTrainerAI.mediumSkill && move.Type == Types.FIRE &&
+ } else if (skill>=TrainerAI.mediumSkill && move.Type == Types.FIRE &&
opponent.hasWorkingAbility(Abilities.FLASH_FIRE)) {
score=0;
- } else if (skill>=PBTrainerAI.mediumSkill && move.Type == Types.WATER &&
+ } else if (skill>=TrainerAI.mediumSkill && move.Type == Types.WATER &&
(opponent.hasWorkingAbility(Abilities.WATER_ABSORB) ||
opponent.hasWorkingAbility(Abilities.STORM_DRAIN) ||
opponent.hasWorkingAbility(Abilities.DRY_SKIN))) {
score=0;
- } else if (skill>=PBTrainerAI.mediumSkill && move.Type == Types.GRASS &&
+ } else if (skill>=TrainerAI.mediumSkill && move.Type == Types.GRASS &&
opponent.hasWorkingAbility(Abilities.SAP_SIPPER)) {
score=0;
- } else if (skill>=PBTrainerAI.mediumSkill && move.Type == Types.ELECTRIC &&
+ } else if (skill>=TrainerAI.mediumSkill && move.Type == Types.ELECTRIC &&
(opponent.hasWorkingAbility(Abilities.VOLT_ABSORB) ||
opponent.hasWorkingAbility(Abilities.LIGHTNING_ROD) ||
opponent.hasWorkingAbility(Abilities.MOTOR_DRIVE))) {
@@ -3334,15 +3334,15 @@ attacker.pbPartner is IBattlerEffect p &&
// Calculate how much damage the move will do (roughly)
int realDamage=move.basedamage;//??0;
if (move.basedamage==1) realDamage=60;
- if (skill>=PBTrainerAI.mediumSkill) {
- realDamage=pbBetterBaseDamage(move,attacker,opponent,skill,realDamage);
+ if (skill>=TrainerAI.mediumSkill) {
+ realDamage=BetterBaseDamage(move,attacker,opponent,skill,realDamage);
}
- realDamage=pbRoughDamage(move,attacker,opponent,skill,realDamage);
+ realDamage=RoughDamage(move,attacker,opponent,skill,realDamage);
// Account for accuracy of move
- int accuracy=pbRoughAccuracy(move,attacker,opponent,skill);
+ int accuracy=RoughAccuracy(move,attacker,opponent,skill);
float basedamage=realDamage*accuracy/100.0f;
// Two-turn attacks waste 2 turns to deal one lot of damage
- //if (move.pbTwoTurnAttack(attacker) || move.Effect==Attack.Data.Effects.x051) { // Hyper Beam
+ //if (move.TwoTurnAttack(attacker) || move.Effect==Attack.Data.Effects.x051) { // Hyper Beam
if (Kernal.MoveMetaData[move.id].MaxTurns > 1 || move.Effect==Attack.Data.Effects.x051) { // Hyper Beam
basedamage*=2/3; // Not halved because semi-invulnerable during use or hits first turn
}
@@ -3385,9 +3385,9 @@ attacker.pbPartner is IBattlerEffect p &&
// Don't prefer attacks which don't deal damage
score-=10;
// Account for accuracy of move
- int accuracy=pbRoughAccuracy(move,attacker,opponent,skill);
+ int accuracy=RoughAccuracy(move,attacker,opponent,skill);
score*=accuracy/100.0f;
- if (score<=10 && skill>=PBTrainerAI.highSkill) score=0;
+ if (score<=10 && skill>=TrainerAI.highSkill) score=0;
}
//score=score.ToInteger();
if (score<0) score=0;
@@ -3395,9 +3395,9 @@ attacker.pbPartner is IBattlerEffect p &&
}
#region Get type effectiveness and approximate stats.
- public float pbTypeModifier(Types type,IBattler attacker,IBattler opponent) {
+ public float TypeModifier(Types type,IBattler attacker,IBattler opponent) {
if (type<0) return 8;
- if (type == Types.GROUND && opponent.pbHasType(Types.FLYING) &&
+ if (type == Types.GROUND && opponent.HasType(Types.FLYING) &&
opponent.hasWorkingItem(Items.IRON_BALL) && !Core.USENEWBATTLEMECHANICS) return 8;
Types atype=type;
Types otype1=opponent.Type1;
@@ -3437,7 +3437,7 @@ public float pbTypeModifier(Types type,IBattler attacker,IBattler opponent) {
// if (otype3 == Types.DARK && atype.isIneffective(otype3)) mod3=2;
//}
//// Delta Stream's weather
- //if (pbWeather==Weather.STRONGWINDS) {
+ //if (Weather==Weather.STRONGWINDS) {
// if (otype1 == Types.FLYING && atype.isSuperEffective(otype1)) mod1=2;
// if (otype2 == Types.FLYING && atype.isSuperEffective(otype2)) mod2=2;
// if (otype3 == Types.FLYING && atype.isSuperEffective(otype3)) mod3=2;
@@ -3451,18 +3451,18 @@ public float pbTypeModifier(Types type,IBattler attacker,IBattler opponent) {
return mod1*mod2*mod3;
}
- public float pbTypeModifier2(IBattler battlerThis,IBattler battlerOther) {
+ public float TypeModifier2(IBattler battlerThis,IBattler battlerOther) {
// battlerThis isn't a Battler object, it's a Pokémon - it has no third type
if (battlerThis.Type1==battlerThis.Type2) {
- return 4*pbTypeModifier(battlerThis.Type1,battlerThis,battlerOther);
+ return 4*TypeModifier(battlerThis.Type1,battlerThis,battlerOther);
}
- float ret=pbTypeModifier(battlerThis.Type1,battlerThis,battlerOther);
- ret*=pbTypeModifier(battlerThis.Type2,battlerThis,battlerOther);
+ float ret=TypeModifier(battlerThis.Type1,battlerThis,battlerOther);
+ ret*=TypeModifier(battlerThis.Type2,battlerThis,battlerOther);
return ret*2; // 0,1,2,4,_8_,16,32,64
}
- public int pbRoughStat(IBattler battler,Stats stat,int skill) {
- if (skill>=PBTrainerAI.highSkill && stat==Stats.SPEED) return battler.SPE;//pbSpeed;
+ public int RoughStat(IBattler battler,Stats stat,int skill) {
+ if (skill>=TrainerAI.highSkill && stat==Stats.SPEED) return battler.SPE;//Speed;
int[] stagemul=new int[] { 2,2,2,2,2,2,2,3,4,5,6,7,8 };
int[] stagediv=new int[] { 8,7,6,5,4,3,2,2,2,2,2,2,2 };
int stage=battler.stages[(int)stat]+6;
@@ -3482,9 +3482,9 @@ public int pbRoughStat(IBattler battler,Stats stat,int skill) {
return (int)Math.Floor(value*1.0f*stagemul[stage]/stagediv[stage]);
}
- public int pbBetterBaseDamage(IBattleMove move,IBattler attacker,IBattler opponent,int skill,int basedamage) {
+ public int BetterBaseDamage(IBattleMove move,IBattler attacker,IBattler opponent,int skill,int basedamage) {
int mult, n = 0; float weight = 0;
- // Covers all function codes which have their own def pbBaseDamage
+ // Covers all function codes which have their own def BaseDamage
switch (move.Effect) {
case Attack.Data.Effects.x083: // SonicBoom
basedamage=20;
@@ -3554,7 +3554,7 @@ public int pbBetterBaseDamage(IBattleMove move,IBattler attacker,IBattler oppone
if (attacker.Item==0 || attacker.hasWorkingItem(Items.FLYING_GEM)) basedamage*=2;
break;
case Attack.Data.Effects.x0CC: // Weather Ball
- if (pbWeather!=0) basedamage*=2;
+ if (Weather!=0) basedamage*=2;
break;
case Attack.Data.Effects.x07A: // Return
basedamage=(int)Math.Max((int)Math.Floor(attacker.Happiness*2/5f),1);
@@ -3569,8 +3569,8 @@ public int pbBetterBaseDamage(IBattleMove move,IBattler attacker,IBattler oppone
basedamage=(int)Math.Max((int)Math.Floor(120f*opponent.HP/opponent.TotalHP),1);
break;
case Attack.Data.Effects.x0DC: // Gyro Ball
- int ospeed=pbRoughStat(opponent,Stats.SPEED,skill);
- int aspeed=pbRoughStat(attacker,Stats.SPEED,skill);
+ int ospeed=RoughStat(opponent,Stats.SPEED,skill);
+ int aspeed=RoughStat(attacker,Stats.SPEED,skill);
basedamage=(int)Math.Max((int)Math.Min((int)Math.Floor(25f*ospeed/aspeed),150),1);
break;
case Attack.Data.Effects.x132: // Stored Power
@@ -3590,14 +3590,14 @@ public int pbBetterBaseDamage(IBattleMove move,IBattler attacker,IBattler oppone
basedamage=(int)Math.Min(20*(mult+3),200);
break;
case Attack.Data.Effects.x088: // Hidden Power
- KeyValuePair hp=PokeBattle_Move_090.pbHiddenPower(attacker.IV);
+ KeyValuePair hp=PokeBattle_Move_090.HiddenPower(attacker.IV);
basedamage=hp.Value;
break;
case Attack.Data.Effects.x078: // Fury Cutter
basedamage=basedamage<<(attacker.effects.FuryCutter-1);
break;
case Attack.Data.Effects.x12F: // Echoed Voice
- basedamage*=attacker.pbOwnSide.EchoedVoiceCounter;
+ basedamage*=attacker.OwnSide.EchoedVoiceCounter;
break;
case Attack.Data.Effects.x07B: // Present
basedamage=50;
@@ -3696,7 +3696,7 @@ public int pbBetterBaseDamage(IBattleMove move,IBattler attacker,IBattler oppone
}
break;
case Attack.Data.Effects.x09B: // Beat Up
- PokemonEssentials.Interface.PokeBattle.IPokemon[] party=pbParty(attacker.Index);
+ PokemonEssentials.Interface.PokeBattle.IPokemon[] party=Party(attacker.Index);
mult=0;
for (int i = 0; i < party.Length; i++) {
if (party[i].IsNotNullOrNone() && !party[i].isEgg &&
@@ -3705,17 +3705,17 @@ public int pbBetterBaseDamage(IBattleMove move,IBattler attacker,IBattler oppone
basedamage*=mult;
break;
case Attack.Data.Effects.x098: // SolarBeam
- if (pbWeather!=0 && pbWeather!=Weather.SUNNYDAY) {
+ if (Weather!=0 && Weather!=Weather.SUNNYDAY) {
basedamage=(int)Math.Floor(basedamage*0.5f);
}
break;
case Attack.Data.Effects.x106: // Whirlpool
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (Kernal.MoveData[opponent.effects.TwoTurnAttack].Effect==Attack.Data.Effects.x100) basedamage*=2; // Dive
}
break;
case Attack.Data.Effects.x076: // Rollout
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.effects.DefenseCurl) basedamage*=2;
}
break;
@@ -3741,7 +3741,7 @@ public int pbBetterBaseDamage(IBattleMove move,IBattler attacker,IBattler oppone
return basedamage;
}
- public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent, int skill, double basedamage) {
+ public int RoughDamage(IBattleMove move, IBattler attacker, IBattler opponent, int skill, double basedamage) {
// Fixed damage moves
if (move.Effect==Attack.Data.Effects.x083 || // SonicBoom
move.Effect==Attack.Data.Effects.x02A || // Dragon Rage
@@ -3756,23 +3756,23 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
move.Effect==Attack.Data.Effects.x141) return (int)basedamage; // Final Gambit
Types type=move.Type;
// More accurate move type (includes Normalize, most type-changing moves, etc.)
- if (skill>=PBTrainerAI.highSkill) {
- type=move.pbType(type,attacker,opponent);
+ if (skill>=TrainerAI.highSkill) {
+ type=move.GetType(type,attacker,opponent);
}
// Technician
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.TECHNICIAN) && basedamage<=60) {
basedamage=(int)Math.Round(basedamage*1.5);
}
}
// Iron Fist
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.IRON_FIST) && move.Flags.Punching) {
basedamage=(int)Math.Round(basedamage*1.2);
}
}
// Reckless
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.RECKLESS)) {
if(move.Effect==Attack.Data.Effects.x031 || // Take Down, etc.
move.Effect==Attack.Data.Effects.x0C7 || // Double-Edge, etc.
@@ -3786,22 +3786,22 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Flare Boost
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.FLARE_BOOST) &&
- attacker.Status==Status.BURN && move.pbIsSpecial(type)) {
+ attacker.Status==Status.BURN && move.IsSpecial(type)) {
basedamage=(int)Math.Round(basedamage*1.5);
}
}
// Toxic Boost
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.TOXIC_BOOST) &&
- attacker.Status==Status.POISON && move.pbIsPhysical(type)) {
+ attacker.Status==Status.POISON && move.IsPhysical(type)) {
basedamage=(int)Math.Round(basedamage*1.5);
}
}
// Analytic
// Rivalry
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.RIVALRY) &&
attacker.Gender!=null && opponent.Gender!=null) {
if (attacker.Gender==opponent.Gender) {
@@ -3813,9 +3813,9 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Sand Force
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.SAND_FORCE) &&
- pbWeather==Weather.SANDSTORM &&
+ Weather==Weather.SANDSTORM &&
(type == Types.ROCK ||
type == Types.GROUND ||
type == Types.STEEL)) {
@@ -3823,21 +3823,21 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Heatproof
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if (opponent.hasWorkingAbility(Abilities.HEATPROOF) &&
type == Types.FIRE) {
basedamage=(int)Math.Round(basedamage*0.5);
}
}
// Dry Skin
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if (opponent.hasWorkingAbility(Abilities.DRY_SKIN) &&
type == Types.FIRE) {
basedamage=(int)Math.Round(basedamage*1.25);
}
}
// Sheer Force
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.SHEER_FORCE) && move.AddlEffect>0) {
basedamage=(int)Math.Round(basedamage*1.3);
}
@@ -3915,11 +3915,11 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
basedamage=(int)Math.Round(basedamage*1.2);
}
// Muscle Band
- if (attacker.hasWorkingItem(Items.MUSCLE_BAND) && move.pbIsPhysical(type)) {
+ if (attacker.hasWorkingItem(Items.MUSCLE_BAND) && move.IsPhysical(type)) {
basedamage=(int)Math.Round(basedamage*1.1);
}
// Wise Glasses
- if (attacker.hasWorkingItem(Items.WISE_GLASSES) && move.pbIsSpecial(type)) {
+ if (attacker.hasWorkingItem(Items.WISE_GLASSES) && move.IsSpecial(type)) {
basedamage=(int)Math.Round(basedamage*1.1);
}
// Legendary Orbs
@@ -3938,7 +3938,7 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
(type == Types.DRAGON || type == Types.GHOST)) {
basedamage=(int)Math.Round(basedamage*1.2);
}
- // pbBaseDamageMultiplier - TODO
+ // BaseDamageMultiplier - TODO
// Me First
// Charge
if (attacker.effects.Charge>0 && type == Types.ELECTRIC) {
@@ -3946,10 +3946,10 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
// Helping Hand - n/a
// Water Sport
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (type == Types.FIRE) {
for (int i = 0; i < 4; i++) {
- if (@battlers[i].effects.WaterSport && !@battlers[i].isFainted()) {
+ if (_battlers[i].effects.WaterSport && !_battlers[i].isFainted()) {
basedamage=(int)Math.Round(basedamage*0.33);
break;
}
@@ -3957,10 +3957,10 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Mud Sport
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (type == Types.ELECTRIC) {
for (int i = 0; i < 4; i++) {
- if (@battlers[i].effects.MudSport && !@battlers[i].isFainted()) {
+ if (_battlers[i].effects.MudSport && !_battlers[i].isFainted()) {
basedamage=(int)Math.Round(basedamage*0.33);
break;
}
@@ -3968,31 +3968,31 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Get base attack stat
- int atk=pbRoughStat(attacker,Stats.ATTACK,skill);
+ int atk=RoughStat(attacker,Stats.ATTACK,skill);
if (move.Effect==Attack.Data.Effects.x12A) { // Foul Play
- atk=pbRoughStat(opponent,Stats.ATTACK,skill);
+ atk=RoughStat(opponent,Stats.ATTACK,skill);
}
- if (type>=0 && move.pbIsSpecial(type)) {
- atk=pbRoughStat(attacker,Stats.SPATK,skill);
+ if (type>=0 && move.IsSpecial(type)) {
+ atk=RoughStat(attacker,Stats.SPATK,skill);
if (move.Effect==Attack.Data.Effects.x12A) { // Foul Play
- atk=pbRoughStat(opponent,Stats.SPATK,skill);
+ atk=RoughStat(opponent,Stats.SPATK,skill);
}
}
// Hustle
- if (skill>=PBTrainerAI.highSkill) {
- if (attacker.hasWorkingAbility(Abilities.HUSTLE) && move.pbIsPhysical(type)) {
+ if (skill>=TrainerAI.highSkill) {
+ if (attacker.hasWorkingAbility(Abilities.HUSTLE) && move.IsPhysical(type)) {
atk=(int)Math.Round(atk*1.5);
}
}
// Thick Fat
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if (opponent.hasWorkingAbility(Abilities.THICK_FAT) &&
(type == Types.ICE || type == Types.FIRE)) {
atk=(int)Math.Round(atk*0.5);
}
}
// Pinch abilities
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.HP<=(int)Math.Floor(attacker.TotalHP/3f)) {
if ((attacker.hasWorkingAbility(Abilities.OVERGROW) && type == Types.GRASS) ||
(attacker.hasWorkingAbility(Abilities.BLAZE) && type == Types.FIRE) ||
@@ -4003,66 +4003,66 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Guts
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.GUTS) &&
- attacker.Status!=0 && move.pbIsPhysical(type)) {
+ attacker.Status!=0 && move.IsPhysical(type)) {
atk=(int)Math.Round(atk*1.5);
}
}
// Plus, Minus
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if ((attacker.hasWorkingAbility(Abilities.PLUS) ||
- attacker.hasWorkingAbility(Abilities.MINUS)) && move.pbIsSpecial(type)) {
- IBattler partner=attacker.pbPartner;
+ attacker.hasWorkingAbility(Abilities.MINUS)) && move.IsSpecial(type)) {
+ IBattler partner=attacker.Partner;
if (partner.hasWorkingAbility(Abilities.PLUS) || partner.hasWorkingAbility(Abilities.MINUS)) {
atk=(int)Math.Round(atk*1.5);
}
}
}
// Defeatist
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.DEFEATIST) &&
attacker.HP<=(int)Math.Floor(attacker.TotalHP/2f)) {
atk=(int)Math.Round(atk*0.5);
}
}
// Pure Power, Huge Power
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.PURE_POWER) ||
attacker.hasWorkingAbility(Abilities.HUGE_POWER)) {
atk=(int)Math.Round(atk*2.0);
}
}
// Solar Power
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.SOLAR_POWER) &&
- pbWeather==Weather.SUNNYDAY && move.pbIsSpecial(type)) {
+ Weather==Weather.SUNNYDAY && move.IsSpecial(type)) {
atk=(int)Math.Round(atk*1.5);
}
}
// Flash Fire
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.FLASH_FIRE) &&
attacker.effects.FlashFire && type == Types.FIRE) {
atk=(int)Math.Round(atk*1.5);
}
}
// Slow Start
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.SLOW_START) &&
- attacker.turncount<5 && move.pbIsPhysical(type)) {
+ attacker.turncount<5 && move.IsPhysical(type)) {
atk=(int)Math.Round(atk*0.5);
}
}
// Flower Gift
- if (skill>=PBTrainerAI.highSkill) {
- if (pbWeather==Weather.SUNNYDAY && move.pbIsPhysical(type)) {
+ if (skill>=TrainerAI.highSkill) {
+ if (Weather==Weather.SUNNYDAY && move.IsPhysical(type)) {
if (attacker.hasWorkingAbility(Abilities.FLOWER_GIFT) &&
attacker.Species == Pokemons.CHERRIM) {
atk=(int)Math.Round(atk*1.5);
}
- if (doublebattle && attacker.pbPartner.hasWorkingAbility(Abilities.FLOWER_GIFT) &&
- attacker.pbPartner.Species == Pokemons.CHERRIM) {
+ if (doublebattle && attacker.Partner.hasWorkingAbility(Abilities.FLOWER_GIFT) &&
+ attacker.Partner.Species == Pokemons.CHERRIM) {
atk=(int)Math.Round(atk*1.5);
}
}
@@ -4070,11 +4070,11 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
// Attack-boosting items
if (attacker.hasWorkingItem(Items.THICK_CLUB) &&
(attacker.Species == Pokemons.CUBONE ||
- attacker.Species == Pokemons.MAROWAK) && move.pbIsPhysical(type)) {
+ attacker.Species == Pokemons.MAROWAK) && move.IsPhysical(type)) {
atk=(int)Math.Round(atk*2.0);
}
if (attacker.hasWorkingItem(Items.DEEP_SEA_TOOTH) &&
- attacker.Species == Pokemons.CLAMPERL && move.pbIsSpecial(type)) {
+ attacker.Species == Pokemons.CLAMPERL && move.IsSpecial(type)) {
atk=(int)Math.Round(atk*2.0);
}
if (attacker.hasWorkingItem(Items.LIGHT_BALL) &&
@@ -4083,55 +4083,55 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
if (attacker.hasWorkingItem(Items.SOUL_DEW) &&
(attacker.Species == Pokemons.LATIAS ||
- attacker.Species == Pokemons.LATIOS) && move.pbIsSpecial(type)) {
+ attacker.Species == Pokemons.LATIOS) && move.IsSpecial(type)) {
atk=(int)Math.Round(atk*1.5);
}
- if (attacker.hasWorkingItem(Items.CHOICE_BAND) && move.pbIsPhysical(type)) {
+ if (attacker.hasWorkingItem(Items.CHOICE_BAND) && move.IsPhysical(type)) {
atk=(int)Math.Round(atk*1.5);
}
- if (attacker.hasWorkingItem(Items.CHOICE_SPECS) && move.pbIsSpecial(type)) {
+ if (attacker.hasWorkingItem(Items.CHOICE_SPECS) && move.IsSpecial(type)) {
atk=(int)Math.Round(atk*1.5);
}
// Get base defense stat
- int defense=pbRoughStat(opponent,Stats.DEFENSE,skill);
+ int defense=RoughStat(opponent,Stats.DEFENSE,skill);
bool applysandstorm=false;
- if (type>=0 && move.pbIsSpecial(type)) {
+ if (type>=0 && move.IsSpecial(type)) {
if (move.Effect!=Attack.Data.Effects.x11B) { // Psyshock
- defense=pbRoughStat(opponent,Stats.SPDEF,skill);
+ defense=RoughStat(opponent,Stats.SPDEF,skill);
applysandstorm=true;
}
}
// Sandstorm weather
- if (skill>=PBTrainerAI.highSkill) {
- if (pbWeather==Weather.SANDSTORM &&
- opponent.pbHasType(Types.ROCK) && applysandstorm) {
+ if (skill>=TrainerAI.highSkill) {
+ if (Weather==Weather.SANDSTORM &&
+ opponent.HasType(Types.ROCK) && applysandstorm) {
defense=(int)Math.Round(defense*1.5);
}
}
// Marvel Scale
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if (opponent.hasWorkingAbility(Abilities.MARVEL_SCALE) &&
- opponent.Status>0 && move.pbIsPhysical(type)) {
+ opponent.Status>0 && move.IsPhysical(type)) {
defense=(int)Math.Round(defense*1.5);
}
}
// Flower Gift
- if (skill>=PBTrainerAI.bestSkill) {
- if (pbWeather==Weather.SUNNYDAY && move.pbIsSpecial(type)) {
+ if (skill>=TrainerAI.bestSkill) {
+ if (Weather==Weather.SUNNYDAY && move.IsSpecial(type)) {
if (opponent.hasWorkingAbility(Abilities.FLOWER_GIFT) &&
opponent.Species == Pokemons.CHERRIM) {
defense=(int)Math.Round(defense*1.5);
}
- if (opponent.pbPartner.hasWorkingAbility(Abilities.FLOWER_GIFT) &&
- opponent.pbPartner.Species == Pokemons.CHERRIM) {
+ if (opponent.Partner.hasWorkingAbility(Abilities.FLOWER_GIFT) &&
+ opponent.Partner.Species == Pokemons.CHERRIM) {
defense=(int)Math.Round(defense*1.5);
}
}
}
// Defense-boosting items
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingItem(Items.EVIOLITE)) {
- //Pokemon[] evos=pbGetEvolvedFormData(opponent.Species);
+ //Pokemon[] evos=GetEvolvedFormData(opponent.Species);
int evos=Kernal.PokemonEvolutionsData[opponent.Species].Length;
//if (evos && evos.Length>0) {
if (evos>0) {
@@ -4139,32 +4139,32 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
if (opponent.hasWorkingItem(Items.DEEP_SEA_SCALE) &&
- opponent.Species == Pokemons.CLAMPERL && move.pbIsSpecial(type)) {
+ opponent.Species == Pokemons.CLAMPERL && move.IsSpecial(type)) {
defense=(int)Math.Round(defense*2.0);
}
if (opponent.hasWorkingItem(Items.METAL_POWDER) &&
opponent.Species == Pokemons.DITTO &&
- !opponent.effects.Transform && move.pbIsPhysical(type)) {
+ !opponent.effects.Transform && move.IsPhysical(type)) {
defense=(int)Math.Round(defense*2.0);
}
if (opponent.hasWorkingItem(Items.SOUL_DEW) &&
(opponent.Species == Pokemons.LATIAS ||
- opponent.Species == Pokemons.LATIOS) && move.pbIsSpecial(type)) {
+ opponent.Species == Pokemons.LATIOS) && move.IsSpecial(type)) {
defense=(int)Math.Round(defense*1.5);
}
}
// Main damage calculation
double damage=Math.Floor(Math.Floor(Math.Floor(2.0f*attacker.Level/5f+2f)*basedamage*atk/defense)/50f)+2;
// Multi-targeting attacks
- if (skill>=PBTrainerAI.highSkill) {
- if (move.pbTargetsMultiple(attacker)) {
+ if (skill>=TrainerAI.highSkill) {
+ if (move.TargetsMultiple(attacker)) {
//if (move.hasMultipleTargets()) {
damage=(int)Math.Round(damage*0.75);
}
}
// Weather
- if (skill>=PBTrainerAI.mediumSkill) {
- switch (pbWeather) {
+ if (skill>=TrainerAI.mediumSkill) {
+ switch (Weather) {
case Weather.SUNNYDAY:
if (type == Types.FIRE) {
damage=(int)Math.Round(damage*1.5);
@@ -4184,10 +4184,10 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
// Critical hits - n/a
// Random variance - n/a
// STAB
- if (skill>=PBTrainerAI.mediumSkill) {
- if (attacker.pbHasType(type)) {
+ if (skill>=TrainerAI.mediumSkill) {
+ if (attacker.HasType(type)) {
if (attacker.hasWorkingAbility(Abilities.ADAPTABILITY) &&
- skill>=PBTrainerAI.highSkill) {
+ skill>=TrainerAI.highSkill) {
damage=(int)Math.Round(damage*2f);
}
else {
@@ -4196,13 +4196,13 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Type effectiveness
- float typemod=pbTypeModifier(type,attacker,opponent);
- if (skill>=PBTrainerAI.highSkill) {
+ float typemod=TypeModifier(type,attacker,opponent);
+ if (skill>=TrainerAI.highSkill) {
damage=(int)Math.Round(damage*typemod*1.0/8);
}
// Burn
- if (skill>=PBTrainerAI.mediumSkill) {
- if (attacker.Status==Status.BURN && move.pbIsPhysical(type) &&
+ if (skill>=TrainerAI.mediumSkill) {
+ if (attacker.Status==Status.BURN && move.IsPhysical(type) &&
!attacker.hasWorkingAbility(Abilities.GUTS)) {
damage=(int)Math.Round(damage*0.5);
}
@@ -4210,9 +4210,9 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
// Make sure damage is at least 1
if (damage<1) damage=1;
// Reflect
- if (skill>=PBTrainerAI.highSkill) {
- if (opponent.pbOwnSide.Reflect>0 && move.pbIsPhysical(type)) {
- if (!opponent.pbPartner.isFainted()) {
+ if (skill>=TrainerAI.highSkill) {
+ if (opponent.OwnSide.Reflect>0 && move.IsPhysical(type)) {
+ if (!opponent.Partner.isFainted()) {
damage=(int)Math.Round(damage*0.66);
}
else {
@@ -4221,9 +4221,9 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Light Screen
- if (skill>=PBTrainerAI.highSkill) {
- if (opponent.pbOwnSide.LightScreen>0 && move.pbIsSpecial(type)) {
- if (!opponent.pbPartner.isFainted()) {
+ if (skill>=TrainerAI.highSkill) {
+ if (opponent.OwnSide.LightScreen>0 && move.IsSpecial(type)) {
+ if (!opponent.Partner.isFainted()) {
damage=(int)Math.Round(damage*0.66);
}
else {
@@ -4232,27 +4232,27 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
}
}
// Multiscale
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if (opponent.hasWorkingAbility(Abilities.MULTISCALE) &&
opponent.HP==opponent.TotalHP) {
damage=(int)Math.Round(damage*0.5);
}
}
// Tinted Lens
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if (attacker.hasWorkingAbility(Abilities.TINTED_LENS) && typemod<8) {
damage=(int)Math.Round(damage*2.0);
}
}
// Friend Guard
- if (skill>=PBTrainerAI.bestSkill) {
- if (opponent.pbPartner.hasWorkingAbility(Abilities.FRIEND_GUARD)) {
+ if (skill>=TrainerAI.bestSkill) {
+ if (opponent.Partner.hasWorkingAbility(Abilities.FRIEND_GUARD)) {
damage=(int)Math.Round(damage*0.75);
}
}
// Sniper - n/a
// Solid Rock, Filter
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if ((opponent.hasWorkingAbility(Abilities.SOLID_ROCK) || opponent.hasWorkingAbility(Abilities.FILTER)) &&
typemod>8) {
damage=(int)Math.Round(damage*0.75);
@@ -4274,7 +4274,7 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
if (attacker.hasWorkingItem(Items.LIFE_ORB)) {
damage=(int)Math.Round(damage*1.3);
}
- if (typemod>8 && skill>=PBTrainerAI.highSkill) {
+ if (typemod>8 && skill>=TrainerAI.highSkill) {
if ((opponent.hasWorkingItem(Items.CHOPLE_BERRY) && type == Types.FIGHTING) ||
(opponent.hasWorkingItem(Items.COBA_BERRY) && type == Types.FLYING) ||
(opponent.hasWorkingItem(Items.KEBIA_BERRY) && type == Types.POISON) ||
@@ -4294,15 +4294,15 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
damage=(int)Math.Round(damage*0.5);
}
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingItem(Items.CHILAN_BERRY) && type == Types.NORMAL) {
damage=(int)Math.Round(damage*0.5);
}
}
- // pbModifyDamage - TODO
+ // ModifyDamage - TODO
// "AI-specific calculations below"
// Increased critical hit rates
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
int c=0;
c+=attacker.effects.FocusEnergy;
//if (move.hasHighCriticalRate) c+=1;
@@ -4322,12 +4322,12 @@ public int pbRoughDamage(IBattleMove move, IBattler attacker, IBattler opponent,
//return 0;
}
- public int pbRoughAccuracy(IBattleMove move, IBattler attacker, IBattler opponent, int skill) {
+ public int RoughAccuracy(IBattleMove move, IBattler attacker, IBattler opponent, int skill) {
float accuracy=0;
// Get base accuracy
int baseaccuracy=move.Accuracy;//??0
- if (skill>=PBTrainerAI.mediumSkill) {
- if (pbWeather==Weather.SUNNYDAY &&
+ if (skill>=TrainerAI.mediumSkill) {
+ if (Weather==Weather.SUNNYDAY &&
(move.Effect==Attack.Data.Effects.x099 || move.Effect==Attack.Data.Effects.x14E)) { // Thunder, Hurricane
accuracy=50;
}
@@ -4346,33 +4346,33 @@ public int pbRoughAccuracy(IBattleMove move, IBattler attacker, IBattler opponen
float evasion=(evastage>=0) ? (evastage+3)*100.0f/3f : 300.0f/(3f-evastage);
accuracy*=baseaccuracy/evasion;
// Accuracy modifiers
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (attacker.hasWorkingAbility(Abilities.COMPOUND_EYES)) accuracy*=1.3f;
if (attacker.hasWorkingAbility(Abilities.VICTORY_STAR)) accuracy*=1.1f;
- if (skill>=PBTrainerAI.highSkill) {
- IBattler partner=!doublebattle ? null : attacker.pbPartner;
+ if (skill>=TrainerAI.highSkill) {
+ IBattler partner=!doublebattle ? null : attacker.Partner;
if (partner.IsNotNullOrNone() && partner.hasWorkingAbility(Abilities.VICTORY_STAR)) accuracy*=1.1f;
}
if (attacker.effects.MicleBerry) accuracy*=1.2f;
if (attacker.hasWorkingItem(Items.WIDE_LENS)) accuracy*=1.1f;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.HUSTLE) &&
move.basedamage>0 //&& //ToDo: here
- //move.pbIsPhysical(move.pbType(move.Type,attacker,opponent))) accuracy*=0.8f;
+ //move.IsPhysical(move.Type(move.Type,attacker,opponent))) accuracy*=0.8f;
) accuracy*=0.8f;
}
- if (skill>=PBTrainerAI.bestSkill) {
+ if (skill>=TrainerAI.bestSkill) {
if (opponent.hasWorkingAbility(Abilities.WONDER_SKIN) &&
move.basedamage==0 &&
- attacker.pbIsOpposing(opponent.Index)) accuracy/=2;
+ attacker.IsOpposing(opponent.Index)) accuracy/=2;
if (opponent.hasWorkingAbility(Abilities.TANGLED_FEET) &&
opponent.effects.Confusion>0) accuracy/=1.2f;
- if (pbWeather==Weather.SANDSTORM &&
+ if (Weather==Weather.SANDSTORM &&
opponent.hasWorkingAbility(Abilities.SAND_VEIL)) accuracy/=1.2f;
- if (pbWeather==Weather.HAIL &&
+ if (Weather==Weather.HAIL &&
opponent.hasWorkingAbility(Abilities.SNOW_CLOAK)) accuracy/=1.2f;
}
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (opponent.hasWorkingItem(Items.BRIGHT_POWDER)) accuracy/=1.1f;
if (opponent.hasWorkingItem(Items.LAX_INCENSE)) accuracy/=1.1f;
}
@@ -4381,15 +4381,15 @@ public int pbRoughAccuracy(IBattleMove move, IBattler attacker, IBattler opponen
// Override accuracy
if (move.Accuracy==0 ) accuracy=125; // Doesn't do accuracy check (always hits)
if (move.Effect==Attack.Data.Effects.x17D) accuracy=125; // Swift
- if (skill>=PBTrainerAI.mediumSkill) {
+ if (skill>=TrainerAI.mediumSkill) {
if (opponent.effects.LockOn>0 &&
opponent.effects.LockOnPos==attacker.Index) accuracy=125;
- if (skill>=PBTrainerAI.highSkill) {
+ if (skill>=TrainerAI.highSkill) {
if (attacker.hasWorkingAbility(Abilities.NO_GUARD) ||
opponent.hasWorkingAbility(Abilities.NO_GUARD)) accuracy=125;
}
if (opponent.effects.Telekinesis>0) accuracy=125;
- switch (pbWeather) {
+ switch (Weather) {
case Weather.HAIL:
if (move.Effect==Attack.Data.Effects.x105) accuracy=125; // Blizzard
break;
@@ -4411,15 +4411,15 @@ public int pbRoughAccuracy(IBattleMove move, IBattler attacker, IBattler opponen
/// Choose a move to use.
///
///
- public void pbChooseMoves(int index) {
- IBattler attacker=@battlers[index];
+ public void ChooseMoves(int index) {
+ IBattler attacker=_battlers[index];
int[] scores=new int[] { 0, 0, 0, 0 };
int[] targets=null;
List myChoices=new List();
int totalscore=0;
int target=-1;
int skill=0;
- bool wildbattle=(@opponent==null || @opponent.Length == 0) && pbIsOpposing(index);
+ bool wildbattle=(@opponent==null || @opponent.Length == 0) && IsOpposing(index);
if (wildbattle) { // If wild battle
for (int i = 0; i < 4; i++) {
if (CanChooseMove(index,i,false)) {
@@ -4430,31 +4430,31 @@ public void pbChooseMoves(int index) {
}
}
else {
- skill=Kernal.TrainerMetaData[pbGetOwner(attacker.Index).trainertype].SkillLevel; //|| 0;
- IBattler opponent=attacker.pbOppositeOpposing;
- if (@doublebattle && !opponent.isFainted() && !opponent.pbPartner.isFainted()) {
+ skill=Kernal.TrainerMetaData[GetOwner(attacker.Index).trainertype].SkillLevel; //|| 0;
+ IBattler opponent=attacker.OppositeOpposing;
+ if (@doublebattle && !opponent.isFainted() && !opponent.Partner.isFainted()) {
// Choose a target and move. Also care about partner.
- IBattler otheropp=opponent.pbPartner;
+ IBattler otheropp=opponent.Partner;
List scoresAndTargets=new List();
targets=new int[] { -1, -1, -1, -1 };
for (int i = 0; i < 4; i++) {
if (CanChooseMove(index,i,false)) {
- int score1=pbGetMoveScore(attacker.moves[i],attacker,opponent,skill);
- int score2=pbGetMoveScore(attacker.moves[i],attacker,otheropp,skill);
+ int score1=GetMoveScore(attacker.moves[i],attacker,opponent,skill);
+ int score2=GetMoveScore(attacker.moves[i],attacker,otheropp,skill);
//if ((attacker.moves[i].Targets&(Attack.Data.Targets)0x20)!=0) { // Target's user's side
if (//attacker.moves[i].Target == Attack.Data.Targets.USER_AND_ALLIES //ToDo: This too?
attacker.moves[i].Target == Attack.Data.Targets.ALL_POKEMON
|| attacker.moves[i].Target == Attack.Data.Targets.ALL_OTHER_POKEMON
|| attacker.moves[i].Target == Attack.Data.Targets.ENTIRE_FIELD
|| attacker.moves[i].Target == Attack.Data.Targets.USERS_FIELD) {
- if (attacker.pbPartner.isFainted()) { // No partner
+ if (attacker.Partner.isFainted()) { // No partner
score1*=5/3;
score2*=5/3;
}
else {
// If this move can also target the partner, get the partner's
// score too
- int s=pbGetMoveScore(attacker.moves[i],attacker,attacker.pbPartner,skill);
+ int s=GetMoveScore(attacker.moves[i],attacker,attacker.Partner,skill);
if (s>=140) { // Highly effective
score1*=1/3;
score2*=1/3;
@@ -4501,11 +4501,11 @@ public void pbChooseMoves(int index) {
else {
// Choose a move. There is only 1 opposing Pokémon.
if (@doublebattle && opponent.isFainted()) {
- opponent=opponent.pbPartner;
+ opponent=opponent.Partner;
}
for (int i = 0; i < 4; i++) {
if (CanChooseMove(index,i,false)) {
- scores[i]=pbGetMoveScore(attacker.moves[i],attacker,opponent,skill);
+ scores[i]=GetMoveScore(attacker.moves[i],attacker,opponent,skill);
myChoices.Add(i);
}
if (scores[i]<0) scores[i]=0;
@@ -4518,9 +4518,9 @@ public void pbChooseMoves(int index) {
if (scores[i]>maxscore) maxscore=scores[i]; //&& scores[i]
}
// Minmax choices depending on AI
- if (!wildbattle && skill>=PBTrainerAI.mediumSkill) {
- float threshold=(skill>=PBTrainerAI.bestSkill) ? 1.5f : (skill>=PBTrainerAI.highSkill) ? 2 : 3;
- int newscore=(skill>=PBTrainerAI.bestSkill) ? 5 : (skill>=PBTrainerAI.highSkill) ? 10 : 15;
+ if (!wildbattle && skill>=TrainerAI.mediumSkill) {
+ float threshold=(skill>=TrainerAI.bestSkill) ? 1.5f : (skill>=TrainerAI.highSkill) ? 2 : 3;
+ int newscore=(skill>=TrainerAI.bestSkill) ? 5 : (skill>=TrainerAI.highSkill) ? 10 : 15;
for (int i = 0; i < scores.Length; i++) {
if (scores[i]>newscore && scores[i]*threshold100) {
- int stdev=pbStdDev(scores);
+ int stdev=StdDev(scores);
if (stdev>=40 && Core.Rand.Next(10)!=0) {
// If standard deviation is 40 or more,
// there is a highly preferred move. Choose it.
@@ -4559,10 +4559,10 @@ public void pbChooseMoves(int index) {
if (preferredMoves.Count>0) {
int i=preferredMoves[Core.Rand.Next(preferredMoves.Count)];
GameDebug.Log($"[AI] Prefer #{Game._INTL(attacker.moves[i].id.ToString(TextScripts.Name))}");
- pbRegisterMove(index,i,false);
+ RegisterMove(index,i,false);
if (targets != null) target=targets[i];
if (@doublebattle && target>=0) {
- pbRegisterTarget(index,target);
+ RegisterTarget(index,target);
}
return;
}
@@ -4589,13 +4589,13 @@ public void pbChooseMoves(int index) {
}
if (badmoves) {
// Attacker has terrible moves, try switching instead
- if (pbEnemyShouldWithdrawEx(index,true)) {
+ if (EnemyShouldWithdrawEx(index,true)) {
if (Core.INTERNAL) {
GameDebug.Log($"[AI] Switching due to terrible moves");
//GameDebug.Log($@"{index},{@choices[index][0]},{@choices[index][1]},
GameDebug.Log($@"{index},{@choices[index].Action},{@choices[index].Index},
- {pbCanChooseNonActive(index)},
- {@battlers[index].pbNonActivePokemonCount}");
+ {CanChooseNonActive(index)},
+ {_battlers[index].NonActivePokemonCount}");
}
return;
}
@@ -4604,10 +4604,10 @@ public void pbChooseMoves(int index) {
if (maxscore<=0) {
// If all scores are 0 or less, choose a move at random
if (myChoices.Count>0) {
- pbRegisterMove(index,myChoices[Core.Rand.Next(myChoices.Count)],false);
+ RegisterMove(index,myChoices[Core.Rand.Next(myChoices.Count)],false);
}
else {
- pbAutoChooseMove(index);
+ AutoChooseMove(index);
}
}
else {
@@ -4617,7 +4617,7 @@ public void pbChooseMoves(int index) {
if (scores[i]>0) {
cumtotal+=scores[i];
if (randnum=0) {
- pbRegisterTarget(index,target);
+ RegisterTarget(index,target);
}
}
@@ -4636,22 +4636,22 @@ public void pbChooseMoves(int index) {
///
///
///
- public bool pbEnemyShouldMegaEvolve (int index) {
+ public bool EnemyShouldMegaEvolve (int index) {
// Simple "always should if possible"
- return pbCanMegaEvolve(index);
+ return CanMegaEvolve(index);
}
#region Decide whether the opponent should use an item on the Pokémon.
- public bool pbEnemyShouldUseItem (int index) {
- Items item=pbEnemyItemToUse(index);
+ public bool EnemyShouldUseItem (int index) {
+ Items item=EnemyItemToUse(index);
if (item>0) {
- pbRegisterItem(index,item,null);
+ RegisterItem(index,item,null);
return true;
}
return false;
}
- public bool pbEnemyItemAlreadyUsed (int index,Items item,Items[] items) {
+ public bool EnemyItemAlreadyUsed (int index,Items item,Items[] items) {
//if (@choices[1][0]==3 && @choices[1][1]==item) {
if (@choices[1].Action==(ChoiceAction)3 && @choices[1].Index==(int)item) {
int qty=0;
@@ -4663,16 +4663,16 @@ public bool pbEnemyItemAlreadyUsed (int index,Items item,Items[] items) {
return false;
}
- public Items pbEnemyItemToUse(int index) {
+ public Items EnemyItemToUse(int index) {
if (!@internalbattle) return 0;
- Items[] items=pbGetOwnerItems(index);
+ Items[] items=GetOwnerItems(index);
if (items == null) return 0;
- IBattler battler=@battlers[index];
+ IBattler battler=_battlers[index];
if (battler.isFainted() ||
battler.effects.Embargo>0) return 0;
bool hashpitem=false;
foreach (var i in items) {
- if (pbEnemyItemAlreadyUsed(index,i,items)) continue;
+ if (EnemyItemAlreadyUsed(index,i,items)) continue;
if (i == Items.POTION ||
i == Items.SUPER_POTION ||
i == Items.HYPER_POTION ||
@@ -4682,7 +4682,7 @@ public Items pbEnemyItemToUse(int index) {
}
}
foreach (var i in items) {
- if (pbEnemyItemAlreadyUsed(index,i,items)) continue;
+ if (EnemyItemAlreadyUsed(index,i,items)) continue;
if (i == Items.FULL_RESTORE) {
if (battler.HP<=battler.TotalHP/4) return i;
if (battler.HP<=battler.TotalHP/2 && Core.Rand.Next(10)<3) return i;
@@ -4711,7 +4711,7 @@ public Items pbEnemyItemToUse(int index) {
if (i == Items.X_SP_ATK) stat=Stats.SPATK;
if (i == Items.X_SP_DEF) stat=Stats.SPDEF;
if (i == Items.X_ACCURACY) stat=Stats.ACCURACY;
- if (stat>0 && battler is IBattlerEffect b && !b.pbTooHigh(stat.Value)) {
+ if (stat>0 && battler is IBattlerEffect b && !b.TooHigh(stat.Value)) {
if (Core.Rand.Next(10)<3-battler.stages[(int)stat]) return i;
}
}
@@ -4721,28 +4721,28 @@ public Items pbEnemyItemToUse(int index) {
#endregion
#region Decide whether the opponent should switch Pokémon.
- public virtual bool pbEnemyShouldWithdraw (int index) {
- //if (Core.INTERNAL && !pbIsOpposing(index)) {
- // return pbEnemyShouldWithdrawOld(index);
+ public virtual bool EnemyShouldWithdraw (int index) {
+ //if (Core.INTERNAL && !IsOpposing(index)) {
+ // return EnemyShouldWithdrawOld(index);
//}
- return pbEnemyShouldWithdrawEx(index,false);
+ return EnemyShouldWithdrawEx(index,false);
}
- public bool pbEnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
+ public bool EnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
if (@opponent == null) return false;
bool shouldswitch=alwaysSwitch;
bool typecheck=false;
int batonpass=-1;
Types movetype=Types.NONE;
- int skill=Kernal.TrainerMetaData[pbGetOwner(index).trainertype].SkillLevel;// || 0;
- if (@opponent!= null && !shouldswitch && @battlers[index].turncount>0) {
- if (skill>=PBTrainerAI.highSkill) {
- IBattler opponent=@battlers[index].pbOppositeOpposing;
- if (opponent.isFainted()) opponent=opponent.pbPartner;
+ int skill=Kernal.TrainerMetaData[GetOwner(index).trainertype].SkillLevel;// || 0;
+ if (@opponent!= null && !shouldswitch && _battlers[index].turncount>0) {
+ if (skill>=TrainerAI.highSkill) {
+ IBattler opponent=_battlers[index].OppositeOpposing;
+ if (opponent.isFainted()) opponent=opponent.Partner;
if (!opponent.isFainted() && opponent.lastMoveUsed>0 &&
- Math.Abs(opponent.Level-@battlers[index].Level)<=6) {
+ Math.Abs(opponent.Level-_battlers[index].Level)<=6) {
Attack.Data.MoveData move=Kernal.MoveData[opponent.lastMoveUsed];
- float typemod=pbTypeModifier(move.Type,@battlers[index],@battlers[index]);
+ float typemod=TypeModifier(move.Type,_battlers[index],_battlers[index]);
movetype=move.Type;
if (move.Power>70 && typemod>8) {
shouldswitch=(Core.Rand.Next(100)<30);
@@ -4756,13 +4756,13 @@ public bool pbEnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
!CanChooseMove(index,1,false) &&
!CanChooseMove(index,2,false) &&
!CanChooseMove(index,3,false) &&
- //@battlers[index].turncount != null &&
- @battlers[index].turncount>5) {
+ //_battlers[index].turncount != null &&
+ _battlers[index].turncount>5) {
shouldswitch=true;
}
- if (skill>=PBTrainerAI.highSkill && @battlers[index].effects.PerishSong!=1) {
+ if (skill>=TrainerAI.highSkill && _battlers[index].effects.PerishSong!=1) {
for (int i = 0; i < 4; i++) {
- IBattleMove move=@battlers[index].moves[i];
+ IBattleMove move=_battlers[index].moves[i];
if (move.id!=0 && CanChooseMove(index,i,false) &&
move.Effect==Attack.Data.Effects.x080) { // Baton Pass
batonpass=i;
@@ -4770,31 +4770,31 @@ public bool pbEnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
}
}
}
- if (skill>=PBTrainerAI.highSkill) {
- if (@battlers[index].Status==Status.POISON &&
- @battlers[index].StatusCount>0) {
- float toxicHP=(@battlers[index].TotalHP/16);
- float nextToxicHP=toxicHP*(@battlers[index].effects.Toxic+1);
- if (nextToxicHP>=@battlers[index].HP &&
- toxicHP<@battlers[index].HP && Core.Rand.Next(100)<80) {
+ if (skill>=TrainerAI.highSkill) {
+ if (_battlers[index].Status==Status.POISON &&
+ _battlers[index].StatusCount>0) {
+ float toxicHP=(_battlers[index].TotalHP/16);
+ float nextToxicHP=toxicHP*(_battlers[index].effects.Toxic+1);
+ if (nextToxicHP>=_battlers[index].HP &&
+ toxicHP<_battlers[index].HP && Core.Rand.Next(100)<80) {
shouldswitch=true;
}
}
}
- if (skill>=PBTrainerAI.mediumSkill) {
- if (@battlers[index].effects.Encore>0) {
+ if (skill>=TrainerAI.mediumSkill) {
+ if (_battlers[index].effects.Encore>0) {
int scoreSum=0;
int scoreCount=0;
- IBattler attacker=@battlers[index];
- int encoreIndex=@battlers[index].effects.EncoreIndex;
- if (!attacker.pbOpposing1.isFainted()) {
- scoreSum+=pbGetMoveScore(attacker.moves[encoreIndex],
- attacker,attacker.pbOpposing1,skill);
+ IBattler attacker=_battlers[index];
+ int encoreIndex=_battlers[index].effects.EncoreIndex;
+ if (!attacker.Opposing1.isFainted()) {
+ scoreSum+=GetMoveScore(attacker.moves[encoreIndex],
+ attacker,attacker.Opposing1,skill);
scoreCount+=1;
}
- if (!attacker.pbOpposing2.isFainted()) {
- scoreSum+=pbGetMoveScore(attacker.moves[encoreIndex],
- attacker,attacker.pbOpposing2,skill);
+ if (!attacker.Opposing2.isFainted()) {
+ scoreSum+=GetMoveScore(attacker.moves[encoreIndex],
+ attacker,attacker.Opposing2,skill);
scoreCount+=1;
}
if (scoreCount>0 && scoreSum/scoreCount<=20 && Core.Rand.Next(10)<8) {
@@ -4802,9 +4802,9 @@ public bool pbEnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
}
}
}
- if (skill>=PBTrainerAI.highSkill) {
- if (!@doublebattle && !@battlers[index].pbOppositeOpposing.isFainted() ) {
- IBattler opp=@battlers[index].pbOppositeOpposing;
+ if (skill>=TrainerAI.highSkill) {
+ if (!@doublebattle && !_battlers[index].OppositeOpposing.isFainted() ) {
+ IBattler opp=_battlers[index].OppositeOpposing;
if ((opp.effects.HyperBeam>0 ||
(opp.hasWorkingAbility(Abilities.TRUANT) &&
opp.effects.Truant)) && Core.Rand.Next(100)<80) {
@@ -4813,41 +4813,41 @@ public bool pbEnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
}
}
if (@rules["suddendeath"]) {
- if (@battlers[index].HP<=(@battlers[index].TotalHP/4) && Core.Rand.Next(10)<3 &&
- @battlers[index].turncount>0) {
+ if (_battlers[index].HP<=(_battlers[index].TotalHP/4) && Core.Rand.Next(10)<3 &&
+ _battlers[index].turncount>0) {
shouldswitch=true;
- } else if (@battlers[index].HP<=(@battlers[index].TotalHP/2) && Core.Rand.Next(10)<8 &&
- @battlers[index].turncount>0) {
+ } else if (_battlers[index].HP<=(_battlers[index].TotalHP/2) && Core.Rand.Next(10)<8 &&
+ _battlers[index].turncount>0) {
shouldswitch=true;
}
}
- if (@battlers[index].effects.PerishSong==1) {
+ if (_battlers[index].effects.PerishSong==1) {
shouldswitch=true;
}
if (shouldswitch) {
List list=new List();
- //PokemonEssentials.Interface.PokeBattle.IPokemon[] party=pbParty(index);
+ //PokemonEssentials.Interface.PokeBattle.IPokemon[] party=Party(index);
IBattler[] party=battlers.Where(b => (b.Index % 2) == (index % 2)).ToArray();
for (int i = 0; i < party.Length; i++) {
- if (pbCanSwitch(index,i,false)) {
+ if (CanSwitch(index,i,false)) {
// If perish count is 1, it may be worth it to switch
// even with Spikes, since Perish Song's effect will end
- if (@battlers[index].effects.PerishSong!=1) {
+ if (_battlers[index].effects.PerishSong!=1) {
// Will contain effects that recommend against switching
- int spikes=@battlers[index].pbOwnSide.Spikes;
+ int spikes=_battlers[index].OwnSide.Spikes;
if ((spikes==1 && party[i].HP<=(party[i].TotalHP/8)) ||
(spikes==2 && party[i].HP<=(party[i].TotalHP/6)) ||
(spikes==3 && party[i].HP<=(party[i].TotalHP/4))) {
- if (!party[i].pbHasType(Types.FLYING) &&
+ if (!party[i].HasType(Types.FLYING) &&
!party[i].hasWorkingAbility(Abilities.LEVITATE)) {
// Don't switch to this if too little HP
continue;
}
}
}
- if (movetype>=0 && pbTypeModifier(movetype,@battlers[index],@battlers[index])==0) {
+ if (movetype>=0 && TypeModifier(movetype,_battlers[index],_battlers[index])==0) {
int weight=65;
- if (pbTypeModifier2(party[i],@battlers[index].pbOppositeOpposing)>8) {
+ if (TypeModifier2(party[i],_battlers[index].OppositeOpposing)>8) {
// Greater weight if new Pokemon's type is effective against opponent
weight=85;
}
@@ -4855,9 +4855,9 @@ public bool pbEnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
//list.unshift(i); // put this Pokemon first
list = list.Where(x => x == i).Concat(list.Where(x => x != i)).ToList(); // put this Pokemon first
}
- } else if (movetype>=0 && pbTypeModifier(movetype,@battlers[index],@battlers[index])<8) {
+ } else if (movetype>=0 && TypeModifier(movetype,_battlers[index],_battlers[index])<8) {
int weight=40;
- if (pbTypeModifier2(party[i],@battlers[index].pbOppositeOpposing)>8) {
+ if (TypeModifier2(party[i],_battlers[index].OppositeOpposing)>8) {
// Greater weight if new Pokemon's type is effective against opponent
weight=60;
}
@@ -4873,37 +4873,37 @@ public bool pbEnemyShouldWithdrawEx (int index,bool alwaysSwitch) {
}
if (list.Count>0) {
if (batonpass!=-1) {
- if (!pbRegisterMove(index,batonpass,false)) {
- return pbRegisterSwitch(index,list[0]);
+ if (!RegisterMove(index,batonpass,false)) {
+ return RegisterSwitch(index,list[0]);
}
return true;
}
else {
- return pbRegisterSwitch(index,list[0]);
+ return RegisterSwitch(index,list[0]);
}
}
}
return false;
}
- public int pbDefaultChooseNewEnemy(int index,IPokemon[] party) {
+ public int DefaultChooseNewEnemy(int index,IPokemon[] party) {
List enemies=new List();
for (int i = 0; i < party.Length-1; i++) {
- if (pbCanSwitchLax(index,i,false)) {
+ if (CanSwitchLax(index,i,false)) {
enemies.Add(i);
}
}
if (enemies.Count>0) {
- return pbChooseBestNewEnemy(index,party,enemies.ToArray());
+ return ChooseBestNewEnemy(index,party,enemies.ToArray());
}
return -1;
}
- public int pbChooseBestNewEnemy(int index,IPokemon[] party,int[] enemies) {
+ public int ChooseBestNewEnemy(int index,IPokemon[] party,int[] enemies) {
if (enemies == null || enemies.Length==0) return -1;
if (Game.GameData.PokemonTemp == null) Game.GameData.PokemonTemp=new PokemonTemp().initialize();
- IBattler o1=@battlers[index].pbOpposing1;
- IBattler o2=@battlers[index].pbOpposing2;
+ IBattler o1=_battlers[index].Opposing1;
+ IBattler o2=_battlers[index].Opposing2;
if (o1.IsNotNullOrNone() && o1.isFainted()) o1=null;
if (o2.IsNotNullOrNone() && o2.isFainted()) o2=null;
int best=-1;
@@ -4936,31 +4936,31 @@ public int pbChooseBestNewEnemy(int index,IPokemon[] party,int[] enemies) {
/// Choose an action.
///
///
- public void pbDefaultChooseEnemyCommand(int index) {
+ public void DefaultChooseEnemyCommand(int index) {
if (!CanShowFightMenu(index)) {
- if (pbEnemyShouldUseItem(index)) return;
- if (pbEnemyShouldWithdraw(index)) return;
- pbAutoChooseMove(index);
+ if (EnemyShouldUseItem(index)) return;
+ if (EnemyShouldWithdraw(index)) return;
+ AutoChooseMove(index);
return;
}
else {
- if (pbEnemyShouldUseItem(index)) return;
- if (pbEnemyShouldWithdraw(index)) return;
- if (pbAutoFightMenu(index)) return;
- if (pbEnemyShouldMegaEvolve(index)) pbRegisterMegaEvolution(index);
- pbChooseMoves(index);
+ if (EnemyShouldUseItem(index)) return;
+ if (EnemyShouldWithdraw(index)) return;
+ if (AutoFightMenu(index)) return;
+ if (EnemyShouldMegaEvolve(index)) RegisterMegaEvolution(index);
+ ChooseMoves(index);
}
}
#region Other functions.
- public bool pbDbgPlayerOnly (int idx) {
+ public bool DbgPlayerOnly (int idx) {
if (!Core.INTERNAL) return true;
//if (idx.respond_to("index"))
- // return pbOwnedByPlayer(idx.Index);
- return pbOwnedByPlayer(idx);
+ // return OwnedByPlayer(idx.Index);
+ return OwnedByPlayer(idx);
}
- public int pbStdDev(int[] scores) {
+ public int StdDev(int[] scores) {
int n=0;
int sum=0;
//scores.ForEach{ s => sum+=s; n+=1 );
diff --git a/PokemonUnity.Application/Combat/Attack/Attack.Shadow.cs b/PokemonUnity.Application/Combat/Attack/Attack.Shadow.cs
index 6244345ea..601b215aa 100644
--- a/PokemonUnity.Application/Combat/Attack/Attack.Shadow.cs
+++ b/PokemonUnity.Application/Combat/Attack/Attack.Shadow.cs
@@ -24,10 +24,10 @@ public class PokeBattle_Move_126 : PokeBattle_Move_000
{
public PokeBattle_Move_126() : base() { }
//public PokeBattle_Move_126(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -39,10 +39,10 @@ public class PokeBattle_Move_127 : PokeBattle_Move_007
{
public PokeBattle_Move_127() : base() { }
//public PokeBattle_Move_127(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -54,10 +54,10 @@ public class PokeBattle_Move_128 : PokeBattle_Move_00A
{
public PokeBattle_Move_128() : base() { }
//public PokeBattle_Move_128(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -69,10 +69,10 @@ public class PokeBattle_Move_129 : PokeBattle_Move_00C
{
public PokeBattle_Move_129() : base() { }
//public PokeBattle_Move_129(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -84,10 +84,10 @@ public class PokeBattle_Move_12A : PokeBattle_Move_013
{
public PokeBattle_Move_12A() : base() { }
//public PokeBattle_Move_12A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -99,10 +99,10 @@ public class PokeBattle_Move_12B : PokeBattle_Move_04C
{
public PokeBattle_Move_12B() : base() { }
//public PokeBattle_Move_12B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -114,12 +114,12 @@ public class PokeBattle_Move_12C : PokeBattle_Move
{
public PokeBattle_Move_12C() : base() { }
//public PokeBattle_Move_12C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.EVASION, attacker, true, this)) return -1;
- pbShowAnimation(MoveId, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect b0 && b0.pbReduceStat(Stats.EVASION, increment: 2, attacker: attacker, showMessages: false);
- if (ret && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.EVASION, attacker, true, this)) return -1;
+ ShowAnimation(MoveId, attacker, opponent, hitnum, alltargets, showanimation);
+ bool ret = opponent is IBattlerEffect b0 && b0.ReduceStat(Stats.EVASION, increment: 2, attacker: attacker, showMessages: false);
+ if (ret && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret ? 0 : -1;
}
}
@@ -131,10 +131,10 @@ public class PokeBattle_Move_12D : PokeBattle_Move_075
{
public PokeBattle_Move_12D() : base() { }
//public PokeBattle_Move_12D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -147,7 +147,7 @@ public class PokeBattle_Move_12E : PokeBattle_Move
{
public PokeBattle_Move_12E() : base() { }
//public PokeBattle_Move_12E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List affected = new List();
for (int i = 0; i < 4; i++)
@@ -156,15 +156,15 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (affected.Count == 0)
{
- this.battle.pbDisplay(Game._INTL("But it failed!"));
+ this.battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(MoveId, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(MoveId, attacker, opponent, hitnum, alltargets, showanimation);
for (int i = 0; i < affected.Count; i++)
{
- this.battle.battlers[i].pbReduceHP((int)Math.Floor(this.battle.battlers[i].HP / 2d));
+ this.battle.battlers[i].ReduceHP((int)Math.Floor(this.battle.battlers[i].HP / 2d));
}
- this.battle.pbDisplay(Game._INTL("Each Pokemon's HP was halved!"));
+ this.battle.Display(Game._INTL("Each Pokemon's HP was halved!"));
attacker.effects.HyperBeam = 2;
attacker.currentMove = MoveId;
return 0;
@@ -179,10 +179,10 @@ public class PokeBattle_Move_12F : PokeBattle_Move_0EF
{
public PokeBattle_Move_12F() : base() { }
//public PokeBattle_Move_12F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
}
@@ -194,19 +194,19 @@ public class PokeBattle_Move_130 : PokeBattle_Move
{
public PokeBattle_Move_130() : base() { }
//public PokeBattle_Move_130(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.pbHyperMode();
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (ret >= 0 && attacker is IBattlerShadowPokemon a) a.HyperMode();
return ret;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
- attacker.pbReduceHP((int)Math.Round(attacker.HP / 2.0));
- this.battle.pbDisplay(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
+ attacker.ReduceHP((int)Math.Round(attacker.HP / 2.0));
+ this.battle.Display(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
}
}
}
@@ -218,25 +218,25 @@ public class PokeBattle_Move_131 : PokeBattle_Move
{
public PokeBattle_Move_131() : base() { }
//public PokeBattle_Move_131(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
switch (this.battle.weather)
{
case Weather.HEAVYRAIN:
- this.battle.pbDisplay(Game._INTL("There is no relief from this heavy rain!"));
+ this.battle.Display(Game._INTL("There is no relief from this heavy rain!"));
return -1;
case Weather.HARSHSUN:
- this.battle.pbDisplay(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
+ this.battle.Display(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
return -1;
case Weather.SHADOWSKY:
- this.battle.pbDisplay(Game._INTL("But it failed!"));
+ this.battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(MoveId, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(MoveId, attacker, null, hitnum, alltargets, showanimation);
this.battle.weather = Weather.SHADOWSKY;
this.battle.weatherduration = 5;
- this.battle.pbCommonAnimation("ShadowSky", null, null);
- this.battle.pbDisplay(Game._INTL("A shadow sky appeared!"));
+ this.battle.CommonAnimation("ShadowSky", null, null);
+ this.battle.Display(Game._INTL("A shadow sky appeared!"));
return 0;
}
}
@@ -249,7 +249,7 @@ public class PokeBattle_Move_132 : PokeBattle_Move
{
public PokeBattle_Move_132() : base() { }
//public PokeBattle_Move_132(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if ((this.battle.sides[0].Reflect > 0 ||
this.battle.sides[1].Reflect > 0 ||
@@ -258,20 +258,20 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
this.battle.sides[0].Safeguard > 0 ||
this.battle.sides[1].Safeguard > 0) && attacker is IBattlerShadowPokemon a)
{
- pbShowAnimation(MoveId, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(MoveId, attacker, null, hitnum, alltargets, showanimation);
this.battle.sides[0].Reflect = 0;
this.battle.sides[1].Reflect = 0;
this.battle.sides[0].LightScreen = 0;
this.battle.sides[1].LightScreen = 0;
this.battle.sides[0].Safeguard = 0;
this.battle.sides[1].Safeguard = 0;
- this.battle.pbDisplay(Game._INTL("It broke all barriers!"));
- a.pbHyperMode();
+ this.battle.Display(Game._INTL("It broke all barriers!"));
+ a.HyperMode();
return 0;
}
else
{
- this.battle.pbDisplay(Game._INTL("But it failed!"));
+ this.battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
diff --git a/PokemonUnity.Application/Combat/Attack/Attack.cs b/PokemonUnity.Application/Combat/Attack/Attack.cs
index 810ed3136..345fc407b 100644
--- a/PokemonUnity.Application/Combat/Attack/Attack.cs
+++ b/PokemonUnity.Application/Combat/Attack/Attack.cs
@@ -67,90 +67,90 @@ IBattleMove IBattleMove.initialize(IBattle battle, IMove move)
return this.Initialize(battle, move);
}
- IBattleMove IBattleMove.pbFromPBMove(IBattle battle, IMove move)
+ IBattleMove IBattleMove.FromMove(IBattle battle, IMove move)
{
- return Move.pbFromPBMove(battle, move);
+ return Move.FromMove(battle, move);
}
#region Interface Implementation
int IBattleMove.ToInt()
{
- throw new NotImplementedException();
+ return (int)id;
}
bool IBattleMove.unusableInGravity()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.isContactMove()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.canProtectAgainst()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.canMagicCoat()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.canSnatch()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.canMirrorMove()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.canKingsRock()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.canThawUser()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.hasHighCriticalRate()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.isBitingMove()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.isPunchingMove()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.isSoundBased()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.isPowderMove()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.isPulseMove()
{
- throw new NotImplementedException();
+ return false;
}
bool IBattleMove.isBombMove()
{
- throw new NotImplementedException();
+ return false;
}
#endregion
}
@@ -158,7 +158,7 @@ bool IBattleMove.isBombMove()
//
// During battle, the moves used are modified by these classes before calculations are applied
//
-#pragma warning disable 0162 //Warning CS0162 Unreachable code detected
+#pragma warning disable 0162 //Warning CS0162 Unreachable code detected
// ToDo: Rename from PokemonEssential's Function to Veekun's Attack.Data.Effects
// https://essentialsdocs.fandom.com/wiki/Function_codes
#region Battle Class Functions
@@ -171,13 +171,13 @@ public partial class PokeBattle_UnimplementedMove : PokeBattle_Move
{
public PokeBattle_UnimplementedMove() : base() { }
//public PokeBattle_UnimplementedMove(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging())
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging())
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
else
{
- battle.pbDisplay("But it failed!");
+ battle.Display("But it failed!");
return -1;
}
}
@@ -191,9 +191,9 @@ public partial class PokeBattle_FailedMove : PokeBattle_Move
{
public PokeBattle_FailedMove() : base() { }
//public PokeBattle_FailedMove(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- battle.pbDisplay("But it failed!");
+ battle.Display("But it failed!");
return -1;
}
}
@@ -227,15 +227,15 @@ public override IBattleMove Initialize(IBattle battle, IMove move)
//public override bool IsPhysical { get { return true; } }
//public override bool IsSpecial { get { return false; } }
- public int pbCalcDamage(IBattler attacker, IBattler opponent)
+ public int CalcDamage(IBattler attacker, IBattler opponent)
{
- return base.pbCalcDamage(attacker, opponent, new byte[] {
+ return base.CalcDamage(attacker, opponent, new byte[] {
Core.NOCRITICAL, Core.SELFCONFUSE, Core.NOTYPE, Core.NOWEIGHTING });
}
- public void pbEffectMessages(IBattler attacker, IBattler opponent, bool ignoretype = false)
+ public void EffectMessages(IBattler attacker, IBattler opponent, bool ignoretype = false)
{
- base.pbEffectMessages(attacker, opponent, true);
+ base.EffectMessages(attacker, opponent, true);
}
}
@@ -275,18 +275,18 @@ public override IBattleMove Initialize(IBattle battle, IMove move)
//public override bool IsPhysical() { return true; }
//public override bool IsSpecial() { return false; }
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
- attacker.pbReduceHP((int)Math.Round(attacker.TotalHP / 4.0f));
- battle.pbDisplay(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
+ attacker.ReduceHP((int)Math.Round(attacker.TotalHP / 4.0f));
+ battle.Display(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
}
}
- public int pbCalcDamage(IBattler attacker, IBattler opponent)
+ public int CalcDamage(IBattler attacker, IBattler opponent)
{
- return base.pbCalcDamage(attacker, opponent, Core.IGNOREPKMNTYPES);
+ return base.CalcDamage(attacker, opponent, Core.IGNOREPKMNTYPES);
}
}
@@ -314,10 +314,10 @@ public override bool UnusableInGravity()
//}
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("But nothing happened!"));
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ battle.Display(Game._INTL("But nothing happened!"));
return 0;
}
}
@@ -338,30 +338,30 @@ public partial class PokeBattle_Move_003 : PokeBattle_Move
{
public PokeBattle_Move_003() : base() { }
//public PokeBattle_Move_003(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
- if (opponent is IBattlerClause b && b.pbCanSleep(attacker, true, this))
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (opponent is IBattlerClause b && b.CanSleep(attacker, true, this))
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbSleep();
+ if (opponent is IBattlerEffect o) o.Sleep();
return 0;
}
return -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerClause b && b.pbCanSleep(attacker, false, this))
+ if (opponent is IBattlerClause b && b.CanSleep(attacker, false, this))
{
- if (opponent is IBattlerEffect o) o.pbSleep();
+ if (opponent is IBattlerEffect o) o.Sleep();
}
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (id == Moves.RELIC_SONG)
{
@@ -371,9 +371,9 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
!attacker.isFainted())
{
attacker.form = (attacker.form + 1) % 2;
- attacker.pbUpdate(true);
- if (this.battle.scene is IPokeBattle_Scene s0) s0.pbChangePokemon(attacker, (attacker as Pokemon).Form.Id);//.Species);
- battle.pbDisplay(Game._INTL("{1} transformed!", attacker.ToString()));
+ attacker.Update(true);
+ if (this.battle.scene is IPokeBattle_Scene s0) s0.ChangePokemon(attacker, attacker.pokemon);
+ battle.Display(Game._INTL("{1} transformed!", attacker.ToString()));
GameDebug.Log($"[Form changed] #{attacker.ToString()} changed to form #{Game._INTL((attacker as Pokemon).Form.Pokemon.ToString(TextScripts.Name))}");
}
}
@@ -387,18 +387,18 @@ public partial class PokeBattle_Move_004 : PokeBattle_Move
{
public PokeBattle_Move_004() : base() { }
//public PokeBattle_Move_004(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent is IBattlerClause b && !b.pbCanSleep(attacker, true, this)) return -1;
+ if (opponent is IBattlerClause b && !b.CanSleep(attacker, true, this)) return -1;
if (opponent.effects.Yawn > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Yawn = 2;
- battle.pbDisplay(Game._INTL("{1} made {2} drowsy!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1} made {2} drowsy!", attacker.ToString(), opponent.ToString(true)));
return 0;
}
}
@@ -410,51 +410,51 @@ public partial class PokeBattle_Move_005 : PokeBattle_Move
{
public PokeBattle_Move_005() : base() { }
//public PokeBattle_Move_005(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanPoison(attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanPoison(attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbPoison(attacker);
+ if (opponent is IBattlerEffect o) o.Poison(attacker);
return 0;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanPoison(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanPoison(attacker, false, this))
{
- b.pbPoison(attacker);
+ b.Poison(attacker);
}
}
}
///
/// Badly poisons the target. (Poison Fang, Toxic)
- /// (Handled in Pokemon's pbSuccessCheck): Hits semi-invulnerable targets if user
+ /// (Handled in Pokemon's SuccessCheck): Hits semi-invulnerable targets if user
/// is Poison-type and move is status move.
///
public partial class PokeBattle_Move_006 : PokeBattle_Move
{
public PokeBattle_Move_006() : base() { }
//public PokeBattle_Move_006(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanPoison(attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanPoison(attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbPoison(attacker, null, true);
+ if (opponent is IBattlerEffect o) o.Poison(attacker, null, true);
return 0;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanPoison(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanPoison(attacker, false, this))
{
- b.pbPoison(attacker, null, true);
+ b.Poison(attacker, null, true);
}
}
}
@@ -468,11 +468,11 @@ public partial class PokeBattle_Move_007 : PokeBattle_Move
{
public PokeBattle_Move_007() : base() { }
//public PokeBattle_Move_007(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging())
+ if (IsDamaging())
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && id == Moves.BOLT_STRIKE)
{
this.battle.field.FusionFlare = true;
@@ -483,52 +483,52 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
if (this.id == Moves.THUNDER_WAVE)
{
- if (pbTypeModifier(type, attacker, opponent) == 0)
+ if (TypeModifier(type, attacker, opponent) == 0)
{
- battle.pbDisplay(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
+ battle.Display(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
return -1;
}
}
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
- if (opponent is IBattlerEffect b && !b.pbCanParalyze(attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (opponent is IBattlerEffect b && !b.CanParalyze(attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbParalyze(attacker);
+ if (opponent is IBattlerEffect o) o.Paralyze(attacker);
return 0;
}
//return -1
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
}
}
///
/// Paralyzes the target. Accuracy perfect in rain, 50% in sunshine. (Thunder)
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_008 : PokeBattle_Move
{
public PokeBattle_Move_008() : base() { }
//public PokeBattle_Move_008(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
}
- public int pbModifyBaseAccuracy(byte baseaccuracy, IBattler attacker, IBattler opponent)
+ public int ModifyBaseAccuracy(byte baseaccuracy, IBattler attacker, IBattler opponent)
{
- switch (this.battle.pbWeather)
+ switch (this.battle.Weather)
{
case Weather.RAINDANCE:
case Weather.HEAVYRAIN:
@@ -549,20 +549,20 @@ public partial class PokeBattle_Move_009 : PokeBattle_Move
{
public PokeBattle_Move_009() : base() { }
//public PokeBattle_Move_009(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (this.battle.pbRandom(10) == 0)
+ if (this.battle.Random(10) == 0)
{
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
}
- if (this.battle.pbRandom(10) == 0)
+ if (this.battle.Random(10) == 0)
{
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
}
@@ -575,11 +575,11 @@ public partial class PokeBattle_Move_00A : PokeBattle_Move
{
public PokeBattle_Move_00A() : base() { }
//public PokeBattle_Move_00A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging())
+ if (IsDamaging())
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && id == Moves.BLUE_FLARE)
{
this.battle.field.FusionBolt = true;
@@ -588,22 +588,22 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
else
{
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
- if (opponent is IBattlerEffect b && !b.pbCanBurn(attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (opponent is IBattlerEffect b && !b.CanBurn(attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbBurn(attacker);
+ if (opponent is IBattlerEffect o) o.Burn(attacker);
return 0;
}
//return -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanBurn(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanBurn(attacker, false, this))
{
- b.pbBurn(attacker);
+ b.Burn(attacker);
}
}
}
@@ -615,20 +615,20 @@ public partial class PokeBattle_Move_00B : PokeBattle_Move
{
public PokeBattle_Move_00B() : base() { }
//public PokeBattle_Move_00B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (this.battle.pbRandom(10) == 0)
+ if (this.battle.Random(10) == 0)
{
- if (opponent is IBattlerEffect b && b.pbCanBurn(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanBurn(attacker, false, this))
{
- b.pbBurn(attacker);
+ b.Burn(attacker);
}
}
- if (this.battle.pbRandom(10) == 0)
+ if (this.battle.Random(10) == 0)
{
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
}
@@ -640,22 +640,22 @@ public partial class PokeBattle_Move_00C : PokeBattle_Move
{
public PokeBattle_Move_00C() : base() { }
//public PokeBattle_Move_00C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerClause b && !b.pbCanFreeze(attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerClause b && !b.CanFreeze(attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbFreeze();
+ if (opponent is IBattlerEffect o) o.Freeze();
return 0;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerClause b && b.pbCanFreeze(attacker, false, this))
+ if (opponent is IBattlerClause b && b.CanFreeze(attacker, false, this))
{
- if (opponent is IBattlerEffect o) o.pbFreeze();
+ if (opponent is IBattlerEffect o) o.Freeze();
}
}
}
@@ -667,28 +667,28 @@ public partial class PokeBattle_Move_00D : PokeBattle_Move
{
public PokeBattle_Move_00D() : base() { }
//public PokeBattle_Move_00D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerClause b && !b.pbCanFreeze(attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerClause b && !b.CanFreeze(attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbFreeze();
+ if (opponent is IBattlerEffect o) o.Freeze();
return 0;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerClause b && b.pbCanFreeze(attacker, false, this))
+ if (opponent is IBattlerClause b && b.CanFreeze(attacker, false, this))
{
- if (opponent is IBattlerEffect o) o.pbFreeze();
+ if (opponent is IBattlerEffect o) o.Freeze();
}
}
- public int pbModifyBaseAccuracy(byte baseaccuracy, IBattler attacker, IBattler opponent)
+ public int ModifyBaseAccuracy(byte baseaccuracy, IBattler attacker, IBattler opponent)
{
- if (this.battle.pbWeather == Weather.HAIL)
+ if (this.battle.Weather == Weather.HAIL)
{
return 0;
}
@@ -703,20 +703,20 @@ public partial class PokeBattle_Move_00E : PokeBattle_Move
{
public PokeBattle_Move_00E() : base() { }
//public PokeBattle_Move_00E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (this.battle.pbRandom(10) == 0)
+ if (this.battle.Random(10) == 0)
{
- if (opponent is IBattlerClause b && b.pbCanFreeze(attacker, false, this))
+ if (opponent is IBattlerClause b && b.CanFreeze(attacker, false, this))
{
- if (opponent is IBattlerEffect o) o.pbFreeze();
+ if (opponent is IBattlerEffect o) o.Freeze();
}
}
- if (this.battle.pbRandom(10) == 0)
+ if (this.battle.Random(10) == 0)
{
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
}
@@ -728,10 +728,10 @@ public partial class PokeBattle_Move_00F : PokeBattle_Move
{
public PokeBattle_Move_00F() : base() { }
//public PokeBattle_Move_00F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
@@ -743,10 +743,10 @@ public partial class PokeBattle_Move_010 : PokeBattle_Move
{
public PokeBattle_Move_010() : base() { }
//public PokeBattle_Move_010(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
public bool tramplesMinimize(byte param = 1)
@@ -765,20 +765,20 @@ public partial class PokeBattle_Move_011 : PokeBattle_Move
{
public PokeBattle_Move_011() : base() { }
//public PokeBattle_Move_011(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbCanUseWhileAsleep()
+ public override bool CanUseWhileAsleep()
{
return true;
}
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
return (attacker.Status != Status.SLEEP);
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
@@ -789,15 +789,15 @@ public partial class PokeBattle_Move_012 : PokeBattle_Move
{
public PokeBattle_Move_012() : base() { }
//public PokeBattle_Move_012(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
return (attacker.turncount > 1);
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
@@ -808,27 +808,27 @@ public partial class PokeBattle_Move_013 : PokeBattle_Move
{
public PokeBattle_Move_013() : base() { }
//public PokeBattle_Move_013(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && b.pbCanConfuse(attacker, true, this))
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && b.CanConfuse(attacker, true, this))
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- b.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused!", opponent.ToString()));
+ b.Confuse();
+ battle.Display(Game._INTL("{1} became confused!", opponent.ToString()));
return 0;
}
return -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanConfuse(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanConfuse(attacker, false, this))
{
- b.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused!", opponent.ToString()));
+ b.Confuse();
+ battle.Display(Game._INTL("{1} became confused!", opponent.ToString()));
}
}
}
@@ -837,13 +837,13 @@ public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
/// Confuses the target. Chance of causing confusion depends on the cry's volume.
/// Confusion chance is 0% if user doesn't have a recorded cry. (Chatter)
/// TODO: Play the actual chatter cry as part of the move animation
- /// this.battle.scene.pbChatter(attacker,opponent) // Just plays cry
+ /// this.battle.scene.Chatter(attacker,opponent) // Just plays cry
///
public partial class PokeBattle_Move_014 : PokeBattle_Move
{
public PokeBattle_Move_014() : base() { }
//public PokeBattle_Move_014(Battle battle, Attack.Move move) : base(battle, move) { }
- private IBattler attacker; //ToDo: use pbAdditionalEffect(IBattler attacker, IBattler opponent) to assign?
+ private IBattler attacker = null;
public override int AddlEffect
{
get
@@ -856,52 +856,53 @@ public override int AddlEffect
}
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
+ this.attacker = attacker;
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanConfuse(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanConfuse(attacker, false, this))
{
- b.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused!", opponent.ToString()));
+ b.Confuse();
+ battle.Display(Game._INTL("{1} became confused!", opponent.ToString()));
}
}
}
///
/// Confuses the target. Accuracy perfect in rain, 50% in sunshine. (Hurricane)
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_015 : PokeBattle_Move
{
public PokeBattle_Move_015() : base() { }
//public PokeBattle_Move_015(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && b.pbCanConfuse(attacker, true, this))
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && b.CanConfuse(attacker, true, this))
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- b.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused!", opponent.ToString()));
+ b.Confuse();
+ battle.Display(Game._INTL("{1} became confused!", opponent.ToString()));
return 0;
}
return -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanConfuse(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanConfuse(attacker, false, this))
{
- b.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused!", opponent.ToString()));
+ b.Confuse();
+ battle.Display(Game._INTL("{1} became confused!", opponent.ToString()));
}
}
- public int pbModifyBaseAccuracy(byte baseaccuracy, IBattler attacker, IBattler opponent)
+ public int ModifyBaseAccuracy(byte baseaccuracy, IBattler attacker, IBattler opponent)
{
- switch (this.battle.pbWeather)
+ switch (this.battle.Weather)
{
case Weather.RAINDANCE:
case Weather.HEAVYRAIN:
@@ -922,9 +923,9 @@ public partial class PokeBattle_Move_016 : PokeBattle_Move
{
public PokeBattle_Move_016() : base() { }
//public PokeBattle_Move_016(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent is IBattlerEffect b && !b.pbCanAttract(attacker))
+ if (opponent is IBattlerEffect b && !b.CanAttract(attacker))
{
return -1;
}
@@ -932,22 +933,22 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
if (opponent.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
opponent.ToString(), Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
- else if (opponent.pbPartner.hasWorkingAbility(Abilities.AROMA_VEIL))
+ else if (opponent.Partner.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
- opponent.pbPartner.ToString(), Game._INTL(opponent.pbPartner.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
+ opponent.Partner.ToString(), Game._INTL(opponent.Partner.Ability.ToString(TextScripts.Name))));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbAttract(attacker);
+ if (opponent is IBattlerEffect o) o.Attract(attacker);
return 0;
}
}
@@ -959,27 +960,27 @@ public partial class PokeBattle_Move_017 : PokeBattle_Move
{
public PokeBattle_Move_017() : base() { }
//public PokeBattle_Move_017(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- switch (this.battle.pbRandom(3))
+ switch (this.battle.Random(3))
{
case 0:
- if (opponent is IBattlerEffect b0 && b0.pbCanBurn(attacker, false, this))
+ if (opponent is IBattlerEffect b0 && b0.CanBurn(attacker, false, this))
{
- b0.pbBurn(attacker);
+ b0.Burn(attacker);
}
break;
case 1:
- if (opponent is IBattlerClause b1 && b1.pbCanFreeze(attacker, false, this))
+ if (opponent is IBattlerClause b1 && b1.CanFreeze(attacker, false, this))
{
- if (b1 is IBattlerEffect o) o.pbFreeze();
+ if (b1 is IBattlerEffect o) o.Freeze();
}
break;
case 2:
- if (opponent is IBattlerEffect b2 && b2.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b2 && b2.CanParalyze(attacker, false, this))
{
- b2.pbParalyze(attacker);
+ b2.Paralyze(attacker);
}
break;
default:
@@ -995,32 +996,32 @@ public partial class PokeBattle_Move_018 : PokeBattle_Move
{
public PokeBattle_Move_018() : base() { }
//public PokeBattle_Move_018(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Status != Status.BURN &&
attacker.Status != Status.POISON &&
attacker.Status != Status.PARALYSIS)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
else
{
Status t = attacker.Status;
- if (attacker is IBattlerEffect a) a.pbCureStatus(false);
+ if (attacker is IBattlerEffect a) a.CureStatus(false);
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
if (t == Status.BURN)
{
- battle.pbDisplay(Game._INTL("{1} healed its burn!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} healed its burn!", attacker.ToString()));
}
else if (t == Status.POISON)
{
- battle.pbDisplay(Game._INTL("{1} cured its poisoning!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} cured its poisoning!", attacker.ToString()));
}
else if (t == Status.PARALYSIS)
{
- battle.pbDisplay(Game._INTL("{1} cured its paralysis!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} cured its paralysis!", attacker.ToString()));
}
return 0;
}
@@ -1034,53 +1035,53 @@ public partial class PokeBattle_Move_019 : PokeBattle_Move
{
public PokeBattle_Move_019() : base() { }
//public PokeBattle_Move_019(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
if (id == Moves.AROMATHERAPY)
{
- battle.pbDisplay(Game._INTL("A soothing aroma wafted through the area!"));
+ battle.Display(Game._INTL("A soothing aroma wafted through the area!"));
}
else
{
- battle.pbDisplay(Game._INTL("A bell chimed!"));
+ battle.Display(Game._INTL("A bell chimed!"));
}
IList activepkmn = new List();
foreach (IBattler i in this.battle.battlers)
{
- if (attacker.pbIsOpposing(i.Index) || i.isFainted()) continue; //next
+ if (attacker.IsOpposing(i.Index) || i.isFainted()) continue; //next
activepkmn.Add(i.pokemonIndex);
if (Core.USENEWBATTLEMECHANICS && i.Index != attacker.Index &&
- pbTypeImmunityByAbility(pbType(this.type, attacker, i), attacker, i)) continue; //next
+ TypeImmunityByAbility(GetType(this.type, attacker, i), attacker, i)) continue; //next
switch (i.Status)
{
case Status.PARALYSIS:
- battle.pbDisplay(Game._INTL("{1} was cured of paralysis.", i.ToString()));
+ battle.Display(Game._INTL("{1} was cured of paralysis.", i.ToString()));
break;
case Status.SLEEP:
- battle.pbDisplay(Game._INTL("{1}'s sleep was woken.", i.ToString()));
+ battle.Display(Game._INTL("{1}'s sleep was woken.", i.ToString()));
break;
case Status.POISON:
- battle.pbDisplay(Game._INTL("{1} was cured of its poisoning.", i.ToString()));
+ battle.Display(Game._INTL("{1} was cured of its poisoning.", i.ToString()));
break;
case Status.BURN:
- battle.pbDisplay(Game._INTL("{1}'s burn was healed.", i.ToString()));
+ battle.Display(Game._INTL("{1}'s burn was healed.", i.ToString()));
break;
case Status.FROZEN:
- battle.pbDisplay(Game._INTL("{1} was thawed out.", i.ToString()));
+ battle.Display(Game._INTL("{1} was thawed out.", i.ToString()));
break;
default: break;
}
- if (i is IBattlerEffect b) b.pbCureStatus(false);
+ if (i is IBattlerEffect b) b.CureStatus(false);
}
- IPokemon[] party = this.battle.pbParty(attacker.Index); // NOTE: Considers both parties in multi battles
+ IPokemon[] party = this.battle.Party(attacker.Index); // NOTE: Considers both parties in multi battles
for (int i = 0; i < party.Length; i++)
{
if (activepkmn.Contains(i)) continue; //next
@@ -1088,23 +1089,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
switch (party[i].Status)
{
case Status.PARALYSIS:
- battle.pbDisplay(Game._INTL("{1} was cured of paralysis.", party[i].ToString()));
+ battle.Display(Game._INTL("{1} was cured of paralysis.", party[i].ToString()));
break;
case Status.SLEEP:
- battle.pbDisplay(Game._INTL("{1} was woken from its sleep.", party[i].ToString()));
+ battle.Display(Game._INTL("{1} was woken from its sleep.", party[i].ToString()));
break;
case Status.POISON:
- battle.pbDisplay(Game._INTL("{1} was cured of its poisoning.", party[i].ToString()));
+ battle.Display(Game._INTL("{1} was cured of its poisoning.", party[i].ToString()));
break;
case Status.BURN:
- battle.pbDisplay(Game._INTL("{1}'s burn was healed.", party[i].ToString()));
+ battle.Display(Game._INTL("{1}'s burn was healed.", party[i].ToString()));
break;
case Status.FROZEN:
- battle.pbDisplay(Game._INTL("{1} was thawed out.", party[i].ToString()));
+ battle.Display(Game._INTL("{1} was thawed out.", party[i].ToString()));
break;
default:
break;
@@ -1123,23 +1124,23 @@ public partial class PokeBattle_Move_01A : PokeBattle_Move
{
public PokeBattle_Move_01A() : base() { }
//public PokeBattle_Move_01A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.Safeguard > 0)
+ if (attacker.OwnSide.Safeguard > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- attacker.pbOwnSide.Safeguard = 5;
+ attacker.OwnSide.Safeguard = 5;
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- if (!this.battle.pbIsOpposing(attacker.Index))
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Your team became cloaked in a mystical veil!"));
+ battle.Display(Game._INTL("Your team became cloaked in a mystical veil!"));
}
else
{
- battle.pbDisplay(Game._INTL("The opposing team became cloaked in a mystical veil!"));
+ battle.Display(Game._INTL("The opposing team became cloaked in a mystical veil!"));
}
return 0;
}
@@ -1152,61 +1153,61 @@ public partial class PokeBattle_Move_01B : PokeBattle_Move
{
public PokeBattle_Move_01B() : base() { }
//public PokeBattle_Move_01B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.Status == 0 || (opponent is IBattlerEffect b &&
+ if (attacker.Status == 0 || (opponent is IBattlerEffect b &&
(
- (attacker.Status == Status.PARALYSIS && !b.pbCanParalyze(attacker, false, this)) ||
- (attacker.Status == Status.POISON && !b.pbCanPoison(attacker, false, this)) ||
- (attacker.Status == Status.BURN && !b.pbCanBurn(attacker, false, this)) ||
- (attacker.Status == Status.SLEEP && opponent is IBattlerClause b1 && !b1.pbCanSleep(attacker, false, this)) ||
- (attacker.Status == Status.FROZEN && opponent is IBattlerClause b2 && !b2.pbCanFreeze(attacker, false, this))
+ (attacker.Status == Status.PARALYSIS && !b.CanParalyze(attacker, false, this)) ||
+ (attacker.Status == Status.POISON && !b.CanPoison(attacker, false, this)) ||
+ (attacker.Status == Status.BURN && !b.CanBurn(attacker, false, this)) ||
+ (attacker.Status == Status.SLEEP && opponent is IBattlerClause b1 && !b1.CanSleep(attacker, false, this)) ||
+ (attacker.Status == Status.FROZEN && opponent is IBattlerClause b2 && !b2.CanFreeze(attacker, false, this))
)))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
IBattlerEffect a = attacker is IBattlerEffect ? attacker as IBattlerEffect : null;
IBattlerEffect o = opponent is IBattlerEffect ? opponent as IBattlerEffect : null;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
switch (attacker.Status)
{
case Status.PARALYSIS:
- o?.pbParalyze(attacker);
+ o?.Paralyze(attacker);
- opponent.pbAbilityCureCheck();
- a?.pbCureStatus(false);
+ opponent.AbilityCureCheck();
+ a?.CureStatus(false);
- battle.pbDisplay(Game._INTL("{1} was cured of paralysis.", attacker.ToString()));
+ battle.Display(Game._INTL("{1} was cured of paralysis.", attacker.ToString()));
break;
case Status.SLEEP:
- o?.pbSleep();
- opponent.pbAbilityCureCheck();
- a?.pbCureStatus(false);
+ o?.Sleep();
+ opponent.AbilityCureCheck();
+ a?.CureStatus(false);
- battle.pbDisplay(Game._INTL("{1} woke up.", attacker.ToString()));
+ battle.Display(Game._INTL("{1} woke up.", attacker.ToString()));
break;
case Status.POISON:
- o?.pbPoison(attacker, null, attacker.StatusCount != 0);
+ o?.Poison(attacker, null, attacker.StatusCount != 0);
- opponent.pbAbilityCureCheck();
- a?.pbCureStatus(false);
+ opponent.AbilityCureCheck();
+ a?.CureStatus(false);
- battle.pbDisplay(Game._INTL("{1} was cured of its poisoning.", attacker.ToString()));
+ battle.Display(Game._INTL("{1} was cured of its poisoning.", attacker.ToString()));
break;
case Status.BURN:
- o?.pbBurn(attacker);
- opponent.pbAbilityCureCheck();
- a?.pbCureStatus(false);
+ o?.Burn(attacker);
+ opponent.AbilityCureCheck();
+ a?.CureStatus(false);
- battle.pbDisplay(Game._INTL("{1}'s burn was healed.", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s burn was healed.", attacker.ToString()));
break;
case Status.FROZEN:
- o?.pbFreeze();
- opponent.pbAbilityCureCheck();
- a?.pbCureStatus(false);
+ o?.Freeze();
+ opponent.AbilityCureCheck();
+ a?.CureStatus(false);
- battle.pbDisplay(Game._INTL("{1} was thawed out.", attacker.ToString()));
+ battle.Display(Game._INTL("{1} was thawed out.", attacker.ToString()));
break;
}
return 0;
@@ -1220,22 +1221,22 @@ public partial class PokeBattle_Move_01C : PokeBattle_Move
{
public PokeBattle_Move_01C() : base() { }
//public PokeBattle_Move_01C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.ATTACK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = false; //attacker.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this);
- if (attacker is IBattlerEffect a) ret = a.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this);
+ bool ret = false; //attacker.IncreaseStat(Stats.ATTACK, 1, attacker, false, this);
+ if (attacker is IBattlerEffect a) ret = a.IncreaseStat(Stats.ATTACK, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this);
+ b.IncreaseStat(Stats.ATTACK, 1, attacker, false, this);
}
}
}
@@ -1247,22 +1248,22 @@ public partial class PokeBattle_Move_01D : PokeBattle_Move
{
public PokeBattle_Move_01D() : base() { }
//public PokeBattle_Move_01D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = false; //attacker.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
- if (attacker is IBattlerEffect a) ret = a.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
+ bool ret = false; //attacker.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
+ if (attacker is IBattlerEffect a) ret = a.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
+ b.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
}
}
}
@@ -1274,15 +1275,15 @@ public partial class PokeBattle_Move_01E : PokeBattle_Move
{
public PokeBattle_Move_01E() : base() { }
//public PokeBattle_Move_01E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
attacker.effects.DefenseCurl = true;
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = false; //attacker.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
- if (attacker is IBattlerEffect a) ret = a.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
+ bool ret = false; //attacker.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
+ if (attacker is IBattlerEffect a) ret = a.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
return ret ? 0 : -1;
}
}
@@ -1294,22 +1295,22 @@ public partial class PokeBattle_Move_01F : PokeBattle_Move
{
public PokeBattle_Move_01F() : base() { }
//public PokeBattle_Move_01F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPEED, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = false; //attacker.pbIncreaseStat(Stats.SPEED, 1, attacker, false, this);
- if (attacker is IBattlerEffect a) ret = a.pbIncreaseStat(Stats.SPEED, 1, attacker, false, this);
+ bool ret = false; //attacker.IncreaseStat(Stats.SPEED, 1, attacker, false, this);
+ if (attacker is IBattlerEffect a) ret = a.IncreaseStat(Stats.SPEED, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b.pbIncreaseStat(Stats.SPEED, 1, attacker, false, this);
+ b.IncreaseStat(Stats.SPEED, 1, attacker, false, this);
}
}
}
@@ -1321,22 +1322,22 @@ public partial class PokeBattle_Move_020 : PokeBattle_Move
{
public PokeBattle_Move_020() : base() { }
//public PokeBattle_Move_020(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPATK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = false; //attacker.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this);
- if (attacker is IBattlerEffect a) ret = a.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this);
+ bool ret = false; //attacker.IncreaseStat(Stats.SPATK, 1, attacker, false, this);
+ if (attacker is IBattlerEffect a) ret = a.IncreaseStat(Stats.SPATK, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this);
+ b.IncreaseStat(Stats.SPATK, 1, attacker, false, this);
}
}
}
@@ -1349,16 +1350,16 @@ public partial class PokeBattle_Move_021 : PokeBattle_Move
{
public PokeBattle_Move_021() : base() { }
//public PokeBattle_Move_021(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
attacker.effects.Charge = 2;
- battle.pbDisplay(Game._INTL("{1} began charging power!", attacker.ToString()));
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, true, this))
+ battle.Display(Game._INTL("{1} began charging power!", attacker.ToString()));
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPDEF, attacker, true, this))
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- b.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this);
+ b.IncreaseStat(Stats.SPDEF, 1, attacker, false, this);
}
return 0;
}
@@ -1371,22 +1372,22 @@ public partial class PokeBattle_Move_022 : PokeBattle_Move
{
public PokeBattle_Move_022() : base() { }
//public PokeBattle_Move_022(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.EVASION, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.EVASION, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = false; //attacker.pbIncreaseStat(Stats.EVASION, 1, attacker, false, this);
- if (attacker is IBattlerEffect a) ret = a.pbIncreaseStat(Stats.EVASION, 1, attacker, false, this);
+ bool ret = false; //attacker.IncreaseStat(Stats.EVASION, 1, attacker, false, this);
+ if (attacker is IBattlerEffect a) ret = a.IncreaseStat(Stats.EVASION, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.EVASION, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.EVASION, attacker, false, this))
{
- b.pbIncreaseStat(Stats.EVASION, 1, attacker, false, this);
+ b.IncreaseStat(Stats.EVASION, 1, attacker, false, this);
}
}
}
@@ -1398,27 +1399,27 @@ public partial class PokeBattle_Move_023 : PokeBattle_Move
{
public PokeBattle_Move_023() : base() { }
//public PokeBattle_Move_023(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (attacker.effects.FocusEnergy >= 2)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
attacker.effects.FocusEnergy = 2;
- battle.pbDisplay(Game._INTL("{1} is getting pumped!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} is getting pumped!", attacker.ToString()));
return 0;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (attacker.effects.FocusEnergy < 2)
{
attacker.effects.FocusEnergy = 2;
- battle.pbDisplay(Game._INTL("{1} is getting pumped!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} is getting pumped!", attacker.ToString()));
}
}
}
@@ -1430,26 +1431,26 @@ public partial class PokeBattle_Move_024 : PokeBattle_Move
{
public PokeBattle_Move_024() : base() { }
//public PokeBattle_Move_024(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1463,32 +1464,32 @@ public partial class PokeBattle_Move_025 : PokeBattle_Move
{
public PokeBattle_Move_025() : base() { }
//public PokeBattle_Move_025(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b2 && b2.pbCanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
+ if (attacker is IBattlerEffect b2 && b2.CanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
{
- b2.pbIncreaseStat(Stats.ACCURACY, 1, attacker, false, this, showanim);
+ b2.IncreaseStat(Stats.ACCURACY, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1502,26 +1503,26 @@ public partial class PokeBattle_Move_026 : PokeBattle_Move
{
public PokeBattle_Move_026() : base() { }
//public PokeBattle_Move_026(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPEED, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPEED, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1535,26 +1536,26 @@ public partial class PokeBattle_Move_027 : PokeBattle_Move
{
public PokeBattle_Move_027() : base() { }
//public PokeBattle_Move_027(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1569,33 +1570,33 @@ public partial class PokeBattle_Move_028 : PokeBattle_Move
{
public PokeBattle_Move_028() : base() { }
//public PokeBattle_Move_028(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
byte increment = 1;
- if (this.battle.pbWeather == Weather.SUNNYDAY ||
- this.battle.pbWeather == Weather.HARSHSUN)
+ if (this.battle.Weather == Weather.SUNNYDAY ||
+ this.battle.Weather == Weather.HARSHSUN)
{
increment = 2;
}
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, increment, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, increment, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPATK, increment, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPATK, increment, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1609,26 +1610,26 @@ public partial class PokeBattle_Move_029 : PokeBattle_Move
{
public PokeBattle_Move_029() : base() { }
//public PokeBattle_Move_029(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.ACCURACY, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.ACCURACY, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.ACCURACY, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1642,26 +1643,26 @@ public partial class PokeBattle_Move_02A : PokeBattle_Move
{
public PokeBattle_Move_02A() : base() { }
//public PokeBattle_Move_02A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1675,32 +1676,32 @@ public partial class PokeBattle_Move_02B : PokeBattle_Move
{
public PokeBattle_Move_02B() : base() { }
//public PokeBattle_Move_02B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b2 && b2.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b2 && b2.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b2.pbIncreaseStat(Stats.SPEED, 1, attacker, false, this, showanim);
+ b2.IncreaseStat(Stats.SPEED, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1714,26 +1715,26 @@ public partial class PokeBattle_Move_02C : PokeBattle_Move
{
public PokeBattle_Move_02C() : base() { }
//public PokeBattle_Move_02C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -1748,33 +1749,33 @@ public partial class PokeBattle_Move_02D : PokeBattle_Move
{
public PokeBattle_Move_02D() : base() { }
//public PokeBattle_Move_02D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b2 && b2.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b2 && b2.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b2.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
+ b2.IncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b3 && b3.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b3 && b3.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b3.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b3.IncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b4 && b4.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b4 && b4.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b4.pbIncreaseStat(Stats.SPEED, 1, attacker, false, this, showanim);
+ b4.IncreaseStat(Stats.SPEED, 1, attacker, false, this, showanim);
showanim = false;
}
}
@@ -1787,21 +1788,21 @@ public partial class PokeBattle_Move_02E : PokeBattle_Move
{
public PokeBattle_Move_02E() : base() { }
//public PokeBattle_Move_02E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.ATTACK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.ATTACK, 2, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.ATTACK, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b.pbIncreaseStat(Stats.ATTACK, 2, attacker, false, this);
+ b.IncreaseStat(Stats.ATTACK, 2, attacker, false, this);
}
}
}
@@ -1813,21 +1814,21 @@ public partial class PokeBattle_Move_02F : PokeBattle_Move
{
public PokeBattle_Move_02F() : base() { }
//public PokeBattle_Move_02F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.DEFENSE, 2, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.DEFENSE, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbIncreaseStat(Stats.DEFENSE, 2, attacker, false, this);
+ b.IncreaseStat(Stats.DEFENSE, 2, attacker, false, this);
}
}
}
@@ -1839,21 +1840,21 @@ public partial class PokeBattle_Move_030 : PokeBattle_Move
{
public PokeBattle_Move_030() : base() { }
//public PokeBattle_Move_030(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPEED, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.SPEED, 2, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.SPEED, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b.pbIncreaseStat(Stats.SPEED, 2, attacker, false, this);
+ b.IncreaseStat(Stats.SPEED, 2, attacker, false, this);
}
}
}
@@ -1865,17 +1866,17 @@ public partial class PokeBattle_Move_031 : PokeBattle_Move
{
public PokeBattle_Move_031() : base() { }
//public PokeBattle_Move_031(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPEED, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.SPEED, 2, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.SPEED, 2, attacker, false, this);
if (ret)
{
attacker.effects.WeightChange -= 1000;
- battle.pbDisplay(Game._INTL("{1} became nimble!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} became nimble!", attacker.ToString()));
}
return ret ? 0 : -1;
}
@@ -1888,21 +1889,21 @@ public partial class PokeBattle_Move_032 : PokeBattle_Move
{
public PokeBattle_Move_032() : base() { }
//public PokeBattle_Move_032(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPATK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.SPATK, 2, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.SPATK, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b.pbIncreaseStat(Stats.SPATK, 2, attacker, false, this);
+ b.IncreaseStat(Stats.SPATK, 2, attacker, false, this);
}
}
}
@@ -1914,21 +1915,21 @@ public partial class PokeBattle_Move_033 : PokeBattle_Move
{
public PokeBattle_Move_033() : base() { }
//public PokeBattle_Move_033(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPDEF, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.SPDEF, 2, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.SPDEF, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b.pbIncreaseStat(Stats.SPDEF, 2, attacker, false, this);
+ b.IncreaseStat(Stats.SPDEF, 2, attacker, false, this);
}
}
}
@@ -1940,25 +1941,25 @@ public partial class PokeBattle_Move_034 : PokeBattle_Move
{
public PokeBattle_Move_034() : base() { }
//public PokeBattle_Move_034(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
attacker.effects.Minimize = true;
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.EVASION, attacker, true, this)) return -1;
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.EVASION, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.EVASION, 2, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.EVASION, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
attacker.effects.Minimize = true;
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.EVASION, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.EVASION, attacker, false, this))
{
- b.pbIncreaseStat(Stats.EVASION, 2, attacker, false, this);
+ b.IncreaseStat(Stats.EVASION, 2, attacker, false, this);
}
}
}
@@ -1971,43 +1972,43 @@ public partial class PokeBattle_Move_035 : PokeBattle_Move
{
public PokeBattle_Move_035() : base() { }
//public PokeBattle_Move_035(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b0.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b0.ReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanReduceStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanReduceStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbReduceStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b1.ReduceStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
showanim = true;
- if (attacker is IBattlerEffect b2 && b2.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b2 && b2.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b2.pbIncreaseStat(Stats.ATTACK, 2, attacker, false, this, showanim);
+ b2.IncreaseStat(Stats.ATTACK, 2, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b3 && b3.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b3 && b3.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b3.pbIncreaseStat(Stats.SPATK, 2, attacker, false, this, showanim);
+ b3.IncreaseStat(Stats.SPATK, 2, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b4 && b4.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b4 && b4.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b4.pbIncreaseStat(Stats.SPEED, 2, attacker, false, this, showanim);
+ b4.IncreaseStat(Stats.SPEED, 2, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -2021,26 +2022,26 @@ public partial class PokeBattle_Move_036 : PokeBattle_Move
{
public PokeBattle_Move_036() : base() { }
//public PokeBattle_Move_036(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.SPEED, 2, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.SPEED, 2, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -2054,14 +2055,14 @@ public partial class PokeBattle_Move_037 : PokeBattle_Move
{
public PokeBattle_Move_037() : base() { }
//public PokeBattle_Move_037(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Index != opponent.Index)
{
if ((opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker)) ||
- opponent.pbOwnSide.CraftyShield)
+ opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
@@ -2070,18 +2071,18 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
foreach (var i in new[] { Stats.ATTACK, Stats.DEFENSE, Stats.SPEED,
Stats.SPATK, Stats.SPDEF, Stats.ACCURACY, Stats.EVASION })
{
- if (opponent is IBattlerEffect b && b.pbCanIncreaseStatStage(i, attacker, false, this)) array.Add(i);
+ if (opponent is IBattlerEffect b && b.CanIncreaseStatStage(i, attacker, false, this)) array.Add(i);
}
if (array.Count == 0)
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", opponent.ToString()));
return -1;
}
- Stats stat = array[this.battle.pbRandom(array.Count)];
+ Stats stat = array[this.battle.Random(array.Count)];
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect o) o.pbIncreaseStat(stat, 2, attacker, false, this); //int ret =
+ if (opponent is IBattlerEffect o) o.IncreaseStat(stat, 2, attacker, false, this); //int ret =
return 0;
}
}
@@ -2093,21 +2094,21 @@ public partial class PokeBattle_Move_038 : PokeBattle_Move
{
public PokeBattle_Move_038() : base() { }
//public PokeBattle_Move_038(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.DEFENSE, 3, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.DEFENSE, 3, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbIncreaseStat(Stats.DEFENSE, 3, attacker, false, this);
+ b.IncreaseStat(Stats.DEFENSE, 3, attacker, false, this);
}
}
}
@@ -2119,21 +2120,21 @@ public partial class PokeBattle_Move_039 : PokeBattle_Move
{
public PokeBattle_Move_039() : base() { }
//public PokeBattle_Move_039(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPATK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.SPATK, 3, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.SPATK, 3, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbIncreaseStat(Stats.SPATK, 3, attacker, false, this);
+ b.IncreaseStat(Stats.SPATK, 3, attacker, false, this);
}
}
}
@@ -2145,28 +2146,28 @@ public partial class PokeBattle_Move_03A : PokeBattle_Move
{
public PokeBattle_Move_03A() : base() { }
//public PokeBattle_Move_03A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.HP <= Math.Floor(attacker.TotalHP / 2f) ||
- attacker is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ attacker is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- attacker.pbReduceHP((int)Math.Floor(attacker.TotalHP / 2f));
+ attacker.ReduceHP((int)Math.Floor(attacker.TotalHP / 2f));
if (attacker.hasWorkingAbility(Abilities.CONTRARY))
{
attacker.stages[(byte)Stats.ATTACK] = -6;
- this.battle.pbCommonAnimation("StatDown", attacker, null);
- battle.pbDisplay(Game._INTL("{1} cut its own HP and minimized its Attack!", attacker.ToString()));
+ this.battle.CommonAnimation("StatDown", attacker, null);
+ battle.Display(Game._INTL("{1} cut its own HP and minimized its Attack!", attacker.ToString()));
}
else
{
attacker.stages[(byte)Stats.ATTACK] = 6;
- this.battle.pbCommonAnimation("StatUp", attacker, null);
- battle.pbDisplay(Game._INTL("{1} cut its own HP and maximized its Attack!", attacker.ToString()));
+ this.battle.CommonAnimation("StatUp", attacker, null);
+ battle.Display(Game._INTL("{1} cut its own HP and maximized its Attack!", attacker.ToString()));
}
return 0;
}
@@ -2179,21 +2180,21 @@ public partial class PokeBattle_Move_03B : PokeBattle_Move
{
public PokeBattle_Move_03B() : base() { }
//public PokeBattle_Move_03B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanReduceStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanReduceStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.ReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b1.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b1.ReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
}
@@ -2208,21 +2209,21 @@ public partial class PokeBattle_Move_03C : PokeBattle_Move
{
public PokeBattle_Move_03C() : base() { }
//public PokeBattle_Move_03C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b0.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b0.ReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanReduceStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanReduceStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbReduceStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b1.ReduceStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
}
@@ -2238,30 +2239,30 @@ public partial class PokeBattle_Move_03D : PokeBattle_Move
{
public PokeBattle_Move_03D() : base() { }
//public PokeBattle_Move_03D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- if (attacker.pbPartner.IsNotNullOrNone() && !attacker.pbPartner.isFainted())
+ if (attacker.Partner.IsNotNullOrNone() && !attacker.Partner.isFainted())
{
- attacker.pbPartner.pbReduceHP((int)Math.Floor(attacker.pbPartner.TotalHP / 16f), true);
+ attacker.Partner.ReduceHP((int)Math.Floor(attacker.Partner.TotalHP / 16f), true);
}
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanReduceStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanReduceStatStage(Stats.SPEED, attacker, false, this))
{
- b0.pbReduceStat(Stats.SPEED, 1, attacker, false, this, showanim);
+ b0.ReduceStat(Stats.SPEED, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b1.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b1.ReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b2 && b2.pbCanReduceStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b2 && b2.CanReduceStatStage(Stats.SPDEF, attacker, false, this))
{
- b2.pbReduceStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b2.ReduceStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
}
@@ -2276,15 +2277,15 @@ public partial class PokeBattle_Move_03E : PokeBattle_Move
{
public PokeBattle_Move_03E() : base() { }
//public PokeBattle_Move_03E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- if (attacker is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanReduceStatStage(Stats.SPEED, attacker, false, this))
{
- b.pbReduceStat(Stats.SPEED, 1, attacker, false, this);
+ b.ReduceStat(Stats.SPEED, 1, attacker, false, this);
}
}
return ret;
@@ -2298,15 +2299,15 @@ public partial class PokeBattle_Move_03F : PokeBattle_Move
{
public PokeBattle_Move_03F() : base() { }
//public PokeBattle_Move_03F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- if (attacker is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanReduceStatStage(Stats.SPATK, attacker, false, this))
{
- b.pbReduceStat(Stats.SPATK, 2, attacker, false, this);
+ b.ReduceStat(Stats.SPATK, 2, attacker, false, this);
}
}
return ret;
@@ -2320,25 +2321,25 @@ public partial class PokeBattle_Move_040 : PokeBattle_Move
{
public PokeBattle_Move_040() : base() { }
//public PokeBattle_Move_040(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("{1}'s attack missed!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s attack missed!", attacker.ToString()));
return -1;
}
int ret = -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this);
+ b0.IncreaseStat(Stats.SPATK, 1, attacker, false, this);
ret = 0;
}
- if (opponent is IBattlerEffect b1 && b1.pbCanConfuse(attacker, true, this))
+ if (opponent is IBattlerEffect b1 && b1.CanConfuse(attacker, true, this))
{
- b1.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused!", opponent.ToString()));
+ b1.Confuse();
+ battle.Display(Game._INTL("{1} became confused!", opponent.ToString()));
ret = 0;
}
return ret;
@@ -2352,25 +2353,25 @@ public partial class PokeBattle_Move_041 : PokeBattle_Move
{
public PokeBattle_Move_041() : base() { }
//public PokeBattle_Move_041(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("{1}'s attack missed!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s attack missed!", attacker.ToString()));
return -1;
}
int ret = -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 2, attacker, false, this);
+ b0.IncreaseStat(Stats.ATTACK, 2, attacker, false, this);
ret = 0;
}
- if (opponent is IBattlerEffect b1 && b1.pbCanConfuse(attacker, true, this))
+ if (opponent is IBattlerEffect b1 && b1.CanConfuse(attacker, true, this))
{
- b1.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused!", opponent.ToString()));
+ b1.Confuse();
+ battle.Display(Game._INTL("{1} became confused!", opponent.ToString()));
ret = 0;
}
return ret;
@@ -2384,23 +2385,23 @@ public partial class PokeBattle_Move_042 : PokeBattle_Move
{
public PokeBattle_Move_042() : base() { }
//public PokeBattle_Move_042(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.ATTACK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.ATTACK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = false; //opponent.pbReduceStat(Stats.ATTACK, 1, attacker, false, this);
- if (opponent is IBattlerEffect o) ret = o.pbReduceStat(Stats.ATTACK, 1, attacker, false, this);
+ bool ret = false; //opponent.ReduceStat(Stats.ATTACK, 1, attacker, false, this);
+ if (opponent is IBattlerEffect o) ret = o.ReduceStat(Stats.ATTACK, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.ATTACK, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.ATTACK, attacker, false, this))
{
- b.pbReduceStat(Stats.ATTACK, 1, attacker, false, this);
+ b.ReduceStat(Stats.ATTACK, 1, attacker, false, this);
}
}
}
@@ -2412,22 +2413,22 @@ public partial class PokeBattle_Move_043 : PokeBattle_Move
{
public PokeBattle_Move_043() : base() { }
//public PokeBattle_Move_043(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.DEFENSE, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this);
+ b.ReduceStat(Stats.DEFENSE, 1, attacker, false, this);
}
}
}
@@ -2439,26 +2440,26 @@ public partial class PokeBattle_Move_044 : PokeBattle_Move
{
public PokeBattle_Move_044() : base() { }
//public PokeBattle_Move_044(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPEED, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPEED, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPEED, 1, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPEED, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPEED, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPEED, attacker, false, this))
{
- b.pbReduceStat(Stats.SPEED, 1, attacker, false, this);
+ b.ReduceStat(Stats.SPEED, 1, attacker, false, this);
}
}
- public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
+ public int ModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
{
if (id == Moves.BULLDOZE &&
this.battle.field.GrassyTerrain > 0)
@@ -2476,22 +2477,22 @@ public partial class PokeBattle_Move_045 : PokeBattle_Move
{
public PokeBattle_Move_045() : base() { }
//public PokeBattle_Move_045(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPATK, 1, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPATK, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPATK, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPATK, attacker, false, this))
{
- b.pbReduceStat(Stats.SPATK, 1, attacker, false, this);
+ b.ReduceStat(Stats.SPATK, 1, attacker, false, this);
}
}
}
@@ -2503,22 +2504,22 @@ public partial class PokeBattle_Move_046 : PokeBattle_Move
{
public PokeBattle_Move_046() : base() { }
//public PokeBattle_Move_046(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPDEF, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPDEF, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPDEF, 1, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPDEF, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPDEF, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPDEF, attacker, false, this))
{
- b.pbReduceStat(Stats.SPDEF, 1, attacker, false, this);
+ b.ReduceStat(Stats.SPDEF, 1, attacker, false, this);
}
}
}
@@ -2530,22 +2531,22 @@ public partial class PokeBattle_Move_047 : PokeBattle_Move
{
public PokeBattle_Move_047() : base() { }
//public PokeBattle_Move_047(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.ACCURACY, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.ACCURACY, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.ACCURACY, 1, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.ACCURACY, 1, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.ACCURACY, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.ACCURACY, attacker, false, this))
{
- b.pbReduceStat(Stats.ACCURACY, 1, attacker, false, this);
+ b.ReduceStat(Stats.ACCURACY, 1, attacker, false, this);
}
}
}
@@ -2557,24 +2558,24 @@ public partial class PokeBattle_Move_048 : PokeBattle_Move
{
public PokeBattle_Move_048() : base() { }
//public PokeBattle_Move_048(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.EVASION, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.EVASION, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
byte increment = (Core.USENEWBATTLEMECHANICS) ? (byte)2 : (byte)1;
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.EVASION, increment, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.EVASION, increment, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.EVASION, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.EVASION, attacker, false, this))
{
byte increment = (Core.USENEWBATTLEMECHANICS) ? (byte)2 : (byte)1;
- b.pbReduceStat(Stats.EVASION, increment, attacker, false, this);
+ b.ReduceStat(Stats.EVASION, increment, attacker, false, this);
}
}
}
@@ -2587,58 +2588,58 @@ public partial class PokeBattle_Move_049 : PokeBattle_Move
{
public PokeBattle_Move_049() : base() { }
//public PokeBattle_Move_049(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
- {
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
-
- if (opponent is IBattlerEffect o) o.pbReduceStat(Stats.EVASION, 1, attacker, false, this);
- opponent.pbOwnSide.Reflect = 0;
- opponent.pbOwnSide.LightScreen = 0;
- opponent.pbOwnSide.Mist = 0;
- opponent.pbOwnSide.Safeguard = 0;
- opponent.pbOwnSide.Spikes = 0;
- opponent.pbOwnSide.StealthRock = false;
- opponent.pbOwnSide.StickyWeb = false;
- opponent.pbOwnSide.ToxicSpikes = 0;
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ {
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+
+ if (opponent is IBattlerEffect o) o.ReduceStat(Stats.EVASION, 1, attacker, false, this);
+ opponent.OwnSide.Reflect = 0;
+ opponent.OwnSide.LightScreen = 0;
+ opponent.OwnSide.Mist = 0;
+ opponent.OwnSide.Safeguard = 0;
+ opponent.OwnSide.Spikes = 0;
+ opponent.OwnSide.StealthRock = false;
+ opponent.OwnSide.StickyWeb = false;
+ opponent.OwnSide.ToxicSpikes = 0;
if (Core.USENEWBATTLEMECHANICS)
{
- opponent.pbOpposingSide.Reflect = 0;
- opponent.pbOpposingSide.LightScreen = 0;
- opponent.pbOpposingSide.Mist = 0;
- opponent.pbOpposingSide.Safeguard = 0;
- opponent.pbOpposingSide.Spikes = 0;
- opponent.pbOpposingSide.StealthRock = false;
- opponent.pbOpposingSide.StickyWeb = false;
- opponent.pbOpposingSide.ToxicSpikes = 0;
+ opponent.OpposingSide.Reflect = 0;
+ opponent.OpposingSide.LightScreen = 0;
+ opponent.OpposingSide.Mist = 0;
+ opponent.OpposingSide.Safeguard = 0;
+ opponent.OpposingSide.Spikes = 0;
+ opponent.OpposingSide.StealthRock = false;
+ opponent.OpposingSide.StickyWeb = false;
+ opponent.OpposingSide.ToxicSpikes = 0;
}
return 0;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (!opponent.damagestate.Substitute)
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.EVASION, attacker, false, this))
- b.pbReduceStat(Stats.EVASION, 1, attacker, false, this);
-
- opponent.pbOwnSide.Reflect = 0;
- opponent.pbOwnSide.LightScreen = 0;
- opponent.pbOwnSide.Mist = 0;
- opponent.pbOwnSide.Safeguard = 0;
- opponent.pbOwnSide.Spikes = 0;
- opponent.pbOwnSide.StealthRock = false;
- opponent.pbOwnSide.StickyWeb = false;
- opponent.pbOwnSide.ToxicSpikes = 0;
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.EVASION, attacker, false, this))
+ b.ReduceStat(Stats.EVASION, 1, attacker, false, this);
+
+ opponent.OwnSide.Reflect = 0;
+ opponent.OwnSide.LightScreen = 0;
+ opponent.OwnSide.Mist = 0;
+ opponent.OwnSide.Safeguard = 0;
+ opponent.OwnSide.Spikes = 0;
+ opponent.OwnSide.StealthRock = false;
+ opponent.OwnSide.StickyWeb = false;
+ opponent.OwnSide.ToxicSpikes = 0;
if (Core.USENEWBATTLEMECHANICS)
{
- opponent.pbOpposingSide.Reflect = 0;
- opponent.pbOpposingSide.LightScreen = 0;
- opponent.pbOpposingSide.Mist = 0;
- opponent.pbOpposingSide.Safeguard = 0;
- opponent.pbOpposingSide.Spikes = 0;
- opponent.pbOpposingSide.StealthRock = false;
- opponent.pbOpposingSide.StickyWeb = false;
- opponent.pbOpposingSide.ToxicSpikes = 0;
+ opponent.OpposingSide.Reflect = 0;
+ opponent.OpposingSide.LightScreen = 0;
+ opponent.OpposingSide.Mist = 0;
+ opponent.OpposingSide.Safeguard = 0;
+ opponent.OpposingSide.Spikes = 0;
+ opponent.OpposingSide.StealthRock = false;
+ opponent.OpposingSide.StickyWeb = false;
+ opponent.OpposingSide.ToxicSpikes = 0;
}
}
}
@@ -2650,25 +2651,25 @@ public partial class PokeBattle_Move_04A : PokeBattle_Move
{
public PokeBattle_Move_04A() : base() { }
//public PokeBattle_Move_04A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- // Replicates pbCanReduceStatStage? so that certain messages aren't shown
+ // Replicates CanReduceStatStage? so that certain messages aren't shown
// multiple times
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("{1}'s attack missed!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s attack missed!", attacker.ToString()));
return -1;
}
if (opponent is IBattlerEffect b &&
- b.pbTooLow(Stats.ATTACK) &&
- b.pbTooLow(Stats.DEFENSE))
+ b.TooLow(Stats.ATTACK) &&
+ b.TooLow(Stats.DEFENSE))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any lower!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any lower!", opponent.ToString()));
return -1;
}
- if (opponent.pbOwnSide.Mist > 0)
+ if (opponent.OwnSide.Mist > 0)
{
- battle.pbDisplay(Game._INTL("{1} is protected by Mist!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} is protected by Mist!", opponent.ToString()));
return -1;
}
if (!attacker.hasMoldBreaker())
@@ -2676,34 +2677,34 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (opponent.hasWorkingAbility(Abilities.CLEAR_BODY) ||
opponent.hasWorkingAbility(Abilities.WHITE_SMOKE))
{
- battle.pbDisplay(Game._INTL("{1}'s {2} prevents stat loss!", opponent.ToString(),
+ battle.Display(Game._INTL("{1}'s {2} prevents stat loss!", opponent.ToString(),
Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int ret = -1; bool showanim = true;
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.HYPER_CUTTER) &&
- opponent is IBattlerEffect b0 && !b0.pbTooLow(Stats.ATTACK))
+ opponent is IBattlerEffect b0 && !b0.TooLow(Stats.ATTACK))
{
string abilityname = Game._INTL(opponent.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1}'s {2} prevents Attack loss!", opponent.ToString(), abilityname));
+ battle.Display(Game._INTL("{1}'s {2} prevents Attack loss!", opponent.ToString(), abilityname));
}
- else if (opponent is IBattlerEffect b1 && b1.pbReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim))
+ else if (opponent is IBattlerEffect b1 && b1.ReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim))
{
ret = 0; showanim = false;
}
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.BIG_PECKS) &&
- opponent is IBattlerEffect b2 && !b2.pbTooLow(Stats.DEFENSE))
+ opponent is IBattlerEffect b2 && !b2.TooLow(Stats.DEFENSE))
{
string abilityname = Game._INTL(opponent.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1}'s {2} prevents Defense loss!", opponent.ToString(), abilityname));
+ battle.Display(Game._INTL("{1}'s {2} prevents Defense loss!", opponent.ToString(), abilityname));
}
- else if (opponent is IBattlerEffect b3 && b3.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim))
+ else if (opponent is IBattlerEffect b3 && b3.ReduceStat(Stats.DEFENSE, 1, attacker, false, this, showanim))
{
ret = 0; showanim = false;
}
@@ -2718,22 +2719,22 @@ public partial class PokeBattle_Move_04B : PokeBattle_Move
{
public PokeBattle_Move_04B() : base() { }
//public PokeBattle_Move_04B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.ATTACK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.ATTACK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.ATTACK, 2, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.ATTACK, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.ATTACK, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.ATTACK, attacker, false, this))
{
- b.pbReduceStat(Stats.ATTACK, 2, attacker, false, this);
+ b.ReduceStat(Stats.ATTACK, 2, attacker, false, this);
}
}
}
@@ -2745,22 +2746,22 @@ public partial class PokeBattle_Move_04C : PokeBattle_Move
{
public PokeBattle_Move_04C() : base() { }
//public PokeBattle_Move_04C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.DEFENSE, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.DEFENSE, 2, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.DEFENSE, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbReduceStat(Stats.DEFENSE, 2, attacker, false, this);
+ b.ReduceStat(Stats.DEFENSE, 2, attacker, false, this);
}
}
}
@@ -2772,25 +2773,25 @@ public partial class PokeBattle_Move_04D : PokeBattle_Move
{
public PokeBattle_Move_04D() : base() { }
//public PokeBattle_Move_04D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPEED, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPEED, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
byte increment = (id == Moves.STRING_SHOT && !Core.USENEWBATTLEMECHANICS) ? (byte)1 : (byte)2;
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPEED, increment, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPEED, increment, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPEED, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPEED, attacker, false, this))
{
byte increment = (id == Moves.STRING_SHOT && !Core.USENEWBATTLEMECHANICS) ? (byte)1 : (byte)2;
- b.pbReduceStat(Stats.SPEED, increment, attacker, false, this);
+ b.ReduceStat(Stats.SPEED, increment, attacker, false, this);
}
}
}
@@ -2803,37 +2804,37 @@ public partial class PokeBattle_Move_04E : PokeBattle_Move
{
public PokeBattle_Move_04E() : base() { }
//public PokeBattle_Move_04E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
if (!attacker.Gender.HasValue || !opponent.Gender.HasValue || attacker.Gender.Value == opponent.Gender.Value)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.OBLIVIOUS))
{
- battle.pbDisplay(Game._INTL("{1}'s {2} prevents romance!", opponent.ToString(),
+ battle.Display(Game._INTL("{1}'s {2} prevents romance!", opponent.ToString(),
Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPATK, 2, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPATK, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
if (attacker.Gender.HasValue && opponent.Gender.HasValue && attacker.Gender.Value != opponent.Gender.Value)
{
if (attacker.hasMoldBreaker() || !opponent.hasWorkingAbility(Abilities.OBLIVIOUS))
{
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPATK, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPATK, attacker, false, this))
{
- b.pbReduceStat(Stats.SPATK, 2, attacker, false, this);
+ b.ReduceStat(Stats.SPATK, 2, attacker, false, this);
}
}
}
@@ -2847,22 +2848,22 @@ public partial class PokeBattle_Move_04F : PokeBattle_Move
{
public PokeBattle_Move_04F() : base() { }
//public PokeBattle_Move_04F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPDEF, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPDEF, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPDEF, 2, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPDEF, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPDEF, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPDEF, attacker, false, this))
{
- b.pbReduceStat(Stats.SPDEF, 2, attacker, false, this);
+ b.ReduceStat(Stats.SPDEF, 2, attacker, false, this);
}
}
}
@@ -2874,10 +2875,10 @@ public partial class PokeBattle_Move_050 : PokeBattle_Move
{
public PokeBattle_Move_050() : base() { }
//public PokeBattle_Move_050(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && !opponent.damagestate.Substitute)
{
opponent.stages[(byte)Stats.ATTACK] = 0;
@@ -2888,7 +2889,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.stages[(byte)Stats.ACCURACY] = 0;
opponent.stages[(byte)Stats.EVASION] = 0;
- battle.pbDisplay(Game._INTL("{1}'s stat changes were removed!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s stat changes were removed!", opponent.ToString()));
}
return ret;
}
@@ -2901,7 +2902,7 @@ public partial class PokeBattle_Move_051 : PokeBattle_Move
{
public PokeBattle_Move_051() : base() { }
//public PokeBattle_Move_051(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
for (int i = 0; i < 4; i++)
{
@@ -2913,9 +2914,9 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
this.battle.battlers[i].stages[(byte)Stats.ACCURACY] = 0;
this.battle.battlers[i].stages[(byte)Stats.EVASION] = 0;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("All stat changes were eliminated!"));
+ battle.Display(Game._INTL("All stat changes were eliminated!"));
return 0;
}
}
@@ -2927,9 +2928,9 @@ public partial class PokeBattle_Move_052 : PokeBattle_Move
{
public PokeBattle_Move_052() : base() { }
//public PokeBattle_Move_052(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
astage = attacker.stages;
ostage = opponent.stages;
@@ -2944,7 +2945,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
astage[(byte)Stats.SPATK] = o; //ostage[(byte)Stats.SPATK];
ostage[(byte)Stats.SPATK] = a; //astage[(byte)Stats.SPATK];
- battle.pbDisplay(Game._INTL("{1} switched all changes to its Attack and Sp. Atk with the target!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} switched all changes to its Attack and Sp. Atk with the target!", attacker.ToString()));
return 0;
}
}
@@ -2956,9 +2957,9 @@ public partial class PokeBattle_Move_053 : PokeBattle_Move
{
public PokeBattle_Move_053() : base() { }
//public PokeBattle_Move_053(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
astage = attacker.stages;
ostage = opponent.stages;
@@ -2973,7 +2974,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
astage[(byte)Stats.SPDEF] = o; //ostage[(byte)Stats.SPDEF];
ostage[(byte)Stats.SPDEF] = a; //astage[(byte)Stats.SPDEF];
- battle.pbDisplay(Game._INTL("{1} switched all changes to its Defense and Sp. Def with the target!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} switched all changes to its Defense and Sp. Def with the target!", attacker.ToString()));
return 0;
}
}
@@ -2985,10 +2986,10 @@ public partial class PokeBattle_Move_054 : PokeBattle_Move
{
public PokeBattle_Move_054() : base() { }
//public PokeBattle_Move_054(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
foreach (var i in new[] { Stats.ATTACK, Stats.DEFENSE, Stats.SPEED,
Stats.SPATK, Stats.SPDEF, Stats.ACCURACY, Stats.EVASION })
{
@@ -2999,7 +3000,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.stages[(byte)i] = a; //attacker.stages[(byte)i];
}
- battle.pbDisplay(Game._INTL("{1} switched stat changes with the target!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} switched stat changes with the target!", attacker.ToString()));
return 0;
}
}
@@ -3011,21 +3012,21 @@ public partial class PokeBattle_Move_055 : PokeBattle_Move
{
public PokeBattle_Move_055() : base() { }
//public PokeBattle_Move_055(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
foreach (var i in new[] { Stats.ATTACK, Stats.DEFENSE, Stats.SPEED,
Stats.SPATK, Stats.SPDEF, Stats.ACCURACY, Stats.EVASION })
{
attacker.stages[(byte)i] = opponent.stages[(byte)i];
}
- battle.pbDisplay(Game._INTL("{1} copied {2}'s stat changes!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1} copied {2}'s stat changes!", attacker.ToString(), opponent.ToString(true)));
return 0;
}
}
@@ -3037,23 +3038,23 @@ public partial class PokeBattle_Move_056 : PokeBattle_Move
{
public PokeBattle_Move_056() : base() { }
//public PokeBattle_Move_056(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.Mist > 0)
+ if (attacker.OwnSide.Mist > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.Mist = 5;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.Mist = 5;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Your team became shrouded in mist!"));
+ battle.Display(Game._INTL("Your team became shrouded in mist!"));
}
else
{
- battle.pbDisplay(Game._INTL("The opposing team became shrouded in mist!"));
+ battle.Display(Game._INTL("The opposing team became shrouded in mist!"));
}
return 0;
}
@@ -3066,9 +3067,9 @@ public partial class PokeBattle_Move_057 : PokeBattle_Move
{
public PokeBattle_Move_057() : base() { }
//public PokeBattle_Move_057(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
//attacker.attack,attacker.defense = attacker.defense,attacker.attack;
int a = attacker.ATK;
@@ -3077,7 +3078,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.DEF = a; //attacker.ATK;
attacker.effects.PowerTrick = !attacker.effects.PowerTrick;
- battle.pbDisplay(Game._INTL("{1} switched its Attack and Defense!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} switched its Attack and Defense!", attacker.ToString()));
return 0;
}
}
@@ -3090,14 +3091,14 @@ public partial class PokeBattle_Move_058 : PokeBattle_Move
{
public PokeBattle_Move_058() : base() { }
//public PokeBattle_Move_058(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int avatk = (int)Math.Floor((attacker.ATK + opponent.ATK) / 2f);
int avspatk = (int)Math.Floor((attacker.SPA + opponent.SPA) / 2f);
@@ -3105,7 +3106,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.ATK = opponent.ATK = avatk;
attacker.SPA = opponent.SPA = avspatk;
- battle.pbDisplay(Game._INTL("{1} shared its power with the target!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} shared its power with the target!", attacker.ToString()));
return 0;
}
}
@@ -3118,14 +3119,14 @@ public partial class PokeBattle_Move_059 : PokeBattle_Move
{
public PokeBattle_Move_059() : base() { }
//public PokeBattle_Move_059(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int avdef = (int)Math.Floor((attacker.DEF + opponent.DEF) / 2f);
int avspdef = (int)Math.Floor((attacker.SPD + opponent.SPD) / 2f);
@@ -3133,7 +3134,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.DEF = opponent.DEF = avdef;
attacker.SPD = opponent.SPD = avspdef;
- battle.pbDisplay(Game._INTL("{1} shared its guard with the target!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} shared its guard with the target!", attacker.ToString()));
return 0;
}
}
@@ -3145,14 +3146,14 @@ public partial class PokeBattle_Move_05A : PokeBattle_Move
{
public PokeBattle_Move_05A() : base() { }
//public PokeBattle_Move_05A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int olda = attacker.HP;
int oldo = opponent.HP;
@@ -3161,9 +3162,9 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.HP = Math.Min(avhp, attacker.TotalHP);
opponent.HP = Math.Min(avhp, opponent.TotalHP);
- if (this.battle.scene is IPokeBattle_Scene s0) s0.pbHPChanged(attacker, olda);
- if (this.battle.scene is IPokeBattle_Scene s1) s1.pbHPChanged(opponent, oldo);
- battle.pbDisplay(Game._INTL("The battlers shared their pain!"));
+ if (this.battle.scene is IPokeBattle_Scene s0) s0.HPChanged(attacker, olda);
+ if (this.battle.scene is IPokeBattle_Scene s1) s1.HPChanged(opponent, oldo);
+ battle.Display(Game._INTL("The battlers shared their pain!"));
return 0;
}
}
@@ -3175,23 +3176,23 @@ public partial class PokeBattle_Move_05B : PokeBattle_Move
{
public PokeBattle_Move_05B() : base() { }
//public PokeBattle_Move_05B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.Tailwind > 0)
+ if (attacker.OwnSide.Tailwind > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.Tailwind = 4;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.Tailwind = 4;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("The tailwind blew from behind your team!"));
+ battle.Display(Game._INTL("The tailwind blew from behind your team!"));
}
else
{
- battle.pbDisplay(Game._INTL("The tailwind blew from behind the opposing team!"));
+ battle.Display(Game._INTL("The tailwind blew from behind the opposing team!"));
}
return 0;
}
@@ -3205,7 +3206,7 @@ public partial class PokeBattle_Move_05C : PokeBattle_Move
{
public PokeBattle_Move_05C() : base() { }
//public PokeBattle_Move_05C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List {
@@ -3217,37 +3218,37 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
};
if (attacker.effects.Transform ||
opponent.lastMoveUsed <= 0 ||
- Kernal.MoveData[(Moves)opponent.lastMoveUsed].Type == Types.SHADOW ||
+ Kernal.MoveData[(Moves)opponent.lastMoveUsed].Type == Types.SHADOW ||
blacklist.Contains(Kernal.MoveData[(Moves)opponent.lastMoveUsed].Effect))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
foreach (var i in attacker.moves)
{
if (i.id == opponent.lastMoveUsed)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
for (int i = 0; i < attacker.moves.Length; i++)
{
if (attacker.moves[i].id == this.id)
{
Attack.Move newmove = new Attack.Move(opponent.lastMoveUsed);
- attacker.moves[i] = Combat.Move.pbFromPBMove(this.battle, newmove);
+ attacker.moves[i] = Combat.Move.FromMove(this.battle, newmove);
string movename = Game._INTL(opponent.lastMoveUsed.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} learned {2}!", attacker.ToString(), movename));
+ battle.Display(Game._INTL("{1} learned {2}!", attacker.ToString(), movename));
return 0;
}
}
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
@@ -3259,7 +3260,7 @@ public partial class PokeBattle_Move_05D : PokeBattle_Move
{
public PokeBattle_Move_05D() : base() { }
//public PokeBattle_Move_05D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List {
@@ -3272,31 +3273,31 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
Kernal.MoveData[(Moves)opponent.lastMoveUsedSketch].Type == Types.SHADOW ||
blacklist.Contains(Kernal.MoveData[(Moves)opponent.lastMoveUsedSketch].Effect))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
foreach (var i in attacker.moves)
{
if (i.id == opponent.lastMoveUsedSketch)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
for (int i = 0; i < attacker.moves.Length; i++)
{
if (attacker.moves[i].id == this.id)
{
Attack.Move newmove = new Attack.Move(opponent.lastMoveUsedSketch);
- attacker.moves[i] = Combat.Move.pbFromPBMove(this.battle, newmove);
+ attacker.moves[i] = Combat.Move.FromMove(this.battle, newmove);
- IPokemon[] party = this.battle.pbParty(attacker.Index);
+ IPokemon[] party = this.battle.Party(attacker.Index);
party[attacker.pokemonIndex].moves[i] = newmove;
@@ -3304,12 +3305,12 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
string movename = Game._INTL(opponent.lastMoveUsedSketch.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} learned {2}!", attacker.ToString(), movename));
+ battle.Display(Game._INTL("{1} learned {2}!", attacker.ToString(), movename));
return 0;
}
}
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
@@ -3322,19 +3323,19 @@ public partial class PokeBattle_Move_05E : PokeBattle_Move
{
public PokeBattle_Move_05E() : base() { }
//public PokeBattle_Move_05E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Ability == Abilities.MULTITYPE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
List types = new List(); //[]
foreach (var i in attacker.moves)
{
if (i.id == this.id) continue; //next
- //if (PBTypes.isPseudoType(i.Type)) continue;
- if (attacker.pbHasType(i.Type)) continue; //next
+ //if (Types.isPseudoType(i.Type)) continue;
+ if (attacker.HasType(i.Type)) continue; //next
if (!types.Contains(i.Type))
{
types.Add(i.Type);
@@ -3344,12 +3345,12 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (types.Count == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- Types newtype = types[this.battle.pbRandom(types.Count)];
+ Types newtype = types[this.battle.Random(types.Count)];
attacker.Type1 = newtype;
attacker.Type2 = newtype;
@@ -3357,7 +3358,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
string typename = Game._INTL(newtype.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} transformed into the {2} type!", attacker.ToString(), typename));
+ battle.Display(Game._INTL("{1} transformed into the {2} type!", attacker.ToString(), typename));
return 0; //ToDo: Wasnt sure what to return, so put null/0
}
}
@@ -3370,23 +3371,23 @@ public partial class PokeBattle_Move_05F : PokeBattle_Move
{
public PokeBattle_Move_05F() : base() { }
//public PokeBattle_Move_05F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Ability == Abilities.MULTITYPE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (opponent.lastMoveUsed <= 0
- //|| PBTypes.isPseudoType(Kernal.MoveData[(Moves)opponent.lastMoveUsed].Type)
+ if (opponent.lastMoveUsed <= 0
+ //|| Types.isPseudoType(Kernal.MoveData[(Moves)opponent.lastMoveUsed].Type)
)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
List types = new List();//[]
@@ -3395,23 +3396,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (atype < 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
for (int i = 0; i < Kernal.TypeData.Count; i++)
{
- //if (PBTypes.isPseudoType((Types)i)) continue;
- if (attacker.pbHasType((Types)i)) continue; //next
+ //if (Types.isPseudoType((Types)i)) continue;
+ if (attacker.HasType((Types)i)) continue; //next
if (atype.GetEffectiveness((Types)i) < 2) types.Add((Types)i);
}
if (types.Count == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- Types newtype = types[this.battle.pbRandom(types.Count)];
+ Types newtype = types[this.battle.Random(types.Count)];
attacker.Type1 = newtype;
attacker.Type2 = newtype;
@@ -3419,7 +3420,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
string typename = Game._INTL(newtype.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} transformed into the {2} type!", attacker.ToString(), typename));
+ battle.Display(Game._INTL("{1} transformed into the {2} type!", attacker.ToString(), typename));
return 0;
}
}
@@ -3431,11 +3432,11 @@ public partial class PokeBattle_Move_060 : PokeBattle_Move
{
public PokeBattle_Move_060() : base() { }
//public PokeBattle_Move_060(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Ability == Abilities.MULTITYPE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
Types type = Types.NORMAL;
@@ -3470,12 +3471,12 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
type = Types.FAIRY;
}
- if (attacker.pbHasType(type))
+ if (attacker.HasType(type))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.Type1 = type;
attacker.Type2 = type;
@@ -3483,7 +3484,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
string typename = Game._INTL(type.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} transformed into the {2} type!", attacker.ToString(), typename));
+ battle.Display(Game._INTL("{1} transformed into the {2} type!", attacker.ToString(), typename));
return 0;
}
}
@@ -3495,26 +3496,26 @@ public partial class PokeBattle_Move_061 : PokeBattle_Move
{
public PokeBattle_Move_061() : base() { }
//public PokeBattle_Move_061(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
if (opponent.Ability == Abilities.MULTITYPE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.Type1 == Types.WATER &&
opponent.Type2 == Types.WATER &&
(opponent.effects.Type3 < 0 ||
opponent.effects.Type3 == Types.WATER))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
opponent.Type1 = Types.WATER;
@@ -3523,7 +3524,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.effects.Type3 = Types.NONE; //-1;
string typename = Game._INTL(Types.WATER.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} transformed into the {2} type!", opponent.ToString(), typename));
+ battle.Display(Game._INTL("{1} transformed into the {2} type!", opponent.ToString(), typename));
return 0;
}
}
@@ -3535,30 +3536,30 @@ public partial class PokeBattle_Move_062 : PokeBattle_Move
{
public PokeBattle_Move_062() : base() { }
//public PokeBattle_Move_062(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Ability == Abilities.MULTITYPE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (attacker.pbHasType(opponent.Type1) &&
- attacker.pbHasType(opponent.Type2) &&
- attacker.pbHasType(opponent.effects.Type3) &&
- opponent.pbHasType(attacker.Type1) &&
- opponent.pbHasType(attacker.Type2) &&
- opponent.pbHasType(attacker.effects.Type3))
+ if (attacker.HasType(opponent.Type1) &&
+ attacker.HasType(opponent.Type2) &&
+ attacker.HasType(opponent.effects.Type3) &&
+ opponent.HasType(attacker.Type1) &&
+ opponent.HasType(attacker.Type2) &&
+ opponent.HasType(attacker.effects.Type3))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
attacker.Type1 = opponent.Type1;
attacker.Type2 = opponent.Type2;
attacker.effects.Type3 = Types.NONE; //-1;
- battle.pbDisplay(Game._INTL("{1}'s type changed to match {2}'s!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1}'s type changed to match {2}'s!", attacker.ToString(), opponent.ToString(true)));
return 0;
}
}
@@ -3570,11 +3571,11 @@ public partial class PokeBattle_Move_063 : PokeBattle_Move
{
public PokeBattle_Move_063() : base() { }
//public PokeBattle_Move_063(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (opponent.Ability == Abilities.MULTITYPE ||
@@ -3582,22 +3583,22 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.Ability == Abilities.STANCE_CHANGE ||
opponent.Ability == Abilities.TRUANT)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
Abilities oldabil = opponent.Ability;
opponent.Ability = Abilities.SIMPLE;
string abilityname = Game._INTL(Abilities.SIMPLE.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} acquired {2}!", opponent.ToString(), abilityname));
+ battle.Display(Game._INTL("{1} acquired {2}!", opponent.ToString(), abilityname));
if (opponent.effects.Illusion.Species != Pokemons.NONE && oldabil == Abilities.ILLUSION)
{
GameDebug.Log($"[Ability triggered] #{opponent.ToString()}'s Illusion ended");
opponent.effects.Illusion = null;
- if (this.battle.scene is IPokeBattle_Scene s0) s0.pbChangePokemon(opponent, (opponent as Pokemon).Form.Id);//Species);
+ if (this.battle.scene is IPokeBattle_Scene s0) s0.ChangePokemon(opponent, opponent.pokemon);
- battle.pbDisplay(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
}
return 0;
}
@@ -3610,35 +3611,35 @@ public partial class PokeBattle_Move_064 : PokeBattle_Move
{
public PokeBattle_Move_064() : base() { }
//public PokeBattle_Move_064(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
if (opponent.Ability == Abilities.MULTITYPE ||
opponent.Ability == Abilities.INSOMNIA ||
opponent.Ability == Abilities.STANCE_CHANGE ||
opponent.Ability == Abilities.TRUANT)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
Abilities oldabil = opponent.Ability;
opponent.Ability = Abilities.INSOMNIA;
string abilityname = Game._INTL(Abilities.INSOMNIA.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} acquired {2}!", opponent.ToString(), abilityname));
+ battle.Display(Game._INTL("{1} acquired {2}!", opponent.ToString(), abilityname));
if (opponent.effects.Illusion.Species != Pokemons.NONE && oldabil == Abilities.ILLUSION)
{
GameDebug.Log($"[Ability triggered] #{opponent.ToString()}'s Illusion ended");
opponent.effects.Illusion = null;
- if (this.battle.scene is IPokeBattle_Scene s0) s0.pbChangePokemon(opponent, (opponent as Pokemon).Form.Id);//Species);
+ if (this.battle.scene is IPokeBattle_Scene s0) s0.ChangePokemon(opponent, opponent.pokemon);
- battle.pbDisplay(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
}
return 0;
}
@@ -3651,11 +3652,11 @@ public partial class PokeBattle_Move_065 : PokeBattle_Move
{
public PokeBattle_Move_065() : base() { }
//public PokeBattle_Move_065(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (opponent.Ability == 0 ||
@@ -3672,23 +3673,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.Ability == Abilities.WONDER_GUARD ||
opponent.Ability == Abilities.ZEN_MODE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
Abilities oldabil = attacker.Ability;
attacker.Ability = opponent.Ability;
string abilityname = Game._INTL(opponent.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} copied {2}'s {3}!", attacker.ToString(), opponent.ToString(true), abilityname));
+ battle.Display(Game._INTL("{1} copied {2}'s {3}!", attacker.ToString(), opponent.ToString(true), abilityname));
if (attacker.effects.Illusion.Species != Pokemons.NONE && oldabil == Abilities.ILLUSION)
{
GameDebug.Log($"[Ability triggered] #{attacker.ToString()}'s Illusion ended");
attacker.effects.Illusion = null;
- if (this.battle.scene is IPokeBattle_Scene s0) s0.pbChangePokemon(attacker, (attacker as Pokemon).Form.Id);//Species);
+ if (this.battle.scene is IPokeBattle_Scene s0) s0.ChangePokemon(attacker, attacker.pokemon);
- battle.pbDisplay(Game._INTL("{1}'s {2} wore off!", attacker.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("{1}'s {2} wore off!", attacker.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
}
return 0;
}
@@ -3701,16 +3702,16 @@ public partial class PokeBattle_Move_066 : PokeBattle_Move
{
public PokeBattle_Move_066() : base() { }
//public PokeBattle_Move_066(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (attacker.Ability == 0 ||
@@ -3731,23 +3732,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.Ability == Abilities.TRACE ||
attacker.Ability == Abilities.ZEN_MODE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
Abilities oldabil = opponent.Ability;
opponent.Ability = attacker.Ability;
string abilityname = Game._INTL(attacker.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} acquired {2}!", opponent.ToString(), abilityname));
+ battle.Display(Game._INTL("{1} acquired {2}!", opponent.ToString(), abilityname));
if (opponent.effects.Illusion.Species != Pokemons.NONE && oldabil == Abilities.ILLUSION)
{
GameDebug.Log($"[Ability triggered] #{opponent.ToString()}'s Illusion ended");
opponent.effects.Illusion = null;
- if (this.battle.scene is IPokeBattle_Scene s0) s0.pbChangePokemon(opponent, (opponent as Pokemon).Form.Id);//Species);
+ if (this.battle.scene is IPokeBattle_Scene s0) s0.ChangePokemon(opponent, opponent.pokemon);
- battle.pbDisplay(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
}
return 0;
}
@@ -3760,7 +3761,7 @@ public partial class PokeBattle_Move_067 : PokeBattle_Move
{
public PokeBattle_Move_067() : base() { }
//public PokeBattle_Move_067(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if ((attacker.Ability == 0 && opponent.Ability == 0) ||
(attacker.Ability == opponent.Ability && !Core.USENEWBATTLEMECHANICS) ||
@@ -3773,20 +3774,20 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.Ability == Abilities.WONDER_GUARD ||
opponent.Ability == Abilities.WONDER_GUARD)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
Abilities tmp = attacker.Ability;
attacker.Ability = opponent.Ability;
opponent.Ability = tmp;
- battle.pbDisplay(Game._INTL("{1} swapped its {2} Ability with its target's {3} Ability!",
+ battle.Display(Game._INTL("{1} swapped its {2} Ability with its target's {3} Ability!",
attacker.ToString(), Game._INTL(opponent.Ability.ToString(TextScripts.Name)),
Game._INTL(attacker.Ability.ToString(TextScripts.Name))));
- attacker.pbAbilitiesOnSwitchIn(true);
- opponent.pbAbilitiesOnSwitchIn(true);
+ attacker.AbilitiesOnSwitchIn(true);
+ opponent.AbilitiesOnSwitchIn(true);
return 0;
}
}
@@ -3798,33 +3799,33 @@ public partial class PokeBattle_Move_068 : PokeBattle_Move
{
public PokeBattle_Move_068() : base() { }
//public PokeBattle_Move_068(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (opponent.Ability == Abilities.MULTITYPE ||
opponent.Ability == Abilities.STANCE_CHANGE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
Abilities oldabil = opponent.Ability;
opponent.effects.GastroAcid = true;
opponent.effects.Truant = false;
- battle.pbDisplay(Game._INTL("{1}'s Ability was suppressed!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s Ability was suppressed!", opponent.ToString()));
if (opponent.effects.Illusion.Species != Pokemons.NONE && oldabil == Abilities.ILLUSION)
{
GameDebug.Log($"[Ability triggered] #{opponent.ToString()}'s Illusion ended");
opponent.effects.Illusion = null;
- if (this.battle.scene is IPokeBattle_Scene s0) s0.pbChangePokemon(opponent, (opponent as Pokemon).Form.Id);//Species);
+ if (this.battle.scene is IPokeBattle_Scene s0) s0.ChangePokemon(opponent, opponent.pokemon);
- battle.pbDisplay(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("{1}'s {2} wore off!", opponent.ToString(), Game._INTL(oldabil.ToString(TextScripts.Name))));
}
return 0;
}
@@ -3837,7 +3838,7 @@ public partial class PokeBattle_Move_069 : PokeBattle_Move
{
public PokeBattle_Move_069() : base() { }
//public PokeBattle_Move_069(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List{
@@ -3856,15 +3857,15 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.effects.SkyDrop ||
blacklist.Contains(Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
attacker.effects.Transform = true;
attacker.Type1 = opponent.Type1;
@@ -3890,7 +3891,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
for (int i = 0; i < 4; i++)
{
- attacker.moves[i] = Combat.Move.pbFromPBMove(
+ attacker.moves[i] = Combat.Move.FromMove(
@battle, new Attack.Move(opponent.moves[i].id));
attacker.moves[i].PP = 5;
attacker.moves[i].TotalPP = 5;
@@ -3899,7 +3900,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.effects.DisableMove = 0;
- battle.pbDisplay(Game._INTL("{1} transformed into {2}!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1} transformed into {2}!", attacker.ToString(), opponent.ToString(true)));
return 0;
}
}
@@ -3911,9 +3912,9 @@ public partial class PokeBattle_Move_06A : PokeBattle_Move
{
public PokeBattle_Move_06A() : base() { }
//public PokeBattle_Move_06A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- return pbEffectFixedDamage(20, attacker, opponent, hitnum, alltargets, showanimation);
+ return EffectFixedDamage(20, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -3924,9 +3925,9 @@ public partial class PokeBattle_Move_06B : PokeBattle_Move
{
public PokeBattle_Move_06B() : base() { }
//public PokeBattle_Move_06B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- return pbEffectFixedDamage(40, attacker, opponent, hitnum, alltargets, showanimation);
+ return EffectFixedDamage(40, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -3937,9 +3938,9 @@ public partial class PokeBattle_Move_06C : PokeBattle_Move
{
public PokeBattle_Move_06C() : base() { }
//public PokeBattle_Move_06C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- return pbEffectFixedDamage((int)Math.Max(Math.Floor(opponent.HP / 2f), 1), attacker, opponent, hitnum, alltargets, showanimation);
+ return EffectFixedDamage((int)Math.Max(Math.Floor(opponent.HP / 2f), 1), attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -3950,9 +3951,9 @@ public partial class PokeBattle_Move_06D : PokeBattle_Move
{
public PokeBattle_Move_06D() : base() { }
//public PokeBattle_Move_06D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- return pbEffectFixedDamage(attacker.Level, attacker, opponent, hitnum, alltargets, showanimation);
+ return EffectFixedDamage(attacker.Level, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -3963,14 +3964,14 @@ public partial class PokeBattle_Move_06E : PokeBattle_Move
{
public PokeBattle_Move_06E() : base() { }
//public PokeBattle_Move_06E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.HP >= opponent.HP)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- return pbEffectFixedDamage(opponent.HP - attacker.HP, attacker, opponent, hitnum, alltargets, showanimation);
+ return EffectFixedDamage(opponent.HP - attacker.HP, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -3981,11 +3982,11 @@ public partial class PokeBattle_Move_06F : PokeBattle_Move
{
public PokeBattle_Move_06F() : base() { }
//public PokeBattle_Move_06F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int dmg = (int)Math.Max((attacker.Level * (int)Math.Floor(this.battle.pbRandom(101) + 50f) / 100f), 1);
- return pbEffectFixedDamage(dmg, attacker, opponent, hitnum, alltargets, showanimation);
+ int dmg = (int)Math.Max((attacker.Level * (int)Math.Floor(this.battle.Random(101) + 50f) / 100f), 1);
+ return EffectFixedDamage(dmg, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -3996,29 +3997,29 @@ public partial class PokeBattle_Move_070 : PokeBattle_Move
{
public PokeBattle_Move_070() : base() { }
//public PokeBattle_Move_070(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbAccuracyCheck(IBattler attacker, IBattler opponent)
+ public override bool AccuracyCheck(IBattler attacker, IBattler opponent)
{
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.STURDY))
{
- battle.pbDisplay(Game._INTL("{1} was protected by {2}!", opponent.ToString(), Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("{1} was protected by {2}!", opponent.ToString(), Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return false;
}
if (opponent.Level > attacker.Level)
{
- battle.pbDisplay(Game._INTL("{1} is unaffected!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} is unaffected!", opponent.ToString()));
return false;
}
int acc = this.accuracy + attacker.Level - opponent.Level;
- return this.battle.pbRandom(100) < acc;
+ return this.battle.Random(100) < acc;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int damage = pbEffectFixedDamage(opponent.TotalHP, attacker, opponent, hitnum, alltargets, showanimation);
+ int damage = EffectFixedDamage(opponent.TotalHP, attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.isFainted())
{
- battle.pbDisplay(Game._INTL("It's a one-hit KO!"));
+ battle.Display(Game._INTL("It's a one-hit KO!"));
}
return damage;
}
@@ -4031,26 +4032,26 @@ public partial class PokeBattle_Move_071 : PokeBattle_Move
{
public PokeBattle_Move_071() : base() { }
//public PokeBattle_Move_071(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAddTarget(IList targets, IBattler attacker)
+ public override void AddTarget(IList targets, IBattler attacker)
{
if (attacker.effects.CounterTarget >= 0 &&
- attacker.pbIsOpposing(attacker.effects.CounterTarget))
+ attacker.IsOpposing(attacker.effects.CounterTarget))
{
- if (!attacker.pbAddTarget(ref targets, this.battle.battlers[attacker.effects.CounterTarget]))
+ if (!attacker.AddTarget(ref targets, this.battle.battlers[attacker.effects.CounterTarget]))
{
- attacker.pbRandomTarget(targets);
+ attacker.RandomTarget(targets);
}
}
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Counter < 0 || opponent.Species == Pokemons.NONE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- int ret = pbEffectFixedDamage(Math.Max(attacker.effects.Counter * 2, 1), attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = EffectFixedDamage(Math.Max(attacker.effects.Counter * 2, 1), attacker, opponent, hitnum, alltargets, showanimation);
return ret;
}
}
@@ -4062,26 +4063,26 @@ public partial class PokeBattle_Move_072 : PokeBattle_Move
{
public PokeBattle_Move_072() : base() { }
//public PokeBattle_Move_072(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAddTarget(IList targets, IBattler attacker)
+ public override void AddTarget(IList targets, IBattler attacker)
{
if (attacker.effects.MirrorCoatTarget >= 0 &&
- attacker.pbIsOpposing(attacker.effects.MirrorCoatTarget))
+ attacker.IsOpposing(attacker.effects.MirrorCoatTarget))
{
- if (!attacker.pbAddTarget(ref targets, this.battle.battlers[attacker.effects.MirrorCoatTarget]))
+ if (!attacker.AddTarget(ref targets, this.battle.battlers[attacker.effects.MirrorCoatTarget]))
{
- attacker.pbRandomTarget(targets);
+ attacker.RandomTarget(targets);
}
}
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.MirrorCoat < 0 || opponent.Species == Pokemons.NONE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- int ret = pbEffectFixedDamage(Math.Max(attacker.effects.MirrorCoat * 2, 1), attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = EffectFixedDamage(Math.Max(attacker.effects.MirrorCoat * 2, 1), attacker, opponent, hitnum, alltargets, showanimation);
return ret;
}
}
@@ -4094,29 +4095,29 @@ public partial class PokeBattle_Move_073 : PokeBattle_Move
{
public PokeBattle_Move_073() : base() { }
//public PokeBattle_Move_073(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAddTarget(IList targets, IBattler attacker)
+ public override void AddTarget(IList targets, IBattler attacker)
{
if (attacker.lastAttacker.Count > 0)
{
int lastattacker = attacker.lastAttacker[attacker.lastAttacker.Count - 1];
- if (lastattacker >= 0 && attacker.pbIsOpposing(lastattacker))
+ if (lastattacker >= 0 && attacker.IsOpposing(lastattacker))
{
- if (!attacker.pbAddTarget(ref targets, this.battle.battlers[lastattacker]))
+ if (!attacker.AddTarget(ref targets, this.battle.battlers[lastattacker]))
{
- attacker.pbRandomTarget(targets);
+ attacker.RandomTarget(targets);
}
}
}
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.lastHPLost == 0 || opponent.Species == Pokemons.NONE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- int ret = pbEffectFixedDamage((int)Math.Max(Math.Floor(attacker.lastHPLost * 1.5f), 1), attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = EffectFixedDamage((int)Math.Max(Math.Floor(attacker.lastHPLost * 1.5f), 1), attacker, opponent, hitnum, alltargets, showanimation);
return ret;
}
}
@@ -4128,16 +4129,16 @@ public partial class PokeBattle_Move_074 : PokeBattle_Move
{
public PokeBattle_Move_074() : base() { }
//public PokeBattle_Move_074(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- if (opponent.pbPartner.IsNotNullOrNone() && !opponent.pbPartner.isFainted() &&
- !opponent.pbPartner.hasWorkingAbility(Abilities.MAGIC_GUARD))
+ if (opponent.Partner.IsNotNullOrNone() && !opponent.Partner.isFainted() &&
+ !opponent.Partner.hasWorkingAbility(Abilities.MAGIC_GUARD))
{
- opponent.pbPartner.pbReduceHP((int)Math.Floor(opponent.pbPartner.TotalHP / 16f));
- battle.pbDisplay(Game._INTL("The bursting flame hit {1}!", opponent.pbPartner.ToString(true)));
+ opponent.Partner.ReduceHP((int)Math.Floor(opponent.Partner.TotalHP / 16f));
+ battle.Display(Game._INTL("The bursting flame hit {1}!", opponent.Partner.ToString(true)));
}
}
return ret;
@@ -4146,13 +4147,13 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
///
/// Power is doubled if the target is using Dive. (Surf)
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_075 : PokeBattle_Move
{
public PokeBattle_Move_075() : base() { }
//public PokeBattle_Move_075(Battle battle, Attack.Move move) : base(battle, move) { }
- public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
+ public int ModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
{
if (Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x100) // Dive
{
@@ -4165,13 +4166,13 @@ public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
///
/// Power is doubled if the target is using Dig. Power is halved if Grassy Terrain
/// is in effect. (Earthquake)
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_076 : PokeBattle_Move
{
public PokeBattle_Move_076() : base() { }
//public PokeBattle_Move_076(Battle battle, Attack.Move move) : base(battle, move) { }
- public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
+ public int ModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
{
int ret = damagemult;
if (Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x101) // Dig
@@ -4188,13 +4189,13 @@ public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
///
/// Power is doubled if the target is using Bounce, Fly or Sky Drop. (Gust)
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_077 : PokeBattle_Move
{
public PokeBattle_Move_077() : base() { }
//public PokeBattle_Move_077(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x09C || // Fly
Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x108 || // Bounce
@@ -4210,13 +4211,13 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
///
/// Power is doubled if the target is using Bounce, Fly or Sky Drop. (Twister)
/// May make the target flinch.
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_078 : PokeBattle_Move
{
public PokeBattle_Move_078() : base() { }
//public PokeBattle_Move_078(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x09C || // Fly
Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x108 || // Bounce
@@ -4228,10 +4229,10 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
@@ -4242,7 +4243,7 @@ public partial class PokeBattle_Move_079 : PokeBattle_Move
{
public PokeBattle_Move_079() : base() { }
//public PokeBattle_Move_079(Battle battle, Attack.Move move) : base(battle, move) { }
- public int pbBaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
+ public int BaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
{
if (this.battle.field.FusionBolt)
{
@@ -4253,10 +4254,10 @@ public int pbBaseDamageMultiplier(int damagemult, IBattler attacker, IBattler op
return damagemult;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
this.doubled = false;
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
this.battle.field.FusionFlare = true;
@@ -4264,13 +4265,13 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
return ret;
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.damagestate.Critical || this.doubled)
{
- base.pbShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Charged anim;
+ base.ShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Charged anim;
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -4281,7 +4282,7 @@ public partial class PokeBattle_Move_07A : PokeBattle_Move
{
public PokeBattle_Move_07A() : base() { }
//public PokeBattle_Move_07A(Battle battle, Attack.Move move) : base(battle, move) { }
- public int pbBaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
+ public int BaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
{
if (battle.field.FusionFlare)
{
@@ -4291,10 +4292,10 @@ public int pbBaseDamageMultiplier(int damagemult, IBattler attacker, IBattler op
return damagemult;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
this.battle.field.FusionBolt = true;
@@ -4302,13 +4303,13 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
return ret;
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.damagestate.Critical || this.doubled)
{
- base.pbShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Charged anim;
+ base.ShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Charged anim;
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -4319,7 +4320,7 @@ public partial class PokeBattle_Move_07B : PokeBattle_Move
{
public PokeBattle_Move_07B() : base() { }
//public PokeBattle_Move_07B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (opponent.Status == Status.POISON &&
(opponent.effects.Substitute == 0 || ignoresSubstitute(attacker)))
@@ -4338,7 +4339,7 @@ public partial class PokeBattle_Move_07C : PokeBattle_Move
{
public PokeBattle_Move_07C() : base() { }
//public PokeBattle_Move_07C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (opponent.Status == Status.PARALYSIS &&
(opponent.effects.Substitute == 0 || ignoresSubstitute(attacker)))
@@ -4348,12 +4349,12 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!opponent.isFainted() && opponent.damagestate.CalcDamage > 0 &&
!opponent.damagestate.Substitute && opponent.Status == Status.PARALYSIS && opponent is IBattlerEffect b)
{
- b.pbCureStatus();
+ b.CureStatus();
}
}
@@ -4366,7 +4367,7 @@ public partial class PokeBattle_Move_07D : PokeBattle_Move
{
public PokeBattle_Move_07D() : base() { }
//public PokeBattle_Move_07D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (opponent.Status == Status.SLEEP &&
(opponent.effects.Substitute == 0 || ignoresSubstitute(attacker)))
@@ -4376,12 +4377,12 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!opponent.isFainted() && opponent.damagestate.CalcDamage > 0 &&
!opponent.damagestate.Substitute && opponent.Status == Status.SLEEP && opponent is IBattlerEffect b)
{
- b.pbCureStatus();
+ b.CureStatus();
}
}
@@ -4394,7 +4395,7 @@ public partial class PokeBattle_Move_07E : PokeBattle_Move
{
public PokeBattle_Move_07E() : base() { }
//public PokeBattle_Move_07E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (attacker.Status == Status.POISON ||
attacker.Status == Status.BURN ||
@@ -4413,7 +4414,7 @@ public partial class PokeBattle_Move_07F : PokeBattle_Move
{
public PokeBattle_Move_07F() : base() { }
//public PokeBattle_Move_07F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (opponent.Status > 0 &&
(opponent.effects.Substitute == 0 || ignoresSubstitute(attacker)))
@@ -4431,7 +4432,7 @@ public partial class PokeBattle_Move_080 : PokeBattle_Move
{
public PokeBattle_Move_080() : base() { }
//public PokeBattle_Move_080(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (opponent.HP <= opponent.TotalHP / 2)
{
@@ -4449,7 +4450,7 @@ public partial class PokeBattle_Move_081 : PokeBattle_Move
{
public PokeBattle_Move_081() : base() { }
//public PokeBattle_Move_081(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (attacker.lastHPLost > 0 && attacker.lastAttacker.Contains((int)opponent.Index))
{
@@ -4466,7 +4467,7 @@ public partial class PokeBattle_Move_082 : PokeBattle_Move
{
public PokeBattle_Move_082() : base() { }
//public PokeBattle_Move_082(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (opponent.tookDamage)
{
@@ -4484,11 +4485,11 @@ public partial class PokeBattle_Move_083 : PokeBattle_Move
{
public PokeBattle_Move_083() : base() { }
//public PokeBattle_Move_083(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int ret = basedmg;
- for (int i = 0; i <= attacker.pbOwnSide.Round; i++)
+ for (int i = 0; i <= attacker.OwnSide.Round; i++)
{
ret *= 2;
@@ -4497,21 +4498,21 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return ret;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- attacker.pbOwnSide.Round += 1;
- if (attacker.pbPartner.IsNotNullOrNone() && !attacker.pbPartner.hasMovedThisRound())
+ attacker.OwnSide.Round += 1;
+ if (attacker.Partner.IsNotNullOrNone() && !attacker.Partner.hasMovedThisRound())
{
- if ((int)this.battle.choices[attacker.pbPartner.Index].Action == 1) // Will use a move
+ if ((int)this.battle.choices[attacker.Partner.Index].Action == 1) // Will use a move
{
- IBattleMove partnermove = this.battle.choices[attacker.pbPartner.Index].Move;
+ IBattleMove partnermove = this.battle.choices[attacker.Partner.Index].Move;
if (partnermove.Effect == this.Effect)
{
- attacker.pbPartner.effects.MoveNext = true;
- attacker.pbPartner.effects.Quash = false;
+ attacker.Partner.effects.MoveNext = true;
+ attacker.Partner.effects.Quash = false;
}
}
}
@@ -4527,7 +4528,7 @@ public partial class PokeBattle_Move_084 : PokeBattle_Move
{
public PokeBattle_Move_084() : base() { }
//public PokeBattle_Move_084(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if ((int)this.battle.choices[opponent.Index].Action != 1 || // Didn't choose a move
opponent.hasMovedThisRound()) // Used a move already
@@ -4545,10 +4546,10 @@ public partial class PokeBattle_Move_085 : PokeBattle_Move
{
public PokeBattle_Move_085() : base() { }
//public PokeBattle_Move_085(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
- if (attacker.pbOwnSide.LastRoundFainted >= 0 &&
- attacker.pbOwnSide.LastRoundFainted == this.battle.turncount - 1)
+ if (attacker.OwnSide.LastRoundFainted >= 0 &&
+ attacker.OwnSide.LastRoundFainted == this.battle.turncount - 1)
{
return basedmg * 2;
}
@@ -4563,7 +4564,7 @@ public partial class PokeBattle_Move_086 : PokeBattle_Move
{
public PokeBattle_Move_086() : base() { }
//public PokeBattle_Move_086(Battle battle, Attack.Move move) : base(battle, move) { }
- public int pbBaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
+ public int BaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
{
if (attacker.Item == 0)
{
@@ -4580,20 +4581,20 @@ public partial class PokeBattle_Move_087 : PokeBattle_Move
{
public PokeBattle_Move_087() : base() { }
//public PokeBattle_Move_087(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
- if (this.battle.pbWeather != 0)
+ if (this.battle.Weather != 0)
{
return basedmg * 2;
}
return basedmg;
}
- public override Types pbModifyType(Types type, IBattler attacker, IBattler opponent)
+ public override Types ModifyType(Types type, IBattler attacker, IBattler opponent)
{
type = Types.NORMAL;
- switch (this.battle.pbWeather)
+ switch (this.battle.Weather)
{
case Weather.SUNNYDAY:
case Weather.HARSHSUN:
@@ -4617,13 +4618,13 @@ public override Types pbModifyType(Types type, IBattler attacker, IBattler oppon
///
/// Power is doubled if a foe tries to switch out or use U-turn/Volt Switch/
/// Parting Shot. (Pursuit)
- /// (Handled in Battle's pbAttackPhase): Makes this attack happen before switching.
+ /// (Handled in Battle's AttackPhase): Makes this attack happen before switching.
///
public partial class PokeBattle_Move_088 : PokeBattle_Move
{
public PokeBattle_Move_088() : base() { }
//public PokeBattle_Move_088(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (this.battle.switching)
{
@@ -4632,10 +4633,10 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override bool pbAccuracyCheck(IBattler attacker, IBattler opponent)
+ public override bool AccuracyCheck(IBattler attacker, IBattler opponent)
{
if (this.battle.switching) return true;
- return base.pbAccuracyCheck(attacker, opponent);
+ return base.AccuracyCheck(attacker, opponent);
}
}
@@ -4646,7 +4647,7 @@ public partial class PokeBattle_Move_089 : PokeBattle_Move
{
public PokeBattle_Move_089() : base() { }
//public PokeBattle_Move_089(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
return (int)Math.Max(Math.Floor(attacker.Happiness * 2 / 5f), 1);
}
@@ -4659,7 +4660,7 @@ public partial class PokeBattle_Move_08A : PokeBattle_Move
{
public PokeBattle_Move_08A() : base() { }
//public PokeBattle_Move_08A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
return (int)Math.Max(Math.Floor((255 - attacker.Happiness) * 2f / 5f), 1);
}
@@ -4672,7 +4673,7 @@ public partial class PokeBattle_Move_08B : PokeBattle_Move
{
public PokeBattle_Move_08B() : base() { }
//public PokeBattle_Move_08B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
return (int)Math.Max(Math.Floor(150f * attacker.HP / attacker.TotalHP), 1);
}
@@ -4685,7 +4686,7 @@ public partial class PokeBattle_Move_08C : PokeBattle_Move
{
public PokeBattle_Move_08C() : base() { }
//public PokeBattle_Move_08C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
return (int)Math.Max(Math.Floor(120f * opponent.HP / opponent.TotalHP), 1);
}
@@ -4698,7 +4699,7 @@ public partial class PokeBattle_Move_08D : PokeBattle_Move
{
public PokeBattle_Move_08D() : base() { }
//public PokeBattle_Move_08D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
return (int)Math.Max(Math.Min(Math.Floor(25f * opponent.SPE / attacker.SPE), 150), 1);
}
@@ -4712,7 +4713,7 @@ public partial class PokeBattle_Move_08E : PokeBattle_Move
{
public PokeBattle_Move_08E() : base() { }
//public PokeBattle_Move_08E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int mult = 1;
@@ -4733,7 +4734,7 @@ public partial class PokeBattle_Move_08F : PokeBattle_Move
{
public PokeBattle_Move_08F() : base() { }
//public PokeBattle_Move_08F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int mult = 3;
foreach (var i in new[] { Stats.ATTACK, Stats.DEFENSE, Stats.SPEED,
@@ -4752,22 +4753,22 @@ public partial class PokeBattle_Move_090 : PokeBattle_Move
{
public PokeBattle_Move_090() : base() { }
//public PokeBattle_Move_090(Battle battle, Attack.Move move) : base(battle, move) { }
- public override Types pbModifyType(Types type, IBattler attacker, IBattler opponent)
+ public override Types ModifyType(Types type, IBattler attacker, IBattler opponent)
{
- KeyValuePair hp = pbHiddenPower(attacker.IV);
+ KeyValuePair hp = HiddenPower(attacker.IV);
type = (Types)hp.Key;
return type;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (Core.USENEWBATTLEMECHANICS) return 60;
- KeyValuePair hp = pbHiddenPower(attacker.IV);
+ KeyValuePair hp = HiddenPower(attacker.IV);
return hp.Value;
}
- public static KeyValuePair pbHiddenPower(int[] iv) //ToDo: Move to another class?
+ public static KeyValuePair HiddenPower(int[] iv) //ToDo: Move to another class?
{
byte powermin = 30;
byte powermax = 70;
@@ -4775,8 +4776,8 @@ public static KeyValuePair pbHiddenPower(int[] iv) //ToDo: Move to an
List types = new List();
for (int i = 0; i < Kernal.TypeData.Count; i++)
{
- if (//!PBTypes.isPseudoType((Types)i) &&
- (Types)i != Types.NORMAL && (Types)i != Types.SHADOW) types.Add((Types)i);
+ if (//!Types.isPseudoType((Types)i) &&
+ (Types)i != Types.NORMAL && (Types)i != Types.SHADOW) types.Add((Types)i);
}
//Types[] types = Kernal.TypeData.Keys.ToArray();
type |= (iv[(int)Stats.HP] & 1);
@@ -4805,7 +4806,7 @@ public partial class PokeBattle_Move_091 : PokeBattle_Move
{
public PokeBattle_Move_091() : base() { }
//public PokeBattle_Move_091(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
basedmg = basedmg << (attacker.effects.FuryCutter - 1); // can be 1 to 4
@@ -4821,27 +4822,27 @@ public partial class PokeBattle_Move_092 : PokeBattle_Move
{
public PokeBattle_Move_092() : base() { }
//public PokeBattle_Move_092(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
- basedmg *= attacker.pbOwnSide.EchoedVoiceCounter; // can be 1 to 5
+ basedmg *= attacker.OwnSide.EchoedVoiceCounter; // can be 1 to 5
return basedmg;
}
}
///
/// User rages until the start of a round in which they don't use this move. (Rage)
- /// (Handled in Pokemon's pbProcessMoveAgainstTarget): Ups rager's Attack by 1
+ /// (Handled in Pokemon's ProcessMoveAgainstTarget): Ups rager's Attack by 1
/// stage each time it loses HP due to a move.
///
public partial class PokeBattle_Move_093 : PokeBattle_Move
{
public PokeBattle_Move_093() : base() { }
//public PokeBattle_Move_093(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = (int)base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = (int)base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (ret > 0) attacker.effects.Rage = true;
return ret;
@@ -4856,23 +4857,23 @@ public partial class PokeBattle_Move_094 : PokeBattle_Move
public bool forcedamage { get; set; }
public PokeBattle_Move_094() : base() { }
//public PokeBattle_Move_094(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
// Just to ensure that Parental Bond's second hit damages if the first hit does
this.forcedamage = false;
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
this.forcedamage = true;
return this.calcbasedmg;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
this.calcbasedmg = 1;
- byte r = (byte)this.battle.pbRandom((this.forcedamage) ? 8 : 10);
+ byte r = (byte)this.battle.Random((this.forcedamage) ? 8 : 10);
if (r < 4)
this.calcbasedmg = 40;
else if (r < 7)
@@ -4881,35 +4882,35 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
this.calcbasedmg = 120;
else
{
- if (pbTypeModifier(pbType(this.type, attacker, opponent), attacker, opponent) == 0)
+ if (TypeModifier(GetType(this.type, attacker, opponent), attacker, opponent) == 0)
{
- battle.pbDisplay(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
+ battle.Display(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
return -1;
}
if (opponent.HP == opponent.TotalHP)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- int damage = pbCalcDamage(attacker, opponent); // Consumes Gems even if it will heal
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Healing animation;
- opponent.pbRecoverHP((int)Math.Floor(opponent.TotalHP / 4f), true);
- battle.pbDisplay(Game._INTL("{1} had its HP restored.", opponent.ToString()));
+ int damage = CalcDamage(attacker, opponent); // Consumes Gems even if it will heal
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Healing animation;
+ opponent.RecoverHP((int)Math.Floor(opponent.TotalHP / 4f), true);
+ battle.Display(Game._INTL("{1} had its HP restored.", opponent.ToString()));
return 0;
}
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
///
/// Power is chosen at random. Power is doubled if the target is using Dig. (Magnitude)
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_095 : PokeBattle_Move
{
public PokeBattle_Move_095() : base() { }
//public PokeBattle_Move_095(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
byte[] basedmg = new byte[] { 10, 30, 50, 70, 90, 110, 150 };
@@ -4922,14 +4923,14 @@ public override bool pbOnStartUse(IBattler attacker)
9,9,
10
};
- byte magni = magnitudes[this.battle.pbRandom(magnitudes.Length)];
+ byte magni = magnitudes[this.battle.Random(magnitudes.Length)];
this.calcbasedmg = basedmg[magni - 4];
- battle.pbDisplay(Game._INTL("Magnitude {1}!", ((int)magni).ToString()));
+ battle.Display(Game._INTL("Magnitude {1}!", ((int)magni).ToString()));
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int ret = this.calcbasedmg;
@@ -4953,40 +4954,40 @@ public partial class PokeBattle_Move_096 : PokeBattle_Move
public Items berry { get; set; }
public PokeBattle_Move_096() : base() { }
//public PokeBattle_Move_096(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
- if (Game.GameData is IItemCheck i && !i.pbIsBerry(attacker.Item) ||
+ if (Game.GameData is IItemCheck i && !i.IsBerry(attacker.Item) ||
attacker.effects.Embargo > 0 ||
this.battle.field.MagicRoom > 0 ||
attacker.hasWorkingAbility(Abilities.KLUTZ) ||
- attacker.pbOpposing1.hasWorkingAbility(Abilities.UNNERVE) ||
- attacker.pbOpposing2.hasWorkingAbility(Abilities.UNNERVE))
+ attacker.Opposing1.hasWorkingAbility(Abilities.UNNERVE) ||
+ attacker.Opposing2.hasWorkingAbility(Abilities.UNNERVE))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return false;
}
this.berry = attacker.Item;
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
Dictionary damagearray = new Dictionary{
- //60 => [
+ //60 => [
{ Items.CHERI_BERRY, 60 }, { Items.CHESTO_BERRY, 60 }, { Items.PECHA_BERRY, 60 }, { Items.RAWST_BERRY, 60 }, { Items.ASPEAR_BERRY, 60 },
{ Items.LEPPA_BERRY, 60 }, { Items.ORAN_BERRY, 60 }, { Items.PERSIM_BERRY, 60 }, { Items.LUM_BERRY, 60 }, { Items.SITRUS_BERRY, 60 },
{ Items.FIGY_BERRY, 60 }, { Items.WIKI_BERRY, 60 }, { Items.MAGO_BERRY, 60 }, { Items.AGUAV_BERRY, 60 }, { Items.IAPAPA_BERRY, 60 },
{ Items.RAZZ_BERRY, 60 }, { Items.OCCA_BERRY, 60 }, { Items.PASSHO_BERRY, 60 }, { Items.WACAN_BERRY, 60 }, { Items.RINDO_BERRY, 60 },
{ Items.YACHE_BERRY, 60 }, { Items.CHOPLE_BERRY, 60 }, { Items.KEBIA_BERRY, 60 }, { Items.SHUCA_BERRY, 60 }, { Items.COBA_BERRY, 60 },
{ Items.PAYAPA_BERRY, 60 }, { Items.TANGA_BERRY, 60 }, { Items.CHARTI_BERRY, 60 }, { Items.KASIB_BERRY, 60 }, { Items.HABAN_BERRY, 60 },
- { Items.COLBUR_BERRY, 60 }, { Items.BABIRI_BERRY, 60 }, { Items.CHILAN_BERRY, 60 }, { Items.ROSELI_BERRY, 60 },
- //70 => [
+ { Items.COLBUR_BERRY, 60 }, { Items.BABIRI_BERRY, 60 }, { Items.CHILAN_BERRY, 60 }, { Items.ROSELI_BERRY, 60 },
+ //70 => [
{ Items.BLUK_BERRY, 70 }, { Items.NANAB_BERRY, 70 }, { Items.WEPEAR_BERRY, 70 }, { Items.PINAP_BERRY, 70 }, { Items.POMEG_BERRY, 70 },
{ Items.KELPSY_BERRY, 70 }, { Items.QUALOT_BERRY, 70 }, { Items.HONDEW_BERRY, 70 }, { Items.GREPA_BERRY, 70 }, { Items.TAMATO_BERRY, 70 },
{ Items.CORNN_BERRY, 70 }, { Items.MAGOST_BERRY, 70 }, { Items.RABUTA_BERRY, 70 }, { Items.NOMEL_BERRY, 70 }, { Items.SPELON_BERRY, 70 },
- { Items.PAMTRE_BERRY, 70 },
- //80 => [
+ { Items.PAMTRE_BERRY, 70 },
+ //80 => [
{ Items.WATMEL_BERRY, 80 }, { Items.DURIN_BERRY, 80 }, { Items.BELUE_BERRY, 80 }, { Items.LIECHI_BERRY, 80 }, { Items.GANLON_BERRY, 80 },
{ Items.SALAC_BERRY, 80 }, { Items.PETAYA_BERRY, 80 }, { Items.APICOT_BERRY, 80 }, { Items.LANSAT_BERRY, 80 }, { Items.STARF_BERRY, 80 },
{ Items.ENIGMA_BERRY, 80 }, { Items.MICLE_BERRY, 80 }, { Items.CUSTAP_BERRY, 80 }, { Items.JABOCA_BERRY, 80 }, { Items.ROWAP_BERRY, 80 },
@@ -4996,7 +4997,7 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
{
//byte data = damagearray[i];
//if (data != null){
- // foreach (var j in data){
+ // foreach (var j in data){
if (this.berry == i)
{
int ret = damagearray[i];
@@ -5010,53 +5011,53 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return 1;
}
- public override Types pbModifyType(Types type, IBattler attacker, IBattler opponent)
+ public override Types ModifyType(Types type, IBattler attacker, IBattler opponent)
{
type = Types.NORMAL;
Dictionary typearray = new Dictionary {
- //:NORMAL =>
- { Items.CHILAN_BERRY, Types.NORMAL },
- //:FIRE =>
- { Items.CHERI_BERRY, Types.FIRE }, { Items.BLUK_BERRY, Types.FIRE }, { Items.WATMEL_BERRY, Types.FIRE }, { Items.OCCA_BERRY, Types.FIRE },
- //:WATER =>
- { Items.CHESTO_BERRY, Types.WATER }, { Items.NANAB_BERRY, Types.WATER }, { Items.DURIN_BERRY, Types.WATER }, { Items.PASSHO_BERRY, Types.WATER },
- //:ELECTRIC =>
- { Items.PECHA_BERRY, Types.ELECTRIC }, { Items.WEPEAR_BERRY, Types.ELECTRIC }, { Items.BELUE_BERRY, Types.ELECTRIC }, { Items.WACAN_BERRY, Types.ELECTRIC },
- //:GRASS =>
- { Items.RAWST_BERRY, Types.GRASS }, { Items.PINAP_BERRY, Types.GRASS }, { Items.RINDO_BERRY, Types.GRASS }, { Items.LIECHI_BERRY, Types.GRASS },
- //:ICE =>
- { Items.ASPEAR_BERRY, Types.ICE }, { Items.POMEG_BERRY, Types.ICE }, { Items.YACHE_BERRY, Types.ICE }, { Items.GANLON_BERRY, Types.ICE },
- //:FIGHTING =>
- { Items.LEPPA_BERRY, Types.FIGHTING }, { Items.KELPSY_BERRY, Types.FIGHTING }, { Items.CHOPLE_BERRY, Types.FIGHTING }, { Items.SALAC_BERRY, Types.FIGHTING },
- //:POISON =>
- { Items.ORAN_BERRY, Types.POISON }, { Items.QUALOT_BERRY, Types.POISON }, { Items.KEBIA_BERRY, Types.POISON }, { Items.PETAYA_BERRY, Types.POISON },
- //:GROUND =>
- { Items.PERSIM_BERRY, Types.GROUND }, { Items.HONDEW_BERRY, Types.GROUND }, { Items.SHUCA_BERRY, Types.GROUND }, { Items.APICOT_BERRY, Types.GROUND },
- //:FLYING =>
- { Items.LUM_BERRY, Types.FLYING }, { Items.GREPA_BERRY, Types.FLYING }, { Items.COBA_BERRY, Types.FLYING }, { Items.LANSAT_BERRY, Types.FLYING },
- //:PSYCHIC=>
- { Items.SITRUS_BERRY, Types.PSYCHIC }, { Items.TAMATO_BERRY, Types.PSYCHIC }, { Items.PAYAPA_BERRY, Types.PSYCHIC }, { Items.STARF_BERRY, Types.PSYCHIC },
- //:BUG =>
- { Items.FIGY_BERRY, Types.BUG }, { Items.CORNN_BERRY, Types.BUG }, { Items.TANGA_BERRY, Types.BUG }, { Items.ENIGMA_BERRY, Types.BUG },
- //:ROCK =>
- { Items.WIKI_BERRY, Types.ROCK }, { Items.MAGOST_BERRY, Types.ROCK }, { Items.CHARTI_BERRY, Types.ROCK }, { Items.MICLE_BERRY, Types.ROCK },
- //:GHOST =>
- { Items.MAGO_BERRY, Types.GHOST }, { Items.RABUTA_BERRY, Types.GHOST }, { Items.KASIB_BERRY, Types.GHOST }, { Items.CUSTAP_BERRY, Types.GHOST },
- //:DRAGON =>
- { Items.AGUAV_BERRY, Types.DRAGON }, { Items.NOMEL_BERRY, Types.DRAGON }, { Items.HABAN_BERRY, Types.DRAGON }, { Items.JABOCA_BERRY, Types.DRAGON },
- //:DARK =>
- { Items.IAPAPA_BERRY, Types.DARK }, { Items.SPELON_BERRY, Types.DARK }, { Items.COLBUR_BERRY, Types.DARK }, { Items.ROWAP_BERRY, Types.DARK }, { Items.MARANGA_BERRY, Types.DARK },
- //:STEEL =>
- { Items.RAZZ_BERRY, Types.STEEL }, { Items.PAMTRE_BERRY, Types.STEEL }, { Items.BABIRI_BERRY, Types.STEEL },
- //:FAIRY =>
+ //:NORMAL =>
+ { Items.CHILAN_BERRY, Types.NORMAL },
+ //:FIRE =>
+ { Items.CHERI_BERRY, Types.FIRE }, { Items.BLUK_BERRY, Types.FIRE }, { Items.WATMEL_BERRY, Types.FIRE }, { Items.OCCA_BERRY, Types.FIRE },
+ //:WATER =>
+ { Items.CHESTO_BERRY, Types.WATER }, { Items.NANAB_BERRY, Types.WATER }, { Items.DURIN_BERRY, Types.WATER }, { Items.PASSHO_BERRY, Types.WATER },
+ //:ELECTRIC =>
+ { Items.PECHA_BERRY, Types.ELECTRIC }, { Items.WEPEAR_BERRY, Types.ELECTRIC }, { Items.BELUE_BERRY, Types.ELECTRIC }, { Items.WACAN_BERRY, Types.ELECTRIC },
+ //:GRASS =>
+ { Items.RAWST_BERRY, Types.GRASS }, { Items.PINAP_BERRY, Types.GRASS }, { Items.RINDO_BERRY, Types.GRASS }, { Items.LIECHI_BERRY, Types.GRASS },
+ //:ICE =>
+ { Items.ASPEAR_BERRY, Types.ICE }, { Items.POMEG_BERRY, Types.ICE }, { Items.YACHE_BERRY, Types.ICE }, { Items.GANLON_BERRY, Types.ICE },
+ //:FIGHTING =>
+ { Items.LEPPA_BERRY, Types.FIGHTING }, { Items.KELPSY_BERRY, Types.FIGHTING }, { Items.CHOPLE_BERRY, Types.FIGHTING }, { Items.SALAC_BERRY, Types.FIGHTING },
+ //:POISON =>
+ { Items.ORAN_BERRY, Types.POISON }, { Items.QUALOT_BERRY, Types.POISON }, { Items.KEBIA_BERRY, Types.POISON }, { Items.PETAYA_BERRY, Types.POISON },
+ //:GROUND =>
+ { Items.PERSIM_BERRY, Types.GROUND }, { Items.HONDEW_BERRY, Types.GROUND }, { Items.SHUCA_BERRY, Types.GROUND }, { Items.APICOT_BERRY, Types.GROUND },
+ //:FLYING =>
+ { Items.LUM_BERRY, Types.FLYING }, { Items.GREPA_BERRY, Types.FLYING }, { Items.COBA_BERRY, Types.FLYING }, { Items.LANSAT_BERRY, Types.FLYING },
+ //:PSYCHIC=>
+ { Items.SITRUS_BERRY, Types.PSYCHIC }, { Items.TAMATO_BERRY, Types.PSYCHIC }, { Items.PAYAPA_BERRY, Types.PSYCHIC }, { Items.STARF_BERRY, Types.PSYCHIC },
+ //:BUG =>
+ { Items.FIGY_BERRY, Types.BUG }, { Items.CORNN_BERRY, Types.BUG }, { Items.TANGA_BERRY, Types.BUG }, { Items.ENIGMA_BERRY, Types.BUG },
+ //:ROCK =>
+ { Items.WIKI_BERRY, Types.ROCK }, { Items.MAGOST_BERRY, Types.ROCK }, { Items.CHARTI_BERRY, Types.ROCK }, { Items.MICLE_BERRY, Types.ROCK },
+ //:GHOST =>
+ { Items.MAGO_BERRY, Types.GHOST }, { Items.RABUTA_BERRY, Types.GHOST }, { Items.KASIB_BERRY, Types.GHOST }, { Items.CUSTAP_BERRY, Types.GHOST },
+ //:DRAGON =>
+ { Items.AGUAV_BERRY, Types.DRAGON }, { Items.NOMEL_BERRY, Types.DRAGON }, { Items.HABAN_BERRY, Types.DRAGON }, { Items.JABOCA_BERRY, Types.DRAGON },
+ //:DARK =>
+ { Items.IAPAPA_BERRY, Types.DARK }, { Items.SPELON_BERRY, Types.DARK }, { Items.COLBUR_BERRY, Types.DARK }, { Items.ROWAP_BERRY, Types.DARK }, { Items.MARANGA_BERRY, Types.DARK },
+ //:STEEL =>
+ { Items.RAZZ_BERRY, Types.STEEL }, { Items.PAMTRE_BERRY, Types.STEEL }, { Items.BABIRI_BERRY, Types.STEEL },
+ //:FAIRY =>
{ Items.ROSELI_BERRY, Types.FAIRY }, { Items.KEE_BERRY, Types.FAIRY }
};
foreach (Items i in typearray.Keys)
{
//data = typearray[i];;
//if (data != null){
- // foreach (var j in data){
+ // foreach (var j in data){
if (this.berry == i)
{
type = typearray[i];//i;
@@ -5067,11 +5068,11 @@ public override Types pbModifyType(Types type, IBattler attacker, IBattler oppon
return type;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (turneffects.TotalDamage > 0)
{
- attacker.pbConsumeItem();
+ attacker.ConsumeItem();
}
}
}
@@ -5083,7 +5084,7 @@ public partial class PokeBattle_Move_097 : PokeBattle_Move
{
public PokeBattle_Move_097() : base() { }
//public PokeBattle_Move_097(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int[] dmgs = new int[] { 200, 80, 60, 50, 40 };
@@ -5100,7 +5101,7 @@ public partial class PokeBattle_Move_098 : PokeBattle_Move
{
public PokeBattle_Move_098() : base() { }
//public PokeBattle_Move_098(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
byte n = (byte)Math.Floor(48f * attacker.HP / attacker.TotalHP);
@@ -5121,7 +5122,7 @@ public partial class PokeBattle_Move_099 : PokeBattle_Move
{
public PokeBattle_Move_099() : base() { }
//public PokeBattle_Move_099(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int n = (int)Math.Floor(Math.Max(attacker.SPE, 1f) / Math.Max(opponent.SPE, 1f));
@@ -5140,7 +5141,7 @@ public partial class PokeBattle_Move_09A : PokeBattle_Move
{
public PokeBattle_Move_09A() : base() { }
//public PokeBattle_Move_09A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
float weight = opponent.Weight(attacker);
@@ -5161,7 +5162,7 @@ public partial class PokeBattle_Move_09B : PokeBattle_Move
{
public PokeBattle_Move_09B() : base() { }
//public PokeBattle_Move_09B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int n = (int)Math.Floor((float)attacker.Weight(attacker) / (float)opponent.Weight(attacker));
@@ -5181,20 +5182,20 @@ public partial class PokeBattle_Move_09C : PokeBattle_Move
{
public PokeBattle_Move_09C() : base() { }
//public PokeBattle_Move_09C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (!this.battle.doublebattle || opponent.isFainted() ||
(int)this.battle.choices[opponent.Index].Action != 1 || // Didn't choose a move;
opponent.hasMovedThisRound() ||
opponent.effects.HelpingHand)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.HelpingHand = true;
- battle.pbDisplay(Game._INTL("{1} is ready to help {2}!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1} is ready to help {2}!", attacker.ToString(), opponent.ToString(true)));
return 0;
}
}
@@ -5206,19 +5207,19 @@ public partial class PokeBattle_Move_09D : PokeBattle_Move
{
public PokeBattle_Move_09D() : base() { }
//public PokeBattle_Move_09D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (Core.USENEWBATTLEMECHANICS)
{
if (this.battle.field.MudSportField > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
this.battle.field.MudSportField = 5;
- battle.pbDisplay(Game._INTL("Electricity's power was weakened!"));
+ battle.Display(Game._INTL("Electricity's power was weakened!"));
return 0;
}
else
@@ -5227,15 +5228,15 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
if (attacker.battle.battlers[i].effects.MudSport)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
attacker.effects.MudSport = true;
- battle.pbDisplay(Game._INTL("Electricity's power was weakened!"));
+ battle.Display(Game._INTL("Electricity's power was weakened!"));
return 0;
}
return -1;
@@ -5249,19 +5250,19 @@ public partial class PokeBattle_Move_09E : PokeBattle_Move
{
public PokeBattle_Move_09E() : base() { }
//public PokeBattle_Move_09E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (Core.USENEWBATTLEMECHANICS)
{
if (this.battle.field.WaterSportField > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
this.battle.field.WaterSportField = 5;
- battle.pbDisplay(Game._INTL("Fire's power was weakened!"));
+ battle.Display(Game._INTL("Fire's power was weakened!"));
return 0;
}
else
@@ -5270,15 +5271,15 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
if (attacker.battle.battlers[i].effects.WaterSport)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
attacker.effects.WaterSport = true;
- battle.pbDisplay(Game._INTL("Fire's power was weakened!"));
+ battle.Display(Game._INTL("Fire's power was weakened!"));
return 0;
}
}
@@ -5291,7 +5292,7 @@ public partial class PokeBattle_Move_09F : PokeBattle_Move
{
public PokeBattle_Move_09F() : base() { }
//public PokeBattle_Move_09F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override Types pbModifyType(Types type, IBattler attacker, IBattler opponent)
+ public override Types ModifyType(Types type, IBattler attacker, IBattler opponent)
{
if (this.id == Moves.JUDGMENT)
{
@@ -5323,18 +5324,18 @@ public override Types pbModifyType(Types type, IBattler attacker, IBattler oppon
return (Types.NORMAL);
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (id == Moves.TECHNO_BLAST)
{
byte anim = 0;
- if (pbType(this.type, attacker, opponent) == Types.ELECTRIC) anim = 1;
- if (pbType(this.type, attacker, opponent) == Types.FIRE) anim = 2;
- if (pbType(this.type, attacker, opponent) == Types.ICE) anim = 3;
- if (pbType(this.type, attacker, opponent) == Types.WATER) anim = 4;
- base.pbShowAnimation(id, attacker, opponent, anim, alltargets, showanimation); // Type-specific anim
+ if (GetType(this.type, attacker, opponent) == Types.ELECTRIC) anim = 1;
+ if (GetType(this.type, attacker, opponent) == Types.FIRE) anim = 2;
+ if (GetType(this.type, attacker, opponent) == Types.ICE) anim = 3;
+ if (GetType(this.type, attacker, opponent) == Types.WATER) anim = 4;
+ base.ShowAnimation(id, attacker, opponent, anim, alltargets, showanimation); // Type-specific anim
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -5345,7 +5346,7 @@ public partial class PokeBattle_Move_0A0 : PokeBattle_Move
{
public PokeBattle_Move_0A0() : base() { }
//public PokeBattle_Move_0A0(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbCritialOverride(IBattler attacker, IBattler opponent)
+ public override bool CritialOverride(IBattler attacker, IBattler opponent)
{
return true;
}
@@ -5358,23 +5359,23 @@ public partial class PokeBattle_Move_0A1 : PokeBattle_Move
{
public PokeBattle_Move_0A1() : base() { }
//public PokeBattle_Move_0A1(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.LuckyChant > 0)
+ if (attacker.OwnSide.LuckyChant > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.LuckyChant = 5;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.LuckyChant = 5;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("The Lucky Chant shielded your team from critical hits!"));
+ battle.Display(Game._INTL("The Lucky Chant shielded your team from critical hits!"));
}
else
{
- battle.pbDisplay(Game._INTL("The Lucky Chant shielded the opposing team from critical hits!"));
+ battle.Display(Game._INTL("The Lucky Chant shielded the opposing team from critical hits!"));
}
return 0;
}
@@ -5387,24 +5388,24 @@ public partial class PokeBattle_Move_0A2 : PokeBattle_Move
{
public PokeBattle_Move_0A2() : base() { }
//public PokeBattle_Move_0A2(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.Reflect > 0)
+ if (attacker.OwnSide.Reflect > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.Reflect = 5;
- if (attacker.hasWorkingItem(Items.LIGHT_CLAY)) attacker.pbOwnSide.Reflect = 8;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.Reflect = 5;
+ if (attacker.hasWorkingItem(Items.LIGHT_CLAY)) attacker.OwnSide.Reflect = 8;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Reflect raised your team's Defense!"));
+ battle.Display(Game._INTL("Reflect raised your team's Defense!"));
}
else
{
- battle.pbDisplay(Game._INTL("Reflect raised the opposing team's Defense!"));
+ battle.Display(Game._INTL("Reflect raised the opposing team's Defense!"));
}
return 0;
}
@@ -5417,24 +5418,24 @@ public partial class PokeBattle_Move_0A3 : PokeBattle_Move
{
public PokeBattle_Move_0A3() : base() { }
//public PokeBattle_Move_0A3(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.LightScreen > 0)
+ if (attacker.OwnSide.LightScreen > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.LightScreen = 5;
- if (attacker.hasWorkingItem(Items.LIGHT_CLAY)) attacker.pbOwnSide.Reflect = 8;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.LightScreen = 5;
+ if (attacker.hasWorkingItem(Items.LIGHT_CLAY)) attacker.OwnSide.Reflect = 8;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Light Screen raised your team's Special Defense!"));
+ battle.Display(Game._INTL("Light Screen raised your team's Special Defense!"));
}
else
{
- battle.pbDisplay(Game._INTL("Light Screen raised the opposing team's Special Defense!"));
+ battle.Display(Game._INTL("Light Screen raised the opposing team's Special Defense!"));
}
return 0;
}
@@ -5447,30 +5448,30 @@ public partial class PokeBattle_Move_0A4 : PokeBattle_Move
{
public PokeBattle_Move_0A4() : base() { }
//public PokeBattle_Move_0A4(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
if (this.battle.field.ElectricTerrain > 0)
{
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
return;
}
else if (this.battle.field.GrassyTerrain > 0)
{
- if (opponent is IBattlerClause b && b.pbCanSleep(attacker, false, this))
+ if (opponent is IBattlerClause b && b.CanSleep(attacker, false, this))
{
- if (opponent is IBattlerEffect o) o.pbSleep();
+ if (opponent is IBattlerEffect o) o.Sleep();
}
return;
}
else if (this.battle.field.MistyTerrain > 0)
{
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPATK, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPATK, attacker, false, this))
{
- b.pbReduceStat(Stats.SPATK, 1, attacker, false, this);
+ b.ReduceStat(Stats.SPATK, 1, attacker, false, this);
}
return;
}
@@ -5480,43 +5481,43 @@ public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
case Environments.Grass:
case Environments.TallGrass:
case Environments.Forest:
- if (obe is IBattlerClause b && (b?.pbCanSleep(attacker, false, this)??false))
+ if (obe is IBattlerClause b && (b?.CanSleep(attacker, false, this)??false))
{
- obe.pbSleep();
+ obe.Sleep();
}
break;
case Environments.MovingWater:
case Environments.Underwater:
- if (obe?.pbCanReduceStatStage(Stats.ATTACK, attacker, false, this)??false)
+ if (obe?.CanReduceStatStage(Stats.ATTACK, attacker, false, this)??false)
{
- obe.pbReduceStat(Stats.ATTACK, 1, attacker, false, this);
+ obe.ReduceStat(Stats.ATTACK, 1, attacker, false, this);
}
break;
case Environments.StillWater:
case Environments.Sky:
- if (obe?.pbCanReduceStatStage(Stats.SPEED, attacker, false, this)??false)
+ if (obe?.CanReduceStatStage(Stats.SPEED, attacker, false, this)??false)
{
- obe.pbReduceStat(Stats.SPEED, 1, attacker, false, this);
+ obe.ReduceStat(Stats.SPEED, 1, attacker, false, this);
}
break;
case Environments.Sand:
- if (obe?.pbCanReduceStatStage(Stats.ACCURACY, attacker, false, this)??false)
+ if (obe?.CanReduceStatStage(Stats.ACCURACY, attacker, false, this)??false)
{
- obe.pbReduceStat(Stats.ACCURACY, 1, attacker, false, this);
+ obe.ReduceStat(Stats.ACCURACY, 1, attacker, false, this);
}
break;
case Environments.Rock:
if (Core.USENEWBATTLEMECHANICS)
{
- if (obe?.pbCanReduceStatStage(Stats.ACCURACY, attacker, false, this)??false)
+ if (obe?.CanReduceStatStage(Stats.ACCURACY, attacker, false, this)??false)
{
- obe.pbReduceStat(Stats.ACCURACY, 1, attacker, false, this);
+ obe.ReduceStat(Stats.ACCURACY, 1, attacker, false, this);
}
}
else
if (opponent.effects.Substitute == 0 || ignoresSubstitute(attacker))
{
- obe.pbFlinch(attacker);
+ obe.Flinch(attacker);
}
break;
case Environments.Cave:
@@ -5524,24 +5525,24 @@ public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
case Environments.Space:
if (opponent.effects.Substitute == 0 || ignoresSubstitute(attacker))
{
- obe.pbFlinch(attacker);
+ obe.Flinch(attacker);
}
break;
case Environments.Snow:
- if (obe is IBattlerClause obc && (obc?.pbCanFreeze(attacker, false, this)??false))
+ if (obe is IBattlerClause obc && (obc?.CanFreeze(attacker, false, this)??false))
{
- obe.pbFreeze();
+ obe.Freeze();
}
break;
case Environments.Volcano:
- if (obe?.pbCanBurn(attacker, false, this)??false)
+ if (obe?.CanBurn(attacker, false, this)??false)
{
- obe.pbBurn(attacker);
+ obe.Burn(attacker);
}
else
- if (obe?.pbCanParalyze(attacker, false, this)??false)
+ if (obe?.CanParalyze(attacker, false, this)??false)
{
- obe.pbParalyze(attacker);
+ obe.Paralyze(attacker);
}
break;
default:
@@ -5549,7 +5550,7 @@ public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
}
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
id = Moves.BODY_SLAM;
if (this.battle.field.ElectricTerrain > 0)
@@ -5581,7 +5582,7 @@ public override void pbShowAnimation(Moves id, IBattler attacker, IBattler oppon
default: break;
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation); // Environment-specific anim;
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation); // Environment-specific anim;
}
}
@@ -5592,7 +5593,7 @@ public partial class PokeBattle_Move_0A5 : PokeBattle_Move
{
public PokeBattle_Move_0A5() : base() { }
//public PokeBattle_Move_0A5(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbAccuracyCheck(IBattler attacker, IBattler opponent)
+ public override bool AccuracyCheck(IBattler attacker, IBattler opponent)
{
return true;
}
@@ -5605,18 +5606,18 @@ public partial class PokeBattle_Move_0A6 : PokeBattle_Move
{
public PokeBattle_Move_0A6() : base() { }
//public PokeBattle_Move_0A6(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.LockOn = 2;
opponent.effects.LockOnPos = attacker.Index;
- battle.pbDisplay(Game._INTL("{1} took aim at {2}!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1} took aim at {2}!", attacker.ToString(), opponent.ToString(true)));
return 0;
}
}
@@ -5629,17 +5630,17 @@ public partial class PokeBattle_Move_0A7 : PokeBattle_Move
{
public PokeBattle_Move_0A7() : base() { }
//public PokeBattle_Move_0A7(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Foresight = true;
- battle.pbDisplay(Game._INTL("{1} was identified!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was identified!", opponent.ToString()));
return 0;
}
}
@@ -5652,17 +5653,17 @@ public partial class PokeBattle_Move_0A8 : PokeBattle_Move
{
public PokeBattle_Move_0A8() : base() { }
//public PokeBattle_Move_0A8(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent.pbOwnSide.CraftyShield)
+ if (opponent.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.MiracleEye = true;
- battle.pbDisplay(Game._INTL("{1} was identified!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was identified!", opponent.ToString()));
return 0;
}
}
@@ -5675,7 +5676,7 @@ public partial class PokeBattle_Move_0A9 : PokeBattle_Move
{
public PokeBattle_Move_0A9() : base() { }
//public PokeBattle_Move_0A9(Battle battle, Attack.Move move) : base(battle, move) { }
- // Handled in superclass public bool pbAccuracyCheck and public object pbCalcDamage, do not edit!
+ // Handled in superclass public bool AccuracyCheck and public object CalcDamage, do not edit!
}
///
@@ -5685,7 +5686,7 @@ public partial class PokeBattle_Move_0AA : PokeBattle_Move
{
public PokeBattle_Move_0AA() : base() { }
//public PokeBattle_Move_0AA(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List ratesharers = new List {
Attack.Data.Effects.x070, // Detect, Protect
@@ -5710,18 +5711,18 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
}
if (!unmoved ||
- this.battle.pbRandom(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate))
+ this.battle.Random(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate))
{
attacker.effects.ProtectRate = 1;
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.Protect = true;
attacker.effects.ProtectRate *= 2;
- battle.pbDisplay(Game._INTL("{1} protected itself!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} protected itself!", attacker.ToString()));
return 0;
}
}
@@ -5734,11 +5735,11 @@ public partial class PokeBattle_Move_0AB : PokeBattle_Move
{
public PokeBattle_Move_0AB() : base() { }
//public PokeBattle_Move_0AB(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.QuickGuard)
+ if (attacker.OwnSide.QuickGuard)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
List ratesharers = new List {
@@ -5765,23 +5766,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!unmoved ||
(!Core.USENEWBATTLEMECHANICS &&
- this.battle.pbRandom(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate)))
+ this.battle.Random(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate)))
{
attacker.effects.ProtectRate = 1;
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.QuickGuard = true;
+ attacker.OwnSide.QuickGuard = true;
attacker.effects.ProtectRate *= 2;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Quick Guard protected your team!"));
+ battle.Display(Game._INTL("Quick Guard protected your team!"));
}
else
{
- battle.pbDisplay(Game._INTL("Quick Guard protected the opposing team!"));
+ battle.Display(Game._INTL("Quick Guard protected the opposing team!"));
}
return 0;
}
@@ -5795,11 +5796,11 @@ public partial class PokeBattle_Move_0AC : PokeBattle_Move
{
public PokeBattle_Move_0AC() : base() { }
//public PokeBattle_Move_0AC(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.WideGuard)
+ if (attacker.OwnSide.WideGuard)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
List ratesharers = new List {
@@ -5826,23 +5827,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!unmoved ||
(!Core.USENEWBATTLEMECHANICS &&
- this.battle.pbRandom(65536) >= (int)Math.Floor(65536f / attacker.effects.ProtectRate)))
+ this.battle.Random(65536) >= (int)Math.Floor(65536f / attacker.effects.ProtectRate)))
{
attacker.effects.ProtectRate = 1;
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.WideGuard = true;
+ attacker.OwnSide.WideGuard = true;
attacker.effects.ProtectRate *= 2;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Wide Guard protected your team!"));
+ battle.Display(Game._INTL("Wide Guard protected your team!"));
}
else
{
- battle.pbDisplay(Game._INTL("Wide Guard protected the opposing team!"));
+ battle.Display(Game._INTL("Wide Guard protected the opposing team!"));
}
return 0;
}
@@ -5856,13 +5857,13 @@ public partial class PokeBattle_Move_0AD : PokeBattle_Move
{
public PokeBattle_Move_0AD() : base() { }
//public PokeBattle_Move_0AD(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = (int)base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = (int)base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (ret > 0)
{
opponent.effects.ProtectNegation = true;
- opponent.pbOwnSide.CraftyShield = false;
+ opponent.OwnSide.CraftyShield = false;
}
return ret;
}
@@ -5875,16 +5876,16 @@ public partial class PokeBattle_Move_0AE : PokeBattle_Move
{
public PokeBattle_Move_0AE() : base() { }
//public PokeBattle_Move_0AE(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.lastMoveUsed <= 0 || //(
!Kernal.MoveData[(Moves)attacker.lastMoveUsed].Flags.Mirror //& 0x10)==0
) // flag e: Copyable by Mirror Move
{
- battle.pbDisplay(Game._INTL("The mirror move failed!"));
+ battle.Display(Game._INTL("The mirror move failed!"));
return -1;
}
- attacker.pbUseMoveSimple(opponent.lastMoveUsed, -1, opponent.Index);
+ attacker.UseMoveSimple(opponent.lastMoveUsed, -1, opponent.Index);
return 0;
}
}
@@ -5896,7 +5897,7 @@ public partial class PokeBattle_Move_0AF : PokeBattle_Move
{
public PokeBattle_Move_0AF() : base() { }
//public PokeBattle_Move_0AF(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List {
Attack.Data.Effects.x0FF, // Struggle
@@ -5944,10 +5945,10 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (this.battle.lastMoveUsed <= 0 ||
blacklist.Contains(Kernal.MoveData[(Moves)attacker.lastMoveUsed].Effect))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- attacker.pbUseMoveSimple(this.battle.lastMoveUsed);
+ attacker.UseMoveSimple(this.battle.lastMoveUsed);
return 0;
}
}
@@ -5959,7 +5960,7 @@ public partial class PokeBattle_Move_0B0 : PokeBattle_Move
{
public PokeBattle_Move_0B0() : base() { }
//public PokeBattle_Move_0B0(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List {
Attack.Data.Effects.x0FF, // Struggle
@@ -5976,15 +5977,15 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if ((int)this.battle.choices[opponent.Index].Action != 1 || // Didn't choose a move
opponent.hasMovedThisRound() ||
oppmove.id == Moves.NONE || oppmove.id <= 0 ||
- oppmove.pbIsStatus ||
+ oppmove.IsStatus ||
blacklist.Contains(oppmove.Effect))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
attacker.effects.MeFirst = true;
- attacker.pbUseMoveSimple(oppmove.id);
+ attacker.UseMoveSimple(oppmove.id);
attacker.effects.MeFirst = false;
return 0;
}
@@ -5998,12 +5999,12 @@ public partial class PokeBattle_Move_0B1 : PokeBattle_Move
{
public PokeBattle_Move_0B1() : base() { }
//public PokeBattle_Move_0B1(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.MagicCoat = true;
- battle.pbDisplay(Game._INTL("{1} shrouded itself with Magic Coat!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} shrouded itself with Magic Coat!", attacker.ToString()));
return 0;
}
}
@@ -6015,12 +6016,12 @@ public partial class PokeBattle_Move_0B2 : PokeBattle_Move
{
public PokeBattle_Move_0B2() : base() { }
//public PokeBattle_Move_0B2(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.Snatch = true;
- battle.pbDisplay(Game._INTL("{1} waits for a target to make a move!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} waits for a target to make a move!", attacker.ToString()));
return 0;
}
}
@@ -6032,7 +6033,7 @@ public partial class PokeBattle_Move_0B3 : PokeBattle_Move
{
public PokeBattle_Move_0B3() : base() { }
//public PokeBattle_Move_0B3(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
Moves move = Moves.TRI_ATTACK;
switch (this.battle.environment)
@@ -6077,15 +6078,15 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (move == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
string thismovename = Name;
string movename = Game._INTL(move.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} turned into {2}!", thismovename, movename));
+ battle.Display(Game._INTL("{1} turned into {2}!", thismovename, movename));
int target = (Core.USENEWBATTLEMECHANICS && opponent.IsNotNullOrNone()) ? opponent.Index : -1;
- attacker.pbUseMoveSimple(move, -1, target);
+ attacker.UseMoveSimple(move, -1, target);
return 0;
}
}
@@ -6097,16 +6098,16 @@ public partial class PokeBattle_Move_0B4 : PokeBattle_Move
{
public PokeBattle_Move_0B4() : base() { }
//public PokeBattle_Move_0B4(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbCanUseWhileAsleep()
+ public override bool CanUseWhileAsleep()
{
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Status != Status.SLEEP)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
List blacklist = new List {
@@ -6148,17 +6149,17 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (attacker.moves[i].id == 0) continue; //next
if (blacklist.Contains(attacker.moves[i].Effect)) found = true;
if (found) continue; //next
- if (this.battle.pbCanChooseMove(attacker.Index, i, false, true)) choices.Add(i);
+ if (this.battle.CanChooseMove(attacker.Index, i, false, true)) choices.Add(i);
}
if (choices.Count == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- int choice = choices[this.battle.pbRandom(choices.Count)];
- attacker.pbUseMoveSimple(attacker.moves[choice].id, -1, attacker.pbOppositeOpposing.Index);
+ int choice = choices[this.battle.Random(choices.Count)];
+ attacker.UseMoveSimple(attacker.moves[choice].id, -1, attacker.OppositeOpposing.Index);
return 0;
}
}
@@ -6170,7 +6171,7 @@ public partial class PokeBattle_Move_0B5 : PokeBattle_Move
{
public PokeBattle_Move_0B5() : base() { }
//public PokeBattle_Move_0B5(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List {
Attack.Data.Effects.x0FF, // Struggle
@@ -6230,7 +6231,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
List moves = new List();
- IPokemon[] party = this.battle.pbParty(attacker.Index); // NOTE: pbParty is common to both allies in multi battles
+ IPokemon[] party = this.battle.Party(attacker.Index); // NOTE: Party is common to both allies in multi battles
for (int i = 0; i < party.Length; i++)
{
if (i != attacker.pokemonIndex && party[i].IsNotNullOrNone() && !(Core.USENEWBATTLEMECHANICS && party[i].isEgg))
@@ -6247,13 +6248,13 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (moves.Count == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- Moves move = moves[this.battle.pbRandom(moves.Count)];
- attacker.pbUseMoveSimple(move);
+ Moves move = moves[this.battle.Random(moves.Count)];
+ attacker.UseMoveSimple(move);
return 0;
}
}
@@ -6265,7 +6266,7 @@ public partial class PokeBattle_Move_0B6 : PokeBattle_Move
{
public PokeBattle_Move_0B6() : base() { }
//public PokeBattle_Move_0B6(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List {
Attack.Data.Effects.x0FF, // Struggle
@@ -6312,7 +6313,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
};
for (int i = 0; i < 1000; i++) //loop do break unless i<1000
{
- Moves move = (Moves)(this.battle.pbRandom(Kernal.MoveData.Keys.Count) + 1);
+ Moves move = (Moves)(this.battle.Random(Kernal.MoveData.Keys.Count) + 1);
if (Kernal.MoveData[(Moves)move].Type == Types.SHADOW) continue; //next
bool found = false;
if (blacklist.Contains(Kernal.MoveData[(Moves)move].Effect))
@@ -6331,14 +6332,14 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!found)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbUseMoveSimple(move);
+ attacker.UseMoveSimple(move);
return 0;
}
i += 1;
}
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
@@ -6350,34 +6351,34 @@ public partial class PokeBattle_Move_0B7 : PokeBattle_Move
{
public PokeBattle_Move_0B7() : base() { }
//public PokeBattle_Move_0B7(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Torment)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (!attacker.hasMoldBreaker())
{
if (opponent.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
opponent.ToString(),Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
- else if (opponent.pbPartner.hasWorkingAbility(Abilities.AROMA_VEIL))
+ else if (opponent.Partner.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
- opponent.pbPartner.ToString(),Game._INTL(opponent.pbPartner.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
+ opponent.Partner.ToString(),Game._INTL(opponent.Partner.Ability.ToString(TextScripts.Name))));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Torment = true;
- battle.pbDisplay(Game._INTL("{1} was subjected to torment!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was subjected to torment!", opponent.ToString()));
return 0;
}
}
@@ -6389,17 +6390,17 @@ public partial class PokeBattle_Move_0B8 : PokeBattle_Move
{
public PokeBattle_Move_0B8() : base() { }
//public PokeBattle_Move_0B8(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Imprison)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
attacker.effects.Imprison = true;
- battle.pbDisplay(Game._INTL("{1} sealed the opponent's move(s)!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} sealed the opponent's move(s)!", attacker.ToString()));
return 0;
}
}
@@ -6411,26 +6412,26 @@ public partial class PokeBattle_Move_0B9 : PokeBattle_Move
{
public PokeBattle_Move_0B9() : base() { }
//public PokeBattle_Move_0B9(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Disable > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (!attacker.hasMoldBreaker())
{
if (opponent.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
opponent.ToString(),Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
- else if (opponent.pbPartner.hasWorkingAbility(Abilities.AROMA_VEIL))
+ else if (opponent.Partner.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
- opponent.pbPartner.ToString(),Game._INTL(opponent.pbPartner.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
+ opponent.Partner.ToString(),Game._INTL(opponent.Partner.Ability.ToString(TextScripts.Name))));
return -1;
}
}
@@ -6438,16 +6439,16 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
if (i.id > 0 && i.id == opponent.lastMoveUsed && (i.PP > 0 || i.TotalPP == 0))
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Disable = 5;
opponent.effects.DisableMove = opponent.lastMoveUsed;
- battle.pbDisplay(Game._INTL("{1}'s {2} was disabled!", opponent.ToString(), Kernal.MoveData[(Moves)i.id].Name));
+ battle.Display(Game._INTL("{1}'s {2} was disabled!", opponent.ToString(), Kernal.MoveData[(Moves)i.id].Name));
return 0;
}
}
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
@@ -6459,36 +6460,36 @@ public partial class PokeBattle_Move_0BA : PokeBattle_Move
{
public PokeBattle_Move_0BA() : base() { }
//public PokeBattle_Move_0BA(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Taunt > 0 ||
(Core.USENEWBATTLEMECHANICS &&
!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.OBLIVIOUS)))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (!attacker.hasMoldBreaker())
{
if (opponent.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
opponent.ToString(),Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
- else if (opponent.pbPartner.hasWorkingAbility(Abilities.AROMA_VEIL))
+ else if (opponent.Partner.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
- opponent.pbPartner.ToString(),Game._INTL(opponent.pbPartner.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
+ opponent.Partner.ToString(),Game._INTL(opponent.Partner.Ability.ToString(TextScripts.Name))));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Taunt = 4;
- battle.pbDisplay(Game._INTL("{1} fell for the taunt!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} fell for the taunt!", opponent.ToString()));
return 0;
}
}
@@ -6500,34 +6501,34 @@ public partial class PokeBattle_Move_0BB : PokeBattle_Move
{
public PokeBattle_Move_0BB() : base() { }
//public PokeBattle_Move_0BB(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.HealBlock > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (!attacker.hasMoldBreaker())
{
if (opponent.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
opponent.ToString(),Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
- else if (opponent.pbPartner.hasWorkingAbility(Abilities.AROMA_VEIL))
+ else if (opponent.Partner.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
- opponent.pbPartner.ToString(),Game._INTL(opponent.pbPartner.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
+ opponent.Partner.ToString(),Game._INTL(opponent.Partner.Ability.ToString(TextScripts.Name))));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.HealBlock = 5;
- battle.pbDisplay(Game._INTL("{1} was prevented from healing!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was prevented from healing!", opponent.ToString()));
return 0;
}
}
@@ -6539,7 +6540,7 @@ public partial class PokeBattle_Move_0BC : PokeBattle_Move
{
public PokeBattle_Move_0BC() : base() { }
//public PokeBattle_Move_0BC(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List blacklist = new List {
Attack.Data.Effects.x0FF, // Struggle
@@ -6551,28 +6552,28 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
};
if (opponent.effects.Encore > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (opponent.lastMoveUsed <= 0 ||
blacklist.Contains(Kernal.MoveData[(Moves)opponent.lastMoveUsed].Effect))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (!attacker.hasMoldBreaker())
{
if (opponent.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
opponent.ToString(),Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
- else if (opponent.pbPartner.hasWorkingAbility(Abilities.AROMA_VEIL))
+ else if (opponent.Partner.hasWorkingAbility(Abilities.AROMA_VEIL))
{
- battle.pbDisplay(Game._INTL("But it failed because of {1}'s {2}!",
- opponent.pbPartner.ToString(),Game._INTL(opponent.pbPartner.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("But it failed because of {1}'s {2}!",
+ opponent.Partner.ToString(),Game._INTL(opponent.Partner.Ability.ToString(TextScripts.Name))));
return -1;
}
}
@@ -6581,18 +6582,18 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (opponent.lastMoveUsed == opponent.moves[i].id &&
(opponent.moves[i].PP > 0 || opponent.moves[i].TotalPP == 0))
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Encore = 4;
opponent.effects.EncoreIndex = i;
opponent.effects.EncoreMove = opponent.moves[i].id;
- battle.pbDisplay(Game._INTL("{1} received an encore!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} received an encore!", opponent.ToString()));
return 0;
}
}
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
@@ -6604,12 +6605,12 @@ public partial class PokeBattle_Move_0BD : PokeBattle_Move
{
public PokeBattle_Move_0BD() : base() { }
//public PokeBattle_Move_0BD(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbIsMultiHit()
+ public override bool IsMultiHit()
{
return true;
}
- public override int pbNumHits(IBattler attacker)
+ public override int NumHits(IBattler attacker)
{
return 2;
}
@@ -6622,22 +6623,22 @@ public partial class PokeBattle_Move_0BE : PokeBattle_Move
{
public PokeBattle_Move_0BE() : base() { }
//public PokeBattle_Move_0BE(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbIsMultiHit()
+ public override bool IsMultiHit()
{
return true;
}
- public override int pbNumHits(IBattler attacker)
+ public override int NumHits(IBattler attacker)
{
return 2;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanPoison(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanPoison(attacker, false, this))
{
- b.pbPoison(attacker);
+ b.Poison(attacker);
}
}
}
@@ -6651,12 +6652,12 @@ public partial class PokeBattle_Move_0BF : PokeBattle_Move
public bool checks { get; set; }
public PokeBattle_Move_0BF() : base() { }
//public PokeBattle_Move_0BF(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbIsMultiHit()
+ public override bool IsMultiHit()
{
return true;
}
- public override int pbNumHits(IBattler attacker)
+ public override int NumHits(IBattler attacker)
{
return 3;
}
@@ -6666,14 +6667,14 @@ public override bool successCheckPerHit()
return this.checks;
}
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
this.calcbasedmg = base.Power;
this.checks = !attacker.hasWorkingAbility(Abilities.SKILL_LINK);
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
int ret = this.calcbasedmg;
this.calcbasedmg += basedmg;
@@ -6688,16 +6689,16 @@ public partial class PokeBattle_Move_0C0 : PokeBattle_Move
{
public PokeBattle_Move_0C0() : base() { }
//public PokeBattle_Move_0C0(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbIsMultiHit()
+ public override bool IsMultiHit()
{
return true;
}
- public override int pbNumHits(IBattler attacker)
+ public override int NumHits(IBattler attacker)
{
int[] hitchances = new int[] { 2, 2, 3, 3, 4, 5 };
- int ret = hitchances[this.battle.pbRandom(hitchances.Length)];
+ int ret = hitchances[this.battle.Random(hitchances.Length)];
if (attacker.hasWorkingAbility(Abilities.SKILL_LINK)) ret = 5;
return ret;
}
@@ -6714,20 +6715,20 @@ public partial class PokeBattle_Move_0C1 : PokeBattle_Move
public List participants { get; set; }
public PokeBattle_Move_0C1() : base() { }
//public PokeBattle_Move_0C1(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbIsMultiHit()
+ public override bool IsMultiHit()
{
return true;
}
- public override int pbNumHits(IBattler attacker)
+ public override int NumHits(IBattler attacker)
{
return this.participants.Count;
}
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
- IPokemon[] party = this.battle.pbParty(attacker.Index);
+ IPokemon[] party = this.battle.Party(attacker.Index);
this.participants = new List();
for (byte i = 0; i < party.Length; i++)
{
@@ -6744,16 +6745,16 @@ public override bool pbOnStartUse(IBattler attacker)
}
if (this.participants.Count == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return false;
}
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
- IPokemon[] party = this.battle.pbParty(attacker.Index);
+ IPokemon[] party = this.battle.Party(attacker.Index);
int atk = party[this.participants[0]].baseStats[1];
this.participants.RemoveAt(0);//[0]=null; //this.participants.compact!;
@@ -6768,9 +6769,9 @@ public partial class PokeBattle_Move_0C2 : PokeBattle_Move
{
public PokeBattle_Move_0C2() : base() { }
//public PokeBattle_Move_0C2(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
attacker.effects.HyperBeam = 2;
@@ -6787,7 +6788,7 @@ public partial class PokeBattle_Move_0C3 : PokeBattle_Move
{
public PokeBattle_Move_0C3() : base() { }
//public PokeBattle_Move_0C3(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -6798,22 +6799,22 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim;
- battle.pbDisplay(Game._INTL("{1} whipped up a whirlwind!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim;
+ battle.Display(Game._INTL("{1} whipped up a whirlwind!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -6826,13 +6827,13 @@ public partial class PokeBattle_Move_0C4 : PokeBattle_Move
public bool sunny { get; set; }
public PokeBattle_Move_0C4() : base() { }
//public PokeBattle_Move_0C4(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false; this.sunny = false;
if (attacker.effects.TwoTurnAttack == 0)
{
- if (this.battle.pbWeather == Weather.SUNNYDAY ||
- this.battle.pbWeather == Weather.HARSHSUN)
+ if (this.battle.Weather == Weather.SUNNYDAY ||
+ this.battle.Weather == Weather.HARSHSUN)
{
this.immediate = true; this.sunny = true;
}
@@ -6845,33 +6846,33 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public int pbBaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
+ public int BaseDamageMultiplier(int damagemult, IBattler attacker, IBattler opponent)
{
- if (this.battle.pbWeather != 0 &&
- this.battle.pbWeather != Weather.SUNNYDAY &&
- this.battle.pbWeather != Weather.HARSHSUN)
+ if (this.battle.Weather != 0 &&
+ this.battle.Weather != Weather.SUNNYDAY &&
+ this.battle.Weather != Weather.HARSHSUN)
{
return (int)Math.Round(damagemult * 0.5f);
}
return damagemult;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} took in sunlight!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} took in sunlight!", attacker.ToString()));
}
if (this.immediate && !this.sunny)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -6883,7 +6884,7 @@ public partial class PokeBattle_Move_0C5 : PokeBattle_Move
{
public PokeBattle_Move_0C5() : base() { }
//public PokeBattle_Move_0C5(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -6894,30 +6895,30 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} became cloaked in a freezing light!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} became cloaked in a freezing light!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
}
}
@@ -6930,7 +6931,7 @@ public partial class PokeBattle_Move_0C6 : PokeBattle_Move
{
public PokeBattle_Move_0C6() : base() { }
//public PokeBattle_Move_0C6(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -6941,30 +6942,30 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} became cloaked in freezing air!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} became cloaked in freezing air!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanBurn(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanBurn(attacker, false, this))
{
- b.pbBurn(attacker);
+ b.Burn(attacker);
}
}
}
@@ -6977,7 +6978,7 @@ public partial class PokeBattle_Move_0C7 : PokeBattle_Move
{
public PokeBattle_Move_0C7() : base() { }
//public PokeBattle_Move_0C7(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -6988,28 +6989,28 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} became cloaked in a harsh light!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} became cloaked in a harsh light!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
}
@@ -7021,7 +7022,7 @@ public partial class PokeBattle_Move_0C8 : PokeBattle_Move
{
public PokeBattle_Move_0C8() : base() { }
//public PokeBattle_Move_0C8(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -7032,32 +7033,32 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} tucked in its head!", attacker.ToString()));
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} tucked in its head!", attacker.ToString()));
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
+ b.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this);
}
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
///
/// Two turn attack. Skips first turn, attacks second turn. (Fly)
- /// (Handled in Pokemon's pbSuccessCheck): Is semi-invulnerable during use.
+ /// (Handled in Pokemon's SuccessCheck): Is semi-invulnerable during use.
///
public partial class PokeBattle_Move_0C9 : PokeBattle_Move
{
@@ -7068,7 +7069,7 @@ public override bool UnusableInGravity()
return true;
}
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -7079,34 +7080,34 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} flew up high!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} flew up high!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
///
/// Two turn attack. Skips first turn, attacks second turn. (Dig)
- /// (Handled in Pokemon's pbSuccessCheck): Is semi-invulnerable during use.
+ /// (Handled in Pokemon's SuccessCheck): Is semi-invulnerable during use.
///
public partial class PokeBattle_Move_0CA : PokeBattle_Move
{
public PokeBattle_Move_0CA() : base() { }
//public PokeBattle_Move_0CA(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -7117,34 +7118,34 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} burrowed its way under the ground!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} burrowed its way under the ground!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
///
/// Two turn attack. Skips first turn, attacks second turn. (Dive)
- /// (Handled in Pokemon's pbSuccessCheck): Is semi-invulnerable during use.
+ /// (Handled in Pokemon's SuccessCheck): Is semi-invulnerable during use.
///
public partial class PokeBattle_Move_0CB : PokeBattle_Move
{
public PokeBattle_Move_0CB() : base() { }
//public PokeBattle_Move_0CB(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -7155,29 +7156,29 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} hid underwater!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} hid underwater!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
///
/// Two turn attack. Skips first turn, attacks second turn. (Bounce)
/// May paralyze the target.
- /// (Handled in Pokemon's pbSuccessCheck): Is semi-invulnerable during use.
+ /// (Handled in Pokemon's SuccessCheck): Is semi-invulnerable during use.
///
public partial class PokeBattle_Move_0CC : PokeBattle_Move
{
@@ -7188,7 +7189,7 @@ public override bool UnusableInGravity()
return true;
}
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -7199,30 +7200,30 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} sprang up!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} sprang up!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
}
}
@@ -7237,7 +7238,7 @@ public partial class PokeBattle_Move_0CD : PokeBattle_Move
{
public PokeBattle_Move_0CD() : base() { }
//public PokeBattle_Move_0CD(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -7248,26 +7249,26 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} vanished instantly!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} vanished instantly!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- int ret = (int)base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = (int)base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (ret > 0)
{
opponent.effects.ProtectNegation = true;
- opponent.pbOwnSide.CraftyShield = false;
+ opponent.OwnSide.CraftyShield = false;
}
return ret;
}
@@ -7275,7 +7276,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
///
/// Two turn attack. Skips first turn, attacks second turn. (Sky Drop)
- /// (Handled in Pokemon's pbSuccessCheck): Is semi-invulnerable during use.
+ /// (Handled in Pokemon's SuccessCheck): Is semi-invulnerable during use.
/// Target is also semi-invulnerable during use, and can't take any action.
/// Doesn't damage airborne Pokémon (but still makes them unable to move during).
///
@@ -7288,45 +7289,45 @@ public override bool UnusableInGravity()
return true;
}
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
bool ret = false;
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker)) ret = true;
if (opponent.effects.TwoTurnAttack > 0) ret = true;
if (opponent.effects.SkyDrop && attacker.effects.TwoTurnAttack > 0) ret = true;
- if (!opponent.pbIsOpposing(attacker.Index)) ret = true;
+ if (!opponent.IsOpposing(attacker.Index)) ret = true;
if (Core.USENEWBATTLEMECHANICS && opponent.Weight(attacker) >= 2000) ret = true;
return ret;
}
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim;
- battle.pbDisplay(Game._INTL("{1} took {2} into the sky!", attacker.ToString(), opponent.ToString(true)));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim;
+ battle.Display(Game._INTL("{1} took {2} into the sky!", attacker.ToString(), opponent.ToString(true)));
opponent.effects.SkyDrop = true;
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("{1} was freed from the Sky Drop!", opponent.ToString()));
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ battle.Display(Game._INTL("{1} was freed from the Sky Drop!", opponent.ToString()));
opponent.effects.SkyDrop = false;
return ret;
}
- public override float pbTypeModifier(Types type, IBattler attacker, IBattler opponent)
+ public override float TypeModifier(Types type, IBattler attacker, IBattler opponent)
{
- if (opponent.pbHasType(Types.FLYING)) return 0;
+ if (opponent.HasType(Types.FLYING)) return 0;
if (!attacker.hasMoldBreaker() &&
opponent.hasWorkingAbility(Abilities.LEVITATE) &&
!opponent.effects.SmackDown) return 0;
- return base.pbTypeModifier(type, attacker, opponent);
+ return base.TypeModifier(type, attacker, opponent);
}
}
@@ -7338,15 +7339,15 @@ public partial class PokeBattle_Move_0CF : PokeBattle_Move
{
public PokeBattle_Move_0CF() : base() { }
//public PokeBattle_Move_0CF(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && !opponent.isFainted() &&
!opponent.damagestate.Substitute)
{
if (opponent.effects.MultiTurn == 0)
{
- opponent.effects.MultiTurn = 5 + this.battle.pbRandom(2);
+ opponent.effects.MultiTurn = 5 + this.battle.Random(2);
if (attacker.hasWorkingItem(Items.GRIP_CLAW))
{
opponent.effects.MultiTurn = (Core.USENEWBATTLEMECHANICS) ? 8 : 6;
@@ -7356,35 +7357,35 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.effects.MultiTurnUser = attacker.Index;
if (id == Moves.BIND)
{
- battle.pbDisplay(Game._INTL("{1} was squeezed by {2}!", opponent.ToString(), attacker.ToString(true)));
+ battle.Display(Game._INTL("{1} was squeezed by {2}!", opponent.ToString(), attacker.ToString(true)));
}
else if (id == Moves.CLAMP)
{
- battle.pbDisplay(Game._INTL("{1} clamped {2}!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1} clamped {2}!", attacker.ToString(), opponent.ToString(true)));
}
else if (id == Moves.FIRE_SPIN)
{
- battle.pbDisplay(Game._INTL("{1} was trapped in the fiery vortex!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was trapped in the fiery vortex!", opponent.ToString()));
}
else if (id == Moves.MAGMA_STORM)
{
- battle.pbDisplay(Game._INTL("{1} became trapped by Magma Storm!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} became trapped by Magma Storm!", opponent.ToString()));
}
else if (id == Moves.SAND_TOMB)
{
- battle.pbDisplay(Game._INTL("{1} became trapped by Sand Tomb!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} became trapped by Sand Tomb!", opponent.ToString()));
}
else if (id == Moves.WRAP)
{
- battle.pbDisplay(Game._INTL("{1} was wrapped by {2}!", opponent.ToString(), attacker.ToString(true)));
+ battle.Display(Game._INTL("{1} was wrapped by {2}!", opponent.ToString(), attacker.ToString(true)));
}
else if (id == Moves.INFESTATION)
{
- battle.pbDisplay(Game._INTL("{1} has been afflicted with an infestation by {2}!", opponent.ToString(), attacker.ToString(true)));
+ battle.Display(Game._INTL("{1} has been afflicted with an infestation by {2}!", opponent.ToString(), attacker.ToString(true)));
}
else
{
- battle.pbDisplay(Game._INTL("{1} was trapped in the vortex!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was trapped in the vortex!", opponent.ToString()));
}
}
@@ -7397,21 +7398,21 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
/// Trapping move. Traps for 5 or 6 rounds. Trapped Pokémon lose 1/16 of max HP
/// at end of each round. (Whirlpool)
/// Power is doubled if target is using Dive.
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_0D0 : PokeBattle_Move
{
public PokeBattle_Move_0D0() : base() { }
//public PokeBattle_Move_0D0(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && !opponent.isFainted() &&
!opponent.damagestate.Substitute)
{
if (opponent.effects.MultiTurn == 0)
{
- opponent.effects.MultiTurn = 5 + this.battle.pbRandom(2);
+ opponent.effects.MultiTurn = 5 + this.battle.Random(2);
if (attacker.hasWorkingItem(Items.GRIP_CLAW))
{
opponent.effects.MultiTurn = (Core.USENEWBATTLEMECHANICS) ? 8 : 6;
@@ -7420,13 +7421,13 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.effects.MultiTurnUser = attacker.Index;
- battle.pbDisplay(Game._INTL("{1} became trapped in the vortex!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} became trapped in the vortex!", opponent.ToString()));
}
}
return ret;
}
- public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
+ public int ModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
{
if (Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x100) // Dive
{
@@ -7443,15 +7444,15 @@ public partial class PokeBattle_Move_0D1 : PokeBattle_Move
{
public PokeBattle_Move_0D1() : base() { }
//public PokeBattle_Move_0D1(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
if (attacker.effects.Uproar == 0)
{
attacker.effects.Uproar = 3;
- battle.pbDisplay(Game._INTL("{1} caused an uproar!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} caused an uproar!", attacker.ToString()));
attacker.currentMove = this.id;
}
@@ -7468,18 +7469,18 @@ public partial class PokeBattle_Move_0D2 : PokeBattle_Move
{
public PokeBattle_Move_0D2() : base() { }
//public PokeBattle_Move_0D2(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 &&
attacker.effects.Outrage == 0 &&
attacker.Status != Status.SLEEP)
{
- attacker.effects.Outrage = 2 + this.battle.pbRandom(2);
+ attacker.effects.Outrage = 2 + this.battle.Random(2);
attacker.currentMove = this.id;
}
- else if (pbTypeModifier(this.type, attacker, opponent) == 0)
+ else if (TypeModifier(this.type, attacker, opponent) == 0)
{
// Cancel effect if attack is ineffective
attacker.effects.Outrage = 0;
@@ -7489,10 +7490,10 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
attacker.effects.Outrage -= 1;
- if (attacker.effects.Outrage == 0 && attacker is IBattlerEffect b && b.pbCanConfuseSelf(false))
+ if (attacker.effects.Outrage == 0 && attacker is IBattlerEffect b && b.CanConfuseSelf(false))
{
- b.pbConfuse();
- battle.pbDisplay(Game._INTL("{1} became confused due to fatigue!", attacker.ToString()));
+ b.Confuse();
+ battle.Display(Game._INTL("{1} became confused due to fatigue!", attacker.ToString()));
}
}
return ret;
@@ -7507,7 +7508,7 @@ public partial class PokeBattle_Move_0D3 : PokeBattle_Move
{
public PokeBattle_Move_0D3() : base() { }
//public PokeBattle_Move_0D3(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
byte shift = (byte)(4 - attacker.effects.Rollout); // from 0 through 4, 0 is most powerful
if (attacker.effects.DefenseCurl) shift += 1;
@@ -7515,15 +7516,15 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Rollout == 0) attacker.effects.Rollout = 5;
attacker.effects.Rollout -= 1;
attacker.currentMove = MoveId;
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage == 0 ||
- pbTypeModifier(this.type, attacker, opponent) == 0 ||
+ TypeModifier(this.type, attacker, opponent) == 0 ||
attacker.Status == Status.SLEEP)
{
// Cancel effect if attack is ineffective
@@ -7541,16 +7542,16 @@ public partial class PokeBattle_Move_0D4 : PokeBattle_Move
{
public PokeBattle_Move_0D4() : base() { }
//public PokeBattle_Move_0D4(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbDisplayUseMessage(IBattler attacker)
+ public override int DisplayUseMessage(IBattler attacker)
{
if (attacker.effects.Bide == 0)
{
- battle.pbDisplayBrief(Game._INTL("{1} used\r\n{2}!", attacker.ToString(), Name));
+ battle.DisplayBrief(Game._INTL("{1} used\r\n{2}!", attacker.ToString(), Name));
attacker.effects.Bide = 2;
attacker.effects.BideDamage = 0;
attacker.effects.BideTarget = -1;
attacker.currentMove = this.id;
- pbShowAnimation(this.id, attacker, null);
+ ShowAnimation(this.id, attacker, null);
return 1;
}
else
@@ -7558,50 +7559,50 @@ public override int pbDisplayUseMessage(IBattler attacker)
attacker.effects.Bide -= 1;
if (attacker.effects.Bide == 0)
{
- battle.pbDisplayBrief(Game._INTL("{1} unleashed energy!", attacker.ToString()));
+ battle.DisplayBrief(Game._INTL("{1} unleashed energy!", attacker.ToString()));
return 0;
}
else
{
- battle.pbDisplayBrief(Game._INTL("{1} is storing energy!", attacker.ToString()));
+ battle.DisplayBrief(Game._INTL("{1} is storing energy!", attacker.ToString()));
return 2;
}
}
}
- public override void pbAddTarget(IList targets, IBattler attacker)
+ public override void AddTarget(IList targets, IBattler attacker)
{
if (attacker.effects.BideTarget >= 0)
{
- if (!attacker.pbAddTarget(ref targets, this.battle.battlers[attacker.effects.BideTarget]))
+ if (!attacker.AddTarget(ref targets, this.battle.battlers[attacker.effects.BideTarget]))
{
- attacker.pbRandomTarget(targets);
+ attacker.RandomTarget(targets);
}
}
else
{
- attacker.pbRandomTarget(targets);
+ attacker.RandomTarget(targets);
}
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.BideDamage == 0 || opponent.Species == Pokemons.NONE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (Core.USENEWBATTLEMECHANICS)
{
- float typemod = pbTypeModifier(pbType(this.type, attacker, opponent), attacker, opponent);
+ float typemod = TypeModifier(GetType(this.type, attacker, opponent), attacker, opponent);
if (typemod == 0)
{
- battle.pbDisplay(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
+ battle.Display(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
return -1;
}
}
- int ret = pbEffectFixedDamage(attacker.effects.BideDamage * 2, attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = EffectFixedDamage(attacker.effects.BideDamage * 2, attacker, opponent, hitnum, alltargets, showanimation);
return ret;
}
}
@@ -7618,17 +7619,17 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.HP == attacker.TotalHP)
{
- battle.pbDisplay(Game._INTL("{1}'s HP is full!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s HP is full!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbRecoverHP((int)Math.Floor((attacker.TotalHP + 1) / 2f), true);
- battle.pbDisplay(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
+ attacker.RecoverHP((int)Math.Floor((attacker.TotalHP + 1) / 2f), true);
+ battle.Display(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
return 0;
}
}
@@ -7646,18 +7647,18 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.HP == attacker.TotalHP)
{
- battle.pbDisplay(Game._INTL("{1}'s HP is full!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s HP is full!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbRecoverHP((int)Math.Floor((attacker.TotalHP + 1) / 2f), true);
+ attacker.RecoverHP((int)Math.Floor((attacker.TotalHP + 1) / 2f), true);
attacker.effects.Roost = true;
- battle.pbDisplay(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
return 0;
}
}
@@ -7675,14 +7676,14 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Wish > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.Wish = 2;
attacker.effects.WishAmount = (int)Math.Floor((attacker.TotalHP + 1) / 2f);
@@ -7704,20 +7705,20 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.HP == attacker.TotalHP)
{
- battle.pbDisplay(Game._INTL("{1}'s HP is full!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s HP is full!", attacker.ToString()));
return -1;
}
int hpgain = 0;
- if (this.battle.pbWeather == Weather.SUNNYDAY ||
- this.battle.pbWeather == Weather.HARSHSUN)
+ if (this.battle.Weather == Weather.SUNNYDAY ||
+ this.battle.Weather == Weather.HARSHSUN)
{
hpgain = (int)Math.Floor(attacker.TotalHP * 2 / 3f);
}
- else if (this.battle.pbWeather != 0)
+ else if (this.battle.Weather != 0)
{
hpgain = (int)Math.Floor(attacker.TotalHP / 4f);
}
@@ -7725,10 +7726,10 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
hpgain = (int)Math.Floor(attacker.TotalHP / 2f);
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbRecoverHP(hpgain, true);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ attacker.RecoverHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
return 0;
}
}
@@ -7745,28 +7746,28 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker is IBattlerClause b && !b.pbCanSleep(attacker, true, this, true))
+ if (attacker is IBattlerClause b && !b.CanSleep(attacker, true, this, true))
{
return -1;
}
if (attacker.Status == Status.SLEEP)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (attacker.HP == attacker.TotalHP)
{
- battle.pbDisplay(Game._INTL("{1}'s HP is full!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s HP is full!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- if (attacker is IBattlerEffect a) a.pbSleepSelf(3);
- battle.pbDisplay(Game._INTL("{1} slept and became healthy!", attacker.ToString()));
- int hp = attacker.pbRecoverHP(attacker.TotalHP - attacker.HP, true);
- if (hp > 0) battle.pbDisplay(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
+ if (attacker is IBattlerEffect a) a.SleepSelf(3);
+ battle.Display(Game._INTL("{1} slept and became healthy!", attacker.ToString()));
+ int hp = attacker.RecoverHP(attacker.TotalHP - attacker.HP, true);
+ if (hp > 0) battle.Display(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
return 0;
}
}
@@ -7784,17 +7785,17 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.AquaRing)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.AquaRing = true;
- battle.pbDisplay(Game._INTL("{1} surrounded itself with a veil of water!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} surrounded itself with a veil of water!", attacker.ToString()));
return 0;
}
}
@@ -7812,17 +7813,17 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Ingrain)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.Ingrain = true;
- battle.pbDisplay(Game._INTL("{1} planted its roots!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} planted its roots!", attacker.ToString()));
return 0;
}
}
@@ -7835,28 +7836,28 @@ public partial class PokeBattle_Move_0DC : PokeBattle_Move
{
public PokeBattle_Move_0DC() : base() { }
//public PokeBattle_Move_0DC(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
if (opponent.effects.LeechSeed >= 0)
{
- battle.pbDisplay(Game._INTL("{1} evaded the attack!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} evaded the attack!", opponent.ToString()));
return -1;
}
- if (opponent.pbHasType(Types.GRASS))
+ if (opponent.HasType(Types.GRASS))
{
- battle.pbDisplay(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
+ battle.Display(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.LeechSeed = attacker.Index;
- battle.pbDisplay(Game._INTL("{1} was seeded!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was seeded!", opponent.ToString()));
return 0;
}
}
@@ -7873,24 +7874,24 @@ public override bool isHealingMove()
return Core.USENEWBATTLEMECHANICS;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
int hpgain = (int)Math.Round(opponent.damagestate.HPLost / 2f);
if (opponent.hasWorkingAbility(Abilities.LIQUID_OOZE))
{
- attacker.pbReduceHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1} sucked up the liquid ooze!", attacker.ToString()));
+ attacker.ReduceHP(hpgain, true);
+ battle.Display(Game._INTL("{1} sucked up the liquid ooze!", attacker.ToString()));
}
else if (attacker.effects.HealBlock == 0)
{
if (attacker.hasWorkingItem(Items.BIG_ROOT)) hpgain = (int)Math.Floor(hpgain * 1.3f);
- attacker.pbRecoverHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1} had its energy drained!", opponent.ToString()));
+ attacker.RecoverHP(hpgain, true);
+ battle.Display(Game._INTL("{1} had its energy drained!", opponent.ToString()));
}
}
return ret;
@@ -7899,7 +7900,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
///
/// User gains half the HP it inflicts as damage. (Dream Eater)
- /// (Handled in Pokemon's pbSuccessCheck): Fails if target is not asleep.
+ /// (Handled in Pokemon's SuccessCheck): Fails if target is not asleep.
///
public partial class PokeBattle_Move_0DE : PokeBattle_Move
{
@@ -7910,24 +7911,24 @@ public override bool isHealingMove()
return Core.USENEWBATTLEMECHANICS;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
int hpgain = (int)Math.Round(opponent.damagestate.HPLost / 2f);
if (opponent.hasWorkingAbility(Abilities.LIQUID_OOZE))
{
- attacker.pbReduceHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1} sucked up the liquid ooze!", attacker.ToString()));
+ attacker.ReduceHP(hpgain, true);
+ battle.Display(Game._INTL("{1} sucked up the liquid ooze!", attacker.ToString()));
}
else if (attacker.effects.HealBlock == 0)
{
if (attacker.hasWorkingItem(Items.BIG_ROOT)) hpgain = (int)Math.Floor(hpgain * 1.3f);
- attacker.pbRecoverHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1} had its energy drained!", opponent.ToString()));
+ attacker.RecoverHP(hpgain, true);
+ battle.Display(Game._INTL("{1} had its energy drained!", opponent.ToString()));
}
}
return ret;
@@ -7946,24 +7947,24 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (opponent.HP == opponent.TotalHP)
{
- battle.pbDisplay(Game._INTL("{1}'s HP is full!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s HP is full!", opponent.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int hpgain = (int)Math.Floor((opponent.TotalHP + 1) / 2f);
if (attacker.hasWorkingAbility(Abilities.MEGA_LAUNCHER)) hpgain = (int)Math.Round(opponent.TotalHP * 3 / 4f);
- opponent.pbRecoverHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1}'s HP was restored.", opponent.ToString()));
+ opponent.RecoverHP(hpgain, true);
+ battle.Display(Game._INTL("{1}'s HP was restored.", opponent.ToString()));
return 0;
}
}
@@ -7975,15 +7976,15 @@ public partial class PokeBattle_Move_0E0 : PokeBattle_Move, IBattleMove
{
public PokeBattle_Move_0E0() : base() { }
//public PokeBattle_Move_0E0(Battle battle, Attack.Move move) : base(battle, move) { }
- //private bool _pbOnStartUse(IBattler attacker)
- bool IBattleMove.pbOnStartUse(IBattler attacker)
+ //private bool _OnStartUse(IBattler attacker)
+ bool IBattleMove.OnStartUse(IBattler attacker)
{
if (!attacker.hasMoldBreaker())
{
- IBattler bearer = this.battle.pbCheckGlobalAbility(Abilities.DAMP);
+ IBattler bearer = this.battle.CheckGlobalAbility(Abilities.DAMP);
if (bearer != null)
{
- battle.pbDisplay(Game._INTL("{1}'s {2} prevents {3} from using {4}!",
+ battle.Display(Game._INTL("{1}'s {2} prevents {3} from using {4}!",
bearer.ToString(), Game._INTL(bearer.Ability.ToString(TextScripts.Name)), attacker.ToString(true), Name));
return false;
}
@@ -7991,15 +7992,15 @@ bool IBattleMove.pbOnStartUse(IBattler attacker)
return true;
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
if (!attacker.isFainted())
{
- attacker.pbReduceHP(attacker.HP);
+ attacker.ReduceHP(attacker.HP);
- if (attacker.isFainted()) attacker.pbFaint();
+ if (attacker.isFainted()) attacker.Faint();
}
}
}
@@ -8012,27 +8013,27 @@ public partial class PokeBattle_Move_0E1 : PokeBattle_Move
{
public PokeBattle_Move_0E1() : base() { }
//public PokeBattle_Move_0E1(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- float typemod = pbTypeModifier(pbType(this.type, attacker, opponent), attacker, opponent);
+ float typemod = TypeModifier(GetType(this.type, attacker, opponent), attacker, opponent);
if (typemod == 0)
{
- battle.pbDisplay(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
+ battle.Display(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
return -1;
}
- int ret = pbEffectFixedDamage(attacker.HP, attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = EffectFixedDamage(attacker.HP, attacker, opponent, hitnum, alltargets, showanimation);
return ret;
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
if (!attacker.isFainted())
{
- attacker.pbReduceHP(attacker.HP);
+ attacker.ReduceHP(attacker.HP);
- if (attacker.isFainted()) attacker.pbFaint();
+ if (attacker.isFainted()) attacker.Faint();
}
}
}
@@ -8045,25 +8046,25 @@ public partial class PokeBattle_Move_0E2 : PokeBattle_Move
{
public PokeBattle_Move_0E2() : base() { }
//public PokeBattle_Move_0E2(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int ret = -1; bool showanim = true;
- if (opponent is IBattlerEffect b0 && b0.pbReduceStat(Stats.ATTACK, 2, attacker, false, this, showanim))
+ if (opponent is IBattlerEffect b0 && b0.ReduceStat(Stats.ATTACK, 2, attacker, false, this, showanim))
{
ret = 0; showanim = false;
}
- if (opponent is IBattlerEffect b1 && b1.pbReduceStat(Stats.SPATK, 2, attacker, false, this, showanim))
+ if (opponent is IBattlerEffect b1 && b1.ReduceStat(Stats.SPATK, 2, attacker, false, this, showanim))
{
ret = 0; showanim = false;
}
- attacker.pbReduceHP(attacker.HP);
+ attacker.ReduceHP(attacker.HP);
return ret;
}
}
@@ -8081,16 +8082,16 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (!this.battle.pbCanChooseNonActive(attacker.Index))
+ if (!this.battle.CanChooseNonActive(attacker.Index))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbReduceHP(attacker.HP);
+ attacker.ReduceHP(attacker.HP);
attacker.effects.HealingWish = true;
return 0;
}
@@ -8109,16 +8110,16 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (!this.battle.pbCanChooseNonActive(attacker.Index))
+ if (!this.battle.CanChooseNonActive(attacker.Index))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbReduceHP(attacker.HP);
+ attacker.ReduceHP(attacker.HP);
attacker.effects.LunarDance = true;
return 0;
}
@@ -8131,7 +8132,7 @@ public partial class PokeBattle_Move_0E5 : PokeBattle_Move
{
public PokeBattle_Move_0E5() : base() { }
//public PokeBattle_Move_0E5(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool failed = true;
for (int i = 0; i < 4; i++)
@@ -8145,20 +8146,20 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (failed)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("All Pokémon that hear the song will faint in three turns!"));
+ battle.Display(Game._INTL("All Pokémon that hear the song will faint in three turns!"));
for (int i = 0; i < 4; i++)
{
if (this.battle.battlers[i].effects.PerishSong == 0)
{
if (!attacker.hasMoldBreaker() && this.battle.battlers[i].hasWorkingAbility(Abilities.SOUNDPROOF))
{
- battle.pbDisplay(Game._INTL("{1}'s {2} blocks {3}!", this.battle.battlers[i].ToString(),
- //PBAbilities.getName(this.battle.battlers[i].Ability), Name));
+ battle.Display(Game._INTL("{1}'s {2} blocks {3}!", this.battle.battlers[i].ToString(),
+ //Abilities.getName(this.battle.battlers[i].Ability), Name));
Game._INTL(this.battle.battlers[i].Ability.ToString(TextScripts.Name)), Name));
}
else
@@ -8180,12 +8181,12 @@ public partial class PokeBattle_Move_0E6 : PokeBattle_Move
{
public PokeBattle_Move_0E6() : base() { }
//public PokeBattle_Move_0E6(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.Grudge = true;
- battle.pbDisplay(Game._INTL("{1} wants its target to bear a grudge!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} wants its target to bear a grudge!", attacker.ToString()));
return 0;
}
}
@@ -8198,12 +8199,12 @@ public partial class PokeBattle_Move_0E7 : PokeBattle_Move
{
public PokeBattle_Move_0E7() : base() { }
//public PokeBattle_Move_0E7(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.DestinyBond = true;
- battle.pbDisplay(Game._INTL("{1} is trying to take its foe down with it!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} is trying to take its foe down with it!", attacker.ToString()));
return 0;
}
}
@@ -8215,7 +8216,7 @@ public partial class PokeBattle_Move_0E8 : PokeBattle_Move
{
public PokeBattle_Move_0E8() : base() { }
//public PokeBattle_Move_0E8(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
List ratesharers = new List {
Attack.Data.Effects.x070, // Detect, Protect
@@ -8240,18 +8241,18 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
}
if (!unmoved ||
- this.battle.pbRandom(65536) > Math.Floor(65536f / attacker.effects.ProtectRate))
+ this.battle.Random(65536) > Math.Floor(65536f / attacker.effects.ProtectRate))
{
attacker.effects.ProtectRate = 1;
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.Endure = true;
attacker.effects.ProtectRate *= 2;
- battle.pbDisplay(Game._INTL("{1} braced itself!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} braced itself!", attacker.ToString()));
return 0;
}
}
@@ -8273,17 +8274,17 @@ public partial class PokeBattle_Move_0EA : PokeBattle_Move
{
public PokeBattle_Move_0EA() : base() { }
//public PokeBattle_Move_0EA(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.opponent.Length == 0 ||
- !this.battle.pbCanRun(attacker.Index))
+ !this.battle.CanRun(attacker.Index))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("{1} fled from battle!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} fled from battle!", attacker.ToString()));
this.battle.decision = (BattleResults)3;
return 0;
}
@@ -8299,26 +8300,26 @@ public partial class PokeBattle_Move_0EB : PokeBattle_Move
{
public PokeBattle_Move_0EB() : base() { }
//public PokeBattle_Move_0EB(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.SUCTION_CUPS))
{
- battle.pbDisplay(Game._INTL("{1} anchored itself with {2}!", opponent.ToString(), Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
+ battle.Display(Game._INTL("{1} anchored itself with {2}!", opponent.ToString(), Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
if (opponent.effects.Ingrain)
{
- battle.pbDisplay(Game._INTL("{1} anchored itself with its roots!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} anchored itself with its roots!", opponent.ToString()));
return -1;
}
if (this.battle.opponent.Length == 0)
{
if (opponent.Level > attacker.Level)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
this.battle.decision = (BattleResults)3; // Set decision to escaped;
return 0;
@@ -8326,10 +8327,10 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
else
{
bool choices = false;
- IPokemon[] party = this.battle.pbParty(opponent.Index);
+ IPokemon[] party = this.battle.Party(opponent.Index);
for (int i = 0; i < party.Length; i++)
{
- if (this.battle.pbCanSwitch(opponent.Index, i, false, true))
+ if (this.battle.CanSwitch(opponent.Index, i, false, true))
{
choices = true;
break;
@@ -8337,10 +8338,10 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!choices)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Roar = true;
return 0;
@@ -8358,7 +8359,7 @@ public partial class PokeBattle_Move_0EC : PokeBattle_Move
{
public PokeBattle_Move_0EC() : base() { }
//public PokeBattle_Move_0EC(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && !opponent.isFainted() &&
opponent.damagestate.CalcDamage > 0 && !opponent.damagestate.Substitute &&
@@ -8375,10 +8376,10 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
else
{
- IPokemon[] party = this.battle.pbParty(opponent.Index);
+ IPokemon[] party = this.battle.Party(opponent.Index);
for (int i = 0; i < party.Length - 1; i++) //ToDo: Double check this
{
- if (this.battle.pbCanSwitch(opponent.Index, i, false))
+ if (this.battle.CanSwitch(opponent.Index, i, false))
{
opponent.effects.Roar = true;
break;
@@ -8398,14 +8399,14 @@ public partial class PokeBattle_Move_0ED : PokeBattle_Move
{
public PokeBattle_Move_0ED() : base() { }
//public PokeBattle_Move_0ED(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (!this.battle.pbCanChooseNonActive(attacker.Index))
+ if (!this.battle.CanChooseNonActive(attacker.Index))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.BatonPass = true;
return 0;
@@ -8421,12 +8422,12 @@ public partial class PokeBattle_Move_0EE : PokeBattle_Move
{
public PokeBattle_Move_0EE() : base() { }
//public PokeBattle_Move_0EE(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (!attacker.isFainted() && opponent.damagestate.CalcDamage > 0 &&
- this.battle.pbCanChooseNonActive(attacker.Index) &&
- !this.battle.pbAllFainted(this.battle.pbParty(opponent.Index)))
+ this.battle.CanChooseNonActive(attacker.Index) &&
+ !this.battle.AllFainted(this.battle.Party(opponent.Index)))
{
attacker.effects.Uturn = true;
}
@@ -8442,19 +8443,19 @@ public partial class PokeBattle_Move_0EF : PokeBattle_Move
{
public PokeBattle_Move_0EF() : base() { }
//public PokeBattle_Move_0EF(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging())
+ if (IsDamaging())
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && !opponent.damagestate.Substitute &&
!opponent.isFainted())
{
if (opponent.effects.MeanLook < 0 &&
- (!Core.USENEWBATTLEMECHANICS || !opponent.pbHasType(Types.GHOST)))
+ (!Core.USENEWBATTLEMECHANICS || !opponent.HasType(Types.GHOST)))
{
opponent.effects.MeanLook = attacker.Index;
- battle.pbDisplay(Game._INTL("{1} can no longer escape!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} can no longer escape!", opponent.ToString()));
}
}
return ret;
@@ -8462,18 +8463,18 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (opponent.effects.MeanLook >= 0 ||
(opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker)))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (Core.USENEWBATTLEMECHANICS && opponent.pbHasType(Types.GHOST))
+ if (Core.USENEWBATTLEMECHANICS && opponent.HasType(Types.GHOST))
{
- battle.pbDisplay(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
+ battle.Display(Game._INTL("It doesn't affect {1}...", opponent.ToString(true)));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.MeanLook = attacker.Index;
- battle.pbDisplay(Game._INTL("{1} can no longer escape!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} can no longer escape!", opponent.ToString()));
return 0;
}
}
@@ -8486,7 +8487,7 @@ public partial class PokeBattle_Move_0F0 : PokeBattle_Move
{
public PokeBattle_Move_0F0() : base() { }
//public PokeBattle_Move_0F0(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && !opponent.isFainted() && opponent.Item != 0 &&
opponent.damagestate.CalcDamage > 0 && !opponent.damagestate.Substitute)
@@ -8494,24 +8495,24 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.STICKY_HOLD))
{
string abilityname = Game._INTL(opponent.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1}'s {2} made {3} ineffective!", opponent.ToString(), abilityname, Kernal.MoveData[MoveId].Name));
+ battle.Display(Game._INTL("{1}'s {2} made {3} ineffective!", opponent.ToString(), abilityname, Kernal.MoveData[MoveId].Name));
}
- else if (!this.battle.pbIsUnlosableItem(opponent, opponent.Item))
+ else if (!this.battle.IsUnlosableItem(opponent, opponent.Item))
{
string itemname = Kernal.ItemData[opponent.Item].Name;
opponent.Item = 0;
opponent.effects.ChoiceBand = Moves.NONE;//-1;
opponent.effects.Unburden = true;
- battle.pbDisplay(Game._INTL("{1} dropped its {2}!", opponent.ToString(), itemname));
+ battle.Display(Game._INTL("{1} dropped its {2}!", opponent.ToString(), itemname));
}
}
}
- public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
+ public int ModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
{
if (Core.USENEWBATTLEMECHANICS &&
- !this.battle.pbIsUnlosableItem(opponent, opponent.Item))
+ !this.battle.IsUnlosableItem(opponent, opponent.Item))
{
// Still boosts damage even if opponent has Sticky Hold
return (int)Math.Round(damagemult * 1.5f);
@@ -8528,7 +8529,7 @@ public partial class PokeBattle_Move_0F1 : PokeBattle_Move
{
public PokeBattle_Move_0F1() : base() { }
//public PokeBattle_Move_0F1(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && !opponent.isFainted() && opponent.Item != 0 &&
opponent.damagestate.CalcDamage > 0 && !opponent.damagestate.Substitute)
@@ -8536,12 +8537,12 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.STICKY_HOLD))
{
string abilityname = Game._INTL(opponent.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1}'s {2} made {3} ineffective!", opponent.ToString(), abilityname, Kernal.MoveData[MoveId].Name));
+ battle.Display(Game._INTL("{1}'s {2} made {3} ineffective!", opponent.ToString(), abilityname, Kernal.MoveData[MoveId].Name));
}
- else if (!this.battle.pbIsUnlosableItem(opponent, opponent.Item) &&
- !this.battle.pbIsUnlosableItem(attacker, opponent.Item) &&
+ else if (!this.battle.IsUnlosableItem(opponent, opponent.Item) &&
+ !this.battle.IsUnlosableItem(attacker, opponent.Item) &&
attacker.Item == 0 &&
- (this.battle.opponent.Length == 0 || !this.battle.pbIsOpposing(attacker.Index)))
+ (this.battle.opponent.Length == 0 || !this.battle.IsOpposing(attacker.Index)))
{
string itemname = Kernal.ItemData[opponent.Item].Name;
attacker.Item = opponent.Item;
@@ -8557,7 +8558,7 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
attacker.pokemon.itemInitial = attacker.Item;
opponent.pokemon.itemInitial = 0;
}
- battle.pbDisplay(Game._INTL("{1} stole {2}'s {3}!", attacker.ToString(), opponent.ToString(true), itemname));
+ battle.Display(Game._INTL("{1} stole {2}'s {3}!", attacker.ToString(), opponent.ToString(true), itemname));
}
}
}
@@ -8571,30 +8572,30 @@ public partial class PokeBattle_Move_0F2 : PokeBattle_Move
{
public PokeBattle_Move_0F2() : base() { }
//public PokeBattle_Move_0F2(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if ((opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker)) ||
(attacker.Item == 0 && opponent.Item == 0) ||
- (this.battle.opponent.Length == 0 && this.battle.pbIsOpposing(attacker.Index)))
+ (this.battle.opponent.Length == 0 && this.battle.IsOpposing(attacker.Index)))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (this.battle.pbIsUnlosableItem(opponent, opponent.Item) ||
- this.battle.pbIsUnlosableItem(attacker, opponent.Item) ||
- this.battle.pbIsUnlosableItem(opponent, attacker.Item) ||
- this.battle.pbIsUnlosableItem(attacker, attacker.Item))
+ if (this.battle.IsUnlosableItem(opponent, opponent.Item) ||
+ this.battle.IsUnlosableItem(attacker, opponent.Item) ||
+ this.battle.IsUnlosableItem(opponent, attacker.Item) ||
+ this.battle.IsUnlosableItem(attacker, attacker.Item))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.STICKY_HOLD))
{
string abilityname = Game._INTL(opponent.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1}'s {2} made {3} ineffective!", opponent.ToString(), abilityname, Name));
+ battle.Display(Game._INTL("{1}'s {2} made {3} ineffective!", opponent.ToString(), abilityname, Name));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
Items oldattitem = attacker.Item;
Items oldoppitem = opponent.Item;
@@ -8612,16 +8613,16 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.pokemon.itemInitial = oldoppitem;
opponent.pokemon.itemInitial = oldattitem;
}
- battle.pbDisplay(Game._INTL("{1} switched items with its opponent!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} switched items with its opponent!", attacker.ToString()));
if (oldoppitem > 0 && oldattitem > 0)
{
- battle.pbDisplayPaused(Game._INTL("{1} obtained {2}.", attacker.ToString(), oldoppitemname));
- battle.pbDisplay(Game._INTL("{1} obtained {2}.", opponent.ToString(), oldattitemname));
+ battle.DisplayPaused(Game._INTL("{1} obtained {2}.", attacker.ToString(), oldoppitemname));
+ battle.Display(Game._INTL("{1} obtained {2}.", opponent.ToString(), oldattitemname));
}
else
{
- if (oldoppitem > 0) battle.pbDisplay(Game._INTL("{1} obtained {2}.", attacker.ToString(), oldoppitemname));
- if (oldattitem > 0) battle.pbDisplay(Game._INTL("{1} obtained {2}.", opponent.ToString(), oldattitemname));
+ if (oldoppitem > 0) battle.Display(Game._INTL("{1} obtained {2}.", attacker.ToString(), oldoppitemname));
+ if (oldattitem > 0) battle.Display(Game._INTL("{1} obtained {2}.", opponent.ToString(), oldattitemname));
}
attacker.effects.ChoiceBand = Moves.NONE;//-1;
@@ -8638,21 +8639,21 @@ public partial class PokeBattle_Move_0F3 : PokeBattle_Move
{
public PokeBattle_Move_0F3() : base() { }
//public PokeBattle_Move_0F3(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if ((opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker)) ||
attacker.Item == 0 || opponent.Item != 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (this.battle.pbIsUnlosableItem(attacker, attacker.Item) ||
- this.battle.pbIsUnlosableItem(opponent, attacker.Item))
+ if (this.battle.IsUnlosableItem(attacker, attacker.Item) ||
+ this.battle.IsUnlosableItem(opponent, attacker.Item))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
string itemname = Kernal.ItemData[attacker.Item].Name;
opponent.Item = attacker.Item;
@@ -8668,7 +8669,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
opponent.pokemon.itemInitial = opponent.Item;
attacker.pokemon.itemInitial = 0;
}
- battle.pbDisplay(Game._INTL("{1} received {2} from {3}!", opponent.ToString(), itemname, attacker.ToString(true)));
+ battle.Display(Game._INTL("{1} received {2} from {3}!", opponent.ToString(), itemname, attacker.ToString(true)));
return 0;
}
}
@@ -8680,9 +8681,9 @@ public partial class PokeBattle_Move_0F4 : PokeBattle_Move
{
public PokeBattle_Move_0F4() : base() { }
//public PokeBattle_Move_0F4(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
- if (!attacker.isFainted() && !opponent.isFainted() && Game.GameData is IItemCheck i && i.pbIsBerry(opponent.Item) &&
+ if (!attacker.isFainted() && !opponent.isFainted() && Game.GameData is IItemCheck i && i.IsBerry(opponent.Item) &&
opponent.damagestate.CalcDamage > 0 && !opponent.damagestate.Substitute)
{
if (attacker.hasMoldBreaker() || !opponent.hasWorkingAbility(Abilities.STICKY_HOLD))
@@ -8690,30 +8691,30 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
Items item = opponent.Item;
string itemname = Kernal.ItemData[item].Name;
- opponent.pbConsumeItem(false, false);
- battle.pbDisplay(Game._INTL("{1} stole and ate its target's {2}!", attacker.ToString(), itemname));
+ opponent.ConsumeItem(false, false);
+ battle.Display(Game._INTL("{1} stole and ate its target's {2}!", attacker.ToString(), itemname));
if (!attacker.hasWorkingAbility(Abilities.KLUTZ) &&
attacker.effects.Embargo == 0)
{
- attacker.pbActivateBerryEffect(item, false);
+ attacker.ActivateBerryEffect(item, false);
}
// Symbiosis
if (attacker.Item == 0 &&
- attacker.pbPartner.IsNotNullOrNone() && attacker.pbPartner.hasWorkingAbility(Abilities.SYMBIOSIS))
+ attacker.Partner.IsNotNullOrNone() && attacker.Partner.hasWorkingAbility(Abilities.SYMBIOSIS))
{
- IBattler partner = attacker.pbPartner;
+ IBattler partner = attacker.Partner;
if (partner.Item > 0 &&
- !this.battle.pbIsUnlosableItem(partner, partner.Item) &&
- !this.battle.pbIsUnlosableItem(attacker, partner.Item))
+ !this.battle.IsUnlosableItem(partner, partner.Item) &&
+ !this.battle.IsUnlosableItem(attacker, partner.Item))
{
- battle.pbDisplay(Game._INTL("{1}'s {2} let it share its {3} with {4}!",
+ battle.Display(Game._INTL("{1}'s {2} let it share its {3} with {4}!",
partner.ToString(), Game._INTL(partner.Ability.ToString(TextScripts.Name)),
Kernal.ItemData[partner.Item].Name, attacker.ToString(true)));
attacker.Item = partner.Item;
partner.Item = 0;
partner.effects.Unburden = true;
- attacker.pbBerryCureCheck();
+ attacker.BerryCureCheck();
}
}
@@ -8729,17 +8730,17 @@ public partial class PokeBattle_Move_0F5 : PokeBattle_Move
{
public PokeBattle_Move_0F5() : base() { }
//public PokeBattle_Move_0F5(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (!attacker.isFainted() && opponent.damagestate.CalcDamage > 0 &&
!opponent.damagestate.Substitute &&
- (Game.GameData is IItemCheck i && i.pbIsBerry(opponent.Item) || (Core.USENEWBATTLEMECHANICS && i.pbIsGem(opponent.Item))))
+ (Game.GameData is IItemCheck i && i.IsBerry(opponent.Item) || (Core.USENEWBATTLEMECHANICS && i.IsGem(opponent.Item))))
{
string itemname = Kernal.ItemData[opponent.Item].Name;
- opponent.pbConsumeItem(false, false);
+ opponent.ConsumeItem(false, false);
- battle.pbDisplay(Game._INTL("{1}'s {2} was incinerated!", opponent.ToString(), itemname));
+ battle.Display(Game._INTL("{1}'s {2} was incinerated!", opponent.ToString(), itemname));
}
return ret;
}
@@ -8752,14 +8753,14 @@ public partial class PokeBattle_Move_0F6 : PokeBattle_Move
{
public PokeBattle_Move_0F6() : base() { }
//public PokeBattle_Move_0F6(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Species == Pokemons.NONE || attacker.pokemon.itemRecycle == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
Items item = attacker.pokemon.itemRecycle;
string itemname = Kernal.ItemData[item].Name;
@@ -8775,7 +8776,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.effects.PickupUse = 0;
- battle.pbDisplay(Game._INTL("{1} found one {2}!", attacker.ToString(), itemname));
+ battle.Display(Game._INTL("{1} found one {2}!", attacker.ToString(), itemname));
return 0;
}
}
@@ -8791,34 +8792,34 @@ public Dictionary flingarray
{
get
{
- return new Dictionary {
- //130 =>
+ return new Dictionary {
+ //130 =>
{ Items.IRON_BALL, 130 },
- //100 =>
+ //100 =>
{ Items.ARMOR_FOSSIL, 100 }, { Items.CLAW_FOSSIL, 100 }, { Items.COVER_FOSSIL, 100 }, { Items.DOME_FOSSIL, 100 }, { Items.HARD_STONE, 100 },
{ Items.HELIX_FOSSIL, 100 }, { Items.JAW_FOSSIL, 100 }, { Items.OLD_AMBER, 100 }, { Items.PLUME_FOSSIL, 100 }, { Items.RARE_BONE, 100 },
- { Items.ROOT_FOSSIL, 100 }, { Items.SAIL_FOSSIL, 100 }, { Items.SKULL_FOSSIL, 100 },
- //90 =>
+ { Items.ROOT_FOSSIL, 100 }, { Items.SAIL_FOSSIL, 100 }, { Items.SKULL_FOSSIL, 100 },
+ //90 =>
{ Items.DEEP_SEA_TOOTH, 90 }, { Items.DRACO_PLATE, 90 }, { Items.DREAD_PLATE, 90 }, { Items.EARTH_PLATE, 90 }, { Items.FIST_PLATE, 90 },
{ Items.FLAME_PLATE, 90 }, { Items.GRIP_CLAW, 90 }, { Items.ICICLE_PLATE, 90 }, { Items.INSECT_PLATE, 90 }, { Items.IRON_PLATE, 90 },
{ Items.MEADOW_PLATE, 90 }, { Items.MIND_PLATE, 90 }, { Items.PIXIE_PLATE, 90 }, { Items.SKY_PLATE, 90 }, { Items.SPLASH_PLATE, 90 },
- { Items.SPOOKY_PLATE, 90 }, { Items.STONE_PLATE, 90 }, { Items.THICK_CLUB, 90 }, { Items.TOXIC_PLATE, 90 }, { Items.ZAP_PLATE, 90 },
- //80 =>
+ { Items.SPOOKY_PLATE, 90 }, { Items.STONE_PLATE, 90 }, { Items.THICK_CLUB, 90 }, { Items.TOXIC_PLATE, 90 }, { Items.ZAP_PLATE, 90 },
+ //80 =>
{ Items.ASSAULT_VEST, 80 }, { Items.DAWN_STONE, 80 }, { Items.DUSK_STONE, 80 }, { Items.ELECTIRIZER, 80 }, { Items.MAGMARIZER, 80 },
{ Items.ODD_KEYSTONE, 80 }, { Items.OVAL_STONE, 80 }, { Items.PROTECTOR, 80 }, { Items.QUICK_CLAW, 80 }, { Items.RAZOR_CLAW, 80 },
- { Items.SAFETY_GOGGLES, 80 }, { Items.SHINY_STONE, 80 }, { Items.STICKY_BARB, 80 }, { Items.WEAKNESS_POLICY, 80 },
- //70 =>
+ { Items.SAFETY_GOGGLES, 80 }, { Items.SHINY_STONE, 80 }, { Items.STICKY_BARB, 80 }, { Items.WEAKNESS_POLICY, 80 },
+ //70 =>
{ Items.BURN_DRIVE, 70 }, { Items.CHILL_DRIVE, 70 }, { Items.DOUSE_DRIVE, 70 }, { Items.DRAGON_FANG, 70 }, { Items.POISON_BARB, 70 },
{ Items.POWER_ANKLET, 70 }, { Items.POWER_BAND, 70 }, { Items.POWER_BELT, 70 }, { Items.POWER_BRACER, 70 }, { Items.POWER_LENS, 70 },
- { Items.POWER_WEIGHT, 70 }, { Items.SHOCK_DRIVE, 70 },
- //60 =>
+ { Items.POWER_WEIGHT, 70 }, { Items.SHOCK_DRIVE, 70 },
+ //60 =>
{ Items.ADAMANT_ORB, 60 }, { Items.DAMP_ROCK, 60 }, { Items.GRISEOUS_ORB, 60 }, { Items.HEAT_ROCK, 60 }, { Items.LUSTROUS_ORB, 60 },
- { Items.MACHO_BRACE, 60 }, { Items.ROCKY_HELMET, 60 }, { Items.STICK, 60 },
- //50 =>
- { Items.DUBIOUS_DISC, 50 }, { Items.SHARP_BEAK, 50 },
- //40 =>
- { Items.EVIOLITE, 40 }, { Items.ICY_ROCK, 40 }, { Items.LUCKY_PUNCH, 40 },
- //30 =>
+ { Items.MACHO_BRACE, 60 }, { Items.ROCKY_HELMET, 60 }, { Items.STICK, 60 },
+ //50 =>
+ { Items.DUBIOUS_DISC, 50 }, { Items.SHARP_BEAK, 50 },
+ //40 =>
+ { Items.EVIOLITE, 40 }, { Items.ICY_ROCK, 40 }, { Items.LUCKY_PUNCH, 40 },
+ //30 =>
{ Items.ABILITY_CAPSULE, 30 }, { Items.ABILITY_URGE, 30 }, { Items.ABSORB_BULB, 30 }, { Items.AMAZE_MULCH, 30 }, { Items.AMULET_COIN, 30 },
{ Items.ANTIDOTE, 30 }, { Items.AWAKENING, 30 }, { Items.BALM_MUSHROOM, 30 }, { Items.BERRY_JUICE, 30 }, { Items.BIG_MUSHROOM, 30 },
{ Items.BIG_NUGGET, 30 }, { Items.BIG_PEARL, 30 }, { Items.BINDING_BAND, 30 }, { Items.BLACK_BELT, 30 }, { Items.BLACK_FLUTE, 30 },
@@ -8852,12 +8853,12 @@ public Dictionary flingarray
{ Items.X_ATTACK_3, 30 }, { Items.X_ATTACK_6, 30 }, { Items.X_DEFENSE, 30 }, { Items.X_DEFENSE_2, 30 }, { Items.X_DEFENSE_3, 30 },
{ Items.X_DEFENSE_6, 30 }, { Items.X_SP_DEF, 30 }, { Items.X_SP_DEF_2, 30 }, { Items.X_SP_DEF_3, 30 }, { Items.X_SP_DEF_6, 30 },
{ Items.X_SP_ATK, 30 }, { Items.X_SP_ATK_2, 30 }, { Items.X_SP_ATK_3, 30 }, { Items.X_SP_ATK_6, 30 }, { Items.X_SPEED, 30 },
- { Items.X_SPEED_2, 30 }, { Items.X_SPEED_3, 30 }, { Items.X_SPEED_6, 30 }, { Items.YELLOW_FLUTE, 30 }, { Items.YELLOW_SHARD, 30 }, { Items.ZINC, 30 },
+ { Items.X_SPEED_2, 30 }, { Items.X_SPEED_3, 30 }, { Items.X_SPEED_6, 30 }, { Items.YELLOW_FLUTE, 30 }, { Items.YELLOW_SHARD, 30 }, { Items.ZINC, 30 },
//{ Items.X_SPECIAL, 30 }, { Items.X_SPECIAL2, 30 }, { Items.X_SPECIAL_3, 30 }, { Items.X_SPECIAL_6, 30 }, //ToDo: Is X-Special a thing?
- //20 =>
+ //20 =>
{ Items.CLEVER_WING, 20 }, { Items.GENIUS_WING, 20 }, { Items.HEALTH_WING, 20 }, { Items.MUSCLE_WING, 20 }, { Items.PRETTY_WING, 20 },
- { Items.RESIST_WING, 20 }, { Items.SWIFT_WING, 20 },
- //10 =>
+ { Items.RESIST_WING, 20 }, { Items.SWIFT_WING, 20 },
+ //10 =>
{ Items.AIR_BALLOON, 10 }, { Items.BIG_ROOT, 10 }, { Items.BLUE_SCARF, 10 }, { Items.BRIGHT_POWDER, 10 }, { Items.CHOICE_BAND, 10 },
{ Items.CHOICE_SCARF, 10 }, { Items.CHOICE_SPECS, 10 }, { Items.DESTINY_KNOT, 10 }, { Items.EXPERT_BELT, 10 }, { Items.FOCUS_BAND, 10 },
{ Items.FOCUS_SASH, 10 }, { Items.FULL_INCENSE, 10 }, { Items.GREEN_SCARF, 10 }, { Items.LAGGING_TAIL, 10 }, { Items.LAX_INCENSE, 10 },
@@ -8871,36 +8872,36 @@ public Dictionary flingarray
}
}
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
if (attacker.Item == 0 ||
- this.battle.pbIsUnlosableItem(attacker, attacker.Item) ||
- Game.GameData is IItemCheck i0 && i0.pbIsPokeBall(attacker.Item) ||
+ this.battle.IsUnlosableItem(attacker, attacker.Item) ||
+ Game.GameData is IItemCheck i0 && i0.IsPokeBall(attacker.Item) ||
this.battle.field.MagicRoom > 0 ||
attacker.hasWorkingAbility(Abilities.KLUTZ) ||
attacker.effects.Embargo > 0) return true;
foreach (Items i in flingarray.Keys)
{
//if (flingarray[i] != null){
- // foreach (var j in flingarray[i]){
+ // foreach (var j in flingarray[i]){
if (attacker.Item == i) return false;
// }
//}
}
- if (Game.GameData is IItemCheck i1 && i1.pbIsBerry(attacker.Item) &&
- !attacker.pbOpposing1.hasWorkingAbility(Abilities.UNNERVE) &&
- !attacker.pbOpposing2.hasWorkingAbility(Abilities.UNNERVE)) return false;
+ if (Game.GameData is IItemCheck i1 && i1.IsBerry(attacker.Item) &&
+ !attacker.Opposing1.hasWorkingAbility(Abilities.UNNERVE) &&
+ !attacker.Opposing2.hasWorkingAbility(Abilities.UNNERVE)) return false;
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
- if (Game.GameData is IItemCheck i0 && i0.pbIsBerry(attacker.Item)) return 10;
- if (Game.GameData is IItemCheck i1 && i1.pbIsMegaStone(attacker.Item)) return 80;
+ if (Game.GameData is IItemCheck i0 && i0.IsBerry(attacker.Item)) return 10;
+ if (Game.GameData is IItemCheck i1 && i1.IsMegaStone(attacker.Item)) return 80;
foreach (Items i in flingarray.Keys)
{
//if (flingarray[i] != null){
- // foreach (var j in flingarray[i]){
+ // foreach (var j in flingarray[i]){
if (attacker.Item == i) return flingarray[i]; //Kernal.ItemData[i].FlingPower.Value;
// }
//}
@@ -8908,92 +8909,92 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return 1;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.Item == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return 0;
}
attacker.effects.Unburden = true;
- battle.pbDisplay(Game._INTL("{1} flung its {2}!", attacker.ToString(), Kernal.ItemData[attacker.Item].Name));
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ battle.Display(Game._INTL("{1} flung its {2}!", attacker.ToString(), Kernal.ItemData[attacker.Item].Name));
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && !opponent.damagestate.Substitute &&
(attacker.hasMoldBreaker() || !opponent.hasWorkingAbility(Abilities.SHIELD_DUST)))
{
if ((attacker as Combat.Pokemon).hasWorkingBerry())
{
- opponent.pbActivateBerryEffect(attacker.Item, false);
+ opponent.ActivateBerryEffect(attacker.Item, false);
}
else if (attacker.hasWorkingItem(Items.FLAME_ORB))
{
- if (opponent is IBattlerEffect b && b.pbCanBurn(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanBurn(attacker, false, this))
{
- b.pbBurn(attacker);
+ b.Burn(attacker);
}
}
else if (attacker.hasWorkingItem(Items.KINGS_ROCK) ||
attacker.hasWorkingItem(Items.RAZOR_FANG))
{
- if (opponent is IBattlerEffect o) o.pbFlinch(attacker);
+ if (opponent is IBattlerEffect o) o.Flinch(attacker);
}
else if (attacker.hasWorkingItem(Items.LIGHT_BALL))
{
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
}
else if (attacker.hasWorkingItem(Items.MENTAL_HERB))
{
if (opponent.effects.Attract >= 0)
{
- if (opponent is IBattlerEffect o) o.pbCureAttract();
- battle.pbDisplay(Game._INTL("{1} got over its infatuation.", opponent.ToString()));
+ if (opponent is IBattlerEffect o) o.CureAttract();
+ battle.Display(Game._INTL("{1} got over its infatuation.", opponent.ToString()));
}
if (opponent.effects.Taunt > 0)
{
opponent.effects.Taunt = 0;
- battle.pbDisplay(Game._INTL("{1}'s taunt wore off!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s taunt wore off!", opponent.ToString()));
}
if (opponent.effects.Encore > 0)
{
opponent.effects.Encore = 0;
opponent.effects.EncoreMove = 0;
opponent.effects.EncoreIndex = 0;
- battle.pbDisplay(Game._INTL("{1}'s encore ended!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s encore ended!", opponent.ToString()));
}
if (opponent.effects.Torment)
{
opponent.effects.Torment = false;
- battle.pbDisplay(Game._INTL("{1}'s torment wore off!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s torment wore off!", opponent.ToString()));
}
if (opponent.effects.Disable > 0)
{
opponent.effects.Disable = 0;
- battle.pbDisplay(Game._INTL("{1} is no longer disabled!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} is no longer disabled!", opponent.ToString()));
}
if (opponent.effects.HealBlock > 0)
{
opponent.effects.HealBlock = 0;
- battle.pbDisplay(Game._INTL("{1}'s Heal Block wore off!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s Heal Block wore off!", opponent.ToString()));
}
}
else if (attacker.hasWorkingItem(Items.POISON_BARB))
{
- if (opponent is IBattlerEffect b && b.pbCanPoison(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanPoison(attacker, false, this))
{
- b.pbPoison(attacker);
+ b.Poison(attacker);
}
}
else if (attacker.hasWorkingItem(Items.TOXIC_ORB))
{
- if (opponent is IBattlerEffect b && b.pbCanPoison(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanPoison(attacker, false, this))
{
- b.pbPoison(attacker, null, true);
+ b.Poison(attacker, null, true);
}
}
else if (attacker.hasWorkingItem(Items.WHITE_HERB))
@@ -9011,12 +9012,12 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
}
if (!reducedstats) break;
- battle.pbDisplay(Game._INTL("{1}'s status is returned to normal!",
+ battle.Display(Game._INTL("{1}'s status is returned to normal!",
opponent.ToString(true)));
}
}
}
- attacker.pbConsumeItem();
+ attacker.ConsumeItem();
return ret;
}
}
@@ -9029,17 +9030,17 @@ public partial class PokeBattle_Move_0F8 : PokeBattle_Move
{
public PokeBattle_Move_0F8() : base() { }
//public PokeBattle_Move_0F8(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Embargo > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Embargo = 5;
- battle.pbDisplay(Game._INTL("{1} can't use items anymore!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} can't use items anymore!", opponent.ToString()));
return 0;
}
}
@@ -9052,19 +9053,19 @@ public partial class PokeBattle_Move_0F9 : PokeBattle_Move
{
public PokeBattle_Move_0F9() : base() { }
//public PokeBattle_Move_0F9(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.MagicRoom > 0)
{
this.battle.field.MagicRoom = 0;
- battle.pbDisplay(Game._INTL("The area returned to normal!"));
+ battle.Display(Game._INTL("The area returned to normal!"));
}
else
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
this.battle.field.MagicRoom = 5;
- battle.pbDisplay(Game._INTL("It created a bizarre area in which Pokémon's held items lose their effects!"));
+ battle.Display(Game._INTL("It created a bizarre area in which Pokémon's held items lose their effects!"));
}
return 0;
}
@@ -9082,15 +9083,15 @@ public override bool isRecoilMove()
return true;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
if (!attacker.hasWorkingAbility(Abilities.ROCK_HEAD) &&
!attacker.hasWorkingAbility(Abilities.MAGIC_GUARD))
{
- attacker.pbReduceHP((int)Math.Round(turneffects.TotalDamage / 4.0f));
- battle.pbDisplay(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
+ attacker.ReduceHP((int)Math.Round(turneffects.TotalDamage / 4.0f));
+ battle.Display(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
}
}
}
@@ -9108,15 +9109,15 @@ public override bool isRecoilMove()
return true;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
if (!attacker.hasWorkingAbility(Abilities.ROCK_HEAD) &&
!attacker.hasWorkingAbility(Abilities.MAGIC_GUARD))
{
- attacker.pbReduceHP((int)Math.Round(turneffects.TotalDamage / 3.0f));
- battle.pbDisplay(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
+ attacker.ReduceHP((int)Math.Round(turneffects.TotalDamage / 3.0f));
+ battle.Display(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
}
}
}
@@ -9135,15 +9136,15 @@ public override bool isRecoilMove()
return true;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
if (!attacker.hasWorkingAbility(Abilities.ROCK_HEAD) &&
!attacker.hasWorkingAbility(Abilities.MAGIC_GUARD))
{
- attacker.pbReduceHP((int)Math.Round(turneffects.TotalDamage / 2.0f));
- battle.pbDisplay(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
+ attacker.ReduceHP((int)Math.Round(turneffects.TotalDamage / 2.0f));
+ battle.Display(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
}
}
}
@@ -9162,25 +9163,25 @@ public override bool isRecoilMove()
return true;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
if (!attacker.hasWorkingAbility(Abilities.ROCK_HEAD) &&
!attacker.hasWorkingAbility(Abilities.MAGIC_GUARD))
{
- attacker.pbReduceHP((int)Math.Round(turneffects.TotalDamage / 3.0f));
- battle.pbDisplay(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
+ attacker.ReduceHP((int)Math.Round(turneffects.TotalDamage / 3.0f));
+ battle.Display(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
}
}
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanParalyze(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanParalyze(attacker, false, this))
{
- b.pbParalyze(attacker);
+ b.Paralyze(attacker);
}
}
}
@@ -9198,25 +9199,25 @@ public override bool isRecoilMove()
return true;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
if (!attacker.hasWorkingAbility(Abilities.ROCK_HEAD) &&
!attacker.hasWorkingAbility(Abilities.MAGIC_GUARD))
{
- attacker.pbReduceHP((int)Math.Round(turneffects.TotalDamage / 3.0f));
- battle.pbDisplay(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
+ attacker.ReduceHP((int)Math.Round(turneffects.TotalDamage / 3.0f));
+ battle.Display(Game._INTL("{1} is damaged by recoil!", attacker.ToString()));
}
}
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanBurn(attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanBurn(attacker, false, this))
{
- b.pbBurn(attacker);
+ b.Burn(attacker);
}
}
}
@@ -9228,34 +9229,34 @@ public partial class PokeBattle_Move_0FF : PokeBattle_Move
{
public PokeBattle_Move_0FF() : base() { }
//public PokeBattle_Move_0FF(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- switch (this.battle.pbWeather)
+ switch (this.battle.Weather)
{
case Weather.HEAVYRAIN:
- battle.pbDisplay(Game._INTL("There is no relief from this heavy rain!"));
+ battle.Display(Game._INTL("There is no relief from this heavy rain!"));
return -1;
case Weather.HARSHSUN:
- battle.pbDisplay(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
+ battle.Display(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
return -1;
case Weather.STRONGWINDS:
- battle.pbDisplay(Game._INTL("The mysterious air current blows on regardless!"));
+ battle.Display(Game._INTL("The mysterious air current blows on regardless!"));
return -1;
case Weather.SUNNYDAY:
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.weather = Weather.SUNNYDAY;
this.battle.weatherduration = 5;
if (attacker.hasWorkingItem(Items.HEAT_ROCK)) this.battle.weatherduration = 8;
- this.battle.pbCommonAnimation("Sunny", null, null);
- battle.pbDisplay(Game._INTL("The sunlight turned harsh!"));
+ this.battle.CommonAnimation("Sunny", null, null);
+ battle.Display(Game._INTL("The sunlight turned harsh!"));
return 0;
}
}
@@ -9267,35 +9268,35 @@ public partial class PokeBattle_Move_100 : PokeBattle_Move
{
public PokeBattle_Move_100() : base() { }
//public PokeBattle_Move_100(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
switch (this.battle.weather)
{
case Weather.HEAVYRAIN:
- battle.pbDisplay(Game._INTL("There is no relief from this heavy rain!"));
+ battle.Display(Game._INTL("There is no relief from this heavy rain!"));
return -1;
case Weather.HARSHSUN:
- battle.pbDisplay(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
+ battle.Display(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
return -1;
case Weather.STRONGWINDS:
- battle.pbDisplay(Game._INTL("The mysterious air current blows on regardless!"));
+ battle.Display(Game._INTL("The mysterious air current blows on regardless!"));
return -1;
case Weather.RAINDANCE:
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
default: break;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.weather = Weather.RAINDANCE;
this.battle.weatherduration = 5;
if (attacker.hasWorkingItem(Items.DAMP_ROCK)) this.battle.weatherduration = 8;
- this.battle.pbCommonAnimation("Rain", null, null);
- battle.pbDisplay(Game._INTL("It started to rain!"));
+ this.battle.CommonAnimation("Rain", null, null);
+ battle.Display(Game._INTL("It started to rain!"));
return 0;
}
}
@@ -9307,35 +9308,35 @@ public partial class PokeBattle_Move_101 : PokeBattle_Move
{
public PokeBattle_Move_101() : base() { }
//public PokeBattle_Move_101(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- switch (this.battle.pbWeather)
+ switch (this.battle.Weather)
{
case Weather.HEAVYRAIN:
- battle.pbDisplay(Game._INTL("There is no relief from this heavy rain!"));
+ battle.Display(Game._INTL("There is no relief from this heavy rain!"));
return -1;
case Weather.HARSHSUN:
- battle.pbDisplay(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
+ battle.Display(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
return -1;
case Weather.STRONGWINDS:
- battle.pbDisplay(Game._INTL("The mysterious air current blows on regardless!"));
+ battle.Display(Game._INTL("The mysterious air current blows on regardless!"));
return -1;
case Weather.SANDSTORM:
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
default: break;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.weather = Weather.SANDSTORM;
this.battle.weatherduration = 5;
if (attacker.hasWorkingItem(Items.SMOOTH_ROCK)) this.battle.weatherduration = 8;
- this.battle.pbCommonAnimation("Sandstorm", null, null);
- battle.pbDisplay(Game._INTL("A sandstorm brewed!"));
+ this.battle.CommonAnimation("Sandstorm", null, null);
+ battle.Display(Game._INTL("A sandstorm brewed!"));
return 0;
}
}
@@ -9347,35 +9348,35 @@ public partial class PokeBattle_Move_102 : PokeBattle_Move
{
public PokeBattle_Move_102() : base() { }
//public PokeBattle_Move_102(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
switch (this.battle.weather)
{
case Weather.HEAVYRAIN:
- battle.pbDisplay(Game._INTL("There is no relief from this heavy rain!"));
+ battle.Display(Game._INTL("There is no relief from this heavy rain!"));
return -1;
case Weather.HARSHSUN:
- battle.pbDisplay(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
+ battle.Display(Game._INTL("The extremely harsh sunlight was not lessened at all!"));
return -1;
case Weather.STRONGWINDS:
- battle.pbDisplay(Game._INTL("The mysterious air current blows on regardless!"));
+ battle.Display(Game._INTL("The mysterious air current blows on regardless!"));
return -1;
case Weather.HAIL:
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
default: break;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.weather = Weather.HAIL;
this.battle.weatherduration = 5;
if (attacker.hasWorkingItem(Items.ICY_ROCK)) this.battle.weatherduration = 8;
- this.battle.pbCommonAnimation("Hail", null, null);
- battle.pbDisplay(Game._INTL("It started to hail!"));
+ this.battle.CommonAnimation("Hail", null, null);
+ battle.Display(Game._INTL("It started to hail!"));
return 0;
}
}
@@ -9387,23 +9388,23 @@ public partial class PokeBattle_Move_103 : PokeBattle_Move
{
public PokeBattle_Move_103() : base() { }
//public PokeBattle_Move_103(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOpposingSide.Spikes >= 3)
+ if (attacker.OpposingSide.Spikes >= 3)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOpposingSide.Spikes += 1;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.Spikes += 1;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Spikes were scattered all around the opposing team's feet!"));
+ battle.Display(Game._INTL("Spikes were scattered all around the opposing team's feet!"));
}
else
{
- battle.pbDisplay(Game._INTL("Spikes were scattered all around your team's feet!"));
+ battle.Display(Game._INTL("Spikes were scattered all around your team's feet!"));
}
return 0;
}
@@ -9417,23 +9418,23 @@ public partial class PokeBattle_Move_104 : PokeBattle_Move
{
public PokeBattle_Move_104() : base() { }
//public PokeBattle_Move_104(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOpposingSide.ToxicSpikes >= 2)
+ if (attacker.OpposingSide.ToxicSpikes >= 2)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOpposingSide.ToxicSpikes += 1;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.ToxicSpikes += 1;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Poison spikes were scattered all around the opposing team's feet!"));
+ battle.Display(Game._INTL("Poison spikes were scattered all around the opposing team's feet!"));
}
else
{
- battle.pbDisplay(Game._INTL("Poison spikes were scattered all around your team's feet!"));
+ battle.Display(Game._INTL("Poison spikes were scattered all around your team's feet!"));
}
return 0;
}
@@ -9446,23 +9447,23 @@ public partial class PokeBattle_Move_105 : PokeBattle_Move
{
public PokeBattle_Move_105() : base() { }
//public PokeBattle_Move_105(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOpposingSide.StealthRock)
+ if (attacker.OpposingSide.StealthRock)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOpposingSide.StealthRock = true;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.StealthRock = true;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Pointed stones float in the air around the opposing team!"));
+ battle.Display(Game._INTL("Pointed stones float in the air around the opposing team!"));
}
else
{
- battle.pbDisplay(Game._INTL("Pointed stones float in the air around your team!"));
+ battle.Display(Game._INTL("Pointed stones float in the air around your team!"));
}
return 0;
}
@@ -9477,13 +9478,13 @@ public partial class PokeBattle_Move_106 : PokeBattle_Move
{
public PokeBattle_Move_106() : base() { }
//public PokeBattle_Move_106(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
this.doubledamage = false; this.overridetype = false;
if (attacker.effects.FirstPledge == Attack.Data.Effects.x146 || // Fire Pledge
attacker.effects.FirstPledge == Attack.Data.Effects.x145) // Water Pledge
{
- battle.pbDisplay(Game._INTL("The two moves have become one! It's a combined move!"));
+ battle.Display(Game._INTL("The two moves have become one! It's a combined move!"));
this.doubledamage = true;
if (attacker.effects.FirstPledge == Attack.Data.Effects.x146) // Fire Pledge
{
@@ -9493,7 +9494,7 @@ public override bool pbOnStartUse(IBattler attacker)
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (this.doubledamage)
{
@@ -9502,38 +9503,38 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override Types pbModifyType(Types type, IBattler attacker, IBattler opponent)
+ public override Types ModifyType(Types type, IBattler attacker, IBattler opponent)
{
if (this.overridetype)
{
type = Types.FIRE;
}
- return base.pbModifyType(type, attacker, opponent);
+ return base.ModifyType(type, attacker, opponent);
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (!this.battle.doublebattle || attacker.pbPartner.Species == Pokemons.NONE || attacker.pbPartner.isFainted())
+ if (!this.battle.doublebattle || attacker.Partner.Species == Pokemons.NONE || attacker.Partner.isFainted())
{
attacker.effects.FirstPledge = 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
// Combined move's effect
if (attacker.effects.FirstPledge == Attack.Data.Effects.x146) // Fire Pledge
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- attacker.pbOpposingSide.SeaOfFire = 4;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.SeaOfFire = 4;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("A sea of fire enveloped the opposing team!"));
- this.battle.pbCommonAnimation("SeaOfFireOpp", null, null);
+ battle.Display(Game._INTL("A sea of fire enveloped the opposing team!"));
+ this.battle.CommonAnimation("SeaOfFireOpp", null, null);
}
else
{
- battle.pbDisplay(Game._INTL("A sea of fire enveloped your team!"));
- this.battle.pbCommonAnimation("SeaOfFire", null, null);
+ battle.Display(Game._INTL("A sea of fire enveloped your team!"));
+ this.battle.CommonAnimation("SeaOfFire", null, null);
}
}
@@ -9542,19 +9543,19 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
else if (attacker.effects.FirstPledge == Attack.Data.Effects.x145)// Water Pledge
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- attacker.pbOpposingSide.Swamp = 4;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.Swamp = 4;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("A swamp enveloped the opposing team!"));
- this.battle.pbCommonAnimation("SwampOpp", null, null);
+ battle.Display(Game._INTL("A swamp enveloped the opposing team!"));
+ this.battle.CommonAnimation("SwampOpp", null, null);
}
else
{
- battle.pbDisplay(Game._INTL("A swamp enveloped your team!"));
- this.battle.pbCommonAnimation("Swamp", null, null);
+ battle.Display(Game._INTL("A swamp enveloped your team!"));
+ this.battle.CommonAnimation("Swamp", null, null);
}
}
@@ -9564,14 +9565,14 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
// Set up partner for a combined move
attacker.effects.FirstPledge = 0;
Attack.Data.Effects partnermove = Attack.Data.Effects.NONE; //-1;
- if ((int)this.battle.choices[attacker.pbPartner.Index].Action == 1) // Chose a move
+ if ((int)this.battle.choices[attacker.Partner.Index].Action == 1) // Chose a move
{
- if (!attacker.pbPartner.hasMovedThisRound())
+ if (!attacker.Partner.hasMovedThisRound())
{
- Moves move = this.battle.choices[attacker.pbPartner.Index].Move.id;
+ Moves move = this.battle.choices[attacker.Partner.Index].Move.id;
if (move > 0)
{
- partnermove = this.battle.choices[attacker.pbPartner.Index].Move.Effect;
+ partnermove = this.battle.choices[attacker.Partner.Index].Move.Effect;
}
}
@@ -9579,23 +9580,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (partnermove == Attack.Data.Effects.x146 || // Fire Pledge
partnermove == Attack.Data.Effects.x145) // Water Pledge
{
- battle.pbDisplay(Game._INTL("{1} is waiting for {2}'s move...", attacker.ToString(), attacker.pbPartner.ToString(true)));
- attacker.pbPartner.effects.FirstPledge = this.Effect;//(Attack.Effect)
- attacker.pbPartner.effects.MoveNext = true;
+ battle.Display(Game._INTL("{1} is waiting for {2}'s move...", attacker.ToString(), attacker.Partner.ToString(true)));
+ attacker.Partner.effects.FirstPledge = this.Effect;//(Attack.Effect)
+ attacker.Partner.effects.MoveNext = true;
return 0;
}
// Use the move on its own
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.overridetype)
{
- base.pbShowAnimation(Moves.FIRE_PLEDGE, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(Moves.FIRE_PLEDGE, attacker, opponent, hitnum, alltargets, showanimation);
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -9608,13 +9609,13 @@ public partial class PokeBattle_Move_107 : PokeBattle_Move
{
public PokeBattle_Move_107() : base() { }
//public PokeBattle_Move_107(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
this.doubledamage = false; this.overridetype = false;
if (attacker.effects.FirstPledge == Attack.Data.Effects.x147 || // Grass Pledge
attacker.effects.FirstPledge == Attack.Data.Effects.x145) // Water Pledge
{
- battle.pbDisplay(Game._INTL("The two moves have become one! It's a combined move!"));
+ battle.Display(Game._INTL("The two moves have become one! It's a combined move!"));
this.doubledamage = true;
if (attacker.effects.FirstPledge == Attack.Data.Effects.x145) // Water Pledge
{
@@ -9624,7 +9625,7 @@ public override bool pbOnStartUse(IBattler attacker)
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (this.doubledamage)
{
@@ -9633,40 +9634,40 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override Types pbModifyType(Types type, IBattler attacker, IBattler opponent)
+ public override Types ModifyType(Types type, IBattler attacker, IBattler opponent)
{
if (this.overridetype)
{
type = Types.WATER;
}
- return base.pbModifyType(type, attacker, opponent);
+ return base.ModifyType(type, attacker, opponent);
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (!this.battle.doublebattle || attacker.pbPartner.Species == Pokemons.NONE || attacker.pbPartner.isFainted())
+ if (!this.battle.doublebattle || attacker.Partner.Species == Pokemons.NONE || attacker.Partner.isFainted())
{
attacker.effects.FirstPledge = 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
// Combined move's effect
if (attacker.effects.FirstPledge == Attack.Data.Effects.x147) // Grass Pledge
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- attacker.pbOpposingSide.SeaOfFire = 4;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.SeaOfFire = 4;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("A sea of fire enveloped the opposing team!"));
- this.battle.pbCommonAnimation("SeaOfFireOpp", null, null);
+ battle.Display(Game._INTL("A sea of fire enveloped the opposing team!"));
+ this.battle.CommonAnimation("SeaOfFireOpp", null, null);
}
else
{
- battle.pbDisplay(Game._INTL("A sea of fire enveloped your team!"));
- this.battle.pbCommonAnimation("SeaOfFire", null, null);
+ battle.Display(Game._INTL("A sea of fire enveloped your team!"));
+ this.battle.CommonAnimation("SeaOfFire", null, null);
}
}
@@ -9675,19 +9676,19 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
else if (attacker.effects.FirstPledge == Attack.Data.Effects.x145) // Water Pledge
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- attacker.pbOwnSide.Rainbow = 4;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.Rainbow = 4;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("A rainbow appeared in the sky on your team's side!"));
- this.battle.pbCommonAnimation("Rainbow", null, null);
+ battle.Display(Game._INTL("A rainbow appeared in the sky on your team's side!"));
+ this.battle.CommonAnimation("Rainbow", null, null);
}
else
{
- battle.pbDisplay(Game._INTL("A rainbow appeared in the sky on the opposing team's side!"));
- this.battle.pbCommonAnimation("RainbowOpp", null, null);
+ battle.Display(Game._INTL("A rainbow appeared in the sky on the opposing team's side!"));
+ this.battle.CommonAnimation("RainbowOpp", null, null);
}
}
@@ -9697,14 +9698,14 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
// Set up partner for a combined move
attacker.effects.FirstPledge = 0;
Attack.Data.Effects partnermove = Attack.Data.Effects.NONE; //-1;
- if ((int)this.battle.choices[attacker.pbPartner.Index].Action == 1) // Chose a move
+ if ((int)this.battle.choices[attacker.Partner.Index].Action == 1) // Chose a move
{
- if (!attacker.pbPartner.hasMovedThisRound())
+ if (!attacker.Partner.hasMovedThisRound())
{
- Moves move = this.battle.choices[attacker.pbPartner.Index].Move.id;
- if (move > 0) //move &&
+ Moves move = this.battle.choices[attacker.Partner.Index].Move.id;
+ if (move > 0) //move &&
{
- partnermove = this.battle.choices[attacker.pbPartner.Index].Move.Effect;
+ partnermove = this.battle.choices[attacker.Partner.Index].Move.Effect;
}
}
@@ -9712,23 +9713,23 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (partnermove == Attack.Data.Effects.x147 || // Grass Pledge
partnermove == Attack.Data.Effects.x145) // Water Pledge
{
- battle.pbDisplay(Game._INTL("{1} is waiting for {2}'s move...", attacker.ToString(), attacker.pbPartner.ToString(true)));
- attacker.pbPartner.effects.FirstPledge = this.Effect;//(Attack.Effect)
- attacker.pbPartner.effects.MoveNext = true;
+ battle.Display(Game._INTL("{1} is waiting for {2}'s move...", attacker.ToString(), attacker.Partner.ToString(true)));
+ attacker.Partner.effects.FirstPledge = this.Effect;//(Attack.Effect)
+ attacker.Partner.effects.MoveNext = true;
return 0;
}
// Use the move on its own
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.overridetype)
{
- base.pbShowAnimation(Moves.WATER_PLEDGE, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(Moves.WATER_PLEDGE, attacker, opponent, hitnum, alltargets, showanimation);
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -9741,13 +9742,13 @@ public partial class PokeBattle_Move_108 : PokeBattle_Move
{
public PokeBattle_Move_108() : base() { }
//public PokeBattle_Move_108(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbOnStartUse(IBattler attacker)
+ public override bool OnStartUse(IBattler attacker)
{
this.doubledamage = false; this.overridetype = false;
if (attacker.effects.FirstPledge == Attack.Data.Effects.x147 || // Grass Pledge
attacker.effects.FirstPledge == Attack.Data.Effects.x146) // Fire Pledge
{
- battle.pbDisplay(Game._INTL("The two moves have become one! It's a combined move!"));
+ battle.Display(Game._INTL("The two moves have become one! It's a combined move!"));
this.doubledamage = true;
if (attacker.effects.FirstPledge == Attack.Data.Effects.x147) // Grass Pledge
{
@@ -9757,7 +9758,7 @@ public override bool pbOnStartUse(IBattler attacker)
return true;
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (this.doubledamage)
{
@@ -9766,39 +9767,39 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
- public override Types pbModifyType(Types type, IBattler attacker, IBattler opponent)
+ public override Types ModifyType(Types type, IBattler attacker, IBattler opponent)
{
if (this.overridetype)
{
type = Types.GRASS;
}
- return base.pbModifyType(type, attacker, opponent);
+ return base.ModifyType(type, attacker, opponent);
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (!this.battle.doublebattle || attacker.pbPartner.Species == Pokemons.NONE || attacker.pbPartner.isFainted())
+ if (!this.battle.doublebattle || attacker.Partner.Species == Pokemons.NONE || attacker.Partner.isFainted())
{
attacker.effects.FirstPledge = 0;
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
// Combined move's effect
if (attacker.effects.FirstPledge == Attack.Data.Effects.x147) // Grass Pledge
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- attacker.pbOpposingSide.Swamp = 4;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.Swamp = 4;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("A swamp enveloped the opposing team!"));
- this.battle.pbCommonAnimation("SwampOpp", null, null);
+ battle.Display(Game._INTL("A swamp enveloped the opposing team!"));
+ this.battle.CommonAnimation("SwampOpp", null, null);
}
else
{
- battle.pbDisplay(Game._INTL("A swamp enveloped your team!"));
- this.battle.pbCommonAnimation("Swamp", null, null);
+ battle.Display(Game._INTL("A swamp enveloped your team!"));
+ this.battle.CommonAnimation("Swamp", null, null);
}
}
@@ -9807,19 +9808,19 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
else if (attacker.effects.FirstPledge == Attack.Data.Effects.x146) // Fire Pledge
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- attacker.pbOwnSide.Rainbow = 4;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.Rainbow = 4;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("A rainbow appeared in the sky on your team's side!"));
- this.battle.pbCommonAnimation("Rainbow", null, null);
+ battle.Display(Game._INTL("A rainbow appeared in the sky on your team's side!"));
+ this.battle.CommonAnimation("Rainbow", null, null);
}
else
{
- battle.pbDisplay(Game._INTL("A rainbow appeared in the sky on the opposing team's side!"));
- this.battle.pbCommonAnimation("RainbowOpp", null, null);
+ battle.Display(Game._INTL("A rainbow appeared in the sky on the opposing team's side!"));
+ this.battle.CommonAnimation("RainbowOpp", null, null);
}
}
@@ -9829,36 +9830,36 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
// Set up partner for a combined move
attacker.effects.FirstPledge = 0;
Attack.Data.Effects partnermove = Attack.Data.Effects.NONE; //-1;
- if ((int)this.battle.choices[attacker.pbPartner.Index].Action == 1) // Chose a move
+ if ((int)this.battle.choices[attacker.Partner.Index].Action == 1) // Chose a move
{
- if (!attacker.pbPartner.hasMovedThisRound())
+ if (!attacker.Partner.hasMovedThisRound())
{
- Moves move = this.battle.choices[attacker.pbPartner.Index].Move.id;
- if (move > 0) //move != null &&
+ Moves move = this.battle.choices[attacker.Partner.Index].Move.id;
+ if (move > 0) //move != null &&
{
- partnermove = this.battle.choices[attacker.pbPartner.Index].Move.Effect;
+ partnermove = this.battle.choices[attacker.Partner.Index].Move.Effect;
}
}
}
if (partnermove == Attack.Data.Effects.x147 || // Grass Pledge
partnermove == Attack.Data.Effects.x146) // Fire Pledge
{
- battle.pbDisplay(Game._INTL("{1} is waiting for {2}'s move...", attacker.ToString(), attacker.pbPartner.ToString(true)));
- attacker.pbPartner.effects.FirstPledge = this.Effect;//(Attack.Effect)
- attacker.pbPartner.effects.MoveNext = true;
+ battle.Display(Game._INTL("{1} is waiting for {2}'s move...", attacker.ToString(), attacker.Partner.ToString(true)));
+ attacker.Partner.effects.FirstPledge = this.Effect;//(Attack.Effect)
+ attacker.Partner.effects.MoveNext = true;
return 0;
}
// Use the move on its own
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.overridetype)
{
- base.pbShowAnimation(Moves.GRASS_PLEDGE, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(Moves.GRASS_PLEDGE, attacker, opponent, hitnum, alltargets, showanimation);
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -9869,18 +9870,18 @@ public partial class PokeBattle_Move_109 : PokeBattle_Move
{
public PokeBattle_Move_109() : base() { }
//public PokeBattle_Move_109(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
- if (this.battle.pbOwnedByPlayer(attacker.Index))
+ if (this.battle.OwnedByPlayer(attacker.Index))
{
this.battle.extramoney += 5 * attacker.Level;
if (this.battle.extramoney > Core.MAXMONEY) this.battle.extramoney = Core.MAXMONEY;
}
- battle.pbDisplay(Game._INTL("Coins were scattered everywhere!"));
+ battle.Display(Game._INTL("Coins were scattered everywhere!"));
}
return ret;
}
@@ -9893,50 +9894,50 @@ public partial class PokeBattle_Move_10A : PokeBattle_Move
{
public PokeBattle_Move_10A() : base() { }
//public PokeBattle_Move_10A(Battle battle, Attack.Move move) : base(battle, move) { }
- public int pbCalcDamage(IBattler attacker, IBattler opponent)
+ public int CalcDamage(IBattler attacker, IBattler opponent)
{
- return base.pbCalcDamage(attacker, opponent, Core.NOREFLECT);
+ return base.CalcDamage(attacker, opponent, Core.NOREFLECT);
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (attacker.pbOpposingSide.Reflect > 0)
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (attacker.OpposingSide.Reflect > 0)
{
- attacker.pbOpposingSide.Reflect = 0;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.Reflect = 0;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("The opposing team's Reflect wore off!"));
+ battle.Display(Game._INTL("The opposing team's Reflect wore off!"));
}
else
{
- battle.pbDisplayPaused(Game._INTL("Your team's Reflect wore off!"));
+ battle.DisplayPaused(Game._INTL("Your team's Reflect wore off!"));
}
}
- if (attacker.pbOpposingSide.LightScreen > 0)
+ if (attacker.OpposingSide.LightScreen > 0)
{
- attacker.pbOpposingSide.LightScreen = 0;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.LightScreen = 0;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("The opposing team's Light Screen wore off!"));
+ battle.Display(Game._INTL("The opposing team's Light Screen wore off!"));
}
else
{
- battle.pbDisplay(Game._INTL("Your team's Light Screen wore off!"));
+ battle.Display(Game._INTL("Your team's Light Screen wore off!"));
}
}
return ret;
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOpposingSide.Reflect > 0 ||
- attacker.pbOpposingSide.LightScreen > 0)
+ if (attacker.OpposingSide.Reflect > 0 ||
+ attacker.OpposingSide.LightScreen > 0)
{
- base.pbShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Wall-breaking anim;
+ base.ShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Wall-breaking anim;
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -9966,27 +9967,27 @@ public partial class PokeBattle_Move_10C : PokeBattle_Move
{
public PokeBattle_Move_10C() : base() { }
//public PokeBattle_Move_10C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Substitute > 0)
{
- battle.pbDisplay(Game._INTL("{1} already has a substitute!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} already has a substitute!", attacker.ToString()));
return -1;
}
int sublife = (int)Math.Max(Math.Floor(attacker.TotalHP / 4f), 1);
if (attacker.HP <= sublife)
{
- battle.pbDisplay(Game._INTL("It was too weak to make a substitute!"));
+ battle.Display(Game._INTL("It was too weak to make a substitute!"));
return -1;
}
- attacker.pbReduceHP(sublife, false, false);
+ attacker.ReduceHP(sublife, false, false);
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.MultiTurn = 0;
attacker.effects.MultiTurnAttack = 0;
attacker.effects.Substitute = sublife;
- battle.pbDisplay(Game._INTL("{1} put in a substitute!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} put in a substitute!", attacker.ToString()));
return 0;
}
}
@@ -10002,51 +10003,51 @@ public partial class PokeBattle_Move_10D : PokeBattle_Move
{
public PokeBattle_Move_10D() : base() { }
//public PokeBattle_Move_10D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool failed = false;
- if (attacker.pbHasType(Types.GHOST))
+ if (attacker.HasType(Types.GHOST))
{
if (opponent.effects.Curse ||
- opponent.pbOwnSide.CraftyShield)
+ opponent.OwnSide.CraftyShield)
{
failed = true;
}
else
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("{1} cut its own HP and laid a curse on {2}!", attacker.ToString(), opponent.ToString(true)));
+ battle.Display(Game._INTL("{1} cut its own HP and laid a curse on {2}!", attacker.ToString(), opponent.ToString(true)));
opponent.effects.Curse = true;
- attacker.pbReduceHP((int)Math.Floor(attacker.TotalHP / 2f));
+ attacker.ReduceHP((int)Math.Floor(attacker.TotalHP / 2f));
}
}
else
{
- bool lowerspeed = attacker is IBattlerEffect b0 && b0.pbCanReduceStatStage(Stats.SPEED, attacker, false, this);
- bool raiseatk = attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this);
- bool raisedef = attacker is IBattlerEffect b2 && b2.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this);
+ bool lowerspeed = attacker is IBattlerEffect b0 && b0.CanReduceStatStage(Stats.SPEED, attacker, false, this);
+ bool raiseatk = attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this);
+ bool raisedef = attacker is IBattlerEffect b2 && b2.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this);
if (!lowerspeed && !raiseatk && !raisedef)
{
failed = true;
}
else
{
- pbShowAnimation(this.id, attacker, null, 1, alltargets, showanimation); // Non-Ghost move animation;
+ ShowAnimation(this.id, attacker, null, 1, alltargets, showanimation); // Non-Ghost move animation;
if (lowerspeed)
{
- (attacker as IBattlerEffect).pbReduceStat(Stats.SPEED, 1, attacker, false, this);
+ (attacker as IBattlerEffect).ReduceStat(Stats.SPEED, 1, attacker, false, this);
}
bool showanim = true;
if (raiseatk)
{
- (attacker as IBattlerEffect).pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ (attacker as IBattlerEffect).IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
if (raisedef)
{
- (attacker as IBattlerEffect).pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ (attacker as IBattlerEffect).IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
@@ -10054,7 +10055,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (failed)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
}
return failed ? -1 : 0;
}
@@ -10067,23 +10068,23 @@ public partial class PokeBattle_Move_10E : PokeBattle_Move
{
public PokeBattle_Move_10E() : base() { }
//public PokeBattle_Move_10E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
foreach (var i in opponent.moves)
{
if (i.id == opponent.lastMoveUsed && i.id > 0 && i.PP > 0)
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int reduction = Math.Min(4, i.PP);
- opponent.pbSetPP(i, (byte)(i.PP - reduction));
+ opponent.SetPP(i, (byte)(i.PP - reduction));
- battle.pbDisplay(Game._INTL("It reduced the PP of {1}'s {2} by {3}!", opponent.ToString(true), Kernal.MoveData[i.id].Name, ((int)reduction).ToString()));
+ battle.Display(Game._INTL("It reduced the PP of {1}'s {2} by {3}!", opponent.ToString(true), Kernal.MoveData[i.id].Name, ((int)reduction).ToString()));
return 0;
}
}
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
}
@@ -10095,18 +10096,18 @@ public partial class PokeBattle_Move_10F : PokeBattle_Move
{
public PokeBattle_Move_10F() : base() { }
//public PokeBattle_Move_10F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.Status != Status.SLEEP || opponent.effects.Nightmare ||
(opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker)))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Nightmare = true;
- battle.pbDisplay(Game._INTL("{1} began having a nightmare!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} began having a nightmare!", opponent.ToString()));
return 0;
}
}
@@ -10119,7 +10120,7 @@ public partial class PokeBattle_Move_110 : PokeBattle_Move
{
public PokeBattle_Move_110() : base() { }
//public PokeBattle_Move_110(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
@@ -10128,7 +10129,7 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
string mtattack = Game._INTL(attacker.effects.MultiTurnAttack.ToString(TextScripts.Name));
IBattler mtuser = this.battle.battlers[attacker.effects.MultiTurnUser];
- battle.pbDisplay(Game._INTL("{1} got free of {2}'s {3}!", attacker.ToString(), mtuser.ToString(true), mtattack));
+ battle.Display(Game._INTL("{1} got free of {2}'s {3}!", attacker.ToString(), mtuser.ToString(true), mtattack));
attacker.effects.MultiTurn = 0;
attacker.effects.MultiTurnAttack = 0;
attacker.effects.MultiTurnUser = -1;
@@ -10136,29 +10137,29 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
if (attacker.effects.LeechSeed >= 0)
{
attacker.effects.LeechSeed = -1;
- battle.pbDisplay(Game._INTL("{1} shed Leech Seed!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} shed Leech Seed!", attacker.ToString()));
}
- if (attacker.pbOwnSide.StealthRock)
+ if (attacker.OwnSide.StealthRock)
{
- attacker.pbOwnSide.StealthRock = false;
+ attacker.OwnSide.StealthRock = false;
- battle.pbDisplay(Game._INTL("{1} blew away stealth rocks!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} blew away stealth rocks!", attacker.ToString()));
}
- if (attacker.pbOwnSide.Spikes > 0)
+ if (attacker.OwnSide.Spikes > 0)
{
- attacker.pbOwnSide.Spikes = 0;
- battle.pbDisplay(Game._INTL("{1} blew away Spikes!", attacker.ToString()));
+ attacker.OwnSide.Spikes = 0;
+ battle.Display(Game._INTL("{1} blew away Spikes!", attacker.ToString()));
}
- if (attacker.pbOwnSide.ToxicSpikes > 0)
+ if (attacker.OwnSide.ToxicSpikes > 0)
{
- attacker.pbOwnSide.ToxicSpikes = 0;
- battle.pbDisplay(Game._INTL("{1} blew away poison spikes!", attacker.ToString()));
+ attacker.OwnSide.ToxicSpikes = 0;
+ battle.Display(Game._INTL("{1} blew away poison spikes!", attacker.ToString()));
}
- if (attacker.pbOwnSide.StickyWeb)
+ if (attacker.OwnSide.StickyWeb)
{
- attacker.pbOwnSide.StickyWeb = false;
+ attacker.OwnSide.StickyWeb = false;
- battle.pbDisplay(Game._INTL("{1} blew away sticky webs!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} blew away sticky webs!", attacker.ToString()));
}
}
}
@@ -10171,27 +10172,27 @@ public partial class PokeBattle_Move_111 : PokeBattle_Move
{
public PokeBattle_Move_111() : base() { }
//public PokeBattle_Move_111(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbDisplayUseMessage(IBattler attacker)
+ public override int DisplayUseMessage(IBattler attacker)
{
if (this.battle.futuresight) return 0;
- return base.pbDisplayUseMessage(attacker);
+ return base.DisplayUseMessage(attacker);
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.FutureSight > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if (this.battle.futuresight)
{
// Attack hits
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
/// Attack is launched
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
opponent.effects.FutureSight = 3;
opponent.effects.FutureSightMove = this.id;
@@ -10201,22 +10202,22 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (id == Moves.FUTURE_SIGHT)
{
- battle.pbDisplay(Game._INTL("{1} foresaw an attack!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} foresaw an attack!", attacker.ToString()));
}
else
{
- battle.pbDisplay(Game._INTL("{1} chose Doom Desire as its destiny!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} chose Doom Desire as its destiny!", attacker.ToString()));
}
return 0;
}
- public override void pbShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override void ShowAnimation(Moves id, IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.futuresight)
{
- base.pbShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Hit opponent anim;
+ base.ShowAnimation(id, attacker, opponent, 1, alltargets, showanimation); // Hit opponent anim;
}
- base.pbShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
+ base.ShowAnimation(id, attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -10228,28 +10229,28 @@ public partial class PokeBattle_Move_112 : PokeBattle_Move
{
public PokeBattle_Move_112() : base() { }
//public PokeBattle_Move_112(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Stockpile >= 3)
{
- battle.pbDisplay(Game._INTL("{1} can't stockpile any more!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} can't stockpile any more!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
attacker.effects.Stockpile += 1;
- battle.pbDisplay(Game._INTL("{1} stockpiled {2}!",attacker.ToString(),
+ battle.Display(Game._INTL("{1} stockpiled {2}!",attacker.ToString(),
attacker.effects.Stockpile));
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
attacker.effects.StockpileDef += 1;
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
attacker.effects.StockpileSpDef += 1;
showanim = false;
}
@@ -10265,35 +10266,35 @@ public partial class PokeBattle_Move_113 : PokeBattle_Move
{
public PokeBattle_Move_113() : base() { }
//public PokeBattle_Move_113(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
return (attacker.effects.Stockpile == 0);
}
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
return 100 * attacker.effects.Stockpile;
}
- public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
+ public override void EffectAfterHit(IBattler attacker, IBattler opponent, IEffectsMove turneffects)
{
if (!attacker.isFainted() && turneffects.TotalDamage > 0)
{
bool showanim = true;
if (attacker.effects.StockpileDef > 0)
{
- if (attacker is IBattlerEffect b && b.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbReduceStat(Stats.DEFENSE, attacker.effects.StockpileDef,
+ b.ReduceStat(Stats.DEFENSE, attacker.effects.StockpileDef,
attacker, false, this, showanim);
showanim = false;
}
}
if (attacker.effects.StockpileSpDef > 0)
{
- if (attacker is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanReduceStatStage(Stats.SPDEF, attacker, false, this))
{
- b.pbReduceStat(Stats.SPDEF, attacker.effects.StockpileSpDef,
+ b.ReduceStat(Stats.SPDEF, attacker.effects.StockpileSpDef,
attacker, false, this, showanim);
showanim = false;
}
@@ -10302,7 +10303,7 @@ public override void pbEffectAfterHit(IBattler attacker, IBattler opponent, IEff
attacker.effects.Stockpile = 0;
attacker.effects.StockpileDef = 0;
attacker.effects.StockpileSpDef = 0;
- battle.pbDisplay(Game._INTL("{1}'s stockpiled effect wore off!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stockpiled effect wore off!", attacker.ToString()));
}
}
}
@@ -10320,13 +10321,13 @@ public override bool isHealingMove()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
int hpgain = 0;
switch (attacker.effects.Stockpile)
{
case 0:
- battle.pbDisplay(Game._INTL("But it failed to swallow a thing!"));
+ battle.Display(Game._INTL("But it failed to swallow a thing!"));
return -1;
case 1:
hpgain = (int)Math.Floor(attacker.TotalHP / 4f); break;
@@ -10340,29 +10341,29 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.effects.StockpileDef == 0 &&
attacker.effects.StockpileSpDef == 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- if (attacker.pbRecoverHP(hpgain, true) > 0)
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ if (attacker.RecoverHP(hpgain, true) > 0)
{
- battle.pbDisplay(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s HP was restored.", attacker.ToString()));
}
bool showanim = true;
if (attacker.effects.StockpileDef > 0)
{
- if (attacker is IBattlerEffect b && b.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbReduceStat(Stats.DEFENSE, attacker.effects.StockpileDef,
+ b.ReduceStat(Stats.DEFENSE, attacker.effects.StockpileDef,
attacker, false, this, showanim);
showanim = false;
}
}
if (attacker.effects.StockpileSpDef > 0)
{
- if (attacker is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanReduceStatStage(Stats.SPDEF, attacker, false, this))
{
- b.pbReduceStat(Stats.SPDEF, attacker.effects.StockpileSpDef,
+ b.ReduceStat(Stats.SPDEF, attacker.effects.StockpileSpDef,
attacker, false, this, showanim);
showanim = false;
}
@@ -10371,7 +10372,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
attacker.effects.Stockpile = 0;
attacker.effects.StockpileDef = 0;
attacker.effects.StockpileSpDef = 0;
- battle.pbDisplay(Game._INTL("{1}'s stockpiled effect wore off!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stockpiled effect wore off!", attacker.ToString()));
return 0;
}
}
@@ -10383,14 +10384,14 @@ public partial class PokeBattle_Move_115 : PokeBattle_Move
{
public PokeBattle_Move_115() : base() { }
//public PokeBattle_Move_115(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbDisplayUseMessage(IBattler attacker)
+ public override int DisplayUseMessage(IBattler attacker)
{
if (attacker.lastHPLost > 0)
{
- battle.pbDisplayBrief(Game._INTL("{1} lost its focus and couldn't move!", attacker.ToString()));
+ battle.DisplayBrief(Game._INTL("{1} lost its focus and couldn't move!", attacker.ToString()));
return -1;
}
- return base.pbDisplayUseMessage(attacker);
+ return base.DisplayUseMessage(attacker);
}
}
@@ -10402,11 +10403,11 @@ public partial class PokeBattle_Move_116 : PokeBattle_Move
{
public PokeBattle_Move_116() : base() { }
//public PokeBattle_Move_116(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
if ((int)this.battle.choices[opponent.Index].Action != 1) return true; // Didn't choose a move
IBattleMove oppmove = this.battle.choices[opponent.Index].Move;
- if (oppmove.id <= 0 || oppmove.pbIsStatus) return true;
+ if (oppmove.id <= 0 || oppmove.IsStatus) return true;
if (opponent.hasMovedThisRound() && oppmove.Effect != Attack.Data.Effects.x073) return true; // Me First
return false;
}
@@ -10420,21 +10421,21 @@ public partial class PokeBattle_Move_117 : PokeBattle_Move
{
public PokeBattle_Move_117() : base() { }
//public PokeBattle_Move_117(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (!this.battle.doublebattle)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.FollowMe = 1;
- if (!attacker.pbPartner.isFainted() && attacker.pbPartner.effects.FollowMe > 0)
+ if (!attacker.Partner.isFainted() && attacker.Partner.effects.FollowMe > 0)
{
- attacker.effects.FollowMe = attacker.pbPartner.effects.FollowMe + 1;
+ attacker.effects.FollowMe = attacker.Partner.effects.FollowMe + 1;
}
- battle.pbDisplay(Game._INTL("{1} became the center of attention!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} became the center of attention!", attacker.ToString()));
return 0;
}
}
@@ -10447,14 +10448,14 @@ public partial class PokeBattle_Move_118 : PokeBattle_Move
{
public PokeBattle_Move_118() : base() { }
//public PokeBattle_Move_118(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.Gravity > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
this.battle.field.Gravity = 5;
for (int i = 0; i < 4; i++)
@@ -10481,7 +10482,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
}
- battle.pbDisplay(Game._INTL("Gravity intensified!"));
+ battle.Display(Game._INTL("Gravity intensified!"));
return 0;
}
}
@@ -10498,19 +10499,19 @@ public override bool UnusableInGravity()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.Ingrain ||
attacker.effects.SmackDown ||
attacker.effects.MagnetRise > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.MagnetRise = 5;
- battle.pbDisplay(Game._INTL("{1} levitated with electromagnetism!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} levitated with electromagnetism!", attacker.ToString()));
return 0;
}
}
@@ -10527,19 +10528,19 @@ public override bool UnusableInGravity()
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Ingrain ||
opponent.effects.SmackDown ||
opponent.effects.Telekinesis > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Telekinesis = 3;
- battle.pbDisplay(Game._INTL("{1} was hurled into the air!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was hurled into the air!", opponent.ToString()));
return 0;
}
}
@@ -10551,18 +10552,18 @@ public partial class PokeBattle_Move_11B : PokeBattle_Move
{
public PokeBattle_Move_11B() : base() { }
//public PokeBattle_Move_11B(Battle battle, Attack.Move move) : base(battle, move) { }
- // Handled in Pokemon's pbSuccessCheck, do not edit!
+ // Handled in Pokemon's SuccessCheck, do not edit!
}
///
/// Grounds the target while it remains active. (Smack Down, Thousand Arrows)
- /// (Handled in Pokemon's pbSuccessCheck): Hits some semi-invulnerable targets.
+ /// (Handled in Pokemon's SuccessCheck): Hits some semi-invulnerable targets.
///
public partial class PokeBattle_Move_11C : PokeBattle_Move
{
public PokeBattle_Move_11C() : base() { }
//public PokeBattle_Move_11C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler opponent)
+ public override int BaseDamage(int basedmg, IBattler attacker, IBattler opponent)
{
if (Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x09C ||// Fly
Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x108 || // Bounce
@@ -10574,16 +10575,16 @@ public override int pbBaseDamage(int basedmg, IBattler attacker, IBattler oppone
return basedmg;
}
//ToDo: Double check this one
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 &&
!opponent.damagestate.Substitute &&
!opponent.effects.Roost)
{
opponent.effects.SmackDown = true;
- bool showmsg = opponent.pbHasType(Types.FLYING) ||
+ bool showmsg = opponent.HasType(Types.FLYING) ||
opponent.hasWorkingAbility(Abilities.LEVITATE);
if (Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x09C ||// Fly
Kernal.MoveData[(Moves)opponent.effects.TwoTurnAttack].Effect == Attack.Data.Effects.x108) // Bounce
@@ -10598,7 +10599,7 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
{
opponent.effects.Telekinesis = 0; showmsg = true;
}
- if (showmsg) battle.pbDisplay(Game._INTL("{1} fell straight down!", opponent.ToString()));
+ if (showmsg) battle.Display(Game._INTL("{1} fell straight down!", opponent.ToString()));
}
return ret;
}
@@ -10611,7 +10612,7 @@ public partial class PokeBattle_Move_11D : PokeBattle_Move
{
public PokeBattle_Move_11D() : base() { }
//public PokeBattle_Move_11D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
if (opponent.effects.MoveNext) return true;
if ((int)this.battle.choices[opponent.Index].Action != 1) return true; // Didn't choose a move
@@ -10621,13 +10622,13 @@ public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
return false;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.MoveNext = true;
opponent.effects.Quash = false;
- battle.pbDisplay(Game._INTL("{1} took the kind offer!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} took the kind offer!", opponent.ToString()));
return 0;
}
}
@@ -10639,7 +10640,7 @@ public partial class PokeBattle_Move_11E : PokeBattle_Move
{
public PokeBattle_Move_11E() : base() { }
//public PokeBattle_Move_11E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
if (opponent.effects.Quash) return true;
if ((int)this.battle.choices[opponent.Index].Action != 1) return true; // Didn't choose a move
@@ -10649,13 +10650,13 @@ public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
return false;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Quash = true;
opponent.effects.MoveNext = false;
- battle.pbDisplay(Game._INTL("{1}'s move was postponed!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s move was postponed!", opponent.ToString()));
return 0;
}
}
@@ -10668,19 +10669,19 @@ public partial class PokeBattle_Move_11F : PokeBattle_Move
{
public PokeBattle_Move_11F() : base() { }
//public PokeBattle_Move_11F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.TrickRoom > 0)
{
this.battle.field.TrickRoom = 0;
- battle.pbDisplay(Game._INTL("{1} reverted the dimensions!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} reverted the dimensions!", attacker.ToString()));
}
else
{
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
this.battle.field.TrickRoom = 5;
- battle.pbDisplay(Game._INTL("{1} twisted the dimensions!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} twisted the dimensions!", attacker.ToString()));
}
return 0;
}
@@ -10690,26 +10691,26 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
/// User switches places with its ally. (Ally Switch)
///
///
- /// Code below might not need to be complicated since Battle.Pokemon rewrite
+ /// Code below might not need to be complicated since Battle.Pokemon rewrite
/// stores values in Battle.Battler (position) instead of in Pokemon variable
///
public partial class PokeBattle_Move_120 : PokeBattle_Move
{
public PokeBattle_Move_120() : base() { }
//public PokeBattle_Move_120(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (!this.battle.doublebattle ||
- attacker.pbPartner.Species == Pokemons.NONE ||
- attacker.pbPartner.isFainted())
+ attacker.Partner.Species == Pokemons.NONE ||
+ attacker.Partner.isFainted())
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
IBattler a = this.battle.battlers[attacker.Index];
- IBattler b = this.battle.battlers[attacker.pbPartner.Index];
+ IBattler b = this.battle.battlers[attacker.Partner.Index];
IBattler temp = a; a = b; b = temp;
// Swap effects that point at the position rather than the Pokémon
@@ -10725,186 +10726,186 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
//foreach (BattlerEffects i in effectstoswap)
{
//a.effects[i], b.effects[i]= b.effects[i], a.effects[i];
- IEffectsBattler atemp = a.effects;
- IEffectsBattler btemp = b.effects;
- //a.effects.Attract = btemp.Attract ;
- //a.effects.BatonPass = btemp.BatonPass ;
- //a.effects.Bide = btemp.Bide ;
- //a.effects.BideDamage = btemp.BideDamage ;
- a.effects.BideTarget = btemp.BideTarget ;
- //a.effects.Charge = btemp.Charge ;
- //a.effects.ChoiceBand = btemp.ChoiceBand ;
- //a.effects.Counter = btemp.Counter ;
- a.effects.CounterTarget = btemp.CounterTarget ;
- //a.effects.DefenseCurl = btemp.DefenseCurl ;
- //a.effects.DestinyBond = btemp.DestinyBond ;
- //a.effects.Disable = btemp.Disable ;
- //a.effects.DisableMove = btemp.DisableMove ;
- //a.effects.Electrify = btemp.Electrify ;
- //a.effects.Encore = btemp.Encore ;
- //a.effects.EncoreIndex = btemp.EncoreIndex ;
- //a.effects.EncoreMove = btemp.EncoreMove ;
- //a.effects.Endure = btemp.Endure ;
- //a.effects.FirstPledge = btemp.FirstPledge ;
- //a.effects.FlashFire = btemp.FlashFire ;
- //a.effects.Flinch = btemp.Flinch ;
- //a.effects.FollowMe = btemp.FollowMe ;
- //a.effects.Foresight = btemp.Foresight ;
- //a.effects.FuryCutter = btemp.FuryCutter ;
- //a.effects.Grudge = btemp.Grudge ;
- //a.effects.HelpingHand = btemp.HelpingHand ;
- //a.effects.HyperBeam = btemp.HyperBeam ;
- //a.effects.Illusion = btemp.Illusion ;
- //a.effects.Imprison = btemp.Imprison ;
- //a.effects.KingsShield = btemp.KingsShield ;
- a.effects.LeechSeed = btemp.LeechSeed ;
- //a.effects.LifeOrb = btemp.LifeOrb ;
- //a.effects.LockOn = btemp.LockOn ;
- a.effects.LockOnPos = btemp.LockOnPos ;
- //a.effects.MagicCoat = btemp.MagicCoat ;
- a.effects.MeanLook = btemp.MeanLook ;
- //a.effects.MeFirst = btemp.MeFirst ;
- //a.effects.Metronome = btemp.Metronome ;
- //a.effects.MicleBerry = btemp.MicleBerry ;
- //a.effects.Minimize = btemp.Minimize ;
- //a.effects.MiracleEye = btemp.MiracleEye ;
- //a.effects.MirrorCoat = btemp.MirrorCoat ;
- a.effects.MirrorCoatTarget = btemp.MirrorCoatTarget;
- //a.effects.MoveNext = btemp.MoveNext ;
- //a.effects.MudSport = btemp.MudSport ;
- //a.effects.MultiTurn = btemp.MultiTurn ;
- //a.effects.MultiTurnAttack = btemp.MultiTurnAttack ;
- //a.effects.MultiTurnUser = btemp.MultiTurnUser ;
- //a.effects.Nightmare = btemp.Nightmare ;
- //a.effects.Outrage = btemp.Outrage ;
- //a.effects.ParentalBond = btemp.ParentalBond ;
- //a.effects.PickupItem = btemp.PickupItem ;
- //a.effects.PickupUse = btemp.PickupUse ;
- //a.effects.Pinch = btemp.Pinch ;
- //a.effects.Powder = btemp.Powder ;
- //a.effects.Protect = btemp.Protect ;
- //a.effects.ProtectNegation = btemp.ProtectNegation ;
- //a.effects.ProtectRate = btemp.ProtectRate ;
- //a.effects.Pursuit = btemp.Pursuit ;
- //a.effects.Quash = btemp.Quash ;
- //a.effects.Rage = btemp.Rage ;
- //a.effects.Revenge = btemp.Revenge ;
- //a.effects.Roar = btemp.Roar ;
- //a.effects.Rollout = btemp.Rollout ;
- //a.effects.Roost = btemp.Roost ;
- //a.effects.SkipTurn = btemp.SkipTurn ;
- //a.effects.SkyDrop = btemp.SkyDrop ;
- //a.effects.SmackDown = btemp.SmackDown ;
- //a.effects.Snatch = btemp.Snatch ;
- //a.effects.SpikyShield = btemp.SpikyShield ;
- //a.effects.Stockpile = btemp.Stockpile ;
- //a.effects.StockpileDef = btemp.StockpileDef ;
- //a.effects.StockpileSpDef = btemp.StockpileSpDef ;
- //a.effects.Taunt = btemp.Taunt ;
- //a.effects.Torment = btemp.Torment ;
- //a.effects.Toxic = btemp.Toxic ;
- //a.effects.Transform = btemp.Transform ;
- //a.effects.Truant = btemp.Truant ;
- //a.effects.TwoTurnAttack = btemp.TwoTurnAttack ;
- //a.effects.Type3 = btemp.Type3 ;
- //a.effects.Unburden = btemp.Unburden ;
- //a.effects.Uproar = btemp.Uproar ;
- //a.effects.Uturn = btemp.Uturn ;
- //a.effects.WaterSport = btemp.WaterSport ;
- //a.effects.WeightChange = btemp.WeightChange ;
- //a.effects.Yawn = btemp.Yawn ;
- //b.effects.Attract = atemp.Attract ;
- //b.effects.BatonPass = atemp.BatonPass ;
- //b.effects.Bide = atemp.Bide ;
- //b.effects.BideDamage = atemp.BideDamage ;
- b.effects.BideTarget = atemp.BideTarget ;
- //b.effects.Charge = atemp.Charge ;
- //b.effects.ChoiceBand = atemp.ChoiceBand ;
- //b.effects.Counter = atemp.Counter ;
- b.effects.CounterTarget = atemp.CounterTarget ;
- //b.effects.DefenseCurl = atemp.DefenseCurl ;
- //b.effects.DestinyBond = atemp.DestinyBond ;
- //b.effects.Disable = atemp.Disable ;
- //b.effects.DisableMove = atemp.DisableMove ;
- //b.effects.Electrify = atemp.Electrify ;
- //b.effects.Encore = atemp.Encore ;
- //b.effects.EncoreIndex = atemp.EncoreIndex ;
- //b.effects.EncoreMove = atemp.EncoreMove ;
- //b.effects.Endure = atemp.Endure ;
- //b.effects.FirstPledge = atemp.FirstPledge ;
- //b.effects.FlashFire = atemp.FlashFire ;
- //b.effects.Flinch = atemp.Flinch ;
- //b.effects.FollowMe = atemp.FollowMe ;
- //b.effects.Foresight = atemp.Foresight ;
- //b.effects.FuryCutter = atemp.FuryCutter ;
- //b.effects.Grudge = atemp.Grudge ;
- //b.effects.HelpingHand = atemp.HelpingHand ;
- //b.effects.HyperBeam = atemp.HyperBeam ;
- //b.effects.Illusion = atemp.Illusion ;
- //b.effects.Imprison = atemp.Imprison ;
- //b.effects.KingsShield = atemp.KingsShield ;
- b.effects.LeechSeed = atemp.LeechSeed ;
- //b.effects.LifeOrb = atemp.LifeOrb ;
- //b.effects.LockOn = atemp.LockOn ;
- b.effects.LockOnPos = atemp.LockOnPos ;
- //b.effects.MagicCoat = atemp.MagicCoat ;
- b.effects.MeanLook = atemp.MeanLook ;
- //b.effects.MeFirst = atemp.MeFirst ;
- //b.effects.Metronome = atemp.Metronome ;
- //b.effects.MicleBerry = atemp.MicleBerry ;
- //b.effects.Minimize = atemp.Minimize ;
- //b.effects.MiracleEye = atemp.MiracleEye ;
- //b.effects.MirrorCoat = atemp.MirrorCoat ;
- b.effects.MirrorCoatTarget = atemp.MirrorCoatTarget;
- //b.effects.MoveNext = atemp.MoveNext ;
- //b.effects.MudSport = atemp.MudSport ;
- //b.effects.MultiTurn = atemp.MultiTurn ;
- //b.effects.MultiTurnAttack = atemp.MultiTurnAttack ;
- //b.effects.MultiTurnUser = atemp.MultiTurnUser ;
- //b.effects.Nightmare = atemp.Nightmare ;
- //b.effects.Outrage = atemp.Outrage ;
- //b.effects.ParentalBond = atemp.ParentalBond ;
- //b.effects.PickupItem = atemp.PickupItem ;
- //b.effects.PickupUse = atemp.PickupUse ;
- //b.effects.Pinch = atemp.Pinch ;
- //b.effects.Powder = atemp.Powder ;
- //b.effects.Protect = atemp.Protect ;
- //b.effects.ProtectNegation = atemp.ProtectNegation ;
- //b.effects.ProtectRate = atemp.ProtectRate ;
- //b.effects.Pursuit = atemp.Pursuit ;
- //b.effects.Quash = atemp.Quash ;
- //b.effects.Rage = atemp.Rage ;
- //b.effects.Revenge = atemp.Revenge ;
- //b.effects.Roar = atemp.Roar ;
- //b.effects.Rollout = atemp.Rollout ;
- //b.effects.Roost = atemp.Roost ;
- //b.effects.SkipTurn = atemp.SkipTurn ;
- //b.effects.SkyDrop = atemp.SkyDrop ;
- //b.effects.SmackDown = atemp.SmackDown ;
- //b.effects.Snatch = atemp.Snatch ;
- //b.effects.SpikyShield = atemp.SpikyShield ;
- //b.effects.Stockpile = atemp.Stockpile ;
- //b.effects.StockpileDef = atemp.StockpileDef ;
- //b.effects.StockpileSpDef = atemp.StockpileSpDef ;
- //b.effects.Taunt = atemp.Taunt ;
- //b.effects.Torment = atemp.Torment ;
- //b.effects.Toxic = atemp.Toxic ;
- //b.effects.Transform = atemp.Transform ;
- //b.effects.Truant = atemp.Truant ;
- //b.effects.TwoTurnAttack = atemp.TwoTurnAttack ;
- //b.effects.Type3 = atemp.Type3 ;
- //b.effects.Unburden = atemp.Unburden ;
- //b.effects.Uproar = atemp.Uproar ;
- //b.effects.Uturn = atemp.Uturn ;
- //b.effects.WaterSport = atemp.WaterSport ;
- //b.effects.WeightChange = atemp.WeightChange ;
- //b.effects.Yawn = atemp.Yawn ;
- }
-
- attacker.pbUpdate(true);
-
- opponent.pbUpdate(true);
- battle.pbDisplay(Game._INTL("{1} and {2} switched places!", opponent.ToString(), attacker.ToString(true)));
+ IEffectsBattler atemp = a.effects ;
+ IEffectsBattler btemp = b.effects ;
+ //a.effects.Attract = btemp.Attract ;
+ //a.effects.BatonPass = btemp.BatonPass ;
+ //a.effects.Bide = btemp.Bide ;
+ //a.effects.BideDamage = btemp.BideDamage ;
+ a.effects.BideTarget = btemp.BideTarget ;
+ //a.effects.Charge = btemp.Charge ;
+ //a.effects.ChoiceBand = btemp.ChoiceBand ;
+ //a.effects.Counter = btemp.Counter ;
+ a.effects.CounterTarget = btemp.CounterTarget ;
+ //a.effects.DefenseCurl = btemp.DefenseCurl ;
+ //a.effects.DestinyBond = btemp.DestinyBond ;
+ //a.effects.Disable = btemp.Disable ;
+ //a.effects.DisableMove = btemp.DisableMove ;
+ //a.effects.Electrify = btemp.Electrify ;
+ //a.effects.Encore = btemp.Encore ;
+ //a.effects.EncoreIndex = btemp.EncoreIndex ;
+ //a.effects.EncoreMove = btemp.EncoreMove ;
+ //a.effects.Endure = btemp.Endure ;
+ //a.effects.FirstPledge = btemp.FirstPledge ;
+ //a.effects.FlashFire = btemp.FlashFire ;
+ //a.effects.Flinch = btemp.Flinch ;
+ //a.effects.FollowMe = btemp.FollowMe ;
+ //a.effects.Foresight = btemp.Foresight ;
+ //a.effects.FuryCutter = btemp.FuryCutter ;
+ //a.effects.Grudge = btemp.Grudge ;
+ //a.effects.HelpingHand = btemp.HelpingHand ;
+ //a.effects.HyperBeam = btemp.HyperBeam ;
+ //a.effects.Illusion = btemp.Illusion ;
+ //a.effects.Imprison = btemp.Imprison ;
+ //a.effects.KingsShield = btemp.KingsShield ;
+ a.effects.LeechSeed = btemp.LeechSeed ;
+ //a.effects.LifeOrb = btemp.LifeOrb ;
+ //a.effects.LockOn = btemp.LockOn ;
+ a.effects.LockOnPos = btemp.LockOnPos ;
+ //a.effects.MagicCoat = btemp.MagicCoat ;
+ a.effects.MeanLook = btemp.MeanLook ;
+ //a.effects.MeFirst = btemp.MeFirst ;
+ //a.effects.Metronome = btemp.Metronome ;
+ //a.effects.MicleBerry = btemp.MicleBerry ;
+ //a.effects.Minimize = btemp.Minimize ;
+ //a.effects.MiracleEye = btemp.MiracleEye ;
+ //a.effects.MirrorCoat = btemp.MirrorCoat ;
+ a.effects.MirrorCoatTarget = btemp.MirrorCoatTarget;
+ //a.effects.MoveNext = btemp.MoveNext ;
+ //a.effects.MudSport = btemp.MudSport ;
+ //a.effects.MultiTurn = btemp.MultiTurn ;
+ //a.effects.MultiTurnAttack = btemp.MultiTurnAttack ;
+ //a.effects.MultiTurnUser = btemp.MultiTurnUser ;
+ //a.effects.Nightmare = btemp.Nightmare ;
+ //a.effects.Outrage = btemp.Outrage ;
+ //a.effects.ParentalBond = btemp.ParentalBond ;
+ //a.effects.PickupItem = btemp.PickupItem ;
+ //a.effects.PickupUse = btemp.PickupUse ;
+ //a.effects.Pinch = btemp.Pinch ;
+ //a.effects.Powder = btemp.Powder ;
+ //a.effects.Protect = btemp.Protect ;
+ //a.effects.ProtectNegation = btemp.ProtectNegation ;
+ //a.effects.ProtectRate = btemp.ProtectRate ;
+ //a.effects.Pursuit = btemp.Pursuit ;
+ //a.effects.Quash = btemp.Quash ;
+ //a.effects.Rage = btemp.Rage ;
+ //a.effects.Revenge = btemp.Revenge ;
+ //a.effects.Roar = btemp.Roar ;
+ //a.effects.Rollout = btemp.Rollout ;
+ //a.effects.Roost = btemp.Roost ;
+ //a.effects.SkipTurn = btemp.SkipTurn ;
+ //a.effects.SkyDrop = btemp.SkyDrop ;
+ //a.effects.SmackDown = btemp.SmackDown ;
+ //a.effects.Snatch = btemp.Snatch ;
+ //a.effects.SpikyShield = btemp.SpikyShield ;
+ //a.effects.Stockpile = btemp.Stockpile ;
+ //a.effects.StockpileDef = btemp.StockpileDef ;
+ //a.effects.StockpileSpDef = btemp.StockpileSpDef ;
+ //a.effects.Taunt = btemp.Taunt ;
+ //a.effects.Torment = btemp.Torment ;
+ //a.effects.Toxic = btemp.Toxic ;
+ //a.effects.Transform = btemp.Transform ;
+ //a.effects.Truant = btemp.Truant ;
+ //a.effects.TwoTurnAttack = btemp.TwoTurnAttack ;
+ //a.effects.Type3 = btemp.Type3 ;
+ //a.effects.Unburden = btemp.Unburden ;
+ //a.effects.Uproar = btemp.Uproar ;
+ //a.effects.Uturn = btemp.Uturn ;
+ //a.effects.WaterSport = btemp.WaterSport ;
+ //a.effects.WeightChange = btemp.WeightChange ;
+ //a.effects.Yawn = btemp.Yawn ;
+ //b.effects.Attract = atemp.Attract ;
+ //b.effects.BatonPass = atemp.BatonPass ;
+ //b.effects.Bide = atemp.Bide ;
+ //b.effects.BideDamage = atemp.BideDamage ;
+ b.effects.BideTarget = atemp.BideTarget ;
+ //b.effects.Charge = atemp.Charge ;
+ //b.effects.ChoiceBand = atemp.ChoiceBand ;
+ //b.effects.Counter = atemp.Counter ;
+ b.effects.CounterTarget = atemp.CounterTarget ;
+ //b.effects.DefenseCurl = atemp.DefenseCurl ;
+ //b.effects.DestinyBond = atemp.DestinyBond ;
+ //b.effects.Disable = atemp.Disable ;
+ //b.effects.DisableMove = atemp.DisableMove ;
+ //b.effects.Electrify = atemp.Electrify ;
+ //b.effects.Encore = atemp.Encore ;
+ //b.effects.EncoreIndex = atemp.EncoreIndex ;
+ //b.effects.EncoreMove = atemp.EncoreMove ;
+ //b.effects.Endure = atemp.Endure ;
+ //b.effects.FirstPledge = atemp.FirstPledge ;
+ //b.effects.FlashFire = atemp.FlashFire ;
+ //b.effects.Flinch = atemp.Flinch ;
+ //b.effects.FollowMe = atemp.FollowMe ;
+ //b.effects.Foresight = atemp.Foresight ;
+ //b.effects.FuryCutter = atemp.FuryCutter ;
+ //b.effects.Grudge = atemp.Grudge ;
+ //b.effects.HelpingHand = atemp.HelpingHand ;
+ //b.effects.HyperBeam = atemp.HyperBeam ;
+ //b.effects.Illusion = atemp.Illusion ;
+ //b.effects.Imprison = atemp.Imprison ;
+ //b.effects.KingsShield = atemp.KingsShield ;
+ b.effects.LeechSeed = atemp.LeechSeed ;
+ //b.effects.LifeOrb = atemp.LifeOrb ;
+ //b.effects.LockOn = atemp.LockOn ;
+ b.effects.LockOnPos = atemp.LockOnPos ;
+ //b.effects.MagicCoat = atemp.MagicCoat ;
+ b.effects.MeanLook = atemp.MeanLook ;
+ //b.effects.MeFirst = atemp.MeFirst ;
+ //b.effects.Metronome = atemp.Metronome ;
+ //b.effects.MicleBerry = atemp.MicleBerry ;
+ //b.effects.Minimize = atemp.Minimize ;
+ //b.effects.MiracleEye = atemp.MiracleEye ;
+ //b.effects.MirrorCoat = atemp.MirrorCoat ;
+ b.effects.MirrorCoatTarget = atemp.MirrorCoatTarget;
+ //b.effects.MoveNext = atemp.MoveNext ;
+ //b.effects.MudSport = atemp.MudSport ;
+ //b.effects.MultiTurn = atemp.MultiTurn ;
+ //b.effects.MultiTurnAttack = atemp.MultiTurnAttack ;
+ //b.effects.MultiTurnUser = atemp.MultiTurnUser ;
+ //b.effects.Nightmare = atemp.Nightmare ;
+ //b.effects.Outrage = atemp.Outrage ;
+ //b.effects.ParentalBond = atemp.ParentalBond ;
+ //b.effects.PickupItem = atemp.PickupItem ;
+ //b.effects.PickupUse = atemp.PickupUse ;
+ //b.effects.Pinch = atemp.Pinch ;
+ //b.effects.Powder = atemp.Powder ;
+ //b.effects.Protect = atemp.Protect ;
+ //b.effects.ProtectNegation = atemp.ProtectNegation ;
+ //b.effects.ProtectRate = atemp.ProtectRate ;
+ //b.effects.Pursuit = atemp.Pursuit ;
+ //b.effects.Quash = atemp.Quash ;
+ //b.effects.Rage = atemp.Rage ;
+ //b.effects.Revenge = atemp.Revenge ;
+ //b.effects.Roar = atemp.Roar ;
+ //b.effects.Rollout = atemp.Rollout ;
+ //b.effects.Roost = atemp.Roost ;
+ //b.effects.SkipTurn = atemp.SkipTurn ;
+ //b.effects.SkyDrop = atemp.SkyDrop ;
+ //b.effects.SmackDown = atemp.SmackDown ;
+ //b.effects.Snatch = atemp.Snatch ;
+ //b.effects.SpikyShield = atemp.SpikyShield ;
+ //b.effects.Stockpile = atemp.Stockpile ;
+ //b.effects.StockpileDef = atemp.StockpileDef ;
+ //b.effects.StockpileSpDef = atemp.StockpileSpDef ;
+ //b.effects.Taunt = atemp.Taunt ;
+ //b.effects.Torment = atemp.Torment ;
+ //b.effects.Toxic = atemp.Toxic ;
+ //b.effects.Transform = atemp.Transform ;
+ //b.effects.Truant = atemp.Truant ;
+ //b.effects.TwoTurnAttack = atemp.TwoTurnAttack ;
+ //b.effects.Type3 = atemp.Type3 ;
+ //b.effects.Unburden = atemp.Unburden ;
+ //b.effects.Uproar = atemp.Uproar ;
+ //b.effects.Uturn = atemp.Uturn ;
+ //b.effects.WaterSport = atemp.WaterSport ;
+ //b.effects.WeightChange = atemp.WeightChange ;
+ //b.effects.Yawn = atemp.Yawn ;
+ }
+
+ attacker.Update(true);
+
+ opponent.Update(true);
+ battle.Display(Game._INTL("{1} and {2} switched places!", opponent.ToString(), attacker.ToString(true)));
return 0;//ToDo: Not sure what to return here, so i added null/0
}
}
@@ -10917,7 +10918,7 @@ public partial class PokeBattle_Move_121 : PokeBattle_Move
{
public PokeBattle_Move_121() : base() { }
//public PokeBattle_Move_121(Battle battle, Attack.Move move) : base(battle, move) { }
- // Handled in superclass public object pbCalcDamage, do not edit!
+ // Handled in superclass public object CalcDamage, do not edit!
}
///
@@ -10928,7 +10929,7 @@ public partial class PokeBattle_Move_122 : PokeBattle_Move
{
public PokeBattle_Move_122() : base() { }
//public PokeBattle_Move_122(Battle battle, Attack.Move move) : base(battle, move) { }
- // Handled in superclass public object pbCalcDamage, do not edit!
+ // Handled in superclass public object CalcDamage, do not edit!
}
///
@@ -10938,16 +10939,16 @@ public partial class PokeBattle_Move_123 : PokeBattle_Move
{
public PokeBattle_Move_123() : base() { }
//public PokeBattle_Move_123(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (!opponent.pbHasType(attacker.Type1) &&
- !opponent.pbHasType(attacker.Type2) &&
- !opponent.pbHasType(attacker.effects.Type3))
+ if (!opponent.HasType(attacker.Type1) &&
+ !opponent.HasType(attacker.Type2) &&
+ !opponent.HasType(attacker.effects.Type3))
{
- battle.pbDisplay(Game._INTL("{1} was unaffected!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was unaffected!", opponent.ToString()));
return -1;
}
- return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
}
}
@@ -10959,19 +10960,19 @@ public partial class PokeBattle_Move_124 : PokeBattle_Move
{
public PokeBattle_Move_124() : base() { }
//public PokeBattle_Move_124(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.WonderRoom > 0)
{
this.battle.field.WonderRoom = 0;
- battle.pbDisplay(Game._INTL("Wonder Room wore off, and the Defense and Sp. Def stats returned to normal!"));
+ battle.Display(Game._INTL("Wonder Room wore off, and the Defense and Sp. Def stats returned to normal!"));
}
else
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.field.WonderRoom = 5;
- battle.pbDisplay(Game._INTL("It created a bizarre area in which the Defense and Sp. Def stats are swapped!"));
+ battle.Display(Game._INTL("It created a bizarre area in which the Defense and Sp. Def stats are swapped!"));
}
return 0;
}
@@ -10984,7 +10985,7 @@ public partial class PokeBattle_Move_125 : PokeBattle_Move
{
public PokeBattle_Move_125() : base() { }
//public PokeBattle_Move_125(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
byte counter = 0; byte nummoves = 0;
foreach (var move in attacker.moves)
@@ -11010,15 +11011,15 @@ public partial class PokeBattle_Move_133 : PokeBattle_Move
{
public PokeBattle_Move_133() : base() { }
//public PokeBattle_Move_133(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (!this.battle.doublebattle ||
- attacker.pbPartner.Species == Pokemons.NONE || attacker.pbPartner.isFainted())
+ attacker.Partner.Species == Pokemons.NONE || attacker.Partner.isFainted())
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
return 0;
}
}
@@ -11030,29 +11031,29 @@ public partial class PokeBattle_Move_134 : PokeBattle_Move
{
public PokeBattle_Move_134() : base() { }
//public PokeBattle_Move_134(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("Congratulations, {1}!", this.battle.pbGetOwner(attacker.Index).name));
+ battle.Display(Game._INTL("Congratulations, {1}!", this.battle.GetOwner(attacker.Index).name));
return 0;
}
}
///
/// Freezes the target. (Freeze-Dry)
- /// (Superclass's pbTypeModifier): Effectiveness against Water-type is 2x.
+ /// (Superclass's TypeModifier): Effectiveness against Water-type is 2x.
///
public partial class PokeBattle_Move_135 : PokeBattle_Move
{
public PokeBattle_Move_135() : base() { }
//public PokeBattle_Move_135(Battle battle, Attack.Move move) : base(battle, move) { }
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerClause b && b.pbCanFreeze(attacker, false, this))
+ if (opponent is IBattlerClause b && b.CanFreeze(attacker, false, this))
{
- if (opponent is IBattlerEffect o) o.pbFreeze();
+ if (opponent is IBattlerEffect o) o.Freeze();
}
}
}
@@ -11075,34 +11076,34 @@ public partial class PokeBattle_Move_137 : PokeBattle_Move
{
public PokeBattle_Move_137() : base() { }
//public PokeBattle_Move_137(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool didsomething = false;
- foreach (IBattler i in new IBattler[] { attacker, attacker.pbPartner })
+ foreach (IBattler i in new IBattler[] { attacker, attacker.Partner })
{
if (i.Species == Pokemons.NONE || i.isFainted()) continue; //next
- if (!i.hasWorkingAbility(Abilities.PLUS) && !i.hasWorkingAbility(Abilities.MINUS)) continue; //next
- if (i is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this)) continue; //next
- if (!didsomething) pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ if (!i.hasWorkingAbility(Abilities.PLUS) && !i.hasWorkingAbility(Abilities.MINUS)) continue; //next
+ if (i is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this)) continue; //next
+ if (!didsomething) ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
didsomething = true;
bool showanim = true;
- if (i is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (i is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
- if (i is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (i is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPDEF, 1, attacker, false, this, showanim);
showanim = false;
}
}
if (!didsomething)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
return 0;
@@ -11116,17 +11117,17 @@ public partial class PokeBattle_Move_138 : PokeBattle_Move
{
public PokeBattle_Move_138() : base() { }
//public PokeBattle_Move_138(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (!this.battle.doublebattle || opponent.Species == Pokemons.NONE ||
- opponent is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ opponent is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = attacker is IBattlerEffect a && a.pbIncreaseStat(Stats.SPDEF, 1, attacker, false, this);
+ bool ret = attacker is IBattlerEffect a && a.IncreaseStat(Stats.SPDEF, 1, attacker, false, this);
return ret ? 0 : -1;
}
}
@@ -11138,17 +11139,17 @@ public partial class PokeBattle_Move_139 : PokeBattle_Move
{
public PokeBattle_Move_139() : base() { }
//public PokeBattle_Move_139(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbAccuracyCheck(IBattler attacker, IBattler opponent)
+ public override bool AccuracyCheck(IBattler attacker, IBattler opponent)
{
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.ATTACK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.ATTACK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.ATTACK, 1, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.ATTACK, 1, attacker, false, this);
return ret ? 0 : -1;
}
}
@@ -11160,25 +11161,25 @@ public partial class PokeBattle_Move_13A : PokeBattle_Move
{
public PokeBattle_Move_13A() : base() { }
//public PokeBattle_Move_13A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- // Replicates pbCanReduceStatStage? so that certain messages aren't shown
+ // Replicates CanReduceStatStage? so that certain messages aren't shown
// multiple times
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("{1}'s attack missed!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s attack missed!", attacker.ToString()));
return -1;
}
if (opponent is IBattlerEffect b &&
- b.pbTooLow(Stats.ATTACK) &&
- b.pbTooLow(Stats.SPATK))
+ b.TooLow(Stats.ATTACK) &&
+ b.TooLow(Stats.SPATK))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any lower!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any lower!", opponent.ToString()));
return -1;
}
- if (opponent.pbOwnSide.Mist > 0)
+ if (opponent.OwnSide.Mist > 0)
{
- battle.pbDisplay(Game._INTL("{1} is protected by Mist!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} is protected by Mist!", opponent.ToString()));
return -1;
}
if (!attacker.hasMoldBreaker())
@@ -11186,25 +11187,25 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
if (opponent.hasWorkingAbility(Abilities.CLEAR_BODY) ||
opponent.hasWorkingAbility(Abilities.WHITE_SMOKE))
{
- battle.pbDisplay(Game._INTL("{1}'s {2} prevents stat loss!", opponent.ToString(),
+ battle.Display(Game._INTL("{1}'s {2} prevents stat loss!", opponent.ToString(),
Game._INTL(opponent.Ability.ToString(TextScripts.Name))));
return -1;
}
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
int ret = -1; bool showanim = true;
if (!attacker.hasMoldBreaker() && opponent.hasWorkingAbility(Abilities.HYPER_CUTTER))
{
string abilityname = Game._INTL(opponent.Ability.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1}'s {2} prevents Attack loss!", opponent.ToString(), abilityname));
+ battle.Display(Game._INTL("{1}'s {2} prevents Attack loss!", opponent.ToString(), abilityname));
}
- else if (opponent is IBattlerEffect b0 && b0.pbReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim))
+ else if (opponent is IBattlerEffect b0 && b0.ReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim))
{
ret = 0; showanim = false;
}
- if (opponent is IBattlerEffect b1 && b1.pbReduceStat(Stats.SPATK, 1, attacker, false, this, showanim))
+ if (opponent is IBattlerEffect b1 && b1.ReduceStat(Stats.SPATK, 1, attacker, false, this, showanim))
{
ret = 0; showanim = false;
}
@@ -11219,24 +11220,24 @@ public partial class PokeBattle_Move_13B : PokeBattle_Move
{
public PokeBattle_Move_13B() : base() { }
//public PokeBattle_Move_13B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
if (attacker.Species == Pokemons.HOOPA) return true;
if (attacker.form != 1) return true;
return false;
}
- public override bool pbAccuracyCheck(IBattler attacker, IBattler opponent)
+ public override bool AccuracyCheck(IBattler attacker, IBattler opponent)
{
return true;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.DEFENSE, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.DEFENSE, attacker, false, this))
{
- b.pbReduceStat(Stats.DEFENSE, 1, attacker, false, this);
+ b.ReduceStat(Stats.DEFENSE, 1, attacker, false, this);
}
}
}
@@ -11248,17 +11249,17 @@ public partial class PokeBattle_Move_13C : PokeBattle_Move
{
public PokeBattle_Move_13C() : base() { }
//public PokeBattle_Move_13C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbAccuracyCheck(IBattler attacker, IBattler opponent)
+ public override bool AccuracyCheck(IBattler attacker, IBattler opponent)
{
return true;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPATK, 1, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPATK, 1, attacker, false, this);
return ret ? 0 : -1;
}
}
@@ -11270,23 +11271,23 @@ public partial class PokeBattle_Move_13D : PokeBattle_Move
{
public PokeBattle_Move_13D() : base() { }
//public PokeBattle_Move_13D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbIsDamaging()) return base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
- if (opponent is IBattlerEffect b && !b.pbCanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ if (IsDamaging()) return base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (opponent is IBattlerEffect b && !b.CanReduceStatStage(Stats.SPATK, attacker, true, this)) return -1;
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- bool ret = opponent is IBattlerEffect o && o.pbReduceStat(Stats.SPATK, 2, attacker, false, this);
+ bool ret = opponent is IBattlerEffect o && o.ReduceStat(Stats.SPATK, 2, attacker, false, this);
return ret ? 0 : -1;
}
- public override void pbAdditionalEffect(IBattler attacker, IBattler opponent)
+ public override void AdditionalEffect(IBattler attacker, IBattler opponent)
{
if (opponent.damagestate.Substitute) return;
- if (opponent is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPATK, attacker, false, this))
+ if (opponent is IBattlerEffect b && b.CanReduceStatStage(Stats.SPATK, attacker, false, this))
{
- b.pbReduceStat(Stats.SPATK, 2, attacker, false, this);
+ b.ReduceStat(Stats.SPATK, 2, attacker, false, this);
}
}
}
@@ -11299,35 +11300,35 @@ public partial class PokeBattle_Move_13E : PokeBattle_Move
{
public PokeBattle_Move_13E() : base() { }
//public PokeBattle_Move_13E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool didsomething = false; //ToDo: If double battle?
- foreach (IBattler i in new IBattler[] { attacker, attacker.pbPartner, attacker.pbOpposing1, attacker.pbOpposing2 })
+ foreach (IBattler i in new IBattler[] { attacker, attacker.Partner, attacker.Opposing1, attacker.Opposing2 })
{
if (i.Species == Pokemons.NONE || i.isFainted()) continue; //next
- if (!i.pbHasType(Types.GRASS)) continue; //next
+ if (!i.HasType(Types.GRASS)) continue; //next
if (i.isAirborne(attacker.hasMoldBreaker())) continue; //next
- if (i is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this)) continue;//next
- if (!didsomething) pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ if (i is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this)) continue;//next
+ if (!didsomething) ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
didsomething = true;
bool showanim = true;
- if (i is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (i is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (i is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (i is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPATK, 1, attacker, false, this, showanim);
showanim = false;
}
}
if (!didsomething)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
return 0;
@@ -11342,27 +11343,27 @@ public partial class PokeBattle_Move_13F : PokeBattle_Move
{
public PokeBattle_Move_13F() : base() { }
//public PokeBattle_Move_13F(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool didsomething = false; //ToDo: If double battle?
- foreach (IBattler i in new IBattler[] { attacker, attacker.pbPartner, attacker.pbOpposing1, attacker.pbOpposing2 })
+ foreach (IBattler i in new IBattler[] { attacker, attacker.Partner, attacker.Opposing1, attacker.Opposing2 })
{
if (i.Species == Pokemons.NONE || i.isFainted()) continue; //next
- if (!i.pbHasType(Types.GRASS)) continue; //next
- if (i is IBattlerEffect b && !b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this)) continue; //next
- if (!didsomething) pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ if (!i.HasType(Types.GRASS)) continue; //next
+ if (i is IBattlerEffect b && !b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this)) continue; //next
+ if (!didsomething) ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
didsomething = true;
bool showanim = true;
- if (i is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
+ if (i is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.DEFENSE, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.DEFENSE, 1, attacker, false, this, showanim);
showanim = false;
}
}
if (!didsomething)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
return 0;
@@ -11377,40 +11378,40 @@ public partial class PokeBattle_Move_140 : PokeBattle_Move
{
public PokeBattle_Move_140() : base() { }
//public PokeBattle_Move_140(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool didsomething = false;
- foreach (IBattler i in new IBattler[] { attacker.pbOpposing1, attacker.pbOpposing2 })
+ foreach (IBattler i in new IBattler[] { attacker.Opposing1, attacker.Opposing2 })
{
if (i.Species == Pokemons.NONE || i.isFainted()) continue; //next
if (i.Status != Status.POISON) continue; //next
- if (i is IBattlerEffect b &&
- !b.pbCanReduceStatStage(Stats.ATTACK, attacker, false, this) &&
- !b.pbCanReduceStatStage(Stats.SPATK, attacker, false, this) &&
- !b.pbCanReduceStatStage(Stats.SPEED, attacker, false, this)) continue; //next
- if (!didsomething) pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ if (i is IBattlerEffect b &&
+ !b.CanReduceStatStage(Stats.ATTACK, attacker, false, this) &&
+ !b.CanReduceStatStage(Stats.SPATK, attacker, false, this) &&
+ !b.CanReduceStatStage(Stats.SPEED, attacker, false, this)) continue; //next
+ if (!didsomething) ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
didsomething = true;
bool showanim = true;
- if (i is IBattlerEffect b0 && b0.pbCanReduceStatStage(Stats.ATTACK, attacker, false, this))
+ if (i is IBattlerEffect b0 && b0.CanReduceStatStage(Stats.ATTACK, attacker, false, this))
{
- b0.pbReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim);
+ b0.ReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (i is IBattlerEffect b1 && b1.pbCanReduceStatStage(Stats.SPATK, attacker, false, this))
+ if (i is IBattlerEffect b1 && b1.CanReduceStatStage(Stats.SPATK, attacker, false, this))
{
- b1.pbReduceStat(Stats.SPATK, 1, attacker, false, this, showanim);
+ b1.ReduceStat(Stats.SPATK, 1, attacker, false, this, showanim);
showanim = false;
}
- if (i is IBattlerEffect b2 && b2.pbCanReduceStatStage(Stats.SPEED, attacker, false, this))
+ if (i is IBattlerEffect b2 && b2.CanReduceStatStage(Stats.SPEED, attacker, false, this))
{
- b2.pbReduceStat(Stats.SPEED, 1, attacker, false, this, showanim);
+ b2.ReduceStat(Stats.SPEED, 1, attacker, false, this, showanim);
showanim = false;
}
}
if (!didsomething)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
return 0;
@@ -11424,7 +11425,7 @@ public partial class PokeBattle_Move_141 : PokeBattle_Move
{
public PokeBattle_Move_141() : base() { }
//public PokeBattle_Move_141(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool nonzero = false;
foreach (var i in new[] { Stats.ATTACK, Stats.DEFENSE, Stats.SPEED,
@@ -11437,16 +11438,16 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!nonzero)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
foreach (var i in new[] { Stats.ATTACK, Stats.DEFENSE, Stats.SPEED,
Stats.SPATK, Stats.SPDEF, Stats.ACCURACY, Stats.EVASION })
{
opponent.stages[(byte)i] *= -1;
}
- battle.pbDisplay(Game._INTL("{1}'s stats were reversed!", opponent.ToString()));
+ battle.Display(Game._INTL("{1}'s stats were reversed!", opponent.ToString()));
return 0;
}
}
@@ -11458,21 +11459,21 @@ public partial class PokeBattle_Move_142 : PokeBattle_Move
{
public PokeBattle_Move_142() : base() { }
//public PokeBattle_Move_142(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if ((opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker)) ||
- opponent.pbHasType(Types.GHOST) ||
+ opponent.HasType(Types.GHOST) ||
opponent.Ability == Abilities.MULTITYPE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Type3 = Types.GHOST;
string typename = Game._INTL(Types.GHOST.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} transformed into the {2} type!", opponent.ToString(), typename));
+ battle.Display(Game._INTL("{1} transformed into the {2} type!", opponent.ToString(), typename));
return 0;
}
}
@@ -11484,31 +11485,31 @@ public partial class PokeBattle_Move_143 : PokeBattle_Move
{
public PokeBattle_Move_143() : base() { }
//public PokeBattle_Move_143(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Substitute > 0 && !ignoresSubstitute(attacker))
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
if (opponent.effects.LeechSeed >= 0)
{
- battle.pbDisplay(Game._INTL("{1} evaded the attack!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} evaded the attack!", opponent.ToString()));
return -1;
}
- if (opponent.pbHasType(Types.GRASS) ||
+ if (opponent.HasType(Types.GRASS) ||
opponent.Ability == Abilities.MULTITYPE)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Type3 = Types.GRASS;
string typename = Game._INTL(Types.GRASS.ToString(TextScripts.Name));
- battle.pbDisplay(Game._INTL("{1} transformed into the {2} type!", opponent.ToString(), typename));
+ battle.Display(Game._INTL("{1} transformed into the {2} type!", opponent.ToString(), typename));
return 0;
}
}
@@ -11521,7 +11522,7 @@ public partial class PokeBattle_Move_144 : PokeBattle_Move
{
public PokeBattle_Move_144() : base() { }
//public PokeBattle_Move_144(Battle battle, Attack.Move move) : base(battle, move) { }
- public int pbModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
+ public int ModifyDamage(int damagemult, IBattler attacker, IBattler opponent)
{
type = Types.FLYING;// || -1
if (type >= 0)
@@ -11548,12 +11549,12 @@ public partial class PokeBattle_Move_145 : PokeBattle_Move
{
public PokeBattle_Move_145() : base() { }
//public PokeBattle_Move_145(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (pbTypeImmunityByAbility(pbType(this.type, attacker, opponent), attacker, opponent)) return -1;
+ if (TypeImmunityByAbility(GetType(this.type, attacker, opponent), attacker, opponent)) return -1;
if (opponent.effects.Electrify)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
if ((int)this.battle.choices[opponent.Index].Action != 1 || // Didn't choose a move
@@ -11561,13 +11562,13 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
this.battle.choices[opponent.Index].Move.id <= 0 ||
opponent.hasMovedThisRound())
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
opponent.effects.Electrify = true;
- battle.pbDisplay(Game._INTL("{1} was electrified!", opponent.ToString()));
+ battle.Display(Game._INTL("{1} was electrified!", opponent.ToString()));
return 0;
}
}
@@ -11580,7 +11581,7 @@ public partial class PokeBattle_Move_146 : PokeBattle_Move
{
public PokeBattle_Move_146() : base() { }
//public PokeBattle_Move_146(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
bool unmoved = false;
foreach (IBattler poke in this.battle.battlers)
@@ -11594,13 +11595,13 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!unmoved || this.battle.field.IonDeluge)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.field.IonDeluge = true;
- battle.pbDisplay(Game._INTL("The Ion Deluge started!"));
+ battle.Display(Game._INTL("The Ion Deluge started!"));
return 0;
}
}
@@ -11613,7 +11614,7 @@ public partial class PokeBattle_Move_147 : PokeBattle_Move
{
public PokeBattle_Move_147() : base() { }
//public PokeBattle_Move_147(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbAccuracyCheck(IBattler attacker, IBattler opponent)
+ public override bool AccuracyCheck(IBattler attacker, IBattler opponent)
{
return true;
}
@@ -11627,17 +11628,17 @@ public partial class PokeBattle_Move_148 : PokeBattle_Move
{
public PokeBattle_Move_148() : base() { }
//public PokeBattle_Move_148(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (opponent.effects.Powder)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
opponent.effects.Powder = true;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("{1} is covered in powder!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ battle.Display(Game._INTL("{1} is covered in powder!", attacker.ToString()));
return 0;
}
}
@@ -11649,17 +11650,17 @@ public partial class PokeBattle_Move_149 : PokeBattle_Move
{
public PokeBattle_Move_149() : base() { }
//public PokeBattle_Move_149(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
return (attacker.turncount > 1);
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- attacker.pbOwnSide.MatBlock = true;
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ attacker.OwnSide.MatBlock = true;
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- battle.pbDisplay(Game._INTL("{1} intends to flip up a mat and block incoming attacks!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} intends to flip up a mat and block incoming attacks!", attacker.ToString()));
return 0;
}
}
@@ -11671,11 +11672,11 @@ public partial class PokeBattle_Move_14A : PokeBattle_Move
{
public PokeBattle_Move_14A() : base() { }
//public PokeBattle_Move_14A(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOwnSide.CraftyShield)
+ if (attacker.OwnSide.CraftyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
bool unmoved = false;
@@ -11690,19 +11691,19 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!unmoved)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOwnSide.CraftyShield = true;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OwnSide.CraftyShield = true;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("Crafty Shield protected your team!"));
+ battle.Display(Game._INTL("Crafty Shield protected your team!"));
}
else
{
- battle.pbDisplay(Game._INTL("Crafty Shield protected the opposing team!"));
+ battle.Display(Game._INTL("Crafty Shield protected the opposing team!"));
}
return 0;
}
@@ -11716,11 +11717,11 @@ public partial class PokeBattle_Move_14B : PokeBattle_Move
{
public PokeBattle_Move_14B() : base() { }
//public PokeBattle_Move_14B(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.KingsShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
List ratesharers = new List {
@@ -11747,17 +11748,17 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
if (!unmoved ||
(!Core.USENEWBATTLEMECHANICS &&
- this.battle.pbRandom(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate)))
+ this.battle.Random(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate)))
{
attacker.effects.ProtectRate = 1;
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.KingsShield = true;
attacker.effects.ProtectRate *= 2;
- battle.pbDisplay(Game._INTL("{1} protected itself!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} protected itself!", attacker.ToString()));
return 0;
}
}
@@ -11770,11 +11771,11 @@ public partial class PokeBattle_Move_14C : PokeBattle_Move
{
public PokeBattle_Move_14C() : base() { }
//public PokeBattle_Move_14C(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (attacker.effects.SpikyShield)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
List ratesharers = new List {
@@ -11800,18 +11801,18 @@ public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum =
}
}
if (!unmoved ||
- this.battle.pbRandom(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate))
+ this.battle.Random(65536) >= Math.Floor(65536f / attacker.effects.ProtectRate))
{
attacker.effects.ProtectRate = 1;
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
attacker.effects.SpikyShield = true;
attacker.effects.ProtectRate *= 2;
- battle.pbDisplay(Game._INTL("{1} protected itself!", attacker.ToString()));
+ battle.Display(Game._INTL("{1} protected itself!", attacker.ToString()));
return 0;
}
}
@@ -11827,7 +11828,7 @@ public partial class PokeBattle_Move_14D : PokeBattle_Move
{
public PokeBattle_Move_14D() : base() { }
//public PokeBattle_Move_14D(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -11838,26 +11839,26 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} vanished instantly!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} vanished instantly!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- int ret = (int)base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = (int)base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (ret > 0)
{
opponent.effects.ProtectNegation = true;
- opponent.pbOwnSide.CraftyShield = false;
+ opponent.OwnSide.CraftyShield = false;
}
return ret;
}
@@ -11878,7 +11879,7 @@ public partial class PokeBattle_Move_14E : PokeBattle_Move
{
public PokeBattle_Move_14E() : base() { }
//public PokeBattle_Move_14E(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbTwoTurnAttack(IBattler attacker)
+ public override bool TwoTurnAttack(IBattler attacker)
{
this.immediate = false;
if (!this.immediate && attacker.hasWorkingItem(Items.POWER_HERB))
@@ -11889,45 +11890,45 @@ public override bool pbTwoTurnAttack(IBattler attacker)
return attacker.effects.TwoTurnAttack == 0;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.immediate || attacker.effects.TwoTurnAttack > 0)
{
- pbShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
- battle.pbDisplay(Game._INTL("{1} is absorbing power!", attacker.ToString()));
+ ShowAnimation(this.id, attacker, opponent, 1, alltargets, showanimation); // Charging anim
+ battle.Display(Game._INTL("{1} is absorbing power!", attacker.ToString()));
}
if (this.immediate)
{
- this.battle.pbCommonAnimation("UseItem", attacker, null);
+ this.battle.CommonAnimation("UseItem", attacker, null);
- battle.pbDisplay(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
- attacker.pbConsumeItem();
+ battle.Display(Game._INTL("{1} became fully charged due to its Power Herb!", attacker.ToString()));
+ attacker.ConsumeItem();
}
if (attacker.effects.TwoTurnAttack > 0) return 0;
- if (attacker is IBattlerEffect b &&
- !b.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this) &&
- !b.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b &&
+ !b.CanIncreaseStatStage(Stats.SPATK, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this) &&
+ !b.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- battle.pbDisplay(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
+ battle.Display(Game._INTL("{1}'s stats won't go any higher!", attacker.ToString()));
return -1;
}
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
bool showanim = true;
- if (attacker is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(Stats.SPATK, attacker, false, this))
+ if (attacker is IBattlerEffect b0 && b0.CanIncreaseStatStage(Stats.SPATK, attacker, false, this))
{
- b0.pbIncreaseStat(Stats.SPATK, 2, attacker, false, this, showanim);
+ b0.IncreaseStat(Stats.SPATK, 2, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b1 && b1.pbCanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
+ if (attacker is IBattlerEffect b1 && b1.CanIncreaseStatStage(Stats.SPDEF, attacker, false, this))
{
- b1.pbIncreaseStat(Stats.SPDEF, 2, attacker, false, this, showanim);
+ b1.IncreaseStat(Stats.SPDEF, 2, attacker, false, this, showanim);
showanim = false;
}
- if (attacker is IBattlerEffect b2 && b2.pbCanIncreaseStatStage(Stats.SPEED, attacker, false, this))
+ if (attacker is IBattlerEffect b2 && b2.CanIncreaseStatStage(Stats.SPEED, attacker, false, this))
{
- b2.pbIncreaseStat(Stats.SPEED, 2, attacker, false, this, showanim);
+ b2.IncreaseStat(Stats.SPEED, 2, attacker, false, this, showanim);
showanim = false;
}
return 0;
@@ -11946,23 +11947,23 @@ public override bool isHealingMove()
return Core.USENEWBATTLEMECHANICS;
}
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0)
{
int hpgain = (int)Math.Round(opponent.damagestate.HPLost * 3 / 4f);
if (opponent.hasWorkingAbility(Abilities.LIQUID_OOZE))
{
- attacker.pbReduceHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1} sucked up the liquid ooze!", attacker.ToString()));
+ attacker.ReduceHP(hpgain, true);
+ battle.Display(Game._INTL("{1} sucked up the liquid ooze!", attacker.ToString()));
}
else if (attacker.effects.HealBlock == 0)
{
if (attacker.hasWorkingItem(Items.BIG_ROOT)) hpgain = (int)Math.Floor(hpgain * 1.3f);
- attacker.pbRecoverHP(hpgain, true);
- battle.pbDisplay(Game._INTL("{1} had its energy drained!", opponent.ToString()));
+ attacker.RecoverHP(hpgain, true);
+ battle.Display(Game._INTL("{1} had its energy drained!", opponent.ToString()));
}
}
return ret;
@@ -11977,14 +11978,14 @@ public partial class PokeBattle_Move_150 : PokeBattle_Move
{
public PokeBattle_Move_150() : base() { }
//public PokeBattle_Move_150(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- int ret = base.pbEffect(attacker, opponent, hitnum, alltargets, showanimation);
+ int ret = base.GetEffect(attacker, opponent, hitnum, alltargets, showanimation);
if (opponent.damagestate.CalcDamage > 0 && opponent.isFainted())
{
- if (attacker is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
+ if (attacker is IBattlerEffect b && b.CanIncreaseStatStage(Stats.ATTACK, attacker, false, this))
{
- b.pbIncreaseStat(Stats.ATTACK, 2, attacker, false, this);
+ b.IncreaseStat(Stats.ATTACK, 2, attacker, false, this);
}
}
return ret;
@@ -12000,26 +12001,26 @@ public partial class PokeBattle_Move_151 : PokeBattle_Move
{
public PokeBattle_Move_151() : base() { }
//public PokeBattle_Move_151(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
int ret = -1;
- pbShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, opponent, hitnum, alltargets, showanimation);
if (!this.Flags.SoundBased ||
attacker.hasMoldBreaker() || !opponent.hasWorkingAbility(Abilities.SOUNDPROOF))
{
bool showanim = true;
- if (opponent is IBattlerEffect b0 && b0.pbReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim))
+ if (opponent is IBattlerEffect b0 && b0.ReduceStat(Stats.ATTACK, 1, attacker, false, this, showanim))
{
showanim = false; ret = 0;
}
- if (opponent is IBattlerEffect b1 && b1.pbReduceStat(Stats.SPATK, 1, attacker, false, this, showanim))
+ if (opponent is IBattlerEffect b1 && b1.ReduceStat(Stats.SPATK, 1, attacker, false, this, showanim))
{
showanim = false; ret = 0;
}
}
if (!attacker.isFainted() &&
- this.battle.pbCanChooseNonActive(attacker.Index) &&
- !this.battle.pbAllFainted(this.battle.pbParty(opponent.Index)))
+ this.battle.CanChooseNonActive(attacker.Index) &&
+ !this.battle.AllFainted(this.battle.Party(opponent.Index)))
{
attacker.effects.Uturn = true; ret = 0;
}
@@ -12035,17 +12036,17 @@ public partial class PokeBattle_Move_152 : PokeBattle_Move
{
public PokeBattle_Move_152() : base() { }
//public PokeBattle_Move_152(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.FairyLock > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.field.FairyLock = 2;
- battle.pbDisplay(Game._INTL("No one will be able to run away during the next turn!"));
+ battle.Display(Game._INTL("No one will be able to run away during the next turn!"));
return 0;
}
}
@@ -12057,23 +12058,23 @@ public partial class PokeBattle_Move_153 : PokeBattle_Move
{
public PokeBattle_Move_153() : base() { }
//public PokeBattle_Move_153(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (attacker.pbOpposingSide.StickyWeb)
+ if (attacker.OpposingSide.StickyWeb)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
- attacker.pbOpposingSide.StickyWeb = true;
- if (!this.battle.pbIsOpposing(attacker.Index))
+ attacker.OpposingSide.StickyWeb = true;
+ if (!this.battle.IsOpposing(attacker.Index))
{
- battle.pbDisplay(Game._INTL("A sticky web has been laid out beneath the opposing team's feet!"));
+ battle.Display(Game._INTL("A sticky web has been laid out beneath the opposing team's feet!"));
}
else
{
- battle.pbDisplay(Game._INTL("A sticky web has been laid out beneath your team's feet!"));
+ battle.Display(Game._INTL("A sticky web has been laid out beneath your team's feet!"));
}
return 0;
}
@@ -12088,19 +12089,19 @@ public partial class PokeBattle_Move_154 : PokeBattle_Move
{
public PokeBattle_Move_154() : base() { }
//public PokeBattle_Move_154(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.ElectricTerrain > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.field.GrassyTerrain = 0;
this.battle.field.MistyTerrain = 0;
this.battle.field.ElectricTerrain = 5;
- battle.pbDisplay(Game._INTL("An electric current runs across the battlefield!"));
+ battle.Display(Game._INTL("An electric current runs across the battlefield!"));
return 0;
}
}
@@ -12114,19 +12115,19 @@ public partial class PokeBattle_Move_155 : PokeBattle_Move
{
public PokeBattle_Move_155() : base() { }
//public PokeBattle_Move_155(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.GrassyTerrain > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.field.ElectricTerrain = 0;
this.battle.field.MistyTerrain = 0;
this.battle.field.GrassyTerrain = 5;
- battle.pbDisplay(Game._INTL("Grass grew to cover the battlefield!"));
+ battle.Display(Game._INTL("Grass grew to cover the battlefield!"));
return 0;
}
}
@@ -12140,19 +12141,19 @@ public partial class PokeBattle_Move_156 : PokeBattle_Move
{
public PokeBattle_Move_156() : base() { }
//public PokeBattle_Move_156(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
if (this.battle.field.MistyTerrain > 0)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.field.ElectricTerrain = 0;
this.battle.field.GrassyTerrain = 0;
this.battle.field.MistyTerrain = 5;
- battle.pbDisplay(Game._INTL("Mist swirled about the battlefield!"));
+ battle.Display(Game._INTL("Mist swirled about the battlefield!"));
return 0;
}
}
@@ -12164,17 +12165,17 @@ public partial class PokeBattle_Move_157 : PokeBattle_Move
{
public PokeBattle_Move_157() : base() { }
//public PokeBattle_Move_157(Battle battle, Attack.Move move) : base(battle, move) { }
- public override int pbEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
+ public override int GetEffect(IBattler attacker, IBattler opponent, int hitnum = 0, int[] alltargets = null, bool showanimation = true)
{
- if (this.battle.pbIsOpposing(attacker.Index) || this.battle.doublemoney)
+ if (this.battle.IsOpposing(attacker.Index) || this.battle.doublemoney)
{
- battle.pbDisplay(Game._INTL("But it failed!"));
+ battle.Display(Game._INTL("But it failed!"));
return -1;
}
- pbShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
+ ShowAnimation(this.id, attacker, null, hitnum, alltargets, showanimation);
this.battle.doublemoney = true;
- battle.pbDisplay(Game._INTL("Everyone is caught up in the happy atmosphere!"));
+ battle.Display(Game._INTL("Everyone is caught up in the happy atmosphere!"));
return 0;
}
}
@@ -12186,13 +12187,13 @@ public partial class PokeBattle_Move_158 : PokeBattle_Move
{
public PokeBattle_Move_158() : base() { }
//public PokeBattle_Move_158(Battle battle, Attack.Move move) : base(battle, move) { }
- public override bool pbMoveFailed(IBattler attacker, IBattler opponent)
+ public override bool MoveFailed(IBattler attacker, IBattler opponent)
{
return attacker.Species == Pokemons.NONE || !attacker.pokemon.belch;
}
}
#endregion
-#pragma warning restore 0162 //Warning CS0162 Unreachable code detected
+#pragma warning restore 0162 //Warning CS0162 Unreachable code detected
//===============================================================================
// NOTE: If you're inventing new move effects, use function code 159 and onwards.
//===============================================================================
diff --git a/PokemonUnity.Application/Combat/Battle.cs b/PokemonUnity.Application/Combat/Battle.cs
index 03d45a0b1..6cbe32a08 100644
--- a/PokemonUnity.Application/Combat/Battle.cs
+++ b/PokemonUnity.Application/Combat/Battle.cs
@@ -52,7 +52,7 @@ public partial class Battle : IBattle, IHasDisplayMessage
/// False if there are no consequences to player's defeat.
///
/// (Ground Hogs day anyone?)
- public bool canLose { get; private set; }
+ public bool canLose { get; protected set; }
///
/// Shift/Set "battle style" option
///
@@ -86,7 +86,7 @@ public partial class Battle : IBattle, IHasDisplayMessage
/// Pokémon party for All Trainers in Battle.
/// Array[4,6] = 0: Player, 1: Foe, 2: Ally, 3: Foe's Ally
///
- //public IPokemon[,] party { get; private set; }
+ //public IPokemon[,] party { get; protected set; }
///
/// Order of Pokémon in the player's party
///
@@ -106,22 +106,23 @@ public partial class Battle : IBattle, IHasDisplayMessage
///
/// Currently active Pokémon
///
- public IBattler[] battlers { get; protected set; }
+ public IBattler[] battlers { get { return _battlers; } }
+ protected IBattler[] _battlers;
///
/// Items held by opponents
///
- //public List items { get; private set; }
+ //public List items { get; protected set; }
public Items[][] items { get; set; }
///
/// Effects common to each side of a battle
///
- /// public List sides { get; private set; }
- public IEffectsSide[] sides { get; private set; }
+ /// public List sides { get; protected set; }
+ public IEffectsSide[] sides { get; protected set; }
///
/// Effects common to the whole of a battle
///
- /// public List field { get; private set; }
- public IEffectsField field { get; private set; }
+ /// public List field { get; protected set; }
+ public IEffectsField field { get; protected set; }
///
/// Battle surroundings;
/// Environment node is used for background visual,
@@ -129,7 +130,7 @@ public partial class Battle : IBattle, IHasDisplayMessage
///
public Environments environment { get; set; }
///
- /// Current weather, custom methods should use instead
+ /// Current weather, custom methods should use instead
///
public Weather weather { get; set; }
//public void SetWeather (Weather weather) { this.weather = weather; }
@@ -140,11 +141,11 @@ public partial class Battle : IBattle, IHasDisplayMessage
///
/// True if during the switching phase of the round
///
- public bool switching { get; private set; }
+ public bool switching { get; protected set; }
///
/// True if Future Sight is hitting
///
- public bool futuresight { get; private set; }
+ public bool futuresight { get; protected set; }
///
/// The Struggle move
///
@@ -152,7 +153,7 @@ public partial class Battle : IBattle, IHasDisplayMessage
/// Execute whatever move/function is stored in this variable
///
/// Func
- public IBattleMove struggle { get; private set; }
+ public IBattleMove struggle { get; protected set; }
///
/// Choices made by each Pokémon this round
///
@@ -160,7 +161,7 @@ public partial class Battle : IBattle, IHasDisplayMessage
///
/// Success states
///
- public ISuccessState[] successStates { get; private set; }
+ public ISuccessState[] successStates { get; protected set; }
///
/// Last move used
///
@@ -173,7 +174,7 @@ public partial class Battle : IBattle, IHasDisplayMessage
/// Battle index of each trainer's Pokémon to Mega Evolve
///
/// Instead of reflecting entire party, it displays for active on field?
- public int[][] megaEvolution { get; private set; }
+ public int[][] megaEvolution { get; protected set; }
///
/// Whether Amulet Coin's effect applies
///
@@ -204,34 +205,38 @@ public partial class Battle : IBattle, IHasDisplayMessage
public string endspeechwin2 { get; set; }
///
///
- public IDictionary rules { get; private set; }
- //public List rules { get; private set; }
+ public IDictionary rules { get; protected set; }
+ //public List rules { get; protected set; }
///
/// Counter to track number of turns for battle
///
public int turncount { get; set; }
- public IBattler[] priority { get; protected set; }
- public List snaggedpokemon { get; private set; }
+ protected IBattler[] priority { get { return _priority; } }
+ protected IBattler[] _priority;
+ protected List snaggedpokemon;
///
/// Each time you use the option to flee, the counter goes up.
///
- public int runCommand { get; private set; }
+ protected int runCommand;
///
/// Another counter that has something to do with tracking items picked up during a battle
///
public int nextPickupUse { get { pickupUse+=1; return pickupUse; } }
- private int pickupUse { get; set; }
- public bool controlPlayer { get; set; }
- public bool usepriority { get; set; }
- public IBattlePeer peer { get; set; }
+ protected int pickupUse;
+ protected bool controlPlayer;
+ protected bool usepriority;
+ protected IBattlePeer peer;
#endregion
#region Constructor
///
+ /// using this to override constructor behavior on inherited...
///
+ protected Battle() { }
public Battle(IScene scene, IPokemon[] p1, IPokemon[] p2, ITrainer player, ITrainer opponent)
+ : this (scene, p1, p2, player == null ? null : new ITrainer[] { player }, opponent == null ? null : new ITrainer[] { opponent })
{
- (this as IBattle).initialize(scene, p1, p2, player, opponent);
+ //(this as IBattle).initialize(scene, p1, p2, player, opponent);
}
public Battle(IScene scene, IPokemon[] p1, IPokemon[] p2, ITrainer[] player, ITrainer[] opponent)
{
@@ -301,7 +306,7 @@ public IBattle initialize(IScene scene, IPokemon[] p1, IPokemon[] p2, ITrainer[]
fullparty1 = false;
fullparty2 = false;
- battlers = new Pokemon[maxBattlers];
+ _battlers = new Pokemon[maxBattlers];
//items = new List(); //null;
items = new Items[this.opponent.Length][];
for (int t = 0; t < this.opponent.Length; t++) //List of Trainers
@@ -358,25 +363,25 @@ public IBattle initialize(IScene scene, IPokemon[] p1, IPokemon[] p2, ITrainer[]
peer = PokemonUnity.Monster.PokeBattle_BattlePeer.create();
//peer = new PokeBattle_BattlePeer();
- priority = new Pokemon[battlers.Length];
+ _priority = new Pokemon[battlers.Length];
- //usepriority = false; //False is already default value; redundant.
+ usepriority = false;
snaggedpokemon = new List();
runCommand = 0;
if (Kernal.MoveData.Keys.Contains(Moves.STRUGGLE))
- struggle = Combat.Move.pbFromPBMove(this, new Attack.Move(Moves.STRUGGLE));
+ struggle = Combat.Move.FromMove(this, new Attack.Move(Moves.STRUGGLE));
else
struggle = new PokeBattle_Struggle().Initialize(this, new Attack.Move(Moves.STRUGGLE));
//struggle.PP = -1;
for (int i = 0; i < battlers.Length; i++) {
- this.battlers[i] = new Pokemon(this, (sbyte)i);
+ this._battlers[i] = new Pokemon(this, (sbyte)i);
//} for (int i = 0; i < battlers.Length; i++) {
- // this.battlers[i].initialize(this, (sbyte)i);
+ // this._battlers[i].initialize(this, (sbyte)i);
}
foreach (var i in party1)
@@ -399,26 +404,26 @@ public IBattle initialize(IScene scene, IPokemon[] p1, IPokemon[] p2, ITrainer[]
#endregion
#region Method
- public virtual int pbRandom(int index)
+ public virtual int Random(int index)
{
return Core.Rand.Next(index);
}
- public virtual void pbAbort() {
+ public virtual void Abort() {
//GameDebug.LogError("Battle aborted");
throw new BattleAbortedException("Battle aborted");
}
#region Catching and storing Pokémon.
- public virtual void pbStorePokemon(IPokemon pokemon)
+ public virtual void StorePokemon(IPokemon pokemon)
{
if(pokemon is IPokemonShadowPokemon p && !p.isShadow)
- if (pbDisplayConfirm(Game._INTL("Would you like to give a nickname to {1}?", Game._INTL(pokemon.Species.ToString(TextScripts.Name)))))
+ if (DisplayConfirm(Game._INTL("Would you like to give a nickname to {1}?", Game._INTL(pokemon.Species.ToString(TextScripts.Name)))))
{
- //string nick = @scene.pbNameEntry(Game._INTL("{1}'s nickname?", Game._INTL(pokemon.Species.ToString(TextScripts.Name))), pokemon);
+ //string nick = @scene.NameEntry(Game._INTL("{1}'s nickname?", Game._INTL(pokemon.Species.ToString(TextScripts.Name))), pokemon);
string nick = string.Empty;
if (@scene is IPokeBattle_Scene s0)
- nick = s0.pbNameEntry(Game._INTL("{1}'s nickname?", Game._INTL(pokemon.Species.ToString(TextScripts.Name))), pokemon);
+ nick = s0.NameEntry(Game._INTL("{1}'s nickname?", Game._INTL(pokemon.Species.ToString(TextScripts.Name))), pokemon);
//if(!string.IsNullOrEmpty(nick)) pokemon.Name = nick;
if(!string.IsNullOrEmpty(nick)) (pokemon as Monster.Pokemon).SetNickname(nick);
}
@@ -430,50 +435,50 @@ public virtual void pbStorePokemon(IPokemon pokemon)
// success = Game.GameData.Player.PC.hasSpace();
// if(!success) Game.GameData.Player.PC.getIndexOfFirstEmpty();
//} while (!success); //Cycle through all boxes unless they're all full
- int oldcurbox = @peer.pbCurrentBox(); //Game.GameData.Player.PC.ActiveBox;
- int storedbox = @peer.pbStorePokemon(pbPlayer(), pokemon);
+ int oldcurbox = @peer.CurrentBox(); //Game.GameData.Player.PC.ActiveBox;
+ int storedbox = @peer.StorePokemon(Player(), pokemon);
//int? storedbox = Game.GameData.Player.PC.getIndexOfFirstEmpty();
if (storedbox<0) return; //!storedbox.HasValue
- string creator = @peer.pbGetStorageCreator(); //Game.GameData.Player.IsCreator ? Game.GameData.Trainer.name : @peer.pbGetStorageCreator();
- string curboxname = @peer.pbBoxName(oldcurbox); //Game.GameData.Player.PC.BoxNames[oldcurbox];
- string boxname = @peer.pbBoxName(storedbox); //Game.GameData.Player.PC.BoxNames[storedbox.Value];
+ string creator = @peer.GetStorageCreator(); //Game.GameData.Player.IsCreator ? Game.GameData.Trainer.name : @peer.GetStorageCreator();
+ string curboxname = @peer.BoxName(oldcurbox); //Game.GameData.Player.PC.BoxNames[oldcurbox];
+ string boxname = @peer.BoxName(storedbox); //Game.GameData.Player.PC.BoxNames[storedbox.Value];
if (storedbox != oldcurbox) {
if (creator != null) //Game.GameData.Player.IsCreator
- pbDisplayPaused(Game._INTL("Box \"{1}\" on {2}'s PC was full.", curboxname, creator));
+ DisplayPaused(Game._INTL("Box \"{1}\" on {2}'s PC was full.", curboxname, creator));
else
- pbDisplayPaused(Game._INTL("Box \"{1}\" on someone's PC was full.", curboxname));
- pbDisplayPaused(Game._INTL("{1} was transferred to box \"{2}\".", pokemon.Name, boxname));
+ DisplayPaused(Game._INTL("Box \"{1}\" on someone's PC was full.", curboxname));
+ DisplayPaused(Game._INTL("{1} was transferred to box \"{2}\".", pokemon.Name, boxname));
}
else {
if (creator != null) //Game.GameData.Player.IsCreator
- pbDisplayPaused(Game._INTL("{1} was transferred to {2}'s PC.", pokemon.Name, creator));
+ DisplayPaused(Game._INTL("{1} was transferred to {2}'s PC.", pokemon.Name, creator));
else
- pbDisplayPaused(Game._INTL("{1} was transferred to someone's PC.", pokemon.Name));
- pbDisplayPaused(Game._INTL("It was stored in box \"{1}\".", boxname));
+ DisplayPaused(Game._INTL("{1} was transferred to someone's PC.", pokemon.Name));
+ DisplayPaused(Game._INTL("It was stored in box \"{1}\".", boxname));
}
}
- public virtual void pbThrowPokeball(int idxPokemon, Items ball, int? rareness = null, bool showplayer = false)
+ public virtual void ThrowPokeball(int idxPokemon, Items ball, int? rareness = null, bool showplayer = false)
{
string itemname = Game._INTL(ball.ToString(TextScripts.Name));
IBattler battler = null;
- if (pbIsOpposing(idxPokemon))
+ if (IsOpposing(idxPokemon))
battler = battlers[idxPokemon];
else
- battler = battlers[idxPokemon].pbOppositeOpposing;
+ battler = battlers[idxPokemon].OppositeOpposing;
if (battler.isFainted())
- battler = battler.pbPartner;
- pbDisplayBrief(Game._INTL("{1} threw one {2}!", Game.GameData.Trainer.name, itemname));
+ battler = battler.Partner;
+ DisplayBrief(Game._INTL("{1} threw one {2}!", Game.GameData.Trainer.name, itemname));
if (battler.isFainted())
{
- pbDisplay(Game._INTL("But there was no target..."));
+ Display(Game._INTL("But there was no target..."));
return;
}
int shakes = 0; bool critical = false;
if (opponent.Length > 0//.ID != TrainerTypes.WildPokemon)
- && ((Game.GameData is IItemCheck ch && !ch.pbIsSnagBall(ball)) || battler is IBattlerShadowPokemon s && !s.isShadow()))
+ && ((Game.GameData is IItemCheck ch && !ch.IsSnagBall(ball)) || battler is IBattlerShadowPokemon s && !s.isShadow()))
{
- if (@scene is IPokeBattle_Scene s0) s0.pbThrowAndDeflect(ball, 1);
- pbDisplay(Game._INTL("The Trainer blocked the Ball!\nDon't be a thief!"));
+ if (@scene is IPokeBattle_Scene s0) s0.ThrowAndDeflect(ball, 1);
+ Display(Game._INTL("The Trainer blocked the Ball!\nDon't be a thief!"));
}
else
{
@@ -511,69 +516,69 @@ public virtual void pbThrowPokeball(int idxPokemon, Items ball, int? rareness =
{
if (x < 1) x = 1;
int y = (int)Math.Floor(65536 / (Math.Pow((255.0 / x), 0.1875)));//(255.0 / x) ^ 0.1875
- if (Core.USECRITICALCAPTURE && pbRandom(256) < 0)
+ if (Core.USECRITICALCAPTURE && Random(256) < 0)
{
critical = true;
- if (pbRandom(65536) < y) shakes = 4;
+ if (Random(65536) < y) shakes = 4;
}
else
{
- if (pbRandom(65536) 0)
+ DisplayBrief(Game._INTL("Gotcha! {1} was caught!", pokemon.Name));
+ if (@scene is IPokeBattle_Scene s1) s1.ThrowSuccess();
+ if (Game.GameData is IItemCheck c0 && c0.IsSnagBall(ball) && @opponent.Length > 0)
{
- pbRemoveFromParty(battler.Index, battler.pokemonIndex);
- battler.pbReset();
+ RemoveFromParty(battler.Index, battler.pokemonIndex);
+ battler.Reset();
battler.participants = new List();
}
else
@decision = BattleResults.CAPTURED;
//Script is repeated below as `SetCatchInfo`
- if (Game.GameData is IItemCheck c1 && c1.pbIsSnagBall(ball))
+ if (Game.GameData is IItemCheck c1 && c1.IsSnagBall(ball))
{
pokemon.ot = this.player[0].name;
pokemon.trainerID = this.player[0].id;
//pokemon.OT = this.player[0].Trainer;
}
BallHandlers.OnCatch(ball,this,pokemon);
- pokemon.ballUsed = ball; //pbGetBallType(ball);
+ pokemon.ballUsed = ball; //GetBallType(ball);
if (pokemon is IPokemonMegaEvolution m0) m0.makeUnmega(); //rescue null
if (pokemon is IPokemonMegaEvolution m1) m1.makeUnprimal(); //rescue null
- pokemon.pbRecordFirstMoves();
+ pokemon.RecordFirstMoves();
BallHandlers.OnCatch(ball,this,pokemon);
- //pokemon = new Monster.Pokemon(pokemon, ball, pbIsSnagBall(ball) ? Monster.Pokemon.ObtainedMethod.SNAGGED : Monster.Pokemon.ObtainedMethod.MET);
- //pokemon.SetCatchInfos(this.pbPlayer(), ball, Item.pbIsSnagBall(ball) ? Monster.Pokemon.ObtainedMethod.SNAGGED : Monster.Pokemon.ObtainedMethod.MET);
+ //pokemon = new Monster.Pokemon(pokemon, ball, IsSnagBall(ball) ? Monster.Pokemon.ObtainedMethod.SNAGGED : Monster.Pokemon.ObtainedMethod.MET);
+ //pokemon.SetCatchInfos(this.Player(), ball, Item.IsSnagBall(ball) ? Monster.Pokemon.ObtainedMethod.SNAGGED : Monster.Pokemon.ObtainedMethod.MET);
if (Core.GAINEXPFORCAPTURE)
{
battler.captured = true;
- pbGainEXP();
+ GainEXP();
battler.captured = false;
}
if (Game.GameData.Trainer.pokedex) //Trainer has a Pokedex
@@ -583,18 +588,18 @@ public virtual void pbThrowPokeball(int idxPokemon, Items ball, int? rareness =
{
this.player[0].setOwned(species);
//Game.GameData.Player.Pokedex[(int)pokemon.Species, 1] = 1;
- pbDisplayPaused(Game._INTL("{1}'s data was added to the Pokédex.", pokemon.Name));
- if (@scene is IPokeBattle_Scene s2) s2.pbShowPokedex(pokemon.Species);
+ DisplayPaused(Game._INTL("{1}'s data was added to the Pokédex.", pokemon.Name));
+ if (@scene is IPokeBattle_Scene s2) s2.ShowPokedex(pokemon.Species);
}
}
- if (@scene is IPokeBattle_Scene s3) s3.pbHideCaptureBall();
- if (Game.GameData is IItemCheck c2 && c2.pbIsSnagBall(ball) && @opponent.Length > 0)
+ if (@scene is IPokeBattle_Scene s3) s3.HideCaptureBall();
+ if (Game.GameData is IItemCheck c2 && c2.IsSnagBall(ball) && @opponent.Length > 0)
{
- if (pokemon is IPokemonShadowPokemon sp) sp.pbUpdateShadowMoves(); //rescue null
+ if (pokemon is IPokemonShadowPokemon sp) sp.UpdateShadowMoves(); //rescue null
@snaggedpokemon.Add((byte)battler.Index); //pokemon
}
else
- pbStorePokemon(pokemon);
+ StorePokemon(pokemon);
break;
}
}
@@ -602,7 +607,7 @@ public virtual void pbThrowPokeball(int idxPokemon, Items ball, int? rareness =
#endregion
#region Info about battle.
- public virtual bool pbDoubleBattleAllowed()
+ public virtual bool DoubleBattleAllowed()
{
if (!@fullparty1 && @party1.Length>Core.MAXPARTYSIZE) {
return false;
@@ -640,34 +645,35 @@ public virtual bool pbDoubleBattleAllowed()
}
}
if (_opponent.Length > 0) {
- int sendout1=pbFindNextUnfainted(@party2,0,pbSecondPartyBegin(1));
- int sendout2=pbFindNextUnfainted(@party2,pbSecondPartyBegin(1));
+ int sendout1=FindNextUnfainted(@party2,0,SecondPartyBegin(1));
+ int sendout2=FindNextUnfainted(@party2,SecondPartyBegin(1));
if (sendout1<0 || sendout2<0) return false;
}
else {
- int sendout1=pbFindNextUnfainted(@party2,0);
- int sendout2=pbFindNextUnfainted(@party2,sendout1+1);
+ int sendout1=FindNextUnfainted(@party2,0);
+ int sendout2=FindNextUnfainted(@party2,sendout1+1);
if (sendout1<0 || sendout2<0) return false;
}
}
if (_player.Length > 0) {
- int sendout1=pbFindNextUnfainted(@party1,0,pbSecondPartyBegin(0));
- int sendout2=pbFindNextUnfainted(@party1,pbSecondPartyBegin(0));
+ int sendout1=FindNextUnfainted(@party1,0,SecondPartyBegin(0));
+ int sendout2=FindNextUnfainted(@party1,SecondPartyBegin(0));
if (sendout1<0 || sendout2<0) return false;
}
else {
- int sendout1=pbFindNextUnfainted(@party1,0);
- int sendout2=pbFindNextUnfainted(@party1,sendout1+1);
+ int sendout1=FindNextUnfainted(@party1,0);
+ int sendout2=FindNextUnfainted(@party1,sendout1+1);
if (sendout1<0 || sendout2<0) return false;
}
return true;
}
- public Weather pbWeather { get //()
+ public virtual Weather Weather { get //()
{
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].hasWorkingAbility(Abilities.CLOUD_NINE) ||
- @battlers[i].hasWorkingAbility(Abilities.AIR_LOCK)) {
+ if (_battlers[i].IsNotNullOrNone() && (
+ _battlers[i].hasWorkingAbility(Abilities.CLOUD_NINE) ||
+ _battlers[i].hasWorkingAbility(Abilities.AIR_LOCK))) {
return Weather.NONE;
}
}
@@ -677,18 +683,18 @@ public virtual bool pbDoubleBattleAllowed()
#endregion
#region Get Battler Info.
- public bool pbIsOpposing(int index)
+ public bool IsOpposing(int index)
{
return (index % 2) == 1;
}
- public bool pbOwnedByPlayer(int index)
+ public bool OwnedByPlayer(int index)
{
- if (pbIsOpposing(index)) return false;
+ if (IsOpposing(index)) return false;
if (@player.Length > 0 && index==2) return false;
return true;
}
- public bool pbIsDoubleBattler(int index) {
+ public bool IsDoubleBattler(int index) {
return (index>=2);
}
///
@@ -698,8 +704,8 @@ public bool pbIsDoubleBattler(int index) {
///
///
public string ToString(int battlerindex, int pokemonindex) {
- IPokemon[] party=pbParty(battlerindex);
- if (pbIsOpposing(battlerindex)) {
+ IPokemon[] party=Party(battlerindex);
+ if (IsOpposing(battlerindex)) {
if (@opponent != null) {
return Game._INTL("The foe {1}", party[pokemonindex].Name);
//return Game._INTL("The foe {1}", party[battlerindex,pokemonindex].Name);
@@ -721,8 +727,8 @@ public string ToString(int battlerindex, int pokemonindex) {
///
///
///
- public bool pbIsUnlosableItem(IBattler pkmn, Items item) {
- if (Kernal.ItemData[item].IsLetter) return true; //pbIsMail(item)
+ public bool IsUnlosableItem(IBattler pkmn, Items item) {
+ if (ItemData.IsLetter(item)) return true; //IsMail(item)
if (pkmn.effects.Transform) return false;
if (pkmn.Ability == Abilities.MULTITYPE) {
Items[] plates= new Items[] { Items.FIST_PLATE, Items.SKY_PLATE, Items.TOXIC_PLATE, Items.EARTH_PLATE, Items.STONE_PLATE,
@@ -799,10 +805,10 @@ public bool pbIsUnlosableItem(IBattler pkmn, Items item) {
return false;
}
- public IBattler pbCheckGlobalAbility(Abilities a) {
+ public IBattler CheckGlobalAbility(Abilities a) {
for (int i = 0; i < battlers.Length; i++) { // in order from own first, opposing first, own second, opposing second
- if (@battlers[i].hasWorkingAbility(a)) {
- return @battlers[i];
+ if (_battlers[i].hasWorkingAbility(a)) {
+ return _battlers[i];
}
}
return null;
@@ -810,7 +816,7 @@ public IBattler pbCheckGlobalAbility(Abilities a) {
#endregion
#region Player-related Info.
- public ITrainer pbPlayer() {
+ public ITrainer Player() {
if (@player?.Length > 0) {
return @player[0];
}
@@ -819,9 +825,9 @@ public ITrainer pbPlayer() {
}
}
- public Items[] pbGetOwnerItems(int battlerIndex) {
+ public Items[] GetOwnerItems(int battlerIndex) {
if (@items == null) return new Items[0];
- if (pbIsOpposing(battlerIndex)) {
+ if (IsOpposing(battlerIndex)) {
if (@opponent.Length > 0) {
return (battlerIndex==1) ? @items[0] : @items[1];
}
@@ -834,36 +840,36 @@ public Items[] pbGetOwnerItems(int battlerIndex) {
}
}
- public void pbSetSeen(IPokemon pokemon) {
+ public void SetSeen(IPokemon pokemon) {
if (Game.GameData.Trainer.pokedex &&
(pokemon.IsNotNullOrNone() && @internalbattle)) { //Trainer has a Pokedex
- this.pbPlayer().seen[pokemon.Species]=true;
- if (Game.GameData is IGameUtility g) g.pbSeenForm(pokemon);
+ this.Player().seen[pokemon.Species]=true;
+ if (Game.GameData is IGameUtility g) g.SeenForm(pokemon);
//Game.GameData.Player.Pokedex[(int)pokemon.Species,0] = 1;
//Game.GameData.Player.Pokedex[(int)pokemon.Species,2] = (byte)pokemon.form;
}
}
- public string pbGetMegaRingName(int battlerIndex) {
- if (pbBelongsToPlayer(battlerIndex)) {
+ public string GetMegaRingName(int battlerIndex) {
+ if (BelongsToPlayer(battlerIndex)) {
foreach (Items i in Core.MEGARINGS) {
- //if (!hasConst(PBItems,i)) continue;
- if (Game.GameData.Bag.pbQuantity(i)>0) return Game._INTL(i.ToString(TextScripts.Name));
+ //if (!hasConst(Items,i)) continue;
+ if (Game.GameData.Bag.Quantity(i)>0) return Game._INTL(i.ToString(TextScripts.Name));
//if (Game.GameData.Player.Bag.GetItemAmount(i)>0) return Game._INTL(i.ToString(TextScripts.Name));
}
}
// Add your own Mega objects for particular trainer types here
- if (pbGetOwner(battlerIndex).trainertype == TrainerTypes.BUGCATCHER) {
+ if (GetOwner(battlerIndex).trainertype == TrainerTypes.BUGCATCHER) {
return Game._INTL("Mega Net");
}
return Game._INTL("Mega Ring");
}
- public bool pbHasMegaRing(int battlerIndex) {
- if (!pbBelongsToPlayer(battlerIndex)) return true;
+ public bool HasMegaRing(int battlerIndex) {
+ if (!BelongsToPlayer(battlerIndex)) return true;
foreach (Items i in Core.MEGARINGS) {
- //if (!hasConst(PBItems,i)) continue;
- if (Game.GameData.Bag.pbQuantity(i)>0) return true;
+ //if (!hasConst(Items,i)) continue;
+ if (Game.GameData.Bag.Quantity(i)>0) return true;
//if (Game.GameData.Player.Bag.GetItemAmount(i)>0) return true;
}
return false;
@@ -871,31 +877,17 @@ public bool pbHasMegaRing(int battlerIndex) {
#endregion
#region Get party info, manipulate parties.
- public int PokemonCount(IPokemon[] party)
- {
- int count = 0;
- for (int i = 0; i < party.Length; i++)
- {
- if (party[i].Species == Pokemons.NONE) continue;
- if (party[i].HP > 0 && !party[i].isEgg) count += 1;
- }
- return count;
- }
- public bool AllFainted(IPokemon[] party)
- {
- return PokemonCount(party) == 0;
- }
- public int MaxLevel(IPokemon[] party)
- {
- int lv = 0;
- for (int i = 0; i < party.Length; i++)
- {
- if (party[i].Species == Pokemons.NONE) continue;
- if (lv < party[i].Level) lv = party[i].Level;
- }
- return lv;
- }
- public int pbPokemonCount(IPokemon[] party) {
+ //public int PokemonCount(IPokemon[] party)
+ //{
+ // int count = 0;
+ // for (int i = 0; i < party.Length; i++)
+ // {
+ // if (party[i].Species == Pokemons.NONE) continue;
+ // if (party[i].HP > 0 && !party[i].isEgg) count += 1;
+ // }
+ // return count;
+ //}
+ public int PokemonCount(IPokemon[] party) {
int count=0;
foreach (IPokemon i in party) {
if (!i.IsNotNullOrNone()) continue;
@@ -903,12 +895,21 @@ public int pbPokemonCount(IPokemon[] party) {
}
return count;
}
-
- public bool pbAllFainted (IPokemon[] party) {
- return pbPokemonCount(party)==0;
+ public bool AllFainted(IPokemon[] party)
+ {
+ return PokemonCount(party) == 0;
}
-
- public int pbMaxLevel(IPokemon[] party) {
+ //public int MaxLevel(IPokemon[] party)
+ //{
+ // int lv = 0;
+ // for (int i = 0; i < party.Length; i++)
+ // {
+ // if (party[i].Species == Pokemons.NONE) continue;
+ // if (lv < party[i].Level) lv = party[i].Level;
+ // }
+ // return lv;
+ //}
+ public int MaxLevel(IPokemon[] party) {
int lv=0;
foreach (var i in party) {
if (!i.IsNotNullOrNone()) continue;
@@ -917,14 +918,14 @@ public int pbMaxLevel(IPokemon[] party) {
return lv;
}
- public int pbMaxLevelFromIndex(int index) {
- IPokemon[] party=pbParty(index);
- ITrainer[] owner=pbIsOpposing(index) ? @opponent : @player;
+ public int MaxLevelFromIndex(int index) {
+ IPokemon[] party=Party(index);
+ ITrainer[] owner=IsOpposing(index) ? @opponent : @player;
int maxlevel=0;
if (owner.Length > 0) {
int start=0;
- int limit=pbSecondPartyBegin(index);
- if (pbIsDoubleBattler(index)) start=limit;
+ int limit=SecondPartyBegin(index);
+ if (IsDoubleBattler(index)) start=limit;
for (int i = start; i < start+limit; i++) {
if (!party[i].IsNotNullOrNone()) continue;
if (maxlevel
///
///
- public IPokemon[] pbParty(int index) {
- return pbIsOpposing(index) ? party2 : party1;
+ public IPokemon[] Party(int index) {
+ return IsOpposing(index) ? party2 : party1;
//return battlers.Where(b => (b.Index % 2) == (index % 2)).ToArray();
}
- public IPokemon[] pbOpposingParty(int index) {
- return pbIsOpposing(index) ? party1 : party2;
+ public IPokemon[] OpposingParty(int index) {
+ return IsOpposing(index) ? party1 : party2;
}
- public int pbSecondPartyBegin(int battlerIndex) {
- if (pbIsOpposing(battlerIndex)) {
+ public int SecondPartyBegin(int battlerIndex) {
+ if (IsOpposing(battlerIndex)) {
//return @fullparty2 ? 6 : 3; //split in half for doubles
return @fullparty2 ? (Game.GameData as Game).Features.LimitPokemonPartySize : (int)(Core.MAXPARTYSIZE * .5);
}
@@ -964,16 +965,16 @@ public int pbSecondPartyBegin(int battlerIndex) {
}
}
- public int pbPartyLength(int battlerIndex) {
- if (pbIsOpposing(battlerIndex)) {
- return (@opponent.Length > 0) ? pbSecondPartyBegin(battlerIndex) : (Game.GameData as Game).Features.LimitPokemonPartySize;
+ public int PartyLength(int battlerIndex) {
+ if (IsOpposing(battlerIndex)) {
+ return (@opponent.Length > 0) ? SecondPartyBegin(battlerIndex) : (Game.GameData as Game).Features.LimitPokemonPartySize;
}
else {
- return @player.Length > 0 ? pbSecondPartyBegin(battlerIndex) : (Game.GameData as Game).Features.LimitPokemonPartySize;
+ return @player.Length > 0 ? SecondPartyBegin(battlerIndex) : (Game.GameData as Game).Features.LimitPokemonPartySize;
}
}
- public int pbFindNextUnfainted(IPokemon[] party,int start,int finish=-1) {
+ public int FindNextUnfainted(IPokemon[] party,int start,int finish=-1) {
if (finish<0) finish=party.Length;
for (int i = start; i < finish; i++) {
if (!party[i].IsNotNullOrNone()) continue;
@@ -982,11 +983,11 @@ public int pbFindNextUnfainted(IPokemon[] party,int start,int finish=-1) {
return -1;
}
- public int pbGetLastPokeInTeam(int index) {
- IPokemon[] party=pbParty(index);
- int[] partyorder=(!pbIsOpposing(index) ? @party1order : @party2order).ToArray();
- int plength=pbPartyLength(index);
- int pstart=pbGetOwnerIndex(index)*plength;
+ public int GetLastPokeInTeam(int index) {
+ IPokemon[] party=Party(index);
+ int[] partyorder=(!IsOpposing(index) ? @party1order : @party2order).ToArray();
+ int plength=PartyLength(index);
+ int pstart=GetOwnerIndex(index)*plength;
int lastpoke=-1;
for (int i = pstart; i < pstart+plength - 1; i++) {
IPokemon p=party[partyorder[i]];
@@ -996,20 +997,20 @@ public int pbGetLastPokeInTeam(int index) {
return lastpoke;
}
- public IBattler pbFindPlayerBattler(int pkmnIndex) {
+ public IBattler FindPlayerBattler(int pkmnIndex) {
IBattler battler=null;
for (int k = 0; k < battlers.Length; k++) {
- if (!pbIsOpposing(k) && @battlers[k].pokemonIndex==pkmnIndex) {
- battler=@battlers[k];
+ if (!IsOpposing(k) && _battlers[k].pokemonIndex==pkmnIndex) {
+ battler=_battlers[k];
break;
}
}
return battler;
}
- public bool pbIsOwner (int battlerIndex, int partyIndex) {
- int secondParty=pbSecondPartyBegin(battlerIndex);
- if (!pbIsOpposing(battlerIndex)) {
+ public bool IsOwner (int battlerIndex, int partyIndex) {
+ int secondParty=SecondPartyBegin(battlerIndex);
+ if (!IsOpposing(battlerIndex)) {
if (@player == null || @player.Length == 0) return true;
return (battlerIndex==0) ? partyIndex=secondParty;
}
@@ -1019,8 +1020,8 @@ public bool pbIsOwner (int battlerIndex, int partyIndex) {
}
}
- public ITrainer pbGetOwner(int battlerIndex) {
- if (pbIsOpposing(battlerIndex)) {
+ public ITrainer GetOwner(int battlerIndex) {
+ if (IsOpposing(battlerIndex)) {
if (@opponent.Length > 0) {
return (battlerIndex==1) ? @opponent[0] : @opponent[1];
}
@@ -1040,8 +1041,8 @@ public ITrainer pbGetOwner(int battlerIndex) {
}
}
- public ITrainer pbGetOwnerPartner(int battlerIndex) {
- if (pbIsOpposing(battlerIndex)) {
+ public ITrainer GetOwnerPartner(int battlerIndex) {
+ if (IsOpposing(battlerIndex)) {
if (@opponent.Length > 0) {
return (battlerIndex==1) ? @opponent[1] : @opponent[0];
}
@@ -1061,8 +1062,8 @@ public ITrainer pbGetOwnerPartner(int battlerIndex) {
}
}
- public int pbGetOwnerIndex(int battlerIndex) {
- if (pbIsOpposing(battlerIndex)) {
+ public int GetOwnerIndex(int battlerIndex) {
+ if (IsOpposing(battlerIndex)) {
return (@opponent.Length > 0) ? ((battlerIndex==1) ? 0 : 1) : 0;
}
else {
@@ -1070,7 +1071,7 @@ public int pbGetOwnerIndex(int battlerIndex) {
}
}
- public bool pbBelongsToPlayer (int battlerIndex) {
+ public bool BelongsToPlayer (int battlerIndex) {
if (@player.Length > 0 && @player.Length>1) {
return battlerIndex==0;
}
@@ -1080,9 +1081,9 @@ public bool pbBelongsToPlayer (int battlerIndex) {
//return false;
}
- public ITrainer pbPartyGetOwner(int battlerIndex, int partyIndex) {
- int secondParty=pbSecondPartyBegin(battlerIndex);
- if (!pbIsOpposing(battlerIndex)) {
+ public ITrainer PartyGetOwner(int battlerIndex, int partyIndex) {
+ int secondParty=SecondPartyBegin(battlerIndex);
+ if (!IsOpposing(battlerIndex)) {
if (@player == null || @player.Length == 0) return new Trainer(null,TrainerTypes.WildPokemon);//wild pokemon instead of @player?
return (partyIndex=party.Length-1) {
party[i]=null;
}
@@ -1146,7 +1147,7 @@ public void pbRemoveFromParty(int battlerIndex, int partyIndex) {
}
for (int i = 0; i < order.Length; i++) {
if (order[i]
///
///
- public bool CanShowCommands(int idxPokemon)
+ public virtual bool CanShowCommands(int idxPokemon)
{
- IBattler thispkmn = @battlers[idxPokemon];
+ if (_battlers.Length <= idxPokemon) return false; //Outside of index boundary...
+ IBattler thispkmn = _battlers[idxPokemon] as IBattler;
+ if (!thispkmn.IsNotNullOrNone()) return false;
if (thispkmn.isFainted()) return false;
if (thispkmn.effects.TwoTurnAttack > 0) return false;
if (thispkmn.effects.HyperBeam > 0) return false;
@@ -1174,7 +1177,7 @@ public bool CanShowCommands(int idxPokemon)
#region Attacking
public bool CanShowFightMenu(int idxPokemon)
{
- IBattler thispkmn = @battlers[idxPokemon];
+ IBattler thispkmn = _battlers[idxPokemon];
if (!CanShowCommands(idxPokemon)) return false;
// No moves that can be chosen
@@ -1191,19 +1194,19 @@ public bool CanShowFightMenu(int idxPokemon)
public bool CanChooseMove(int idxPokemon, int idxMove, bool showMessages, bool sleeptalk = false)
{
- IBattler thispkmn = @battlers[idxPokemon];
+ IBattler thispkmn = _battlers[idxPokemon];
IBattleMove thismove = thispkmn.moves[idxMove];
//ToDo: Array for opposing pokemons, [i] changes based on if double battle
- IBattler opp1 = thispkmn.pbOpposing1;
- IBattler opp2 = null; //ToDo: thispkmn.pbOpposing2;
+ IBattler opp1 = thispkmn.Opposing1;
+ IBattler opp2 = null; //ToDo: thispkmn.Opposing2;
if (thismove == null || thismove.id == 0) return false;
if (thismove.PP <= 0 && thismove.TotalPP > 0 && !sleeptalk) {
- if (showMessages) pbDisplayPaused(Game._INTL("There's no PP left for this move!"));
+ if (showMessages) DisplayPaused(Game._INTL("There's no PP left for this move!"));
return false;
}
if (thispkmn.hasWorkingItem(Items.ASSAULT_VEST)) {// && thismove.IsStatus?
- if (showMessages) pbDisplayPaused(Game._INTL("The effects of the {1} prevent status moves from being used!", Game._INTL(thispkmn.Item.ToString(TextScripts.Name))));
+ if (showMessages) DisplayPaused(Game._INTL("The effects of the {1} prevent status moves from being used!", Game._INTL(thispkmn.Item.ToString(TextScripts.Name))));
return false;
}
if ((int)thispkmn.effects.ChoiceBand >= 0 &&
@@ -1218,7 +1221,7 @@ public bool CanChooseMove(int idxPokemon, int idxMove, bool showMessages, bool s
}
if (hasmove && thismove.id != thispkmn.effects.ChoiceBand) {
if (showMessages)
- pbDisplayPaused(Game._INTL("{1} allows the use of only {2}!",
+ DisplayPaused(Game._INTL("{1} allows the use of only {2}!",
Game._INTL(thispkmn.Item.ToString(TextScripts.Name)),
Game._INTL(thispkmn.effects.ChoiceBand.ToString(TextScripts.Name))));
return false;
@@ -1231,7 +1234,7 @@ public bool CanChooseMove(int idxPokemon, int idxMove, bool showMessages, bool s
thismove.id == opp1.moves[2].id ||
thismove.id == opp1.moves[3].id)
{
- if (showMessages) pbDisplayPaused(Game._INTL("{1} can't use the sealed {2}!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
+ if (showMessages) DisplayPaused(Game._INTL("{1} can't use the sealed {2}!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
GameDebug.Log($"[CanChoose][#{opp1.ToString()} has: #{Game._INTL(opp1.moves[0].id.ToString(TextScripts.Name))}, #{Game._INTL(opp1.moves[1].id.ToString(TextScripts.Name))}, #{Game._INTL(opp1.moves[2].id.ToString(TextScripts.Name))}, #{Game._INTL(opp1.moves[3].id.ToString(TextScripts.Name))}]");
return false;
}
@@ -1243,28 +1246,28 @@ public bool CanChooseMove(int idxPokemon, int idxMove, bool showMessages, bool s
thismove.id == opp2.moves[2].id ||
thismove.id == opp2.moves[3].id)
{
- if (showMessages) pbDisplayPaused(Game._INTL("{1} can't use the sealed {2}!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
+ if (showMessages) DisplayPaused(Game._INTL("{1} can't use the sealed {2}!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
GameDebug.Log($"[CanChoose][#{opp2.ToString()} has: #{Game._INTL(opp2.moves[0].id.ToString(TextScripts.Name))}, #{Game._INTL(opp2.moves[1].id.ToString(TextScripts.Name))}, #{Game._INTL(opp2.moves[2].id.ToString(TextScripts.Name))}, #{Game._INTL(opp2.moves[3].id.ToString(TextScripts.Name))}]");
return false;
}
}
if (thispkmn.effects.Taunt > 0 && thismove.basedamage == 0) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} can't use {2} after the taunt!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
+ if (showMessages) DisplayPaused(Game._INTL("{1} can't use {2} after the taunt!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
return false;
}
if (thispkmn.effects.Torment) {
if (thismove.id==thispkmn.lastMoveUsed) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} can't use the same move twice in a row due to the torment!", thispkmn.ToString()));
+ if (showMessages) DisplayPaused(Game._INTL("{1} can't use the same move twice in a row due to the torment!", thispkmn.ToString()));
return false;
}
}
if (thismove.id==thispkmn.effects.DisableMove && !sleeptalk) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1}'s {2} is disabled!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
+ if (showMessages) DisplayPaused(Game._INTL("{1}'s {2} is disabled!", thispkmn.ToString(), Game._INTL(thismove.id.ToString(TextScripts.Name))));
return false;
}
if (thismove.Effect==Attack.Data.Effects.x153 && // ToDo: Belch
(thispkmn.Species != Pokemons.NONE || !thispkmn.pokemon.belch)) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} hasn't eaten any held berry, so it can't possibly belch!", thispkmn.ToString()));
+ if (showMessages) DisplayPaused(Game._INTL("{1} hasn't eaten any held berry, so it can't possibly belch!", thispkmn.ToString()));
return false;
}
if (thispkmn.effects.Encore>0 && idxMove!=thispkmn.effects.EncoreIndex) {
@@ -1273,8 +1276,8 @@ public bool CanChooseMove(int idxPokemon, int idxMove, bool showMessages, bool s
return true;
}
- public virtual void pbAutoChooseMove(int idxPokemon, bool showMessages=true) {
- IBattler thispkmn=@battlers[idxPokemon];
+ public virtual void AutoChooseMove(int idxPokemon, bool showMessages=true) {
+ IBattler thispkmn=_battlers[idxPokemon];
if (thispkmn.isFainted()) {
//@choices[idxPokemon][0]=0;
//@choices[idxPokemon][1]=0;
@@ -1292,20 +1295,20 @@ public virtual void pbAutoChooseMove(int idxPokemon, bool showMessages=true) {
@choices[idxPokemon]=new Choice(ChoiceAction.UseMove, thispkmn.effects.EncoreIndex, thispkmn.moves[thispkmn.effects.EncoreIndex]);
if (@doublebattle) {
IBattleMove thismove=thispkmn.moves[thispkmn.effects.EncoreIndex];
- Attack.Data.Targets targets=thispkmn.pbTarget(thismove);
+ Attack.Data.Targets targets=thispkmn.Target(thismove);
if (targets==Attack.Data.Targets.SELECTED_POKEMON || targets==Attack.Data.Targets.SELECTED_POKEMON_ME_FIRST) { //Targets.SingleNonUser
- int target=(@scene as IPokeBattle_SceneNonInteractive).pbChooseTarget(idxPokemon,targets);
- if (target>=0) pbRegisterTarget(idxPokemon,target);
+ int target=(@scene as IPokeBattle_SceneNonInteractive).ChooseTarget(idxPokemon,targets);
+ if (target>=0) RegisterTarget(idxPokemon,target);
}
else if (targets==Attack.Data.Targets.USER_OR_ALLY) { //Targets.UserOrPartner
- int target=(@scene as IPokeBattle_SceneNonInteractive).pbChooseTarget(idxPokemon,targets);
- if (target>=0 && (target&1)==(idxPokemon&1)) pbRegisterTarget(idxPokemon,target); //both integers are Even (ally) and Identical (selected)
+ int target=(@scene as IPokeBattle_SceneNonInteractive).ChooseTarget(idxPokemon,targets);
+ if (target>=0 && (target&1)==(idxPokemon&1)) RegisterTarget(idxPokemon,target); //both integers are Even (ally) and Identical (selected)
}
}
}
else {
- if (!pbIsOpposing(idxPokemon)) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} has no moves left!",thispkmn.Name));
+ if (!IsOpposing(idxPokemon)) {
+ if (showMessages) DisplayPaused(Game._INTL("{1} has no moves left!",thispkmn.Name));
}
//@choices[idxPokemon][0]=1; // "Use move"
//@choices[idxPokemon][1]=-1; // Index of move to be used
@@ -1315,8 +1318,8 @@ public virtual void pbAutoChooseMove(int idxPokemon, bool showMessages=true) {
}
}
- public virtual bool pbRegisterMove(int idxPokemon, int idxMove, bool showMessages=true) {
- IBattler thispkmn=@battlers[idxPokemon];
+ public virtual bool RegisterMove(int idxPokemon, int idxMove, bool showMessages=true) {
+ IBattler thispkmn=_battlers[idxPokemon];
IBattleMove thismove=thispkmn.moves[idxMove];
if (!CanChooseMove(idxPokemon,idxMove,showMessages)) return false;
//@choices[idxPokemon][0]=1; // "Use move"
@@ -1327,35 +1330,35 @@ public virtual bool pbRegisterMove(int idxPokemon, int idxMove, bool showMessage
return true;
}
- public bool pbChoseMove (int i, Moves move) {
- if (@battlers[i].isFainted()) return false;
+ public bool ChoseMove (int i, Moves move) {
+ if (_battlers[i].isFainted()) return false;
//if (@choices[i][0]==1 && @choices[i][1]>=0) {
- if (@choices[i].Action==ChoiceAction.UseMove && @choices[i].Index>=0) {
+ if (@choices[i]?.Action==ChoiceAction.UseMove && @choices[i]?.Index>=0) {
int choice=@choices[i].Index; //@choices[i][1];
- return @battlers[i].moves[choice].id == move;
+ return _battlers[i].moves[choice].id == move;
}
return false;
}
- public bool pbChoseMoveFunctionCode (int i,Attack.Data.Effects code) {
- if (@battlers[i].isFainted()) return false;
+ public bool ChoseMoveFunctionCode (int i,Attack.Data.Effects code) {
+ if (_battlers[i].isFainted()) return false;
//if (@choices[i][0]==1 && @choices[i][1]>=0) {
- if (@choices[i].Action==ChoiceAction.UseMove && @choices[i].Index>=0) {
+ if (@choices[i]?.Action==ChoiceAction.UseMove && @choices[i]?.Index>=0) {
int choice=@choices[i].Index; //@choices[i][1];
- return @battlers[i].moves[choice].Effect==code;
+ return _battlers[i].moves[choice].Effect==code;
}
return false;
}
- public virtual bool pbRegisterTarget(int idxPokemon, int idxTarget) {
+ public virtual bool RegisterTarget(int idxPokemon, int idxTarget) {
//@choices[idxPokemon][3]=idxTarget; // Set target of move
@choices[idxPokemon]=new Choice(ChoiceAction.UseMove, @choices[idxPokemon].Index, @choices[idxPokemon].Move, idxTarget); // Set target of move
return true;
}
- public IBattler[] pbPriority(bool ignorequickclaw=false, bool log=false) {
- if (@usepriority) return @priority; // use stored priority if round isn't over yet
- @priority = new Pokemon[battlers.Length]; //.Clear();
+ public IBattler[] Priority(bool ignorequickclaw=false, bool log=false) {
+ if (@usepriority) return priority; // use stored priority if round isn't over yet
+ _priority = new Pokemon[battlers.Length]; //.Clear();
int[] speeds=new int[battlers.Length];
int[] priorities=new int[battlers.Length];
bool[] quickclaw=new bool[battlers.Length]; bool[] lagging=new bool[battlers.Length];
@@ -1363,35 +1366,35 @@ public IBattler[] pbPriority(bool ignorequickclaw=false, bool log=false) {
List temp=new List();
#region Calculate each Pokémon's speed
for (int i = 0; i < battlers.Length; i++) {
- speeds[i]=@battlers[i].SPE;
+ speeds[i]=_battlers[i].SPE;
quickclaw[i]=false;
lagging[i]=false;
//if (!ignorequickclaw && @choices[i][0]==1) { // Chose to use a move
if (!ignorequickclaw && @choices[i]?.Action==ChoiceAction.UseMove) {
- if (!quickclaw[i] && @battlers[i].hasWorkingItem(Items.CUSTAP_BERRY) &&
- !@battlers[i].pbOpposing1.hasWorkingAbility(Abilities.UNNERVE) &&
- !@battlers[i].pbOpposing2.hasWorkingAbility(Abilities.UNNERVE)) {
- if ((@battlers[i].hasWorkingAbility(Abilities.GLUTTONY) && @battlers[i].HP<=(int)Math.Floor(@battlers[i].TotalHP * .5)) ||
- @battlers[i].HP<=(int)Math.Floor(@battlers[i].TotalHP * .25)) {
- pbCommonAnimation("UseItem",@battlers[i],null);
+ if (!quickclaw[i] && _battlers[i].hasWorkingItem(Items.CUSTAP_BERRY) &&
+ !_battlers[i].Opposing1.hasWorkingAbility(Abilities.UNNERVE) &&
+ !_battlers[i].Opposing2.hasWorkingAbility(Abilities.UNNERVE)) {
+ if ((_battlers[i].hasWorkingAbility(Abilities.GLUTTONY) && _battlers[i].HP<=(int)Math.Floor(_battlers[i].TotalHP * .5)) ||
+ _battlers[i].HP<=(int)Math.Floor(_battlers[i].TotalHP * .25)) {
+ CommonAnimation("UseItem",_battlers[i],null);
quickclaw[i]=true;
- pbDisplayBrief(Game._INTL("{1}'s {2} let it move first!",
- @battlers[i].ToString(),Game._INTL(@battlers[i].Item.ToString(TextScripts.Name))));
- @battlers[i].pbConsumeItem();
+ DisplayBrief(Game._INTL("{1}'s {2} let it move first!",
+ _battlers[i].ToString(),Game._INTL(_battlers[i].Item.ToString(TextScripts.Name))));
+ _battlers[i].ConsumeItem();
}
}
- if (!quickclaw[i] && @battlers[i].hasWorkingItem(Items.QUICK_CLAW)) {
- if (pbRandom(10)<2) {
- pbCommonAnimation("UseItem",@battlers[i],null);
+ if (!quickclaw[i] && _battlers[i].hasWorkingItem(Items.QUICK_CLAW)) {
+ if (Random(10)<2) {
+ CommonAnimation("UseItem",_battlers[i],null);
quickclaw[i]=true;
- pbDisplayBrief(Game._INTL("{1}'s {2} let it move first!",
- @battlers[i].ToString(),Game._INTL(@battlers[i].Item.ToString(TextScripts.Name))));
+ DisplayBrief(Game._INTL("{1}'s {2} let it move first!",
+ _battlers[i].ToString(),Game._INTL(_battlers[i].Item.ToString(TextScripts.Name))));
}
}
if (!quickclaw[i] &&
- (@battlers[i].hasWorkingAbility(Abilities.STALL) ||
- @battlers[i].hasWorkingItem(Items.LAGGING_TAIL) ||
- @battlers[i].hasWorkingItem(Items.FULL_INCENSE))) {
+ (_battlers[i].hasWorkingAbility(Abilities.STALL) ||
+ _battlers[i].hasWorkingItem(Items.LAGGING_TAIL) ||
+ _battlers[i].hasWorkingItem(Items.FULL_INCENSE))) {
lagging[i]=true;
}
}
@@ -1403,9 +1406,9 @@ public IBattler[] pbPriority(bool ignorequickclaw=false, bool log=false) {
int pri=0;
if (@choices[i]?.Action==ChoiceAction.UseMove) { // Chose to use a move
pri=@choices[i].Move.Priority;
- if (@battlers[i].hasWorkingAbility(Abilities.PRANKSTER) &&
- @choices[i].Move.pbIsStatus) pri+=1;
- if (@battlers[i].hasWorkingAbility(Abilities.GALE_WINGS) &&
+ if (_battlers[i].hasWorkingAbility(Abilities.PRANKSTER) &&
+ @choices[i].Move.IsStatus) pri+=1;
+ if (_battlers[i].hasWorkingAbility(Abilities.GALE_WINGS) &&
@choices[i].Move.Type == Types.FLYING) pri+=1;
}
priorities[i]=pri;
@@ -1428,7 +1431,7 @@ public IBattler[] pbPriority(bool ignorequickclaw=false, bool log=false) {
}
// Sort by speed
if (temp.Count==1) {
- @priority[@priority.Length]=@battlers[temp[0]]; //ToDo: Redo this, maybe use Math.Min to sort..
+ _priority[_priority.Length]=_battlers[temp[0]]; //ToDo: Redo this, maybe use Math.Min to sort..
}
else if (temp.Count>1) {
int n=temp.Count - 1;
@@ -1474,7 +1477,7 @@ public IBattler[] pbPriority(bool ignorequickclaw=false, bool log=false) {
}
}
if (cmp<0 || // Swap the pair according to the second battler's rank
- (cmp==0 && pbRandom(2)==0)) {
+ (cmp==0 && Random(2)==0)) {
int swaptmp=temp[i];
temp[i]=temp[i-1];
temp[i-1]=swaptmp;
@@ -1483,8 +1486,8 @@ public IBattler[] pbPriority(bool ignorequickclaw=false, bool log=false) {
}
// Battlers in this bracket are properly sorted, so add them to @priority
int x = 0; foreach (int i in temp) {
- //@priority[@priority.Length - 1]=@battlers[i];
- @priority[x]=@battlers[i]; x++;
+ //@priority[@priority.Length - 1]=_battlers[i];
+ _priority[x]=_battlers[i]; x++;
}
}
curpri-=1;
@@ -1494,22 +1497,22 @@ public IBattler[] pbPriority(bool ignorequickclaw=false, bool log=false) {
if (log) {
string d="[Priority] "; bool comma=false;
for (int i = 0; i < battlers.Length; i++) {
- if (@priority[i].IsNotNullOrNone() && !@priority[i].isFainted()) {
+ if (_priority[i].IsNotNullOrNone() && !_priority[i].isFainted()) {
if (comma) d+=", ";
- d+=$"#{@priority[i].ToString(comma)} (#{@priority[i].Index})"; comma=true;
+ d+=$"#{_priority[i].ToString(comma)} (#{_priority[i].Index})"; comma=true;
}
}
GameDebug.Log(d);
}
@usepriority=true;
- return @priority;
+ return priority;
}
#endregion
#region Switching Pokemon
- public virtual bool pbCanSwitchLax (int idxPokemon,int pkmnidxTo,bool showMessages) {
+ public virtual bool CanSwitchLax (int idxPokemon,int pkmnidxTo,bool showMessages) {
if (pkmnidxTo>=0) {
- IPokemon[] party=pbParty(idxPokemon);
+ IPokemon[] party=Party(idxPokemon);
if (pkmnidxTo>=party.Length) {
return false;
}
@@ -1517,65 +1520,65 @@ public virtual bool pbCanSwitchLax (int idxPokemon,int pkmnidxTo,bool showMessag
return false;
}
if (party[pkmnidxTo].isEgg) {
- if (showMessages) pbDisplayPaused(Game._INTL("An Egg can't battle!"));
+ if (showMessages) DisplayPaused(Game._INTL("An Egg can't battle!"));
return false;
}
- if (!pbIsOwner(idxPokemon,pkmnidxTo)) {
- ITrainer owner=pbPartyGetOwner(idxPokemon,pkmnidxTo);
- if (showMessages) pbDisplayPaused(Game._INTL("You can't switch {1}'s Pokémon with one of yours!",owner.name));
+ if (!IsOwner(idxPokemon,pkmnidxTo)) {
+ ITrainer owner=PartyGetOwner(idxPokemon,pkmnidxTo);
+ if (showMessages) DisplayPaused(Game._INTL("You can't switch {1}'s Pokémon with one of yours!",owner.name));
return false;
}
if (party[pkmnidxTo].HP<=0) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} has no energy left to battle!",party[pkmnidxTo].Name));
+ if (showMessages) DisplayPaused(Game._INTL("{1} has no energy left to battle!",party[pkmnidxTo].Name));
return false;
}
- if (@battlers[idxPokemon].pokemonIndex==pkmnidxTo ||
- @battlers[idxPokemon].pbPartner.pokemonIndex==pkmnidxTo) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} is already in battle!",party[pkmnidxTo].Name));
+ if (_battlers[idxPokemon].pokemonIndex==pkmnidxTo ||
+ _battlers[idxPokemon].Partner.pokemonIndex==pkmnidxTo) {
+ if (showMessages) DisplayPaused(Game._INTL("{1} is already in battle!",party[pkmnidxTo].Name));
return false;
}
}
return true;
}
- public bool pbCanSwitch (int idxPokemon, int pkmnidxTo, bool showMessages, bool ignoremeanlook=false) {
- IBattler thispkmn=@battlers[idxPokemon];
+ public bool CanSwitch (int idxPokemon, int pkmnidxTo, bool showMessages, bool ignoremeanlook=false) {
+ IBattler thispkmn=_battlers[idxPokemon];
// Multi-Turn Attacks/Mean Look
- if (!pbCanSwitchLax(idxPokemon,pkmnidxTo,showMessages)) {
+ if (!CanSwitchLax(idxPokemon,pkmnidxTo,showMessages)) {
return false;
}
- bool isOppose=pbIsOpposing(idxPokemon);
- IPokemon[] party=pbParty(idxPokemon);
+ bool isOppose=IsOpposing(idxPokemon);
+ IPokemon[] party=Party(idxPokemon);
for (int i = 0; i < battlers.Length; i++) {
- if (isOppose!=pbIsOpposing(i)) continue;
- if (choices[i].Action==ChoiceAction.SwitchPokemon && choices[i].Index==pkmnidxTo) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} has already been selected.",party[pkmnidxTo].Name));
+ if (isOppose!=IsOpposing(i)) continue;
+ if (choices[i]?.Action==ChoiceAction.SwitchPokemon && choices[i]?.Index==pkmnidxTo) {
+ if (showMessages) DisplayPaused(Game._INTL("{1} has already been selected.",party[pkmnidxTo].Name));
return false;
}
}
if (thispkmn.hasWorkingItem(Items.SHED_SHELL)) {
return true;
}
- if (Core.USENEWBATTLEMECHANICS && thispkmn.pbHasType(Types.GHOST)) {
+ if (Core.USENEWBATTLEMECHANICS && thispkmn.HasType(Types.GHOST)) {
return true;
}
if (thispkmn.effects.MultiTurn>0 ||
(!ignoremeanlook && thispkmn.effects.MeanLook>=0)) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} can't be switched out!",thispkmn.ToString()));
+ if (showMessages) DisplayPaused(Game._INTL("{1} can't be switched out!",thispkmn.ToString()));
return false;
}
if (@field.FairyLock>0) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} can't be switched out!",thispkmn.ToString()));
+ if (showMessages) DisplayPaused(Game._INTL("{1} can't be switched out!",thispkmn.ToString()));
return false;
}
if (thispkmn.effects.Ingrain) {
- if (showMessages) pbDisplayPaused(Game._INTL("{1} can't be switched out!",thispkmn.ToString()));
+ if (showMessages) DisplayPaused(Game._INTL("{1} can't be switched out!",thispkmn.ToString()));
return false;
}
- IBattler opp1=thispkmn.pbOpposing1;
- IBattler opp2=thispkmn.pbOpposing2;
+ IBattler opp1=thispkmn.Opposing1;
+ IBattler opp2=thispkmn.Opposing2;
IBattler opp=null;
- if (thispkmn.pbHasType(Types.STEEL)) {
+ if (thispkmn.HasType(Types.STEEL)) {
if (opp1.hasWorkingAbility(Abilities.MAGNET_PULL)) opp=opp1;
if (opp2.hasWorkingAbility(Abilities.MAGNET_PULL)) opp=opp2;
}
@@ -1589,134 +1592,134 @@ public bool pbCanSwitch (int idxPokemon, int pkmnidxTo, bool showMessages, bool
}
if (opp.IsNotNullOrNone()) {
string abilityname=Game._INTL(opp.Ability.ToString(TextScripts.Name));
- if (showMessages) pbDisplayPaused(Game._INTL("{1}'s {2} prevents switching!",opp.ToString(),abilityname));
+ if (showMessages) DisplayPaused(Game._INTL("{1}'s {2} prevents switching!",opp.ToString(),abilityname));
return false;
}
return true;
}
- public virtual bool pbRegisterSwitch(int idxPokemon,int idxOther) {
- if (!pbCanSwitch(idxPokemon,idxOther,false)) return false;
+ public virtual bool RegisterSwitch(int idxPokemon,int idxOther) {
+ if (!CanSwitch(idxPokemon,idxOther,false)) return false;
//@choices[idxPokemon][0]=2; // "Switch Pokémon"
//@choices[idxPokemon][1]=idxOther; // Index of other Pokémon to switch with
//@choices[idxPokemon][2]=null;
@choices[idxPokemon]=new Choice(ChoiceAction.SwitchPokemon, idxOther);
- int side=pbIsOpposing(idxPokemon) ? 1 : 0;
- int owner=pbGetOwnerIndex(idxPokemon);
+ int side=IsOpposing(idxPokemon) ? 1 : 0;
+ int owner=GetOwnerIndex(idxPokemon);
if (@megaEvolution[side][owner]==idxPokemon) {
@megaEvolution[side][owner]=-1;
}
return true;
}
- public bool pbCanChooseNonActive (int index) {
- IPokemon[] party=pbParty(index);
+ public bool CanChooseNonActive (int index) {
+ IPokemon[] party=Party(index);
for (int i = 0; i < party.Length; i++) {
- if (pbCanSwitchLax(index,i,false)) return true;
+ if (CanSwitchLax(index,i,false)) return true;
}
return false;
}
- public virtual void pbSwitch(bool favorDraws=false) {
+ public virtual void Switch(bool favorDraws=false) {
if (!favorDraws) {
if (@decision>0) return;
}
else {
if (@decision== BattleResults.DRAW) return;
}
- pbJudge();
+ Judge();
if (@decision>0) return;
- int firstbattlerhp=@battlers[0].HP;
+ int firstbattlerhp=_battlers[0].HP;
List switched=new List();
for (int index = 0; index < battlers.Length; index++) {
int newenemy; int newenemyname; int newpokename; int newpoke;
- if (!@doublebattle && pbIsDoubleBattler(index)) continue;
- if (@battlers[index].IsNotNullOrNone() && !@battlers[index].isFainted()) continue;
- if (!pbCanChooseNonActive(index)) continue;
- if (!pbOwnedByPlayer(index)) {
- if (!pbIsOpposing(index) || (@opponent.Length > 0 && pbIsOpposing(index))) {
- newenemy=pbSwitchInBetween(index,false,false);
+ if (!@doublebattle && IsDoubleBattler(index)) continue;
+ if (_battlers[index].IsNotNullOrNone() && !_battlers[index].isFainted()) continue;
+ if (!CanChooseNonActive(index)) continue;
+ if (!OwnedByPlayer(index)) {
+ if (!IsOpposing(index) || (@opponent.Length > 0 && IsOpposing(index))) {
+ newenemy=SwitchInBetween(index,false,false);
newenemyname=newenemy;
- if (newenemy>=0 && pbParty(index)[newenemy].Ability == Abilities.ILLUSION) {
- newenemyname=pbGetLastPokeInTeam(index);
+ if (newenemy>=0 && Party(index)[newenemy].Ability == Abilities.ILLUSION) {
+ newenemyname=GetLastPokeInTeam(index);
}
- ITrainer opponent=pbGetOwner(index);
+ ITrainer opponent=GetOwner(index);
if (!@doublebattle && firstbattlerhp>0 && @shiftStyle && this.opponent.Length > 0 &&
- @internalbattle && pbCanChooseNonActive(0) && pbIsOpposing(index) &&
- @battlers[0].effects.Outrage==0) {
- pbDisplayPaused(Game._INTL("{1} is about to send in {2}.",opponent.name,pbParty(index)[newenemyname].Name));
- if (pbDisplayConfirm(Game._INTL("Will {1} change Pokémon?",this.pbPlayer().name))) {
- newpoke=pbSwitchPlayer(0,true,true);
+ @internalbattle && CanChooseNonActive(0) && IsOpposing(index) &&
+ _battlers[0].effects.Outrage==0) {
+ DisplayPaused(Game._INTL("{1} is about to send in {2}.",opponent.name,Party(index)[newenemyname].Name));
+ if (DisplayConfirm(Game._INTL("Will {1} change Pokémon?",this.Player().name))) {
+ newpoke=SwitchPlayer(0,true,true);
if (newpoke>=0) {
newpokename=newpoke;
if (@party1[newpoke].Ability == Abilities.ILLUSION) {
- newpokename=pbGetLastPokeInTeam(0);
+ newpokename=GetLastPokeInTeam(0);
}
- pbDisplayBrief(Game._INTL("{1}, that's enough! Come back!",@battlers[0].Name));
- pbRecallAndReplace(0,newpoke,newpokename);
+ DisplayBrief(Game._INTL("{1}, that's enough! Come back!",_battlers[0].Name));
+ RecallAndReplace(0,newpoke,newpokename);
switched.Add(0);
}
}
}
- pbRecallAndReplace(index,newenemy,newenemyname,false,false);
+ RecallAndReplace(index,newenemy,newenemyname,false,false);
switched.Add(index);
}
}
else if (@opponent.Length > 0) {
- newpoke=pbSwitchInBetween(index,true,false);
+ newpoke=SwitchInBetween(index,true,false);
newpokename=newpoke;
if (@party1[newpoke].Ability == Abilities.ILLUSION) {
- newpokename=pbGetLastPokeInTeam(index);
+ newpokename=GetLastPokeInTeam(index);
}
- pbRecallAndReplace(index,newpoke,newpokename);
+ RecallAndReplace(index,newpoke,newpokename);
switched.Add(index);
}
else {
bool swtch=false;
- if (!pbDisplayConfirm(Game._INTL("Use next Pokémon?"))) {
- swtch=(pbRun(index,true)<=0);
+ if (!DisplayConfirm(Game._INTL("Use next Pokémon?"))) {
+ swtch=(Run(index,true)<=0);
}
else {
swtch=true;
}
if (swtch) {
- newpoke=pbSwitchInBetween(index,true,false);
+ newpoke=SwitchInBetween(index,true,false);
newpokename=newpoke;
if (@party1[newpoke].Ability == Abilities.ILLUSION) {
- newpokename=pbGetLastPokeInTeam(index);
+ newpokename=GetLastPokeInTeam(index);
}
- pbRecallAndReplace(index,newpoke,newpokename);
+ RecallAndReplace(index,newpoke,newpokename);
switched.Add(index);
}
}
}
if (switched.Count>0) {
- priority=pbPriority();
+ _priority=Priority();
foreach (var i in priority) {
- if (switched.Contains(i.Index)) i.pbAbilitiesOnSwitchIn(true);
+ if (switched.Contains(i.Index)) i.AbilitiesOnSwitchIn(true);
}
}
}
- public void pbSendOut(int index,IPokemon pokemon) {
- pbSetSeen(pokemon);
- if(@peer is IBattlePeerMultipleForms p) p.pbOnEnteringBattle(this,pokemon);
- if (pbIsOpposing(index)) {
- if (@scene is IPokeBattle_Scene s0) s0.pbTrainerSendOut(index,pokemon);
+ public void SendOut(int index,IPokemon pokemon) {
+ SetSeen(pokemon);
+ if(@peer is IBattlePeerMultipleForms p) p.OnEnteringBattle(this,pokemon);
+ if (IsOpposing(index)) {
+ if (@scene is IPokeBattle_Scene s0) s0.TrainerSendOut(index,pokemon);
}
else {
- if (@scene is IPokeBattle_Scene s0) s0.pbSendOut(index,pokemon);
+ if (@scene is IPokeBattle_Scene s0) s0.SendOut(index,pokemon);
}
- if (@scene is IPokeBattle_Scene s1) s1.pbResetMoveIndex(index);
+ if (@scene is IPokeBattle_Scene s1) s1.ResetMoveIndex(index);
}
- public void pbReplace(int index,int newpoke,bool batonpass=false) {
- IPokemon[] party=pbParty(index);
- int oldpoke=@battlers[index].pokemonIndex;
+ public void Replace(int index,int newpoke,bool batonpass=false) {
+ IPokemon[] party=Party(index);
+ int oldpoke=_battlers[index].pokemonIndex;
// Initialize the new Pokémon
- @battlers[index].pbInitialize(party[newpoke],(sbyte)newpoke,batonpass);
+ _battlers[index].Initialize(party[newpoke],(sbyte)newpoke,batonpass);
// Reorder the party for this battle
- int[] partyorder=(!pbIsOpposing(index) ? @party1order : @party2order).ToArray();
+ int[] partyorder=(!IsOpposing(index) ? @party1order : @party2order).ToArray();
int bpo=-1; int bpn=-1;
for (int i = 0; i < partyorder.Length; i++) {
if (partyorder[i]==oldpoke) bpo=i;
@@ -1724,79 +1727,79 @@ public void pbReplace(int index,int newpoke,bool batonpass=false) {
}
int p=partyorder[bpo]; partyorder[bpo]=partyorder[bpn]; partyorder[bpn]=p;
// Send out the new Pokémon
- pbSendOut(index,party[newpoke]);
- pbSetSeen(party[newpoke]);
+ SendOut(index,party[newpoke]);
+ SetSeen(party[newpoke]);
}
- public bool pbRecallAndReplace(int index,int newpoke,int newpokename=-1,bool batonpass=false,bool moldbreaker=false) {
- @battlers[index].pbResetForm();
- if (!@battlers[index].isFainted()) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbRecall(index);
- }
- pbMessagesOnReplace(index,newpoke,newpokename);
- pbReplace(index,newpoke,batonpass);
- return pbOnActiveOne(@battlers[index],false,moldbreaker);
+ public bool RecallAndReplace(int index,int newpoke,int newpokename=-1,bool batonpass=false,bool moldbreaker=false) {
+ _battlers[index].ResetForm();
+ if (!_battlers[index].isFainted()) {
+ (@scene as IPokeBattle_DebugSceneNoGraphics).Recall(index);
+ }
+ MessagesOnReplace(index,newpoke,newpokename);
+ Replace(index,newpoke,batonpass);
+ return OnActiveOne(_battlers[index],false,moldbreaker);
}
- public void pbMessagesOnReplace(int index,int newpoke,int newpokename=-1) {
+ public void MessagesOnReplace(int index,int newpoke,int newpokename=-1) {
if (newpokename<0) newpokename=newpoke;
- IPokemon[] party=pbParty(index);
- if (pbOwnedByPlayer(index)) {
+ IPokemon[] party=Party(index);
+ if (OwnedByPlayer(index)) {
if (!party[newpoke].IsNotNullOrNone()) {
- //p [index,newpoke,party[newpoke],pbAllFainted(party)];
- GameDebug.Log($"[{index},{newpoke},{party[newpoke]},pbMOR]");
+ //p [index,newpoke,party[newpoke],AllFainted(party)];
+ GameDebug.Log($"[{index},{newpoke},{party[newpoke]},MOR]");
for (int i = 0; i < party.Length; i++) {
GameDebug.Log($"[{i},{party[i].HP}]");
}
//throw new BattleAbortedException();
- GameDebug.LogError("BattleAbortedException"); pbAbort();
+ GameDebug.LogError("BattleAbortedException"); Abort();
}
- IBattler opposing=@battlers[index].pbOppositeOpposing;
+ IBattler opposing=_battlers[index].OppositeOpposing;
if (opposing.isFainted() || opposing.HP==opposing.TotalHP) {
- pbDisplayBrief(Game._INTL("Go! {1}!",party[newpokename].Name));
+ DisplayBrief(Game._INTL("Go! {1}!",party[newpokename].Name));
}
else if (opposing.HP>=(opposing.TotalHP/2)) {
- pbDisplayBrief(Game._INTL("Do it! {1}!",party[newpokename].Name));
+ DisplayBrief(Game._INTL("Do it! {1}!",party[newpokename].Name));
}
else if (opposing.HP>=(opposing.TotalHP/4)) {
- pbDisplayBrief(Game._INTL("Go for it, {1}!",party[newpokename].Name));
+ DisplayBrief(Game._INTL("Go for it, {1}!",party[newpokename].Name));
}
else {
- pbDisplayBrief(Game._INTL("Your opponent's weak!\nGet 'em, {1}!",party[newpokename].Name));
+ DisplayBrief(Game._INTL("Your opponent's weak!\nGet 'em, {1}!",party[newpokename].Name));
}
GameDebug.Log($"[Send out Pokémon] Player sent out #{party[newpokename].Name} in position #{index}");
}
else {
if (!party[newpoke].IsNotNullOrNone()) {
- //p [index,newpoke,party[newpoke],pbAllFainted(party)]
- GameDebug.Log($"[{index},{newpoke},{party[newpoke]},pbMOR]");
+ //p [index,newpoke,party[newpoke],AllFainted(party)]
+ GameDebug.Log($"[{index},{newpoke},{party[newpoke]},MOR]");
for (int i = 0; i < party.Length; i++) {
GameDebug.Log($"[{i},{party[i].HP}]");
}
//throw new BattleAbortedException();
- GameDebug.LogError("BattleAbortedException"); pbAbort();
+ GameDebug.LogError("BattleAbortedException"); Abort();
}
- ITrainer owner=pbGetOwner(index);
- pbDisplayBrief(Game._INTL("{1} sent\r\nout {2}!",owner.name,party[newpokename].Name));
+ ITrainer owner=GetOwner(index);
+ DisplayBrief(Game._INTL("{1} sent\r\nout {2}!",owner.name,party[newpokename].Name));
GameDebug.Log($"[Send out Pokémon] Opponent sent out #{party[newpokename].Name} in position #{index}");
}
}
- public virtual int pbSwitchInBetween(int index, bool lax, bool cancancel) {
- if (!pbOwnedByPlayer(index)) {
- return (@scene as IPokeBattle_SceneNonInteractive).pbChooseNewEnemy(index,pbParty(index));
+ public virtual int SwitchInBetween(int index, bool lax, bool cancancel) {
+ if (!OwnedByPlayer(index)) {
+ return (@scene as IPokeBattle_SceneNonInteractive).ChooseNewEnemy(index,Party(index));
}
else {
- return pbSwitchPlayer(index,lax,cancancel);
+ return SwitchPlayer(index,lax,cancancel);
}
}
- public int pbSwitchPlayer(int index,bool lax, bool cancancel) {
+ public int SwitchPlayer(int index,bool lax, bool cancancel) {
if (@debug) {
- return (@scene as IPokeBattle_SceneNonInteractive).pbChooseNewEnemy(index,pbParty(index));
+ return (@scene as IPokeBattle_SceneNonInteractive).ChooseNewEnemy(index,Party(index));
}
//else {
- return (@scene as IPokeBattle_SceneNonInteractive).pbSwitch(index,lax,cancancel);
+ return (@scene as IPokeBattle_SceneNonInteractive).Switch(index,lax,cancancel);
//}
}
#endregion
@@ -1810,29 +1813,29 @@ public int pbSwitchPlayer(int index,bool lax, bool cancancel) {
///
///
///
- //protected bool _pbUseItemOnPokemon(Items item,int pkmnIndex,IBattler userPkmn,IHasDisplayMessage scene) {
- bool IBattle.pbUseItemOnPokemon(Items item,int pkmnIndex,IBattler userPkmn,IHasDisplayMessage scene) {
+ //protected bool _UseItemOnPokemon(Items item,int pkmnIndex,IBattler userPkmn,IHasDisplayMessage scene) {
+ bool IBattle.UseItemOnPokemon(Items item,int pkmnIndex,IBattler userPkmn,IHasDisplayMessage scene) {
IPokemon pokemon=@party1[pkmnIndex];
IBattler battler=null;
- string name=pbGetOwner(userPkmn.Index).name;
- if (pbBelongsToPlayer(userPkmn.Index)) name=pbGetOwner(userPkmn.Index).name;
- pbDisplayBrief(Game._INTL("{1} used the\r\n{2}.",name,Game._INTL(item.ToString(TextScripts.Name))));
+ string name=GetOwner(userPkmn.Index).name;
+ if (BelongsToPlayer(userPkmn.Index)) name=GetOwner(userPkmn.Index).name;
+ DisplayBrief(Game._INTL("{1} used the\r\n{2}.",name,Game._INTL(item.ToString(TextScripts.Name))));
GameDebug.Log($"[Use item] Player used #{Game._INTL(item.ToString(TextScripts.Name))} on #{pokemon.Name}");
bool ret=false;
if (pokemon.isEgg) {
- pbDisplay(Game._INTL("But it had no effect!"));
+ Display(Game._INTL("But it had no effect!"));
}
else {
for (int i = 0; i < battlers.Length; i++) {
- if (!pbIsOpposing(i) && @battlers[i].pokemonIndex==pkmnIndex) {
- battler=@battlers[i];
+ if (!IsOpposing(i) && _battlers[i].pokemonIndex==pkmnIndex) {
+ battler=_battlers[i];
}
}
ret=ItemHandlers.triggerBattleUseOnPokemon(item,pokemon,battler,scene); //Invoke Event, returns which pokemon selected
}
- if (!ret && pbBelongsToPlayer(userPkmn.Index)) {
- if (Game.GameData.Bag.pbCanStore(item)) {
- Game.GameData.Bag.pbStoreItem(item);
+ if (!ret && BelongsToPlayer(userPkmn.Index)) {
+ if (Game.GameData.Bag.CanStore(item)) {
+ Game.GameData.Bag.StoreItem(item);
}
else {
//throw new Exception(Game._INTL("Couldn't return unused item to Bag somehow."));
@@ -1850,12 +1853,12 @@ bool IBattle.pbUseItemOnPokemon(Items item,int pkmnIndex,IBattler userPkmn,IHasD
///
///
///
- public bool pbUseItemOnBattler(Items item,int index,IBattler userPkmn,IHasDisplayMessage scene) {
- GameDebug.Log($"[Use item] Player used #{Game._INTL(item.ToString(TextScripts.Name))} on #{@battlers[index].ToString(true)}");
- bool ret=ItemHandlers.triggerBattleUseOnBattler(item,@battlers[index],scene);
- if (!ret && pbBelongsToPlayer(userPkmn.Index)) {
- if (Game.GameData.Bag.pbCanStore(item)) {
- Game.GameData.Bag.pbStoreItem(item);
+ public bool UseItemOnBattler(Items item,int index,IBattler userPkmn,IHasDisplayMessage scene) {
+ GameDebug.Log($"[Use item] Player used #{Game._INTL(item.ToString(TextScripts.Name))} on #{_battlers[index].ToString(true)}");
+ bool ret=ItemHandlers.triggerBattleUseOnBattler(item,_battlers[index],scene);
+ if (!ret && BelongsToPlayer(userPkmn.Index)) {
+ if (Game.GameData.Bag.CanStore(item)) {
+ Game.GameData.Bag.StoreItem(item);
}
else {
//throw new Exception(Game._INTL("Couldn't return unused item to Bag somehow."));
@@ -1865,16 +1868,16 @@ public bool pbUseItemOnBattler(Items item,int index,IBattler userPkmn,IHasDispla
return ret;
}
- public bool pbRegisterItem(int idxPokemon,Items idxItem,int? idxTarget=null) {
+ public bool RegisterItem(int idxPokemon,Items idxItem,int? idxTarget=null) {
if (idxTarget!=null && idxTarget.Value>=0) {
for (int i = 0; i < battlers.Length; i++) {
- if (!@battlers[i].pbIsOpposing(idxPokemon) &&
- @battlers[i].pokemonIndex==idxTarget.Value &&
- @battlers[i].effects.Embargo>0) {
- pbDisplay(Game._INTL("Embargo's effect prevents the item's use on {1}!",@battlers[i].ToString(true)));
- if (pbBelongsToPlayer(@battlers[i].Index)) {
- if (Game.GameData.Bag.pbCanStore(idxItem)) {
- Game.GameData.Bag.pbStoreItem(idxItem);
+ if (!_battlers[i].IsOpposing(idxPokemon) &&
+ _battlers[i].pokemonIndex==idxTarget.Value &&
+ _battlers[i].effects.Embargo>0) {
+ Display(Game._INTL("Embargo's effect prevents the item's use on {1}!",_battlers[i].ToString(true)));
+ if (BelongsToPlayer(_battlers[i].Index)) {
+ if (Game.GameData.Bag.CanStore(idxItem)) {
+ Game.GameData.Bag.StoreItem(idxItem);
}
else {
//throw new Exception(Game._INTL("Couldn't return unused item to Bag somehow."));
@@ -1887,16 +1890,16 @@ public bool pbRegisterItem(int idxPokemon,Items idxItem,int? idxTarget=null) {
}
if (ItemHandlers.hasUseInBattle(idxItem)) {
if (idxPokemon==0) { // Player's first Pokémon
- if (ItemHandlers.triggerBattleUseOnBattler(idxItem,@battlers[idxPokemon],this)) {
+ if (ItemHandlers.triggerBattleUseOnBattler(idxItem,_battlers[idxPokemon],this)) {
// Using Poké Balls or Poké Doll only
- ItemHandlers.triggerUseInBattle(idxItem,@battlers[idxPokemon],this);
+ ItemHandlers.triggerUseInBattle(idxItem,_battlers[idxPokemon],this);
if (@doublebattle) {
- @battlers[idxPokemon+2].effects.SkipTurn=true;
+ _battlers[idxPokemon+2].effects.SkipTurn=true;
}
}
else {
- if (Game.GameData.Bag.pbCanStore(idxItem)) {
- Game.GameData.Bag.pbStoreItem(idxItem);
+ if (Game.GameData.Bag.CanStore(idxItem)) {
+ Game.GameData.Bag.StoreItem(idxItem);
}
else {
//throw new Exception(Game._INTL("Couldn't return unusable item to Bag somehow."));
@@ -1906,8 +1909,8 @@ public bool pbRegisterItem(int idxPokemon,Items idxItem,int? idxTarget=null) {
}
}
else {
- if (ItemHandlers.triggerBattleUseOnBattler(idxItem,@battlers[idxPokemon],this)) {
- pbDisplay(Game._INTL("It's impossible to aim without being focused!"));
+ if (ItemHandlers.triggerBattleUseOnBattler(idxItem,_battlers[idxPokemon],this)) {
+ Display(Game._INTL("It's impossible to aim without being focused!"));
}
return false;
}
@@ -1916,19 +1919,19 @@ public bool pbRegisterItem(int idxPokemon,Items idxItem,int? idxTarget=null) {
//@choices[idxPokemon][1]=idxItem; // ID of item to be used
//@choices[idxPokemon][2]=idxTarget; // Index of Pokémon to use item on
@choices[idxPokemon]= new Choice(ChoiceAction.UseItem,idxItem,idxTarget.Value);
- int side=pbIsOpposing(idxPokemon) ? 1 : 0;
- int owner=pbGetOwnerIndex(idxPokemon);
+ int side=IsOpposing(idxPokemon) ? 1 : 0;
+ int owner=GetOwnerIndex(idxPokemon);
if (@megaEvolution[side][owner]==idxPokemon) {
@megaEvolution[side][owner]=-1;
}
return true;
}
- public void pbEnemyUseItem(Items item, IBattler battler) {
+ public void EnemyUseItem(Items item, IBattler battler) {
if (!@internalbattle) return; //0
- Items[] items=pbGetOwnerItems(battler.Index);
+ Items[] items=GetOwnerItems(battler.Index);
if (items == null) return; //Items.NONE
- ITrainer opponent=pbGetOwner(battler.Index);
+ ITrainer opponent=GetOwner(battler.Index);
for (int i = 0; i < items.Length; i++) {
if (items[i]==item) {
//items.delete_at(i);
@@ -1937,89 +1940,89 @@ public void pbEnemyUseItem(Items item, IBattler battler) {
}
}
string itemname=Game._INTL(item.ToString(TextScripts.Name));
- pbDisplayBrief(Game._INTL("{1} used the\r\n{2}!",opponent.name,itemname));
+ DisplayBrief(Game._INTL("{1} used the\r\n{2}!",opponent.name,itemname));
GameDebug.Log($"[Use item] Opponent used #{itemname} on #{battler.ToString(true)}");
if (item == Items.POTION) {
- battler.pbRecoverHP(20,true);
- pbDisplay(Game._INTL("{1}'s HP was restored.",battler.ToString()));
+ battler.RecoverHP(20,true);
+ Display(Game._INTL("{1}'s HP was restored.",battler.ToString()));
}
else if (item == Items.SUPER_POTION) {
- battler.pbRecoverHP(50,true);
- pbDisplay(Game._INTL("{1}'s HP was restored.",battler.ToString()));
+ battler.RecoverHP(50,true);
+ Display(Game._INTL("{1}'s HP was restored.",battler.ToString()));
}
else if (item == Items.HYPER_POTION) {
- battler.pbRecoverHP(200,true);
- pbDisplay(Game._INTL("{1}'s HP was restored.",battler.ToString()));
+ battler.RecoverHP(200,true);
+ Display(Game._INTL("{1}'s HP was restored.",battler.ToString()));
}
else if (item == Items.MAX_POTION) {
- battler.pbRecoverHP(battler.TotalHP-battler.HP,true);
- pbDisplay(Game._INTL("{1}'s HP was restored.",battler.ToString()));
+ battler.RecoverHP(battler.TotalHP-battler.HP,true);
+ Display(Game._INTL("{1}'s HP was restored.",battler.ToString()));
}
else if (item == Items.FULL_RESTORE) {
bool fullhp=(battler.HP==battler.TotalHP);
- battler.pbRecoverHP(battler.TotalHP-battler.HP,true);
+ battler.RecoverHP(battler.TotalHP-battler.HP,true);
battler.Status=0; battler.StatusCount=0;
battler.effects.Confusion=0;
if (fullhp) {
- pbDisplay(Game._INTL("{1} became healthy!",battler.ToString()));
+ Display(Game._INTL("{1} became healthy!",battler.ToString()));
}
else {
- pbDisplay(Game._INTL("{1}'s HP was restored.",battler.ToString()));
+ Display(Game._INTL("{1}'s HP was restored.",battler.ToString()));
}
}
else if (item == Items.FULL_HEAL) {
battler.Status=0; battler.StatusCount=0;
battler.effects.Confusion=0;
- pbDisplay(Game._INTL("{1} became healthy!",battler.ToString()));
+ Display(Game._INTL("{1} became healthy!",battler.ToString()));
}
else if (item == Items.X_ATTACK) {
- if (battler is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.ATTACK,battler)) {
- b.pbIncreaseStat(Stats.ATTACK,1,battler,true);
+ if (battler is IBattlerEffect b && b.CanIncreaseStatStage(Stats.ATTACK,battler)) {
+ b.IncreaseStat(Stats.ATTACK,1,battler,true);
}
}
else if (item == Items.X_DEFENSE) {
- if (battler is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.DEFENSE,battler)) {
- b.pbIncreaseStat(Stats.DEFENSE,1,battler,true);
+ if (battler is IBattlerEffect b && b.CanIncreaseStatStage(Stats.DEFENSE,battler)) {
+ b.IncreaseStat(Stats.DEFENSE,1,battler,true);
}
}
else if (item == Items.X_SPEED) {
- if (battler is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPEED,battler)) {
- b.pbIncreaseStat(Stats.SPEED,1,battler,true);
+ if (battler is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPEED,battler)) {
+ b.IncreaseStat(Stats.SPEED,1,battler,true);
}
}
else if (item == Items.X_SP_ATK) {
- if (battler is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPATK,battler)) {
- b.pbIncreaseStat(Stats.SPATK,1,battler,true);
+ if (battler is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPATK,battler)) {
+ b.IncreaseStat(Stats.SPATK,1,battler,true);
}
}
else if (item == Items.X_SP_DEF) {
- if (battler is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.SPDEF,battler)) {
- b.pbIncreaseStat(Stats.SPDEF,1,battler,true);
+ if (battler is IBattlerEffect b && b.CanIncreaseStatStage(Stats.SPDEF,battler)) {
+ b.IncreaseStat(Stats.SPDEF,1,battler,true);
}
}
else if (item == Items.X_ACCURACY) {
- if (battler is IBattlerEffect b && b.pbCanIncreaseStatStage(Stats.ACCURACY,battler)) {
- b.pbIncreaseStat(Stats.ACCURACY,1,battler,true);
+ if (battler is IBattlerEffect b && b.CanIncreaseStatStage(Stats.ACCURACY,battler)) {
+ b.IncreaseStat(Stats.ACCURACY,1,battler,true);
}
}
}
#endregion
#region Fleeing from Battle
- public bool pbCanRun(int idxPokemon)
+ public bool CanRun(int idxPokemon)
{
if (@opponent.Length > 0) return false;
- if (@cantescape && !pbIsOpposing(idxPokemon)) return false;
- IBattler thispkmn=@battlers[idxPokemon];
- if (thispkmn.pbHasType(Types.GHOST) && Core.USENEWBATTLEMECHANICS) return true;
+ if (@cantescape && !IsOpposing(idxPokemon)) return false;
+ IBattler thispkmn=_battlers[idxPokemon];
+ if (thispkmn.HasType(Types.GHOST) && Core.USENEWBATTLEMECHANICS) return true;
if (thispkmn.hasWorkingItem(Items.SMOKE_BALL)) return true;
if (thispkmn.hasWorkingAbility(Abilities.RUN_AWAY)) return true;
- return pbCanSwitch(idxPokemon,-1,false);
+ return CanSwitch(idxPokemon,-1,false);
}
- public virtual int pbRun(int idxPokemon,bool duringBattle=false) {
- IBattler thispkmn=@battlers[idxPokemon];
- if (pbIsOpposing(idxPokemon)) {
+ public virtual int Run(int idxPokemon,bool duringBattle=false) {
+ IBattler thispkmn=_battlers[idxPokemon];
+ if (IsOpposing(idxPokemon)) {
if (@opponent.Length > 0) return 0;
//@choices[i][0]=5; // run
//@choices[i][1]=0;
@@ -2029,68 +2032,68 @@ public virtual int pbRun(int idxPokemon,bool duringBattle=false) {
}
if (@opponent.Length > 0) {
if (debug && Input.press((int)PokemonUnity.UX.InputKeys.DEBUG)) {
- if (pbDisplayConfirm(Game._INTL("Treat this battle as a win?"))) {
+ if (DisplayConfirm(Game._INTL("Treat this battle as a win?"))) {
@decision=BattleResults.WON;
return 1;
}
- else if (pbDisplayConfirm(Game._INTL("Treat this battle as a loss?"))) {
+ else if (DisplayConfirm(Game._INTL("Treat this battle as a loss?"))) {
@decision=BattleResults.LOST;
return 1;
}
}
else if (@internalbattle) {
- pbDisplayPaused(Game._INTL("No! There's no running from a Trainer battle!"));
+ DisplayPaused(Game._INTL("No! There's no running from a Trainer battle!"));
}
- else if (pbDisplayConfirm(Game._INTL("Would you like to forfeit the match and quit now?"))) {
- pbDisplay(Game._INTL("{1} forfeited the match!",this.pbPlayer().name));
+ else if (DisplayConfirm(Game._INTL("Would you like to forfeit the match and quit now?"))) {
+ Display(Game._INTL("{1} forfeited the match!",this.Player().name));
@decision=BattleResults.FORFEIT;
return 1;
}
return 0;
}
if (debug && Input.press((int)PokemonUnity.UX.InputKeys.DEBUG)) {
- pbDisplayPaused(Game._INTL("Got away safely!"));
+ DisplayPaused(Game._INTL("Got away safely!"));
@decision=BattleResults.FORFEIT;
return 1;
}
if (@cantescape) {
- pbDisplayPaused(Game._INTL("Can't escape!"));
+ DisplayPaused(Game._INTL("Can't escape!"));
return 0;
}
- if (thispkmn.pbHasType(Types.GHOST) && Core.USENEWBATTLEMECHANICS) {
- pbDisplayPaused(Game._INTL("Got away safely!"));
+ if (thispkmn.HasType(Types.GHOST) && Core.USENEWBATTLEMECHANICS) {
+ DisplayPaused(Game._INTL("Got away safely!"));
@decision=BattleResults.FORFEIT;
return 1;
}
if (thispkmn.hasWorkingAbility(Abilities.RUN_AWAY)) {
if (duringBattle) {
- pbDisplayPaused(Game._INTL("Got away safely!"));
+ DisplayPaused(Game._INTL("Got away safely!"));
}
else {
- pbDisplayPaused(Game._INTL("{1} escaped using Run Away!",thispkmn.ToString()));
+ DisplayPaused(Game._INTL("{1} escaped using Run Away!",thispkmn.ToString()));
}
@decision=BattleResults.FORFEIT;
return 1;
}
if (thispkmn.hasWorkingItem(Items.SMOKE_BALL)) {
if (duringBattle) {
- pbDisplayPaused(Game._INTL("Got away safely!"));
+ DisplayPaused(Game._INTL("Got away safely!"));
}
else {
- pbDisplayPaused(Game._INTL("{1} escaped using its {2}!",thispkmn.ToString(),Game._INTL(thispkmn.Item.ToString(TextScripts.Name))));
+ DisplayPaused(Game._INTL("{1} escaped using its {2}!",thispkmn.ToString(),Game._INTL(thispkmn.Item.ToString(TextScripts.Name))));
}
@decision=BattleResults.FORFEIT;
return 1;
}
- if (!duringBattle && !pbCanSwitch(idxPokemon,-1,false)) {
- pbDisplayPaused(Game._INTL("Can't escape!"));
+ if (!duringBattle && !CanSwitch(idxPokemon,-1,false)) {
+ DisplayPaused(Game._INTL("Can't escape!"));
return 0;
}
int rate;
- // Note: not pbSpeed, because using unmodified Speed
- int speedPlayer=@battlers[idxPokemon].pokemon.SPE;
- IBattler opposing=@battlers[idxPokemon].pbOppositeOpposing;
- if (opposing.isFainted()) opposing=opposing.pbPartner;
+ // Note: not Speed, because using unmodified Speed
+ int speedPlayer=_battlers[idxPokemon].pokemon.SPE;
+ IBattler opposing=_battlers[idxPokemon].OppositeOpposing;
+ if (opposing.isFainted()) opposing=opposing.Partner;
if (!opposing.isFainted()) {
int speedEnemy=opposing.pokemon.SPE;
if (speedPlayer>speedEnemy) {
@@ -2107,12 +2110,12 @@ public virtual int pbRun(int idxPokemon,bool duringBattle=false) {
rate=256;
}
int ret=1;
- if (pbRandom(256)0 &&
- (@battlers[i].isFainted() || @battlers[i].captured)) {
- bool haveexpall=Game.GameData.Bag.pbQuantity(Items.EXP_ALL)>0; //hasConst(Items.EXP_ALL) &&
+ if (IsOpposing(i) && _battlers[i].participants.Count>0 &&
+ (_battlers[i].isFainted() || _battlers[i].captured)) {
+ bool haveexpall=Game.GameData.Bag.Quantity(Items.EXP_ALL)>0; //hasConst(Items.EXP_ALL) &&
// First count the number of participants
int partic=0;
int expshare=0;
- foreach (var j in @battlers[i].participants) {
- if (!@party1[j].IsNotNullOrNone() || !pbIsOwner(0,j)) continue;
+ foreach (var j in _battlers[i].participants) {
+ if (!@party1[j].IsNotNullOrNone() || !IsOwner(0,j)) continue;
if (@party1[j].HP>0 && !@party1[j].isEgg) partic+=1;
}
if (!haveexpall) {
for (int j = 0; j < @party1.Length; j++) {
- if (!@party1[j].IsNotNullOrNone() || !pbIsOwner(0,j)) continue;
+ if (!@party1[j].IsNotNullOrNone() || !IsOwner(0,j)) continue;
if (@party1[j].HP>0 && !@party1[j].isEgg &&
(@party1[j].Item == Items.EXP_SHARE ||
@party1[j].itemInitial == Items.EXP_SHARE)) expshare+=1;
@@ -2260,40 +2263,40 @@ public virtual void pbGainEXP() {
}
// Now calculate EXP for the participants
if (partic>0 || expshare>0 || haveexpall) {
- if (@opponent == null && successbegin && pbAllFainted(@party2)) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbWildBattleSuccess();
+ if (@opponent == null && successbegin && AllFainted(@party2)) {
+ (@scene as IPokeBattle_DebugSceneNoGraphics).WildBattleSuccess();
successbegin=false;
}
for (int j = 0; j < @party1.Length; j++) {
- if (!@party1[j].IsNotNullOrNone() || !pbIsOwner(0,j)) continue;
+ if (!@party1[j].IsNotNullOrNone() || !IsOwner(0,j)) continue;
if (@party1[j].HP<=0 || @party1[j].isEgg) continue;
bool haveexpshare=@party1[j].Item == Items.EXP_SHARE ||
@party1[j].itemInitial == Items.EXP_SHARE;
- if (!haveexpshare && !@battlers[i].participants.Contains((byte)j)) continue;
- pbGainExpOne(j,@battlers[i],partic,expshare,haveexpall);
+ if (!haveexpshare && !_battlers[i].participants.Contains((byte)j)) continue;
+ GainExpOne(j,_battlers[i],partic,expshare,haveexpall);
}
if (haveexpall) {
bool showmessage=true;
for (int j = 0; j < @party1.Length; j++) {
- if (!@party1[j].IsNotNullOrNone() || !pbIsOwner(0,j)) continue;
+ if (!@party1[j].IsNotNullOrNone() || !IsOwner(0,j)) continue;
if (@party1[j].HP<=0 || @party1[j].isEgg) continue;
if (@party1[j].Item == Items.EXP_SHARE ||
@party1[j].itemInitial == Items.EXP_SHARE) continue;
- if (@battlers[i].participants.Contains((byte)j)) continue;
- if (showmessage) pbDisplayPaused(Game._INTL("The rest of your team gained Exp. Points thanks to the {1}!",
+ if (_battlers[i].participants.Contains((byte)j)) continue;
+ if (showmessage) DisplayPaused(Game._INTL("The rest of your team gained Exp. Points thanks to the {1}!",
Game._INTL(Items.EXP_ALL.ToString(TextScripts.Name))));
showmessage=false;
- pbGainExpOne(j,@battlers[i],partic,expshare,haveexpall,false);
+ GainExpOne(j,_battlers[i],partic,expshare,haveexpall,false);
}
}
}
// Now clear the participants array
- @battlers[i].participants.Clear();//=[];
+ _battlers[i].participants.Clear();//=[];
}
}
}
- public void pbGainExpOne(int index,IBattler defeated,int partic,int expshare,bool haveexpall,bool showmessages=true) {
+ public void GainExpOne(int index,IBattler defeated,int partic,int expshare,bool haveexpall,bool showmessages=true) {
IPokemon thispoke=@party1[index];
// Original species, not current species
int level=defeated.Level;
@@ -2401,10 +2404,10 @@ public void pbGainExpOne(int index,IBattler defeated,int partic,int expshare,boo
else {
exp=(int)Math.Floor(exp/7f);
}
- bool isOutsider = thispoke.isForeign(pbPlayer());
- // || (thispoke.language!=0 && thispoke.language!=this.pbPlayer().language);
+ bool isOutsider = thispoke.isForeign(Player());
+ // || (thispoke.language!=0 && thispoke.language!=this.Player().language);
if (isOutsider) {
- //if (thispoke.language!=0 && thispoke.language!=this.pbPlayer().language) {
+ //if (thispoke.language!=0 && thispoke.language!=this.Player().language) {
// exp=(int)Math.Floor(exp*1.7);
//}
//else {
@@ -2422,10 +2425,10 @@ public void pbGainExpOne(int index,IBattler defeated,int partic,int expshare,boo
if (exp>0) {
if (showmessages) {
if (isOutsider) {
- pbDisplayPaused(Game._INTL("{1} gained a boosted {2} Exp. Points!",thispoke.Name,exp.ToString()));
+ DisplayPaused(Game._INTL("{1} gained a boosted {2} Exp. Points!",thispoke.Name,exp.ToString()));
}
else {
- pbDisplayPaused(Game._INTL("{1} gained {2} Exp. Points!",thispoke.Name,exp.ToString()));
+ DisplayPaused(Game._INTL("{1} gained {2} Exp. Points!",thispoke.Name,exp.ToString()));
}
}
int newlevel=Monster.Data.Experience.GetLevelFromExperience(growthrate,newexp);
@@ -2447,7 +2450,7 @@ public void pbGainExpOne(int index,IBattler defeated,int partic,int expshare,boo
int tempexp1=thispoke.Exp;
int tempexp2=0;
// Find battler
- IBattler battler=pbFindPlayerBattler(index);
+ IBattler battler=FindPlayerBattler(index);
do { //loop
// EXP Bar animation
int startexp=Monster.Data.Experience.GetStartExperience(growthrate,curlevel); //0
@@ -2455,13 +2458,13 @@ public void pbGainExpOne(int index,IBattler defeated,int partic,int expshare,boo
tempexp2=(endexpnewlevel) {
thispoke.calcStats();
- if (battler.IsNotNullOrNone()) battler.pbUpdate(false);
- @scene.pbRefresh();
+ if (battler.IsNotNullOrNone()) battler.Update(false);
+ @scene.Refresh();
break;
}
int oldtotalhp=thispoke.TotalHP;
@@ -2474,18 +2477,18 @@ public void pbGainExpOne(int index,IBattler defeated,int partic,int expshare,boo
(battler.pokemon as Monster.Pokemon).ChangeHappiness(HappinessMethods.LEVELUP);//"level up"
}
thispoke.calcStats();
- if (battler.IsNotNullOrNone()) battler.pbUpdate(false);
- @scene.pbRefresh();
- pbDisplayPaused(Game._INTL("{1} grew to Level {2}!",thispoke.Name,curlevel.ToString()));
+ if (battler.IsNotNullOrNone()) battler.Update(false);
+ @scene.Refresh();
+ DisplayPaused(Game._INTL("{1} grew to Level {2}!",thispoke.Name,curlevel.ToString()));
//ToDo: Can Evolve during battle?
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbLevelUp(battler,thispoke,oldtotalhp,oldattack,
+ (@scene as IPokeBattle_DebugSceneNoGraphics).LevelUp(battler,thispoke,oldtotalhp,oldattack,
olddefense,oldspeed,oldspatk,oldspdef);
// Finding all moves learned at this level
Moves[] movelist=thispoke.getMoveList(Monster.LearnMethod.levelup);
foreach (Moves k in movelist) {
//if (k[0]==thispoke.Level) // Learned a new move
- //pbLearnMove(index,k[1]);
- pbLearnMove(index,k);
+ //LearnMove(index,k[1]);
+ LearnMove(index,k);
}
} while (true);
}
@@ -2494,50 +2497,50 @@ public void pbGainExpOne(int index,IBattler defeated,int partic,int expshare,boo
#endregion
#region Learning a move.
- public void pbLearnMove(int pkmnIndex,Moves move) {
+ public void LearnMove(int pkmnIndex,Moves move) {
IPokemon pokemon=@party1[pkmnIndex];
if (!pokemon.IsNotNullOrNone()) return;
string pkmnname=pokemon.Name;
- IBattler battler=pbFindPlayerBattler(pkmnIndex);
+ IBattler battler=FindPlayerBattler(pkmnIndex);
string movename=Game._INTL(move.ToString(TextScripts.Name));
for (int i = 0; i < pokemon.moves.Length; i++) {
if (pokemon.moves[i].id==move) return;
if (pokemon.moves[i].id==0) {
pokemon.moves[i]=new PokemonUnity.Attack.Move(move); //ToDo: Use LearnMove Method in Pokemon Class?
if (battler.IsNotNullOrNone())
- battler.moves[i]=Combat.Move.pbFromPBMove(this,pokemon.moves[i]);
- pbDisplayPaused(Game._INTL("{1} learned {2}!",pkmnname,movename));
+ battler.moves[i]=Combat.Move.FromMove(this,pokemon.moves[i]);
+ DisplayPaused(Game._INTL("{1} learned {2}!",pkmnname,movename));
GameDebug.Log($"[Learn move] #{pkmnname} learned #{movename}");
return;
}
}
do { //loop
- pbDisplayPaused(Game._INTL("{1} is trying to learn {2}.",pkmnname,movename));
- pbDisplayPaused(Game._INTL("But {1} can't learn more than four moves.",pkmnname));
- if (pbDisplayConfirm(Game._INTL("Delete a move to make room for {1}?",movename))) {
- pbDisplayPaused(Game._INTL("Which move should be forgotten?"));
- int forgetmove=(@scene as IPokeBattle_DebugSceneNoGraphics).pbForgetMove(pokemon,move);
+ DisplayPaused(Game._INTL("{1} is trying to learn {2}.",pkmnname,movename));
+ DisplayPaused(Game._INTL("But {1} can't learn more than four moves.",pkmnname));
+ if (DisplayConfirm(Game._INTL("Delete a move to make room for {1}?",movename))) {
+ DisplayPaused(Game._INTL("Which move should be forgotten?"));
+ int forgetmove=(@scene as IPokeBattle_DebugSceneNoGraphics).ForgetMove(pokemon,move);
if (forgetmove>=0) {
string oldmovename=Game._INTL(pokemon.moves[forgetmove].id.ToString(TextScripts.Name));
pokemon.moves[forgetmove]=new PokemonUnity.Attack.Move(move); // Replaces current/total PP
if (battler.IsNotNullOrNone())
- battler.moves[forgetmove]=Combat.Move.pbFromPBMove(this,pokemon.moves[forgetmove]); //ToDo: Use ForgetMove Method in Pokemon Class?
+ battler.moves[forgetmove]=Combat.Move.FromMove(this,pokemon.moves[forgetmove]); //ToDo: Use ForgetMove Method in Pokemon Class?
//battler.pokemon.DeleteMoveAtIndex(forgetmove);
- pbDisplayPaused(Game._INTL("1, 2, and... ... ...")); //ToDo: 2sec delay between text
- pbDisplayPaused(Game._INTL("Poof!"));
- pbDisplayPaused(Game._INTL("{1} forgot {2}.",pkmnname,oldmovename));
- pbDisplayPaused(Game._INTL("And..."));
- pbDisplayPaused(Game._INTL("{1} learned {2}!",pkmnname,movename));
+ DisplayPaused(Game._INTL("1, 2, and... ... ...")); //ToDo: 2sec delay between text
+ DisplayPaused(Game._INTL("Poof!"));
+ DisplayPaused(Game._INTL("{1} forgot {2}.",pkmnname,oldmovename));
+ DisplayPaused(Game._INTL("And..."));
+ DisplayPaused(Game._INTL("{1} learned {2}!",pkmnname,movename));
GameDebug.Log($"[Learn move] #{pkmnname} forgot #{oldmovename} and learned #{movename}");
return;
}
- else if (pbDisplayConfirm(Game._INTL("Should {1} stop learning {2}?",pkmnname,movename))) {
- pbDisplayPaused(Game._INTL("{1} did not learn {2}.",pkmnname,movename));
- return;
- }
+ else if (DisplayConfirm(Game._INTL("Should {1} stop learning {2}?",pkmnname,movename))) {
+ DisplayPaused(Game._INTL("{1} did not learn {2}.",pkmnname,movename));
+ return;
+ }
}
- else if (pbDisplayConfirm(Game._INTL("Should {1} stop learning {2}?",pkmnname,movename))) {
- pbDisplayPaused(Game._INTL("{1} did not learn {2}.",pkmnname,movename));
+ else if (DisplayConfirm(Game._INTL("Should {1} stop learning {2}?",pkmnname,movename))) {
+ DisplayPaused(Game._INTL("{1} did not learn {2}.",pkmnname,movename));
return;
}
} while(true);
@@ -2545,174 +2548,174 @@ public void pbLearnMove(int pkmnIndex,Moves move) {
#endregion
#region Abilities.
- public virtual void pbOnActiveAll() {
+ public virtual void OnActiveAll() {
for (int i = 0; i < battlers.Length; i++) { // Currently unfainted participants will earn EXP even if they faint afterwards
- if (pbIsOpposing(i)) @battlers[i].pbUpdateParticipants();
- if (!pbIsOpposing(i) &&
- (@battlers[i].Item == Items.AMULET_COIN ||
- @battlers[i].Item == Items.LUCK_INCENSE)) @amuletcoin=true;
+ if (IsOpposing(i)) _battlers[i].UpdateParticipants();
+ if (!IsOpposing(i) &&
+ (_battlers[i].Item == Items.AMULET_COIN ||
+ _battlers[i].Item == Items.LUCK_INCENSE)) @amuletcoin=true;
}
for (int i = 0; i < battlers.Length; i++) {
- if (!@battlers[i].isFainted()) {
- if (@battlers[i] is IBattlerShadowPokemon b && b.isShadow() && pbIsOpposing(i)) {
- pbCommonAnimation("Shadow",@battlers[i],null);
- pbDisplay(Game._INTL("Oh!\nA Shadow Pokémon!"));
+ if (!_battlers[i].isFainted()) {
+ if (_battlers[i] is IBattlerShadowPokemon b && b.isShadow() && IsOpposing(i)) {
+ CommonAnimation("Shadow",_battlers[i],null);
+ Display(Game._INTL("Oh!\nA Shadow Pokémon!"));
}
}
}
// Weather-inducing abilities, Trace, Imposter, etc.
@usepriority=false;
- IBattler[] priority=pbPriority();
- foreach (var i in priority) {
- i?.pbAbilitiesOnSwitchIn(true);
+ IBattler[] priority=Priority();
+ foreach (var i in this.priority) {
+ i?.AbilitiesOnSwitchIn(true);
}
// Check forms are correct
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].isFainted()) continue;
- @battlers[i].pbCheckForm();
+ if (_battlers[i].isFainted()) continue;
+ _battlers[i].CheckForm();
}
}
- public virtual bool pbOnActiveOne(IBattler pkmn,bool onlyabilities=false,bool moldbreaker=false) {
+ public virtual bool OnActiveOne(IBattler pkmn,bool onlyabilities=false,bool moldbreaker=false) {
if (pkmn.isFainted()) return false;
if (!onlyabilities) {
for (int i = 0; i < battlers.Length; i++) { // Currently unfainted participants will earn EXP even if they faint afterwards
- if (pbIsOpposing(i)) @battlers[i].pbUpdateParticipants();
- if (!pbIsOpposing(i) &&
- (@battlers[i].Item == Items.AMULET_COIN ||
- @battlers[i].Item == Items.LUCK_INCENSE)) @amuletcoin=true;
+ if (IsOpposing(i)) _battlers[i].UpdateParticipants();
+ if (!IsOpposing(i) &&
+ (_battlers[i].Item == Items.AMULET_COIN ||
+ _battlers[i].Item == Items.LUCK_INCENSE)) @amuletcoin=true;
}
- if (pkmn is IPokemonShadowPokemon p && p.isShadow && pbIsOpposing(pkmn.Index)) {
- pbCommonAnimation("Shadow",pkmn,null);
- pbDisplay(Game._INTL("Oh!\nA Shadow Pokémon!"));
+ if (pkmn is IPokemonShadowPokemon p && p.isShadow && IsOpposing(pkmn.Index)) {
+ CommonAnimation("Shadow",pkmn,null);
+ Display(Game._INTL("Oh!\nA Shadow Pokémon!"));
}
// Healing Wish
if (pkmn.effects.HealingWish) {
GameDebug.Log($"[Lingering effect triggered] #{pkmn.ToString()}'s Healing Wish");
- pbCommonAnimation("HealingWish",pkmn,null);
- pbDisplayPaused(Game._INTL("The healing wish came true for {1}!",pkmn.ToString(true)));
- pkmn.pbRecoverHP(pkmn.TotalHP,true);
- if (pkmn is IBattlerEffect b) b.pbCureStatus(false);
+ CommonAnimation("HealingWish",pkmn,null);
+ DisplayPaused(Game._INTL("The healing wish came true for {1}!",pkmn.ToString(true)));
+ pkmn.RecoverHP(pkmn.TotalHP,true);
+ if (pkmn is IBattlerEffect b) b.CureStatus(false);
pkmn.effects.HealingWish=false;
}
// Lunar Dance
if (pkmn.effects.LunarDance) {
GameDebug.Log($"[Lingering effect triggered] #{pkmn.ToString()}'s Lunar Dance");
- pbCommonAnimation("LunarDance",pkmn,null);
- pbDisplayPaused(Game._INTL("{1} became cloaked in mystical moonlight!",pkmn.ToString()));
- pkmn.pbRecoverHP(pkmn.TotalHP,true);
- if (pkmn is IBattlerEffect b) b.pbCureStatus(false);
+ CommonAnimation("LunarDance",pkmn,null);
+ DisplayPaused(Game._INTL("{1} became cloaked in mystical moonlight!",pkmn.ToString()));
+ pkmn.RecoverHP(pkmn.TotalHP,true);
+ if (pkmn is IBattlerEffect b) b.CureStatus(false);
for (int i = 0; i < pkmn.moves.Length; i++) {
pkmn.moves[i].PP=(byte)pkmn.moves[i].TotalPP;
}
pkmn.effects.LunarDance=false;
}
// Spikes
- if (pkmn.pbOwnSide.Spikes>0 && !pkmn.isAirborne(moldbreaker)) {
+ if (pkmn.OwnSide.Spikes>0 && !pkmn.isAirborne(moldbreaker)) {
if (!pkmn.hasWorkingAbility(Abilities.MAGIC_GUARD)) {
GameDebug.Log($"[Entry hazard] #{pkmn.ToString()} triggered Spikes");
- float spikesdiv=new int[] { 8, 6, 4 }[pkmn.pbOwnSide.Spikes-1];
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(pkmn,0);
- pkmn.pbReduceHP((int)Math.Floor(pkmn.TotalHP/spikesdiv));
- pbDisplayPaused(Game._INTL("{1} is hurt by the spikes!",pkmn.ToString()));
+ float spikesdiv=new int[] { 8, 6, 4 }[pkmn.OwnSide.Spikes-1];
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(pkmn,0);
+ pkmn.ReduceHP((int)Math.Floor(pkmn.TotalHP/spikesdiv));
+ DisplayPaused(Game._INTL("{1} is hurt by the spikes!",pkmn.ToString()));
}
}
- if (pkmn.isFainted()) pkmn.pbFaint();
+ if (pkmn.isFainted()) pkmn.Faint();
// Stealth Rock
- if (pkmn.pbOwnSide.StealthRock && !pkmn.isFainted()) {
+ if (pkmn.OwnSide.StealthRock && !pkmn.isFainted()) {
if (!pkmn.hasWorkingAbility(Abilities.MAGIC_GUARD)) {
/*Types atype=Types.ROCK; //|| 0;
//ToDo: Deal with Type Advantage...
float eff=atype.GetCombinedEffectiveness(pkmn.Type1,pkmn.Type2,pkmn.effects.Type3);
if (eff>0) {
GameDebug.Log($"[Entry hazard] #{pkmn.ToString()} triggered Stealth Rock");
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(pkmn,0);
- pkmn.pbReduceHP((int)Math.Floor((pkmn.TotalHP*eff)/64f));
- pbDisplayPaused(Game._INTL("Pointed stones dug into {1}!",pkmn.ToString()));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(pkmn,0);
+ pkmn.ReduceHP((int)Math.Floor((pkmn.TotalHP*eff)/64f));
+ DisplayPaused(Game._INTL("Pointed stones dug into {1}!",pkmn.ToString()));
}*/
}
}
- if (pkmn.isFainted()) pkmn.pbFaint();
+ if (pkmn.isFainted()) pkmn.Faint();
// Toxic Spikes
- if (pkmn.pbOwnSide.ToxicSpikes>0 && !pkmn.isFainted()) {
+ if (pkmn.OwnSide.ToxicSpikes>0 && !pkmn.isFainted()) {
if (!pkmn.isAirborne(moldbreaker)) {
- if (pkmn.pbHasType(Types.POISON)) {
+ if (pkmn.HasType(Types.POISON)) {
GameDebug.Log($"[Entry hazard] #{pkmn.ToString()} absorbed Toxic Spikes");
- pkmn.pbOwnSide.ToxicSpikes=0;
- pbDisplayPaused(Game._INTL("{1} absorbed the poison spikes!",pkmn.ToString()));
+ pkmn.OwnSide.ToxicSpikes=0;
+ DisplayPaused(Game._INTL("{1} absorbed the poison spikes!",pkmn.ToString()));
}
- else if (pkmn is IBattlerEffect b && b.pbCanPoisonSpikes(moldbreaker)) {
+ else if (pkmn is IBattlerEffect b && b.CanPoisonSpikes(moldbreaker)) {
GameDebug.Log($"[Entry hazard] #{pkmn.ToString()} triggered Toxic Spikes");
- if (pkmn.pbOwnSide.ToxicSpikes==2) {
- b.pbPoison(null,Game._INTL("{1} was badly poisoned by the poison spikes!",pkmn.ToString()),true);
+ if (pkmn.OwnSide.ToxicSpikes==2) {
+ b.Poison(null,Game._INTL("{1} was badly poisoned by the poison spikes!",pkmn.ToString()),true);
}
else {
- b.pbPoison(null,Game._INTL("{1} was poisoned by the poison spikes!",pkmn.ToString()));
+ b.Poison(null,Game._INTL("{1} was poisoned by the poison spikes!",pkmn.ToString()));
}
}
}
}
// Sticky Web
- if (pkmn.pbOwnSide.StickyWeb && !pkmn.isFainted() &&
+ if (pkmn.OwnSide.StickyWeb && !pkmn.isFainted() &&
!pkmn.isAirborne(moldbreaker)) {
- if (pkmn is IBattlerEffect b && b.pbCanReduceStatStage(Stats.SPEED,null,false,null,moldbreaker)) {
+ if (pkmn is IBattlerEffect b && b.CanReduceStatStage(Stats.SPEED,null,false,null,moldbreaker)) {
GameDebug.Log($"[Entry hazard] #{pkmn.ToString()} triggered Sticky Web");
- pbDisplayPaused(Game._INTL("{1} was caught in a sticky web!",pkmn.ToString()));
- b.pbReduceStat(Stats.SPEED,1,null,false,null,true,moldbreaker);
+ DisplayPaused(Game._INTL("{1} was caught in a sticky web!",pkmn.ToString()));
+ b.ReduceStat(Stats.SPEED,1,null,false,null,true,moldbreaker);
}
}
}
- pkmn.pbAbilityCureCheck();
+ pkmn.AbilityCureCheck();
if (pkmn.isFainted()) {
- pbGainEXP();
- pbJudge(); // pbSwitch
+ GainEXP();
+ Judge(); // Switch
return false;
}
- pkmn.pbAbilitiesOnSwitchIn(true);
+ pkmn.AbilitiesOnSwitchIn(true);
if (!onlyabilities) {
- pkmn.pbCheckForm();
- pkmn.pbBerryCureCheck();
+ pkmn.CheckForm();
+ pkmn.BerryCureCheck();
}
return true;
}
- public void pbPrimordialWeather() {
+ public void PrimordialWeather() {
// End Primordial Sea, Desolate Land, Delta Stream
bool hasabil=false;
switch (@weather) {
case Weather.HEAVYRAIN:
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].Ability == Abilities.PRIMORDIAL_SEA &&
- !@battlers[i].isFainted()) {
+ if (_battlers[i].Ability == Abilities.PRIMORDIAL_SEA &&
+ !_battlers[i].isFainted()) {
hasabil=true; break;
}
if (!hasabil) {
@weather=Weather.NONE;
- pbDisplayBrief("The heavy rain has lifted!");
+ DisplayBrief("The heavy rain has lifted!");
}
}
break;
case Weather.HARSHSUN:
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].Ability == Abilities.DESOLATE_LAND &&
- !@battlers[i].isFainted()) {
+ if (_battlers[i].Ability == Abilities.DESOLATE_LAND &&
+ !_battlers[i].isFainted()) {
hasabil=true; break;
}
if (!hasabil) {
@weather=Weather.NONE;
- pbDisplayBrief("The harsh sunlight faded!");
+ DisplayBrief("The harsh sunlight faded!");
}
}
break;
case Weather.STRONGWINDS:
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].Ability == Abilities.DELTA_STREAM &&
- !@battlers[i].isFainted()) {
+ if (_battlers[i].Ability == Abilities.DELTA_STREAM &&
+ !_battlers[i].isFainted()) {
hasabil=true; break;
}
if (!hasabil) {
@weather=Weather.NONE;
- pbDisplayBrief("The mysterious air current has dissipated!");
+ DisplayBrief("The mysterious air current has dissipated!");
}
}
break;
@@ -2721,10 +2724,11 @@ public void pbPrimordialWeather() {
#endregion
#region Judging
- private void _pbJudgeCheckpoint(IBattler attacker,IBattleMove move=null) {
+ //protected void _JudgeCheckpoint(IBattler attacker,IBattleMove move=null) {
+ void IBattle.JudgeCheckpoint(IBattler attacker,IBattleMove move) {
}
- public BattleResults pbDecisionOnTime() {
+ public BattleResults DecisionOnTime() {
int count1=0;
int count2=0;
int hptotal1=0;
@@ -2754,7 +2758,7 @@ public BattleResults pbDecisionOnTime() {
///
///
/// Made this and forgot to label it... idr details
- public BattleResults pbDecisionOnTime2() {
+ public BattleResults DecisionOnTime2() {
int count1=0;
int count2=0;
int hptotal1=0;
@@ -2762,19 +2766,19 @@ public BattleResults pbDecisionOnTime2() {
foreach (var i in @party1) {
if (!i.IsNotNullOrNone()) continue;
if (i.HP>0 && !i.isEgg) {
- count1+=1;
- hptotal1+=(i.HP*100/i.TotalHP);
+ count1+=1;
+ hptotal1+=(i.HP*100/i.TotalHP); //the difference between the first and second function is this line...
}
}
if (count1>0) hptotal1/=count1;
foreach (var i in @party2) {
if (!i.IsNotNullOrNone()) continue;
if (i.HP>0 && !i.isEgg) {
- count2+=1;
- hptotal2+=(i.HP*100/i.TotalHP);
+ count2+=1;
+ hptotal2+=(i.HP*100/i.TotalHP);
}
}
- if (count2>0) hptotal2/=count2;
+ if (count2>0) hptotal2/=count2; //and this line...
if (count1>count2 ) return BattleResults.WON; // win
if (count1hptotal2) return BattleResults.WON; // win
@@ -2782,22 +2786,22 @@ public BattleResults pbDecisionOnTime2() {
return BattleResults.DRAW; // draw;
}
- //private BattleResults _pbDecisionOnDraw() {
- BattleResults IBattle.pbDecisionOnDraw() {
+ //protected BattleResults _DecisionOnDraw() {
+ BattleResults IBattle.DecisionOnDraw() {
return BattleResults.DRAW; // draw;
}
- public void pbJudge() {
- GameDebug.Log($"[Counts: #{pbPokemonCount(@party1)}/#{pbPokemonCount(@party2)}]");
- if (pbAllFainted(@party1) && pbAllFainted(@party2)) {
- @decision=pbDecisionOnDraw(); // Draw
+ public void Judge() {
+ GameDebug.Log($"[Counts: #{PokemonCount(@party1)}/#{PokemonCount(@party2)}]");
+ if (AllFainted(@party1) && AllFainted(@party2)) {
+ @decision=DecisionOnDraw(); // Draw
return;
}
- if (pbAllFainted(@party1)) {
+ if (AllFainted(@party1)) {
@decision=BattleResults.LOST; // Loss
return;
}
- if (pbAllFainted(@party2)) {
+ if (AllFainted(@party2)) {
@decision=BattleResults.WON; // Win
return;
}
@@ -2809,12 +2813,12 @@ public void pbJudge() {
/// Displays a message on screen, and wait for player input
///
///
- public virtual void pbDisplay(string msg) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDisplayMessage(msg);
+ public virtual void Display(string msg) {
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DisplayMessage(msg);
}
- public virtual void pbDisplayPaused(string msg) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDisplayPausedMessage(msg);
+ public virtual void DisplayPaused(string msg) {
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DisplayPausedMessage(msg);
}
///
@@ -2822,53 +2826,53 @@ public virtual void pbDisplayPaused(string msg) {
/// but will continue without player input after short delay
///
///
- public virtual void pbDisplayBrief(string msg) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDisplayMessage(msg,true);
+ public virtual void DisplayBrief(string msg) {
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DisplayMessage(msg,true);
}
- public virtual bool pbDisplayConfirm(string msg) {
- return (@scene as IPokeBattle_DebugSceneNoGraphics).pbDisplayConfirmMessage(msg);
+ public virtual bool DisplayConfirm(string msg) {
+ return (@scene as IPokeBattle_DebugSceneNoGraphics).DisplayConfirmMessage(msg);
}
- public void pbShowCommands(string msg,string[] commands,bool cancancel=true) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbShowCommands(msg,commands,cancancel);
+ public void ShowCommands(string msg,string[] commands,bool cancancel=true) {
+ (@scene as IPokeBattle_DebugSceneNoGraphics).ShowCommands(msg,commands,cancancel);
}
- public void pbShowCommands(string msg,string[] commands,int cancancel) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbShowCommands(msg,commands,cancancel);
+ public void ShowCommands(string msg,string[] commands,int cancancel) {
+ (@scene as IPokeBattle_DebugSceneNoGraphics).ShowCommands(msg,commands,cancancel);
}
- public void pbAnimation(Moves move,IBattler attacker,IBattler opponent,int hitnum=0) {
+ public void Animation(Moves move,IBattler attacker,IBattler opponent,int hitnum=0) {
if (@battlescene) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbAnimation(move,attacker,opponent,hitnum);
+ (@scene as IPokeBattle_DebugSceneNoGraphics).Animation(move,attacker,opponent,hitnum);
}
}
- public void pbCommonAnimation(string name,IBattler attacker,IBattler opponent,int hitnum=0) {
+ public void CommonAnimation(string name,IBattler attacker,IBattler opponent,int hitnum=0) {
if (@battlescene) {
- if (@scene is IPokeBattle_Scene s0) s0.pbCommonAnimation(name,attacker,opponent,hitnum);
+ if (@scene is IPokeBattle_Scene s0) s0.CommonAnimation(name,attacker,opponent,hitnum);
}
}
#endregion
#region Battle Core.
- public virtual BattleResults pbStartBattle(bool canlose=false) {
+ public virtual BattleResults StartBattle(bool canlose=false) {
GameDebug.Log($"");
GameDebug.Log($"******************************************");
@decision = BattleResults.InProgress;
try {
- pbStartBattleCore(canlose);
+ StartBattleCore(canlose);
} catch (BattleAbortedException e){ //rescue BattleAbortedException;
GameDebug.LogError(e.Message);
GameDebug.LogError(e.StackTrace);
@decision = BattleResults.ABORTED;
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbEndBattle(@decision);
+ (@scene as IPokeBattle_DebugSceneNoGraphics).EndBattle(@decision);
}
return @decision;
}
- public void pbStartBattleCore(bool canlose) {
+ public void StartBattleCore(bool canlose) {
if (!@fullparty1 && @party1.Length>Core.MAXPARTYSIZE) {
//throw new Exception(new ArgumentError(Game._INTL("Party 1 has more than {1} Pokémon.",Core.MAXPARTYSIZE)));
GameDebug.LogError(Game._INTL("Party 1 has more than {1} Pokémon.",Core.MAXPARTYSIZE));
@@ -2894,11 +2898,11 @@ public void pbStartBattleCore(bool canlose) {
GameDebug.LogWarning("Changed battle to single.");
}
IPokemon wildpoke=@party2[0];
- @battlers[1].pbInitialize(wildpoke,0,false);
- if (@peer is IBattlePeerMultipleForms p) p.pbOnEnteringBattle(this,wildpoke);
- pbSetSeen(wildpoke);
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbStartBattle(this);
- pbDisplayPaused(Game._INTL("Wild {1} appeared!",Game._INTL(wildpoke.Species.ToString(TextScripts.Name)))); //Wild pokemons dont get nicknames
+ _battlers[1].Initialize(wildpoke,0,false);
+ if (@peer is IBattlePeerMultipleForms p) p.OnEnteringBattle(this,wildpoke);
+ SetSeen(wildpoke);
+ (@scene as IPokeBattle_DebugSceneNoGraphics).StartBattle(this);
+ DisplayPaused(Game._INTL("Wild {1} appeared!",Game._INTL(wildpoke.Species.ToString(TextScripts.Name)))); //Wild pokemons dont get nicknames
}
else if (@party2.Length>1) { //length==2
if (!@doublebattle) {
@@ -2916,14 +2920,14 @@ public void pbStartBattleCore(bool canlose) {
goto initialize_wild_battle;
}
}
- @battlers[1].pbInitialize(@party2[0],0,false);
- @battlers[3].pbInitialize(@party2[1],0,false);
- if (@peer is IBattlePeerMultipleForms p0) p0.pbOnEnteringBattle(this,@party2[0]);
- if (@peer is IBattlePeerMultipleForms p1) p1.pbOnEnteringBattle(this,@party2[1]);
- pbSetSeen(@party2[0]);
- pbSetSeen(@party2[1]);
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbStartBattle(this);
- pbDisplayPaused(Game._INTL("Wild {1} and\r\n{2} appeared!",
+ _battlers[1].Initialize(@party2[0],0,false);
+ _battlers[3].Initialize(@party2[1],0,false);
+ if (@peer is IBattlePeerMultipleForms p0) p0.OnEnteringBattle(this,@party2[0]);
+ if (@peer is IBattlePeerMultipleForms p1) p1.OnEnteringBattle(this,@party2[1]);
+ SetSeen(@party2[0]);
+ SetSeen(@party2[1]);
+ (@scene as IPokeBattle_DebugSceneNoGraphics).StartBattle(this);
+ DisplayPaused(Game._INTL("Wild {1} and\r\n{2} appeared!",
Game._INTL(@party2[0].Species.ToString(TextScripts.Name)),Game._INTL(@party2[1].Species.ToString(TextScripts.Name)))); //Wild pokemons dont get nicknames
}
else {
@@ -2954,40 +2958,40 @@ public void pbStartBattleCore(bool canlose) {
@player= new ITrainer[] { @player[0], @player[1] }; //Resolved Error
}
}
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbStartBattle(this);
+ (@scene as IPokeBattle_DebugSceneNoGraphics).StartBattle(this);
if (@opponent.Length > 0) {
- pbDisplayPaused(Game._INTL("{1} and {2} want to battle!",@opponent[0].name,@opponent[1].name));
- int sendout1=pbFindNextUnfainted(@party2,0,pbSecondPartyBegin(1));
+ DisplayPaused(Game._INTL("{1} and {2} want to battle!",@opponent[0].name,@opponent[1].name));
+ int sendout1=FindNextUnfainted(@party2,0,SecondPartyBegin(1));
if (sendout1<0) GameDebug.LogError(Game._INTL("Opponent 1 has no unfainted Pokémon")); //throw new Exception(Game._INTL("Opponent 1 has no unfainted Pokémon"));
- int sendout2=pbFindNextUnfainted(@party2,pbSecondPartyBegin(1));
+ int sendout2=FindNextUnfainted(@party2,SecondPartyBegin(1));
if (sendout2<0) GameDebug.LogError(Game._INTL("Opponent 2 has no unfainted Pokémon")); //throw new Exception(Game._INTL("Opponent 2 has no unfainted Pokémon"));
- @battlers[1].pbInitialize(@party2[sendout1],(sbyte)sendout1,false);
- pbDisplayBrief(Game._INTL("{1} sent\r\nout {2}!",@opponent[0].name,@battlers[1].Name));
- pbSendOut(1,@party2[sendout1]);
- @battlers[3].pbInitialize(@party2[sendout2],(sbyte)sendout2,false);
- pbDisplayBrief(Game._INTL("{1} sent\r\nout {2}!",@opponent[1].name,@battlers[3].Name));
- pbSendOut(3,@party2[sendout2]);
+ _battlers[1].Initialize(@party2[sendout1],(sbyte)sendout1,false);
+ DisplayBrief(Game._INTL("{1} sent\r\nout {2}!",@opponent[0].name,_battlers[1].Name));
+ SendOut(1,@party2[sendout1]);
+ _battlers[3].Initialize(@party2[sendout2],(sbyte)sendout2,false);
+ DisplayBrief(Game._INTL("{1} sent\r\nout {2}!",@opponent[1].name,_battlers[3].Name));
+ SendOut(3,@party2[sendout2]);
}
else {
- pbDisplayPaused(Game._INTL("{1}\r\nwould like to battle!",@opponent[0].name));
- int sendout1=pbFindNextUnfainted(@party2,0);
- int sendout2=pbFindNextUnfainted(@party2,sendout1+1);
+ DisplayPaused(Game._INTL("{1}\r\nwould like to battle!",@opponent[0].name));
+ int sendout1=FindNextUnfainted(@party2,0);
+ int sendout2=FindNextUnfainted(@party2,sendout1+1);
if (sendout1<0 || sendout2<0) {
//throw new Exception(Game._INTL("Opponent doesn't have two unfainted Pokémon"));
GameDebug.LogError(Game._INTL("Opponent doesn't have two unfainted Pokémon"));
}
- @battlers[1].pbInitialize(@party2[sendout1],(sbyte)sendout1,false);
- @battlers[3].pbInitialize(@party2[sendout2],(sbyte)sendout2,false);
- pbDisplayBrief(Game._INTL("{1} sent\r\nout {2} and {3}!",
- @opponent[0].name,@battlers[1].Name,@battlers[3].Name));
- pbSendOut(1,@party2[sendout1]);
- pbSendOut(3,@party2[sendout2]);
+ _battlers[1].Initialize(@party2[sendout1],(sbyte)sendout1,false);
+ _battlers[3].Initialize(@party2[sendout2],(sbyte)sendout2,false);
+ DisplayBrief(Game._INTL("{1} sent\r\nout {2} and {3}!",
+ @opponent[0].name,_battlers[1].Name,_battlers[3].Name));
+ SendOut(1,@party2[sendout1]);
+ SendOut(3,@party2[sendout2]);
}
}
#endregion
#region Initialize opponent in single battles
else {
- int sendout=pbFindNextUnfainted(@party2,0);
+ int sendout=FindNextUnfainted(@party2,0);
if (sendout<0) GameDebug.LogError(Game._INTL("Trainer has no unfainted Pokémon")); //throw new Exception(Game._INTL("Trainer has no unfainted Pokémon"));
if (@opponent.Length > 0) {
if (@opponent.Length!=1) GameDebug.LogError(Game._INTL("Opponent trainer must be only one person in single battles")); //throw new Exception(Game._INTL("Opponent trainer must be only one person in single battles"));
@@ -2998,85 +3002,85 @@ public void pbStartBattleCore(bool canlose) {
@player=new ITrainer[] { @player[0] };
}
IPokemon trainerpoke=@party2[sendout];
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbStartBattle(this);
- pbDisplayPaused(Game._INTL("{1}\r\nwould like to battle!",@opponent[0].name));
- @battlers[1].pbInitialize(trainerpoke,(sbyte)sendout,false);
- pbDisplayBrief(Game._INTL("{1} sent\r\nout {2}!",@opponent[0].name,@battlers[1].Name));
- pbSendOut(1,trainerpoke);
+ (@scene as IPokeBattle_DebugSceneNoGraphics).StartBattle(this);
+ DisplayPaused(Game._INTL("{1}\r\nwould like to battle!",@opponent[0].name));
+ _battlers[1].Initialize(trainerpoke,(sbyte)sendout,false);
+ DisplayBrief(Game._INTL("{1} sent\r\nout {2}!",@opponent[0].name,_battlers[1].Name));
+ SendOut(1,trainerpoke);
}
#endregion
#region Initialize players in double battles
if (@doublebattle) {
int sendout1 = 0; int sendout2 = 0;
if (@player.Length > 0) {
- sendout1=pbFindNextUnfainted(@party1,0,pbSecondPartyBegin(0));
+ sendout1=FindNextUnfainted(@party1,0,SecondPartyBegin(0));
if (sendout1<0) GameDebug.LogError(Game._INTL("Player 1 has no unfainted Pokémon")); //throw new Exception(Game._INTL("Player 1 has no unfainted Pokémon"));
- sendout2=pbFindNextUnfainted(@party1,pbSecondPartyBegin(0));
+ sendout2=FindNextUnfainted(@party1,SecondPartyBegin(0));
if (sendout2<0) GameDebug.LogError(Game._INTL("Player 2 has no unfainted Pokémon")); //throw new Exception(Game._INTL("Player 2 has no unfainted Pokémon"));
- @battlers[0].pbInitialize(@party1[sendout1],(sbyte)sendout1,false);
- @battlers[2].pbInitialize(@party1[sendout2],(sbyte)sendout2,false);
- pbDisplayBrief(Game._INTL("{1} sent\r\nout {2}! Go! {3}!",
- @player[1].name,@battlers[2].Name,@battlers[0].Name));
- pbSetSeen(@party1[sendout1]);
- pbSetSeen(@party1[sendout2]);
+ _battlers[0].Initialize(@party1[sendout1],(sbyte)sendout1,false);
+ _battlers[2].Initialize(@party1[sendout2],(sbyte)sendout2,false);
+ DisplayBrief(Game._INTL("{1} sent\r\nout {2}! Go! {3}!",
+ @player[1].name,_battlers[2].Name,_battlers[0].Name));
+ SetSeen(@party1[sendout1]);
+ SetSeen(@party1[sendout2]);
}
else {
- sendout1=pbFindNextUnfainted(@party1,0);
- sendout2=pbFindNextUnfainted(@party1,sendout1+1);
+ sendout1=FindNextUnfainted(@party1,0);
+ sendout2=FindNextUnfainted(@party1,sendout1+1);
if (sendout1<0 || sendout2<0) {
//throw new Exception(Game._INTL("Player doesn't have two unfainted Pokémon"));
GameDebug.LogError(Game._INTL("Player doesn't have two unfainted Pokémon"));
}
- @battlers[0].pbInitialize(@party1[sendout1],(sbyte)sendout1,false);
- @battlers[2].pbInitialize(@party1[sendout2],(sbyte)sendout2,false);
- pbDisplayBrief(Game._INTL("Go! {1} and {2}!",@battlers[0].Name,@battlers[2].Name));
+ _battlers[0].Initialize(@party1[sendout1],(sbyte)sendout1,false);
+ _battlers[2].Initialize(@party1[sendout2],(sbyte)sendout2,false);
+ DisplayBrief(Game._INTL("Go! {1} and {2}!",_battlers[0].Name,_battlers[2].Name));
}
- pbSendOut(0,@party1[sendout1]);
- pbSendOut(2,@party1[sendout2]);
+ SendOut(0,@party1[sendout1]);
+ SendOut(2,@party1[sendout2]);
}
#endregion
#region Initialize player in single battles
else {
- int sendout=pbFindNextUnfainted(@party1,0);
+ int sendout=FindNextUnfainted(@party1,0);
if (sendout<0) {
//throw new Exception(Game._INTL("Player has no unfainted Pokémon"));
GameDebug.LogError(Game._INTL("Player has no unfainted Pokémon"));
}
- @battlers[0].pbInitialize(@party1[sendout],(sbyte)sendout,false);
- pbDisplayBrief(Game._INTL("Go! {1}!",@battlers[0].Name));
- pbSendOut(0,@party1[sendout]);
+ _battlers[0].Initialize(@party1[sendout],(sbyte)sendout,false);
+ DisplayBrief(Game._INTL("Go! {1}!",_battlers[0].Name));
+ SendOut(0,@party1[sendout]);
}
#endregion
#region Initialize battle
if (@weather==Weather.SUNNYDAY) {
- pbCommonAnimation("Sunny",null,null);
- pbDisplay(Game._INTL("The sunlight is strong."));
+ CommonAnimation("Sunny",null,null);
+ Display(Game._INTL("The sunlight is strong."));
}
else if (@weather==Weather.RAINDANCE) {
- pbCommonAnimation("Rain",null,null);
- pbDisplay(Game._INTL("It is raining."));
+ CommonAnimation("Rain",null,null);
+ Display(Game._INTL("It is raining."));
}
else if (@weather==Weather.SANDSTORM) {
- pbCommonAnimation("Sandstorm",null,null);
- pbDisplay(Game._INTL("A sandstorm is raging."));
+ CommonAnimation("Sandstorm",null,null);
+ Display(Game._INTL("A sandstorm is raging."));
}
else if (@weather==Weather.HAIL) {
- pbCommonAnimation("Hail",null,null);
- pbDisplay(Game._INTL("Hail is falling."));
+ CommonAnimation("Hail",null,null);
+ Display(Game._INTL("Hail is falling."));
}
else if (@weather==Weather.HEAVYRAIN) {
- pbCommonAnimation("HeavyRain",null,null);
- pbDisplay(Game._INTL("It is raining heavily."));
+ CommonAnimation("HeavyRain",null,null);
+ Display(Game._INTL("It is raining heavily."));
}
else if (@weather==Weather.HARSHSUN) {
- pbCommonAnimation("HarshSun",null,null);
- pbDisplay(Game._INTL("The sunlight is extremely harsh."));
+ CommonAnimation("HarshSun",null,null);
+ Display(Game._INTL("The sunlight is extremely harsh."));
}
else if (@weather==Weather.STRONGWINDS) {
- pbCommonAnimation("StrongWinds",null,null);
- pbDisplay(Game._INTL("The wind is strong."));
+ CommonAnimation("StrongWinds",null,null);
+ Display(Game._INTL("The wind is strong."));
}
- pbOnActiveAll(); // Abilities
+ OnActiveAll(); // Abilities
@turncount=0;
#endregion
#region Battle-Sequence Loop
@@ -3084,30 +3088,30 @@ public void pbStartBattleCore(bool canlose) {
GameDebug.Log($"");
GameDebug.Log($"***Round #{@turncount+1}***");
if (@debug && @turncount>=100) {
- @decision=pbDecisionOnTime();
+ @decision=DecisionOnTime();
GameDebug.Log($"");
GameDebug.Log($"***Undecided after 100 rounds, aborting***");
- pbAbort();
+ Abort();
break;
}
//try
//{
- //PBDebug.logonerr{
- pbCommandPhase();
+ //Debug.logonerr{
+ CommandPhase();
//}
if (@decision>0) break;
- //PBDebug.logonerr{
- pbAttackPhase();
+ //Debug.logonerr{
+ AttackPhase();
//}
if (@decision>0) break;
- //PBDebug.logonerr{
- pbEndOfRoundPhase();
+ //Debug.logonerr{
+ EndOfRoundPhase();
//}
//}
//catch (BattleAbortedException ex)
//{
// GameDebug.Log(ex.ToString());
- // pbAbort();
+ // Abort();
// break;
//}
//catch (Exception ex)
@@ -3118,31 +3122,31 @@ public void pbStartBattleCore(bool canlose) {
@turncount+=1;
} while (this.decision == BattleResults.InProgress); //while (true);
#endregion
- pbEndOfBattle(canlose);
+ EndOfBattle(canlose);
}
#endregion
#region Command phase.
- public virtual MenuCommands pbCommandMenu(int i) {
- return (MenuCommands)(@scene as IPokeBattle_SceneNonInteractive).pbCommandMenu(i);
+ public virtual MenuCommands CommandMenu(int i) {
+ return (MenuCommands)(@scene as IPokeBattle_SceneNonInteractive).CommandMenu(i);
}
- public virtual KeyValuePair pbItemMenu(int i) {
- //return (@scene as IPokeBattle_SceneNonInteractive).pbItemMenu(i);
+ public virtual KeyValuePair ItemMenu(int i) {
+ //return (@scene as IPokeBattle_SceneNonInteractive).ItemMenu(i);
//Returns from UI the Selected item, and the target for the item's usage
- return new KeyValuePair((@scene as IPokeBattle_SceneNonInteractive).pbItemMenu(i), null);
+ return new KeyValuePair((@scene as IPokeBattle_SceneNonInteractive).ItemMenu(i), null);
}
- public virtual bool pbAutoFightMenu(int i) {
+ public virtual bool AutoFightMenu(int i) {
return false;
}
- public virtual void pbCommandPhase() {
- if (@scene is IPokeBattle_DebugSceneNoGraphics s0) s0.pbBeginCommandPhase();
- if (@scene is IPokeBattle_Scene s1) s1.pbResetCommandIndices();
+ public virtual void CommandPhase() {
+ if (@scene is IPokeBattle_DebugSceneNoGraphics s0) s0.BeginCommandPhase();
+ if (@scene is IPokeBattle_Scene s1) s1.ResetCommandIndices();
for (int i = 0; i < battlers.Length; i++) { // Reset choices if commands can be shown
- @battlers[i].effects.SkipTurn=false;
- if (CanShowCommands(i) || @battlers[i].isFainted()) {
+ _battlers[i].effects.SkipTurn=false;
+ if (CanShowCommands(i) || _battlers[i].isFainted()) {
//@choices[i][0]=0;
//@choices[i][1]=0;
//@choices[i][2]=null;
@@ -3150,8 +3154,8 @@ public virtual void pbCommandPhase() {
@choices[i]=new Choice(ChoiceAction.NoAction);
}
else {
- if (@doublebattle && !pbIsDoubleBattler(i)) {
- GameDebug.Log($"[Reusing commands] #{@battlers[i].ToString(true)}");
+ if (@doublebattle && !IsDoubleBattler(i)) {
+ GameDebug.Log($"[Reusing commands] #{_battlers[i].ToString(true)}");
}
}
}
@@ -3163,10 +3167,10 @@ public virtual void pbCommandPhase() {
}
for (int i = 0; i < battlers.Length; i++) {
if (@decision==0) break;
- if (@choices[i].Action!=0) continue; //@choices[i][0]!=0
- if (!pbOwnedByPlayer(i) || @controlPlayer) {
- if (!@battlers[i].isFainted() && CanShowCommands(i)) {
- (@scene as IPokeBattle_SceneNonInteractive).pbChooseEnemyCommand(i);
+ if (@choices[i]?.Action!=0) continue; //@choices[i][0]!=0
+ if (!OwnedByPlayer(i) || @controlPlayer) {
+ if (!_battlers[i].isFainted() && CanShowCommands(i)) {
+ (@scene as IPokeBattle_SceneNonInteractive).ChooseEnemyCommand(i);
}
}
else {
@@ -3174,37 +3178,37 @@ public virtual void pbCommandPhase() {
//bool commandEnd=false;
if (CanShowCommands(i)) {
do { //loop
- MenuCommands cmd=pbCommandMenu(i);
+ MenuCommands cmd=CommandMenu(i);
if (cmd==MenuCommands.FIGHT) { // Fight
if (CanShowFightMenu(i)) {
- if (pbAutoFightMenu(i)) commandDone=true;
+ if (AutoFightMenu(i)) commandDone=true;
do {
- int index=(@scene as IPokeBattle_SceneNonInteractive).pbFightMenu(i);
+ int index=(@scene as IPokeBattle_SceneNonInteractive).FightMenu(i);
if (index<0) {
- int side=(pbIsOpposing(i)) ? 1 : 0;
- int owner=pbGetOwnerIndex(i);
+ int side=(IsOpposing(i)) ? 1 : 0;
+ int owner=GetOwnerIndex(i);
if (@megaEvolution[side][owner]==i) {
@megaEvolution[side][owner]=-1;
}
break;
}
- if (!pbRegisterMove(i,index)) continue;
+ if (!RegisterMove(i,index)) continue;
if (@doublebattle) {
- IBattleMove thismove=@battlers[i].moves[index];
- //Attack.Target target=@battlers[i].pbTarget(thismove);
- Attack.Data.Targets targets=@battlers[i].pbTarget(thismove);
+ IBattleMove thismove=_battlers[i].moves[index];
+ //Attack.Target target=_battlers[i].Target(thismove);
+ Attack.Data.Targets targets=_battlers[i].Target(thismove);
//if (target==Attack.Target.SingleNonUser) { // single non-user
if (targets==Attack.Data.Targets.SELECTED_POKEMON || // single non-user
targets==Attack.Data.Targets.SELECTED_POKEMON_ME_FIRST) {
- int target=(@scene as IPokeBattle_SceneNonInteractive).pbChooseTarget(i,targets);
+ int target=(@scene as IPokeBattle_SceneNonInteractive).ChooseTarget(i,targets);
if (target<0) continue;
- pbRegisterTarget(i,target);
+ RegisterTarget(i,target);
}
//else if (target==Attack.Target.UserOrPartner) { // Acupressure
else if (targets==Attack.Data.Targets.USER_OR_ALLY) { // Acupressure
- int target=(@scene as IPokeBattle_SceneNonInteractive).pbChooseTarget(i,targets);
+ int target=(@scene as IPokeBattle_SceneNonInteractive).ChooseTarget(i,targets);
if (target<0 || (target%2)==1) continue; //no choice or enemy
- pbRegisterTarget(i,target);
+ RegisterTarget(i,target);
}
//ToDo: Else... random selected pokemon (not target select, but still register target)
}
@@ -3212,57 +3216,57 @@ public virtual void pbCommandPhase() {
} while (!commandDone);
}
else {
- pbAutoChooseMove(i);
+ AutoChooseMove(i);
commandDone=true;
}
}
- else if (cmd!=MenuCommands.FIGHT && @battlers[i].effects.SkyDrop) {
- pbDisplay(Game._INTL("Sky Drop won't let {1} go!",@battlers[i].ToString(true)));
+ else if (cmd!=MenuCommands.FIGHT && _battlers[i].effects.SkyDrop) {
+ Display(Game._INTL("Sky Drop won't let {1} go!",_battlers[i].ToString(true)));
}
else if (cmd==MenuCommands.BAG) { // Bag
if (!@internalbattle) {
- if (pbOwnedByPlayer(i)) {
- pbDisplay(Game._INTL("Items can't be used here."));
+ if (OwnedByPlayer(i)) {
+ Display(Game._INTL("Items can't be used here."));
}
}
else {
- KeyValuePair item=pbItemMenu(i);
+ KeyValuePair item=ItemMenu(i);
if (item.Key>0) {
- if (pbRegisterItem(i,(Items)item.Key,item.Value)) {
+ if (RegisterItem(i,(Items)item.Key,item.Value)) {
commandDone=true;
}
}
}
}
else if (cmd==MenuCommands.POKEMON) { // Pokémon
- int pkmn=pbSwitchPlayer(i,false,true);
+ int pkmn=SwitchPlayer(i,false,true);
if (pkmn>=0) {
- if (pbRegisterSwitch(i,pkmn)) commandDone=true;
+ if (RegisterSwitch(i,pkmn)) commandDone=true;
}
}
else if (cmd==MenuCommands.RUN) { // Run
- int run=pbRun(i);
+ int run=Run(i);
if (run>0) {
commandDone=true;
return;
}
else if (run<0) {
commandDone=true;
- int side=(pbIsOpposing(i)) ? 1 : 0;
- int owner=pbGetOwnerIndex(i);
+ int side=(IsOpposing(i)) ? 1 : 0;
+ int owner=GetOwnerIndex(i);
if (@megaEvolution[side][owner]==i) {
@megaEvolution[side][owner]=-1;
}
}
}
else if (cmd==MenuCommands.CALL) { // Call
- IBattler thispkmn=@battlers[i];
+ IBattler thispkmn=_battlers[i];
//@choices[i][0]=4; // "Call Pokémon"
//@choices[i][1]=0;
//@choices[i][2]=null;
@choices[i]=new Choice(ChoiceAction.CallPokemon);
- int side=(pbIsOpposing(i)) ? 1 : 0;
- int owner=pbGetOwnerIndex(i);
+ int side=(IsOpposing(i)) ? 1 : 0;
+ int owner=GetOwnerIndex(i);
if (@megaEvolution[side][owner]==i) {
@megaEvolution[side][owner]=-1;
}
@@ -3272,11 +3276,11 @@ public virtual void pbCommandPhase() {
if (@megaEvolution[0][0]>=0) @megaEvolution[0][0]=-1;
if (@megaEvolution[1][0]>=0) @megaEvolution[1][0]=-1;
// Restore the item the player's first Pokémon was due to use
- //if (@choices[0][0]==3 && Game.GameData.Bag && Game.GameData.Bag.pbCanStore(@choices[0][1])) {
- if (@choices[0].Action==ChoiceAction.UseItem && Game.GameData.Bag != null && Game.GameData.Bag.pbCanStore((Items)@choices[0].Index)) {
- Game.GameData.Bag.pbStoreItem((Items)@choices[0].Index); //@choices[0][1]
+ //if (@choices[0][0]==3 && Game.GameData.Bag && Game.GameData.Bag.CanStore(@choices[0][1])) {
+ if (@choices[0].Action==ChoiceAction.UseItem && Game.GameData.Bag != null && Game.GameData.Bag.CanStore((Items)@choices[0].Index)) {
+ Game.GameData.Bag.StoreItem((Items)@choices[0].Index); //@choices[0][1]
}
- pbCommandPhase();
+ CommandPhase();
return;
}
if (commandDone) break;
@@ -3288,74 +3292,74 @@ public virtual void pbCommandPhase() {
#endregion
#region Attack phase.
- public void pbAttackPhase() {
- if (@scene is IPokeBattle_DebugSceneNoGraphics s0) s0.pbBeginAttackPhase();
+ public void AttackPhase() {
+ if (@scene is IPokeBattle_DebugSceneNoGraphics s0) s0.BeginAttackPhase();
for (int i = 0; i < battlers.Length; i++) {
@successStates[i].Clear();
- if (@choices[i].Action!= ChoiceAction.UseMove && @choices[i].Action!=ChoiceAction.SwitchPokemon) {
- @battlers[i].effects.DestinyBond=false;
- @battlers[i].effects.Grudge=false;
+ if (@choices[i]?.Action!= ChoiceAction.UseMove && @choices[i]?.Action!=ChoiceAction.SwitchPokemon) {
+ _battlers[i].effects.DestinyBond=false;
+ _battlers[i].effects.Grudge=false;
}
- if (!@battlers[i].isFainted()) @battlers[i].turncount+=1;
- if (!pbChoseMove(i,Moves.RAGE)) @battlers[i].effects.Rage=false;
+ if (!_battlers[i].isFainted()) _battlers[i].turncount+=1;
+ if (!ChoseMove(i,Moves.RAGE)) _battlers[i].effects.Rage=false;
}
// Calculate priority at this time
@usepriority=false;
- priority=pbPriority(false,true);
+ _priority=Priority(false,true);
// Mega Evolution
List megaevolved=new List();
foreach (var i in priority) {
- if (@choices[i.Index].Action==ChoiceAction.UseMove && !i.effects.SkipTurn) {
- int side=(pbIsOpposing(i.Index)) ? 1 : 0;
- int owner=pbGetOwnerIndex(i.Index);
+ if (@choices[i.Index]?.Action==ChoiceAction.UseMove && !i.effects.SkipTurn) {
+ int side=(IsOpposing(i.Index)) ? 1 : 0;
+ int owner=GetOwnerIndex(i.Index);
if (@megaEvolution[side][owner]==i.Index) { //@megaEvolution[side][owner]
- //pbMegaEvolve(i.Index);
+ //MegaEvolve(i.Index);
megaevolved.Add(i.Index);
}
}
}
if (megaevolved.Count>0) {
foreach (var i in priority) {
- if (megaevolved.Contains(i.Index)) i.pbAbilitiesOnSwitchIn(true);
+ if (megaevolved.Contains(i.Index)) i.AbilitiesOnSwitchIn(true);
}
}
// Call at Pokémon
foreach (var i in priority) {
- if (@choices[i.Index].Action==ChoiceAction.CallPokemon && !i.effects.SkipTurn) {
- pbCall(i.Index);
+ if (@choices[i.Index]?.Action==ChoiceAction.CallPokemon && !i.effects.SkipTurn) {
+ Call(i.Index);
}
}
// Switch out Pokémon
@switching=true;
List switched=new List();
foreach (var i in priority) {
- if (@choices[i.Index].Action==ChoiceAction.SwitchPokemon && !i.effects.SkipTurn) {
+ if (@choices[i.Index]?.Action==ChoiceAction.SwitchPokemon && !i.effects.SkipTurn) {
int index=@choices[i.Index].Index; // party position of Pokémon to switch to
int newpokename=index;
- if (pbParty(i.Index)[index].Ability == Abilities.ILLUSION) {
- newpokename=pbGetLastPokeInTeam(i.Index);
+ if (Party(i.Index)[index].Ability == Abilities.ILLUSION) {
+ newpokename=GetLastPokeInTeam(i.Index);
}
this.lastMoveUser=i.Index;
- if (!pbOwnedByPlayer(i.Index)) {
- ITrainer owner=pbGetOwner(i.Index);
- pbDisplayBrief(Game._INTL("{1} withdrew {2}!",owner.name,i.Name));
+ if (!OwnedByPlayer(i.Index)) {
+ ITrainer owner=GetOwner(i.Index);
+ DisplayBrief(Game._INTL("{1} withdrew {2}!",owner.name,i.Name));
GameDebug.Log($"[Withdrew Pokémon] Opponent withdrew #{i.ToString(true)}");
}
else {
- pbDisplayBrief(Game._INTL("{1}, that's enough!\r\nCome back!",i.Name));
+ DisplayBrief(Game._INTL("{1}, that's enough!\r\nCome back!",i.Name));
GameDebug.Log($"[Withdrew Pokémon] Player withdrew #{i.ToString(true)}");
}
foreach (var j in priority) {
- if (!i.pbIsOpposing(j.Index)) continue;
+ if (!i.IsOpposing(j.Index)) continue;
// if Pursuit and this target ("i") was chosen
- if (pbChoseMoveFunctionCode(j.Index,Attack.Data.Effects.x081) && // Pursuit
+ if (ChoseMoveFunctionCode(j.Index,Attack.Data.Effects.x081) && // Pursuit
!j.hasMovedThisRound()) {
if (j.Status!=Status.SLEEP && j.Status!=Status.FROZEN &&
!j.effects.SkyDrop &&
(!j.hasWorkingAbility(Abilities.TRUANT) || !j.effects.Truant)) {
//@choices[j.Index].Target=i.Index; // Make sure to target the switching Pokémon
@choices[j.Index]=new Choice(@choices[j.Index].Action, @choices[j.Index].Index, @choices[j.Index].Move, target: i.Index); // Make sure to target the switching Pokémon
- j.pbUseMove(@choices[j.Index]); // This calls pbGainEXP as appropriate
+ j.UseMove(@choices[j.Index]); // This calls GainEXP as appropriate
j.effects.Pursuit=true;
@switching=false;
if (@decision>0) return;
@@ -3363,7 +3367,7 @@ public void pbAttackPhase() {
}
if (i.isFainted()) break;
}
- if (!pbRecallAndReplace(i.Index,index,newpokename)) {
+ if (!RecallAndReplace(i.Index,index,newpokename)) {
// If a forced switch somehow occurs here in single battles
// the attack phase now ends
if (!@doublebattle) {
@@ -3378,16 +3382,16 @@ public void pbAttackPhase() {
}
if (switched.Count>0) {
foreach (var i in priority) {
- if (switched.Contains(i.Index)) i.pbAbilitiesOnSwitchIn(true);
+ if (switched.Contains(i.Index)) i.AbilitiesOnSwitchIn(true);
}
}
@switching=false;
// Use items
foreach (var i in priority) {
- if (@choices[i.Index].Action== ChoiceAction.UseItem && !i.effects.SkipTurn) {
- if (pbIsOpposing(i.Index)) {
+ if (@choices[i.Index]?.Action==ChoiceAction.UseItem && !i.effects.SkipTurn) {
+ if (IsOpposing(i.Index)) {
// Opponent use item
- pbEnemyUseItem((Items)@choices[i.Index].Index,i);
+ EnemyUseItem((Items)@choices[i.Index].Index,i);
}
else {
// Player use item
@@ -3397,12 +3401,12 @@ public void pbAttackPhase() {
int usetype=0;//Kernal.ItemData[item].Flags.[Core.ITEMBATTLEUSE]; //AIs can use items?
if (usetype==1 || usetype==3) {
if (@choices[i.Index].Target>=0) { //@choices[i.Index][2]
- pbUseItemOnPokemon(item,@choices[i.Index].Target,i,@scene);
+ UseItemOnPokemon(item,@choices[i.Index].Target,i,@scene);
}
}
else if (usetype==2 || usetype==4) {
if (!ItemHandlers.hasUseInBattle(item)) { // Poké Ball/Poké Doll used already
- pbUseItemOnBattler(item,@choices[i.Index].Target,i,@scene);
+ UseItemOnBattler(item,@choices[i.Index].Target,i,@scene);
}
}
}
@@ -3412,9 +3416,9 @@ public void pbAttackPhase() {
// Use attacks
foreach (var i in priority) {
if (i.effects.SkipTurn) continue;
- if (pbChoseMoveFunctionCode(i.Index,Attack.Data.Effects.x0AB)) { // Focus Punch
- pbCommonAnimation("FocusPunch",i,null);
- pbDisplay(Game._INTL("{1} is tightening its focus!",i.ToString()));
+ if (ChoseMoveFunctionCode(i.Index,Attack.Data.Effects.x0AB)) { // Focus Punch
+ CommonAnimation("FocusPunch",i,null);
+ Display(Game._INTL("{1} is tightening its focus!",i.ToString()));
}
}
int n = 0; do { //10.times
@@ -3423,7 +3427,7 @@ public void pbAttackPhase() {
foreach (var i in priority) {
if (!i.effects.MoveNext) continue;
if (i.hasMovedThisRound() || i.effects.SkipTurn) continue;
- advance=i.pbProcessTurn(@choices[i.Index]);
+ advance=i.ProcessTurn(@choices[i.Index]);
if (advance) break;
}
if (@decision>0) return;
@@ -3432,7 +3436,7 @@ public void pbAttackPhase() {
foreach (var i in priority) {
if (i.effects.Quash) continue;
if (i.hasMovedThisRound() || i.effects.SkipTurn) continue;
- advance=i.pbProcessTurn(@choices[i.Index]);
+ advance=i.ProcessTurn(@choices[i.Index]);
if (advance) break;
}
if (@decision>0) return;
@@ -3441,66 +3445,66 @@ public void pbAttackPhase() {
foreach (var i in priority) {
if (!i.effects.Quash) continue;
if (i.hasMovedThisRound() || i.effects.SkipTurn) continue;
- advance=i.pbProcessTurn(@choices[i.Index]);
+ advance=i.ProcessTurn(@choices[i.Index]);
if (advance) break;
}
if (@decision>0) return;
if (advance) continue;
// Check for all done
foreach (var i in priority) {
- if (@choices[i.Index].Action== ChoiceAction.UseMove && !i.hasMovedThisRound() &&
+ if (@choices[i.Index]?.Action==ChoiceAction.UseMove && !i.hasMovedThisRound() &&
!i.effects.SkipTurn) advance=true;
if (advance) break;
}
if (advance) continue;
n++;//break;
} while (n < 10);
- if (Game.GameData is IGameField f) f.pbWait(20);
+ if (Game.GameData is IGameField f) f.Wait(20);
}
#endregion
#region End of round.
- //private void _pbEndOfRoundPhase() {
- void IBattle.pbEndOfRoundPhase() {
+ //protected void _EndOfRoundPhase() {
+ void IBattle.EndOfRoundPhase() {
GameDebug.Log($"[End of round]");
for (int i = 0; i < battlers.Length; i++) {
- @battlers[i].effects.Electrify=false;
- @battlers[i].effects.Endure=false;
- @battlers[i].effects.FirstPledge=0;
- if (@battlers[i].effects.HyperBeam>0) @battlers[i].effects.HyperBeam-=1;
- @battlers[i].effects.KingsShield=false;
- @battlers[i].effects.LifeOrb=false;
- @battlers[i].effects.MoveNext=false;
- @battlers[i].effects.Powder=false;
- @battlers[i].effects.Protect=false;
- @battlers[i].effects.ProtectNegation=false;
- @battlers[i].effects.Quash=false;
- @battlers[i].effects.Roost=false;
- @battlers[i].effects.SpikyShield=false;
+ _battlers[i].effects.Electrify=false;
+ _battlers[i].effects.Endure=false;
+ _battlers[i].effects.FirstPledge=0;
+ if (_battlers[i].effects.HyperBeam>0) _battlers[i].effects.HyperBeam-=1;
+ _battlers[i].effects.KingsShield=false;
+ _battlers[i].effects.LifeOrb=false;
+ _battlers[i].effects.MoveNext=false;
+ _battlers[i].effects.Powder=false;
+ _battlers[i].effects.Protect=false;
+ _battlers[i].effects.ProtectNegation=false;
+ _battlers[i].effects.Quash=false;
+ _battlers[i].effects.Roost=false;
+ _battlers[i].effects.SpikyShield=false;
}
@usepriority=false; // recalculate priority
- priority=pbPriority(true); // Ignoring Quick Claw here
+ _priority=Priority(true); // Ignoring Quick Claw here
// Weather
switch (@weather) {
case Weather.SUNNYDAY:
if (@weatherduration>0) @weatherduration=@weatherduration-1;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The sunlight faded."));
+ Display(Game._INTL("The sunlight faded."));
@weather=0;
GameDebug.Log($"[End of effect] Sunlight weather ended");
}
else {
- pbCommonAnimation("Sunny",null,null);
- pbDisplay(Game._INTL("The sunlight is strong."));
- if (pbWeather==Weather.SUNNYDAY) {
+ CommonAnimation("Sunny",null,null);
+ Display(Game._INTL("The sunlight is strong."));
+ if (Weather==Weather.SUNNYDAY) {
foreach (var i in priority) {
if (i.hasWorkingAbility(Abilities.SOLAR_POWER)) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Solar Power");
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(i,0);
- i.pbReduceHP((int)Math.Floor(i.TotalHP/8f));
- pbDisplay(Game._INTL("{1} was hurt by the sunlight!",i.ToString()));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(i,0);
+ i.ReduceHP((int)Math.Floor(i.TotalHP/8f));
+ Display(Game._INTL("{1} was hurt by the sunlight!",i.ToString()));
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
}
@@ -3510,30 +3514,30 @@ void IBattle.pbEndOfRoundPhase() {
case Weather.RAINDANCE:
if (@weatherduration>0) @weatherduration=@weatherduration-1;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The rain stopped."));
+ Display(Game._INTL("The rain stopped."));
@weather=0;
GameDebug.Log($"[End of effect] Rain weather ended");
}
else {
- pbCommonAnimation("Rain",null,null);
- pbDisplay(Game._INTL("Rain continues to fall."));
+ CommonAnimation("Rain",null,null);
+ Display(Game._INTL("Rain continues to fall."));
}
break;
case Weather.SANDSTORM:
if (@weatherduration>0) @weatherduration=@weatherduration-1;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The sandstorm subsided."));
+ Display(Game._INTL("The sandstorm subsided."));
@weather=0;
GameDebug.Log($"[End of effect] Sandstorm weather ended");
}
else {
- pbCommonAnimation("Sandstorm",null,null);
- pbDisplay(Game._INTL("The sandstorm rages."));
- if (pbWeather==Weather.SANDSTORM) {
+ CommonAnimation("Sandstorm",null,null);
+ Display(Game._INTL("The sandstorm rages."));
+ if (Weather==Weather.SANDSTORM) {
GameDebug.Log($"[Lingering effect triggered] Sandstorm weather damage");
foreach (var i in priority) {
if (i.isFainted()) continue;
- if (!i.pbHasType(Types.GROUND) && !i.pbHasType(Types.ROCK) && !i.pbHasType(Types.STEEL) &&
+ if (!i.HasType(Types.GROUND) && !i.HasType(Types.ROCK) && !i.HasType(Types.STEEL) &&
!i.hasWorkingAbility(Abilities.SAND_VEIL) &&
!i.hasWorkingAbility(Abilities.SAND_RUSH) &&
!i.hasWorkingAbility(Abilities.SAND_FORCE) &&
@@ -3544,11 +3548,11 @@ void IBattle.pbEndOfRoundPhase() {
Attack.Data.Effects.x101, // Dig
Attack.Data.Effects.x100 // Dive
}.Contains(Kernal.MoveData[i.effects.TwoTurnAttack].Effect)) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(i,0);
- i.pbReduceHP((int)Math.Floor(i.TotalHP/16f));
- pbDisplay(Game._INTL("{1} is buffeted by the sandstorm!",i.ToString()));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(i,0);
+ i.ReduceHP((int)Math.Floor(i.TotalHP/16f));
+ Display(Game._INTL("{1} is buffeted by the sandstorm!",i.ToString()));
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
}
@@ -3558,29 +3562,29 @@ void IBattle.pbEndOfRoundPhase() {
case Weather.HAIL:
if (@weatherduration>0) @weatherduration=@weatherduration-1;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The hail stopped."));
+ Display(Game._INTL("The hail stopped."));
@weather=0;
GameDebug.Log($"[End of effect] Hail weather ended");
}
else {
- pbCommonAnimation("Hail",null,null);
- pbDisplay(Game._INTL("Hail continues to fall."));
- if (pbWeather==Weather.HAIL) {
+ CommonAnimation("Hail",null,null);
+ Display(Game._INTL("Hail continues to fall."));
+ if (Weather==Weather.HAIL) {
GameDebug.Log($"[Lingering effect triggered] Hail weather damage");
foreach (var i in priority) {
if (i.isFainted()) continue;
- if (!i.pbHasType(Types.ICE) &&
+ if (!i.HasType(Types.ICE) &&
!i.hasWorkingAbility(Abilities.ICE_BODY) &&
!i.hasWorkingAbility(Abilities.SNOW_CLOAK) &&
!i.hasWorkingAbility(Abilities.MAGIC_GUARD) &&
!i.hasWorkingAbility(Abilities.OVERCOAT) &&
!i.hasWorkingItem(Items.SAFETY_GOGGLES) &&
!new int[] { 0xCA,0xCB }.Contains((int)Kernal.MoveData[i.effects.TwoTurnAttack].Effect)) { // Dig, Dive
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(i,0);
- i.pbReduceHP((int)Math.Floor(i.TotalHP/16f));
- pbDisplay(Game._INTL("{1} is buffeted by the hail!",i.ToString()));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(i,0);
+ i.ReduceHP((int)Math.Floor(i.TotalHP/16f));
+ Display(Game._INTL("{1} is buffeted by the hail!",i.ToString()));
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
}
@@ -3590,46 +3594,46 @@ void IBattle.pbEndOfRoundPhase() {
case Weather.HEAVYRAIN:
bool hasabil=false;
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].Ability == Abilities.PRIMORDIAL_SEA && !@battlers[i].isFainted()) {
+ if (_battlers[i].Ability == Abilities.PRIMORDIAL_SEA && !_battlers[i].isFainted()) {
hasabil=true; break;
}
}
if (!hasabil) @weatherduration=0;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The heavy rain stopped."));
+ Display(Game._INTL("The heavy rain stopped."));
@weather=0;
GameDebug.Log($"[End of effect] Primordial Sea's rain weather ended");
}
else {
- pbCommonAnimation("HeavyRain",null,null);
- pbDisplay(Game._INTL("It is raining heavily."));
+ CommonAnimation("HeavyRain",null,null);
+ Display(Game._INTL("It is raining heavily."));
}
break;
case Weather.HARSHSUN:
hasabil=false;
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].Ability == Abilities.DESOLATE_LAND && !@battlers[i].isFainted()) {
+ if (_battlers[i].Ability == Abilities.DESOLATE_LAND && !_battlers[i].isFainted()) {
hasabil=true; break;
}
}
if (!hasabil) @weatherduration=0;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The harsh sunlight faded."));
+ Display(Game._INTL("The harsh sunlight faded."));
@weather=0;
GameDebug.Log($"[End of effect] Desolate Land's sunlight weather ended");
}
else {
- pbCommonAnimation("HarshSun",null,null);
- pbDisplay(Game._INTL("The sunlight is extremely harsh."));
- if (pbWeather==Weather.HARSHSUN) {
+ CommonAnimation("HarshSun",null,null);
+ Display(Game._INTL("The sunlight is extremely harsh."));
+ if (Weather==Weather.HARSHSUN) {
foreach (var i in priority) {
if (i.hasWorkingAbility(Abilities.SOLAR_POWER)) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Solar Power");
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(i,0);
- i.pbReduceHP((int)Math.Floor(i.TotalHP/8f));
- pbDisplay(Game._INTL("{1} was hurt by the sunlight!",i.ToString()));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(i,0);
+ i.ReduceHP((int)Math.Floor(i.TotalHP/8f));
+ Display(Game._INTL("{1} was hurt by the sunlight!",i.ToString()));
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
}
@@ -3639,19 +3643,19 @@ void IBattle.pbEndOfRoundPhase() {
case Weather.STRONGWINDS:
hasabil=false;
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].Ability == Abilities.DELTA_STREAM && !@battlers[i].isFainted()) {
+ if (_battlers[i].Ability == Abilities.DELTA_STREAM && !_battlers[i].isFainted()) {
hasabil=true; break;
}
}
if (!hasabil) @weatherduration=0;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The air current subsided."));
+ Display(Game._INTL("The air current subsided."));
@weather=Weather.NONE;
GameDebug.Log($"[End of effect] Delta Stream's wind weather ended");
}
else {
- pbCommonAnimation("StrongWinds",null,null);
- pbDisplay(Game._INTL("The wind is strong."));
+ CommonAnimation("StrongWinds",null,null);
+ Display(Game._INTL("The wind is strong."));
}
break;
}
@@ -3659,23 +3663,23 @@ void IBattle.pbEndOfRoundPhase() {
if (@weather == Weather.SHADOWSKY) {
if (@weatherduration>0) @weatherduration=@weatherduration-1;
if (@weatherduration==0) {
- pbDisplay(Game._INTL("The shadow sky faded."));
+ Display(Game._INTL("The shadow sky faded."));
@weather=Weather.NONE;
GameDebug.Log($"[End of effect] Shadow Sky weather ended");
}
else {
- pbCommonAnimation("ShadowSky",null,null);
- pbDisplay(Game._INTL("The shadow sky continues."));
- if (pbWeather == Weather.SHADOWSKY) {
+ CommonAnimation("ShadowSky",null,null);
+ Display(Game._INTL("The shadow sky continues."));
+ if (Weather == Weather.SHADOWSKY) {
GameDebug.Log($"[Lingering effect triggered] Shadow Sky weather damage");
foreach (var i in priority) {
if (i.isFainted()) continue;
if (i is IBattlerShadowPokemon s && !s.isShadow()) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(i,0);
- i.pbReduceHP((int)Math.Floor(i.TotalHP/16f));
- pbDisplay(Game._INTL("{1} was hurt by the shadow sky!",i.ToString()));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(i,0);
+ i.ReduceHP((int)Math.Floor(i.TotalHP/16f));
+ Display(Game._INTL("{1} was hurt by the shadow sky!",i.ToString()));
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
}
@@ -3690,28 +3694,28 @@ void IBattle.pbEndOfRoundPhase() {
if (i.effects.FutureSight==0) {
Moves move=i.effects.FutureSightMove;
GameDebug.Log($"[Lingering effect triggered] #{Game._INTL(move.ToString(TextScripts.Name))} struck #{i.ToString(true)}");
- pbDisplay(Game._INTL("{1} took the {2} attack!",i.ToString(),Game._INTL(move.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1} took the {2} attack!",i.ToString(),Game._INTL(move.ToString(TextScripts.Name))));
IBattler moveuser=null;
foreach (var j in battlers) {
- if (j.pbIsOpposing(i.effects.FutureSightUserPos)) continue;
+ if (j.IsOpposing(i.effects.FutureSightUserPos)) continue;
if (j.pokemonIndex==i.effects.FutureSightUser && !j.isFainted()) {
moveuser=j; break;
}
}
if (!moveuser.IsNotNullOrNone()) {
- IPokemon[] party=pbParty(i.effects.FutureSightUserPos);
+ IPokemon[] party=Party(i.effects.FutureSightUserPos);
if (party[i.effects.FutureSightUser].HP>0) {
moveuser=new Pokemon(this,(sbyte)i.effects.FutureSightUserPos);
- moveuser.pbInitPokemon(party[i.effects.FutureSightUser],
+ moveuser.InitPokemon(party[i.effects.FutureSightUser],
(sbyte)i.effects.FutureSightUser);
}
}
if (!moveuser.IsNotNullOrNone()) {
- pbDisplay(Game._INTL("But it failed!"));
+ Display(Game._INTL("But it failed!"));
}
else {
@futuresight=true;
- moveuser.pbUseMoveSimple(move,-1,i.Index);
+ moveuser.UseMoveSimple(move,-1,i.Index);
@futuresight=false;
}
i.effects.FutureSight=0;
@@ -3719,7 +3723,7 @@ void IBattle.pbEndOfRoundPhase() {
i.effects.FutureSightUser=-1;
i.effects.FutureSightUserPos=-1;
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
continue;
}
}
@@ -3729,36 +3733,36 @@ void IBattle.pbEndOfRoundPhase() {
if (i.isFainted()) continue;
// Rain Dish
if (i.hasWorkingAbility(Abilities.RAIN_DISH) &&
- (pbWeather==Weather.RAINDANCE ||
- pbWeather==Weather.HEAVYRAIN)) {
+ (Weather==Weather.RAINDANCE ||
+ Weather==Weather.HEAVYRAIN)) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Rain Dish");
- int hpgain=i.pbRecoverHP((int)Math.Floor(i.TotalHP/16f),true);
- if (hpgain>0) pbDisplay(Game._INTL("{1}'s {2} restored its HP a little!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ int hpgain=i.RecoverHP((int)Math.Floor(i.TotalHP/16f),true);
+ if (hpgain>0) Display(Game._INTL("{1}'s {2} restored its HP a little!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
}
// Dry Skin
if (i.hasWorkingAbility(Abilities.DRY_SKIN)) {
- if (pbWeather==Weather.RAINDANCE ||
- pbWeather==Weather.HEAVYRAIN) {
+ if (Weather==Weather.RAINDANCE ||
+ Weather==Weather.HEAVYRAIN) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Dry Skin (in rain)");
- int hpgain=i.pbRecoverHP((int)Math.Floor(i.TotalHP/8f),true);
- if (hpgain>0) pbDisplay(Game._INTL("{1}'s {2} was healed by the rain!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ int hpgain=i.RecoverHP((int)Math.Floor(i.TotalHP/8f),true);
+ if (hpgain>0) Display(Game._INTL("{1}'s {2} was healed by the rain!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
}
- else if (pbWeather==Weather.SUNNYDAY ||
- pbWeather==Weather.HARSHSUN) {
+ else if (Weather==Weather.SUNNYDAY ||
+ Weather==Weather.HARSHSUN) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Dry Skin (in sun)");
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(i,0);
- int hploss=i.pbReduceHP((int)Math.Floor(i.TotalHP/8f));
- if (hploss>0) pbDisplay(Game._INTL("{1}'s {2} was hurt by the sunlight!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(i,0);
+ int hploss=i.ReduceHP((int)Math.Floor(i.TotalHP/8f));
+ if (hploss>0) Display(Game._INTL("{1}'s {2} was hurt by the sunlight!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
}
}
// Ice Body
- if (i.hasWorkingAbility(Abilities.ICE_BODY) && pbWeather==Weather.HAIL) {
+ if (i.hasWorkingAbility(Abilities.ICE_BODY) && Weather==Weather.HAIL) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Ice Body");
- int hpgain=i.pbRecoverHP((int)Math.Floor(i.TotalHP/16f),true);
- if (hpgain>0) pbDisplay(Game._INTL("{1}'s {2} restored its HP a little!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ int hpgain=i.RecoverHP((int)Math.Floor(i.TotalHP/16f),true);
+ if (hpgain>0) Display(Game._INTL("{1}'s {2} restored its HP a little!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
}
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
// Wish
@@ -3768,10 +3772,10 @@ void IBattle.pbEndOfRoundPhase() {
i.effects.Wish-=1;
if (i.effects.Wish==0) {
GameDebug.Log($"[Lingering effect triggered] #{i.ToString()}'s Wish");
- int hpgain=i.pbRecoverHP(i.effects.WishAmount,true);
+ int hpgain=i.RecoverHP(i.effects.WishAmount,true);
if (hpgain>0) {
string wishmaker=ToString(i.Index,i.effects.WishMaker);
- pbDisplay(Game._INTL("{1}'s wish came true!",wishmaker));
+ Display(Game._INTL("{1}'s wish came true!",wishmaker));
}
}
}
@@ -3779,18 +3783,18 @@ void IBattle.pbEndOfRoundPhase() {
// Fire Pledge + Grass Pledge combination damage
for (int i = 0; i < sides.Length; i++) {
if (sides[i].SeaOfFire>0 &&
- pbWeather!=Weather.RAINDANCE &&
- pbWeather!=Weather.HEAVYRAIN) {
- if (i==0) pbCommonAnimation("SeaOfFire",null,null); //@battle.
- if (i==1) pbCommonAnimation("SeaOfFireOpp",null,null); //@battle.
+ Weather!=Weather.RAINDANCE &&
+ Weather!=Weather.HEAVYRAIN) {
+ if (i==0) CommonAnimation("SeaOfFire",null,null); //@battle.
+ if (i==1) CommonAnimation("SeaOfFireOpp",null,null); //@battle.
foreach (var j in priority) {
if ((j.Index&1)!=i) continue;
- if (j.pbHasType(Types.FIRE) || j.hasWorkingAbility(Abilities.MAGIC_GUARD)) continue;
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(j,0);
- int hploss=j.pbReduceHP((int)Math.Floor(j.TotalHP/8f));
- if (hploss>0) pbDisplay(Game._INTL("{1} is hurt by the sea of fire!",j.ToString()));
+ if (j.HasType(Types.FIRE) || j.hasWorkingAbility(Abilities.MAGIC_GUARD)) continue;
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(j,0);
+ int hploss=j.ReduceHP((int)Math.Floor(j.TotalHP/8f));
+ if (hploss>0) Display(Game._INTL("{1} is hurt by the sea of fire!",j.ToString()));
if (j.isFainted()) {
- if (!j.pbFaint()) return;
+ if (!j.Faint()) return;
}
}
}
@@ -3798,54 +3802,54 @@ void IBattle.pbEndOfRoundPhase() {
foreach (IBattler i in priority) {
if (i.isFainted()) continue;
// Shed Skin, Hydration
- if ((i.hasWorkingAbility(Abilities.SHED_SKIN) && pbRandom(10)<3) ||
- (i.hasWorkingAbility(Abilities.HYDRATION) && (pbWeather==Weather.RAINDANCE ||
- pbWeather==Weather.HEAVYRAIN))) {
+ if ((i.hasWorkingAbility(Abilities.SHED_SKIN) && Random(10)<3) ||
+ (i.hasWorkingAbility(Abilities.HYDRATION) && (Weather==Weather.RAINDANCE ||
+ Weather==Weather.HEAVYRAIN))) {
if (i.Status>0) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s #{Game._INTL(i.Ability.ToString(TextScripts.Name))}");
Status s=i.Status;
- if (i is IBattlerEffect b) b.pbCureStatus(false);
+ if (i is IBattlerEffect b) b.CureStatus(false);
switch (s) {
case Status.SLEEP:
- pbDisplay(Game._INTL("{1}'s {2} cured its sleep problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} cured its sleep problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.POISON:
- pbDisplay(Game._INTL("{1}'s {2} cured its poison problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} cured its poison problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.BURN:
- pbDisplay(Game._INTL("{1}'s {2} healed its burn!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} healed its burn!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.PARALYSIS:
- pbDisplay(Game._INTL("{1}'s {2} cured its paralysis!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} cured its paralysis!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.FROZEN:
- pbDisplay(Game._INTL("{1}'s {2} thawed it out!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} thawed it out!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
}
}
}
// Healer
- if (i.hasWorkingAbility(Abilities.HEALER) && pbRandom(10)<3) {
- IBattler partner=i.pbPartner;
+ if (i.hasWorkingAbility(Abilities.HEALER) && Random(10)<3) {
+ IBattler partner=i.Partner;
if (partner.IsNotNullOrNone() && partner.Status>0) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s #{Game._INTL(i.Ability.ToString(TextScripts.Name))}");
Status s=partner.Status;
- if (partner is IBattlerEffect b) b.pbCureStatus(false);
+ if (partner is IBattlerEffect b) b.CureStatus(false);
switch (s) {
case Status.SLEEP:
- pbDisplay(Game._INTL("{1}'s {2} cured its partner's sleep problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} cured its partner's sleep problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.POISON:
- pbDisplay(Game._INTL("{1}'s {2} cured its partner's poison problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} cured its partner's poison problem!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.BURN:
- pbDisplay(Game._INTL("{1}'s {2} healed its partner's burn!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} healed its partner's burn!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.PARALYSIS:
- pbDisplay(Game._INTL("{1}'s {2} cured its partner's paralysis!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} cured its partner's paralysis!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
case Status.FROZEN:
- pbDisplay(Game._INTL("{1}'s {2} thawed its partner out!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
+ Display(Game._INTL("{1}'s {2} thawed its partner out!",i.ToString(),Game._INTL(i.Ability.ToString(TextScripts.Name))));
break;
}
}
@@ -3855,13 +3859,13 @@ void IBattle.pbEndOfRoundPhase() {
if (i.isFainted()) continue;
// Grassy Terrain (healing)
if (@field.GrassyTerrain>0 && !i.isAirborne()) {
- int hpgain=i.pbRecoverHP((int)Math.Floor(i.TotalHP/16f),true);
- if (hpgain>0) pbDisplay(Game._INTL("{1}'s HP was restored.",i.ToString()));
+ int hpgain=i.RecoverHP((int)Math.Floor(i.TotalHP/16f),true);
+ if (hpgain>0) Display(Game._INTL("{1}'s HP was restored.",i.ToString()));
}
// Held berries/Leftovers/Black Sludge
- i.pbBerryCureCheck(true);
+ i.BerryCureCheck(true);
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
// Aqua Ring
@@ -3871,8 +3875,8 @@ void IBattle.pbEndOfRoundPhase() {
GameDebug.Log($"[Lingering effect triggered] #{i.ToString()}'s Aqua Ring");
int hpgain=(int)Math.Floor(i.TotalHP/16f);
if (i.hasWorkingItem(Items.BIG_ROOT)) hpgain=(int)Math.Floor(hpgain*1.3);
- hpgain=i.pbRecoverHP(hpgain,true);
- if (hpgain>0) pbDisplay(Game._INTL("Aqua Ring restored {1}'s HP!",i.ToString()));
+ hpgain=i.RecoverHP(hpgain,true);
+ if (hpgain>0) Display(Game._INTL("Aqua Ring restored {1}'s HP!",i.ToString()));
}
}
// Ingrain
@@ -3882,35 +3886,35 @@ void IBattle.pbEndOfRoundPhase() {
GameDebug.Log($"[Lingering effect triggered] #{i.ToString()}'s Ingrain");
int hpgain=(int)Math.Floor(i.TotalHP/16f);
if (i.hasWorkingItem(Items.BIG_ROOT)) hpgain=(int)Math.Floor(hpgain*1.3);
- hpgain=i.pbRecoverHP(hpgain,true);
- if (hpgain>0) pbDisplay(Game._INTL("{1} absorbed nutrients with its roots!",i.ToString()));
+ hpgain=i.RecoverHP(hpgain,true);
+ if (hpgain>0) Display(Game._INTL("{1} absorbed nutrients with its roots!",i.ToString()));
}
}
// Leech Seed
foreach (var i in priority) {
if (i.isFainted()) continue;
if (i.effects.LeechSeed>=0 && !i.hasWorkingAbility(Abilities.MAGIC_GUARD)) {
- IBattler recipient=@battlers[i.effects.LeechSeed];
+ IBattler recipient=_battlers[i.effects.LeechSeed];
if (recipient.IsNotNullOrNone() && !recipient.isFainted()) {
GameDebug.Log($"[Lingering effect triggered] #{i.ToString()}'s Leech Seed");
- pbCommonAnimation("LeechSeed",recipient,i);
- int hploss=i.pbReduceHP((int)Math.Floor(i.TotalHP/8f),true);
+ CommonAnimation("LeechSeed",recipient,i);
+ int hploss=i.ReduceHP((int)Math.Floor(i.TotalHP/8f),true);
if (i.hasWorkingAbility(Abilities.LIQUID_OOZE)) {
- recipient.pbReduceHP(hploss,true);
- pbDisplay(Game._INTL("{1} sucked up the liquid ooze!",recipient.ToString()));
+ recipient.ReduceHP(hploss,true);
+ Display(Game._INTL("{1} sucked up the liquid ooze!",recipient.ToString()));
}
else {
if (recipient.effects.HealBlock==0) {
if (recipient.hasWorkingItem(Items.BIG_ROOT)) hploss=(int)Math.Floor(hploss*1.3);
- recipient.pbRecoverHP(hploss,true);
+ recipient.RecoverHP(hploss,true);
}
- pbDisplay(Game._INTL("{1}'s health was sapped by Leech Seed!",i.ToString()));
+ Display(Game._INTL("{1}'s health was sapped by Leech Seed!",i.ToString()));
}
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
if (recipient.isFainted()) {
- if (!recipient.pbFaint()) return;
+ if (!recipient.Faint()) return;
}
}
}
@@ -3924,23 +3928,23 @@ void IBattle.pbEndOfRoundPhase() {
i.effects.Toxic=(int)Math.Min(15,i.effects.Toxic);
}
if (i.hasWorkingAbility(Abilities.POISON_HEAL)) {
- pbCommonAnimation("Poison",i,null);
+ CommonAnimation("Poison",i,null);
if (i.effects.HealBlock==0 && i.HP0) {
i.effects.Taunt-=1;
if (i.effects.Taunt==0) {
- pbDisplay(Game._INTL("{1}'s taunt wore off!",i.ToString()));
+ Display(Game._INTL("{1}'s taunt wore off!",i.ToString()));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer taunted");
}
}
@@ -4065,7 +4069,7 @@ void IBattle.pbEndOfRoundPhase() {
i.effects.Encore-=1;
if (i.effects.Encore==0 || i.moves[i.effects.EncoreIndex].PP==0) {
i.effects.Encore=0;
- pbDisplay(Game._INTL("{1}'s encore ended!",i.ToString()));
+ Display(Game._INTL("{1}'s encore ended!",i.ToString()));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer encored");
}
}
@@ -4078,7 +4082,7 @@ void IBattle.pbEndOfRoundPhase() {
i.effects.Disable-=1;
if (i.effects.Disable==0) {
i.effects.DisableMove=0;
- pbDisplay(Game._INTL("{1} is no longer disabled!",i.ToString()));
+ Display(Game._INTL("{1} is no longer disabled!",i.ToString()));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer disabled");
}
}
@@ -4089,7 +4093,7 @@ void IBattle.pbEndOfRoundPhase() {
if (i.effects.MagnetRise>0) {
i.effects.MagnetRise-=1;
if (i.effects.MagnetRise==0) {
- pbDisplay(Game._INTL("{1} stopped levitating.",i.ToString()));
+ Display(Game._INTL("{1} stopped levitating.",i.ToString()));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer levitating by Magnet Rise");
}
}
@@ -4100,7 +4104,7 @@ void IBattle.pbEndOfRoundPhase() {
if (i.effects.Telekinesis>0) {
i.effects.Telekinesis-=1;
if (i.effects.Telekinesis==0) {
- pbDisplay(Game._INTL("{1} stopped levitating.",i.ToString()));
+ Display(Game._INTL("{1} stopped levitating.",i.ToString()));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer levitating by Telekinesis");
}
}
@@ -4111,7 +4115,7 @@ void IBattle.pbEndOfRoundPhase() {
if (i.effects.HealBlock>0) {
i.effects.HealBlock-=1;
if (i.effects.HealBlock==0) {
- pbDisplay(Game._INTL("{1}'s Heal Block wore off!",i.ToString()));
+ Display(Game._INTL("{1}'s Heal Block wore off!",i.ToString()));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer Heal Blocked");
}
}
@@ -4122,7 +4126,7 @@ void IBattle.pbEndOfRoundPhase() {
if (i.effects.Embargo>0) {
i.effects.Embargo-=1;
if (i.effects.Embargo==0) {
- pbDisplay(Game._INTL("{1} can use items again!",i.ToString(true)));
+ Display(Game._INTL("{1} can use items again!",i.ToString(true)));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer affected by an embargo");
}
}
@@ -4132,9 +4136,9 @@ void IBattle.pbEndOfRoundPhase() {
if (i.isFainted()) continue;
if (i.effects.Yawn>0) {
i.effects.Yawn-=1;
- if (i.effects.Yawn==0 && i is IBattlerClause b0 && b0.pbCanSleepYawn()) {
+ if (i.effects.Yawn==0 && i is IBattlerClause b0 && b0.CanSleepYawn()) {
GameDebug.Log($"[Lingering effect triggered] #{i.ToString()}'s Yawn");
- if (i is IBattlerEffect b1) b1.pbSleep();
+ if (i is IBattlerEffect b1) b1.Sleep();
}
}
}
@@ -4144,26 +4148,26 @@ void IBattle.pbEndOfRoundPhase() {
if (i.isFainted()) continue;
if (i.effects.PerishSong>0) {
i.effects.PerishSong-=1;
- pbDisplay(Game._INTL("{1}'s perish count fell to {2}!",i.ToString(),i.effects.PerishSong.ToString()));
+ Display(Game._INTL("{1}'s perish count fell to {2}!",i.ToString(),i.effects.PerishSong.ToString()));
GameDebug.Log($"[Lingering effect triggered] #{i.ToString()}'s Perish Song count dropped to #{i.effects.PerishSong}");
if (i.effects.PerishSong==0) {
perishSongUsers.Add(i.effects.PerishSongUser);
- i.pbReduceHP(i.HP,true);
+ i.ReduceHP(i.HP,true);
}
}
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
if (perishSongUsers.Count>0) {
// If all remaining Pokemon fainted by a Perish Song triggered by a single side
- if ((perishSongUsers.Count(item => pbIsOpposing(item))==perishSongUsers.Count) ||
- (perishSongUsers.Count(item => !pbIsOpposing(item))==perishSongUsers.Count)) {
- pbJudgeCheckpoint(@battlers[(int)perishSongUsers[0]]);
+ if ((perishSongUsers.Count(item => IsOpposing(item))==perishSongUsers.Count) ||
+ (perishSongUsers.Count(item => !IsOpposing(item))==perishSongUsers.Count)) {
+ JudgeCheckpoint(_battlers[(int)perishSongUsers[0]]);
}
}
if (@decision>0) {
- pbGainEXP();
+ GainEXP();
return;
}
// Reflect
@@ -4171,8 +4175,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].Reflect>0) {
sides[i].Reflect-=1;
if (sides[i].Reflect==0) {
- if (i==0) pbDisplay(Game._INTL("Your team's Reflect faded!"));
- if (i==1) pbDisplay(Game._INTL("The opposing team's Reflect faded!"));
+ if (i==0) Display(Game._INTL("Your team's Reflect faded!"));
+ if (i==1) Display(Game._INTL("The opposing team's Reflect faded!"));
if (i==0) GameDebug.Log($"[End of effect] Reflect ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Reflect ended on the opponent's side");
}
@@ -4183,8 +4187,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].LightScreen>0) {
sides[i].LightScreen-=1;
if (sides[i].LightScreen==0) {
- if (i==0) pbDisplay(Game._INTL("Your team's Light Screen faded!"));
- if (i==1) pbDisplay(Game._INTL("The opposing team's Light Screen faded!"));
+ if (i==0) Display(Game._INTL("Your team's Light Screen faded!"));
+ if (i==1) Display(Game._INTL("The opposing team's Light Screen faded!"));
if (i==0) GameDebug.Log($"[End of effect] Light Screen ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Light Screen ended on the opponent's side");
}
@@ -4195,8 +4199,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].Safeguard>0) {
sides[i].Safeguard-=1;
if (sides[i].Safeguard==0) {
- if (i==0) pbDisplay(Game._INTL("Your team is no longer protected by Safeguard!"));
- if (i==1) pbDisplay(Game._INTL("The opposing team is no longer protected by Safeguard!"));
+ if (i==0) Display(Game._INTL("Your team is no longer protected by Safeguard!"));
+ if (i==1) Display(Game._INTL("The opposing team is no longer protected by Safeguard!"));
if (i==0) GameDebug.Log($"[End of effect] Safeguard ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Safeguard ended on the opponent's side");
}
@@ -4207,8 +4211,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].Mist>0) {
sides[i].Mist-=1;
if (sides[i].Mist==0) {
- if (i==0) pbDisplay(Game._INTL("Your team's Mist faded!"));
- if (i==1) pbDisplay(Game._INTL("The opposing team's Mist faded!"));
+ if (i==0) Display(Game._INTL("Your team's Mist faded!"));
+ if (i==1) Display(Game._INTL("The opposing team's Mist faded!"));
if (i==0) GameDebug.Log($"[End of effect] Mist ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Mist ended on the opponent's side");
}
@@ -4219,8 +4223,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].Tailwind>0) {
sides[i].Tailwind-=1;
if (sides[i].Tailwind==0) {
- if (i==0) pbDisplay(Game._INTL("Your team's Tailwind petered out!"));
- if (i==1) pbDisplay(Game._INTL("The opposing team's Tailwind petered out!"));
+ if (i==0) Display(Game._INTL("Your team's Tailwind petered out!"));
+ if (i==1) Display(Game._INTL("The opposing team's Tailwind petered out!"));
if (i==0) GameDebug.Log($"[End of effect] Tailwind ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Tailwind ended on the opponent's side");
}
@@ -4231,8 +4235,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].LuckyChant>0) {
sides[i].LuckyChant-=1;
if (sides[i].LuckyChant==0) {
- if (i==0) pbDisplay(Game._INTL("Your team's Lucky Chant faded!"));
- if (i==1) pbDisplay(Game._INTL("The opposing team's Lucky Chant faded!"));
+ if (i==0) Display(Game._INTL("Your team's Lucky Chant faded!"));
+ if (i==1) Display(Game._INTL("The opposing team's Lucky Chant faded!"));
if (i==0) GameDebug.Log($"[End of effect] Lucky Chant ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Lucky Chant ended on the opponent's side");
}
@@ -4243,8 +4247,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].Swamp>0) {
sides[i].Swamp-=1;
if (sides[i].Swamp==0) {
- if (i==0) pbDisplay(Game._INTL("The swamp around your team disappeared!"));
- if (i==1) pbDisplay(Game._INTL("The swamp around the opposing team disappeared!"));
+ if (i==0) Display(Game._INTL("The swamp around your team disappeared!"));
+ if (i==1) Display(Game._INTL("The swamp around the opposing team disappeared!"));
if (i==0) GameDebug.Log($"[End of effect] Grass Pledge's swamp ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Grass Pledge's swamp ended on the opponent's side");
}
@@ -4252,8 +4256,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].SeaOfFire>0) {
sides[i].SeaOfFire-=1;
if (sides[i].SeaOfFire==0) {
- if (i==0) pbDisplay(Game._INTL("The sea of fire around your team disappeared!"));
- if (i==1) pbDisplay(Game._INTL("The sea of fire around the opposing team disappeared!"));
+ if (i==0) Display(Game._INTL("The sea of fire around your team disappeared!"));
+ if (i==1) Display(Game._INTL("The sea of fire around the opposing team disappeared!"));
if (i==0) GameDebug.Log($"[End of effect] Fire Pledge's sea of fire ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Fire Pledge's sea of fire ended on the opponent's side");
}
@@ -4261,8 +4265,8 @@ void IBattle.pbEndOfRoundPhase() {
if (sides[i].Rainbow>0) {
sides[i].Rainbow-=1;
if (sides[i].Rainbow==0) {
- if (i==0) pbDisplay(Game._INTL("The rainbow around your team disappeared!"));
- if (i==1) pbDisplay(Game._INTL("The rainbow around the opposing team disappeared!"));
+ if (i==0) Display(Game._INTL("The rainbow around your team disappeared!"));
+ if (i==1) Display(Game._INTL("The rainbow around the opposing team disappeared!"));
if (i==0) GameDebug.Log($"[End of effect] Water Pledge's rainbow ended on the player's side");
if (i==1) GameDebug.Log($"[End of effect] Water Pledge's rainbow ended on the opponent's side");
}
@@ -4272,7 +4276,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.Gravity>0) {
@field.Gravity-=1;
if (@field.Gravity==0) {
- pbDisplay(Game._INTL("Gravity returned to normal."));
+ Display(Game._INTL("Gravity returned to normal."));
GameDebug.Log($"[End of effect] Strong gravity ended");
}
}
@@ -4280,7 +4284,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.TrickRoom>0) {
@field.TrickRoom-=1;
if (@field.TrickRoom==0) {
- pbDisplay(Game._INTL("The twisted dimensions returned to normal."));
+ Display(Game._INTL("The twisted dimensions returned to normal."));
GameDebug.Log($"[End of effect] Trick Room ended");
}
}
@@ -4288,7 +4292,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.WonderRoom>0) {
@field.WonderRoom-=1;
if (@field.WonderRoom==0) {
- pbDisplay(Game._INTL("Wonder Room wore off, and the Defense and Sp. public void stats returned to normal!"));
+ Display(Game._INTL("Wonder Room wore off, and the Defense and Sp. public void stats returned to normal!"));
GameDebug.Log($"[End of effect] Wonder Room ended");
}
}
@@ -4296,7 +4300,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.MagicRoom>0) {
@field.MagicRoom-=1;
if (@field.MagicRoom==0) {
- pbDisplay(Game._INTL("The area returned to normal."));
+ Display(Game._INTL("The area returned to normal."));
GameDebug.Log($"[End of effect] Magic Room ended");
}
}
@@ -4304,7 +4308,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.MudSportField>0) {
@field.MudSportField-=1;
if (@field.MudSportField==0) {
- pbDisplay(Game._INTL("The effects of Mud Sport have faded."));
+ Display(Game._INTL("The effects of Mud Sport have faded."));
GameDebug.Log($"[End of effect] Mud Sport ended");
}
}
@@ -4312,7 +4316,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.WaterSportField>0) {
@field.WaterSportField-=1;
if (@field.WaterSportField==0) {
- pbDisplay(Game._INTL("The effects of Water Sport have faded."));
+ Display(Game._INTL("The effects of Water Sport have faded."));
GameDebug.Log($"[End of effect] Water Sport ended");
}
}
@@ -4320,7 +4324,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.ElectricTerrain>0) {
@field.ElectricTerrain-=1;
if (@field.ElectricTerrain==0) {
- pbDisplay(Game._INTL("The electric current disappeared from the battlefield."));
+ Display(Game._INTL("The electric current disappeared from the battlefield."));
GameDebug.Log($"[End of effect] Electric Terrain ended");
}
}
@@ -4328,7 +4332,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.GrassyTerrain>0) {
@field.GrassyTerrain-=1;
if (@field.GrassyTerrain==0) {
- pbDisplay(Game._INTL("The grass disappeared from the battlefield."));
+ Display(Game._INTL("The grass disappeared from the battlefield."));
GameDebug.Log($"[End of effect] Grassy Terrain ended");
}
}
@@ -4336,7 +4340,7 @@ void IBattle.pbEndOfRoundPhase() {
if (@field.MistyTerrain>0) {
@field.MistyTerrain-=1;
if (@field.MistyTerrain==0) {
- pbDisplay(Game._INTL("The mist disappeared from the battlefield."));
+ Display(Game._INTL("The mist disappeared from the battlefield."));
GameDebug.Log($"[End of effect] Misty Terrain ended");
}
}
@@ -4347,17 +4351,17 @@ void IBattle.pbEndOfRoundPhase() {
foreach (var j in priority) {
if (!j.isFainted() && j.Status==Status.SLEEP && !j.hasWorkingAbility(Abilities.SOUNDPROOF)) {
GameDebug.Log($"[Lingering effect triggered] Uproar woke up #{j.ToString(true)}");
- if (j is IBattlerEffect b) b.pbCureStatus(false);
- pbDisplay(Game._INTL("{1} woke up in the uproar!",j.ToString()));
+ if (j is IBattlerEffect b) b.CureStatus(false);
+ Display(Game._INTL("{1} woke up in the uproar!",j.ToString()));
}
}
i.effects.Uproar-=1;
if (i.effects.Uproar==0) {
- pbDisplay(Game._INTL("{1} calmed down.",i.ToString()));
+ Display(Game._INTL("{1} calmed down.",i.ToString()));
GameDebug.Log($"[End of effect] #{i.ToString()} is no longer uproaring");
}
else {
- pbDisplay(Game._INTL("{1} is making an uproar!",i.ToString()));
+ Display(Game._INTL("{1} is making an uproar!",i.ToString()));
}
}
}
@@ -4366,21 +4370,21 @@ void IBattle.pbEndOfRoundPhase() {
// Speed Boost
// A Pokémon's turncount is 0 if it became active after the beginning of a round
if (i.turncount>0 && i.hasWorkingAbility(Abilities.SPEED_BOOST)) {
- if (i is IBattlerEffect b && b.pbIncreaseStatWithCause(Stats.SPEED,1,i,Game._INTL(i.Ability.ToString(TextScripts.Name)))) {
+ if (i is IBattlerEffect b && b.IncreaseStatWithCause(Stats.SPEED,1,i,Game._INTL(i.Ability.ToString(TextScripts.Name)))) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s #{Game._INTL(i.Ability.ToString(TextScripts.Name))}");
}
}
// Bad Dreams
if (i.Status==Status.SLEEP && !i.hasWorkingAbility(Abilities.MAGIC_GUARD)) {
- if (i.pbOpposing1.hasWorkingAbility(Abilities.BAD_DREAMS) ||
- i.pbOpposing2.hasWorkingAbility(Abilities.BAD_DREAMS)) {
+ if (i.Opposing1.hasWorkingAbility(Abilities.BAD_DREAMS) ||
+ i.Opposing2.hasWorkingAbility(Abilities.BAD_DREAMS)) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s opponent's Bad Dreams");
- int hploss=i.pbReduceHP((int)Math.Floor(i.TotalHP/8f),true);
- if (hploss>0) pbDisplay(Game._INTL("{1} is having a bad dream!",i.ToString()));
+ int hploss=i.ReduceHP((int)Math.Floor(i.TotalHP/8f),true);
+ if (hploss>0) Display(Game._INTL("{1} is having a bad dream!",i.ToString()));
}
}
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
continue;
}
// Pickup
@@ -4388,37 +4392,37 @@ void IBattle.pbEndOfRoundPhase() {
Items item=0; int index=-1; int use=0;
for (int j = 0; j < battlers.Length; j++) {
if (j==i.Index) continue;
- if (@battlers[j].effects.PickupUse>use) {
- item=@battlers[j].effects.PickupItem;
+ if (_battlers[j].effects.PickupUse>use) {
+ item=_battlers[j].effects.PickupItem;
index=j;
- use=@battlers[j].effects.PickupUse;
+ use=_battlers[j].effects.PickupUse;
}
}
if (item>0) {
i.Item=item;
- @battlers[index].effects.PickupItem=0;
- @battlers[index].effects.PickupUse=0;
- if (@battlers[index].pokemon.itemRecycle==item) @battlers[index].pokemon.itemRecycle=0;
+ _battlers[index].effects.PickupItem=0;
+ _battlers[index].effects.PickupUse=0;
+ if (_battlers[index].pokemon.itemRecycle==item) _battlers[index].pokemon.itemRecycle=0;
if (@opponent.Length == 0 && // In a wild battle
i.pokemon.itemInitial==0 &&
- @battlers[index].pokemon.itemInitial==item) {
+ _battlers[index].pokemon.itemInitial==item) {
i.pokemon.itemInitial=item;
- @battlers[index].pokemon.itemInitial=0;
+ _battlers[index].pokemon.itemInitial=0;
}
- pbDisplay(Game._INTL("{1} found one {2}!",i.ToString(),Game._INTL(item.ToString(TextScripts.Name))));
- i.pbBerryCureCheck(true);
+ Display(Game._INTL("{1} found one {2}!",i.ToString(),Game._INTL(item.ToString(TextScripts.Name))));
+ i.BerryCureCheck(true);
}
}
// Harvest
if (i.hasWorkingAbility(Abilities.HARVEST) && i.Item<=0 && i.pokemon.itemRecycle>0) {
- if (Kernal.ItemData[i.pokemon.itemRecycle].IsBerry && //pbIsBerry(i.itemRecycle)
- (pbWeather==Weather.SUNNYDAY ||
- pbWeather==Weather.HARSHSUN || pbRandom(10)<5)) {
+ if (ItemData.IsBerry(i.pokemon.itemRecycle) && //IsBerry(i.itemRecycle)
+ (Weather==Weather.SUNNYDAY ||
+ Weather==Weather.HARSHSUN || Random(10)<5)) {
i.Item=i.pokemon.itemRecycle;
i.pokemon.itemRecycle=0;
if (i.pokemon.itemInitial==0) i.pokemon.itemInitial=i.Item;
- pbDisplay(Game._INTL("{1} harvested one {2}!",i.ToString(),Game._INTL(i.Item.ToString(TextScripts.Name))));
- i.pbBerryCureCheck(true);
+ Display(Game._INTL("{1} harvested one {2}!",i.ToString(),Game._INTL(i.Item.ToString(TextScripts.Name))));
+ i.BerryCureCheck(true);
}
}
// Moody
@@ -4426,13 +4430,13 @@ void IBattle.pbEndOfRoundPhase() {
List randomup=new List(); List randomdown=new List();
foreach (var j in new Stats[] { Stats.ATTACK,Stats.DEFENSE,Stats.SPEED,Stats.SPATK,
Stats.SPDEF,Stats.ACCURACY,Stats.EVASION }) {
- if (i is IBattlerEffect b0 && b0.pbCanIncreaseStatStage(j,i)) randomup.Add(j);
- if (i is IBattlerEffect b1 && b1.pbCanReduceStatStage(j,i)) randomdown.Add(j);
+ if (i is IBattlerEffect b0 && b0.CanIncreaseStatStage(j,i)) randomup.Add(j);
+ if (i is IBattlerEffect b1 && b1.CanReduceStatStage(j,i)) randomdown.Add(j);
}
if (randomup.Count>0) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Moody (raise stat)");
- int r=pbRandom(randomup.Count);
- if (i is IBattlerEffect b) b.pbIncreaseStatWithCause(randomup[r],2,i,Game._INTL(i.Ability.ToString(TextScripts.Name)));
+ int r=Random(randomup.Count);
+ if (i is IBattlerEffect b) b.IncreaseStatWithCause(randomup[r],2,i,Game._INTL(i.Ability.ToString(TextScripts.Name)));
for (int j = 0; j < randomdown.Count; j++) {
if (randomdown[j]==randomup[r]) {
//randomdown[j]=null; randomdown.compact!;
@@ -4443,70 +4447,70 @@ void IBattle.pbEndOfRoundPhase() {
}
if (randomdown.Count>0) {
GameDebug.Log($"[Ability triggered] #{i.ToString()}'s Moody (lower stat)");
- int r=pbRandom(randomdown.Count);
- if (i is IBattlerEffect b) b.pbReduceStatWithCause(randomdown[r],1,i,Game._INTL(i.Ability.ToString(TextScripts.Name)));
+ int r=Random(randomdown.Count);
+ if (i is IBattlerEffect b) b.ReduceStatWithCause(randomdown[r],1,i,Game._INTL(i.Ability.ToString(TextScripts.Name)));
}
}
}
foreach (var i in priority) {
if (i.isFainted()) continue;
// Toxic Orb
- if (i.hasWorkingItem(Items.TOXIC_ORB) && i.Status==0 && i is IBattlerEffect b0 && b0.pbCanPoison(null,false)) {
+ if (i.hasWorkingItem(Items.TOXIC_ORB) && i.Status==0 && i is IBattlerEffect b0 && b0.CanPoison(null,false)) {
GameDebug.Log($"[Item triggered] #{i.ToString()}'s Toxic Orb");
- b0.pbPoison(null,Game._INTL("{1} was badly poisoned by its {2}!",i.ToString(),
+ b0.Poison(null,Game._INTL("{1} was badly poisoned by its {2}!",i.ToString(),
Game._INTL(i.Item.ToString(TextScripts.Name))),true);
}
// Flame Orb
- if (i.hasWorkingItem(Items.FLAME_ORB) && i.Status==0 && i is IBattlerEffect b1 && b1.pbCanBurn(null,false)) {
+ if (i.hasWorkingItem(Items.FLAME_ORB) && i.Status==0 && i is IBattlerEffect b1 && b1.CanBurn(null,false)) {
GameDebug.Log($"[Item triggered] #{i.ToString()}'s Flame Orb");
- b1.pbBurn(null,Game._INTL("{1} was burned by its {2}!",i.ToString(),Game._INTL(i.Item.ToString(TextScripts.Name))));
+ b1.Burn(null,Game._INTL("{1} was burned by its {2}!",i.ToString(),Game._INTL(i.Item.ToString(TextScripts.Name))));
}
// Sticky Barb
if (i.hasWorkingItem(Items.STICKY_BARB) && !i.hasWorkingAbility(Abilities.MAGIC_GUARD)) {
GameDebug.Log($"[Item triggered] #{i.ToString()}'s Sticky Barb");
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbDamageAnimation(i,0);
- i.pbReduceHP((int)Math.Floor(i.TotalHP/8f));
- pbDisplay(Game._INTL("{1} is hurt by its {2}!",i.ToString(),Game._INTL(i.Item.ToString(TextScripts.Name))));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).DamageAnimation(i,0);
+ i.ReduceHP((int)Math.Floor(i.TotalHP/8f));
+ Display(Game._INTL("{1} is hurt by its {2}!",i.ToString(),Game._INTL(i.Item.ToString(TextScripts.Name))));
}
if (i.isFainted()) {
- if (!i.pbFaint()) return;
+ if (!i.Faint()) return;
}
}
// Form checks
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].isFainted()) continue;
- @battlers[i].pbCheckForm();
+ if (_battlers[i].isFainted()) continue;
+ _battlers[i].CheckForm();
}
- pbGainEXP();
- pbSwitch();
+ GainEXP();
+ Switch();
if (@decision>0) return;
foreach (var i in priority) {
if (i.isFainted()) continue;
- i.pbAbilitiesOnSwitchIn(false);
+ i.AbilitiesOnSwitchIn(false);
}
// Healing Wish/Lunar Dance - should go here
// Spikes/Toxic Spikes/Stealth Rock - should go here (in order of their 1st use)
for (int i = 0; i < battlers.Length; i++) {
- if (@battlers[i].turncount>0 && @battlers[i].hasWorkingAbility(Abilities.TRUANT)) {
- @battlers[i].effects.Truant=!@battlers[i].effects.Truant;
- }
- if (@battlers[i].effects.LockOn>0) { // Also Mind Reader
- @battlers[i].effects.LockOn-=1;
- if (@battlers[i].effects.LockOn==0) @battlers[i].effects.LockOnPos=-1;
- }
- @battlers[i].effects.Flinch=false;
- @battlers[i].effects.FollowMe=0;
- @battlers[i].effects.HelpingHand=false;
- @battlers[i].effects.MagicCoat=false;
- @battlers[i].effects.Snatch=false;
- if (@battlers[i].effects.Charge>0) @battlers[i].effects.Charge-=1;
- @battlers[i].lastHPLost=0;
- @battlers[i].tookDamage=false;
- @battlers[i].lastAttacker.Clear();
- @battlers[i].effects.Counter=-1;
- @battlers[i].effects.CounterTarget=-1;
- @battlers[i].effects.MirrorCoat=-1;
- @battlers[i].effects.MirrorCoatTarget=-1;
+ if (_battlers[i].turncount>0 && _battlers[i].hasWorkingAbility(Abilities.TRUANT)) {
+ _battlers[i].effects.Truant=!_battlers[i].effects.Truant;
+ }
+ if (_battlers[i].effects.LockOn>0) { // Also Mind Reader
+ _battlers[i].effects.LockOn-=1;
+ if (_battlers[i].effects.LockOn==0) _battlers[i].effects.LockOnPos=-1;
+ }
+ _battlers[i].effects.Flinch=false;
+ _battlers[i].effects.FollowMe=0;
+ _battlers[i].effects.HelpingHand=false;
+ _battlers[i].effects.MagicCoat=false;
+ _battlers[i].effects.Snatch=false;
+ if (_battlers[i].effects.Charge>0) _battlers[i].effects.Charge-=1;
+ _battlers[i].lastHPLost=0;
+ _battlers[i].tookDamage=false;
+ _battlers[i].lastAttacker.Clear();
+ _battlers[i].effects.Counter=-1;
+ _battlers[i].effects.CounterTarget=-1;
+ _battlers[i].effects.MirrorCoat=-1;
+ _battlers[i].effects.MirrorCoatTarget=-1;
}
for (int i = 0; i < sides.Length; i++) {
if (!@sides[i].EchoedVoiceUsed) {
@@ -4528,32 +4532,32 @@ void IBattle.pbEndOfRoundPhase() {
#endregion
#region End of battle.
- public BattleResults pbEndOfBattle(bool canlose=false) {
+ public BattleResults EndOfBattle(bool canlose=false) {
//switch (@decision) {
//#### WIN ####//
if (@decision == BattleResults.WON) { //case BattleResults.WON:
GameDebug.Log($"");
GameDebug.Log($"***Player won***");
if (@opponent.Length > 0) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbTrainerBattleSuccess();
+ (@scene as IPokeBattle_DebugSceneNoGraphics).TrainerBattleSuccess();
if (@opponent.Length > 0) {
- pbDisplayPaused(Game._INTL("{1} defeated {2} and {3}!",this.pbPlayer().name,@opponent[0].name,@opponent[1].name));
+ DisplayPaused(Game._INTL("{1} defeated {2} and {3}!",this.Player().name,@opponent[0].name,@opponent[1].name));
}
else {
- pbDisplayPaused(Game._INTL("{1} defeated\r\n{2}!",this.pbPlayer().name,@opponent[0].name));
+ DisplayPaused(Game._INTL("{1} defeated\r\n{2}!",this.Player().name,@opponent[0].name));
}
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbShowOpponent(0);
- pbDisplayPaused(@endspeech.Replace("/\\[Pp][Nn]/",this.pbPlayer().name));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).ShowOpponent(0);
+ DisplayPaused(@endspeech.Replace("/\\[Pp][Nn]/",this.Player().name));
if (@opponent.Length > 0) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbHideOpponent();
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbShowOpponent(1);
- pbDisplayPaused(@endspeech2.Replace("/\\[Pp][Nn]/",this.pbPlayer().name));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).HideOpponent();
+ (@scene as IPokeBattle_DebugSceneNoGraphics).ShowOpponent(1);
+ DisplayPaused(@endspeech2.Replace("/\\[Pp][Nn]/",this.Player().name));
}
// Calculate money gained for winning
if (@internalbattle) {
int tmoney=0;
if (@opponent.Length > 1) { // Double battles
- int maxlevel1=0; int maxlevel2=0; int limit=pbSecondPartyBegin(1);
+ int maxlevel1=0; int maxlevel2=0; int limit=SecondPartyBegin(1);
for (int i = 0; i < limit; i++) {
if (@party2[i].IsNotNullOrNone()) {
if (maxlevel1<@party2[i].Level) maxlevel1=@party2[i].Level;
@@ -4577,31 +4581,31 @@ public BattleResults pbEndOfBattle(bool canlose=false) {
if (@amuletcoin) tmoney*=2;
// If Happy Hour's effect applies, double money earned
if (@doublemoney) tmoney*=2;
- int oldmoney=this.pbPlayer().Money;
- this.pbPlayer().Money+=tmoney;
- int moneygained=this.pbPlayer().Money-oldmoney;
+ int oldmoney=this.Player().Money;
+ this.Player().Money+=tmoney;
+ int moneygained=this.Player().Money-oldmoney;
if (moneygained>0) {
- pbDisplayPaused(Game._INTL("{1} got ${2}\r\nfor winning!",this.pbPlayer().name,tmoney.ToString()));
+ DisplayPaused(Game._INTL("{1} got ${2}\r\nfor winning!",this.Player().name,tmoney.ToString()));
}
}
}
if (@internalbattle && @extramoney>0) {
if (@amuletcoin) @extramoney*=2;
if (@doublemoney) @extramoney*=2;
- int oldmoney=this.pbPlayer().Money;
- this.pbPlayer().Money+=@extramoney;
- int moneygained=this.pbPlayer().Money-oldmoney;
+ int oldmoney=this.Player().Money;
+ this.Player().Money+=@extramoney;
+ int moneygained=this.Player().Money-oldmoney;
if (moneygained>0) {
- pbDisplayPaused(Game._INTL("{1} picked up ${2}!",this.pbPlayer().name,@extramoney.ToString()));
+ DisplayPaused(Game._INTL("{1} picked up ${2}!",this.Player().name,@extramoney.ToString()));
}
}
foreach (var p in @snaggedpokemon) {
IPokemon pkmn = this.party2[p];
- pbStorePokemon(pkmn);
- //if (this.pbPlayer().shadowcaught == null) this.pbPlayer().shadowcaught=new Dictionary();
- if (this.pbPlayer().shadowcaught == null) this.pbPlayer().shadowcaught=new List();
- //this.pbPlayer().shadowcaught[pkmn.Species]=true;
- if (!this.pbPlayer().shadowcaught.Contains(pkmn.Species)) this.pbPlayer().shadowcaught.Add(pkmn.Species);
+ StorePokemon(pkmn);
+ //if (this.Player().shadowcaught == null) this.Player().shadowcaught=new Dictionary();
+ if (this.Player().shadowcaught == null) this.Player().shadowcaught=new List();
+ //this.Player().shadowcaught[pkmn.Species]=true;
+ if (!this.Player().shadowcaught.Contains(pkmn.Species)) this.Player().shadowcaught.Add(pkmn.Species);
}
@snaggedpokemon.Clear();
//break;
@@ -4612,42 +4616,42 @@ public BattleResults pbEndOfBattle(bool canlose=false) {
if (@decision==BattleResults.LOST) GameDebug.Log($"***Player lost***");
if (@decision==BattleResults.DRAW) GameDebug.Log($"***Player drew with opponent***");
if (@internalbattle) {
- pbDisplayPaused(Game._INTL("{1} is out of usable Pokémon!",this.pbPlayer().name));
- int moneylost=pbMaxLevelFromIndex(0); // Player's Pokémon only, not partner's
+ DisplayPaused(Game._INTL("{1} is out of usable Pokémon!",this.Player().name));
+ int moneylost=MaxLevelFromIndex(0); // Player's Pokémon only, not partner's
int[] multiplier=new int[] { 8, 16, 24, 36, 48, 60, 80, 100, 120 };
- moneylost*=multiplier[(int)Math.Min(multiplier.Length-1,this.pbPlayer().badges.Length)];
- if (moneylost>this.pbPlayer().Money) moneylost=this.pbPlayer().Money;
+ moneylost*=multiplier[(int)Math.Min(multiplier.Length-1,this.Player().badges.Length)];
+ if (moneylost>this.Player().Money) moneylost=this.Player().Money;
if (Core.NO_MONEY_LOSS) moneylost=0;
- int oldmoney=this.pbPlayer().Money;
- this.pbPlayer().Money-=moneylost;
- int lostmoney=oldmoney-this.pbPlayer().Money;
+ int oldmoney=this.Player().Money;
+ this.Player().Money-=moneylost;
+ int lostmoney=oldmoney-this.Player().Money;
if (@opponent.Length > 0) {
if (@opponent.Length > 0) {
- pbDisplayPaused(Game._INTL("{1} lost against {2} and {3}!",this.pbPlayer().name,@opponent[0].name,@opponent[1].name));
+ DisplayPaused(Game._INTL("{1} lost against {2} and {3}!",this.Player().name,@opponent[0].name,@opponent[1].name));
}
else {
- pbDisplayPaused(Game._INTL("{1} lost against\r\n{2}!",this.pbPlayer().name,@opponent[0].name));
+ DisplayPaused(Game._INTL("{1} lost against\r\n{2}!",this.Player().name,@opponent[0].name));
}
if (moneylost>0) {
- pbDisplayPaused(Game._INTL("{1} paid ${2}\r\nas the prize money...",this.pbPlayer().name,lostmoney.ToString()));
- if (!canlose) pbDisplayPaused(Game._INTL("..."));
+ DisplayPaused(Game._INTL("{1} paid ${2}\r\nas the prize money...",this.Player().name,lostmoney.ToString()));
+ if (!canlose) DisplayPaused(Game._INTL("..."));
}
}
else {
if (moneylost>0) {
- pbDisplayPaused(Game._INTL("{1} panicked and lost\r\n${2}...",this.pbPlayer().name,lostmoney.ToString()));
- if (!canlose) pbDisplayPaused(Game._INTL("..."));
+ DisplayPaused(Game._INTL("{1} panicked and lost\r\n${2}...",this.Player().name,lostmoney.ToString()));
+ if (!canlose) DisplayPaused(Game._INTL("..."));
}
}
- if (!canlose) pbDisplayPaused(Game._INTL("{1} blacked out!",this.pbPlayer().name));
+ if (!canlose) DisplayPaused(Game._INTL("{1} blacked out!",this.Player().name));
}
else if (@decision==BattleResults.LOST) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbShowOpponent(0);
- pbDisplayPaused(@endspeechwin.Replace("/\\[Pp][Nn]/",this.pbPlayer().name));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).ShowOpponent(0);
+ DisplayPaused(@endspeechwin.Replace("/\\[Pp][Nn]/",this.Player().name));
if (@opponent.Length > 0) {
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbHideOpponent();
- (@scene as IPokeBattle_DebugSceneNoGraphics).pbShowOpponent(1);
- pbDisplayPaused(@endspeechwin2.Replace("/\\[Pp][Nn]/",this.pbPlayer().name));
+ (@scene as IPokeBattle_DebugSceneNoGraphics).HideOpponent();
+ (@scene as IPokeBattle_DebugSceneNoGraphics).ShowOpponent(1);
+ DisplayPaused(@endspeechwin2.Replace("/\\[Pp][Nn]/",this.Player().name));
}
}
//break;
@@ -4663,16 +4667,16 @@ public BattleResults pbEndOfBattle(bool canlose=false) {
foreach (var i in infected) {
int strain=(Game.GameData.Trainer.party[i] as Monster.Pokemon).PokerusStrain;//.pokerus/16;
if (i>0 && !Game.GameData.Trainer.party[i-1].PokerusStage.HasValue) { //Game.GameData.Trainer.party[i-1].PokerusStage==0
- if (pbRandom(3)==0) Game.GameData.Trainer.party[i-1].GivePokerus(strain);
+ if (Random(3)==0) Game.GameData.Trainer.party[i-1].GivePokerus(strain);
}
if (i0) return;
}
else {
if (@decision==BattleResults.DRAW) return;
}
- pbJudge();
+ Judge();
if (@decision>0) return;
List switched=new List();
- if (@battlers[0].isFainted() && @partyindexes[0]+10) {
- IBattler[] priority=pbPriority();
+ IBattler[] priority=Priority();
foreach (var i in priority) {
- if (switched.Contains(i.Index)) i.pbAbilitiesOnSwitchIn(true);
+ if (switched.Contains(i.Index)) i.AbilitiesOnSwitchIn(true);
}
}
}
- public override void pbOnActiveAll() {
+ public override void OnActiveAll() {
@battlerschanged=true;
@mind[0]=0;
@mind[1]=0;
@@ -106,10 +106,10 @@ public override void pbOnActiveAll() {
@starthp[0]=battlers[0].HP;
@starthp[1]=battlers[1].HP;
@count=0;
- base.pbOnActiveAll(); //return
+ base.OnActiveAll(); //return
}
- public override bool pbOnActiveOne(IBattler pkmn, bool onlyabilities = false, bool moldbreaker = false) {
+ public override bool OnActiveOne(IBattler pkmn, bool onlyabilities = false, bool moldbreaker = false) {
@battlerschanged=true;
@mind[0]=0;
@mind[1]=0;
@@ -118,10 +118,10 @@ public override bool pbOnActiveOne(IBattler pkmn, bool onlyabilities = false, bo
@starthp[0]=battlers[0].HP;
@starthp[1]=battlers[1].HP;
@count=0;
- return base.pbOnActiveOne(pkmn, onlyabilities, moldbreaker);
+ return base.OnActiveOne(pkmn, onlyabilities, moldbreaker);
}
- public int pbMindScore(IBattleMove move) {
+ public int MindScore(IBattleMove move) {
if (move.Effect==Attack.Data.Effects.x070 || // Detect/Protect
move.Effect==Attack.Data.Effects.x075 || // Endure
move.Effect==Attack.Data.Effects.x09F) { // Fake Out
@@ -140,25 +140,25 @@ public int pbMindScore(IBattleMove move) {
}
}
- public override void pbCommandPhase() {
+ public override void CommandPhase() {
if (@battlerschanged) {
- ((IPokeBattleArena_Scene)@scene).pbBattleArenaBattlers(@battlers[0],@battlers[1]);
+ ((IPokeBattleArena_Scene)@scene).BattleArenaBattlers(@battlers[0],@battlers[1]);
@battlerschanged=false;
@count=0;
}
- base.pbCommandPhase();
+ base.CommandPhase();
if (@decision!=0) return;
// Update mind rating (asserting that a move was chosen)
// TODO: Actually done at Pokémon's turn
for (int i = 0; i < 2; i++) {
if (@choices[i].Move.IsNotNullOrNone() && @choices[i].Action==ChoiceAction.UseMove) {//[0]==1
- @mind[i]+=pbMindScore(@choices[i].Move);
+ @mind[i]+=MindScore(@choices[i].Move);
}
}
}
- public override void pbEndOfRoundPhase() {
- base.pbEndOfRoundPhase();
+ public override void EndOfRoundPhase() {
+ base.EndOfRoundPhase();
if (@decision!=0) return;
@count+=1;
// Update skill rating
@@ -168,8 +168,8 @@ public override void pbEndOfRoundPhase() {
GameDebug.Log($"[Mind: #{@mind.ToString()}, Skill: #{@skill.ToString()}]");
if (@count==3) {
int[] points=new int[] { 0, 0 };
- @battlers[0].pbCancelMoves();
- @battlers[1].pbCancelMoves();
+ @battlers[0].CancelMoves();
+ @battlers[1].CancelMoves();
int[] ratings1=new int[] {0,0,0};
int[] ratings2=new int[] {0,0,0};
if (@mind[0]==@mind[1]) {
@@ -202,158 +202,158 @@ public override void pbEndOfRoundPhase() {
else {
ratings2[2]=2;
}
- ((IPokeBattleArena_Scene)@scene).pbBattleArenaJudgment(@battlers[0],@battlers[1],ratings1,ratings2);
+ ((IPokeBattleArena_Scene)@scene).BattleArenaJudgment(@battlers[0],@battlers[1],(int[])ratings1.Clone(),(int[])ratings2.Clone());
points=new int[] { 0, 0 };
for (int i = 0; i < 3; i++) {
points[0]+=ratings1[i];
points[1]+=ratings2[i];
}
if (points[0]==points[1]) {
- pbDisplay(Game._INTL("{1} tied the opponent\n{2} in a referee's decision!",
+ Display(Game._INTL("{1} tied the opponent\n{2} in a referee's decision!",
@battlers[0].Name,@battlers[1].Name)) ;
@battlers[0].HP=0; // Note: Pokemon doesn't really lose HP, but the effect is mostly the same
- @battlers[0].pbFaint(false);
+ @battlers[0].Faint(false);
@battlers[1].HP=0 ;
- @battlers[1].pbFaint(false);
+ @battlers[1].Faint(false);
} else if (points[0]>points[1]) {
- pbDisplay(Game._INTL("{1} defeated the opponent\n{2} in a referee's decision!",
+ Display(Game._INTL("{1} defeated the opponent\n{2} in a referee's decision!",
@battlers[0].Name,@battlers[1].Name));
@battlers[1].HP=0 ;
- @battlers[1].pbFaint(false);
+ @battlers[1].Faint(false);
}
else {
- pbDisplay(Game._INTL("{1} lost to the opponent\n{2} in a referee's decision!",
+ Display(Game._INTL("{1} lost to the opponent\n{2} in a referee's decision!",
@battlers[0].Name,@battlers[1].Name));
@battlers[0].HP=0 ;
- @battlers[0].pbFaint(false);
+ @battlers[0].Faint(false);
}
- pbGainEXP();
- pbSwitch();
+ GainEXP();
+ Switch();
}
}
}
/*public partial class PokeBattle_Scene : IPokeBattleArena_Scene {
public void updateJudgment(window,int phase,IBattler battler1,IBattler battler2,int[] ratings1,int[] ratings2) {
- int total1=0;
- int total2=0;
- for (int i = 0; i < phase; i++) {
- total1+=ratings1[i];
- total2+=ratings2[i];
- }
- window.contents.clear();
- pbSetSystemFont(window.contents);
- textpos=new {
- //[battler1.Name,64,0,2,new Color(248,0,0),new Color(208,208,200)],
- //[Game._INTL("VS"),144,0,2,new Color(72,72,72),new Color(208,208,200)],
- //[battler2.Name,224,0,2,new Color(72,72,72),new Color(208,208,200)],
- //[Game._INTL("Mind"),144,48,2,new Color(72,72,72),new Color(208,208,200)],
- //[Game._INTL("Skill"),144,80,2,new Color(72,72,72),new Color(208,208,200)],
- //[Game._INTL("Body"),144,112,2,new Color(72,72,72),new Color(208,208,200)],
- //[string.Format("{0}",total1),64,160,2,new Color(72,72,72),new Color(208,208,200)],
- //[Game._INTL("Judgment"),144,160,2,new Color(72,72,72),new Color(208,208,200)],
- //[string.Format("{0}",total2),224,160,2,new Color(72,72,72),new Color(208,208,200)]
- };
- pbDrawTextPositions(window.contents,textpos);
- List<> images=new List<>();
- for (int i = 0; i < phase; i++) {
- float y=[48,80,112][i];
- float x=(ratings1[i]==ratings2[i]) ? 64 : ((ratings1[i]>ratings2[i]) ? 0 : 32);
- images.Add(new { "Graphics/Pictures/judgment", 64 - 16, y, x, 0, 32, 32 });
- x=(ratings1[i]==ratings2[i]) ? 64 : ((ratings1[i]total2) {
- Game.pbMessageDisplay(msgwindow,
- Game._INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]",
- total1,total2,@battle.pbGetOwner(battler1.index).Name,battler1.Name)); {
- pbUpdate(); dimmingvp.update(); infowindow.update(); }
+ for (int i = 0; i < phase; i++) {
+ total1+=ratings1[i];
+ total2+=ratings2[i];
}
- else {
- Game.pbMessageDisplay(msgwindow,
- Game._INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]",
- total1,total2,battler2.Name)); {
- pbUpdate(); dimmingvp.update(); infowindow.update(); }
- }
- infowindow.visible=false;
- msgwindow.visible=false;
- for (int i = 0; i < 10; i++) {
- pbGraphicsUpdate();
- pbInputUpdate();
- msgwindow.update();
- dimmingvp.update();
- dimmingvp.color=new Color(0,0,0,(10-i)*128/10);
+ window.contents.clear();
+ SetSystemFont(window.contents);
+ textpos=new {
+ //[battler1.Name,64,0,2,new Color(248,0,0),new Color(208,208,200)],
+ //[Game._INTL("VS"),144,0,2,new Color(72,72,72),new Color(208,208,200)],
+ //[battler2.Name,224,0,2,new Color(72,72,72),new Color(208,208,200)],
+ //[Game._INTL("Mind"),144,48,2,new Color(72,72,72),new Color(208,208,200)],
+ //[Game._INTL("Skill"),144,80,2,new Color(72,72,72),new Color(208,208,200)],
+ //[Game._INTL("Body"),144,112,2,new Color(72,72,72),new Color(208,208,200)],
+ //[string.Format("{0}",total1),64,160,2,new Color(72,72,72),new Color(208,208,200)],
+ //[Game._INTL("Judgment"),144,160,2,new Color(72,72,72),new Color(208,208,200)],
+ //[string.Format("{0}",total2),224,160,2,new Color(72,72,72),new Color(208,208,200)]
+ };
+ DrawTextPositions(window.contents,textpos);
+ List<> images=new List<>();
+ for (int i = 0; i < phase; i++) {
+ float y=[48,80,112][i];
+ float x=(ratings1[i]==ratings2[i]) ? 64 : ((ratings1[i]>ratings2[i]) ? 0 : 32);
+ images.Add(new { "Graphics/Pictures/judgment", 64 - 16, y, x, 0, 32, 32 });
+ x=(ratings1[i]==ratings2[i]) ? 64 : ((ratings1[i]total2) {
+ Game.MessageDisplay(msgwindow,
+ Game._INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]",
+ total1,total2,@battle.GetOwner(battler1.index).Name,battler1.Name)); {
+ Update(); dimmingvp.update(); infowindow.update(); }
+ }
+ else {
+ Game.MessageDisplay(msgwindow,
+ Game._INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]",
+ total1,total2,battler2.Name)); {
+ Update(); dimmingvp.update(); infowindow.update(); }
+ }
+ infowindow.visible=false;
+ msgwindow.visible=false;
+ for (int i = 0; i < 10; i++) {
+ GraphicsUpdate();
+ InputUpdate();
+ msgwindow.update();
+ dimmingvp.update();
+ dimmingvp.color=new Color(0,0,0,(10-i)*128/10);
+ }
+ } finally { //ensure;
+ Game.DisposeMessageWindow(msgwindow);
+ dimmingvp.dispose();
+ infowindow.contents.dispose();
+ infowindow.dispose();
+ }
}
}*/
}
\ No newline at end of file
diff --git a/PokemonUnity.Application/Combat/Match/BattlePalace.cs b/PokemonUnity.Application/Combat/Match/BattlePalace.cs
index 4c8aabd66..000766fb9 100644
--- a/PokemonUnity.Application/Combat/Match/BattlePalace.cs
+++ b/PokemonUnity.Application/Combat/Match/BattlePalace.cs
@@ -85,14 +85,14 @@ public PokemonEssentials.Interface.PokeBattle.IBattlePalace initialize(IPokeBatt
return this;
}
- public IBattle pbCreateBattle(IPokeBattle_Scene scene, ITrainer[] trainer1, ITrainer[] trainer2)
+ public IBattle CreateBattle(IPokeBattle_Scene scene, ITrainer[] trainer1, ITrainer[] trainer2)
{
//return new PokeBattle_RecordedBattlePalace(scene, trainer1[0].party, trainer2[0].party, trainer1, trainer2);
//ToDo: Uncomment above and remove below...
return new PokeBattle_BattlePalace(scene, trainer1[0].party, trainer2[0].party, trainer1, trainer2);
}
- public int pbMoveCategory(IBattleMove move) {
+ public int MoveCategory(IBattleMove move) {
if (//Game.MoveData[move.id].Target==Attack.Data.Targets. 0x10 || //ToDo: Finish Convert from Essentials to Veekun
move.Effect==Attack.Data.Effects.x01B) { // Bide
return 1;
@@ -106,12 +106,12 @@ public int pbMoveCategory(IBattleMove move) {
}
///
- /// Different implementation of pbCanChooseMove, ignores Imprison/Torment/Taunt/Disable/Encore
+ /// Different implementation of CanChooseMove, ignores Imprison/Torment/Taunt/Disable/Encore
///
///
///
///
- public bool pbCanChooseMovePartial (int idxPokemon,int idxMove) {
+ public bool CanChooseMovePartial (int idxPokemon,int idxMove) {
PokemonEssentials.Interface.PokeBattle.IBattler thispkmn=@battlers[idxPokemon];
IBattleMove thismove=thispkmn.moves[idxMove];
if (!thismove.IsNotNullOrNone()||thismove.id==0) {
@@ -134,7 +134,7 @@ public bool pbCanChooseMovePartial (int idxPokemon,int idxMove) {
return true;
}
- public void pbPinchChange(int idxPokemon) {
+ public void PinchChange(int idxPokemon) {
PokemonEssentials.Interface.PokeBattle.IBattler thispkmn=@battlers[idxPokemon];
if (!thispkmn.effects.Pinch && thispkmn.Status!=Status.SLEEP &&
thispkmn.HP<=(int)Math.Floor(thispkmn.TotalHP/2f)) {
@@ -147,7 +147,7 @@ public void pbPinchChange(int idxPokemon) {
nature==Natures.HARDY||
nature==Natures.DOCILE||
nature==Natures.SERIOUS) {
- pbDisplay(Game._INTL("{1} is eager for more!",thispkmn.ToString()));
+ Display(Game._INTL("{1} is eager for more!",thispkmn.ToString()));
}
if (nature==Natures.CAREFUL||
nature==Natures.RASH||
@@ -155,7 +155,7 @@ public void pbPinchChange(int idxPokemon) {
nature==Natures.SASSY||
nature==Natures.MILD||
nature==Natures.TIMID) {
- pbDisplay(Game._INTL("{1} began growling deeply!",thispkmn.ToString()));
+ Display(Game._INTL("{1} began growling deeply!",thispkmn.ToString()));
}
if (nature==Natures.GENTLE||
nature==Natures.ADAMANT||
@@ -163,7 +163,7 @@ public void pbPinchChange(int idxPokemon) {
nature==Natures.LONELY||
nature==Natures.RELAXED||
nature==Natures.NAUGHTY) {
- pbDisplay(Game._INTL("A glint appears in {1}'s eyes!",thispkmn.ToString(true)));
+ Display(Game._INTL("A glint appears in {1}'s eyes!",thispkmn.ToString(true)));
}
if (nature==Natures.JOLLY||
nature==Natures.BOLD||
@@ -171,12 +171,12 @@ public void pbPinchChange(int idxPokemon) {
nature==Natures.CALM||
nature==Natures.IMPISH||
nature==Natures.MODEST) {
- pbDisplay(Game._INTL("{1} is getting into position!",thispkmn.ToString()));
+ Display(Game._INTL("{1} is getting into position!",thispkmn.ToString()));
}
}
}
- public override bool pbEnemyShouldWithdraw (int index) {
+ public override bool EnemyShouldWithdraw (int index) {
bool shouldswitch=false;
if (@battlers[index].effects.PerishSong==1) {
shouldswitch=true;
@@ -194,9 +194,9 @@ public override bool pbEnemyShouldWithdraw (int index) {
int maxindex=-1;
int maxpercent=0;
int factor=0;
- PokemonEssentials.Interface.PokeBattle.IPokemon[] party=pbParty(index);
+ PokemonEssentials.Interface.PokeBattle.IPokemon[] party=Party(index);
for (int i = 0; i < party.Length; i++) {
- if (pbCanSwitch(index,i,false)) {
+ if (CanSwitch(index,i,false)) {
percents[i]=party[i].HP*100/party[i].TotalHP;
if (percents[i]>maxpercent) {
maxindex=i;
@@ -230,16 +230,16 @@ public override bool pbEnemyShouldWithdraw (int index) {
}
shouldswitch=(Core.Rand.Next(100)=0) {
- pbRegisterSwitch(index,maxindex);
+ RegisterSwitch(index,maxindex);
return true;
}
}
@justswitched[index]=shouldswitch;
if (shouldswitch) {
- PokemonEssentials.Interface.PokeBattle.IPokemon[] party=pbParty(index);
+ PokemonEssentials.Interface.PokeBattle.IPokemon[] party=Party(index);
for (int i = 0; i < party.Length; i++) {
- if (pbCanSwitch(index,i,false)) {
- pbRegisterSwitch(index,i);
+ if (CanSwitch(index,i,false)) {
+ RegisterSwitch(index,i);
return true;
}
}
@@ -247,7 +247,7 @@ public override bool pbEnemyShouldWithdraw (int index) {
return false;
}
- public override bool pbRegisterMove(int idxPokemon,int idxMove,bool showMessages=true) {
+ public override bool RegisterMove(int idxPokemon,int idxMove,bool showMessages=true) {
PokemonEssentials.Interface.PokeBattle.IBattler thispkmn=@battlers[idxPokemon];
if (idxMove==-2) {
//@choices[idxPokemon][0]=1; // Move
@@ -266,7 +266,7 @@ public override bool pbRegisterMove(int idxPokemon,int idxMove,bool showMessages
return true;
}
- public override bool pbAutoFightMenu(int idxPokemon) {
+ public override bool AutoFightMenu(int idxPokemon) {
PokemonEssentials.Interface.PokeBattle.IBattler thispkmn=@battlers[idxPokemon];
Natures nature=thispkmn.pokemon.Nature;
int randnum=Core.Rand.Next(100);
@@ -291,28 +291,28 @@ public override bool pbAutoFightMenu(int idxPokemon) {
}
int[] moves=new int[4];
for (int i = 0; i < thispkmn.moves.Length; i++) {
- if (!pbCanChooseMovePartial(idxPokemon,i)) continue;
- if (pbMoveCategory(thispkmn.moves[i])==category) {
+ if (!CanChooseMovePartial(idxPokemon,i)) continue;
+ if (MoveCategory(thispkmn.moves[i])==category) {
moves[moves.Length]=i;
}
}
if (moves.Length==0) {
// No moves of selected category
- pbRegisterMove(idxPokemon,-2);
+ RegisterMove(idxPokemon,-2);
}
else {
int chosenmove=moves[Core.Rand.Next(moves.Length)];
- pbRegisterMove(idxPokemon,chosenmove);
+ RegisterMove(idxPokemon,chosenmove);
}
return true;
}
- public override void pbEndOfRoundPhase() {
- base.pbEndOfRoundPhase();
+ public override void EndOfRoundPhase() {
+ base.EndOfRoundPhase();
if (@decision!=0) return;
for (int i = 0; i < 4; i++) {
if (!@battlers[i].isFainted()) {
- pbPinchChange(i);
+ PinchChange(i);
}
}
}
diff --git a/PokemonUnity.Application/Combat/Match/Recorder.cs b/PokemonUnity.Application/Combat/Match/Recorder.cs
index d600e31bd..69dffd4bc 100644
--- a/PokemonUnity.Application/Combat/Match/Recorder.cs
+++ b/PokemonUnity.Application/Combat/Match/Recorder.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using PokemonUnity.Inventory;
@@ -17,30 +18,33 @@
namespace PokemonUnity.Combat
{
- public class PokeBattle_RecordedBattleModule : Battle, IRecordedBattleModule, IBattle, IBattleRecordData
- where TBattle : IBattle, IBattleRecordData
+ //public class PokeBattle_RecordedBattleModule : Battle, IRecordedBattleModule, IBattle, IBattleRecordData
+ public class PokeBattle_RecordedBattleModule : Battle, IRecordedBattleModule, IBattle, IBattleRecordData
+ where TBattle : IBattle, IBattleRecordData
{
#region Variables
+ protected TBattle Instance;
+
public IList randomnumbers { get; protected set; }
//public IList rounds { get; protected set; }
- public IList[]> rounds { get; protected set; }
+ public IList?[]> rounds { get; protected set; }
public IList switches { get; protected set; }
public int roundindex { get; protected set; }
public IBattleMetaData properties { get; protected set; }
- //public int pbGetBattleType { get { return battletype; } }
- protected int battletype;
+ //public int GetBattleType { get { return battletype; } }
+ public int battletype { get; protected set; }
#endregion
public PokeBattle_RecordedBattleModule(IPokeBattle_Scene scene,PokemonEssentials.Interface.PokeBattle.IPokemon[] p1,PokemonEssentials.Interface.PokeBattle.IPokemon[] p2,PokemonEssentials.Interface.PokeBattle.ITrainer[] player,PokemonEssentials.Interface.PokeBattle.ITrainer[] opponent)
: base (scene, p1, p2, player, opponent)
- { (this as IRecordedBattleModule).initialize(scene, p1, p2, player, opponent); }
+ { (this as IRecordedBattleModule).initialize(scene, p1, p2, player, opponent); }
public IBattle initialize(IPokeBattle_Scene scene,PokemonEssentials.Interface.PokeBattle.IPokemon[] p1,PokemonEssentials.Interface.PokeBattle.IPokemon[] p2,PokemonEssentials.Interface.PokeBattle.ITrainer[] player,PokemonEssentials.Interface.PokeBattle.ITrainer[] opponent)
{
- battletype = pbGetBattleType();
+ battletype = GetBattleType();
//@randomnumbers=new List();
randomnumbers=new List();
//@rounds=new List();
- @rounds=new List[]>();
+ @rounds=new List?[]>();
@switches=new List();
@roundindex=-1;
//@properties=new object();
@@ -49,33 +53,34 @@ public IBattle initialize(IPokeBattle_Scene scene,PokemonEssentials.Interface.Po
}
#region Methods
- public virtual int pbGetBattleType() {
+ public virtual int GetBattleType() {
return 0; // Battle Tower
}
- public ITrainer[] pbGetTrainerInfo(ITrainer[] trainer) {
+ public ITrainer[] GetTrainerInfo(ITrainer[] trainer) {
if (trainer == null) return null;
- if (trainer.Length > 0) {
+ if (trainer.Length > 1) {
return trainer;
//return new Trainer[] {
- // //new Trainer(trainer[0].trainertype,trainer[0].Name,trainer[0].id,trainer[0].badges),
- // new Trainer(trainer[0].ID,trainer[0].Name,trainer[0].TrainerID,trainer[0].Badges),
- // new Trainer(trainer[1].ID,trainer[1].Name,trainer[1].TrainerID,trainer[0].Badges)
+ // //new Trainer(trainer[0].trainertype,trainer[0].Name.Clone(),trainer[0].id,trainer[0].badges.Clone()),
+ // new Trainer(trainer[0].ID,trainer[0].Name.Clone(),trainer[0].TrainerID,trainer[0].Badges.Clong()),
+ // new Trainer(trainer[1].ID,trainer[1].Name.Clone(),trainer[1].TrainerID,trainer[0].Badges.Clong())
//};
}
else {
return trainer;
//return new Trainer[] {
- // new Trainer(trainer.trainertype,trainer.Name,trainer.id,trainer.badges)
+ // //new Trainer(trainer.trainertype,trainer.Name,trainer.id,trainer.badges)
+ // new Trainer(trainer.trainertype,trainer.Name.Clone(),trainer.id,trainer.Badges.Clone)
//};
}
}
- public override BattleResults pbStartBattle(bool canlose=false) {
- /*@properties=new object();
- @properties["internalbattle"]=@internalbattle;
- @properties["player"]=pbGetTrainerInfo(@player);
- @properties["opponent"]=pbGetTrainerInfo(@opponent);
+ public override BattleResults StartBattle(bool canlose=false) {
+ /*@properties=new IBattleMetaData();
+ @properties["internalbattle"]=Core.INTERNAL;//@internalbattle;
+ @properties["player"]=GetTrainerInfo(@player);
+ @properties["opponent"]=GetTrainerInfo(@opponent);
@properties["party1"]=@party1.Serialize();//Marshal.dump(@party1);
@properties["party2"]=@party2.Serialize();//Marshal.dump(@party2);
@properties["endspeech"]=@endspeech != null ? @endspeech : "";
@@ -91,23 +96,23 @@ public override BattleResults pbStartBattle(bool canlose=false) {
@properties["items"]=Marshal.dump(@items);
@properties["environment"]=@environment;
@properties["rules"]=Marshal.dump(@rules);*/
- return base.pbStartBattle(canlose);
+ return base.StartBattle(canlose);
}
- public string pbDumpRecord() {
- //return Marshal.dump([pbGetBattleType,@properties,@rounds,@randomnumbers,@switches]);
- //return new { pbGetBattleType(), @properties, @rounds, randomnumbers, @switches }.ToString();
+ public string DumpRecord() {
+ //return Marshal.dump([GetBattleType,@properties,@rounds,@randomnumbers,@switches]);
+ //return new { GetBattleType(), @properties, @rounds, randomnumbers, @switches }.ToString();
return new { @battletype, @properties, @rounds, randomnumbers, @switches }.ToString();
}
- public override int pbSwitchInBetween(int i1,bool i2,bool i3) {
- int ret=base.pbSwitchInBetween(i1,i2,i3);
+ public override int SwitchInBetween(int i1,bool i2,bool i3) {
+ int ret=base.SwitchInBetween(i1,i2,i3);
@switches.Add(ret);
return ret;
}
- public override bool pbRegisterMove(int i1,int i2, bool showMessages=true) {
- if (base.pbRegisterMove(i1,i2,showMessages)) {
+ public override bool RegisterMove(int i1,int i2, bool showMessages=true) {
+ if (base.RegisterMove(i1,i2,showMessages)) {
//@rounds[@roundindex][i1]=new int[] { MenuCommands.FIGHT, i2 };
@rounds[@roundindex][i1]=new KeyValuePair(MenuCommands.FIGHT, i2);
return true;
@@ -115,30 +120,30 @@ public override bool pbRegisterMove(int i1,int i2, bool showMessages=true) {
return false;
}
- public override int pbRun(int i1,bool duringBattle=false) {
- int ret=base.pbRun(i1,duringBattle);
+ public override int Run(int i1,bool duringBattle=false) {
+ int ret=base.Run(i1,duringBattle);
//@rounds[@roundindex][i1]=new int[] { MenuCommands.RUN, (int)@decision };
@rounds[@roundindex][i1]=new KeyValuePair(MenuCommands.RUN, (int)@decision);
return ret;
}
- public override bool pbRegisterTarget(int i1,int i2) {
- bool ret=base.pbRegisterTarget(i1,i2);
+ public override bool RegisterTarget(int i1,int i2) {
+ bool ret=base.RegisterTarget(i1,i2);
//@rounds[@roundindex][i1][2]=i2; //ToDo: Select target for Move choosen
@rounds[@roundindex][i1]=new KeyValuePair(MenuCommands.FIGHT, i2); //@rounds[@roundindex][i1].Value=i2;
return ret;
}
- public override void pbAutoChooseMove(int i1,bool showMessages=true) {
+ public override void AutoChooseMove(int i1,bool showMessages=true) {
//bool ret= //no return value...
- base.pbAutoChooseMove(i1,showMessages);
+ base.AutoChooseMove(i1,showMessages);
//@rounds[@roundindex][i1]=new int[] { MenuCommands.FIGHT, -1 };
@rounds[@roundindex][i1]=new KeyValuePair(MenuCommands.FIGHT, -1);
return; //ret;
}
- public override bool pbRegisterSwitch(int i1,int i2) {
- if (base.pbRegisterSwitch(i1,i2)) {
+ public override bool RegisterSwitch(int i1,int i2) {
+ if (base.RegisterSwitch(i1,i2)) {
//@rounds[@roundindex][i1]=new int[] { MenuCommands.POKEMON, i2 };
@rounds[@roundindex][i1]=new KeyValuePair(MenuCommands.POKEMON, i2);
return true;
@@ -146,8 +151,8 @@ public override bool pbRegisterSwitch(int i1,int i2) {
return false;
}
- public bool pbRegisterItem(int i1,Items i2) {
- if (base.pbRegisterItem(i1,i2)) {
+ public bool RegisterItem(int i1,Items i2) {
+ if (base.RegisterItem(i1,i2)) {
//@rounds[@roundindex][i1]=new int[] { MenuCommands.BAG, (int)i2 }; //MenuCommands.Item == Bag
@rounds[@roundindex][i1]=new KeyValuePair(MenuCommands.BAG, (int)i2);
return true;
@@ -155,19 +160,19 @@ public bool pbRegisterItem(int i1,Items i2) {
return false;
}
- public override void pbCommandPhase() {
+ public override void CommandPhase() {
@roundindex+=1;
//@rounds[@roundindex]=new int[4][]; //[[],[],[],[]];
//@rounds.Add(new int[battlers.Length][]); //[[],[],[],[]];
- @rounds.Add(new KeyValuePair[battlers.Length]);
- base.pbCommandPhase();
+ @rounds.Add(new KeyValuePair?[battlers.Length]);
+ base.CommandPhase();
}
- public override void pbStorePokemon(IPokemon pkmn) {
+ public override void StorePokemon(IPokemon pkmn) {
}
- public override int pbRandom(int num) {
- int ret=base.pbRandom(num);
+ public override int Random(int num) {
+ int ret=base.Random(num);
//@randomnumbers.Add(ret);
randomnumbers.Add(ret);
return ret;
@@ -175,33 +180,54 @@ public override int pbRandom(int num) {
#endregion
}
- /*public static class BattlePlayerHelper {
- public static ITrainer[] pbGetOpponent(IBattle battle) {
- //return this.pbCreateTrainerInfo(battle[1]["opponent"]);
- return pbCreateTrainerInfo(battle.opponent);
+ public static class BattlePlayerHelper {
+ public static ITrainer[] GetOpponent(IBattle battle) {
+ //return this.CreateTrainerInfo(battle[1]["opponent"]);
+ return CreateTrainerInfo(battle.opponent);
}
- public static IAudioBGM pbGetBattleBGM(IBattle battle) {
- return pbGetTrainerBattleBGM(BattlePlayerHelper.pbGetOpponent(battle));
+ public static IAudioBGM GetBattleBGM(IBattle battle) {
+ return (Game.GameData as IGameUtility).GetTrainerBattleBGM(BattlePlayerHelper.GetOpponent(battle));
}
- public static ITrainer[] pbCreateTrainerInfo(ITrainer[] trainer) {
+ public static ITrainer[] CreateTrainerInfo(TrainerData[] trainer) {
+ if (trainer == null) return null;
+ if (trainer.Length>1) {
+ ITrainer[] ret=new Trainer[2];
+ ret[0]=new Trainer(trainer[0].Name, trainer[0].ID); //trainer[0][1],trainer[0][0]
+ ret[0].id=trainer[0].TrainerID; //trainer[0][2];
+ //ret[0].badges=trainer[0].badges; //trainer[0][3];
+ //ToDo: for-loop, foreach badge in array, assign same value to second variable
+ ret[1]=new Trainer(trainer[1].Name, trainer[1].ID); //trainer[1][1],trainer[1][0]
+ ret[1].id=trainer[1].TrainerID; //trainer[1][2];
+ //ret[1].badges=trainer[1].badges; //trainer[1][3];
+ return ret;
+ }
+ else {
+ ITrainer[] ret=new Trainer[] { new Trainer(trainer[0].Name, trainer[0].ID) };//(trainer[0][1], trainer[0][0])
+ ret[0].id=trainer[0].TrainerID; //trainer[0][2];
+ //ret[0].badges=trainer[0].badges; //trainer[0][3];
+ return ret;
+ }
+ }
+
+ public static ITrainer[] CreateTrainerInfo(ITrainer[] trainer) {
if (trainer == null) return null;
if (trainer.Length>1) {
ITrainer[] ret=new Trainer[2];
ret[0]=new Trainer(trainer[0].fullname, trainer[0].trainertype); //trainer[0][1],trainer[0][0]
ret[0].id=trainer[0].id; //trainer[0][2];
- //ret[0].badges=trainer[0].badges; //trainer[0][3];
+ ret[0].badges=trainer[0].badges; //trainer[0][3];
//ToDo: for-loop, foreach badge in array, assign same value to second variable
ret[1]=new Trainer(trainer[1].fullname, trainer[1].trainertype); //trainer[1][1],trainer[1][0]
ret[1].id=trainer[1].id; //trainer[1][2];
- //ret[1].badges=trainer[1].badges; //trainer[1][3];
+ ret[1].badges=trainer[1].badges; //trainer[1][3];
return ret;
}
else {
ITrainer[] ret=new Trainer[] { new Trainer(trainer[0].fullname, trainer[0].trainertype) };//(trainer[0][1], trainer[0][0])
- ret[0].trainertype=trainer[0].trainertype; //trainer[0][2];
- //ret[0].badges=trainer[0].badges; //trainer[0][3];
+ ret[0].id=trainer[0].id; //trainer[0][2];
+ ret[0].badges=trainer[0].badges; //trainer[0][3];
return ret;
}
}
@@ -211,70 +237,98 @@ public static ITrainer[] pbCreateTrainerInfo(ITrainer[] trainer) {
/// Playback?
///
///
- public class PokeBattle_BattlePlayerModule : PokeBattle_RecordedBattleModule, IBattlePlayerModule
- //where TBattle : PokeBattle_RecordedBattleModule, IRecordedBattleModule, IBattle, IBattleRecordData
+ //public class PokeBattle_BattlePlayerModule : Battle, IBattlePlayerModule, IBattle
+ //public class PokeBattle_BattlePlayerModule : PokeBattle_RecordedBattleModule, IBattlePlayerModule where T : IRecordedBattleModule
+ //public class PokeBattle_BattlePlayerModule : PokeBattle_RecordedBattleModule, IBattlePlayerModule
+ // //where TBattle : PokeBattle_RecordedBattleModule, IRecordedBattleModule, IBattle, IBattleRecordData
+ public class PokeBattle_BattlePlayerModule : PokeBattle_RecordedBattleModule, IBattlePlayerModule where T : IRecordedBattleModule, IBattle, IBattleRecordData
{
#region Variables
public int randomindex { get; protected set; }
public int switchindex { get; protected set; }
- #endregion
- public PokeBattle_BattlePlayerModule(IPokeBattle_Scene scene, IPokeBattle_RecordedBattleModule battle) : base (scene, battle.party1, battle.party2, battle.player, battle.opponent)
- { (this as IBattlePlayerModule).initialize(scene, battle); }
- public IBattlePlayerModule initialize(IPokeBattle_Scene scene, IBattle battle)
+ //Inherited from IRecordedBattleModule
+ /*public IList randomnumbers { get; protected set; }
+ //public IList rounds { get; protected set; }
+ public IList?[]> rounds { get; protected set; }
+ public int battletype { get; protected set; }
+ public IBattleMetaData properties { get; protected set; }
+ public int roundindex { get; protected set; }
+ public IList switches { get; protected set; }*/
+ #endregion
+
+ public PokeBattle_BattlePlayerModule(IPokeBattle_Scene scene, IBattle battle) : base (scene, battle.party1, battle.party2, battle.player, battle.opponent)
+ //{ (this as IBattlePlayerModule).initialize(scene, (IRecordedBattleModule)battle); }
+ { initialize(scene, (IRecordedBattleModule)battle); }
+ //public PokeBattle_BattlePlayerModule(IPokeBattle_Scene scene, IRecordedBattleModule battle) : base (scene, battle.party1, battle.party2, battle.player, battle.opponent)
+ //{ (this as IBattlePlayerModule).initialize(scene, battle); }
+ public IBattlePlayerModule initialize(IPokeBattle_Scene scene, IRecordedBattleModule battle)
{
- @battletype=battle.battletype;
+ @battletype=battle.GetBattleType(); //battle.battletype;
@properties=battle.properties;
@rounds=battle.rounds;
- randomnumbers=battle.randomnums;
+ randomnumbers=battle.randomnumbers;
@switches=battle.switches;
@roundindex=-1;
@randomindex=0;
@switchindex=0;
//base.initialize(scene,
- // Marshal.restore(new StringInput(@properties["party1"])),
- // Marshal.restore(new StringInput(@properties["party2"])),
- // BattlePlayerHelper.pbCreateTrainerInfo(@properties["player"]),
- // BattlePlayerHelper.pbCreateTrainerInfo(@properties["opponent"])
+ // @properties.party1, //(IPokemon[])@properties["party1"], //Marshal.restore(new StringInput(@properties["party1"])),
+ // @properties.party2, //(IPokemon[])@properties["party2"], //Marshal.restore(new StringInput(@properties["party2"])),
+ // BattlePlayerHelper.CreateTrainerInfo(@properties.player), //(ITrainer[])@properties["player"]),
+ // BattlePlayerHelper.CreateTrainerInfo(@properties.opponent) //(ITrainer[])@properties["opponent"])
//);
+ return this;
+ }
+
+ //IBattlePlayerModule IBattlePlayerModule.initialize(IPokeBattle_Scene scene, IBattle battle)
+ IBattlePlayerModule IBattlePlayerModule.initialize(IPokeBattle_Scene scene, IBattle battle)
+ {
+ // Check if battle can be cast to IRecordedBattleModule
+ //if (battle is IRecordedBattleModule recordedBattle)
+ //{
+ // return initialize(scene, recordedBattle);
+ //}
+ //throw new ArgumentException("Battle must be of type IRecordedBattleModule");
+ return initialize(scene, (IRecordedBattleModule)battle);
}
#region Methods
- public override BattleResults pbStartBattle(bool canlose=false) {
- //@internalbattle=@properties["internalbattle"];
- //@endspeech=@properties["endspeech"].ToString();
- //@endspeech2=@properties["endspeech2"].ToString();
- //@endspeechwin=@properties["endspeechwin"].ToString();
- //@endspeechwin2=@properties["endspeechwin2"].ToString();
- //@doublebattle=(bool)@properties["doublebattle"];
- //@weather=@properties["weather"];
- //@weatherduration=@properties["weatherduration"];
- //@cantescape=(bool)@properties["cantescape"];
- //@shiftStyle=(bool)@properties["shiftStyle"];
- //@battlescene=@properties["battlescene"];
- //@items=Marshal.restore(new StringInput(@properties["items"]));
- //@rules=Marshal.restore(new StringInput(@properties["rules"]));
- //@environment=@properties["environment"];
- return base.pbStartBattle(canlose);
- }
-
- public int pbSwitchInBetween(int i1,int i2,bool i3) {
+ public override BattleResults StartBattle(bool canlose=false) {
+ @internalbattle =Core.INTERNAL;//@properties.internalbattle; //Core.INTERNAL;//@properties["internalbattle"];
+ @endspeech =@properties.endspeech.ToString(); //@properties["endspeech"].ToString();
+ @endspeech2 =@properties.endspeech2.ToString(); //@properties["endspeech2"].ToString();
+ @endspeechwin =@properties.endspeechwin.ToString(); //@properties["endspeechwin"].ToString();
+ @endspeechwin2 =@properties.endspeechwin2.ToString(); //@properties["endspeechwin2"].ToString();
+ @doublebattle =(bool)@properties.doublebattle; //(bool)@properties["doublebattle"];
+ @weather =(Weather)@properties.weather; //(Weather)@properties["weather"];
+ @weatherduration =(int)@properties.weatherduration; //(int)@properties["weatherduration"];
+ @cantescape =(bool)@properties.cantescape; //(bool)@properties["cantescape"];
+ @shiftStyle =(bool)@properties.shiftStyle; //(bool)@properties["shiftStyle"];
+ @battlescene =(bool)@properties.battlescene; //(bool)@properties["battlescene"];
+ @items =(Items[][])@properties.items; //(Items[][])@properties["items"]; //Marshal.restore(new StringInput(@properties["items"]));
+ @rules =(IDictionary)@properties.rules; //(IDictionary)@properties["rules"]; //Marshal.restore(new StringInput(@properties["rules"]));
+ @environment =(Overworld.Environments)@properties.environment; //(Overworld.Environments)@properties["environment"];
+ return base.StartBattle(canlose);
+ }
+
+ public int SwitchInBetween(int i1,int i2,bool i3) {
int ret=@switches[@switchindex];
@switchindex+=1;
return ret;
}
- public override int pbRandom(int num) {
+ public override int Random(int num) {
int ret=randomnumbers[@randomindex];
@randomindex+=1;
return ret;
}
- public override void pbDisplayPaused(string str) {
- pbDisplay(str);
+ public override void DisplayPaused(string str) {
+ Display(str);
}
- public void pbCommandPhaseCore() {
+ public void CommandPhaseCore() {
@roundindex+=1;
for (int i = 0; i < battlers.Length; i++) {
//if (@rounds[@roundindex][i].Length==0) continue;
@@ -284,30 +338,30 @@ public void pbCommandPhaseCore() {
//@choices[i][2]=null;
//@choices[i][3]=-1;
@choices[i]=new Choice();
- switch (@rounds[@roundindex][i].Key) { //@rounds[@roundindex][i][0]
+ switch (@rounds[@roundindex][i].Value.Key) { //@rounds[@roundindex][i][0]
case MenuCommands.FIGHT:
- if (@rounds[@roundindex][i].Value==-1) { //@rounds[@roundindex][i][1]==-1
- pbAutoChooseMove(i,false);
+ if (@rounds[@roundindex][i].Value.Value==-1) { //@rounds[@roundindex][i][1]==-1
+ AutoChooseMove(i,false);
}
else {
- ///pbRegisterMove(i,@rounds[@roundindex][i][1]);
- pbRegisterMove(i,@rounds[@roundindex][i].Value);
+ ///RegisterMove(i,@rounds[@roundindex][i][1]);
+ RegisterMove(i,@rounds[@roundindex][i].Value.Value);
}
//if (@rounds[@roundindex][i][2]!=null)
- //pbRegisterTarget(i,@rounds[@roundindex][i][2]);
- pbRegisterTarget(i,@rounds[@roundindex][i].Value); //ToDo: Select target for Move choosen
+ //RegisterTarget(i,@rounds[@roundindex][i][2]);
+ RegisterTarget(i,@rounds[@roundindex][i].Value.Value); //ToDo: Select target for Move chosen
break;
case MenuCommands.POKEMON:
- //pbRegisterSwitch(i,@rounds[@roundindex][i][1]);
- pbRegisterSwitch(i,@rounds[@roundindex][i].Value);
+ //RegisterSwitch(i,@rounds[@roundindex][i][1]);
+ RegisterSwitch(i,@rounds[@roundindex][i].Value.Value);
break;
case MenuCommands.BAG:
- //pbRegisterItem(i,(Items)@rounds[@roundindex][i][1]);
- pbRegisterItem(i,(Items)@rounds[@roundindex][i].Value);
+ //RegisterItem(i,(Items)@rounds[@roundindex][i][1]);
+ RegisterItem(i,(Items)@rounds[@roundindex][i].Value.Value);
break;
case MenuCommands.RUN:
//@decision=(BattleResults)@rounds[@roundindex][i][1];
- @decision=(BattleResults)@rounds[@roundindex][i].Value;
+ @decision=(BattleResults)@rounds[@roundindex][i].Value.Value;
break;
}
}
@@ -315,24 +369,51 @@ public void pbCommandPhaseCore() {
#endregion
}
- public class PokeBattle_RecordedBattle : PokeBattle_RecordedBattleModule, IRecordedBattle {
+ //public class PokeBattle_RecordedBattle : PokeBattle_RecordedBattleModule, IRecordedBattle {
+ /*public class PokeBattle_RecordedBattle : PokeBattle_RecordedBattleModule, IRecordedBattle {
//include PokeBattle_RecordedBattleModule;
public PokeBattle_RecordedBattle(IPokeBattle_Scene scene, PokemonEssentials.Interface.PokeBattle.IPokemon[] p1, PokemonEssentials.Interface.PokeBattle.IPokemon[] p2, ITrainer[] player, ITrainer[] opponent) : base(scene, p1, p2, player, opponent)
{
}
- public override int pbGetBattleType() {
+ public override int GetBattleType() {
return 0;
}
}
public class PokeBattle_RecordedBattlePalace : PokeBattle_RecordedBattleModule, IRecordedBattlePalace {
//include PokeBattle_RecordedBattleModule;
+ public int[] BattlePalaceUsualTable { get { return Instance.BattlePalaceUsualTable; } }
+
+ public int[] BattlePalacePinchTable { get { return Instance.BattlePalaceUsualTable; } }
+
public PokeBattle_RecordedBattlePalace(IPokeBattle_Scene scene, PokemonEssentials.Interface.PokeBattle.IPokemon[] p1, PokemonEssentials.Interface.PokeBattle.IPokemon[] p2, ITrainer[] player, ITrainer[] opponent) : base(scene, p1, p2, player, opponent)
{
+ //Instance = (TBattle)this;
}
- public override int pbGetBattleType() {
+
+ PokemonEssentials.Interface.PokeBattle.IBattlePalace PokemonEssentials.Interface.PokeBattle.IBattlePalace.initialize(IPokeBattle_Scene scene, IPokemon[] p1, IPokemon[] p2, ITrainer[] player, ITrainer[] opponent)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override int GetBattleType() {
return 1;
}
+
+ public int MoveCategory(IBattleMove move)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool CanChooseMovePartial(int idxPokemon, int idxMove)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void PinchChange(int idxPokemon)
+ {
+ throw new NotImplementedException();
+ }
}
public class PokeBattle_RecordedBattleArena : PokeBattle_RecordedBattleModule, IRecordedBattleArena {
@@ -340,29 +421,97 @@ public class PokeBattle_RecordedBattleArena : PokeBattle_RecordedBattleModule>, IBattlePlayer {
+ public class PokeBattle_BattlePlayer : PokeBattle_BattlePlayerModule>, IBattlePlayerModule, IBattlePlayer {
//include PokeBattle_BattlePlayerModule;
public PokeBattle_BattlePlayer(IPokeBattle_Scene scene, PokeBattle_RecordedBattleModule battle) : base(scene, battle)
{
}
+ public IBattle initialize(PokemonEssentials.Interface.Screen.IPokeBattle_Scene scene, IBattle battle)
+ {
+ throw new NotImplementedException();
+ }
+
+ IBattlePlayerModule IBattlePlayerModule.initialize(IPokeBattle_Scene scene, IBattle battle)
+ {
+ throw new NotImplementedException();
+ }
+
+ IBattlePlayerModule IBattlePlayerModule.initialize(IPokeBattle_Scene scene, IBattle battle)
+ {
+ throw new NotImplementedException();
+ }
}
- public class PokeBattle_BattlePalacePlayer : PokeBattle_BattlePlayerModule>, IBattlePalacePlayer {
+ public class PokeBattle_BattlePalacePlayer : PokeBattle_BattlePlayerModule>, IBattlePlayerModule, IBattlePalacePlayer {
//include PokeBattle_BattlePlayerModule;
+
+ public int[] BattlePalaceUsualTable => throw new NotImplementedException();
+
+ public int[] BattlePalacePinchTable => throw new NotImplementedException();
+
public PokeBattle_BattlePalacePlayer(IPokeBattle_Scene scene, PokeBattle_RecordedBattleModule battle) : base(scene, battle)
{
}
+
+ public IBattle initialize(PokemonEssentials.Interface.Screen.IPokeBattle_Scene scene, IBattle battle)
+ {
+ throw new NotImplementedException();
+ }
+
+ IBattlePlayerModule IBattlePlayerModule.initialize(IPokeBattle_Scene scene, IBattle battle)
+ {
+ throw new NotImplementedException();
+ }
+
+ PokemonEssentials.Interface.PokeBattle.IBattlePalace PokemonEssentials.Interface.PokeBattle.IBattlePalace.initialize(IPokeBattle_Scene scene, IPokemon[] p1, IPokemon[] p2, ITrainer[] player, ITrainer[] opponent)
+ {
+ throw new NotImplementedException();
+ }
+
+ IBattlePlayerModule IBattlePlayerModule.initialize(IPokeBattle_Scene scene, IBattle battle)
+ {
+ throw new NotImplementedException();
+ }
+
+ public bool CanChooseMovePartial(int idxPokemon, int idxMove)
+ {
+ throw new NotImplementedException();
+ }
+
+ public int MoveCategory(IBattleMove move)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void PinchChange(int idxPokemon)
+ {
+ throw new NotImplementedException();
+ }
}
- public class PokeBattle_BattleArenaPlayer : PokeBattle_BattlePlayerModule>, IBattleArenaPlayer {
+ public class PokeBattle_BattleArenaPlayer : PokeBattle_BattlePlayerModule>, IBattlePlayerModule, IBattleArenaPlayer {
//include PokeBattle_BattlePlayerModule;
public PokeBattle_BattleArenaPlayer(IPokeBattle_Scene scene, PokeBattle_RecordedBattleModule battle) : base(scene, battle)
{
}
+ public IBattle initialize(PokemonEssentials.Interface.Screen.IPokeBattle_Scene scene, IBattle battle)
+ {
+ throw new NotImplementedException();
+ }
}*/
}
\ No newline at end of file
diff --git a/PokemonUnity.Application/Combat/Match/Regulated/OrgBattle.cs b/PokemonUnity.Application/Combat/Match/Regulated/OrgBattle.cs
new file mode 100644
index 000000000..29a8bacba
--- /dev/null
+++ b/PokemonUnity.Application/Combat/Match/Regulated/OrgBattle.cs
@@ -0,0 +1,1084 @@
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using PokemonUnity;
+using PokemonUnity.Monster;
+using PokemonUnity.Inventory;
+using PokemonUnity.Utility;
+using PokemonEssentials.Interface;
+using PokemonEssentials.Interface.Battle;
+using PokemonEssentials.Interface.Screen;
+using PokemonEssentials.Interface.PokeBattle;
+using PokemonUnity.Combat;
+
+namespace PokemonUnity
+{
+ /*public partial class Game : PokemonEssentials.Interface.Battle.IGameOrgBattle
+ {
+ // ===============================================================================
+ // Pokémon Organized Battle
+ // ===============================================================================
+ public bool HasEligible (*arg) {
+ return BattleChallenge.rules.ruleset.hasValidTeam(Game.GameData.Trainer.party);
+ }
+
+ public void GetBTTrainers(challengeID) {
+ trlists=(load_data("Data/trainerlists.dat") rescue []);
+ for (int i = 0; i < trlists.Length; i++) {
+ tr=trlists[i];
+ if (!tr[5] && tr[2].Contains(challengeID)) {
+ return tr[0];
+ }
+ }
+ for (int i = 0; i < trlists.Length; i++) {
+ tr=trlists[i];
+ if (tr[5]) { // is default list
+ return tr[0];
+ }
+ }
+ return [];
+ }
+
+ public void GetBTPokemon(challengeID) {
+ trlists=(load_data("Data/trainerlists.dat") rescue []);
+ foreach (var tr in trlists) {
+ if (!tr[5] && tr[2].Contains(challengeID)) {
+ return tr[1];
+ }
+ }
+ foreach (var tr in trlists) {
+ if (tr[5]) { // is default list
+ return tr[1];
+ }
+ }
+ return [];
+ }
+
+ public void RecordLastBattle() {
+ Game.GameData.Global.lastbattle=Game.GameData.PokemonTemp.lastbattle;
+ Game.GameData.PokemonTemp.lastbattle=null;
+ }
+
+ public void PlayBattle(battledata) {
+ if (battledata) {
+ scene=NewBattleScene;
+ scene.abortable=true;
+ lastbattle=Marshal.restore(new StringInput(battledata));
+ switch (lastbattle[0]) {
+ case BattleChallenge.eattleTower:
+ battleplayer=new PokeBattle_BattlePlayer(scene,lastbattle);
+ break;
+ case BattleChallenge.eattlePalace:
+ battleplayer=new PokeBattle_BattlePalacePlayer(scene,lastbattle);
+ break;
+ case BattleChallenge.eattleArena:
+ battleplayer=new PokeBattle_BattleArenaPlayer(scene,lastbattle);
+ break;
+ }
+ bgm=BattlePlayerHelper.GetBattleBGM(lastbattle);
+ BattleAnimation(bgm) {
+ SceneStandby {
+ decision=battleplayer.StartBattle;
+ }
+ }
+ }
+ }
+
+ public void DebugPlayBattle() {
+ params=new ChooseNumberParams();
+ params.setRange(0,500);
+ params.setInitialValue(0);
+ params.setCancelValue(-1);
+ num=Kernel.MessageChooseNumber(_INTL("Choose a battle."),params);
+ if (num>=0) {
+ PlayBattleFromFile(string.Format("Battles/Battle%03d.dat",num));
+ }
+ }
+
+ public void PlayLastBattle() {
+ PlayBattle(Game.GameData.Global.lastbattle);
+ }
+
+ public void PlayBattleFromFile(filename) {
+ RgssOpen(filename,"rb"){|f|
+ PlayBattle(f.read);
+ }
+ }
+
+ public void BattleChallenge() {
+ if (!Game.GameData.Global.challenge) {
+ Game.GameData.Global.challenge=new BattleChallenge();
+ }
+ return Game.GameData.Global.challenge;
+ }
+
+ public void BattleChallengeTrainer(numwins,bttrainers) {
+ table=new int[]
+ 0,5,0,100,
+ 6,6,80,40,
+ 7,12,80,40,
+ 13,13,120,20,
+ 14,19,100,40,
+ 20,20,140,20,
+ 21,26,120,40,
+ 27,27,160,20,
+ 28,33,140,40,
+ 34,34,180,20,
+ 35,40,160,40,
+ 41,41,200,20,
+ 42,47,180,40,
+ 48,48,220,40,
+ 49,-1,200,100
+ };
+ for (int i = 0; i < table.Length/4; i++) {
+ if (table[i*4]<=numwins) {
+ if ((table[i*4+1]<0 || table[i*4+1]>=numwins)) {
+ offset=((table[i*4+2]*bttrainers.Length).floor/300).floor;
+ length=((table[i*4+3]*bttrainers.Length).floor/300).floor;
+ return (offset+Core.Rand.Next(length)).floor;
+ }
+ }
+ }
+ return 0;
+ }
+
+ public void BattleChallengeGraphic(event) {
+ nextTrainer=BattleChallenge.nextTrainer;
+ bttrainers=GetBTTrainers(BattleChallenge.currentChallenge);
+ filename=TrainerCharNameFile((bttrainers[nextTrainer][0] rescue 0));
+ begin;
+ bitmap=new AnimatedBitmap("Graphics/Characters/"+filename);
+ bitmap.dispose();
+ event.character_name=filename;
+ rescue;
+ event.character_name="NPC 01";
+ }
+ }
+
+ public void BattleChallengeBeginSpeech() {
+ if (!BattleChallenge.InProgress?) {
+ return "...";
+ } else {
+ bttrainers=GetBTTrainers(BattleChallenge.currentChallenge);
+ tr=bttrainers[BattleChallenge.nextTrainer];
+ return tr ? GetMessageFromHash(MessageTypes.seginSpeech,tr[2]) : "...";
+ }
+ }
+
+ public void EntryScreen(*arg) {
+ retval=false;
+ FadeOutIn(99999){
+ scene=new PokemonScreen_Scene();
+ screen=new PokemonScreen(scene,Game.GameData.Trainer.party);
+ ret=screen.PokemonMultipleEntryScreenEx(BattleChallenge.rules.ruleset);
+ // Set party
+ if (ret) BattleChallenge.setParty(ret);
+ // Continue (return true) if Pokémon were chosen
+ retval=(ret!=null && ret.Length>0);
+ }
+ return retval;
+ }
+
+ public void BattleChallengeBattle() {
+ return BattleChallenge.Battle;
+ }
+
+ public void BattleFactoryPokemon(rule,numwins,numswaps,rentals) {
+ table=null;
+ btpokemon=GetBTPokemon(BattleChallenge.currentChallenge);
+ ivtable=new int[] {
+ 0,6,3,6,
+ 7,13,6,9,
+ 14,20,9,12,
+ 21,27,12,15,
+ 28,34,15,21,
+ 35,41,21,31,
+ 42,-1,31,31
+ };
+ groups=new int[]
+ 1,14,6,0,
+ 15,21,5,1,
+ 22,28,4,2,
+ 29,35,3,3,
+ 36,42,2,4,
+ 43,-1,1,5
+ };
+ if (rule.ruleset.suggestedLevel!=100) {
+ table=new int[] {
+ 0,6,110,199,
+ 7,13,162,266,
+ 14,20,267,371,
+ 21,27,372,467,
+ 28,34,468,563,
+ 35,41,564,659,
+ 42,48,660,755,
+ 49,-1,372,849
+ };
+ } else { // Open Level (Level 100)
+ table=new int[] {
+ 0,6,372,467,
+ 7,13,468,563,
+ 14,20,564,659,
+ 21,27,660,755,
+ 28,34,372,881,
+ 35,41,372,881,
+ 42,48,372,881,
+ 49,-1,372,881
+ };
+ }
+ pokemonNumbers= new []{ 0,0 };
+ ivs= new []{ 0,0 };
+ ivgroups= new []{ 6,0 };
+ for (int i = 0; i < table.Length/4; i++) {
+ if (table[i*4]<=numwins) {
+ if ((table[i*4+1]<0 || table[i*4+1]>=numwins)) {
+ pokemonNumbers=new int[] {
+ table[i*4+2]*btpokemon.Length/882,
+ table[i*4+3]*btpokemon.Length/882
+ };
+ }
+ }
+ }
+ for (int i = 0; i < ivtable.Length/4; i++) {
+ if (ivtable[i*4]<=numwins) {
+ if ((ivtable[i*4+1]<0 || ivtable[i*4+1]>=numwins)) {
+ ivs=[ivtable[i*4+2],ivtable[i*4+3]];
+ }
+ }
+ }
+ for (int i = 0; i < groups.Length/4; i++) {
+ if (groups[i*4]<=numswaps) {
+ if ((groups[i*4+1]<0 || groups[i*4+1]>=numswaps)) {
+ ivgroups=[groups[i*4+2],groups[i*4+3]];
+ }
+ }
+ }
+ party=new List<>();
+ do {
+ party.clear();
+ while (party.Length<6) {
+ rnd=pokemonNumbers[0]+Core.Rand.Next(pokemonNumbers[1]-pokemonNumbers[0]+1);
+ rndpoke=btpokemon[rnd];
+ indvalue=(party.Length shuffle(this IList array) {
+ // int size = array.Count;
+ // IPokemon[] tempa = new IPokemon[size];
+ // int i = size; do { //|i|
+ // int r = Kernel.Core.Rand.Next(i); //size
+ // //array[i], array[r] = array[r], array[i];
+ // T temp = array[i];
+ // array[i] = array[r];
+ // array[r] = temp;
+ // i--;
+ // } while (i > 0); //size.times
+ // return this;
+ // //unless (method_defined? :shuffle!)
+ // }
+ //}
+
+ //public static partial class Enumerable {
+ // public void transform() {
+ // ret=[];
+ // this.each(){|item| ret.Add(yield(item)) }
+ // return ret;
+ // }
+ //}
+
+ public partial class PBPokemon {
+ public int species { get; protected set; }
+ public int item { get; protected set; }
+ public int nature { get; protected set; }
+ public int move1 { get; protected set; }
+ public int move2 { get; protected set; }
+ public int move3 { get; protected set; }
+ public int move4 { get; protected set; }
+ public int ev { get; protected set; }
+
+ //public Pokemon(species,item,nature,move1,move2,move3,move4,ev) {
+ // @species=species;
+ // @item=item ? item : 0;
+ // @nature=nature;
+ // @move1=move1 ? move1 : 0;
+ // @move2=move2 ? move2 : 0;
+ // @move3=move3 ? move3 : 0;
+ // @move4=move4 ? move4 : 0;
+ // @ev=ev;
+ //}
+
+ /*=begin;
+ public void _dump(depth) {
+ return [@species,@item,@nature,@move1,@move2,
+ @move3,@move4,@ev].pack("vvCvvvvC");
+ }
+
+ public static void _load(str) {
+ data=str.unpack("vvCvvvvC");
+ return new this(
+ data[0],data[1],data[2],data[3],
+ data[4],data[5],data[6],data[7];
+ );
+ }
+ =end;*/
+
+ //public static void fromInspected(str) {
+ // insp=str.gsub(/^\s+/,"").gsub(/\s+$/,"");
+ // pieces=insp.split(/\s*;\s*/);
+ // species=1;
+ // if ((Species.const_defined(pieces[0]) rescue false)) {
+ // species=Species.const_get(pieces[0]);
+ // }
+ // item=0;
+ // if ((Items.const_defined(pieces[1]) rescue false)) {
+ // item=Items.const_get(pieces[1]);
+ // }
+ // nature=Natures.const_get(pieces[2]);
+ // ev=pieces[3].split(/\s*,\s*/);
+ // evvalue=0;
+ // for (int i = 0; i < 6; i++) {
+ // if (!ev[i]||ev[i]=="") continue;
+ // evupcase=ev[i].upcase;
+ // if (evupcase=="HP") evvalue|=0x01;
+ // if (evupcase=="ATK") evvalue|=0x02;
+ // if (evupcase=="DEF") evvalue|=0x04;
+ // if (evupcase=="SPD") evvalue|=0x08;
+ // if (evupcase=="SA") evvalue|=0x10;
+ // if (evupcase=="SD") evvalue|=0x20;
+ // }
+ // moves=pieces[4].split(/\s*,\s*/);
+ // moveid=[];
+ // for (int i = 0; i < 4; i++) {
+ // if ((Moves.const_defined(moves[i]) rescue false)) {
+ // moveid.Add(Moves.const_get(moves[i]));
+ // }
+ // }
+ // if (moveid.Length==0) moveid= new []{ 1 };
+ // return new this(species,item,nature,
+ // moveid[0],(moveid[1]||0),(moveid[2]||0),(moveid[3]||0),evvalue);
+ //}
+ //
+ //public static void fromPokemon(pokemon) {
+ // evvalue=0;
+ // if (pokemon.ev[0]>60) evvalue|=0x01;
+ // if (pokemon.ev[1]>60) evvalue|=0x02;
+ // if (pokemon.ev[2]>60) evvalue|=0x04;
+ // if (pokemon.ev[3]>60) evvalue|=0x08;
+ // if (pokemon.ev[4]>60) evvalue|=0x10;
+ // if (pokemon.ev[5]>60) evvalue|=0x20;
+ // return new this(pokemon.Species,pokemon.Item,pokemon.nature,
+ // pokemon.moves[0].id,pokemon.moves[1].id,pokemon.moves[2].id,
+ // pokemon.moves[3].id,evvalue);
+ //}
+ //
+ //public void inspect() {
+ // c1=getConstantName(Species,@species);
+ // c2=(@item==0) ? "" : getConstantName(Items,@item);
+ // c3=getConstantName(Natures,@nature);
+ // evlist="";
+ // for (int i = 0; i < @ev; i++) {
+ // if (((@ev&(1<0) evlist+=",";
+ // evlist+= new []{ "HP","ATK","DEF","SPD","SA","SD" }[i];
+ // }
+ // }
+ // c4=(@move1==0) ? "" : getConstantName(Moves,@move1);
+ // c5=(@move2==0) ? "" : getConstantName(Moves,@move2);
+ // c6=(@move3==0) ? "" : getConstantName(Moves,@move3);
+ // c7=(@move4==0) ? "" : getConstantName(Moves,@move4);
+ // return "#{c1};#{c2};#{c3};#{evlist};#{c4},#{c5},#{c6},#{c7}";
+ //}
+ //
+ //public void tocompact() {
+ // return "#{species},#{item},#{nature},#{move1},#{move2},#{move3},#{move4},#{ev}";
+ //}
+ //
+ //public static void constFromStr(mod,str) {
+ // maxconst=0;
+ // foreach (var constant in mod.constants) {
+ // maxconst=[maxconst,mod.const_get(constant.to_sym)].max;
+ // }
+ // for (int i = 1; i < maxconst; i++) {
+ // val=i.ToString(TextScripts.Name);
+ // if (!val || val=="") continue;
+ // if (val==str) return i;
+ // }
+ // return 0;
+ //}
+ //
+ //public static void fromString(str) {
+ // return this.fromstring(str);
+ //}
+ //
+ //public static void fromstring(str) {
+ // s=str.split(/\s*,\s*/);
+ // species=this.constFromStr(Species,s[1]);
+ // item=this.constFromStr(Items,s[2]);
+ // nature=this.constFromStr(Natures,s[3]);
+ // move1=this.constFromStr(Moves,s[4]);
+ // move2=(s.Length>=12) ? this.constFromStr(Moves,s[5]) : 0;
+ // move3=(s.Length>=13) ? this.constFromStr(Moves,s[6]) : 0;
+ // move4=(s.Length>=14) ? this.constFromStr(Moves,s[7]) : 0;
+ // ev=0;
+ // slen=s.Length-6;
+ // if (s[slen].to_i>0) ev|=0x01;
+ // if (s[slen+1].to_i>0) ev|=0x02;
+ // if (s[slen+2].to_i>0) ev|=0x04;
+ // if (s[slen+3].to_i>0) ev|=0x08;
+ // if (s[slen+4].to_i>0) ev|=0x10;
+ // if (s[slen+5].to_i>0) ev|=0x20;
+ // return new this(species,item,nature,move1,move2,move3,move4,ev);
+ //}
+ //
+ //public void convertMove(move) {
+ // if (move == Moves.RETURN && hasConst(Moves,:FRUSTRATION)) {
+ // move=Moves.FRUSTRATION;
+ // }
+ // return move;
+ //}
+ //
+ //public void createPokemon(level,iv,trainer) {
+ // pokemon=new PokeBattle_Pokemon(@species,level,trainer,false);
+ // pokemon.setItem(@item);
+ // pokemon.personalID=Core.Rand.Next(65536);
+ // pokemon.personalID|=Core.Rand.Next(65536)<<8;
+ // pokemon.personalID-=pokemon.personalID%25;
+ // pokemon.personalID+=nature;
+ // pokemon.personalID&=0xFFFFFFFF;
+ // pokemon.happiness=0;
+ // pokemon.moves[0]=new Move(this.convertMove(@move1));
+ // pokemon.moves[1]=new Move(this.convertMove(@move2));
+ // pokemon.moves[2]=new Move(this.convertMove(@move3));
+ // pokemon.moves[3]=new Move(this.convertMove(@move4));
+ // evcount=0;
+ // for (int i = 0; i < 6; i++) {
+ // if (((@ev&(1< trainers;// { get; protected set; }
+
+ public BattleChallengeData() {
+ initialize();
+ }
+
+ public IBattleChallengeData initialize() {
+ reset();
+ return this;
+ }
+
+ public void setExtraData(IBattleFactoryData value) {
+ @extraData=value;
+ }
+
+ public void AddWin() {
+ if (@inProgress) {
+ @battleNumber+=1;
+ @wins+=1;
+ }
+ }
+
+ public void AddSwap() {
+ if (@inProgress) {
+ @swaps+=1;
+ }
+ }
+
+ public bool MatchOver() {
+ if (!@inProgress) return true;
+ if (@decision!=0) return true;
+ return (@battleNumber>@numRounds);
+ }
+
+ public int nextTrainer { get {
+ return @trainers[@battleNumber-1];
+ } }
+
+ public void GoToStart() {
+ if (Game.GameData.Scene is ISceneMap) {
+ Game.GameData.GameTemp.player_transferring = true;
+ Game.GameData.GameTemp.player_new_map_id = @start.MapId; //@start[0];
+ Game.GameData.GameTemp.player_new_x = @start.X; //@start[1];
+ Game.GameData.GameTemp.player_new_y = @start.Y; //@start[2];
+ Game.GameData.GameTemp.player_new_direction = 8;
+ Game.GameData.Scene.transfer_player();
+ }
+ }
+
+ public void setParty(IPokemon[] value) {
+ if (@inProgress) {
+ Game.GameData.Trainer.party=value;
+ @party=value;
+ } else {
+ @party=value;
+ }
+ }
+
+ public void Start(IBattleChallengeType t, int numRounds) {
+ @inProgress=true;
+ @resting=false;
+ @decision=0;
+ @swaps=t.currentSwaps;
+ @wins=t.currentWins;
+ @battleNumber=1;
+ @trainers=new List();
+ //if (numRounds<=0) throw new Exception (Game._INTL("Number of rounds is 0 or less."));
+ if (numRounds<=0) { GameDebug.LogError(Game._INTL("Number of rounds is 0 or less.")); numRounds = 1; }
+ this.numRounds=numRounds;
+ Character.TrainerMetaData[] btTrainers=null;//GetBTTrainers(BattleChallenge.currentChallenge);
+ if (Game.GameData is IGameOrgBattle gob) btTrainers=gob.GetBTTrainers(gob.BattleChallenge.currentChallenge);
+ while (@trainers.Count();
+ @oldParty=null;
+ @party=null;
+ @extraData=null;
+ }
+
+ private void SaveInProgress() {
+ int oldmapid=Game.GameData.GameMap.map_id;
+ float oldx=Game.GameData.GamePlayer.x;
+ float oldy=Game.GameData.GamePlayer.y;
+ int olddirection=Game.GameData.GamePlayer.direction;
+ Game.GameData.GameMap.map_id=@start.MapId; //@start[0];
+ if (Game.GameData.GamePlayer is IGamePlayerOrgBattle gpob) gpob.moveto2(@start.X,@start.Y); //(@start[1],@start[2]);
+ Game.GameData.GamePlayer.direction=8; // facing up
+ if (Game.GameData is IGameSave s) s.Save(true);
+ Game.GameData.GameMap.map_id=oldmapid;
+ if (Game.GameData.GamePlayer is IGamePlayerOrgBattle gpob2) gpob2.moveto2(oldx,oldy);
+ Game.GameData.GamePlayer.direction=olddirection;
+ }
+ }
+
+ public partial class BattleChallenge : PokemonEssentials.Interface.Battle.IBattleChallenge {
+ public int currentChallenge { get; protected set; }
+ protected int id;// { get; protected set; }
+ protected int numRounds;// { get; protected set; }
+ protected IBattleChallengeData bc;// { get; protected set; }
+ protected IPokemonChallengeRules _rules;// { get; protected set; }
+ protected IList types;// { get; protected set; }
+ const int BattleTower = 0;
+ const int BattlePalace = 1;
+ const int BattleArena = 2;
+ const int BattleFactory = 3;
+
+ public BattleChallenge() {
+ initialize();
+ }
+
+ public IBattleChallenge initialize() {
+ @bc=new BattleChallengeData();
+ @currentChallenge=-1;
+ @types=new List