mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-28 22:33:59 -06:00
misc: fix some of pylint warnings
This commit is contained in:
+6
-6
@@ -99,7 +99,7 @@ class Inventory:
|
|||||||
)
|
)
|
||||||
self._gold += quantity
|
self._gold += quantity
|
||||||
|
|
||||||
def at(self, index: int) -> Item:
|
def item_at(self, index: int) -> Item:
|
||||||
return self._items[index]
|
return self._items[index]
|
||||||
|
|
||||||
def pop(self, index: int) -> None:
|
def pop(self, index: int) -> None:
|
||||||
@@ -411,7 +411,7 @@ class Simulation:
|
|||||||
|
|
||||||
elif isinstance(self.player.task, (HeadingToMarketTask, SellTask)):
|
elif isinstance(self.player.task, (HeadingToMarketTask, SellTask)):
|
||||||
if isinstance(self.player.task, SellTask):
|
if isinstance(self.player.task, SellTask):
|
||||||
item = self.player.inventory.at(0)
|
item = self.player.inventory.item_at(0)
|
||||||
amount = item.quantity * self.player.level
|
amount = item.quantity * self.player.level
|
||||||
if " of " in item.name:
|
if " of " in item.name:
|
||||||
amount *= (1 + random.below_low(10)) * (
|
amount *= (1 + random.below_low(10)) * (
|
||||||
@@ -420,7 +420,7 @@ class Simulation:
|
|||||||
self.player.inventory.pop(0)
|
self.player.inventory.pop(0)
|
||||||
self.player.inventory.add_gold(amount)
|
self.player.inventory.add_gold(amount)
|
||||||
if len(self.player.inventory):
|
if len(self.player.inventory):
|
||||||
item = self.player.inventory.at(0)
|
item = self.player.inventory.item_at(0)
|
||||||
self.player.set_task(
|
self.player.set_task(
|
||||||
SellTask(
|
SellTask(
|
||||||
"Selling " + indefinite(item.name, item.quantity),
|
"Selling " + indefinite(item.name, item.quantity),
|
||||||
@@ -691,7 +691,7 @@ def monster_task(
|
|||||||
if level < 1:
|
if level < 1:
|
||||||
level = 1
|
level = 1
|
||||||
|
|
||||||
definite = False
|
is_definite = False
|
||||||
monster: T.Optional[Monster] = None
|
monster: T.Optional[Monster] = None
|
||||||
if random.odds(1, 25):
|
if random.odds(1, 25):
|
||||||
# use an NPC every once in a while
|
# use an NPC every once in a while
|
||||||
@@ -706,7 +706,7 @@ def monster_task(
|
|||||||
+ " the "
|
+ " the "
|
||||||
+ race.name
|
+ race.name
|
||||||
)
|
)
|
||||||
definite = True
|
is_definite = True
|
||||||
lev = level
|
lev = level
|
||||||
elif quest_monster and random.odds(1, 4):
|
elif quest_monster and random.odds(1, 4):
|
||||||
# use the quest monster
|
# use the quest monster
|
||||||
@@ -750,7 +750,7 @@ def monster_task(
|
|||||||
|
|
||||||
lev = level
|
lev = level
|
||||||
level = lev * qty
|
level = lev * qty
|
||||||
if not definite:
|
if not is_definite:
|
||||||
result = indefinite(result, qty)
|
result = indefinite(result, qty)
|
||||||
|
|
||||||
duration = (2 * 3 * level * 1000) // player_level
|
duration = (2 * 3 * level * 1000) // player_level
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import urwid
|
|||||||
import urwid_readline
|
import urwid_readline
|
||||||
|
|
||||||
from pqcli.config import CLASSES, PRIME_STATS, RACES
|
from pqcli.config import CLASSES, PRIME_STATS, RACES
|
||||||
from pqcli.mechanic import StatsBuilder, generate_name, create_player
|
from pqcli.mechanic import StatsBuilder, create_player, generate_name
|
||||||
from pqcli.ui.button import MenuButton
|
from pqcli.ui.button import MenuButton
|
||||||
from pqcli.ui.line_box import LineBox
|
from pqcli.ui.line_box import LineBox
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user