mirror of
https://github.com/rr-/pq-cli.git
synced 2026-11-12 22:40:36 -07:00
mechanic: shorten quests as upstream does
This commit is contained in:
5 files changed
+3860
-3732
No files matched your search
+1
-1
@@ -629,7 +629,7 @@ class Simulation:
|
||||
self.player.win_equipment(self.data)
|
||||
|
||||
def complete_quest(self) -> None:
|
||||
self.player.quest_book.quest_bar.reset(50 + random.below_low(1000))
|
||||
self.player.quest_book.quest_bar.reset(50 + random.below(100))
|
||||
if self.player.quest_book.current_quest:
|
||||
logger.info(
|
||||
"Quest completed: %s", self.player.quest_book.current_quest
|
||||
|
||||
Vendored
+1225
-1195
File diff suppressed because it is too large.
Load diff
Vendored
+1296
-1265
File diff suppressed because it is too large.
Load diff
Vendored
+1308
-1270
File diff suppressed because it is too large.
Load diff
+30
-1
@@ -1,4 +1,9 @@
|
||||
from pqcli.mechanic import level_up_time
|
||||
import datetime
|
||||
|
||||
from pqcli import random
|
||||
from pqcli.config import StatType
|
||||
from pqcli.game_data import load_game_data
|
||||
from pqcli.mechanic import Player, Simulation, Stats, level_up_time
|
||||
|
||||
|
||||
def test_level_up_time_matches_upstream() -> None:
|
||||
@@ -7,3 +12,27 @@ def test_level_up_time_matches_upstream() -> None:
|
||||
assert level_up_time(10) == 1443
|
||||
assert level_up_time(30) == 5173
|
||||
assert level_up_time(100) == 70460007
|
||||
|
||||
|
||||
def make_simulation() -> Simulation:
|
||||
data = load_game_data()
|
||||
player = Player(
|
||||
name="Tester",
|
||||
birthday=datetime.datetime(2000, 1, 1),
|
||||
race=data.races[0],
|
||||
class_=data.classes[0],
|
||||
stats=Stats({stat: 10 for stat in StatType}),
|
||||
)
|
||||
return Simulation(player, data)
|
||||
|
||||
|
||||
def test_quest_length_matches_upstream() -> None:
|
||||
# QuestBar.reset(50 + Random(100)), pq-web f7d5e83
|
||||
random.seed("quests")
|
||||
simulation = make_simulation()
|
||||
lengths = set()
|
||||
for _ in range(2000):
|
||||
simulation.complete_quest()
|
||||
lengths.add(simulation.player.quest_book.quest_bar.max_)
|
||||
assert min(lengths) == 50
|
||||
assert max(lengths) == 149
|
||||
Reference in new issue
Block a user