Add "Tech Finesse Lock" modes and some other improvements (#946)

* Improve Tech FInesse modes and add new player hooks

* Add Tech Finesse[+] Lock into mode map

* Credit PopUpWaffles

* Rearrange mode map
This commit is contained in:
NOT_A_ROBOT
2023-08-23 15:12:42 +07:00
committed by GitHub
parent 51968741ea
commit 9769b33deb
20 changed files with 567 additions and 336 deletions

View File

@@ -242,14 +242,28 @@ local function _mergeFuncTable(f,L)
end
return L
end
local hooks = {
'mesDisp',
'hook_left',
'hook_left_manual',
'hook_left_auto',
'hook_right',
'hook_right_manual',
'hook_right_auto',
'hook_rotLeft',
'hook_rotRight',
'hook_rot180',
'hook_drop',
'hook_die',
'task'
}
local function _applyGameEnv(P)-- Finish gameEnv processing
local ENV=P.gameEnv
-- Apply events
ENV.mesDisp=_mergeFuncTable(ENV.mesDisp,{})
ENV.hook_drop=_mergeFuncTable(ENV.hook_drop,{})
ENV.hook_die=_mergeFuncTable(ENV.hook_die,{})
ENV.task=_mergeFuncTable(ENV.task,{})
for i=1,#hooks do
ENV[hooks[i]]=_mergeFuncTable(ENV[hooks[i]],{})
end
-- Apply eventSet
if ENV.eventSet and ENV.eventSet~="X" then
@@ -257,12 +271,7 @@ local function _applyGameEnv(P)-- Finish gameEnv processing
local eventSet=require('parts.eventsets.'..ENV.eventSet)
if eventSet then
for k,v in next,eventSet do
if
k=='mesDisp' or
k=='hook_drop' or
k=='hook_die' or
k=='task'
then
if TABLE.find(hooks,k) then
_mergeFuncTable(v,ENV[k])
elseif type(v)=='table' then
ENV[k]=TABLE.copy(v)