1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-14 13:49:26 +08:00

ref: split the crack functions into specific Op

This commit is contained in:
0O0o0oOoO00
2026-02-02 15:16:08 +08:00
parent de4646d045
commit 899265c256
2 changed files with 386 additions and 431 deletions

View File

@@ -16,44 +16,6 @@ from module.logger import logger
from module.luahook.api import CrackApi
from module.luahook.op import CrackOp
ALL_ENABLE_OPS = [
CrackOp.EnableHookedLuaFunctionTrace,
CrackOp.EnableGlobalShipProperties,
CrackOp.EnableChapterFastMove,
CrackOp.EnableRemoveHardModeLimit,
CrackOp.EnableFakePlayer,
CrackOp.EnableNoBBAnimation,
CrackOp.EnableNoEmotionWarning,
CrackOp.EnableOpsiFastMove,
CrackOp.EnableRemoveHardModeShipTypeLimit,
CrackOp.EnableRemoveHardModeShipPropertiesLimit,
CrackOp.EnableGGFactor,
CrackOp.EnableGlobalSpeedup,
CrackOp.EnableBetterGlobalSpeedup,
CrackOp.EnableExerciseGodMod,
CrackOp.EnableExerciseMorePower,
CrackOp.EnableFastWave,
CrackOp.EnableMonsterKillSelf,
CrackOp.EnableSkipBattleCelebrate,
CrackOp.EnableNoDamage,
CrackOp.EnableOpsiForceAuto,
CrackOp.EnableOpsiNoMapFog,
CrackOp.EnableSkipShipGainShow,
CrackOp.EnableChapterForceEnableAutoFight,
CrackOp.EnableChapterSkipPrecombat,
CrackOp.EnableChapterAutoNextBattle,
CrackOp.EnableChapterAutoAmbush,
CrackOp.EnableChapterAutoClear,
CrackOp.EnableSkipStory,
CrackOp.EnableInfiniteBattle,
CrackOp.EnableSkipAirStrikeAnimation,
CrackOp.EnableAutoOnceAgain,
CrackOp.EnableAutoRetire,
CrackOp.EnableSkipEnemyScan,
CrackOp.EnableSkipBattleResult,
CrackOp.EnableSkipEnterBattle,
]
REMOTE_PORT = 23897
@@ -101,7 +63,7 @@ def do_crack_op(config: AzurLaneConfig, device: Device, ops: Union[Type[CrackOp.
l = ops
else:
if ops == CrackOp.EnableAll:
l = ALL_ENABLE_OPS
l = CrackOp.ALL_ENABLE_OPS
else:
l = [ops]
@@ -122,269 +84,12 @@ def do_crack_op(config: AzurLaneConfig, device: Device, ops: Union[Type[CrackOp.
g_cracker_has_inited = True
for op in l:
if op == CrackOp.DisableAll:
if issubclass(op, CrackOp.Op):
obj = op(full_config, api)
if without_pause:
api.disable_all_without_pause()
obj.execute_without_pause()
else:
api.disable_all()
elif op == CrackOp.EnableHookedLuaFunctionTrace:
if full_config.Hook_HookGeneral_HookedLuaFunctionTrace:
api.enable_hooked_lua_function_trace()
elif op == CrackOp.DisableHookedLuaFunctionTrace:
api.disable_hooked_lua_function_trace()
elif op == CrackOp.EnableGlobalShipProperties:
if config.full_config.Hook_ShipProperty_Method != "final_properties":
continue
api.update_global_ship_properties(
CrackApi.ShipProperties(
armor=float(full_config.Hook_ShipProperty_Armor),
speed=float(full_config.Hook_ShipProperty_Speed),
antiaircraft=float(full_config.Hook_ShipProperty_AntiAircraft),
oxy_recovery_bench=float(full_config.Hook_ShipProperty_OxyRecoveryBench),
torpedo=float(full_config.Hook_ShipProperty_Torpedo),
hit=float(full_config.Hook_ShipProperty_Hit),
sonarRange=float(full_config.Hook_ShipProperty_SonarRange),
attack_duration=float(full_config.Hook_ShipProperty_AttackDuration),
raid_distance=float(full_config.Hook_ShipProperty_RaidDistance),
oxy_recovery_surface=float(full_config.Hook_ShipProperty_OxyRecoverySurface),
oxy_recovery=float(full_config.Hook_ShipProperty_OxyRecovery),
dodge=float(full_config.Hook_ShipProperty_Dodge),
luck=float(full_config.Hook_ShipProperty_Luck),
reload=float(full_config.Hook_ShipProperty_Reload),
oxy_cost=float(full_config.Hook_ShipProperty_OxyCost),
durability=float(full_config.Hook_ShipProperty_Durability),
air=float(full_config.Hook_ShipProperty_Air),
oxy_max=float(full_config.Hook_ShipProperty_OxyMax),
cannon=float(full_config.Hook_ShipProperty_Cannon),
antisub=float(full_config.Hook_ShipProperty_AntiSub),
)
)
api.enable_global_ship_properties_crack()
elif op == CrackOp.DisableGlobalShipProperties:
api.disable_global_ship_properties_crack()
elif op == CrackOp.EnableChapterFastMove:
if not full_config.Hook_Misc_ChapterMove:
continue
if without_pause:
api.enable_fast_stage_move_without_pause()
else:
api.enable_fast_stage_move()
elif op == CrackOp.DisableChapterFastMove:
if without_pause:
api.disable_fast_stage_move_without_pause()
else:
api.disable_fast_stage_move()
elif op == CrackOp.EnableRemoveHardModeShipPropertiesLimit:
if full_config.Hook_Misc_RemoveHardMapLimit != "remove_ship_properties_limit":
continue
api.enable_remove_hard_mode_ship_properties_limit()
elif op == CrackOp.DisableRemoveHardModeShipPropertiesLimit:
api.disable_remove_hard_mode_ship_properties_limit()
elif op == CrackOp.EnableRemoveHardModeShipTypeLimit:
if full_config.Hook_Misc_RemoveHardMapLimit != "remove_ship_type_limit":
continue
api.enable_remove_hard_mode_ship_type_limit()
elif op == CrackOp.DisableRemoveHardModeShipTypeLimit:
api.disable_remove_hard_mode_ship_type_limit()
elif op == CrackOp.EnableRemoveHardModeLimit:
if full_config.Hook_Misc_RemoveHardMapLimit != "remove_both":
continue
api.enable_remove_hard_mode_limit()
elif op == CrackOp.DisableRemoveHardModeLimit:
api.disable_remove_hard_mode_limit()
elif op == CrackOp.EnableFakePlayer:
if not full_config.Hook_FakePlayer_Enable:
continue
api.update_fake_player_info(
CrackApi.FakePlayerInfo(
name=str(full_config.Hook_FakePlayer_Name),
level=str(full_config.Hook_FakePlayer_Level),
id=str(full_config.Hook_FakePlayer_Id),
)
)
api.enable_fake_player()
elif op == CrackOp.DisableFakePlayer:
api.disable_fake_player()
elif op == CrackOp.EnableNoBBAnimation:
if not full_config.Hook_Misc_NoBBAnimation:
continue
api.enable_no_bb_animation()
elif op == CrackOp.DisableNoBBAnimation:
api.disable_no_bb_animation()
elif op == CrackOp.EnableNoEmotionWarning:
if not full_config.Hook_Misc_NoEmotionWarning:
continue
if without_pause:
api.enable_no_emotion_warning_without_pause()
else:
api.enable_no_emotion_warning()
elif op == CrackOp.DisableNoEmotionWarning:
if without_pause:
api.disable_no_emotion_warning_without_pause()
else:
api.disable_no_emotion_warning()
elif op == CrackOp.IsAlive:
api.is_alive()
elif op == CrackOp.EnableOpsiFastMove:
api.enable_opsi_fast_move()
elif op == CrackOp.DisableOpsiFastMove:
api.disable_opsi_fast_move()
elif op == CrackOp.EnableGGFactor:
if full_config.Hook_ShipProperty_Method != "gg_factor":
continue
api.update_gg_factor(float(full_config.Hook_ShipProperty_Factor))
api.enable_gg_factor()
elif op == CrackOp.DisableGGFactor:
api.disable_gg_factor()
elif op == CrackOp.EnableGlobalSpeedup:
rate = float(full_config.Hook_Misc_GlobalSpeedup)
if rate == 1.0:
continue
api.update_global_speedup_rate(CrackApi.GlobalSpeedupRate(rate=rate))
api.enable_global_speedup()
elif op == CrackOp.DisableGlobalSpeedup:
api.disable_global_speedup()
elif op == CrackOp.EnableBetterGlobalSpeedup:
rate = float(full_config.Hook_Misc_BetterGlobalSpeedup)
if rate == 1.0:
continue
if without_pause:
api.update_better_global_speedup_rate_without_pause(CrackApi.BetterGlobalSpeedupRate(rate=rate))
api.enable_better_global_speedup_without_pause()
else:
api.update_better_global_speedup_rate(CrackApi.BetterGlobalSpeedupRate(rate=rate))
api.enable_better_global_speedup()
elif op == CrackOp.DisableBetterGlobalSpeedup:
if without_pause:
api.disable_better_global_speedup_without_pause()
else:
api.disable_better_global_speedup()
elif op == CrackOp.EnableExerciseGodMod:
if full_config.Hook_Misc_ExerciseGodMod:
api.enable_exercise_god_mode()
elif op == CrackOp.DisableExerciseGodMod:
api.disable_exercise_god_mode()
elif op == CrackOp.EnableExerciseMorePower:
rate = float(full_config.Hook_Misc_ExerciseMorePower)
if rate == -1.0:
continue
api.update_exercise_more_power_rate(CrackApi.ExerciseMorePowerRate(rate=rate))
api.enable_exercise_more_power()
elif op == CrackOp.DisableExerciseMorePower:
api.disable_exercise_more_power()
elif op == CrackOp.EnableFastWave:
if full_config.Hook_Misc_FastWave:
api.enable_fast_wave()
elif op == CrackOp.DisableFastWave:
api.disable_fast_wave()
elif op == CrackOp.EnableMonsterKillSelf:
if full_config.Hook_Misc_MonsterKillSelf:
api.enable_monster_kill_self()
elif op == CrackOp.DisableMonsterKillSelf:
api.disable_monster_kill_self()
elif op == CrackOp.EnableSkipBattleCelebrate:
if full_config.Hook_Misc_SkipBattleCelebrate:
if without_pause:
api.enable_skip_battle_celebrate_without_pause()
else:
api.enable_skip_battle_celebrate()
elif op == CrackOp.DisableSkipBattleCelebrate:
if without_pause:
api.disable_skip_battle_celebrate_without_pause()
else:
api.disable_skip_battle_celebrate()
elif op == CrackOp.EnableNoDamage:
if full_config.Hook_Misc_NoDamage:
api.enable_no_damage()
elif op == CrackOp.DisableNoDamage:
api.disable_no_damage()
elif op == CrackOp.EnableOpsiForceAuto:
if full_config.Hook_Misc_OpsiForceAuto:
api.enable_opsi_force_auto()
elif op == CrackOp.DisableOpsiForceAuto:
api.disable_opsi_force_auto()
elif op == CrackOp.EnableOpsiNoMapFog:
if full_config.Hook_Misc_OpsiNoMapFog:
api.enable_opsi_no_map_fog()
elif op == CrackOp.DisableOpsiNoMapFog:
api.disable_opsi_no_map_fog()
elif op == CrackOp.EnableSkipShipGainShow:
if full_config.Hook_Misc_SkipShipGainShow:
api.enable_skip_ship_gain_show()
elif op == CrackOp.DisableSkipShipGainShow:
api.disable_skip_ship_gain_show()
elif op == CrackOp.EnableChapterForceEnableAutoFight:
if full_config.Hook_Misc_ChapterForceEnableAutoFight:
api.enable_chapter_force_enable_auto_fight()
elif op == CrackOp.DisableChapterForceEnableAutoFight:
api.disable_chapter_force_enable_auto_fight()
elif op == CrackOp.EnableChapterSkipPrecombat:
if full_config.Hook_Misc_ChapterSkipPrecombat:
api.enable_chapter_skip_precombat()
elif op == CrackOp.DisableChapterSkipPrecombat:
api.disable_chapter_skip_precombat()
elif op == CrackOp.EnableChapterAutoNextBattle:
if full_config.Hook_Misc_ChapterAutoNextBattle:
api.enable_chapter_auto_next_battle()
elif op == CrackOp.DisableChapterAutoNextBattle:
api.disable_chapter_auto_next_battle()
elif op == CrackOp.EnableChapterAutoAmbush:
if full_config.Hook_Misc_ChapterAutoAmbush:
api.enable_chapter_auto_ambush()
elif op == CrackOp.DisableChapterAutoAmbush:
api.disable_chapter_auto_ambush()
elif op == CrackOp.EnableChapterAutoClear:
if full_config.Hook_Misc_ChapterAutoClear:
api.set_chapter_auto_clear_step_interval(CrackApi.ChapterAutoClearStepInterval(interval=float(full_config.Hook_Misc_ChapterAutoClearStepInterval)))
api.enable_chapter_auto_clear()
elif op == CrackOp.DisableChapterAutoClear:
api.disable_chapter_auto_clear()
elif op == CrackOp.EnableSkipStory:
if full_config.Hook_Misc_SkipStory:
api.enable_skip_story()
elif op == CrackOp.DisableSkipStory:
api.disable_skip_story()
elif op == CrackOp.EnableInfiniteBattle:
if full_config.Hook_Misc_InfiniteBattle:
api.enable_infinite_battle()
elif op == CrackOp.DisableInfiniteBattle:
api.disable_infinite_battle()
elif op == CrackOp.EnableSkipAirStrikeAnimation:
if full_config.Hook_Misc_SkipAirStrikeAnimation:
api.enable_skip_air_strike_animation()
elif op == CrackOp.DisableSkipAirStrikeAnimation:
api.disable_skip_air_strike_animation()
elif op == CrackOp.EnableAutoOnceAgain:
if full_config.Hook_Misc_AutoOnceAgain:
api.enable_auto_once_again()
elif op == CrackOp.DisableAutoOnceAgain:
api.disable_auto_once_again()
elif op == CrackOp.EnableAutoRetire:
if full_config.Hook_Misc_AutoRetire:
api.enable_auto_retire()
elif op == CrackOp.DisableAutoRetire:
api.disable_auto_retire()
elif op == CrackOp.EnableSkipEnemyScan:
if full_config.Hook_Misc_SkipEnemyScan:
api.enable_skip_enemy_scan()
elif op == CrackOp.DisableSkipEnemyScan:
api.disable_skip_enemy_scan()
elif op == CrackOp.EnableSkipBattleResult:
if full_config.Hook_Misc_SkipBattleResult:
api.enable_skip_battle_result()
elif op == CrackOp.DisableSkipBattleResult:
api.disable_skip_battle_result()
elif op == CrackOp.EnableSkipEnterBattle:
if full_config.Hook_Misc_SkipEnterBattle:
if without_pause:
api.enable_skip_enter_battle_without_pause()
else:
api.enable_skip_enter_battle()
elif op == CrackOp.DisableSkipEnterBattle:
if without_pause:
api.disable_skip_enter_battle_without_pause()
else:
api.disable_skip_enter_battle()
obj.execute_with_pause()
else:
logger.error(f"Unsupported op: {op}")
@@ -421,73 +126,19 @@ def luahook_disable_all(config: AzurLaneConfig, device: Device):
do_crack_op(config, device, CrackOp.DisableAll)
CHAPTER_CRACK_OPS = [
CrackOp.EnableHookedLuaFunctionTrace,
CrackOp.EnableChapterFastMove,
CrackOp.EnableNoBBAnimation,
CrackOp.EnableNoEmotionWarning,
CrackOp.EnableGlobalShipProperties,
CrackOp.EnableRemoveHardModeLimit,
CrackOp.EnableFakePlayer,
CrackOp.EnableGGFactor,
CrackOp.EnableGlobalSpeedup,
CrackOp.EnableBetterGlobalSpeedup,
CrackOp.EnableFastWave,
CrackOp.EnableMonsterKillSelf,
CrackOp.EnableSkipBattleCelebrate,
CrackOp.EnableNoDamage,
CrackOp.EnableSkipShipGainShow,
CrackOp.EnableChapterForceEnableAutoFight,
CrackOp.EnableChapterSkipPrecombat,
CrackOp.EnableChapterAutoNextBattle,
CrackOp.EnableChapterAutoAmbush,
CrackOp.EnableChapterAutoClear,
CrackOp.EnableSkipStory,
CrackOp.EnableInfiniteBattle,
CrackOp.EnableSkipAirStrikeAnimation,
CrackOp.EnableAutoOnceAgain,
CrackOp.EnableAutoRetire,
CrackOp.EnableSkipEnemyScan,
CrackOp.EnableSkipBattleResult,
CrackOp.EnableSkipEnterBattle,
]
def chapter_task_crack(f):
def wrapper(*args, **kwargs):
obj = args[0]
do_crack_op(obj.config, obj.device, CHAPTER_CRACK_OPS)
do_crack_op(obj.config, obj.device, CrackOp.CHAPTER_CRACK_OPS)
return f(*args, **kwargs)
return wrapper
OPSI_CRACK_OPS = [
CrackOp.EnableHookedLuaFunctionTrace,
CrackOp.EnableNoBBAnimation,
CrackOp.EnableOpsiFastMove,
CrackOp.EnableGlobalShipProperties,
CrackOp.EnableFakePlayer,
CrackOp.EnableGGFactor,
CrackOp.EnableGlobalSpeedup,
CrackOp.EnableBetterGlobalSpeedup,
CrackOp.EnableFastWave,
CrackOp.EnableMonsterKillSelf,
CrackOp.EnableSkipBattleCelebrate,
CrackOp.EnableNoDamage,
CrackOp.EnableOpsiForceAuto,
CrackOp.EnableOpsiNoMapFog,
CrackOp.EnableSkipShipGainShow,
CrackOp.EnableSkipStory,
CrackOp.EnableSkipBattleResult,
CrackOp.EnableSkipEnterBattle,
]
def opsi_task_crack(f):
def wrapper(*args, **kwargs):
obj = args[0]
do_crack_op(obj.config, obj.device, OPSI_CRACK_OPS)
do_crack_op(obj.config, obj.device, CrackOp.OPSI_CRACK_OPS)
return f(*args, **kwargs)
return wrapper
@@ -671,7 +322,8 @@ class CrackResource:
return self.device.adb_shell(cmd) == "exist"
def __is_remote_file_exist(self) -> bool:
return self.__is_exist(self.upload_dir) and self.__is_exist(f"{self.upload_dir}/libcracker.so") and self.__is_exist(f"{self.upload_dir}/patchelf")
return self.__is_exist(self.upload_dir) and self.__is_exist(
f"{self.upload_dir}/libcracker.so") and self.__is_exist(f"{self.upload_dir}/patchelf")
def __adb_su_do(self, cmd: str):
return self.device.adb_shell(f"su -c '{cmd}'")
@@ -680,7 +332,8 @@ class CrackResource:
self.device.adb_command(["root"])
def __check_game_lib_dir(self):
return self.__is_exist(f"{self.game_lib_dir}/libil2cpp.so") and self.__is_exist(f"{self.game_lib_dir}/libtolua.so")
return self.__is_exist(f"{self.game_lib_dir}/libil2cpp.so") and self.__is_exist(
f"{self.game_lib_dir}/libtolua.so")
def ensure(self):
if not self.config.full_config.Hook_HookGeneral_Enable:

View File

@@ -1,222 +1,524 @@
from module.luahook.api import CrackApi
class CrackOp:
class Op:
...
def __init__(self, full_config, api):
self.full_config = full_config
self.api = api
def execute_with_pause(self):
...
def execute_without_pause(self):
self.execute_with_pause()
class EnableAll(Op):
...
class DisableAll(Op):
...
def execute_with_pause(self):
self.api.disable_all()
def execute_without_pause(self):
self.api.disable_all_without_pause()
class EnableHookedLuaFunctionTrace(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_HookGeneral_HookedLuaFunctionTrace:
self.api.enable_hooked_lua_function_trace()
class DisableHookedLuaFunctionTrace(Op):
...
def execute_with_pause(self):
self.api.disable_hooked_lua_function_trace()
class EnableGlobalShipProperties(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_ShipProperty_Method != "final_properties":
return
self.api.update_global_ship_properties(
CrackApi.ShipProperties(
armor=float(self.full_config.Hook_ShipProperty_Armor),
speed=float(self.full_config.Hook_ShipProperty_Speed),
antiaircraft=float(self.full_config.Hook_ShipProperty_AntiAircraft),
oxy_recovery_bench=float(self.full_config.Hook_ShipProperty_OxyRecoveryBench),
torpedo=float(self.full_config.Hook_ShipProperty_Torpedo),
hit=float(self.full_config.Hook_ShipProperty_Hit),
sonarRange=float(self.full_config.Hook_ShipProperty_SonarRange),
attack_duration=float(self.full_config.Hook_ShipProperty_AttackDuration),
raid_distance=float(self.full_config.Hook_ShipProperty_RaidDistance),
oxy_recovery_surface=float(self.full_config.Hook_ShipProperty_OxyRecoverySurface),
oxy_recovery=float(self.full_config.Hook_ShipProperty_OxyRecovery),
dodge=float(self.full_config.Hook_ShipProperty_Dodge),
luck=float(self.full_config.Hook_ShipProperty_Luck),
reload=float(self.full_config.Hook_ShipProperty_Reload),
oxy_cost=float(self.full_config.Hook_ShipProperty_OxyCost),
durability=float(self.full_config.Hook_ShipProperty_Durability),
air=float(self.full_config.Hook_ShipProperty_Air),
oxy_max=float(self.full_config.Hook_ShipProperty_OxyMax),
cannon=float(self.full_config.Hook_ShipProperty_Cannon),
antisub=float(self.full_config.Hook_ShipProperty_AntiSub),
)
)
self.api.enable_global_ship_properties_crack()
class DisableGlobalShipProperties(Op):
...
def execute_with_pause(self):
self.api.disable_global_ship_properties_crack()
class EnableChapterFastMove(Op):
...
def execute_with_pause(self):
if not self.full_config.Hook_Misc_ChapterMove:
return
self.api.enable_fast_stage_move()
def execute_without_pause(self):
if not self.full_config.Hook_Misc_ChapterMove:
return
self.api.enable_fast_stage_move_without_pause()
class DisableChapterFastMove(Op):
...
def execute_with_pause(self):
self.api.disable_fast_stage_move()
def execute_without_pause(self):
self.api.disable_fast_stage_move_without_pause()
class EnableOpsiFastMove(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_ChapterMove:
self.api.enable_opsi_fast_move()
class DisableOpsiFastMove(Op):
...
def execute_with_pause(self):
self.api.disable_opsi_fast_move()
class EnableRemoveHardModeShipPropertiesLimit(Op):
...
def execute_with_pause(self):
remove_method = self.full_config.Hook_Misc_RemoveHardMapLimit
if remove_method in ["remove_ship_properties_limit", "remove_both"]:
self.api.enable_remove_hard_mode_ship_properties_limit()
class DisableRemoveHardModeShipPropertiesLimit(Op):
...
def execute_with_pause(self):
self.api.disable_remove_hard_mode_ship_properties_limit()
class EnableRemoveHardModeShipTypeLimit(Op):
...
def execute_with_pause(self):
remove_method = self.full_config.Hook_Misc_RemoveHardMapLimit
if remove_method in ["remove_ship_type_limit", "remove_both"]:
self.api.enable_remove_hard_mode_ship_type_limit()
class DisableRemoveHardModeShipTypeLimit(Op):
...
def execute_with_pause(self):
self.api.disable_remove_hard_mode_ship_type_limit()
class EnableRemoveHardModeLimit(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_RemoveHardMapLimit != "remove_both":
return
self.api.enable_remove_hard_mode_limit()
class DisableRemoveHardModeLimit(Op):
...
def execute_with_pause(self):
self.api.disable_remove_hard_mode_limit()
class EnableFakePlayer(Op):
...
def execute_with_pause(self):
if not self.full_config.Hook_FakePlayer_Enable:
return
self.api.update_fake_player_info(
CrackApi.FakePlayerInfo(
name=str(self.full_config.Hook_FakePlayer_Name),
level=str(self.full_config.Hook_FakePlayer_Level),
id=str(self.full_config.Hook_FakePlayer_Id),
)
)
self.api.enable_fake_player()
class DisableFakePlayer(Op):
...
def execute_with_pause(self):
self.api.disable_fake_player()
class EnableGlobalSpeedup(Op):
...
def execute_with_pause(self):
rate = float(self.full_config.Hook_Misc_GlobalSpeedup)
if rate == 1.0:
return
self.api.update_global_speedup_rate(CrackApi.GlobalSpeedupRate(rate=rate))
self.api.enable_global_speedup()
class DisableGlobalSpeedup(Op):
...
def execute_with_pause(self):
self.api.disable_global_speedup()
class EnableBetterGlobalSpeedup(Op):
...
def execute_with_pause(self):
rate = self.full_config.Hook_Misc_BetterGlobalSpeedup
if rate == 1.0:
return
self.api.update_better_global_speedup_rate(CrackApi.BetterGlobalSpeedupRate(rate=rate))
self.api.enable_better_global_speedup()
def execute_without_pause(self):
rate = self.full_config.Hook_Misc_BetterGlobalSpeedup
if rate == 1.0:
return
self.api.update_better_global_speedup_rate_without_pause(CrackApi.BetterGlobalSpeedupRate(rate=rate))
self.api.enable_better_global_speedup_without_pause()
class DisableBetterGlobalSpeedup(Op):
...
def execute_with_pause(self):
self.api.disable_better_global_speedup()
def execute_without_pause(self):
self.api.disable_better_global_speedup_without_pause()
class EnableNoBBAnimation(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_NoBBAnimation:
self.api.enable_no_bb_animation()
class DisableNoBBAnimation(Op):
...
def execute_with_pause(self):
self.api.disable_no_bb_animation()
class EnableNoEmotionWarning(Op):
...
def execute_with_pause(self):
if not self.full_config.Hook_Misc_NoEmotionWarning:
return
self.api.enable_no_emotion_warning()
def execute_without_pause(self):
if not self.full_config.Hook_Misc_NoEmotionWarning:
return
self.api.enable_no_emotion_warning_without_pause()
class DisableNoEmotionWarning(Op):
...
def execute_with_pause(self):
self.api.disable_no_emotion_warning()
def execute_without_pause(self):
self.api.disable_no_emotion_warning_without_pause()
class IsAlive(Op):
...
def execute_with_pause(self):
self.api.is_alive()
class EnableGGFactor(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_ShipProperty_Method != "gg_factor":
return
self.api.update_gg_factor(float(self.full_config.Hook_ShipProperty_Factor))
self.api.enable_gg_factor()
class DisableGGFactor(Op):
...
def execute_with_pause(self):
self.api.disable_gg_factor()
class EnableExerciseGodMod(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_ExerciseGodMod:
self.api.enable_exercise_god_mode()
class DisableExerciseGodMod(Op):
...
def execute_with_pause(self):
self.api.disable_exercise_god_mode()
class EnableExerciseMorePower(Op):
...
def execute_with_pause(self):
rate = float(self.full_config.Hook_Misc_ExerciseMorePower)
if rate == -1.0:
return
self.api.update_exercise_more_power_rate(CrackApi.ExerciseMorePowerRate(rate=rate))
self.api.enable_exercise_more_power()
class DisableExerciseMorePower(Op):
...
def execute_with_pause(self):
self.api.disable_exercise_more_power()
class EnableFastWave(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_FastWave:
self.api.enable_fast_wave()
class DisableFastWave(Op):
...
def execute_with_pause(self):
self.api.disable_fast_wave()
class EnableMonsterKillSelf(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_MonsterKillSelf:
self.api.enable_monster_kill_self()
class DisableMonsterKillSelf(Op):
...
def execute_with_pause(self):
self.api.disable_monster_kill_self()
class EnableSkipBattleCelebrate(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_SkipBattleCelebrate:
self.api.enable_skip_battle_celebrate()
def execute_without_pause(self):
if self.full_config.Hook_Misc_SkipBattleCelebrate:
self.api.enable_skip_battle_celebrate_without_pause()
class DisableSkipBattleCelebrate(Op):
...
def execute_with_pause(self):
self.api.disable_skip_battle_celebrate()
def execute_without_pause(self):
self.api.disable_skip_battle_celebrate_without_pause()
class EnableNoDamage(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_NoDamage:
self.api.enable_no_damage()
class DisableNoDamage(Op):
...
def execute_with_pause(self):
self.api.disable_no_damage()
class EnableOpsiForceAuto(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_OpsiForceAuto:
self.api.enable_opsi_force_auto()
class DisableOpsiForceAuto(Op):
...
def execute_with_pause(self):
self.api.disable_opsi_force_auto()
class EnableOpsiNoMapFog(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_OpsiNoMapFog:
self.api.enable_opsi_no_map_fog()
class DisableOpsiNoMapFog(Op):
...
def execute_with_pause(self):
self.api.disable_opsi_no_map_fog()
class EnableSkipShipGainShow(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_SkipShipGainShow:
self.api.enable_skip_ship_gain_show()
class DisableSkipShipGainShow(Op):
...
def execute_with_pause(self):
self.api.disable_skip_ship_gain_show()
class EnableChapterForceEnableAutoFight(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_ChapterForceEnableAutoFight:
self.api.enable_chapter_force_enable_auto_fight()
class DisableChapterForceEnableAutoFight(Op):
...
def execute_with_pause(self):
self.api.disable_chapter_force_enable_auto_fight()
class EnableChapterSkipPrecombat(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_ChapterSkipPrecombat:
self.api.enable_chapter_skip_precombat()
class DisableChapterSkipPrecombat(Op):
...
def execute_with_pause(self):
self.api.disable_chapter_skip_precombat()
class EnableChapterAutoNextBattle(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_ChapterAutoNextBattle:
self.api.enable_chapter_auto_next_battle()
class DisableChapterAutoNextBattle(Op):
...
def execute_with_pause(self):
self.api.disable_chapter_auto_next_battle()
class EnableChapterAutoAmbush(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_ChapterAutoAmbush:
self.api.enable_chapter_auto_ambush()
class DisableChapterAutoAmbush(Op):
...
def execute_with_pause(self):
self.api.disable_chapter_auto_ambush()
class EnableChapterAutoClear(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_ChapterAutoClear:
self.api.set_chapter_auto_clear_step_interval(CrackApi.ChapterAutoClearStepInterval(
interval=float(self.full_config.Hook_Misc_ChapterAutoClearStepInterval)))
self.api.enable_chapter_auto_clear()
class DisableChapterAutoClear(Op):
...
def execute_with_pause(self):
self.api.disable_chapter_auto_clear()
class EnableSkipStory(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_SkipStory:
self.api.enable_skip_story()
class DisableSkipStory(Op):
...
def execute_with_pause(self):
self.api.disable_skip_story()
class EnableInfiniteBattle(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_InfiniteBattle:
self.api.enable_infinite_battle()
class DisableInfiniteBattle(Op):
...
def execute_with_pause(self):
self.api.disable_infinite_battle()
class EnableSkipAirStrikeAnimation(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_SkipAirStrikeAnimation:
self.api.enable_skip_air_strike_animation()
class DisableSkipAirStrikeAnimation(Op):
...
def execute_with_pause(self):
self.api.disable_skip_air_strike_animation()
class EnableAutoOnceAgain(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_AutoOnceAgain:
self.api.enable_auto_once_again()
class DisableAutoOnceAgain(Op):
...
def execute_with_pause(self):
self.api.disable_auto_once_again()
class EnableAutoRetire(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_AutoRetire:
self.api.enable_auto_retire()
class DisableAutoRetire(Op):
...
def execute_with_pause(self):
self.api.disable_auto_retire()
class EnableSkipEnemyScan(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_SkipEnemyScan:
self.api.enable_skip_enemy_scan()
class DisableSkipEnemyScan(Op):
...
def execute_with_pause(self):
self.api.disable_skip_enemy_scan()
class EnableSkipBattleResult(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_SkipBattleResult:
self.api.enable_skip_battle_result()
class DisableSkipBattleResult(Op):
...
def execute_with_pause(self):
self.api.disable_skip_battle_result()
class EnableSkipEnterBattle(Op):
...
def execute_with_pause(self):
if self.full_config.Hook_Misc_SkipEnterBattle:
self.api.enable_skip_enter_battle()
def execute_without_pause(self):
if self.full_config.Hook_Misc_SkipEnterBattle:
self.api.enable_skip_enter_battle_without_pause()
class DisableSkipEnterBattle(Op):
...
def execute_with_pause(self):
self.api.disable_skip_enter_battle()
def execute_without_pause(self):
self.api.disable_skip_enter_battle_without_pause()
ALL_ENABLE_OPS = [
EnableHookedLuaFunctionTrace,
EnableGlobalShipProperties,
EnableChapterFastMove,
# EnableRemoveHardModeLimit,
EnableFakePlayer,
EnableNoBBAnimation,
EnableNoEmotionWarning,
EnableOpsiFastMove,
EnableRemoveHardModeShipTypeLimit,
EnableRemoveHardModeShipPropertiesLimit,
EnableGGFactor,
EnableGlobalSpeedup,
EnableBetterGlobalSpeedup,
EnableExerciseGodMod,
EnableExerciseMorePower,
EnableFastWave,
EnableMonsterKillSelf,
EnableSkipBattleCelebrate,
EnableNoDamage,
EnableOpsiForceAuto,
EnableOpsiNoMapFog,
EnableSkipShipGainShow,
EnableChapterForceEnableAutoFight,
EnableChapterSkipPrecombat,
EnableChapterAutoNextBattle,
EnableChapterAutoAmbush,
EnableChapterAutoClear,
EnableSkipStory,
EnableInfiniteBattle,
EnableSkipAirStrikeAnimation,
EnableAutoOnceAgain,
EnableAutoRetire,
EnableSkipEnemyScan,
EnableSkipBattleResult,
EnableSkipEnterBattle,
]
CHAPTER_CRACK_OPS = [
EnableHookedLuaFunctionTrace,
EnableChapterFastMove,
EnableNoBBAnimation,
EnableNoEmotionWarning,
EnableGlobalShipProperties,
EnableRemoveHardModeLimit,
EnableFakePlayer,
EnableGGFactor,
EnableGlobalSpeedup,
EnableBetterGlobalSpeedup,
EnableFastWave,
EnableMonsterKillSelf,
EnableSkipBattleCelebrate,
EnableNoDamage,
EnableSkipShipGainShow,
EnableChapterForceEnableAutoFight,
EnableChapterSkipPrecombat,
EnableChapterAutoNextBattle,
EnableChapterAutoAmbush,
EnableChapterAutoClear,
EnableSkipStory,
EnableInfiniteBattle,
EnableSkipAirStrikeAnimation,
EnableAutoOnceAgain,
EnableAutoRetire,
EnableSkipEnemyScan,
EnableSkipBattleResult,
EnableSkipEnterBattle,
]
OPSI_CRACK_OPS = [
EnableHookedLuaFunctionTrace,
EnableNoBBAnimation,
EnableOpsiFastMove,
EnableGlobalShipProperties,
EnableFakePlayer,
EnableGGFactor,
EnableGlobalSpeedup,
EnableBetterGlobalSpeedup,
EnableFastWave,
EnableMonsterKillSelf,
EnableSkipBattleCelebrate,
EnableNoDamage,
EnableOpsiForceAuto,
EnableOpsiNoMapFog,
EnableSkipShipGainShow,
EnableSkipStory,
EnableSkipBattleResult,
EnableSkipEnterBattle,
]