add:bonus store

This commit is contained in:
2025-07-31 07:00:07 +05:00
parent 8c4db146c9
commit fa9611cc99
5 changed files with 374 additions and 4 deletions

View File

@ -0,0 +1,54 @@
# scripts/add_test_bonuses.py
from app.db.database import db
import uuid
from datetime import datetime
# Коллекция для бонусов
bonus_types_collection = db.bonus_types
# Очищаем существующие записи
bonus_types_collection.delete_many({})
# Добавляем типы бонусов
bonus_types = [
{
"id": str(uuid.uuid4()),
"name": "Бонус опыта",
"description": "Увеличивает получаемый опыт на 100% (+10% за уровень)",
"effect_type": "experience",
"base_effect_value": 1.0, # +100%
"effect_increment": 0.1, # +10% за уровень
"price": 100,
"upgrade_price": 50,
"duration": 0, # Бесконечный
"max_level": 0 # Без ограничения уровня
},
{
"id": str(uuid.uuid4()),
"name": "Бонус силы",
"description": "Увеличивает силу атаки на 10% (+5% за уровень)",
"effect_type": "strength",
"base_effect_value": 0.1,
"effect_increment": 0.05,
"price": 75,
"upgrade_price": 40,
"duration": 0, # Бесконечный
"max_level": 10 # Максимум 10 уровней
},
{
"id": str(uuid.uuid4()),
"name": "Бонус скорости",
"description": "Временно увеличивает скорость передвижения на 20%",
"effect_type": "speed",
"base_effect_value": 0.2,
"effect_increment": 0.05,
"price": 40,
"upgrade_price": 30,
"duration": 1800, # 30 минут
"max_level": 5
}
]
# Вставляем бонусы в БД
bonus_types_collection.insert_many(bonus_types)
print(f"Добавлено {len(bonus_types)} типов бонусов")