Spaces:
Running
Running
#!/usr/bin/env python3 | |
""" | |
Game Constants for Tag Collector Game - Updated with new tag rarity names | |
This file contains shared constants used by both the main game and the library system. | |
""" | |
# Game currency names | |
TAG_CURRENCY_NAME = "TagCoins" | |
ENKEPHALIN_CURRENCY_NAME = "Enkephalin" | |
ENKEPHALIN_ICON = "💧" | |
STARTING_THRESHOLD = 0.9 | |
MIN_THRESHOLD = 0.1 | |
# Tag animations and theme settings | |
TAG_ANIMATIONS = { | |
"Star of the City": { | |
"css_class": "star-of-city", | |
"animation": """ | |
@keyframes glowing { | |
0% { box-shadow: 0 0 5px #FFD700; } | |
50% { box-shadow: 0 0 20px #FFD700; } | |
100% { box-shadow: 0 0 5px #FFD700; } | |
} | |
.star-of-city { | |
background-color: rgba(255, 215, 0, 0.2); | |
padding: 8px; | |
border-radius: 5px; | |
border: 2px solid gold; | |
animation: glowing 2s infinite; | |
} | |
""" | |
}, | |
"Impuritas Civitas": { | |
"css_class": "impuritas-civitas", | |
"animation": """ | |
@keyframes rainbow-border { | |
0% { border-color: red; } | |
14% { border-color: orange; } | |
28% { border-color: yellow; } | |
42% { border-color: green; } | |
57% { border-color: blue; } | |
71% { border-color: indigo; } | |
85% { border-color: violet; } | |
100% { border-color: red; } | |
} | |
@keyframes rainbow-text { | |
0% { color: red; } | |
14% { color: orange; } | |
28% { color: yellow; } | |
42% { color: green; } | |
57% { color: blue; } | |
71% { color: indigo; } | |
85% { color: violet; } | |
100% { color: red; } | |
} | |
@keyframes rainbow-bg { | |
0% { background-color: rgba(255,0,0,0.1); } | |
14% { background-color: rgba(255,165,0,0.1); } | |
28% { background-color: rgba(255,255,0,0.1); } | |
42% { background-color: rgba(0,128,0,0.1); } | |
57% { background-color: rgba(0,0,255,0.1); } | |
71% { background-color: rgba(75,0,130,0.1); } | |
85% { background-color: rgba(238,130,238,0.1); } | |
100% { background-color: rgba(255,0,0,0.1); } | |
} | |
.impuritas-civitas { | |
background-color: rgba(0, 0, 0, 0.1); | |
padding: 10px; | |
border-radius: 5px; | |
border: 3px solid red; | |
animation: rainbow-border 4s linear infinite, rainbow-bg 4s linear infinite; | |
} | |
.impuritas-text { | |
font-weight: bold; | |
animation: rainbow-text 4s linear infinite; | |
} | |
""" | |
} | |
} | |
# Rarity levels with appropriate colors (updated to match new rarity tiers) | |
RARITY_LEVELS = { | |
"Canard": {"color": "#AAAAAA", "value": 1}, # Gray | |
"Urban Myth": {"color": "#5D9C59", "value": 5}, # Green | |
"Urban Legend": {"color": "#2196F3", "value": 10}, # Blue | |
"Urban Plague": {"color": "#9C27B0", "value": 25}, # Purple | |
"Urban Nightmare": {"color": "#FF9800", "value": 50}, # Orange | |
"Star of the City": {"color": "#FFEB3B", "value": 250}, # Yellow/Gold | |
"Impuritas Civitas": {"color": "#F44336", "value": 1000} # Red | |
} | |
# Essence generation costs in enkephalin | |
ESSENCE_COSTS = { | |
"Canard": 10, # Common tags | |
"Urban Myth": 30, # Uncommon tags | |
"Urban Legend": 75, # Rare tags | |
"Urban Plague": 150, # Very rare tags | |
"Urban Nightmare": 300, # Extremely rare tags | |
"Star of the City": 600, # Nearly mythical tags | |
"Impuritas Civitas": 1200 # Legendary tags | |
} | |
# Tag power system | |
TAG_POWER_BONUSES = { | |
"Canard": {"coin_multiplier": 0, "enkephalin_reward": 0}, | |
"Urban Myth": {"coin_multiplier": 0, "enkephalin_reward": 0}, | |
"Urban Legend": {"coin_multiplier": 0, "enkephalin_reward": 1}, | |
"Urban Plague": {"coin_multiplier": 0.001, "enkephalin_reward": 3}, | |
"Urban Nightmare": {"coin_multiplier": 0.0025, "enkephalin_reward": 5}, | |
"Star of the City": {"coin_multiplier": 0.005, "enkephalin_reward": 10}, | |
"Impuritas Civitas": {"coin_multiplier": 0.01, "enkephalin_reward": 25} | |
} | |
THRESHOLD_UPGRADES = [ | |
{ | |
"name": "Pattern Recognition Module", | |
"threshold_setting": 0.85, | |
"cost": 300, | |
"description": "Basic algorithm focused on high-precision identification. Reduces false positives but may miss some tags." | |
}, | |
{ | |
"name": "Neural Network Enhancement", | |
"threshold_setting": 0.75, | |
"cost": 500, | |
"description": "Improved tag detection using multi-layer perceptrons. Offers good precision with moderate recall." | |
}, | |
{ | |
"name": "Deep Learning Framework", | |
"threshold_setting": 0.61, | |
"cost": 1000, | |
"description": "Advanced algorithms that learn from previous scans. Provides better balance between precision and recall." | |
}, | |
{ | |
"name": "Quantum Probability Engine", | |
"threshold_setting": 0.55, | |
"cost": 2500, | |
"description": "Leverages quantum uncertainty for optimal detection balance. Perfect calibration point for F1 score." | |
}, | |
{ | |
"name": "Recursive Self-Improvement", | |
"threshold_setting": 0.45, | |
"cost": 7500, | |
"description": "Scanner enhances its own detection capabilities. Optimized for weighted tag discovery." | |
}, | |
{ | |
"name": "Consciousness Emulation", | |
"threshold_setting": 0.41, | |
"cost": 15000, | |
"description": "Scanner develops intuition-like abilities. Favors higher recall while maintaining reasonable precision." | |
}, | |
{ | |
"name": "Technological Singularity", | |
"threshold_setting": 0.35, | |
"cost": 50000, | |
"description": "The scanner transcends conventional limitations. Maximizes tag discovery at the cost of some precision." | |
} | |
] | |
# Achievements | |
ACHIEVEMENTS = { | |
# Collection achievements | |
"tag_collector_beginner": {"name": "Novice Archivist", "requirement": 50, "description": "Collect 50 different tags", "reward": {"coin_bonus": 0.01}}, | |
"tag_collector_expert": {"name": "Senior Cataloger", "requirement": 250, "description": "Collect 250 different tags", "reward": {"coin_bonus": 0.01}}, | |
"tag_collector_master": {"name": "Master Librarian", "requirement": 500, "description": "Collect 500 different tags", "reward": {"coin_bonus": 0.01}}, | |
"tag_master": {"name": "Grand Archivist", "requirement": 1000, "description": "Collect 1000 different tags", "reward": {"coin_bonus": 0.01}}, | |
# Rarity achievements | |
"legendary_hunter": {"name": "Impuritas Seeker", "requirement": 1, "description": "Find your first Impuritas Civitas tag", "reward": {"coin_bonus": 0.01, "enkephalin": 50}}, | |
"multi_legendary": {"name": "Forbidden Collection", "requirement": 5, "description": "Collect 5 Impuritas Civitas tags", "reward": {"coin_bonus": 0.01, "enkephalin": 100}}, | |
"canard_collector": {"name": "Canard Chronicler", "requirement": 30, "description": "Collect 30 Canard tags", "reward": {"coin_bonus": 0.01}}, | |
"urban_myth_collector": {"name": "Myth Curator", "requirement": 15, "description": "Collect 15 Urban Myth tags", "reward": {"coin_bonus": 0.01}}, | |
"urban_legend_collector": {"name": "Legend Preserver", "requirement": 10, "description": "Collect 10 Urban Legend tags", "reward": {"coin_bonus": 0.01}}, | |
"urban_plague_collector": {"name": "Plague Archivist", "requirement": 5, "description": "Collect 5 Urban Plague tags", "reward": {"coin_bonus": 0.01}}, | |
"urban_nightmare_collector": {"name": "Nightmare Keeper", "requirement": 5, "description": "Collect 5 Urban Nightmare tags", "reward": {"coin_bonus": 0.01}}, | |
"star_collector": {"name": "Star Collector", "requirement": 3, "description": "Collect 3 Star of the City tags", "reward": {"coin_bonus": 0.01, "enkephalin": 30}}, | |
"impuritas_collector": {"name": "Impuritas Scholar", "requirement": 3, "description": "Collect 3 Impuritas Civitas tags", "reward": {"coin_bonus": 0.01, "enkephalin": 75}}, | |
# Progress achievements | |
"perfect_scanner": {"name": "Omniscient Observer", "description": "Reach the minimum threshold", "reward": {"coin_bonus": 0.01}}, | |
"optimal_threshold": {"name": "Perfect Calibration", "description": "Reach the optimal F1 score threshold of 0.328", "reward": {"coin_bonus": 0.01}}, | |
"collection_milestone_100": {"name": "Century Collector", "requirement": 100, "description": "Collect 100 different tags", "reward": {"tagcoins": 100, "coin_bonus": 0.01}}, | |
"collection_milestone_1000": {"name": "Millennium Collector", "requirement": 1000, "description": "Collect 1000 different tags", "reward": {"tagcoins": 1000, "coin_bonus": 0.01}}, | |
"collection_milestone_5000": {"name": "Epic Collector", "requirement": 5000, "description": "Collect 5000 different tags", "reward": {"tagcoins": 5000, "coin_bonus": 0.01}}, | |
# Essence & library achievements | |
"essence_creator": {"name": "Essence Creator", "requirement": 5, "description": "Generate 5 tag essences", "reward": {"essence_cost_reduction": 0.2, "coin_bonus": 0.01}}, | |
"tag_explorer": {"name": "Tag Explorer", "requirement": 20, "description": "Explore all library tiers", "reward": {"library_cost_reduction": 0.15, "coin_bonus": 0.01}}, | |
"enkephalin_master": {"name": "Enkephalin Master", "requirement": 5000, "description": "Generate 5000 Enkephalin", "reward": {"essence_cost_reduction": 0.25, "coin_bonus": 0.01}}, | |
"sacrifice_devotee": {"name": "Sacrifice Devotee", "requirement": 100, "description": "Sacrifice 100 tags", "reward": {"enkephalin_bonus": 0.2, "coin_bonus": 0.01}}, | |
# New achievements | |
"category_explorer": {"name": "Category Explorer", "requirement": 10, "description": "Collect tags from 10 different categories", "reward": {"coin_bonus": 0.01}}, | |
"series_collector": {"name": "Series Collector", "requirement": 3, "description": "Complete 3 series mosaics", "reward": {"coin_bonus": 0.01, "enkephalin": 25}}, | |
"rapid_tagger": {"name": "Rapid Tagger", "requirement": 100, "description": "Scan 100 images", "reward": {"coin_bonus": 0.01}}, | |
"enkephalin_harvester": {"name": "Enkephalin Harvester", "requirement": 1000, "description": "Generate 1000 Enkephalin", "reward": {"enkephalin_bonus": 0.1, "coin_bonus": 0.01}}, | |
"library_scholar": {"name": "Library Scholar", "requirement": 50, "description": "Extract 50 tags from the library", "reward": {"library_cost_reduction": 0.1, "coin_bonus": 0.01}}, | |
"rarity_hunter": {"name": "Rarity Hunter", "description": "Find tags of all rarity levels", "reward": {"coin_bonus": 0.02}}, | |
"essence_master": {"name": "Essence Master", "requirement": 25, "description": "Generate 25 tag essences", "reward": {"essence_cost_reduction": 0.15, "coin_bonus": 0.01}}, | |
"legendary_librarian": {"name": "Legendary Librarian", "description": "Extract an Impuritas Civitas tag from the library", "reward": {"library_cost_reduction": 0.2, "coin_bonus": 0.01, "enkephalin": 100}} | |
} |