-
Notifications
You must be signed in to change notification settings - Fork 5
/
vars.py
474 lines (350 loc) · 13.3 KB
/
vars.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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
import logging
import os
import config
logger = logging.getLogger(__name__)
class AllVars:
def __init__(self):
self.set_start_vars()
def set_start_vars(self):
# Open the config file
config_data = config.open_config()
# All relevant vars are stored in a dictionary
config_vars = config_data.get("vars", {})
# === Game mode set ===
# ----Set defaults, then override for specific run type.
self.perfect_aeon_kills = False
self.attempt_djose = False
self.skip_cutscene_flag = True
self.force_blitz_win = False
self.blitz_loop = False
self.battle_speedup = False
self.ml_heals_val = False
self.run_modifier_val = "standard"
# ----Overrides
if config_vars.get("game_mode") == "speed":
self.perfect_aeon_kills = True
self.force_blitz_win = True
self.battle_speedup = True
elif config_vars.get("game_mode") == "story":
self.skip_cutscene_flag = False
elif config_vars.get("game_mode") == "swag":
self.perfect_aeon_kills = True
elif config_vars.get("game_mode") == "blitz_loop":
self.blitz_loop = True
# === RNG settings ===
self.patched = config_vars.get("game_patched", False)
self.rng_mode_val = config_vars.get("rng_mode", False)
self.rng_seed = config_vars.get("rng_seed_num")
self.rng_preferred_seeds = [31, 139, 160]
# === Other vars from user ===
self.nemesis_value = config_vars.get("nemesis_value", False)
self.force_loop = config_vars.get("force_loop", False)
self.legacy_soundtrack = config_vars.get("original_soundtrack", True)
self.generate_saves = config_vars.get("generate_saves", False)
# === Future functions / foundations ===
self.kilika_skip = True
self.rails_trials = True
self.rails_egg_hunt = True
self.skip_diag_flag = True
self.play_TTS_flag = False
# === Vars used by the TAS, no pre-set values ===
# ----Cutscene remover, TAS will set this value on New Game
# ----If loading to a save file without CSR, may need to change this.
self.csr_value = True
# ----Blitzball
self.blitz_loss_force_reset = False
self.blitz_win_value = True
self.blitz_overtime = False
self.blitz_first_shot_val = False
self.oblitz_attack_val = "255"
# ----Sphere grid
self.full_kilik_menu = False
self.early_tidus_grid_val = False
self.early_haste_val = -1
self.wakka_late_menu_val = False
self.end_game_version_val = 0
# ----Equipment
self.zombie_weapon_val = 255
self.l_strike_count = 0
self.mrr_skip = False
# ----RNG Manip
self.yellows = 0 # Not yet implemented. Part of thunderstrike weapon manip.
self.confirmed_seed_num = 999
self.skip_zan_luck = False
self.god_mode_val = config_vars.get("god_mode", False)
# ----NEA Manip
self.try_ne_val = True # We can choose False later, no current value here.
self.ne_armor_val = 255
self.ne_battles = 0 # Tracks number of forced manip battles outside cave.
self.nea_zone = 0
self.nea_force_third_larvae = False
self.nea_force_def_x_drop = False
self.nea_after_bny = False
# ----Other
self.new_game = False
self.self_destruct = False
self.ytk_farm = 0
self.rescue_count = 0
self.flux_overkill_var = False
self.first_hits = [0] * 8
self.invert_confirm = False
# === Nemesis stuff ===
# ----Nemesis variables, unused in any%
# Nemesis route, determines Tidus level-up progress. Starts at 1
self.nem_ap_val = 1
self.yojimbo_index = 1 # Used in arena battles to track Zanmato progress.
# ----Nemesis Arena variables, sets to 1 after a boss is killed.
# ----Note, 0/1 are preferable to True/False for viewing in the console.
self.area_results = [0] * 13
self.species_results = [0] * 14
self.original_results = [0] * 7
# === Hardware / Other settings ===
# ----Path for save files, used for loading a specific save
# ---- The following are valid options, depending on your file path.
# ---- "C://users//user_name//etc"
# ---- "" (blank means to use the default path)
self.save_path = str(config_vars.get("save_path"))
logger.debug(f"Base save path: |{self.save_path}|")
if len(self.save_path) == 0:
logger.debug("Dynamically using userprofile, default")
self.save_path = (
os.environ.get("userprofile")
+ "/Documents/SQUARE ENIX/FINAL FANTASY X&X-2 HD Remaster/FINAL FANTASY X/" # noqa: E501
)
elif config_vars.get("save_path").find(":"):
logger.debug("Full save path provided from config")
else:
logger.debug("Possibly a bad save path, unknown state.")
logger.debug(f"Save files, base path: {self.save_path}")
# If your computer has bad specs, this will input commands to the controller
# at a lower rate of speed. Very rarely used.
self.artificial_pauses = config_vars.get("artificial_pauses", False)
def ml_heals(self):
return self.ml_heals_val
def set_invert_confirm(self, value):
self.invert_confirm = value
def get_invert_confirm(self):
return self.invert_confirm
def set_ml_heals(self, value):
self.ml_heals_val = value
def run_modifier(self):
return self.run_modifier_val
def set_run_modifier(self, value):
self.run_modifier_val = value
def god_mode(self):
if self.god_mode_val:
logger.warning("God RNG Mode is active.")
return self.god_mode_val
def activate_god_rng(self):
logger.warning("== God RNG Mode is active. ==")
logger.warning("== God RNG Mode is active. ==")
logger.warning("== God RNG Mode is active. ==")
logger.warning("== God RNG Mode is active. ==")
logger.warning("== God RNG Mode is active. ==")
logger.warning("== God RNG Mode is active. ==")
logger.warning("== God RNG Mode is active. ==")
self.god_mode_val = True
def create_saves(self):
return self.generate_saves
def accessibility_vars(self):
return [
self.skip_cutscene_flag,
self.skip_diag_flag,
self.play_TTS_flag,
self.rails_trials,
self.rails_egg_hunt,
]
def use_legacy_soundtrack(self):
return self.legacy_soundtrack
def try_djose_skip(self):
return self.attempt_djose
def get_force_blitz_win(self):
return self.force_blitz_win
def blitz_loss_reset(self):
return self.blitz_loss_force_reset
def game_is_patched(self):
return self.patched
def rng_mode(self):
return self.rng_mode_val
def rng_seed_num(self):
return self.rng_seed
def rng_seed_num_set(self, value):
self.rng_mode_val = "set"
self.rng_seed = value
def rng_preferred_array(self):
return self.rng_preferred_seeds
def print_arena_status(self):
logger.debug(f"Area: {self.area_results}")
logger.debug(f"Species: {self.species_results}")
logger.debug(f"Original: {self.original_results}")
def arena_success(self, array_num, index):
logger.debug(f"arena_success(): {array_num} | {index}")
if array_num == 0:
self.area_results[index] = 1
elif array_num == 1:
self.species_results[index] = 1
elif array_num == 2:
self.original_results[index] = 1
self.print_arena_status()
def yu_yevon_swag(self):
return self.perfect_aeon_kills
def skip_kilika_luck(self):
return self.kilika_skip
def dont_skip_kilika_luck(self):
self.kilika_skip = False
def loop_blitz(self):
return self.blitz_loop
def set_loop_blitz(self, value):
self.blitz_loop = value
def loop_seeds(self):
return self.force_loop
def confirmed_seed(self):
return self.confirmed_seed_num
def set_confirmed_seed(self, value):
self.confirmed_seed_num = value
def set_oblitz_rng(self, value):
self.oblitz_attack_val = str(value)
def oblitz_rng_check(self):
return self.oblitz_attack_val
def get_yellows(self):
return self.yellows
def set_yellows(self, new_vals):
self.yellows = new_vals
def yojimbo_get_index(self):
return self.yojimbo_index
def yojimbo_increment_index(self):
self.yojimbo_index += 1
def nemesis(self):
return self.nemesis_value
def nemesis_set(self, value):
self.nemesis_value = value
def get_nea_zone(self):
return self.nea_zone
def set_nea_zone(self, value):
self.nea_zone = value
def get_force_third_larvae(self):
return self.nea_force_third_larvae
def set_force_third_larvae(self, value):
self.nea_force_third_larvae = value
def get_def_x_drop(self):
return self.nea_force_def_x_drop
def set_def_x_drop(self, value):
self.nea_force_def_x_drop = value
def get_nea_after_bny(self):
return self.nea_after_bny
def set_nea_after_bny(self, value):
self.nea_after_bny = value
def nem_checkpoint_ap(self):
return self.nem_ap_val
def set_nem_checkpoint_ap(self, value):
self.nem_ap_val = value
def ne_extra_battles(self):
return self.ne_battles
def ne_battles_increment(self):
self.ne_battles += 1
def ne_armor(self):
return self.ne_armor_val
def set_ne_armor(self, value):
self.ne_armor_val = value
def try_for_ne(self):
return self.try_ne_val
def first_hits_set(self, values):
for x in range(8):
self.first_hits[x] = values[x]
def first_hits_value(self, index):
return self.first_hits[index]
def print_first_hits(self):
logger.debug(f"print_first_hits(): {self.first_hits}")
def game_save_path(self):
return self.save_path
def blitz_first_shot(self):
return self.blitz_first_shot_val
def blitz_first_shot_taken(self):
self.blitz_first_shot_val = True
def blitz_first_shot_reset(self):
self.blitz_first_shot_val = False
def flux_overkill(self):
return self.flux_overkill_var
def flux_overkill_success(self):
self.flux_overkill_var = True
def csr(self):
return self.csr_value
def set_csr(self, value):
logger.debug(f"Setting CSR: {value}")
self.csr_value = value
def complete_full_klikk_menu(self):
self.full_klikk_menu = True
def did_full_klikk_menu(self):
return self.full_klikk_menu
def use_pause(self):
return self.artificial_pauses
def set_blitz_win(self, value):
self.blitz_win_value = value
def get_blitz_win(self):
return self.blitz_win_value
def set_blitz_ot(self, value):
self.blitz_overtime = value
def get_blitz_ot(self):
return self.blitz_overtime
def set_l_strike(self, value):
self.l_strike_count = value
def get_l_strike(self):
return self.l_strike_count
def zombie_weapon(self):
return self.zombie_weapon_val
def set_zombie(self, value):
self.zombie_weapon_val = value
def mrr_skip_val(self):
return self.mrr_skip
def mrr_skip_set(self, value):
self.mrr_skip = value
def early_tidus_grid_set_true(self):
self.early_tidus_grid_val = True
def early_tidus_grid(self):
return self.early_tidus_grid_val
def early_haste_set(self, value):
self.early_haste_val = value
def early_haste(self):
return self.early_haste_val
def wakka_late_menu_set(self, value):
self.wakka_late_menu_val = value
def wakka_late_menu(self):
return self.wakka_late_menu_val
def end_game_version_set(self, value):
self.end_game_version_val = value
def end_game_version(self):
return self.end_game_version_val
def self_destruct_learned(self):
self.self_destruct = True
def self_destruct_get(self):
return self.self_destruct
def add_rescue_count(self):
self.rescue_count += 1
def reset_rescue_count(self, value=0):
self.rescue_count = value
def remove_rescue_count(self):
self.rescue_count = 3
def set_rescue_count(self, value):
self.rescue_count = value
def get_rescue_count(self):
return self.rescue_count
def completed_rescue_fights(self):
# logger.debug(f"Completed {self.rescue_count} exp kills")
return self.rescue_count >= 4
def add_ytk_farm(self):
self.ytk_farm += 1
def ytk_farm_count(self):
return self.ytk_farm
def completed_ytk_farm(self):
return self.ytk_farm >= 2
def set_skip_zan_luck(self, value):
self.skip_zan_luck = value
def get_skip_zan_luck(self):
return self.skip_zan_luck
def get_battle_speedup(self):
return self.battle_speedup
def init_vars():
AllVars()
def vars_handle():
return main_vars
main_vars = AllVars()