Skip to content

Commit

Permalink
Run black and isort (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaskRendix committed Sep 28, 2022
1 parent 4504196 commit 901e45e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/tuxemon/item/test_economy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_missing_price(self):
def test_missing_cost(self):
economy = self.economy
cost = economy.lookup_item_cost("revive")
self.assertEqual(cost,0)
self.assertEqual(cost, 0)

def test_unknown_item_price(self):
economy = self.economy
Expand Down
4 changes: 3 additions & 1 deletion tuxemon/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ class MonsterModel(BaseModel):
shape: MonsterShape = Field(..., description="The shape of the monster")
types: Sequence[str] = Field([], description="The type(s) of this monster")
catch_rate: float = Field(0, description="The catch rate of the monster")
possible_genders: Sequence[GenderType] = Field([], description="Valid genders for the monster")
possible_genders: Sequence[GenderType] = Field(
[], description="Valid genders for the monster"
)
lower_catch_resistance: float = Field(
0, description="The lower catch resistance of the monster"
)
Expand Down
5 changes: 2 additions & 3 deletions tuxemon/event/actions/random_monster.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from __future__ import annotations

import os
import random as rd
from typing import NamedTuple, Optional, Union, final

Expand Down Expand Up @@ -70,10 +69,10 @@ def start(self) -> None:
assert trainer, "No Trainer found with slug '{}'".format(
trainer_slug or "player"
)

# list is required as choice expects a sequence
monster_slug = rd.choice(list(db.database["monster"]))

current_monster = monster.Monster()
current_monster.load_from_db(monster_slug)
current_monster.set_level(monster_level)
Expand Down
11 changes: 1 addition & 10 deletions tuxemon/map_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@

import logging
from math import cos, pi, sin
from typing import (
Any,
Dict,
Generator,
Iterator,
Mapping,
Optional,
Sequence,
Tuple,
)
from typing import Any, Dict, Generator, Iterator, Mapping, Optional, Tuple

import pytmx
import yaml
Expand Down
3 changes: 1 addition & 2 deletions tuxemon/monster.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ def load_from_db(self, slug: str) -> None:
self.weight = results.weight
self.possible_genders = results.possible_genders
self.catch_rate = (
results.catch_rate
or TuxemonConfig().default_monster_catch_rate
results.catch_rate or TuxemonConfig().default_monster_catch_rate
)
self.upper_catch_resistance = (
results.upper_catch_resistance
Expand Down
9 changes: 8 additions & 1 deletion tuxemon/technique.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,14 @@ def changestats(self, user: Monster, target: Monster) -> EffectResult:
self.statranged,
self.statdodge,
]
statslugs = ["speed", "current_hp", "armour", "melee", "ranged", "dodge"]
statslugs = [
"speed",
"current_hp",
"armour",
"melee",
"ranged",
"dodge",
]
newstatvalue = 0
for stat, slugdata in zip(statsmaster, statslugs):
if not stat:
Expand Down

0 comments on commit 901e45e

Please sign in to comment.