Skip to content

Commit 9ad10e5

Browse files
Haddock
1 parent 17ea127 commit 9ad10e5

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

‎hall_of_legends_demo.py‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
from dataclasses import dataclass, field
2+
3+
# Legend tiers and their rewards
4+
LEGEND_TIERS = {
5+
"Bronze": 20,
6+
"Silver": 40,
7+
"Gold": 75,
8+
"Mythic": 150,
9+
"Eternal": 300
10+
}
11+
12+
# Minimal RitualRecord for demonstration
13+
@dataclass
14+
class RitualRecord:
15+
player_name: str
16+
achievement: str
17+
score: int
18+
19+
@dataclass
20+
class LegendaryRecord(RitualRecord):
21+
legend_rank: str = "Bronze"
22+
enshrined_by: str = "Obsidian Heir"
23+
24+
@dataclass
25+
class HallOfLegends:
26+
legends: list = field(default_factory=list)
27+
28+
def enshrine(self, record: RitualRecord, rank: str, enshrined_by: str = "Obsidian Heir"):
29+
reward = LEGEND_TIERS.get(rank, 0)
30+
legendary = LegendaryRecord(
31+
**record.__dict__,
32+
legend_rank=rank,
33+
enshrined_by=enshrined_by
34+
)
35+
self.legends.append(legendary)
36+
return reward, legendary
37+
38+
# Example usage
39+
if __name__ == "__main__":
40+
# Create a ritual record
41+
ritual = RitualRecord(player_name="Alice", achievement="Defeated the Dragon", score=999)
42+
43+
# Create the Hall of Legends
44+
hall = HallOfLegends()
45+
46+
# Enshrine the record as Gold, by the AI Oracle
47+
reward, legendary = hall.enshrine(ritual, "Gold", "AI Oracle")
48+
49+
print(f"Reward: {reward} VB")
50+
print("Legendary Record:")
51+
print(legendary)
52+
print("All Legends in Hall:")
53+
for legend in hall.legends:
54+
print(legend)

0 commit comments

Comments
 (0)