From 73bfb8cdf918df5e956c99949fd91bbbcd8bc32f Mon Sep 17 00:00:00 2001
From: MelloBoo44 <97173040+MelloBoo44@users.noreply.github.com>
Date: Wed, 7 Aug 2024 13:54:03 -0500
Subject: [PATCH 01/15] stack_tec added
---
parts/eventsets/stack_tec.lua | 66 +++++++++++++++++++++++++++++++++++
parts/modes/stack_tec.lua | 12 +++++++
2 files changed, 78 insertions(+)
create mode 100644 parts/eventsets/stack_tec.lua
create mode 100644 parts/modes/stack_tec.lua
diff --git a/parts/eventsets/stack_tec.lua b/parts/eventsets/stack_tec.lua
new file mode 100644
index 000000000..8f796fc16
--- /dev/null
+++ b/parts/eventsets/stack_tec.lua
@@ -0,0 +1,66 @@
+return {
+ fieldH=20,
+ task=function(P)
+ P.modeData.LineTotal=0
+ P.modeData.Zone=0
+ P.modeData.FrameZoneStarted=0
+ end,
+ mesDisp=function(P)
+ setFont(60)
+ GC.mStr(P.stat.row,63,280)
+ setFont(30)
+ love.graphics.setColor(0,1,0,1)
+ if P.modeData.LineTotal<7 then love.graphics.setColor(1,0,0,1) end
+ if P.modeData.LineTotal==28 then love.graphics.setColor(0,1,1,1) end
+ if P.modeData.Zone>0 then
+ love.graphics.setColor(1,1,0,1)
+ if P.stat.frame
0 and P.modeData.Zone==0 then
+ P.modeData.LineTotal=P.modeData.LineTotal+#P.clearedRow
+ if P.modeData.LineTotal>28 then P.modeData.LineTotal=28 end
+ end
+ if P.modeData.Zone>0 then
+ P:garbageRise(21,c,1023)
+ P.stat.row=P.stat.row-c
+ end
+ P:freshMoveBlock('push')
+ if P.modeData.Zone>0 and P.stat.frame>P.modeData.FrameZoneStarted+((P.modeData.Zone)*60*5) then
+ P.modeData.Zone=0
+ P:freshMoveBlock('push')
+ TABLE.cut(P.clearedRow)
+ P:clearFilledLines(1,P.garbageBeneath)
+ end
+ end,
+
+ fkey1=function(P)
+ if P.modeData.LineTotal>=7 then
+ P.modeData.Zone=math.floor(P.modeData.LineTotal/7)
+ P.modeData.LineTotal=0
+ P.modeData.FrameZoneStarted=P.stat.frame
+ end
+ end,
+
+ hook_die=function(P)
+ P.modeData.Zone=0
+ P:freshMoveBlock('push')
+ TABLE.cut(P.clearedRow)
+ P:clearFilledLines(1,P.garbageBeneath)
+ end,
+}
\ No newline at end of file
diff --git a/parts/modes/stack_tec.lua b/parts/modes/stack_tec.lua
new file mode 100644
index 000000000..9b8c4f0d7
--- /dev/null
+++ b/parts/modes/stack_tec.lua
@@ -0,0 +1,12 @@
+return {
+ env={
+ drop=60,lock=60,
+ wait=6,--fall=0,
+ hang=15,
+ pushSpeed=1e99,
+ garbageSpeed=1e99,
+ seqData={1,2,3,4,5,6,7},
+ eventSet='stack_tec',
+ bg='blockrain',bgm='there',
+ },
+}
From e506a99bd7f60ee483fc0b57be3041657d160590 Mon Sep 17 00:00:00 2001
From: Electra
Date: Wed, 7 Aug 2024 14:56:56 -0400
Subject: [PATCH 02/15] Updated IRS to be holdable
---
parts/player/player.lua | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/parts/player/player.lua b/parts/player/player.lua
index c58f93655..0fa69a9a3 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -272,7 +272,7 @@ function Player:act_rotRight()
self.ctrlCount=self.ctrlCount+1
self:spin(1)
self:_triggerEvent('hook_rotate',1)
- self.keyPressing[3]=false
+ -- self.keyPressing[3]=false New IRS allows you to keep holding rotate
end
end
function Player:act_rotLeft()
@@ -281,7 +281,7 @@ function Player:act_rotLeft()
self.ctrlCount=self.ctrlCount+1
self:spin(3)
self:_triggerEvent('hook_rotate',3)
- self.keyPressing[4]=false
+ -- self.keyPressing[4]=false New IRS allows you to keep holding rotate
end
end
function Player:act_rot180()
@@ -290,7 +290,7 @@ function Player:act_rot180()
self.ctrlCount=self.ctrlCount+2
self:spin(2)
self:_triggerEvent('hook_rotate',2)
- self.keyPressing[5]=false
+ -- self.keyPressing[5]=false New IRS allows you to keep holding rotate
end
end
function Player:act_hardDrop()
@@ -344,7 +344,7 @@ function Player:act_hold()
if not self.control then return end
if self.cur then
if self:hold() then
- self.keyPressing[8]=false
+ -- self.keyPressing[8]=false New IRS allows you to keep holding hold
self:_triggerEvent('hook_hold')
end
end
@@ -1173,7 +1173,7 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
elseif pressing[4] then
self:spin(3,true)
end
- pressing[3],pressing[4],pressing[5]=false,false,false
+ -- pressing[3],pressing[4],pressing[5]=false,false,false New IRS allows you to keep holding rotate
end
-- DAS cut
@@ -1500,7 +1500,7 @@ function Player:_popNext(ifhold)-- Pop nextQueue to hand
-- IHS
if not ifhold and pressing[8] and ENV.ihs and self.holdTime>0 then
self:hold(true)
- pressing[8]=false
+ -- pressing[8]=false New IRS allows you to keep holding hold
else
self:resetBlock()
end
From f6d821130c531c567a0270f35cbb47f881cc7761 Mon Sep 17 00:00:00 2001
From: Electra
Date: Thu, 8 Aug 2024 04:56:21 -0400
Subject: [PATCH 03/15] IRS buffering and cancelling via DCD
---
parts/player/player.lua | 86 +++++++++++++++++++++++++++++++++++------
1 file changed, 75 insertions(+), 11 deletions(-)
diff --git a/parts/player/player.lua b/parts/player/player.lua
index 0fa69a9a3..346653418 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -270,6 +270,14 @@ function Player:act_rotRight()
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+1
+ if self.bufferedIRS then
+ -- Ensure IRS is spent before the rotation is processed so it doesn't throw things off.
+ -- This is so that if you for instance, are holding left IRS and then rotate right, it doesn't process
+ -- the left and right rotates in the reverse order.
+ self.keyPressing[3] = false
+ self:resolveIRS()
+ self.keyPressing[3] = true
+ end
self:spin(1)
self:_triggerEvent('hook_rotate',1)
-- self.keyPressing[3]=false New IRS allows you to keep holding rotate
@@ -279,6 +287,14 @@ function Player:act_rotLeft()
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+1
+ if self.bufferedIRS then
+ -- Ensure IRS is spent before the rotation is processed so it doesn't throw things off.
+ -- This is so that if you for instance, are holding left IRS and then rotate right, it doesn't process
+ -- the left and right rotates in the reverse order.
+ self.keyPressing[4] = false
+ self:resolveIRS()
+ self.keyPressing[4] = true
+ end
self:spin(3)
self:_triggerEvent('hook_rotate',3)
-- self.keyPressing[4]=false New IRS allows you to keep holding rotate
@@ -288,6 +304,14 @@ function Player:act_rot180()
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+2
+ if self.bufferedIRS then
+ -- Ensure IRS is spent before the rotation is processed so it doesn't throw things off.
+ -- This is so that if you for instance, are holding left IRS and then rotate right, it doesn't process
+ -- the left and right rotates in the reverse order.
+ self.keyPressing[5] = false
+ self:resolveIRS()
+ self.keyPressing[5] = true
+ end
self:spin(2)
self:_triggerEvent('hook_rotate',2)
-- self.keyPressing[5]=false New IRS allows you to keep holding rotate
@@ -300,6 +324,10 @@ function Player:act_hardDrop()
if self.lastPiece.autoLock and self.frameRun-self.lastPiece.frameself.ghoY then
self:createDropFX()
self.curY=self.ghoY
@@ -1162,16 +1190,12 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
-- IRS
if self.gameEnv.irs then
- if pressing[5] then
- self:spin(2,true)
- elseif pressing[3] then
- if pressing[4] then
- self:spin(2,true)
- else
- self:spin(1,true)
- end
- elseif pressing[4] then
- self:spin(3,true)
+ -- If DAS cut delay is enabled and we aren't currently dying, buffer the input instead.
+ if self.gameEnv.dascut>0 and not self:ifoverlap(C.bk, self.curX, self.curY) then
+ self.bufferedIRS = true
+ self.bufferedDelay = self.gameEnv.dascut
+ else
+ self:resolveIRS()
end
-- pressing[3],pressing[4],pressing[5]=false,false,false New IRS allows you to keep holding rotate
end
@@ -1499,7 +1523,14 @@ function Player:_popNext(ifhold)-- Pop nextQueue to hand
-- IHS
if not ifhold and pressing[8] and ENV.ihs and self.holdTime>0 then
- self:hold(true)
+ if self.gameEnv.dascut>0 and not self:willDieWith(self.cur) then
+ self.bufferedIRS = true
+ self.bufferedIHS = true
+ self.bufferedDelay = self.gameEnv.dascut
+ self:resetBlock()
+ else
+ self:resolveIRS()
+ end
-- pressing[8]=false New IRS allows you to keep holding hold
else
self:resetBlock()
@@ -2447,6 +2478,27 @@ local function _updateFX(P,dt)
end
end
end
+
+function Player:resolveIRS()
+ if self.bufferedIHS then
+ self:hold(true)
+ self.bufferedIHS = false
+ end
+ self.bufferedIRS = false
+ local pressing = self.keyPressing
+ if pressing[5] then
+ self:act_rot180()
+ elseif pressing[3] then
+ if pressing[4] then
+ self:act_rot180()
+ else
+ self:act_rotRight()
+ end
+ elseif pressing[4] then
+ self:act_rotLeft()
+ end
+end
+
local function update_alive(P,dt)
local ENV=P.gameEnv
@@ -2504,6 +2556,18 @@ local function update_alive(P,dt)
end
end
end
+
+ -- Buffer IRS after DAS cut delay has elapsed.
+ -- The purpose of this is to allow the player to release their rotate key during the DAS cut delay, which will
+ -- allow them to avoid accidentally using IRS.
+ if P.bufferedDelay then
+ P.bufferedDelay = P.bufferedDelay - 1
+ if P.bufferedDelay == 0 then
+ if P.bufferedIRS then
+ P:resolveIRS()
+ end
+ end
+ end
-- Moving pressed
if P.movDir~=0 then
From 2562d513ae1e015b725b2d322bbb35297d9ea170 Mon Sep 17 00:00:00 2001
From: Electra
Date: Thu, 8 Aug 2024 20:47:46 -0400
Subject: [PATCH 04/15] Fixed a crash with instant IHS
---
parts/player/player.lua | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/parts/player/player.lua b/parts/player/player.lua
index 346653418..1c64ec14f 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -1195,7 +1195,17 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
self.bufferedIRS = true
self.bufferedDelay = self.gameEnv.dascut
else
- self:resolveIRS()
+ if pressing[5] then
+ self:act_rot180()
+ elseif pressing[3] then
+ if pressing[4] then
+ self:act_rot180()
+ else
+ self:act_rotRight()
+ end
+ elseif pressing[4] then
+ self:act_rotLeft()
+ end
end
-- pressing[3],pressing[4],pressing[5]=false,false,false New IRS allows you to keep holding rotate
end
@@ -1529,7 +1539,7 @@ function Player:_popNext(ifhold)-- Pop nextQueue to hand
self.bufferedDelay = self.gameEnv.dascut
self:resetBlock()
else
- self:resolveIRS()
+ self:hold(true)
end
-- pressing[8]=false New IRS allows you to keep holding hold
else
@@ -2484,6 +2494,7 @@ function Player:resolveIRS()
self:hold(true)
self.bufferedIHS = false
end
+
self.bufferedIRS = false
local pressing = self.keyPressing
if pressing[5] then
From 84171227a2f842cd0229e2f2f7f8b876968d528b Mon Sep 17 00:00:00 2001
From: Electra
Date: Thu, 29 Aug 2024 16:55:26 -0400
Subject: [PATCH 05/15] IRS changes to allow further flexibility in controls
and game modes
---
parts/eventsets/classic_h.lua | 2 +-
parts/eventsets/classic_l.lua | 2 +-
parts/eventsets/classic_u.lua | 2 +-
parts/eventsets/master_g.lua | 2 +-
parts/gameFuncs.lua | 6 +-
parts/gameTables.lua | 2 +-
parts/language/dict_en.lua | 5 ++
parts/language/lang_en.lua | 1 +
parts/player/gameEnv0.lua | 3 +-
parts/player/player.lua | 113 ++++++++++++++++++++++---------
parts/scenes/setting_control.lua | 21 +++---
version.lua | 2 +-
12 files changed, 109 insertions(+), 52 deletions(-)
diff --git a/parts/eventsets/classic_h.lua b/parts/eventsets/classic_h.lua
index 0cd353e56..83fb3196c 100644
--- a/parts/eventsets/classic_h.lua
+++ b/parts/eventsets/classic_h.lua
@@ -26,7 +26,7 @@ end
return {
das=16,arr=6,
sddas=3,sdarr=3,
- irs=false,ims=false,
+ logicalIRS=false,logicalIMS=false,
drop=3,lock=3,
wait=10,fall=25,
freshLimit=0,
diff --git a/parts/eventsets/classic_l.lua b/parts/eventsets/classic_l.lua
index 1b603412e..893972bd7 100644
--- a/parts/eventsets/classic_l.lua
+++ b/parts/eventsets/classic_l.lua
@@ -26,7 +26,7 @@ end
return {
das=16,arr=6,
sddas=2,sdarr=2,
- irs=false,ims=false,
+ logicalIRS=false,logicalIMS=false,
drop=2,lock=2,
wait=10,fall=25,
freshLimit=0,
diff --git a/parts/eventsets/classic_u.lua b/parts/eventsets/classic_u.lua
index f6c9d14e8..72cfc184d 100644
--- a/parts/eventsets/classic_u.lua
+++ b/parts/eventsets/classic_u.lua
@@ -7,7 +7,7 @@ end
return {
das=16,arr=6,
sddas=1,sdarr=1,
- irs=false,ims=false,
+ logicalIRS=false,logicalIMS=false,
drop=1,lock=1,
wait=10,fall=25,
freshLimit=0,
diff --git a/parts/eventsets/master_g.lua b/parts/eventsets/master_g.lua
index 1f869da51..2fcc12b8d 100644
--- a/parts/eventsets/master_g.lua
+++ b/parts/eventsets/master_g.lua
@@ -149,7 +149,7 @@ return {
keyCancel={10,11,12,14,15,16,17,18,19,20},
das=16,arr=1,
minsdarr=1,
- ihs=true,irs=true,ims=false,
+ logicalIRS=true,logicalIHS=true,logicalIMS=false,
mesDisp=function(P)
local D=P.modeData
GC.setColor(1,1,1,1)
diff --git a/parts/gameFuncs.lua b/parts/gameFuncs.lua
index 8cd0dd56d..73ca7584d 100644
--- a/parts/gameFuncs.lua
+++ b/parts/gameFuncs.lua
@@ -975,7 +975,7 @@ end
do-- function dumpBasicConfig()
local gameSetting={
-- Tuning
- 'das','arr','dascut','dropcut','sddas','sdarr',
+ 'das','arr','dascut','irscut','dropcut','sddas','sdarr',
'ihs','irs','ims','RS',
-- System
@@ -1021,7 +1021,7 @@ do-- function resetGameData(args)
end
local gameSetting={
-- Tuning
- 'das','arr','dascut','dropcut','sddas','sdarr',
+ 'das','arr','dascut','irscut','dropcut','sddas','sdarr',
'ihs','irs','ims','RS',
-- System
@@ -1236,7 +1236,7 @@ do-- function pressKey(k)
end
do-- SETXXX(k) & ROOMXXX(k)
local warnList={
- 'das','arr','dascut','dropcut','sddas','sdarr',
+ 'das','arr','dascut','irscut','dropcut','sddas','sdarr',
'ihs','irs','ims','RS',
'frameMul','highCam',
'VKSwitch','VKIcon','VKTrack','VKDodge',
diff --git a/parts/gameTables.lua b/parts/gameTables.lua
index 7543b25e4..3700bd582 100644
--- a/parts/gameTables.lua
+++ b/parts/gameTables.lua
@@ -605,7 +605,7 @@ do-- Userdata tables
SETTING={-- Settings
-- Tuning
das=10,arr=2,
- dascut=0,dropcut=0,
+ dascut=0,irscut=6,dropcut=0,
sddas=0,sdarr=2,
ihs=true,irs=true,ims=true,
holdMode='hold',
diff --git a/parts/language/dict_en.lua b/parts/language/dict_en.lua
index 213f114a2..21b9a6979 100644
--- a/parts/language/dict_en.lua
+++ b/parts/language/dict_en.lua
@@ -865,6 +865,11 @@ FNNS and {"Support 3",
"term",
"A special delay applied to DAS when a new block is spawned. When this happens, a small delay is added before the DAS starts timing, so that a piece doesn't start moving immediately when a sideways direction key is pressed.\nOther games may have similar mechanisms, but they may work differently.",
},
+ {"IRS cut",
+ "irscut icd",
+ "term",
+ "A special delay applied to IRS when a new block is spawned. When entry delay is disabled, this will delay IRS from being applied, allowing you to release the rotation button in the period to avoid a misdrop.",
+ },
{"Auto-lock cut",
"autolockcut mdcut",
"term",
diff --git a/parts/language/lang_en.lua b/parts/language/lang_en.lua
index 9c82f4d5a..b44043960 100644
--- a/parts/language/lang_en.lua
+++ b/parts/language/lang_en.lua
@@ -622,6 +622,7 @@ C. Gamepad
das="DAS",arr="ARR",
dascut="DAS Cut",
+ irscut="IRS Cut",
dropcut="Auto-lock Cut",
sddas="Soft Drop DAS",sdarr="Soft Drop ARR",
ihs="Initial Hold",
diff --git a/parts/player/gameEnv0.lua b/parts/player/gameEnv0.lua
index e057d0ae8..2d237f546 100644
--- a/parts/player/gameEnv0.lua
+++ b/parts/player/gameEnv0.lua
@@ -1,8 +1,9 @@
return {
das=10,arr=2,
- dascut=0,dropcut=0,
+ dascut=0,irscut=6,dropcut=0,
sddas=2,sdarr=2,
ihs=true,irs=true,ims=true,
+ logicalIHS=true,logicalIRS=true,logicalIMS=true,
ghostType='gray',
block=true,ghost=.3,center=1,
diff --git a/parts/player/player.lua b/parts/player/player.lua
index 1fbe1abda..08e0e1817 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -280,7 +280,11 @@ function Player:act_rotRight()
end
self:spin(1)
self:_triggerEvent('hook_rotate',1)
- -- self.keyPressing[3]=false New IRS allows you to keep holding rotate
+
+ -- Disable held inputs if IRS is off
+ if not self.gameEnv.irs then
+ self.keyPressing[3]=false
+ end
end
end
function Player:act_rotLeft()
@@ -297,7 +301,10 @@ function Player:act_rotLeft()
end
self:spin(3)
self:_triggerEvent('hook_rotate',3)
- -- self.keyPressing[4]=false New IRS allows you to keep holding rotate
+ -- Disable held inputs if IRS is off
+ if not self.gameEnv.irs then
+ self.keyPressing[4]=false
+ end
end
end
function Player:act_rot180()
@@ -314,7 +321,10 @@ function Player:act_rot180()
end
self:spin(2)
self:_triggerEvent('hook_rotate',2)
- -- self.keyPressing[5]=false New IRS allows you to keep holding rotate
+ -- Disable held inputs if IRS is off
+ if not self.gameEnv.irs then
+ self.keyPressing[5]=false
+ end
end
end
function Player:act_hardDrop()
@@ -372,7 +382,10 @@ function Player:act_hold()
if not self.control then return end
if self.cur then
if self:hold() then
- -- self.keyPressing[8]=false New IRS allows you to keep holding hold
+ -- Disable held inputs if IHS is off
+ if not self.gameEnv.ihs then
+ self.keyPressing[8]=false
+ end
self:_triggerEvent('hook_hold')
end
end
@@ -1192,35 +1205,59 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
self.curY=y
self.minY=y+sc[1]
- local pressing=self.keyPressing
- -- IMS
- if self.gameEnv.ims and (pressing[1] and self.movDir==-1 or pressing[2] and self.movDir==1) and self.moving>=self.gameEnv.das then
- local x=self.curX+self.movDir
- if not self:ifoverlap(C.bk,x,y) then
- self.curX=x
- end
- end
+ local ENV = self.gameEnv
- -- IRS
- if self.gameEnv.irs then
- -- If DAS cut delay is enabled and we aren't currently dying, buffer the input instead.
- if self.gameEnv.dascut>0 and not self:ifoverlap(C.bk, self.curX, self.curY) then
- self.bufferedIRS = true
- self.bufferedDelay = self.gameEnv.dascut
- else
- if pressing[5] then
+ -- In the game settings, there are user-set control flags for irs,irs,ims
+ -- These control in what way the user can buffer their rotate/hold/move inputs.
+ -- (If enabled, they may hold these inputs from the previous piece instead of just Entry Delay)
+
+ -- And mode-set flags for logicalIRS,logicalIHS,logicalIMS
+ -- These control whether IRS/IHS/IMS are effective in modifying what you can do.
+ -- (For instance, changing your piece's spawn position in 20g, or saving you from a death).
+ -- If logical IRS is disabled, the player may still IRS, but it will just buffer their input,
+ -- not actually allowing them to survive in a way they could not without.
+
+ local pressing=self.keyPressing
+ -- IMS is enabled only when logicalIMS is enabled, because otherwise, it's just faster DAS.
+ if ENV.logicalIMS and (pressing[1] and self.movDir==-1 or pressing[2] and self.movDir==1) and self.moving>=self.gameEnv.das then
+ -- To avoid a top-out
+ if self:ifoverlap(C.bk, self.curX, self.curY) then
+ -- Always perform the shift, since you're topped out anyway
+ self.curX = self.curX + self.movDir
+ elseif ENV.wait > 0 and ENV.ims then
+ -- Otherwise, only check IMS if it's enabled and you're in a mode with entry delay (20g)
+ local x=self.curX+self.movDir
+ if not self:ifoverlap(C.bk,x,y) then
+ self.curX=x
+ end
+ end
+ end
+
+ if not ENV.logicalIRS then
+ -- If logical IRS is disabled, all IRS inputs will be buffered to prevent survival.
+ self.bufferedIRS = true
+ self.bufferedDelay = ENV.irscut
+ elseif ENV.wait==0 and ENV.irscut>0 and not self:ifoverlap(C.bk, self.curX, self.curY) then
+ -- If IRS cut delay is enabled and we aren't currently dying, buffer the input instead.
+ self.bufferedIRS = true
+ self.bufferedDelay = self.gameEnv.irscut
+ else
+ -- If we're currently dying or in an entry-delay mode (20g), perform the rotation right away.
+ if pressing[5] then
+ self:act_rot180()
+ elseif pressing[3] then
+ if pressing[4] then
self:act_rot180()
- elseif pressing[3] then
- if pressing[4] then
- self:act_rot180()
- else
- self:act_rotRight()
- end
- elseif pressing[4] then
- self:act_rotLeft()
+ else
+ self:act_rotRight()
end
+ elseif pressing[4] then
+ self:act_rotLeft()
end
- -- pressing[3],pressing[4],pressing[5]=false,false,false New IRS allows you to keep holding rotate
+ end
+ -- Disable held inputs if IRS is off
+ if not self.gameEnv.irs then
+ pressing[3],pressing[4],pressing[5]=false,false,false
end
-- DAS cut
@@ -1545,16 +1582,26 @@ function Player:_popNext(ifhold)-- Pop nextQueue to hand
local pressing=self.keyPressing
-- IHS
- if not ifhold and pressing[8] and ENV.ihs and self.holdTime>0 then
- if self.gameEnv.dascut>0 and not self:willDieWith(self.cur) then
+ if not ifhold and pressing[8] and self.holdTime>0 then
+ if not ENV.logicalIHS then
+ -- If logical IHS is disabled, all IHS inputs will be buffered to prevent survival.
self.bufferedIRS = true
self.bufferedIHS = true
- self.bufferedDelay = self.gameEnv.dascut
+ self.bufferedDelay = ENV.irscut
+ elseif ENV.wait==0 and ENV.irscut>0 and not self:willDieWith(self.cur) then
+ -- If IRS cut delay is enabled and we're not currently dying, buffer the input instead.
+ self.bufferedIRS = true
+ self.bufferedIHS = true
+ self.bufferedDelay = ENV.irscut
self:resetBlock()
else
+ -- If we're currently dying or in an entry-delay mode (20g), perform the hold immediately.
self:hold(true)
end
- -- pressing[8]=false New IRS allows you to keep holding hold
+ -- Disable held inputs if IHS is off
+ if not ENV.ihs then
+ pressing[8]=false
+ end
else
self:resetBlock()
end
diff --git a/parts/scenes/setting_control.lua b/parts/scenes/setting_control.lua
index f8444dd52..512d10ce7 100644
--- a/parts/scenes/setting_control.lua
+++ b/parts/scenes/setting_control.lua
@@ -89,21 +89,24 @@ scene.widgetList={
WIDGET.newText{name='title', x=100, y=50,lim=626,font=70,align='L'},
WIDGET.newText{name='preview', x=520, y=610,font=40,align='R'},
- WIDGET.newSlider{name='das', x=250, y=190,lim=230,w=600,axis={0,20,1},disp=SETval('das'), show=_sliderShow,code=SETsto('das')},
- WIDGET.newSlider{name='arr', x=250, y=260,lim=230,w=525,axis={0,15,1},disp=SETval('arr'), show=_sliderShow,code=SETsto('arr')},
- WIDGET.newSlider{name='sddas', x=250, y=330,lim=230,w=350,axis={0,10,1},disp=SETval('sddas'), show=_sliderShow,code=SETsto('sddas')},
- WIDGET.newSlider{name='sdarr', x=250, y=400,lim=230,w=140,axis={0,4,1}, disp=SETval('sdarr'), show=_sliderShow,code=SETsto('sdarr')},
- WIDGET.newSlider{name='dascut', x=250, y=470,lim=230,w=600,axis={0,20,1},disp=SETval('dascut'), show=_sliderShow,code=SETsto('dascut')},
+ WIDGET.newSlider{name='das', x=250, y=180,lim=230,w=600,axis={0,20,1},disp=SETval('das'), show=_sliderShow,code=SETsto('das')},
+ WIDGET.newSlider{name='arr', x=250, y=240,lim=230,w=525,axis={0,15,1},disp=SETval('arr'), show=_sliderShow,code=SETsto('arr')},
+ WIDGET.newSlider{name='sddas', x=250, y=300,lim=230,w=350,axis={0,10,1},disp=SETval('sddas'), show=_sliderShow,code=SETsto('sddas')},
+ WIDGET.newSlider{name='sdarr', x=250, y=360,lim=230,w=140,axis={0,4,1}, disp=SETval('sdarr'), show=_sliderShow,code=SETsto('sdarr')},
+ WIDGET.newSlider{name='dascut', x=250, y=420,lim=230,w=600,axis={0,20,1},disp=SETval('dascut'), show=_sliderShow,code=SETsto('dascut')},
+ WIDGET.newSlider{name='irscut', x=250, y=480,lim=230,w=600,axis={0,20,1},disp=SETval('irscut'), show=_sliderShow,code=SETsto('irscut')},
WIDGET.newSlider{name='dropcut',x=250, y=540,lim=230,w=300,axis={0,10,1},disp=SETval('dropcut'),show=_sliderShow,code=SETsto('dropcut')},
- WIDGET.newSwitch{name='ihs', x=1100, y=260,lim=300, disp=SETval('ihs'), code=SETrev('ihs')},
- WIDGET.newSwitch{name='irs', x=1100, y=330,lim=300, disp=SETval('irs'), code=SETrev('irs')},
- WIDGET.newSwitch{name='ims', x=1100, y=400,lim=300, disp=SETval('ims'), code=SETrev('ims')},
+
+ WIDGET.newSwitch{name='ihs', x=1100, y=240,lim=300, disp=SETval('ihs'), code=SETrev('ihs')},
+ WIDGET.newSwitch{name='irs', x=1100, y=300,lim=300, disp=SETval('irs'), code=SETrev('irs')},
+ WIDGET.newSwitch{name='ims', x=1100, y=360,lim=300, disp=SETval('ims'), code=SETrev('ims')},
+
WIDGET.newButton{name='reset', x=160, y=640,w=200,h=100,color='lR',font=40,
code=function()
local _=SETTING
_.das,_.arr,_.dascut=10,2,0
_.sddas,_.sdarr=0,2
- _.ihs,_.irs,_.ims=false,false,false
+ _.ihs,_.irs,_.ims,_.irscut=false,false,false,6
end},
WIDGET.newButton{name='back', x=1140, y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
}
diff --git a/version.lua b/version.lua
index 5dca7c19d..579610db3 100644
--- a/version.lua
+++ b/version.lua
@@ -1,7 +1,7 @@
return {
["apkCode"]=1722,
["code"]=1722,
- ["string"]="V0.17.22",
+ ["string"]="V0.17.22 + IRS",
["room"]="ver A-14",
["name"]="暂停 Break",
}
From e6cb527c0e04d616b5cb8521fe590374ae668db9 Mon Sep 17 00:00:00 2001
From: Electra
Date: Thu, 29 Aug 2024 17:11:13 -0400
Subject: [PATCH 06/15] Forgot to save classic_e file
---
parts/eventsets/classic_e.lua | 2 +-
parts/player/player.lua | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/parts/eventsets/classic_e.lua b/parts/eventsets/classic_e.lua
index 980610472..7913e8438 100644
--- a/parts/eventsets/classic_e.lua
+++ b/parts/eventsets/classic_e.lua
@@ -26,7 +26,7 @@ end
return {
das=16,arr=6,
sddas=6,sdarr=6,
- irs=false,ims=false,
+ logicalIRS=false,logicalIMS=false,
drop=6,lock=6,
wait=10,fall=25,
freshLimit=0,
diff --git a/parts/player/player.lua b/parts/player/player.lua
index 08e0e1817..30d347490 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -335,7 +335,7 @@ function Player:act_hardDrop()
SFX.play('drop_cancel',.3)
else
if self.bufferedIRS then
- -- If the player drops quicker than their DAS cut delay, make sure IRS still resolves.
+ -- If the player drops quicker than their IRS cut delay, make sure IRS still resolves.
self:resolveIRS()
end
if self.curY>self.ghoY then
@@ -1240,7 +1240,7 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
elseif ENV.wait==0 and ENV.irscut>0 and not self:ifoverlap(C.bk, self.curX, self.curY) then
-- If IRS cut delay is enabled and we aren't currently dying, buffer the input instead.
self.bufferedIRS = true
- self.bufferedDelay = self.gameEnv.irscut
+ self.bufferedDelay = ENV.irscut
else
-- If we're currently dying or in an entry-delay mode (20g), perform the rotation right away.
if pressing[5] then
@@ -1256,13 +1256,13 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
end
end
-- Disable held inputs if IRS is off
- if not self.gameEnv.irs then
+ if not ENV.irs then
pressing[3],pressing[4],pressing[5]=false,false,false
end
-- DAS cut
- if self.gameEnv.dascut>0 then
- self.moving=self.moving-(self.moving>0 and 1 or -1)*self.gameEnv.dascut
+ if ENV.dascut>0 then
+ self.moving=self.moving-(self.moving>0 and 1 or -1)*ENV.dascut
end
-- Spawn SFX
@@ -2628,12 +2628,12 @@ local function update_alive(P,dt)
end
end
- -- Buffer IRS after DAS cut delay has elapsed.
- -- The purpose of this is to allow the player to release their rotate key during the DAS cut delay, which will
- -- allow them to avoid accidentally using IRS.
+ -- Buffer IRS after IRS cut delay has elapsed.
+ -- The purpose of this is to allow the player to release their rotate key during the IRS cut delay,
+ -- which will allow them to avoid accidentally using IRS.
if P.bufferedDelay then
P.bufferedDelay = P.bufferedDelay - 1
- if P.bufferedDelay == 0 then
+ if P.bufferedDelay <= 0 then
if P.bufferedIRS then
P:resolveIRS()
end
From 11f41b3fee36b651650f3646c279388691d98b09 Mon Sep 17 00:00:00 2001
From: Electra
Date: Thu, 29 Aug 2024 17:15:27 -0400
Subject: [PATCH 07/15] Logical IRS disabled will now buffer on the first frame
instead of the ICD delay if there is entry delay
---
parts/player/player.lua | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/parts/player/player.lua b/parts/player/player.lua
index 30d347490..c28795902 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -1236,7 +1236,10 @@ function Player:resetBlock()-- Reset Block's position and execute I*S
if not ENV.logicalIRS then
-- If logical IRS is disabled, all IRS inputs will be buffered to prevent survival.
self.bufferedIRS = true
- self.bufferedDelay = ENV.irscut
+ self.bufferedDelay = 0
+ if ENV.wait == 0 then
+ self.bufferedDelay = ENV.irscut
+ end
elseif ENV.wait==0 and ENV.irscut>0 and not self:ifoverlap(C.bk, self.curX, self.curY) then
-- If IRS cut delay is enabled and we aren't currently dying, buffer the input instead.
self.bufferedIRS = true
@@ -1587,7 +1590,10 @@ function Player:_popNext(ifhold)-- Pop nextQueue to hand
-- If logical IHS is disabled, all IHS inputs will be buffered to prevent survival.
self.bufferedIRS = true
self.bufferedIHS = true
- self.bufferedDelay = ENV.irscut
+ self.bufferedDelay = 0
+ if ENV.wait == 0 then
+ self.bufferedDelay = ENV.irscut
+ end
elseif ENV.wait==0 and ENV.irscut>0 and not self:willDieWith(self.cur) then
-- If IRS cut delay is enabled and we're not currently dying, buffer the input instead.
self.bufferedIRS = true
From d2e473954a865aeb88242f5955a01073c698c06d Mon Sep 17 00:00:00 2001
From: Electra
Date: Thu, 29 Aug 2024 17:32:19 -0400
Subject: [PATCH 08/15] Removed stack_tec (it has its own branch)
---
parts/eventsets/stack_tec.lua | 66 -----------------------------------
parts/modes/stack_tec.lua | 12 -------
2 files changed, 78 deletions(-)
delete mode 100644 parts/eventsets/stack_tec.lua
delete mode 100644 parts/modes/stack_tec.lua
diff --git a/parts/eventsets/stack_tec.lua b/parts/eventsets/stack_tec.lua
deleted file mode 100644
index 8f796fc16..000000000
--- a/parts/eventsets/stack_tec.lua
+++ /dev/null
@@ -1,66 +0,0 @@
-return {
- fieldH=20,
- task=function(P)
- P.modeData.LineTotal=0
- P.modeData.Zone=0
- P.modeData.FrameZoneStarted=0
- end,
- mesDisp=function(P)
- setFont(60)
- GC.mStr(P.stat.row,63,280)
- setFont(30)
- love.graphics.setColor(0,1,0,1)
- if P.modeData.LineTotal<7 then love.graphics.setColor(1,0,0,1) end
- if P.modeData.LineTotal==28 then love.graphics.setColor(0,1,1,1) end
- if P.modeData.Zone>0 then
- love.graphics.setColor(1,1,0,1)
- if P.stat.frame0 and P.modeData.Zone==0 then
- P.modeData.LineTotal=P.modeData.LineTotal+#P.clearedRow
- if P.modeData.LineTotal>28 then P.modeData.LineTotal=28 end
- end
- if P.modeData.Zone>0 then
- P:garbageRise(21,c,1023)
- P.stat.row=P.stat.row-c
- end
- P:freshMoveBlock('push')
- if P.modeData.Zone>0 and P.stat.frame>P.modeData.FrameZoneStarted+((P.modeData.Zone)*60*5) then
- P.modeData.Zone=0
- P:freshMoveBlock('push')
- TABLE.cut(P.clearedRow)
- P:clearFilledLines(1,P.garbageBeneath)
- end
- end,
-
- fkey1=function(P)
- if P.modeData.LineTotal>=7 then
- P.modeData.Zone=math.floor(P.modeData.LineTotal/7)
- P.modeData.LineTotal=0
- P.modeData.FrameZoneStarted=P.stat.frame
- end
- end,
-
- hook_die=function(P)
- P.modeData.Zone=0
- P:freshMoveBlock('push')
- TABLE.cut(P.clearedRow)
- P:clearFilledLines(1,P.garbageBeneath)
- end,
-}
\ No newline at end of file
diff --git a/parts/modes/stack_tec.lua b/parts/modes/stack_tec.lua
deleted file mode 100644
index 9b8c4f0d7..000000000
--- a/parts/modes/stack_tec.lua
+++ /dev/null
@@ -1,12 +0,0 @@
-return {
- env={
- drop=60,lock=60,
- wait=6,--fall=0,
- hang=15,
- pushSpeed=1e99,
- garbageSpeed=1e99,
- seqData={1,2,3,4,5,6,7},
- eventSet='stack_tec',
- bg='blockrain',bgm='there',
- },
-}
From fa897183999b20f8b7abc52c09a6245b6995a3de Mon Sep 17 00:00:00 2001
From: electraminer
Date: Mon, 7 Oct 2024 23:09:58 -0400
Subject: [PATCH 09/15] Update main.yml to allow more version strings
---
.github/workflows/main.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e03b8ae07..35e52c4ee 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -36,7 +36,7 @@ jobs:
local version = require "version"
os.execute('echo "app-name=Techmino" >> $GITHUB_OUTPUT')
os.execute('echo "version-name=' .. version.name .. '" >> $GITHUB_OUTPUT')
- os.execute('echo "version-string=' .. version.string:gsub("%a", "") .. '" >> $GITHUB_OUTPUT')
+ os.execute('echo "version-string=' .. version.string:gsub(" ", "_") .. '" >> $GITHUB_OUTPUT')
os.execute('echo "version-code=' .. tostring(version.code) .. '" >> $GITHUB_OUTPUT')
local f = io.open("updateLog.txt", 'r')
From bea81c6bc9616b104615f3de35849ce8bedf9704 Mon Sep 17 00:00:00 2001
From: electraminer
Date: Tue, 8 Oct 2024 20:19:43 -0400
Subject: [PATCH 10/15] Update main.yml to be under a different org
---
.github/workflows/main.yml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 35e52c4ee..9fb7ac9c4 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -161,10 +161,10 @@ jobs:
import re
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
if "${{ env.BUILD_TYPE }}" == "dev":
- f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '.snapshot\n')
+ f.write('bundle-id=org.electra.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '.snapshot\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '-', '${{ needs.get-info.outputs.app-name }}') + '_Snapshot\n')
else:
- f.write('bundle-id=org.f26_studio.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
+ f.write('bundle-id=org.electra.' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '-', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package
uses: actions/download-artifact@v3
@@ -234,7 +234,7 @@ jobs:
product_name = re.sub(r'[^A-Za-z0-9]+', '-', '${{ needs.get-info.outputs.app-name }}').strip('-').lower()
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
- f.write('bundle-id=org.26f-studio.' + product_name + '\n')
+ f.write('bundle-id=org.electra.' + product_name + '\n')
f.write('product-name=' + product_name + '\n')
- name: Download core love package
uses: actions/download-artifact@v3
@@ -316,7 +316,7 @@ jobs:
import os
import re
with open(os.getenv('GITHUB_OUTPUT'), 'a') as f:
- f.write('bundle-id=org.26f-studio.techmino\n')
+ f.write('bundle-id=org.electra.techmino\n')
f.write('product-name=' + re.sub(r'[^A-Za-z0-9]+', '_', '${{ needs.get-info.outputs.app-name }}') + '\n')
- name: Download core love package
uses: actions/download-artifact@v3
@@ -337,7 +337,7 @@ jobs:
with:
app-name: ${{ needs.get-info.outputs.app-name }}
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
- copyright: "Copyright © 2019-2023 26F-Studio. Some Rights Reserved."
+ copyright: "Copyright © 2019-2023 electra. Some Rights Reserved."
icon-path: ./.github/build/macOS/${{ env.BUILD_TYPE }}/icon.icns
love-package: ${{ env.CORE_LOVE_PACKAGE_PATH }}
libs-path: ./ColdClear/universal/
From 6847a3b27bf33d3363cb782d9431bb415b22a445 Mon Sep 17 00:00:00 2001
From: Electra
Date: Tue, 8 Oct 2024 20:20:37 -0400
Subject: [PATCH 11/15] Fixed action system loading bug
---
parts/player/init.lua | 86 +++++++++++++++++++++----------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/parts/player/init.lua b/parts/player/init.lua
index cafd04ec2..900a0fdb6 100644
--- a/parts/player/init.lua
+++ b/parts/player/init.lua
@@ -236,7 +236,17 @@ local function _loadRemoteEnv(P,confStr)-- Load gameEnv
end
end
end
-local tableNeedMerge={
+local function _mergeFuncTable(f,L)
+ if type(f)=='function' then
+ ins(L,f)
+ elseif type(f)=='table' then
+ for i=1,#f do
+ ins(L,f[i])
+ end
+ end
+ return L
+end
+local tableNeedMerge = {
'task',
'mesDisp',
'hook_left',
@@ -250,63 +260,53 @@ local tableNeedMerge={
'hook_spawn',
'hook_hold',
'hook_die',
- 'extraEvent',
+ 'hook_atk_calculation',
+ 'task',
}
-for _,k in next,tableNeedMerge do gameEnv0[k]={} end
-local function _mergeFuncTable(f,L)
- if type(f)=='function' then
- ins(L,f)
- elseif type(f)=='table' then
- for i=1,#f do
- ins(L,f[i])
- end
- end
- return L
-end
local function _applyGameEnv(P)-- Finish gameEnv processing
local ENV=P.gameEnv
- -- Create event tables
+ -- Apply events
for i=1,#tableNeedMerge do
ENV[tableNeedMerge[i]]=_mergeFuncTable(ENV[tableNeedMerge[i]],{})
end
-- Apply eventSet
- while true do
- if not (ENV.eventSet and ENV.eventSet~="X") then
- break
- end
- if type(ENV.eventSet)~='string' then
- MES.new('warn',"Wrong event set type: "..type(ENV.eventSet))
- break
- end
- local eventSet=require('parts.eventsets.'..ENV.eventSet)
- if not eventSet then
- MES.new('warn',"No event set called: "..ENV.eventSet)
- break
- end
- for k,v in next,eventSet do
- if k=='extraEventHandler' then
- for ev,handler in next,v do
- if ENV.extraEventHandler[ev] then
- local prevHandler=ENV.extraEventHandler[ev]
- ENV.extraEventHandler[ev]=function(...)
- prevHandler(...)
- handler(...)
+ if ENV.eventSet and ENV.eventSet~="X" then
+ if type(ENV.eventSet)=='string' then
+ local eventSet=require('parts.eventsets.'..ENV.eventSet)
+ if eventSet then
+ for k,v in next,eventSet do
+ if k == "extraEvent" then
+ for _,ev in ipairs(v) do
+ table.insert(ENV.extraEvent, ev)
end
+ elseif k == "extraEventHandler" then
+ for ev,handler in pairs(v) do
+ if ENV.extraEventHandler[ev] then
+ local prevHandler = ENV.extraEventHandler[ev]
+ ENV.extraEventHandler[ev] = function(...)
+ prevHandler(...)
+ handler(...)
+ end
+ else
+ ENV.extraEventHandler[ev] = handler
+ end
+ end
+ elseif TABLE.find(tableNeedMerge,k) then
+ _mergeFuncTable(v,ENV[k])
+ elseif type(v)=='table' then
+ ENV[k]=TABLE.copy(v)
else
- ENV.extraEventHandler[ev]=handler
+ ENV[k]=v
end
end
- elseif TABLE.find(tableNeedMerge,k) then
- _mergeFuncTable(v,ENV[k])
- elseif type(v)=='table' then
- ENV[k]=TABLE.copy(v)
else
- ENV[k]=v
+ MES.new('warn',"No event set called: "..ENV.eventSet)
end
+ else
+ MES.new('warn',"Wrong event set type: "..type(ENV.eventSet))
end
- break
end
P._20G=ENV.drop==0
@@ -512,4 +512,4 @@ function PLY.newPlayer(id,mini,p)
_applyGameEnv(P)
end
----------------------------------------------------
-return PLY
+return PLY
\ No newline at end of file
From ab6424838640ddb09884b6e8feea186c5bb7abbd Mon Sep 17 00:00:00 2001
From: Electra
Date: Tue, 8 Oct 2024 21:09:25 -0400
Subject: [PATCH 12/15] Fixed passthrough
---
parts/player/gameEnv0.lua | 6 +++---
parts/player/player.lua | 45 +++++++++++++++++++++++++++++++++------
version.lua | 2 +-
3 files changed, 43 insertions(+), 10 deletions(-)
diff --git a/parts/player/gameEnv0.lua b/parts/player/gameEnv0.lua
index 2d237f546..c1fc068cf 100644
--- a/parts/player/gameEnv0.lua
+++ b/parts/player/gameEnv0.lua
@@ -65,11 +65,11 @@ return {
-- Some Events are registered in player/init.lua, see "tableNeedMerge"
extraEvent={
- {'attack',4},
+ {'attack',5},
},
extraEventHandler={
- attack=function(P,P2,...)
- P:beAttacked(P2,...)
+ attack=function(P,source,...)
+ P:beAttacked(source,...)
end,
},
diff --git a/parts/player/player.lua b/parts/player/player.lua
index c28795902..757c9e137 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -909,12 +909,45 @@ function Player:ifoverlap(bk,x,y)
end
end
function Player:attack(R,send,time,line)
- self:extraEvent('attack',R.sid,send,time,line)
-end
-function Player:beAttacked(P2,sid,send,time,line)
- if self==P2 or self.sid~=sid then return end
- self:receive(P2,send,time,line)
- P2:createBeam(self,send)
+ local sid = R.sid
+ -- Add the attack to the list of in-transit attacks.
+ -- These attacks will be able to cancel with incoming attacks that cross them.
+ if not self.inTransitAttacks then
+ self.inTransitAttacks = {}
+ end
+ if not self.inTransitAttacks[sid] then
+ self.inTransitAttacks[sid] = {seenAttacks = 0}
+ end
+ table.insert(self.inTransitAttacks[sid], {send=send, time=time, line=line})
+ -- Send the attack
+ -- We also send the number of seen attacks from this player.
+ -- This allows that player to know which attacks are still in transit, and which have already arrived.
+ -- This is because... if a player already saw an attack before sending this one, the attacks did not cross.
+ -- But if they didn't see the attack, then the attacks must have crossed (and should cancel each other)
+ self:extraEvent('attack',sid,send,time,line,self.inTransitAttacks[sid].seenAttacks)
+end
+function Player:beAttacked(source,target_sid,send,time,line,seenCount)
+ -- Only recieve the attack if you are the target.
+ if self==source or self.sid~=target_sid then return end
+
+ if not self.inTransitAttacks then
+ self.inTransitAttacks = {}
+ end
+ if not self.inTransitAttacks[source.sid] then
+ self.inTransitAttacks[source.sid] = {seenAttacks = 0}
+ end
+ -- Increment the number of seen attacks from that player.
+ self.inTransitAttacks[source.sid].seenAttacks = self.inTransitAttacks[source.sid].seenAttacks + 1
+ -- Block against any in-transit attacks before recieving (this prevents passhtrough)
+ for i=seenCount+1,#self.inTransitAttacks[source.sid] do
+ local atk = self.inTransitAttacks[source.sid][i]
+ local cancel = MATH.min(atk.send, send)
+ atk.send = atk.send - reduction
+ send = send - reduction
+ end
+
+ self:receive(source,send,time,line)
+ source:createBeam(self,send)
end
function Player:receive(A,send,time,line)
self.lastRecv=A
diff --git a/version.lua b/version.lua
index 579610db3..6c0db8791 100644
--- a/version.lua
+++ b/version.lua
@@ -1,7 +1,7 @@
return {
["apkCode"]=1722,
["code"]=1722,
- ["string"]="V0.17.22 + IRS",
+ ["string"]="V0.17.22 + PASSTHROUGHFIXv0.1beta",
["room"]="ver A-14",
["name"]="暂停 Break",
}
From 9189f7944807d3882995a822d8dce2f9d2f4ea46 Mon Sep 17 00:00:00 2001
From: Electra
Date: Tue, 8 Oct 2024 21:12:16 -0400
Subject: [PATCH 13/15] Forgot to rename a variable
---
parts/player/player.lua | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/parts/player/player.lua b/parts/player/player.lua
index 757c9e137..6704956fc 100644
--- a/parts/player/player.lua
+++ b/parts/player/player.lua
@@ -942,8 +942,8 @@ function Player:beAttacked(source,target_sid,send,time,line,seenCount)
for i=seenCount+1,#self.inTransitAttacks[source.sid] do
local atk = self.inTransitAttacks[source.sid][i]
local cancel = MATH.min(atk.send, send)
- atk.send = atk.send - reduction
- send = send - reduction
+ atk.send = atk.send - cancel
+ send = send - cancel
end
self:receive(source,send,time,line)
From 3f12e1cdcf44e0d46c753e5350ac01886743ed64 Mon Sep 17 00:00:00 2001
From: Electra
Date: Tue, 8 Oct 2024 21:24:40 -0400
Subject: [PATCH 14/15] It works!
---
version.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.lua b/version.lua
index 6c0db8791..030813934 100644
--- a/version.lua
+++ b/version.lua
@@ -1,7 +1,7 @@
return {
["apkCode"]=1722,
["code"]=1722,
- ["string"]="V0.17.22 + PASSTHROUGHFIXv0.1beta",
+ ["string"]="V0.17.22 + PASSTHROUGHFIXv1.0",
["room"]="ver A-14",
["name"]="暂停 Break",
}
From ee9de2cc98690559cf17248db2f1874451f0fb39 Mon Sep 17 00:00:00 2001
From: Electra
Date: Tue, 19 Nov 2024 10:02:19 -0500
Subject: [PATCH 15/15] removed special version tag
---
version.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/version.lua b/version.lua
index 030813934..5dca7c19d 100644
--- a/version.lua
+++ b/version.lua
@@ -1,7 +1,7 @@
return {
["apkCode"]=1722,
["code"]=1722,
- ["string"]="V0.17.22 + PASSTHROUGHFIXv1.0",
+ ["string"]="V0.17.22",
["room"]="ver A-14",
["name"]="暂停 Break",
}