Add more entries

This commit is contained in:
zontreck 2025-03-22 21:28:20 -07:00
parent dff8ee1334
commit 0fb6f422fa
17 changed files with 73 additions and 7 deletions

View file

@ -62,10 +62,34 @@ enum Type {
const Type(this.backgroundColor, this.textColor);
}
enum EvolutionCondition {
HighFriendship,
ThunderStone,
WaterStone,
Trading,
MoonStone,
FireStone,
}
class Evolution {
final int to;
final int level;
const Evolution(this.to, this.level);
final EvolutionCondition? condition;
const Evolution(this.to, this.level, {this.condition = null});
String printEvolution() {
String sRet = "";
if (level != -1) {
sRet += "Level $level";
}
if (condition != null) {
if (sRet.isNotEmpty) {
sRet += "\n";
}
sRet += condition.toString().split('.').last;
}
return sRet;
}
}
enum LearnType { TM, HM }
@ -125,7 +149,27 @@ enum Pokemon {
Rattata(19, Generation.One, [Type.Normal], Evolution(20, 20)),
Raticate(20, Generation.One, [Type.Normal], null),
Spearow(21, Generation.One, [Type.Normal, Type.Flying], Evolution(22, 20)),
Fearow(22, Generation.One, [Type.Normal, Type.Flying], null);
Fearow(22, Generation.One, [Type.Normal, Type.Flying], null),
Pikachu(25, Generation.One, [
Type.Electric,
], Evolution(26, -1, condition: EvolutionCondition.ThunderStone)),
Raichu(26, Generation.One, [Type.Electric], null),
Sandshrew(27, Generation.One, [Type.Ground], Evolution(28, 22)),
Sandslash(28, Generation.One, [Type.Ground], null),
NidoranF(29, Generation.One, [Type.Poison], Evolution(30, 16)),
Nidorina(30, Generation.One, [Type.Poison], Evolution(31, 36)),
NidoQueen(31, Generation.One, [Type.Poison, Type.Ground], null),
NidoranM(32, Generation.One, [Type.Poison], Evolution(33, 16)),
Nidorino(33, Generation.One, [Type.Poison], Evolution(34, 36)),
NidoKing(34, Generation.One, [Type.Poison, Type.Ground], null),
Clefairy(35, Generation.One, [
Type.Fairy,
], Evolution(36, -1, condition: EvolutionCondition.MoonStone)),
Clefable(36, Generation.One, [Type.Fairy], null),
Vulpix(37, Generation.One, [
Type.Fire,
], Evolution(38, -1, condition: EvolutionCondition.FireStone)),
NineTales(38, Generation.One, [Type.Fire], null);
final int id;
final Generation generation;
@ -135,7 +179,7 @@ enum Pokemon {
const Pokemon(this.id, this.generation, this.types, this.evolution);
String toDexPath() {
return 'assets/sprites/${name.toLowerCase()}.png';
return 'assets/sprites/${printName().replaceAll("", "-f").replaceAll("", "-m").toLowerCase()}.png';
}
Widget getTypeWidgets() {
@ -159,6 +203,14 @@ enum Pokemon {
return Row(children: widgets);
}
String printName() {
String sRet = name.replaceAll("_", " ");
if (sRet.endsWith("F")) sRet = sRet.substring(0, sRet.length - 1) + "";
if (sRet.endsWith("M")) sRet = sRet.substring(0, sRet.length - 1) + "";
return sRet;
}
List<Widget> getEvolutions(int subID) {
if (!hasEvolutions) return [];
@ -189,7 +241,7 @@ enum Pokemon {
Constants.isMobile ? Icons.arrow_downward : Icons.arrow_forward,
size: 48,
),
Text("Level ${evolution!.level}", style: TextStyle(fontSize: 24)),
Text(evolution!.printEvolution(), style: TextStyle(fontSize: 24)),
],
),
);
@ -217,7 +269,7 @@ enum Pokemon {
size: 48,
),
Text(
"Level ${ev.evolution!.level}",
ev.evolution!.printEvolution(),
style: TextStyle(fontSize: 24),
),
],