This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmimus_cfg.py
90 lines (79 loc) · 3.33 KB
/
mimus_cfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# pylint: disable=invalid-name
"""Config dictionary for mimus."""
import os
cfg = c = {}
# GCP Auth parameters
c['gcp'] = {}
c['gcp']['project'] = os.getenv('GCP_PROJECT', 'joeholley-mimus01')
# db api parameters (for choosing different db backends)
c['db_api'] = {}
c['db_api']['dir'] = 'db_api'
# db connection parameters
c['db_con'] = {}
c['db_con']['timeout'] = 30
# DB API Cloud Pub/Sub connection parameters
c['pubsub'] = {}
c['pubsub']['topic'] = os.getenv('DB_WORKER_TOPIC', 'queriestoprocess')
c['pubsub']['sub'] = os.getenv('DB_WORKER_SUB', 'dbworkersub')
# DB API Redis connection parameters
c['redis_con'] = {}
c['redis_con']['db'] = 0
# Docker env var format: REDIS_PORT=tcp://172.17.0.2:6379
redis_host, redis_port = os.getenv(
'REDIS_PORT', 'tcp://mimus-redis:6379').split('/')[-1].split(':')
c['redis_con']['hostname'] = redis_host
c['redis_con']['port'] = int(redis_port)
c['redis_con']['password'] = '9dc1b3ae-584c-434e-b899-da2c8ad093fb'
# Player parameters
c['player'] = {}
c['player']['initial_cards'] = {}
c['player']['initial_cards']['std'] = 5
c['player']['initial_cards']['stone'] = 1
c['player']['initial_loadout'] = {}
c['player']['initial_loadout']['stones'] = 5
c['player']['initial_loadout']['points'] = 1000
c['player']['initial_loadout']['slots'] = 50
c['player']['initial_loadout']['stamina'] = 5
# Card (unit) parameters
c['card'] = {}
c['card']['xp_limit'] = 10000 # Max XP for a unit
# Parameters for evolving ('consuming') cards
c['evolve'] = {}
c['evolve']['min_time'] = 3 # min time this action will take
c['evolve']['max_time'] = 3 # max time this action will take
c['evolve']['fail_time'] = 3 # time this action takes if it fails
c['evolve']['min_cards'] = 2 # min number of cards consumed
c['evolve']['max_cards'] = 5 # max number of cards consumed
# Parameters for leveling ('combining') cards
c['level'] = {}
c['level']['min_time'] = 3 # min time this action will take
c['level']['max_time'] = 3 # max time this action will take
c['level']['fail_time'] = 3 # time this action takes if it fails
c['level']['min_cards'] = 1 # min number of cards consumed
c['level']['max_cards'] = 5 # max number of cards consumed
# Stage parameters
c['stage'] = {}
c['stage']['min_time'] = 30 # min time this action will take
c['stage']['max_time'] = 90 # max time this action will take
c['stage']['fail_time'] = 30 # time this action takes if it fails
c['stage']['failure_chance'] = 0.90 # chance to simulate player failing stage
c['stage']['points_per_run'] = 10 # friends points earned per stage played
# Loot tables
c['loot_tables'] = {}
c['loot_tables']['std'] = {'drop_chance': 0.35, 'min': 1, 'max': 500}
c['loot_tables']['point'] = {'drop_chance': 1.00, 'min': 1, 'max': 750}
c['loot_tables']['stone'] = {'drop_chance': 1.00, 'min': 500, 'max': 1000}