-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAA_RiseTweaks.lua
More file actions
39 lines (35 loc) · 1.62 KB
/
AA_RiseTweaks.lua
File metadata and controls
39 lines (35 loc) · 1.62 KB
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
local Constants = _G.require("Constants.Constants");
local sdk = Constants.sdk;
local get_hook_storage = Constants.get_hook_storage;
local SKIP_ORIGINAL_func = Constants.SKIP_ORIGINAL_func;
local hook = sdk.hook;
local find_type_definition = sdk.find_type_definition;
local to_managed_object = sdk.to_managed_object;
--
local MAX_FPS = 119.98;
--
local set_MaxFps_method = Constants.type_definitions.Application_type_def:get_method("set_MaxFps(System.Single)"); -- static
--
local changeAllMarkerEnable_method = find_type_definition("snow.access.ObjectAccessManager"):get_method("changeAllMarkerEnable(System.Boolean)");
local function applyFps()
set_MaxFps_method:call(nil, MAX_FPS);
end
local hookNeed = true;
local function PreHook_changeAllMarkerEnable(args)
if hookNeed == true then
get_hook_storage()["ObjectAccessManager"] = to_managed_object(args[2]);
return SKIP_ORIGINAL_func;
end
hookNeed = true;
end
local function PostHook_changeAllMarkerEnable()
local ObjectAccessManager = get_hook_storage()["ObjectAccessManager"];
if ObjectAccessManager ~= nil then
hookNeed = false;
changeAllMarkerEnable_method:call(ObjectAccessManager, true);
end
end
--
hook(find_type_definition("snow.eventcut.UniqueEventManager"):get_method("playEventCommon(System.Boolean, System.Int32)"), nil, applyFps);
hook(changeAllMarkerEnable_method, PreHook_changeAllMarkerEnable, PostHook_changeAllMarkerEnable);
hook(find_type_definition("snow.enemy.EnemyCharacterBase"):get_method("requestMysteryCoreHitMark(snow.enemy.EnemyDef.PartsGroup, snow.hit.EnemyCalcDamageInfo.AfterCalcInfo_DamageSide)"), SKIP_ORIGINAL_func);