-
Notifications
You must be signed in to change notification settings - Fork 73
Add "Classic Beyond" mode #778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Not-A-Normal-Robot
wants to merge
5
commits into
26F-Studio:main
Choose a base branch
from
Not-A-Normal-Robot:patch-32
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b41fbe2
finish up coding, haven't translated
Not-A-Normal-Robot 3d7e0a1
finish classic beyond
Not-A-Normal-Robot 1335d27
finish classic beyond
Not-A-Normal-Robot 0f5a12c
Merge branch 'patch-32' of https://github.com/Not-A-Normal-Robot/Tech…
Not-A-Normal-Robot 041621a
Use Zframework's PointInPolygon for star border
Not-A-Normal-Robot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| local function GetGravity(lvl) -- note: uses G units, not frames per block | ||
| return math.pow(lvl/4+1,.7) | ||
| end | ||
| local function GetDAS(lvl) -- if these seem random, i was plotting the graph and this seemed like the perfect curve | ||
| return math.max(math.floor(5-math.pow(lvl,0.6)),2) | ||
| end | ||
| local function GetPlayableARE(lvl) -- delay between the piece spawning and it actually starting to fall. subtracted from actual ARE, hence named "Playable ARE" | ||
| return math.min(math.floor(2+math.pow(3*lvl,0.37)),9) | ||
| end | ||
| local function LinesUntilNextLife(lvl,lives) | ||
| if lives>=3 then return math.huge end | ||
| if lvl<2 then | ||
| return math.pow(3,lives+1) | ||
| elseif lvl<5 then | ||
| return math.pow(2,lives+1) | ||
| else | ||
| return math.pow(2,lives) | ||
| end | ||
| end | ||
|
|
||
| return { | ||
| das=5,arr=2, | ||
| sddas=1e99,sdarr=1e99, | ||
| irs=true,ihs=true,-- also IRS and IHS is enabled because we want it to actually be playable after 1.3G | ||
| drop=1e99,lock=1, -- use custom drop method for classic levels | ||
| wait=8,fall=25, | ||
| freshLimit=0, | ||
| fieldH=19, | ||
| nextCount=1, | ||
| holdCount=0, | ||
| RS='C2_sym', -- for basic finesse and a few basic kicks, no up kicks | ||
| sequence=function(P) -- rndES | ||
| local rndGen=P.seqRND | ||
| do --start without bad pieces | ||
| local goodPieces={3,4,5,7} | ||
| P:getNext(goodPieces[rndGen:random(4)]) | ||
| end | ||
| while true do | ||
| while #P.nextQueue<10 do | ||
| P:getNext(rndGen:random(7)) | ||
| end | ||
| coroutine.yield() | ||
| end | ||
| end, | ||
| noTele=true, | ||
| keyCancel={6}, -- 180 enabled so you don't have to break your fingers at 2G | ||
| mesDisp=function(P) | ||
| setFont(60) | ||
| GC.mStr(('%.2f'):format(P.modeData.grav),47,220) | ||
| setFont(30) | ||
| GC.mStr("G",120,252) | ||
| mText(TEXTOBJ.speed,63,290) | ||
| PLY.draw.drawProgress(P.stat.row,P.modeData.target) | ||
| if P.modeData.nextLife<1e99 then | ||
| mText(TEXTOBJ.nextLife,63,20) | ||
| GC.mStr(P.modeData.nextLife,63,40) | ||
| mText(TEXTOBJ.line,63,80) | ||
| end | ||
| if P.modeData.drought>7 then | ||
| if P.modeData.drought<=14 then | ||
| GC.setColor(1,1,1,P.modeData.drought/7-1) | ||
| else | ||
| local gb=P.modeData.drought<=21 and 2-P.modeData.drought/14 or .5 | ||
| GC.setColor(1,gb,gb) | ||
| end | ||
| setFont(50) | ||
| GC.mStr(P.modeData.drought,63,130) | ||
| mDraw(MODES.drought_l.icon,63,200,nil,.5) | ||
| end | ||
| end, | ||
| task=function(P) | ||
| local D=P.modeData | ||
| D.grav=1 | ||
| D.target=10 | ||
| D.nextLife=3 | ||
| D.gravCounter=0 | ||
| D.gravPause=100 | ||
| D.areConv=2 | ||
| D.plare=0 | ||
| local prevY | ||
| while true do | ||
| while not P.cur do coroutine.yield() end | ||
| prevY=P:getCenterY() | ||
| while D.gravPause>0 or D.plare>0 do | ||
| print(D.gravPause,D.plare) | ||
| coroutine.yield() | ||
| if D.gravPause>0 then D.gravPause=D.gravPause-1 end | ||
| if D.plare>0 then D.plare=D.plare-1 end | ||
| if P.cur and P:getCenterY()<prevY then | ||
| D.gravPause,D.plare=0,0 | ||
| break | ||
| end | ||
| end | ||
| coroutine.yield() | ||
| D.gravCounter=D.gravCounter+D.grav | ||
| if P.curY-math.floor(D.gravCounter)<P.ghoY then -- custom gravity logic since the player's gravity logic doesn't support unusual decimal numbers | ||
| P.curY=P.ghoY | ||
| if P.cur then P:drop(true) end | ||
| else | ||
| if P.gameEnv.moveFX then | ||
| for i=1,math.floor(D.gravCounter) do | ||
| P:createMoveFX('down') | ||
| P.curY=P.curY-1 | ||
| end | ||
| else | ||
| P.curY=P.curY-math.floor(D.gravCounter) | ||
| end | ||
| end | ||
| D.gravCounter=D.gravCounter%1 | ||
| end | ||
| end, | ||
| hook_drop=function(P) | ||
| local D,E=P.modeData,P.gameEnv | ||
| D.drought=P.lastPiece.id==7 and 0 or D.drought+1 | ||
| if P.lastPiece.row>0 then | ||
| D.nextLife=D.nextLife-P.lastPiece.row | ||
| if D.nextLife<=0 then | ||
| P.life=P.life+1 | ||
| D.nextLife=D.nextLife+LinesUntilNextLife(math.floor(P.stat.row/10),P.life) | ||
| end | ||
| end | ||
| if P.stat.row>=D.target then | ||
| local lvl=math.floor(P.stat.row/10) | ||
| SFX.play('reach') | ||
| D.grav=GetGravity(lvl) | ||
| D.target=D.target+10 | ||
| D.nextLife=math.min(D.nextLife,LinesUntilNextLife(lvl,P.life)) | ||
| D.areConv=GetPlayableARE(lvl) | ||
| E.das,E.arr=GetDAS(lvl),1 | ||
| E.nextCount=math.min(math.ceil(D.grav),6) | ||
| E.wait=10-D.areConv | ||
| end | ||
| D.plare=D.areConv | ||
| end, | ||
| hook_die=function(P) | ||
| if P.life>0 then | ||
| P.modeData.nextLife=math.min( | ||
| P.modeData.nextLife, | ||
| LinesUntilNextLife(math.floor(P.stat.row/10),P.life-1) | ||
| ) | ||
| local goodPieces={3,4,5,7} | ||
| local id=P.cur.id | ||
| if id==1 or id==2 or id==6 then | ||
| P.cur=P:getBlock(goodPieces[P.seqRND:random(4)]) | ||
| P:resetBlock() | ||
| end | ||
| end | ||
| P.modeData.gravCounter=0 | ||
| P.modeData.gravPause=120 | ||
| end | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| return { | ||
| env={ | ||
| center=0,ghost=0, | ||
| smooth=false, | ||
| face={0,0,2,2,2,0,0}, | ||
| eventSet='classic_beyond', | ||
| bg='rgb',bgm='1980s', | ||
| }, | ||
| slowMark=true, | ||
| score=function(P) return {P.stat.score,P.stat.row} end, | ||
| scoreDisp=function(D) return D[1].." "..D[2].." Lines" end, | ||
| comp=function(a,b) return a[1]>b[1] or a[1]==b[1] and a[2]<b[2] end, | ||
| getRank=function(P) | ||
| local L=P.stat.row | ||
| return | ||
| L>=62 and 5 or | ||
| L>=45 and 4 or | ||
| L>=30 and 3 or | ||
| L>=15 and 2 or | ||
| L>=5 and 1 or | ||
| L>=1 and 0 | ||
| end, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.