forked from DanielK314/DnDSimulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_full_stat_recap.py
30 lines (26 loc) · 967 Bytes
/
run_full_stat_recap.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
from Entity_class import *
from Encounter_Simulator import *
from Dm_class import DungeonMaster
import json
def run_full_stat_recap():
#read out Informations for the simulation from json file
if getattr(sys, 'frozen', False):
application_path = os.path.dirname(sys.executable)
elif __file__:
application_path = os.path.dirname(__file__)
f = open(application_path + '/simulation_parameters.json')
data = json.load(f)
parameters = data['simulation_parameters']
Loaded_Entities = data['Entities']
f.close
#initiate the DM and check the printing#
DM = DungeonMaster()
if parameters['printing_on'] == 0:
DM.block_print()
else:
DM.enable_print()
#load the Entities for the fight
Fighters = [entity(player['name'], player['team'], DM) for player in Loaded_Entities]
full_statistical_recap(parameters['repetitions'], Fighters)
if __name__ == '__main__':
run_full_stat_recap()