mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-22 16:29:29 +08:00
add: no damage crack
This commit is contained in:
@@ -227,6 +227,15 @@ void Cracker::disable_all() {
|
||||
disable_monster_kill_self();
|
||||
disable_skip_battle_celebrate();
|
||||
disable_better_global_speedup();
|
||||
disable_no_damage();
|
||||
}
|
||||
|
||||
void Cracker::enable_no_damage() {
|
||||
ENABLE(NO_DAMAGE);
|
||||
}
|
||||
|
||||
void Cracker::disable_no_damage() {
|
||||
DISABLE(NO_DAMAGE);
|
||||
}
|
||||
|
||||
void Cracker::enable_better_global_speedup() {
|
||||
@@ -623,7 +632,27 @@ void Cracker::hook_all_lua_functions() {
|
||||
}
|
||||
}
|
||||
|
||||
Lua::Table ret = m_original.FinishStageCommand_GeneralPackage(args);
|
||||
Lua::Table ret;
|
||||
if (IS_ENABLED(NO_DAMAGE)) {
|
||||
Lua::Table battle_into = args[0];
|
||||
Lua::Table battle_statistics = battle_into["statistics"];
|
||||
Lua::Table battle_ship_info = args[1];
|
||||
for(int i = 1; i <= battle_ship_info.size(); ++i) {
|
||||
double ship_id = battle_ship_info[i]["id"];
|
||||
Lua::Table item = battle_statistics[ship_id];
|
||||
Utils::Lua::print_table_fields_type(item);
|
||||
item["output"] = 0.0;
|
||||
item["damage"] = 0.0;
|
||||
item["maxDamageOnce"] = 0.0;
|
||||
item["kill_count"] = 0.0;
|
||||
}
|
||||
|
||||
std::vector<Lua::Object> new_args(args.begin(), args.end());
|
||||
new_args[0] = sol::make_object(L, battle_into);
|
||||
ret = m_original.FinishStageCommand_GeneralPackage(L, sol::as_args(new_args));
|
||||
} else {
|
||||
ret = m_original.FinishStageCommand_GeneralPackage(L, args);
|
||||
}
|
||||
|
||||
double speedup_rate;
|
||||
if (IS_ENABLED(GLOBAL_SPEEDUP)) {
|
||||
|
||||
Reference in New Issue
Block a user