落块事件改名落块钩子
添加死亡钩子(仅在窒息和超高触发) 堆积模式消行动作挂到死亡钩子上
This commit is contained in:
@@ -7,9 +7,9 @@ return{
|
|||||||
mText(TEXTOBJ.line,63,350)
|
mText(TEXTOBJ.line,63,350)
|
||||||
PLY.draw.drawMarkLine(P,20,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
PLY.draw.drawMarkLine(P,20,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
||||||
end,
|
end,
|
||||||
hook_drop=function(P)
|
hook_die=function(P)
|
||||||
if #P.field>20 then
|
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
||||||
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
if cc>0 then
|
||||||
local h=20-cc-P.garbageBeneath
|
local h=20-cc-P.garbageBeneath
|
||||||
if h>0 then
|
if h>0 then
|
||||||
P:garbageRise(21,h,2e10-1)
|
P:garbageRise(21,h,2e10-1)
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ return{
|
|||||||
mText(TEXTOBJ.line,63,350)
|
mText(TEXTOBJ.line,63,350)
|
||||||
PLY.draw.drawMarkLine(P,17,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
PLY.draw.drawMarkLine(P,17,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
||||||
end,
|
end,
|
||||||
hook_drop=function(P)
|
hook_die=function(P)
|
||||||
if #P.field>20 then
|
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
||||||
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
|
if cc>0 then
|
||||||
local h=20-cc-P.garbageBeneath-3
|
local h=20-cc-P.garbageBeneath-3
|
||||||
if h>0 then
|
if h>0 then
|
||||||
P:garbageRise(21,h,2e10-1)
|
P:garbageRise(21,h,2e10-1)
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ return{
|
|||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
wait=0,fall=50,
|
wait=0,fall=50,
|
||||||
garbageSpeed=30,
|
garbageSpeed=30,
|
||||||
highCam=false,
|
|
||||||
seqData={1,2,3,4,5,6,7},
|
seqData={1,2,3,4,5,6,7},
|
||||||
eventSet='stack_e',
|
eventSet='stack_e',
|
||||||
bg='blockrain',bgm='there',
|
bg='blockrain',bgm='there',
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ return{
|
|||||||
env={
|
env={
|
||||||
drop=60,lock=60,
|
drop=60,lock=60,
|
||||||
wait=0,fall=50,
|
wait=0,fall=50,
|
||||||
highCam=false,
|
|
||||||
garbageSpeed=30,
|
garbageSpeed=30,
|
||||||
seqData={8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25},
|
seqData={8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25},
|
||||||
eventSet='stack_u',
|
eventSet='stack_u',
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ return{
|
|||||||
|
|
||||||
mesDisp={},
|
mesDisp={},
|
||||||
hook_drop={},
|
hook_drop={},
|
||||||
|
hook_die={},
|
||||||
task={},
|
task={},
|
||||||
eventSet="X",
|
eventSet="X",
|
||||||
|
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ local function _applyGameEnv(P)--Finish gameEnv processing
|
|||||||
--Apply events
|
--Apply events
|
||||||
ENV.mesDisp=_mergeFuncTable(ENV.mesDisp,{})
|
ENV.mesDisp=_mergeFuncTable(ENV.mesDisp,{})
|
||||||
ENV.hook_drop=_mergeFuncTable(ENV.hook_drop,{})
|
ENV.hook_drop=_mergeFuncTable(ENV.hook_drop,{})
|
||||||
|
ENV.hook_die=_mergeFuncTable(ENV.hook_die,{})
|
||||||
ENV.task=_mergeFuncTable(ENV.task,{})
|
ENV.task=_mergeFuncTable(ENV.task,{})
|
||||||
|
|
||||||
--Apply eventSet
|
--Apply eventSet
|
||||||
@@ -315,6 +316,7 @@ local function _applyGameEnv(P)--Finish gameEnv processing
|
|||||||
if
|
if
|
||||||
k=='mesDisp'or
|
k=='mesDisp'or
|
||||||
k=='hook_drop'or
|
k=='hook_drop'or
|
||||||
|
k=='hook_die'or
|
||||||
k=='task'
|
k=='task'
|
||||||
then
|
then
|
||||||
_mergeFuncTable(v,ENV[k])
|
_mergeFuncTable(v,ENV[k])
|
||||||
|
|||||||
@@ -313,10 +313,13 @@ function Player:setRS(RSname)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Player:triggerDropEvents()
|
function Player:_triggerEvent(eventName)
|
||||||
local L=self.gameEnv.hook_drop
|
local L=self.gameEnv[eventName]
|
||||||
for i=1,#L do
|
if L[1]then
|
||||||
L[i](self)
|
for i=1,#L do
|
||||||
|
L[i](self)
|
||||||
|
end
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -378,9 +381,22 @@ function Player:garbageRise(color,amount,line)--Release n-lines garbage to field
|
|||||||
_=self.dropFX[i]
|
_=self.dropFX[i]
|
||||||
_[3],_[5]=_[3]+amount,_[5]+amount
|
_[3],_[5]=_[3]+amount,_[5]+amount
|
||||||
end
|
end
|
||||||
if #self.field>self.gameEnv.heightLimit then
|
if
|
||||||
|
#self.field>self.gameEnv.heightLimit and(
|
||||||
|
not self:_triggerEvent('hook_die')or
|
||||||
|
#self.field>self.gameEnv.heightLimit
|
||||||
|
)
|
||||||
|
then
|
||||||
|
self:lock()
|
||||||
self:lose()
|
self:lose()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if #self.field>self.gameEnv.heightLimit then
|
||||||
|
self:_triggerEvent('hook_die')
|
||||||
|
if #self.field>self.gameEnv.heightLimit then
|
||||||
|
self:lose()
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local invList={2,1,4,3,5,6,7}
|
local invList={2,1,4,3,5,6,7}
|
||||||
@@ -724,7 +740,7 @@ function Player:removeTopClearingFX()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:checkMission(piece,mission)
|
function Player:_checkMission(piece,mission)
|
||||||
if mission<5 then
|
if mission<5 then
|
||||||
return piece.row==mission and not piece.spin
|
return piece.row==mission and not piece.spin
|
||||||
elseif mission<9 then
|
elseif mission<9 then
|
||||||
@@ -736,6 +752,17 @@ function Player:checkMission(piece,mission)
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
function Player:_checkSuffocate()
|
||||||
|
if
|
||||||
|
self:ifoverlap(self.cur.bk,self.curX,self.curY)and(
|
||||||
|
not self:_triggerEvent('hook_die')or
|
||||||
|
self:ifoverlap(self.cur.bk,self.curX,self.curY)
|
||||||
|
)
|
||||||
|
then
|
||||||
|
self:lock()
|
||||||
|
self:lose()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local spawnSFX_name={'spawn_1','spawn_2','spawn_3','spawn_4','spawn_5','spawn_6','spawn_7'}
|
local spawnSFX_name={'spawn_1','spawn_2','spawn_3','spawn_4','spawn_5','spawn_6','spawn_7'}
|
||||||
function Player:resetBlock()--Reset Block's position and execute I*S
|
function Player:resetBlock()--Reset Block's position and execute I*S
|
||||||
@@ -905,10 +932,7 @@ function Player:hold_norm(ifpre)
|
|||||||
self:freshBlock('move')
|
self:freshBlock('move')
|
||||||
self.dropDelay=ENV.drop
|
self.dropDelay=ENV.drop
|
||||||
self.lockDelay=ENV.lock
|
self.lockDelay=ENV.lock
|
||||||
if self:ifoverlap(self.cur.bk,self.curX,self.curY)then
|
self:_checkSuffocate()
|
||||||
self:lock()
|
|
||||||
self:lose()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.freshTime=int(min(self.freshTime+ENV.freshLimit*.25,ENV.freshLimit*((self.holdTime+1)/ENV.holdCount),ENV.freshLimit))
|
self.freshTime=int(min(self.freshTime+ENV.freshLimit*.25,ENV.freshLimit*((self.holdTime+1)/ENV.holdCount),ENV.freshLimit))
|
||||||
@@ -971,10 +995,7 @@ function Player:hold_swap(ifpre)
|
|||||||
self:freshBlock('move')
|
self:freshBlock('move')
|
||||||
self.dropDelay=ENV.drop
|
self.dropDelay=ENV.drop
|
||||||
self.lockDelay=ENV.lock
|
self.lockDelay=ENV.lock
|
||||||
if self:ifoverlap(self.cur.bk,self.curX,self.curY)then
|
self:_checkSuffocate()
|
||||||
self:lock()
|
|
||||||
self:lose()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self.freshTime=int(min(self.freshTime+ENV.freshLimit*.25,ENV.freshLimit*((self.holdTime+1)/ENV.holdCount),ENV.freshLimit))
|
self.freshTime=int(min(self.freshTime+ENV.freshLimit*.25,ENV.freshLimit*((self.holdTime+1)/ENV.holdCount),ENV.freshLimit))
|
||||||
@@ -1044,10 +1065,7 @@ function Player:popNext(ifhold)--Pop nextQueue to hand
|
|||||||
self.freshTime=ENV.freshLimit
|
self.freshTime=ENV.freshLimit
|
||||||
|
|
||||||
if self.cur then
|
if self.cur then
|
||||||
if self:ifoverlap(self.cur.bk,self.curX,self.curY)then
|
self:_checkSuffocate()
|
||||||
self:lock()
|
|
||||||
self:lose()
|
|
||||||
end
|
|
||||||
self:freshBlock('newBlock')
|
self:freshBlock('newBlock')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1608,7 +1626,7 @@ do
|
|||||||
|
|
||||||
--Check clearing task
|
--Check clearing task
|
||||||
if cc>0 and self.curMission then
|
if cc>0 and self.curMission then
|
||||||
if self:checkMission(piece,ENV.mission[self.curMission])then
|
if self:_checkMission(piece,ENV.mission[self.curMission])then
|
||||||
self.curMission=self.curMission+1
|
self.curMission=self.curMission+1
|
||||||
SFX.play('reach')
|
SFX.play('reach')
|
||||||
if self.curMission>#ENV.mission then
|
if self.curMission>#ENV.mission then
|
||||||
@@ -1670,13 +1688,13 @@ do
|
|||||||
if finish=='lose'then
|
if finish=='lose'then
|
||||||
self:lose()
|
self:lose()
|
||||||
else
|
else
|
||||||
self:triggerDropEvents()
|
self:_triggerEvent('hook_drop')
|
||||||
if finish then
|
if finish then
|
||||||
self:win(finish)
|
self:win(finish)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:triggerDropEvents()
|
self:_triggerEvent('hook_drop')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user