diff --git a/assets/sprites/clefable.png b/assets/sprites/clefable.png new file mode 100644 index 0000000..517e8a4 Binary files /dev/null and b/assets/sprites/clefable.png differ diff --git a/assets/sprites/clefairy.png b/assets/sprites/clefairy.png new file mode 100644 index 0000000..0dab6e4 Binary files /dev/null and b/assets/sprites/clefairy.png differ diff --git a/assets/sprites/nidoking.png b/assets/sprites/nidoking.png new file mode 100644 index 0000000..178ac55 Binary files /dev/null and b/assets/sprites/nidoking.png differ diff --git a/assets/sprites/nidoqueen.png b/assets/sprites/nidoqueen.png new file mode 100644 index 0000000..13dddd5 Binary files /dev/null and b/assets/sprites/nidoqueen.png differ diff --git a/assets/sprites/nidoran-f.png b/assets/sprites/nidoran-f.png new file mode 100644 index 0000000..ef36d53 Binary files /dev/null and b/assets/sprites/nidoran-f.png differ diff --git a/assets/sprites/nidoran-m.png b/assets/sprites/nidoran-m.png new file mode 100644 index 0000000..d772001 Binary files /dev/null and b/assets/sprites/nidoran-m.png differ diff --git a/assets/sprites/nidorina.png b/assets/sprites/nidorina.png new file mode 100644 index 0000000..278db05 Binary files /dev/null and b/assets/sprites/nidorina.png differ diff --git a/assets/sprites/nidorino.png b/assets/sprites/nidorino.png new file mode 100644 index 0000000..ed80056 Binary files /dev/null and b/assets/sprites/nidorino.png differ diff --git a/assets/sprites/ninetales.png b/assets/sprites/ninetales.png new file mode 100644 index 0000000..68c1558 Binary files /dev/null and b/assets/sprites/ninetales.png differ diff --git a/assets/sprites/pikachu.png b/assets/sprites/pikachu.png new file mode 100644 index 0000000..b6ccc7b Binary files /dev/null and b/assets/sprites/pikachu.png differ diff --git a/assets/sprites/raichu.png b/assets/sprites/raichu.png new file mode 100644 index 0000000..b93cd82 Binary files /dev/null and b/assets/sprites/raichu.png differ diff --git a/assets/sprites/sandshrew.png b/assets/sprites/sandshrew.png new file mode 100644 index 0000000..f96bf68 Binary files /dev/null and b/assets/sprites/sandshrew.png differ diff --git a/assets/sprites/sandslash.png b/assets/sprites/sandslash.png new file mode 100644 index 0000000..d0979f9 Binary files /dev/null and b/assets/sprites/sandslash.png differ diff --git a/assets/sprites/vulpix.png b/assets/sprites/vulpix.png new file mode 100644 index 0000000..176e7eb Binary files /dev/null and b/assets/sprites/vulpix.png differ diff --git a/lib/Consts.dart b/lib/Consts.dart index 6daf8b8..63f698d 100644 --- a/lib/Consts.dart +++ b/lib/Consts.dart @@ -1,7 +1,7 @@ import 'dart:io'; class Constants { - static const VERSION = "1.0.032225+2037"; + static const VERSION = "1.0.032225+2127"; static bool get isMobile => Platform.isAndroid || Platform.isIOS; } diff --git a/lib/pokemon.dart b/lib/pokemon.dart index 7333144..d86d76d 100644 --- a/lib/pokemon.dart +++ b/lib/pokemon.dart @@ -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 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), ), ], diff --git a/pubspec.yaml b/pubspec.yaml index 2fe894f..45bbdec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.032225+2037 +version: 1.0.032225+2127 environment: sdk: ^3.7.0 @@ -88,6 +88,20 @@ flutter: - assets/sprites/fearow.png - assets/sprites/ekans.png - assets/sprites/arbok.png + - assets/sprites/pikachu.png + - assets/sprites/raichu.png + - assets/sprites/sandshrew.png + - assets/sprites/sandslash.png + - assets/sprites/nidoran-f.png + - assets/sprites/nidorina.png + - assets/sprites/nidoqueen.png + - assets/sprites/nidoran-m.png + - assets/sprites/nidorino.png + - assets/sprites/nidoking.png + - assets/sprites/clefairy.png + - assets/sprites/clefable.png + - assets/sprites/vulpix.png + - assets/sprites/ninetales.png # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/to/resolution-aware-images