Add forme specific cry detect

dex-form.wav
if not found, reverts to none (dex.wav)

47be96e92d (commitcomment-28950071)
This commit is contained in:
Kurt 2018-05-11 17:40:00 -07:00
parent b933677c44
commit 4fdff9581f

View File

@ -157,9 +157,15 @@ private void PlayCry(PKM pk)
if (pk.Species == 0)
return;
var path = Path.Combine("sounds", $"{pk.Species}.wav");
string resource = $"{pk.Species}-{pk.AltForm}";
var path = Path.Combine("sounds", $"{resource}.wav");
if (!File.Exists(path))
return;
{
resource = $"{pk.Species}";
path = Path.Combine("sounds", $"{resource}.wav");
if (!File.Exists(path))
return;
}
Sounds.SoundLocation = path;
Sounds.Play();