-
Notifications
You must be signed in to change notification settings - Fork 4
/
chapter_data.gd
126 lines (93 loc) · 2.84 KB
/
chapter_data.gd
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
extends Node
var _book_data = {}
# Exemple of book_data entry
#"computed": {
# "aquire": [],
# "arc": "Catacombes",
# "chapter": "Forteresse",
# "ending": false,
# "ending_id": null,
# "ending_txt": null,
# "ending_type": null,
# "id": 212,
# "is_combat": false,
# "combat": {
# "arm": 0,
# "deg": 0,
# "hab": 13,
# "nom": "PLANTE CARNITREX",
# "pv": 18,
# "pyro": 7
# },
# "jump_conditions": {},
# "jump_conditions_txts": {},
# "label": null,
# "remove": [
# "MEDAILLON D'EDIRE"
# ],
# "secret": false,
# "secret_jumps": [],
# "sons": [
# 25
# ],
# "success": null
# },
func create(book_data):
self._book_data = book_data
func get_id():
return self._book_data['computed']['id']
func get_chapter():
return self._book_data['computed']['chapter']
func get_arc():
return self._book_data['computed']['arc']
func get_jump_conditions():
return self._book_data['computed']['jump_conditions']
func get_jump_conditions_txts():
return self._book_data['computed']['jump_conditions_txts']
func get_stats():
return self._book_data['computed']['stats']
func get_stats_cond():
return self._book_data['computed']['stats_cond']
func get_ending():
return self._book_data['computed']['ending']
func get_ending_id():
return self._book_data['computed']['ending_id']
func get_ending_txt():
return self._book_data['computed']['ending_txt']
func get_ending_type():
return self._book_data['computed']['ending_type']
func get_success():
return self._book_data['computed']['success']
func get_label():
return self._book_data['computed']['label']
func get_secret():
return self._book_data['computed']['secret']
func get_sons():
return self._book_data['computed']['sons']
func get_secret_jumps():
return self._book_data['computed']['secret_jumps']
func is_combat():
return self._book_data['computed']['is_combat']
# TODO: the 276 is a list
func _get_combat():
var combat = self._book_data['computed']['combat']
#print('type: %s , array=' % typeof(combat), '=%s' % TYPE_ARRAY)
if typeof(combat) == TYPE_ARRAY:
return combat[0]
return combat
func get_combat_name():
return self._get_combat()['nom']
func get_combat_hab():
return self._get_combat()['hab']
func get_combat_pv():
return self._get_combat()['pv']
func get_combat_pyro():
return self._get_combat()['pyro']
func get_combat_armure():
return self._get_combat()['arm']
func get_combat_degat():
return self._get_combat()['deg']
func get_aquire():
return self._book_data['computed']['aquire']
func get_remove():
return self._book_data['computed']['remove']