mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 11:59:24 +08:00
add: skip air strike animation
This commit is contained in:
@@ -321,6 +321,15 @@ void Cracker::disable_all() {
|
|||||||
disable_chapter_auto_clear();
|
disable_chapter_auto_clear();
|
||||||
disable_skip_story();
|
disable_skip_story();
|
||||||
disable_infinite_battle();
|
disable_infinite_battle();
|
||||||
|
disable_skip_air_strike_animation();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Cracker::enable_skip_air_strike_animation() {
|
||||||
|
ENABLE(SKIP_AIR_STRIKE_ANIMATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Cracker::disable_skip_air_strike_animation() {
|
||||||
|
DISABLE(INFINITE_BATTLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cracker::enable_infinite_battle() {
|
void Cracker::enable_infinite_battle() {
|
||||||
@@ -762,11 +771,28 @@ void Cracker::load_lua_resources() {
|
|||||||
m_original.Fleet_EnergyCheck = m_state["Fleet"]["EnergyCheck"];
|
m_original.Fleet_EnergyCheck = m_state["Fleet"]["EnergyCheck"];
|
||||||
m_original.ContinuousOperationRuntimeData_ConsumeBattleTime = m_state["ContinuousOperationRuntimeData"]["ConsumeBattleTime"];
|
m_original.ContinuousOperationRuntimeData_ConsumeBattleTime = m_state["ContinuousOperationRuntimeData"]["ConsumeBattleTime"];
|
||||||
m_original.ActivityProxy_UseContinuousTime = m_state["ActivityProxy"]["UseContinuousTime"];
|
m_original.ActivityProxy_UseContinuousTime = m_state["ActivityProxy"]["UseContinuousTime"];
|
||||||
|
m_original.LevelScene_doPlayAirStrike = m_state["LevelScene"]["doPlayAirStrike"];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cracker::hook_all_lua_functions() {
|
void Cracker::hook_all_lua_functions() {
|
||||||
SPDLOG_INFO("Hook lua functions");
|
SPDLOG_INFO("Hook lua functions");
|
||||||
|
|
||||||
|
// skip_air_strike_animation
|
||||||
|
m_state["LevelScene"]["doPlayAirStrike"] = [this](sol::this_state L, Lua::VariadicArgs args) {
|
||||||
|
CALLED(LevelScene.doPlayAirStrike)
|
||||||
|
|
||||||
|
if (IS_ENABLED(SKIP_AIR_STRIKE_ANIMATION)) {
|
||||||
|
Lua::Object callback = args[3];
|
||||||
|
if (callback.is<Lua::Function>()) {
|
||||||
|
callback.as<Lua::Function>()(L);
|
||||||
|
} else {
|
||||||
|
m_original.LevelScene_doPlayAirStrike(L, args);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_original.LevelScene_doPlayAirStrike(L, args);
|
||||||
|
};
|
||||||
|
|
||||||
// infinite_battle
|
// infinite_battle
|
||||||
m_state["ContinuousOperationRuntimeData"]["ConsumeBattleTime"] = [this](sol::this_state L, Lua::VariadicArgs args) {
|
m_state["ContinuousOperationRuntimeData"]["ConsumeBattleTime"] = [this](sol::this_state L, Lua::VariadicArgs args) {
|
||||||
CALLED(ContinuousOperationRuntimeData.ConsumeBattleTime);
|
CALLED(ContinuousOperationRuntimeData.ConsumeBattleTime);
|
||||||
@@ -1565,6 +1591,7 @@ Cracker::Config Cracker::get_config() {
|
|||||||
SET_CONFIG_FLAG(CHAPTER_AUTO_CLEAR),
|
SET_CONFIG_FLAG(CHAPTER_AUTO_CLEAR),
|
||||||
SET_CONFIG_FLAG(SKIP_STORY),
|
SET_CONFIG_FLAG(SKIP_STORY),
|
||||||
SET_CONFIG_FLAG(INFINITE_BATTLE),
|
SET_CONFIG_FLAG(INFINITE_BATTLE),
|
||||||
|
SET_CONFIG_FLAG(SKIP_AIR_STRIKE_ANIMATION),
|
||||||
},
|
},
|
||||||
.globle_ship_properties = m_globle_ship_properties,
|
.globle_ship_properties = m_globle_ship_properties,
|
||||||
.global_speedup_rate = static_cast<int>(m_global_speedup_rate),
|
.global_speedup_rate = static_cast<int>(m_global_speedup_rate),
|
||||||
@@ -1579,6 +1606,12 @@ Cracker::Config Cracker::get_config() {
|
|||||||
#define IS_CONFIG_ENABLED(n) config.flag.n
|
#define IS_CONFIG_ENABLED(n) config.flag.n
|
||||||
|
|
||||||
void Cracker::apply_config(Config& config) {
|
void Cracker::apply_config(Config& config) {
|
||||||
|
if(IS_CONFIG_ENABLED(SKIP_AIR_STRIKE_ANIMATION)) {
|
||||||
|
enable_skip_air_strike_animation();
|
||||||
|
} else {
|
||||||
|
disable_skip_air_strike_animation();
|
||||||
|
}
|
||||||
|
|
||||||
if(IS_CONFIG_ENABLED(INFINITE_BATTLE)) {
|
if(IS_CONFIG_ENABLED(INFINITE_BATTLE)) {
|
||||||
enable_infinite_battle();
|
enable_infinite_battle();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ public:
|
|||||||
bool CHAPTER_AUTO_CLEAR = false;
|
bool CHAPTER_AUTO_CLEAR = false;
|
||||||
bool SKIP_STORY = false;
|
bool SKIP_STORY = false;
|
||||||
bool INFINITE_BATTLE = false;
|
bool INFINITE_BATTLE = false;
|
||||||
|
bool SKIP_AIR_STRIKE_ANIMATION = false;
|
||||||
} flag;
|
} flag;
|
||||||
ShipProperties globle_ship_properties;
|
ShipProperties globle_ship_properties;
|
||||||
int global_speedup_rate = 1;
|
int global_speedup_rate = 1;
|
||||||
@@ -153,6 +154,9 @@ public:
|
|||||||
|
|
||||||
void disable_all();
|
void disable_all();
|
||||||
|
|
||||||
|
void enable_skip_air_strike_animation();
|
||||||
|
void disable_skip_air_strike_animation();
|
||||||
|
|
||||||
void enable_infinite_battle();
|
void enable_infinite_battle();
|
||||||
void disable_infinite_battle();
|
void disable_infinite_battle();
|
||||||
|
|
||||||
@@ -331,6 +335,7 @@ private:
|
|||||||
std::atomic<bool> CHAPTER_AUTO_CLEAR = false;
|
std::atomic<bool> CHAPTER_AUTO_CLEAR = false;
|
||||||
std::atomic<bool> SKIP_STORY = false;
|
std::atomic<bool> SKIP_STORY = false;
|
||||||
std::atomic<bool> INFINITE_BATTLE = false;
|
std::atomic<bool> INFINITE_BATTLE = false;
|
||||||
|
std::atomic<bool> SKIP_AIR_STRIKE_ANIMATION = false;
|
||||||
} m_flag;
|
} m_flag;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
@@ -382,6 +387,7 @@ private:
|
|||||||
Lua::Function Fleet_EnergyCheck;
|
Lua::Function Fleet_EnergyCheck;
|
||||||
Lua::Function ContinuousOperationRuntimeData_ConsumeBattleTime;
|
Lua::Function ContinuousOperationRuntimeData_ConsumeBattleTime;
|
||||||
Lua::Function ActivityProxy_UseContinuousTime;
|
Lua::Function ActivityProxy_UseContinuousTime;
|
||||||
|
Lua::Function LevelScene_doPlayAirStrike;
|
||||||
} m_original;
|
} m_original;
|
||||||
struct {
|
struct {
|
||||||
Lua::Function Clone;
|
Lua::Function Clone;
|
||||||
|
|||||||
@@ -1212,6 +1212,28 @@ CrackerServer::CrackerServer() {
|
|||||||
CRACK_OK();
|
CRACK_OK();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Post("/enable_skip_air_strike_animation", [](const httplib::Request& req, httplib::Response& res) {
|
||||||
|
try {
|
||||||
|
Cracker::Instance().enable_skip_air_strike_animation();
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
SPDLOG_ERROR("Enable skip air strike animation failed: {}", e.what());
|
||||||
|
res.status = 500;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
CRACK_OK();
|
||||||
|
});
|
||||||
|
|
||||||
|
Post("/disable_skip_air_strike_animation", [](const httplib::Request& req, httplib::Response& res) {
|
||||||
|
try {
|
||||||
|
Cracker::Instance().disable_skip_air_strike_animation();
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
SPDLOG_ERROR("Disable skip air strike animation failed: {}", e.what());
|
||||||
|
res.status = 500;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
CRACK_OK();
|
||||||
|
});
|
||||||
|
|
||||||
Post("/init", [](const httplib::Request& req, httplib::Response& res) {
|
Post("/init", [](const httplib::Request& req, httplib::Response& res) {
|
||||||
try {
|
try {
|
||||||
Cracker::Instance();
|
Cracker::Instance();
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ void CrackerUI::draw_menu() {
|
|||||||
PRESET(SKIP_SHIP_GAIN_SHOW);
|
PRESET(SKIP_SHIP_GAIN_SHOW);
|
||||||
PRESET(CHAPTER_AUTO_NEXT_BATTLE);
|
PRESET(CHAPTER_AUTO_NEXT_BATTLE);
|
||||||
PRESET(CHAPTER_AUTO_CLEAR);
|
PRESET(CHAPTER_AUTO_CLEAR);
|
||||||
|
PRESET(SKIP_AIR_STRIKE_ANIMATION);
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("加载大世界开荒预设")) {
|
if (ImGui::Button("加载大世界开荒预设")) {
|
||||||
@@ -138,6 +139,7 @@ void CrackerUI::draw_menu() {
|
|||||||
ImGui::Checkbox("演习锁血", &CONFIG_FLAG(EXERCISE_GOD_MOD));
|
ImGui::Checkbox("演习锁血", &CONFIG_FLAG(EXERCISE_GOD_MOD));
|
||||||
ImGui::Checkbox("自动规避伏击", &CONFIG_FLAG(CHAPTER_AUTO_AMBUSH));
|
ImGui::Checkbox("自动规避伏击", &CONFIG_FLAG(CHAPTER_AUTO_AMBUSH));
|
||||||
ImGui::Checkbox("跳过剧情", &CONFIG_FLAG(SKIP_STORY));
|
ImGui::Checkbox("跳过剧情", &CONFIG_FLAG(SKIP_STORY));
|
||||||
|
ImGui::Checkbox("跳过空袭动画", &CONFIG_FLAG(SKIP_AIR_STRIKE_ANIMATION));
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::Checkbox("移除困难图属性限制", &CONFIG_FLAG(REMOVE_HARD_MODE_SHIP_PROPERTIES_LIMIT));
|
ImGui::Checkbox("移除困难图属性限制", &CONFIG_FLAG(REMOVE_HARD_MODE_SHIP_PROPERTIES_LIMIT));
|
||||||
|
|||||||
@@ -231,7 +231,8 @@
|
|||||||
"ChapterAutoClear": false,
|
"ChapterAutoClear": false,
|
||||||
"ChapterAutoClearStepInterval": 0.5,
|
"ChapterAutoClearStepInterval": 0.5,
|
||||||
"SkipStory": false,
|
"SkipStory": false,
|
||||||
"InfiniteBattle": false
|
"InfiniteBattle": false,
|
||||||
|
"SkipAirStrikeAnimation": false
|
||||||
},
|
},
|
||||||
"ShipProperty": {
|
"ShipProperty": {
|
||||||
"Method": "disable",
|
"Method": "disable",
|
||||||
|
|||||||
@@ -921,6 +921,10 @@
|
|||||||
"InfiniteBattle": {
|
"InfiniteBattle": {
|
||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": false
|
"value": false
|
||||||
|
},
|
||||||
|
"SkipAirStrikeAnimation": {
|
||||||
|
"type": "checkbox",
|
||||||
|
"value": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ShipProperty": {
|
"ShipProperty": {
|
||||||
|
|||||||
@@ -897,6 +897,7 @@ Misc:
|
|||||||
ChapterAutoClearStepInterval: 0.5
|
ChapterAutoClearStepInterval: 0.5
|
||||||
SkipStory: false
|
SkipStory: false
|
||||||
InfiniteBattle: false
|
InfiniteBattle: false
|
||||||
|
SkipAirStrikeAnimation: false
|
||||||
|
|
||||||
# ==================== Cheat ====================
|
# ==================== Cheat ====================
|
||||||
PowerLimit:
|
PowerLimit:
|
||||||
|
|||||||
@@ -552,6 +552,7 @@ class GeneratedConfig:
|
|||||||
Misc_ChapterAutoClearStepInterval = 0.5
|
Misc_ChapterAutoClearStepInterval = 0.5
|
||||||
Misc_SkipStory = False
|
Misc_SkipStory = False
|
||||||
Misc_InfiniteBattle = False
|
Misc_InfiniteBattle = False
|
||||||
|
Misc_SkipAirStrikeAnimation = False
|
||||||
|
|
||||||
# Group `PowerLimit`
|
# Group `PowerLimit`
|
||||||
PowerLimit_Enable = True
|
PowerLimit_Enable = True
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ class FullGeneratedConfig:
|
|||||||
Hook_Misc_ChapterAutoClearStepInterval = None
|
Hook_Misc_ChapterAutoClearStepInterval = None
|
||||||
Hook_Misc_SkipStory = None
|
Hook_Misc_SkipStory = None
|
||||||
Hook_Misc_InfiniteBattle = None
|
Hook_Misc_InfiniteBattle = None
|
||||||
|
Hook_Misc_SkipAirStrikeAnimation = None
|
||||||
Hook_ShipProperty_Method = None
|
Hook_ShipProperty_Method = None
|
||||||
Hook_ShipProperty_Factor = None
|
Hook_ShipProperty_Factor = None
|
||||||
Hook_ShipProperty_Armor = None
|
Hook_ShipProperty_Armor = None
|
||||||
|
|||||||
@@ -3176,6 +3176,10 @@
|
|||||||
"InfiniteBattle": {
|
"InfiniteBattle": {
|
||||||
"name": "Misc.InfiniteBattle.name",
|
"name": "Misc.InfiniteBattle.name",
|
||||||
"help": "Misc.InfiniteBattle.help"
|
"help": "Misc.InfiniteBattle.help"
|
||||||
|
},
|
||||||
|
"SkipAirStrikeAnimation": {
|
||||||
|
"name": "Misc.SkipAirStrikeAnimation.name",
|
||||||
|
"help": "Misc.SkipAirStrikeAnimation.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
|
|||||||
@@ -3176,6 +3176,10 @@
|
|||||||
"InfiniteBattle": {
|
"InfiniteBattle": {
|
||||||
"name": "Misc.InfiniteBattle.name",
|
"name": "Misc.InfiniteBattle.name",
|
||||||
"help": "Misc.InfiniteBattle.help"
|
"help": "Misc.InfiniteBattle.help"
|
||||||
|
},
|
||||||
|
"SkipAirStrikeAnimation": {
|
||||||
|
"name": "Misc.SkipAirStrikeAnimation.name",
|
||||||
|
"help": "Misc.SkipAirStrikeAnimation.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
|
|||||||
@@ -3176,6 +3176,10 @@
|
|||||||
"InfiniteBattle": {
|
"InfiniteBattle": {
|
||||||
"name": "无限连战",
|
"name": "无限连战",
|
||||||
"help": ""
|
"help": ""
|
||||||
|
},
|
||||||
|
"SkipAirStrikeAnimation": {
|
||||||
|
"name": "跳过空袭动画",
|
||||||
|
"help": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
|
|||||||
@@ -3176,6 +3176,10 @@
|
|||||||
"InfiniteBattle": {
|
"InfiniteBattle": {
|
||||||
"name": "Misc.InfiniteBattle.name",
|
"name": "Misc.InfiniteBattle.name",
|
||||||
"help": "Misc.InfiniteBattle.help"
|
"help": "Misc.InfiniteBattle.help"
|
||||||
|
},
|
||||||
|
"SkipAirStrikeAnimation": {
|
||||||
|
"name": "Misc.SkipAirStrikeAnimation.name",
|
||||||
|
"help": "Misc.SkipAirStrikeAnimation.help"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"PowerLimit": {
|
"PowerLimit": {
|
||||||
|
|||||||
@@ -404,6 +404,12 @@ class CrackApi:
|
|||||||
def disable_infinite_battle(self):
|
def disable_infinite_battle(self):
|
||||||
self.post("disable_infinite_battle")
|
self.post("disable_infinite_battle")
|
||||||
|
|
||||||
|
def enable_skip_air_strike_animation(self):
|
||||||
|
self.post("enable_skip_air_strike_animation")
|
||||||
|
|
||||||
|
def disable_skip_air_strike_animation(self):
|
||||||
|
self.post("disable_skip_air_strike_animation")
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
self.post("init")
|
self.post("init")
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ ALL_ENABLE_OPS = [
|
|||||||
CrackOp.EnableChapterAutoClear,
|
CrackOp.EnableChapterAutoClear,
|
||||||
CrackOp.EnableSkipStory,
|
CrackOp.EnableSkipStory,
|
||||||
CrackOp.EnableInfiniteBattle,
|
CrackOp.EnableInfiniteBattle,
|
||||||
|
CrackOp.EnableSkipAirStrikeAnimation,
|
||||||
]
|
]
|
||||||
|
|
||||||
REMOTE_PORT = 23897
|
REMOTE_PORT = 23897
|
||||||
@@ -337,6 +338,11 @@ def do_crack_op(config: AzurLaneConfig, device: Device, ops: Union[Type[CrackOp.
|
|||||||
api.enable_infinite_battle()
|
api.enable_infinite_battle()
|
||||||
elif op == CrackOp.DisableInfiniteBattle:
|
elif op == CrackOp.DisableInfiniteBattle:
|
||||||
api.disable_infinite_battle()
|
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()
|
||||||
else:
|
else:
|
||||||
logger.error(f"Unsupported op: {op}")
|
logger.error(f"Unsupported op: {op}")
|
||||||
|
|
||||||
@@ -396,6 +402,7 @@ CHAPTER_CRACK_OPS = [
|
|||||||
CrackOp.EnableChapterAutoClear,
|
CrackOp.EnableChapterAutoClear,
|
||||||
CrackOp.EnableSkipStory,
|
CrackOp.EnableSkipStory,
|
||||||
CrackOp.EnableInfiniteBattle,
|
CrackOp.EnableInfiniteBattle,
|
||||||
|
CrackOp.EnableSkipAirStrikeAnimation,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -184,3 +184,9 @@ class CrackOp:
|
|||||||
|
|
||||||
class DisableInfiniteBattle(Op):
|
class DisableInfiniteBattle(Op):
|
||||||
...
|
...
|
||||||
|
|
||||||
|
class EnableSkipAirStrikeAnimation(Op):
|
||||||
|
...
|
||||||
|
|
||||||
|
class DisableSkipAirStrikeAnimation(Op):
|
||||||
|
...
|
||||||
|
|||||||
Reference in New Issue
Block a user