Skip to content

Commit

Permalink
删除消四-简单模式
Browse files Browse the repository at this point in the history
整理注释 框架跟进
  • Loading branch information
MrZ626 committed May 21, 2024
1 parent e7994ae commit 2a5daad
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 173 deletions.
2 changes: 1 addition & 1 deletion Zenitha
Submodule Zenitha updated 3 files
+2 −1 init.lua
+ mono.ttf
+ norm.ttf
4 changes: 2 additions & 2 deletions assets/game/acryPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,11 @@ end
-- Other

function AP:decodeScript(line,errMsg)
-- TODO
-- TODO (script)
-- error(errMsg.."No string command '"..cmd.."'")
end
function AP:checkScriptSyntax(cmd,arg,errMsg)
-- TODO
-- TODO (script)
end

--------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions assets/game/brikPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ function BP:decodeScript(line,errMsg)
end
function BP:checkScriptSyntax(cmd,arg,errMsg)
if cmd=='setField' then
-- TODO
-- TODO (script)
elseif cmd=='switchAction' then
assert(self._actions[arg],"Invalid action name '"..arg.."'")
elseif cmd=='clearHold' then
Expand All @@ -1911,7 +1911,7 @@ function BP:checkScriptSyntax(cmd,arg,errMsg)
assert(arg==nil,errMsg.."No arg needed")
elseif cmd=='pushNext' then
if type(arg)=='string' then
-- TODO
-- TODO (script)
elseif type(arg)=='table' then
for i=1,#arg do
assert(Brik.get(arg[i]),errMsg.."Invalid brik id '"..arg[i].."'")
Expand Down
6 changes: 2 additions & 4 deletions assets/game/brikmap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ local tau=MATH.tau
-- Z
local modes={
{pos={10,10,0},name='marathon'},
{pos={10,25,0},name='techrash_easy'},
{pos={25,25,0},name='hypersonic_lo'},
{pos={25,35,0},name='techrash_hard'},
{pos={25,35,0},name='techrash'},
{pos={35,35,0},name='hypersonic_hi'},
{pos={55,55,0},name='hypersonic_ti'},
{pos={35,45,0},name='hypersonic_hd'},
Expand Down Expand Up @@ -83,9 +82,8 @@ local modes_str={} for i=1,#modes do modes_str[modes[i].name]=modes[i] end

local bridgeLinks={
'marathon - dig_practice - sprint_40 - marathon',
'marathon - techrash_easy',
'marathon - hypersonic_lo - hypersonic_hi - hypersonic_ti',
'hypersonic_lo - techrash_hard',
'hypersonic_lo - techrash',
'hypersonic_hi - hypersonic_hd',
'marathon - combo_practice - ac_easy - ac_hard - ac_challenge',
'combo_practice - tsd_practice - tsd_easy - tsd_hard',
Expand Down
4 changes: 2 additions & 2 deletions assets/game/gelaPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1384,11 +1384,11 @@ end
-- Other

function GP:decodeScript(line,errMsg)
-- TODO
-- TODO (script)
-- error(errMsg.."No string command '"..cmd.."'")
end
function GP:checkScriptSyntax(cmd,arg,errMsg)
-- TODO
-- TODO (script)
end

--------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion assets/game/mechanicLib/brik/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ do -- obstacle
end)
end

do -- Cascade
do -- cascade
local function getSolidMat(P)
local F=P.field
local visitedMat={}
Expand Down
7 changes: 1 addition & 6 deletions assets/game/mechanicLib/brik/music.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,12 @@ function music.marathon_afterClear(P)
FMOD.music.setParam('level_marathon_exterior',(md.level or 1)+(md.ascend or 0))
end

function music.techrash_easy_afterClear(P)
if not P.isMain then return true end
FMOD.music.setParam('intensity',MATH.icLerp(4,10,P.modeData.techrash))
end

function music.hypersonic_lo_afterSpawn(P)
if not P.isMain then return true end
FMOD.music.setParam('intensity',MATH.icLerp(100,300,P.modeData.point))
end

function music.techrash_hard_afterClear(P)
function music.techrash_afterClear(P)
if not P.isMain then return true end
FMOD.music.setParam('intensity',MATH.icLerp(4,10,P.modeData.techrash))
end
Expand Down
23 changes: 4 additions & 19 deletions assets/game/mechanicLib/brik/progress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ do -- sprint_dizzy_40
end

do -- marathon
function progress.marathon_afterClear(P)
if not P.isMain then return true end
if P.modeData.stat.clears[4]==16 then
PROGRESS.setModeState('brik_stdMap','techrash_easy')
end
end
function progress.marathon_gameOver(P,reason)
if not P.isMain then return true end
if reason=='AC' then
Expand All @@ -270,20 +264,11 @@ do -- marathon
end
end

do -- techrash_easy
function progress.techrash_easy_afterClear(P)
if not P.isMain then return true end
if P.modeData.stat.clears[4]>=20 then
PROGRESS.setModeState('brik_stdMap','techrash_easy',1)
end
end
end

do -- hypersonic_lo
function progress.hypersonic_lo_afterClear(P)
if not P.isMain then return true end
if P.modeData.stat.clears[4]==36 then
PROGRESS.setModeState('brik_stdMap','techrash_hard')
PROGRESS.setModeState('brik_stdMap','techrash')
end
end
function progress.hypersonic_lo_gameOver(P,reason)
Expand All @@ -295,11 +280,11 @@ do -- hypersonic_lo
end
end

do -- techrash_hard
function progress.techrash_hard_afterClear(P)
do -- techrash
function progress.techrash_afterClear(P)
if not P.isMain then return true end
if P.modeData.stat.clears[4]>=20 then
PROGRESS.setModeState('brik_stdMap','techrash_easy',1)
PROGRESS.setModeState('brik_stdMap','techrash',1)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions assets/game/mechanicLib/brik/sequence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function sequence.bag7(P,d,init)
return rem(d.bag,P:random(#d.bag))
end

function sequence.bag7_p1fromBag7(P,d,init) -- bag8, which the extra piece from another bag
function sequence.bag7_p1fromBag7(P,d,init) -- bag7 + 1 from another bag7
if init then
d.bag={}
d.extra={}
Expand Down Expand Up @@ -125,7 +125,7 @@ function sequence.bag7_sprint(P,d,init) -- bag7, but no early S/Z/O and shufflin
end
end

function sequence.bag7_spreadFirstTo3211(P,d,init) -- bag7, but first bag 3+2+1+1-ly splited into next four bags
function sequence.bag7_spread1stTo3211(P,d,init) -- bag7, but first bag 3+2+1+1-ly splited into next four bags
if init then
d.bag={}
d.victim=TABLE.copy(Tetros)
Expand Down
92 changes: 9 additions & 83 deletions assets/game/mechanicLib/brik/techrashChallenge.lua
Original file line number Diff line number Diff line change
@@ -1,84 +1,6 @@
local gc=love.graphics

---@type Map<Techmino.Mech.Brik>
local techrash={}

function techrash.easy_seqType(P,d,init)
if init then
P.modeData.bagLoop=0
d.l1={}
d.l2={}
return
end
-- Fill list1 (bag7_p0to4_by_bagLoop_fromBag6_noI)
if not d.l1[1] then
P.modeData.bagLoop=P.modeData.bagLoop+1
for i=1,7 do table.insert(d.l1,i) end
for _=1,
P.modeData.bagLoop<=10 and 0 or
P.modeData.bagLoop<=20 and 1 or
P.modeData.bagLoop<=30 and 2 or
P.modeData.bagLoop<=40 and 3 or
4
do
-- Fill list2 (bag6_noI)
if not d.l2[1] then for i=1,6 do table.insert(d.l2,i) end end
table.insert(d.l1,table.remove(d.l2,P:random(#d.l2)))
end
end
return table.remove(d.l1,P:random(#d.l1))
end
function techrash.easy_event_playerInit(P)
P.modeData.techrash=0
P.modeData.minH=0
end
function techrash.easy_event_afterLock(P)
local minH=P.field:getHeight()
for x=1,P.settings.fieldW do
for y=P.field:getHeight(),0,-1 do
if P.field:getCell(x,y) then
if y<minH then minH=y end
break
end
end
end
P.modeData.minH=minH
end
function techrash.easy_event_afterClear(P,clear)
P:triggerEvent('afterLock') -- Force refresh
if P.hand.name=='I' and clear.line>=4 then
P.modeData.techrash=P.modeData.techrash+1
if P.modeData.techrash>1 then
P:playSound('charge',math.min(math.floor((P.modeData.techrash+2.6)^1.2/5.4),11))
end
local HC=P.field:getHeight()==0
if not HC then
HC=true
for x=1,P.settings.fieldW do
if #P:getConnectedCells(x,1)%4~=0 then
HC=false
break
end
end
end
if HC then P:playSound('frenzy') end
P.modeData.bagLoop=math.max(P.modeData.bagLoop-(P.lastMovement.combo-1)*2-(HC and 2 or 0),0)
else
P:finish('PE')
end
end
function techrash.easy_event_drawInField(P)
gc.setColor(1,1,1,.26)
for y=P.modeData.minH+4,19,4 do
gc.rectangle('fill',0,-y*40-2,P.settings.fieldW*40,4)
end
end
function techrash.easy_event_drawOnPlayer(P)
P:drawInfoPanel(-380,-60,160,120)
FONT.set(80) GC.mStr(P.modeData.techrash,-300,-70)
FONT.set(30) GC.mStr(Text.target_techrash,-300,15)
end

local initPower=3
local initSidePower=0
local maxPower=6
Expand All @@ -90,13 +12,13 @@ local infoMeta={__index=function(self,k)
self[k]={charge=0,_charge=0}
return self[k]
end}
function techrash.hard_event_playerInit(P)
function techrash.event_playerInit(P)
P.modeData.techrash=0
P.modeData.chargePower=initPower
P.modeData.sidePower=initSidePower
P.modeData.techrashInfo=setmetatable({},infoMeta)
end
function techrash.hard_event_always(P)
function techrash.event_always(P)
for _,v in next,P.modeData.techrashInfo do
if v._charge~=v.charge then
if v._charge<v.charge then
Expand All @@ -110,7 +32,7 @@ function techrash.hard_event_always(P)
end
end
end
function techrash.hard_event_afterClear(P,clear)
function techrash.event_afterClear(P,clear)
if P.hand.name=='I' and clear.line==4 then
local list=P.modeData.techrashInfo
local x=P.handX
Expand Down Expand Up @@ -145,7 +67,7 @@ function techrash.hard_event_afterClear(P,clear)
P:finish('PE')
end
end
function techrash.hard_event_drawBelowMarks(P)
function techrash.event_drawBelowMarks(P)
local t=love.timer.getTime()
for k,v in next,P.modeData.techrashInfo do
if v._charge>0 or v.dead then
Expand Down Expand Up @@ -174,6 +96,10 @@ function techrash.hard_event_drawBelowMarks(P)
end
end
end
techrash.hard_event_drawOnPlayer=techrash.easy_event_drawOnPlayer
function techrash.event_drawOnPlayer(P)
P:drawInfoPanel(-380,-60,160,120)
FONT.set(80) GC.mStr(P.modeData.techrash,-300,-70)
FONT.set(30) GC.mStr(Text.target_techrash,-300,15)
end

return techrash
2 changes: 1 addition & 1 deletion assets/game/mechanicLib/gela/colorSet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ colorSet.dark ={400,440,014,141,204,144,420,413}
colorSet.greyscale={111,333,777,999,888,555,444,222}

function colorSet.getRandom(P)
-- TODO
-- TODO: reasonable random color
end

return colorSet
2 changes: 1 addition & 1 deletion assets/game/mechanicLib/gela/sequence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ end end
--------------------------------------------------------------
-- Multi

-- TODO
-- TODO: complicate shade puyo sets

return sequence
1 change: 0 additions & 1 deletion assets/game/mode/brik/exterior/marathon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ return {
},
afterClear={
mechLib.brik.music.marathon_afterClear,
mechLib.brik.progress.marathon_afterClear,
},
gameOver=mechLib.brik.progress.marathon_gameOver,
},
Expand Down
22 changes: 22 additions & 0 deletions assets/game/mode/brik/exterior/techrash.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---@type Techmino.Mode
return {
initialize=function()
GAME.newPlayer(1,'brik')
GAME.setMain(1)
playBgm('way')
end,
settings={brik={
seqType='bag7p7p2_power',
event={
playerInit=mechLib.brik.techrashChallenge.event_playerInit,
always=mechLib.brik.techrashChallenge.event_always,
afterClear={
mechLib.brik.techrashChallenge.event_afterClear,
mechLib.brik.music.techrash_afterClear,
mechLib.brik.progress.techrash_afterClear,
},
drawBelowMarks=mechLib.brik.techrashChallenge.event_drawBelowMarks,
drawOnPlayer=mechLib.brik.techrashChallenge.event_drawOnPlayer,
},
}},
}
22 changes: 0 additions & 22 deletions assets/game/mode/brik/exterior/techrash_easy.lua

This file was deleted.

21 changes: 0 additions & 21 deletions assets/game/mode/brik/exterior/techrash_hard.lua

This file was deleted.

Loading

0 comments on commit 2a5daad

Please sign in to comment.