Add level 2 hoards

This commit is contained in:
henriquenakashima 2021-06-08 22:26:48 -04:00
parent bb740e040f
commit 41936ae73b
2 changed files with 45 additions and 8 deletions

View file

@ -25,7 +25,8 @@ _TABLES = {
(6, 1, TT.DEED), (6, 1, TT.DEED),
(8, 50, TT.GOLD), (8, 50, TT.GOLD),
(9, 1, TT.GEMS), (9, 1, TT.GEMS),
(11, 1, TT.ART_OBJECT), (10, 1, TT.ART_OBJECT),
(11, 100, TT.GOLD),
(12, 1, TT.LIFE), (12, 1, TT.LIFE),
]), ]),
EncounterType.BATTLE_ELITE: HoardTable([ EncounterType.BATTLE_ELITE: HoardTable([
@ -36,8 +37,8 @@ _TABLES = {
(8, 100, TT.GOLD), (8, 100, TT.GOLD),
(9, 2, TT.GEMS), (9, 2, TT.GEMS),
(10, 2, TT.ART_OBJECT), (10, 2, TT.ART_OBJECT),
(11, 1, TT.NOBILITY_TITLE), (11, 1, TT.LIFE),
(12, 1, TT.LIFE), (12, 1, TT.RELIC),
]), ]),
EncounterType.BATTLE_BOSS: HoardTable([ EncounterType.BATTLE_BOSS: HoardTable([
(2, 400, TT.GOLD), (2, 400, TT.GOLD),
@ -46,10 +47,47 @@ _TABLES = {
(6, 3, TT.DEED), (6, 3, TT.DEED),
(8, 150, TT.GOLD), (8, 150, TT.GOLD),
(9, 3, TT.GEMS), (9, 3, TT.GEMS),
(10, 1, TT.NOBILITY_TITLE),
(12, 1, TT.RELIC),
]),
},
2: {
EncounterType.BATTLE_REGULAR: HoardTable([
(2, 240, TT.GOLD),
(3, 1, TT.ART_OBJECT),
(4, 2, TT.COG),
(5, 1, TT.CONSUMABLE),
(6, 1, TT.DEED),
(8, 60, TT.GOLD),
(9, 1, TT.GEMS),
(10, 1, TT.ART_OBJECT),
(11, 120, TT.GOLD),
(12, 1, TT.LIFE),
]),
EncounterType.BATTLE_ELITE: HoardTable([
(2, 360, TT.GOLD),
(3, 2, TT.ART_OBJECT),
(4, 4, TT.COG),
(5, 2, TT.CONSUMABLE),
(6, 2, TT.DEED),
(8, 120, TT.GOLD),
(9, 2, TT.GEMS),
(10, 1, TT.LIFE),
(11, 1, TT.NOBILITY_TITLE), (11, 1, TT.NOBILITY_TITLE),
(12, 1, TT.RELIC), (12, 1, TT.RELIC),
]), ]),
} EncounterType.BATTLE_BOSS: HoardTable([
(2, 480, TT.GOLD),
(3, 3, TT.ART_OBJECT),
(4, 6, TT.COG),
(5, 3, TT.CONSUMABLE),
(6, 3, TT.DEED),
(8, 180, TT.GOLD),
(9, 3, TT.GEMS),
(10, 1, TT.NOBILITY_TITLE),
(12, 1, TT.RELIC),
]),
},
} }
@ -58,8 +96,5 @@ def generate_hoard(battle_type: EncounterType, level: int):
def _roll_treasure(battle_type: EncounterType, level: int): def _roll_treasure(battle_type: EncounterType, level: int):
# TODO: Handle more quest levels
assert level == 1
table: HoardTable = _TABLES[level][battle_type] table: HoardTable = _TABLES[level][battle_type]
return table.roll() return table.roll()

View file

@ -12,7 +12,9 @@ def _ordinal(level):
def index(request): def index(request):
level = 1 level = int(request.GET.get('level', 1))
if level not in range(1, 5 + 1):
raise Exception(f'Level should be in range [1, 5] but was {level}')
quest_map: QuestMap = map_generator.generate_map(level) quest_map: QuestMap = map_generator.generate_map(level)
rendered_map: RenderedMap = map_renderer.render_map(quest_map) rendered_map: RenderedMap = map_renderer.render_map(quest_map)