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:
@@ -45,21 +45,21 @@ public class Forecast : Script, IScriptOnSwitchIn, IScriptOnWeatherChange
|
||||
|
||||
private static void ChangeForm(IPokemon pokemon, StringKey? weather)
|
||||
{
|
||||
if (pokemon.Species.Name != "castform")
|
||||
if (pokemon.Species.Name != SpeciesNames.Castform)
|
||||
return;
|
||||
|
||||
if (weather == ScriptUtils.ResolveName<Weather.HarshSunlight>() &&
|
||||
pokemon.Species.TryGetForm("sunny", out var sunnyForm) && pokemon.Form != sunnyForm)
|
||||
pokemon.Species.TryGetForm(FormNames.Sunny, out var sunnyForm) && pokemon.Form != sunnyForm)
|
||||
{
|
||||
pokemon.ChangeForm(sunnyForm);
|
||||
}
|
||||
else if (weather == ScriptUtils.ResolveName<Weather.Rain>() &&
|
||||
pokemon.Species.TryGetForm("rainy", out var rainyForm) && pokemon.Form != rainyForm)
|
||||
pokemon.Species.TryGetForm(FormNames.Rainy, out var rainyForm) && pokemon.Form != rainyForm)
|
||||
{
|
||||
pokemon.ChangeForm(rainyForm);
|
||||
}
|
||||
else if (weather == ScriptUtils.ResolveName<Weather.Hail>() &&
|
||||
pokemon.Species.TryGetForm("snowy", out var snowyForm) && pokemon.Form != snowyForm)
|
||||
pokemon.Species.TryGetForm(FormNames.Snowy, out var snowyForm) && pokemon.Form != snowyForm)
|
||||
{
|
||||
pokemon.ChangeForm(snowyForm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user