Replace all raw string comparisons with StringKey, source generator that creates cache keys for all names for Gen7 plugin
All checks were successful
Build / Build (push) Successful in 2m21s
All checks were successful
Build / Build (push) Successful in 2m21s
This commit is contained in:
@@ -12,7 +12,7 @@ public class ElectricTerrain : Script, IScriptChangeBasePower, IScriptPreventSta
|
||||
if (!IsAffectedByTerrain(move.User))
|
||||
return;
|
||||
var type = move.GetHitData(target, hit).Type;
|
||||
if (type?.Name == "electric")
|
||||
if (type?.Name == TypeNames.Electric)
|
||||
basePower = basePower.MultiplyOrMax(1.5f);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public class GrassyTerrain : Script, IScriptChangeBasePower, IScriptOnEndTurn
|
||||
if (IsAffectedByTerrain(move.User))
|
||||
{
|
||||
var type = move.GetHitData(target, hit).Type;
|
||||
if (type?.Name == "grass")
|
||||
if (type?.Name == TypeNames.Grass)
|
||||
{
|
||||
basePower = basePower.MultiplyOrMax(1.5f);
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class GrassyTerrain : Script, IScriptChangeBasePower, IScriptOnEndTurn
|
||||
if (IsAffectedByTerrain(target))
|
||||
{
|
||||
var moveName = move.UseMove.Name;
|
||||
if (moveName == "bulldoze" || moveName == "earthquake" || moveName == "magnitude")
|
||||
if (moveName == MoveNames.Bulldoze || moveName == MoveNames.Earthquake || moveName == MoveNames.Magnitude)
|
||||
{
|
||||
basePower /= 2;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class MistyTerrain : Script, IScriptChangeBasePower, IScriptPreventStatus
|
||||
{
|
||||
if (!IsAffectedByTerrain(target))
|
||||
return;
|
||||
if (move.GetHitData(target, hit).Type?.Name == "dragon")
|
||||
if (move.GetHitData(target, hit).Type?.Name == TypeNames.Dragon)
|
||||
{
|
||||
basePower /= 2;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class PsychicTerrain : Script, IScriptIsInvulnerableToMove, IScriptChange
|
||||
// It boosts the power of Psychic-type moves used by affected Pokémon by 50% (regardless of whether the target of
|
||||
// the move is affected by Psychic Terrain).
|
||||
var type = move.GetHitData(target, hit).Type;
|
||||
if (type?.Name == "psychic")
|
||||
if (type?.Name == TypeNames.Psychic)
|
||||
{
|
||||
basePower = basePower.MultiplyOrMax(1.5f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user