File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -213,8 +213,22 @@ def get_queryset(self) -> models.QuerySet[Special]:
213213class BaseBallInstanceManager [T : models .Model ](Manager [T ]):
214214 def with_stats (self ):
215215 return self .annotate (
216- attack = Cast (F ("attack_bonus" ), models .BigIntegerField ()) * F ("ball__attack" ),
217- health = Cast (F ("health_bonus" ), models .BigIntegerField ()) * F ("ball__health" ),
216+ attack = Cast (
217+ models .ExpressionWrapper (
218+ F ("ball__attack" )
219+ * (models .Value (1.0 ) + Cast (F ("attack_bonus" ), models .FloatField ()) / models .Value (100.0 )),
220+ output_field = models .FloatField (),
221+ ),
222+ models .BigIntegerField (),
223+ ),
224+ health = Cast (
225+ models .ExpressionWrapper (
226+ F ("ball__health" )
227+ * (models .Value (1.0 ) + Cast (F ("health_bonus" ), models .FloatField ()) / models .Value (100.0 )),
228+ output_field = models .FloatField (),
229+ ),
230+ models .BigIntegerField (),
231+ ),
218232 )
219233
220234
You can’t perform that action at this time.
0 commit comments