File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed
Pkmds.Web/Components/EditForms/Tabs Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 92
92
</MudStack >
93
93
}
94
94
95
+ <MudNumericField Label =" Level"
96
+ Variant =" @Variant.Outlined"
97
+ @bind-Value =" @Pokemon.CurrentLevel"
98
+ @bind-Value:after =" @(() => AppService.LoadPokemonStats(Pokemon))"
99
+ For =" @(() => Pokemon.CurrentLevel)" />
100
+
95
101
<MudNumericField Label =" EXP"
96
102
Variant =" @Variant.Outlined"
97
103
@bind-Value =" @Pokemon.EXP"
98
104
@bind-Value:after =" @(() => AppService.LoadPokemonStats(Pokemon))"
99
105
For =" @(() => Pokemon.EXP)" />
100
106
101
- <MudNumericField Label =" Level"
102
- Variant =" @Variant.Outlined"
103
- @bind-Value =" @Pokemon.CurrentLevel"
104
- @bind-Value:after =" @(() => AppService.LoadPokemonStats(Pokemon))"
105
- For =" @(() => Pokemon.CurrentLevel)" />
107
+ <MudNumericField Label =" EXP to next level"
108
+ Value =" @GetEXPToLevelUp()" />
109
+
110
+ @{
111
+ var levelProgress = Experience .GetEXPToLevelUpPercentage (Pokemon .CurrentLevel , Pokemon .EXP , Pokemon .PersonalInfo .EXPGrowth );
112
+ <MudProgressLinear
113
+ Value =" @(levelProgress * 100)"
114
+ Color =" @Color.Primary"
115
+ Size =" @Size.Medium"
116
+ Rounded
117
+ title =" @(levelProgress.ToString(" P " ))" />
118
+ }
106
119
107
120
@if (saveGeneration >= 3 )
108
121
{
Original file line number Diff line number Diff line change @@ -124,4 +124,17 @@ private void SetPokemonPid(string newPidHex)
124
124
}
125
125
126
126
private readonly PatternMask hexMask = new ( "########" ) { MaskChars = [ new ( '#' , "[0-9a-fA-F]" ) ] } ;
127
+
128
+ // ReSharper disable once InconsistentNaming
129
+ private double GetEXPToLevelUp ( )
130
+ {
131
+ if ( Pokemon is not { CurrentLevel : var level and < 100 , EXP : var exp , PersonalInfo . EXPGrowth : var growth } )
132
+ {
133
+ return 0 ;
134
+ }
135
+
136
+ var table = Experience . GetTable ( growth ) ;
137
+ var next = Experience . GetEXP ( ++ level , table ) ;
138
+ return next - exp ;
139
+ }
127
140
}
You can’t perform that action at this time.
0 commit comments